[FFmpeg-devel] [PATCH] adpcm: Flush the PutBitsContext at the end of each block when encoding IMA QT

Martin Storsjö martin
Thu Aug 26 11:51:33 CEST 2010


On Thu, 26 Aug 2010, Kostya wrote:

> On Thu, Aug 26, 2010 at 10:40:54AM +0300, Martin Storsj? wrote:
> > On Thu, 26 Aug 2010, Michael Niedermayer wrote:
> > 
> > > On Wed, Aug 25, 2010 at 10:37:33PM +0300, Martin Storsj? wrote:
> > > > Hi,
> > > > 
> > > > As in $subj - currently, the last few bytes of each packet aren't written 
> > > > properly, leading to quite audible noise.
> > > > 
> > > > // Martin
> > > >  adpcm.c |    1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 9fcdbc3755bebeedc46002086d944af9a9d513b6  0001-Flush-the-PutBitsContext-at-the-end-of-each-block-wh.patch
> > > > From e0ccf7f48b9264f271a5cadd45ce67182f56bb03 Mon Sep 17 00:00:00 2001
> > > > From: Martin Storsjo <martin at martin.st>
> > > > Date: Wed, 25 Aug 2010 22:34:39 +0300
> > > > Subject: [PATCH] Flush the PutBitsContext at the end of each block when encoding ADPCM IMA QT
> > > 
> > > probably ok, do the reg tests change?
> > 
> > No, they didn't seem to change, curiously enough. Thus, committed.
> 
> Well, 32 samples x 4 bits = enough aligned bits to make put_bits() flush
> it behind the scenes. Not that it's a good thing to rely on that.

Yes, that would have made sense, but despite that, they weren't 
automatically flushed behind the scenes in my tests at least. (valgrind 
also complained about writing uninitialized data to the output file.)

// Martin



More information about the ffmpeg-devel mailing list