shithub: aacdec

Download patch

ref: 8ab8622bc39fb152ab2062b78bfe19f44236c00a
parent: befcd24885655130d24f8a45f5b2c93ab417714c
author: gcp <gcp>
date: Wed Sep 8 05:43:40 EDT 2004

Sync CVS - smal bugfixes

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+8 september 2004  mbakker(at)nero.com
+    - specrec.c: fixed compilation without PS
+
+4 september 2004  mbakker(at)nero.com
+    - sbr_fbt.c, sbr_hfgen.c: fixed possible lockup with bad data.
+
+4 september 2004  mbakker(at)nero.com
+    - cfft.c,h, common.c,h, filtbank.c,h, mdct.h, sbr_qmf.h, structs.h, decoder.c, specrec.c:
+         Removed USE_SSE
+
 4 september 2004  gpascutto(at)nero.com
     - specrec.c: small optimizations to inverse quant
 
--- 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 [email protected].
 **
-** $Id: cfft.c,v 1.29 2004/09/04 14:56:27 menno Exp $
+** $Id: cfft.c,v 1.30 2004/09/08 09:43:11 gcp Exp $
 **/
 
 /*
@@ -44,14 +44,6 @@
 
 
 /* static function declarations */
-#ifdef USE_SSE
-static void passf2pos_sse(const uint16_t l1, const complex_t *cc,
-                          complex_t *ch, const complex_t *wa);
-static void passf2pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc,
-                              complex_t *ch, const complex_t *wa);
-static void passf4pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc, complex_t *ch,
-                              const complex_t *wa1, const complex_t *wa2, const complex_t *wa3);
-#endif
 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
                       complex_t *ch, const complex_t *wa);
 static void passf2neg(const uint16_t ido, const uint16_t l1, const complex_t *cc,
@@ -74,89 +66,6 @@
    passf2, passf3, passf4, passf5. Complex FFT passes fwd and bwd.
   ----------------------------------------------------------------------*/
 
-#if 0 //def USE_SSE
-static void passf2pos_sse(const uint16_t l1, const complex_t *cc,
-                          complex_t *ch, const complex_t *wa)
-{
-    uint16_t k, ah, ac;
-
-    for (k = 0; k < l1; k++)
-    {
-        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+l1]) = RE(cc[ac]) - RE(cc[ac+1]);
-        IM(ch[ah+l1]) = IM(cc[ac]) - IM(cc[ac+1]);
-    }
-}
-
-static void passf2pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc,
-                              complex_t *ch, const complex_t *wa)
-{
-    uint16_t i, k, ah, ac;
-
-    for (k = 0; k < l1; k++)
-    {
-        ah = k*ido;
-        ac = 2*k*ido;
-
-        for (i = 0; i < ido; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14;
-            __m128 m15, m16, m17, m18, m19, m20, m21, m22, m23, m24;
-            __m128 w1, w2, w3, w4;
-
-            m1 = _mm_load_ps(&RE(cc[ac+i]));
-            m2 = _mm_load_ps(&RE(cc[ac+ido+i]));
-            m5 = _mm_load_ps(&RE(cc[ac+i+2]));
-            m6 = _mm_load_ps(&RE(cc[ac+ido+i+2]));
-            w1 = _mm_load_ps(&RE(wa[i]));
-            w3 = _mm_load_ps(&RE(wa[i+2]));
-
-            m3 = _mm_add_ps(m1, m2);
-            m15 = _mm_add_ps(m5, m6);
-
-            m4 = _mm_sub_ps(m1, m2);
-            m16 = _mm_sub_ps(m5, m6);
-
-            _mm_store_ps(&RE(ch[ah+i]), m3);
-            _mm_store_ps(&RE(ch[ah+i+2]), m15);
-
-
-            w2 = _mm_shuffle_ps(w1, w1, _MM_SHUFFLE(2, 3, 0, 1));
-            w4 = _mm_shuffle_ps(w3, w3, _MM_SHUFFLE(2, 3, 0, 1));
-
-            m7 = _mm_mul_ps(m4, w1);
-            m17 = _mm_mul_ps(m16, w3);
-            m8 = _mm_mul_ps(m4, w2);
-            m18 = _mm_mul_ps(m16, w4);
-
-            m9  = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(2, 0, 2, 0));
-            m19 = _mm_shuffle_ps(m17, m18, _MM_SHUFFLE(2, 0, 2, 0));
-            m10 = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(3, 1, 3, 1));
-            m20 = _mm_shuffle_ps(m17, m18, _MM_SHUFFLE(3, 1, 3, 1));
-
-            m11 = _mm_add_ps(m9, m10);
-            m21 = _mm_add_ps(m19, m20);
-            m12 = _mm_sub_ps(m9, m10);
-            m22 = _mm_sub_ps(m19, m20);
-
-            m13 = _mm_shuffle_ps(m11, m11, _MM_SHUFFLE(0, 0, 3, 2));
-            m23 = _mm_shuffle_ps(m21, m21, _MM_SHUFFLE(0, 0, 3, 2));
-
-            m14 = _mm_unpacklo_ps(m12, m13);
-            m24 = _mm_unpacklo_ps(m22, m23);
-
-            _mm_store_ps(&RE(ch[ah+i+l1*ido]), m14);
-            _mm_store_ps(&RE(ch[ah+i+2+l1*ido]), m24);
-        }
-    }
-}
-#endif
-
 static void passf2pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
                       complex_t *ch, const complex_t *wa)
 {
@@ -385,219 +294,7 @@
     }
 }
 
