[xiph-commits] r10610 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Fri Dec 16 18:44:29 PST 2005


Author: jm
Date: 2005-12-16 18:44:27 -0800 (Fri, 16 Dec 2005)
New Revision: 10610

Modified:
   trunk/speex/libspeex/mdf.c
Log:
more leak_estimate work


Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2005-12-17 02:26:28 UTC (rev 10609)
+++ trunk/speex/libspeex/mdf.c	2005-12-17 02:44:27 UTC (rev 10610)
@@ -248,8 +248,7 @@
    st->memX=st->memD=st->memE=0;
    st->preemph = QCONST16(.9,15);
    st->adapted = 0;
-   st->Pey = FLOAT_ZERO;
-   st->Pyy = FLOAT_ZERO;
+   st->Pey = st->Pyy = FLOAT_ONE;
    return st;
 }
 
@@ -270,7 +269,7 @@
    
    st->adapted = 0;
    st->sum_adapt = 0;
-   st->Pey = st->Pyy = FLOAT_ZERO;
+   st->Pey = st->Pyy = FLOAT_ONE;
 
 }
 
@@ -313,7 +312,7 @@
    float leak_estimate;
    spx_word16_t ss, ss_1;
    float adapt_rate=0;
-   spx_float_t Pey = FLOAT_ZERO, Pyy=FLOAT_ZERO;
+   spx_float_t Pey = FLOAT_ONE, Pyy=FLOAT_ONE;
    spx_float_t alpha;
    float RER;
    
@@ -434,6 +433,8 @@
    /* We don't really hope to get better than 33 dB attenuation anyway */
    if (FLOAT_LT(st->Pey, FLOAT_MULT(MIN_LEAK,st->Pyy)))
       st->Pey = FLOAT_MULT(MIN_LEAK,st->Pyy);
+   if (FLOAT_GT(st->Pey, st->Pyy))
+      st->Pey = st->Pyy;
    leak_estimate = REALFLOAT(st->Pey) / (1+REALFLOAT(st->Pyy));
 #else
    alpha = .05*Syy / (SHR(10000,6)+See);
@@ -445,10 +446,10 @@
    if (st->Pey< .001*st->Pyy)
       st->Pey = .001*st->Pyy;
    leak_estimate = st->Pey / (1+st->Pyy);
+   if (leak_estimate > 1)
+      leak_estimate = 1;
 #endif
 
-   if (leak_estimate > 1)
-      leak_estimate = 1;
    /*printf ("%f\n", leak_estimate);*/
    
    RER = 3*leak_estimate*Syy / (SHR(10000,6)+See);



More information about the commits mailing list