- Timestamp:
- Sep 2, 2015, 2:27:52 PM (10 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:
- 5b896e0
- Parents:
- e06ac8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mathutils.c
re06ac8f r98d8d2b 159 159 fvec_mean (fvec_t * s) 160 160 { 161 uint_t j;162 161 smpl_t tmp = 0.0; 162 #ifndef HAVE_ACCELERATE 163 uint_t j; 163 164 for (j = 0; j < s->length; j++) { 164 165 tmp += s->data[j]; 165 166 } 166 167 return tmp / (smpl_t) (s->length); 168 #else 169 #if !HAVE_AUBIO_DOUBLE 170 vDSP_meanv(s->data, 1, &tmp, s->length); 171 #else /* HAVE_AUBIO_DOUBLE */ 172 vDSP_meanvD(s->data, 1, &tmp, s->length); 173 #endif /* HAVE_AUBIO_DOUBLE */ 174 return tmp; 175 #endif /* HAVE_ACCELERATE */ 167 176 } 168 177 … … 170 179 fvec_sum (fvec_t * s) 171 180 { 172 uint_t j;173 181 smpl_t tmp = 0.0; 182 #ifndef HAVE_ACCELERATE 183 uint_t j; 174 184 for (j = 0; j < s->length; j++) { 175 185 tmp += s->data[j]; 176 186 } 187 #else 188 #if !HAVE_AUBIO_DOUBLE 189 vDSP_sve(s->data, 1, &tmp, s->length); 190 #else /* HAVE_AUBIO_DOUBLE */ 191 vDSP_sveD(s->data, 1, &tmp, s->length); 192 #endif /* HAVE_AUBIO_DOUBLE */ 193 #endif /* HAVE_ACCELERATE */ 177 194 return tmp; 178 195 }
Note: See TracChangeset
for help on using the changeset viewer.