Changeset 116bd1b for src/mathutils.c
- Timestamp:
- Feb 16, 2016, 5:47:43 PM (8 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:
- 7cdabbe
- Parents:
- d21a4b1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
rd21a4b1 r116bd1b 254 254 fvec_shift (fvec_t * s) 255 255 { 256 uint_t half = s->length / 2, start = half; 257 // if length is odd, middle element is moved to the end 258 if (2 * half < s->length) start ++; 256 259 #ifndef HAVE_ATLAS 257 uint_t j; 258 for (j = 0; j < s->length / 2; j++) { 259 ELEM_SWAP (s->data[j], s->data[j + s->length / 2]); 260 } 261 #else 262 uint_t half = s->length / 2; 263 aubio_cblas_swap(half, s->data, 1, s->data + half, 1); 264 #endif 260 for (uint_t j = 0; j < half; j++) { 261 ELEM_SWAP (s->data[j], s->data[j + start]); 262 } 263 #else 264 aubio_cblas_swap(half, s->data, 1, s->data + start, 1); 265 #endif 266 if (start != half) { 267 for (uint_t j = 0; j < half; j++) { 268 ELEM_SWAP (s->data[j + start - 1], s->data[j + start]); 269 } 270 } 271 } 272 273 void 274 fvec_ishift (fvec_t * s) 275 { 276 uint_t half = s->length / 2, start = half; 277 // if length is odd, middle element is moved to the beginning 278 if (2 * half < s->length) start ++; 279 #ifndef HAVE_ATLAS 280 for (uint_t j = 0; j < half; j++) { 281 ELEM_SWAP (s->data[j], s->data[j + start]); 282 } 283 #else 284 aubio_cblas_swap(half, s->data, 1, s->data + start, 1); 285 #endif 286 if (start != half) { 287 for (uint_t j = 0; j < half; j++) { 288 ELEM_SWAP (s->data[half], s->data[j]); 289 } 290 } 265 291 } 266 292
Note: See TracChangeset
for help on using the changeset viewer.