shithub: aacdec

Download patch

ref: 7778db108536ffa6ebdf18e3591c92ec2bd14972
parent: bbdbf311656bb20e93a9bc4d3dc427d8b0276390
author: menno <menno>
date: Tue Sep 30 08:43:05 EDT 2003

Small DRM patches
General optimisations

--- a/libfaad/cfft.c
+++ b/libfaad/cfft.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: cfft.c,v 1.12 2003/09/09 18:09:51 menno Exp $
+** $Id: cfft.c,v 1.14 2003/10/09 20:04:24 menno Exp $
 **/
 
 /*
@@ -64,9 +64,9 @@
             ah = 2*k;
             ac = 4*k;
 
-            RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+1]);
-            IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+1]);
+            RE(ch[ah])    = RE(cc[ac]) + RE(cc[ac+1]);
             RE(ch[ah+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
+            IM(ch[ah])    = IM(cc[ac]) + IM(cc[ac+1]);
             IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
         }
     } else {
@@ -79,16 +79,14 @@
             {
                 complex_t t2;
 
-                RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac+ido]);
-                IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac+ido]);
+                RE(ch[ah+i]) = RE(cc[ac+i]) + RE(cc[ac+i+ido]);
+                RE(t2)       = RE(cc[ac+i]) - RE(cc[ac+i+ido]);
 
-                RE(t2) = RE(cc[ac]) - RE(cc[ac+ido]);
-                IM(t2) = IM(cc[ac]) - IM(cc[ac+ido]);
+                IM(ch[ah+i]) = IM(cc[ac+i]) + IM(cc[ac+i+ido]);
+                IM(t2)       = IM(cc[ac+i]) - IM(cc[ac+i+ido]);
 
-                RE(ch[ah+l1*ido]) = MUL_R_C(RE(t2),RE(wa[i])) - MUL_R_C(IM(t2),IM(wa[i]))*isign;
-                IM(ch[ah+l1*ido]) = MUL_R_C(IM(t2),RE(wa[i])) + MUL_R_C(RE(t2),IM(wa[i]))*isign;
-                ah++;
-                ac++;
+                RE(ch[ah+i+l1*ido]) = MUL_R_C(RE(t2),RE(wa[i])) - MUL_R_C(IM(t2),IM(wa[i]))*isign;
+                IM(ch[ah+i+l1*ido]) = MUL_R_C(IM(t2),RE(wa[i])) + MUL_R_C(RE(t2),IM(wa[i]))*isign;
             }
         }
     }
@@ -164,66 +162,74 @@
                    complex_t *wa1, complex_t *wa2, complex_t *wa3, int8_t isign)
 {
     uint16_t i, k, ac, ah;
-    complex_t c2, c3, c4, t1, t2, t3, t4;
 
     if (ido == 1)
     {
         for (k = 0; k < l1; k++)
         {
+            complex_t t1, t2, t3, t4;
+
             ac = 4*k;
             ah = k;
 
-            RE(t2) = RE(cc[ac]) + RE(cc[ac+2]);
-            IM(t2) = IM(cc[ac]) + IM(cc[ac+2]);
+            RE(t2) = RE(cc[ac])   + RE(cc[ac+2]);
+            RE(t1) = RE(cc[ac])   - RE(cc[ac+2]);
+            IM(t2) = IM(cc[ac])   + IM(cc[ac+2]);
+            IM(t1) = IM(cc[ac])   - IM(cc[ac+2]);
             RE(t3) = RE(cc[ac+1]) + RE(cc[ac+3]);
-            IM(t3) = IM(cc[ac+1]) + IM(cc[ac+3]);
-            RE(t1) = RE(cc[ac]) - RE(cc[ac+2]);
-            IM(t1) = IM(cc[ac]) - IM(cc[ac+2]);
-            RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
             IM(t4) = RE(cc[ac+1]) - RE(cc[ac+3]);
+            IM(t3) = IM(cc[ac+3]) + IM(cc[ac+1]);
+            RE(t4) = IM(cc[ac+3]) - IM(cc[ac+1]);
 
-            RE(ch[ah]) = RE(t2) + RE(t3);
-            IM(ch[ah]) = IM(t2) + IM(t3);
-            RE(ch[ah+l1]) = RE(t1) + RE(t4)*isign;
-            IM(ch[ah+l1]) = IM(t1) + IM(t4)*isign;
+            RE(ch[ah])      = RE(t2) + RE(t3);
             RE(ch[ah+2*l1]) = RE(t2) - RE(t3);
+
+            IM(ch[ah])      = IM(t2) + IM(t3);
             IM(ch[ah+2*l1]) = IM(t2) - IM(t3);
+
+            RE(ch[ah+l1])   = RE(t1) + RE(t4)*isign;
             RE(ch[ah+3*l1]) = RE(t1) - RE(t4)*isign;
+
+            IM(ch[ah+l1])   = IM(t1) + IM(t4)*isign;
             IM(ch[ah+3*l1]) = IM(t1) - IM(t4)*isign;
         }
     } else {
         for (k = 0; k < l1; k++)
         {
+            ac = 4*k*ido;
+            ah = k*ido;
+
             for (i = 0; i < ido; i++)
             {
-                ac = i + 4*k*ido;
-                ah = i + k*ido;
+                complex_t c2, c3, c4, t1, t2, t3, t4;
 
-                RE(t2) = RE(cc[ac]) + RE(cc[ac+2*ido]);
-                IM(t2) = IM(cc[ac]) + IM(cc[ac+2*ido]);
-                RE(t3) = RE(cc[ac+ido]) + RE(cc[ac+3*ido]);
-                IM(t3) = IM(cc[ac+ido]) + IM(cc[ac+3*ido]);
-                RE(t1) = RE(cc[ac]) - RE(cc[ac+2*ido]);
-                IM(t1) = IM(cc[ac]) - IM(cc[ac+2*ido]);
-                RE(t4) = IM(cc[ac+3*ido]) - IM(cc[ac+ido]);
-                IM(t4) = RE(cc[ac+ido]) - RE(cc[ac+3*ido]);
+                RE(t2) = RE(cc[ac+i]) + RE(cc[ac+i+2*ido]);
+                RE(t1) = RE(cc[ac+i]) - RE(cc[ac+i+2*ido]);
+                IM(t2) = IM(cc[ac+i]) + IM(cc[ac+i+2*ido]);
+                IM(t1) = IM(cc[ac+i]) - IM(cc[ac+i+2*ido]);
+                RE(t3) = RE(cc[ac+i+ido]) + RE(cc[ac+i+3*ido]);
+                IM(t4) = RE(cc[ac+i+ido]) - RE(cc[ac+i+3*ido]);
+                IM(t3) = IM(cc[ac+i+3*ido]) + IM(cc[ac+i+ido]);
+                RE(t4) = IM(cc[ac+i+3*ido]) - IM(cc[ac+i+ido]);
 
-                RE(ch[ah]) = RE(t2) + RE(t3);
-                IM(ch[ah]) = IM(t2) + IM(t3);
-
                 RE(c2) = RE(t1) + RE(t4)*isign;
-                IM(c2) = IM(t1) + IM(t4)*isign;
-                RE(c3) = RE(t2) - RE(t3);
-                IM(c3) = IM(t2) - IM(t3);
                 RE(c4) = RE(t1) - RE(t4)*isign;
+
+                IM(c2) = IM(t1) + IM(t4)*isign;
                 IM(c4) = IM(t1) - IM(t4)*isign;
 
-                RE(ch[ah+l1*ido]) = MUL_R_C(RE(c2),RE(wa1[i])) - MUL_R_C(IM(c2),IM(wa1[i]))*isign;
-                IM(ch[ah+l1*ido]) = MUL_R_C(IM(c2),RE(wa1[i])) + MUL_R_C(RE(c2),IM(wa1[i]))*isign;
-                RE(ch[ah+2*l1*ido]) = MUL_R_C(RE(c3),RE(wa2[i])) - MUL_R_C(IM(c3),IM(wa2[i]))*isign;
-                IM(ch[ah+2*l1*ido]) = MUL_R_C(IM(c3),RE(wa2[i])) + MUL_R_C(RE(c3),IM(wa2[i]))*isign;
-                RE(ch[ah+3*l1*ido]) = MUL_R_C(RE(c4),RE(wa3[i])) - MUL_R_C(IM(c4),IM(wa3[i]))*isign;
-                IM(ch[ah+3*l1*ido]) = MUL_R_C(IM(c4),RE(wa3[i])) + MUL_R_C(RE(c4),IM(wa3[i]))*isign;
+                RE(ch[ah+i]) = RE(t2) + RE(t3);
+                RE(c3)       = RE(t2) - RE(t3);
+
+                IM(ch[ah+i]) = IM(t2) + IM(t3);
+                IM(c3)       = IM(t2) - IM(t3);
+
+                IM(ch[ah+i+l1*ido])   = MUL_R_C(IM(c2),RE(wa1[i])) + MUL_R_C(RE(c2),IM(wa1[i]))*isign;
+                RE(ch[ah+i+l1*ido])   = MUL_R_C(RE(c2),RE(wa1[i])) - MUL_R_C(IM(c2),IM(wa1[i]))*isign;
+                IM(ch[ah+i+2*l1*ido]) = MUL_R_C(IM(c3),RE(wa2[i])) + MUL_R_C(RE(c3),IM(wa2[i]))*isign;
+                RE(ch[ah+i+2*l1*ido]) = MUL_R_C(RE(c3),RE(wa2[i])) - MUL_R_C(IM(c3),IM(wa2[i]))*isign;
+                IM(ch[ah+i+3*l1*ido]) = MUL_R_C(IM(c4),RE(wa3[i])) + MUL_R_C(RE(c4),IM(wa3[i]))*isign;
+                RE(ch[ah+i+3*l1*ido]) = MUL_R_C(RE(c4),RE(wa3[i])) - MUL_R_C(IM(c4),IM(wa3[i]))*isign;
             }
         }
     }
@@ -355,6 +361,17 @@
 
         switch (ip)
         {
+        case 4:
+            ix2 = iw + ido;
+            ix3 = ix2 + ido;
+
+            if (na == 0)
+                passf4(ido, l1, c, ch, &wa[iw], &wa[ix2], &wa[ix3], isign);
+            else
+                passf4(ido, l1, ch, c, &wa[iw], &wa[ix2], &wa[ix3], isign);
+
+            na = 1 - na;
+            break;
         case 2:
             if (na == 0)
                 passf2(ido, l1, c, ch, &wa[iw], isign);
@@ -370,17 +387,6 @@
                 passf3(ido, l1, c, ch, &wa[iw], &wa[ix2], isign);
             else
                 passf3(ido, l1, ch, c, &wa[iw], &wa[ix2], isign);
-
-            na = 1 - na;
-            break;
-        case 4:
-            ix2 = iw + ido;
-            ix3 = ix2 + ido;
-
-            if (na == 0)
-                passf4(ido, l1, c, ch, &wa[iw], &wa[ix2], &wa[ix3], isign);
-            else
-                passf4(ido, l1, ch, c, &wa[iw], &wa[ix2], &wa[ix3], isign);
 
             na = 1 - na;
             break;
--- a/libfaad/filtbank.c
+++ b/libfaad/filtbank.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: filtbank.c,v 1.26 2003/09/09 18:09:51 menno Exp $
+** $Id: filtbank.c,v 1.28 2003/10/09 20:04:24 menno Exp $
 **/
 
 #include "common.h"
