Add information about microphone gain changes to AEC3

Changes in the microphone gain are effecting the AEC in the sense
that each change in the microphone gain is a change in the echo
path seen by the AEC. This CL utilizes the ability of AEC3 to
leverage information about known changes in the analog microphone
gain.

BUG=webrtc:6018

Review-Url: https://codereview.webrtc.org/2808073002
Cr-Commit-Position: refs/heads/master@{#17625}
This commit is contained in:
peah 2017-04-10 14:12:41 -07:00 committed by Commit bot
parent 6d822adac4
commit 6799553a2c
2 changed files with 11 additions and 2 deletions

View File

@ -1145,6 +1145,10 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
}
if (private_submodules_->echo_canceller3) {
const int new_agc_level = gain_control()->stream_analog_level();
capture_.echo_path_gain_change =
(capture_.previous_agc_level != new_agc_level);
capture_.previous_agc_level = new_agc_level;
private_submodules_->echo_canceller3->AnalyzeCapture(capture_buffer);
}
@ -1193,7 +1197,8 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
}
if (private_submodules_->echo_canceller3) {
private_submodules_->echo_canceller3->ProcessCapture(capture_buffer, false);
private_submodules_->echo_canceller3->ProcessCapture(
capture_buffer, capture_.echo_path_gain_change);
} else {
RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio(
capture_buffer, stream_delay_ms()));
@ -1993,7 +1998,9 @@ AudioProcessingImpl::ApmCaptureState::ApmCaptureState(
array_geometry(array_geometry),
target_direction(target_direction),
capture_processing_format(kSampleRate16kHz),
split_rate(kSampleRate16kHz) {}
split_rate(kSampleRate16kHz),
previous_agc_level(0),
echo_path_gain_change(false) {}
AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;

View File

@ -366,6 +366,8 @@ class AudioProcessingImpl : public AudioProcessing {
// tracked by the capture_audio_.
StreamConfig capture_processing_format;
int split_rate;
int previous_agc_level;
bool echo_path_gain_change;
} capture_ GUARDED_BY(crit_capture_);
struct ApmCaptureNonLockedState {