Activating the AEC3 audibility improvements functionality

This CL turns on the previously implemented AEC3 audibility
improvements, which before has been off by default.

Bug: webrtc:9193,chromium:836790
Change-Id: Ibcd057ba5dd002718d62fd83db33d01d9563b8ea
Reviewed-on: https://webrtc-review.googlesource.com/77123
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23265}
This commit is contained in:
Per Åhgren
2018-05-16 15:25:04 +02:00
committed by Commit Bot
parent 85cb19fec7
commit 90e3fbdd37
3 changed files with 14 additions and 7 deletions

View File

@ -28,6 +28,11 @@ bool EnableTransparentMode() {
return !field_trial::IsEnabled("WebRTC-Aec3TransparentModeKillSwitch");
}
bool EnableStationaryRenderImprovements() {
return !field_trial::IsEnabled(
"WebRTC-Aec3StationaryRenderImprovementsKillSwitch");
}
float ComputeGainRampupIncrease(const EchoCanceller3Config& config) {
const auto& c = config.echo_removal_control.gain_rampup;
return powf(1.f / c.first_non_zero_gain, 1.f / c.non_zero_gain_blocks);
@ -43,9 +48,12 @@ int AecState::instance_count_ = 0;
AecState::AecState(const EchoCanceller3Config& config)
: data_dumper_(
new ApmDataDumper(rtc::AtomicOps::Increment(&instance_count_))),
allow_transparent_mode_(EnableTransparentMode()),
erle_estimator_(config.erle.min, config.erle.max_l, config.erle.max_h),
config_(config),
allow_transparent_mode_(EnableTransparentMode()),
use_stationary_properties_(
EnableStationaryRenderImprovements() &&
config_.echo_audibility.use_stationary_properties),
erle_estimator_(config.erle.min, config.erle.max_l, config.erle.max_h),
max_render_(config_.filter.main.length_blocks, 0.f),
reverb_decay_(fabsf(config_.ep_strength.default_len)),
gain_rampup_increase_(ComputeGainRampupIncrease(config_)),

View File

@ -62,9 +62,7 @@ class AecState {
// Returns whether the stationary properties of the signals are used in the
// aec.
bool UseStationaryProperties() const {
return config_.echo_audibility.use_stationary_properties;
}
bool UseStationaryProperties() const { return use_stationary_properties_; }
// Returns the ERLE.
const std::array<float, kFftLengthBy2Plus1>& Erle() const {
@ -142,7 +140,9 @@ class AecState {
static int instance_count_;
std::unique_ptr<ApmDataDumper> data_dumper_;
const EchoCanceller3Config config_;
const bool allow_transparent_mode_;
const bool use_stationary_properties_;
ErlEstimator erl_estimator_;
ErleEstimator erle_estimator_;
size_t capture_block_counter_ = 0;
@ -166,7 +166,6 @@ class AecState {
bool found_end_of_reverb_decay_ = false;
bool main_filter_is_adapting_ = true;
std::array<float, kMaxAdaptiveFilterLength> block_energies_;
const EchoCanceller3Config config_;
std::vector<float> max_render_;
float reverb_decay_ = fabsf(config_.ep_strength.default_len);
bool filter_has_had_time_to_converge_ = false;