aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2013-11-13 18:44:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-24 01:05:47 +0100
commit3a3b5ae4c05388340965554369a854bc7971afab (patch)
treee185dbc2713e1da4b9061c02b51de4ef191a8e07
parent70fcea3b77617373c1a3317218cee9d5c8da2410 (diff)
downloadffmpeg-3a3b5ae4c05388340965554369a854bc7971afab.tar.gz
mpegvideo: Fix swapping of UV planes for VCR2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit bae14f38d992f326c94d93f01197ccd84ea62053) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegvideo.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4fef2f7338..d497864b62 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -537,6 +537,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);
@@ -567,6 +576,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 */
@@ -641,6 +652,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 "