AEC3: Remove unused kill-switches from AdjustConfig
Kill-switches removed: WebRTC-Aec3UseShortDelayEstimatorWindow WebRTC-Aec3ReverbBasedOnRenderKillSwitch WebRTC-Aec3ReverbModellingKillSwitch WebRTC-Aec3EnableUnityInitialRampupGain WebRTC-Aec3EnableUnityNonZeroRampupGain WebRTC-Aec3ShortReverbKillSwitch WebRTC-Aec3NewFilterParamsKillSwitch WebRTC-Aec3EnableLegacyDominantNearend WebRTC-Aec3UseLegacyNormalSuppressorTuning WebRTC-Aec3UseStationarityProperties WebRTC-Aec3UseStationarityPropertiesAtInit WebRTC-Aec3EarlyDelayDetectionKillSwitch The change is tested for bit-exactness. Bug: webrtc:8671 Change-Id: Ic7638002c0ca1bc5fc911e048285134c4df5d134 Reviewed-on: https://webrtc-review.googlesource.com/c/119921 Reviewed-by: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26403}
This commit is contained in:
committed by
Commit Bot
parent
a9316c9445
commit
99ec6f39b9
@ -32,127 +32,9 @@ bool DetectSaturation(rtc::ArrayView<const float> y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UseShortDelayEstimatorWindow() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3UseShortDelayEstimatorWindow");
|
||||
}
|
||||
|
||||
bool EnableReverbBasedOnRender() {
|
||||
return !field_trial::IsEnabled("WebRTC-Aec3ReverbBasedOnRenderKillSwitch");
|
||||
}
|
||||
|
||||
bool EnableReverbModelling() {
|
||||
return !field_trial::IsEnabled("WebRTC-Aec3ReverbModellingKillSwitch");
|
||||
}
|
||||
|
||||
bool EnableUnityInitialRampupGain() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3EnableUnityInitialRampupGain");
|
||||
}
|
||||
|
||||
bool EnableUnityNonZeroRampupGain() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3EnableUnityNonZeroRampupGain");
|
||||
}
|
||||
|
||||
bool EnableLongReverb() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3ShortReverbKillSwitch");
|
||||
}
|
||||
|
||||
bool EnableNewFilterParams() {
|
||||
return !field_trial::IsEnabled("WebRTC-Aec3NewFilterParamsKillSwitch");
|
||||
}
|
||||
|
||||
bool EnableLegacyDominantNearend() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3EnableLegacyDominantNearend");
|
||||
}
|
||||
|
||||
bool UseLegacyNormalSuppressorTuning() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3UseLegacyNormalSuppressorTuning");
|
||||
}
|
||||
|
||||
bool ActivateStationarityProperties() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3UseStationarityProperties");
|
||||
}
|
||||
|
||||
bool ActivateStationarityPropertiesAtInit() {
|
||||
return field_trial::IsEnabled("WebRTC-Aec3UseStationarityPropertiesAtInit");
|
||||
}
|
||||
|
||||
bool UseEarlyDelayDetection() {
|
||||
return !field_trial::IsEnabled("WebRTC-Aec3EarlyDelayDetectionKillSwitch");
|
||||
}
|
||||
|
||||
// Method for adjusting config parameter dependencies..
|
||||
EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) {
|
||||
EchoCanceller3Config adjusted_cfg = config;
|
||||
const EchoCanceller3Config default_cfg;
|
||||
|
||||
if (!EnableReverbModelling()) {
|
||||
adjusted_cfg.ep_strength.default_len = 0.f;
|
||||
}
|
||||
|
||||
if (UseShortDelayEstimatorWindow()) {
|
||||
adjusted_cfg.delay.num_filters =
|
||||
std::min(adjusted_cfg.delay.num_filters, static_cast<size_t>(5));
|
||||
}
|
||||
|
||||
if (EnableReverbBasedOnRender() == false) {
|
||||
adjusted_cfg.ep_strength.reverb_based_on_render = false;
|
||||
}
|
||||
|
||||
if (!EnableNewFilterParams()) {
|
||||
adjusted_cfg.filter.main.leakage_diverged = 0.01f;
|
||||
adjusted_cfg.filter.main.error_floor = 0.1f;
|
||||
adjusted_cfg.filter.main.error_ceil = 1E10f;
|
||||
adjusted_cfg.filter.main_initial.error_ceil = 1E10f;
|
||||
}
|
||||
|
||||
if (EnableUnityInitialRampupGain() &&
|
||||
adjusted_cfg.echo_removal_control.gain_rampup.initial_gain ==
|
||||
default_cfg.echo_removal_control.gain_rampup.initial_gain) {
|
||||
adjusted_cfg.echo_removal_control.gain_rampup.initial_gain = 1.f;
|
||||
}
|
||||
|
||||
if (EnableUnityNonZeroRampupGain() &&
|
||||
adjusted_cfg.echo_removal_control.gain_rampup.first_non_zero_gain ==
|
||||
default_cfg.echo_removal_control.gain_rampup.first_non_zero_gain) {
|
||||
adjusted_cfg.echo_removal_control.gain_rampup.first_non_zero_gain = 1.f;
|
||||
}
|
||||
|
||||
if (EnableLongReverb()) {
|
||||
adjusted_cfg.ep_strength.default_len = 0.88f;
|
||||
}
|
||||
|
||||
if (EnableLegacyDominantNearend()) {
|
||||
adjusted_cfg.suppressor.nearend_tuning =
|
||||
EchoCanceller3Config::Suppressor::Tuning(
|
||||
EchoCanceller3Config::Suppressor::MaskingThresholds(.2f, .3f, .3f),
|
||||
EchoCanceller3Config::Suppressor::MaskingThresholds(.07f, .1f, .3f),
|
||||
2.0f, 0.25f);
|
||||
}
|
||||
|
||||
if (UseLegacyNormalSuppressorTuning()) {
|
||||
adjusted_cfg.suppressor.normal_tuning =
|
||||
EchoCanceller3Config::Suppressor::Tuning(
|
||||
EchoCanceller3Config::Suppressor::MaskingThresholds(.2f, .3f, .3f),
|
||||
EchoCanceller3Config::Suppressor::MaskingThresholds(.07f, .1f, .3f),
|
||||
2.0f, 0.25f);
|
||||
|
||||
adjusted_cfg.suppressor.dominant_nearend_detection.enr_threshold = 0.1f;
|
||||
adjusted_cfg.suppressor.dominant_nearend_detection.snr_threshold = 10.f;
|
||||
adjusted_cfg.suppressor.dominant_nearend_detection.hold_duration = 25;
|
||||
}
|
||||
|
||||
if (ActivateStationarityProperties()) {
|
||||
adjusted_cfg.echo_audibility.use_stationary_properties = true;
|
||||
}
|
||||
|
||||
if (ActivateStationarityPropertiesAtInit()) {
|
||||
adjusted_cfg.echo_audibility.use_stationarity_properties_at_init = true;
|
||||
}
|
||||
|
||||
if (!UseEarlyDelayDetection()) {
|
||||
adjusted_cfg.delay.delay_selection_thresholds = {25, 25};
|
||||
}
|
||||
|
||||
return adjusted_cfg;
|
||||
}
|
||||
|
||||
|
||||
@ -30,10 +30,6 @@ namespace webrtc {
|
||||
|
||||
namespace {
|
||||
|
||||
bool UseEarlyDelayDetection() {
|
||||
return !field_trial::IsEnabled("WebRTC-Aec3EarlyDelayDetectionKillSwitch");
|
||||
}
|
||||
|
||||
class RenderDelayControllerImpl final : public RenderDelayController {
|
||||
public:
|
||||
RenderDelayControllerImpl(const EchoCanceller3Config& config,
|
||||
@ -51,7 +47,6 @@ class RenderDelayControllerImpl final : public RenderDelayController {
|
||||
private:
|
||||
static int instance_count_;
|
||||
std::unique_ptr<ApmDataDumper> data_dumper_;
|
||||
const bool use_early_delay_detection_;
|
||||
const int delay_headroom_blocks_;
|
||||
const int hysteresis_limit_1_blocks_;
|
||||
const int hysteresis_limit_2_blocks_;
|
||||
@ -108,7 +103,6 @@ RenderDelayControllerImpl::RenderDelayControllerImpl(
|
||||
int sample_rate_hz)
|
||||
: data_dumper_(
|
||||
new ApmDataDumper(rtc::AtomicOps::Increment(&instance_count_))),
|
||||
use_early_delay_detection_(UseEarlyDelayDetection()),
|
||||
delay_headroom_blocks_(
|
||||
static_cast<int>(config.delay.delay_headroom_blocks)),
|
||||
hysteresis_limit_1_blocks_(
|
||||
|
||||
Reference in New Issue
Block a user