diff aac.c @ 7857:d7801471cd52 libavcodec

Apply pulses to unscaled coefficients rather than scaled. Slight reworking of a patch by Alex Converse (alex converse gmail com)
author superdump
date Sat, 13 Sep 2008 20:51:36 +0000
parents 0882c93a0c11
children f75806078d46
line wrap: on
line diff
--- a/aac.c	Sat Sep 13 20:22:31 2008 +0000
+++ b/aac.c	Sat Sep 13 20:51:36 2008 +0000
@@ -754,12 +754,19 @@
     }
 
     if (pulse_present) {
+        idx = 0;
         for(i = 0; i < pulse->num_pulse; i++){
             float co  = coef_base[ pulse->pos[i] ];
+            while(offsets[idx + 1] <= pulse->pos[i])
+                idx++;
+            if (band_type[idx] != NOISE_BT && sf[idx]) {
             float ico = -pulse->amp[i];
-            if (co)
+            if (co) {
+                co /= sf[idx];
                 ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
-            coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico;
+            }
+            coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico * sf[idx];
+            }
         }
     }
     return 0;