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

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

Issue 1190733004: Attempt to reland: Allow intelligibility to compile in apm (https://codereview.webrtc.org/118232300… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changed temp file name Created 5 years, 6 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 550f293a7cdccecf407c13798da803ea287789bd..075b8ad46bea1823fb78a9376001c3bb06bd20bf 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
@@ -8,12 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+//
+// Specifies helper classes for intelligibility enhancement.
+//
+
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_
#define WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_
#include <complex>
-#include "webrtc/system_wrappers/interface/scoped_ptr.h"
+#include "webrtc/base/scoped_ptr.h"
namespace webrtc {
@@ -63,14 +67,10 @@ class VarianceArray {
void ApplyScale(float scale);
// The current set of variances.
- const float* variance() const {
- return variance_.get();
- }
+ const float* variance() const { return variance_.get(); }
// The mean value of the current set of variances.
- float array_mean() const {
- return array_mean_;
- }
+ float array_mean() const { return array_mean_; }
private:
void InfiniteStep(const std::complex<float>* data, bool dummy);
@@ -78,23 +78,26 @@ class VarianceArray {
void WindowedStep(const std::complex<float>* data, bool dummy);
void BlockedStep(const std::complex<float>* data, bool dummy);
+ // TODO(ekmeyerson): Switch the following running means
+ // and histories from rtc::scoped_ptr to std::vector.
+
// The current average X and X^2.
- scoped_ptr<std::complex<float>[]> running_mean_;
- scoped_ptr<std::complex<float>[]> running_mean_sq_;
+ rtc::scoped_ptr<std::complex<float>[]> running_mean_;
+ rtc::scoped_ptr<std::complex<float>[]> running_mean_sq_;
// Average X and X^2 for the current block in kStepBlocked.
- scoped_ptr<std::complex<float>[]> sub_running_mean_;
- scoped_ptr<std::complex<float>[]> sub_running_mean_sq_;
+ rtc::scoped_ptr<std::complex<float>[]> sub_running_mean_;
+ rtc::scoped_ptr<std::complex<float>[]> sub_running_mean_sq_;
// Sample history for the rolling window in kStepWindowed and block-wise
// histories for kStepBlocked.
- scoped_ptr<scoped_ptr<std::complex<float>[]>[]> history_;
- scoped_ptr<scoped_ptr<std::complex<float>[]>[]> subhistory_;
- scoped_ptr<scoped_ptr<std::complex<float>[]>[]> subhistory_sq_;
+ rtc::scoped_ptr<rtc::scoped_ptr<std::complex<float>[]>[]> history_;
+ rtc::scoped_ptr<rtc::scoped_ptr<std::complex<float>[]>[]> subhistory_;
+ rtc::scoped_ptr<rtc::scoped_ptr<std::complex<float>[]>[]> subhistory_sq_;
// The current set of variances and sums for Welford's algorithm.
- scoped_ptr<float[]> variance_;
- scoped_ptr<float[]> conj_sum_;
+ rtc::scoped_ptr<float[]> variance_;
+ rtc::scoped_ptr<float[]> conj_sum_;
const int freqs_;
const int window_size_;
@@ -118,15 +121,13 @@ class GainApplier {
std::complex<float>* out_block);
// Return the current target gain set. Modify this array to set the targets.
- float* target() const {
- return target_.get();
- }
+ float* target() const { return target_.get(); }
private:
const int freqs_;
const float change_limit_;
- scoped_ptr<float[]> target_;
- scoped_ptr<float[]> current_;
+ rtc::scoped_ptr<float[]> target_;
+ rtc::scoped_ptr<float[]> current_;
};
} // namespace intelligibility
@@ -134,4 +135,3 @@ class GainApplier {
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_
-

Powered by Google App Engine
This is Rietveld 408576698