Opus wrapper: Use const for inputs and uint8[] for byte streams

About half of the functions already followed the desired pattern; this
patch fixes the other half.

BUG=909
R=aluebs@webrtc.org, bjornv@webrtc.org, henrik.lundin@webrtc.org, minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/26719004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7409 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kwiberg@webrtc.org
2014-10-09 11:21:10 +00:00
parent 1bada48401
commit 4bd2db9a55
3 changed files with 41 additions and 44 deletions

View File

@@ -131,7 +131,6 @@ TEST_F(OpusTest, OpusEncodeDecodeMono) {
int16_t audio_type;
int16_t output_data_decode_new[kOpusMaxFrameSamples];
int16_t output_data_decode[kOpusMaxFrameSamples];
int16_t* coded = reinterpret_cast<int16_t*>(bitstream_);
encoded_bytes = WebRtcOpus_Encode(opus_mono_encoder_, speech_data_,
kOpus20msFrameSamples, kMaxBytes,
bitstream_);
@@ -140,7 +139,7 @@ TEST_F(OpusTest, OpusEncodeDecodeMono) {
encoded_bytes, output_data_decode_new,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_Decode(opus_mono_decoder_, coded,
WebRtcOpus_Decode(opus_mono_decoder_, bitstream_,
encoded_bytes, output_data_decode,
&audio_type));
@@ -175,7 +174,6 @@ TEST_F(OpusTest, OpusEncodeDecodeStereo) {
int16_t output_data_decode_new[kOpusMaxFrameSamples];
int16_t output_data_decode[kOpusMaxFrameSamples];
int16_t output_data_decode_slave[kOpusMaxFrameSamples];
int16_t* coded = reinterpret_cast<int16_t*>(bitstream_);
encoded_bytes = WebRtcOpus_Encode(opus_stereo_encoder_, speech_data_,
kOpus20msFrameSamples, kMaxBytes,
bitstream_);
@@ -184,11 +182,11 @@ TEST_F(OpusTest, OpusEncodeDecodeStereo) {
encoded_bytes, output_data_decode_new,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_Decode(opus_stereo_decoder_, coded,
WebRtcOpus_Decode(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, coded,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode_slave,
&audio_type));
@@ -259,7 +257,6 @@ TEST_F(OpusTest, OpusDecodeInit) {
int16_t output_data_decode_new[kOpusMaxFrameSamples];
int16_t output_data_decode[kOpusMaxFrameSamples];
int16_t output_data_decode_slave[kOpusMaxFrameSamples];
int16_t* coded = reinterpret_cast<int16_t*>(bitstream_);
encoded_bytes = WebRtcOpus_Encode(opus_stereo_encoder_, speech_data_,
kOpus20msFrameSamples, kMaxBytes,
bitstream_);
@@ -268,11 +265,11 @@ TEST_F(OpusTest, OpusDecodeInit) {
encoded_bytes, output_data_decode_new,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_Decode(opus_stereo_decoder_, coded,
WebRtcOpus_Decode(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, coded,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode_slave,
&audio_type));
@@ -293,11 +290,11 @@ TEST_F(OpusTest, OpusDecodeInit) {
encoded_bytes, output_data_decode_new,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_Decode(opus_stereo_decoder_, coded,
WebRtcOpus_Decode(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, coded,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode_slave,
&audio_type));
@@ -399,7 +396,6 @@ TEST_F(OpusTest, OpusDecodePlcMono) {
int16_t audio_type;
int16_t output_data_decode_new[kOpusMaxFrameSamples];
int16_t output_data_decode[kOpusMaxFrameSamples];
int16_t* coded = reinterpret_cast<int16_t*>(bitstream_);
encoded_bytes = WebRtcOpus_Encode(opus_mono_encoder_, speech_data_,
kOpus20msFrameSamples, kMaxBytes,
bitstream_);
@@ -408,7 +404,7 @@ TEST_F(OpusTest, OpusDecodePlcMono) {
encoded_bytes, output_data_decode_new,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_Decode(opus_mono_decoder_, coded,
WebRtcOpus_Decode(opus_mono_decoder_, bitstream_,
encoded_bytes, output_data_decode,
&audio_type));
@@ -451,7 +447,6 @@ TEST_F(OpusTest, OpusDecodePlcStereo) {
int16_t output_data_decode_new[kOpusMaxFrameSamples];
int16_t output_data_decode[kOpusMaxFrameSamples];
int16_t output_data_decode_slave[kOpusMaxFrameSamples];
int16_t* coded = reinterpret_cast<int16_t*>(bitstream_);
encoded_bytes = WebRtcOpus_Encode(opus_stereo_encoder_, speech_data_,
kOpus20msFrameSamples, kMaxBytes,
bitstream_);
@@ -460,11 +455,11 @@ TEST_F(OpusTest, OpusDecodePlcStereo) {
encoded_bytes, output_data_decode_new,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_Decode(opus_stereo_decoder_, coded,
WebRtcOpus_Decode(opus_stereo_decoder_, bitstream_,
encoded_bytes, output_data_decode,
&audio_type));
EXPECT_EQ(kOpus20msFrameSamples,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, coded,
WebRtcOpus_DecodeSlave(opus_stereo_decoder_, bitstream_,
encoded_bytes,
output_data_decode_slave,
&audio_type));