OLD | NEW |
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 { | 165 { |
166 { | 166 { |
167 rtc::CritScope cs_render(&crit_render_); | 167 rtc::CritScope cs_render(&crit_render_); |
168 rtc::CritScope cs_capture(&crit_capture_); | 168 rtc::CritScope cs_capture(&crit_capture_); |
169 | 169 |
170 public_submodules_->echo_cancellation.reset( | 170 public_submodules_->echo_cancellation.reset( |
171 new EchoCancellationImpl(this, &crit_render_, &crit_capture_)); | 171 new EchoCancellationImpl(this, &crit_render_, &crit_capture_)); |
172 public_submodules_->echo_control_mobile.reset( | 172 public_submodules_->echo_control_mobile.reset( |
173 new EchoControlMobileImpl(this, &crit_render_, &crit_capture_)); | 173 new EchoControlMobileImpl(this, &crit_render_, &crit_capture_)); |
174 public_submodules_->gain_control.reset( | 174 public_submodules_->gain_control.reset( |
175 new GainControlImpl(this, &crit_capture_, &crit_capture_)); | 175 new GainControlImpl(&crit_capture_, &crit_capture_)); |
176 public_submodules_->high_pass_filter.reset( | 176 public_submodules_->high_pass_filter.reset( |
177 new HighPassFilterImpl(&crit_capture_)); | 177 new HighPassFilterImpl(&crit_capture_)); |
178 public_submodules_->level_estimator.reset( | 178 public_submodules_->level_estimator.reset( |
179 new LevelEstimatorImpl(&crit_capture_)); | 179 new LevelEstimatorImpl(&crit_capture_)); |
180 public_submodules_->noise_suppression.reset( | 180 public_submodules_->noise_suppression.reset( |
181 new NoiseSuppressionImpl(&crit_capture_)); | 181 new NoiseSuppressionImpl(&crit_capture_)); |
182 public_submodules_->voice_detection.reset( | 182 public_submodules_->voice_detection.reset( |
183 new VoiceDetectionImpl(&crit_capture_)); | 183 new VoiceDetectionImpl(&crit_capture_)); |
184 public_submodules_->gain_control_for_experimental_agc.reset( | 184 public_submodules_->gain_control_for_experimental_agc.reset( |
185 new GainControlForExperimentalAgc( | 185 new GainControlForExperimentalAgc( |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 public_submodules_->voice_detection->ProcessCaptureAudio(ca); | 711 public_submodules_->voice_detection->ProcessCaptureAudio(ca); |
712 | 712 |
713 if (constants_.use_experimental_agc && | 713 if (constants_.use_experimental_agc && |
714 public_submodules_->gain_control->is_enabled() && | 714 public_submodules_->gain_control->is_enabled() && |
715 (!capture_nonlocked_.beamformer_enabled || | 715 (!capture_nonlocked_.beamformer_enabled || |
716 private_submodules_->beamformer->is_target_present())) { | 716 private_submodules_->beamformer->is_target_present())) { |
717 private_submodules_->agc_manager->Process( | 717 private_submodules_->agc_manager->Process( |
718 ca->split_bands_const(0)[kBand0To8kHz], ca->num_frames_per_band(), | 718 ca->split_bands_const(0)[kBand0To8kHz], ca->num_frames_per_band(), |
719 capture_nonlocked_.split_rate); | 719 capture_nonlocked_.split_rate); |
720 } | 720 } |
721 RETURN_ON_ERR(public_submodules_->gain_control->ProcessCaptureAudio(ca)); | 721 RETURN_ON_ERR(public_submodules_->gain_control->ProcessCaptureAudio( |
| 722 ca, echo_cancellation()->stream_has_echo())); |
722 | 723 |
723 if (synthesis_needed(data_processed)) { | 724 if (synthesis_needed(data_processed)) { |
724 ca->MergeFrequencyBands(); | 725 ca->MergeFrequencyBands(); |
725 } | 726 } |
726 | 727 |
727 // TODO(aluebs): Investigate if the transient suppression placement should be | 728 // TODO(aluebs): Investigate if the transient suppression placement should be |
728 // before or after the AGC. | 729 // before or after the AGC. |
729 if (capture_.transient_suppressor_enabled) { | 730 if (capture_.transient_suppressor_enabled) { |
730 float voice_probability = | 731 float voice_probability = |
731 private_submodules_->agc_manager.get() | 732 private_submodules_->agc_manager.get() |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 void AudioProcessingImpl::InitializeNoiseSuppression() { | 1215 void AudioProcessingImpl::InitializeNoiseSuppression() { |
1215 public_submodules_->noise_suppression->Initialize(num_proc_channels(), | 1216 public_submodules_->noise_suppression->Initialize(num_proc_channels(), |
1216 proc_sample_rate_hz()); | 1217 proc_sample_rate_hz()); |
1217 } | 1218 } |
1218 | 1219 |
1219 void AudioProcessingImpl::InitializeEchoCanceller() { | 1220 void AudioProcessingImpl::InitializeEchoCanceller() { |
1220 public_submodules_->echo_cancellation->Initialize(); | 1221 public_submodules_->echo_cancellation->Initialize(); |
1221 } | 1222 } |
1222 | 1223 |
1223 void AudioProcessingImpl::InitializeGainController() { | 1224 void AudioProcessingImpl::InitializeGainController() { |
1224 public_submodules_->gain_control->Initialize(); | 1225 public_submodules_->gain_control->Initialize(num_proc_channels(), |
| 1226 proc_sample_rate_hz()); |
1225 } | 1227 } |
1226 | 1228 |
1227 void AudioProcessingImpl::InitializeEchoControlMobile() { | 1229 void AudioProcessingImpl::InitializeEchoControlMobile() { |
1228 public_submodules_->echo_control_mobile->Initialize(); | 1230 public_submodules_->echo_control_mobile->Initialize(); |
1229 } | 1231 } |
1230 | 1232 |
1231 void AudioProcessingImpl::InitializeLevelEstimator() { | 1233 void AudioProcessingImpl::InitializeLevelEstimator() { |
1232 public_submodules_->level_estimator->Initialize(); | 1234 public_submodules_->level_estimator->Initialize(); |
1233 } | 1235 } |
1234 | 1236 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1430 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1432 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
1431 | 1433 |
1432 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1434 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
1433 &debug_dump_.num_bytes_left_for_log_, | 1435 &debug_dump_.num_bytes_left_for_log_, |
1434 &crit_debug_, &debug_dump_.capture)); | 1436 &crit_debug_, &debug_dump_.capture)); |
1435 return kNoError; | 1437 return kNoError; |
1436 } | 1438 } |
1437 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1439 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1438 | 1440 |
1439 } // namespace webrtc | 1441 } // namespace webrtc |
OLD | NEW |