diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-09-28 14:00:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-09-28 14:27:35 +0200 |
commit | a52f443714b5c2a40ed272d8445f4c39220a4b69 (patch) | |
tree | 1338bcfc750ff4d25045b5343c37a11fbe76639c /libavcodec/vc1dec.c | |
parent | b7082d953fda93f7841ffffe7d15a6c3cd15bdee (diff) | |
download | ffmpeg-a52f443714b5c2a40ed272d8445f4c39220a4b69.tar.gz |
avcodec/vc1dec: fix is_intra block vs. mb bug
Fixes CID1194380
There are no vissible differences in the changed fate samples. Only
a tiny number of pixels change by tiny amounts in the frames i checked
If someone has a file that shows a vissible difference, please post it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 72c8327554..8368781385 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -3379,7 +3379,7 @@ static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_ int mb_cbp = v->cbp[s->mb_x - s->mb_stride], block_cbp = mb_cbp >> (block_num * 4), bottom_cbp, mb_is_intra = v->is_intra[s->mb_x - s->mb_stride], - block_is_intra = mb_is_intra >> (block_num * 4), bottom_is_intra; + block_is_intra = mb_is_intra, bottom_is_intra; int idx, linesize = block_num > 3 ? s->uvlinesize : s->linesize, ttblk; uint8_t *dst; @@ -3394,19 +3394,19 @@ static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_ if (block_num > 3) { bottom_cbp = v->cbp[s->mb_x] >> (block_num * 4); - bottom_is_intra = v->is_intra[s->mb_x] >> (block_num * 4); + bottom_is_intra = v->is_intra[s->mb_x]; mv = &v->luma_mv[s->mb_x - s->mb_stride]; mv_stride = s->mb_stride; } else { bottom_cbp = (block_num < 2) ? (mb_cbp >> ((block_num + 2) * 4)) : (v->cbp[s->mb_x] >> ((block_num - 2) * 4)); - bottom_is_intra = (block_num < 2) ? (mb_is_intra >> ((block_num + 2) * 4)) - : (v->is_intra[s->mb_x] >> ((block_num - 2) * 4)); + bottom_is_intra = (block_num < 2) ? mb_is_intra + : v->is_intra[s->mb_x]; mv_stride = s->b8_stride; mv = &s->current_picture.motion_val[0][s->block_index[block_num] - 2 * mv_stride]; } - if (bottom_is_intra & 1 || block_is_intra & 1 || + if (bottom_is_intra || block_is_intra || mv[0][0] != mv[mv_stride][0] || mv[0][1] != mv[mv_stride][1]) { v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq); } else { @@ -3443,7 +3443,7 @@ static av_always_inline void vc1_apply_p_h_loop_filter(VC1Context *v, int block_ int mb_cbp = v->cbp[s->mb_x - 1 - s->mb_stride], block_cbp = mb_cbp >> (block_num * 4), right_cbp, mb_is_intra = v->is_intra[s->mb_x - 1 - s->mb_stride], - block_is_intra = mb_is_intra >> (block_num * 4), right_is_intra; + block_is_intra = mb_is_intra, right_is_intra; int idx, linesize = block_num > 3 ? s->uvlinesize : s->linesize, ttblk; uint8_t *dst; @@ -3458,16 +3458,16 @@ static av_always_inline void vc1_apply_p_h_loop_filter(VC1Context *v, int block_ if (block_num > 3) { right_cbp = v->cbp[s->mb_x - s->mb_stride] >> (block_num * 4); - right_is_intra = v->is_intra[s->mb_x - s->mb_stride] >> (block_num * 4); + right_is_intra = v->is_intra[s->mb_x - s->mb_stride]; mv = &v->luma_mv[s->mb_x - s->mb_stride - 1]; } else { right_cbp = (block_num & 1) ? (v->cbp[s->mb_x - s->mb_stride] >> ((block_num - 1) * 4)) : (mb_cbp >> ((block_num + 1) * 4)); - right_is_intra = (block_num & 1) ? (v->is_intra[s->mb_x - s->mb_stride] >> ((block_num - 1) * 4)) - : (mb_is_intra >> ((block_num + 1) * 4)); + right_is_intra = (block_num & 1) ? v->is_intra[s->mb_x - s->mb_stride] + : mb_is_intra; mv = &s->current_picture.motion_val[0][s->block_index[block_num] - s->b8_stride * 2 - 2]; } - if (block_is_intra & 1 || right_is_intra & 1 || mv[0][0] != mv[1][0] || mv[0][1] != mv[1][1]) { + if (block_is_intra || right_is_intra || mv[0][0] != mv[1][0] || mv[0][1] != mv[1][1]) { v->vc1dsp.vc1_h_loop_filter8(dst, linesize, v->pq); } else { idx = ((right_cbp >> 1) | block_cbp) & 5; // FIXME check @@ -3619,7 +3619,7 @@ static int vc1_decode_p_mb(VC1Context *v) v->vc1dsp.vc1_v_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize); } block_cbp |= 0xF << (i << 2); - block_intra |= 1 << i; + block_intra |= 1; } else if (val) { pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i & 4) ? s->uvlinesize : s->linesize, @@ -3730,7 +3730,7 @@ static int vc1_decode_p_mb(VC1Context *v) v->vc1dsp.vc1_v_overlap(s->dest[dst_idx] + off, i & 4 ? s->uvlinesize : s->linesize); } block_cbp |= 0xF << (i << 2); - block_intra |= 1 << i; + block_intra |= 1; } else if (is_coded[i]) { pat = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, |