diff options
author | Frank Barchard <fbarchard@google.com> | 2010-06-02 16:09:19 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-06-02 16:09:19 +0000 |
commit | 83b707613181c01fd4e9d25dda6787af439d2e41 (patch) | |
tree | 341cd25d6160d09426cdc7e6cbafa8f5b05dd92b /libavcodec | |
parent | 5dc051f4c137888c2d37d383ed31bf6514b257cd (diff) | |
download | ffmpeg-83b707613181c01fd4e9d25dda6787af439d2e41.tar.gz |
Avoid division by zero that caused noise, typically at the beginning or
end of a file.
Patch by Frank Barchard, fbarchard google
Originally committed as revision 23426 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vorbis_enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 01d1b85cf0..b18f6531c6 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -681,7 +681,7 @@ static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc, float average = averages[i]; int j; - average *= pow(tot_average / average, 0.5) * pow(1.25, position/200.); // MAGIC! + average = sqrt(tot_average * average) * pow(1.25f, position*0.005f); // MAGIC! for (j = 0; j < range - 1; j++) if (ff_vorbis_floor1_inverse_db_table[j * fc->multiplier] > average) break; |