From: Paul Brossier Date: Tue, 17 Dec 2013 16:30:13 +0000 (-0500) Subject: src/fmat.c: new_fmat() takes height as first argument X-Git-Tag: 0.4.0~8 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=4ed0ed1f6cac63c8081b9e63c3dcaf49af606b89;p=aubio.git src/fmat.c: new_fmat() takes height as first argument --- diff --git a/src/fmat.c b/src/fmat.c index 978abb73..09b3a8c7 100644 --- a/src/fmat.c +++ b/src/fmat.c @@ -21,7 +21,7 @@ #include "aubio_priv.h" #include "fmat.h" -fmat_t * new_fmat (uint_t length, uint_t height) { +fmat_t * new_fmat (uint_t height, uint_t length) { if ((sint_t)length <= 0 || (sint_t)height <= 0 ) { return NULL; } diff --git a/src/fmat.h b/src/fmat.h index 800af5d7..363965e4 100644 --- a/src/fmat.h +++ b/src/fmat.h @@ -49,7 +49,7 @@ typedef struct { \param height the height of the matrix to create */ -fmat_t * new_fmat(uint_t length, uint_t height); +fmat_t * new_fmat(uint_t height, uint_t length); /** fmat_t buffer deletion function diff --git a/src/io/audio_unit.c b/src/io/audio_unit.c index 53c1a245..00f742d8 100644 --- a/src/io/audio_unit.c +++ b/src/io/audio_unit.c @@ -104,8 +104,8 @@ aubio_audio_unit_t * new_aubio_audio_unit(uint_t samplerate, o->au_ios_inbuf = AUBIO_ARRAY(SInt16, AU_IOS_MAX_FRAMES * o->hw_input_channels); /* the floats coming from and to the device callback */ - o->output_frames = new_fmat(blocksize, sw_output_channels); - o->input_frames = new_fmat(blocksize, sw_input_channels); + o->output_frames = new_fmat(sw_output_channels, blocksize); + o->input_frames = new_fmat(sw_input_channels, blocksize); /* check for some sizes */ if ( o->hw_output_channels != o->output_frames->height ) { diff --git a/src/spectral/filterbank.c b/src/spectral/filterbank.c index 39dfa5da..f8678e5d 100644 --- a/src/spectral/filterbank.c +++ b/src/spectral/filterbank.c @@ -43,7 +43,7 @@ new_aubio_filterbank (uint_t n_filters, uint_t win_s) fb->n_filters = n_filters; /* allocate filter tables, a matrix of length win_s and of height n_filters */ - fb->filters = new_fmat (win_s / 2 + 1, n_filters); + fb->filters = new_fmat (n_filters, win_s / 2 + 1); return fb; } diff --git a/src/spectral/mfcc.c b/src/spectral/mfcc.c index 25dbf0e4..a71a6a5c 100644 --- a/src/spectral/mfcc.c +++ b/src/spectral/mfcc.c @@ -66,7 +66,7 @@ new_aubio_mfcc (uint_t win_s, uint_t n_filters, uint_t n_coefs, /* allocating buffers */ mfcc->in_dct = new_fvec (n_filters); - mfcc->dct_coeffs = new_fmat (n_coefs, n_filters); + mfcc->dct_coeffs = new_fmat (n_filters, n_coefs); /* compute DCT transform dct_coeffs[i][j] as cos ( j * (i+.5) * PI / n_filters ) */ diff --git a/src/synth/sampler.c b/src/synth/sampler.c index e6ee809a..d6e5fd3b 100644 --- a/src/synth/sampler.c +++ b/src/synth/sampler.c @@ -42,7 +42,7 @@ aubio_sampler_t *new_aubio_sampler(uint_t samplerate, uint_t blocksize) s->samplerate = samplerate; s->blocksize = blocksize; s->source_output = new_fvec(blocksize); - s->source_output_multi = new_fmat(blocksize, 4); + s->source_output_multi = new_fmat(4, blocksize); s->source = NULL; s->playing = 0; return s; diff --git a/tests/src/io/test-source_multi.c b/tests/src/io/test-source_multi.c index 853f028d..b3b4683b 100644 --- a/tests/src/io/test-source_multi.c +++ b/tests/src/io/test-source_multi.c @@ -38,7 +38,7 @@ int main (int argc, char **argv) if ( n_channels == 0 ) n_channels = aubio_source_get_channels(s); - fmat_t *mat = new_fmat(hop_size, n_channels); + fmat_t *mat = new_fmat(n_channels, hop_size); do { aubio_source_do_multi (s, mat, &read); diff --git a/tests/src/test-fmat.c b/tests/src/test-fmat.c index 3de04613..718903d5 100644 --- a/tests/src/test-fmat.c +++ b/tests/src/test-fmat.c @@ -8,7 +8,7 @@ int main () { uint_t height = 3, length = 9, i, j; // create fmat_t object - fmat_t * mat = new_fmat (length, height); + fmat_t * mat = new_fmat (height, length); for ( i = 0; i < mat->height; i++ ) { for ( j = 0; j < mat->length; j++ ) { // all elements are already initialized to 0.