Replace scoped_ptr with unique_ptr in webrtc/modules/audio_processing/
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1710483002
Cr-Commit-Position: refs/heads/master@{#11684}
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
index 9cb03ca..2deb4d2 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h
@@ -12,9 +12,9 @@
#define WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_ENHANCER_H_
#include <complex>
+#include <memory>
#include <vector>
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_audio/lapped_transform.h"
#include "webrtc/common_audio/channel_buffer.h"
#include "webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h"
@@ -120,24 +120,24 @@
intelligibility::PowerEstimator clear_power_;
std::vector<float> noise_power_;
- rtc::scoped_ptr<float[]> filtered_clear_pow_;
- rtc::scoped_ptr<float[]> filtered_noise_pow_;
- rtc::scoped_ptr<float[]> center_freqs_;
+ std::unique_ptr<float[]> filtered_clear_pow_;
+ std::unique_ptr<float[]> filtered_noise_pow_;
+ std::unique_ptr<float[]> center_freqs_;
std::vector<std::vector<float>> capture_filter_bank_;
std::vector<std::vector<float>> render_filter_bank_;
size_t start_freq_;
- rtc::scoped_ptr<float[]> rho_; // Production and interpretation SNR.
+ std::unique_ptr<float[]> rho_; // Production and interpretation SNR.
// for each ERB band.
- rtc::scoped_ptr<float[]> gains_eq_; // Pre-filter modified gains.
+ std::unique_ptr<float[]> gains_eq_; // Pre-filter modified gains.
intelligibility::GainApplier gain_applier_;
// Destination buffers used to reassemble blocked chunks before overwriting
// the original input array with modifications.
ChannelBuffer<float> temp_render_out_buffer_;
- rtc::scoped_ptr<float[]> kbd_window_;
+ std::unique_ptr<float[]> kbd_window_;
TransformCallback render_callback_;
- rtc::scoped_ptr<LappedTransform> render_mangler_;
+ std::unique_ptr<LappedTransform> render_mangler_;
int block_count_;
int analysis_step_;
};
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
index 0d15406..b0f94ec 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer_unittest.cc
@@ -10,12 +10,13 @@
#include <math.h>
#include <stdlib.h>
+
#include <algorithm>
+#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/arraysize.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.h"
@@ -105,7 +106,7 @@
}
IntelligibilityEnhancer::Config config_;
- rtc::scoped_ptr<IntelligibilityEnhancer> enh_;
+ std::unique_ptr<IntelligibilityEnhancer> enh_;
std::vector<float> clear_data_;
std::vector<float> noise_data_;
std::vector<float> orig_data_;
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
index 2bf0791..8858cff 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
@@ -12,8 +12,7 @@
#define WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_
#include <complex>
-
-#include "webrtc/base/scoped_ptr.h"
+#include <memory>
namespace webrtc {
@@ -36,13 +35,13 @@
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_;
+ // and histories from std::unique_ptr to std::vector.
+ std::unique_ptr<std::complex<float>[]> running_mean_sq_;
// The current magnitude array.
- rtc::scoped_ptr<float[]> magnitude_;
+ std::unique_ptr<float[]> magnitude_;
// The current power array.
- rtc::scoped_ptr<float[]> power_;
+ std::unique_ptr<float[]> power_;
const size_t num_freqs_;
const float decay_;
@@ -66,8 +65,8 @@
private:
const size_t num_freqs_;
const float change_limit_;
- rtc::scoped_ptr<float[]> target_;
- rtc::scoped_ptr<float[]> current_;
+ std::unique_ptr<float[]> target_;
+ std::unique_ptr<float[]> current_;
};
} // namespace intelligibility