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 |
11 #include "webrtc/modules/audio_processing/audio_processing_impl.h" | 11 #include "webrtc/modules/audio_processing/audio_processing_impl.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 #include <algorithm> | 14 #include <algorithm> |
| 15 #include <string> |
15 | 16 |
16 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/platform_file.h" | 19 #include "webrtc/base/platform_file.h" |
19 #include "webrtc/base/trace_event.h" | 20 #include "webrtc/base/trace_event.h" |
20 #include "webrtc/common_audio/audio_converter.h" | 21 #include "webrtc/common_audio/audio_converter.h" |
21 #include "webrtc/common_audio/channel_buffer.h" | 22 #include "webrtc/common_audio/channel_buffer.h" |
22 #include "webrtc/common_audio/include/audio_util.h" | 23 #include "webrtc/common_audio/include/audio_util.h" |
23 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 24 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
24 #include "webrtc/modules/audio_processing/aec/aec_core.h" | 25 #include "webrtc/modules/audio_processing/aec/aec_core.h" |
25 #include "webrtc/modules/audio_processing/aec3/echo_canceller3.h" | 26 #include "webrtc/modules/audio_processing/aec3/echo_canceller3.h" |
| 27 #include "webrtc/modules/audio_processing/agc2/gain_controller2.h" |
26 #include "webrtc/modules/audio_processing/agc/agc_manager_direct.h" | 28 #include "webrtc/modules/audio_processing/agc/agc_manager_direct.h" |
27 #include "webrtc/modules/audio_processing/audio_buffer.h" | 29 #include "webrtc/modules/audio_processing/audio_buffer.h" |
28 #include "webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h" | 30 #include "webrtc/modules/audio_processing/beamformer/nonlinear_beamformer.h" |
29 #include "webrtc/modules/audio_processing/common.h" | 31 #include "webrtc/modules/audio_processing/common.h" |
30 #include "webrtc/modules/audio_processing/echo_cancellation_impl.h" | 32 #include "webrtc/modules/audio_processing/echo_cancellation_impl.h" |
31 #include "webrtc/modules/audio_processing/echo_control_mobile_impl.h" | 33 #include "webrtc/modules/audio_processing/echo_control_mobile_impl.h" |
32 #include "webrtc/modules/audio_processing/gain_control_for_experimental_agc.h" | 34 #include "webrtc/modules/audio_processing/gain_control_for_experimental_agc.h" |
33 #include "webrtc/modules/audio_processing/gain_control_impl.h" | 35 #include "webrtc/modules/audio_processing/gain_control_impl.h" |
34 #if WEBRTC_INTELLIGIBILITY_ENHANCER | 36 #if WEBRTC_INTELLIGIBILITY_ENHANCER |
35 #include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhanc
er.h" | 37 #include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhanc
er.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 166 |
165 bool AudioProcessingImpl::ApmSubmoduleStates::Update( | 167 bool AudioProcessingImpl::ApmSubmoduleStates::Update( |
166 bool low_cut_filter_enabled, | 168 bool low_cut_filter_enabled, |
167 bool echo_canceller_enabled, | 169 bool echo_canceller_enabled, |
168 bool mobile_echo_controller_enabled, | 170 bool mobile_echo_controller_enabled, |
169 bool residual_echo_detector_enabled, | 171 bool residual_echo_detector_enabled, |
170 bool noise_suppressor_enabled, | 172 bool noise_suppressor_enabled, |
171 bool intelligibility_enhancer_enabled, | 173 bool intelligibility_enhancer_enabled, |
172 bool beamformer_enabled, | 174 bool beamformer_enabled, |
173 bool adaptive_gain_controller_enabled, | 175 bool adaptive_gain_controller_enabled, |
| 176 bool gain_controller2_enabled, |
174 bool level_controller_enabled, | 177 bool level_controller_enabled, |
175 bool echo_canceller3_enabled, | 178 bool echo_canceller3_enabled, |
176 bool voice_activity_detector_enabled, | 179 bool voice_activity_detector_enabled, |
177 bool level_estimator_enabled, | 180 bool level_estimator_enabled, |
178 bool transient_suppressor_enabled) { | 181 bool transient_suppressor_enabled) { |
179 bool changed = false; | 182 bool changed = false; |
180 changed |= (low_cut_filter_enabled != low_cut_filter_enabled_); | 183 changed |= (low_cut_filter_enabled != low_cut_filter_enabled_); |
181 changed |= (echo_canceller_enabled != echo_canceller_enabled_); | 184 changed |= (echo_canceller_enabled != echo_canceller_enabled_); |
182 changed |= | 185 changed |= |
183 (mobile_echo_controller_enabled != mobile_echo_controller_enabled_); | 186 (mobile_echo_controller_enabled != mobile_echo_controller_enabled_); |
184 changed |= | 187 changed |= |
185 (residual_echo_detector_enabled != residual_echo_detector_enabled_); | 188 (residual_echo_detector_enabled != residual_echo_detector_enabled_); |
186 changed |= (noise_suppressor_enabled != noise_suppressor_enabled_); | 189 changed |= (noise_suppressor_enabled != noise_suppressor_enabled_); |
187 changed |= | 190 changed |= |
188 (intelligibility_enhancer_enabled != intelligibility_enhancer_enabled_); | 191 (intelligibility_enhancer_enabled != intelligibility_enhancer_enabled_); |
189 changed |= (beamformer_enabled != beamformer_enabled_); | 192 changed |= (beamformer_enabled != beamformer_enabled_); |
190 changed |= | 193 changed |= |
191 (adaptive_gain_controller_enabled != adaptive_gain_controller_enabled_); | 194 (adaptive_gain_controller_enabled != adaptive_gain_controller_enabled_); |
| 195 changed |= |
| 196 (gain_controller2_enabled != gain_controller2_enabled_); |
192 changed |= (level_controller_enabled != level_controller_enabled_); | 197 changed |= (level_controller_enabled != level_controller_enabled_); |
193 changed |= (echo_canceller3_enabled != echo_canceller3_enabled_); | 198 changed |= (echo_canceller3_enabled != echo_canceller3_enabled_); |
194 changed |= (level_estimator_enabled != level_estimator_enabled_); | 199 changed |= (level_estimator_enabled != level_estimator_enabled_); |
195 changed |= | 200 changed |= |
196 (voice_activity_detector_enabled != voice_activity_detector_enabled_); | 201 (voice_activity_detector_enabled != voice_activity_detector_enabled_); |
197 changed |= (transient_suppressor_enabled != transient_suppressor_enabled_); | 202 changed |= (transient_suppressor_enabled != transient_suppressor_enabled_); |
198 if (changed) { | 203 if (changed) { |
199 low_cut_filter_enabled_ = low_cut_filter_enabled; | 204 low_cut_filter_enabled_ = low_cut_filter_enabled; |
200 echo_canceller_enabled_ = echo_canceller_enabled; | 205 echo_canceller_enabled_ = echo_canceller_enabled; |
201 mobile_echo_controller_enabled_ = mobile_echo_controller_enabled; | 206 mobile_echo_controller_enabled_ = mobile_echo_controller_enabled; |
202 residual_echo_detector_enabled_ = residual_echo_detector_enabled; | 207 residual_echo_detector_enabled_ = residual_echo_detector_enabled; |
203 noise_suppressor_enabled_ = noise_suppressor_enabled; | 208 noise_suppressor_enabled_ = noise_suppressor_enabled; |
204 intelligibility_enhancer_enabled_ = intelligibility_enhancer_enabled; | 209 intelligibility_enhancer_enabled_ = intelligibility_enhancer_enabled; |
205 beamformer_enabled_ = beamformer_enabled; | 210 beamformer_enabled_ = beamformer_enabled; |
206 adaptive_gain_controller_enabled_ = adaptive_gain_controller_enabled; | 211 adaptive_gain_controller_enabled_ = adaptive_gain_controller_enabled; |
| 212 gain_controller2_enabled_ = gain_controller2_enabled; |
207 level_controller_enabled_ = level_controller_enabled; | 213 level_controller_enabled_ = level_controller_enabled; |
208 echo_canceller3_enabled_ = echo_canceller3_enabled; | 214 echo_canceller3_enabled_ = echo_canceller3_enabled; |
209 level_estimator_enabled_ = level_estimator_enabled; | 215 level_estimator_enabled_ = level_estimator_enabled; |
210 voice_activity_detector_enabled_ = voice_activity_detector_enabled; | 216 voice_activity_detector_enabled_ = voice_activity_detector_enabled; |
211 transient_suppressor_enabled_ = transient_suppressor_enabled; | 217 transient_suppressor_enabled_ = transient_suppressor_enabled; |
212 } | 218 } |
213 | 219 |
214 changed |= first_update_; | 220 changed |= first_update_; |
215 first_update_ = false; | 221 first_update_ = false; |
216 return changed; | 222 return changed; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 std::unique_ptr<IntelligibilityEnhancer> intelligibility_enhancer; | 276 std::unique_ptr<IntelligibilityEnhancer> intelligibility_enhancer; |
271 #endif | 277 #endif |
272 }; | 278 }; |
273 | 279 |
274 struct AudioProcessingImpl::ApmPrivateSubmodules { | 280 struct AudioProcessingImpl::ApmPrivateSubmodules { |
275 explicit ApmPrivateSubmodules(NonlinearBeamformer* beamformer) | 281 explicit ApmPrivateSubmodules(NonlinearBeamformer* beamformer) |
276 : beamformer(beamformer) {} | 282 : beamformer(beamformer) {} |
277 // Accessed internally from capture or during initialization | 283 // Accessed internally from capture or during initialization |
278 std::unique_ptr<NonlinearBeamformer> beamformer; | 284 std::unique_ptr<NonlinearBeamformer> beamformer; |
279 std::unique_ptr<AgcManagerDirect> agc_manager; | 285 std::unique_ptr<AgcManagerDirect> agc_manager; |
| 286 std::unique_ptr<GainController2> gain_controller2; |
280 std::unique_ptr<LowCutFilter> low_cut_filter; | 287 std::unique_ptr<LowCutFilter> low_cut_filter; |
281 std::unique_ptr<LevelController> level_controller; | 288 std::unique_ptr<LevelController> level_controller; |
282 std::unique_ptr<ResidualEchoDetector> residual_echo_detector; | 289 std::unique_ptr<ResidualEchoDetector> residual_echo_detector; |
283 std::unique_ptr<EchoCanceller3> echo_canceller3; | 290 std::unique_ptr<EchoCanceller3> echo_canceller3; |
284 }; | 291 }; |
285 | 292 |
286 AudioProcessing* AudioProcessing::Create() { | 293 AudioProcessing* AudioProcessing::Create() { |
287 webrtc::Config config; | 294 webrtc::Config config; |
288 return Create(config, nullptr); | 295 return Create(config, nullptr); |
289 } | 296 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 InitializeIntelligibility(); | 520 InitializeIntelligibility(); |
514 #endif | 521 #endif |
515 InitializeLowCutFilter(); | 522 InitializeLowCutFilter(); |
516 public_submodules_->noise_suppression->Initialize(num_proc_channels(), | 523 public_submodules_->noise_suppression->Initialize(num_proc_channels(), |
517 proc_sample_rate_hz()); | 524 proc_sample_rate_hz()); |
518 public_submodules_->voice_detection->Initialize(proc_split_sample_rate_hz()); | 525 public_submodules_->voice_detection->Initialize(proc_split_sample_rate_hz()); |
519 public_submodules_->level_estimator->Initialize(); | 526 public_submodules_->level_estimator->Initialize(); |
520 InitializeLevelController(); | 527 InitializeLevelController(); |
521 InitializeResidualEchoDetector(); | 528 InitializeResidualEchoDetector(); |
522 InitializeEchoCanceller3(); | 529 InitializeEchoCanceller3(); |
| 530 InitializeGainController2(); |
523 | 531 |
524 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP | 532 #ifdef WEBRTC_AUDIOPROC_DEBUG_DUMP |
525 if (debug_dump_.debug_file->is_open()) { | 533 if (debug_dump_.debug_file->is_open()) { |
526 int err = WriteInitMessage(); | 534 int err = WriteInitMessage(); |
527 if (err != kNoError) { | 535 if (err != kNoError) { |
528 return err; | 536 return err; |
529 } | 537 } |
530 } | 538 } |
531 #endif | 539 #endif |
532 | 540 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 } | 669 } |
662 | 670 |
663 if (config.echo_canceller3.enabled != | 671 if (config.echo_canceller3.enabled != |
664 capture_nonlocked_.echo_canceller3_enabled) { | 672 capture_nonlocked_.echo_canceller3_enabled) { |
665 capture_nonlocked_.echo_canceller3_enabled = | 673 capture_nonlocked_.echo_canceller3_enabled = |
666 config_.echo_canceller3.enabled; | 674 config_.echo_canceller3.enabled; |
667 InitializeEchoCanceller3(); | 675 InitializeEchoCanceller3(); |
668 LOG(LS_INFO) << "Echo canceller 3 activated: " | 676 LOG(LS_INFO) << "Echo canceller 3 activated: " |
669 << capture_nonlocked_.echo_canceller3_enabled; | 677 << capture_nonlocked_.echo_canceller3_enabled; |
670 } | 678 } |
| 679 |
| 680 config_ok = GainController2::Validate(config_.gain_controller2); |
| 681 if (!config_ok) { |
| 682 LOG(LS_ERROR) << "AudioProcessing module config error" << std::endl |
| 683 << "gain_controller2: " |
| 684 << GainController2::ToString(config_.gain_controller2) |
| 685 << std::endl |
| 686 << "Reverting to default parameter set"; |
| 687 config_.gain_controller2 = AudioProcessing::Config::GainController2(); |
| 688 } |
| 689 |
| 690 if (config.gain_controller2.enabled != |
| 691 capture_nonlocked_.gain_controller2_enabled) { |
| 692 capture_nonlocked_.gain_controller2_enabled = |
| 693 config_.gain_controller2.enabled; |
| 694 InitializeGainController2(); |
| 695 LOG(LS_INFO) << "Gain controller 2 activated: " |
| 696 << capture_nonlocked_.gain_controller2_enabled; |
| 697 } |
671 } | 698 } |
672 | 699 |
673 void AudioProcessingImpl::SetExtraOptions(const webrtc::Config& config) { | 700 void AudioProcessingImpl::SetExtraOptions(const webrtc::Config& config) { |
674 // Run in a single-threaded manner when setting the extra options. | 701 // Run in a single-threaded manner when setting the extra options. |
675 rtc::CritScope cs_render(&crit_render_); | 702 rtc::CritScope cs_render(&crit_render_); |
676 rtc::CritScope cs_capture(&crit_capture_); | 703 rtc::CritScope cs_capture(&crit_capture_); |
677 | 704 |
678 public_submodules_->echo_cancellation->SetExtraOptions(config); | 705 public_submodules_->echo_cancellation->SetExtraOptions(config); |
679 | 706 |
680 if (capture_.transient_suppressor_enabled != | 707 if (capture_.transient_suppressor_enabled != |
681 config.Get<ExperimentalNs>().enabled) { | 708 config.Get<ExperimentalNs>().enabled) { |
682 capture_.transient_suppressor_enabled = | 709 capture_.transient_suppressor_enabled = |
683 config.Get<ExperimentalNs>().enabled; | 710 config.Get<ExperimentalNs>().enabled; |
684 InitializeTransient(); | 711 InitializeTransient(); |
685 } | 712 } |
686 | 713 |
687 #if WEBRTC_INTELLIGIBILITY_ENHANCER | 714 #if WEBRTC_INTELLIGIBILITY_ENHANCER |
688 if(capture_nonlocked_.intelligibility_enabled != | 715 if (capture_nonlocked_.intelligibility_enabled != |
689 config.Get<Intelligibility>().enabled) { | 716 config.Get<Intelligibility>().enabled) { |
690 capture_nonlocked_.intelligibility_enabled = | 717 capture_nonlocked_.intelligibility_enabled = |
691 config.Get<Intelligibility>().enabled; | 718 config.Get<Intelligibility>().enabled; |
692 InitializeIntelligibility(); | 719 InitializeIntelligibility(); |
693 } | 720 } |
694 #endif | 721 #endif |
695 | 722 |
696 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 723 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
697 if (capture_nonlocked_.beamformer_enabled != | 724 if (capture_nonlocked_.beamformer_enabled != |
698 config.Get<Beamforming>().enabled) { | 725 config.Get<Beamforming>().enabled) { |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 | 1310 |
1284 public_submodules_->transient_suppressor->Suppress( | 1311 public_submodules_->transient_suppressor->Suppress( |
1285 capture_buffer->channels_f()[0], capture_buffer->num_frames(), | 1312 capture_buffer->channels_f()[0], capture_buffer->num_frames(), |
1286 capture_buffer->num_channels(), | 1313 capture_buffer->num_channels(), |
1287 capture_buffer->split_bands_const_f(0)[kBand0To8kHz], | 1314 capture_buffer->split_bands_const_f(0)[kBand0To8kHz], |
1288 capture_buffer->num_frames_per_band(), capture_buffer->keyboard_data(), | 1315 capture_buffer->num_frames_per_band(), capture_buffer->keyboard_data(), |
1289 capture_buffer->num_keyboard_frames(), voice_probability, | 1316 capture_buffer->num_keyboard_frames(), voice_probability, |
1290 capture_.key_pressed); | 1317 capture_.key_pressed); |
1291 } | 1318 } |
1292 | 1319 |
| 1320 if (capture_nonlocked_.gain_controller2_enabled) { |
| 1321 private_submodules_->gain_controller2->Process(capture_buffer); |
| 1322 } |
| 1323 |
1293 if (capture_nonlocked_.level_controller_enabled) { | 1324 if (capture_nonlocked_.level_controller_enabled) { |
1294 private_submodules_->level_controller->Process(capture_buffer); | 1325 private_submodules_->level_controller->Process(capture_buffer); |
1295 } | 1326 } |
1296 | 1327 |
1297 // The level estimator operates on the recombined data. | 1328 // The level estimator operates on the recombined data. |
1298 public_submodules_->level_estimator->ProcessStream(capture_buffer); | 1329 public_submodules_->level_estimator->ProcessStream(capture_buffer); |
1299 | 1330 |
1300 capture_output_rms_.Analyze(rtc::ArrayView<const int16_t>( | 1331 capture_output_rms_.Analyze(rtc::ArrayView<const int16_t>( |
1301 capture_buffer->channels_const()[0], | 1332 capture_buffer->channels_const()[0], |
1302 capture_nonlocked_.capture_processing_format.num_frames())); | 1333 capture_nonlocked_.capture_processing_format.num_frames())); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 bool AudioProcessingImpl::UpdateActiveSubmoduleStates() { | 1732 bool AudioProcessingImpl::UpdateActiveSubmoduleStates() { |
1702 return submodule_states_.Update( | 1733 return submodule_states_.Update( |
1703 config_.high_pass_filter.enabled, | 1734 config_.high_pass_filter.enabled, |
1704 public_submodules_->echo_cancellation->is_enabled(), | 1735 public_submodules_->echo_cancellation->is_enabled(), |
1705 public_submodules_->echo_control_mobile->is_enabled(), | 1736 public_submodules_->echo_control_mobile->is_enabled(), |
1706 config_.residual_echo_detector.enabled, | 1737 config_.residual_echo_detector.enabled, |
1707 public_submodules_->noise_suppression->is_enabled(), | 1738 public_submodules_->noise_suppression->is_enabled(), |
1708 capture_nonlocked_.intelligibility_enabled, | 1739 capture_nonlocked_.intelligibility_enabled, |
1709 capture_nonlocked_.beamformer_enabled, | 1740 capture_nonlocked_.beamformer_enabled, |
1710 public_submodules_->gain_control->is_enabled(), | 1741 public_submodules_->gain_control->is_enabled(), |
| 1742 capture_nonlocked_.gain_controller2_enabled, |
1711 capture_nonlocked_.level_controller_enabled, | 1743 capture_nonlocked_.level_controller_enabled, |
1712 capture_nonlocked_.echo_canceller3_enabled, | 1744 capture_nonlocked_.echo_canceller3_enabled, |
1713 public_submodules_->voice_detection->is_enabled(), | 1745 public_submodules_->voice_detection->is_enabled(), |
1714 public_submodules_->level_estimator->is_enabled(), | 1746 public_submodules_->level_estimator->is_enabled(), |
1715 capture_.transient_suppressor_enabled); | 1747 capture_.transient_suppressor_enabled); |
1716 } | 1748 } |
1717 | 1749 |
1718 | 1750 |
1719 void AudioProcessingImpl::InitializeTransient() { | 1751 void AudioProcessingImpl::InitializeTransient() { |
1720 if (capture_.transient_suppressor_enabled) { | 1752 if (capture_.transient_suppressor_enabled) { |
(...skipping 30 matching lines...) Expand all Loading... |
1751 } | 1783 } |
1752 | 1784 |
1753 void AudioProcessingImpl::InitializeLowCutFilter() { | 1785 void AudioProcessingImpl::InitializeLowCutFilter() { |
1754 if (config_.high_pass_filter.enabled) { | 1786 if (config_.high_pass_filter.enabled) { |
1755 private_submodules_->low_cut_filter.reset( | 1787 private_submodules_->low_cut_filter.reset( |
1756 new LowCutFilter(num_proc_channels(), proc_sample_rate_hz())); | 1788 new LowCutFilter(num_proc_channels(), proc_sample_rate_hz())); |
1757 } else { | 1789 } else { |
1758 private_submodules_->low_cut_filter.reset(); | 1790 private_submodules_->low_cut_filter.reset(); |
1759 } | 1791 } |
1760 } | 1792 } |
| 1793 |
1761 void AudioProcessingImpl::InitializeEchoCanceller3() { | 1794 void AudioProcessingImpl::InitializeEchoCanceller3() { |
1762 if (capture_nonlocked_.echo_canceller3_enabled) { | 1795 if (capture_nonlocked_.echo_canceller3_enabled) { |
1763 private_submodules_->echo_canceller3.reset( | 1796 private_submodules_->echo_canceller3.reset( |
1764 new EchoCanceller3(proc_sample_rate_hz(), true)); | 1797 new EchoCanceller3(proc_sample_rate_hz(), true)); |
1765 } else { | 1798 } else { |
1766 private_submodules_->echo_canceller3.reset(); | 1799 private_submodules_->echo_canceller3.reset(); |
1767 } | 1800 } |
1768 } | 1801 } |
1769 | 1802 |
| 1803 void AudioProcessingImpl::InitializeGainController2() { |
| 1804 if (capture_nonlocked_.gain_controller2_enabled) { |
| 1805 private_submodules_->gain_controller2.reset( |
| 1806 new GainController2(proc_sample_rate_hz())); |
| 1807 } else { |
| 1808 private_submodules_->gain_controller2.reset(); |
| 1809 } |
| 1810 } |
| 1811 |
1770 void AudioProcessingImpl::InitializeLevelController() { | 1812 void AudioProcessingImpl::InitializeLevelController() { |
1771 private_submodules_->level_controller->Initialize(proc_sample_rate_hz()); | 1813 private_submodules_->level_controller->Initialize(proc_sample_rate_hz()); |
1772 } | 1814 } |
1773 | 1815 |
1774 void AudioProcessingImpl::InitializeResidualEchoDetector() { | 1816 void AudioProcessingImpl::InitializeResidualEchoDetector() { |
1775 private_submodules_->residual_echo_detector->Initialize(); | 1817 private_submodules_->residual_echo_detector->Initialize(); |
1776 } | 1818 } |
1777 | 1819 |
1778 void AudioProcessingImpl::MaybeUpdateHistograms() { | 1820 void AudioProcessingImpl::MaybeUpdateHistograms() { |
1779 static const int kMinDiffDelayMs = 60; | 1821 static const int kMinDiffDelayMs = 60; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 previous_agc_level(0), | 2056 previous_agc_level(0), |
2015 echo_path_gain_change(false) {} | 2057 echo_path_gain_change(false) {} |
2016 | 2058 |
2017 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; | 2059 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; |
2018 | 2060 |
2019 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; | 2061 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; |
2020 | 2062 |
2021 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; | 2063 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; |
2022 | 2064 |
2023 } // namespace webrtc | 2065 } // namespace webrtc |
OLD | NEW |