Commit 0881beac authored by cehoyos's avatar cehoyos

Avoid division by zero that caused noise, typically at the beginning or

end of a file.

Patch by Frank Barchard, fbarchard google


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23426 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9ed9ce96
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment