Commit 51436848 authored by Alex Converse's avatar Alex Converse Committed by Robert Swain
Browse files

Apply pulses to unscaled coefficients rather than scaled.

Slight reworking of a patch by Alex Converse (alex converse gmail com)

Originally committed as revision 15314 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 408992ba
......@@ -754,12 +754,19 @@ static int decode_spectrum_and_dequant(AACContext * ac, float coef[1024], GetBit
}
if (pulse_present) {
idx = 0;
for(i = 0; i < pulse->num_pulse; i++){
float co = coef_base[ pulse->pos[i] ];
while(offsets[idx + 1] <= pulse->pos[i])
idx++;
if (band_type[idx] != NOISE_BT && sf[idx]) {
float ico = -pulse->amp[i];
if (co)
if (co) {
co /= sf[idx];
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 * sf[idx];
}
}
}
return 0;
......
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