Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: webrtc/modules/audio_processing/aec3/aec_state.cc

Issue 2808733002: Added forced zero AEC output after call startup and echo path changes (Closed)
Patch Set: Fixed memory access issue again Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/aec3/aec_state.cc
diff --git a/webrtc/modules/audio_processing/aec3/aec_state.cc b/webrtc/modules/audio_processing/aec3/aec_state.cc
index 8e92f5fbdac3a4719428e1275bf966ca73b58151..1a9f66ffcb94d0bee478446820142a5fbfa91f28 100644
--- a/webrtc/modules/audio_processing/aec3/aec_state.cc
+++ b/webrtc/modules/audio_processing/aec3/aec_state.cc
@@ -97,6 +97,11 @@ void AecState::HandleEchoPathChange(
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;
+ }
}
}
@@ -117,6 +122,12 @@ void AecState::Update(const std::vector<std::array<float, kFftLengthBy2Plus1>>&
active_render_blocks_ += active_render_block ? 1 : 0;
--echo_path_change_counter_;
+ // Force zero echo suppression gain after an echo path change to allow at
+ // least some render data to be collected in order to avoid an initial echo
+ // burst.
+ constexpr size_t kZeroGainBlocksAfterChange = kNumBlocksPerSecond / 5;
+ force_zero_gain_ = (++force_zero_gain_counter_) < kZeroGainBlocksAfterChange;
+
// Estimate delays.
filter_delay_ = EstimateFilterDelay(adaptive_filter_frequency_response);
external_delay_ =
« no previous file with comments | « webrtc/modules/audio_processing/aec3/aec_state.h ('k') | webrtc/modules/audio_processing/aec3/echo_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698