From aa91b3c67e4c8f4030f773da66b23a1d38c58427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85hgren?= Date: Thu, 16 Aug 2018 09:29:18 +0200 Subject: [PATCH] Hooks up more AEC3 parameters to be read by the AEC3 configuration file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8671 Change-Id: I593ea4965ab2f8215e5d55e0778caf83cf62d4e1 Reviewed-on: https://webrtc-review.googlesource.com/94480 Reviewed-by: Gustaf Ullberg Commit-Queue: Per Ã…hgren Cr-Commit-Position: refs/heads/master@{#24304} --- .../test/audio_processing_simulator.cc | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/modules/audio_processing/test/audio_processing_simulator.cc b/modules/audio_processing/test/audio_processing_simulator.cc index ba827b15c9..f6af179bf0 100644 --- a/modules/audio_processing/test/audio_processing_simulator.cc +++ b/modules/audio_processing/test/audio_processing_simulator.cc @@ -141,6 +141,28 @@ void ReadParam(const Json::Value& root, } } +void ReadParam(const Json::Value& root, + std::string param_name, + EchoCanceller3Config::Suppressor::MaskingThresholds* param) { + RTC_CHECK(param); + Json::Value json_array; + if (rtc::GetValueFromJsonObject(root, param_name, &json_array)) { + std::vector v; + rtc::JsonArrayToDoubleVector(json_array, &v); + if (v.size() != 3) { + std::cout << "Incorrect array size for " << param_name << std::endl; + RTC_CHECK(false); + } + param->enr_transparent = static_cast(v[0]); + param->enr_suppress = static_cast(v[1]); + param->emr_transparent = static_cast(v[2]); + + std::cout << param_name << ":" + << "[" << param->enr_transparent << "," << param->enr_suppress + << "," << param->emr_transparent << "]" << std::endl; + } +} + EchoCanceller3Config ParseAec3Parameters(const std::string& filename) { EchoCanceller3Config cfg; Json::Value root; @@ -250,6 +272,9 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) { ReadParam(section, "normal", &cfg.gain_updates.normal); ReadParam(section, "saturation", &cfg.gain_updates.saturation); ReadParam(section, "nonlinear", &cfg.gain_updates.nonlinear); + ReadParam(section, "max_inc_factor", &cfg.gain_updates.max_inc_factor); + ReadParam(section, "max_dec_factor_lf", + &cfg.gain_updates.max_dec_factor_lf); ReadParam(section, "floor_first_increase", &cfg.gain_updates.floor_first_increase); } @@ -293,6 +318,15 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) { ReadParam(section, "nonlinear_release", &cfg.echo_model.nonlinear_release); } + if (rtc::GetValueFromJsonObject(root, "suppressor", §ion)) { + ReadParam(section, "bands_with_reliable_coherence", + &cfg.suppressor.bands_with_reliable_coherence); + ReadParam(section, "nearend_average_blocks", + &cfg.suppressor.nearend_average_blocks); + ReadParam(section, "mask_lf", &cfg.suppressor.mask_lf); + ReadParam(section, "mask_hf", &cfg.suppressor.mask_hf); + } + std::cout << std::endl; return cfg; }