Further headset mode robustification based on linear filter convergence

This CL adds robustifications for avoiding that the headset mode
is triggered for reverberant or weak echo paths.

Bug: webrtc:9047,chromium:824111,webrtc:8314,webrtc:8671,webrtc:5201,webrtc:5919
Change-Id: Ib111e617f765377c021a5b633cf13a7917fe62a6
Reviewed-on: https://webrtc-review.googlesource.com/64002
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22557}
This commit is contained in:
Per Åhgren
2018-03-22 10:15:59 +01:00
committed by Commit Bot
parent a09993d147
commit f3e2bf1807
2 changed files with 12 additions and 1 deletions

View File

@ -170,6 +170,15 @@ void AecState::Update(
bool recently_converged_filter = bool recently_converged_filter =
blocks_since_converged_filter_ < 60 * kNumBlocksPerSecond; blocks_since_converged_filter_ < 60 * kNumBlocksPerSecond;
if (blocks_since_converged_filter_ > 20 * kNumBlocksPerSecond) {
converged_filter_count_ = 0;
} else if (converged_filter) {
++converged_filter_count_;
}
if (converged_filter_count_ > 50) {
finite_erl_ = true;
}
if (filter_analyzer_.Consistent() && filter_delay_blocks_ < 5) { if (filter_analyzer_.Consistent() && filter_delay_blocks_ < 5) {
consistent_filter_seen_ = true; consistent_filter_seen_ = true;
active_blocks_since_consistent_filter_estimate_ = 0; active_blocks_since_consistent_filter_estimate_ = 0;
@ -192,7 +201,7 @@ void AecState::Update(
// After an amount of active render samples for which an echo should have been // After an amount of active render samples for which an echo should have been
// detected in the capture signal if the ERL was not infinite, flag that a // detected in the capture signal if the ERL was not infinite, flag that a
// transparent mode should be entered. // transparent mode should be entered.
transparent_mode_ = !config_.ep_strength.bounded_erl; transparent_mode_ = !config_.ep_strength.bounded_erl && !finite_erl_;
transparent_mode_ = transparent_mode_ =
transparent_mode_ && transparent_mode_ &&
(consistent_filter_estimate_not_seen || !converged_filter_seen_); (consistent_filter_estimate_not_seen || !converged_filter_seen_);

View File

@ -173,6 +173,8 @@ class AecState {
bool converged_filter_seen_ = false; bool converged_filter_seen_ = false;
bool consistent_filter_seen_ = false; bool consistent_filter_seen_ = false;
bool external_delay_seen_ = false; bool external_delay_seen_ = false;
size_t converged_filter_count_ = 0;
bool finite_erl_ = false;
RTC_DISALLOW_COPY_AND_ASSIGN(AecState); RTC_DISALLOW_COPY_AND_ASSIGN(AecState);
}; };