diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-24 13:51:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-24 14:06:07 +0200 |
commit | 3fdd0979acd384f1c006aa5ca097e39a7b735983 (patch) | |
tree | 11600b73ddfc6feeebdfc03fa645669fd50a5cd9 /libavcodec/vc1dec.c | |
parent | 1d0f817b17d72e6e02ab1edd03df57f5a92b32ff (diff) | |
download | ffmpeg-3fdd0979acd384f1c006aa5ca097e39a7b735983.tar.gz |
vc1dec: Fix mv_f shuffling
Avoid a (confusing) memcpy()
Simpler code
Fixes a small number of artifacts in black_screen_VC-1.mkv
and several more artifacts in other videos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 50e47e7784..fc2614696d 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -6008,22 +6008,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, v->bits = buf_size * 8; v->end_mb_x = s->mb_width; if (v->field_mode) { - uint8_t *tmp[2]; s->current_picture.f.linesize[0] <<= 1; s->current_picture.f.linesize[1] <<= 1; s->current_picture.f.linesize[2] <<= 1; s->linesize <<= 1; s->uvlinesize <<= 1; - if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) { - tmp[0] = v->mv_f_last[0]; - tmp[1] = v->mv_f_last[1]; - v->mv_f_last[0] = v->mv_f_next[0]; - v->mv_f_last[1] = v->mv_f_next[1]; - v->mv_f_next[0] = v->mv_f[0]; - v->mv_f_next[1] = v->mv_f[1]; - v->mv_f[0] = tmp[0]; - v->mv_f[1] = tmp[1]; - } } mb_height = s->mb_height >> v->field_mode; for (i = 0; i <= n_slices; i++) { @@ -6083,15 +6072,22 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, } if (v->field_mode) { v->second_field = 0; - if (s->pict_type == AV_PICTURE_TYPE_B) { - memcpy(v->mv_f_base, v->mv_f_next_base, - 2 * (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2)); - } s->current_picture.f.linesize[0] >>= 1; s->current_picture.f.linesize[1] >>= 1; s->current_picture.f.linesize[2] >>= 1; s->linesize >>= 1; s->uvlinesize >>= 1; + if (v->s.pict_type != AV_PICTURE_TYPE_BI && v->s.pict_type != AV_PICTURE_TYPE_B) { + uint8_t *tmp[2]; + tmp[0] = v->mv_f_last[0]; + tmp[1] = v->mv_f_last[1]; + v->mv_f_last[0] = v->mv_f_next[0]; + v->mv_f_last[1] = v->mv_f_next[1]; + v->mv_f_next[0] = v->mv_f[0]; + v->mv_f_next[1] = v->mv_f[1]; + v->mv_f[0] = tmp[0]; + v->mv_f[1] = tmp[1]; + } } av_dlog(s->avctx, "Consumed %i/%i bits\n", get_bits_count(&s->gb), s->gb.size_in_bits); |