aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-23 10:09:01 -0800
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2015-12-25 10:48:18 -0800
commitcb3a994bb148ea4859d11a20b12b2b94cbdc2bee (patch)
tree5ff1c437d209318ccc38178cf04fd1c30f74b786 /libavcodec/aacpsy.c
parent421679dbf799c8f70332b62434c86f7da27ec181 (diff)
downloadffmpeg-cb3a994bb148ea4859d11a20b12b2b94cbdc2bee.tar.gz
lavc/aacpsy: replace pow(10,x) by ff_exp10(x)
Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r--libavcodec/aacpsy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 71eeb3e547..8643fe7036 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/attributes.h"
+#include "libavutil/internal.h"
#include "libavutil/libm.h"
#include "avcodec.h"
@@ -349,10 +350,10 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
for (g = 0; g < ctx->num_bands[j] - 1; g++) {
AacPsyCoeffs *coeff = &coeffs[g];
float bark_width = coeffs[g+1].barks - coeffs->barks;
- coeff->spread_low[0] = pow(10.0, -bark_width * PSY_3GPP_THR_SPREAD_LOW);
- coeff->spread_hi [0] = pow(10.0, -bark_width * PSY_3GPP_THR_SPREAD_HI);
- coeff->spread_low[1] = pow(10.0, -bark_width * en_spread_low);
- coeff->spread_hi [1] = pow(10.0, -bark_width * en_spread_hi);
+ coeff->spread_low[0] = ff_exp10(-bark_width * PSY_3GPP_THR_SPREAD_LOW);
+ coeff->spread_hi [0] = ff_exp10(-bark_width * PSY_3GPP_THR_SPREAD_HI);
+ coeff->spread_low[1] = ff_exp10(-bark_width * en_spread_low);
+ coeff->spread_hi [1] = ff_exp10(-bark_width * en_spread_hi);
pe_min = bark_pe * bark_width;
minsnr = exp2(pe_min / band_sizes[g]) - 1.5f;
coeff->min_snr = av_clipf(1.0f / minsnr, PSY_SNR_25DB, PSY_SNR_1DB);