diff options
author | Jai Menon <realityman@gmx.net> | 2009-04-02 12:15:04 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2009-04-02 12:15:04 +0000 |
commit | 3dd2f87e61d3c02493a02efca146569dc771cb86 (patch) | |
tree | 5711b917d88f2eefa8852dea948d0230bcb8e931 /libavcodec/rawenc.c | |
parent | 3dd3604197f8b562b8fc707c28a6329d6bac730c (diff) | |
download | ffmpeg-3dd2f87e61d3c02493a02efca146569dc771cb86.tar.gz |
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
Diffstat (limited to 'libavcodec/rawenc.c')
-rw-r--r-- | libavcodec/rawenc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index 4e560333e1..82a543ad46 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "raw.h" +#include "libavutil/intreadwrite.h" static av_cold int raw_init_encoder(AVCodecContext *avctx) { @@ -40,8 +41,16 @@ static av_cold int raw_init_encoder(AVCodecContext *avctx) static int raw_encode(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) { - return avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width, + int ret = avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width, avctx->height, frame, buf_size); + + if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 && + avctx->pix_fmt == PIX_FMT_YUYV422) { + int x; + for(x = 1; x < avctx->height*avctx->width*2; x += 2) + frame[x] ^= 0x80; + } + return ret; } AVCodec rawvideo_encoder = { |