[FFmpeg-devel] [PATCH] scale msadpcm table to fit in int8_t

Reimar Döffinger Reimar.Doeffinger
Sat Jul 12 11:25:47 CEST 2008


On Sat, Jul 12, 2008 at 11:07:04AM +0200, Reimar D?ffinger wrote:
> On Fri, Jul 11, 2008 at 07:29:33PM -0700, Mike Melanson wrote:
> > Michael Niedermayer wrote:
> > > On Fri, Jul 11, 2008 at 06:14:44PM -0700, Mike Melanson wrote:
> > >> Reimar D?ffinger wrote:
> > >>> this implements the same change I did to the MPlayer decoder.
> > >>> Saves only a few bytes though and would probably be slower on an 8-bit
> > >>> CPU without good shift support (e.g. Atmel AVR) if someone cares...
> > >> I guess ADPCM algorithms are not specified to be bit exact? This changes 
> > >> the output from before. But as long as it sounds right, I can update the 
> > >> relevant FATE tests. However, you will be responsible for updating the 
> > >> regression tests (which are presently broken due to this change).
> > > 
> > > hmmmmmmmmmm
> > > i thought it was a bitexact optim just reducing the table sizes
> > > has reimar maybe missed some use of the tables? :)
> > 
> > Perhaps this:
> > 
> > -static const int AdaptCoeff2[] = {
> > -        0, -256, 0, 64, 0, -208, -232
> > +static const int8_t AdaptCoeff2[] = {
> > +        0, -64, 0, 16, 0, -52, -58
> > 
> > Maybe there are rounding implications due to the negative numbers?
> 
> I've been thinking about this, but my brain seems stuck, I always come
> to the conclusion that rounding should still be the same even for
> negative numbers.
> But while the regression tests now work, the FATE sample still decodes
> differently, so I obviously am missing something...

Finally fixed. I admit I doubt this "improvement" was worth all the
mess, maybe some day I will learn to be less hasty ;-).




More information about the ffmpeg-devel mailing list