mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
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:
parent
3886069dc9
commit
efbf15754a
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1670
|
||||
Version: 1671
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1670
|
||||
#define LIBYUV_VERSION 1671
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
@ -124,7 +124,7 @@ void CpuId(int eax, int ecx, int* cpu_info) {
|
||||
int GetXCR0() {
|
||||
int xcr0 = 0;
|
||||
#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 160040219)
|
||||
xcr0 = (int) _xgetbv(0); // VS2010 SP1 required. NOLINT
|
||||
xcr0 = (int)_xgetbv(0); // VS2010 SP1 required. NOLINT
|
||||
#elif defined(__i386__) || defined(__x86_64__)
|
||||
asm(".byte 0x0f, 0x01, 0xd0" : "=a"(xcr0) : "c"(0) : "%edx");
|
||||
#endif // defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
@ -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] =
|
||||
{
|
||||
int rh[256] = {
|
||||
0,
|
||||
},
|
||||
gh[256] =
|
||||
{
|
||||
};
|
||||
int gh[256] = {
|
||||
0,
|
||||
},
|
||||
bh[256] = {
|
||||
};
|
||||
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] =
|
||||
{
|
||||
int rh[256] = {
|
||||
0,
|
||||
},
|
||||
gh[256] =
|
||||
{
|
||||
};
|
||||
int gh[256] = {
|
||||
0,
|
||||
},
|
||||
bh[256] = {
|
||||
};
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user