- Timestamp:
- Sep 2, 2015, 2:44:22 PM (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:
- 1dd95c7
- Parents:
- 98d8d2b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/fvec.c
r98d8d2b r5b896e0 21 21 #include "aubio_priv.h" 22 22 #include "fvec.h" 23 24 #ifdef HAVE_ACCELERATE 25 #include <Accelerate/Accelerate.h> 26 #endif 23 27 24 28 fvec_t * new_fvec( uint_t length) { … … 61 65 62 66 void fvec_set_all (fvec_t *s, smpl_t val) { 67 #ifndef HAVE_ACCELERATE 63 68 uint_t j; 64 69 for (j=0; j< s->length; j++) { 65 70 s->data[j] = val; 66 71 } 72 #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 */ 78 #endif 67 79 } 68 80 69 81 void fvec_zeros(fvec_t *s) { 82 #ifndef HAVE_ACCELERATE 70 83 #if HAVE_MEMCPY_HACKS 71 84 memset(s->data, 0, s->length * sizeof(smpl_t)); 72 85 #else 73 86 fvec_set_all (s, 0.); 87 #endif 88 #else 89 #if !HAVE_AUBIO_DOUBLE 90 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 */ 74 94 #endif 75 95 } … … 87 107 88 108 void fvec_weight(fvec_t *s, fvec_t *weight) { 109 #ifndef HAVE_ACCELERATE 89 110 uint_t j; 90 111 uint_t length = MIN(s->length, weight->length); … … 92 113 s->data[j] *= weight->data[j]; 93 114 } 115 #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 */ 121 #endif /* HAVE_ACCELERATE */ 94 122 } 95 123 … … 100 128 return; 101 129 } 130 #ifndef HAVE_ACCELERATE 102 131 #if HAVE_MEMCPY_HACKS 103 132 memcpy(t->data, s->data, t->length * sizeof(smpl_t)); … … 108 137 } 109 138 #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 */ 110 146 }
Note: See TracChangeset
for help on using the changeset viewer.