Replace log2f(10) with a constant

Originally committed as revision 21924 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2010-02-20 20:13:48 +00:00
parent c4f267ab75
commit e4a35244fa
2 changed files with 4 additions and 1 deletions

View File

@ -128,7 +128,7 @@ float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
// ^g_c = ^gamma_gc * 100.05 (predicted dB + mean dB - dB of fixed vector)
// Note 10^(0.05 * -10log(average x2)) = 1/sqrt((average x2)).
float val = fixed_gain_factor *
exp2f(log2f(10.0) * 0.05 *
exp2f(M_LOG2_10 * 0.05 *
(ff_dot_productf(pred_table, prediction_error, 4) +
energy_mean)) /
sqrtf(fixed_mean_energy);

View File

@ -35,6 +35,9 @@
#ifndef M_LN10
#define M_LN10 2.30258509299404568402 /* log_e 10 */
#endif
#ifndef M_LOG2_10
#define M_LOG2_10 3.32192809488736218171 /* log_2 10 */
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846 /* pi */
#endif