mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
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).
This commit is contained in:
parent
c975dfa5a5
commit
47e4dd1ec4
9 changed files with 802 additions and 1 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include <pulsecore/macro.h>
|
||||
|
||||
#include <speex/speex_echo.h>
|
||||
#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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue