Commit a93ba093 authored by cehoyos's avatar cehoyos

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

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21154 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8ef12f2d
...@@ -74,6 +74,8 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) ...@@ -74,6 +74,8 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
if (avctx->codec_tag == MKTAG('r','a','w',' ')) if (avctx->codec_tag == MKTAG('r','a','w',' '))
avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_coded_sample); 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) else if (avctx->codec_tag)
avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag); avctx->pix_fmt = findPixelFormat(ff_raw_pixelFormatTags, avctx->codec_tag);
else if (avctx->bits_per_coded_sample) else if (avctx->bits_per_coded_sample)
......
...@@ -518,6 +518,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -518,6 +518,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->codec_tag = tag1; st->codec->codec_tag = tag1;
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, 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. 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){ if(st->codec->codec_tag==0 && st->codec->height > 0 && st->codec->extradata_size < 1U<<30){
st->codec->extradata_size+= 9; st->codec->extradata_size+= 9;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment