Added first version of the EchoControl interface, used for AEC abstraction.

Bug: webrtc:8346
Change-Id: I792a5f8eefb98388de199fea12c017759fdc6c1e
Reviewed-on: https://webrtc-review.googlesource.com/6780
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20174}
This commit is contained in:
Gustaf Ullberg 2017-10-05 10:25:05 +02:00 committed by Commit Bot
parent 07c5bfb4d6
commit c522298e03
3 changed files with 21 additions and 6 deletions

View File

@ -60,7 +60,7 @@ class Aec3RenderQueueItemVerifier {
//
// The class is supposed to be used in a non-concurrent manner apart from the
// AnalyzeRender call which can be called concurrently with the other methods.
class EchoCanceller3 {
class EchoCanceller3 : public EchoControl {
public:
// Normal c-tor to use.
EchoCanceller3(const AudioProcessing::Config::EchoCanceller3& config,
@ -70,15 +70,15 @@ class EchoCanceller3 {
EchoCanceller3(int sample_rate_hz,
bool use_highpass_filter,
std::unique_ptr<BlockProcessor> block_processor);
~EchoCanceller3();
~EchoCanceller3() override;
// Analyzes and stores an internal copy of the split-band domain render
// signal.
void AnalyzeRender(AudioBuffer* farend);
void AnalyzeRender(AudioBuffer* farend) override;
// Analyzes the full-band domain capture signal to detect signal saturation.
void AnalyzeCapture(AudioBuffer* capture);
void AnalyzeCapture(AudioBuffer* capture) override;
// Processes the split-band domain capture signal in order to remove any echo
// present in the signal.
void ProcessCapture(AudioBuffer* capture, bool level_change);
void ProcessCapture(AudioBuffer* capture, bool level_change) override;
// Signals whether an external detector has detected echo leakage from the
// echo canceller.

View File

@ -302,7 +302,7 @@ struct AudioProcessingImpl::ApmPrivateSubmodules {
std::unique_ptr<LowCutFilter> low_cut_filter;
std::unique_ptr<LevelController> level_controller;
std::unique_ptr<ResidualEchoDetector> residual_echo_detector;
std::unique_ptr<EchoCanceller3> echo_canceller3;
std::unique_ptr<EchoControl> echo_canceller3;
std::unique_ptr<PostProcessing> capture_post_processor;
};

View File

@ -939,6 +939,21 @@ class EchoControlMobile {
virtual ~EchoControlMobile() {}
};
// Interface for an acoustic echo cancellation (AEC) submodule.
class EchoControl {
public:
// Analysis (not changing) of the render signal.
virtual void AnalyzeRender(AudioBuffer* render) = 0;
// Analysis (not changing) of the capture signal.
virtual void AnalyzeCapture(AudioBuffer* capture) = 0;
// Processes the capture signal in order to remove the echo.
virtual void ProcessCapture(AudioBuffer* capture, bool echo_path_change) = 0;
virtual ~EchoControl() {}
};
// The automatic gain control (AGC) component brings the signal to an
// appropriate range. This is done by applying a digital gain directly and, in
// the analog mode, prescribing an analog gain to be applied at the audio HAL.