Changeset 4087d54


Ignore:
Timestamp:
Dec 29, 2013, 12:38:03 AM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
5c6acbb2
Parents:
5c6b264
Message:

src/spectral/phasevoc.c: optimize swapbuffers by using memcpy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/phasevoc.c

    r5c6b264 r4087d54  
    120120    const smpl_t * datanew, uint_t win_s, uint_t hop_s)
    121121{
     122#if !HAVE_MEMCPY_HACKS
    122123  uint_t i;
    123124  for (i = 0; i < win_s - hop_s; i++)
     
    127128  for (i = 0; i < win_s - hop_s; i++)
    128129    dataold[i] = data[i + hop_s];
     130#else
     131  memcpy(data, dataold, (win_s - hop_s) * sizeof(smpl_t));
     132  data += win_s - hop_s;
     133  memcpy(data, datanew, hop_s * sizeof(smpl_t));
     134  data -= win_s - hop_s;
     135  data += hop_s;
     136  memcpy(dataold, data, (win_s - hop_s) * sizeof(smpl_t));
     137#endif
    129138}
    130139
Note: See TracChangeset for help on using the changeset viewer.