single prec float changes, thatnls Steve
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 15 Oct 2014 20:06:52 +0000 (20:06 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 15 Oct 2014 20:06:52 +0000 (20:06 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1895 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/kiss_fft.c
codec2-dev/src/lsp.c
codec2-dev/src/nlp.c
codec2-dev/src/quantise.c
codec2-dev/src/sine.c

index 465d6c97a08104315deb80269ddbf5fc049aa2e2..3d1d4831ec1f44ef37363a960e28a39a91c741ce 100644 (file)
@@ -310,7 +310,7 @@ void kf_factor(int n,int * facbuf)
 {
     int p=4;
     double floor_sqrt;
-    floor_sqrt = floor( sqrt((double)n) );
+    floor_sqrt = floorf( sqrtf((double)n) );
 
     /*factor out powers of 4, powers of 2, then any remaining primes */
     do {
index e47a5636ea90d8d0d827a7719ad0f68441d804a3..192fbbdb089a7fec47d7114efaa9f6864c2754f6 100644 (file)
@@ -241,7 +241,7 @@ int lpc_to_lsp (float *a, int order, float *freq, int nb, float delta)
     /* convert from x domain to radians */
 
     for(i=0; i<order; i++) {
-       freq[i] = acos(freq[i]);
+       freq[i] = acosf(freq[i]);
     }
 
     return(roots);
@@ -274,7 +274,7 @@ void lsp_to_lpc(float *lsp, float *ak, int order)
     /* convert from radians to the x=cos(w) domain */
 
     for(i=0; i<order; i++)
-       freq[i] = cos(lsp[i]);
+       freq[i] = cosf(lsp[i]);
 
     pw = Wp;
 
index 9ed0561625247b1e41521ee7620bf8e91300c610..4ff11c14704cc58bf6b50e9d5be67dbca55d23f7 100644 (file)
@@ -476,7 +476,7 @@ float post_process_mbe(COMP Fw[], int pmin, int pmax, float gmax, COMP Sw[], COM
            for(f0=f0_start; f0<=f0_end; f0+= 2.5) {
                e = test_candidate_mbe(Sw, W, f0);
                #if !defined(NDEBUG) || defined(DUMP)
-               bin = floor(f0); assert((bin > 0) && (bin < F0_MAX));
+               bin = floorf(f0); assert((bin > 0) && (bin < F0_MAX));
                #endif
                #ifdef DUMP
                 e_hz[bin] = e;
@@ -503,7 +503,7 @@ float post_process_mbe(COMP Fw[], int pmin, int pmax, float gmax, COMP Sw[], COM
   for(f0=f0_start; f0<=f0_end; f0+= 2.5) {
       e = test_candidate_mbe(Sw, W, f0);
       #if !defined(NDEBUG) || defined(DUMP)
-      bin = floor(f0); assert((bin > 0) && (bin < F0_MAX));
+      bin = floorf(f0); assert((bin > 0) && (bin < F0_MAX));
       #endif
       #ifdef DUMP
       e_hz[bin] = e;
@@ -547,7 +547,7 @@ float test_candidate_mbe(
     float Wo;             /* current "test" fundamental freq. */
     int   L;
     
-    L = floor((SAMPLE_RATE/2.0)/f0);
+    L = floorf((SAMPLE_RATE/2.0)/f0);
     Wo = f0*(2*PI/SAMPLE_RATE);
 
     error = 0.0;
@@ -558,8 +558,8 @@ float test_candidate_mbe(
        Am.real = 0.0;
        Am.imag = 0.0;
        den = 0.0;
-       al = ceil((l - 0.5)*Wo*FFT_ENC/TWO_PI);
-       bl = ceil((l + 0.5)*Wo*FFT_ENC/TWO_PI);
+       al = ceilf((l - 0.5)*Wo*FFT_ENC/TWO_PI);
+       bl = ceilf((l + 0.5)*Wo*FFT_ENC/TWO_PI);
 
        /* Estimate amplitude of harmonic assuming harmonic is totally voiced */
 
index acf2a1a5ba8fdb88cf0a1969e5dc98ce985fedec..03b9812ed19b8e548d9d039bf35a5884004015a7 100644 (file)
@@ -442,7 +442,7 @@ void compute_weights_anssi_mode2(const float *x, float *w, int ndim)
         else
             w[i]=1.0/(0.01+d[i]);
         
-        w[i]=pow(w[i]+0.3, 0.66);
+        w[i]=powf(w[i]+0.3, 0.66);
   }
 }
 #endif
@@ -638,7 +638,7 @@ static void mbest_search(
        e = 0.0;
        for(i=0; i<k; i++) {
            diff = cb[j*k+i]-vec[i];
-           e += pow(diff*w[i],2.0);
+           e += powf(diff*w[i],2.0);
        }
        index[0] = j;
        mbest_insert(mbest, index, e);
@@ -1113,7 +1113,7 @@ int encode_Wo_dt(float Wo, float prev_Wo)
     float norm;
 
     norm = (Wo - prev_Wo)/(Wo_max - Wo_min);
-    index = floor(WO_LEVELS * norm + 0.5);
+    index = floorf(WO_LEVELS * norm + 0.5);
     //printf("ENC index: %d ", index);
 
     /* hard limit */
index d09b1a579da98b31658d0cfc878d5472e0cf6417..2b6a58fc671feb3d139da8cf7e083bd909585e1a 100644 (file)
@@ -261,7 +261,7 @@ void two_stage_pitch_refinement(MODEL *model, COMP Sw[])
   if (model->Wo > TWO_PI/P_MIN)
     model->Wo = TWO_PI/P_MIN;
 
-  model->L = floor(PI/model->Wo);
+  model->L = floorf(PI/model->Wo);
 }
 
 /*---------------------------------------------------------------------------*\
@@ -369,7 +369,7 @@ void estimate_amplitudes(MODEL *model, COMP Sw[], COMP W[], int est_phase)
         /* Estimate phase of harmonic, this is expensive in CPU for
            embedded devicesso we make it an option */
 
-        model->phi[m] = atan2(Sw[b].imag,Sw[b].real);
+        model->phi[m] = atan2f(Sw[b].imag,Sw[b].real);
     }
   }
 }
@@ -423,8 +423,8 @@ float est_voicing_mbe(
        Am.real = 0.0;
        Am.imag = 0.0;
        den = 0.0;
-       al = ceil((l - 0.5)*Wo*FFT_ENC/TWO_PI);
-       bl = ceil((l + 0.5)*Wo*FFT_ENC/TWO_PI);
+       al = ceilf((l - 0.5)*Wo*FFT_ENC/TWO_PI);
+       bl = ceilf((l + 0.5)*Wo*FFT_ENC/TWO_PI);
 
        /* Estimate amplitude of harmonic assuming harmonic is totally voiced */
 
@@ -616,10 +616,10 @@ void synthesise(
     */
     for(l=1; l<=model->L; l++) {
        for(i=0,j=-N+1; i<N-1; i++,j++) {
-           Sw_[FFT_DEC-N+1+i].real += 2.0*model->A[l]*cos(j*model->Wo*l + model->phi[l]);
+           Sw_[FFT_DEC-N+1+i].real += 2.0*model->A[l]*cosf(j*model->Wo*l + model->phi[l]);
        }
        for(i=N-1,j=0; i<2*N; i++,j++)
-           Sw_[j].real += 2.0*model->A[l]*cos(j*model->Wo*l + model->phi[l]);
+           Sw_[j].real += 2.0*model->A[l]*cosf(j*model->Wo*l + model->phi[l]);
     }  
 #endif