[FFmpeg-devel] [PATCH] GSM 6.10 audio decoder

Reimar Döffinger Reimar.Doeffinger
Sun Jul 4 07:25:36 CEST 2010


On Sat, Jul 03, 2010 at 04:54:48PM -0700, Eli Friedman wrote:
> On Sat, Jul 3, 2010 at 4:51 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> > On Sat, Jul 3, 2010 at 4:03 PM, Reimar D?ffinger
> > <Reimar.Doeffinger at gmx.de> wrote:
> >> Hello,
> >> I fear I may have gone a bit too far when removing clipping protections,
> >> however the clips I have (well, the three in samples/) decode bit-exact
> >> compared to the libgsm decoder, and thanks to not trying to optimize for
> >> 16-bit CPUs etc. it is a lot smaller and probably also faster (though
> >> I did not care to benchmark).
> >> When reviewing keep in mind that I think I've never implemented an
> >> audio codec before :-)
> >> As for the purpose: I want to throw out MPlayer's "native" variant
> >> of this, which is basically libgsm just with a bit more of those horrible
> >> old-style function declarations.
> >
> > I'd suggest writing out the formula for dequant_tab
> > ("((idxb<<3)-28)*(idxa+1)", if I'm not mistaken) and getting rid of
> > the table; unless I've really messed up the formula, it's cheap enough
> > to compute on any processor with a decent multiplier that the table
> > isn't worthwhile (e.g. it's two instructions on x86).
> 
> Wait, nevermind, for some reason I thought it was linear.

Well, the formula would be simple, if it wasn't for the very specific
rounding they used.
To be bit-exact, the calculation becomes rathe complex and a lot of code
(well, relative to what it does at least).



More information about the ffmpeg-devel mailing list