Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2800033003: Fixing sample-rate dependent band-split filter issues in AEC3 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index f9cc98faa022846ea9e42e0f4eeba2945b8ba3ea..636d6ca5f0090a1cadac8d4b9c488523418d0dad 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -562,11 +562,17 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
capture_nonlocked_.capture_processing_format =
StreamConfig(capture_processing_rate);
- int render_processing_rate = FindNativeProcessRateToUse(
- std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(),
- formats_.api_format.reverse_output_stream().sample_rate_hz()),
- submodule_states_.CaptureMultiBandSubModulesActive() ||
- submodule_states_.RenderMultiBandSubModulesActive());
+ int render_processing_rate;
+ if (!config_.echo_canceller3.enabled) {
+ render_processing_rate = FindNativeProcessRateToUse(
+ std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(),
+ formats_.api_format.reverse_output_stream().sample_rate_hz()),
+ submodule_states_.CaptureMultiBandSubModulesActive() ||
+ submodule_states_.RenderMultiBandSubModulesActive());
+ } else {
+ render_processing_rate = capture_processing_rate;
+ }
+
// TODO(aluebs): Remove this restriction once we figure out why the 3-band
// splitting filter degrades the AEC performance.
if (render_processing_rate > kSampleRate32kHz &&
@@ -575,6 +581,7 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
? kSampleRate32kHz
: kSampleRate16kHz;
}
+
// If the forward sample rate is 8 kHz, the render stream is also processed
// at this rate.
if (capture_nonlocked_.capture_processing_format.sample_rate_hz() ==

Powered by Google App Engine
This is Rietveld 408576698