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

jm at svn.xiph.org jm at svn.xiph.org
Sun Jan 21 16:31:18 PST 2007


Author: jm
Date: 2007-01-21 16:31:16 -0800 (Sun, 21 Jan 2007)
New Revision: 12370

Modified:
   trunk/speex/libspeex/resample.c
Log:
implemented reset


Modified: trunk/speex/libspeex/resample.c
===================================================================
--- trunk/speex/libspeex/resample.c	2007-01-21 21:54:26 UTC (rev 12369)
+++ trunk/speex/libspeex/resample.c	2007-01-22 00:31:16 UTC (rev 12370)
@@ -50,9 +50,12 @@
    int    out_rate;
    int    num_rate;
    int    den_rate;
+   
+   int    nb_channels;
    int    last_sample;
    int    samp_frac_num;
    int    filt_len;
+   
    float *mem;
    float *sinc_table;
    int    sinc_table_length;
@@ -82,7 +85,8 @@
    st->out_rate = 0;
    st->num_rate = 0;
    st->den_rate = 0;
-
+   
+   st->nb_channels = nb_channels;
    st->last_sample = 0;
    st->filt_len = FILTER_SIZE;
    st->mem = (float*)speex_alloc(nb_channels*(st->filt_len-1) * sizeof(float));
@@ -281,6 +285,9 @@
 
 void speex_resample_reset_mem(SpeexResamplerState *st)
 {
+   int i;
+   for (i=0;i<st->nb_channels*(st->filt_len-1);i++)
+      st->mem[i] = 0;
 }
 
 #define NN 256



More information about the commits mailing list