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

Jean-Marc Valin jm at xiph.org
Mon May 19 19:46:34 PDT 2003



jm          03/05/19 22:46:34

  Modified:    libspeex denoise.c testdenoise.c
  Log:
  denoiser now behaves correctly with 240-sample frames

Revision  Changes    Path
1.7       +5 -1      speex/libspeex/denoise.c

Index: denoise.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/denoise.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- denoise.c	14 May 2003 04:37:00 -0000	1.6
+++ denoise.c	20 May 2003 02:46:34 -0000	1.7
@@ -99,6 +99,8 @@
       }
    }
 
+   if (st->ps_size < 3*st->frame_size/4)
+      st->ps_size = st->ps_size * 3 / 2;
    N = st->ps_size;
    N3 = 2*N - st->frame_size;
    N4 = st->frame_size - N3;
@@ -120,6 +122,8 @@
    st->outbuf = (float*)speex_alloc(N3*sizeof(float));
 
    conj_window(st->window, 2*N3);
+   for (i=2*N3;i<2*st->ps_size;i++)
+      st->window[i]=1;
    for (i=N3-1;i>=0;i--)
    {
       st->window[i+N3+N4]=st->window[i+N3];
@@ -301,7 +305,7 @@
 #endif
 
    /* Noise estimation always updated for the 20 first times */
-   if (st->nb_adapt<20)
+   if (st->nb_adapt<15)
    {
       update_noise(st, ps);
       st->last_update=0;

<p><p>1.3       +1 -1      speex/libspeex/testdenoise.c

Index: testdenoise.c
===================================================================
RCS file: /usr/local/cvsroot/speex/libspeex/testdenoise.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- testdenoise.c	12 May 2003 01:02:19 -0000	1.2
+++ testdenoise.c	20 May 2003 02:46:34 -0000	1.3
@@ -1,7 +1,7 @@
 #include "speex_denoise.h"
 #include <stdio.h>
 
-#define NN 160
+#define NN 240
 
 int main()
 {

<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