Commit cea529dd authored by Ganesh Ajjanagadde's avatar 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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 9254e617
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <stdint.h> #include <stdint.h>
#include "libavutil/float_dsp.h" #include "libavutil/float_dsp.h"
#include "libavutil/libm.h"
#include "imdct15.h" #include "imdct15.h"
#include "opus.h" #include "opus.h"
...@@ -1839,7 +1840,7 @@ static void process_anticollapse(CeltContext *s, CeltFrame *frame, float *X) ...@@ -1839,7 +1840,7 @@ static void process_anticollapse(CeltContext *s, CeltFrame *frame, float *X)
/* depth in 1/8 bits */ /* depth in 1/8 bits */
depth = (1 + s->pulses[i]) / (celt_freq_range[i] << s->duration); 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); sqrt_1 = 1.0f / sqrtf(celt_freq_range[i] << s->duration);
xptr = X + (celt_freq_bands[i] << s->duration); xptr = X + (celt_freq_bands[i] << s->duration);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment