diff options
author | Måns Rullgård <mans@mansr.com> | 2009-09-23 13:52:53 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-09-23 13:52:53 +0000 |
commit | b418a6ca7e34c7788ab172f9e8a7b39cfac2fda2 (patch) | |
tree | 7ced060cb024be2db621550d9c8519ef3bea250c /libavcodec/aac.c | |
parent | a27090208eea511f47c4e1b3069c8334639f692f (diff) | |
download | ffmpeg-b418a6ca7e34c7788ab172f9e8a7b39cfac2fda2.tar.gz |
AAC: minor simplification in PNS decoding
Originally committed as revision 19999 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aac.c')
-rw-r--r-- | libavcodec/aac.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c index 0b8922fe6c..235cce5394 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -860,16 +860,16 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], } else if (cur_band_type == NOISE_BT) { for (group = 0; group < ics->group_len[g]; group++) { float scale; - float band_energy = 0; + float band_energy; float *cf = coef + group * 128 + offsets[i]; int len = offsets[i+1] - offsets[i]; - for (k = offsets[i]; k < offsets[i + 1]; k++) { + for (k = 0; k < len; k++) { ac->random_state = lcg_random(ac->random_state); - coef[group * 128 + k] = ac->random_state; + cf[k] = ac->random_state; } - band_energy += ac->dsp.scalarproduct_float(cf, cf, len); + band_energy = ac->dsp.scalarproduct_float(cf, cf, len); scale = sf[idx] / sqrtf(band_energy); ac->dsp.vector_fmul_scalar(cf, cf, scale, len); } |