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

Side by Side Diff: webrtc/modules/audio_processing/level_controller/level_controller.cc

Issue 2364553003: Change of the format of the log output in the level controller (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.LevelControl.AverageGain", 149 RTC_HISTOGRAM_COUNTS("WebRTC.Audio.LevelControl.AverageGain",
150 average_gain_db, 0, 33, 30); 150 average_gain_db, 0, 33, 30);
151 151
152 const int long_term_peak_level_dbfs = static_cast<int>( 152 const int long_term_peak_level_dbfs = static_cast<int>(
153 10 * log10(long_term_peak_level * long_term_peak_level + 1e-10f) - 153 10 * log10(long_term_peak_level * long_term_peak_level + 1e-10f) -
154 kdBFSOffset); 154 kdBFSOffset);
155 155
156 const int frame_peak_level_dbfs = static_cast<int>( 156 const int frame_peak_level_dbfs = static_cast<int>(
157 10 * log10(frame_peak_level * frame_peak_level + 1e-10f) - kdBFSOffset); 157 10 * log10(frame_peak_level * frame_peak_level + 1e-10f) - kdBFSOffset);
158 158
159 LOG(LS_INFO) << "Level Controller metrics: " << std::endl 159 LOG(LS_INFO) << "Level Controller metrics: {"
the sun 2016/09/23 12:31:33 Consider putting this in a ToString() method, like
peah-webrtc 2016/10/03 10:37:02 I agree, but in this case not all the reported met
160 << "Max noise power: " << max_noise_power_dbfs 160 << "Max noise power: " << max_noise_power_dbfs << " dBFS, "
161 << " dBFS" << std::endl 161 << "Average noise power: " << average_noise_power_dbfs
162 << "Average noise power: " << average_noise_power_dbfs 162 << " dBFS, "
163 << " dBFS" << std::endl 163 << "Max long term peak level: " << max_peak_level_dbfs
164 << "Max long term peak level: " << max_peak_level_dbfs 164 << " dBFS, "
165 << " dBFS" << std::endl
166 << "Average long term peak level: " << average_peak_level_dbfs 165 << "Average long term peak level: " << average_peak_level_dbfs
167 << " dBFS" << std::endl 166 << " dBFS, "
168 << "Max gain: " << max_gain_db << " dB" 167 << "Max gain: " << max_gain_db << " dB, "
169 << std::endl 168 << "Average gain: " << average_gain_db << " dB, "
170 << "Average gain: " << average_gain_db << " dB" 169 << "Long term peak level: " << long_term_peak_level_dbfs
171 << std::endl 170 << " dBFS, "
172 << "Long term peak level: " 171 << "Last frame peak level: " << frame_peak_level_dbfs
173 << long_term_peak_level_dbfs << " dBFS" << std::endl 172 << " dBFS"
174 << "Last frame peak level: " << frame_peak_level_dbfs 173 << "}";
175 << " dBFS";
176 174
177 Reset(); 175 Reset();
178 } 176 }
179 } 177 }
180 178
181 LevelController::LevelController() 179 LevelController::LevelController()
182 : data_dumper_(new ApmDataDumper(instance_count_)), 180 : data_dumper_(new ApmDataDumper(instance_count_)),
183 gain_applier_(data_dumper_.get()), 181 gain_applier_(data_dumper_.get()),
184 signal_classifier_(data_dumper_.get()) { 182 signal_classifier_(data_dumper_.get()) {
185 Initialize(AudioProcessing::kSampleRate48kHz); 183 Initialize(AudioProcessing::kSampleRate48kHz);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 << "enabled: " << (config.enabled ? "true" : "false") << "}"; 267 << "enabled: " << (config.enabled ? "true" : "false") << "}";
270 return ss.str(); 268 return ss.str();
271 } 269 }
272 270
273 bool LevelController::Validate( 271 bool LevelController::Validate(
274 const AudioProcessing::Config::LevelController& config) { 272 const AudioProcessing::Config::LevelController& config) {
275 return true; 273 return true;
276 } 274 }
277 275
278 } // namespace webrtc 276 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698