| OLD | NEW |
| 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 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 DEFINE_int32(libyuv_repeat, 0, "number of times to repeat test."); | 27 DEFINE_int32(libyuv_repeat, 0, "number of times to repeat test."); |
| 28 DEFINE_int32(libyuv_flags, 0, "cpu flags for reference code. 0 = C -1 = asm"); | 28 DEFINE_int32(libyuv_flags, 0, "cpu flags for reference code. 0 = C -1 = asm"); |
| 29 DEFINE_int32(libyuv_cpu_info, -1, | 29 DEFINE_int32(libyuv_cpu_info, -1, |
| 30 "cpu flags for benchmark code. -1 = SIMD, 1 = C"); | 30 "cpu flags for benchmark code. -1 = SIMD, 1 = C"); |
| 31 | 31 |
| 32 // For quicker unittests, default is 128 x 72. But when benchmarking, | 32 // For quicker unittests, default is 128 x 72. But when benchmarking, |
| 33 // default to 720p. Allow size to specify. | 33 // default to 720p. Allow size to specify. |
| 34 // Set flags to -1 for benchmarking to avoid slower C code. | 34 // Set flags to -1 for benchmarking to avoid slower C code. |
| 35 | 35 |
| 36 LibYUVConvertTest::LibYUVConvertTest() : | 36 LibYUVConvertTest::LibYUVConvertTest() : |
| 37 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(130), | 37 benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), |
| 38 benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) { | 38 benchmark_height_(72), disable_cpu_flags_(1), benchmark_cpu_info_(-1) { |
| 39 const char* repeat = getenv("LIBYUV_REPEAT"); | 39 const char* repeat = getenv("LIBYUV_REPEAT"); |
| 40 if (repeat) { | 40 if (repeat) { |
| 41 benchmark_iterations_ = atoi(repeat); // NOLINT | 41 benchmark_iterations_ = atoi(repeat); // NOLINT |
| 42 } | 42 } |
| 43 if (FLAGS_libyuv_repeat) { | 43 if (FLAGS_libyuv_repeat) { |
| 44 benchmark_iterations_ = FLAGS_libyuv_repeat; | 44 benchmark_iterations_ = FLAGS_libyuv_repeat; |
| 45 } | 45 } |
| 46 if (benchmark_iterations_ > 1) { | 46 if (benchmark_iterations_ > 1) { |
| 47 benchmark_width_ = 1280; | 47 benchmark_width_ = 1280; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 346 } |
| 347 | 347 |
| 348 int main(int argc, char** argv) { | 348 int main(int argc, char** argv) { |
| 349 ::testing::InitGoogleTest(&argc, argv); | 349 ::testing::InitGoogleTest(&argc, argv); |
| 350 // AllowCommandLineParsing allows us to ignore flags passed on to us by | 350 // AllowCommandLineParsing allows us to ignore flags passed on to us by |
| 351 // Chromium build bots without having to explicitly disable them. | 351 // Chromium build bots without having to explicitly disable them. |
| 352 google::AllowCommandLineReparsing(); | 352 google::AllowCommandLineReparsing(); |
| 353 google::ParseCommandLineFlags(&argc, &argv, true); | 353 google::ParseCommandLineFlags(&argc, &argv, true); |
| 354 return RUN_ALL_TESTS(); | 354 return RUN_ALL_TESTS(); |
| 355 } | 355 } |
| OLD | NEW |