diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2016-01-15 13:45:30 -0500 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2016-01-22 19:26:58 +0530 |
commit | cea529dd7f0d2d7fd1c7f33c5f778a051eedfaf9 (patch) | |
tree | ff0a24563c0ff4d3528f1e58b4cc43336a378602 /libavcodec | |
parent | 9254e6176c1a7e1498f1305619f46a3ab979816f (diff) | |
download | ffmpeg-cea529dd7f0d2d7fd1c7f33c5f778a051eedfaf9.tar.gz |
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@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/opus_celt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c index 474452f293..61a9dc61d3 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); |