[speex-dev] Memory leak in denoiser + a few questions

Steve Kann stevek at stevek.com
Tue Mar 30 15:35:19 PST 2004

Jean-Marc Valin wrote:

>>Hmm, How can I find that out?  How much CPU would you expect it to
>I don't know. It's been a while since I last played with that code, but
>I'd expect it to take less time. 
>>I've been playing with oprofile, but I don't see it getting that
>>finely grained..
>Can you make sure the time is spent in the VAD and not in the encoder or
>decoder (at the other end) when the VAD is on (the underflow problem I
>had appeared with VBR, but the problem was in the decoder).
The tests I did to determine VAD CPU usage were pretty basic, and I'm 
sure it was just VAD being used.  I made a small test program which 
reads a bunch of audio data into a buffer, and then does:

 /* speex implementation */
        SpeexPreprocessState *dsp = speex_preprocess_state_init( 
        int set;
        set = 1;
        speex_preprocess_ctl( dsp, SPEEX_PREPROCESS_SET_VAD, &set ) ;
        set = 0;
        speex_preprocess_ctl( dsp, SPEEX_PREPROCESS_SET_DENOISE, &set ) ;
        speex_preprocess_ctl( dsp, SPEEX_PREPROCESS_SET_AGC, &set ) ;

        while(reps-- > 0) {
          int i;

          printf("beginning pass\n");

          for(i=0;i<BUFSAMP;i+=AST_CONF_BLOCK_SAMPLES) {
              speex_preprocess(dsp, audbuf+i, NULL);

The sample data I used was 1024x1024 samples, and I went through it 5 
times (nreps = 5, BUFSAMP = 1024*1024).  The data in the buffer is 
537760 samples of speech, with the rest being zeros.

>>I'll take a look at that.  In this case [in the conferencing
>>application], I'm not actually using speex encoding [these are PSTN
>>callers, I do VAD in clients when I control them], so I'd need to see
>>if I could rip it out of speex to use it.
>Don't waste too much time, though. That VAD is really basic.
I might be able to get by, in this application, with something more 
basic, though.  In my limited testing, I seem to remember getting SNR 
from PSTN clients which was _much_ better than that from microphones on 

I'd like to be able to handle sume number of hundreds of calls in the 
conference, with up to maybe 100 of them being processed by the VAD.  
Right now, the VAD is the dominant part of the conference [encoding and 
decoding are actually smaller, because the channels which do 
encoding/decoding do VAD on the client end, and the channels that do 
need VAD are ulaw encoded.

<p>>>Also, I do have a couple of patches to the preprocessor to send along
>>actually; basically this makes the start and continue probabilities
>>parameters that can be set by callers.  We're currently using very low
>>probabilities;   Much lower than your defaults, VAD_START=0.05
>>VAD_CONTINUE=0.02.  We also have 20 frame (2/5 sec) "tail" that is
>>outside the preprocessor, which continues treating some frames as
>>speech after the detector has dropped out.
>That's the same patch you sent a while ago, right? Sorry, I haven't had
>much time for Speex lately.
I already sent that?  I forgot :)  We're all busy!

<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 'speex-dev-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 Speex-dev mailing list