[xiph-cvs] r6487 - trunk/speex/libspeex

jm at xiph.org jm at xiph.org
Fri Apr 2 13:08:09 PST 2004



Author: jm
Date: 2004-04-02 16:08:08 -0500 (Fri, 02 Apr 2004)
New Revision: 6487

Modified:
   trunk/speex/libspeex/preprocess.c
Log:
changed constants to single precision

<p>Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c	2004-04-02 18:25:44 UTC (rev 6486)
+++ trunk/speex/libspeex/preprocess.c	2004-04-02 21:08:08 UTC (rev 6487)
@@ -91,9 +91,9 @@
    int ind;
    float integer, frac;
    static const float table[21] = {
-      0.82157, 1.02017, 1.20461, 1.37534, 1.53363, 1.68092, 1.81865, 
-      1.94811, 2.07038, 2.18638, 2.29688, 2.40255, 2.50391, 2.60144, 
-      2.69551, 2.78647, 2.87458, 2.96015, 3.04333, 3.12431, 3.20326};
+      0.82157f, 1.02017f, 1.20461f, 1.37534f, 1.53363f, 1.68092f, 1.81865f, 
+      1.94811f, 2.07038f, 2.18638f, 2.29688f, 2.40255f, 2.50391f, 2.60144f, 
+      2.69551f, 2.78647f, 2.87458f, 2.96015f, 3.04333f, 3.12431f, 3.20326f};
    
    if (x>9.5)
       return 1+.12/x;
@@ -102,7 +102,7 @@
    frac = x-integer;
    ind = (int)integer;
    
-   return ((1-frac)*table[ind] + frac*table[ind+1])/sqrt(x+.0001);
+   return ((1-frac)*table[ind] + frac*table[ind+1])/sqrt(x+.0001f);
 }
 
 SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate)
@@ -209,9 +209,9 @@
    for (i=0;i<N;i++)
    {
       float ff=((float)i)*.5*sampling_rate/((float)N);
-      st->loudness_weight[i] = .35-.35*ff/16000+.73*exp(-.5*(ff-3800)*(ff-3800)/9e5);
-      if (st->loudness_weight[i]<.01)
-         st->loudness_weight[i]=.01;
+      st->loudness_weight[i] = .35f-.35f*ff/16000.f+.73f*exp(-.5f*(ff-3800)*(ff-3800)/9e5f);
+      if (st->loudness_weight[i]<.01f)
+         st->loudness_weight[i]=.01f;
       st->loudness_weight[i] *= st->loudness_weight[i];
    }
 
@@ -270,17 +270,17 @@
    int i;
    float beta;
    st->nb_adapt++;
