From be77e062da042c1ec721e0a557d235893a2a4204 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Tue, 10 Mar 2015 21:26:46 +0000 Subject: [PATCH] Make TestFullYUV test do full yuv color space by default with randomized Y for inner loop BUG=none TESTED=out\release\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter=*TestFullYUV R=harryjin@google.com Review URL: https://webrtc-codereview.appspot.com/47499005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1319 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/color_test.cc | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.chromium b/README.chromium index b839c85b5..39a2eed61 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1315 +Version: 1318 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index ff962c5a1..466b01a6f 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1315 +#define LIBYUV_VERSION 1318 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/color_test.cc b/unit_test/color_test.cc index 6de5dc694..aaffb7ef2 100644 --- a/unit_test/color_test.cc +++ b/unit_test/color_test.cc @@ -296,17 +296,16 @@ TEST_F(libyuvTest, TestGreyYUV) { } } -// This full test should be run occassionally to test all values are accurate. +#define RANDOM256(s) ((s & 1) ? ((s >> 1) ^ 0xb8) : (s >> 1)) + TEST_F(libyuvTest, TestFullYUV) { int i; - // If using small image, step faster. - int step = benchmark_width_ <= 128 ? 3 : 1; - int r0, g0, b0, r1, g1, b1; int rh[256] = { 0, }, gh[256] = { 0, }, bh[256] = { 0, }; - for (int y = 0; y < 256; y += step) { - for (int u = 0; u < 256; u += step) { - for (int v2 = 0; v2 < 256; v2 += step) { - int v = (v2 & 1) ? ((v2 >> 1) ^ 0xb8) : (v2 >> 1); + for (int u = 0; u < 256; ++u) { + for (int v = 0; v < 256; ++v) { + for (int y2 = 0; y2 < 256; ++y2) { + int r0, g0, b0, r1, g1, b1; + int y = RANDOM256(y2); YUVToRGBReference(y, u, v, &r0, &g0, &b0); YUVToRGB(y, u, v, &r1, &g1, &b1); EXPECT_NEAR(r0, r1, ERROR_R);