Commit c2f0bf93 authored by superdump's avatar superdump

Correct pulse amplitude application - a negative or 0 coefficient implies the

pulse is subtracted, else it is added. Also avoid a divide by 0.

Based on a patch by Alex Converse (alex converse gmail com)
Fixes part of issue632


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15294 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8268ada5
...@@ -753,7 +753,9 @@ static int decode_spectrum_and_dequant(AACContext * ac, float coef[1024], GetBit ...@@ -753,7 +753,9 @@ static int decode_spectrum_and_dequant(AACContext * ac, float coef[1024], GetBit
if (pulse_present) { if (pulse_present) {
for(i = 0; i < pulse->num_pulse; i++){ for(i = 0; i < pulse->num_pulse; i++){
float co = coef_base[ pulse->pos[i] ]; float co = coef_base[ pulse->pos[i] ];
float ico = co / sqrtf(sqrtf(fabsf(co))) + pulse->amp[i]; float ico = -pulse->amp[i];
if (co)
ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico; coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico;
} }
} }
......
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