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

2015-11-25 Thread Timothy Gu
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()

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

2015-11-25 Thread Timothy Gu
On Wed, Nov 25, 2015 at 6:03 PM Timothy Gu 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

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

2015-11-25 Thread Ganesh Ajjanagadde
On Wed, Nov 25, 2015 at 9:03 PM, Timothy Gu 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

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

2015-11-25 Thread Ganesh Ajjanagadde
This does some miscellaneous stuff mainly avoiding the usage of pow to achieve significant speedups. This is not speed critical, but is unnecessary latency and cycles wasted for a user. All tables tested and are identical to the old ones (bit-exact even in floating point case). Sample benchmark