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

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

Issue 2278393002: Added logging of the level controller metrics (Closed)
Patch Set: Rebase Created 4 years, 3 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 | webrtc/modules/audio_processing/level_controller/level_controller.cc » ('j') | 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 25 matching lines...) Expand all
36 36
37 void Initialize(int sample_rate_hz); 37 void Initialize(int sample_rate_hz);
38 void Process(AudioBuffer* audio); 38 void Process(AudioBuffer* audio);
39 float GetLastGain() { return last_gain_; } 39 float GetLastGain() { return last_gain_; }
40 40
41 private: 41 private:
42 class Metrics { 42 class Metrics {
43 public: 43 public:
44 Metrics() { Initialize(AudioProcessing::kSampleRate48kHz); } 44 Metrics() { Initialize(AudioProcessing::kSampleRate48kHz); }
45 void Initialize(int sample_rate_hz); 45 void Initialize(int sample_rate_hz);
46 void Update(float peak_level, float noise_level, float gain); 46 void Update(float long_term_peak_level,
47 float noise_level,
48 float gain,
49 float frame_peak_level);
47 50
48 private: 51 private:
49 void Reset(); 52 void Reset();
50 53
51 size_t metrics_frame_counter_; 54 size_t metrics_frame_counter_;
52 float gain_sum_; 55 float gain_sum_;
53 float peak_level_sum_; 56 float peak_level_sum_;
54 float noise_energy_sum_; 57 float noise_energy_sum_;
55 float max_gain_; 58 float max_gain_;
56 float max_peak_level_; 59 float max_peak_level_;
(...skipping 14 matching lines...) Expand all
71 float dc_level_[2]; 74 float dc_level_[2];
72 float dc_forgetting_factor_; 75 float dc_forgetting_factor_;
73 float last_gain_; 76 float last_gain_;
74 77
75 RTC_DISALLOW_COPY_AND_ASSIGN(LevelController); 78 RTC_DISALLOW_COPY_AND_ASSIGN(LevelController);
76 }; 79 };
77 80
78 } // namespace webrtc 81 } // namespace webrtc
79 82
80 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_ 83 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_processing/level_controller/level_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698