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

jm at svn.xiph.org jm at svn.xiph.org
Mon Dec 4 05:09:21 PST 2006


Author: jm
Date: 2006-12-04 05:09:18 -0800 (Mon, 04 Dec 2006)
New Revision: 12171

Modified:
   trunk/speex/libspeex/sb_celp.c
   trunk/speex/libspeex/sb_celp.h
Log:
No need for an explicit buffer to receive the narrowband innovation.


Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c	2006-12-04 11:21:23 UTC (rev 12170)
+++ trunk/speex/libspeex/sb_celp.c	2006-12-04 13:09:18 UTC (rev 12171)
@@ -812,8 +812,6 @@
    st->exc_rms = (spx_word16_t*)speex_alloc((st->nbSubframes)*sizeof(spx_word16_t));
    st->mem_sp = (spx_mem_t*)speex_alloc((2*st->lpcSize)*sizeof(spx_mem_t));
    
-   st->low_innov = (spx_word16_t*)speex_alloc((st->frame_size)*sizeof(spx_word16_t));
-   speex_decoder_ctl(st->st_low, SPEEX_SET_INNOVATION_SAVE, st->low_innov);
    st->innov_save = NULL;
 
 
@@ -844,7 +842,6 @@
    speex_free(st->interp_qlpc);
    speex_free(st->pi_gain);
    speex_free(st->exc_rms);
-   speex_free(st->low_innov);
    speex_free(st->mem_sp);
 
    speex_free(state);
@@ -901,11 +898,13 @@
    spx_int32_t dtx;
    const SpeexSBMode *mode;
    spx_word16_t *out = (spx_word16_t*)vout;
-   
+   spx_word16_t *low_innov_alias;
    st = (SBDecState*)state;
    stack=st->stack;
    mode = (const SpeexSBMode*)(st->mode->mode);
 
+   low_innov_alias = out+st->frame_size;
+   speex_decoder_ctl(st->st_low, SPEEX_SET_INNOVATION_SAVE, low_innov_alias);
    /* Decode the low-band */
    ret = speex_decode_native(st->st_low, bits, out);
 
@@ -1061,7 +1060,7 @@
             el = compute_rms(low_innov+offset, st->subframeSize);*/
             for (i=0;i<st->subframeSize;i++)
             {
-               float e=tmp*g*mode->folding_gain*st->low_innov[offset+i];
+               float e=tmp*g*mode->folding_gain*low_innov_alias[offset+i];
                tmp *= -1;
                exc[i] = SIG_SCALING*e;
                /*float r = speex_rand(g*el,&seed);

Modified: trunk/speex/libspeex/sb_celp.h
===================================================================
--- trunk/speex/libspeex/sb_celp.h	2006-12-04 11:21:23 UTC (rev 12170)
+++ trunk/speex/libspeex/sb_celp.h	2006-12-04 13:09:18 UTC (rev 12171)
@@ -135,7 +135,6 @@
    spx_word32_t *pi_gain;
    spx_word16_t *exc_rms;
    spx_word16_t *innov_save;      /** If non-NULL, innovation is copied here */
-   spx_word16_t *low_innov;       /** Lower-band innovation is copied here magically */
    
    spx_word16_t last_ener;
    spx_int32_t seed;



More information about the commits mailing list