| Index: webrtc/modules/audio_processing/aec3/main_filter_update_gain.cc
|
| diff --git a/webrtc/modules/audio_processing/aec3/main_filter_update_gain.cc b/webrtc/modules/audio_processing/aec3/main_filter_update_gain.cc
|
| index dad1a7a2a77bc4902cb2a57300e9299bde5acbfe..9cfb08bdb0fd6aff83e0c39b5791f467b8eb984b 100644
|
| --- a/webrtc/modules/audio_processing/aec3/main_filter_update_gain.cc
|
| +++ b/webrtc/modules/audio_processing/aec3/main_filter_update_gain.cc
|
| @@ -49,13 +49,12 @@ void MainFilterUpdateGain::Compute(
|
| FftData* gain_fft) {
|
| RTC_DCHECK(gain_fft);
|
| // Introducing shorter notation to improve readability.
|
| - const RenderBuffer& X_buffer = render_buffer;
|
| const FftData& E_main = subtractor_output.E_main;
|
| const auto& E2_main = subtractor_output.E2_main;
|
| const auto& E2_shadow = subtractor_output.E2_shadow;
|
| FftData* G = gain_fft;
|
| const size_t size_partitions = filter.SizePartitions();
|
| - const auto& X2 = X_buffer.SpectralSum(size_partitions);
|
| + const auto& X2 = render_buffer.SpectralSum(size_partitions);
|
| const auto& erl = filter.Erl();
|
|
|
| ++call_counter_;
|
| @@ -70,16 +69,15 @@ void MainFilterUpdateGain::Compute(
|
| G->re.fill(0.f);
|
| G->im.fill(0.f);
|
| } else {
|
| - // Corresponds of WGN of power -46 dBFS.
|
| - constexpr float kX2Min = 44015068.0f;
|
| + // Corresponds to WGN of power -39 dBFS.
|
| + constexpr float kNoiseGatePower = 220075344.f;
|
| std::array<float, kFftLengthBy2Plus1> mu;
|
| // mu = H_error / (0.5* H_error* X2 + n * E2).
|
| for (size_t k = 0; k < kFftLengthBy2Plus1; ++k) {
|
| - mu[k] =
|
| - X2[k] > kX2Min
|
| - ? H_error_[k] /
|
| - (0.5f * H_error_[k] * X2[k] + size_partitions * E2_main[k])
|
| - : 0.f;
|
| + mu[k] = X2[k] > kNoiseGatePower
|
| + ? H_error_[k] / (0.5f * H_error_[k] * X2[k] +
|
| + size_partitions * E2_main[k])
|
| + : 0.f;
|
| }
|
|
|
| // Avoid updating the filter close to narrow bands in the render signals.
|
|
|