Changeset 8b69453 for src


Ignore:
Timestamp:
Sep 15, 2018, 4:54:13 PM (6 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
Children:
3cb2a52
Parents:
0fbbb067
git-author:
Paul Brossier <piem@piem.org> (09/15/18 16:42:38)
git-committer:
Paul Brossier <piem@piem.org> (09/15/18 16:54:13)
Message:

src/spectral/dct.c: check if accelerate support size

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/dct.c

    r0fbbb067 r8b69453  
    8484  if ((sint_t)size <= 0) goto beach;
    8585#if defined(HAVE_ACCELERATE)
    86   // TODO check
    8786  // vDSP supports sizes = f * 2 ** n, where n >= 4 and f in [1, 3, 5, 15]
    8887  // see https://developer.apple.com/documentation/accelerate/1449930-vdsp_dct_createsetup
    89   if (aubio_is_power_of_two(size/16) != 1
    90       || (size/16 != 3 && size/16 != 5 && size/16 != 15)) {
    91     goto plain;
     88  {
     89    uint_t radix = size;
     90    uint_t order = 0;
     91    while ((radix / 2) * 2 == radix) {
     92      radix /= 2;
     93      order++;
     94    }
     95    if (order < 4 || (radix != 1 && radix != 3 && radix != 5 && radix != 15)) {
     96      goto plain;
     97    }
    9298  }
    9399  s->dct = (void *)new_aubio_dct_accelerate (size);
Note: See TracChangeset for help on using the changeset viewer.