[FFmpeg-devel] [PATCH] pixdesc.h: add support for bitstream formats

Stefano Sabatini stefano.sabatini-lala
Wed Apr 1 00:32:09 CEST 2009


On date Tuesday 2009-03-31 23:23:36 +0200, Michael Niedermayer encoded:
> On Tue, Mar 31, 2009 at 10:32:10PM +0200, Stefano Sabatini wrote:
[...]
> > Index: libavfilter-soc/ffmpeg/libavcodec/pixdesc.h
> > ===================================================================
> > --- libavfilter-soc.orig/ffmpeg/libavcodec/pixdesc.h	2009-03-31 21:43:24.000000000 +0200
> > +++ libavfilter-soc/ffmpeg/libavcodec/pixdesc.h	2009-03-31 21:45:32.000000000 +0200
> > @@ -22,6 +22,7 @@
> >  #include <inttypes.h>
> >  
> >  #include "libavutil/intreadwrite.h"
> > +#include "libavcodec/bitstream.h"
> >  
> >  typedef struct AVComponentDescriptor{
> >      uint16_t plane        :2;            ///< which of the 4 planes contains the component
> > @@ -104,10 +105,21 @@
> >      int shift= comp.shift;
> >      int step = comp.step_minus1+1;
> >      int flags= desc->flags;
> > -    const uint8_t *p= data[plane]+y*linesize[plane] + x * step + comp.offset_plus1 - 1;
> > -
> > -    //FIXME initial x in case of PIX_FMT_BITSTREAM is wrong
> >  
> > +    if (flags & PIX_FMT_BITSTREAM) {
> > +        GetBitContext gb;
> > +        init_get_bits(&gb, data[plane] + y*linesize[plane], linesize[plane]*8);
> > +        skip_bits(&gb, x*step + comp.offset_plus1-1);
> 
> skip_bits_long()

Updated.

BTW, Michael could you briefly explain the differenence between
the two functions()? I suppose the _long version has to be used when
the number of bits to skip is supposed to be "long", right?

Regards.
-- 
FFmpeg = Forgiving & Fundamental Meaningless Pitiless Eager Glue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pixdesc-bitstream-management.patch
Type: text/x-diff
Size: 1734 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090401/8aa81faf/attachment.patch>



More information about the ffmpeg-devel mailing list