Changeset 50961b9 for src/mathutils.c


Ignore:
Timestamp:
Sep 6, 2015, 10:20:19 AM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
b046c8c
Parents:
4aa18e3 (diff), ee6ca74 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'develop' into accelerate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r4aa18e3 r50961b9  
    2626#include "musicutils.h"
    2727#include "config.h"
    28 
    29 #ifdef HAVE_ACCELERATE
    30 #include <Accelerate/Accelerate.h>
    31 #endif
    32 
    33 #if !HAVE_AUBIO_DOUBLE
    34 #define aubio_cblas_xswap cblas_sswap
    35 #define aubio_cblas_dot   cblas_sdot
    36 #else
    37 #define aubio_cblas_xswap cblas_dswap
    38 #define aubio_cblas_dot   cblas_ddot
    39 #endif
    4028
    4129/** Window types */
     
    175163  return tmp / (smpl_t) (s->length);
    176164#else
    177 #if !HAVE_AUBIO_DOUBLE
    178   vDSP_meanv(s->data, 1, &tmp, s->length);
    179 #else /* HAVE_AUBIO_DOUBLE */
    180   vDSP_meanvD(s->data, 1, &tmp, s->length);
    181 #endif /* HAVE_AUBIO_DOUBLE */
     165  aubio_vDSP_meanv(s->data, 1, &tmp, s->length);
    182166  return tmp;
    183167#endif /* HAVE_ACCELERATE */
     
    194178  }
    195179#else
    196 #if !HAVE_AUBIO_DOUBLE
    197   vDSP_sve(s->data, 1, &tmp, s->length);
    198 #else /* HAVE_AUBIO_DOUBLE */
    199   vDSP_sveD(s->data, 1, &tmp, s->length);
    200 #endif /* HAVE_AUBIO_DOUBLE */
     180  aubio_vDSP_sve(s->data, 1, &tmp, s->length);
    201181#endif /* HAVE_ACCELERATE */
    202182  return tmp;
     
    214194#else
    215195  smpl_t tmp = 0.;
    216 #if !HAVE_AUBIO_DOUBLE
    217   vDSP_maxv(s->data, 1, &tmp, s->length);
    218 #else
    219   vDSP_maxvD(s->data, 1, &tmp, s->length);
    220 #endif
     196  aubio_vDSP_maxv(s->data, 1, &tmp, s->length);
    221197#endif
    222198  return tmp;
     
    234210#else
    235211  smpl_t tmp = 0.;
    236 #if !HAVE_AUBIO_DOUBLE
    237   vDSP_minv(s->data, 1, &tmp, s->length);
    238 #else
    239   vDSP_minvD(s->data, 1, &tmp, s->length);
    240 #endif
     212  aubio_vDSP_minv(s->data, 1, &tmp, s->length);
    241213#endif
    242214  return tmp;
     
    256228  smpl_t tmp = 0.;
    257229  uint_t pos = 0.;
    258 #if !HAVE_AUBIO_DOUBLE
    259   vDSP_minvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
    260 #else
    261   vDSP_minviD(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
    262 #endif
     230  aubio_vDSP_minvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
    263231#endif
    264232  return pos;
     
    278246  smpl_t tmp = 0.;
    279247  uint_t pos = 0.;
    280 #if !HAVE_AUBIO_DOUBLE
    281   vDSP_maxvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
    282 #else
    283   vDSP_maxviD(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
    284 #endif
     248  aubio_vDSP_maxvi(s->data, 1, &tmp, (vDSP_Length *)&pos, s->length);
    285249#endif
    286250  return pos;
Note: See TracChangeset for help on using the changeset viewer.