changeset 9143:5001f33c30f3 libavcodec

AAC: hoist dependent gain lookup out of the loop
author alexc
date Thu, 05 Mar 2009 23:10:22 +0000
parents 8b977d664424
children 53123c63f82a
files aac.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/aac.c	Thu Mar 05 22:17:12 2009 +0000
+++ b/aac.c	Thu Mar 05 23:10:22 2009 +0000
@@ -1434,10 +1434,11 @@
     for (g = 0; g < ics->num_window_groups; g++) {
         for (i = 0; i < ics->max_sfb; i++, idx++) {
             if (cce->ch[0].band_type[idx] != ZERO_BT) {
+                const float gain = cce->coup.gain[index][idx];
                 for (group = 0; group < ics->group_len[g]; group++) {
                     for (k = offsets[i]; k < offsets[i+1]; k++) {
                         // XXX dsputil-ize
-                        dest[group*128+k] += cce->coup.gain[index][idx] * src[group*128+k];
+                        dest[group*128+k] += gain * src[group*128+k];
                     }
                 }
             }