diff options
author | Alex Converse <alex.converse@gmail.com> | 2008-09-13 20:51:36 +0000 |
---|---|---|
committer | Robert Swain <robert.swain@gmail.com> | 2008-09-13 20:51:36 +0000 |
commit | 5143684891cae4ec23c599f337c31dd47de13ed3 (patch) | |
tree | d134ff7dfed5c2bf53273aa618bf55697a0eeb49 /libavcodec/aac.c | |
parent | 408992bae211c09e7460b4738134a569bd93c58a (diff) | |
download | ffmpeg-streaming-5143684891cae4ec23c599f337c31dd47de13ed3.zip ffmpeg-streaming-5143684891cae4ec23c599f337c31dd47de13ed3.tar.gz |
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
Diffstat (limited to 'libavcodec/aac.c')
-rw-r--r-- | libavcodec/aac.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c index 0e2db12..d18e25b 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -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; |