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

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

Issue 2782423003: Major updates to the echo removal functionality in AEC3 (Closed)
Patch Set: Added initialization of uninitialized vector 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/comfort_noise_generator.cc
diff --git a/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc b/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc
index f630b25175eb3b22ef2ee3ee6cfa47f256a0434c..b8d7f28df6b402543fdda02d671b2983ddc319d1 100644
--- a/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc
+++ b/webrtc/modules/audio_processing/aec3/comfort_noise_generator.cc
@@ -188,6 +188,17 @@ void ComfortNoiseGenerator::Compute(
}
}
+ // Limit the noise to a floor of -96 dBFS.
+ constexpr float kNoiseFloor = 440.f;
+ for (auto& n : N2_) {
+ n = std::max(n, kNoiseFloor);
+ }
+ if (N2_initial_) {
+ for (auto& n : *N2_initial_) {
+ n = std::max(n, kNoiseFloor);
+ }
+ }
+
// Choose N2 estimate to use.
const std::array<float, kFftLengthBy2Plus1>& N2 =
N2_initial_ ? *N2_initial_ : N2_;
« no previous file with comments | « webrtc/modules/audio_processing/aec3/aec_state_unittest.cc ('k') | webrtc/modules/audio_processing/aec3/echo_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698