AEC3: Added a mode to properly utilize highly linear setups

Bug: webrtc:9321
Change-Id: I9c1abbd6b1daa1ecff041633318edfb8a011e9c0
Reviewed-on: https://webrtc-review.googlesource.com/79480
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23423}
This commit is contained in:
Per Åhgren
2018-05-28 22:57:17 +02:00
committed by Commit Bot
parent 7c1ccfa881
commit e3ca991770
3 changed files with 9 additions and 3 deletions

View File

@ -134,6 +134,7 @@ struct EchoCanceller3Config {
int full_gain_blocks = 312;
} gain_rampup;
bool has_clock_drift = false;
bool linear_and_stable_echo_path = false;
} echo_removal_control;
struct EchoModel {

View File

@ -245,10 +245,13 @@ void AecState::Update(
usable_linear_estimate_ = !echo_saturation_;
usable_linear_estimate_ =
usable_linear_estimate_ && filter_has_had_time_to_converge;
usable_linear_estimate_ =
usable_linear_estimate_ && recently_converged_filter;
usable_linear_estimate_ = usable_linear_estimate_ && !diverged_filter;
usable_linear_estimate_ = usable_linear_estimate_ && external_delay;
if (!config_.echo_removal_control.linear_and_stable_echo_path) {
usable_linear_estimate_ =
usable_linear_estimate_ && recently_converged_filter;
usable_linear_estimate_ = usable_linear_estimate_ && !diverged_filter;
}
use_linear_filter_output_ = usable_linear_estimate_ && !TransparentMode();

View File

@ -266,6 +266,8 @@ EchoCanceller3Config ParseAec3Parameters(const std::string& filename) {
}
ReadParam(section, "has_clock_drift",
&cfg.echo_removal_control.has_clock_drift);
ReadParam(section, "linear_and_stable_echo_path",
&cfg.echo_removal_control.linear_and_stable_echo_path);
}
if (rtc::GetValueFromJsonObject(root, "echo_model", &section)) {