[xiph-cvs] cvs commit: speex/libspeex nb_celp.c
Jean-Marc Valin
jm at xiph.org
Sun Oct 20 16:56:37 PDT 2002
jm 02/10/20 19:56:36
Modified: libspeex nb_celp.c
Log:
Separated the enhanced LPC filter in 2
Revision Changes Path
1.61 +35 -1 speex/libspeex/nb_celp.c
Index: nb_celp.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/nb_celp.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- nb_celp.c 11 Oct 2002 03:39:34 -0000 1.60
+++ nb_celp.c 20 Oct 2002 23:56:36 -0000 1.61
@@ -984,7 +984,11 @@
{
int offset;
float *sp, *exc, tmp;
+#if 0
float *num, *den;
+#else
+ float *awk1, *awk2, *awk3;
+#endif
/* Offset relative to start of frame */
offset = st->subframeSize*sub;
/* Original signal */
@@ -1006,6 +1010,7 @@
st->interp_qlsp[i] = cos(st->interp_qlsp[i]);
lsp_to_lpc(st->interp_qlsp, st->interp_qlpc, st->lpcSize, st->stack);
+#if 0
num=PUSH(st->stack, ((st->lpcSize<<1)+1));
den=PUSH(st->stack, ((st->lpcSize<<1)+1));
if (st->lpc_enh_enabled)
@@ -1016,6 +1021,28 @@
enh_lpc(st->interp_qlpc, st->lpcSize, num, den,
SUBMODE(lpc_enh_k2), SUBMODE(lpc_enh_k2), st->stack);
}
+#else
+ {
+ float r=.9;
+
+ float k1,k2,k3;
+ k1=SUBMODE(lpc_enh_k1);
+ k2=SUBMODE(lpc_enh_k2);
+ k3=(1-(1-r*k1)/(1-r*k2))/r;
+ if (!st->lpc_enh_enabled)
+ {
+ k1=k2;
+ k3=0;
+ }
+ awk1=PUSH(st->stack, st->lpcSize+1);
+ awk2=PUSH(st->stack, st->lpcSize+1);
+ awk3=PUSH(st->stack, st->lpcSize+1);
+ bw_lpc(k1, st->interp_qlpc, awk1, st->lpcSize);
+ bw_lpc(k2, st->interp_qlpc, awk2, st->lpcSize);
+ bw_lpc(k3, st->interp_qlpc, awk3, st->lpcSize);
+
+ }
+#endif
/* Compute analysis filter at w=pi */
tmp=1;
st->pi_gain[sub]=0;
@@ -1132,13 +1159,20 @@
if (st->lpc_enh_enabled && SUBMODE(comb_gain>0))
comb_filter(exc, sp, st->interp_qlpc, st->lpcSize, st->subframeSize,
pitch, pitch_gain, .5);
+#if 0
/*pole_zero_mem(sp, num, den, sp, st->subframeSize, (st->lpcSize<<1),
st->mem_sp+st->lpcSize, st->stack);*/
filter_mem2(sp, num, den, sp, st->subframeSize, (st->lpcSize<<1),
st->mem_sp+st->lpcSize);
iir_mem2(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
st->mem_sp);
-
+#else
+ filter_mem2(sp, awk3, awk1, sp, st->subframeSize, st->lpcSize,
+ st->mem_sp);
+ filter_mem2(sp, awk2, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
+ st->mem_sp+st->lpcSize);
+ POP(st->stack);
+#endif
POP(st->stack);
POP(st->stack);
}
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list