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); |