[FFmpeg-cvslog] lavc/opus_celt: replace pow(2,x) by 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:45:30 2016 -0500| [cea529dd7f0d2d7fd1c7f33c5f778a051eedfaf9] | committer: Ganesh Ajjanagadde

lavc/opus_celt: replace pow(2,x) by exp2f(x)

Faster methods possible; since exponent is always a multiple of 1/8.

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=cea529dd7f0d2d7fd1c7f33c5f778a051eedfaf9
---

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

diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c
index 474452f..61a9dc6 100644
--- a/libavcodec/opus_celt.c
+++ b/libavcodec/opus_celt.c
@@ -27,6 +27,7 @@
 #include <stdint.h>
 
 #include "libavutil/float_dsp.h"
+#include "libavutil/libm.h"
 
 #include "imdct15.h"
 #include "opus.h"
@@ -1839,7 +1840,7 @@ static void process_anticollapse(CeltContext *s, CeltFrame *frame, float *X)
 
         /* depth in 1/8 bits */
         depth = (1 + s->pulses[i]) / (celt_freq_range[i] << s->duration);
-        thresh = pow(2, -1.0 - 0.125f * depth);
+        thresh = exp2f(-1.0 - 0.125f * depth);
         sqrt_1 = 1.0f / sqrtf(celt_freq_range[i] << s->duration);
 
         xptr = X + (celt_freq_bands[i] << s->duration);



More information about the ffmpeg-cvslog mailing list