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

Side by Side 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: Corrected the histograms Created 3 years, 12 months 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 public_submodules_->echo_cancellation->stream_drift_samples()); 1125 public_submodules_->echo_cancellation->stream_drift_samples());
1126 msg->set_level(gain_control()->stream_analog_level()); 1126 msg->set_level(gain_control()->stream_analog_level());
1127 msg->set_keypress(capture_.key_pressed); 1127 msg->set_keypress(capture_.key_pressed);
1128 } 1128 }
1129 #endif 1129 #endif
1130 1130
1131 MaybeUpdateHistograms(); 1131 MaybeUpdateHistograms();
1132 1132
1133 AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity. 1133 AudioBuffer* capture_buffer = capture_.capture_audio.get(); // For brevity.
1134 1134
1135 rms_.Analyze(rtc::ArrayView<const int16_t>( 1135 capture_input_rms_.Analyze(rtc::ArrayView<const int16_t>(
1136 capture_buffer->channels_const()[0], 1136 capture_buffer->channels_const()[0],
1137 capture_nonlocked_.capture_processing_format.num_frames())); 1137 capture_nonlocked_.capture_processing_format.num_frames()));
1138 if (++rms_interval_counter_ >= 1000) { 1138 if (++capture_rms_interval_counter_ >= 1000) {
hlundin-webrtc 2016/12/20 14:41:26 This feels a bit fragile now, with incrementing in
peah-webrtc 2016/12/20 14:46:47 Great point and suggestion! Done.
1139 rms_interval_counter_ = 0; 1139 RmsLevel::Levels levels = capture_input_rms_.AverageAndPeak();
1140 RmsLevel::Levels levels = rms_.AverageAndPeak();
1141 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelAverageRms", 1140 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelAverageRms",
1142 levels.average, 1, RmsLevel::kMinLevelDb, 64); 1141 levels.average, 1, RmsLevel::kMinLevelDb, 64);
1143 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelPeakRms", 1142 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelPeakRms",
1144 levels.peak, 1, RmsLevel::kMinLevelDb, 64); 1143 levels.peak, 1, RmsLevel::kMinLevelDb, 64);
1145 } 1144 }
1146 1145
1147 if (private_submodules_->echo_canceller3) { 1146 if (private_submodules_->echo_canceller3) {
1148 private_submodules_->echo_canceller3->AnalyzeCapture(capture_buffer); 1147 private_submodules_->echo_canceller3->AnalyzeCapture(capture_buffer);
1149 } 1148 }
1150 1149
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 capture_.key_pressed); 1267 capture_.key_pressed);
1269 } 1268 }
1270 1269
1271 if (capture_nonlocked_.level_controller_enabled) { 1270 if (capture_nonlocked_.level_controller_enabled) {
1272 private_submodules_->level_controller->Process(capture_buffer); 1271 private_submodules_->level_controller->Process(capture_buffer);
1273 } 1272 }
1274 1273
1275 // The level estimator operates on the recombined data. 1274 // The level estimator operates on the recombined data.
1276 public_submodules_->level_estimator->ProcessStream(capture_buffer); 1275 public_submodules_->level_estimator->ProcessStream(capture_buffer);
1277 1276
1277 capture_output_rms_.Analyze(rtc::ArrayView<const int16_t>(
1278 capture_buffer->channels_const()[0],
1279 capture_nonlocked_.capture_processing_format.num_frames()));
1280 if (capture_rms_interval_counter_ >= 1000) {
1281 capture_rms_interval_counter_ = 0;
1282 RmsLevel::Levels levels = capture_output_rms_.AverageAndPeak();
1283 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureOutputLevelAverageRms",
1284 levels.average, 1, RmsLevel::kMinLevelDb, 64);
1285 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureOutputLevelPeakRms",
1286 levels.peak, 1, RmsLevel::kMinLevelDb, 64);
1287 }
1288
1278 capture_.was_stream_delay_set = false; 1289 capture_.was_stream_delay_set = false;
1279 return kNoError; 1290 return kNoError;
1280 } 1291 }
1281 1292
1282 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, 1293 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data,
1283 size_t samples_per_channel, 1294 size_t samples_per_channel,
1284 int sample_rate_hz, 1295 int sample_rate_hz,
1285 ChannelLayout layout) { 1296 ChannelLayout layout) {
1286 TRACE_EVENT0("webrtc", "AudioProcessing::AnalyzeReverseStream_ChannelLayout"); 1297 TRACE_EVENT0("webrtc", "AudioProcessing::AnalyzeReverseStream_ChannelLayout");
1287 rtc::CritScope cs(&crit_render_); 1298 rtc::CritScope cs(&crit_render_);
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 capture_processing_format(kSampleRate16kHz), 1970 capture_processing_format(kSampleRate16kHz),
1960 split_rate(kSampleRate16kHz) {} 1971 split_rate(kSampleRate16kHz) {}
1961 1972
1962 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1973 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1963 1974
1964 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1975 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1965 1976
1966 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1977 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1967 1978
1968 } // namespace webrtc 1979 } // namespace webrtc
OLDNEW
« 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