-#ifdef USE_SSE
-ALIGN static const int32_t negate[4] = { 0x0, 0x0, 0x0, 0x80000000 };
 
-__declspec(naked) static void passf4pos_sse(const uint16_t l1, const complex_t *cc,
-                                     complex_t *ch, const complex_t *wa1, const complex_t *wa2,
-                                     const complex_t *wa3)
-{
-    __asm {
-        push      ebx
-        mov       ebx, esp
-        and       esp, -16
-        push      edi
-        push      esi
-        sub       esp, 8
-        movzx     edi, WORD PTR [ebx+8]
-
-        movaps    xmm1, XMMWORD PTR negate
-
-        test      edi, edi
-        jle       l1_is_zero
-
-        lea       esi, DWORD PTR [edi+edi]
-        add       esi, esi
-        sub       esi, edi
-        add       esi, esi
-        add       esi, esi
-        add       esi, esi
-        mov       eax, DWORD PTR [ebx+16]
-        add       esi, eax
-        lea       ecx, DWORD PTR [edi+edi]
-        add       ecx, ecx
-        add       ecx, ecx
-        add       ecx, ecx
-        add       ecx, eax
-        lea       edx, DWORD PTR [edi+edi]
-        add       edx, edx
-        add       edx, edx
-        add       edx, eax
-        xor       eax, eax
-        mov       DWORD PTR [esp], ebp
-        mov       ebp, DWORD PTR [ebx+12]
-
-fftloop:
-        lea       edi, DWORD PTR [eax+eax]
-        add       edi, edi
-        movaps    xmm2, XMMWORD PTR [ebp+edi*8]
-        movaps    xmm0, XMMWORD PTR [ebp+edi*8+16]
-        movaps    xmm7, XMMWORD PTR [ebp+edi*8+32]
-        movaps    xmm5, XMMWORD PTR [ebp+edi*8+48]
-        movaps    xmm6, xmm2
-        addps     xmm6, xmm0
-        movaps    xmm4, xmm1
-        xorps     xmm4, xmm7
-        movaps    xmm3, xmm1
-        xorps     xmm3, xmm5
-        xorps     xmm2, xmm1
-        xorps     xmm0, xmm1
-        addps     xmm7, xmm5
-        subps     xmm2, xmm0
-        movaps    xmm0, xmm6
-        shufps    xmm0, xmm7, 68
-        subps     xmm4, xmm3
-        shufps    xmm6, xmm7, 238
-        movaps    xmm5, xmm2
-        shufps    xmm5, xmm4, 68
-        movaps    xmm3, xmm0
-        addps     xmm3, xmm6
-        shufps    xmm2, xmm4, 187
-        subps     xmm0, xmm6
-        movaps    xmm4, xmm5
-        addps     xmm4, xmm2
-        mov       edi, DWORD PTR [ebx+16]
-        movaps    XMMWORD PTR [edi+eax*8], xmm3
-        subps     xmm5, xmm2
-        movaps    XMMWORD PTR [edx+eax*8], xmm4
-        movaps    XMMWORD PTR [ecx+eax*8], xmm0
-        movaps    XMMWORD PTR [esi+eax*8], xmm5
-        add       eax, 2
-        movzx     eax, ax
-        movzx     edi, WORD PTR [ebx+8]
-        cmp       eax, edi
-        jl        fftloop
-
-        mov       ebp, DWORD PTR [esp]
-
-l1_is_zero:
-
-        add       esp, 8
-        pop       esi
-        pop       edi
-        mov       esp, ebx
-        pop       ebx
-        ret
-    }
-}
-#endif
-
-#if 0
-static void passf4pos_sse_ido(const uint16_t ido, const uint16_t l1, const complex_t *cc,
-                              complex_t *ch, const complex_t *wa1, const complex_t *wa2,
-                              const complex_t *wa3)
-{
-    uint16_t i, k, ac, ah;
-
-    for (k = 0; k < l1; k++)
-    {
-        ac = 4*k*ido;
-        ah = k*ido;
-
-        for (i = 0; i < ido; i+=2)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15, m16;
-            __m128 n1, n2, n3, n4, n5, n6, n7, n8, n9, m17, m18, m19, m20, m21, m22, m23;
-            __m128 w1, w2, w3, w4, w5, w6, m24, m25, m26, m27, m28, m29, m30;
-            __m128 neg1 = _mm_set_ps(-1.0, 1.0, -1.0, 1.0);
-
-            m1 = _mm_load_ps(&RE(cc[ac+i]));
-            m2 = _mm_load_ps(&RE(cc[ac+i+2*ido]));
-            m3 = _mm_add_ps(m1, m2);
-            m4 = _mm_sub_ps(m1, m2);
-
-            n1 = _mm_load_ps(&RE(cc[ac+i+ido]));
-            n2 = _mm_load_ps(&RE(cc[ac+i+3*ido]));
-            n3 = _mm_add_ps(n1, n2);
-
-            n4 = _mm_mul_ps(neg1, n1);
-            n5 = _mm_mul_ps(neg1, n2);
-            n6 = _mm_sub_ps(n4, n5);
-
-            m5 = _mm_add_ps(m3, n3);
-
-            n7 = _mm_shuffle_ps(n6, n6, _MM_SHUFFLE(2, 3, 0, 1));
-            n8 = _mm_add_ps(m4, n7);
-
-            m6 = _mm_sub_ps(m3, n3);
-            n9 = _mm_sub_ps(m4, n7);
-
-            _mm_store_ps(&RE(ch[ah+i]), m5);
-
-#if 0
-            static INLINE void ComplexMult(real_t *y1, real_t *y2,
-                real_t x1, real_t x2, real_t c1, real_t c2)
-            {
-                *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
-                *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
-            }
-
-            m7.0 = RE(c2)*RE(wa1[i])
-            m7.1 = IM(c2)*IM(wa1[i])
-            m7.2 = RE(c6)*RE(wa1[i+1])
-            m7.3 = IM(c6)*IM(wa1[i+1])
-
-            m8.0 = RE(c2)*IM(wa1[i])
-            m8.1 = IM(c2)*RE(wa1[i])
-            m8.2 = RE(c6)*IM(wa1[i+1])
-            m8.3 = IM(c6)*RE(wa1[i+1])
-
-            RE(0) = m7.0 - m7.1
-            IM(0) = m8.0 + m8.1
-            RE(1) = m7.2 - m7.3
-            IM(1) = m8.2 + m8.3
-
-            ////
-            RE(0) = RE(c2)*RE(wa1[i])   - IM(c2)*IM(wa1[i])
-            IM(0) = RE(c2)*IM(wa1[i])   + IM(c2)*RE(wa1[i])
-            RE(1) = RE(c6)*RE(wa1[i+1]) - IM(c6)*IM(wa1[i+1])
-            IM(1) = RE(c6)*IM(wa1[i+1]) + IM(c6)*RE(wa1[i+1])
-#endif
-
-            w1 = _mm_load_ps(&RE(wa1[i]));
-            w3 = _mm_load_ps(&RE(wa2[i]));
-            w5 = _mm_load_ps(&RE(wa3[i]));
-
-            w2 = _mm_shuffle_ps(w1, w1, _MM_SHUFFLE(2, 3, 0, 1));
-            w4 = _mm_shuffle_ps(w3, w3, _MM_SHUFFLE(2, 3, 0, 1));
-            w6 = _mm_shuffle_ps(w5, w5, _MM_SHUFFLE(2, 3, 0, 1));
-
-            m7 = _mm_mul_ps(n8, w1);
-            m15 = _mm_mul_ps(m6, w3);
-            m23 = _mm_mul_ps(n9, w5);
-            m8 = _mm_mul_ps(n8, w2);
-            m16 = _mm_mul_ps(m6, w4);
-            m24 = _mm_mul_ps(n9, w6);
-
-            m9  = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(2, 0, 2, 0));
-            m17 = _mm_shuffle_ps(m15, m16, _MM_SHUFFLE(2, 0, 2, 0));
-            m25 = _mm_shuffle_ps(m23, m24, _MM_SHUFFLE(2, 0, 2, 0));
-            m10 = _mm_shuffle_ps(m7, m8, _MM_SHUFFLE(3, 1, 3, 1));
-            m18 = _mm_shuffle_ps(m15, m16, _MM_SHUFFLE(3, 1, 3, 1));
-            m26 = _mm_shuffle_ps(m23, m24, _MM_SHUFFLE(3, 1, 3, 1));
-
-            m11 = _mm_add_ps(m9, m10);
-            m19 = _mm_add_ps(m17, m18);
-            m27 = _mm_add_ps(m25, m26);
-            m12 = _mm_sub_ps(m9, m10);
-            m20 = _mm_sub_ps(m17, m18);
-            m28 = _mm_sub_ps(m25, m26);
-
-            m13 = _mm_shuffle_ps(m11, m11, _MM_SHUFFLE(0, 0, 3, 2));
-            m21 = _mm_shuffle_ps(m19, m19, _MM_SHUFFLE(0, 0, 3, 2));
-            m29 = _mm_shuffle_ps(m27, m27, _MM_SHUFFLE(0, 0, 3, 2));
-            m14 = _mm_unpacklo_ps(m12, m13);
-            m22 = _mm_unpacklo_ps(m20, m21);
-            m30 = _mm_unpacklo_ps(m28, m29);
-
-            _mm_store_ps(&RE(ch[ah+i+l1*ido]), m14);
-            _mm_store_ps(&RE(ch[ah+i+2*l1*ido]), m22);
-            _mm_store_ps(&RE(ch[ah+i+3*l1*ido]), m30);
-        }
-    }
-}
-#endif
-
 static void passf4pos(const uint16_t ido, const uint16_t l1, const complex_t *cc,
                       complex_t *ch, const complex_t *wa1, const complex_t *wa2,
                       const complex_t *wa3)
