From 1e2c82fd0b63807b7d7068b5886aa53b96b7c605 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 2 Oct 2009 01:09:46 +0200 Subject: [PATCH] rename vec_max and vec_max_elem to fvec_max fvec_max_elem --- src/mathutils.c | 4 ++-- src/mathutils.h | 4 ++-- src/tempo/beattracking.c | 8 ++++---- src/utils/hist.c | 4 ++-- swig/aubio.i | 4 ++-- tests/src/test-filterbank.c | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mathutils.c b/src/mathutils.c index 5334d6c7..1f8f3954 100644 --- a/src/mathutils.c +++ b/src/mathutils.c @@ -101,7 +101,7 @@ smpl_t vec_sum(fvec_t *s) { return tmp; } -smpl_t vec_max(fvec_t *s) { +smpl_t fvec_max(fvec_t *s) { uint_t i,j; smpl_t tmp = 0.0f; for (i=0; i < s->channels; i++) @@ -130,7 +130,7 @@ uint_t vec_min_elem(fvec_t *s) { return pos; } -uint_t vec_max_elem(fvec_t *s) { +uint_t fvec_max_elem(fvec_t *s) { uint_t i,j=0, pos=0.; smpl_t tmp = 0.0f; for (i=0; i < s->channels; i++) diff --git a/src/mathutils.h b/src/mathutils.h index 1fd05dd9..3e474468 100644 --- a/src/mathutils.h +++ b/src/mathutils.h @@ -72,7 +72,7 @@ smpl_t fvec_mean(fvec_t *s); * * \bug mono */ -smpl_t vec_max(fvec_t *s); +smpl_t fvec_max(fvec_t *s); /** returns the min of a vector * * \bug mono @@ -87,7 +87,7 @@ uint_t vec_min_elem(fvec_t *s); * * \bug mono */ -uint_t vec_max_elem(fvec_t *s); +uint_t fvec_max_elem(fvec_t *s); /** implement 'fftshift' like function * * a[0]...,a[n/2],a[n/2+1],...a[n] diff --git a/src/tempo/beattracking.c b/src/tempo/beattracking.c index 2fced244..45311e0e 100644 --- a/src/tempo/beattracking.c +++ b/src/tempo/beattracking.c @@ -168,7 +168,7 @@ aubio_beattracking_do (aubio_beattracking_t * bt, fvec_t * dfframe, fvec_weight (bt->acfout, bt->rwv); /* find non-zero Rayleigh period */ - maxindex = vec_max_elem (bt->acfout); + maxindex = fvec_max_elem (bt->acfout); bt->rp = maxindex ? vec_quadint (bt->acfout, maxindex, 1) : 1; //rp = (maxindex==127) ? 43 : maxindex; //rayparam bt->rp = (maxindex == bt->acfout->length - 1) ? bt->rayparam : maxindex; //rayparam @@ -195,7 +195,7 @@ aubio_beattracking_do (aubio_beattracking_t * bt, fvec_t * dfframe, fvec_weight (bt->phout, bt->phwv); /* find Rayleigh period */ - maxindex = vec_max_elem (bt->phout); + maxindex = fvec_max_elem (bt->phout); if (maxindex >= winlen - 1) { #if AUBIO_BEAT_WARNINGS AUBIO_WRN ("no idea what this groove's phase is\n"); @@ -304,7 +304,7 @@ aubio_beattracking_checkstate (aubio_beattracking_t * bt) } } fvec_weight (acfout, bt->gwv); - gp = vec_quadint (acfout, vec_max_elem (acfout), 1); + gp = vec_quadint (acfout, fvec_max_elem (acfout), 1); /* while(gp<32) gp =gp*2; while(gp>64) gp = gp/2; @@ -418,7 +418,7 @@ smpl_t aubio_beattracking_get_confidence (aubio_beattracking_t * bt) { if (bt->gp) { - return vec_max (bt->acfout); + return fvec_max (bt->acfout); } else { return 0.; } diff --git a/src/utils/hist.c b/src/utils/hist.c index b6e27423..9e8d2709 100644 --- a/src/utils/hist.c +++ b/src/utils/hist.c @@ -19,7 +19,7 @@ #include "aubio_priv.h" #include "fvec.h" #include "utils/scale.h" -#include "mathutils.h" //vec_min vec_max +#include "mathutils.h" //vec_min fvec_max #include "utils/hist.h" /******** @@ -109,7 +109,7 @@ void aubio_hist_dyn_notnull (aubio_hist_t *s, fvec_t *input) { uint_t i,j; sint_t tmp = 0; smpl_t ilow = vec_min(input); - smpl_t ihig = vec_max(input); + smpl_t ihig = fvec_max(input); smpl_t step = (ihig-ilow)/(smpl_t)(s->nelems); /* readapt */ diff --git a/swig/aubio.i b/swig/aubio.i index b3a2a651..3933391c 100644 --- a/swig/aubio.i +++ b/swig/aubio.i @@ -130,10 +130,10 @@ typedef enum { fvec_t * new_aubio_window(uint_t size, aubio_window_type wintype); smpl_t aubio_unwrap2pi (smpl_t phase); smpl_t fvec_mean(fvec_t *s); -smpl_t vec_max(fvec_t *s); +smpl_t fvec_max(fvec_t *s); smpl_t vec_min(fvec_t *s); uint_t vec_min_elem(fvec_t *s); -uint_t vec_max_elem(fvec_t *s); +uint_t fvec_max_elem(fvec_t *s); void vec_shift(fvec_t *s); smpl_t vec_sum(fvec_t *s); smpl_t vec_local_energy(fvec_t * f); diff --git a/tests/src/test-filterbank.c b/tests/src/test-filterbank.c index 445c4f9e..44c97042 100644 --- a/tests/src/test-filterbank.c +++ b/tests/src/test-filterbank.c @@ -20,7 +20,7 @@ main (void) return -1; } - if (vec_max (coeffs) != 0.) { + if (fvec_max (coeffs) != 0.) { return -1; } -- 2.26.2