AEC3 tunings to increase the transparency

This CL changes the tuning of AEC3 to increase the transparency.
In particular:
-The present parameters are re-tuned.
-An oversuppression factor is added in the newly added soft-knee in
 the NLP gain. The purpose of this is to avoid fluctuations in the
 residual echo.
-The dynamics of the computed gain are bounded to ensure that the 
 specified gain characteristics are realizable without echo leakage.
 This also adds robustness against echo leakage in frequency regions
 that are poorly estimated.
 This change was needed to avoid echo leakage from the above 
 tunings.

Bug: chromium:773543,webrtc:8378
Change-Id: If8acc41c1423a6a2fa6f8c4daf2735c86f0b529a
Reviewed-on: https://webrtc-review.googlesource.com/8262
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20231}
diff --git a/modules/audio_processing/aec3/suppression_gain.cc b/modules/audio_processing/aec3/suppression_gain.cc
index e5274ab..5b4dfcd 100644
--- a/modules/audio_processing/aec3/suppression_gain.cc
+++ b/modules/audio_processing/aec3/suppression_gain.cc
@@ -209,7 +209,7 @@
       (*gain)[k] = 1.f;
     } else {
       RTC_DCHECK_LT(0.f, unity_gain_masker);
-      (*gain)[k] = std::max(0.f, (1.f - echo[k] / unity_gain_masker) *
+      (*gain)[k] = std::max(0.f, (1.f - 5.f * echo[k] / unity_gain_masker) *
                                      one_by_one_minus_nearend_masking_margin);
       (*gain)[k] =
           std::max(masker_margin * masker[k] * one_by_echo[k], (*gain)[k]);
@@ -340,6 +340,12 @@
                         linear_echo_estimate, last_echo_, echo, last_gain_,
                         *gain, &gain_increase_);
 
+  // Adjust gain dynamics.
+  const float gain_bound =
+      std::max(0.001f, *std::min_element(gain->begin(), gain->end()) * 10000.f);
+  std::for_each(gain->begin(), gain->end(),
+                [gain_bound](float& a) { a = std::min(a, gain_bound); });
+
   // Store data required for the gain computation of the next block.
   std::copy(echo.begin(), echo.end(), last_echo_.begin());
   std::copy(gain->begin(), gain->end(), last_gain_.begin());
diff --git a/modules/audio_processing/include/audio_processing.h b/modules/audio_processing/include/audio_processing.h
index 3fa2389..54aed34 100644
--- a/modules/audio_processing/include/audio_processing.h
+++ b/modules/audio_processing/include/audio_processing.h
@@ -290,15 +290,15 @@
         } ep_strength;
 
         struct Mask {
-          float m1 = 0.0001f;
+          float m1 = 0.01f;
           float m2 = 0.0001f;
-          float m3 = 0.0001f;
+          float m3 = 0.01f;
           float m4 = 0.1f;
-          float m5 = 0.1f;
-          float m6 = 0.00001f;
+          float m5 = 0.3f;
+          float m6 = 0.0001f;
           float m7 = 0.01f;
           float m8 = 0.0001f;
-          float m9 = 0.0001f;
+          float m9 = 0.1f;
         } gain_mask;
 
         struct EchoAudibility {
@@ -322,8 +322,8 @@
             float min_dec;
           };
 
-          GainChanges low_noise = {1.5f, 1.5f, 1.2f, 1.2f, 1.1f, 1.1f};
-          GainChanges normal = {1.5f, 1.5f, 1.2f, 1.2f, 1.1f, 1.1f};
+          GainChanges low_noise = {3.f, 3.f, 1.5f, 1.5f, 1.5f, 1.5f};
+          GainChanges normal = {2.f, 2.f, 1.5f, 1.5f, 1.2f, 1.2f};
           GainChanges saturation = {1.2f, 1.2f, 1.5f, 1.5f, 1.f, 1.f};
           GainChanges nonlinear = {1.5f, 1.5f, 1.2f, 1.2f, 1.1f, 1.1f};