@@ -992,101 +689,6 @@
    cfftf1, cfftf, cfftb, cffti1, cffti. Complex FFTs.
   ----------------------------------------------------------------------*/
 
-#ifdef USE_SSE
-
-#define CONV(A,B,C) ( (A<<2) | ((B & 0x1)<<1) | ((C==1)&0x1) )
-
-static INLINE void cfftf1pos_sse(uint16_t n, complex_t *c, complex_t *ch,
-                                 const uint16_t *ifac, const complex_t *wa,
-                                 const int8_t isign)
-{
-    uint16_t i;
-    uint16_t k1, l1, l2;
-    uint16_t na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
-
-    nf = ifac[1];
-    na = 0;
-    l1 = 1;
-    iw = 0;
-
-    for (k1 = 2; k1 <= nf+1; k1++)
-    {
-        ip = ifac[k1];
-        l2 = ip*l1;
-        ido = n / l2;
-        idl1 = ido*l1;
-
-        ix2 = iw + ido;
-        ix3 = ix2 + ido;
-        ix4 = ix3 + ido;
-
-        switch (CONV(ip,na,ido))
-        {
-        case CONV(4,0,0):
-            //passf4pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
-            passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
-            break;
-        case CONV(4,0,1):
-            passf4pos_sse((const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]);
-            break;
-        case CONV(4,1,0):
-            passf4pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
-            //passf4pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
-            break;
-        case CONV(4,1,1):
-            passf4pos_sse((const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]);
-            break;
-        case CONV(2,0,0):
-            passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
-            //passf2pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
-            break;
-        case CONV(2,0,1):
-            passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
-            //passf2pos_sse((const uint16_t)l1, (const complex_t*)c, ch, &wa[iw]);
-            break;
-        case CONV(2,1,0):
-            passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
-            //passf2pos_sse_ido((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
-            break;
-        case CONV(2,1,1):
-            passf2pos((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
-            //passf2pos_sse((const uint16_t)l1, (const complex_t*)ch, c, &wa[iw]);
-            break;
-        case CONV(3,0,0):
-        case CONV(3,0,1):
-            passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign);
-            break;
-        case CONV(3,1,0):
-        case CONV(3,1,1):
-            passf3((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign);
-            break;
-        case CONV(5,0,0):
-        case CONV(5,0,1):
-            passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
-            break;
-        case CONV(5,1,0):
-        case CONV(5,1,1):
-            passf5((const uint16_t)ido, (const uint16_t)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign);
-            break;
-        }
-
-        na = 1 - na;
-
-        l1 = l2;
-        iw += (ip-1) * ido;
-    }
-
-    if (na == 0)
-        return;
-
-    for (i = 0; i < n; i++)
-    {
-        RE(c[i]) = RE(ch[i]);
-        IM(c[i]) = IM(ch[i]);
-    }
-}
-#endif
-
 static INLINE void cfftf1pos(uint16_t n, complex_t *c, complex_t *ch,
                              const uint16_t *ifac, const complex_t *wa,
                              const int8_t isign)
@@ -1254,13 +856,6 @@
 {
     cfftf1pos(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
 }
-
-#ifdef USE_SSE
-void cfftb_sse(cfft_info *cfft, complex_t *c)
-{
-    cfftf1pos_sse(cfft->n, c, cfft->work, (const uint16_t*)cfft->ifac, (const complex_t*)cfft->tab, +1);
-}
-#endif
 
 static void cffti1(uint16_t n, complex_t *wa, uint16_t *ifac)
 {
--- a/libfaad/cfft.h
+++ b/libfaad/cfft.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: cfft.h,v 1.19 2004/09/04 14:56:28 menno Exp $
+** $Id: cfft.h,v 1.20 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #ifndef __CFFT_H__
@@ -45,10 +45,6 @@
 void cfftb(cfft_info *cfft, complex_t *c);
 cfft_info *cffti(uint16_t n);
 void cfftu(cfft_info *cfft);
-
-#ifdef USE_SSE
-void cfftb_sse(cfft_info *cfft, complex_t *c);
-#endif
 
 
 #ifdef __cplusplus
--- a/libfaad/common.c
+++ b/libfaad/common.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: common.c,v 1.21 2004/09/04 14:56:28 menno Exp $
+** $Id: common.c,v 1.22 2004/09/08 09:43:11 gcp Exp $
 **/
 
 /* just some common functions that could be used anywhere */
@@ -33,67 +33,6 @@
 #include <stdlib.h>
 #include "syntax.h"
 
-#ifdef USE_SSE
-__declspec(naked) static int32_t __fastcall test_cpuid(void)
-{
-    __asm
-    {
-        pushf
-        pop eax
-        mov ecx,eax
-        xor eax,(1<<21)
-        push eax
-        popf
-        pushf
-        pop eax
-        push ecx
-        popf
-        cmp eax,ecx
-        mov eax,0
-        setne al
-        ret
-    }
-}
-
-__declspec(naked) static void __fastcall run_cpuid(int32_t param, int32_t out[4])
-{
-    __asm
-    {
-        pushad
-        push edx
-        mov eax,ecx
-        cpuid
-        pop edi
-        mov [edi+0],eax
-        mov [edi+4],ebx
-        mov [edi+8],ecx
-        mov [edi+12],edx
-        popad
-        ret
-    }
-}
-
-uint8_t cpu_has_sse()
-{
-    int32_t features[4];
-
-    if (test_cpuid())
-    {
-        run_cpuid(1, features);
-    }
-
-    /* check for SSE */
-    if (features[3] & 0x02000000)
-        return 1;
-
-    return 0;
-}
-#else
-uint8_t cpu_has_sse()
-{
-    return 0;
-}
-#endif
 
 /* Returns the sample rate index based on the samplerate */
 uint8_t get_sr_index(const uint32_t samplerate)
--- a/libfaad/common.h
+++ b/libfaad/common.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: common.h,v 1.64 2004/09/04 14:56:28 menno Exp $
+** $Id: common.h,v 1.65 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #ifndef __COMMON_H__
@@ -125,12 +125,6 @@
 # endif
 #endif
 
-#if ((defined(_WIN32) && !defined(_WIN32_WCE)) /* || ((__GNUC__ >= 3) && defined(__i386__)) */ )
-#ifndef FIXED_POINT
-/* includes <xmmintrin.h> to enable SSE intrinsics */
-//#define USE_SSE
-#endif
-#endif
 
 #ifdef FIXED_POINT
 #define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B)
@@ -276,10 +270,6 @@
 #else /* Normal floating point operation */
 
   typedef float real_t;
-
-#ifdef USE_SSE
-# include <xmmintrin.h>
-#endif
 
   #define MUL_R(A,B) ((A)*(B))
   #define MUL_C(A,B) ((A)*(B))
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: decoder.c,v 1.106 2004/09/04 14:56:28 menno Exp $
+** $Id: decoder.c,v 1.107 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #include "common.h"
@@ -142,15 +142,6 @@
 #endif
 
     hDecoder->drc = drc_init(REAL_CONST(1.0), REAL_CONST(1.0));
-
-#ifdef USE_SSE
-    if (cpu_has_sse())
-    {
-        hDecoder->apply_sf_func = apply_scalefactors_sse;
-    } else {
-        hDecoder->apply_sf_func = apply_scalefactors;
-    }
-#endif
 
     return hDecoder;
 }
--- 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 [email protected].
 **
-** $Id: filtbank.c,v 1.40 2004/09/04 14:56:28 menno Exp $
+** $Id: filtbank.c,v 1.41 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #include "common.h"
@@ -87,15 +87,6 @@
     }
 #endif
 
-#ifdef USE_SSE
-    if (cpu_has_sse())
-    {
-        fb->if_func = ifilter_bank_sse;
-    } else {
-        fb->if_func = ifilter_bank;
-    }
-#endif
-
     return fb;
 }
 
@@ -140,31 +131,7 @@
 #endif
 }
 
