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

jm at svn.xiph.org jm at svn.xiph.org
Sun Jul 30 08:06:44 PDT 2006


Author: jm
Date: 2006-07-30 08:06:42 -0700 (Sun, 30 Jul 2006)
New Revision: 11725

Modified:
   trunk/speex/libspeex/filters.c
Log:
fixed-point version of the high-pass seems to work now.


Modified: trunk/speex/libspeex/filters.c
===================================================================
--- trunk/speex/libspeex/filters.c	2006-07-30 14:35:08 UTC (rev 11724)
+++ trunk/speex/libspeex/filters.c	2006-07-30 15:06:42 UTC (rev 11725)
@@ -78,11 +78,12 @@
    for (i=0;i<len;i++)
    {
       spx_word16_t xi, yi, nyi;
+      spx_word32_t vout = ADD32(MULT16_16(num[0], x[i]),mem[0]);
       xi = x[i];
-      yi = EXTRACT16(SATURATE(PSHR32(ADD32(MULT16_16(num[0], x[i]),mem[0]),15),32767));
+      yi = EXTRACT16(SATURATE(PSHR32(vout,14),32767));
       nyi = NEG16(yi);
-      mem[0] = MAC16_16(MAC16_16(mem[1], num[1],xi), den[1],nyi);
-      mem[1] = ADD32(MULT16_16(num[2],xi), MULT16_16(den[2],nyi));
+      mem[0] = ADD32(MAC16_16(mem[1], num[1],xi), MULT16_32_Q14(-den[1],vout));
+      mem[1] = ADD32(MULT16_16(num[2],xi), MULT16_32_Q14(-den[2],vout));
       y[i] = yi;
    }
 }



More information about the commits mailing list