Changeset 8982328
- Timestamp:
- Sep 5, 2015, 11:07:11 AM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- c9e3a4e
- Parents:
- 7166ef8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r7166ef8 r8982328 29 29 #ifdef HAVE_ACCELERATE 30 30 #include <Accelerate/Accelerate.h> 31 #endif 32 33 #if !HAVE_AUBIO_DOUBLE 34 #define aubio_cblas_xswap cblas_sswap 35 #define aubio_cblas_dot cblas_sdot 36 #else 37 #define aubio_cblas_xswap cblas_dswap 38 #define aubio_cblas_dot cblas_ddot 31 39 #endif 32 40 … … 282 290 fvec_shift (fvec_t * s) 283 291 { 292 #ifndef HAVE_ACCELERATE 284 293 uint_t j; 285 294 for (j = 0; j < s->length / 2; j++) { 286 295 ELEM_SWAP (s->data[j], s->data[j + s->length / 2]); 287 296 } 297 #else 298 uint_t half = s->length / 2; 299 aubio_cblas_xswap(half, s->data, 1, s->data + half, 1); 300 #endif 288 301 } 289 302 … … 292 305 { 293 306 smpl_t energy = 0.; 307 #ifndef HAVE_ACCELERATE 294 308 uint_t j; 295 309 for (j = 0; j < f->length; j++) { 296 310 energy += SQR (f->data[j]); 297 311 } 312 #else 313 energy = aubio_cblas_dot(f->length, f->data, 1, f->data, 1); 314 #endif 298 315 return energy / f->length; 299 316 }
Note: See TracChangeset
for help on using the changeset viewer.