-#ifdef USE_SSE
-static INLINE void imdct_long_sse(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
-{
-#ifdef LD_DEC
-    mdct_info *mdct = NULL;
 
-    switch (len)
-    {
-    case 2048:
-    case 1920:
-        mdct = fb->mdct2048;
-        break;
-    case 1024:
-    case 960:
-        mdct = fb->mdct1024;
-        break;
-    }
-
-    faad_imdct_sse(mdct, in_data, out_data);
-#else
-    faad_imdct_sse(fb->mdct2048, in_data, out_data);
-#endif
-}
-#endif
-
 #ifdef LTP_DEC
 static INLINE void mdct(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
 {
@@ -362,334 +329,6 @@
 #endif
 }
 
-#ifdef USE_SSE
-void ifilter_bank_sse(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
-                      uint8_t window_shape_prev, real_t *freq_in,
-                      real_t *time_out, uint8_t object_type, uint16_t frame_len)
-{
-    int16_t i;
-    ALIGN real_t transf_buf[2*1024] = {0};
-
-    const real_t *window_long = NULL;
-    const real_t *window_long_prev = NULL;
-    const real_t *window_short = NULL;
-    const real_t *window_short_prev = NULL;
-
-    uint16_t nlong = frame_len;
-    uint16_t nshort = frame_len/8;
-    uint16_t trans = nshort/2;
-
-    uint16_t nflat_ls = (nlong-nshort)/2;
-
-#ifdef PROFILE
-    int64_t count = faad_get_ts();
-#endif
-
-#ifdef LD_DEC
-    if (object_type == LD)
-    {
-        window_long       = fb->ld_window[window_shape];
-        window_long_prev  = fb->ld_window[window_shape_prev];
-    } else {
-#endif
-        window_long       = fb->long_window[window_shape];
-        window_long_prev  = fb->long_window[window_shape_prev];
-        window_short      = fb->short_window[window_shape];
-        window_short_prev = fb->short_window[window_shape_prev];
-#ifdef LD_DEC
-    }
-#endif
-
-    switch (window_sequence)
-    {
-    case ONLY_LONG_SEQUENCE:
-        imdct_long_sse(fb, freq_in, transf_buf, 2*nlong);
-        for (i = 0; i < nlong; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-
-            m1 = _mm_load_ps(&transf_buf[i]);
-            m2 = _mm_load_ps(&window_long_prev[i]);
-            m6 = _mm_load_ps(&window_long[nlong-4-i]);
-            m3 = _mm_load_ps(&time_out[nlong+i]);
-            m5 = _mm_load_ps(&transf_buf[nlong+i]);
-
-            m4 = _mm_mul_ps(m1, m2);
-            m7 = _mm_shuffle_ps(m6, m6, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_add_ps(m4, m3);
-            m8 = _mm_mul_ps(m5, m7);
-
-            _mm_store_ps(&time_out[i], m4);
-            _mm_store_ps(&time_out[nlong+i], m8);
-        }
-        break;
-
-    case LONG_START_SEQUENCE:
-        imdct_long_sse(fb, freq_in, transf_buf, 2*nlong);
-        for (i = 0; i < nlong; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[i]);
-            __m128 m2 = _mm_load_ps(&window_long_prev[i]);
-            __m128 m3 = _mm_load_ps(&time_out[nlong+i]);
-
-            __m128 m4 = _mm_mul_ps(m1, m2);
-            m4 = _mm_add_ps(m4, m3);
-
-            _mm_store_ps(&time_out[i], m4);
-        }
-        for (i = 0; i < nflat_ls; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[nlong+i]);
-            _mm_store_ps(&time_out[nlong+i], m1);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[nlong+nflat_ls+i]);
-            __m128 m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            __m128 m3, m4;
-
-            m3 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m3);
-
-            _mm_store_ps(&time_out[nlong+nflat_ls+i], m4);
-        }
-        for (i = 0; i < nflat_ls; i+=4)
-        {
-            __m128 m1 = _mm_setzero_ps();
-            _mm_store_ps(&time_out[nlong+nflat_ls+nshort+i], m1);
-        }
-        break;
-
-    case EIGHT_SHORT_SEQUENCE:
-        faad_imdct_sse(fb->mdct256, &freq_in[0*nshort], &transf_buf[2*nshort*0]);
-        faad_imdct_sse(fb->mdct256, &freq_in[1*nshort], &transf_buf[2*nshort*1]);
-        faad_imdct_sse(fb->mdct256, &freq_in[2*nshort], &transf_buf[2*nshort*2]);
-        faad_imdct_sse(fb->mdct256, &freq_in[3*nshort], &transf_buf[2*nshort*3]);
-        faad_imdct_sse(fb->mdct256, &freq_in[4*nshort], &transf_buf[2*nshort*4]);
-        faad_imdct_sse(fb->mdct256, &freq_in[5*nshort], &transf_buf[2*nshort*5]);
-        faad_imdct_sse(fb->mdct256, &freq_in[6*nshort], &transf_buf[2*nshort*6]);
-        faad_imdct_sse(fb->mdct256, &freq_in[7*nshort], &transf_buf[2*nshort*7]);
-        for (i = 0; i < nflat_ls; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&time_out[nlong+i]);
-            _mm_store_ps(&time_out[i], m1);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[nshort*0+i]);
-            __m128 m2 = _mm_load_ps(&window_short_prev[i]);
-            __m128 m3 = _mm_load_ps(&time_out[nlong+nflat_ls+i]);
-
-            __m128 m4 = _mm_mul_ps(m1, m2);
-            m4 = _mm_add_ps(m4, m3);
-
-            _mm_store_ps(&time_out[nflat_ls+i], m4);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*1+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m3 = _mm_load_ps(&time_out[nlong+nflat_ls+nshort*1+i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*2+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m4 = _mm_add_ps(m4, m3);
-            m4 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+1*nshort+i], m4);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*3+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m3 = _mm_load_ps(&time_out[nlong+nflat_ls+nshort*2+i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*4+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m4 = _mm_add_ps(m4, m3);
-            m4 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+2*nshort+i], m4);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*5+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m3 = _mm_load_ps(&time_out[nlong+nflat_ls+nshort*3+i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*6+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m4 = _mm_add_ps(m4, m3);
-            m4 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+3*nshort+i], m4);
-        }
-        for(i = 0; i < trans; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*7+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m3 = _mm_load_ps(&time_out[nlong+nflat_ls+nshort*4+i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*8+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m4 = _mm_add_ps(m4, m3);
-            m4 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+4*nshort+i], m4);
-        }
-        for (i = trans; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*7+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*8+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m3 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+4*nshort+i], m3);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*9+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*10+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m3 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+5*nshort+i], m3);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*11+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*12+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m3 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+6*nshort+i], m3);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m4, m5, m6, m7, m8;
-            m1 = _mm_load_ps(&transf_buf[nshort*13+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-            m6 = _mm_load_ps(&transf_buf[nshort*14+i]);
-            m7 = _mm_load_ps(&window_short[i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m5);
-            m8 = _mm_mul_ps(m6, m7);
-            m3 = _mm_add_ps(m4, m8);
-
-            _mm_store_ps(&time_out[nflat_ls+7*nshort+i], m3);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1, m2, m3, m5;
-            m1 = _mm_load_ps(&transf_buf[nshort*15+i]);
-            m2 = _mm_load_ps(&window_short[nshort-4-i]);
-
-            m5 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m3 = _mm_mul_ps(m1, m5);
-
-            _mm_store_ps(&time_out[nflat_ls+8*nshort+i], m3);
-        }
-        for (i = 0; i < nflat_ls; i+=4)
-        {
-            __m128 m1 = _mm_setzero_ps();
-            _mm_store_ps(&time_out[nlong+nflat_ls+nshort+i], m1);
-        }
-        break;
-
-    case LONG_STOP_SEQUENCE:
-        imdct_long_sse(fb, freq_in, transf_buf, 2*nlong);
-        for (i = 0; i < nflat_ls; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&time_out[nlong+i]);
-            _mm_store_ps(&time_out[i], m1);
-        }
-        for (i = 0; i < nshort; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[nflat_ls+i]);
-            __m128 m2 = _mm_load_ps(&window_short_prev[i]);
-            __m128 m3 = _mm_load_ps(&time_out[nlong+nflat_ls+i]);
-
-            __m128 m4 = _mm_mul_ps(m1, m2);
-            m4 = _mm_add_ps(m4, m3);
-
-            _mm_store_ps(&time_out[nflat_ls+i], m4);
-        }
-        for (i = 0; i < nflat_ls; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[nflat_ls+nshort+i]);
-            __m128 m2 = _mm_load_ps(&time_out[nlong+nflat_ls+nshort+i]);
-
-            __m128 m3 = _mm_add_ps(m1, m2);
-
-            _mm_store_ps(&time_out[nflat_ls+nshort+i], m3);
-        }
-        for (i = 0; i < nlong; i+=4)
-        {
-            __m128 m1 = _mm_load_ps(&transf_buf[nlong+i]);
-            __m128 m2 = _mm_load_ps(&window_long[nlong-4-i]);
-            __m128 m3, m4;
-
-            m3 = _mm_shuffle_ps(m2, m2, _MM_SHUFFLE(0, 1, 2, 3));
-
-            m4 = _mm_mul_ps(m1, m3);
-
-            _mm_store_ps(&time_out[nlong+i], m4);
-        }
-		break;
-    }
-
-#ifdef PROFILE
-    count = faad_get_ts() - count;
-    fb->cycles += count;
-#endif
-}
-#endif
 
 #ifdef LTP_DEC
 /* only works for LTP -> no overlapping, no short blocks */
