From 3dd2f87e61d3c02493a02efca146569dc771cb86 Mon Sep 17 00:00:00 2001 From: Jai Menon Date: Thu, 2 Apr 2009 12:15:04 +0000 Subject: Map MOV fourcc YUV2 correctly to PIX_FMT_YUYV422. Patch by Jai Menon Originally committed as revision 18316 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/rawdec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavcodec/rawdec.c') diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index db44f0c8b4..963e148aa1 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "raw.h" +#include "libavutil/intreadwrite.h" typedef struct RawVideoContext { unsigned char * buffer; /* block of memory for holding one frame */ @@ -144,6 +145,17 @@ static int raw_decode(AVCodecContext *avctx, picture->data[2] = tmp; } + if(avctx->codec_tag == AV_RL32("yuv2") && + avctx->pix_fmt == PIX_FMT_YUYV422) { + int x, y; + uint8_t *line = picture->data[0]; + for(y = 0; y < avctx->height; y++) { + for(x = 0; x < avctx->width; x++) + line[2*x + 1] ^= 0x80; + line += picture->linesize[0]; + } + } + *data_size = sizeof(AVPicture); return buf_size; } -- cgit v1.2.1