ref: 7be054b7ff71768ea9c8e325de827af764100950
parent: 0cc4d9659aaa35c8a21af0e7a8927bf9132315bf
author: Jean-Marc Valin <[email protected]>
date: Thu Jun 1 09:21:59 EDT 2017
Avoid using log2() since it's not in C90
--- a/src/analysis.c
+++ b/src/analysis.c
@@ -481,7 +481,7 @@
E += binE;
}
E = SCALE_ENER(E);
- band_log2[0] = (float).5*log2(E+1e-10f);
+ band_log2[0] = .5f*1.442695f*(float)log(E+1e-10f);
}
for (b=0;b<NB_TBANDS;b++)
{
@@ -512,7 +512,7 @@
frame_loudness += (float)sqrt(E+1e-10f);
logE[b] = (float)log(E+1e-10f);
- band_log2[b+1] = (float).5*log2(E+1e-10f);
+ band_log2[b+1] = .5f*1.442695f*(float)log(E+1e-10f);
tonal->logE[tonal->E_count][b] = logE[b];
if (tonal->count==0)
tonal->highE[b] = tonal->lowE[b] = logE[b];