[xiph-commits] r11362 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Sun May 7 10:08:45 PDT 2006
Author: jm
Date: 2006-05-07 10:08:41 -0700 (Sun, 07 May 2006)
New Revision: 11362
Modified:
trunk/speex/libspeex/modes.c
trunk/speex/libspeex/modes.h
trunk/speex/libspeex/nb_celp.c
trunk/speex/libspeex/sb_celp.c
Log:
Removed the whole LPC enhancement -- wasn't really worth the trouble.
Modified: trunk/speex/libspeex/modes.c
===================================================================
--- trunk/speex/libspeex/modes.c 2006-05-07 16:21:46 UTC (rev 11361)
+++ trunk/speex/libspeex/modes.c 2006-05-07 17:08:41 UTC (rev 11362)
@@ -190,7 +190,7 @@
noise_codebook_quant,
noise_codebook_unquant,
NULL,
- QCONST16(0.7,15), QCONST16(0.7,15), 0, -1,
+ -1,
43
};
@@ -211,7 +211,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_nb_ulbr,
- QCONST16(0.7,15), QCONST16(0.5,15), QCONST16(.36,15), QCONST16(.65,15),
+ QCONST16(.65,15),
79
};
@@ -232,7 +232,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_nb_vlbr,
- QCONST16(0.7,15), QCONST16(0.55,15), QCONST16(.22,15), QCONST16(.55,15),
+ QCONST16(.55,15),
119
};
@@ -253,7 +253,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_nb_lbr,
- QCONST16(0.7,15), QCONST16(0.6,15), QCONST16(.15,15), QCONST16(.45,15),
+ QCONST16(.45,15),
160
};
@@ -274,7 +274,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_nb_med,
- QCONST16(0.7,15), QCONST16(0.63,15), QCONST16(.1,15), QCONST16(.35,15),
+ QCONST16(.35,15),
220
};
@@ -295,7 +295,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_nb,
- QCONST16(0.7,15), QCONST16(0.65,15), QCONST16(.08,15), QCONST16(.2,15),
+ QCONST16(.2,15),
300
};
@@ -316,7 +316,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_sb,
- QCONST16(0.68,15), QCONST16(0.65,15), QCONST16(.03,15), QCONST16(.1,15),
+ QCONST16(.1,15),
364
};
@@ -337,7 +337,7 @@
split_cb_search_shape_sign,
split_cb_shape_sign_unquant,
&split_cb_nb,
- QCONST16(0.65,15), QCONST16(0.65,15), 0, -1,
+ -1,
492
};
@@ -402,11 +402,7 @@
NULL,
NULL,
NULL,
-#ifdef FIXED_POINT
- 24576, 24576, 0, -1,
-#else
- .75, .75, .0, -1,
-#endif
+ -1,
36
};
@@ -431,11 +427,7 @@
#else
&split_cb_high_lbr,
#endif
-#ifdef FIXED_POINT
- 27853, 19661, 8192, -1,
-#else
- .85, .6, .25, -1,
-#endif
+ -1,
112
};
@@ -460,12 +452,7 @@
#else
&split_cb_high,
#endif
-
-#ifdef FIXED_POINT
- 24576, 22938, 1638, -1,
-#else
- .75, .7, .05, -1,
-#endif
+ -1,
192
};
@@ -489,11 +476,7 @@
#else
&split_cb_high,
#endif
-#ifdef FIXED_POINT
- 24576, 24576, 0, -1,
-#else
- .75, .75, .0, -1,
-#endif
+ -1,
352
};
Modified: trunk/speex/libspeex/modes.h
===================================================================
--- trunk/speex/libspeex/modes.h 2006-05-07 16:21:46 UTC (rev 11361)
+++ trunk/speex/libspeex/modes.h 2006-05-07 17:08:41 UTC (rev 11362)
@@ -91,10 +91,6 @@
innovation_unquant_func innovation_unquant; /**< Innovation un-quantization */
const void *innovation_params; /**< Innovation quantization parameters*/
- /*Synthesis filter enhancement*/
- spx_word16_t lpc_enh_k1; /**< Enhancer constant */
- spx_word16_t lpc_enh_k2; /**< Enhancer constant */
- spx_word16_t lpc_enh_k3; /**< Enhancer constant */
spx_word16_t comb_gain; /**< Gain of enhancer comb filter */
int bits_per_frame; /**< Number of bits per frame after encoding*/
Modified: trunk/speex/libspeex/nb_celp.c
===================================================================
--- trunk/speex/libspeex/nb_celp.c 2006-05-07 16:21:46 UTC (rev 11361)
+++ trunk/speex/libspeex/nb_celp.c 2006-05-07 17:08:41 UTC (rev 11362)
@@ -1151,9 +1151,6 @@
{
int i, sub;
int pitch_val;
- VARDECL(spx_coef_t *awk1);
- VARDECL(spx_coef_t *awk2);
- VARDECL(spx_coef_t *awk3);
spx_word16_t pitch_gain;
spx_word16_t fact;
spx_word16_t gain_med;
@@ -1185,10 +1182,6 @@
/*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, spx_coef_t);
- ALLOC(awk2, st->lpcSize, spx_coef_t);
- ALLOC(awk3, st->lpcSize, spx_coef_t);
-
for (sub=0;sub<st->nbSubframes;sub++)
{
int offset;
@@ -1201,24 +1194,6 @@
/* Excitation */
exc=st->exc+offset;
/* Excitation after post-filter*/
-
- /* Calculate perceptually enhanced LPC filter */
- if (st->lpc_enh_enabled)
- {
- spx_word16_t k1,k2,k3;
- if (st->submodes[st->submodeID] != NULL)
- {
- k1=SUBMODE(lpc_enh_k1);
- k2=SUBMODE(lpc_enh_k2);
- k3=SUBMODE(lpc_enh_k3);
- } else {
- k1=k2=.7*GAMMA_SCALING;
- k3=.0;
- }
- 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);
- }
/* Make up a plausible excitation */
/* FIXME: THIS CAN BE IMPROVED */
@@ -1244,19 +1219,9 @@
for (i=0;i<st->subframeSize;i++)
sp[i]=PSHR32(exc[i],SIG_SHIFT);
#endif
- /* Signal synthesis */
- if (st->lpc_enh_enabled)
- {
- filter_mem16(sp, awk2, awk1, sp, st->subframeSize, st->lpcSize,
- st->mem_sp+st->lpcSize);
- filter_mem16(sp, awk3, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
- st->mem_sp);
- } else {
- for (i=0;i<st->lpcSize;i++)
- st->mem_sp[st->lpcSize+i] = 0;
- iir_mem16(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
- st->mem_sp);
- }
+ iir_mem16(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
+ st->mem_sp);
+
bw_lpc(QCONST16(.98,15), st->interp_qlpc, st->interp_qlpc, st->lpcSize);
}
@@ -1283,9 +1248,6 @@
char *stack;
VARDECL(spx_sig_t *innov);
VARDECL(spx_coef_t *ak);
- VARDECL(spx_coef_t *awk1);
- VARDECL(spx_coef_t *awk2);
- VARDECL(spx_coef_t *awk3);
VARDECL(spx_lsp_t *qlsp);
spx_word16_t pitch_average=0;
#ifdef EPIC_48K
@@ -1500,9 +1462,6 @@
#endif
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);
ALLOC(innov, st->subframeSize, spx_sig_t);
if (st->submodeID==1)
@@ -1794,14 +1753,6 @@
for (i=0;i<st->lpcSize;i++)
st->interp_qlpc[i] = ak[i];
#endif
-
- /* Compute enhanced synthesis filter */
- if (st->lpc_enh_enabled)
- {
- bw_lpc(SUBMODE(lpc_enh_k1), st->interp_qlpc, awk1, st->lpcSize);
- bw_lpc(SUBMODE(lpc_enh_k2), st->interp_qlpc, awk2, st->lpcSize);
- bw_lpc(SUBMODE(lpc_enh_k3), st->interp_qlpc, awk3, st->lpcSize);
- }
/* Compute analysis filter at w=pi */
{
@@ -1814,20 +1765,8 @@
st->pi_gain[sub] = pi_g;
}
- if (st->lpc_enh_enabled)
- {
- /* Use enhanced LPC filter */
- filter_mem16(sp, awk2, awk1, sp, st->subframeSize, st->lpcSize,
- st->mem_sp+st->lpcSize);
- filter_mem16(sp, awk3, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
- st->mem_sp);
- } else {
- /* Use regular filter */
- for (i=0;i<st->lpcSize;i++)
- st->mem_sp[st->lpcSize+i] = 0;
- iir_mem16(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
- st->mem_sp);
- }
+ iir_mem16(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
+ st->mem_sp);
for (i=0;i<st->lpcSize;i++)
st->interp_qlpc[i] = ak[i];
Modified: trunk/speex/libspeex/sb_celp.c
===================================================================
--- trunk/speex/libspeex/sb_celp.c 2006-05-07 16:21:46 UTC (rev 11361)
+++ trunk/speex/libspeex/sb_celp.c 2006-05-07 17:08:41 UTC (rev 11362)
@@ -930,9 +930,6 @@
static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *stack)
{
int i;
- VARDECL(spx_coef_t *awk1);
- VARDECL(spx_coef_t *awk2);
- VARDECL(spx_coef_t *awk3);
int saved_modeid=0;
if (dtx)
@@ -945,29 +942,7 @@
st->first=1;
- 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)
- {
- spx_word16_t k1,k2,k3;
- if (st->submodes[st->submodeID] != NULL)
- {
- k1=SUBMODE(lpc_enh_k1);
- k2=SUBMODE(lpc_enh_k2);
- k3=SUBMODE(lpc_enh_k3);
- } else {
- k1=k2=.7*GAMMA_SCALING;
- k3 = 0;
- }
- 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);
- /*fprintf (stderr, "%f %f %f\n", k1, k2, k3);*/
- }
-
-
/* Final signal synthesis from excitation */
if (!dtx)
{
@@ -980,22 +955,9 @@
for (i=0;i<st->frame_size;i++)
st->high[i]=st->exc[i];
- if (st->lpc_enh_enabled)
- {
- /* Use enhanced LPC filter */
- filter_mem2(st->high, awk2, awk1, st->high, st->frame_size, st->lpcSize,
- st->mem_sp+st->lpcSize);
- filter_mem2(st->high, awk3, st->interp_qlpc, st->high, st->frame_size, st->lpcSize,
- st->mem_sp);
- } else {
- /* Use regular filter */
- for (i=0;i<st->lpcSize;i++)
- st->mem_sp[st->lpcSize+i] = 0;
- iir_mem2(st->high, st->interp_qlpc, st->high, st->frame_size, st->lpcSize,
- st->mem_sp);
- }
+ iir_mem2(st->high, st->interp_qlpc, st->high, st->frame_size, st->lpcSize,
+ st->mem_sp);
- /*iir_mem2(st->exc, st->interp_qlpc, st->high, st->frame_size, st->lpcSize, st->mem_sp);*/
/* Reconstruct the original */
fir_mem_up(st->x0d, h0, st->y0, st->full_frame_size, QMF_ORDER, st->g0_mem, stack);
@@ -1021,9 +983,6 @@
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);
int dtx;
const SpeexSBMode *mode;
spx_word16_t *out = vout;
@@ -1125,9 +1084,6 @@
}
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++)
{
@@ -1161,19 +1117,6 @@
st->interp_qlpc[i] = ak[i];
#endif
- if (st->lpc_enh_enabled)
- {
- spx_word16_t k1,k2,k3;
- k1=SUBMODE(lpc_enh_k1);
- k2=SUBMODE(lpc_enh_k2);
- k3=SUBMODE(lpc_enh_k3);
- 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);
- /*fprintf (stderr, "%f %f %f\n", k1, k2, k3);*/
- }
-
-
/* Calculate reponse ratio between the low and high filter in the middle
of the band (4000 Hz) */
@@ -1285,20 +1228,8 @@
#endif
for (i=0;i<st->subframeSize;i++)
sp[i]=st->excBuf[i];
- if (st->lpc_enh_enabled)
- {
- /* Use enhanced LPC filter */
- filter_mem2(sp, awk2, awk1, sp, st->subframeSize, st->lpcSize,
- st->mem_sp+st->lpcSize);
- filter_mem2(sp, awk3, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
- st->mem_sp);
- } else {
- /* Use regular filter */
- for (i=0;i<st->lpcSize;i++)
- st->mem_sp[st->lpcSize+i] = 0;
- iir_mem2(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,
- st->mem_sp);
- }
+ iir_mem2(sp, 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];
More information about the commits
mailing list