Merge to M74: AEC3: Removing unused parameters

This CL removes parameters for AEC3 which are no longer used. To reflect
that change, one of the parameters also is renamed

(cherry picked from commit e8efbbd61b34eee210b0d206cd67652a84362b79)

TBR: gustaf@webrtc.org
Bug: chromium:941949,webrtc:8671
Change-Id: I26609b396fa14ecb7523eebfe531a1338718103b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127780
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Original-Commit-Position: refs/heads/master@{#27128}
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/129903
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/branch-heads/m74@{#13}
Cr-Branched-From: be7af9399ceb88171bf60b50419ff2dec8184fb9-refs/heads/master@{#26981}
diff --git a/api/audio/echo_canceller3_config.cc b/api/audio/echo_canceller3_config.cc
index 36bb6fd..a560c9e 100644
--- a/api/audio/echo_canceller3_config.cc
+++ b/api/audio/echo_canceller3_config.cc
@@ -142,9 +142,7 @@
   }
   res = res & Limit(&c->erle.num_sections, 1, c->filter.main.length_blocks);
 
-  res = res & Limit(&c->ep_strength.lf, 0.f, 1000000.f);
-  res = res & Limit(&c->ep_strength.mf, 0.f, 1000000.f);
-  res = res & Limit(&c->ep_strength.hf, 0.f, 1000000.f);
+  res = res & Limit(&c->ep_strength.default_gain, 0.f, 1000000.f);
   res = res & Limit(&c->ep_strength.default_len, -1.f, 1.f);
 
   res =
@@ -166,13 +164,6 @@
   res = res & Limit(&c->render_levels.poor_excitation_render_limit_ds8, 0.f,
                     32768.f * 32768.f);
 
-  res =
-      res & Limit(&c->echo_removal_control.gain_rampup.initial_gain, 0.f, 1.f);
-  res = res & Limit(&c->echo_removal_control.gain_rampup.non_zero_gain_blocks,
-                    0, 100000);
-  res = res &
-        Limit(&c->echo_removal_control.gain_rampup.full_gain_blocks, 0, 100000);
-
   res = res & Limit(&c->echo_model.noise_floor_hold, 0, 1000);
   res = res & Limit(&c->echo_model.min_noise_floor_power, 0, 2000000.f);
   res = res & Limit(&c->echo_model.stationary_gate_slope, 0, 1000000.f);
diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h
index 4ae87d0..7dcc7dd 100644
--- a/api/audio/echo_canceller3_config.h
+++ b/api/audio/echo_canceller3_config.h
@@ -86,9 +86,7 @@
   } erle;
 
   struct EpStrength {
-    float lf = 1.f;
-    float mf = 1.f;
-    float hf = 1.f;
+    float default_gain = 1.f;
     float default_len = 0.83f;
     bool reverb_based_on_render = true;
     bool echo_can_saturate = true;
@@ -113,11 +111,6 @@
   } render_levels;
 
   struct EchoRemovalControl {
-    struct GainRampup {
-      float initial_gain = 0.0f;
-      int non_zero_gain_blocks = 187;
-      int full_gain_blocks = 312;
-    } gain_rampup;
     bool has_clock_drift = false;
     bool linear_and_stable_echo_path = false;
   } echo_removal_control;
diff --git a/api/audio/echo_canceller3_config_json.cc b/api/audio/echo_canceller3_config_json.cc
index 9aabc2d..4c8c8ab 100644
--- a/api/audio/echo_canceller3_config_json.cc
+++ b/api/audio/echo_canceller3_config_json.cc
@@ -193,9 +193,7 @@
   }
 
   if (rtc::GetValueFromJsonObject(aec3_root, "ep_strength", &section)) {
-    ReadParam(section, "lf", &cfg.ep_strength.lf);
-    ReadParam(section, "mf", &cfg.ep_strength.mf);
-    ReadParam(section, "hf", &cfg.ep_strength.hf);
+    ReadParam(section, "default_gain", &cfg.ep_strength.default_gain);
     ReadParam(section, "default_len", &cfg.ep_strength.default_len);
     ReadParam(section, "reverb_based_on_render",
               &cfg.ep_strength.reverb_based_on_render);
@@ -233,15 +231,6 @@
 
   if (rtc::GetValueFromJsonObject(aec3_root, "echo_removal_control",
                                   &section)) {
-    Json::Value subsection;
-    if (rtc::GetValueFromJsonObject(section, "gain_rampup", &subsection)) {
-      ReadParam(subsection, "initial_gain",
-                &cfg.echo_removal_control.gain_rampup.initial_gain);
-      ReadParam(subsection, "non_zero_gain_blocks",
-                &cfg.echo_removal_control.gain_rampup.non_zero_gain_blocks);
-      ReadParam(subsection, "full_gain_blocks",
-                &cfg.echo_removal_control.gain_rampup.full_gain_blocks);
-    }
     ReadParam(section, "has_clock_drift",
               &cfg.echo_removal_control.has_clock_drift);
     ReadParam(section, "linear_and_stable_echo_path",
@@ -413,9 +402,7 @@
   ost << "},";
 
   ost << "\"ep_strength\": {";
-  ost << "\"lf\": " << config.ep_strength.lf << ",";
-  ost << "\"mf\": " << config.ep_strength.mf << ",";
-  ost << "\"hf\": " << config.ep_strength.hf << ",";
+  ost << "\"default_gain\": " << config.ep_strength.default_gain << ",";
   ost << "\"default_len\": " << config.ep_strength.default_len << ",";
   ost << "\"reverb_based_on_render\": "
       << (config.ep_strength.reverb_based_on_render ? "true" : "false") << ",";
@@ -456,14 +443,6 @@
   ost << "},";
 
   ost << "\"echo_removal_control\": {";
-  ost << "\"gain_rampup\": {";
-  ost << "\"initial_gain\": "
-      << config.echo_removal_control.gain_rampup.initial_gain << ",";
-  ost << "\"non_zero_gain_blocks\": "
-      << config.echo_removal_control.gain_rampup.non_zero_gain_blocks << ",";
-  ost << "\"full_gain_blocks\": "
-      << config.echo_removal_control.gain_rampup.full_gain_blocks;
-  ost << "},";
   ost << "\"has_clock_drift\": "
       << (config.echo_removal_control.has_clock_drift ? "true" : "false")
       << ",";
diff --git a/modules/audio_processing/aec3/filter_analyzer.cc b/modules/audio_processing/aec3/filter_analyzer.cc
index b623b73..7a6471a 100644
--- a/modules/audio_processing/aec3/filter_analyzer.cc
+++ b/modules/audio_processing/aec3/filter_analyzer.cc
@@ -50,7 +50,7 @@
     : data_dumper_(
           new ApmDataDumper(rtc::AtomicOps::Increment(&instance_count_))),
       bounded_erl_(config.ep_strength.bounded_erl),
-      default_gain_(config.ep_strength.lf),
+      default_gain_(config.ep_strength.default_gain),
       h_highpass_(GetTimeDomainLength(config.filter.main.length_blocks), 0.f),
       filter_length_blocks_(config.filter.main_initial.length_blocks),
       consistent_filter_detector_(config) {
diff --git a/modules/audio_processing/aec3/residual_echo_estimator.cc b/modules/audio_processing/aec3/residual_echo_estimator.cc
index 4897ca8..d47fa4c 100644
--- a/modules/audio_processing/aec3/residual_echo_estimator.cc
+++ b/modules/audio_processing/aec3/residual_echo_estimator.cc
@@ -113,7 +113,7 @@
 
     float echo_path_gain;
     echo_path_gain =
-        aec_state.TransparentMode() ? 0.01f : config_.ep_strength.lf;
+        aec_state.TransparentMode() ? 0.01f : config_.ep_strength.default_gain;
     NonLinearEstimate(echo_path_gain, X2, Y2, R2);
 
     // When there is saturated echo, assume the same spectral content as is