Changeset 633400d for src/cvec.c


Ignore:
Timestamp:
Dec 5, 2018, 10:34:39 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
283a619a
Parents:
5b46bc3 (diff), f19db54 (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 'master' into feature/pitchshift

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.c

    r5b46bc3 r633400d  
    8686    return;
    8787  }
    88 #ifdef HAVE_MEMCPY_HACKS
     88#if defined(HAVE_INTEL_IPP)
     89  aubio_ippsCopy(s->phas, t->phas, (int)s->length);
     90  aubio_ippsCopy(s->norm, t->norm, (int)s->length);
     91#elif defined(HAVE_MEMCPY_HACKS)
    8992  memcpy(t->norm, s->norm, t->length * sizeof(smpl_t));
    9093  memcpy(t->phas, s->phas, t->length * sizeof(smpl_t));
    91 #else /* HAVE_MEMCPY_HACKS */
     94#else
    9295  uint_t j;
    9396  for (j=0; j< t->length; j++) {
     
    9598    t->phas[j] = s->phas[j];
    9699  }
    97 #endif /* HAVE_MEMCPY_HACKS */
     100#endif
    98101}
    99102
    100 void cvec_norm_set_all (cvec_t *s, smpl_t val) {
     103void cvec_norm_set_all(cvec_t *s, smpl_t val) {
     104#if defined(HAVE_INTEL_IPP)
     105  aubio_ippsSet(val, s->norm, (int)s->length);
     106#else
    101107  uint_t j;
    102108  for (j=0; j< s->length; j++) {
    103109    s->norm[j] = val;
    104110  }
     111#endif
    105112}
    106113
    107114void cvec_norm_zeros(cvec_t *s) {
    108 #ifdef HAVE_MEMCPY_HACKS
     115#if defined(HAVE_INTEL_IPP)
     116  aubio_ippsZero(s->norm, (int)s->length);
     117#elif defined(HAVE_MEMCPY_HACKS)
    109118  memset(s->norm, 0, s->length * sizeof(smpl_t));
    110 #else /* HAVE_MEMCPY_HACKS */
     119#else
    111120  cvec_norm_set_all (s, 0.);
    112 #endif /* HAVE_MEMCPY_HACKS */
     121#endif
    113122}
    114123
     
    118127
    119128void cvec_phas_set_all (cvec_t *s, smpl_t val) {
     129#if defined(HAVE_INTEL_IPP)
     130  aubio_ippsSet(val, s->phas, (int)s->length);
     131#else
    120132  uint_t j;
    121133  for (j=0; j< s->length; j++) {
    122134    s->phas[j] = val;
    123135  }
     136#endif
    124137}
    125138
    126139void cvec_phas_zeros(cvec_t *s) {
    127 #ifdef HAVE_MEMCPY_HACKS
     140#if defined(HAVE_INTEL_IPP)
     141  aubio_ippsZero(s->phas, (int)s->length);
     142#elif defined(HAVE_MEMCPY_HACKS)
    128143  memset(s->phas, 0, s->length * sizeof(smpl_t));
    129144#else
     
    140155  cvec_phas_zeros(s);
    141156}
     157
     158void cvec_logmag(cvec_t *s, smpl_t lambda) {
     159#if defined(HAVE_INTEL_IPP)
     160  aubio_ippsMulC(s->norm, lambda, s->norm, (int)s->length);
     161  aubio_ippsAddC(s->norm, 1.0, s->norm, (int)s->length);
     162  aubio_ippsLn(s->norm, s->norm, (int)s->length);
     163#else
     164  uint_t j;
     165  for (j=0; j< s->length; j++) {
     166    s->norm[j] = LOG(lambda * s->norm[j] + 1);
     167  }
     168#endif
     169}
Note: See TracChangeset for help on using the changeset viewer.