diff --git a/api/audio/echo_canceller3_config.cc b/api/audio/echo_canceller3_config.cc index 36bb6fd395..a560c9eb20 100644 --- a/api/audio/echo_canceller3_config.cc +++ b/api/audio/echo_canceller3_config.cc @@ -142,9 +142,7 @@ bool EchoCanceller3Config::Validate(EchoCanceller3Config* config) { } 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 @@ bool EchoCanceller3Config::Validate(EchoCanceller3Config* config) { 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 4ae87d0fa2..7dcc7dd9c2 100644 --- a/api/audio/echo_canceller3_config.h +++ b/api/audio/echo_canceller3_config.h @@ -86,9 +86,7 @@ struct RTC_EXPORT EchoCanceller3Config { } 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 @@ struct RTC_EXPORT EchoCanceller3Config { } 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 9aabc2d537..4c8c8ab6f4 100644 --- a/api/audio/echo_canceller3_config_json.cc +++ b/api/audio/echo_canceller3_config_json.cc @@ -193,9 +193,7 @@ void Aec3ConfigFromJsonString(absl::string_view json_string, } if (rtc::GetValueFromJsonObject(aec3_root, "ep_strength", §ion)) { - 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 @@ void Aec3ConfigFromJsonString(absl::string_view json_string, if (rtc::GetValueFromJsonObject(aec3_root, "echo_removal_control", §ion)) { - 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 @@ std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) { 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 @@ std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) { 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 b623b73a08..7a6471a5e3 100644 --- a/modules/audio_processing/aec3/filter_analyzer.cc +++ b/modules/audio_processing/aec3/filter_analyzer.cc @@ -50,7 +50,7 @@ FilterAnalyzer::FilterAnalyzer(const EchoCanceller3Config& config) : 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 4897ca8359..d47fa4cede 100644 --- a/modules/audio_processing/aec3/residual_echo_estimator.cc +++ b/modules/audio_processing/aec3/residual_echo_estimator.cc @@ -113,7 +113,7 @@ void ResidualEchoEstimator::Estimate( 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