Drop the 16kHz sample rate restriction on AECM and zero out higher bands
The restriction has been removed completely and AECM now supports any
number of higher bands. But this has been achieved by always zeroing out the
higher bands, instead of applying a constant gain which is the average over half
of the lower band (like it is done for the AEC), because that would be
non-trivial to implement and we don't want to spend too much time on AECM, since
we want to get rid of it in the long term anyway.
R=peah@webrtc.org, solenberg@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1774553002 .
Cr-Commit-Position: refs/heads/master@{#11931}
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index 7715134..b7b8762 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -122,7 +122,6 @@
arraysize(AudioProcessing::kNativeSampleRatesHz);
const int AudioProcessing::kMaxNativeSampleRateHz = AudioProcessing::
kNativeSampleRatesHz[AudioProcessing::kNumNativeSampleRates - 1];
-const int AudioProcessing::kMaxAECMSampleRateHz = kSampleRate16kHz;
AudioProcessing* AudioProcessing::Create() {
Config config;
@@ -369,7 +368,7 @@
formats_.api_format = config;
- // We process at the closest native rate >= min(input rate, output rate)...
+ // We process at the closest native rate >= min(input rate, output rate).
const int min_proc_rate =
std::min(formats_.api_format.input_stream().sample_rate_hz(),
formats_.api_format.output_stream().sample_rate_hz());
@@ -380,11 +379,6 @@
break;
}
}
- // ...with one exception.
- if (public_submodules_->echo_control_mobile->is_enabled() &&
- min_proc_rate > kMaxAECMSampleRateHz) {
- fwd_proc_rate = kMaxAECMSampleRateHz;
- }
capture_nonlocked_.fwd_proc_format = StreamConfig(fwd_proc_rate);
@@ -620,12 +614,6 @@
return kBadSampleRateError;
}
- if (public_submodules_->echo_control_mobile->is_enabled() &&
- frame->sample_rate_hz_ > kMaxAECMSampleRateHz) {
- LOG(LS_ERROR) << "AECM only supports 16 or 8 kHz sample rates";
- return kUnsupportedComponentError;
- }
-
ProcessingConfig processing_config;
{
// Aquire lock for the access of api_format.