| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes, | 28 float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes, |
| 29 int16_t* out_data) override; | 29 int16_t* out_data) override; |
| 30 WebRtcOpusEncInst* opus_encoder_; | 30 WebRtcOpusEncInst* opus_encoder_; |
| 31 WebRtcOpusDecInst* opus_decoder_; | 31 WebRtcOpusDecInst* opus_decoder_; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 OpusSpeedTest::OpusSpeedTest() | 34 OpusSpeedTest::OpusSpeedTest() |
| 35 : AudioCodecSpeedTest(kOpusBlockDurationMs, | 35 : AudioCodecSpeedTest(kOpusBlockDurationMs, |
| 36 kOpusSamplingKhz, | 36 kOpusSamplingKhz, |
| 37 kOpusSamplingKhz), | 37 kOpusSamplingKhz), |
| 38 opus_encoder_(NULL), | 38 opus_encoder_(nullptr), |
| 39 opus_decoder_(NULL) { | 39 opus_decoder_(nullptr) {} |
| 40 } | |
| 41 | 40 |
| 42 void OpusSpeedTest::SetUp() { | 41 void OpusSpeedTest::SetUp() { |
| 43 AudioCodecSpeedTest::SetUp(); | 42 AudioCodecSpeedTest::SetUp(); |
| 44 // If channels_ == 1, use Opus VOIP mode, otherwise, audio mode. | 43 // If channels_ == 1, use Opus VOIP mode, otherwise, audio mode. |
| 45 int app = channels_ == 1 ? 0 : 1; | 44 int app = channels_ == 1 ? 0 : 1; |
| 46 /* Create encoder memory. */ | 45 /* Create encoder memory. */ |
| 47 EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_encoder_, channels_, app)); | 46 EXPECT_EQ(0, WebRtcOpus_EncoderCreate(&opus_encoder_, channels_, app)); |
| 48 EXPECT_EQ(0, WebRtcOpus_DecoderCreate(&opus_decoder_, channels_)); | 47 EXPECT_EQ(0, WebRtcOpus_DecoderCreate(&opus_decoder_, channels_)); |
| 49 /* Set bitrate. */ | 48 /* Set bitrate. */ |
| 50 EXPECT_EQ(0, WebRtcOpus_SetBitRate(opus_encoder_, bit_rate_)); | 49 EXPECT_EQ(0, WebRtcOpus_SetBitRate(opus_encoder_, bit_rate_)); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 string("audio_coding/speech_mono_32_48kHz"), | 111 string("audio_coding/speech_mono_32_48kHz"), |
| 113 string("pcm"), true), | 112 string("pcm"), true), |
| 114 ::std::tr1::make_tuple(2, 64000, | 113 ::std::tr1::make_tuple(2, 64000, |
| 115 string("audio_coding/music_stereo_48kHz"), | 114 string("audio_coding/music_stereo_48kHz"), |
| 116 string("pcm"), true)}; | 115 string("pcm"), true)}; |
| 117 | 116 |
| 118 INSTANTIATE_TEST_CASE_P(AllTest, OpusSpeedTest, | 117 INSTANTIATE_TEST_CASE_P(AllTest, OpusSpeedTest, |
| 119 ::testing::ValuesIn(param_set)); | 118 ::testing::ValuesIn(param_set)); |
| 120 | 119 |
| 121 } // namespace webrtc | 120 } // namespace webrtc |
| OLD | NEW |