denoiser tuning, Solaris support, small optimization in codebook
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Tue, 30 Sep 2003 00:44:08 +0000 (00:44 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Tue, 30 Sep 2003 00:44:08 +0000 (00:44 +0000)
computations.

git-svn-id: http://svn.xiph.org/trunk/speex@5383 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/cb_search.c
libspeex/preprocess.c
src/speexdec.c

index 785bb49..ce45264 100644 (file)
@@ -136,7 +136,8 @@ int   complexity
       {
          res[j]=0;
          for (k=0;k<=j;k++)
       {
          res[j]=0;
          for (k=0;k<=j;k++)
-            res[j] += 0.03125*shape[k]*r[j-k];
+            res[j] += shape[k]*r[j-k];
+         res[j] *= 0.03125;
       }
       
       /* Compute codeword energy */
       }
       
       /* Compute codeword energy */
index 48387ba..6de1531 100644 (file)
@@ -582,7 +582,7 @@ static void update_noise_prob(SpeexPreprocessState *st)
          st->Smin[i] = st->Stmp[i] = st->S[i]+100;
    }
 
          st->Smin[i] = st->Stmp[i] = st->S[i]+100;
    }
 
-   if (st->nb_preprocess%80==0)
+   if (st->nb_preprocess%100==0)
    {
       for (i=1;i<N-1;i++)
       {
    {
       for (i=1;i<N-1;i++)
       {
@@ -670,14 +670,15 @@ int speex_preprocess(SpeexPreprocessState *st, float *x, float *echo)
       else
          min_gamma *= 4.;
 #else
       else
          min_gamma *= 4.;
 #else
-      min_gamma = .2*fabs(mean_prior - mean_post)*fabs(mean_prior - mean_post);
-      if (min_gamma>.6)
-         min_gamma = .6;
-      if (min_gamma<.01)
-         min_gamma = .01;
+      min_gamma = .1*fabs(mean_prior - mean_post)*fabs(mean_prior - mean_post);
+      if (min_gamma>.15)
+         min_gamma = .15;
+      if (min_gamma<.02)
+         min_gamma = .02;
 #endif
 #endif
+      /*min_gamma = .08;*/
 
 
-      if (gamma<min_gamma)
+      /*if (gamma<min_gamma)*/
          gamma=min_gamma;
       
       for (i=1;i<N;i++)
          gamma=min_gamma;
       
       for (i=1;i<N;i++)
index 689ea41..1c1898c 100644 (file)
@@ -194,6 +194,7 @@ FILE *out_file_open(char *outFile, int rate, int *channels)
 #endif
       info.play.encoding = AUDIO_ENCODING_SLINEAR;
       info.play.precision = 16;
 #endif
       info.play.encoding = AUDIO_ENCODING_SLINEAR;
       info.play.precision = 16;
+      info.play.sample_rate = rate;
       info.play.channels = *channels;
       
       if (ioctl(audio_fd, AUDIO_SETINFO, &info) < 0)
       info.play.channels = *channels;
       
       if (ioctl(audio_fd, AUDIO_SETINFO, &info) < 0)