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

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

Issue 2337083002: Reland of added functionality for specifying the initial signal level to use for the gain estimation (Closed)
Patch Set: Fixed type conversion error 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
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 20 matching lines...) Expand all
31 31
32 class LevelController { 32 class LevelController {
33 public: 33 public:
34 LevelController(); 34 LevelController();
35 ~LevelController(); 35 ~LevelController();
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 // TODO(peah): This method is a temporary solution as the the aim is to
42 // instead apply the config inside the constructor. Therefore this is likely
43 // to change.
44 void ApplyConfig(const AudioProcessing::Config::LevelController& config);
41 // Validates a config. 45 // Validates a config.
42 static bool Validate(const AudioProcessing::Config::LevelController& config); 46 static bool Validate(const AudioProcessing::Config::LevelController& config);
43 // Dumps a config to a string. 47 // Dumps a config to a string.
44 static std::string ToString( 48 static std::string ToString(
45 const AudioProcessing::Config::LevelController& config); 49 const AudioProcessing::Config::LevelController& config);
46 50
47 private: 51 private:
48 class Metrics { 52 class Metrics {
49 public: 53 public:
50 Metrics() { Initialize(AudioProcessing::kSampleRate48kHz); } 54 Metrics() { Initialize(AudioProcessing::kSampleRate48kHz); }
(...skipping 22 matching lines...) Expand all
73 SignalClassifier signal_classifier_; 77 SignalClassifier signal_classifier_;
74 NoiseLevelEstimator noise_level_estimator_; 78 NoiseLevelEstimator noise_level_estimator_;
75 PeakLevelEstimator peak_level_estimator_; 79 PeakLevelEstimator peak_level_estimator_;
76 SaturatingGainEstimator saturating_gain_estimator_; 80 SaturatingGainEstimator saturating_gain_estimator_;
77 Metrics metrics_; 81 Metrics metrics_;
78 rtc::Optional<int> sample_rate_hz_; 82 rtc::Optional<int> sample_rate_hz_;
79 static int instance_count_; 83 static int instance_count_;
80 float dc_level_[2]; 84 float dc_level_[2];
81 float dc_forgetting_factor_; 85 float dc_forgetting_factor_;
82 float last_gain_; 86 float last_gain_;
87 bool gain_jumpstart_ = false;
88 AudioProcessing::Config::LevelController config_;
83 89
84 RTC_DISALLOW_COPY_AND_ASSIGN(LevelController); 90 RTC_DISALLOW_COPY_AND_ASSIGN(LevelController);
85 }; 91 };
86 92
87 } // namespace webrtc 93 } // namespace webrtc
88 94
89 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_ 95 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_LEVEL_CONTROLLER_LEVEL_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698