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

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

Issue 1770823002: Removed the AudioProcessing dependency in EchoCancellerImpl (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@CleanUpAecImpl_CL
Patch Set: Created 4 years, 9 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
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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 708
709 if (capture_nonlocked_.beamformer_enabled) { 709 if (capture_nonlocked_.beamformer_enabled) {
710 private_submodules_->beamformer->ProcessChunk(*ca->split_data_f(), 710 private_submodules_->beamformer->ProcessChunk(*ca->split_data_f(),
711 ca->split_data_f()); 711 ca->split_data_f());
712 ca->set_num_channels(1); 712 ca->set_num_channels(1);
713 } 713 }
714 714
715 public_submodules_->high_pass_filter->ProcessCaptureAudio(ca); 715 public_submodules_->high_pass_filter->ProcessCaptureAudio(ca);
716 RETURN_ON_ERR(public_submodules_->gain_control->AnalyzeCaptureAudio(ca)); 716 RETURN_ON_ERR(public_submodules_->gain_control->AnalyzeCaptureAudio(ca));
717 public_submodules_->noise_suppression->AnalyzeCaptureAudio(ca); 717 public_submodules_->noise_suppression->AnalyzeCaptureAudio(ca);
718 RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio(ca)); 718
719 // Ensure that not both the AEC and AECM are active at the same time.
720 // TODO(peah): Simplify once the public API Enable functions for these
721 // are moved to APM.
722 RETURN_ON_ERR((public_submodules_->echo_cancellation->is_enabled() &&
hlundin-webrtc 2016/03/07 16:03:08 You don't have to use RETURN_ON_ERR here, since yo
peah-webrtc 2016/03/08 06:05:08 You are definitely right on that. It is just that
peah-webrtc 2016/03/08 06:05:08 Done.
hlundin-webrtc 2016/03/08 12:39:23 I think the code is nicer without the macro.
723 public_submodules_->echo_control_mobile->is_enabled()
724 ? AudioProcessing::kBadParameterError
725 : AudioProcessing::kNoError));
726
727 // Ensure that the stream delay was set before the call to the
728 // AEC ProcessCaptureAudio function.
729 RETURN_ON_ERR((was_stream_delay_set() ? AudioProcessing::kNoError
hlundin-webrtc 2016/03/07 16:03:08 Same as above.
peah-webrtc 2016/03/08 06:05:08 Done.
730 : AudioProcessing::kBadParameterError));
731
732 RETURN_ON_ERR(public_submodules_->echo_cancellation->ProcessCaptureAudio(
733 ca, stream_delay_ms()));
719 734
720 if (public_submodules_->echo_control_mobile->is_enabled() && 735 if (public_submodules_->echo_control_mobile->is_enabled() &&
721 public_submodules_->noise_suppression->is_enabled()) { 736 public_submodules_->noise_suppression->is_enabled()) {
722 ca->CopyLowPassToReference(); 737 ca->CopyLowPassToReference();
723 } 738 }
724 public_submodules_->noise_suppression->ProcessCaptureAudio(ca); 739 public_submodules_->noise_suppression->ProcessCaptureAudio(ca);
725 if (constants_.intelligibility_enabled) { 740 if (constants_.intelligibility_enabled) {
726 RTC_DCHECK(public_submodules_->noise_suppression->is_enabled()); 741 RTC_DCHECK(public_submodules_->noise_suppression->is_enabled());
727 public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate( 742 public_submodules_->intelligibility_enhancer->SetCaptureNoiseEstimate(
728 public_submodules_->noise_suppression->NoiseEstimate()); 743 public_submodules_->noise_suppression->NoiseEstimate());
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 public_submodules_->high_pass_filter->Initialize(num_proc_channels(), 1259 public_submodules_->high_pass_filter->Initialize(num_proc_channels(),
1245 proc_sample_rate_hz()); 1260 proc_sample_rate_hz());
1246 } 1261 }
1247 1262
1248 void AudioProcessingImpl::InitializeNoiseSuppression() { 1263 void AudioProcessingImpl::InitializeNoiseSuppression() {
1249 public_submodules_->noise_suppression->Initialize(num_proc_channels(), 1264 public_submodules_->noise_suppression->Initialize(num_proc_channels(),
1250 proc_sample_rate_hz()); 1265 proc_sample_rate_hz());
1251 } 1266 }
1252 1267
1253 void AudioProcessingImpl::InitializeEchoCanceller() { 1268 void AudioProcessingImpl::InitializeEchoCanceller() {
1254 public_submodules_->echo_cancellation->Initialize(); 1269 public_submodules_->echo_cancellation->Initialize(
1270 proc_sample_rate_hz(), num_reverse_channels(), num_output_channels(),
1271 num_proc_channels());
1255 } 1272 }
1256 1273
1257 void AudioProcessingImpl::InitializeLevelEstimator() { 1274 void AudioProcessingImpl::InitializeLevelEstimator() {
1258 public_submodules_->level_estimator->Initialize(); 1275 public_submodules_->level_estimator->Initialize();
1259 } 1276 }
1260 1277
1261 void AudioProcessingImpl::InitializeVoiceDetection() { 1278 void AudioProcessingImpl::InitializeVoiceDetection() {
1262 public_submodules_->voice_detection->Initialize(proc_split_sample_rate_hz()); 1279 public_submodules_->voice_detection->Initialize(proc_split_sample_rate_hz());
1263 } 1280 }
1264 1281
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); 1474 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config);
1458 1475
1459 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), 1476 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(),
1460 &debug_dump_.num_bytes_left_for_log_, 1477 &debug_dump_.num_bytes_left_for_log_,
1461 &crit_debug_, &debug_dump_.capture)); 1478 &crit_debug_, &debug_dump_.capture));
1462 return kNoError; 1479 return kNoError;
1463 } 1480 }
1464 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP 1481 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
1465 1482
1466 } // namespace webrtc 1483 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698