[xiph-cvs] cvs commit: speex/libspeex denoise.c

Jean-Marc Valin jm at xiph.org
Wed May 21 11:24:21 PDT 2003



jm          03/05/21 14:24:21

  Modified:    libspeex denoise.c
  Log:
  returning VAD results in the denoiser

Revision  Changes    Path
1.9       +7 -1      speex/libspeex/denoise.c

Index: denoise.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/denoise.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- denoise.c	21 May 2003 06:03:45 -0000	1.8
+++ denoise.c	21 May 2003 18:24:21 -0000	1.9
@@ -208,6 +208,7 @@
 int denoise(DenoiseState *st, float *x)
 {
    int i;
+   int is_speech=0;
    float mean_post=0;
    float mean_prior=0;
    float energy;
@@ -379,6 +380,11 @@
       st->consec_noise=0;
    }
 
+   if (mean_prior>1 && mean_post > 1)
+   {
+      is_speech=1;
+   }
+
    if (st->consec_noise>=3)
    {
       update_noise(st, st->old_ps);
@@ -488,5 +494,5 @@
    if (st->last_id>=NB_LAST_PS)
       st->last_id=0;
 
-   return 1;
+   return is_speech;
 }

<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