[xiph-commits] r11941 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Mon Oct 23 09:11:19 PDT 2006
Author: jm
Date: 2006-10-23 09:11:17 -0700 (Mon, 23 Oct 2006)
New Revision: 11941
Modified:
trunk/speex/libspeex/preprocess.c
Log:
some tuning
Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c 2006-10-23 16:00:59 UTC (rev 11940)
+++ trunk/speex/libspeex/preprocess.c 2006-10-23 16:11:17 UTC (rev 11941)
@@ -641,15 +641,20 @@
g = prior_ratio * MM;
/* Constrain the gain to be close to the Bark scale gain */
- if (g > 2*st->gain[i])
- g = 2*st->gain[i];
+ if (g > 3*st->gain[i])
+ g = 3*st->gain[i];
if (g < .5*st->gain[i])
g = .5*st->gain[i];
st->gain[i] = g;
- /* Sounds on the gain */
+ /* Bound on the gain */
if (st->gain[i]>1.f)
st->gain[i]=1.f;
+
+ /* Save old power spectrum */
+ st->old_ps[i] = .2*st->old_ps[i] + .8*st->gain[i]*st->gain[i]*ps[i];
+
+ /* Apply gain floor */
if (st->gain[i] < gain_floor)
st->gain[i] = gain_floor;
@@ -663,8 +668,6 @@
st->gain2[i] = pow(st->gain[i], p) * pow(gain_floor,1.f-p);
#endif
- /* Save old power spectrum */
- st->old_ps[i] = .2*st->old_ps[i] + .8*st->gain[i]*st->gain[i]*ps[i];
}
More information about the commits
mailing list