[xiph-commits] r11094 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Tue Apr 4 10:24:14 PDT 2006


Author: jm
Date: 2006-04-04 10:24:11 -0700 (Tue, 04 Apr 2006)
New Revision: 11094

Modified:
   trunk/speex/libspeex/filters.c
Log:
accuracy improvement in QMF


Modified: trunk/speex/libspeex/filters.c
===================================================================
--- trunk/speex/libspeex/filters.c	2006-04-04 08:30:25 UTC (rev 11093)
+++ trunk/speex/libspeex/filters.c	2006-04-04 17:24:11 UTC (rev 11094)
@@ -426,12 +426,14 @@
       y2[k]=0;
       for (j=0;j<M2;j++)
       {
-         y1[k]=ADD32(y1[k],SHR(MULT16_16(a[j],ADD16(x[i+j],x2[i-j])),1));
-         y2[k]=SUB32(y2[k],SHR(MULT16_16(a[j],SUB16(x[i+j],x2[i-j])),1));
+         y1[k]=ADD32(y1[k],MULT16_16(a[j],ADD16(x[i+j],x2[i-j])));
+         y2[k]=SUB32(y2[k],MULT16_16(a[j],SUB16(x[i+j],x2[i-j])));
          j++;
-         y1[k]=ADD32(y1[k],SHR(MULT16_16(a[j],ADD16(x[i+j],x2[i-j])),1));
-         y2[k]=ADD32(y2[k],SHR(MULT16_16(a[j],SUB16(x[i+j],x2[i-j])),1));
+         y1[k]=ADD32(y1[k],MULT16_16(a[j],ADD16(x[i+j],x2[i-j])));
+         y2[k]=ADD32(y2[k],MULT16_16(a[j],SUB16(x[i+j],x2[i-j])));
       }
+      y1[k] = SHR(y1[k],1);
+      y2[k] = SHR(y2[k],1);
    }
    for (i=0;i<M-1;i++)
      mem[i]=SATURATE(PSHR(xx[N-i-1],1),16383);
@@ -450,7 +452,7 @@
    ALLOC(xx, M+N-1, spx_word16_t);
 
    for (i = 0; i < N/2; i++)
-      xx[2*i] = SHR(x[N/2-1-i],SIG_SHIFT+1);
+      xx[2*i] = PSHR(x[N/2-1-i],SIG_SHIFT+1);
    for (i = 0; i < M - 1; i += 2)
       xx[N+i] = mem[i+1];
 



More information about the commits mailing list