[FFmpeg-devel] [RFC][PATCH] Fix decoding of QT WRAW filefromticket #108

Stefano Sabatini stefano.sabatini-lala at poste.it
Wed May 25 00:16:18 CEST 2011


On date Monday 2011-05-23 18:28:25 +0200, Stefano Sabatini encoded:
> On date Monday 2011-05-23 13:31:45 +0200, ami_stuff encoded:
> > Hi,
> > 
> > > So resuming:
> > > * in AVI, WRAW is paletted 8-bit
> > > 
> > > * in MOV, it means Windows RAW and it means rawvideo stream, the exact
> > >   format depends on pix_fmt_bps_mov.
> > > 
> > > Or maybe WRAW in AVI is rawvideo as well (according to
> > > pix_fmt_bps_mov), but the only analyzed sample was paletted so we
> > > didn't check on pix_fmt_bps_avi.
> > > 
> > > As for the flipping, I have no ideas nor samples, so I don't know when
> > > we're assumed to flip it, according to Michael:
> > > 
> > > http://ffmpeg.org/pipermail/ffmpeg-devel/2009-July/070210.html
> > > 
> > > |all rgb should be fliped unless height<0 or so IIRC
> > > 
> > > Also should it be RGB or BGR?
> > > 
> > > From here:
> > > http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
> > > http://wiki.multimedia.cx/index.php?title=Raw_RGB
> > > 
> > > I couldn't find relevant information, nor in fourcc.org.
> > 
> > I did some more tests and it seems that
> > 
> > 1. all of the AVI/MOV WRAW files (at least from the link I have posted to the #108 ticket)
> > needs to be flipped
> > 
> > 2. mov WRAW files needs to use AVI color modes
> > 
> > 3. assigning PAL8 mode by default to WRAW codec is not correct, so I removed it as well
> > 
> > Regards
> 
> > diff --git a/libavcodec/raw.c b/libavcodec/raw.c
> > index 7481b2f..0bc04df 100644
> > --- a/libavcodec/raw.c
> > +++ b/libavcodec/raw.c
> > @@ -123,7 +123,6 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
> >      { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
> >      { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') },
> >      { PIX_FMT_YUYV422, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */
> > -    { PIX_FMT_PAL8,    MKTAG('W', 'R', 'A', 'W') },
> >      { PIX_FMT_RGB555LE,MKTAG('L', '5', '5', '5') },
> >      { PIX_FMT_RGB565LE,MKTAG('L', '5', '6', '5') },
> >      { PIX_FMT_RGB565BE,MKTAG('B', '5', '6', '5') },
> > diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
> > index 6bf749f..7c7e8c2 100644
> > --- a/libavcodec/rawdec.c
> > +++ b/libavcodec/rawdec.c
> > @@ -90,6 +90,8 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
> >  
> >      if (avctx->codec_tag == MKTAG('r','a','w',' '))
> >          avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_mov, avctx->bits_per_coded_sample);
> > +    else if (avctx->codec_tag == MKTAG('W','R','A','W'))
> > +        avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
> >      else if (avctx->codec_tag)
> >          avctx->pix_fmt = ff_find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag);
> >      else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)
> 
> Looks fine to me, I'll apply in a few days if I see no more comments, thanks.

Pushed.
-- 
FFmpeg = Free and Fabulous Multimedia Philosophical Ecletic God


More information about the ffmpeg-devel mailing list