Changeset bafe71d


Ignore:
Timestamp:
Nov 3, 2009, 4:22:39 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
31907fd
Parents:
fddfa64
Message:

src/temporal: indent

Location:
src/temporal
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/temporal/a_weighting.h

    rfddfa64 rbafe71d  
    8080
    8181*/
    82 uint_t aubio_filter_set_a_weighting (aubio_filter_t *f, uint_t samplerate);
     82uint_t aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate);
    8383
    8484#ifdef __cplusplus
  • src/temporal/biquad.c

    rfddfa64 rbafe71d  
    2626uint_t
    2727aubio_filter_set_biquad (aubio_filter_t * f, lsmp_t b0, lsmp_t b1, lsmp_t b2,
    28     lsmp_t a1, lsmp_t a2) {
     28    lsmp_t a1, lsmp_t a2)
     29{
    2930  uint_t order = aubio_filter_get_order (f);
    3031  lvec_t *bs = aubio_filter_get_feedforward (f);
  • src/temporal/filter.c

    rfddfa64 rbafe71d  
    8181
    8282/* The rough way: reset memory of filter between each run to avoid end effects. */
    83 void aubio_filter_do_filtfilt(aubio_filter_t * f, fvec_t * in, fvec_t * tmp) {
    84   uint_t j,i=0;
     83void
     84aubio_filter_do_filtfilt (aubio_filter_t * f, fvec_t * in, fvec_t * tmp)
     85{
     86  uint_t j, i = 0;
    8587  uint_t length = in->length;
    8688  /* apply filtering */
    87   aubio_filter_do(f,in);
    88   aubio_filter_do_reset(f);
     89  aubio_filter_do (f, in);
     90  aubio_filter_do_reset (f);
    8991  /* mirror */
    9092  for (j = 0; j < length; j++)
    91     tmp->data[i][length-j-1] = in->data[i][j];
     93    tmp->data[i][length - j - 1] = in->data[i][j];
    9294  /* apply filtering on mirrored */
    93   aubio_filter_do(f,tmp);
    94   aubio_filter_do_reset(f);
     95  aubio_filter_do (f, tmp);
     96  aubio_filter_do_reset (f);
    9597  /* invert back */
    9698  for (j = 0; j < length; j++)
    97     in->data[i][j] = tmp->data[i][length-j-1];
     99    in->data[i][j] = tmp->data[i][length - j - 1];
    98100}
    99101
     
    132134aubio_filter_do_reset (aubio_filter_t * f)
    133135{
    134   lvec_zeros(f->x);
    135   lvec_zeros(f->y);
     136  lvec_zeros (f->x);
     137  lvec_zeros (f->y);
    136138}
    137139
  • src/temporal/resampler.c

    rfddfa64 rbafe71d  
    2323#if HAVE_SAMPLERATE
    2424
    25 #include <samplerate.h> /* from libsamplerate */
     25#include <samplerate.h>         /* from libsamplerate */
    2626
    2727#include "aubio_priv.h"
     
    2929#include "temporal/resampler.h"
    3030
    31 struct _aubio_resampler_t {
    32         SRC_DATA  *proc;
    33         SRC_STATE *stat;
    34         smpl_t ratio;
    35         uint_t type;
     31struct _aubio_resampler_t
     32{
     33  SRC_DATA *proc;
     34  SRC_STATE *stat;
     35  smpl_t ratio;
     36  uint_t type;
    3637};
    3738
    38 aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type) {
    39         aubio_resampler_t * s  = AUBIO_NEW(aubio_resampler_t);
    40         int error = 0;
    41         s->stat = src_new (type, 1, &error) ; /* only one channel */
    42         s->proc = AUBIO_NEW(SRC_DATA);
    43         if (error) AUBIO_ERR("%s\n",src_strerror(error));
    44         s->ratio = ratio;
    45         return s;
     39aubio_resampler_t *
     40new_aubio_resampler (smpl_t ratio, uint_t type)
     41{
     42  aubio_resampler_t *s = AUBIO_NEW (aubio_resampler_t);
     43  int error = 0;
     44  s->stat = src_new (type, 1, &error);  /* only one channel */
     45  s->proc = AUBIO_NEW (SRC_DATA);
     46  if (error)
     47    AUBIO_ERR ("%s\n", src_strerror (error));
     48  s->ratio = ratio;
     49  return s;
    4650}
    4751
    48 void del_aubio_resampler(aubio_resampler_t *s) {
    49         src_delete(s->stat);
    50         AUBIO_FREE(s->proc);
    51         AUBIO_FREE(s);
     52void
     53del_aubio_resampler (aubio_resampler_t * s)
     54{
     55  src_delete (s->stat);
     56  AUBIO_FREE (s->proc);
     57  AUBIO_FREE (s);
    5258}
    5359
    54 void aubio_resampler_do (aubio_resampler_t *s,
    55     fvec_t * input,  fvec_t * output) {
    56         uint_t i ;
    57         s->proc->input_frames = input->length;
    58         s->proc->output_frames = output->length;
    59         s->proc->src_ratio = (double)s->ratio;
    60         for (i = 0 ; i< input->channels; i++)
    61         {
    62                 /* make SRC_PROC data point to input outputs */
    63                 s->proc->data_in = (float *)input->data[i];
    64                 s->proc->data_out= (float *)output->data[i];
    65                 /* do resampling */
    66                 src_process (s->stat, s->proc) ;
    67         }
    68 }       
     60void
     61aubio_resampler_do (aubio_resampler_t * s, fvec_t * input, fvec_t * output)
     62{
     63  uint_t i;
     64  s->proc->input_frames = input->length;
     65  s->proc->output_frames = output->length;
     66  s->proc->src_ratio = (double) s->ratio;
     67  for (i = 0; i < input->channels; i++) {
     68    /* make SRC_PROC data point to input outputs */
     69    s->proc->data_in = (float *) input->data[i];
     70    s->proc->data_out = (float *) output->data[i];
     71    /* do resampling */
     72    src_process (s->stat, s->proc);
     73  }
     74}
    6975
    7076#endif /* HAVE_SAMPLERATE */
  • src/temporal/resampler.h

    rfddfa64 rbafe71d  
    4646
    4747*/
    48 aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type);
     48aubio_resampler_t *new_aubio_resampler (smpl_t ratio, uint_t type);
    4949
    5050/** delete resampler object */
    51 void del_aubio_resampler(aubio_resampler_t *s);
     51void del_aubio_resampler (aubio_resampler_t * s);
    5252
    5353/** resample input in output
     
    5858
    5959*/
    60 void aubio_resampler_do (aubio_resampler_t *s, fvec_t * input,  fvec_t * output);
     60void aubio_resampler_do (aubio_resampler_t * s, fvec_t * input,
     61    fvec_t * output);
    6162
    6263#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.