From: Paul Brossier Date: Tue, 3 Nov 2009 15:22:39 +0000 (+0100) Subject: src/temporal: indent X-Git-Tag: 0.4.0-beta1~579 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=bafe71d4aff707869145b763043e36aaded03d02;p=aubio.git src/temporal: indent --- diff --git a/src/temporal/a_weighting.h b/src/temporal/a_weighting.h index d1a541ab..807a0101 100644 --- a/src/temporal/a_weighting.h +++ b/src/temporal/a_weighting.h @@ -79,7 +79,7 @@ aubio_filter_t *new_aubio_filter_a_weighting (uint_t channels, 192000 Hz */ -uint_t aubio_filter_set_a_weighting (aubio_filter_t *f, uint_t samplerate); +uint_t aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate); #ifdef __cplusplus } diff --git a/src/temporal/biquad.c b/src/temporal/biquad.c index 5e65b3bf..97f41385 100644 --- a/src/temporal/biquad.c +++ b/src/temporal/biquad.c @@ -25,7 +25,8 @@ uint_t aubio_filter_set_biquad (aubio_filter_t * f, lsmp_t b0, lsmp_t b1, lsmp_t b2, - lsmp_t a1, lsmp_t a2) { + lsmp_t a1, lsmp_t a2) +{ uint_t order = aubio_filter_get_order (f); lvec_t *bs = aubio_filter_get_feedforward (f); lvec_t *as = aubio_filter_get_feedback (f); diff --git a/src/temporal/filter.c b/src/temporal/filter.c index a94495f9..3c10f74b 100644 --- a/src/temporal/filter.c +++ b/src/temporal/filter.c @@ -80,21 +80,23 @@ aubio_filter_do (aubio_filter_t * f, fvec_t * in) } /* The rough way: reset memory of filter between each run to avoid end effects. */ -void aubio_filter_do_filtfilt(aubio_filter_t * f, fvec_t * in, fvec_t * tmp) { - uint_t j,i=0; +void +aubio_filter_do_filtfilt (aubio_filter_t * f, fvec_t * in, fvec_t * tmp) +{ + uint_t j, i = 0; uint_t length = in->length; /* apply filtering */ - aubio_filter_do(f,in); - aubio_filter_do_reset(f); + aubio_filter_do (f, in); + aubio_filter_do_reset (f); /* mirror */ for (j = 0; j < length; j++) - tmp->data[i][length-j-1] = in->data[i][j]; + tmp->data[i][length - j - 1] = in->data[i][j]; /* apply filtering on mirrored */ - aubio_filter_do(f,tmp); - aubio_filter_do_reset(f); + aubio_filter_do (f, tmp); + aubio_filter_do_reset (f); /* invert back */ for (j = 0; j < length; j++) - in->data[i][j] = tmp->data[i][length-j-1]; + in->data[i][j] = tmp->data[i][length - j - 1]; } lvec_t * @@ -131,8 +133,8 @@ aubio_filter_set_samplerate (aubio_filter_t * f, uint_t samplerate) void aubio_filter_do_reset (aubio_filter_t * f) { - lvec_zeros(f->x); - lvec_zeros(f->y); + lvec_zeros (f->x); + lvec_zeros (f->y); } aubio_filter_t * diff --git a/src/temporal/resampler.c b/src/temporal/resampler.c index c2ad8423..dfc333a7 100644 --- a/src/temporal/resampler.c +++ b/src/temporal/resampler.c @@ -22,49 +22,55 @@ #if HAVE_SAMPLERATE -#include /* from libsamplerate */ +#include /* from libsamplerate */ #include "aubio_priv.h" #include "fvec.h" #include "temporal/resampler.h" -struct _aubio_resampler_t { - SRC_DATA *proc; - SRC_STATE *stat; - smpl_t ratio; - uint_t type; +struct _aubio_resampler_t +{ + SRC_DATA *proc; + SRC_STATE *stat; + smpl_t ratio; + uint_t type; }; -aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type) { - aubio_resampler_t * s = AUBIO_NEW(aubio_resampler_t); - int error = 0; - s->stat = src_new (type, 1, &error) ; /* only one channel */ - s->proc = AUBIO_NEW(SRC_DATA); - if (error) AUBIO_ERR("%s\n",src_strerror(error)); - s->ratio = ratio; - return s; +aubio_resampler_t * +new_aubio_resampler (smpl_t ratio, uint_t type) +{ + aubio_resampler_t *s = AUBIO_NEW (aubio_resampler_t); + int error = 0; + s->stat = src_new (type, 1, &error); /* only one channel */ + s->proc = AUBIO_NEW (SRC_DATA); + if (error) + AUBIO_ERR ("%s\n", src_strerror (error)); + s->ratio = ratio; + return s; } -void del_aubio_resampler(aubio_resampler_t *s) { - src_delete(s->stat); - AUBIO_FREE(s->proc); - AUBIO_FREE(s); +void +del_aubio_resampler (aubio_resampler_t * s) +{ + src_delete (s->stat); + AUBIO_FREE (s->proc); + AUBIO_FREE (s); } -void aubio_resampler_do (aubio_resampler_t *s, - fvec_t * input, fvec_t * output) { - uint_t i ; - s->proc->input_frames = input->length; - s->proc->output_frames = output->length; - s->proc->src_ratio = (double)s->ratio; - for (i = 0 ; i< input->channels; i++) - { - /* make SRC_PROC data point to input outputs */ - s->proc->data_in = (float *)input->data[i]; - s->proc->data_out= (float *)output->data[i]; - /* do resampling */ - src_process (s->stat, s->proc) ; - } -} +void +aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, fvec_t * output) +{ + uint_t i; + s->proc->input_frames = input->length; + s->proc->output_frames = output->length; + s->proc->src_ratio = (double) s->ratio; + for (i = 0; i < input->channels; i++) { + /* make SRC_PROC data point to input outputs */ + s->proc->data_in = (float *) input->data[i]; + s->proc->data_out = (float *) output->data[i]; + /* do resampling */ + src_process (s->stat, s->proc); + } +} #endif /* HAVE_SAMPLERATE */ diff --git a/src/temporal/resampler.h b/src/temporal/resampler.h index c2f10966..644d6183 100644 --- a/src/temporal/resampler.h +++ b/src/temporal/resampler.h @@ -45,10 +45,10 @@ typedef struct _aubio_resampler_t aubio_resampler_t; \param type libsamplerate resampling type */ -aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type); +aubio_resampler_t *new_aubio_resampler (smpl_t ratio, uint_t type); /** delete resampler object */ -void del_aubio_resampler(aubio_resampler_t *s); +void del_aubio_resampler (aubio_resampler_t * s); /** resample input in output @@ -57,7 +57,8 @@ void del_aubio_resampler(aubio_resampler_t *s); \param output output buffer of size N*ratio */ -void aubio_resampler_do (aubio_resampler_t *s, fvec_t * input, fvec_t * output); +void aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, + fvec_t * output); #ifdef __cplusplus }