-   beta=1.0/st->nb_adapt;
-   if (beta < .05)
-      beta=.05;
+   beta=1.0f/st->nb_adapt;
+   if (beta < .05f)
+      beta=.05f;
    
    if (!echo)
    {
       for (i=0;i<st->ps_size;i++)
-         st->noise[i] = (1-beta)*st->noise[i] + beta*ps[i];   
+         st->noise[i] = (1.f-beta)*st->noise[i] + beta*ps[i];   
    } else {
       for (i=0;i<st->ps_size;i++)
-         st->noise[i] = (1-beta)*st->noise[i] + beta*max(0,ps[i]-echo[i]); 
+         st->noise[i] = (1.f-beta)*st->noise[i] + beta*max(0.f,ps[i]-echo[i]); 
 #if 0
       for (i=0;i<st->ps_size;i++)
          st->noise[i] = 0;
@@ -292,7 +292,7 @@
 {
    int i, is_speech=0;
    int N = st->ps_size;
-   float scale=.5/N;
+   float scale=.5f/N;
 
    /* FIXME: Clean this up a bit */
    {
@@ -309,7 +309,7 @@
 
       for (i=0;i<NB_BANDS;i++)
       {
-         bands[i]=1e4;
+         bands[i]=1e4f;
          for (j=i*N/NB_BANDS;j<(i+1)*N/NB_BANDS;j++)
          {
             bands[i] += ps[j];
@@ -324,8 +324,8 @@
          p0=.02+.1*exp(-.2*(x-1.5));
       */
 
-      p0=1/(1+exp(3*(1.5-x)));
-      p1=1-p0;
+      p0=1.f/(1.f+exp(3.f*(1.5f-x)));
+      p1=1.f-p0;
 
       /*fprintf (stderr, "%f %f ", p0, p1);*/
       /*p0 *= .99*st->speech_prob + .01*(1-st->speech_prob);
@@ -336,26 +336,26 @@
 
       if (st->noise_bandsN < 50 || st->speech_bandsN < 50)
       {
-         if (mean_post > 5)
+         if (mean_post > 5.f)
          {
             float adapt = 1./st->speech_bandsN++;
-            if (adapt<.005)
-               adapt = .005;
+            if (adapt<.005f)
+               adapt = .005f;
             for (i=0;i<NB_BANDS;i++)
             {
-               st->speech_bands[i] = (1-adapt)*st->speech_bands[i] + adapt*bands[i];
+               st->speech_bands[i] = (1.f-adapt)*st->speech_bands[i] + adapt*bands[i];
                /*st->speech_bands2[i] = (1-adapt)*st->speech_bands2[i] + adapt*bands[i]*bands[i];*/
-               st->speech_bands2[i] = (1-adapt)*st->speech_bands2[i] + adapt*(bands[i]-st->speech_bands[i])*(bands[i]-st->speech_bands[i]);
+               st->speech_bands2[i] = (1.f-adapt)*st->speech_bands2[i] + adapt*(bands[i]-st->speech_bands[i])*(bands[i]-st->speech_bands[i]);
             }
          } else {
             float adapt = 1./st->noise_bandsN++;
-            if (adapt<.005)
-               adapt = .005;
+            if (adapt<.005f)
+               adapt = .005f;
             for (i=0;i<NB_BANDS;i++)
             {
-               st->noise_bands[i] = (1-adapt)*st->noise_bands[i] + adapt*bands[i];
+               st->noise_bands[i] = (1.f-adapt)*st->noise_bands[i] + adapt*bands[i];
                /*st->noise_bands2[i] = (1-adapt)*st->noise_bands2[i] + adapt*bands[i]*bands[i];*/
-               st->noise_bands2[i] = (1-adapt)*st->noise_bands2[i] + adapt*(bands[i]-st->noise_bands[i])*(bands[i]-st->noise_bands[i]);
+               st->noise_bands2[i] = (1.f-adapt)*st->noise_bands2[i] + adapt*(bands[i]-st->noise_bands[i])*(bands[i]-st->noise_bands[i]);
             }
          }
       }
@@ -370,17 +370,17 @@
            speech_var = 1.01*st->speech_bands2[i] - st->speech_bands[i]*st->speech_bands[i];*/
          noise_var = st->noise_bands2[i];
          speech_var = st->speech_bands2[i];
-         if (noise_var < .1)
-            noise_var = .1;
-         if (speech_var < .1)
-            speech_var = .1;
+         if (noise_var < .1f)
+            noise_var = .1f;
+         if (speech_var < .1f)
+            speech_var = .1f;
          
          /*speech_var = sqrt(speech_var*noise_var);
            noise_var = speech_var;*/
-         if (speech_var < .05*speech_var)
-            noise_var = .05*speech_var; 
-         if (speech_var < .05*noise_var)
-            speech_var = .05*noise_var;
+         if (speech_var < .05f*speech_var)
+            noise_var = .05f*speech_var; 
+         if (speech_var < .05f*noise_var)
+            speech_var = .05f*noise_var;
          
          if (bands[i] < st->noise_bands[i])
             speech_var = noise_var;
@@ -389,11 +389,11 @@
 
          speech_mean = st->speech_bands[i];
          noise_mean = st->noise_bands[i];
-         if (noise_mean < speech_mean - 5)
-            noise_mean = speech_mean - 5;
+         if (noise_mean < speech_mean - 5.f)
+            noise_mean = speech_mean - 5.f;
 
-         tmp1 = exp(-.5*(bands[i]-speech_mean)*(bands[i]-speech_mean)/speech_var)/sqrt(2*M_PI*speech_var);
-         tmp2 = exp(-.5*(bands[i]-noise_mean)*(bands[i]-noise_mean)/noise_var)/sqrt(2*M_PI*noise_var);
+         tmp1 = exp(-.5f*(bands[i]-speech_mean)*(bands[i]-speech_mean)/speech_var)/sqrt(2.f*M_PI*speech_var);
+         tmp2 = exp(-.5f*(bands[i]-noise_mean)*(bands[i]-noise_mean)/noise_var)/sqrt(2.f*M_PI*noise_var);
          /*fprintf (stderr, "%f ", (float)(p0/(.01+p0+p1)));*/
          /*fprintf (stderr, "%f ", (float)(bands[i]));*/
          pr = tmp1/(1e-25+tmp1+tmp2);
@@ -401,10 +401,10 @@
             pr=.01;
          if (bands[i] > st->speech_bands[i] && pr < .995)
          pr=.995;*/
-         if (pr>.999)
-            pr=.999;
-         if (pr<.001)
-            pr=.001;
+         if (pr>.999f)
+            pr=.999f;
+         if (pr<.001f)
+            pr=.001f;
          /*fprintf (stderr, "%f ", pr);*/
          p0 *= pr;
          p1 *= (1-pr);
@@ -414,32 +414,32 @@
       p1 = pow(p1,.2);      
       
 #if 1
-      p0 *= 2;
+      p0 *= 2.f;
       p0=p0/(p1+p0);
       if (st->last_speech>20) 
       {
          float tmp = sqrt(tot_loudness)/st->loudness2;
-         tmp = 1-exp(-10*tmp);
+         tmp = 1.f-exp(-10.f*tmp);
          if (p0>tmp)
             p0=tmp;
       }
       p1=1-p0;
 #else
-      if (sqrt(tot_loudness) < .6*st->loudness2 && p0>15*p1)
-         p0=15*p1;
-      if (sqrt(tot_loudness) < .45*st->loudness2 && p0>7*p1)
-         p0=7*p1;
-      if (sqrt(tot_loudness) < .3*st->loudness2 && p0>3*p1)
-         p0=3*p1;
-      if (sqrt(tot_loudness) < .15*st->loudness2 && p0>p1)
+      if (sqrt(tot_loudness) < .6f*st->loudness2 && p0>15.f*p1)
+         p0=15.f*p1;
+      if (sqrt(tot_loudness) < .45f*st->loudness2 && p0>7.f*p1)
+         p0=7.f*p1;
+      if (sqrt(tot_loudness) < .3f*st->loudness2 && p0>3.f*p1)
+         p0=3.f*p1;
+      if (sqrt(tot_loudness) < .15f*st->loudness2 && p0>p1)
          p0=p1;
       /*fprintf (stderr, "%f %f ", (float)(sqrt(tot_loudness) /( .25*st->loudness2)), p0/(p1+p0));*/
 #endif
 
-      p0 *= .99*st->speech_prob + .01*(1-st->speech_prob);
-      p1 *= .01*st->speech_prob + .99*(1-st->speech_prob);
+      p0 *= .99f*st->speech_prob + .01f*(1-st->speech_prob);
+      p1 *= .01f*st->speech_prob + .99f*(1-st->speech_prob);
       
-      st->speech_prob = p0/(1e-25+p1+p0);
+      st->speech_prob = p0/(1e-25f+p1+p0);
       /*fprintf (stderr, "%f %f %f ", tot_loudness, st->loudness2, st->speech_prob);*/
 
       if (st->speech_prob>.35 || (st->last_speech < 20 && st->speech_prob>.1))
@@ -457,8 +457,8 @@
          if (mean_post > 5)
          {
             float adapt = 1./st->speech_bandsN++;
-            if (adapt<.005)
-               adapt = .005;
+            if (adapt<.005f)
+               adapt = .005f;
             for (i=0;i<NB_BANDS;i++)
             {
                st->speech_bands[i] = (1-adapt)*st->speech_bands[i] + adapt*bands[i];
@@ -467,8 +467,8 @@
             }
          } else {
             float adapt = 1./st->noise_bandsN++;
-            if (adapt<.005)
-               adapt = .005;
+            if (adapt<.005f)
+               adapt = .005f;
             for (i=0;i<NB_BANDS;i++)
             {
                st->noise_bands[i] = (1-adapt)*st->noise_bands[i] + adapt*bands[i];
@@ -488,34 +488,34 @@
 {
    int i;
    int N = st->ps_size;
-   float scale=.5/N;
+   float scale=.5f/N;
    float agc_gain;
    int freq_start, freq_end;
    float active_bands = 0;
 
-   freq_start = (int)(300.0*2*N/st->sampling_rate);
-   freq_end   = (int)(2000.0*2*N/st->sampling_rate);
+   freq_start = (int)(300.0f*2*N/st->sampling_rate);
+   freq_end   = (int)(2000.0f*2*N/st->sampling_rate);
    for (i=freq_start;i<freq_end;i++)
    {
-      if (st->S[i] > 20*st->Smin[i]+1000)
+      if (st->S[i] > 20.f*st->Smin[i]+1000.f)
          active_bands+=1;
    }
    active_bands /= (freq_end-freq_start+1);
 
-   if (active_bands > .2)
+   if (active_bands > .2f)
    {
-      float loudness=0;
-      float rate, rate2=.2;
+      float loudness=0.f;
+      float rate, rate2=.2f;
       st->nb_loudness_adapt++;
-      rate=2.0/(1+st->nb_loudness_adapt);
-      if (rate < .05)
-         rate = .05;
-      if (rate < .1 && pow(loudness, LOUDNESS_EXP) > st->loudness)
-         rate = .1;
-      if (rate < .2 && pow(loudness, LOUDNESS_EXP) > 3*st->loudness)
-         rate = .2;
-      if (rate < .4 && pow(loudness, LOUDNESS_EXP) > 10*st->loudness)
-         rate = .4;
+      rate=2.0f/(1+st->nb_loudness_adapt);
+      if (rate < .05f)
+         rate = .05f;
+      if (rate < .1f && pow(loudness, LOUDNESS_EXP) > st->loudness)
+         rate = .1f;
+      if (rate < .2f && pow(loudness, LOUDNESS_EXP) > 3.f*st->loudness)
+         rate = .2f;
+      if (rate < .4f && pow(loudness, LOUDNESS_EXP) > 10.f*st->loudness)
+         rate = .4f;
 
       for (i=2;i<N;i++)
       {
@@ -526,9 +526,9 @@
         loudness*2 > pow(st->loudness, 1.0/LOUDNESS_EXP))*/
       st->loudness = (1-rate)*st->loudness + (rate)*pow(loudness, LOUDNESS_EXP);
       
-      st->loudness2 = (1-rate2)*st->loudness2 + rate2*pow(st->loudness, 1.0/LOUDNESS_EXP);
+      st->loudness2 = (1-rate2)*st->loudness2 + rate2*pow(st->loudness, 1.0f/LOUDNESS_EXP);
 
-      loudness = pow(st->loudness, 1.0/LOUDNESS_EXP);
+      loudness = pow(st->loudness, 1.0f/LOUDNESS_EXP);
 
       /*fprintf (stderr, "%f %f %f\n", loudness, st->loudness2, rate);*/
    }
@@ -581,12 +581,12 @@
    int N = st->ps_size;
 
    for (i=1;i<N-1;i++)
-      st->S[i] = 100+ .8*st->S[i] + .05*st->ps[i-1]+.1*st->ps[i]+.05*st->ps[i+1];
+      st->S[i] = 100.f+ .8f*st->S[i] + .05f*st->ps[i-1]+.1f*st->ps[i]+.05f*st->ps[i+1];
    
    if (st->nb_preprocess<1)
    {
       for (i=1;i<N-1;i++)
-         st->Smin[i] = st->Stmp[i] = st->S[i]+100;
+         st->Smin[i] = st->Stmp[i] = st->S[i]+100.f;
    }
 
    if (st->nb_preprocess%100==0)
@@ -605,9 +605,9 @@
    }
    for (i=1;i<N-1;i++)
    {
-      st->update_prob[i] *= .2;
+      st->update_prob[i] *= .2f;
       if (st->S[i] > 4*st->Smin[i])
-         st->update_prob[i] += .8;
+         st->update_prob[i] += .8f;
       /*fprintf (stderr, "%f ", st->S[i]/st->Smin[i]);*/
       /*fprintf (stderr, "%f ", st->update_prob[i]);*/
    }
@@ -623,7 +623,7 @@
    int N = st->ps_size;
    int N3 = 2*N - st->frame_size;
    int N4 = st->frame_size - N3;
-   float scale=.5/N;
+   float scale=.5f/N;
    float *ps=st->ps;
    float Zframe=0, Pframe;
 
@@ -642,21 +642,21 @@
    /* Deal with residual echo if provided */
    if (echo)
       for (i=1;i<N;i++)
-         st->echo_noise[i] = (.7*st->echo_noise[i] + .3* echo[i]);
+         st->echo_noise[i] = (.7f*st->echo_noise[i] + .3f* echo[i]);
 
    /* Compute a posteriori SNR */
    for (i=1;i<N;i++)
    {
-      st->post[i] = ps[i]/(1+st->noise[i]+st->echo_noise[i]+st->reverb_estimate[i]) - 1;
-      if (st->post[i]>100)
-         st->post[i]=100;
+      st->post[i] = ps[i]/(1.f+st->noise[i]+st->echo_noise[i]+st->reverb_estimate[i]) - 1.f;
+      if (st->post[i]>100.f)
+         st->post[i]=100.f;
       /*if (st->post[i]<0)
         st->post[i]=0;*/
       mean_post+=st->post[i];
    }
    mean_post /= N;
-   if (mean_post<0)
-      mean_post=0;
+   if (mean_post<0.f)
+      mean_post=0.f;
 
    /* Special case for first frame */
    if (st->nb_adapt==1)
@@ -667,8 +667,8 @@
    {
       /* A priori update rate */
       float gamma;
-      float min_gamma=0.12;
-      gamma = 1.0/st->nb_preprocess;
+      float min_gamma=0.12f;
+      gamma = 1.0f/st->nb_preprocess;
 
       /*Make update rate smaller when there's no speech*/
 #if 0
@@ -677,11 +677,11 @@
       else
          min_gamma *= 4.;
 #else
-      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;
+      min_gamma = .1f*fabs(mean_prior - mean_post)*fabs(mean_prior - mean_post);
+      if (min_gamma>.15f)
+         min_gamma = .15f;
+      if (min_gamma<.02f)
+         min_gamma = .02f;
 #endif
       /*min_gamma = .08;*/
 
@@ -692,11 +692,11 @@
       {
          
          /* A priori SNR update */
-         st->prior[i] = gamma*max(0.0,st->post[i]) +
-         (1-gamma)*st->gain[i]*st->gain[i]*st->old_ps[i]/(1+st->noise[i]+st->echo_noise[i]+st->reverb_estimate[i]);
+         st->prior[i] = gamma*max(0.0f,st->post[i]) +
+         (1.f-gamma)*st->gain[i]*st->gain[i]*st->old_ps[i]/(1.f+st->noise[i]+st->echo_noise[i]+st->reverb_estimate[i]);
          
-         if (st->prior[i]>100)
-            st->prior[i]=100;
+         if (st->prior[i]>100.f)
+            st->prior[i]=100.f;
          
          mean_prior+=st->prior[i];
       }
@@ -718,14 +718,14 @@
       float noise_ener=0, sig_ener=0;
       /* If SNR is low (both a priori and a posteriori), update the noise estimate*/
       /*if (mean_prior<.23 && mean_post < .5)*/
-      if (mean_prior<.23 && mean_post < .5)
+      if (mean_prior<.23f && mean_post < .5f)
          do_update = 1;
       for (i=1;i<N;i++)
       {
          noise_ener += st->noise[i];
          sig_ener += ps[i];
       }
-      if (noise_ener > 3*sig_ener)
+      if (noise_ener > 3.f*sig_ener)
          do_update = 1;
       /*do_update = 0;*/
       if (do_update)
@@ -746,24 +746,24 @@
    } else {
       for (i=1;i<N-1;i++)
       {
-         if (st->update_prob[i]<.5 || st->ps[i] < st->noise[i])
+         if (st->update_prob[i]<.5f || st->ps[i] < st->noise[i])
          {
             if (echo)
-               st->noise[i] = .90*st->noise[i] + .1*(st->ps[i]-echo[i]);
+               st->noise[i] = .90f*st->noise[i] + .1f*(st->ps[i]-echo[i]);
             else
-               st->noise[i] = .90*st->noise[i] + .1*st->ps[i];
+               st->noise[i] = .90f*st->noise[i] + .1f*st->ps[i];
          }
       }
    }
 
    for (i=1;i<N;i++)
    {
-      st->zeta[i] = .7*st->zeta[i] + .3*st->prior[i];
+      st->zeta[i] = .7f*st->zeta[i] + .3f*st->prior[i];
    }
 
    {
-      int freq_start = (int)(300.0*2*N/st->sampling_rate);
-      int freq_end   = (int)(2000.0*2*N/st->sampling_rate);
+      int freq_start = (int)(300.0f*2.f*N/st->sampling_rate);
+      int freq_end   = (int)(2000.0f*2.f*N/st->sampling_rate);
       for (i=freq_start;i<freq_end;i++)
       {
          Zframe += st->zeta[i];         
@@ -775,14 +775,14 @@
    {
       Pframe = 0;
    } else {
-      if (Zframe > 1.5*st->Zlast)
+      if (Zframe > 1.5f*st->Zlast)
       {
-         Pframe = 1;
+         Pframe = 1.f;
          st->Zpeak = Zframe;
-         if (st->Zpeak > 10)
-            st->Zpeak = 10;
-         if (st->Zpeak < 1)
-            st->Zpeak = 1;
+         if (st->Zpeak > 10.f)
+            st->Zpeak = 10.f;
+         if (st->Zpeak < 1.f)
+            st->Zpeak = 1.f;
       } else {
          if (Zframe < st->Zpeak*ZMIN)
          {
@@ -808,27 +808,27 @@
       float zeta1;
       float P1;
 
-      prior_ratio = st->prior[i]/(1.0001+st->prior[i]);
-      theta = (1+st->post[i])*prior_ratio;
+      prior_ratio = st->prior[i]/(1.0001f+st->prior[i]);
+      theta = (1.f+st->post[i])*prior_ratio;
 
       if (i==1 || i==N-1)
          zeta1 = st->zeta[i];
       else
-         zeta1 = .25*st->zeta[i-1] + .5*st->zeta[i] + .25*st->zeta[i+1];
+         zeta1 = .25f*st->zeta[i-1] + .5f*st->zeta[i] + .25f*st->zeta[i+1];
       if (zeta1<ZMIN)
-         P1 = 0;
+         P1 = 0.f;
       else if (zeta1>ZMAX)
-         P1 = 1;
+         P1 = 1.f;
       else
          P1 = LOG_MIN_MAX_1 * log(ZMIN_1*zeta1);
   
       /*P1 = log(zeta1/ZMIN)/log(ZMAX/ZMIN);*/
       
-      /* FIXME: add global prop (P2) */
+      /* FIXME: add global prob (P2) */
       q = 1-Pframe*P1;
-      if (q>.95)
-         q=.95;
-      p=1/(1 + (q/(1-q))*(1+st->prior[i])*exp(-theta));
+      if (q>.95f)
+         q=.95f;
+      p=1.f/(1.f + (q/(1.f-q))*(1.f+st->prior[i])*exp(-theta));
       
 
 #if 0
@@ -844,9 +844,9 @@
 
       st->gain[i] = prior_ratio * MM;
       /*Put some (very arbitraty) limit on the gain*/
-      if (st->gain[i]>2)
+      if (st->gain[i]>2.f)
       {
-         st->gain[i]=2;
+         st->gain[i]=2.f;
       }
       
       st->reverb_estimate[i] = st->reverb_decay*st->reverb_estimate[i] + st->reverb_decay*st->reverb_level*st->gain[i]*st->gain[i]*st->ps[i];
@@ -854,11 +854,11 @@
       {
          st->gain2[i]=p*p*st->gain[i];
       } else {
-         st->gain2[i]=1;
+         st->gain2[i]=1.f;
       }
    }
-   st->gain2[0]=st->gain[0]=0;
-   st->gain2[N-1]=st->gain[N-1]=0;
+   st->gain2[0]=st->gain[0]=0.f;
+   st->gain2[N-1]=st->gain[N-1]=0.f;
 
    if (st->agc_enabled)
       speex_compute_agc(st, mean_prior);
@@ -902,9 +902,9 @@
       for (i=0;i<2*N;i++)
          if (fabs(st->frame[i])>max_sample)
             max_sample = fabs(st->frame[i]);
-      if (max_sample>28000)
+      if (max_sample>28000.f)
       {
-         float damp = 28000./max_sample;
+         float damp = 28000.f/max_sample;
          for (i=0;i<2*N;i++)
             st->frame[i] *= damp;
       }
@@ -946,12 +946,12 @@
    
    for (i=1;i<N-1;i++)
    {
-      if (st->update_prob[i]<.5 || st->ps[i] < st->noise[i])
+      if (st->update_prob[i]<.5f || st->ps[i] < st->noise[i])
       {
          if (echo)
-            st->noise[i] = .90*st->noise[i] + .1*(st->ps[i]-echo[i]);
+            st->noise[i] = .90f*st->noise[i] + .1f*(st->ps[i]-echo[i]);
          else
-            st->noise[i] = .90*st->noise[i] + .1*st->ps[i];
+            st->noise[i] = .90f*st->noise[i] + .1f*st->ps[i];
       }
    }
 

--- >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