| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 float OpusSpeedTest::DecodeABlock(const uint8_t* bit_stream, | 72 float OpusSpeedTest::DecodeABlock(const uint8_t* bit_stream, |
| 73 size_t encoded_bytes, int16_t* out_data) { | 73 size_t encoded_bytes, int16_t* out_data) { |
| 74 int value; | 74 int value; |
| 75 int16_t audio_type; | 75 int16_t audio_type; |
| 76 clock_t clocks = clock(); | 76 clock_t clocks = clock(); |
| 77 value = WebRtcOpus_Decode(opus_decoder_, bit_stream, encoded_bytes, out_data, | 77 value = WebRtcOpus_Decode(opus_decoder_, bit_stream, encoded_bytes, out_data, |
| 78 &audio_type); | 78 &audio_type); |
| 79 clocks = clock() - clocks; | 79 clocks = clock() - clocks; |
| 80 EXPECT_EQ(output_length_sample_, value); | 80 EXPECT_EQ(output_length_sample_, static_cast<size_t>(value)); |
| 81 return 1000.0 * clocks / CLOCKS_PER_SEC; | 81 return 1000.0 * clocks / CLOCKS_PER_SEC; |
| 82 } | 82 } |
| 83 | 83 |
| 84 #define ADD_TEST(complexity) \ | 84 #define ADD_TEST(complexity) \ |
| 85 TEST_P(OpusSpeedTest, OpusSetComplexityTest##complexity) { \ | 85 TEST_P(OpusSpeedTest, OpusSetComplexityTest##complexity) { \ |
| 86 /* Test audio length in second. */ \ | 86 /* Test audio length in second. */ \ |
| 87 size_t kDurationSec = 400; \ | 87 size_t kDurationSec = 400; \ |
| 88 /* Set complexity. */ \ | 88 /* Set complexity. */ \ |
| 89 printf("Setting complexity to %d ...\n", complexity); \ | 89 printf("Setting complexity to %d ...\n", complexity); \ |
| 90 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_encoder_, complexity)); \ | 90 EXPECT_EQ(0, WebRtcOpus_SetComplexity(opus_encoder_, complexity)); \ |
| (...skipping 21 matching lines...) Expand all Loading... |
| 112 string("audio_coding/speech_mono_32_48kHz"), | 112 string("audio_coding/speech_mono_32_48kHz"), |
| 113 string("pcm"), true), | 113 string("pcm"), true), |
| 114 ::std::tr1::make_tuple(2, 64000, | 114 ::std::tr1::make_tuple(2, 64000, |
| 115 string("audio_coding/music_stereo_48kHz"), | 115 string("audio_coding/music_stereo_48kHz"), |
| 116 string("pcm"), true)}; | 116 string("pcm"), true)}; |
| 117 | 117 |
| 118 INSTANTIATE_TEST_CASE_P(AllTest, OpusSpeedTest, | 118 INSTANTIATE_TEST_CASE_P(AllTest, OpusSpeedTest, |
| 119 ::testing::ValuesIn(param_set)); | 119 ::testing::ValuesIn(param_set)); |
| 120 | 120 |
| 121 } // namespace webrtc | 121 } // namespace webrtc |
| OLD | NEW |