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

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Tue Mar 1 15:47:57 PST 2005


Author: jm
Date: 2005-03-01 15:47:54 -0800 (Tue, 01 Mar 2005)
New Revision: 9002

Modified:
   trunk/speex/libspeex/cb_search.c
   trunk/speex/libspeex/ltp.c
   trunk/speex/libspeex/nb_celp.c
   trunk/speex/libspeex/nb_celp.h
   trunk/speex/libspeex/sb_celp.c
Log:
cleanup


Modified: trunk/speex/libspeex/cb_search.c
===================================================================
--- trunk/speex/libspeex/cb_search.c	2005-03-01 17:05:06 UTC (rev 9001)
+++ trunk/speex/libspeex/cb_search.c	2005-03-01 23:47:54 UTC (rev 9002)
@@ -38,7 +38,6 @@
 #include "stack_alloc.h"
 #include "vq.h"
 #include "misc.h"
-#include <stdio.h>
 
 #ifdef _USE_SSE
 #include "cb_search_sse.h"

Modified: trunk/speex/libspeex/ltp.c
===================================================================
--- trunk/speex/libspeex/ltp.c	2005-03-01 17:05:06 UTC (rev 9001)
+++ trunk/speex/libspeex/ltp.c	2005-03-01 23:47:54 UTC (rev 9002)
@@ -41,8 +41,11 @@
 #include <speex/speex_bits.h>
 #include "math_approx.h"
 
-#include <stdio.h>
+#ifndef NULL
+#define NULL 0
+#endif
 
+
 #ifdef _USE_SSE
 #include "ltp_sse.h"
 #elif defined (ARM4_ASM) || defined(ARM5E_ASM)

Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c	2005-03-01 17:05:06 UTC (rev 9001)
+++ trunk/speex/libspeex/nb_celp.c	2005-03-01 23:47:54 UTC (rev 9002)
@@ -48,8 +48,6 @@
 #include "misc.h"
 #include <speex/speex_callbacks.h>
 
-#include <stdio.h>
-
 #ifndef M_PI
 #define M_PI           3.14159265358979323846  /* pi */
 #endif
@@ -135,9 +133,6 @@
    st->swBuf = PUSH(st->stack, mode->frameSize+mode->pitchEnd+1, spx_sig_t);
    st->sw = st->swBuf + mode->pitchEnd + 1;
 
-   /*st->exc2Buf = PUSH(st->stack, st->bufSize, spx_sig_t);
-   st->exc2 = st->exc2Buf + st->bufSize - st->windowSize;*/
-
    st->innov = PUSH(st->stack, st->frameSize, spx_sig_t);
 
    /* Asymmetric "pseudo-Hamming" window */
@@ -243,12 +238,9 @@
       st->inBuf[st->windowSize-st->frameSize+i] = SHL((int)in[i], SIG_SHIFT);
 
    /* Move signals 1 frame towards the past */
-   /*speex_move(st->exc2Buf, st->exc2Buf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(spx_sig_t));*/
-   //mode->frameSize+mode->pitchEnd+1;
    speex_move(st->excBuf, st->excBuf+st->frameSize, (st->max_pitch+1)*sizeof(spx_sig_t));
    speex_move(st->swBuf, st->swBuf+st->frameSize, (st->max_pitch+1)*sizeof(spx_sig_t));
 
