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

Michael Niedermayer michaelni
Wed Apr 1 00:35:48 CEST 2009


On Wed, Apr 01, 2009 at 12:32:09AM +0200, Stefano Sabatini wrote:
> 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?

yes

and patch ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090401/4056602a/attachment.pgp>



More information about the ffmpeg-devel mailing list