AEC3: option for using the stationarity estimator at render from the beginning of the call

Bug: webrtc:9697
Change-Id: I2427e9e62505d27b0942fd6b2e38eee6d720f4f3
Reviewed-on: https://webrtc-review.googlesource.com/97081
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24513}
This commit is contained in:
Jesús de Vicente Peña 2018-08-31 15:03:04 +02:00 committed by Commit Bot
parent 2165233874
commit 836a7a2e4d
5 changed files with 10 additions and 3 deletions

View File

@ -106,6 +106,7 @@ struct EchoCanceller3Config {
float audibility_threshold_mf = 10;
float audibility_threshold_hf = 10;
bool use_stationary_properties = true;
bool use_stationarity_properties_at_init = false;
} echo_audibility;
struct RenderLevels {

View File

@ -131,6 +131,8 @@ AecState::AecState(const EchoCanceller3Config& config)
blocks_since_converged_filter_(kBlocksSinceConvergencedFilterInit),
active_blocks_since_consistent_filter_estimate_(
kBlocksSinceConsistentEstimateInit),
echo_audibility_(
config.echo_audibility.use_stationarity_properties_at_init),
reverb_model_estimator_(config) {}
AecState::~AecState() = default;

View File

@ -20,7 +20,8 @@
namespace webrtc {
EchoAudibility::EchoAudibility() {
EchoAudibility::EchoAudibility(bool use_render_stationarity_at_init)
: use_render_stationarity_at_init_(use_render_stationarity_at_init) {
Reset();
}
@ -34,7 +35,7 @@ void EchoAudibility::Update(const RenderBuffer& render_buffer,
render_buffer.GetBlockBuffer(),
external_delay_seen);
if (external_delay_seen) {
if (external_delay_seen || use_render_stationarity_at_init_) {
UpdateRenderStationarityFlags(render_buffer, delay_blocks, reverb_decay);
}
}

View File

@ -31,7 +31,7 @@ class ApmDataDumper;
class EchoAudibility {
public:
EchoAudibility();
explicit EchoAudibility(bool use_render_stationarity_at_init);
~EchoAudibility();
// Feed new render data to the echo audibility estimator.
@ -78,6 +78,7 @@ class EchoAudibility {
absl::optional<int> render_spectrum_write_prev_;
int render_block_write_prev_;
bool non_zero_render_seen_;
const bool use_render_stationarity_at_init_;
StationarityEstimator render_stationarity_;
RTC_DISALLOW_COPY_AND_ASSIGN(EchoAudibility);
};

View File

@ -293,6 +293,8 @@ class Aec3ParametersParser {
&cfg.echo_audibility.audibility_threshold_hf);
ReadParam(section, "use_stationary_properties",
&cfg.echo_audibility.use_stationary_properties);
ReadParam(section, "use_stationary_properties_at_init",
&cfg.echo_audibility.use_stationarity_properties_at_init);
}
if (rtc::GetValueFromJsonObject(root, "echo_removal_control", &section)) {