[xiph-cvs] cvs commit: speex/libspeex sb_celp.c

Jean-Marc Valin jm at xiph.org
Mon Nov 10 20:33:41 PST 2003



jm          03/11/10 23:33:40

  Modified:    libspeex sb_celp.c
  Log:
  fixed-point: some wideband work

Revision  Changes    Path
1.144     +10 -14    speex/libspeex/sb_celp.c

Index: sb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/sb_celp.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -r1.143 -r1.144
--- sb_celp.c	9 Oct 2003 21:33:52 -0000	1.143
+++ sb_celp.c	11 Nov 2003 04:33:38 -0000	1.144
@@ -502,12 +502,9 @@
       sw=st->sw+offset;
       
       /* LSP interpolation (quantized and unquantized) */
-      tmp = (1.0 + sub)/st->nbSubframes;
-      for (i=0;i<st->lpcSize;i++)
-         st->interp_lsp[i] = (1-tmp)*st->old_lsp[i] + tmp*st->lsp[i];
-      for (i=0;i<st->lpcSize;i++)
-         st->interp_qlsp[i] = (1-tmp)*st->old_qlsp[i] + tmp*st->qlsp[i];
-      
+      lsp_interpolate(st->old_lsp, st->lsp, st->interp_lsp, st->lpcSize, sub, st->nbSubframes);
+      lsp_interpolate(st->old_qlsp, st->qlsp, st->interp_qlsp, st->lpcSize, sub, st->nbSubframes);
+
       lsp_enforce_margin(st->interp_lsp, st->lpcSize, .05);
       lsp_enforce_margin(st->interp_qlsp, st->lpcSize, .05);
 
@@ -622,8 +619,7 @@
            exc[i]=0;
 
 
-         for (i=0;i<st->subframeSize;i++)
-            target[i]*=scale_1;
+         signal_div(target, target, scale, st->subframeSize);
 
          /* Reset excitation */
          for (i=0;i<st->subframeSize;i++)
@@ -635,8 +631,10 @@
                                    innov, syn_resp, bits, stack, (st->complexity+1)>>1);
          /*print_vec(target, st->subframeSize, "after");*/
 
+         signal_mul(innov, innov, scale, st->subframeSize);
+
          for (i=0;i<st->subframeSize;i++)
-            exc[i] += innov[i]*scale;
+            exc[i] += innov[i];
 
          if (SUBMODE(double_codebook)) {
             char *tmp_stack=stack;
@@ -966,9 +964,7 @@
       exc=st->exc+offset;
       
       /* LSP interpolation */
-      tmp = (1.0 + sub)/st->nbSubframes;
-      for (i=0;i<st->lpcSize;i++)
-         st->interp_qlsp[i] = (1-tmp)*st->old_qlsp[i] + tmp*st->qlsp[i];
+      lsp_interpolate(st->old_qlsp, st->qlsp, st->interp_qlsp, st->lpcSize, sub, st->nbSubframes);
 
       lsp_enforce_margin(st->interp_qlsp, st->lpcSize, .05);
 
@@ -1046,8 +1042,8 @@
 
          SUBMODE(innovation_unquant)(exc, SUBMODE(innovation_params), st->subframeSize, 
                                 bits, stack);
-         for (i=0;i<st->subframeSize;i++)
-            exc[i]*=scale;
+
+         signal_mul(exc,exc,scale,st->subframeSize);
 
          if (SUBMODE(double_codebook)) {
             char *tmp_stack=stack;

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list