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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 dst_width > kMaxWidth || dst_height > kMaxHeight) { | 60 dst_width > kMaxWidth || dst_height > kMaxHeight) { |
61 printf("Warning - size too large to test. Skipping\n"); | 61 printf("Warning - size too large to test. Skipping\n"); |
62 return false; | 62 return false; |
63 } | 63 } |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 #define align_buffer_page_end(var, size) \ | 67 #define align_buffer_page_end(var, size) \ |
68 uint8* var; \ | 68 uint8* var; \ |
69 uint8* var##_mem; \ | 69 uint8* var##_mem; \ |
70 var##_mem = reinterpret_cast<uint8*>(malloc((((size) + 4095) & ~4095) + \ | 70 var##_mem = reinterpret_cast<uint8*>(malloc(((size) + 4095 + 63) & ~4095)); \ |
71 OFFBY)); \ | 71 var = (uint8*)((intptr_t)(var##_mem + (((size) + 4095 + 63) & ~4095) - \ |
72 var = var##_mem + (-(size) & 4095) + OFFBY; | 72 (size)) & ~63); |
73 | 73 |
74 #define free_aligned_buffer_page_end(var) \ | 74 #define free_aligned_buffer_page_end(var) \ |
75 free(var##_mem); \ | 75 free(var##_mem); \ |
76 var = 0; | 76 var = 0; |
77 | 77 |
78 #ifdef WIN32 | 78 #ifdef WIN32 |
79 static inline double get_time() { | 79 static inline double get_time() { |
80 LARGE_INTEGER t, f; | 80 LARGE_INTEGER t, f; |
81 QueryPerformanceCounter(&t); | 81 QueryPerformanceCounter(&t); |
82 QueryPerformanceFrequency(&f); | 82 QueryPerformanceFrequency(&f); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. | 190 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
191 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. | 191 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
192 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. | 192 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
193 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. | 193 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
194 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. | 194 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
195 int disable_cpu_flags_; // Default 1. Use -1 for benchmarking. | 195 int disable_cpu_flags_; // Default 1. Use -1 for benchmarking. |
196 int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD. | 196 int benchmark_cpu_info_; // Default -1. Use 1 to disable SIMD. |
197 }; | 197 }; |
198 | 198 |
199 #endif // UNIT_TEST_UNIT_TEST_H_ NOLINT | 199 #endif // UNIT_TEST_UNIT_TEST_H_ NOLINT |
OLD | NEW |