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

jm at svn.xiph.org jm at svn.xiph.org
Wed Apr 19 10:13:58 PDT 2006


Author: jm
Date: 2006-04-19 10:13:55 -0700 (Wed, 19 Apr 2006)
New Revision: 11169

Modified:
   trunk/speex/libspeex/nb_celp.c
Log:
24.6 kbps mode now entirely in fixed-point.


Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2006-04-19 15:51:03 UTC (rev 11168)
+++ trunk/speex/libspeex/nb_celp.c	2006-04-19 17:13:55 UTC (rev 11169)
@@ -960,11 +960,11 @@
             for (i=0;i<st->subframeSize;i++)
                innov2[i]=0;
             for (i=0;i<st->subframeSize;i++)
-               target[i]*=2.2;
+               target[i]=MULT16_32_Q13(QCONST16(2.2,13), target[i]);
             SUBMODE(innovation_quant)(target, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, 
                                       SUBMODE(innovation_params), st->lpcSize, st->subframeSize, 
                                       innov2, syn_resp, bits, stack, st->complexity, 0);
-            signal_mul(innov2, innov2, (spx_word32_t) (ener*(1.f/2.2f)), st->subframeSize);
+            signal_mul(innov2, innov2, MULT16_32_Q15(QCONST16(0.454545,15),ener), st->subframeSize);
             for (i=0;i<st->subframeSize;i++)
                exc[i] = ADD32(exc[i],innov2[i]);
             if (innov_save)
@@ -1672,7 +1672,7 @@
             for (i=0;i<st->subframeSize;i++)
                innov2[i]=0;
             SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize, bits, stack);
-            signal_mul(innov2, innov2, (spx_word32_t) (ener*(1/2.2)), st->subframeSize);
+            signal_mul(innov2, innov2, MULT16_32_Q15(QCONST16(0.454545,15),ener), st->subframeSize);
             for (i=0;i<st->subframeSize;i++)
                exc[i] = ADD32(exc[i],innov2[i]);
             stack = tmp_stack;



More information about the commits mailing list