[FFmpeg-cvslog] r21154 - in trunk: libavcodec/rawdec.c libavformat/avidec.c

cehoyos subversion
Tue Jan 12 01:29:27 CET 2010


Author: cehoyos
Date: Tue Jan 12 01:29:26 2010
New Revision: 21154

Log:
Support uncompressed ("Resolution 1:1") Avid AVI Codec, (partially) fixes issue 1474.

Modified:
   trunk/libavcodec/rawdec.c
   trunk/libavformat/avidec.c

Modified: trunk/libavcodec/rawdec.c
==============================================================================
--- trunk/libavcodec/rawdec.c	Mon Jan 11 21:21:26 2010	(r21153)
+++ trunk/libavcodec/rawdec.c	Tue Jan 12 01:29:26 2010	(r21154)
@@ -74,6 +74,8 @@ static av_cold int raw_init_decoder(AVCo
 
     if (avctx->codec_tag == MKTAG('r','a','w',' '))
         avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_coded_sample);
+    else if (avctx->codec_tag == MKTAG('A', 'V', 'R', 'n'))
+        avctx->pix_fmt = PIX_FMT_UYVY422; // Avid AVI Codec "Resolution 1:1"
     else if (avctx->codec_tag)
         avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag);
     else if (avctx->bits_per_coded_sample)

Modified: trunk/libavformat/avidec.c
==============================================================================
--- trunk/libavformat/avidec.c	Mon Jan 11 21:21:26 2010	(r21153)
+++ trunk/libavformat/avidec.c	Tue Jan 12 01:29:26 2010	(r21154)
@@ -518,6 +518,11 @@ static int avi_read_header(AVFormatConte
                     st->codec->codec_tag = tag1;
                     st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1);
                     st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts.
+                    // Support "Resolution 1:1" for Avid AVI Codec
+                    if(tag1 == MKTAG('A', 'V', 'R', 'n') &&
+                       st->codec->extradata_size >= 31 &&
+                       !memcmp(&st->codec->extradata[28], "1:1", 3))
+                        st->codec->codec_id = CODEC_ID_RAWVIDEO;
 
                     if(st->codec->codec_tag==0 && st->codec->height > 0 && st->codec->extradata_size < 1U<<30){
                         st->codec->extradata_size+= 9;



More information about the ffmpeg-cvslog mailing list