[xiph-commits] r11377 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Mon May 8 07:16:57 PDT 2006
Author: jm
Date: 2006-05-08 07:16:53 -0700 (Mon, 08 May 2006)
New Revision: 11377
Modified:
trunk/speex/libspeex/filters.c
trunk/speex/libspeex/filters.h
trunk/speex/libspeex/nb_celp.c
Log:
cleaned up temp allocation in enhancer a bit
Modified: trunk/speex/libspeex/filters.c
===================================================================
--- trunk/speex/libspeex/filters.c 2006-05-08 12:25:57 UTC (rev 11376)
+++ trunk/speex/libspeex/filters.c 2006-05-08 14:16:53 UTC (rev 11377)
@@ -734,7 +734,7 @@
int p, /*LPC order*/
int nsf, /*sub-frame size*/
int pitch, /*pitch period*/
-spx_word16_t *pitch_gain, /*pitch gain (3-tap)*/
+int max_pitch,
spx_word16_t comb_gain, /*gain of comb filter*/
char *stack
)
@@ -759,12 +759,11 @@
#ifdef FIXED_POINT
VARDECL(spx_word16_t *exc2);
- /* FIXME: Can it get uglier than that??? */
- ALLOC(exc2, 510, spx_word16_t);
- for (i=0;i<510;i++)
+ ALLOC(exc2, 12+nsf+(nsf>>1)+2*max_pitch, spx_word16_t);
+ for (i=0;i<12+nsf+(nsf>>1)+2*max_pitch;i++)
exc2[i] = 0;
- exc = exc2+300;
- for (i=-280;i<200;i++)
+ exc = exc2+6+2*max_pitch;
+ for (i=-2*max_pitch-6;i<nsf+(nsf>>1)+6;i++)
exc[i] = PSHR32(_exc[i], SIG_SHIFT);
#else
exc = _exc;
Modified: trunk/speex/libspeex/filters.h
===================================================================
--- trunk/speex/libspeex/filters.h 2006-05-08 12:25:57 UTC (rev 11376)
+++ trunk/speex/libspeex/filters.h 2006-05-08 14:16:53 UTC (rev 11377)
@@ -80,7 +80,7 @@
int p, /*LPC order*/
int nsf, /*sub-frame size*/
int pitch, /*pitch period*/
-spx_word16_t *pitch_gain, /*pitch gain (3-tap)*/
+int max_pitch, /*pitch gain (3-tap)*/
spx_word16_t comb_gain, /*gain of comb filter*/
char *stack
);
Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c 2006-05-08 12:25:57 UTC (rev 11376)
+++ trunk/speex/libspeex/nb_celp.c 2006-05-08 14:16:53 UTC (rev 11377)
@@ -1690,8 +1690,8 @@
#ifndef OLD_ENHANCER
if (st->lpc_enh_enabled && SUBMODE(comb_gain)>0 && !st->count_lost)
{
- multicomb(st->exc-st->subframeSize, out, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, pitch_gain, SUBMODE(comb_gain), stack);
- multicomb(st->exc+st->subframeSize, out+2*st->subframeSize, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, pitch_gain, SUBMODE(comb_gain), stack);
+ multicomb(st->exc-st->subframeSize, out, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, st->max_pitch, SUBMODE(comb_gain), stack);
+ multicomb(st->exc+st->subframeSize, out+2*st->subframeSize, st->interp_qlpc, st->lpcSize, 2*st->subframeSize, best_pitch, st->max_pitch, SUBMODE(comb_gain), stack);
} else {
for (i=0;i<st->frameSize;i++)
out[i]=PSHR32(st->exc[i-st->subframeSize],SIG_SHIFT);
More information about the commits
mailing list