Changeset 81b3910


Ignore:
Timestamp:
Oct 1, 2017, 12:50:15 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
a6b5bf1
Parents:
16c12a1 (diff), faeec7c (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 'intel_ipp_pull' of https://github.com/emuell/aubio into emuell-intel_ipp_pull

Files:
61 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r16c12a1 r81b3910  
    8787void examples_common_init (int argc, char **argv)
    8888{
     89  /* initialize statics */
     90  aubio_init();
    8991
    9092  /* parse command line arguments */
  • src/aubio_priv.h

    r16c12a1 r81b3910  
    9494#define aubio_vDSP_minvi      vDSP_minvi
    9595#define aubio_vDSP_dotpr      vDSP_dotpr
     96#define aubio_vDSP_vclr       vDSP_vclr
    9697#else /* HAVE_AUBIO_DOUBLE */
    9798#define aubio_vDSP_mmov       vDSP_mmovD
     
    105106#define aubio_vDSP_minvi      vDSP_minviD
    106107#define aubio_vDSP_dotpr      vDSP_dotprD
     108#define aubio_vDSP_vclr       vDSP_vclrD
    107109#endif /* HAVE_AUBIO_DOUBLE */
    108110#endif /* HAVE_ACCELERATE */
  • src/cvec.c

    r16c12a1 r81b3910  
    2121#include "aubio_priv.h"
    2222#include "cvec.h"
     23
     24#if defined HAVE_INTEL_IPP
     25#include <ippcore.h>
     26#include <ippvm.h>
     27#include <ipps.h>
     28#endif
    2329
    2430cvec_t * new_cvec(uint_t length) {
     
    8692    return;
    8793  }
    88 #ifdef HAVE_MEMCPY_HACKS
     94#if defined(HAVE_INTEL_IPP)
     95  #if HAVE_AUBIO_DOUBLE
     96    ippsCopy_64f(s->phas, t->phas, (int)s->length);
     97    ippsCopy_64f(s->norm, t->norm, (int)s->length);
     98  #else
     99    ippsCopy_32f(s->phas, t->phas, (int)s->length);
     100    ippsCopy_32f(s->norm, t->norm, (int)s->length);
     101  #endif
     102#elif defined(HAVE_MEMCPY_HACKS)
    89103  memcpy(t->norm, s->norm, t->length * sizeof(smpl_t));
    90104  memcpy(t->phas, s->phas, t->length * sizeof(smpl_t));
    91 #else /* HAVE_MEMCPY_HACKS */
     105#else
    92106  uint_t j;
    93107  for (j=0; j< t->length; j++) {
     
    95109    t->phas[j] = s->phas[j];
    96110  }
    97 #endif /* HAVE_MEMCPY_HACKS */
    98 }
    99 
    100 void cvec_norm_set_all (cvec_t *s, smpl_t val) {
     111#endif
     112}
     113
     114void cvec_norm_set_all(cvec_t *s, smpl_t val) {
     115#if defined(HAVE_INTEL_IPP)
     116  #if HAVE_AUBIO_DOUBLE
     117    ippsSet_64f(val, s->norm, (int)s->length);
     118  #else
     119    ippsSet_32f(val, s->norm, (int)s->length);
     120  #endif
     121#else
    101122  uint_t j;
    102123  for (j=0; j< s->length; j++) {
    103124    s->norm[j] = val;
    104125  }
     126#endif
    105127}
    106128
    107129void cvec_norm_zeros(cvec_t *s) {
    108 #ifdef HAVE_MEMCPY_HACKS
     130#if defined(HAVE_INTEL_IPP)
     131  #if HAVE_AUBIO_DOUBLE
     132    ippsZero_64f(s->norm, (int)s->length);
     133  #else
     134    ippsZero_32f(s->norm, (int)s->length);
     135  #endif
     136#elif defined(HAVE_MEMCPY_HACKS)
    109137  memset(s->norm, 0, s->length * sizeof(smpl_t));
    110 #else /* HAVE_MEMCPY_HACKS */
     138#else
    111139  cvec_norm_set_all (s, 0.);
    112 #endif /* HAVE_MEMCPY_HACKS */
     140#endif
    113141}
    114142
     
    118146
    119147void cvec_phas_set_all (cvec_t *s, smpl_t val) {
     148#if defined(HAVE_INTEL_IPP)
     149  #if HAVE_AUBIO_DOUBLE
     150    ippsSet_64f(val, s->phas, (int)s->length);
     151  #else
     152    ippsSet_32f(val, s->phas, (int)s->length);
     153  #endif
     154#else
    120155  uint_t j;
    121156  for (j=0; j< s->length; j++) {
    122157    s->phas[j] = val;
    123158  }
     159#endif
    124160}
    125161
    126162void cvec_phas_zeros(cvec_t *s) {
    127 #ifdef HAVE_MEMCPY_HACKS
     163#if defined(HAVE_INTEL_IPP)
     164  #if HAVE_AUBIO_DOUBLE
     165    ippsZero_64f(s->phas, (int)s->length);
     166  #else
     167    ippsZero_32f(s->phas, (int)s->length);
     168  #endif
     169#elif defined(HAVE_MEMCPY_HACKS)
    128170  memset(s->phas, 0, s->length * sizeof(smpl_t));
    129171#else
     
    142184
    143185void cvec_logmag(cvec_t *s, smpl_t lambda) {
    144   uint_t j;
    145   for (j=0; j< s->length; j++) {
    146     s->norm[j] = LOG(lambda * s->norm[j] + 1);
    147   }
    148 }
     186  #if defined(HAVE_INTEL_IPP)
     187    #if HAVE_AUBIO_DOUBLE
     188      ippsMulC_64f(s->norm, lambda, s->norm, (int)s->length);
     189      ippsAddC_64f(s->norm, 1.0, s->norm, (int)s->length);
     190      ippsLn_64f_A26(s->norm, s->norm, (int)s->length);
     191    #else
     192      ippsMulC_32f(s->norm, lambda, s->norm, (int)s->length);
     193      ippsAddC_32f(s->norm, 1.0, s->norm, (int)s->length);
     194      ippsLn_32f_A21(s->norm, s->norm, (int)s->length);
     195    #endif
     196  #else
     197    uint_t j;
     198    for (j=0; j< s->length; j++) {
     199      s->norm[j] = LOG(lambda * s->norm[j] + 1);
     200    }
     201  #endif
     202}
  • src/fvec.c

    r16c12a1 r81b3910  
    2121#include "aubio_priv.h"
    2222#include "fvec.h"
     23
     24#if defined HAVE_INTEL_IPP
     25#include <ippcore.h>
     26#include <ippvm.h>
     27#include <ipps.h>
     28#endif
    2329
    2430fvec_t * new_fvec(uint_t length) {
     
    6167
    6268void fvec_set_all (fvec_t *s, smpl_t val) {
    63 #if !defined(HAVE_ACCELERATE) && !defined(HAVE_ATLAS)
    64   uint_t j;
    65   for (j=0; j< s->length; j++) {
    66     s->data[j] = val;
    67   }
     69#if defined(HAVE_INTEL_IPP)
     70  #if HAVE_AUBIO_DOUBLE
     71    ippsSet_64f(val, s->data, (int)s->length);
     72  #else
     73    ippsSet_32f(val, s->data, (int)s->length);
     74  #endif
    6875#elif defined(HAVE_ATLAS)
    6976  aubio_catlas_set(s->length, val, s->data, 1);
    7077#elif defined(HAVE_ACCELERATE)
    7178  aubio_vDSP_vfill(&val, s->data, 1, s->length);
     79#else
     80  uint_t j;
     81  for ( j = 0; j< s->length; j++ )
     82  {
     83    s->data[j] = val;
     84  }
    7285#endif
    7386}
    7487
    7588void fvec_zeros(fvec_t *s) {
    76 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE)
    77   fvec_set_all (s, 0.);
    78 #else
    79 #if defined(HAVE_MEMCPY_HACKS)
     89#if defined(HAVE_INTEL_IPP)
     90  #if HAVE_AUBIO_DOUBLE
     91    ippsZero_64f(s->data, (int)s->length);
     92  #else
     93    ippsZero_32f(s->data, (int)s->length);
     94  #endif
     95#elif defined(HAVE_ACCELERATE)
     96  aubio_vDSP_vclr(s->data, 1, s->length);
     97#elif defined(HAVE_MEMCPY_HACKS)
    8098  memset(s->data, 0, s->length * sizeof(smpl_t));
    8199#else
    82   aubio_vDSP_vclr(s->data, 1, s->length);
    83 #endif
     100  fvec_set_all(s, 0.);
    84101#endif
    85102}
     
    97114
    98115void fvec_weight(fvec_t *s, const fvec_t *weight) {
    99 #ifndef HAVE_ACCELERATE
     116  uint_t length = MIN(s->length, weight->length);
     117#if defined(HAVE_INTEL_IPP)
     118  #if HAVE_AUBIO_DOUBLE
     119    ippsMul_64f(s->data, weight->data, s->data, (int)length);
     120  #else
     121    ippsMul_32f(s->data, weight->data, s->data, (int)length);
     122  #endif
     123#elif defined(HAVE_ACCELERATE)
     124  aubio_vDSP_vmul( s->data, 1, weight->data, 1, s->data, 1, length );
     125#else
    100126  uint_t j;
    101   uint_t length = MIN(s->length, weight->length);
    102   for (j=0; j< length; j++) {
     127  for (j = 0; j < length; j++) {
    103128    s->data[j] *= weight->data[j];
    104129  }
    105 #else
    106   aubio_vDSP_vmul(s->data, 1, weight->data, 1, s->data, 1, s->length);
    107130#endif /* HAVE_ACCELERATE */
    108131}
    109132
    110133void fvec_weighted_copy(const fvec_t *in, const fvec_t *weight, fvec_t *out) {
    111 #ifndef HAVE_ACCELERATE
     134  uint_t length = MIN(in->length, MIN(out->length, weight->length));
     135#if defined(HAVE_INTEL_IPP)
     136  #if HAVE_AUBIO_DOUBLE
     137    ippsMul_64f(in->data, weight->data, out->data, (int)length);
     138  #else
     139    ippsMul_32f(in->data, weight->data, out->data, (int)length);
     140  #endif
     141#elif defined(HAVE_ACCELERATE)
     142  aubio_vDSP_vmul(in->data, 1, weight->data, 1, out->data, 1, length);
     143#else
    112144  uint_t j;
    113   uint_t length = MIN(out->length, weight->length);
    114   for (j=0; j< length; j++) {
     145  for (j = 0; j < length; j++) {
    115146    out->data[j] = in->data[j] * weight->data[j];
    116147  }
    117 #else
    118   aubio_vDSP_vmul(in->data, 1, weight->data, 1, out->data, 1, out->length);
    119 #endif /* HAVE_ACCELERATE */
     148#endif
    120149}
    121150
     
    126155    return;
    127156  }
    128 #ifdef HAVE_NOOPT
    129   uint_t j;
    130   for (j=0; j< t->length; j++) {
    131     t->data[j] = s->data[j];
    132   }
    133 #elif defined(HAVE_MEMCPY_HACKS)
    134   memcpy(t->data, s->data, t->length * sizeof(smpl_t));
     157#if defined(HAVE_INTEL_IPP)
     158  #if HAVE_AUBIO_DOUBLE
     159    ippsCopy_64f(s->data, t->data, (int)s->length);
     160  #else
     161    ippsCopy_32f(s->data, t->data, (int)s->length);
     162  #endif
    135163#elif defined(HAVE_ATLAS)
    136164  aubio_cblas_copy(s->length, s->data, 1, t->data, 1);
    137165#elif defined(HAVE_ACCELERATE)
    138166  aubio_vDSP_mmov(s->data, t->data, 1, s->length, 1, 1);
     167#elif defined(HAVE_MEMCPY_HACKS)
     168  memcpy(t->data, s->data, t->length * sizeof(smpl_t));
     169#else
     170  uint_t j;
     171  for (j = 0; j < t->length; j++) {
     172    t->data[j] = s->data[j];
     173  }
    139174#endif
    140175}
  • src/mathutils.c

    r16c12a1 r81b3910  
    2525#include "mathutils.h"
    2626#include "musicutils.h"
     27
     28#if defined HAVE_INTEL_IPP
     29#include <ippcore.h>
     30#include <ippvm.h>
     31#include <ipps.h>
     32#endif
    2733
    2834/** Window types */
     
    160166{
    161167  smpl_t tmp = 0.0;
    162 #ifndef HAVE_ACCELERATE
     168#if defined(HAVE_INTEL_IPP)
     169  #if HAVE_AUBIO_DOUBLE
     170    ippsMean_64f(s->data, (int)s->length, &tmp);
     171  #else
     172    ippsMean_32f(s->data, (int)s->length, &tmp, ippAlgHintFast);
     173  #endif
     174    return tmp;
     175#elif defined(HAVE_ACCELERATE)
     176  aubio_vDSP_meanv(s->data, 1, &tmp, s->length);
     177  return tmp;
     178#else
    163179  uint_t j;
    164180  for (j = 0; j < s->length; j++) {
    165181    tmp += s->data[j];
    166182  }
    167   return tmp / (smpl_t) (s->length);
    168 #else
    169   aubio_vDSP_meanv(s->data, 1, &tmp, s->length);
    170   return tmp;
    171 #endif /* HAVE_ACCELERATE */
     183  return tmp / (smpl_t)(s->length);
     184#endif
    172185}
    173186
     
    176189{
    177190  smpl_t tmp = 0.0;
    178 #ifndef HAVE_ACCELERATE
     191#if defined(HAVE_INTEL_IPP)
     192  #if HAVE_AUBIO_DOUBLE
     193    ippsSum_64f(s->data, (int)s->length, &tmp);
     194  #else
     195    ippsSum_32f(s->data, (int)s->length, &tmp, ippAlgHintFast);
     196  #endif
     197#elif defined(HAVE_ACCELERATE)
     198  aubio_vDSP_sve(s->data, 1, &tmp, s->length);
     199#else
    179200  uint_t j;
    180201  for (j = 0; j < s->length; j++) {
    181202    tmp += s->data[j];
    182203  }
    183 #else
    184   aubio_vDSP_sve(s->data, 1, &tmp, s->length);
    185 #endif /* HAVE_ACCELERATE */
     204#endif
    186205  return tmp;
    187206}
     
    190209fvec_max (fvec_t * s)
    191210{
    192 #ifndef HAVE_ACCELERATE
    193   uint_t j;
    194   smpl_t tmp = 0.0;
    195   for (j = 0; j < s->length; j++) {
     211#if defined(HAVE_INTEL_IPP)
     212  smpl_t tmp = 0.;
     213  #if HAVE_AUBIO_DOUBLE
     214    ippsMax_64f( s->data, (int)s->length, &tmp);
     215  #else
     216    ippsMax_32f( s->data, (int)s->length, &tmp);
     217#endif
     218#elif defined(HAVE_ACCELERATE)
     219  smpl_t tmp = 0.;
     220  aubio_vDSP_maxv( s->data, 1, &tmp, s->length );
     221#else
     222  uint_t j;
     223  smpl_t tmp = s->data[0];
     224  for (j = 1; j < s->length; j++) {
    196225    tmp = (tmp > s->data[j]) ? tmp : s->data[j];
    197226  }
    198 #else
     227#endif
     228  return tmp;
     229}
     230
     231smpl_t
     232fvec_min (fvec_t * s)
     233{
     234#if defined(HAVE_INTEL_IPP)
    199235  smpl_t tmp = 0.;
    200   aubio_vDSP_maxv(s->data, 1, &tmp, s->length);
    201 #endif
    202   return tmp;
    203 }
    204 
    205 smpl_t
    206 fvec_min (fvec_t * s)
    207 {
    208 #ifndef HAVE_ACCELERATE
    209   uint_t j;
    210   smpl_t tmp = s->data[0];
    211   for (j = 0; j < s->length; j++) {
    212     tmp = (tmp < s->data[j]) ? tmp : s->data[j];
    213   }
    214 #else
     236  #if HAVE_AUBIO_DOUBLE
     237    ippsMin_64f(s->data, (int)s->length, &tmp);
     238  #else
     239    ippsMin_32f(s->data, (int)s->length, &tmp);
     240#endif
     241#elif defined(HAVE_ACCELERATE)
    215242  smpl_t tmp = 0.;
    216243  aubio_vDSP_minv(s->data, 1, &tmp, s->length);
     244#else
     245  uint_t j;
     246  smpl_t tmp = s->data[0];
     247  for (j = 1; j < s->length; j++) {
     248    tmp = (tmp < s->data[j]) ? tmp : s->data[j];
     249  }
    217250#endif
    218251  return tmp;
     
    575608}
    576609
     610uint_t
     611aubio_power_of_two_order (uint_t a)
     612{
     613  int order = 0;
     614  int temp = aubio_next_power_of_two(a);
     615  while (temp >>= 1) {
     616    ++order;
     617  }
     618  return order;
     619}
     620
    577621smpl_t
    578622aubio_db_spl (const fvec_t * o)
     
    639683
    640684void
     685aubio_init (void)
     686{
     687/* initialize intel IPP */
     688#ifdef HAVE_INTEL_IPP
     689  IppStatus status = ippInit();
     690  if (status != ippStsNoErr) {
     691    fprintf (stderr, "Error: failed to initialize Intel IPP - status %d\n", status);
     692  }
     693#endif
     694}
     695
     696void
    641697aubio_cleanup (void)
    642698{
  • src/mathutils.h

    r16c12a1 r81b3910  
    313313uint_t aubio_next_power_of_two(uint_t a);
    314314
     315/** return the log2 factor of the given power of 2 value a */
     316uint_t aubio_power_of_two_order(uint_t a);
     317
    315318/** compute normalised autocorrelation function
    316319
  • src/musicutils.h

    r16c12a1 r81b3910  
    9393smpl_t aubio_miditofreq (smpl_t midi);
    9494
     95/** initialize global status at beginning of program
     96
     97  This function should be used before doing anything else in aubio.
     98  So far it is only used to initialize the Intel IPP library, when it's used.
     99*/
     100void aubio_init (void);
     101
    95102/** clean up cached memory at the end of program
    96103
  • src/spectral/fft.c

    r16c12a1 r81b3910  
    7878pthread_mutex_t aubio_fftw_mutex = PTHREAD_MUTEX_INITIALIZER;
    7979
    80 #else
    81 #ifdef HAVE_ACCELERATE        // using ACCELERATE
     80#elif defined HAVE_ACCELERATE        // using ACCELERATE
    8281// https://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html
    8382#include <Accelerate/Accelerate.h>
     
    113112#endif /* HAVE_AUBIO_DOUBLE */
    114113
    115 #else                         // using OOURA
     114#elif defined HAVE_INTEL_IPP // using INTEL IPP
     115
     116#include <ippcore.h>
     117#include <ippvm.h>
     118#include <ipps.h>
     119
     120#else // using OOURA
    116121// let's use ooura instead
    117122extern void aubio_ooura_rdft(int, int, smpl_t *, int *, smpl_t *);
    118123
    119 #endif /* HAVE_ACCELERATE */
    120 #endif /* HAVE_FFTW3 */
     124#endif
    121125
    122126struct _aubio_fft_t {
    123127  uint_t winsize;
    124128  uint_t fft_size;
     129
    125130#ifdef HAVE_FFTW3             // using FFTW3
    126131  real_t *in, *out;
    127132  fftw_plan pfw, pbw;
    128   fft_data_t * specdata;      /* complex spectral data */
    129 #else
    130 #ifdef HAVE_ACCELERATE        // using ACCELERATE
     133  fft_data_t * specdata; /* complex spectral data */
     134
     135#elif defined HAVE_ACCELERATE  // using ACCELERATE
    131136  int log2fftsize;
    132137  aubio_FFTSetup fftSetup;
    133138  aubio_DSPSplitComplex spec;
    134139  smpl_t *in, *out;
     140 
     141#elif defined HAVE_INTEL_IPP  // using Intel IPP
     142  // mark FFT impl as Intel IPP
     143  #define INTEL_IPP_FFT 1
     144  smpl_t *in, *out;
     145  Ipp8u* memSpec;
     146  Ipp8u* memInit;
     147  Ipp8u* memBuffer;
     148  #if HAVE_AUBIO_DOUBLE
     149    struct FFTSpec_R_64f* fftSpec;
     150    Ipp64fc* complexOut;
     151  #else
     152    struct FFTSpec_R_32f* fftSpec;
     153    Ipp32fc* complexOut;
     154  #endif
    135155#else                         // using OOURA
    136156  smpl_t *in, *out;
    137157  smpl_t *w;
    138158  int *ip;
    139 #endif /* HAVE_ACCELERATE */
    140 #endif /* HAVE_FFTW3 */
     159#endif /* using OOURA */
     160
    141161  fvec_t * compspec;
    142162};
     
    148168    goto beach;
    149169  }
     170
    150171#ifdef HAVE_FFTW3
    151172  uint_t i;
     
    176197    s->specdata[i] = 0.;
    177198  }
    178 #else
    179 #ifdef HAVE_ACCELERATE        // using ACCELERATE
     199
     200#elif defined HAVE_ACCELERATE  // using ACCELERATE
    180201  s->winsize = winsize;
    181202  s->fft_size = winsize;
    182203  s->compspec = new_fvec(winsize);
    183   s->log2fftsize = (uint_t)log2f(s->fft_size);
     204  s->log2fftsize = aubio_power_of_two_order(s->fft_size);
    184205  s->in = AUBIO_ARRAY(smpl_t, s->fft_size);
    185206  s->out = AUBIO_ARRAY(smpl_t, s->fft_size);
     
    187208  s->spec.imagp = AUBIO_ARRAY(smpl_t, s->fft_size/2);
    188209  s->fftSetup = aubio_vDSP_create_fftsetup(s->log2fftsize, FFT_RADIX2);
     210
     211#elif defined HAVE_INTEL_IPP  // using Intel IPP
     212  const IppHintAlgorithm qualityHint = ippAlgHintAccurate; // OR ippAlgHintFast;
     213  const int flags = IPP_FFT_NODIV_BY_ANY; // we're scaling manually afterwards
     214  int order = aubio_power_of_two_order(winsize);
     215  int sizeSpec, sizeInit, sizeBuffer;
     216  IppStatus status;
     217
     218  if (winsize <= 4 || aubio_is_power_of_two(winsize) != 1)
     219  {
     220    AUBIO_ERR("intel IPP fft: can only create with sizes > 4 and power of two, requested %d,"
     221      " try recompiling aubio with --enable-fftw3\n", winsize);
     222    goto beach;
     223  }
     224
     225#if HAVE_AUBIO_DOUBLE
     226  status = ippsFFTGetSize_R_64f(order, flags, qualityHint,
     227      &sizeSpec, &sizeInit, &sizeBuffer);
     228#else
     229  status = ippsFFTGetSize_R_32f(order, flags, qualityHint,
     230    &sizeSpec, &sizeInit, &sizeBuffer);
     231#endif
     232  if (status != ippStsNoErr) {
     233    AUBIO_ERR("fft: failed to initialize fft. IPP error: %d\n", status);
     234    goto beach;
     235  }
     236  s->fft_size = s->winsize = winsize;
     237  s->compspec = new_fvec(winsize);
     238  s->in = AUBIO_ARRAY(smpl_t, s->winsize);
     239  s->out = AUBIO_ARRAY(smpl_t, s->winsize);
     240  s->memSpec = ippsMalloc_8u(sizeSpec);
     241  s->memBuffer = ippsMalloc_8u(sizeBuffer);
     242  if (sizeInit > 0 ) {
     243    s->memInit = ippsMalloc_8u(sizeInit);
     244  }
     245#if HAVE_AUBIO_DOUBLE
     246  s->complexOut = ippsMalloc_64fc(s->fft_size / 2 + 1);
     247  status = ippsFFTInit_R_64f(
     248    &s->fftSpec, order, flags, qualityHint, s->memSpec, s->memInit);
     249#else
     250  s->complexOut = ippsMalloc_32fc(s->fft_size / 2 + 1);
     251  status = ippsFFTInit_R_32f(
     252    &s->fftSpec, order, flags, qualityHint, s->memSpec, s->memInit);
     253#endif
     254  if (status != ippStsNoErr) {
     255    AUBIO_ERR("fft: failed to initialize. IPP error: %d\n", status);
     256    goto beach;
     257  }
     258
    189259#else                         // using OOURA
    190260  if (aubio_is_power_of_two(winsize) != 1) {
     
    201271  s->w     = AUBIO_ARRAY(smpl_t, s->fft_size);
    202272  s->ip[0] = 0;
    203 #endif /* HAVE_ACCELERATE */
    204 #endif /* HAVE_FFTW3 */
     273#endif /* using OOURA */
     274
    205275  return s;
     276
    206277beach:
    207278  AUBIO_FREE(s);
     
    211282void del_aubio_fft(aubio_fft_t * s) {
    212283  /* destroy data */
    213   del_fvec(s->compspec);
    214284#ifdef HAVE_FFTW3             // using FFTW3
    215285  pthread_mutex_lock(&aubio_fftw_mutex);
     
    218288  fftw_free(s->specdata);
    219289  pthread_mutex_unlock(&aubio_fftw_mutex);
    220 #else /* HAVE_FFTW3 */
    221 #ifdef HAVE_ACCELERATE        // using ACCELERATE
     290
     291#elif defined HAVE_ACCELERATE // using ACCELERATE
    222292  AUBIO_FREE(s->spec.realp);
    223293  AUBIO_FREE(s->spec.imagp);
    224294  aubio_vDSP_destroy_fftsetup(s->fftSetup);
     295
     296#elif defined HAVE_INTEL_IPP  // using Intel IPP
     297  ippFree(s->memSpec);
     298  ippFree(s->memInit);
     299  ippFree(s->memBuffer);
     300  ippFree(s->complexOut);
     301
    225302#else                         // using OOURA
    226303  AUBIO_FREE(s->w);
    227304  AUBIO_FREE(s->ip);
    228 #endif /* HAVE_ACCELERATE */
    229 #endif /* HAVE_FFTW3 */
     305#endif
     306
     307  del_fvec(s->compspec);
     308  AUBIO_FREE(s->in);
    230309  AUBIO_FREE(s->out);
    231   AUBIO_FREE(s->in);
    232310  AUBIO_FREE(s);
    233311}
     
    235313void aubio_fft_do(aubio_fft_t * s, const fvec_t * input, cvec_t * spectrum) {
    236314  aubio_fft_do_complex(s, input, s->compspec);
    237   aubio_fft_get_spectrum(s->compspec, spectrum);
     315  aubio_fft_get_spectrum(s, s->compspec, spectrum);
    238316}
    239317
    240318void aubio_fft_rdo(aubio_fft_t * s, const cvec_t * spectrum, fvec_t * output) {
    241   aubio_fft_get_realimag(spectrum, s->compspec);
     319  aubio_fft_get_realimag(s, spectrum, s->compspec);
    242320  aubio_fft_rdo_complex(s, s->compspec, output);
    243321}
     
    252330  memcpy(s->in, input->data, s->winsize * sizeof(smpl_t));
    253331#endif /* HAVE_MEMCPY_HACKS */
     332
    254333#ifdef HAVE_FFTW3             // using FFTW3
    255334  fftw_execute(s->pfw);
     
    266345  }
    267346#endif /* HAVE_COMPLEX_H */
    268 #else /* HAVE_FFTW3 */
    269 #ifdef HAVE_ACCELERATE        // using ACCELERATE
     347
     348#elif defined HAVE_ACCELERATE // using ACCELERATE
    270349  // convert real data to even/odd format used in vDSP
    271350  aubio_vDSP_ctoz((aubio_DSPComplex*)s->in, 2, &s->spec, 1, s->fft_size/2);
     
    282361  smpl_t scale = 1./2.;
    283362  aubio_vDSP_vsmul(compspec->data, 1, &scale, compspec->data, 1, s->fft_size);
     363
     364#elif defined HAVE_INTEL_IPP  // using Intel IPP
     365
     366  // apply fft
     367#if HAVE_AUBIO_DOUBLE
     368  ippsFFTFwd_RToCCS_64f(s->in, (Ipp64f*)s->complexOut, s->fftSpec, s->memBuffer);
     369#else
     370  ippsFFTFwd_RToCCS_32f(s->in, (Ipp32f*)s->complexOut, s->fftSpec, s->memBuffer);
     371#endif
     372  // convert complex buffer to [ r0, r1, ..., rN, iN-1, .., i2, i1]
     373  compspec->data[0] = s->complexOut[0].re;
     374  compspec->data[s->fft_size / 2] = s->complexOut[s->fft_size / 2].re;
     375  for (i = 1; i < s->fft_size / 2; i++) {
     376    compspec->data[i] = s->complexOut[i].re;
     377    compspec->data[s->fft_size - i] = s->complexOut[i].im;
     378  }
     379  // apply scaling
     380#if HAVE_AUBIO_DOUBLE
     381  ippsMulC_64f(compspec->data, 1.0 / 2.0, compspec->data, s->fft_size);
     382#else
     383  ippsMulC_32f(compspec->data, 1.0 / 2.0, compspec->data, s->fft_size);
     384#endif
     385
    284386#else                         // using OOURA
    285387  aubio_ooura_rdft(s->winsize, 1, s->in, s->ip, s->w);
     
    290392    compspec->data[s->winsize - i] = - s->in[2 * i + 1];
    291393  }
    292 #endif /* HAVE_ACCELERATE */
    293 #endif /* HAVE_FFTW3 */
     394#endif /* using OOURA */
    294395}
    295396
     
    314415    output->data[i] = s->out[i]*renorm;
    315416  }
    316 #else /* HAVE_FFTW3 */
    317 #ifdef HAVE_ACCELERATE        // using ACCELERATE
     417
     418#elif defined HAVE_ACCELERATE // using ACCELERATE
    318419  // convert from real imag  [ r0, r1, ..., rN, iN-1, .., i2, i1]
    319420  // to vDSP packed format   [ r0, rN, r1, i1, ..., rN-1, iN-1 ]
     
    333434  smpl_t scale = 1.0 / s->winsize;
    334435  aubio_vDSP_vsmul(output->data, 1, &scale, output->data, 1, s->fft_size);
     436
     437#elif defined HAVE_INTEL_IPP  // using Intel IPP
     438
     439  // convert from real imag  [ r0, 0, ..., rN, iN-1, .., i2, i1, iN-1] to complex format
     440  s->complexOut[0].re = compspec->data[0];
     441  s->complexOut[0].im = 0;
     442  s->complexOut[s->fft_size / 2].re = compspec->data[s->fft_size / 2];
     443  s->complexOut[s->fft_size / 2].im = 0.0;
     444  for (i = 1; i < s->fft_size / 2; i++) {
     445    s->complexOut[i].re = compspec->data[i];
     446    s->complexOut[i].im = compspec->data[s->fft_size - i];
     447  }
     448#if HAVE_AUBIO_DOUBLE
     449  // apply fft
     450  ippsFFTInv_CCSToR_64f((const Ipp64f *)s->complexOut, output->data, s->fftSpec, s->memBuffer);
     451  // apply scaling
     452  ippsMulC_64f(output->data, 2.0 / s->winsize, output->data, s->fft_size);
     453#else
     454  // apply fft
     455  ippsFFTInv_CCSToR_32f((const Ipp32f *)s->complexOut, output->data, s->fftSpec, s->memBuffer);
     456  // apply scaling
     457  ippsMulC_32f(output->data, 2.0f / s->winsize, output->data, s->fft_size);
     458#endif /* HAVE_AUBIO_DOUBLE */
     459
    335460#else                         // using OOURA
    336461  smpl_t scale = 2.0 / s->winsize;
     
    345470    output->data[i] = s->out[i] * scale;
    346471  }
    347 #endif /* HAVE_ACCELERATE */
    348 #endif /* HAVE_FFTW3 */
    349 }
    350 
    351 void aubio_fft_get_spectrum(const fvec_t * compspec, cvec_t * spectrum) {
    352   aubio_fft_get_phas(compspec, spectrum);
    353   aubio_fft_get_norm(compspec, spectrum);
    354 }
    355 
    356 void aubio_fft_get_realimag(const cvec_t * spectrum, fvec_t * compspec) {
    357   aubio_fft_get_imag(spectrum, compspec);
    358   aubio_fft_get_real(spectrum, compspec);
    359 }
    360 
    361 void aubio_fft_get_phas(const fvec_t * compspec, cvec_t * spectrum) {
     472#endif
     473}
     474
     475void aubio_fft_get_spectrum(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum) {
     476  aubio_fft_get_phas(s, compspec, spectrum);
     477  aubio_fft_get_norm(s, compspec, spectrum);
     478}
     479
     480void aubio_fft_get_realimag(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec) {
     481  aubio_fft_get_imag(s, spectrum, compspec);
     482  aubio_fft_get_real(s, spectrum, compspec);
     483}
     484
     485void aubio_fft_get_phas(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum) {
     486
     487#ifdef INTEL_IPP_FFT // using Intel IPP FFT
     488  uint_t i;
     489 
     490  // convert from real imag  [ r0, 0, ..., rN, iN-1, .., i2, i1, iN-1] to complex format
     491  s->complexOut[0].re = compspec->data[0];
     492  s->complexOut[0].im = 0;
     493  s->complexOut[s->fft_size / 2].re = compspec->data[s->fft_size / 2];
     494  s->complexOut[s->fft_size / 2].im = 0.0;
     495  for (i = 1; i < spectrum->length - 1; i++) {
     496    s->complexOut[i].re = compspec->data[i];
     497    s->complexOut[i].im = compspec->data[compspec->length - i];
     498  }
     499 
     500#if HAVE_AUBIO_DOUBLE
     501  IppStatus status = ippsPhase_64fc(s->complexOut, spectrum->phas, spectrum->length);
     502#else
     503  IppStatus status = ippsPhase_32fc(s->complexOut, spectrum->phas, spectrum->length);
     504#endif
     505  if (status != ippStsNoErr) {
     506    AUBIO_ERR("fft: failed to extract phase from fft. IPP error: %d\n", status);
     507  }
     508
     509#else                 // NOT using Intel IPP
    362510  uint_t i;
    363511  if (compspec->data[0] < 0) {
     
    375523    spectrum->phas[spectrum->length - 1] = 0.;
    376524  }
    377 }
    378 
    379 void aubio_fft_get_norm(const fvec_t * compspec, cvec_t * spectrum) {
     525#endif
     526}
     527
     528void aubio_fft_get_norm(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum) {
    380529  uint_t i = 0;
    381530  spectrum->norm[0] = ABS(compspec->data[0]);
     
    388537}
    389538
    390 void aubio_fft_get_imag(const cvec_t * spectrum, fvec_t * compspec) {
     539void aubio_fft_get_imag(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec) {
    391540  uint_t i;
    392541  for (i = 1; i < ( compspec->length + 1 ) / 2 /*- 1 + 1*/; i++) {
     
    396545}
    397546
    398 void aubio_fft_get_real(const cvec_t * spectrum, fvec_t * compspec) {
     547void aubio_fft_get_real(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec) {
    399548  uint_t i;
    400549  for (i = 0; i < compspec->length / 2 + 1; i++) {
  • src/spectral/fft.h

    r16c12a1 r81b3910  
    9999
    100100*/
    101 void aubio_fft_get_spectrum(const fvec_t * compspec, cvec_t * spectrum);
     101void aubio_fft_get_spectrum(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum);
    102102/** convert real/imag spectrum to norm/phas spectrum
    103103
     
    106106
    107107*/
    108 void aubio_fft_get_realimag(const cvec_t * spectrum, fvec_t * compspec);
     108void aubio_fft_get_realimag(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec);
    109109
    110110/** compute phas spectrum from real/imag parts
     
    114114
    115115*/
    116 void aubio_fft_get_phas(const fvec_t * compspec, cvec_t * spectrum);
     116void aubio_fft_get_phas(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum);
    117117/** compute imaginary part from the norm/phas cvec
    118118
     
    121121
    122122*/
    123 void aubio_fft_get_imag(const cvec_t * spectrum, fvec_t * compspec);
     123void aubio_fft_get_imag(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec);
    124124
    125125/** compute norm component from real/imag parts
     
    129129
    130130*/
    131 void aubio_fft_get_norm(const fvec_t * compspec, cvec_t * spectrum);
     131void aubio_fft_get_norm(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum);
    132132/** compute real part from norm/phas components
    133133
     
    136136
    137137*/
    138 void aubio_fft_get_real(const cvec_t * spectrum, fvec_t * compspec);
     138void aubio_fft_get_real(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec);
    139139
    140140#ifdef __cplusplus
  • tests/src/io/test-sink-multi.c

    r16c12a1 r81b3910  
    77int main (int argc, char **argv)
    88{
     9  aubio_init();
     10
    911  sint_t err = 0;
    1012
     
    6971  del_aubio_source(i);
    7072beach_source:
     73
     74  aubio_cleanup();
     75 
    7176  return err;
    7277}
  • tests/src/io/test-sink.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7
    68  sint_t err = 0;
    79
     
    5557  del_fvec(vec);
    5658beach_fvec:
     59
     60  aubio_cleanup();
     61 
    5762  return err;
    5863}
  • tests/src/io/test-sink_apple_audio-multi.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  sint_t err = 0;
    1113
     
    7577  PRINT_ERR("aubio was not compiled with aubio_sink_apple_audio\n");
    7678#endif /* HAVE_SINK_APPLE_AUDIO */
     79
     80  aubio_cleanup();
     81 
    7782  return err;
    7883}
  • tests/src/io/test-sink_apple_audio.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  sint_t err = 0;
    1113
     
    6466  PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
    6567#endif /* HAVE_SINK_APPLE_AUDIO */
     68
     69  aubio_cleanup();
     70 
    6671  return err;
    6772}
  • tests/src/io/test-sink_sndfile-multi.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  sint_t err = 0;
    1113
     
    7577  PRINT_ERR("aubio was not compiled with aubio_sink_sndfile\n");
    7678#endif /* HAVE_SNDFILE */
     79
     80  aubio_cleanup();
     81 
    7782  return err;
    7883}
  • tests/src/io/test-sink_sndfile.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  sint_t err = 0;
    1113
     
    6466  PRINT_ERR("aubio was not compiled with aubio_source_sndfile\n");
    6567#endif /* HAVE_SNDFILE */
     68
     69  aubio_cleanup();
     70 
    6671  return err;
    6772}
  • tests/src/io/test-sink_wavwrite-multi.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  sint_t err = 0;
    1113
     
    7577  PRINT_ERR("aubio was not compiled with aubio_sink_wavwrite\n");
    7678#endif /* HAVE_WAVWRITE */
     79
     80  aubio_cleanup();
     81 
    7782  return err;
    7883}
  • tests/src/io/test-sink_wavwrite.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  sint_t err = 0;
    1113
     
    6466  PRINT_ERR("aubio was not compiled with aubio_sink_wavwrite\n");
    6567#endif /* HAVE_WAVWRITE */
     68
     69  aubio_cleanup();
     70 
    6671  return err;
    6772}
  • tests/src/io/test-source.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7
    68  uint_t err = 0;
    79  if (argc < 2) {
     
    5658  del_aubio_source (s);
    5759beach:
     60  aubio_cleanup();
    5861  return err;
    5962}
  • tests/src/io/test-source_apple_audio.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  uint_t err = 0;
    1113  if (argc < 2) {
     
    6062  PRINT_ERR("aubio was not compiled with aubio_source_apple_audio\n");
    6163#endif /* HAVE_SOURCE_APPLE_AUDIO */
     64
     65  aubio_cleanup();
     66 
    6267  return err;
    6368}
  • tests/src/io/test-source_avcodec.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  uint_t err = 0;
    1113  if (argc < 2) {
     
    6062  PRINT_ERR("aubio was not compiled with aubio_source_avcodec\n");
    6163#endif /* HAVE_LIBAV */
     64
     65  aubio_cleanup();
     66 
    6267  return err;
    6368}
  • tests/src/io/test-source_multi.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7
    68  sint_t err = 0;
    79  if (argc < 2) {
     
    5456beach:
    5557
     58  aubio_cleanup();
     59 
    5660  return err;
    5761}
  • tests/src/io/test-source_seek.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7
    68  uint_t err = 0;
    79  if (argc < 2) {
     
    8991  // check that we got about half the frames, with 3 decimals
    9092  assert ( roundf(1.e3 * old_n_frames_1 / old_n_frames_3) / 1.e3 == 2.);
     93
     94  aubio_cleanup();
     95 
    9196  return err;
    9297}
  • tests/src/io/test-source_sndfile.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  uint_t err = 0;
    1113  if (argc < 2) {
     
    6062  PRINT_ERR("aubio was not compiled with aubio_source_sndfile\n");
    6163#endif /* HAVE_SNDFILE */
     64
     65  aubio_cleanup();
     66 
    6267  return err;
    6368}
  • tests/src/io/test-source_wavread.c

    r16c12a1 r81b3910  
    88int main (int argc, char **argv)
    99{
     10  aubio_init();
     11
    1012  uint_t err = 0;
    1113  if (argc < 2) {
     
    6163  PRINT_ERR("aubio was not compiled with aubio_source_wavread\n");
    6264#endif /* HAVE_WAVREAD */
     65
     66  aubio_cleanup();
     67 
    6368  return err;
    6469}
  • tests/src/onset/test-onset.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7 
    68  uint_t err = 0;
    79  if (argc < 2) {
  • tests/src/pitch/test-pitch.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  // 1. allocate some memory
    68  uint_t n = 0; // frame counter
  • tests/src/pitch/test-pitchfcomb.c

    r16c12a1 r81b3910  
    88int main (void)
    99{
     10  aubio_init();
    1011  uint_t i = 0;
    1112  uint_t win_s = 1024; // window size
  • tests/src/pitch/test-pitchmcomb.c

    r16c12a1 r81b3910  
    88int main (void)
    99{
     10  aubio_init();
     11 
    1012  uint_t n = 10; // compute n times
    1113  uint_t win_s = 1024; // window size
  • tests/src/pitch/test-pitchschmitt.c

    r16c12a1 r81b3910  
    88int main (void)
    99{
     10  aubio_init();
    1011  uint_t n = 10; // compute n times
    1112  uint_t win_s = 1024; // window size
  • tests/src/pitch/test-pitchspecacf.c

    r16c12a1 r81b3910  
    88int main (void)
    99{
     10  aubio_init();
     11 
    1012  uint_t n = 10; // compute n times
    1113  uint_t win_s = 1024; // window size
  • tests/src/pitch/test-pitchyin.c

    r16c12a1 r81b3910  
    88int main (void)
    99{
     10  aubio_init();
     11 
    1012  uint_t n = 10; // compute n times
    1113  uint_t win_s = 1024; // window size
  • tests/src/pitch/test-pitchyinfft.c

    r16c12a1 r81b3910  
    88int main (void)
    99{
     10  aubio_init();
     11 
    1012  uint_t n = 10; // compute n times
    1113  uint_t win_s = 1024; // window size
  • tests/src/spectral/test-awhitening.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7
    68  sint_t err = 0;
    79
     
    8082  del_fvec(vec);
    8183beach_fvec:
     84  aubio_cleanup();
    8285  return err;
    8386}
  • tests/src/spectral/test-fft.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  int return_code = 0;
    68  uint_t i, n_iters = 100; // number of iterations
     
    4446  del_cvec(fftgrain);
    4547  del_fvec(out);
     48
    4649  aubio_cleanup();
     50 
    4751  return return_code;
    4852}
  • tests/src/spectral/test-filterbank.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  uint_t win_s = 1024; // window size
    68  uint_t n_filters = 13; // number of filters
     
    3436  del_cvec (in_spec);
    3537  del_fvec (out_filters);
     38 
    3639  aubio_cleanup ();
    3740
  • tests/src/spectral/test-filterbank_mel.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  uint_t samplerate = 16000; // samplerate of signal to filter
    68  uint_t win_s = 512; // fft size
     
    3335  del_cvec (in_spec);
    3436  del_fvec (out_filters);
     37 
    3538  aubio_cleanup ();
    3639
  • tests/src/spectral/test-mfcc.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6
    57  uint_t win_s = 512; // fft size
    68  uint_t n_filters = 40; // number of filters
     
    2527  del_cvec (in);
    2628  del_fvec (out);
     29 
    2730  aubio_cleanup ();
    2831
  • tests/src/spectral/test-phasevoc.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  uint_t n = 6; // compute n times
    68  uint_t win_s = 32; // window size
     
    4244  del_fvec(out);
    4345  del_aubio_pvoc(pv);
     46 
    4447  aubio_cleanup();
    4548
  • tests/src/spectral/test-specdesc.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  uint_t win_s = 1024; // window size
    68  cvec_t *in = new_cvec (win_s); // input buffer
     
    3941  del_cvec (in);
    4042  del_fvec (out);
     43 
    4144  aubio_cleanup ();
    4245
  • tests/src/spectral/test-tss.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  uint_t n = 10; // compute n times
    68  uint_t win_s = 1024; // window size
  • tests/src/synth/test-sampler.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7 
    68  sint_t err = 0;
    79
     
    5456  del_aubio_sink(sink);
    5557  del_fvec(vec);
     58 
    5659  aubio_cleanup();
    5760
  • tests/src/synth/test-wavetable.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7 
    68  sint_t err = 0;
    79
     
    6365  del_aubio_sink(sink);
    6466  del_fvec(vec);
     67 
    6568  aubio_cleanup();
    6669
  • tests/src/tempo/test-beattracking.c

    r16c12a1 r81b3910  
    66int main (void)
    77{
     8  aubio_init();
     9 
    810  uint_t i = 0;
    911  uint_t win_s = 1024; // window size
     
    3436  del_fvec(in);
    3537  del_fvec(out);
     38 
    3639  aubio_cleanup();
    3740
  • tests/src/tempo/test-tempo.c

    r16c12a1 r81b3910  
    44int main (int argc, char **argv)
    55{
     6  aubio_init();
     7 
    68  uint_t err = 0;
    79  if (argc < 2) {
     
    5759  del_fvec(out);
    5860  del_aubio_source(source);
     61 
    5962beach:
    6063  aubio_cleanup();
  • tests/src/temporal/test-a_weighting.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
    5  
     5  aubio_init();
     6
    67  aubio_filter_t * f;
    78
     
    3940  del_aubio_filter (f);
    4041
     42  aubio_cleanup();
     43 
    4144  return 0;
    4245}
  • tests/src/temporal/test-biquad.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6
    57  uint_t win_s = 64; // window size
    68
     
    2931  del_fvec(out_vec);
    3032
     33  aubio_cleanup();
     34 
    3135  return 0;
    3236}
  • tests/src/temporal/test-c_weighting.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6
    57  aubio_filter_t * f;
    68
     
    3840  del_aubio_filter (f);
    3941
     42  aubio_cleanup();
     43 
    4044  return 0;
    4145}
  • tests/src/temporal/test-filter.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6 
    57  uint_t win_s = 16; // window size
    68  uint_t impulse_at = win_s / 2;
     
    3032  del_fvec (out);
    3133  del_aubio_filter (o);
     34 
    3235  aubio_cleanup ();
    3336
  • tests/src/temporal/test-resampler.c

    r16c12a1 r81b3910  
    33int main (void)
    44{
     5  aubio_init();
     6
    57  uint_t win_s = 1024; // window size
    68  smpl_t ratio = 0.5;
     
    1921  del_fvec (out);
    2022
     23  aubio_cleanup();
     24
    2125  return 0;
    2226}
  • tests/src/test-cvec.c

    r16c12a1 r81b3910  
    44int main (void)
    55{
     6  aubio_init();
     7
    68  uint_t i, window_size = 16; // window size
    79  cvec_t * complex_vector = new_cvec (window_size); // input buffer
     
    4547  // destroy it
    4648  del_cvec(complex_vector);
     49
     50  aubio_cleanup();
     51
    4752  return 0;
    4853}
  • tests/src/test-delnull.c

    r16c12a1 r81b3910  
    77int main (void)
    88{
     9  aubio_init();
     10
    911  uint_t return_code = 0;
    1012  fvec_t *f = new_fvec(-12);
     
    2123    return_code = 3;
    2224  }
     25
     26  aubio_cleanup();
     27 
    2328  return return_code;
    2429}
  • tests/src/test-fmat.c

    r16c12a1 r81b3910  
    77int main (void)
    88{
     9  aubio_init();
     10
    911  uint_t height = 3, length = 9, i, j;
    1012  // create fmat_t object
     
    2628  // destroy it
    2729  del_fmat(mat);
     30
     31  aubio_cleanup();
     32 
    2833  return 0;
    2934}
  • tests/src/test-fvec.c

    r16c12a1 r81b3910  
    44int main (void)
    55{
     6  aubio_init();
     7
    68  uint_t vec_size = 10, i;
    79  fvec_t * vec = new_fvec (vec_size);
     
    3941  del_fvec(vec);
    4042
     43  aubio_cleanup();
     44
    4145  return 0;
    4246}
  • tests/src/test-lvec.c

    r16c12a1 r81b3910  
    44int main (void)
    55{
     6  aubio_init();
     7
    68  uint_t win_s = 32; // window size
    79  lvec_t * sp = new_lvec (win_s); // input buffer
     
    1416  lvec_print (sp);
    1517  del_lvec(sp);
     18
     19  aubio_cleanup();
     20 
    1621  return 0;
    1722}
  • tests/src/test-mathutils-window.c

    r16c12a1 r81b3910  
    44int main (void)
    55{
     6  aubio_init();
     7
    68  uint_t length = 0;
    79  uint_t n_length = 4, n_types = 10, i, t;
     
    2729    }
    2830  }
     31
     32  aubio_cleanup();
     33 
    2934  return 0;
    3035}
  • tests/src/test-mathutils.c

    r16c12a1 r81b3910  
    114114int main (void)
    115115{
     116  aubio_init();
     117
    116118  test_next_power_of_two();
    117119  test_miditofreq();
    118120  test_freqtomidi();
     121
     122  aubio_cleanup();
     123 
    119124  return 0;
    120125}
  • tests/src/utils/test-hist.c

    r16c12a1 r81b3910  
    55int main (void)
    66{
     7  aubio_init();
     8
    79  uint_t length;
    810  for (length = 1; length < 10; length ++ ) {
     
    2628    del_fvec(t);
    2729  }
     30
     31  aubio_cleanup();
     32 
    2833  return 0;
    2934}
  • tests/src/utils/test-log.c

    r16c12a1 r81b3910  
    2424int main (void)
    2525{
     26  aubio_init();
     27
    2628  fprintf(stdout, "### testing normal logging\n");
    2729  AUBIO_ERR("testing normal AUBIO_LOG_ERR\n");
     
    5759  AUBIO_DBG("testing again normal AUBIO_LOG_DBG\n");
    5860
     61  aubio_cleanup();
     62 
    5963  return 0;
    6064}
  • tests/src/utils/test-parameter.c

    r16c12a1 r81b3910  
    2525int main (void)
    2626{
     27  aubio_init();
     28
    2729  smpl_t max_value = 100.;
    2830  smpl_t min_value = 0.;
     
    6769  del_aubio_parameter (param);
    6870
     71  aubio_cleanup();
     72 
    6973  return 0;
    7074}
  • tests/src/utils/test-scale.c

    r16c12a1 r81b3910  
    55int main (void)
    66{
     7  aubio_init();
     8
    79  uint_t n = 0;
    810  uint_t win_s = 1024; // window size
     
    1921  del_fvec(in);
    2022
     23  aubio_cleanup();
     24 
    2125  return 0;
    2226}
  • wscript

    r16c12a1 r81b3910  
    5151            help_str = 'compile with fftw3 instead of ooura',
    5252            help_disable_str = 'do not compile with fftw3')
     53    add_option_enable_disable(ctx, 'intelipp', default = None,
     54            help_str = 'use Intel IPP libraries (auto)',
     55            help_disable_str = 'do not use Intel IPP libraries')
    5356    add_option_enable_disable(ctx, 'complex', default = False,
    5457            help_str ='compile with C99 complex',
     
    156159        # configure warnings
    157160        ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
     161        # ignore "possible loss of data" warnings
     162        ctx.env.CFLAGS += ['/wd4305', '/wd4244', '/wd4245', '/wd4267']
     163        # ignore "unreferenced formal parameter" warnings
     164        ctx.env.CFLAGS += ['/wd4100']
    158165        # set optimization level and runtime libs
    159166        if (ctx.options.build_type == "release"):
     
    283290    else:
    284291        ctx.msg('Checking if complex.h is enabled', 'no')
    285 
     292   
     293    # check for Intel IPP
     294    if (ctx.options.enable_intelipp != False):
     295        if (ctx.check(header_name=['ippcore.h', 'ippvm.h', 'ipps.h'], mandatory = False) and
     296            ctx.check(lib=['ippcore', 'ippvm', 'ipps'], uselib_store='INTEL_IPP', mandatory = False)):
     297            ctx.msg('Checking if Intel IPP is available', 'yes')
     298            ctx.define('HAVE_INTEL_IPP', 1)
     299            if ctx.env.CC_NAME == 'msvc':
     300                # force linking multi-threaded static IPP libraries on Windows with msvc
     301                ctx.define('_IPP_SEQUENTIAL_STATIC', 1)
     302        else:
     303            ctx.msg('Checking if Intel IPP is available', 'no')
     304   
    286305    # check for fftw3
    287306    if (ctx.options.enable_fftw3 != False or ctx.options.enable_fftw3f != False):
     
    307326        ctx.define('HAVE_FFTW3', 1)
    308327
    309     # fftw not enabled, use vDSP or ooura
     328    # fftw not enabled, use vDSP, intelIPP or ooura
    310329    if 'HAVE_FFTW3F' in ctx.env.define_key:
    311330        ctx.msg('Checking for FFT implementation', 'fftw3f')
     
    314333    elif 'HAVE_ACCELERATE' in ctx.env.define_key:
    315334        ctx.msg('Checking for FFT implementation', 'vDSP')
     335    elif 'HAVE_INTEL_IPP' in ctx.env.define_key:
     336        ctx.msg('Checking for FFT implementation', 'Intel IPP')
    316337    else:
    317338        ctx.msg('Checking for FFT implementation', 'ooura')
Note: See TracChangeset for help on using the changeset viewer.