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

Side by Side Diff: unit_test/scale_test.cc

Issue 2084533006: YUV scale filter columns improved filtering accuracy (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: bump version Created 4 years, 6 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 | « source/scale_win.cc ('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
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // Test a scale factor with all 4 filters. Expect unfiltered to be exact, but 307 // Test a scale factor with all 4 filters. Expect unfiltered to be exact, but
308 // filtering is different fixed point implementations for SSSE3, Neon and C. 308 // filtering is different fixed point implementations for SSSE3, Neon and C.
309 #define TEST_FACTOR(name, nom, denom, boxdiff) \ 309 #define TEST_FACTOR(name, nom, denom, boxdiff) \
310 TEST_FACTOR1(name, None, nom, denom, 0) \ 310 TEST_FACTOR1(name, None, nom, denom, 0) \
311 TEST_FACTOR1(name, Linear, nom, denom, 3) \ 311 TEST_FACTOR1(name, Linear, nom, denom, 3) \
312 TEST_FACTOR1(name, Bilinear, nom, denom, 3) \ 312 TEST_FACTOR1(name, Bilinear, nom, denom, 3) \
313 TEST_FACTOR1(name, Box, nom, denom, boxdiff) 313 TEST_FACTOR1(name, Box, nom, denom, boxdiff)
314 314
315 TEST_FACTOR(2, 1, 2, 0) 315 TEST_FACTOR(2, 1, 2, 0)
316 TEST_FACTOR(4, 1, 4, 0) 316 TEST_FACTOR(4, 1, 4, 0)
317 TEST_FACTOR(8, 1, 8, 3) 317 TEST_FACTOR(8, 1, 8, 0)
318 TEST_FACTOR(3by4, 3, 4, 1) 318 TEST_FACTOR(3by4, 3, 4, 1)
319 TEST_FACTOR(3by8, 3, 8, 1) 319 TEST_FACTOR(3by8, 3, 8, 1)
320 TEST_FACTOR(3, 1, 3, 3) 320 TEST_FACTOR(3, 1, 3, 0)
321 #undef TEST_FACTOR1 321 #undef TEST_FACTOR1
322 #undef TEST_FACTOR 322 #undef TEST_FACTOR
323 #undef SX 323 #undef SX
324 #undef DX 324 #undef DX
325 325
326 #define TEST_SCALETO1(name, width, height, filter, max_diff) \ 326 #define TEST_SCALETO1(name, width, height, filter, max_diff) \
327 TEST_F(LibYUVScaleTest, name##To##width##x##height##_##filter) { \ 327 TEST_F(LibYUVScaleTest, name##To##width##x##height##_##filter) { \
328 int diff = TestFilter(benchmark_width_, benchmark_height_, \ 328 int diff = TestFilter(benchmark_width_, benchmark_height_, \
329 width, height, \ 329 width, height, \
330 kFilter##filter, benchmark_iterations_, \ 330 kFilter##filter, benchmark_iterations_, \
(...skipping 18 matching lines...) Expand all
349 DISABLED_##name##From##width##x##height##_##filter##_16) { \ 349 DISABLED_##name##From##width##x##height##_##filter##_16) { \
350 int diff = TestFilter_16(width, height, \ 350 int diff = TestFilter_16(width, height, \
351 Abs(benchmark_width_), Abs(benchmark_height_), \ 351 Abs(benchmark_width_), Abs(benchmark_height_), \
352 kFilter##filter, benchmark_iterations_); \ 352 kFilter##filter, benchmark_iterations_); \
353 EXPECT_LE(diff, max_diff); \ 353 EXPECT_LE(diff, max_diff); \
354 } 354 }
355 355
356 // Test scale to a specified size with all 4 filters. 356 // Test scale to a specified size with all 4 filters.
357 #define TEST_SCALETO(name, width, height) \ 357 #define TEST_SCALETO(name, width, height) \
358 TEST_SCALETO1(name, width, height, None, 0) \ 358 TEST_SCALETO1(name, width, height, None, 0) \
359 TEST_SCALETO1(name, width, height, Linear, 3) \ 359 TEST_SCALETO1(name, width, height, Linear, 0) \
360 TEST_SCALETO1(name, width, height, Bilinear, 3) \ 360 TEST_SCALETO1(name, width, height, Bilinear, 0) \
361 TEST_SCALETO1(name, width, height, Box, 3) 361 TEST_SCALETO1(name, width, height, Box, 0)
362 362
363 TEST_SCALETO(Scale, 1, 1) 363 TEST_SCALETO(Scale, 1, 1)
364 TEST_SCALETO(Scale, 320, 240) 364 TEST_SCALETO(Scale, 320, 240)
365 TEST_SCALETO(Scale, 352, 288) 365 TEST_SCALETO(Scale, 352, 288)
366 TEST_SCALETO(Scale, 569, 480) 366 TEST_SCALETO(Scale, 569, 480)
367 TEST_SCALETO(Scale, 640, 360) 367 TEST_SCALETO(Scale, 640, 360)
368 TEST_SCALETO(Scale, 1280, 720) 368 TEST_SCALETO(Scale, 1280, 720)
369 #undef TEST_SCALETO1 369 #undef TEST_SCALETO1
370 #undef TEST_SCALETO 370 #undef TEST_SCALETO
371 371
372 } // namespace libyuv 372 } // namespace libyuv
OLDNEW
« no previous file with comments | « source/scale_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698