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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 float IsacSpeedTest::DecodeABlock(const uint8_t* bit_stream, | 86 float IsacSpeedTest::DecodeABlock(const uint8_t* bit_stream, |
87 size_t encoded_bytes, | 87 size_t encoded_bytes, |
88 int16_t* out_data) { | 88 int16_t* out_data) { |
89 int value; | 89 int value; |
90 int16_t audio_type; | 90 int16_t audio_type; |
91 clock_t clocks = clock(); | 91 clock_t clocks = clock(); |
92 value = WebRtcIsacfix_Decode(ISACFIX_main_inst_, bit_stream, encoded_bytes, | 92 value = WebRtcIsacfix_Decode(ISACFIX_main_inst_, bit_stream, encoded_bytes, |
93 out_data, &audio_type); | 93 out_data, &audio_type); |
94 clocks = clock() - clocks; | 94 clocks = clock() - clocks; |
95 EXPECT_EQ(output_length_sample_, value); | 95 EXPECT_EQ(output_length_sample_, static_cast<size_t>(value)); |
96 return 1000.0 * clocks / CLOCKS_PER_SEC; | 96 return 1000.0 * clocks / CLOCKS_PER_SEC; |
97 } | 97 } |
98 | 98 |
99 TEST_P(IsacSpeedTest, IsacEncodeDecodeTest) { | 99 TEST_P(IsacSpeedTest, IsacEncodeDecodeTest) { |
100 size_t kDurationSec = 400; // Test audio length in second. | 100 size_t kDurationSec = 400; // Test audio length in second. |
101 EncodeDecode(kDurationSec); | 101 EncodeDecode(kDurationSec); |
102 } | 102 } |
103 | 103 |
104 const coding_param param_set[] = | 104 const coding_param param_set[] = |
105 {::std::tr1::make_tuple(1, 32000, string("audio_coding/speech_mono_16kHz"), | 105 {::std::tr1::make_tuple(1, 32000, string("audio_coding/speech_mono_16kHz"), |
106 string("pcm"), true)}; | 106 string("pcm"), true)}; |
107 | 107 |
108 INSTANTIATE_TEST_CASE_P(AllTest, IsacSpeedTest, | 108 INSTANTIATE_TEST_CASE_P(AllTest, IsacSpeedTest, |
109 ::testing::ValuesIn(param_set)); | 109 ::testing::ValuesIn(param_set)); |
110 | 110 |
111 } // namespace webrtc | 111 } // namespace webrtc |
OLD | NEW |