diff options
author | Steve L'Homme <slhomme@divxcorp.com> | 2006-08-18 07:55:08 +0000 |
---|---|---|
committer | Guillaume Poirier <gpoirier@mplayerhq.hu> | 2006-08-18 07:55:08 +0000 |
commit | 0b23d689d850c636ba4594b578007aa2b0fdc88a (patch) | |
tree | 31bd53305df1c548b1c40d25749f4ebd9065bc71 | |
parent | 751b9004793c28a50ff6acd4d3981e0cbb530b88 (diff) | |
download | ffmpeg-0b23d689d850c636ba4594b578007aa2b0fdc88a.tar.gz |
Add YV12 support, patch by Steve Lhomme % steve P lhomme A free P fr %
Original thread:
Date: Aug 17, 2006 5:45 PM
Subject: Re: [Ffmpeg-devel] [PATCH] AVISynth support
Originally committed as revision 6018 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/raw.c | 10 | ||||
-rw-r--r-- | libavformat/riff.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/raw.c b/libavcodec/raw.c index e777397feb..6204cf7975 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -38,6 +38,7 @@ typedef struct PixelFormatTag { const PixelFormatTag pixelFormatTags[] = { { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') }, + { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') }, { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') }, { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') }, { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') }, @@ -141,6 +142,15 @@ static int raw_decode(AVCodecContext *avctx, } flip(avctx, picture); + + if (avctx->codec_tag == MKTAG('Y', 'V', '1', '2')) + { + // swap fields + unsigned char *tmp = picture->data[1]; + picture->data[1] = picture->data[2]; + picture->data[2] = tmp; + } + *data_size = sizeof(AVPicture); return buf_size; } diff --git a/libavformat/riff.c b/libavformat/riff.c index 2ccbc8c567..0be0be7620 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -106,6 +106,7 @@ const CodecTag codec_bmp_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('I', '4', '2', '0') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'Y', '2') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', '4', '2', '2') }, + { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') }, { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') }, { CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') }, { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') }, |