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}
This commit is contained in:
henrik.lundin
2016-11-22 07:02:44 -08:00
committed by Commit bot
parent 24d812ddc1
commit 30a12fbbb9

View File

@ -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