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

Unified Diff: webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.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/shadow_filter_update_gain.cc
diff --git a/webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.cc b/webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.cc
index ee6938b31e805312c30952a16e6357ce7190f5df..85bc11fb0d631865cc45ec2e25b019aa047b3509 100644
--- a/webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.cc
+++ b/webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.cc
@@ -18,7 +18,7 @@
namespace webrtc {
void ShadowFilterUpdateGain::Compute(
- const RenderBuffer& X_buffer,
+ const RenderBuffer& render_buffer,
const RenderSignalAnalyzer& render_signal_analyzer,
const FftData& E_shadow,
size_t size_partitions,
@@ -40,12 +40,14 @@ void ShadowFilterUpdateGain::Compute(
}
// Compute mu.
- constexpr float kX2Min = 44015068.0f;
+ // Corresponds to WGN of power -39 dBFS.
+ constexpr float kNoiseGatePower = 220075344.f;
constexpr float kMuFixed = .5f;
std::array<float, kFftLengthBy2Plus1> mu;
- const auto& X2 = X_buffer.SpectralSum(size_partitions);
- std::transform(X2.begin(), X2.end(), mu.begin(),
- [&](float a) { return a > kX2Min ? kMuFixed / a : 0.f; });
+ const auto& X2 = render_buffer.SpectralSum(size_partitions);
+ std::transform(X2.begin(), X2.end(), mu.begin(), [&](float a) {
+ return a > kNoiseGatePower ? kMuFixed / a : 0.f;
+ });
// Avoid updating the filter close to narrow bands in the render signals.
render_signal_analyzer.MaskRegionsAroundNarrowBands(&mu);

Powered by Google App Engine
This is Rietveld 408576698