Index: webrtc/modules/audio_processing/splitting_filter_unittest.cc |
diff --git a/webrtc/modules/audio_processing/splitting_filter_unittest.cc b/webrtc/modules/audio_processing/splitting_filter_unittest.cc |
index 0498cc688a5427b169b8ac32f8d116cc13ea8f48..e7af65115c69319dafc733974f30311aee2bbe6e 100644 |
--- a/webrtc/modules/audio_processing/splitting_filter_unittest.cc |
+++ b/webrtc/modules/audio_processing/splitting_filter_unittest.cc |
@@ -20,8 +20,8 @@ |
namespace webrtc { |
namespace { |
-const int kSamplesPer16kHzChannel = 160; |
-const int kSamplesPer48kHzChannel = 480; |
+const size_t kSamplesPer16kHzChannel = 160; |
+const size_t kSamplesPer48kHzChannel = 480; |
} // namespace |
@@ -35,26 +35,26 @@ const int kSamplesPer48kHzChannel = 480; |
TEST(SplittingFilterTest, SplitsIntoThreeBandsAndReconstructs) { |
static const int kChannels = 1; |
static const int kSampleRateHz = 48000; |
- static const int kNumBands = 3; |
+ static const size_t kNumBands = 3; |
static const int kFrequenciesHz[kNumBands] = {1000, 12000, 18000}; |
static const float kAmplitude = 8192.f; |
- static const int kChunks = 8; |
+ static const size_t kChunks = 8; |
SplittingFilter splitting_filter(kChannels, |
kNumBands, |
kSamplesPer48kHzChannel); |
IFChannelBuffer in_data(kSamplesPer48kHzChannel, kChannels, kNumBands); |
IFChannelBuffer bands(kSamplesPer48kHzChannel, kChannels, kNumBands); |
IFChannelBuffer out_data(kSamplesPer48kHzChannel, kChannels, kNumBands); |
- for (int i = 0; i < kChunks; ++i) { |
+ for (size_t i = 0; i < kChunks; ++i) { |
// Input signal generation. |
bool is_present[kNumBands]; |
memset(in_data.fbuf()->channels()[0], |
0, |
kSamplesPer48kHzChannel * sizeof(in_data.fbuf()->channels()[0][0])); |
- for (int j = 0; j < kNumBands; ++j) { |
- is_present[j] = i & (1 << j); |
+ for (size_t j = 0; j < kNumBands; ++j) { |
+ is_present[j] = i & (static_cast<size_t>(1) << j); |
float amplitude = is_present[j] ? kAmplitude : 0.f; |
- for (int k = 0; k < kSamplesPer48kHzChannel; ++k) { |
+ for (size_t k = 0; k < kSamplesPer48kHzChannel; ++k) { |
in_data.fbuf()->channels()[0][k] += |
amplitude * sin(2.f * M_PI * kFrequenciesHz[j] * |
(i * kSamplesPer48kHzChannel + k) / kSampleRateHz); |
@@ -64,9 +64,9 @@ TEST(SplittingFilterTest, SplitsIntoThreeBandsAndReconstructs) { |
splitting_filter.Analysis(&in_data, &bands); |
// Energy calculation. |
float energy[kNumBands]; |
- for (int j = 0; j < kNumBands; ++j) { |
+ for (size_t j = 0; j < kNumBands; ++j) { |
energy[j] = 0.f; |
- for (int k = 0; k < kSamplesPer16kHzChannel; ++k) { |
+ for (size_t k = 0; k < kSamplesPer16kHzChannel; ++k) { |
energy[j] += bands.fbuf_const()->channels(j)[0][k] * |
bands.fbuf_const()->channels(j)[0][k]; |
} |
@@ -81,9 +81,9 @@ TEST(SplittingFilterTest, SplitsIntoThreeBandsAndReconstructs) { |
splitting_filter.Synthesis(&bands, &out_data); |
// Delay and cross correlation estimation. |
float xcorr = 0.f; |
- for (int delay = 0; delay < kSamplesPer48kHzChannel; ++delay) { |
+ for (size_t delay = 0; delay < kSamplesPer48kHzChannel; ++delay) { |
float tmpcorr = 0.f; |
- for (int j = delay; j < kSamplesPer48kHzChannel; ++j) { |
+ for (size_t j = delay; j < kSamplesPer48kHzChannel; ++j) { |
tmpcorr += in_data.fbuf_const()->channels()[0][j - delay] * |
out_data.fbuf_const()->channels()[0][j]; |
} |
@@ -94,7 +94,7 @@ TEST(SplittingFilterTest, SplitsIntoThreeBandsAndReconstructs) { |
} |
// High cross correlation check. |
bool any_present = false; |
- for (int j = 0; j < kNumBands; ++j) { |
+ for (size_t j = 0; j < kNumBands; ++j) { |
any_present |= is_present[j]; |
} |
if (any_present) { |