AEC3: Adding another config parameter and matching json reader with config

This CL:
-Adds another config parameter that controls the duration of the initial
state.
-Adds reading of that parameter in audioproc_f from the json settings file.
-Adds missing reading of another parameter in audioproc_f from the json
settings file.

Bug: webrtc:8671
Change-Id: Ie6164c360492de5e6b0ade8838bbabe214560b5e
Reviewed-on: https://webrtc-review.googlesource.com/94621
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24360}
This commit is contained in:
Per Åhgren
2018-08-17 00:09:15 +02:00
committed by Commit Bot
parent 223eba5f72
commit c3da6716d4
3 changed files with 7 additions and 2 deletions

View File

@ -53,6 +53,7 @@ struct EchoCanceller3Config {
ShadowConfiguration shadow_initial = {12, 0.9f, 20075344.f};
size_t config_change_duration_blocks = 250;
float initial_state_seconds = 2.5f;
} filter;
struct Erle {

View File

@ -284,8 +284,8 @@ void AecState::Update(
// Flag whether the initial state is still active.
if (use_short_initial_state_) {
initial_state_ =
blocks_with_proper_filter_adaptation_ < 2.5f * kNumBlocksPerSecond;
initial_state_ = blocks_with_proper_filter_adaptation_ <
config_.filter.initial_state_seconds * kNumBlocksPerSecond;
} else {
initial_state_ =
blocks_with_proper_filter_adaptation_ < 5 * kNumBlocksPerSecond;

View File

@ -210,6 +210,10 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) {
ReadParam(section, "shadow", &cfg.filter.shadow);
ReadParam(section, "main_initial", &cfg.filter.main_initial);
ReadParam(section, "shadow_initial", &cfg.filter.shadow_initial);
ReadParam(section, "config_change_duration_blocks",
&cfg.filter.config_change_duration_blocks);
ReadParam(section, "initial_state_seconds",
&cfg.filter.initial_state_seconds);
}
if (rtc::GetValueFromJsonObject(root, "erle", &section)) {