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

Unified Diff: webrtc/modules/audio_processing/level_controller/peak_level_estimator.cc

Issue 2254973003: Added functionality for specifying the initial signal level to use for the gain estimation in the l… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge from upstream CL Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/level_controller/peak_level_estimator.cc
diff --git a/webrtc/modules/audio_processing/level_controller/peak_level_estimator.cc b/webrtc/modules/audio_processing/level_controller/peak_level_estimator.cc
index 2ba806c8ee0d15b58c366421aaa1e2b5c20d635b..41587b017fdfa45f59675414b8bac3ec556184ba 100644
--- a/webrtc/modules/audio_processing/level_controller/peak_level_estimator.cc
+++ b/webrtc/modules/audio_processing/level_controller/peak_level_estimator.cc
@@ -13,7 +13,6 @@
#include <algorithm>
#include "webrtc/modules/audio_processing/audio_buffer.h"
-#include "webrtc/modules/audio_processing/level_controller/lc_constants.h"
#include "webrtc/modules/audio_processing/logging/apm_data_dumper.h"
namespace webrtc {
@@ -25,11 +24,16 @@ PeakLevelEstimator::PeakLevelEstimator() {
PeakLevelEstimator::~PeakLevelEstimator() {}
void PeakLevelEstimator::Initialize() {
- peak_level_ = kTargetLcPeakLevel;
+ peak_level_ = initial_peak_level_;
hold_counter_ = 0;
initialization_phase_ = true;
}
+void PeakLevelEstimator::SetInitialLevel(float level) {
hlundin-webrtc 2016/08/18 12:58:13 The method should be called SetInitialPeakLevel, r
peah-webrtc 2016/08/18 17:02:58 Good find! Done.
+ initial_peak_level_ = level;
+ Initialize();
+}
+
float PeakLevelEstimator::Analyze(SignalClassifier::SignalType signal_type,
float frame_peak_level) {
if (frame_peak_level == 0) {

Powered by Google App Engine
This is Rietveld 408576698