[FFmpeg-devel] skip_put_bits() bugged?

Michael Niedermayer michaelni
Tue Mar 31 20:44:34 CEST 2009

On Tue, Mar 31, 2009 at 08:15:15PM +0200, Stefano Sabatini wrote:
> On date Tuesday 2009-03-31 04:10:56 +0200, Michael Niedermayer encoded:
> > On Tue, Mar 31, 2009 at 12:17:31AM +0200, Stefano Sabatini wrote:
> > [...]
> > 
> > > Which looks quite wrong.
> > > Commenting in skip_put_bits(&pb, 0); it looks fine.
> > > 
> > > Am I missing something or is it indeed broken?
> > 
> > bug in the documentation i would say unless you can fix it without
> > speed loss
> Bug is issued when bit_left is 32 or more (but I don't think bit_left
> may assume a value grater than 32), I'd say is not a good idea to ask
> the user to check for that value and then manually fiddle with
> PutBitContext.

what i meant was
"skip_put_bits(0) has undefined behavior" could be added to the docs
This is not something the user will want to use anyway most of the time
and when she really wants a
if(n) skip_put_bits(n) isnt worse than what you suggest

> Also skip_put_bits() is currently called only in three points in
> libavcodec/h263.c.
> My previous fix adds a check, so it slows down it a little, but I
> don't see other alternatives but to change the other functions (such
> as put_bits() to make bit_left only take values less than 32.

i dont see any bug that you fix i just see a slowdown you create,
if there is a bug id like to see full ffmpeg output from an unmodified ffmpeg

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- 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/20090331/172ee5ce/attachment.pgp>

More information about the ffmpeg-devel mailing list