Changes in / [c9ca2608:3aac194]


Ignore:
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.h

    rc9ca2608 r3aac194  
    6767
    6868/** common process function */
    69 typedef void (*aubio_process_func_t) (fvec_t * input, fvec_t * output);
     69typedef int (*aubio_process_func_t) (fvec_t * input, fvec_t * output);
    7070
    7171void process_block (fvec_t *ibuf, fvec_t *obuf);
  • python/ext/aubiomodule.c

    rc9ca2608 r3aac194  
    243243  {"level_detection", Py_aubio_level_detection, METH_VARARGS, Py_aubio_level_detection_doc},
    244244  {"window", Py_aubio_window, METH_VARARGS, Py_aubio_window_doc},
    245   {"shift", Py_aubio_shift, METH_VARARGS, Py_aubio_shift_doc},
    246   {"ishift", Py_aubio_ishift, METH_VARARGS, Py_aubio_ishift_doc},
    247245  {NULL, NULL, 0, NULL} /* Sentinel */
    248246};
  • python/ext/py-musicutils.c

    rc9ca2608 r3aac194  
    134134  return level_detection;
    135135}
    136 
    137 PyObject *
    138 Py_aubio_shift(PyObject *self, PyObject *args)
    139 {
    140   PyObject *input;
    141   fvec_t vec;
    142 
    143   if (!PyArg_ParseTuple (args, "O:shift", &input)) {
    144     return NULL;
    145   }
    146 
    147   if (input == NULL) {
    148     return NULL;
    149   }
    150 
    151   if (!PyAubio_ArrayToCFvec(input, &vec)) {
    152     return NULL;
    153   }
    154 
    155   fvec_shift(&vec);
    156 
    157   //Py_RETURN_NONE;
    158   return (PyObject *) PyAubio_CFvecToArray(&vec);
    159 }
    160 
    161 PyObject *
    162 Py_aubio_ishift(PyObject *self, PyObject *args)
    163 {
    164   PyObject *input;
    165   fvec_t vec;
    166 
    167   if (!PyArg_ParseTuple (args, "O:shift", &input)) {
    168     return NULL;
    169   }
    170 
    171   if (input == NULL) {
    172     return NULL;
    173   }
    174 
    175   if (!PyAubio_ArrayToCFvec(input, &vec)) {
    176     return NULL;
    177   }
    178 
    179   fvec_ishift(&vec);
    180 
    181   //Py_RETURN_NONE;
    182   return (PyObject *) PyAubio_CFvecToArray(&vec);
    183 }
  • python/ext/py-musicutils.h

    rc9ca2608 r3aac194  
    7272PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args);
    7373
    74 static char Py_aubio_shift_doc[] = ""
    75 "Swap left and right partitions of a vector\n"
    76 "\n"
    77 "Returns the swapped vector. The input vector is also modified.\n"
    78 "\n"
    79 "For a vector of length N, the partition is split at index N - N//2.\n"
    80 "\n"
    81 "Example\n"
    82 "-------\n"
    83 "\n"
    84 ">>> import numpy\n"
    85 ">>> shift(numpy.arange(3, dtype=aubio.float_type))\n"
    86 "array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")";
    87 PyObject * Py_aubio_shift(PyObject *self, PyObject *args);
    88 
    89 static char Py_aubio_ishift_doc[] = ""
    90 "Swap right and left partitions of a vector\n"
    91 "\n"
    92 "Returns the swapped vector. The input vector is also modified.\n"
    93 "\n"
    94 "Unlike with shift(), the partition is split at index N//2.\n"
    95 "\n"
    96 "Example\n"
    97 "-------\n"
    98 "\n"
    99 ">>> import numpy\n"
    100 ">>> ishift(numpy.arange(3, dtype=aubio.float_type))\n"
    101 "array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")";
    102 PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);
    103 
    10474#endif /* PY_AUBIO_MUSICUTILS_H */
  • python/tests/test_dct.py

    rc9ca2608 r3aac194  
    3232        a_in = np.arange(8).astype(aubio.float_type)
    3333        a_expected = aubio.fvec(precomputed_arange)
    34         assert_almost_equal(a_dct(a_in), a_expected, decimal=5)
     34        assert_almost_equal(a_dct(a_in), a_expected, decimal=6)
    3535
    3636    def test_some_ones(self):
  • scripts/get_waf.sh

    rc9ca2608 r3aac194  
    44set -x
    55
    6 WAFVERSION=2.0.11
     6WAFVERSION=2.0.1
    77WAFTARBALL=waf-$WAFVERSION.tar.bz2
    88WAFURL=https://waf.io/$WAFTARBALL
  • src/io/source_avcodec.c

    rc9ca2608 r3aac194  
    144144  strncpy(s->path, path, strnlen(path, PATH_MAX) + 1);
    145145
    146 #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,0,0)
    147146  // register all formats and codecs
    148147  av_register_all();
    149 #endif
    150148
    151149  if (aubio_source_avcodec_has_network_url(s)) {
  • src/spectral/dct.c

    rc9ca2608 r3aac194  
    4141
    4242#if defined(HAVE_ACCELERATE)
    43 typedef struct _aubio_dct_accelerate_t aubio_dct_accelerate_t;
     43typedef struct _aubio_dct_opt_t aubio_dct_accelerate_t;
    4444extern aubio_dct_accelerate_t * new_aubio_dct_accelerate (uint_t size);
    4545extern void aubio_dct_accelerate_do(aubio_dct_accelerate_t *s, const fvec_t *input, fvec_t *output);
     
    4747extern void del_aubio_dct_accelerate (aubio_dct_accelerate_t *s);
    4848#elif defined(HAVE_FFTW3)
    49 typedef struct _aubio_dct_fftw_t aubio_dct_fftw_t;
     49typedef struct _aubio_dct_opt_t aubio_dct_fftw_t;
    5050extern aubio_dct_fftw_t * new_aubio_dct_fftw (uint_t size);
    5151extern void aubio_dct_fftw_do(aubio_dct_fftw_t *s, const fvec_t *input, fvec_t *output);
     
    8484  if ((sint_t)size <= 0) goto beach;
    8585#if defined(HAVE_ACCELERATE)
     86  // TODO check
    8687  // vDSP supports sizes = f * 2 ** n, where n >= 4 and f in [1, 3, 5, 15]
    8788  // see https://developer.apple.com/documentation/accelerate/1449930-vdsp_dct_createsetup
    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     }
     89  if (aubio_is_power_of_two(size/16) != 1
     90      || (size/16 != 3 && size/16 != 5 && size/16 != 15)) {
     91    goto plain;
    9892  }
    9993  s->dct = (void *)new_aubio_dct_accelerate (size);
Note: See TracChangeset for help on using the changeset viewer.