From 526277c97c8c1e77252d3c67186914789ba55c33 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 7 Sep 2010 13:43:58 +0530 Subject: echo-cancel: Add alternative echo-cancellation implementation This adds Andre Adrian's AEC implementation from his intercom project (http://andreadrian.de/intercom/) as an alternative to the speex echo cancellation routines. Since the implementation was in C++ and not in the form of a library, I have converted the code to C and made a local copy of the implementation. The implementation actually works on floating point data, so we can tweak it to work with both integer and floating point samples (currently we just use S16LE). --- src/modules/echo-cancel/echo-cancel.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/modules/echo-cancel/echo-cancel.h') diff --git a/src/modules/echo-cancel/echo-cancel.h b/src/modules/echo-cancel/echo-cancel.h index 205c4d14..65e0e240 100644 --- a/src/modules/echo-cancel/echo-cancel.h +++ b/src/modules/echo-cancel/echo-cancel.h @@ -28,6 +28,7 @@ #include #include +#include "adrian.h" /* Common data structures */ @@ -39,6 +40,10 @@ struct pa_echo_canceller_params { uint32_t blocksize; SpeexEchoState *state; } speex; + struct { + uint32_t blocksize; + AEC *aec; + } adrian; /* each canceller-specific structure goes here */ } priv; }; @@ -67,3 +72,12 @@ pa_bool_t pa_speex_ec_init(pa_echo_canceller *ec, void pa_speex_ec_run(pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out); void pa_speex_ec_done(pa_echo_canceller *ec); uint32_t pa_speex_ec_get_block_size(pa_echo_canceller *ec); + +/* Adrian Andre's echo canceller */ +pa_bool_t pa_adrian_ec_init(pa_echo_canceller *ec, + pa_sample_spec *source_ss, pa_channel_map *source_map, + pa_sample_spec *sink_ss, pa_channel_map *sink_map, + const char *args); +void pa_adrian_ec_run(pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out); +void pa_adrian_ec_done(pa_echo_canceller *ec); +uint32_t pa_adrian_ec_get_block_size(pa_echo_canceller *ec); -- cgit