-
    {
       spx_word16_t *w_sig;
       w_sig = PUSH(stack, st->windowSize, spx_word16_t);
@@ -508,7 +500,7 @@
    if (st->submodes[st->submodeID] == NULL)
    {
       for (i=0;i<st->frameSize;i++)
-         st->exc[i]/*=st->exc2[i]*/=st->sw[i]=VERY_SMALL;
+         st->exc[i]=st->sw[i]=VERY_SMALL;
 
       for (i=0;i<st->lpcSize;i++)
          st->mem_sw[i]=0;
@@ -634,7 +626,7 @@
    for (sub=0;sub<st->nbSubframes;sub++)
    {
       int   offset;
-      spx_sig_t *sp, *sw, *exc/*, *exc2*/;
+      spx_sig_t *sp, *sw, *exc;
       int pitch;
       int response_bound = st->subframeSize;
 #ifdef EPIC_48K
@@ -656,9 +648,6 @@
       /* Weighted signal */
       sw=st->sw+offset;
 
-      /*exc2=st->exc2+offset;*/
-
-
       /* LSP interpolation (quantized and unquantized) */
       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);
@@ -711,8 +700,6 @@
       /* Reset excitation */
       for (i=0;i<st->subframeSize;i++)
          exc[i]=VERY_SMALL;
-      /*for (i=0;i<st->subframeSize;i++)
-      exc2[i]=VERY_SMALL;*/
 
       /* Compute zero response of A(z/g1) / ( A(z/g2) * A(z) ) */
       for (i=0;i<st->lpcSize;i++)
@@ -745,7 +732,7 @@
          target[i]=sw[i]-res[i];
 
       for (i=0;i<st->subframeSize;i++)
-         exc[i]=/*exc2[i]=*/0;
+         exc[i]=0;
 
       /* If we have a long-term predictor (otherwise, something's wrong) */
       if (SUBMODE(ltp_quant))
@@ -801,12 +788,6 @@
          speex_error ("No pitch prediction, what's wrong");
       }
 
-      /* Update target for adaptive codebook contribution */
-      /* FIXME: We shouldn't have to apply the filter again (compute directly in the pitch quantizer) */
-      /*syn_percep_zero(exc, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, res, st->subframeSize, st->lpcSize, stack);
-      for (i=0;i<st->subframeSize;i++)
-         target[i]=SATURATE(SUB32(target[i],res[i]),805306368);
-      */
       /* Quantization of innovation */
       {
          spx_sig_t *innov;
@@ -817,16 +798,10 @@
          for (i=0;i<st->subframeSize;i++)
             innov[i]=0;
          
-         /*FIXME: Check that I'm really allowed to replace the residue_percep_zero */
          for (i=0;i<st->subframeSize;i++)
             real_exc[i] = SUB32(real_exc[i], exc[i]);
-         /*residue_percep_zero(target, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2, st->buf2, st->subframeSize, st->lpcSize, stack);*/
 
          ener = SHL((spx_word32_t)compute_rms(real_exc, st->subframeSize),SIG_SHIFT);
-
-         /*for (i=0;i<st->subframeSize;i++)
-            printf ("%f\n", st->buf2[i]/ener);
-         */
          
          /*FIXME: Should use DIV32_16 and make sure result fits in 16 bits */
 #ifdef FIXED_POINT
@@ -896,8 +871,6 @@
                exc[i] += innov2[i];
          }
 
-         /* FIXME: I can remove that, right? */
-         /*signal_mul(target, target, ener, st->subframeSize);*/
       }
 
       /* Final signal synthesis from excitation */
@@ -907,8 +880,6 @@
       if (st->complexity!=0)
          filter_mem2(sp, st->bw_lpc1, st->bw_lpc2, sw, st->subframeSize, st->lpcSize, st->mem_sw);
       
-      /*for (i=0;i<st->subframeSize;i++)
-      exc2[i]=exc[i];*/
    }
 
    /* Store the LSPs for interpolation in the next frame */
@@ -1266,7 +1237,6 @@
    }
 
    /* Shift all buffers by one frame */
-   /*speex_move(st->inBuf, st->inBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(spx_sig_t));*/
    speex_move(st->excBuf, st->excBuf+st->frameSize, (st->max_pitch + 1)*sizeof(spx_sig_t));
 
    /* If null mode (no transmission), just set a couple things to zero*/
@@ -1275,8 +1245,6 @@
       spx_coef_t *lpc;
       lpc = PUSH(stack,11, spx_coef_t);
       bw_lpc(GAMMA_SCALING*.93, st->interp_qlpc, lpc, 10);
-      /*for (i=0;i<st->frameSize;i++)
-        st->exc[i]=0;*/
       {
          float innov_gain=0;
          float pgain=GAIN_SCALING_1*st->last_pitch_gain;

Modified: trunk/speex/libspeex/nb_celp.h
===================================================================
--- trunk/speex/libspeex/nb_celp.h	2005-03-01 17:05:06 UTC (rev 9001)
+++ trunk/speex/libspeex/nb_celp.h	2005-03-01 23:47:54 UTC (rev 9002)
@@ -73,8 +73,6 @@
    spx_sig_t *frame;          /**< Start of original frame */
    spx_sig_t *excBuf;         /**< Excitation buffer */
    spx_sig_t *exc;            /**< Start of excitation frame */
-   spx_sig_t *exc2Buf;        /**< "Pitch enhanced" excitation */
-   spx_sig_t *exc2;           /**< "Pitch enhanced" excitation */
    spx_sig_t *swBuf;          /**< Weighted signal buffer */
    spx_sig_t *sw;             /**< Start of weighted signal frame */
    spx_sig_t *innov;          /**< Innovation for the frame */

Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c	2005-03-01 17:05:06 UTC (rev 9001)
+++ trunk/speex/libspeex/sb_celp.c	2005-03-01 23:47:54 UTC (rev 9002)
@@ -46,8 +46,6 @@
 #include "ltp.h"
 #include "misc.h"
 
-#include <stdio.h>
-
 #ifndef M_PI
 #define M_PI           3.14159265358979323846  /* pi */
 #endif



More information about the commits mailing list