AEC3: Configuration parameter for disabling linear filter

The configuration parameter filter.use_linear_filter can be used to
disable the linear filtering. Disabling the linear filter is equivalent
to runing in non-linear mode.

Bug: b/130016532
Change-Id: I8ffdf474822888b9915444bba6cc1c25ec1efe5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132552
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27566}
This commit is contained in:
Gustaf Ullberg
2019-04-11 14:43:17 +02:00
committed by Commit Bot
parent 7aacdd9515
commit 52caa0ef58
4 changed files with 12 additions and 3 deletions

View File

@ -118,7 +118,9 @@ void AecState::Update(
// Estimate the direct path delay of the filter.
delay_state_.Update(filter_analyzer_, external_delay,
strong_not_saturated_render_blocks_);
config_.filter.use_linear_filter
? strong_not_saturated_render_blocks_
: 0);
const std::vector<float>& aligned_render_block =
render_buffer.Block(-delay_state_.DirectPathFilterDelay())[0];

View File

@ -45,12 +45,14 @@ class AecState {
// Returns whether the echo subtractor can be used to determine the residual
// echo.
bool UsableLinearEstimate() const {
return filter_quality_state_.LinearFilterUsable();
return filter_quality_state_.LinearFilterUsable() &&
config_.filter.use_linear_filter;
}
// Returns whether the echo subtractor output should be used as output.
bool UseLinearFilterOutput() const {
return filter_quality_state_.LinearFilterUsable();
return filter_quality_state_.LinearFilterUsable() &&
config_.filter.use_linear_filter;
}
// Returns the estimated echo path gain.