Changes in / [c59e693:f45dd12]


Ignore:
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/fvec.c

    rc59e693 rf45dd12  
    2828#define aubio_vDSP_vmul       vDSP_vmul
    2929#define aubio_vDSP_vfill      vDSP_vfill
    30 #define aubio_catlas_set      catlas_sset
    3130#else /* HAVE_AUBIO_DOUBLE */
    3231#define aubio_vDSP_mmov       vDSP_mmovD
    3332#define aubio_vDSP_vmul       vDSP_vmulD
    3433#define aubio_vDSP_vfill      vDSP_vfillD
    35 #define aubio_catlas_set      catlas_dset
    3634#endif /* HAVE_AUBIO_DOUBLE */
    3735#endif
     
    8280  }
    8381#else
    84   //aubio_catlas_set(s->length, val, s->data, 1);
    8582  aubio_vDSP_vfill(&val, s->data, 1, s->length);
    8683#endif
     
    122119}
    123120
    124 void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out) {
    125 #ifndef HAVE_ACCELERATE
    126   uint_t j;
    127   uint_t length = MIN(s->length, weight->length);
    128   for (j=0; j< length; j++) {
    129     out->data[j] = in->data[j] * weight->data[j];
    130   }
    131 #else
    132   aubio_vDSP_vmul(in->data, 1, weight->data, 1, out->data, 1, out->length);
    133 #endif /* HAVE_ACCELERATE */
    134 }
    135 
    136121void fvec_copy(fvec_t *s, fvec_t *t) {
    137122  if (s->length != t->length) {
  • src/fvec.h

    rc59e693 rf45dd12  
    163163void fvec_copy(fvec_t *s, fvec_t *t);
    164164
    165 /** make a copy of a vector, applying weights to each element
    166 
    167   \param in input vector
    168   \param weight weights vector
    169   \param out output vector
    170 
    171 */
    172 void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out);
    173 
    174165#ifdef __cplusplus
    175166}
  • src/mathutils.c

    rc59e693 rf45dd12  
    2929#ifdef HAVE_ACCELERATE
    3030#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
    3931#endif
    4032
     
    290282fvec_shift (fvec_t * s)
    291283{
    292 #ifndef HAVE_ACCELERATE
    293284  uint_t j;
    294285  for (j = 0; j < s->length / 2; j++) {
    295286    ELEM_SWAP (s->data[j], s->data[j + s->length / 2]);
    296287  }
    297 #else
    298   uint_t half = s->length / 2;
    299   aubio_cblas_xswap(half, s->data, 1, s->data + half, 1);
    300 #endif
    301288}
    302289
     
    305292{
    306293  smpl_t energy = 0.;
    307 #ifndef HAVE_ACCELERATE
    308294  uint_t j;
    309295  for (j = 0; j < f->length; j++) {
    310296    energy += SQR (f->data[j]);
    311297  }
    312 #else
    313   energy = aubio_cblas_dot(f->length, f->data, 1, f->data, 1);
    314 #endif
    315298  return energy / f->length;
    316299}
  • src/pitch/pitch.c

    rc59e693 rf45dd12  
    240240aubio_pitch_slideblock (aubio_pitch_t * p, fvec_t * ibuf)
    241241{
    242   uint_t overlap_size = p->buf->length - ibuf->length;
    243 #if !HAVE_MEMCPY_HACKS
    244   uint_t j;
     242  uint_t j = 0, overlap_size = 0;
     243  overlap_size = p->buf->length - ibuf->length;
    245244  for (j = 0; j < overlap_size; j++) {
    246245    p->buf->data[j] = p->buf->data[j + ibuf->length];
     
    249248    p->buf->data[j + overlap_size] = ibuf->data[j];
    250249  }
    251 #else
    252   smpl_t *data = p->buf->data;
    253   smpl_t *newdata = ibuf->data;
    254   memmove(data, data + ibuf->length, overlap_size);
    255   memcpy(data + overlap_size, newdata, ibuf->length);
    256 #endif
    257250}
    258251
  • src/pitch/pitchyinfft.c

    rc59e693 rf45dd12  
    108108  smpl_t tmp = 0., sum = 0.;
    109109  // window the input
    110   fvec_weighted_copy(input, p->win, p->winput);
     110  for (l = 0; l < input->length; l++) {
     111    p->winput->data[l] = p->win->data[l] * input->data[l];
     112  }
    111113  // get the real / imag parts of its fft
    112114  aubio_fft_do_complex (p->fft, p->winput, fftout);
Note: See TracChangeset for help on using the changeset viewer.