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 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 LOG(LS_INFO) << "[agc] rms_error=" << rms_error << ", " | 404 LOG(LS_INFO) << "[agc] rms_error=" << rms_error << ", " |
405 << "target_compression=" << target_compression_ << ", " | 405 << "target_compression=" << target_compression_ << ", " |
406 << "residual_gain=" << residual_gain; | 406 << "residual_gain=" << residual_gain; |
407 if (residual_gain == 0) | 407 if (residual_gain == 0) |
408 return; | 408 return; |
409 | 409 |
410 int old_level = level_; | 410 int old_level = level_; |
411 SetLevel(LevelFromGainError(residual_gain, level_)); | 411 SetLevel(LevelFromGainError(residual_gain, level_)); |
412 if (old_level != level_) { | 412 if (old_level != level_) { |
413 // level_ was updated by SetLevel; log the new value. | 413 // level_ was updated by SetLevel; log the new value. |
414 RTC_HISTOGRAM_ENUMERATION("WebRTC.Audio.AgcLevel", level_, kMaxMicLevel); | 414 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.AgcSetLevel", level_, 1, |
| 415 kMaxMicLevel, 50); |
415 } | 416 } |
416 } | 417 } |
417 | 418 |
418 void AgcManagerDirect::UpdateCompressor() { | 419 void AgcManagerDirect::UpdateCompressor() { |
419 if (compression_ == target_compression_) { | 420 if (compression_ == target_compression_) { |
420 return; | 421 return; |
421 } | 422 } |
422 | 423 |
423 // Adapt the compression gain slowly towards the target, in order to avoid | 424 // Adapt the compression gain slowly towards the target, in order to avoid |
424 // highly perceptible changes. | 425 // highly perceptible changes. |
(...skipping 18 matching lines...) Expand all Loading... |
443 compression_ = new_compression; | 444 compression_ = new_compression; |
444 compression_accumulator_ = new_compression; | 445 compression_accumulator_ = new_compression; |
445 if (gctrl_->set_compression_gain_db(compression_) != 0) { | 446 if (gctrl_->set_compression_gain_db(compression_) != 0) { |
446 LOG(LS_ERROR) << "set_compression_gain_db(" << compression_ | 447 LOG(LS_ERROR) << "set_compression_gain_db(" << compression_ |
447 << ") failed."; | 448 << ") failed."; |
448 } | 449 } |
449 } | 450 } |
450 } | 451 } |
451 | 452 |
452 } // namespace webrtc | 453 } // namespace webrtc |
OLD | NEW |