diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2013-11-13 18:44:26 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-11-19 02:05:51 +0100 |
commit | 16e7b189c548b4075ff4b5dd62af10e2acae260b (patch) | |
tree | 630a58b8428e81833e54d0f6b4fdc72438bb3175 /libavcodec | |
parent | 69d4dbfd1faa99563065329656bbe597d612ca03 (diff) | |
download | ffmpeg-16e7b189c548b4075ff4b5dd62af10e2acae260b.tar.gz |
mpegvideo: Fix swapping of UV planes for VCR2
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 7ffb2615df..737a92fa84 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -518,6 +518,15 @@ fail: return ret; } +static void exchange_uv(MpegEncContext *s) +{ + int16_t (*tmp)[64]; + + tmp = s->pblocks[4]; + s->pblocks[4] = s->pblocks[5]; + s->pblocks[5] = tmp; +} + static int init_duplicate_context(MpegEncContext *s) { int y_size = s->b8_stride * (2 * s->mb_height + 1); @@ -548,6 +557,8 @@ static int init_duplicate_context(MpegEncContext *s) for (i = 0; i < 12; i++) { s->pblocks[i] = &s->block[i]; } + if (s->avctx->codec_tag == AV_RL32("VCR2")) + exchange_uv(s); if (s->out_format == FMT_H263) { /* ac values */ @@ -622,6 +633,8 @@ int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src) for (i = 0; i < 12; i++) { dst->pblocks[i] = &dst->block[i]; } + if (dst->avctx->codec_tag == AV_RL32("VCR2")) + exchange_uv(dst); if (!dst->edge_emu_buffer && (ret = ff_mpv_frame_size_alloc(dst, dst->linesize)) < 0) { av_log(dst->avctx, AV_LOG_ERROR, "failed to allocate context " |