From b1737fc198ca768abdb6c0753e4f4cda5766aff6 Mon Sep 17 00:00:00 2001 From: peah Date: Thu, 24 Aug 2017 06:02:49 -0700 Subject: [PATCH] Made the AEC3 alignment a mandatory for using the adaptive filter delay This CL ensures that the adaptive filter delay is not used for fine tune echo removal unless the render and capture signals have been properly aligned. BUG=webrtc:8189 Review-Url: https://codereview.webrtc.org/3003303002 Cr-Commit-Position: refs/heads/master@{#19492} --- .../audio_processing/aec3/residual_echo_estimator.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc b/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc index c5df82c747..8905846743 100644 --- a/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc +++ b/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc @@ -95,10 +95,10 @@ void ResidualEchoEstimator::Estimate( RTC_DCHECK(R2); const rtc::Optional delay = - aec_state.FilterDelay() - ? aec_state.FilterDelay() - : (aec_state.ExternalDelay() ? aec_state.ExternalDelay() - : rtc::Optional()); + aec_state.ExternalDelay() + ? (aec_state.FilterDelay() ? aec_state.FilterDelay() + : aec_state.ExternalDelay()) + : rtc::Optional(); // Estimate the power of the stationary noise in the render signal. RenderNoisePower(render_buffer, &X2_noise_floor_, &X2_noise_floor_counter_); @@ -115,7 +115,7 @@ void ResidualEchoEstimator::Estimate( } else { // Estimate the echo generating signal power. std::array X2; - if (aec_state.ExternalDelay() || aec_state.FilterDelay()) { + if (aec_state.ExternalDelay() && aec_state.FilterDelay()) { RTC_DCHECK(delay); const int delay_use = static_cast(*delay);