mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
VC1: Fix first/last row checks with slices
In some places 0/mb_height were used in place of start_mb_y/end_mb_y. Fixes SA00049, SA00058, SA10091, SA10097, SA10131, SA20021, SA30030 Improves PSNR in SA00054, SA00059, SA00060, SA10096, SA10098, SA20022, SA30031, SA30032, SA40012, SA40013 Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
This commit is contained in:
parent
ad6c7c1b52
commit
1cf82cab08
@ -242,7 +242,7 @@ static void vc1_loop_filter_iblk(VC1Context *v, int pq)
|
||||
}
|
||||
v->vc1dsp.vc1_v_loop_filter16(s->dest[0] + 8*s->linesize, s->linesize, pq);
|
||||
|
||||
if (s->mb_y == s->mb_height-1) {
|
||||
if (s->mb_y == s->end_mb_y-1) {
|
||||
if (s->mb_x) {
|
||||
v->vc1dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq);
|
||||
v->vc1dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq);
|
||||
@ -294,7 +294,7 @@ static void vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
|
||||
v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 8 * s->linesize, s->linesize, pq);
|
||||
}
|
||||
|
||||
if (s->mb_y == s->mb_height) {
|
||||
if (s->mb_y == s->end_mb_y) {
|
||||
if (s->mb_x) {
|
||||
if (s->mb_x >= 2)
|
||||
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize - 16, s->linesize, pq);
|
||||
@ -2329,7 +2329,7 @@ static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_
|
||||
} else {
|
||||
dst = s->dest[0] + (block_num & 1) * 8 + ((block_num & 2) * 4 - 8) * linesize;
|
||||
}
|
||||
if (s->mb_y != s->mb_height || block_num < 2) {
|
||||
if (s->mb_y != s->end_mb_y || block_num < 2) {
|
||||
int16_t (*mv)[2];
|
||||
int mv_stride;
|
||||
|
||||
@ -3095,7 +3095,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
|
||||
if(v->s.loop_filter) vc1_loop_filter_iblk_delayed(v, v->pq);
|
||||
}
|
||||
if (v->s.loop_filter)
|
||||
ff_draw_horiz_band(s, (s->mb_height-1)*16, 16);
|
||||
ff_draw_horiz_band(s, (s->end_mb_y-1)*16, 16);
|
||||
ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END));
|
||||
}
|
||||
|
||||
@ -3218,7 +3218,7 @@ static void vc1_decode_b_blocks(VC1Context *v)
|
||||
s->first_slice_line = 0;
|
||||
}
|
||||
if (v->s.loop_filter)
|
||||
ff_draw_horiz_band(s, (s->mb_height-1)*16, 16);
|
||||
ff_draw_horiz_band(s, (s->end_mb_y-1)*16, 16);
|
||||
ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END));
|
||||
}
|
||||
|
||||
@ -3226,9 +3226,9 @@ static void vc1_decode_skip_blocks(VC1Context *v)
|
||||
{
|
||||
MpegEncContext *s = &v->s;
|
||||
|
||||
ff_er_add_slice(s, 0, 0, s->mb_width - 1, s->mb_height - 1, (AC_END|DC_END|MV_END));
|
||||
ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END));
|
||||
s->first_slice_line = 1;
|
||||
for(s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
|
||||
for(s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) {
|
||||
s->mb_x = 0;
|
||||
ff_init_block_index(s);
|
||||
ff_update_block_index(s);
|
||||
|
Loading…
Reference in New Issue
Block a user