Step thru full color test by increments of 5 for better test speed.

Full color test is the slowest of the unittests, and not catching any
additional bugs at the moment.  Step thru range of 0 to 255 in steps of
5 to speed up the test.  255 is 3 * 5 * 17, so any of those primes would
hit 0 and 255 exactly.

Was LibYUVColorTest.TestFullYUV (896 ms)
Now LibYUVColorTest.TestFullYUV (212 ms)

TBR=kjellander@chromium.org
Bug: libyuv:736
Test: LibYUVColorTest.TestFullYUV
Change-Id: I5b55fb07ada0dc7bdc3c3c20569d36bf09bb3804
Reviewed-on: https://chromium-review.googlesource.com/672064
Commit-Queue: Frank Barchard <fbarchard@google.com>
Reviewed-by: Frank Barchard <fbarchard@google.com>
This commit is contained in:
Frank Barchard 2017-09-18 18:57:04 -07:00 committed by Commit Bot
parent 3886069dc9
commit efbf15754a
5 changed files with 37 additions and 37 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1670 Version: 1671
License: BSD License: BSD
License File: LICENSE License File: LICENSE

View File

@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ #ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1670 #define LIBYUV_VERSION 1671
#endif // INCLUDE_LIBYUV_VERSION_H_ #endif // INCLUDE_LIBYUV_VERSION_H_

View File

@ -471,21 +471,22 @@ static void PrintHistogram(int rh[256], int gh[256], int bh[256]) {
printf("\n"); 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) { TEST_F(LibYUVColorTest, TestFullYUV) {
int rh[256] = int rh[256] = {
{
0, 0,
}, };
gh[256] = int gh[256] = {
{
0, 0,
}, };
bh[256] = { int bh[256] = {
0, 0,
}; };
for (int u = 0; u < 256; ++u) { for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) { 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 r0, g0, b0, r1, g1, b1;
int y = RANDOM256(y2); int y = RANDOM256(y2);
YUVToRGBReference(y, u, v, &r0, &g0, &b0); YUVToRGBReference(y, u, v, &r0, &g0, &b0);
@ -503,20 +504,18 @@ TEST_F(LibYUVColorTest, TestFullYUV) {
} }
TEST_F(LibYUVColorTest, TestFullYUVJ) { TEST_F(LibYUVColorTest, TestFullYUVJ) {
int rh[256] = int rh[256] = {
{
0, 0,
}, };
gh[256] = int gh[256] = {
{
0, 0,
}, };
bh[256] = { int bh[256] = {
0, 0,
}; };
for (int u = 0; u < 256; ++u) { for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) { 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 r0, g0, b0, r1, g1, b1;
int y = RANDOM256(y2); int y = RANDOM256(y2);
YUVJToRGBReference(y, u, v, &r0, &g0, &b0); YUVJToRGBReference(y, u, v, &r0, &g0, &b0);
@ -532,6 +531,7 @@ TEST_F(LibYUVColorTest, TestFullYUVJ) {
} }
PrintHistogram(rh, gh, bh); PrintHistogram(rh, gh, bh);
} }
#undef FASTSTEP
TEST_F(LibYUVColorTest, TestGreyYUVJ) { TEST_F(LibYUVColorTest, TestGreyYUVJ) {
int r0, g0, b0, r1, g1, b1, r2, g2, b2; int r0, g0, b0, r1, g1, b1, r2, g2, b2;