[FFmpeg-cvslog] lavc/atrac3plusdsp: change pow(2,x) to exp2f(x)

Ganesh Ajjanagadde git at videolan.org
Fri Jan 22 15:04:43 CET 2016


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Fri Jan 15 13:38:43 2016 -0500| [9254e6176c1a7e1498f1305619f46a3ab979816f] | committer: Ganesh Ajjanagadde

lavc/atrac3plusdsp: change pow(2,x) to exp2f(x)

Much faster generation possible; but array is small so don't want to bloat
the binary.

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9254e6176c1a7e1498f1305619f46a3ab979816f
---

 libavcodec/atrac3plusdsp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/atrac3plusdsp.c b/libavcodec/atrac3plusdsp.c
index 17c6437..d089588 100644
--- a/libavcodec/atrac3plusdsp.c
+++ b/libavcodec/atrac3plusdsp.c
@@ -28,6 +28,7 @@
 #include <math.h>
 
 #include "libavutil/float_dsp.h"
+#include "libavutil/libm.h"
 #include "avcodec.h"
 #include "sinewin.h"
 #include "fft.h"
@@ -107,7 +108,7 @@ av_cold void ff_atrac3p_init_wave_synth(void)
 
     /* generate amplitude scalefactors table */
     for (i = 0; i < 64; i++)
-        amp_sf_tab[i] = pow(2.0f, ((double)i - 3) / 4.0f);
+        amp_sf_tab[i] = exp2f((i - 3) / 4.0f);
 }
 
 /**



More information about the ffmpeg-cvslog mailing list