[xiph-commits] r11147 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Mon Apr 17 09:05:07 PDT 2006
Author: jm
Date: 2006-04-17 09:05:03 -0700 (Mon, 17 Apr 2006)
New Revision: 11147
Modified:
trunk/speex/libspeex/nb_celp.c
trunk/speex/libspeex/sb_celp.c
trunk/speex/libspeex/sb_celp.h
Log:
fixed enhancement for wideband (sort of) and a bit of cleaning up.
Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c 2006-04-16 23:22:20 UTC (rev 11146)
+++ trunk/speex/libspeex/nb_celp.c 2006-04-17 16:05:03 UTC (rev 11147)
@@ -1170,9 +1170,9 @@
/*speex_move(st->inBuf, st->inBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(spx_sig_t));*/
speex_move(st->excBuf, st->excBuf+st->frameSize, (PITCH_PERIODS*st->max_pitch + 1)*sizeof(spx_sig_t));
- ALLOC(awk1, (st->lpcSize+1), spx_coef_t);
- ALLOC(awk2, (st->lpcSize+1), spx_coef_t);
- ALLOC(awk3, (st->lpcSize+1), spx_coef_t);
+ ALLOC(awk1, st->lpcSize, spx_coef_t);
+ ALLOC(awk2, st->lpcSize, spx_coef_t);
+ ALLOC(awk3, st->lpcSize, spx_coef_t);
for (sub=0;sub<st->nbSubframes;sub++)
{
Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c 2006-04-16 23:22:20 UTC (rev 11146)
+++ trunk/speex/libspeex/sb_celp.c 2006-04-17 16:05:03 UTC (rev 11147)
@@ -875,6 +875,7 @@
st->g1_mem=speex_alloc((QMF_ORDER)*sizeof(spx_word32_t));
st->exc=speex_alloc((st->frame_size)*sizeof(spx_sig_t));
+ st->excBuf=speex_alloc((st->subframeSize)*sizeof(spx_sig_t));
st->qlsp = speex_alloc((st->lpcSize)*sizeof(spx_lsp_t));
st->old_qlsp = speex_alloc((st->lpcSize)*sizeof(spx_lsp_t));
@@ -915,6 +916,7 @@
speex_free(st->g0_mem);
speex_free(st->g1_mem);
speex_free(st->exc);
+ speex_free(st->excBuf);
speex_free(st->qlsp);
speex_free(st->old_qlsp);
speex_free(st->interp_qlsp);
@@ -943,9 +945,9 @@
st->first=1;
- ALLOC(awk1, st->lpcSize+1, spx_coef_t);
- ALLOC(awk2, st->lpcSize+1, spx_coef_t);
- ALLOC(awk3, st->lpcSize+1, spx_coef_t);
+ ALLOC(awk1, st->lpcSize, spx_coef_t);
+ ALLOC(awk2, st->lpcSize, spx_coef_t);
+ ALLOC(awk3, st->lpcSize, spx_coef_t);
if (st->lpc_enh_enabled)
{
@@ -1018,6 +1020,7 @@
char *stack;
VARDECL(spx_word32_t *low_pi_gain);
VARDECL(spx_sig_t *low_exc);
+ VARDECL(spx_coef_t *ak);
VARDECL(spx_coef_t *awk1);
VARDECL(spx_coef_t *awk2);
VARDECL(spx_coef_t *awk3);
@@ -1121,9 +1124,10 @@
st->old_qlsp[i] = st->qlsp[i];
}
- ALLOC(awk1, st->lpcSize+1, spx_coef_t);
- ALLOC(awk2, st->lpcSize+1, spx_coef_t);
- ALLOC(awk3, st->lpcSize+1, spx_coef_t);
+ ALLOC(ak, st->lpcSize, spx_coef_t);
+ ALLOC(awk1, st->lpcSize, spx_coef_t);
+ ALLOC(awk2, st->lpcSize, spx_coef_t);
+ ALLOC(awk3, st->lpcSize, spx_coef_t);
for (sub=0;sub<st->nbSubframes;sub++)
{
@@ -1150,8 +1154,12 @@
lsp_enforce_margin(st->interp_qlsp, st->lpcSize, LSP_MARGIN);
/* LSP to LPC */
- lsp_to_lpc(st->interp_qlsp, st->interp_qlpc, st->lpcSize, stack);
+ lsp_to_lpc(st->interp_qlsp, ak, st->lpcSize, stack);
+#ifndef NEW_ENHANCER
+ for (i=0;i<st->lpcSize;i++)
+ st->interp_qlpc[i] = ak[i];
+#endif
if (st->lpc_enh_enabled)
{
@@ -1271,8 +1279,12 @@
innov_save[2*i]=exc[i];
}
+#ifndef NEW_ENHANCER
for (i=0;i<st->subframeSize;i++)
- sp[i]=exc[i];
+ st->excBuf[i]=exc[i];
+#endif
+ for (i=0;i<st->subframeSize;i++)
+ sp[i]=st->excBuf[i];
if (st->lpc_enh_enabled)
{
/* Use enhanced LPC filter */
@@ -1287,7 +1299,12 @@
iir_mem2(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
st->mem_sp);
}
- /*iir_mem2(exc, st->interp_qlpc, sp, st->subframeSize, st->lpcSize, st->mem_sp);*/
+#ifdef NEW_ENHANCER
+ for (i=0;i<st->subframeSize;i++)
+ st->excBuf[i]=exc[i];
+ for (i=0;i<st->lpcSize;i++)
+ st->interp_qlpc[i] = ak[i];
+#endif
}
Modified: trunk/speex/libspeex/sb_celp.h
===================================================================
--- trunk/speex/libspeex/sb_celp.h 2006-04-16 23:22:20 UTC (rev 11146)
+++ trunk/speex/libspeex/sb_celp.h 2006-04-17 16:05:03 UTC (rev 11147)
@@ -130,6 +130,7 @@
spx_word32_t *g0_mem, *g1_mem;
spx_sig_t *exc;
+ spx_sig_t *excBuf;
spx_lsp_t *qlsp;
spx_lsp_t *old_qlsp;
spx_lsp_t *interp_qlsp;
More information about the commits
mailing list