fixed-point: integerized bandwidth expansion
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Mon, 10 Nov 2003 17:17:33 +0000 (17:17 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Mon, 10 Nov 2003 17:17:33 +0000 (17:17 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@5554 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/filters.c

index d85b4ee..e75a2ea 100644 (file)
 #include "misc.h"
 #include "math_approx.h"
 
+
+#ifdef FIXED_POINT
+void bw_lpc(float gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
+{
+   int i;
+   lpc_out[0] = lpc_in[0];
+   spx_word16_t g=gamma*32768;
+   spx_word16_t tmp=g;
+   for (i=1;i<order+1;i++)
+   {
+      lpc_out[i] = MULT16_16_Q15(tmp,lpc_in[i]);
+      tmp = MULT16_16_Q15(tmp, g);
+   }
+}
+#else
 void bw_lpc(float gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
 {
    int i;
@@ -47,6 +62,9 @@ void bw_lpc(float gamma, spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order)
    }
 }
 
+#endif
+
+
 #ifdef FIXED_POINT
 
 /* FIXME: These functions are ugly and probably might too much error */