summaryrefslogtreecommitdiff
path: root/chromium/third_party/libyuv/unit_test/color_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/libyuv/unit_test/color_test.cc')
-rw-r--r--chromium/third_party/libyuv/unit_test/color_test.cc48
1 files changed, 24 insertions, 24 deletions
diff --git a/chromium/third_party/libyuv/unit_test/color_test.cc b/chromium/third_party/libyuv/unit_test/color_test.cc
index 0aa7a54ac01..30b6411283f 100644
--- a/chromium/third_party/libyuv/unit_test/color_test.cc
+++ b/chromium/third_party/libyuv/unit_test/color_test.cc
@@ -471,21 +471,22 @@ static void PrintHistogram(int rh[256], int gh[256], int bh[256]) {
printf("\n");
}
+// Step by 5 on inner loop goes from 0 to 255 inclusive.
+// Set to 1 for better converage. 3, 5 or 17 for faster testing.
+#define FASTSTEP 5
TEST_F(LibYUVColorTest, TestFullYUV) {
- int rh[256] =
- {
- 0,
- },
- gh[256] =
- {
- 0,
- },
- bh[256] = {
- 0,
- };
+ int rh[256] = {
+ 0,
+ };
+ int gh[256] = {
+ 0,
+ };
+ int bh[256] = {
+ 0,
+ };
for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) {
- for (int y2 = 0; y2 < 256; ++y2) {
+ for (int y2 = 0; y2 < 256; y2 += FASTSTEP) {
int r0, g0, b0, r1, g1, b1;
int y = RANDOM256(y2);
YUVToRGBReference(y, u, v, &r0, &g0, &b0);
@@ -503,20 +504,18 @@ TEST_F(LibYUVColorTest, TestFullYUV) {
}
TEST_F(LibYUVColorTest, TestFullYUVJ) {
- int rh[256] =
- {
- 0,
- },
- gh[256] =
- {
- 0,
- },
- bh[256] = {
- 0,
- };
+ int rh[256] = {
+ 0,
+ };
+ int gh[256] = {
+ 0,
+ };
+ int bh[256] = {
+ 0,
+ };
for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) {
- for (int y2 = 0; y2 < 256; ++y2) {
+ for (int y2 = 0; y2 < 256; y2 += FASTSTEP) {
int r0, g0, b0, r1, g1, b1;
int y = RANDOM256(y2);
YUVJToRGBReference(y, u, v, &r0, &g0, &b0);
@@ -532,6 +531,7 @@ TEST_F(LibYUVColorTest, TestFullYUVJ) {
}
PrintHistogram(rh, gh, bh);
}
+#undef FASTSTEP
TEST_F(LibYUVColorTest, TestGreyYUVJ) {
int r0, g0, b0, r1, g1, b1, r2, g2, b2;