AEC3 Tuning changes.
This CL adds tuning to AEC3 for the purpose of reducing the impact of gain changes in the analog microphone gain. BUG=chromium:710818, webrtc:6018 Review-Url: https://codereview.webrtc.org/2811283003 Cr-Commit-Position: refs/heads/master@{#17673}
This commit is contained in:
parent
e5fd38989d
commit
103ac7e7d9
@ -72,7 +72,7 @@ rtc::Optional<size_t> EstimateFilterDelay(
|
||||
}
|
||||
|
||||
constexpr int kEchoPathChangeCounterInitial = kNumBlocksPerSecond / 5;
|
||||
constexpr int kEchoPathChangeCounterMax = 3 * kNumBlocksPerSecond;
|
||||
constexpr int kEchoPathChangeCounterMax = 2 * kNumBlocksPerSecond;
|
||||
|
||||
} // namespace
|
||||
|
||||
@ -90,17 +90,19 @@ void AecState::HandleEchoPathChange(
|
||||
if (echo_path_variability.AudioPathChanged()) {
|
||||
blocks_since_last_saturation_ = 0;
|
||||
active_render_blocks_ = 0;
|
||||
echo_path_change_counter_ = kEchoPathChangeCounterMax;
|
||||
usable_linear_estimate_ = false;
|
||||
echo_leakage_detected_ = false;
|
||||
capture_signal_saturation_ = false;
|
||||
echo_saturation_ = false;
|
||||
headset_detected_ = false;
|
||||
previous_max_sample_ = 0.f;
|
||||
|
||||
if (echo_path_variability.delay_change) {
|
||||
force_zero_gain_counter_ = 0;
|
||||
force_zero_gain_ = true;
|
||||
echo_path_change_counter_ = kEchoPathChangeCounterMax;
|
||||
}
|
||||
if (echo_path_variability.gain_change) {
|
||||
echo_path_change_counter_ = kEchoPathChangeCounterInitial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
#include "webrtc/modules/audio_processing/audio_processing_impl.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
@ -1147,7 +1148,7 @@ 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);
|
||||
abs(capture_.previous_agc_level - new_agc_level) > 5;
|
||||
capture_.previous_agc_level = new_agc_level;
|
||||
private_submodules_->echo_canceller3->AnalyzeCapture(capture_buffer);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user