Changeset 1dd95c7
- Timestamp:
- Sep 3, 2015, 9:21:19 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:
- 152ed05
- Parents:
- 5b896e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fvec.c
r5b896e0 r1dd95c7 24 24 #ifdef HAVE_ACCELERATE 25 25 #include <Accelerate/Accelerate.h> 26 #if !HAVE_AUBIO_DOUBLE 27 #define aubio_vDSP_mmov vDSP_mmov 28 #define aubio_vDSP_vmul vDSP_vmul 29 #define aubio_vDSP_vfill vDSP_vfill 30 #else /* HAVE_AUBIO_DOUBLE */ 31 #define aubio_vDSP_mmov vDSP_mmovD 32 #define aubio_vDSP_vmul vDSP_vmulD 33 #define aubio_vDSP_vfill vDSP_vfillD 34 #endif /* HAVE_AUBIO_DOUBLE */ 26 35 #endif 27 36 … … 71 80 } 72 81 #else 73 #if !HAVE_AUBIO_DOUBLE 74 vDSP_vfill(&val, s->data, 1, s->length); 75 #else /* HAVE_AUBIO_DOUBLE */ 76 vDSP_vfillD(&val, s->data, 1, s->length); 77 #endif /* HAVE_AUBIO_DOUBLE */ 82 aubio_vDSP_vfill(&val, s->data, 1, s->length); 78 83 #endif 79 84 } 80 85 81 86 void fvec_zeros(fvec_t *s) { 82 #ifndef HAVE_ACCELERATE 83 #if HAVE_MEMCPY_HACKS 87 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) 88 fvec_set_all (s, 0.); 89 #else 90 #if defined(HAVE_MEMCPY_HACKS) 84 91 memset(s->data, 0, s->length * sizeof(smpl_t)); 85 92 #else 86 fvec_set_all (s, 0.);93 aubio_vDSP_vclr(s->data, 1, s->length); 87 94 #endif 88 #else89 #if !HAVE_AUBIO_DOUBLE90 vDSP_vclr(s->data, 1, s->length);91 #else /* HAVE_AUBIO_DOUBLE */92 vDSP_vclrD(s->data, 1, s->length);93 #endif /* HAVE_AUBIO_DOUBLE */94 95 #endif 95 96 } … … 114 115 } 115 116 #else 116 #if !HAVE_AUBIO_DOUBLE 117 vDSP_vmul(s->data, 1, weight->data, 1, s->data, 1, s->length); 118 #else /* HAVE_AUBIO_DOUBLE */ 119 vDSP_vmulD(s->data, 1, weight->data, 1, s->data, 1, s->length); 120 #endif /* HAVE_AUBIO_DOUBLE */ 117 aubio_vDSP_vmul(s->data, 1, weight->data, 1, s->data, 1, s->length); 121 118 #endif /* HAVE_ACCELERATE */ 122 119 } … … 128 125 return; 129 126 } 130 #ifndef HAVE_ACCELERATE 131 #if HAVE_MEMCPY_HACKS 132 memcpy(t->data, s->data, t->length * sizeof(smpl_t)); 133 #else 127 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) 134 128 uint_t j; 135 129 for (j=0; j< t->length; j++) { 136 130 t->data[j] = s->data[j]; 137 131 } 132 #else 133 #if defined(HAVE_MEMCPY_HACKS) 134 memcpy(t->data, s->data, t->length * sizeof(smpl_t)); 135 #else 136 aubio_vDSP_mmov(s->data, t->data, 1, s->length, 1, 1); 138 137 #endif 139 #else 140 #if !HAVE_AUBIO_DOUBLE 141 vDSP_mmov(s->data, t->data, 1, s->length, 1, 1); 142 #else /* HAVE_AUBIO_DOUBLE */ 143 vDSP_mmovD(s->data, t->data, 1, s->length, 1, 1); 144 #endif /* HAVE_AUBIO_DOUBLE */ 145 #endif /* HAVE_ACCELERATE */ 138 #endif 146 139 }
Note: See TracChangeset
for help on using the changeset viewer.