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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 | 295 |
296 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config) | 296 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config) |
297 : AudioProcessingImpl(config, nullptr) {} | 297 : AudioProcessingImpl(config, nullptr) {} |
298 | 298 |
299 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config, | 299 AudioProcessingImpl::AudioProcessingImpl(const webrtc::Config& config, |
300 NonlinearBeamformer* beamformer) | 300 NonlinearBeamformer* beamformer) |
301 : high_pass_filter_impl_(new HighPassFilterImpl(this)), | 301 : high_pass_filter_impl_(new HighPassFilterImpl(this)), |
302 public_submodules_(new ApmPublicSubmodules()), | 302 public_submodules_(new ApmPublicSubmodules()), |
303 private_submodules_(new ApmPrivateSubmodules(beamformer)), | 303 private_submodules_(new ApmPrivateSubmodules(beamformer)), |
304 constants_(config.Get<ExperimentalAgc>().startup_min_volume, | 304 constants_(config.Get<ExperimentalAgc>().startup_min_volume, |
305 config.Get<ExperimentalAgc>().clipped_level_min, | |
305 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 306 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
306 false), | 307 false), |
307 #else | 308 #else |
308 config.Get<ExperimentalAgc>().enabled), | 309 config.Get<ExperimentalAgc>().enabled), |
309 #endif | 310 #endif |
310 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) | 311 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS) |
311 capture_(false, | 312 capture_(false, |
312 #else | 313 #else |
313 capture_(config.Get<ExperimentalNs>().enabled, | 314 capture_(config.Get<ExperimentalNs>().enabled, |
314 #endif | 315 #endif |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
481 proc_split_sample_rate_hz(), num_reverse_channels(), | 482 proc_split_sample_rate_hz(), num_reverse_channels(), |
482 num_output_channels()); | 483 num_output_channels()); |
483 | 484 |
484 public_submodules_->gain_control->Initialize(num_proc_channels(), | 485 public_submodules_->gain_control->Initialize(num_proc_channels(), |
485 proc_sample_rate_hz()); | 486 proc_sample_rate_hz()); |
486 if (constants_.use_experimental_agc) { | 487 if (constants_.use_experimental_agc) { |
487 if (!private_submodules_->agc_manager.get()) { | 488 if (!private_submodules_->agc_manager.get()) { |
488 private_submodules_->agc_manager.reset(new AgcManagerDirect( | 489 private_submodules_->agc_manager.reset(new AgcManagerDirect( |
489 public_submodules_->gain_control.get(), | 490 public_submodules_->gain_control.get(), |
490 public_submodules_->gain_control_for_experimental_agc.get(), | 491 public_submodules_->gain_control_for_experimental_agc.get(), |
491 constants_.agc_startup_min_volume)); | 492 constants_.agc_startup_min_volume, constants_.agc_clipped_level_min)); |
492 } | 493 } |
493 private_submodules_->agc_manager->Initialize(); | 494 private_submodules_->agc_manager->Initialize(); |
494 private_submodules_->agc_manager->SetCaptureMuted( | 495 private_submodules_->agc_manager->SetCaptureMuted( |
495 capture_.output_will_be_muted); | 496 capture_.output_will_be_muted); |
496 public_submodules_->gain_control_for_experimental_agc->Initialize(); | 497 public_submodules_->gain_control_for_experimental_agc->Initialize(); |
497 } | 498 } |
498 InitializeTransient(); | 499 InitializeTransient(); |
499 InitializeBeamformer(); | 500 InitializeBeamformer(); |
500 #if WEBRTC_INTELLIGIBILITY_ENHANCER | 501 #if WEBRTC_INTELLIGIBILITY_ENHANCER |
501 InitializeIntelligibility(); | 502 InitializeIntelligibility(); |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1839 | 1840 |
1840 config.set_ns_enabled(public_submodules_->noise_suppression->is_enabled()); | 1841 config.set_ns_enabled(public_submodules_->noise_suppression->is_enabled()); |
1841 config.set_ns_level( | 1842 config.set_ns_level( |
1842 static_cast<int>(public_submodules_->noise_suppression->level())); | 1843 static_cast<int>(public_submodules_->noise_suppression->level())); |
1843 | 1844 |
1844 config.set_transient_suppression_enabled( | 1845 config.set_transient_suppression_enabled( |
1845 capture_.transient_suppressor_enabled); | 1846 capture_.transient_suppressor_enabled); |
1846 config.set_intelligibility_enhancer_enabled( | 1847 config.set_intelligibility_enhancer_enabled( |
1847 capture_nonlocked_.intelligibility_enabled); | 1848 capture_nonlocked_.intelligibility_enabled); |
1848 | 1849 |
1849 std::string experiments_description = | 1850 std::string experiments_description = |
peah-webrtc
2016/12/05 09:23:59
We should somehow store in APM recordings that thi
hlundin-webrtc
2016/12/05 15:01:11
Done.
| |
1850 public_submodules_->echo_cancellation->GetExperimentsDescription(); | 1851 public_submodules_->echo_cancellation->GetExperimentsDescription(); |
1851 // TODO(peah): Add semicolon-separated concatenations of experiment | 1852 // TODO(peah): Add semicolon-separated concatenations of experiment |
1852 // descriptions for other submodules. | 1853 // descriptions for other submodules. |
1853 if (capture_nonlocked_.level_controller_enabled) { | 1854 if (capture_nonlocked_.level_controller_enabled) { |
1854 experiments_description += "LevelController;"; | 1855 experiments_description += "LevelController;"; |
1855 } | 1856 } |
1856 config.set_experiments_description(experiments_description); | 1857 config.set_experiments_description(experiments_description); |
1857 | 1858 |
1858 std::string serialized_config = config.SerializeAsString(); | 1859 std::string serialized_config = config.SerializeAsString(); |
1859 if (!forced && | 1860 if (!forced && |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1891 capture_processing_format(kSampleRate16kHz), | 1892 capture_processing_format(kSampleRate16kHz), |
1892 split_rate(kSampleRate16kHz) {} | 1893 split_rate(kSampleRate16kHz) {} |
1893 | 1894 |
1894 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; | 1895 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; |
1895 | 1896 |
1896 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; | 1897 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; |
1897 | 1898 |
1898 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; | 1899 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; |
1899 | 1900 |
1900 } // namespace webrtc | 1901 } // namespace webrtc |
OLD | NEW |