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

jm at svn.xiph.org jm at svn.xiph.org
Mon Dec 12 13:25:55 PST 2005


Author: jm
Date: 2005-12-12 13:25:53 -0800 (Mon, 12 Dec 2005)
New Revision: 10584

Modified:
   trunk/speex/libspeex/mdf.c
Log:
prevent offsets caused by quantization


Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2005-12-12 14:00:27 UTC (rev 10583)
+++ trunk/speex/libspeex/mdf.c	2005-12-12 21:25:53 UTC (rev 10584)
@@ -139,7 +139,7 @@
    {
       tmp1 = MAC16_16(tmp1, X[j*N],Y[j*N]);
    }
-   acc[0] = SHR32(tmp1,WEIGHT_SHIFT);
+   acc[0] = PSHR32(tmp1,WEIGHT_SHIFT);
    for (i=1;i<N-1;i+=2)
    {
       tmp1 = tmp2 = 0;
@@ -148,15 +148,15 @@
          tmp1 = SUB32(MAC16_16(tmp1, X[j*N+i],Y[j*N+i]), MULT16_16(X[j*N+i+1],Y[j*N+i+1]));
          tmp2 = MAC16_16(MAC16_16(tmp2, X[j*N+i+1],Y[j*N+i]), X[j*N+i], Y[j*N+i+1]);
       }
-      acc[i] = SHR32(tmp1,WEIGHT_SHIFT);
-      acc[i+1] = SHR32(tmp2,WEIGHT_SHIFT);
+      acc[i] = PSHR32(tmp1,WEIGHT_SHIFT);
+      acc[i+1] = PSHR32(tmp2,WEIGHT_SHIFT);
    }
    tmp1 = tmp2 = 0;
    for (j=0;j<M;j++)
    {
       tmp1 = MAC16_16(tmp1, X[(j+1)*N-1],Y[(j+1)*N-1]);
    }
-   acc[N-1] = SHR32(tmp1,WEIGHT_SHIFT);
+   acc[N-1] = PSHR32(tmp1,WEIGHT_SHIFT);
 }
 #else
 static inline void spectral_mul_accum(spx_word16_t *X, spx_word16_t *Y, spx_word16_t *acc, int N, int M)



More information about the commits mailing list