diff options
author | Måns Rullgård <mans@mansr.com> | 2010-02-20 20:13:48 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-02-20 20:13:48 +0000 |
commit | e4a35244fac4171a3d3c60a5bac465b98fe0444b (patch) | |
tree | 2d54ef1d6bfaa293b00fd5628a0262d56d8033a3 | |
parent | c4f267ab7570a66eea46a231ad10486c63cc4c68 (diff) | |
download | ffmpeg-e4a35244fac4171a3d3c60a5bac465b98fe0444b.tar.gz |
Replace log2f(10) with a constant
Originally committed as revision 21924 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/acelp_pitch_delay.c | 2 | ||||
-rw-r--r-- | libavutil/mathematics.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/acelp_pitch_delay.c b/libavcodec/acelp_pitch_delay.c index c3e2409c1e..cddf7262b6 100644 --- a/libavcodec/acelp_pitch_delay.c +++ b/libavcodec/acelp_pitch_delay.c @@ -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); diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h index 29b13f77ed..4cc3b49aad 100644 --- a/libavutil/mathematics.h +++ b/libavutil/mathematics.h @@ -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 |