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

jm at svn.xiph.org jm at svn.xiph.org
Sun Dec 24 18:31:50 PST 2006


Author: jm
Date: 2006-12-24 18:31:47 -0800 (Sun, 24 Dec 2006)
New Revision: 12237

Modified:
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/sb_celp.c
Log:
fixed-point: minor tweaks


Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2006-12-24 22:18:49 UTC (rev 12236)
+++ trunk/speex/libspeex/nb_celp.c	2006-12-25 02:31:47 UTC (rev 12237)
@@ -1339,7 +1339,7 @@
    {
       VARDECL(spx_coef_t *lpc);
       ALLOC(lpc, st->lpcSize, spx_coef_t);
-      bw_lpc(GAMMA_SCALING*.93, st->interp_qlpc, lpc, st->lpcSize);
+      bw_lpc(QCONST16(0.93f,15), st->interp_qlpc, lpc, st->lpcSize);
       {
          float innov_gain=0;
          float pgain=GAIN_SCALING_1*st->last_pitch_gain;

Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c	2006-12-24 22:18:49 UTC (rev 12236)
+++ trunk/speex/libspeex/sb_celp.c	2006-12-25 02:31:47 UTC (rev 12237)
@@ -258,6 +258,11 @@
    st->mem_sp2 = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t));
    st->mem_sw = (spx_mem_t*)speex_alloc((st->lpcSize)*sizeof(spx_mem_t));
 
+   for (i=0;i<st->lpcSize;i++)
+   {
+      st->old_lsp[i]=LSP_SCALING*(M_PI*((float)(i+1)))/(st->lpcSize+1);
+   }
+
    st->vbr_quality = 8;
    st->vbr_enabled = 0;
    st->vbr_max = 0;
@@ -407,7 +412,7 @@
          /*If we can't find all LSP's, do some damage control and use a flat filter*/
          for (i=0;i<st->lpcSize;i++)
          {
-            st->lsp[i]=LSP_SCALING*M_PI*((float)(i+1))/(st->lpcSize+1);
+            st->lsp[i]=st->old_lsp[i];
          }
       }
    }
@@ -846,7 +851,7 @@
       saved_modeid=st->submodeID;
       st->submodeID=1;
    } else {
-      bw_lpc(GAMMA_SCALING*0.99, st->interp_qlpc, st->interp_qlpc, st->lpcSize);
+      bw_lpc(QCONST16(0.99f,15), st->interp_qlpc, st->interp_qlpc, st->lpcSize);
    }
 
    st->first=1;



More information about the commits mailing list