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

Side by Side Diff: unit_test/unit_test.cc

Issue 1414483002: add gflags support files from webrtc (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: add libyuv_flags option Created 5 years, 2 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
« no previous file with comments | « libyuv_test.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2011 The LibYuv 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
11 #include "../unit_test/unit_test.h" 11 #include "../unit_test/unit_test.h"
12 12
13 #include <stdlib.h> // For getenv() 13 #include <stdlib.h> // For getenv()
14 14
15 #include <cstring> 15 #include <cstring>
16 16
17 #include "gflags/gflags.h"
18 #include "testing/gtest/include/gtest/gtest.h"
19
17 // Change this to 1000 for benchmarking. 20 // Change this to 1000 for benchmarking.
18 // TODO(fbarchard): Add command line parsing to pass this as option. 21 // TODO(fbarchard): Add command line parsing to pass this as option.
19 #define BENCHMARK_ITERATIONS 1 22 #define BENCHMARK_ITERATIONS 1
20 23
21 int fastrand_seed = 0xfb; 24 int fastrand_seed = 0xfb;
22 25
26 DEFINE_int32(libyuv_width, 0, "width of test image.");
27 DEFINE_int32(libyuv_height, 0, "height of test image.");
28 DEFINE_int32(libyuv_repeat, 0, "number of times to repeat test.");
29 DEFINE_int32(libyuv_flags, 0, "cpu flags for reference code. 0 = C -1 = asm");
30
31 // For quicker unittests, default is 128 x 72. But when benchmarking,
32 // default to 720p. Allow size to specify.
33 // Set flags to -1 for benchmarking to avoid slower C code.
34
23 LibYUVConvertTest::LibYUVConvertTest() : 35 LibYUVConvertTest::LibYUVConvertTest() :
24 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), 36 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
25 benchmark_height_(72), disable_cpu_flags_(0) { 37 benchmark_height_(72), disable_cpu_flags_(0) {
26 const char* repeat = getenv("LIBYUV_REPEAT"); 38 const char* repeat = getenv("LIBYUV_REPEAT");
27 if (repeat) { 39 if (repeat) {
28 benchmark_iterations_ = atoi(repeat); // NOLINT 40 benchmark_iterations_ = atoi(repeat); // NOLINT
29 // For quicker unittests, default is 128 x 72. But when benchmarking, 41 }
30 // default to 720p. Allow size to specify. 42 if (FLAGS_libyuv_repeat) {
31 if (benchmark_iterations_ > 1) { 43 benchmark_iterations_ = FLAGS_libyuv_repeat;
32 benchmark_width_ = 1280; 44 }
33 benchmark_height_ = 720; 45 if (benchmark_iterations_ > 1) {
34 } 46 benchmark_width_ = 1280;
35 } 47 benchmark_height_ = 720;
36 const char* width = getenv("LIBYUV_WIDTH"); 48 }
37 if (width) { 49 const char* width = getenv("LIBYUV_WIDTH");
38 benchmark_width_ = atoi(width); // NOLINT 50 if (width) {
39 } 51 benchmark_width_ = atoi(width); // NOLINT
40 const char* height = getenv("LIBYUV_HEIGHT"); 52 }
41 if (height) { 53 if (FLAGS_libyuv_width) {
42 benchmark_height_ = atoi(height); // NOLINT 54 benchmark_width_ = FLAGS_libyuv_width;
43 } 55 }
44 const char* cpu_flags = getenv("LIBYUV_FLAGS"); 56 const char* height = getenv("LIBYUV_HEIGHT");
45 if (cpu_flags) { 57 if (height) {
46 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT 58 benchmark_height_ = atoi(height); // NOLINT
47 } 59 }
48 benchmark_pixels_div256_ = static_cast<int>(( 60 if (FLAGS_libyuv_height) {
49 static_cast<double>(Abs(benchmark_width_)) * 61 benchmark_height_ = FLAGS_libyuv_height;
50 static_cast<double>(Abs(benchmark_height_)) * 62 }
51 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0); 63 const char* cpu_flags = getenv("LIBYUV_FLAGS");
52 benchmark_pixels_div1280_ = static_cast<int>(( 64 if (cpu_flags) {
53 static_cast<double>(Abs(benchmark_width_)) * 65 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
54 static_cast<double>(Abs(benchmark_height_)) * 66 }
55 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0); 67 if (FLAGS_libyuv_flags) {
68 disable_cpu_flags_ = FLAGS_libyuv_flags;
69 }
70 benchmark_pixels_div256_ = static_cast<int>((
71 static_cast<double>(Abs(benchmark_width_)) *
72 static_cast<double>(Abs(benchmark_height_)) *
73 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
74 benchmark_pixels_div1280_ = static_cast<int>((
75 static_cast<double>(Abs(benchmark_width_)) *
76 static_cast<double>(Abs(benchmark_height_)) *
77 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
56 } 78 }
57 79
58 LibYUVColorTest::LibYUVColorTest() : 80 LibYUVColorTest::LibYUVColorTest() :
59 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), 81 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
60 benchmark_height_(72), disable_cpu_flags_(0) { 82 benchmark_height_(72), disable_cpu_flags_(0) {
61 const char* repeat = getenv("LIBYUV_REPEAT"); 83 const char* repeat = getenv("LIBYUV_REPEAT");
62 if (repeat) { 84 if (repeat) {
63 benchmark_iterations_ = atoi(repeat); // NOLINT 85 benchmark_iterations_ = atoi(repeat); // NOLINT
64 // For quicker unittests, default is 128 x 72. But when benchmarking, 86 }
65 // default to 720p. Allow size to specify. 87 if (FLAGS_libyuv_repeat) {
66 if (benchmark_iterations_ > 1) { 88 benchmark_iterations_ = FLAGS_libyuv_repeat;
67 benchmark_width_ = 1280; 89 }
68 benchmark_height_ = 720; 90 if (benchmark_iterations_ > 1) {
69 } 91 benchmark_width_ = 1280;
70 } 92 benchmark_height_ = 720;
71 const char* width = getenv("LIBYUV_WIDTH"); 93 }
72 if (width) { 94 const char* width = getenv("LIBYUV_WIDTH");
73 benchmark_width_ = atoi(width); // NOLINT 95 if (width) {
74 } 96 benchmark_width_ = atoi(width); // NOLINT
75 const char* height = getenv("LIBYUV_HEIGHT"); 97 }
76 if (height) { 98 if (FLAGS_libyuv_width) {
77 benchmark_height_ = atoi(height); // NOLINT 99 benchmark_width_ = FLAGS_libyuv_width;
78 } 100 }
79 const char* cpu_flags = getenv("LIBYUV_FLAGS"); 101 const char* height = getenv("LIBYUV_HEIGHT");
80 if (cpu_flags) { 102 if (height) {
81 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT 103 benchmark_height_ = atoi(height); // NOLINT
82 } 104 }
83 benchmark_pixels_div256_ = static_cast<int>(( 105 if (FLAGS_libyuv_height) {
84 static_cast<double>(Abs(benchmark_width_)) * 106 benchmark_height_ = FLAGS_libyuv_height;
85 static_cast<double>(Abs(benchmark_height_)) * 107 }
86 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0); 108 const char* cpu_flags = getenv("LIBYUV_FLAGS");
87 benchmark_pixels_div1280_ = static_cast<int>(( 109 if (cpu_flags) {
88 static_cast<double>(Abs(benchmark_width_)) * 110 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
89 static_cast<double>(Abs(benchmark_height_)) * 111 }
90 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0); 112 if (FLAGS_libyuv_flags) {
113 disable_cpu_flags_ = FLAGS_libyuv_flags;
114 }
115 benchmark_pixels_div256_ = static_cast<int>((
116 static_cast<double>(Abs(benchmark_width_)) *
117 static_cast<double>(Abs(benchmark_height_)) *
118 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
119 benchmark_pixels_div1280_ = static_cast<int>((
120 static_cast<double>(Abs(benchmark_width_)) *
121 static_cast<double>(Abs(benchmark_height_)) *
122 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
91 } 123 }
92 124
93 LibYUVScaleTest::LibYUVScaleTest() : 125 LibYUVScaleTest::LibYUVScaleTest() :
94 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), 126 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
95 benchmark_height_(72), disable_cpu_flags_(0) { 127 benchmark_height_(72), disable_cpu_flags_(0) {
96 const char* repeat = getenv("LIBYUV_REPEAT"); 128 const char* repeat = getenv("LIBYUV_REPEAT");
97 if (repeat) { 129 if (repeat) {
98 benchmark_iterations_ = atoi(repeat); // NOLINT 130 benchmark_iterations_ = atoi(repeat); // NOLINT
99 // For quicker unittests, default is 128 x 72. But when benchmarking, 131 }
100 // default to 720p. Allow size to specify. 132 if (FLAGS_libyuv_repeat) {
101 if (benchmark_iterations_ > 1) { 133 benchmark_iterations_ = FLAGS_libyuv_repeat;
102 benchmark_width_ = 1280; 134 }
103 benchmark_height_ = 720; 135 if (benchmark_iterations_ > 1) {
104 } 136 benchmark_width_ = 1280;
105 } 137 benchmark_height_ = 720;
106 const char* width = getenv("LIBYUV_WIDTH"); 138 }
107 if (width) { 139 const char* width = getenv("LIBYUV_WIDTH");
108 benchmark_width_ = atoi(width); // NOLINT 140 if (width) {
109 } 141 benchmark_width_ = atoi(width); // NOLINT
110 const char* height = getenv("LIBYUV_HEIGHT"); 142 }
111 if (height) { 143 if (FLAGS_libyuv_width) {
112 benchmark_height_ = atoi(height); // NOLINT 144 benchmark_width_ = FLAGS_libyuv_width;
113 } 145 }
114 const char* cpu_flags = getenv("LIBYUV_FLAGS"); 146 const char* height = getenv("LIBYUV_HEIGHT");
115 if (cpu_flags) { 147 if (height) {
116 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT 148 benchmark_height_ = atoi(height); // NOLINT
117 } 149 }
118 benchmark_pixels_div256_ = static_cast<int>(( 150 if (FLAGS_libyuv_height) {
119 static_cast<double>(Abs(benchmark_width_)) * 151 benchmark_height_ = FLAGS_libyuv_height;
120 static_cast<double>(Abs(benchmark_height_)) * 152 }
121 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0); 153 const char* cpu_flags = getenv("LIBYUV_FLAGS");
122 benchmark_pixels_div1280_ = static_cast<int>(( 154 if (cpu_flags) {
123 static_cast<double>(Abs(benchmark_width_)) * 155 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
124 static_cast<double>(Abs(benchmark_height_)) * 156 }
125 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0); 157 if (FLAGS_libyuv_flags) {
158 disable_cpu_flags_ = FLAGS_libyuv_flags;
159 }
160 benchmark_pixels_div256_ = static_cast<int>((
161 static_cast<double>(Abs(benchmark_width_)) *
162 static_cast<double>(Abs(benchmark_height_)) *
163 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
164 benchmark_pixels_div1280_ = static_cast<int>((
165 static_cast<double>(Abs(benchmark_width_)) *
166 static_cast<double>(Abs(benchmark_height_)) *
167 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
126 } 168 }
127 169
128 LibYUVRotateTest::LibYUVRotateTest() : 170 LibYUVRotateTest::LibYUVRotateTest() :
129 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), 171 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
130 benchmark_height_(72), disable_cpu_flags_(0) { 172 benchmark_height_(72), disable_cpu_flags_(0) {
131 const char* repeat = getenv("LIBYUV_REPEAT"); 173 const char* repeat = getenv("LIBYUV_REPEAT");
132 if (repeat) { 174 if (repeat) {
133 benchmark_iterations_ = atoi(repeat); // NOLINT 175 benchmark_iterations_ = atoi(repeat); // NOLINT
134 // For quicker unittests, default is 128 x 72. But when benchmarking, 176 }
135 // default to 720p. Allow size to specify. 177 if (FLAGS_libyuv_repeat) {
136 if (benchmark_iterations_ > 1) { 178 benchmark_iterations_ = FLAGS_libyuv_repeat;
137 benchmark_width_ = 1280; 179 }
138 benchmark_height_ = 720; 180 if (benchmark_iterations_ > 1) {
139 } 181 benchmark_width_ = 1280;
140 } 182 benchmark_height_ = 720;
141 const char* width = getenv("LIBYUV_WIDTH"); 183 }
142 if (width) { 184 const char* width = getenv("LIBYUV_WIDTH");
143 benchmark_width_ = atoi(width); // NOLINT 185 if (width) {
144 } 186 benchmark_width_ = atoi(width); // NOLINT
145 const char* height = getenv("LIBYUV_HEIGHT"); 187 }
146 if (height) { 188 if (FLAGS_libyuv_width) {
147 benchmark_height_ = atoi(height); // NOLINT 189 benchmark_width_ = FLAGS_libyuv_width;
148 } 190 }
149 const char* cpu_flags = getenv("LIBYUV_FLAGS"); 191 const char* height = getenv("LIBYUV_HEIGHT");
150 if (cpu_flags) { 192 if (height) {
151 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT 193 benchmark_height_ = atoi(height); // NOLINT
152 } 194 }
153 benchmark_pixels_div256_ = static_cast<int>(( 195 if (FLAGS_libyuv_height) {
154 static_cast<double>(Abs(benchmark_width_)) * 196 benchmark_height_ = FLAGS_libyuv_height;
155 static_cast<double>(Abs(benchmark_height_)) * 197 }
156 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0); 198 const char* cpu_flags = getenv("LIBYUV_FLAGS");
157 benchmark_pixels_div1280_ = static_cast<int>(( 199 if (cpu_flags) {
158 static_cast<double>(Abs(benchmark_width_)) * 200 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
159 static_cast<double>(Abs(benchmark_height_)) * 201 }
160 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0); 202 if (FLAGS_libyuv_flags) {
203 disable_cpu_flags_ = FLAGS_libyuv_flags;
204 }
205 benchmark_pixels_div256_ = static_cast<int>((
206 static_cast<double>(Abs(benchmark_width_)) *
207 static_cast<double>(Abs(benchmark_height_)) *
208 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
209 benchmark_pixels_div1280_ = static_cast<int>((
210 static_cast<double>(Abs(benchmark_width_)) *
211 static_cast<double>(Abs(benchmark_height_)) *
212 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
161 } 213 }
162 214
163 LibYUVPlanarTest::LibYUVPlanarTest() : 215 LibYUVPlanarTest::LibYUVPlanarTest() :
164 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), 216 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
165 benchmark_height_(72), disable_cpu_flags_(0) { 217 benchmark_height_(72), disable_cpu_flags_(0) {
166 const char* repeat = getenv("LIBYUV_REPEAT"); 218 const char* repeat = getenv("LIBYUV_REPEAT");
167 if (repeat) { 219 if (repeat) {
168 benchmark_iterations_ = atoi(repeat); // NOLINT 220 benchmark_iterations_ = atoi(repeat); // NOLINT
169 // For quicker unittests, default is 128 x 72. But when benchmarking, 221 }
170 // default to 720p. Allow size to specify. 222 if (FLAGS_libyuv_repeat) {
171 if (benchmark_iterations_ > 1) { 223 benchmark_iterations_ = FLAGS_libyuv_repeat;
172 benchmark_width_ = 1280; 224 }
173 benchmark_height_ = 720; 225 if (benchmark_iterations_ > 1) {
174 } 226 benchmark_width_ = 1280;
175 } 227 benchmark_height_ = 720;
176 const char* width = getenv("LIBYUV_WIDTH"); 228 }
177 if (width) { 229 const char* width = getenv("LIBYUV_WIDTH");
178 benchmark_width_ = atoi(width); // NOLINT 230 if (width) {
179 } 231 benchmark_width_ = atoi(width); // NOLINT
180 const char* height = getenv("LIBYUV_HEIGHT"); 232 }
181 if (height) { 233 if (FLAGS_libyuv_width) {
182 benchmark_height_ = atoi(height); // NOLINT 234 benchmark_width_ = FLAGS_libyuv_width;
183 } 235 }
184 const char* cpu_flags = getenv("LIBYUV_FLAGS"); 236 const char* height = getenv("LIBYUV_HEIGHT");
185 if (cpu_flags) { 237 if (height) {
186 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT 238 benchmark_height_ = atoi(height); // NOLINT
187 } 239 }
188 benchmark_pixels_div256_ = static_cast<int>(( 240 if (FLAGS_libyuv_height) {
189 static_cast<double>(Abs(benchmark_width_)) * 241 benchmark_height_ = FLAGS_libyuv_height;
190 static_cast<double>(Abs(benchmark_height_)) * 242 }
191 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0); 243 const char* cpu_flags = getenv("LIBYUV_FLAGS");
192 benchmark_pixels_div1280_ = static_cast<int>(( 244 if (cpu_flags) {
193 static_cast<double>(Abs(benchmark_width_)) * 245 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
194 static_cast<double>(Abs(benchmark_height_)) * 246 }
195 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0); 247 if (FLAGS_libyuv_flags) {
248 disable_cpu_flags_ = FLAGS_libyuv_flags;
249 }
250 benchmark_pixels_div256_ = static_cast<int>((
251 static_cast<double>(Abs(benchmark_width_)) *
252 static_cast<double>(Abs(benchmark_height_)) *
253 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
254 benchmark_pixels_div1280_ = static_cast<int>((
255 static_cast<double>(Abs(benchmark_width_)) *
256 static_cast<double>(Abs(benchmark_height_)) *
257 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
196 } 258 }
197 259
198 LibYUVBaseTest::LibYUVBaseTest() : 260 LibYUVBaseTest::LibYUVBaseTest() :
199 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), 261 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
200 benchmark_height_(72), disable_cpu_flags_(0) { 262 benchmark_height_(72), disable_cpu_flags_(0) {
201 const char* repeat = getenv("LIBYUV_REPEAT"); 263 const char* repeat = getenv("LIBYUV_REPEAT");
202 if (repeat) { 264 if (repeat) {
203 benchmark_iterations_ = atoi(repeat); // NOLINT 265 benchmark_iterations_ = atoi(repeat); // NOLINT
204 // For quicker unittests, default is 128 x 72. But when benchmarking, 266 }
205 // default to 720p. Allow size to specify. 267 if (FLAGS_libyuv_repeat) {
206 if (benchmark_iterations_ > 1) { 268 benchmark_iterations_ = FLAGS_libyuv_repeat;
207 benchmark_width_ = 1280; 269 }
208 benchmark_height_ = 720; 270 if (benchmark_iterations_ > 1) {
209 } 271 benchmark_width_ = 1280;
210 } 272 benchmark_height_ = 720;
211 const char* width = getenv("LIBYUV_WIDTH"); 273 }
212 if (width) { 274 const char* width = getenv("LIBYUV_WIDTH");
213 benchmark_width_ = atoi(width); // NOLINT 275 if (width) {
214 } 276 benchmark_width_ = atoi(width); // NOLINT
215 const char* height = getenv("LIBYUV_HEIGHT"); 277 }
216 if (height) { 278 if (FLAGS_libyuv_width) {
217 benchmark_height_ = atoi(height); // NOLINT 279 benchmark_width_ = FLAGS_libyuv_width;
218 } 280 }
219 const char* cpu_flags = getenv("LIBYUV_FLAGS"); 281 const char* height = getenv("LIBYUV_HEIGHT");
220 if (cpu_flags) { 282 if (height) {
221 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT 283 benchmark_height_ = atoi(height); // NOLINT
222 } 284 }
223 benchmark_pixels_div256_ = static_cast<int>(( 285 if (FLAGS_libyuv_height) {
224 static_cast<double>(Abs(benchmark_width_)) * 286 benchmark_height_ = FLAGS_libyuv_height;
225 static_cast<double>(Abs(benchmark_height_)) * 287 }
226 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0); 288 const char* cpu_flags = getenv("LIBYUV_FLAGS");
227 benchmark_pixels_div1280_ = static_cast<int>(( 289 if (cpu_flags) {
228 static_cast<double>(Abs(benchmark_width_)) * 290 disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
229 static_cast<double>(Abs(benchmark_height_)) * 291 }
230 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0); 292 if (FLAGS_libyuv_flags) {
293 disable_cpu_flags_ = FLAGS_libyuv_flags;
294 }
295 benchmark_pixels_div256_ = static_cast<int>((
296 static_cast<double>(Abs(benchmark_width_)) *
297 static_cast<double>(Abs(benchmark_height_)) *
298 static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
299 benchmark_pixels_div1280_ = static_cast<int>((
300 static_cast<double>(Abs(benchmark_width_)) *
301 static_cast<double>(Abs(benchmark_height_)) *
302 static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
231 } 303 }
232 304
233 int main(int argc, char** argv) { 305 int main(int argc, char** argv) {
234 ::testing::InitGoogleTest(&argc, argv); 306 ::testing::InitGoogleTest(&argc, argv);
307 google::ParseCommandLineFlags(&argc, &argv, true);
235 return RUN_ALL_TESTS(); 308 return RUN_ALL_TESTS();
236 } 309 }
OLDNEW
« no previous file with comments | « libyuv_test.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698