From f2637a8d6fa667cced48d1b8bcbba4fd32dec4c1 Mon Sep 17 00:00:00 2001 From: Alex Loiko Date: Fri, 5 Oct 2018 13:49:33 +0200 Subject: [PATCH] Reland of 'Bug in histogram metric reporting.' Original CL: https://webrtc-review.googlesource.com/c/src/+/101340 A (actually several weeks) while ago, we noticed an error with the WebRTC.Audio.Agc2.EstimatedNoiseLevel histogram. It always reported the value 0. Here is why: The histogram bins go from 0 to 100. But the value logged is dBFS. It is always less than or equal to 0. This CL changes inverts the value logged. The noise level value should be somewhere between -90 and 0 dBFS. The histogram description is updated in https://chromium-review.googlesource.com/c/chromium/src/+/1264578 Bug: webrtc:7494 Change-Id: I0b53630d4284ce1078fd453e05e89ee53ca9f6c7 Reviewed-on: https://webrtc-review.googlesource.com/c/104063 Reviewed-by: Ivo Creusen Commit-Queue: Alex Loiko Cr-Commit-Position: refs/heads/master@{#25021} --- modules/audio_processing/agc2/adaptive_digital_gain_applier.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/audio_processing/agc2/adaptive_digital_gain_applier.cc b/modules/audio_processing/agc2/adaptive_digital_gain_applier.cc index b3e5a1350a..d4560caf1a 100644 --- a/modules/audio_processing/agc2/adaptive_digital_gain_applier.cc +++ b/modules/audio_processing/agc2/adaptive_digital_gain_applier.cc @@ -100,7 +100,7 @@ void AdaptiveDigitalGainApplier::Process(SignalWithLevels signal_with_levels) { RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.Agc2.DigitalGainApplied", last_gain_db_, 0, kMaxGainDb, kMaxGainDb + 1); RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.Agc2.EstimatedNoiseLevel", - signal_with_levels.input_noise_level_dbfs, 0, + -signal_with_levels.input_noise_level_dbfs, 0, 100, 101); }