Skip to content

Commit

Permalink
Remove echo suppression in transparent mode
Browse files Browse the repository at this point in the history
This change completely disables the use of suppression
when operating in transparent mode.

It also removes the following field trials:
* WebRTC-Aec3UseLowEarlyReflectionsTransparentModeGain
* WebRTC-Aec3UseLowLateReflectionsTransparentModeGain

Bug: webrtc:11985
Change-Id: I1c75efdad2d9c9d0a1aced86bf0278fc96616ea1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185402
Reviewed-by: Per Åhgren <[email protected]>
Commit-Queue: Gustaf Ullberg <[email protected]>
Cr-Commit-Position: refs/heads/master@{#32223}
  • Loading branch information
Gustaf Ullberg authored and Commit Bot committed Sep 29, 2020
1 parent b3b45d4 commit 46be80d
Showing 1 changed file with 12 additions and 39 deletions.
51 changes: 12 additions & 39 deletions modules/audio_processing/aec3/residual_echo_estimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,57 +23,32 @@
namespace webrtc {
namespace {

bool UseLowEarlyReflectionsTransparentModeGain() {
return field_trial::IsEnabled(
"WebRTC-Aec3UseLowEarlyReflectionsTransparentModeGain");
}

bool UseLowLateReflectionsTransparentModeGain() {
return field_trial::IsEnabled(
"WebRTC-Aec3UseLowLateReflectionsTransparentModeGain");
}

bool UseLowEarlyReflectionsDefaultGain() {
return field_trial::IsEnabled("WebRTC-Aec3UseLowEarlyReflectionsDefaultGain");
}

bool UseLowLateReflectionsDefaultGain() {
return field_trial::IsEnabled("WebRTC-Aec3UseLowLateReflectionsDefaultGain");
}

bool ModelReverbInNonlinearMode() {
return !field_trial::IsEnabled("WebRTC-Aec3rNonlinearModeReverbKillSwitch");
return !field_trial::IsEnabled("WebRTC-Aec3NonlinearModeReverbKillSwitch");
}

constexpr float kDefaultTransparentModeGain = 0.01f;

float GetEarlyReflectionsTransparentModeGain() {
if (UseLowEarlyReflectionsTransparentModeGain()) {
return 0.001f;
}
return kDefaultTransparentModeGain;
}
constexpr float kDefaultTransparentModeGain = 0.f;

float GetLateReflectionsTransparentModeGain() {
if (UseLowLateReflectionsTransparentModeGain()) {
return 0.001f;
float GetTransparentModeGain() {
if (field_trial::IsEnabled(
"WebRTC-Aec3NoSuppressionInTransparentModeKillSwitch")) {
return 0.01f;
} else {
return kDefaultTransparentModeGain;
}

return kDefaultTransparentModeGain;
}

float GetEarlyReflectionsDefaultModeGain(
const EchoCanceller3Config::EpStrength& config) {
if (UseLowEarlyReflectionsDefaultGain()) {
if (field_trial::IsEnabled("WebRTC-Aec3UseLowEarlyReflectionsDefaultGain")) {
return 0.1f;
}

return config.default_gain;
}

float GetLateReflectionsDefaultModeGain(
const EchoCanceller3Config::EpStrength& config) {
if (UseLowLateReflectionsDefaultGain()) {
if (field_trial::IsEnabled("WebRTC-Aec3UseLowLateReflectionsDefaultGain")) {
return 0.1f;
}
return config.default_gain;
Expand Down Expand Up @@ -201,10 +176,8 @@ ResidualEchoEstimator::ResidualEchoEstimator(const EchoCanceller3Config& config,
size_t num_render_channels)
: config_(config),
num_render_channels_(num_render_channels),
early_reflections_transparent_mode_gain_(
GetEarlyReflectionsTransparentModeGain()),
late_reflections_transparent_mode_gain_(
GetLateReflectionsTransparentModeGain()),
early_reflections_transparent_mode_gain_(GetTransparentModeGain()),
late_reflections_transparent_mode_gain_(GetTransparentModeGain()),
early_reflections_general_gain_(
GetEarlyReflectionsDefaultModeGain(config_.ep_strength)),
late_reflections_general_gain_(
Expand Down

0 comments on commit 46be80d

Please sign in to comment.