shithub: aubio

Download patch

ref: 1e2c82fd0b63807b7d7068b5886aa53b96b7c605
parent: d57c879a5865b998ed7f289bca0620e42bf06a3f
author: Paul Brossier <piem@piem.org>
date: Thu Oct 1 21:09:46 EDT 2009

rename vec_max and vec_max_elem to fvec_max fvec_max_elem

--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -101,7 +101,7 @@
   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 @@
   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++)
--- a/src/mathutils.h
+++ b/src/mathutils.h
@@ -72,7 +72,7 @@
  *
  * \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 @@
  *
  * \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]
--- a/src/tempo/beattracking.c
+++ b/src/tempo/beattracking.c
@@ -168,7 +168,7 @@
   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 @@
   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 @@
       }
     }
     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 @@
 aubio_beattracking_get_confidence (aubio_beattracking_t * bt)
 {
   if (bt->gp) {
-    return vec_max (bt->acfout);
+    return fvec_max (bt->acfout);
   } else {
     return 0.;
   }
--- 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 @@
   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 */
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -130,10 +130,10 @@
 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);
--- a/tests/src/test-filterbank.c
+++ b/tests/src/test-filterbank.c
@@ -20,7 +20,7 @@
     return -1;
   }
 
-  if (vec_max (coeffs) != 0.) {
+  if (fvec_max (coeffs) != 0.) {
     return -1;
   }