[FFmpeg-devel] [PATCH] HAM6/HAM8 support for IFF demuxer/decoder

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Apr 22 07:40:47 CEST 2011


On Thu, Apr 21, 2011 at 10:41:41PM +0200, Michael Niedermayer wrote:
> On Thu, Apr 21, 2011 at 12:17:46PM -0400, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Thu, Apr 21, 2011 at 12:13 PM, Stefano Sabatini
> > <stefano.sabatini-lala at poste.it> wrote:
> > > On date Wednesday 2011-04-20 13:56:56 +0200, Sebastian Vater encoded:
> > >> +        if (!st->codec->extradata) {
> > >> +            st->codec->extradata_size = IFF_EXTRA_VIDEO_SIZE;
> > >> +            st->codec->extradata      = av_malloc(IFF_EXTRA_VIDEO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
> > >> +            if (!st->codec->extradata)
> > >> +                return AVERROR(ENOMEM);
> > >> +        }
> > >> +        buf = st->codec->extradata;
> > >> +        bytestream_put_be16(&buf, IFF_EXTRA_VIDEO_SIZE);
> > >> +        bytestream_put_byte(&buf, iff->compression);
> > >> +        bytestream_put_byte(&buf, iff->bpp);
> > >> +        bytestream_put_byte(&buf, iff->ham);
> > >> +        bytestream_put_byte(&buf, iff->flags);
> > >> +        bytestream_put_be16(&buf, iff->transparency);
> > >> +        bytestream_put_byte(&buf, iff->masking);
> > >
> > > I confess I have not much experience with this way of passing data
> > > from the demuxer to the decoder, and I remember it was already
> > > discussed, but isn't this ABI fragile, isn't this creating a lavc/lavf
> > > coupling?
> > 
> > Yeah, this is what Kostya added the AVPacket.side_data for.
> 
> side data has been added to pass per packet data that isnt part the
> normal codec bitstream. (if its smart to store it like that ill
> ignore here)
> 
> But iam sure you can see that above is global data not per packet data.
> 
> the ABI isnt pretty, i agree with stefano but passing that in
> side data doesnt change that.If you have a better suggestion iam
> interrested, if not i see no reason to change the quoted code

It looks like a "done is done" case, however it probably would have been
better to pass the whole ID_CAMG etc. things that contain global setup
data unchanged, simply concatenated via extradata.


More information about the ffmpeg-devel mailing list