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

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2800033003: Fixing sample-rate dependent band-split filter issues in AEC3 (Closed)
Patch Set: Reverted the changes relating to the number of bands used internally inside AEC3 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_processing/aec3/aec3_common.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 int capture_processing_rate = FindNativeProcessRateToUse( 556 int capture_processing_rate = FindNativeProcessRateToUse(
557 std::min(formats_.api_format.input_stream().sample_rate_hz(), 557 std::min(formats_.api_format.input_stream().sample_rate_hz(),
558 formats_.api_format.output_stream().sample_rate_hz()), 558 formats_.api_format.output_stream().sample_rate_hz()),
559 submodule_states_.CaptureMultiBandSubModulesActive() || 559 submodule_states_.CaptureMultiBandSubModulesActive() ||
560 submodule_states_.RenderMultiBandSubModulesActive()); 560 submodule_states_.RenderMultiBandSubModulesActive());
561 561
562 capture_nonlocked_.capture_processing_format = 562 capture_nonlocked_.capture_processing_format =
563 StreamConfig(capture_processing_rate); 563 StreamConfig(capture_processing_rate);
564 564
565 int render_processing_rate = FindNativeProcessRateToUse( 565 int render_processing_rate;
566 std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(), 566 if (!config_.echo_canceller3.enabled) {
567 formats_.api_format.reverse_output_stream().sample_rate_hz()), 567 render_processing_rate = FindNativeProcessRateToUse(
568 submodule_states_.CaptureMultiBandSubModulesActive() || 568 std::min(formats_.api_format.reverse_input_stream().sample_rate_hz(),
569 submodule_states_.RenderMultiBandSubModulesActive()); 569 formats_.api_format.reverse_output_stream().sample_rate_hz()),
570 submodule_states_.CaptureMultiBandSubModulesActive() ||
571 submodule_states_.RenderMultiBandSubModulesActive());
572 } else {
573 render_processing_rate = capture_processing_rate;
574 }
575
570 // TODO(aluebs): Remove this restriction once we figure out why the 3-band 576 // TODO(aluebs): Remove this restriction once we figure out why the 3-band
571 // splitting filter degrades the AEC performance. 577 // splitting filter degrades the AEC performance.
572 if (render_processing_rate > kSampleRate32kHz && 578 if (render_processing_rate > kSampleRate32kHz &&
573 !config_.echo_canceller3.enabled) { 579 !config_.echo_canceller3.enabled) {
574 render_processing_rate = submodule_states_.RenderMultiBandProcessingActive() 580 render_processing_rate = submodule_states_.RenderMultiBandProcessingActive()
575 ? kSampleRate32kHz 581 ? kSampleRate32kHz
576 : kSampleRate16kHz; 582 : kSampleRate16kHz;
577 } 583 }
584
578 // If the forward sample rate is 8 kHz, the render stream is also processed 585 // If the forward sample rate is 8 kHz, the render stream is also processed
579 // at this rate. 586 // at this rate.
580 if (capture_nonlocked_.capture_processing_format.sample_rate_hz() == 587 if (capture_nonlocked_.capture_processing_format.sample_rate_hz() ==
581 kSampleRate8kHz) { 588 kSampleRate8kHz) {
582 render_processing_rate = kSampleRate8kHz; 589 render_processing_rate = kSampleRate8kHz;
583 } else { 590 } else {
584 render_processing_rate = 591 render_processing_rate =
585 std::max(render_processing_rate, static_cast<int>(kSampleRate16kHz)); 592 std::max(render_processing_rate, static_cast<int>(kSampleRate16kHz));
586 } 593 }
587 594
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 capture_processing_format(kSampleRate16kHz), 1995 capture_processing_format(kSampleRate16kHz),
1989 split_rate(kSampleRate16kHz) {} 1996 split_rate(kSampleRate16kHz) {}
1990 1997
1991 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1998 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1992 1999
1993 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 2000 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1994 2001
1995 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 2002 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1996 2003
1997 } // namespace webrtc 2004 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/aec3/aec3_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698