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

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: Changed to using a bool value to control the reporting of the levels 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 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 const bool log_rms = ++capture_rms_interval_counter_ >= 1000;
1139 rms_interval_counter_ = 0; 1139 if (log_rms) {
1140 RmsLevel::Levels levels = rms_.AverageAndPeak(); 1140 capture_rms_interval_counter_ = 0;
1141 RmsLevel::Levels levels = capture_input_rms_.AverageAndPeak();
1141 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelAverageRms", 1142 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelAverageRms",
1142 levels.average, 1, RmsLevel::kMinLevelDb, 64); 1143 levels.average, 1, RmsLevel::kMinLevelDb, 64);
1143 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelPeakRms", 1144 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureInputLevelPeakRms",
1144 levels.peak, 1, RmsLevel::kMinLevelDb, 64); 1145 levels.peak, 1, RmsLevel::kMinLevelDb, 64);
1145 } 1146 }
1146 1147
1147 if (private_submodules_->echo_canceller3) { 1148 if (private_submodules_->echo_canceller3) {
1148 private_submodules_->echo_canceller3->AnalyzeCapture(capture_buffer); 1149 private_submodules_->echo_canceller3->AnalyzeCapture(capture_buffer);
1149 } 1150 }
1150 1151
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 capture_.key_pressed); 1269 capture_.key_pressed);
1269 } 1270 }
1270 1271
1271 if (capture_nonlocked_.level_controller_enabled) { 1272 if (capture_nonlocked_.level_controller_enabled) {
1272 private_submodules_->level_controller->Process(capture_buffer); 1273 private_submodules_->level_controller->Process(capture_buffer);
1273 } 1274 }
1274 1275
1275 // The level estimator operates on the recombined data. 1276 // The level estimator operates on the recombined data.
1276 public_submodules_->level_estimator->ProcessStream(capture_buffer); 1277 public_submodules_->level_estimator->ProcessStream(capture_buffer);
1277 1278
1279 capture_output_rms_.Analyze(rtc::ArrayView<const int16_t>(
1280 capture_buffer->channels_const()[0],
1281 capture_nonlocked_.capture_processing_format.num_frames()));
1282 if (log_rms) {
1283 RmsLevel::Levels levels = capture_output_rms_.AverageAndPeak();
1284 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureOutputLevelAverageRms",
1285 levels.average, 1, RmsLevel::kMinLevelDb, 64);
1286 RTC_HISTOGRAM_COUNTS_LINEAR("WebRTC.Audio.ApmCaptureOutputLevelPeakRms",
1287 levels.peak, 1, RmsLevel::kMinLevelDb, 64);
1288 }
1289
1278 capture_.was_stream_delay_set = false; 1290 capture_.was_stream_delay_set = false;
1279 return kNoError; 1291 return kNoError;
1280 } 1292 }
1281 1293
1282 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data, 1294 int AudioProcessingImpl::AnalyzeReverseStream(const float* const* data,
1283 size_t samples_per_channel, 1295 size_t samples_per_channel,
1284 int sample_rate_hz, 1296 int sample_rate_hz,
1285 ChannelLayout layout) { 1297 ChannelLayout layout) {
1286 TRACE_EVENT0("webrtc", "AudioProcessing::AnalyzeReverseStream_ChannelLayout"); 1298 TRACE_EVENT0("webrtc", "AudioProcessing::AnalyzeReverseStream_ChannelLayout");
1287 rtc::CritScope cs(&crit_render_); 1299 rtc::CritScope cs(&crit_render_);
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 capture_processing_format(kSampleRate16kHz), 1971 capture_processing_format(kSampleRate16kHz),
1960 split_rate(kSampleRate16kHz) {} 1972 split_rate(kSampleRate16kHz) {}
1961 1973
1962 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default; 1974 AudioProcessingImpl::ApmCaptureState::~ApmCaptureState() = default;
1963 1975
1964 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default; 1976 AudioProcessingImpl::ApmRenderState::ApmRenderState() = default;
1965 1977
1966 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default; 1978 AudioProcessingImpl::ApmRenderState::~ApmRenderState() = default;
1967 1979
1968 } // namespace webrtc 1980 } // 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