shithub: aubio

Download patch

ref: 053495bddae15831da28ee865378ec5c62ea7408
parent: a1718fc896310b64032c380dcd5ab7f6a35edd58
author: Paul Brossier <piem@piem.org>
date: Fri Jul 31 18:05:17 EDT 2015

src/*.c: fix some useless float conversion

--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -140,7 +140,7 @@
       break;
     case aubio_win_parzen:
       for (i=0;i<size;i++)
-        w[i] = 1.0 - ABS((2.*i-size)/(size+1.0));
+        w[i] = 1.0 - ABS((2.f*i-size)/(size+1.0f));
       break;
     default:
       break;
--- a/src/spectral/specdesc.c
+++ b/src/spectral/specdesc.c
@@ -118,7 +118,7 @@
     // sqrt ( r_1^2 + r_2^2 - 2 * r_1 * r_2 * \cos ( \phi_1 - \phi_2 ) )
     onset->data[0] +=
       SQRT (ABS (SQR (o->oldmag->data[j]) + SQR (fftgrain->norm[j])
-            - 2. * o->oldmag->data[j] * fftgrain->norm[j]
+            - 2 * o->oldmag->data[j] * fftgrain->norm[j]
             * COS (o->dev1->data[j] - fftgrain->phas[j])));
     /* swap old phase data (need to remember 2 frames behind)*/
     o->theta2->data[j] = o->theta1->data[j];
--- a/src/tempo/beattracking.c
+++ b/src/tempo/beattracking.c
@@ -330,7 +330,7 @@
   //i.e. 3rd frame after flagstep initially set
   if (counter == 1 && flagstep == 1) {
     //check for consistency between previous beatperiod values
-    if (ABS (2. * rp - rp1 - rp2) < bt->g_var) {
+    if (ABS (2 * rp - rp1 - rp2) < bt->g_var) {
       //if true, can activate context dependent model
       flagconst = 1;
       counter = 0;              // reset counter and flagstep