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

Unified Diff: webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.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
Index: webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc b/webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc
index 8f073adf7ebeda9d530a91ce2b05db7f609f00a0..fc7588dac89309c71b5391bebed42586c95f85f4 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc
@@ -26,8 +26,8 @@ class IsacSpeedTest : public AudioCodecSpeedTest {
void SetUp() override;
void TearDown() override;
virtual float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
- int max_bytes, int* encoded_bytes);
- virtual float DecodeABlock(const uint8_t* bit_stream, int encoded_bytes,
+ size_t max_bytes, size_t* encoded_bytes);
+ virtual float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
int16_t* out_data);
ISACFIX_MainStruct *ISACFIX_main_inst_;
};
@@ -43,7 +43,7 @@ void IsacSpeedTest::SetUp() {
AudioCodecSpeedTest::SetUp();
// Check whether the allocated buffer for the bit stream is large enough.
- EXPECT_GE(max_bytes_, STREAM_MAXW16_60MS);
+ EXPECT_GE(max_bytes_, static_cast<size_t>(STREAM_MAXW16_60MS));
// Create encoder memory.
EXPECT_EQ(0, WebRtcIsacfix_Create(&ISACFIX_main_inst_));
@@ -61,7 +61,7 @@ void IsacSpeedTest::TearDown() {
}
float IsacSpeedTest::EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
- int max_bytes, int* encoded_bytes) {
+ size_t max_bytes, size_t* encoded_bytes) {
// ISAC takes 10 ms everycall
const int subblocks = block_duration_ms_ / 10;
const int subblock_length = 10 * input_sampling_khz_;
@@ -78,13 +78,13 @@ float IsacSpeedTest::EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
EXPECT_EQ(0, value);
}
clocks = clock() - clocks;
- *encoded_bytes = value;
+ *encoded_bytes = static_cast<size_t>(value);
assert(*encoded_bytes <= max_bytes);
return 1000.0 * clocks / CLOCKS_PER_SEC;
}
float IsacSpeedTest::DecodeABlock(const uint8_t* bit_stream,
- int encoded_bytes,
+ size_t encoded_bytes,
int16_t* out_data) {
int value;
int16_t audio_type;

Powered by Google App Engine
This is Rietveld 408576698