Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: webrtc/modules/audio_processing/audio_processing_impl.cc

Issue 2549143004: Added histogram for the output level int the audio processing module (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/audio_processing_impl.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index 2379cd1be8ec06fd8a2626a32f14c82d2a46631e..b1e72e61993119183da5c1ed385b72a52a30a172 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -1095,12 +1095,11 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity.
- rms_.Analyze(rtc::ArrayView<const int16_t>(
+ capture_input_rms_.Analyze(rtc::ArrayView<const int16_t>(
capture_buffer->channels_const()[0],
capture_nonlocked_.capture_processing_format.num_frames()));
- if (++rms_interval_counter_ >= 1000) {
- rms_interval_counter_ = 0;
- RmsLevel::Levels levels = rms_.AverageAndPeak();
+ if (capture_rms_interval_counter_ >= 1000) {
+ RmsLevel::Levels levels = capture_input_rms_.AverageAndPeak();
RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelAverage",
levels.average, 1, RmsLevel::kMinLevelDb, 100);
RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureInputLevelPeak", levels.peak,
@@ -1228,6 +1227,18 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
// The level estimator operates on the recombined data.
public_submodules_->level_estimator->ProcessStream(capture_buffer);
+ capture_output_rms_.Analyze(rtc::ArrayView<const int16_t>(
+ capture_buffer->channels_const()[0],
+ capture_nonlocked_.capture_processing_format.num_frames()));
+ if (++capture_rms_interval_counter_ >= 1000) {
+ capture_rms_interval_counter_ = 0;
+ RmsLevel::Levels levels = capture_output_rms_.AverageAndPeak();
+ RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureOutputLevelAverage",
hlundin-webrtc 2016/12/06 16:07:10 Did you not want this to be RTC_HISTOGRAM_COUNTS_L
peah-webrtc 2016/12/20 14:02:39 Fully true! Thanks! I also changed the ranges to m
+ levels.average, 1, RmsLevel::kMinLevelDb, 100);
+ RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ApmCaptureOutputLevelPeak", levels.peak,
hlundin-webrtc 2016/12/06 16:07:10 And this?
peah-webrtc 2016/12/20 14:02:39 Done.
+ 1, RmsLevel::kMinLevelDb, 100);
+ }
+
capture_.was_stream_delay_set = false;
return kNoError;
}
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698