changeset 10252:10df50768c02 libavcodec

AAC: minor simplification in PNS decoding
author mru
date Wed, 23 Sep 2009 13:52:53 +0000
parents b9ea1706bf27
children 64dd9515b93b
files aac.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/aac.c	Wed Sep 23 13:18:29 2009 +0000
+++ b/aac.c	Wed Sep 23 13:52:53 2009 +0000
@@ -860,16 +860,16 @@
             } 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);
                 }