OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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/agc/agc_manager_direct.h" | 11 #include "webrtc/modules/audio_processing/agc/agc_manager_direct.h" |
12 | 12 |
13 #include <cmath> | 13 #include <cmath> |
14 | 14 |
15 #ifdef WEBRTC_AGC_DEBUG_DUMP | 15 #ifdef WEBRTC_AGC_DEBUG_DUMP |
16 #include <cstdio> | 16 #include <cstdio> |
17 #endif | 17 #endif |
18 | 18 |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
| 20 #include "webrtc/base/logging.h" |
20 #include "webrtc/modules/audio_processing/agc/gain_map_internal.h" | 21 #include "webrtc/modules/audio_processing/agc/gain_map_internal.h" |
21 #include "webrtc/modules/audio_processing/gain_control_impl.h" | 22 #include "webrtc/modules/audio_processing/gain_control_impl.h" |
22 #include "webrtc/modules/include/module_common_types.h" | 23 #include "webrtc/modules/include/module_common_types.h" |
23 #include "webrtc/system_wrappers/include/logging.h" | |
24 #include "webrtc/system_wrappers/include/metrics.h" | 24 #include "webrtc/system_wrappers/include/metrics.h" |
25 | 25 |
26 namespace webrtc { | 26 namespace webrtc { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Amount the microphone level is lowered with every clipping event. | 30 // Amount the microphone level is lowered with every clipping event. |
31 const int kClippedLevelStep = 15; | 31 const int kClippedLevelStep = 15; |
32 // Proportion of clipped samples required to declare a clipping event. | 32 // Proportion of clipped samples required to declare a clipping event. |
33 const float kClippedRatioThreshold = 0.1f; | 33 const float kClippedRatioThreshold = 0.1f; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 compression_ = new_compression; | 446 compression_ = new_compression; |
447 compression_accumulator_ = new_compression; | 447 compression_accumulator_ = new_compression; |
448 if (gctrl_->set_compression_gain_db(compression_) != 0) { | 448 if (gctrl_->set_compression_gain_db(compression_) != 0) { |
449 LOG(LS_ERROR) << "set_compression_gain_db(" << compression_ | 449 LOG(LS_ERROR) << "set_compression_gain_db(" << compression_ |
450 << ") failed."; | 450 << ") failed."; |
451 } | 451 } |
452 } | 452 } |
453 } | 453 } |
454 | 454 |
455 } // namespace webrtc | 455 } // namespace webrtc |
OLD | NEW |