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

Unified Diff: webrtc/common_audio/real_fourier_ooura.cc

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 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
« no previous file with comments | « webrtc/common_audio/real_fourier_ooura.h ('k') | webrtc/common_audio/real_fourier_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/real_fourier_ooura.cc
diff --git a/webrtc/common_audio/real_fourier_ooura.cc b/webrtc/common_audio/real_fourier_ooura.cc
index 6f76516432186d66b1a972921fc557141cbc6949..1c4004dea77adaeb1d693c5aac06fdbc4b4b9c31 100644
--- a/webrtc/common_audio/real_fourier_ooura.cc
+++ b/webrtc/common_audio/real_fourier_ooura.cc
@@ -22,12 +22,12 @@ using std::complex;
namespace {
-void Conjugate(complex<float>* array, int complex_length) {
+void Conjugate(complex<float>* array, size_t complex_length) {
std::for_each(array, array + complex_length,
[=](complex<float>& v) { v = std::conj(v); });
}
-size_t ComputeWorkIpSize(int fft_length) {
+size_t ComputeWorkIpSize(size_t fft_length) {
return static_cast<size_t>(2 + std::ceil(std::sqrt(
static_cast<float>(fft_length))));
}
@@ -40,7 +40,7 @@ RealFourierOoura::RealFourierOoura(int fft_order)
complex_length_(ComplexLength(order_)),
// Zero-initializing work_ip_ will cause rdft to initialize these work
// arrays on the first call.
- work_ip_(new int[ComputeWorkIpSize(length_)]()),
+ work_ip_(new size_t[ComputeWorkIpSize(length_)]()),
work_w_(new float[complex_length_]()) {
CHECK_GE(fft_order, 1);
}
@@ -66,7 +66,7 @@ void RealFourierOoura::Inverse(const complex<float>* src, float* dest) const {
auto dest_complex = reinterpret_cast<complex<float>*>(dest);
// The real output array is shorter than the input complex array by one
// complex element.
- const int dest_complex_length = complex_length_ - 1;
+ const size_t dest_complex_length = complex_length_ - 1;
std::copy(src, src + dest_complex_length, dest_complex);
// Restore Ooura's conjugate definition.
Conjugate(dest_complex, dest_complex_length);
« no previous file with comments | « webrtc/common_audio/real_fourier_ooura.h ('k') | webrtc/common_audio/real_fourier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698