- Timestamp:
- Oct 16, 2013, 1:21:29 AM (11 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:
- cdd24f0
- Parents:
- 7609f6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
r7609f6d r7c07af2 27 27 #include "config.h" 28 28 29 #ifdef HAVE_ACCELERATE 30 #include <Accelerate/Accelerate.h> 31 #endif 29 32 30 33 /** Window types */ … … 170 173 fvec_max (fvec_t * s) 171 174 { 175 #ifndef HAVE_ACCELERATE 172 176 uint_t j; 173 177 smpl_t tmp = 0.0; … … 175 179 tmp = (tmp > s->data[j]) ? tmp : s->data[j]; 176 180 } 181 #else 182 smpl_t tmp = 0.; 183 #if !HAVE_AUBIO_DOUBLE 184 vDSP_maxv(s->data, 1, &tmp, s->length); 185 #else 186 vDSP_maxvD(s->data, 1, &tmp, s->length); 187 #endif 188 #endif 177 189 return tmp; 178 190 } … … 181 193 fvec_min (fvec_t * s) 182 194 { 195 #ifndef HAVE_ACCELERATE 183 196 uint_t j; 184 197 smpl_t tmp = s->data[0]; … … 186 199 tmp = (tmp < s->data[j]) ? tmp : s->data[j]; 187 200 } 201 #else 202 smpl_t tmp = 0.; 203 #if !HAVE_AUBIO_DOUBLE 204 vDSP_minv(s->data, 1, &tmp, s->length); 205 #else 206 vDSP_minvD(s->data, 1, &tmp, s->length); 207 #endif 208 #endif 188 209 return tmp; 189 210 } … … 192 213 fvec_min_elem (fvec_t * s) 193 214 { 215 #ifndef HAVE_ACCELERATE 194 216 uint_t j, pos = 0.; 195 217 smpl_t tmp = s->data[0]; … … 198 220 tmp = (tmp < s->data[j]) ? tmp : s->data[j]; 199 221 } 222 #else 223 smpl_t tmp = 0.; 224 uint_t pos = 0.; 225 #if !HAVE_AUBIO_DOUBLE 226 vDSP_minvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length); 227 #else 228 vDSP_minviD(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length); 229 #endif 230 #endif 200 231 return pos; 201 232 } … … 204 235 fvec_max_elem (fvec_t * s) 205 236 { 237 #ifndef HAVE_ACCELERATE 206 238 uint_t j, pos = 0; 207 239 smpl_t tmp = 0.0; … … 210 242 tmp = (tmp > s->data[j]) ? tmp : s->data[j]; 211 243 } 244 #else 245 smpl_t tmp = 0.; 246 uint_t pos = 0.; 247 #if !HAVE_AUBIO_DOUBLE 248 vDSP_maxvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length); 249 #else 250 vDSP_maxviD(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length); 251 #endif 252 #endif 212 253 return pos; 213 254 }
Note: See TracChangeset
for help on using the changeset viewer.