Add AnalogGainStatsReporter to compute and report analog gain statistics
Implement AnalogGainStatsReporter and add it in AudioProcessingImpl.
This class computes statistics for analog gain updates and
periodically reports them into a histogram.
The added histograms for analog gain update statistics:
- WebRTC.Audio.ApmAnalogGainDecreaseRate
- WebRTC.Audio.ApmAnalogGainIncreaseRate
- WebRTC.Audio.ApmAnalogGainUpdateRate
- WebRTC.Audio.ApmAnalogGainDecreaseAverage
- WebRTC.Audio.ApmAnalogGainIncreaseAverage
- WebRTC.Audio.ApmAnalogGainUpdateAverage
The histograms are defined in
https://chromium-review.googlesource.com/c/chromium/src/+/3207987
Bug: webrtc:12774
Change-Id: I3c58d4bb3eb034a11c3f39ab8edb2bc67c5fd5e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234140
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Ã…hgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35301}
diff --git a/modules/audio_processing/audio_processing_impl.h b/modules/audio_processing/audio_processing_impl.h
index bf1d22e..22cdadd 100644
--- a/modules/audio_processing/audio_processing_impl.h
+++ b/modules/audio_processing/audio_processing_impl.h
@@ -21,6 +21,7 @@
#include "api/function_view.h"
#include "modules/audio_processing/aec3/echo_canceller3.h"
#include "modules/audio_processing/agc/agc_manager_direct.h"
+#include "modules/audio_processing/agc/analog_gain_stats_reporter.h"
#include "modules/audio_processing/agc/gain_control.h"
#include "modules/audio_processing/audio_buffer.h"
#include "modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster.h"
@@ -531,6 +532,9 @@
RmsLevel capture_output_rms_ RTC_GUARDED_BY(mutex_capture_);
int capture_rms_interval_counter_ RTC_GUARDED_BY(mutex_capture_) = 0;
+ AnalogGainStatsReporter analog_gain_stats_reporter_
+ RTC_GUARDED_BY(mutex_capture_);
+
// Lock protection not needed.
std::unique_ptr<
SwapQueue<std::vector<int16_t>, RenderQueueItemVerifier<int16_t>>>