shithub: aubio

Download patch

ref: 50961b97eaa535c6f21493dedeaab3b22c7a9546
parent: 4aa18e3dbc0f8101887c9511538f4c5fe2cc8ce7
parent: ee6ca748537954a97cbfcc5b6d091c40a75e48df
author: Paul Brossier <piem@piem.org>
date: Sun Sep 6 06:20:19 EDT 2015

Merge branch 'develop' into accelerate

--- a/src/aubio_priv.h
+++ b/src/aubio_priv.h
@@ -80,10 +80,22 @@
 #define aubio_vDSP_mmov       vDSP_mmov
 #define aubio_vDSP_vmul       vDSP_vmul
 #define aubio_vDSP_vfill      vDSP_vfill
+#define aubio_vDSP_meanv      vDSP_meanv
+#define aubio_vDSP_sve        vDSP_sve
+#define aubio_vDSP_maxv       vDSP_maxv
+#define aubio_vDSP_maxvi      vDSP_maxvi
+#define aubio_vDSP_minv       vDSP_minv
+#define aubio_vDSP_minvi      vDSP_minvi
 #else /* HAVE_AUBIO_DOUBLE */
 #define aubio_vDSP_mmov       vDSP_mmovD
 #define aubio_vDSP_vmul       vDSP_vmulD
 #define aubio_vDSP_vfill      vDSP_vfillD
+#define aubio_vDSP_meanv      vDSP_meanvD
+#define aubio_vDSP_sve        vDSP_sveD
+#define aubio_vDSP_maxv       vDSP_maxvD
+#define aubio_vDSP_maxvi      vDSP_maxviD
+#define aubio_vDSP_minv       vDSP_minvD
+#define aubio_vDSP_minvi      vDSP_minviD
 #endif /* HAVE_AUBIO_DOUBLE */
 #endif /* HAVE_ACCELERATE */
 
--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -26,18 +26,6 @@
 #include "musicutils.h"
 #include "config.h"
 
-#ifdef HAVE_ACCELERATE
-#include <Accelerate/Accelerate.h>
-#endif
-
-#if !HAVE_AUBIO_DOUBLE
-#define aubio_cblas_xswap cblas_sswap
-#define aubio_cblas_dot   cblas_sdot
-#else
-#define aubio_cblas_xswap cblas_dswap
-#define aubio_cblas_dot   cblas_ddot
-#endif
-
 /** Window types */
 typedef enum
 {
@@ -174,11 +162,7 @@
   }
   return tmp / (smpl_t) (s->length);
 #else
-#if !HAVE_AUBIO_DOUBLE
-  vDSP_meanv(s->data, 1, &tmp, s->length);
-#else /* HAVE_AUBIO_DOUBLE */
-  vDSP_meanvD(s->data, 1, &tmp, s->length);
-#endif /* HAVE_AUBIO_DOUBLE */
+  aubio_vDSP_meanv(s->data, 1, &tmp, s->length);
   return tmp;
 #endif /* HAVE_ACCELERATE */
 }
@@ -193,11 +177,7 @@
     tmp += s->data[j];
   }
 #else
-#if !HAVE_AUBIO_DOUBLE
-  vDSP_sve(s->data, 1, &tmp, s->length);
-#else /* HAVE_AUBIO_DOUBLE */
-  vDSP_sveD(s->data, 1, &tmp, s->length);
-#endif /* HAVE_AUBIO_DOUBLE */
+  aubio_vDSP_sve(s->data, 1, &tmp, s->length);
 #endif /* HAVE_ACCELERATE */
   return tmp;
 }
@@ -213,12 +193,8 @@
   }
 #else
   smpl_t tmp = 0.;
-#if !HAVE_AUBIO_DOUBLE
-  vDSP_maxv(s->data, 1, &tmp, s->length);
-#else
-  vDSP_maxvD(s->data, 1, &tmp, s->length);
+  aubio_vDSP_maxv(s->data, 1, &tmp, s->length);
 #endif
-#endif
   return tmp;
 }
 
@@ -233,12 +209,8 @@
   }
 #else
   smpl_t tmp = 0.;
-#if !HAVE_AUBIO_DOUBLE
-  vDSP_minv(s->data, 1, &tmp, s->length);
-#else
-  vDSP_minvD(s->data, 1, &tmp, s->length);
+  aubio_vDSP_minv(s->data, 1, &tmp, s->length);
 #endif
-#endif
   return tmp;
 }
 
@@ -255,12 +227,8 @@
 #else
   smpl_t tmp = 0.;
   uint_t pos = 0.;
-#if !HAVE_AUBIO_DOUBLE
-  vDSP_minvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
-#else
-  vDSP_minviD(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
+  aubio_vDSP_minvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
 #endif
-#endif
   return pos;
 }
 
@@ -277,11 +245,7 @@
 #else
   smpl_t tmp = 0.;
   uint_t pos = 0.;
-#if !HAVE_AUBIO_DOUBLE
-  vDSP_maxvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
-#else
-  vDSP_maxviD(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
-#endif
+  aubio_vDSP_maxvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
 #endif
   return pos;
 }