Changes in / [f7771c6:d47ad546]
- Files:
-
- 10 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
README.md
rf7771c6 rd47ad546 5 5 [![Appveyor build status](https://img.shields.io/appveyor/ci/piem/aubio/master.svg)](https://ci.appveyor.com/project/piem/aubio "Appveyor build status") 6 6 [![Landscape code health](https://landscape.io/github/aubio/aubio/master/landscape.svg?style=flat)](https://landscape.io/github/aubio/aubio/master "Landscape code health") 7 [![Commits since last release](https://img.shields.io/github/commits-since/aubio/aubio/ 0.4.6.svg)](https://github.com/aubio/aubio "Commits since last release")7 [![Commits since last release](https://img.shields.io/github/commits-since/aubio/aubio/latest.svg)](https://github.com/aubio/aubio "Commits since last release") 8 8 9 9 [![Documentation](https://readthedocs.org/projects/aubio/badge/?version=latest)](http://aubio.readthedocs.io/en/latest/?badge=latest "Latest documentation") -
doc/statuslinks.rst
rf7771c6 rd47ad546 18 18 :alt: Documentation status 19 19 20 .. image:: https://img.shields.io/github/commits-since/aubio/aubio/ 0.4.6.svg?maxAge=259200020 .. image:: https://img.shields.io/github/commits-since/aubio/aubio/latest.svg 21 21 :target: https://github.com/aubio/aubio 22 22 :alt: Commits since last release -
examples/utils.h
rf7771c6 rd47ad546 67 67 68 68 /** common process function */ 69 typedef int(*aubio_process_func_t) (fvec_t * input, fvec_t * output);69 typedef void (*aubio_process_func_t) (fvec_t * input, fvec_t * output); 70 70 71 71 void process_block (fvec_t *ibuf, fvec_t *obuf); -
python/ext/aubiomodule.c
rf7771c6 rd47ad546 243 243 {"level_detection", Py_aubio_level_detection, METH_VARARGS, Py_aubio_level_detection_doc}, 244 244 {"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}, 245 247 {NULL, NULL, 0, NULL} /* Sentinel */ 246 248 }; -
python/ext/py-musicutils.c
rf7771c6 rd47ad546 134 134 return level_detection; 135 135 } 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
rf7771c6 rd47ad546 72 72 PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args); 73 73 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 74 104 #endif /* PY_AUBIO_MUSICUTILS_H */ -
python/lib/gen_code.py
rf7771c6 rd47ad546 3 3 'buf_size': 'Py_default_vector_length', 4 4 'win_s': 'Py_default_vector_length', 5 'size': 'Py_default_vector_length', 5 6 # and here too 6 7 'hop_size': 'Py_default_vector_length / 2', … … 83 84 'filterbank': 'self->n_filters', 84 85 'tss': 'self->buf_size', 86 'dct': 'self->size', 85 87 } 86 88 … … 177 179 self.do_outputs = get_params_types_names(self.do_proto)[2:] 178 180 struct_output_str = ["PyObject *{0[name]}; {1} c_{0[name]}".format(i, i['type'][:-1]) for i in self.do_outputs] 181 if len(self.prototypes['rdo']): 182 rdo_outputs = get_params_types_names(prototypes['rdo'][0])[2:] 183 struct_output_str += ["PyObject *{0[name]}; {1} c_{0[name]}".format(i, i['type'][:-1]) for i in rdo_outputs] 184 self.outputs += rdo_outputs 179 185 self.struct_outputs = ";\n ".join(struct_output_str) 180 186 … … 191 197 out += self.gen_del() 192 198 out += self.gen_do() 199 if len(self.prototypes['rdo']): 200 self.do_proto = self.prototypes['rdo'][0] 201 self.do_inputs = [get_params_types_names(self.do_proto)[1]] 202 self.do_outputs = get_params_types_names(self.do_proto)[2:] 203 out += self.gen_do(method='rdo') 193 204 out += self.gen_memberdef() 194 205 out += self.gen_set() … … 371 382 return out 372 383 373 def gen_do(self ):384 def gen_do(self, method = 'do'): 374 385 out = """ 375 386 // do {shortname} 376 387 static PyObject* 377 Py _{shortname}_do(Py_{shortname} * self, PyObject * args)378 {{""".format( **self.__dict__)388 Pyaubio_{shortname}_{method} (Py_{shortname} * self, PyObject * args) 389 {{""".format(method = method, **self.__dict__) 379 390 input_params = self.do_inputs 380 391 output_params = self.do_outputs … … 516 527 {{"{shortname}", (PyCFunction) Py{name}, 517 528 METH_NOARGS, ""}},""".format(name = name, shortname = shortname) 529 for m in self.prototypes['rdo']: 530 name = get_name(m) 531 shortname = name.replace('aubio_%s_' % self.shortname, '') 532 out += """ 533 {{"{shortname}", (PyCFunction) Py{name}, 534 METH_VARARGS, ""}},""".format(name = name, shortname = shortname) 518 535 out += """ 519 536 {NULL} /* sentinel */ … … 541 558 0, 542 559 0, 543 (ternaryfunc)Py _{shortname}_do,560 (ternaryfunc)Pyaubio_{shortname}_do, 544 561 0, 545 562 0, -
python/lib/gen_external.py
rf7771c6 rd47ad546 182 182 shortname = o[6:-2] # without aubio_ prefix and _t suffix 183 183 184 lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], ' get': [], 'set': [], 'other': []}184 lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'rdo': [], 'get': [], 'set': [], 'other': []} 185 185 lib[shortname]['longname'] = o 186 186 lib[shortname]['shortname'] = shortname … … 196 196 elif '_do' in fn: 197 197 lib[shortname]['do'].append(fn) 198 elif '_rdo' in fn: 199 lib[shortname]['rdo'].append(fn) 198 200 elif 'new_' in fn: 199 201 lib[shortname]['new'].append(fn) -
scripts/get_waf.sh
rf7771c6 rd47ad546 4 4 set -x 5 5 6 WAFVERSION=2.0.1 6 WAFVERSION=2.0.11 7 7 WAFTARBALL=waf-$WAFVERSION.tar.bz2 8 8 WAFURL=https://waf.io/$WAFTARBALL -
src/aubio.h
rf7771c6 rd47ad546 183 183 #include "temporal/c_weighting.h" 184 184 #include "spectral/fft.h" 185 #include "spectral/dct.h" 185 186 #include "spectral/phasevoc.h" 186 187 #include "spectral/filterbank.h" -
src/aubio_priv.h
rf7771c6 rd47ad546 86 86 #define aubio_vDSP_mmov vDSP_mmov 87 87 #define aubio_vDSP_vmul vDSP_vmul 88 #define aubio_vDSP_vsmul vDSP_vsmul 89 #define aubio_vDSP_vsadd vDSP_vsadd 88 90 #define aubio_vDSP_vfill vDSP_vfill 89 91 #define aubio_vDSP_meanv vDSP_meanv … … 98 100 #define aubio_vDSP_mmov vDSP_mmovD 99 101 #define aubio_vDSP_vmul vDSP_vmulD 102 #define aubio_vDSP_vsmul vDSP_vsmulD 103 #define aubio_vDSP_vsadd vDSP_vsaddD 100 104 #define aubio_vDSP_vfill vDSP_vfillD 101 105 #define aubio_vDSP_meanv vDSP_meanvD -
src/io/source_avcodec.c
rf7771c6 rd47ad546 144 144 strncpy(s->path, path, strnlen(path, PATH_MAX) + 1); 145 145 146 #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,0,0) 146 147 // register all formats and codecs 147 148 av_register_all(); 149 #endif 148 150 149 151 if (aubio_source_avcodec_has_network_url(s)) { -
src/spectral/mfcc.c
rf7771c6 rd47ad546 29 29 #include "spectral/filterbank.h" 30 30 #include "spectral/filterbank_mel.h" 31 #include "spectral/dct.h" 31 32 #include "spectral/mfcc.h" 33 34 #undef HAVE_SLOW_DCT 32 35 33 36 /** Internal structure for mfcc object */ … … 41 44 aubio_filterbank_t *fb; /** filter bank */ 42 45 fvec_t *in_dct; /** input buffer for dct * [fb->n_filters] */ 46 #if defined(HAVE_SLOW_DCT) 43 47 fmat_t *dct_coeffs; /** DCT transform n_filters * n_coeffs */ 48 #else 49 aubio_dct_t *dct; 50 fvec_t *output; 51 #endif 44 52 }; 45 53 … … 52 60 /* allocate space for mfcc object */ 53 61 aubio_mfcc_t *mfcc = AUBIO_NEW (aubio_mfcc_t); 62 #if defined(HAVE_SLOW_DCT) 54 63 smpl_t scaling; 55 64 56 65 uint_t i, j; 66 #endif 57 67 58 68 mfcc->win_s = win_s; … … 68 78 mfcc->in_dct = new_fvec (n_filters); 69 79 80 #if defined(HAVE_SLOW_DCT) 70 81 mfcc->dct_coeffs = new_fmat (n_coefs, n_filters); 71 82 … … 80 91 mfcc->dct_coeffs->data[0][i] *= SQRT (2.) / 2.; 81 92 } 93 #else 94 mfcc->dct = new_aubio_dct (n_filters); 95 mfcc->output = new_fvec (n_filters); 96 #endif 82 97 83 98 return mfcc; … … 93 108 /* delete buffers */ 94 109 del_fvec (mf->in_dct); 110 #if defined(HAVE_SLOW_DCT) 95 111 del_fmat (mf->dct_coeffs); 112 #else 113 del_aubio_dct (mf->dct); 114 del_fvec (mf->output); 115 #endif 96 116 97 117 /* delete mfcc object */ … … 103 123 aubio_mfcc_do (aubio_mfcc_t * mf, const cvec_t * in, fvec_t * out) 104 124 { 125 #ifndef HAVE_SLOW_DCT 126 fvec_t tmp; 127 #endif 105 128 /* compute filterbank */ 106 129 aubio_filterbank_do (mf->fb, in, mf->in_dct); … … 113 136 114 137 /* compute mfccs */ 138 #if defined(HAVE_SLOW_DCT) 115 139 fmat_vecmul(mf->dct_coeffs, mf->in_dct, out); 140 #else 141 aubio_dct_do(mf->dct, mf->in_dct, mf->output); 142 // copy only first n_coeffs elements 143 // TODO assert mf->output->length == n_coeffs 144 tmp.data = mf->output->data; 145 tmp.length = out->length; 146 fvec_copy(&tmp, out); 147 #endif 116 148 117 149 return;
Note: See TracChangeset
for help on using the changeset viewer.