Changeset 6c8ef58


Ignore:
Timestamp:
Sep 5, 2015, 9:50:59 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:
7166ef8
Parents:
6bb268b
Message:

src/pitch/pitch.c: variant for aubio_pitch_slideblock using memmove/memcpy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/pitch/pitch.c

    r6bb268b r6c8ef58  
    240240aubio_pitch_slideblock (aubio_pitch_t * p, fvec_t * ibuf)
    241241{
    242   uint_t j = 0, overlap_size = 0;
    243   overlap_size = p->buf->length - ibuf->length;
     242  uint_t overlap_size = p->buf->length - ibuf->length;
     243#if !HAVE_MEMCPY_HACKS
     244  uint_t j;
    244245  for (j = 0; j < overlap_size; j++) {
    245246    p->buf->data[j] = p->buf->data[j + ibuf->length];
     
    248249    p->buf->data[j + overlap_size] = ibuf->data[j];
    249250  }
     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
    250257}
    251258
Note: See TracChangeset for help on using the changeset viewer.