OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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/level_controller/level_controller.h" | 11 #include "webrtc/modules/audio_processing/level_controller/level_controller.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <numeric> | 15 #include <numeric> |
16 | 16 |
17 #include "webrtc/base/array_view.h" | 17 #include "webrtc/base/array_view.h" |
18 #include "webrtc/base/arraysize.h" | 18 #include "webrtc/base/arraysize.h" |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
| 20 #include "webrtc/base/logging.h" |
20 #include "webrtc/modules/audio_processing/audio_buffer.h" | 21 #include "webrtc/modules/audio_processing/audio_buffer.h" |
21 #include "webrtc/modules/audio_processing/level_controller/gain_applier.h" | 22 #include "webrtc/modules/audio_processing/level_controller/gain_applier.h" |
22 #include "webrtc/modules/audio_processing/level_controller/gain_selector.h" | 23 #include "webrtc/modules/audio_processing/level_controller/gain_selector.h" |
23 #include "webrtc/modules/audio_processing/level_controller/noise_level_estimator
.h" | 24 #include "webrtc/modules/audio_processing/level_controller/noise_level_estimator
.h" |
24 #include "webrtc/modules/audio_processing/level_controller/peak_level_estimator.
h" | 25 #include "webrtc/modules/audio_processing/level_controller/peak_level_estimator.
h" |
25 #include "webrtc/modules/audio_processing/level_controller/saturating_gain_estim
ator.h" | 26 #include "webrtc/modules/audio_processing/level_controller/saturating_gain_estim
ator.h" |
26 #include "webrtc/modules/audio_processing/level_controller/signal_classifier.h" | 27 #include "webrtc/modules/audio_processing/level_controller/signal_classifier.h" |
27 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" | 28 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
28 #include "webrtc/system_wrappers/include/logging.h" | |
29 #include "webrtc/system_wrappers/include/metrics.h" | 29 #include "webrtc/system_wrappers/include/metrics.h" |
30 | 30 |
31 namespace webrtc { | 31 namespace webrtc { |
32 namespace { | 32 namespace { |
33 | 33 |
34 void UpdateAndRemoveDcLevel(float forgetting_factor, | 34 void UpdateAndRemoveDcLevel(float forgetting_factor, |
35 float* dc_level, | 35 float* dc_level, |
36 rtc::ArrayView<float> x) { | 36 rtc::ArrayView<float> x) { |
37 RTC_DCHECK(!x.empty()); | 37 RTC_DCHECK(!x.empty()); |
38 float mean = | 38 float mean = |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 bool LevelController::Validate( | 285 bool LevelController::Validate( |
286 const AudioProcessing::Config::LevelController& config) { | 286 const AudioProcessing::Config::LevelController& config) { |
287 return (config.initial_peak_level_dbfs < | 287 return (config.initial_peak_level_dbfs < |
288 std::numeric_limits<float>::epsilon() && | 288 std::numeric_limits<float>::epsilon() && |
289 config.initial_peak_level_dbfs > | 289 config.initial_peak_level_dbfs > |
290 -(100.f + std::numeric_limits<float>::epsilon())); | 290 -(100.f + std::numeric_limits<float>::epsilon())); |
291 } | 291 } |
292 | 292 |
293 } // namespace webrtc | 293 } // namespace webrtc |
OLD | NEW |