[FFmpeg-soc] [soc]: r2877 - aac/aac.c

superdump subversion at mplayerhq.hu
Mon Jul 28 11:04:06 CEST 2008


Author: superdump
Date: Mon Jul 28 11:04:06 2008
New Revision: 2877

Log:
Move constant outside loop


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Mon Jul 28 11:04:06 2008
@@ -1341,8 +1341,8 @@ static void dequant(AACContext * ac, con
         memset(coef + g * 128 + offsets[ics->max_sfb], 0, sizeof(float)*(c - offsets[ics->max_sfb]));
         for (i = 0; i < ics->max_sfb; i++) {
             if (band_type[g][i] == NOISE_BT) {
+                const float scale = sf[g][i] / ((offsets[i+1] - offsets[i]) * PNS_MEAN_ENERGY);
                 for (group = 0; group < ics->group_len[g]; group++) {
-                    float scale = sf[g][i] / ((offsets[i+1] - offsets[i]) * PNS_MEAN_ENERGY);
                     for (k = offsets[i]; k < offsets[i+1]; k++)
                         coef[group*128+k] = (int32_t)av_random(&ac->random_state) * scale;
                 }



More information about the FFmpeg-soc mailing list