]> code.delx.au - pulseaudio/blobdiff - src/modules/echo-cancel/adrian-aec.h
bluetooth: Don't mark device valid before it has an adapter
[pulseaudio] / src / modules / echo-cancel / adrian-aec.h
index efb9e2749aa765429d7bbf8d9247f66e42adf114..6271774f3504c801c7fa75e29102c215f4b5b2b7 100644 (file)
 #include <config.h>
 #endif
 
-#include <pulsecore/macro.h>
+#include <pulse/gccmacro.h>
 #include <pulse/xmalloc.h>
 
+#include <pulsecore/macro.h>
+
 #define WIDEB 2
 
 // use double if your CPU does software-emulation of float
@@ -121,7 +123,7 @@ static  REAL IIR_HP_highpass(IIR_HP *i, REAL in) {
     /* Highpass = Signal - Lowpass. Lowpass = Exponential Smoothing */
     i->x += a0 * (in - i->x);
     return in - i->x;
-  };
+  }
 
 typedef struct FIR_HP_300Hz FIR_HP_300Hz;
 
@@ -306,7 +308,7 @@ struct AEC {
   // NLMS-pw
   REAL x[NLMS_LEN + NLMS_EXT];  // tap delayed loudspeaker signal
   REAL xf[NLMS_LEN + NLMS_EXT]; // pre-whitening tap delayed signal
-  REAL w_arr[NLMS_LEN+16];      // tap weights
+  REAL w_arr[NLMS_LEN + (16 / sizeof(REAL))]; // tap weights
   REAL *w;                      // this will be a 16-byte aligned pointer into w_arr
   int j;                        // optimize: less memory copies
   double dotp_xf_xf;            // double to avoid loss of precision
@@ -349,7 +351,8 @@ static  void AEC_leaky(AEC *a);
  */
 static  REAL AEC_nlms_pw(AEC *a, REAL d, REAL x_, float stepsize);
 
-  AEC* AEC_init(int RATE, int have_vector);
+AEC* AEC_init(int RATE, int have_vector);
+void AEC_done(AEC *a);
 
 /* Acoustic Echo Cancellation and Suppression of one sample
  * in   d:  microphone signal with echo
@@ -360,21 +363,21 @@ static  REAL AEC_nlms_pw(AEC *a, REAL d, REAL x_, float stepsize);
 
 PA_GCC_UNUSED static  float AEC_getambient(AEC *a) {
     return a->dfast;
-  };
+  }
 static  void AEC_setambient(AEC *a, float Min_xf) {
     a->dotp_xf_xf -= a->delta;  // subtract old delta
     a->delta = (NLMS_LEN-1) * Min_xf * Min_xf;
     a->dotp_xf_xf += a->delta;  // add new delta
-  };
+  }
 PA_GCC_UNUSED static  void AEC_setgain(AEC *a, float gain_) {
     a->gain = gain_;
-  };
+  }
 #if 0
   void AEC_openwdisplay(AEC *a);
 #endif
 PA_GCC_UNUSED static  void AEC_setaes(AEC *a, float aes_y2_) {
     a->aes_y2 = aes_y2_;
-  };
+  }
 
 #define _AEC_H
 #endif