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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 int64 i; | 65 int64 i; |
66 for (i = 0; i < len - 1; i += 2) { | 66 for (i = 0; i < len - 1; i += 2) { |
67 *reinterpret_cast<uint16*>(dst) = fastrand(); | 67 *reinterpret_cast<uint16*>(dst) = fastrand(); |
68 dst += 2; | 68 dst += 2; |
69 } | 69 } |
70 for (; i < len; ++i) { | 70 for (; i < len; ++i) { |
71 *dst++ = fastrand(); | 71 *dst++ = fastrand(); |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
| 75 class LibYUVColorTest : public ::testing::Test { |
| 76 protected: |
| 77 LibYUVColorTest(); |
| 78 |
| 79 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
| 80 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
| 81 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
| 82 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
| 83 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
| 84 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. |
| 85 }; |
| 86 |
75 class LibYUVConvertTest : public ::testing::Test { | 87 class LibYUVConvertTest : public ::testing::Test { |
76 protected: | 88 protected: |
77 LibYUVConvertTest(); | 89 LibYUVConvertTest(); |
78 | 90 |
79 const int rotate_max_w_; | |
80 const int rotate_max_h_; | |
81 | |
82 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. | 91 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
83 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. | 92 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
84 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. | 93 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
85 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. | 94 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
86 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. | 95 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
87 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. | 96 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. |
88 }; | 97 }; |
89 | 98 |
90 class LibYUVScaleTest : public ::testing::Test { | 99 class LibYUVScaleTest : public ::testing::Test { |
91 protected: | 100 protected: |
92 LibYUVScaleTest(); | 101 LibYUVScaleTest(); |
93 | 102 |
94 const int rotate_max_w_; | |
95 const int rotate_max_h_; | |
96 | |
97 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. | 103 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
98 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. | 104 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
99 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. | 105 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
100 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. | 106 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
101 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. | 107 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
102 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. | 108 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. |
103 }; | 109 }; |
104 | 110 |
105 class LibYUVRotateTest : public ::testing::Test { | 111 class LibYUVRotateTest : public ::testing::Test { |
106 protected: | 112 protected: |
107 LibYUVRotateTest(); | 113 LibYUVRotateTest(); |
108 | 114 |
109 const int rotate_max_w_; | |
110 const int rotate_max_h_; | |
111 | |
112 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. | 115 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
113 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. | 116 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
114 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. | 117 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
115 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. | 118 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
116 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. | 119 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
117 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. | 120 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. |
118 }; | 121 }; |
119 | 122 |
120 class LibYUVPlanarTest : public ::testing::Test { | 123 class LibYUVPlanarTest : public ::testing::Test { |
121 protected: | 124 protected: |
122 LibYUVPlanarTest(); | 125 LibYUVPlanarTest(); |
123 | 126 |
124 const int rotate_max_w_; | |
125 const int rotate_max_h_; | |
126 | |
127 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. | 127 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
128 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. | 128 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
129 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. | 129 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
130 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. | 130 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
131 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. | 131 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
132 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. | 132 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. |
133 }; | 133 }; |
134 | 134 |
135 class LibYUVBaseTest : public ::testing::Test { | 135 class LibYUVBaseTest : public ::testing::Test { |
136 protected: | 136 protected: |
137 LibYUVBaseTest(); | 137 LibYUVBaseTest(); |
138 | 138 |
139 const int rotate_max_w_; | |
140 const int rotate_max_h_; | |
141 | |
142 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. | 139 int benchmark_iterations_; // Default 1. Use 1000 for benchmarking. |
143 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. | 140 int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA. |
144 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. | 141 int benchmark_height_; // Default 720. Use 360 for benchmarking VGA. |
145 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. | 142 int benchmark_pixels_div256_; // Total pixels to benchmark / 256. |
146 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. | 143 int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280. |
147 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. | 144 int disable_cpu_flags_; // Default 0. Use -1 for benchmarking. |
148 }; | 145 }; |
149 | 146 |
150 #endif // UNIT_TEST_UNIT_TEST_H_ NOLINT | 147 #endif // UNIT_TEST_UNIT_TEST_H_ NOLINT |
OLD | NEW |