| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 int diff = TestFilter_16(SX(benchmark_width_, nom, denom), \ | 291 int diff = TestFilter_16(SX(benchmark_width_, nom, denom), \ |
| 292 SX(benchmark_height_, nom, denom), \ | 292 SX(benchmark_height_, nom, denom), \ |
| 293 DX(benchmark_width_, nom, denom), \ | 293 DX(benchmark_width_, nom, denom), \ |
| 294 DX(benchmark_height_, nom, denom), \ | 294 DX(benchmark_height_, nom, denom), \ |
| 295 kFilter##filter, benchmark_iterations_); \ | 295 kFilter##filter, benchmark_iterations_); \ |
| 296 EXPECT_LE(diff, max_diff); \ | 296 EXPECT_LE(diff, max_diff); \ |
| 297 } | 297 } |
| 298 | 298 |
| 299 // Test a scale factor with all 4 filters. Expect unfiltered to be exact, but | 299 // Test a scale factor with all 4 filters. Expect unfiltered to be exact, but |
| 300 // filtering is different fixed point implementations for SSSE3, Neon and C. | 300 // filtering is different fixed point implementations for SSSE3, Neon and C. |
| 301 #define TEST_FACTOR(name, nom, denom, maxdiff) \ | 301 #define TEST_FACTOR(name, nom, denom, boxdiff) \ |
| 302 TEST_FACTOR1(name, None, nom, denom, 0) \ | 302 TEST_FACTOR1(name, None, nom, denom, 0) \ |
| 303 TEST_FACTOR1(name, Linear, nom, denom, maxdiff) \ | 303 TEST_FACTOR1(name, Linear, nom, denom, 3) \ |
| 304 TEST_FACTOR1(name, Bilinear, nom, denom, maxdiff) \ | 304 TEST_FACTOR1(name, Bilinear, nom, denom, 3) \ |
| 305 TEST_FACTOR1(name, Box, nom, denom, maxdiff) | 305 TEST_FACTOR1(name, Box, nom, denom, boxdiff) |
| 306 | 306 |
| 307 TEST_FACTOR(2, 1, 2, 0) | 307 TEST_FACTOR(2, 1, 2, 0) |
| 308 TEST_FACTOR(4, 1, 4, 3) | 308 TEST_FACTOR(4, 1, 4, 0) |
| 309 TEST_FACTOR(8, 1, 8, 3) | 309 TEST_FACTOR(8, 1, 8, 3) |
| 310 TEST_FACTOR(3by4, 3, 4, 3) | 310 TEST_FACTOR(3by4, 3, 4, 1) |
| 311 TEST_FACTOR(3by8, 3, 8, 3) | 311 TEST_FACTOR(3by8, 3, 8, 1) |
| 312 TEST_FACTOR(3, 1, 3, 3) | 312 TEST_FACTOR(3, 1, 3, 3) |
| 313 #undef TEST_FACTOR1 | 313 #undef TEST_FACTOR1 |
| 314 #undef TEST_FACTOR | 314 #undef TEST_FACTOR |
| 315 #undef SX | 315 #undef SX |
| 316 #undef DX | 316 #undef DX |
| 317 | 317 |
| 318 #define TEST_SCALETO1(name, width, height, filter, max_diff) \ | 318 #define TEST_SCALETO1(name, width, height, filter, max_diff) \ |
| 319 TEST_F(LibYUVScaleTest, name##To##width##x##height##_##filter) { \ | 319 TEST_F(LibYUVScaleTest, name##To##width##x##height##_##filter) { \ |
| 320 int diff = TestFilter(benchmark_width_, benchmark_height_, \ | 320 int diff = TestFilter(benchmark_width_, benchmark_height_, \ |
| 321 width, height, \ | 321 width, height, \ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 TEST_SCALETO(Scale, 1, 1) | 355 TEST_SCALETO(Scale, 1, 1) |
| 356 TEST_SCALETO(Scale, 320, 240) | 356 TEST_SCALETO(Scale, 320, 240) |
| 357 TEST_SCALETO(Scale, 352, 288) | 357 TEST_SCALETO(Scale, 352, 288) |
| 358 TEST_SCALETO(Scale, 569, 480) | 358 TEST_SCALETO(Scale, 569, 480) |
| 359 TEST_SCALETO(Scale, 640, 360) | 359 TEST_SCALETO(Scale, 640, 360) |
| 360 TEST_SCALETO(Scale, 1280, 720) | 360 TEST_SCALETO(Scale, 1280, 720) |
| 361 #undef TEST_SCALETO1 | 361 #undef TEST_SCALETO1 |
| 362 #undef TEST_SCALETO | 362 #undef TEST_SCALETO |
| 363 | 363 |
| 364 } // namespace libyuv | 364 } // namespace libyuv |
| OLD | NEW |