diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-12-09 18:23:00 -0500 |
---|---|---|
committer | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-12-17 14:06:46 -0800 |
commit | 97d2c2d678f6aa4ba5178a5bd16094e73e118ff6 (patch) | |
tree | d34ee8bef55dd417603a921f52ef99d4d474d7b4 /libavcodec | |
parent | 95b59bfb9d9e47de8438183a035e02667946f27c (diff) | |
download | ffmpeg-97d2c2d678f6aa4ba5178a5bd16094e73e118ff6.tar.gz |
lavc/opus_celt: replace pow by exp2
exp2 is faster.
It may be possible to optimize further; e.g the exponents seem to be
multiples of 0.25. This requires study though.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/opus_celt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c index 9911de3848..474452f293 100644 --- a/libavcodec/opus_celt.c +++ b/libavcodec/opus_celt.c @@ -1677,7 +1677,7 @@ static void celt_denormalize(CeltContext *s, CeltFrame *frame, float *data) for (i = s->startband; i < s->endband; i++) { float *dst = data + (celt_freq_bands[i] << s->duration); - float norm = pow(2, frame->energy[i] + celt_mean_energy[i]); + float norm = exp2(frame->energy[i] + celt_mean_energy[i]); for (j = 0; j < celt_freq_range[i] << s->duration; j++) dst[j] *= norm; @@ -1857,7 +1857,7 @@ static void process_anticollapse(CeltContext *s, CeltFrame *frame, float *X) /* r needs to be multiplied by 2 or 2*sqrt(2) depending on LM because short blocks don't have the same energy as long */ - r = pow(2, 1 - Ediff); + r = exp2(1 - Ediff); if (s->duration == 3) r *= M_SQRT2; r = FFMIN(thresh, r) * sqrt_1; |