Revert "AEC3: Ensure that the high-pass filter effect is on when AEC3 is active"

This reverts commit 3a77f93589f77aabfdfa75cd7202f09b4315ff7c.

Reason for revert: The change is breaking downstream tests.

Original change's description:
> AEC3: Ensure that the high-pass filter effect is on when AEC3 is active
> 
> This CL ensures that the high-pass filter is on whenever the echo
> controller is on. This is important as the echo controller code assumes
> that the external high-pass filter is active.
> 
> The CL also corrects the ToggleAec unit test (which started failing
> after this code change).
> 
> Bug: webrtc:11159,chromium:1030179
> Change-Id: Ie29db74bf3de6279a08564398d32d67d5e1569db
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161222
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29979}

TBR=saza@webrtc.org,peah@webrtc.org

Change-Id: I78b4e397555f50898ca42c4b32fb39cf06a2541a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11159, chromium:1030179
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161226
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29981}
This commit is contained in:
Per Åhgren 2019-12-03 11:48:48 +00:00 committed by Commit Bot
parent 6a05bb1b12
commit 4011de012f
3 changed files with 10 additions and 13 deletions

View File

@ -247,8 +247,7 @@ bool AudioProcessingImpl::SubmoduleStates::RenderMultiBandProcessingActive()
bool AudioProcessingImpl::SubmoduleStates::HighPassFilteringRequired() const {
return high_pass_filter_enabled_ || echo_canceller_enabled_ ||
mobile_echo_controller_enabled_ || noise_suppressor_enabled_ ||
echo_controller_enabled_;
mobile_echo_controller_enabled_ || noise_suppressor_enabled_;
}
AudioProcessingBuilder::AudioProcessingBuilder() = default;
@ -514,7 +513,7 @@ int AudioProcessingImpl::InitializeLocked() {
submodules_.agc_manager->SetCaptureMuted(capture_.output_will_be_muted);
}
InitializeTransient();
InitializeHighPassFilter(false);
InitializeHighPassFilter();
InitializeVoiceDetector();
InitializeResidualEchoDetector();
InitializeEchoController();
@ -677,8 +676,7 @@ void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
InitializeNoiseSuppressor();
}
InitializeHighPassFilter(config_.echo_canceller.enabled &&
!config.echo_canceller.mobile_mode);
InitializeHighPassFilter();
if (agc1_config_changed) {
ApplyAgc1Config(config_.gain_controller1);
@ -1790,7 +1788,7 @@ AudioProcessing::Config AudioProcessingImpl::GetConfig() const {
bool AudioProcessingImpl::UpdateActiveSubmoduleStates() {
return submodule_states_.Update(
config_.high_pass_filter.enabled, config_.echo_canceller.enabled,
config_.high_pass_filter.enabled, !!submodules_.echo_cancellation,
!!submodules_.echo_control_mobile, config_.residual_echo_detector.enabled,
!!submodules_.legacy_noise_suppressor || !!submodules_.noise_suppressor,
submodules_.gain_control->is_enabled(), config_.gain_controller2.enabled,
@ -1809,8 +1807,8 @@ void AudioProcessingImpl::InitializeTransient() {
}
}
void AudioProcessingImpl::InitializeHighPassFilter(bool force_activation) {
if (force_activation || submodule_states_.HighPassFilteringRequired()) {
void AudioProcessingImpl::InitializeHighPassFilter() {
if (submodule_states_.HighPassFilteringRequired()) {
submodules_.high_pass_filter.reset(new HighPassFilter(num_proc_channels()));
} else {
submodules_.high_pass_filter.reset();

View File

@ -232,8 +232,7 @@ class AudioProcessingImpl : public AudioProcessing {
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeResidualEchoDetector()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);
void InitializeHighPassFilter(bool force_activation)
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeHighPassFilter() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeVoiceDetector() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_capture_);
void InitializeEchoController()
RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_render_, crit_capture_);

View File

@ -51,8 +51,8 @@ class DebugDumpGenerator {
bool enable_pre_amplifier);
// Constructor that uses default input files.
DebugDumpGenerator(const Config& config,
const AudioProcessing::Config& apm_config);
explicit DebugDumpGenerator(const Config& config,
const AudioProcessing::Config& apm_config);
~DebugDumpGenerator();
@ -346,7 +346,7 @@ TEST_F(DebugDumpTest, ToggleAec) {
generator.StartRecording();
generator.Process(100);
apm_config.echo_canceller.enabled = false;
apm_config.echo_canceller.enabled = true;
generator.apm()->ApplyConfig(apm_config);
generator.Process(100);