@@ -191,17 +191,31 @@
     {
     case ONLY_LONG_SEQUENCE:
         imdct(fb, freq_in, transf_buf, 2*nlong);
-        for (i = nlong-1; i >= 0; i--)
+        for (i = 0; i < nlong; i+=4)
         {
-            time_out[i] = time_out[nlong+i] + MUL_R_C(transf_buf[i],window_long_prev[i]);
-            time_out[nlong+i] = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
+            time_out[i]   = time_out[nlong+i]   + MUL_R_C(transf_buf[i],window_long_prev[i]);
+            time_out[i+1] = time_out[nlong+i+1] + MUL_R_C(transf_buf[i+1],window_long_prev[i+1]);
+            time_out[i+2] = time_out[nlong+i+2] + MUL_R_C(transf_buf[i+2],window_long_prev[i+2]);
+            time_out[i+3] = time_out[nlong+i+3] + MUL_R_C(transf_buf[i+3],window_long_prev[i+3]);
         }
+        for (i = 0; i < nlong; i+=4)
+        {
+            time_out[nlong+i]   = MUL_R_C(transf_buf[nlong+i],window_long[nlong-1-i]);
+            time_out[nlong+i+1] = MUL_R_C(transf_buf[nlong+i+1],window_long[nlong-2-i]);
+            time_out[nlong+i+2] = MUL_R_C(transf_buf[nlong+i+2],window_long[nlong-3-i]);
+            time_out[nlong+i+3] = MUL_R_C(transf_buf[nlong+i+3],window_long[nlong-4-i]);
+        }
         break;
 
     case LONG_START_SEQUENCE:
         imdct(fb, freq_in, transf_buf, 2*nlong);
-        for (i = 0; i < nlong; i++)
-            time_out[i] = time_out[nlong+i] + MUL_R_C(transf_buf[i],window_long_prev[i]);
+        for (i = 0; i < nlong; i+=4)
+        {
+            time_out[i]   = time_out[nlong+i]   + MUL_R_C(transf_buf[i],window_long_prev[i]);
+            time_out[i+1] = time_out[nlong+i+1] + MUL_R_C(transf_buf[i+1],window_long_prev[i+1]);
+            time_out[i+2] = time_out[nlong+i+2] + MUL_R_C(transf_buf[i+2],window_long_prev[i+2]);
+            time_out[i+3] = time_out[nlong+i+3] + MUL_R_C(transf_buf[i+3],window_long_prev[i+3]);
+        }
         for (i = 0; i < nflat_ls; i++)
             time_out[nlong+i] = transf_buf[nlong+i];
         for (i = 0; i < nshort; i++)
--- a/libfaad/mdct.c
+++ b/libfaad/mdct.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: mdct.c,v 1.27 2003/09/09 18:09:52 menno Exp $
+** $Id: mdct.c,v 1.29 2003/10/09 20:04:24 menno Exp $
 **/
 
 /*
@@ -208,11 +208,8 @@
     /* pre-IFFT complex multiplication */
     for (k = 0; k < N4; k++)
     {
-        uint16_t n = k << 1;
-        RE(x) = X_in[         n];
-        IM(x) = X_in[N2 - 1 - n];
-        RE(Z1[k]) = MUL_R_C(IM(x), RE(sincos[k])) - MUL_R_C(RE(x), IM(sincos[k]));
-        IM(Z1[k]) = MUL_R_C(RE(x), RE(sincos[k])) + MUL_R_C(IM(x), IM(sincos[k]));
+        RE(Z1[k]) = MUL_R_C(X_in[N2 - 1 - 2*k], RE(sincos[k])) - MUL_R_C(X_in[2*k], IM(sincos[k]));
+        IM(Z1[k]) = MUL_R_C(X_in[2*k], RE(sincos[k])) + MUL_R_C(X_in[N2 - 1 - 2*k], IM(sincos[k]));
     }
 
     /* complex IFFT, any non-scaling FFT can be used here */
@@ -221,7 +218,6 @@
     /* post-IFFT complex multiplication */
     for (k = 0; k < N4; k++)
     {
-        uint16_t n = k << 1;
         RE(x) = RE(Z1[k]);
         IM(x) = IM(Z1[k]);
 
@@ -232,15 +228,14 @@
     /* reordering */
     for (k = 0; k < N8; k++)
     {
-        uint16_t n = k << 1;
-        X_out[              n] =  IM(Z1[N8 +     k]);
-        X_out[          1 + n] = -RE(Z1[N8 - 1 - k]);
-        X_out[N4 +          n] =  RE(Z1[         k]);
-        X_out[N4 +      1 + n] = -IM(Z1[N4 - 1 - k]);
-        X_out[N2 +          n] =  RE(Z1[N8 +     k]);
-        X_out[N2 +      1 + n] = -IM(Z1[N8 - 1 - k]);
-        X_out[N2 + N4 +     n] = -IM(Z1[         k]);
-        X_out[N2 + N4 + 1 + n] =  RE(Z1[N4 - 1 - k]);
+        X_out[              2*k] =  IM(Z1[N8 +     k]);
+        X_out[          1 + 2*k] = -RE(Z1[N8 - 1 - k]);
+        X_out[N4 +          2*k] =  RE(Z1[         k]);
+        X_out[N4 +      1 + 2*k] = -IM(Z1[N4 - 1 - k]);
+        X_out[N2 +          2*k] =  RE(Z1[N8 +     k]);
+        X_out[N2 +      1 + 2*k] = -IM(Z1[N8 - 1 - k]);
+        X_out[N2 + N4 +     2*k] = -IM(Z1[         k]);
+        X_out[N2 + N4 + 1 + 2*k] =  RE(Z1[N4 - 1 - k]);
     }
 }
 
--- a/libfaad/sbr_qmf.c
+++ b/libfaad/sbr_qmf.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: sbr_qmf.c,v 1.12 2003/09/25 12:04:31 menno Exp $
+** $Id: sbr_qmf.c,v 1.13 2003/09/30 12:43:05 menno Exp $
 **/
 
 #include "common.h"
@@ -72,7 +72,7 @@
     const real_t *inptr = input;
 
     /* qmf subsample l */
-    for (l = 0; l < 32; l++)
+    for (l = 0; l < sbr->numTimeSlotsRate; l++)
     {
         int16_t n;
 
@@ -191,7 +191,7 @@
 
 
     /* qmf subsample l */
-    for (l = 0; l < 32; l++)
+    for (l = 0; l < sbr->numTimeSlotsRate; l++)
     {
         real_t *v0, *v1;
 
@@ -255,7 +255,7 @@
 
 
     /* qmf subsample l */
-    for (l = 0; l < 32; l++)
+    for (l = 0; l < sbr->numTimeSlotsRate; l++)
     {
         real_t *v0, *v1;
 
--- a/libfaad/specrec.c
+++ b/libfaad/specrec.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: specrec.c,v 1.26 2003/09/24 08:05:44 menno Exp $
+** $Id: specrec.c,v 1.27 2003/09/30 12:43:05 menno Exp $
 **/
 
 /*
@@ -413,59 +413,43 @@
 void quant_to_spec(ic_stream *ics, real_t *spec_data, uint16_t frame_len)
 {
     uint8_t g, sfb, win;
-    uint16_t width, bin;
-    real_t *start_inptr, *start_win_ptr, *win_ptr;
+    uint16_t width, bin, k, gindex;
 
     real_t tmp_spec[1024];
-    real_t *tmp_spec_ptr, *spec_ptr;
 
-    tmp_spec_ptr = tmp_spec;
-    memset(tmp_spec_ptr, 0, frame_len*sizeof(real_t));
+    memset(tmp_spec, 0, frame_len*sizeof(real_t));
 
-    spec_ptr = spec_data;
-    tmp_spec_ptr = tmp_spec;
-    start_win_ptr = tmp_spec_ptr;
+    k = 0;
+    gindex = 0;
 
     for (g = 0; g < ics->num_window_groups; g++)
     {
         uint16_t j = 0;
-        uint16_t win_inc = 0;
+        uint16_t gincrease = 0;
+        uint16_t win_inc = ics->swb_offset[ics->num_swb];
 
-        start_inptr = spec_ptr;
-
-        win_inc = ics->swb_offset[ics->num_swb];
-
         for (sfb = 0; sfb < ics->num_swb; sfb++)
         {
             width = ics->swb_offset[sfb+1] - ics->swb_offset[sfb];
 
-            win_ptr = start_win_ptr;
-
             for (win = 0; win < ics->window_group_length[g]; win++)
             {
-                tmp_spec_ptr = win_ptr + j;
-
                 for (bin = 0; bin < width; bin += 4)
                 {
-                    tmp_spec_ptr[0] = spec_ptr[0];
-                    tmp_spec_ptr[1] = spec_ptr[1];
-                    tmp_spec_ptr[2] = spec_ptr[2];
-                    tmp_spec_ptr[3] = spec_ptr[3];
-                    tmp_spec_ptr += 4;
-                    spec_ptr += 4;
+                    tmp_spec[gindex+(win*win_inc)+j+bin+0] = spec_data[k+0];
+                    tmp_spec[gindex+(win*win_inc)+j+bin+1] = spec_data[k+1];
+                    tmp_spec[gindex+(win*win_inc)+j+bin+2] = spec_data[k+2];
+                    tmp_spec[gindex+(win*win_inc)+j+bin+3] = spec_data[k+3];
+                    gincrease += 4;
+                    k += 4;
                 }
-
-                win_ptr += win_inc;
             }
             j += width;
         }
-        start_win_ptr += (spec_ptr - start_inptr);
+        gindex += gincrease;
     }
 
-    spec_ptr = spec_data;
-    tmp_spec_ptr = tmp_spec;
-
-    memcpy(spec_ptr, tmp_spec_ptr, frame_len*sizeof(real_t));
+    memcpy(spec_data, tmp_spec, frame_len*sizeof(real_t));
 }
 
 #ifndef FIXED_POINT
@@ -519,18 +503,14 @@
 void inverse_quantization(real_t *x_invquant, int16_t *x_quant, uint16_t frame_len)
 {
     int16_t i;
-    int16_t *in_ptr = x_quant;
-    real_t *out_ptr = x_invquant;
     real_t *tab = iq_table;
 
-    for(i = frame_len/4-1; i >= 0; --i)
+    for(i = 0; i < frame_len; i+=4)
     {
-        out_ptr[0] = iquant(in_ptr[0], tab);
-        out_ptr[1] = iquant(in_ptr[1], tab);
-        out_ptr[2] = iquant(in_ptr[2], tab);
-        out_ptr[3] = iquant(in_ptr[3], tab);
-        out_ptr += 4;
-        in_ptr += 4;
+        x_invquant[i] = iquant(x_quant[i], tab);
+        x_invquant[i+1] = iquant(x_quant[i+1], tab);
+        x_invquant[i+2] = iquant(x_quant[i+2], tab);
+        x_invquant[i+3] = iquant(x_quant[i+3], tab);
     }
 }
 
@@ -560,7 +540,6 @@
 {
     uint8_t g, sfb;
     uint16_t top;
-    real_t *fp;
 #ifndef FIXED_POINT
     real_t scale;
 #else
@@ -577,12 +556,10 @@
     {
         uint16_t k = 0;
 
-        /* using this 128*groups doesn't hurt long blocks, because
+        /* using this nshort*groups doesn't hurt long blocks, because
            long blocks only have 1 group, so that means 'groups' is
            always 0 for long blocks
         */
-        fp = x_invquant + (groups*nshort);
-
         for (sfb = 0; sfb < ics->max_sfb; sfb++)
         {
             top = ics->sect_sfb_offset[g][sfb+1];
@@ -609,33 +586,32 @@
             for ( ; k < top; k += 4)
             {
 #ifndef FIXED_POINT
-                fp[0] = fp[0] * scale;
-                fp[1] = fp[1] * scale;
-                fp[2] = fp[2] * scale;
-                fp[3] = fp[3] * scale;
+                x_invquant[k+(groups*nshort)]   = x_invquant[k+(groups*nshort)]   * scale;
+                x_invquant[k+(groups*nshort)+1] = x_invquant[k+(groups*nshort)+1] * scale;
+                x_invquant[k+(groups*nshort)+2] = x_invquant[k+(groups*nshort)+2] * scale;
+                x_invquant[k+(groups*nshort)+3] = x_invquant[k+(groups*nshort)+3] * scale;
 #else
                 if (exp < 0)
                 {
-                    fp[0] >>= -exp;
-                    fp[1] >>= -exp;
-                    fp[2] >>= -exp;
-                    fp[3] >>= -exp;
+                    x_invquant[k+(groups*nshort)] >>= -exp;
+                    x_invquant[k+(groups*nshort)+1] >>= -exp;
+                    x_invquant[k+(groups*nshort)+2] >>= -exp;
+                    x_invquant[k+(groups*nshort)+3] >>= -exp;
                 } else {
-                    fp[0] <<= exp;
-                    fp[1] <<= exp;
-                    fp[2] <<= exp;
-                    fp[3] <<= exp;
+                    x_invquant[k+(groups*nshort)] <<= exp;
+                    x_invquant[k+(groups*nshort)+1] <<= exp;
+                    x_invquant[k+(groups*nshort)+2] <<= exp;
+                    x_invquant[k+(groups*nshort)+3] <<= exp;
                 }
 
                 if (frac)
                 {
-                    fp[0] = MUL_R_C(fp[0],pow2_table[frac + 3]);
-                    fp[1] = MUL_R_C(fp[1],pow2_table[frac + 3]);
-                    fp[2] = MUL_R_C(fp[2],pow2_table[frac + 3]);
-                    fp[3] = MUL_R_C(fp[3],pow2_table[frac + 3]);
+                    x_invquant[k+(groups*nshort)]   = MUL_R_C(x_invquant[k+(groups*nshort)],pow2_table[frac + 3]);
+                    x_invquant[k+(groups*nshort)+1] = MUL_R_C(x_invquant[k+(groups*nshort)+1],pow2_table[frac + 3]);
+                    x_invquant[k+(groups*nshort)+2] = MUL_R_C(x_invquant[k+(groups*nshort)+2],pow2_table[frac + 3]);
+                    x_invquant[k+(groups*nshort)+3] = MUL_R_C(x_invquant[k+(groups*nshort)+3],pow2_table[frac + 3]);
                 }
 #endif
-                fp += 4;
             }
         }
         groups += ics->window_group_length[g];
--- a/libfaad/syntax.c
+++ b/libfaad/syntax.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
 **
-** $Id: syntax.c,v 1.55 2003/09/24 08:05:45 menno Exp $
+** $Id: syntax.c,v 1.56 2003/09/30 12:43:05 menno Exp $
 **/
 
 /*
@@ -568,13 +568,13 @@
                 return 2; /* pulse coding not allowed for short blocks */
             }
         }
-        return 0;
     } else
 #endif
-
-    retval = individual_channel_stream(hDecoder, sce, ld, ics, 0, spec_data);
-    if (retval > 0)
-        return retval;
+    {
+        retval = individual_channel_stream(hDecoder, sce, ld, ics, 0, spec_data);
+        if (retval > 0)
+            return retval;
+    }
 
 
     /* noiseless coding is done, spectral reconstruction is done now */