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

Unified Diff: webrtc/modules/audio_processing/aec3/suppression_gain.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/suppression_gain.cc
diff --git a/webrtc/modules/audio_processing/aec3/suppression_gain.cc b/webrtc/modules/audio_processing/aec3/suppression_gain.cc
index 0e50292008947cbc1799d3affb5e3faf35867792..4bf452cbbea51563b86516e770385ac48d32ee33 100644
--- a/webrtc/modules/audio_processing/aec3/suppression_gain.cc
+++ b/webrtc/modules/audio_processing/aec3/suppression_gain.cc
@@ -325,11 +325,21 @@ void SuppressionGain::GetGain(
bool saturated_echo,
const std::vector<std::vector<float>>& render,
size_t num_capture_bands,
+ bool force_zero_gain,
float* high_bands_gain,
std::array<float, kFftLengthBy2Plus1>* low_band_gain) {
RTC_DCHECK(high_bands_gain);
RTC_DCHECK(low_band_gain);
+ if (force_zero_gain) {
+ previous_gain_squared_.fill(0.f);
+ std::copy(comfort_noise_power.begin() + 1, comfort_noise_power.end() - 1,
+ previous_masker_.begin());
+ low_band_gain->fill(0.f);
+ *high_bands_gain = 0.f;
+ return;
+ }
+
// Choose margin to use.
const float margin = saturated_echo ? 0.001f : 0.01f;
switch (optimization_) {

Powered by Google App Engine
This is Rietveld 408576698