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

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

Issue 2718993002: Added post-adjustment of the suppression gains (Closed)
Patch Set: Added DHECK Created 3 years, 10 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
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/aec3/suppression_gain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/aec3/suppression_filter.cc
diff --git a/webrtc/modules/audio_processing/aec3/suppression_filter.cc b/webrtc/modules/audio_processing/aec3/suppression_filter.cc
index 358aafbdfb3777f0a5cb8fe05076d9cd0a4dc1ee..3b830a612ef866e61258e66e9532d96a9fdee0dd 100644
--- a/webrtc/modules/audio_processing/aec3/suppression_filter.cc
+++ b/webrtc/modules/audio_processing/aec3/suppression_filter.cc
@@ -138,17 +138,12 @@ void SuppressionFilter::ApplyGain(
fft_.Ifft(E, &time_domain_high_band_noise);
// Scale and apply the noise to the signals.
- // TODO(peah): Ensure that the high bands are properly delayed.
- constexpr int kNumBandsAveragingUpperGain = kFftLengthBy2 / 4;
- constexpr float kOneByNumBandsAveragingUpperGain =
- 1.f / kNumBandsAveragingUpperGain;
+ RTC_DCHECK_LT(3, suppression_gain.size());
float high_bands_gain =
- std::accumulate(suppression_gain.end() - kNumBandsAveragingUpperGain,
- suppression_gain.end(), 0.f) *
- kOneByNumBandsAveragingUpperGain;
+ *std::min_element(suppression_gain.begin() + 3, suppression_gain.end());
float high_bands_noise_scaling =
- 0.4f * std::max(1.f - high_bands_gain * high_bands_gain, 0.f);
+ 0.4f * std::max(1.f - high_bands_gain, 0.f);
std::transform(
(*e)[1].begin(), (*e)[1].end(), time_domain_high_band_noise.begin(),
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/aec3/suppression_gain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698