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

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Wed Feb 2 11:20:09 PST 2005


Author: jm
Date: 2005-02-02 11:20:07 -0800 (Wed, 02 Feb 2005)
New Revision: 8823

Modified:
   trunk/speex/libspeex/cb_search.c
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/sb_celp.c
Log:
Misc fixed-point fixes


Modified: trunk/speex/libspeex/cb_search.c
===================================================================
--- trunk/speex/libspeex/cb_search.c	2005-02-02 08:05:12 UTC (rev 8822)
+++ trunk/speex/libspeex/cb_search.c	2005-02-02 19:20:07 UTC (rev 8823)
@@ -238,7 +238,7 @@
             /*compute error (distance)*/
             err=odist[j];
             for (m=i*subvect_size;m<(i+1)*subvect_size;m++)
-               err += t[m]*t[m];
+               err = MAC16_16(err, t[m],t[m]);
             /*update n-best list*/
             if (err<ndist[N-1] || ndist[N-1]<-1)
             {

Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2005-02-02 08:05:12 UTC (rev 8822)
+++ trunk/speex/libspeex/nb_celp.c	2005-02-02 19:20:07 UTC (rev 8823)
@@ -380,7 +380,7 @@
 
       } else {
 #endif
-         ol_gain = SHL(compute_rms(st->exc, st->frameSize),SIG_SHIFT);
+         ol_gain = SHL((spx_word32_t)compute_rms(st->exc, st->frameSize),SIG_SHIFT);
 #ifdef EPIC_48K
       }
 #endif
@@ -803,7 +803,7 @@
          
          residue_percep_zero(target, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, st->buf2, st->subframeSize, st->lpcSize, stack);
 
-         ener = SHL(compute_rms(st->buf2, st->subframeSize),SIG_SHIFT);
+         ener = SHL((spx_word32_t)compute_rms(st->buf2, st->subframeSize),SIG_SHIFT);
 
          /*for (i=0;i<st->subframeSize;i++)
             printf ("%f\n", st->buf2[i]/ener);

Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c	2005-02-02 08:05:12 UTC (rev 8822)
+++ trunk/speex/libspeex/sb_celp.c	2005-02-02 19:20:07 UTC (rev 8823)
@@ -565,6 +565,21 @@
 
          /* Gain to use if we want to use the low-band excitation for high-band */
          g=eh/(.01+el);
+         
+#if 0
+         {
+            char *tmp_stack=stack;
+            float *tmp_sig;
+            float g2;
+            tmp_sig = PUSH(tmp_stack, st->subframeSize, spx_sig_t);
+            for (i=0;i<st->lpcSize;i++)
+               mem[i]=st->mem_sp[i];
+            iir_mem2(low_innov+offset, st->interp_qlpc, tmp_sig, st->subframeSize, st->lpcSize, mem);
+            g2 = compute_rms(sp, st->subframeSize)/(.01+compute_rms(tmp_sig, st->subframeSize));
+            /*fprintf (stderr, "gains: %f %f\n", g, g2);*/
+            g = g2;
+         }
+#endif
 
 #ifdef FIXED_POINT
          g *= filter_ratio/128.;



More information about the commits mailing list