Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/test/isac_speed_test.cc

Issue 1172163004: Reformat existing code. There should be no functional effects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 EXPECT_GT(value, 0); 76 EXPECT_GT(value, 0);
77 else 77 else
78 EXPECT_EQ(0, value); 78 EXPECT_EQ(0, value);
79 } 79 }
80 clocks = clock() - clocks; 80 clocks = clock() - clocks;
81 *encoded_bytes = value; 81 *encoded_bytes = value;
82 assert(*encoded_bytes <= max_bytes); 82 assert(*encoded_bytes <= max_bytes);
83 return 1000.0 * clocks / CLOCKS_PER_SEC; 83 return 1000.0 * clocks / CLOCKS_PER_SEC;
84 } 84 }
85 85
86 float IsacSpeedTest::DecodeABlock(const uint8_t* bit_stream, int encoded_bytes, 86 float IsacSpeedTest::DecodeABlock(const uint8_t* bit_stream,
87 int encoded_bytes,
87 int16_t* out_data) { 88 int16_t* out_data) {
88 int value; 89 int value;
89 int16_t audio_type; 90 int16_t audio_type;
90 clock_t clocks = clock(); 91 clock_t clocks = clock();
91 value = WebRtcIsacfix_Decode(ISACFIX_main_inst_, 92 value = WebRtcIsacfix_Decode(ISACFIX_main_inst_, bit_stream, encoded_bytes,
92 bit_stream, 93 out_data, &audio_type);
93 encoded_bytes, 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_, 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698