shithub: aubio

Download patch

ref: c17a0ee55f9441312e444ded19ad5e8fd01f117a
parent: 7dec719b7fab7f4d76a84c7756ede2a40942612c
author: Paul Brossier <piem@piem.org>
date: Thu Dec 3 20:46:04 EST 2009

src/vecutils.c: switch to mono

--- a/src/vecutils.c
+++ b/src/vecutils.c
@@ -8,11 +8,9 @@
 #define AUBIO_OP(OPNAME, OP, TYPE, OBJ) \
 void TYPE ## _ ## OPNAME (TYPE ## _t *o) \
 { \
-  uint_t i,j; \
-  for (i = 0; i < o->channels; i++) { \
-    for (j = 0; j < o->length; j++) { \
-      o->OBJ[i][j] = OP (o->OBJ[i][j]); \
-    } \
+  uint_t j; \
+  for (j = 0; j < o->length; j++) { \
+    o->OBJ[j] = OP (o->OBJ[j]); \
   } \
 }
 
@@ -34,21 +32,17 @@
 //AUBIO_OP_C_AND_F(pow, POW)
 void fvec_pow (fvec_t *s, smpl_t power)
 {
-  uint_t i,j;
-  for (i = 0; i < s->channels; i++) {
-    for (j = 0; j < s->length; j++) {
-      s->data[i][j] = POW(s->data[i][j], power);
-    }
+  uint_t j;
+  for (j = 0; j < s->length; j++) {
+    s->data[j] = POW(s->data[j], power);
   }
 }
 
 void cvec_pow (cvec_t *s, smpl_t power)
 {
-  uint_t i,j;
-  for (i = 0; i < s->channels; i++) {
-    for (j = 0; j < s->length; j++) {
-      s->norm[i][j] = POW(s->norm[i][j], power);
-    }
+  uint_t j;
+  for (j = 0; j < s->length; j++) {
+    s->norm[j] = POW(s->norm[j], power);
   }
 }