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

Unified Diff: webrtc/modules/audio_coding/codecs/opus/opus_speed_test.cc

Issue 1225173002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments 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/opus/opus_speed_test.cc
diff --git a/webrtc/modules/audio_coding/codecs/opus/opus_speed_test.cc b/webrtc/modules/audio_coding/codecs/opus/opus_speed_test.cc
index b39de499a7f619cf38fb5d81b9ea8958feed0957..926bcaf9d127b8fb97dfe7bb1ebecf58a993beb2 100644
--- a/webrtc/modules/audio_coding/codecs/opus/opus_speed_test.cc
+++ b/webrtc/modules/audio_coding/codecs/opus/opus_speed_test.cc
@@ -24,8 +24,8 @@ class OpusSpeedTest : 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);
WebRtcOpusEncInst* opus_encoder_;
WebRtcOpusDecInst* opus_decoder_;
@@ -58,19 +58,19 @@ void OpusSpeedTest::TearDown() {
}
float OpusSpeedTest::EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
- int max_bytes, int* encoded_bytes) {
+ size_t max_bytes, size_t* encoded_bytes) {
clock_t clocks = clock();
int value = WebRtcOpus_Encode(opus_encoder_, in_data,
input_length_sample_, max_bytes,
bit_stream);
clocks = clock() - clocks;
EXPECT_GT(value, 0);
- *encoded_bytes = value;
+ *encoded_bytes = static_cast<size_t>(value);
return 1000.0 * clocks / CLOCKS_PER_SEC;
}
float OpusSpeedTest::DecodeABlock(const uint8_t* bit_stream,
- int encoded_bytes, int16_t* out_data) {
+ size_t encoded_bytes, int16_t* out_data) {
int value;
int16_t audio_type;
clock_t clocks = clock();

Powered by Google App Engine
This is Rietveld 408576698