Disable transparent mode when ERL is bounded

A bounded ERL disables all TransparentMode implementations.

Bug: webrtc:10232
Change-Id: I5a3641b356c2abf42cd6d055cee4007327528a41
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185301
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32187}
This commit is contained in:
Gustaf Ullberg
2020-09-24 17:24:03 +02:00
committed by Commit Bot
parent a70528e0be
commit 39a3f081c1

View File

@ -123,8 +123,7 @@ class TransparentModeImpl : public TransparentMode {
class LegacyTransparentModeImpl : public TransparentMode {
public:
explicit LegacyTransparentModeImpl(const EchoCanceller3Config& config)
: bounded_erl_(config.ep_strength.bounded_erl),
linear_and_stable_echo_path_(
: linear_and_stable_echo_path_(
config.echo_removal_control.linear_and_stable_echo_path),
active_blocks_since_sane_filter_(kBlocksSinceConsistentEstimateInit),
non_converged_sequence_size_(kBlocksSinceConvergencedFilterInit) {}
@ -197,9 +196,7 @@ class LegacyTransparentModeImpl : public TransparentMode {
finite_erl_recently_detected_ = true;
}
if (bounded_erl_) {
transparency_activated_ = false;
} else if (finite_erl_recently_detected_) {
if (finite_erl_recently_detected_) {
transparency_activated_ = false;
} else if (sane_filter_recently_seen &&
recent_convergence_during_activity_) {
@ -212,7 +209,6 @@ class LegacyTransparentModeImpl : public TransparentMode {
}
private:
const bool bounded_erl_;
const bool linear_and_stable_echo_path_;
size_t capture_block_counter_ = 0;
bool transparency_activated_ = false;
@ -229,7 +225,7 @@ class LegacyTransparentModeImpl : public TransparentMode {
std::unique_ptr<TransparentMode> TransparentMode::Create(
const EchoCanceller3Config& config) {
if (DeactivateTransparentMode()) {
if (config.ep_strength.bounded_erl || DeactivateTransparentMode()) {
return nullptr;
}
if (DeactivateTransparentModeHmm()) {