--- a/libfaad/filtbank.h
+++ b/libfaad/filtbank.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: filtbank.h,v 1.22 2004/09/04 14:56:28 menno Exp $
+** $Id: filtbank.h,v 1.23 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #ifndef __FILTBANK_H__
@@ -51,12 +51,6 @@
                   uint8_t window_shape_prev, real_t *freq_in,
                   real_t *time_out, real_t *overlap,
                   uint8_t object_type, uint16_t frame_len);
-
-#ifdef USE_SSE
-void ifilter_bank_sse(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
-                      uint8_t window_shape_prev, real_t *freq_in,
-                      real_t *time_out, uint8_t object_type, uint16_t frame_len);
-#endif
 
 #ifdef __cplusplus
 }
--- a/libfaad/mdct.h
+++ b/libfaad/mdct.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: mdct.h,v 1.25 2004/09/04 14:56:28 menno Exp $
+** $Id: mdct.h,v 1.26 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #ifndef __MDCT_H__
@@ -36,9 +36,6 @@
 mdct_info *faad_mdct_init(uint16_t N);
 void faad_mdct_end(mdct_info *mdct);
 void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
-#ifdef USE_SSE
-void faad_imdct_sse(mdct_info *mdct, real_t *X_in, real_t *X_out);
-#endif
 void faad_mdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
 
 
