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

jm at svn.xiph.org jm at svn.xiph.org
Fri Nov 3 04:03:20 PST 2006


Author: jm
Date: 2006-11-03 04:03:17 -0800 (Fri, 03 Nov 2006)
New Revision: 12003

Modified:
   trunk/speex/libspeex/preprocess.c
Log:
almost done converting hypergeom_gain() to fixed-point


Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c	2006-11-03 11:03:04 UTC (rev 12002)
+++ trunk/speex/libspeex/preprocess.c	2006-11-03 12:03:17 UTC (rev 12003)
@@ -284,6 +284,7 @@
    int ind;
    spx_word16_t frac;
    float x;
+   /* Q13 table */
    static const spx_word16_t table[21] = {
        6730,  8357,  9868, 11267, 12563, 13770, 14898,
       15959, 16961, 17911, 18816, 19682, 20512, 21311,
@@ -295,7 +296,7 @@
       if (ind>19)
          return FRAC_SCALING*(1+.1296/x);
       frac = SHL32(xx-SHL32(ind,10),5);
-      return (MULT16_16(Q15_ONE-frac,table[ind]) + MULT16_16(frac,table[ind+1]))/(8192.*sqrt(x+.0001f));
+      return SHL32(DIV32_16(PSHR32(MULT16_16(Q15_ONE-frac,table[ind]) + MULT16_16(frac,table[ind+1]),7),(spx_sqrt(SHL32(xx,15)+6711))),7);
 }
 
 static inline spx_word16_t qcurve(spx_word16_t x)



More information about the commits mailing list