Commit be77e062 authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent 0e53718e
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1315
Version: 1318
License: BSD
License File: LICENSE
......
......@@ -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
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment