From 30a12fbbb9f89959b9a4f3f81b20a9dbb54b5c66 Mon Sep 17 00:00:00 2001 From: "henrik.lundin" Date: Tue, 22 Nov 2016 07:02:44 -0800 Subject: [PATCH] AGC: Add a histogram for clipping adjustment This new histogram will log a value every time input clipping is detected. The value is a boolean, with "true" meaning that the gain was in fact adjusted in response to the detected clipping, and "false" meaning that adjustment was not allowed due to kClippedLevelMin. BUG=webrtc:6622 Review-Url: https://codereview.webrtc.org/2522543006 Cr-Commit-Position: refs/heads/master@{#15196} --- webrtc/modules/audio_processing/agc/agc_manager_direct.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webrtc/modules/audio_processing/agc/agc_manager_direct.cc b/webrtc/modules/audio_processing/agc/agc_manager_direct.cc index 92715dc61e..dc9ba42d51 100644 --- a/webrtc/modules/audio_processing/agc/agc_manager_direct.cc +++ b/webrtc/modules/audio_processing/agc/agc_manager_direct.cc @@ -21,6 +21,7 @@ #include "webrtc/modules/audio_processing/gain_control_impl.h" #include "webrtc/modules/include/module_common_types.h" #include "webrtc/system_wrappers/include/logging.h" +#include "webrtc/system_wrappers/include/metrics.h" namespace webrtc { @@ -218,6 +219,8 @@ void AgcManagerDirect::AnalyzePreProcess(int16_t* audio, // Always decrease the maximum level, even if the current level is below // threshold. SetMaxLevel(std::max(kClippedLevelMin, max_level_ - kClippedLevelStep)); + RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.AgcClippingAdjustmentAllowed", + level_ - kClippedLevelStep >= kClippedLevelMin); if (level_ > kClippedLevelMin) { // Don't try to adjust the level if we're already below the limit. As // a consequence, if the user has brought the level above the limit, we