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

superdump subversion at mplayerhq.hu
Mon Jul 28 12:22:29 CEST 2008


Author: superdump
Date: Mon Jul 28 12:22:29 2008
New Revision: 2880

Log:
Use band_type_run_end[][] to avoid branches within a loop


Modified:
   aac/aac.c

Modified: aac/aac.c
==============================================================================
--- aac/aac.c	(original)
+++ aac/aac.c	Mon Jul 28 12:22:29 2008
@@ -1458,15 +1458,20 @@ static void apply_intensity_stereo(AACCo
     float scale;
     for (g = 0; g < ics->num_window_groups; g++) {
         for (gp = 0; gp < ics->group_len[g]; gp++) {
-            for (i = 0; i < ics->max_sfb; i++) {
+            for (i = 0; i < ics->max_sfb;) {
                 if (sce1->band_type[g][i] == INTENSITY_BT || sce1->band_type[g][i] == INTENSITY_BT2) {
+                    const int bt_run_end = sce1->band_type_run_end[g][i];
+                while (i < bt_run_end) {
                     c = -1 + 2 * (sce1->band_type[g][i] - 14);
                     if (cpe->ms.present)
                         c *= 1 - 2 * cpe->ms.mask[g][i];
                     scale = c * sce1->sf[g][i];
                     for (k = offsets[i]; k < offsets[i+1]; k++)
                         coef1[k] = scale * coef0[k];
+                    i++;
                 }
+                } else
+                    i = sce1->band_type_run_end[g][i];
             }
             coef0 += 128;
             coef1 += 128;



More information about the FFmpeg-soc mailing list