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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h

Issue 1693823004: Use VAD to get a better speech power estimation in the IntelligibilityEnhancer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@pow
Patch Set: Created 4 years, 10 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/intelligibility/intelligibility_utils.h
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
index 7d5de7d92a54b2fed4065ccee72a7990ce03d4a2..146899457e2141e272e0d046dcaa3dfe0e1af632 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
@@ -12,6 +12,7 @@
#define WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_
#include <complex>
+#include <vector>
#include "webrtc/base/scoped_ptr.h"
@@ -27,22 +28,16 @@ class PowerEstimator {
PowerEstimator(size_t freqs, float decay);
// Add a new data point to the series.
+ void Step(const float* data);
void Step(const std::complex<float>* data);
// The current power array.
- const float* Power();
+ const float* power() { return &power_[0]; };
hlundin-webrtc 2016/02/15 13:05:12 Why not return a const std::vector<float>&?
aluebs-webrtc 2016/02/19 03:56:31 Done.
private:
- // TODO(ekmeyerson): Switch the following running means
- // and histories from rtc::scoped_ptr to std::vector.
- rtc::scoped_ptr<std::complex<float>[]> running_mean_sq_;
-
- // The current magnitude array.
- rtc::scoped_ptr<float[]> magnitude_;
// The current power array.
- rtc::scoped_ptr<float[]> power_;
+ std::vector<float> power_;
- const size_t num_freqs_;
const float decay_;
};

Powered by Google App Engine
This is Rietveld 408576698