lavc/opus_celt: replace pow(2,x) by exp2f(x)
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Fri, 15 Jan 2016 18:45:30 +0000 (13:45 -0500)
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>
Fri, 22 Jan 2016 13:56:58 +0000 (19:26 +0530)
Faster methods possible; since exponent is always a multiple of 1/8.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
libavcodec/opus_celt.c

index 474452f..61a9dc6 100644 (file)
@@ -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);