--- a/libfaad/sbr_fbt.c
+++ b/libfaad/sbr_fbt.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: sbr_fbt.c,v 1.16 2004/09/04 14:56:28 menno Exp $
+** $Id: sbr_fbt.c,v 1.17 2004/09/08 09:43:11 gcp Exp $
 **/
 
 /* Calculate frequency band tables */
@@ -197,7 +197,7 @@
     if (k2 <= k0)
     {
         sbr->N_master = 0;
-        return 0;
+        return 1;
     }
 
     dk = bs_alter_scale ? 2 : 1;
@@ -363,7 +363,7 @@
     if (k2 <= k0)
     {
         sbr->N_master = 0;
-        return 0;
+        return 1;
     }
 
     bands = temp1[bs_freq_scale-1];
--- a/libfaad/sbr_hfgen.c
+++ b/libfaad/sbr_hfgen.c
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: sbr_hfgen.c,v 1.21 2004/09/04 14:56:28 menno Exp $
+** $Id: sbr_hfgen.c,v 1.22 2004/09/08 09:43:11 gcp Exp $
 **/
 
 /* High Frequency generation */
@@ -615,6 +615,15 @@
             k = i+1;
     } else {
         k = sbr->N_master;
+    }
+
+    if (sbr->N_master == 0)
+    {
+        sbr->noPatches = 0;
+        sbr->patchNoSubbands[0] = 0;
+        sbr->patchStartSubband[0] = 0;
+
+        return;
     }
 
     do
