[FFmpeg-devel] [PATCH] avcodec/mpegaudio_tablegen: speed up table generation

Timothy Gu timothygu99 at gmail.com
Thu Nov 26 03:22:05 CET 2015

On Wed, Nov 25, 2015 at 6:03 PM Timothy Gu <timothygu99 at gmail.com> wrote:

> On Wed, Nov 25, 2015 at 05:17:29PM -0500, Ganesh Ajjanagadde wrote:
> > +            double f = value * cbrt_lut[value] * pow(2, (exponent -
> 400) * 0.25 + FRAC_BITS + 5) / IMDCT_SCALAR;
> While at it, you could change pow(2 to exp2(, which has a libm.h shim
> and is easily 4 times faster than pow() on my machine (glibc 2.19,
> Haswell).

In light of the comments made by Ronald and James in the other thread, it
would probably be better if you look for instances of optimization
opportunities in other files that matter rather than these tablegen files
that will only be run once during the build process. A simple `git grep -E
'powf?\(2'` shows an awful lot.

(BTW next time you send similar patches you c/should put them in a patch
series so that it's easier to track on the ML. I missed the other thread
before reading this one.)


More information about the ffmpeg-devel mailing list