[xiph-commits] r12154 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Wed Nov 29 04:52:29 PST 2006
Author: jm
Date: 2006-11-29 04:52:25 -0800 (Wed, 29 Nov 2006)
New Revision: 12154
Modified:
trunk/speex/libspeex/sb_celp.c
trunk/speex/libspeex/sb_celp.h
Log:
another 640 bytes off the decoder state.
Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c 2006-11-29 01:55:47 UTC (rev 12153)
+++ trunk/speex/libspeex/sb_celp.c 2006-11-29 12:52:25 UTC (rev 12154)
@@ -804,10 +804,6 @@
st->first=1;
-
- st->x0d = (spx_word16_t*)speex_alloc((st->frame_size)*sizeof(spx_word16_t));
- st->high = (spx_word16_t*)speex_alloc((st->frame_size)*sizeof(spx_word16_t));
-
st->g0_mem = (spx_word32_t*)speex_alloc((QMF_ORDER)*sizeof(spx_word32_t));
st->g1_mem = (spx_word32_t*)speex_alloc((QMF_ORDER)*sizeof(spx_word32_t));
@@ -845,8 +841,6 @@
speex_free_scratch(st->stack);
#endif
- speex_free(st->x0d);
- speex_free(st->high);
speex_free(st->g0_mem);
speex_free(st->g1_mem);
speex_free(st->exc);
@@ -888,14 +882,14 @@
}
for (i=0;i<st->frame_size;i++)
- st->high[i]=EXTRACT16(PSHR32(st->exc[i],SIG_SHIFT));
+ out[i+st->frame_size]=EXTRACT16(PSHR32(st->exc[i],SIG_SHIFT));
- iir_mem16(st->high, st->interp_qlpc, st->high, st->frame_size, st->lpcSize,
+ iir_mem16(out+st->frame_size, st->interp_qlpc, out+st->frame_size, st->frame_size, st->lpcSize,
st->mem_sp, stack);
/* Reconstruct the original */
- qmf_synth(st->x0d, st->high, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack);
+ qmf_synth(out, out+st->frame_size, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack);
if (dtx)
{
st->submodeID=saved_modeid;
@@ -922,16 +916,8 @@
stack=st->stack;
mode = (const SpeexSBMode*)(st->mode->mode);
- {
- VARDECL(spx_word16_t *low);
- ALLOC(low, st->frame_size, spx_word16_t);
-
- /* Decode the low-band */
- ret = speex_decode_native(st->st_low, bits, low);
-
- for (i=0;i<st->frame_size;i++)
- st->x0d[i] = low[i];
- }
+ /* Decode the low-band */
+ ret = speex_decode_native(st->st_low, bits, out);
speex_decoder_ctl(st->st_low, SPEEX_GET_DTX_STATUS, &dtx);
@@ -984,14 +970,14 @@
for (i=0;i<st->frame_size;i++)
st->exc[i]=VERY_SMALL;
for (i=0;i<st->frame_size;i++)
- st->high[i]=VERY_SMALL;
+ out[st->frame_size+i]=VERY_SMALL;
st->first=1;
/* Final signal synthesis from excitation */
- iir_mem16(st->high, st->interp_qlpc, st->high, st->frame_size, st->lpcSize, st->mem_sp, stack);
+ iir_mem16(out+st->frame_size, st->interp_qlpc, out+st->frame_size, st->frame_size, st->lpcSize, st->mem_sp, stack);
- qmf_synth(st->x0d, st->high, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack);
+ qmf_synth(out, out+st->frame_size, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack);
return 0;
@@ -1025,7 +1011,7 @@
spx_word32_t rl=0,rh=0;
offset = st->subframeSize*sub;
- sp=st->high+offset;
+ sp=out+st->frame_size+offset;
exc=st->exc+offset;
/* Pointer for saving innovation */
if (st->innov_save)
@@ -1158,7 +1144,7 @@
}
- qmf_synth(st->x0d, st->high, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack);
+ qmf_synth(out, out+st->frame_size, h0, out, st->full_frame_size, QMF_ORDER, st->g0_mem, st->g1_mem, stack);
for (i=0;i<st->lpcSize;i++)
st->old_qlsp[i] = st->qlsp[i];
Modified: trunk/speex/libspeex/sb_celp.h
===================================================================
--- trunk/speex/libspeex/sb_celp.h 2006-11-29 01:55:47 UTC (rev 12153)
+++ trunk/speex/libspeex/sb_celp.h 2006-11-29 12:52:25 UTC (rev 12154)
@@ -124,8 +124,6 @@
int lpc_enh_enabled;
char *stack;
- spx_word16_t *x0d;
- spx_word16_t *high;
spx_word32_t *g0_mem, *g1_mem;
spx_sig_t *exc;
More information about the commits
mailing list