--- a/libfaad/sbr_qmf.h
+++ b/libfaad/sbr_qmf.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: sbr_qmf.h,v 1.20 2004/09/04 14:56:28 menno Exp $
+** $Id: sbr_qmf.h,v 1.21 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #ifndef __SBR_QMF_H__
@@ -43,10 +43,6 @@
                           real_t *output);
 void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
                           real_t *output);
-#ifdef USE_SSE
-void sbr_qmf_synthesis_64_sse(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
-                              real_t *output);
-#endif
 
 
 #ifdef __cplusplus
--- 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 [email protected].
 **
-** $Id: specrec.c,v 1.55 2004/09/04 18:37:58 gcp Exp $
+** $Id: specrec.c,v 1.56 2004/09/08 09:43:11 gcp Exp $
 **/
 
 /*
@@ -864,7 +864,11 @@
 
 
     /* always allocate 2 channels, PS can always "suddenly" turn up */
+#if (defined(PS_DEC) || defined(DRM_PS))
     output_channels = 2;
+#else
+    output_channels = 1;
+#endif
 
     if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0)
     {
@@ -953,16 +957,10 @@
     if (hDecoder->object_type != SSR)
     {
 #endif
-#ifdef USE_SSE
-        hDecoder->fb->if_func(hDecoder->fb, ics->window_sequence, ics->window_shape,
-            hDecoder->window_shape_prev[sce->channel], spec_coef,
-            hDecoder->time_out[sce->channel], hDecoder->object_type, hDecoder->frameLength);
-#else
         ifilter_bank(hDecoder->fb, ics->window_sequence, ics->window_shape,
             hDecoder->window_shape_prev[sce->channel], spec_coef,
             hDecoder->time_out[sce->channel], hDecoder->fb_intermed[sce->channel],
             hDecoder->object_type, hDecoder->frameLength);
-#endif
 #ifdef SSR_DEC
     } else {
         ssr_decode(&(ics->ssr), hDecoder->fb, ics->window_sequence, ics->window_shape,
@@ -1031,6 +1029,7 @@
 #endif
 
     /* copy L to R when no PS is used */
+#if (defined(PS_DEC) || defined(DRM_PS))
     if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0))
     {
         uint8_t ele = hDecoder->fr_ch_ele;
@@ -1040,6 +1039,7 @@
 
         memcpy(hDecoder->time_out[ch+1], hDecoder->time_out[ch], frame_size);
     }
+#endif
 
     return 0;
 }
