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 <cassert> | 13 #include <cassert> |
14 #include <cmath> | 14 #include <cmath> |
15 | 15 |
16 #ifdef WEBRTC_AGC_DEBUG_DUMP | 16 #ifdef WEBRTC_AGC_DEBUG_DUMP |
17 #include <cstdio> | 17 #include <cstdio> |
18 #endif | 18 #endif |
19 | 19 |
20 #include "webrtc/modules/audio_processing/agc/gain_map_internal.h" | 20 #include "webrtc/modules/audio_processing/agc/gain_map_internal.h" |
21 #include "webrtc/modules/audio_processing/gain_control_impl.h" | 21 #include "webrtc/modules/audio_processing/gain_control_impl.h" |
22 #include "webrtc/modules/interface/module_common_types.h" | 22 #include "webrtc/modules/include/module_common_types.h" |
23 #include "webrtc/system_wrappers/include/logging.h" | 23 #include "webrtc/system_wrappers/include/logging.h" |
24 | 24 |
25 namespace webrtc { | 25 namespace webrtc { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // Lowest the microphone level can be lowered due to clipping. | 29 // Lowest the microphone level can be lowered due to clipping. |
30 const int kClippedLevelMin = 170; | 30 const int kClippedLevelMin = 170; |
31 // Amount the microphone level is lowered with every clipping event. | 31 // Amount the microphone level is lowered with every clipping event. |
32 const int kClippedLevelStep = 15; | 32 const int kClippedLevelStep = 15; |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 if (new_compression != compression_) { | 433 if (new_compression != compression_) { |
434 compression_ = new_compression; | 434 compression_ = new_compression; |
435 compression_accumulator_ = new_compression; | 435 compression_accumulator_ = new_compression; |
436 if (gctrl_->set_compression_gain_db(compression_) != 0) { | 436 if (gctrl_->set_compression_gain_db(compression_) != 0) { |
437 LOG_FERR1(LS_ERROR, set_compression_gain_db, compression_); | 437 LOG_FERR1(LS_ERROR, set_compression_gain_db, compression_); |
438 } | 438 } |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 } // namespace webrtc | 442 } // namespace webrtc |
OLD | NEW |