| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #include <string> | 10 #include <string> |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 369 |
| 370 // Encode & decode. | 370 // Encode & decode. |
| 371 int16_t audio_type; | 371 int16_t audio_type; |
| 372 int16_t* output_data_decode = new int16_t[kOpus20msFrameSamples * channels_]; | 372 int16_t* output_data_decode = new int16_t[kOpus20msFrameSamples * channels_]; |
| 373 EXPECT_EQ(kOpus20msFrameSamples, | 373 EXPECT_EQ(kOpus20msFrameSamples, |
| 374 static_cast<size_t>(EncodeDecode( | 374 static_cast<size_t>(EncodeDecode( |
| 375 opus_encoder_, speech_data_.GetNextBlock(), | 375 opus_encoder_, speech_data_.GetNextBlock(), |
| 376 kOpus20msFrameSamples, opus_decoder_, output_data_decode, | 376 kOpus20msFrameSamples, opus_decoder_, output_data_decode, |
| 377 &audio_type))); | 377 &audio_type))); |
| 378 | 378 |
| 379 EXPECT_EQ(0, WebRtcOpus_DecoderInit(opus_decoder_)); | 379 WebRtcOpus_DecoderInit(opus_decoder_); |
| 380 | 380 |
| 381 EXPECT_EQ(kOpus20msFrameSamples, | 381 EXPECT_EQ(kOpus20msFrameSamples, |
| 382 static_cast<size_t>(WebRtcOpus_Decode( | 382 static_cast<size_t>(WebRtcOpus_Decode( |
| 383 opus_decoder_, bitstream_, encoded_bytes_, output_data_decode, | 383 opus_decoder_, bitstream_, encoded_bytes_, output_data_decode, |
| 384 &audio_type))); | 384 &audio_type))); |
| 385 | 385 |
| 386 // Free memory. | 386 // Free memory. |
| 387 delete[] output_data_decode; | 387 delete[] output_data_decode; |
| 388 EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_)); | 388 EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_)); |
| 389 EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_)); | 389 EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_)); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_)); | 614 EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_)); |
| 615 EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_)); | 615 EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_)); |
| 616 } | 616 } |
| 617 | 617 |
| 618 INSTANTIATE_TEST_CASE_P(VariousMode, | 618 INSTANTIATE_TEST_CASE_P(VariousMode, |
| 619 OpusTest, | 619 OpusTest, |
| 620 Combine(Values(1, 2), Values(0, 1))); | 620 Combine(Values(1, 2), Values(0, 1))); |
| 621 | 621 |
| 622 | 622 |
| 623 } // namespace webrtc | 623 } // namespace webrtc |
| OLD | NEW |