@@ -1196,14 +1196,6 @@
     if (hDecoder->object_type != SSR)
     {
 #endif
-#ifdef USE_SSE
-        hDecoder->fb->if_func(hDecoder->fb, ics1->window_sequence, ics1->window_shape,
-            hDecoder->window_shape_prev[cpe->channel], spec_coef1,
-            hDecoder->time_out[cpe->channel], hDecoder->object_type, hDecoder->frameLength);
-        hDecoder->fb->if_func(hDecoder->fb, ics2->window_sequence, ics2->window_shape,
-            hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
-            hDecoder->time_out[cpe->paired_channel], hDecoder->object_type, hDecoder->frameLength);
-#else
         ifilter_bank(hDecoder->fb, ics1->window_sequence, ics1->window_shape,
             hDecoder->window_shape_prev[cpe->channel], spec_coef1,
             hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
@@ -1212,7 +1204,6 @@
             hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
             hDecoder->time_out[cpe->paired_channel], hDecoder->fb_intermed[cpe->paired_channel],
             hDecoder->object_type, hDecoder->frameLength);
-#endif
 #ifdef SSR_DEC
     } else {
         ssr_decode(&(ics1->ssr), hDecoder->fb, ics1->window_sequence, ics1->window_shape,
--- a/libfaad/structs.h
+++ b/libfaad/structs.h
@@ -22,7 +22,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Ahead Software through [email protected].
 **
-** $Id: structs.h,v 1.41 2004/09/04 14:56:29 menno Exp $
+** $Id: structs.h,v 1.42 2004/09/08 09:43:11 gcp Exp $
 **/
 
 #ifndef __STRUCTS_H__
@@ -77,9 +77,6 @@
 #ifdef PROFILE
     int64_t cycles;
 #endif
-#ifdef USE_SSE
-    void (*if_func)(void *a, uint8_t b, uint8_t c, uint8_t d, real_t *e, real_t *f, uint8_t g, uint16_t h);
-#endif
 } fb_info;
 
 typedef struct
@@ -458,10 +455,6 @@
 
     /* Configuration data */
     NeAACDecConfiguration config;
-
-#ifdef USE_SSE
-    void (*apply_sf_func)(void *a, void *b, void *c, uint16_t d);
-#endif
 
 #ifdef PROFILE
     int64_t cycles;