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 16 matching lines...) Expand all Loading... |
27 #include "webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h" | 27 #include "webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h" |
28 #include "webrtc/modules/audio_processing/common.h" | 28 #include "webrtc/modules/audio_processing/common.h" |
29 #include "webrtc/modules/audio_processing/echo_cancellation_impl.h" | 29 #include "webrtc/modules/audio_processing/echo_cancellation_impl.h" |
30 #include "webrtc/modules/audio_processing/echo_control_mobile_impl.h" | 30 #include "webrtc/modules/audio_processing/echo_control_mobile_impl.h" |
31 #include "webrtc/modules/audio_processing/gain_control_impl.h" | 31 #include "webrtc/modules/audio_processing/gain_control_impl.h" |
32 #include "webrtc/modules/audio_processing/high_pass_filter_impl.h" | 32 #include "webrtc/modules/audio_processing/high_pass_filter_impl.h" |
33 #include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhanc
er.h" | 33 #include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhanc
er.h" |
34 #include "webrtc/modules/audio_processing/level_estimator_impl.h" | 34 #include "webrtc/modules/audio_processing/level_estimator_impl.h" |
35 #include "webrtc/modules/audio_processing/noise_suppression_impl.h" | 35 #include "webrtc/modules/audio_processing/noise_suppression_impl.h" |
36 #include "webrtc/modules/audio_processing/processing_component.h" | 36 #include "webrtc/modules/audio_processing/processing_component.h" |
| 37 #include "webrtc/modules/audio_processing/repetition_detector.h" |
37 #include "webrtc/modules/audio_processing/transient/transient_suppressor.h" | 38 #include "webrtc/modules/audio_processing/transient/transient_suppressor.h" |
38 #include "webrtc/modules/audio_processing/voice_detection_impl.h" | 39 #include "webrtc/modules/audio_processing/voice_detection_impl.h" |
39 #include "webrtc/modules/interface/module_common_types.h" | 40 #include "webrtc/modules/interface/module_common_types.h" |
40 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 41 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
41 #include "webrtc/system_wrappers/interface/file_wrapper.h" | 42 #include "webrtc/system_wrappers/interface/file_wrapper.h" |
42 #include "webrtc/system_wrappers/interface/logging.h" | 43 #include "webrtc/system_wrappers/interface/logging.h" |
43 #include "webrtc/system_wrappers/interface/metrics.h" | 44 #include "webrtc/system_wrappers/interface/metrics.h" |
44 | 45 |
45 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP | 46 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
46 // Files generated at build-time by the protobuf compiler. | 47 // Files generated at build-time by the protobuf compiler. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 #endif | 208 #endif |
208 agc_startup_min_volume_(config.Get<ExperimentalAgc>().startup_min_volume), | 209 agc_startup_min_volume_(config.Get<ExperimentalAgc>().startup_min_volume), |
209 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 210 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
210 transient_suppressor_enabled_(false), | 211 transient_suppressor_enabled_(false), |
211 #else | 212 #else |
212 transient_suppressor_enabled_(config.Get<ExperimentalNs>().enabled), | 213 transient_suppressor_enabled_(config.Get<ExperimentalNs>().enabled), |
213 #endif | 214 #endif |
214 beamformer_enabled_(config.Get<Beamforming>().enabled), | 215 beamformer_enabled_(config.Get<Beamforming>().enabled), |
215 beamformer_(beamformer), | 216 beamformer_(beamformer), |
216 array_geometry_(config.Get<Beamforming>().array_geometry), | 217 array_geometry_(config.Get<Beamforming>().array_geometry), |
| 218 repetition_detector_(new RepetitionDetector()), |
217 intelligibility_enabled_(config.Get<Intelligibility>().enabled) { | 219 intelligibility_enabled_(config.Get<Intelligibility>().enabled) { |
218 echo_cancellation_ = new EchoCancellationImpl(this, crit_); | 220 echo_cancellation_ = new EchoCancellationImpl(this, crit_); |
219 component_list_.push_back(echo_cancellation_); | 221 component_list_.push_back(echo_cancellation_); |
220 | 222 |
221 echo_control_mobile_ = new EchoControlMobileImpl(this, crit_); | 223 echo_control_mobile_ = new EchoControlMobileImpl(this, crit_); |
222 component_list_.push_back(echo_control_mobile_); | 224 component_list_.push_back(echo_control_mobile_); |
223 | 225 |
224 gain_control_ = new GainControlImpl(this, crit_); | 226 gain_control_ = new GainControlImpl(this, crit_); |
225 component_list_.push_back(gain_control_); | 227 component_list_.push_back(gain_control_); |
226 | 228 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); | 525 input_stream.set_has_keyboard(LayoutHasKeyboard(input_layout)); |
524 | 526 |
525 StreamConfig output_stream = api_format_.output_stream(); | 527 StreamConfig output_stream = api_format_.output_stream(); |
526 output_stream.set_sample_rate_hz(output_sample_rate_hz); | 528 output_stream.set_sample_rate_hz(output_sample_rate_hz); |
527 output_stream.set_num_channels(ChannelsFromLayout(output_layout)); | 529 output_stream.set_num_channels(ChannelsFromLayout(output_layout)); |
528 output_stream.set_has_keyboard(LayoutHasKeyboard(output_layout)); | 530 output_stream.set_has_keyboard(LayoutHasKeyboard(output_layout)); |
529 | 531 |
530 if (samples_per_channel != input_stream.num_frames()) { | 532 if (samples_per_channel != input_stream.num_frames()) { |
531 return kBadDataLengthError; | 533 return kBadDataLengthError; |
532 } | 534 } |
| 535 |
| 536 // Check only one channel. |
| 537 repetition_detector_->Detect(src[0], samples_per_channel, 1, |
| 538 input_sample_rate_hz); |
| 539 |
533 return ProcessStream(src, input_stream, output_stream, dest); | 540 return ProcessStream(src, input_stream, output_stream, dest); |
534 } | 541 } |
535 | 542 |
536 int AudioProcessingImpl::ProcessStream(const float* const* src, | 543 int AudioProcessingImpl::ProcessStream(const float* const* src, |
537 const StreamConfig& input_config, | 544 const StreamConfig& input_config, |
538 const StreamConfig& output_config, | 545 const StreamConfig& output_config, |
539 float* const* dest) { | 546 float* const* dest) { |
540 CriticalSectionScoped crit_scoped(crit_); | 547 CriticalSectionScoped crit_scoped(crit_); |
541 if (!src || !dest) { | 548 if (!src || !dest) { |
542 return kNullPointerError; | 549 return kNullPointerError; |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 int err = WriteMessageToDebugFile(); | 1249 int err = WriteMessageToDebugFile(); |
1243 if (err != kNoError) { | 1250 if (err != kNoError) { |
1244 return err; | 1251 return err; |
1245 } | 1252 } |
1246 | 1253 |
1247 return kNoError; | 1254 return kNoError; |
1248 } | 1255 } |
1249 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1256 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1250 | 1257 |
1251 } // namespace webrtc | 1258 } // namespace webrtc |
OLD | NEW |