diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-25 02:31:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-25 13:51:44 +0200 |
commit | 32a6dfeb125d485c9667a052547935b1b1bd13ca (patch) | |
tree | a4167ac6e8c9a9c9941e8b1ff692c200fa03e71e /libavcodec/vc1dec.c | |
parent | 16cecf9c3de89600aa28852201da4e605cf796bf (diff) | |
download | ffmpeg-32a6dfeb125d485c9667a052547935b1b1bd13ca.tar.gz |
vc1dec: drop mv_f_last, simplify code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 696a4ddd62..cbf45c7341 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5490,9 +5490,6 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) v->mv_f_base = av_mallocz(2 * (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2)); v->mv_f[0] = v->mv_f_base + s->b8_stride + 1; v->mv_f[1] = v->mv_f[0] + (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2); - v->mv_f_last_base = av_mallocz(2 * (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2)); - v->mv_f_last[0] = v->mv_f_last_base + s->b8_stride + 1; - v->mv_f_last[1] = v->mv_f_last[0] + (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2); v->mv_f_next_base = av_mallocz(2 * (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2)); v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (s->mb_height * 2 + 1) + s->mb_stride * (s->mb_height + 1) * 2); @@ -5705,7 +5702,6 @@ av_cold int ff_vc1_decode_end(AVCodecContext *avctx) av_freep(&v->mb_type_base); av_freep(&v->blk_mv_type_base); av_freep(&v->mv_f_base); - av_freep(&v->mv_f_last_base); av_freep(&v->mv_f_next_base); av_freep(&v->block); av_freep(&v->cbp_base); @@ -6102,15 +6098,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, 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]; + FFSWAP(uint8_t *, v->mv_f_next[0], v->mv_f[0]); + FFSWAP(uint8_t *, v->mv_f_next[1], v->mv_f[1]); } } av_dlog(s->avctx, "Consumed %i/%i bits\n", |