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

Unified Diff: webrtc/modules/audio_processing/test/test_utils.h

Issue 1534193008: Misc. small cleanups (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Unnecessary parens Created 4 years, 11 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/test/test_utils.h
diff --git a/webrtc/modules/audio_processing/test/test_utils.h b/webrtc/modules/audio_processing/test/test_utils.h
index 93a0138c1686d7009dd0b2d7cf166b84d8df0baa..291e03e5f4ab067a0d469a9bd5d64b16c02f05b0 100644
--- a/webrtc/modules/audio_processing/test/test_utils.h
+++ b/webrtc/modules/audio_processing/test/test_utils.h
@@ -78,7 +78,7 @@ void WriteIntData(const int16_t* data,
RawFile* raw_file);
void WriteFloatData(const float* const* data,
- int samples_per_channel,
+ size_t samples_per_channel,
int num_channels,
WavWriter* wav_file,
RawFile* raw_file);
@@ -86,7 +86,7 @@ void WriteFloatData(const float* const* data,
// Exits on failure; do not use in unit tests.
FILE* OpenFile(const std::string& filename, const char* mode);
-int SamplesFromRate(int rate);
+size_t SamplesFromRate(int rate);
void SetFrameSampleRate(AudioFrame* frame,
int sample_rate_hz);
@@ -104,11 +104,11 @@ void SetContainerFormat(int sample_rate_hz,
AudioProcessing::ChannelLayout LayoutFromChannels(int num_channels);
template <typename T>
-float ComputeSNR(const T* ref, const T* test, int length, float* variance) {
+float ComputeSNR(const T* ref, const T* test, size_t length, float* variance) {
float mse = 0;
float mean = 0;
*variance = 0;
- for (int i = 0; i < length; ++i) {
+ for (size_t i = 0; i < length; ++i) {
T error = ref[i] - test[i];
mse += error * error;
*variance += ref[i] * ref[i];
« no previous file with comments | « webrtc/modules/audio_processing/test/audio_processing_unittest.cc ('k') | webrtc/modules/audio_processing/test/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698