Commit 26db4de2 authored by Frank Barchard's avatar Frank Barchard

break up unittests into categories

R=harryjin@google.com
BUG=none

Review URL: https://codereview.chromium.org/1399523004 .
parent be4d445e
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1507
Version: 1508
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1507
#define LIBYUV_VERSION 1508
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -13,7 +13,7 @@
namespace libyuv {
TEST_F(libyuvTest, Endian) {
TEST_F(LibYUVBaseTest, Endian) {
uint16 v16 = 0x1234u;
uint8 first_byte = *reinterpret_cast<uint8*>(&v16);
#if defined(LIBYUV_LITTLE_ENDIAN)
......@@ -23,7 +23,7 @@ TEST_F(libyuvTest, Endian) {
#endif
}
TEST_F(libyuvTest, SizeOfTypes) {
TEST_F(LibYUVBaseTest, SizeOfTypes) {
int8 i8 = -1;
uint8 u8 = 1u;
int16 i16 = -1;
......@@ -50,7 +50,7 @@ TEST_F(libyuvTest, SizeOfTypes) {
EXPECT_LT(0u, u64);
}
TEST_F(libyuvTest, SizeOfConstants) {
TEST_F(LibYUVBaseTest, SizeOfConstants) {
EXPECT_EQ(8u, sizeof(INT64_C(0)));
EXPECT_EQ(8u, sizeof(UINT64_C(0)));
EXPECT_EQ(8u, sizeof(INT64_C(0x1234567887654321)));
......
......@@ -37,7 +37,7 @@ namespace libyuv {
#endif
#define TESTCS(TESTNAME, YUVTOARGB, ARGBTOYUV, HS1, HS, HN, DIFF) \
TEST_F(libyuvTest, TESTNAME) { \
TEST_F(LibYUVConvertTest, TESTNAME) { \
const int kPixels = benchmark_width_ * benchmark_height_; \
const int kHalfPixels = ((benchmark_width_ + 1) / 2) * \
((benchmark_height_ + HS1) / HS); \
......@@ -312,7 +312,7 @@ static int RoundToByte(float f) {
#define RANDOM256(s) ((s & 1) ? ((s >> 1) ^ 0xb8) : (s >> 1))
TEST_F(libyuvTest, TestRoundToByte) {
TEST_F(LibYUVConvertTest, TestRoundToByte) {
int allb = 0;
int count = benchmark_width_ * benchmark_height_;
for (int i = 0; i < benchmark_iterations_; ++i) {
......@@ -339,7 +339,7 @@ static void YUVJToRGBReference(int y, int u, int v, int* r, int* g, int* b) {
*b = RoundToByte(y - (u - 128) * -1.77200);
}
TEST_F(libyuvTest, TestYUV) {
TEST_F(LibYUVConvertTest, TestYUV) {
int r0, g0, b0, r1, g1, b1;
// cyan (less red)
......@@ -385,7 +385,7 @@ TEST_F(libyuvTest, TestYUV) {
}
}
TEST_F(libyuvTest, TestGreyYUV) {
TEST_F(LibYUVConvertTest, TestGreyYUV) {
int r0, g0, b0, r1, g1, b1, r2, g2, b2;
// black
......@@ -464,7 +464,7 @@ static void PrintHistogram(int rh[256], int gh[256], int bh[256]) {
printf("\n");
}
TEST_F(libyuvTest, TestFullYUV) {
TEST_F(LibYUVConvertTest, TestFullYUV) {
int rh[256] = { 0, }, gh[256] = { 0, }, bh[256] = { 0, };
for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) {
......@@ -485,7 +485,7 @@ TEST_F(libyuvTest, TestFullYUV) {
PrintHistogram(rh, gh, bh);
}
TEST_F(libyuvTest, TestFullYUVJ) {
TEST_F(LibYUVConvertTest, TestFullYUVJ) {
int rh[256] = { 0, }, gh[256] = { 0, }, bh[256] = { 0, };
for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) {
......@@ -506,7 +506,7 @@ TEST_F(libyuvTest, TestFullYUVJ) {
PrintHistogram(rh, gh, bh);
}
TEST_F(libyuvTest, TestGreyYUVJ) {
TEST_F(LibYUVConvertTest, TestGreyYUVJ) {
int r0, g0, b0, r1, g1, b1, r2, g2, b2;
// black
......
......@@ -32,7 +32,7 @@ static uint32 ReferenceHashDjb2(const uint8* src, uint64 count, uint32 seed) {
return hash;
}
TEST_F(libyuvTest, Djb2_Test) {
TEST_F(LibYUVBaseTest, Djb2_Test) {
const int kMaxTest = benchmark_width_ * benchmark_height_;
align_buffer_64(src_a, kMaxTest);
align_buffer_64(src_b, kMaxTest);
......@@ -116,7 +116,7 @@ TEST_F(libyuvTest, Djb2_Test) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, BenchmarkDjb2_Opt) {
TEST_F(LibYUVBaseTest, BenchmarkDjb2_Opt) {
const int kMaxTest = benchmark_width_ * benchmark_height_;
align_buffer_64(src_a, kMaxTest);
......@@ -132,7 +132,7 @@ TEST_F(libyuvTest, BenchmarkDjb2_Opt) {
free_aligned_buffer_64(src_a);
}
TEST_F(libyuvTest, BenchmarkDjb2_Unaligned) {
TEST_F(LibYUVBaseTest, BenchmarkDjb2_Unaligned) {
const int kMaxTest = benchmark_width_ * benchmark_height_;
align_buffer_64(src_a, kMaxTest + 1);
for (int i = 0; i < kMaxTest; ++i) {
......@@ -147,7 +147,7 @@ TEST_F(libyuvTest, BenchmarkDjb2_Unaligned) {
free_aligned_buffer_64(src_a);
}
TEST_F(libyuvTest, BenchmarkARGBDetect_Opt) {
TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Opt) {
uint32 fourcc;
const int kMaxTest = benchmark_width_ * benchmark_height_ * 4;
align_buffer_64(src_a, kMaxTest);
......@@ -175,7 +175,7 @@ TEST_F(libyuvTest, BenchmarkARGBDetect_Opt) {
free_aligned_buffer_64(src_a);
}
TEST_F(libyuvTest, BenchmarkARGBDetect_Unaligned) {
TEST_F(LibYUVBaseTest, BenchmarkARGBDetect_Unaligned) {
uint32 fourcc;
const int kMaxTest = benchmark_width_ * benchmark_height_ * 4 + 1;
align_buffer_64(src_a, kMaxTest);
......@@ -202,7 +202,7 @@ TEST_F(libyuvTest, BenchmarkARGBDetect_Unaligned) {
free_aligned_buffer_64(src_a);
}
TEST_F(libyuvTest, BenchmarkSumSquareError_Opt) {
TEST_F(LibYUVBaseTest, BenchmarkSumSquareError_Opt) {
const int kMaxWidth = 4096 * 3;
align_buffer_64(src_a, kMaxWidth);
align_buffer_64(src_b, kMaxWidth);
......@@ -233,7 +233,7 @@ TEST_F(libyuvTest, BenchmarkSumSquareError_Opt) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, SumSquareError) {
TEST_F(LibYUVBaseTest, SumSquareError) {
const int kMaxWidth = 4096 * 3;
align_buffer_64(src_a, kMaxWidth);
align_buffer_64(src_b, kMaxWidth);
......@@ -273,7 +273,7 @@ TEST_F(libyuvTest, SumSquareError) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, BenchmarkPsnr_Opt) {
TEST_F(LibYUVBaseTest, BenchmarkPsnr_Opt) {
align_buffer_64(src_a, benchmark_width_ * benchmark_height_);
align_buffer_64(src_b, benchmark_width_ * benchmark_height_);
for (int i = 0; i < benchmark_width_ * benchmark_height_; ++i) {
......@@ -298,7 +298,7 @@ TEST_F(libyuvTest, BenchmarkPsnr_Opt) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, BenchmarkPsnr_Unaligned) {
TEST_F(LibYUVBaseTest, BenchmarkPsnr_Unaligned) {
align_buffer_64(src_a, benchmark_width_ * benchmark_height_ + 1);
align_buffer_64(src_b, benchmark_width_ * benchmark_height_);
for (int i = 0; i < benchmark_width_ * benchmark_height_; ++i) {
......@@ -323,7 +323,7 @@ TEST_F(libyuvTest, BenchmarkPsnr_Unaligned) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, Psnr) {
TEST_F(LibYUVBaseTest, Psnr) {
const int kSrcWidth = benchmark_width_;
const int kSrcHeight = benchmark_height_;
const int b = 128;
......@@ -400,7 +400,7 @@ TEST_F(libyuvTest, Psnr) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, DISABLED_BenchmarkSsim_Opt) {
TEST_F(LibYUVBaseTest, DISABLED_BenchmarkSsim_Opt) {
align_buffer_64(src_a, benchmark_width_ * benchmark_height_);
align_buffer_64(src_b, benchmark_width_ * benchmark_height_);
for (int i = 0; i < benchmark_width_ * benchmark_height_; ++i) {
......@@ -425,7 +425,7 @@ TEST_F(libyuvTest, DISABLED_BenchmarkSsim_Opt) {
free_aligned_buffer_64(src_b);
}
TEST_F(libyuvTest, Ssim) {
TEST_F(LibYUVBaseTest, Ssim) {
const int kSrcWidth = benchmark_width_;
const int kSrcHeight = benchmark_height_;
const int b = 128;
......
......@@ -32,7 +32,7 @@ namespace libyuv {
#define TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \
FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, W1280, N, NEG, OFF) \
TEST_F(libyuvTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \
TEST_F(LibYUVConvertTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
align_buffer_64(src_y, kWidth * kHeight + OFF); \
......@@ -176,7 +176,7 @@ TESTPLANARTOP(I444, 1, 1, I444, 1, 1)
#define TESTPLANARTOBPI(SRC_FMT_PLANAR, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \
FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, W1280, N, NEG, OFF) \
TEST_F(libyuvTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \
TEST_F(LibYUVConvertTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
align_buffer_64(src_y, kWidth * kHeight + OFF); \
......@@ -284,7 +284,7 @@ TESTPLANARTOBP(I420, 2, 2, NV21, 2, 2)
#define TESTBIPLANARTOPI(SRC_FMT_PLANAR, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \
FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, W1280, N, NEG, OFF) \
TEST_F(libyuvTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \
TEST_F(LibYUVConvertTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
align_buffer_64(src_y, kWidth * kHeight + OFF); \
......@@ -411,7 +411,7 @@ TESTBIPLANARTOP(NV21, 2, 2, I420, 2, 2)
#define TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \
YALIGN, W1280, DIFF, N, NEG, OFF, FMT_C, BPP_C) \
TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##N) { \
TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \
const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \
......@@ -520,7 +520,7 @@ TESTPLANARTOB(J420, 2, 2, J400, 1, 1, 1, 0, ARGB, 4)
#define TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \
YALIGN, W1280, DIFF, N, NEG, OFF, ATTEN) \
TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##N) { \
TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \
const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \
......@@ -594,7 +594,7 @@ TESTQPLANARTOB(I420Alpha, 2, 2, ABGR, 4, 4, 1, 2)
#define TESTBIPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \
W1280, DIFF, N, NEG, OFF) \
TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##N) { \
TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
const int kStrideB = kWidth * BPP_B; \
......@@ -674,7 +674,7 @@ TESTBIPLANARTOB(NV12, 2, 2, RGB565, 2, 9)
#define TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \
W1280, DIFF, N, NEG, OFF) \
TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \
TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \
const int kStride = \
......@@ -792,7 +792,7 @@ TESTATOPLANAR(J400, 1, 1, J420, 2, 2, 2)
#define TESTATOBIPLANARI(FMT_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \
W1280, N, NEG, OFF) \
TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##N) { \
TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
const int kStride = (kWidth * 8 * BPP_A + 7) / 8; \
......@@ -876,7 +876,7 @@ TESTATOBIPLANAR(UYVY, 2, NV12, 2, 2)
#define TESTATOBI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
W1280, DIFF, N, NEG, OFF) \
TEST_F(libyuvTest, FMT_A##To##FMT_B##N) { \
TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \
......@@ -918,7 +918,7 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##N) { \
#define TESTATOBRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, DIFF) \
TEST_F(libyuvTest, FMT_A##To##FMT_B##_Random) { \
TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##_Random) { \
for (int times = 0; times < benchmark_iterations_; ++times) { \
const int kWidth = (fastrand() & 63) + 1; \
const int kHeight = (fastrand() & 31) + 1; \
......@@ -1008,7 +1008,7 @@ TESTATOB(ARGB, 4, 4, 1, ARGBMirror, 4, 4, 1, 0)
#define TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, \
W1280, DIFF, N, NEG, OFF) \
TEST_F(libyuvTest, FMT_A##To##FMT_B##Dither##N) { \
TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##Dither##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \
......@@ -1050,7 +1050,7 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##Dither##N) { \
#define TESTATOBDRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, \
FMT_B, BPP_B, STRIDE_B, HEIGHT_B, DIFF) \
TEST_F(libyuvTest, FMT_A##To##FMT_B##Dither_Random) { \
TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##Dither_Random) { \
for (int times = 0; times < benchmark_iterations_; ++times) { \
const int kWidth = (fastrand() & 63) + 1; \
const int kHeight = (fastrand() & 31) + 1; \
......@@ -1111,7 +1111,7 @@ TESTATOBD(ARGB, 4, 4, 1, RGB565, 2, 2, 1, 0)
#define TESTSYMI(FMT_ATOB, BPP_A, STRIDE_A, HEIGHT_A, \
W1280, N, NEG, OFF) \
TEST_F(libyuvTest, FMT_ATOB##_Symetric##N) { \
TEST_F(LibYUVConvertTest, FMT_ATOB##_Symetric##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \
......@@ -1165,7 +1165,7 @@ TESTSYM(ARGBToABGR, 4, 4, 1)
TESTSYM(BGRAToARGB, 4, 4, 1)
TESTSYM(ABGRToARGB, 4, 4, 1)
TEST_F(libyuvTest, Test565) {
TEST_F(LibYUVConvertTest, Test565) {
SIMD_ALIGNED(uint8 orig_pixels[256][4]);
SIMD_ALIGNED(uint8 pixels565[256][2]);
......@@ -1180,7 +1180,7 @@ TEST_F(libyuvTest, Test565) {
}
#ifdef HAVE_JPEG
TEST_F(libyuvTest, ValidateJpeg) {
TEST_F(LibYUVConvertTest, ValidateJpeg) {
const int kOff = 10;
const int kMinJpeg = 64;
const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg ?
......@@ -1207,7 +1207,7 @@ TEST_F(libyuvTest, ValidateJpeg) {
free_aligned_buffer_page_end(orig_pixels);
}
TEST_F(libyuvTest, ValidateJpegLarge) {
TEST_F(LibYUVConvertTest, ValidateJpegLarge) {
const int kOff = 10;
const int kMinJpeg = 64;
const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg ?
......@@ -1232,7 +1232,7 @@ TEST_F(libyuvTest, ValidateJpegLarge) {
free_aligned_buffer_page_end(orig_pixels);
}
TEST_F(libyuvTest, InvalidateJpeg) {
TEST_F(LibYUVConvertTest, InvalidateJpeg) {
const int kOff = 10;
const int kMinJpeg = 64;
const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg ?
......@@ -1270,7 +1270,7 @@ TEST_F(libyuvTest, InvalidateJpeg) {
free_aligned_buffer_page_end(orig_pixels);
}
TEST_F(libyuvTest, FuzzJpeg) {
TEST_F(LibYUVConvertTest, FuzzJpeg) {
// SOI but no EOI. Expect fail.
for (int times = 0; times < benchmark_iterations_; ++times) {
const int kSize = fastrand() % 5000 + 2;
......@@ -1286,7 +1286,7 @@ TEST_F(libyuvTest, FuzzJpeg) {
}
}
TEST_F(libyuvTest, MJPGToI420) {
TEST_F(LibYUVConvertTest, MJPGToI420) {
const int kOff = 10;
const int kMinJpeg = 64;
const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg ?
......@@ -1325,7 +1325,7 @@ TEST_F(libyuvTest, MJPGToI420) {
free_aligned_buffer_page_end(orig_pixels);
}
TEST_F(libyuvTest, MJPGToARGB) {
TEST_F(LibYUVConvertTest, MJPGToARGB) {
const int kOff = 10;
const int kMinJpeg = 64;
const int kImageSize = benchmark_width_ * benchmark_height_ >= kMinJpeg ?
......@@ -1356,7 +1356,7 @@ TEST_F(libyuvTest, MJPGToARGB) {
#endif // HAVE_JPEG
TEST_F(libyuvTest, CropNV12) {
TEST_F(LibYUVConvertTest, CropNV12) {
const int SUBSAMP_X = 2;
const int SUBSAMP_Y = 2;
const int kWidth = benchmark_width_;
......@@ -1448,7 +1448,7 @@ TEST_F(libyuvTest, CropNV12) {
free_aligned_buffer_64(src_y);
}
TEST_F(libyuvTest, HaveJPEG) {
TEST_F(LibYUVConvertTest, HaveJPEG) {
#ifdef HAVE_JPEG
printf("JPEG enabled\n.");
#else
......@@ -1456,7 +1456,7 @@ TEST_F(libyuvTest, HaveJPEG) {
#endif
}
TEST_F(libyuvTest, TestYToARGB) {
TEST_F(LibYUVConvertTest, TestYToARGB) {
uint8 y[32];
uint8 expectedg[32];
for (int i = 0; i < 32; ++i) {
......@@ -1485,7 +1485,7 @@ static const uint8 kNoDither4x4[16] = {
0, 0, 0, 0,
};
TEST_F(libyuvTest, TestNoDither) {
TEST_F(LibYUVConvertTest, TestNoDither) {
align_buffer_64(src_argb, benchmark_width_ * benchmark_height_ * 4);
align_buffer_64(dst_rgb565, benchmark_width_ * benchmark_height_ * 2);
align_buffer_64(dst_rgb565dither, benchmark_width_ * benchmark_height_ * 2);
......@@ -1515,7 +1515,7 @@ static const uint8 kDither565_4x4[16] = {
7, 3, 6, 2,
};
TEST_F(libyuvTest, TestDither) {
TEST_F(LibYUVConvertTest, TestDither) {
align_buffer_64(src_argb, benchmark_width_ * benchmark_height_ * 4);
align_buffer_64(dst_rgb565, benchmark_width_ * benchmark_height_ * 2);
align_buffer_64(dst_rgb565dither, benchmark_width_ * benchmark_height_ * 2);
......@@ -1551,7 +1551,7 @@ TEST_F(libyuvTest, TestDither) {
#define TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \
YALIGN, W1280, DIFF, N, NEG, OFF, FMT_C, BPP_C) \
TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##Dither##N) { \
TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##Dither##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \
const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \
......@@ -1629,7 +1629,7 @@ TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##Dither##N) { \
TESTPLANARTOBD(I420, 2, 2, RGB565, 2, 2, 1, 9, ARGB, 4)
#define TESTPTOB(NAME, UYVYTOI420, UYVYTONV12) \
TEST_F(libyuvTest, NAME) { \
TEST_F(LibYUVConvertTest, NAME) { \
const int kWidth = benchmark_width_; \
const int kHeight = benchmark_height_; \
\
......
......@@ -19,7 +19,7 @@
namespace libyuv {
TEST_F(libyuvTest, TestCpuHas) {
TEST_F(LibYUVBaseTest, TestCpuHas) {
int cpu_flags = TestCpuFlag(-1);
printf("Cpu Flags %x\n", cpu_flags);
int has_arm = TestCpuFlag(kCpuHasARM);
......@@ -52,7 +52,7 @@ TEST_F(libyuvTest, TestCpuHas) {
printf("Has MIPS DSPR2 %x\n", has_mips_dspr2);
}
TEST_F(libyuvTest, TestCompilerHasAVX2) {
TEST_F(LibYUVBaseTest, TestCompilerHasAVX2) {
#ifdef _MSC_VER
printf("_MSC_VER %d\n", _MSC_VER);
#endif
......@@ -74,7 +74,7 @@ printf("_MSC_VER %d\n", _MSC_VER);
#if defined(__i386__) || defined(__x86_64__) || \
defined(_M_IX86) || defined(_M_X64)
TEST_F(libyuvTest, TestCpuId) {
TEST_F(LibYUVBaseTest, TestCpuId) {
int has_x86 = TestCpuFlag(kCpuHasX86);
if (has_x86) {
uint32 cpu_info[4];
......@@ -122,7 +122,7 @@ static int FileExists(const char* file_name) {
return 1;
}
TEST_F(libyuvTest, TestLinuxNeon) {
TEST_F(LibYUVBaseTest, TestLinuxNeon) {
if (FileExists("../../unit_test/testdata/arm_v7.txt")) {
EXPECT_EQ(0, ArmCpuCaps("../../unit_test/testdata/arm_v7.txt"));
EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("../../unit_test/testdata/tegra3.txt"));
......
......@@ -21,7 +21,7 @@
namespace libyuv {
TEST_F(libyuvTest, TestFixedDiv) {
TEST_F(LibYUVBaseTest, TestFixedDiv) {
int num[1280];
int div[1280];
int result_opt[1280];
......@@ -85,7 +85,7 @@ TEST_F(libyuvTest, TestFixedDiv) {
}
}
TEST_F(libyuvTest, TestFixedDiv_Opt) {
TEST_F(LibYUVBaseTest, TestFixedDiv_Opt) {
int num[1280];
int div[1280];
int result_opt[1280];
......@@ -119,7 +119,7 @@ TEST_F(libyuvTest, TestFixedDiv_Opt) {
}
}
TEST_F(libyuvTest, TestFixedDiv1_Opt) {
TEST_F(LibYUVBaseTest, TestFixedDiv1_Opt) {
int num[1280];
int div[1280];
int result_opt[1280];
......
......@@ -24,7 +24,7 @@
namespace libyuv {
TEST_F(libyuvTest, TestAttenuate) {
TEST_F(LibYUVPlanarTest, TestAttenuate) {
const int kSize = 1280 * 4;
align_buffer_64(orig_pixels, kSize);
align_buffer_64(atten_pixels, kSize);
......@@ -145,27 +145,31 @@ static int TestAttenuateI(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBAttenuate_Any) {
TEST_F(LibYUVPlanarTest, ARGBAttenuate_Any) {
int max_diff = TestAttenuateI(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
benchmark_iterations_, disable_cpu_flags_,
+1, 0);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, ARGBAttenuate_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBAttenuate_Unaligned) {
int max_diff = TestAttenuateI(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
benchmark_iterations_, disable_cpu_flags_,
+1, 1);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, ARGBAttenuate_Invert) {
TEST_F(LibYUVPlanarTest, ARGBAttenuate_Invert) {
int max_diff = TestAttenuateI(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
benchmark_iterations_, disable_cpu_flags_,
-1, 0);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, ARGBAttenuate_Opt) {
TEST_F(LibYUVPlanarTest, ARGBAttenuate_Opt) {
int max_diff = TestAttenuateI(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
benchmark_iterations_, disable_cpu_flags_,
+1, 0);
EXPECT_LE(max_diff, 2);
}
......@@ -213,31 +217,35 @@ static int TestUnattenuateI(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBUnattenuate_Any) {
TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Any) {
int max_diff = TestUnattenuateI(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
benchmark_iterations_, disable_cpu_flags_,
+1, 0);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, ARGBUnattenuate_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Unaligned) {
int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
benchmark_iterations_, disable_cpu_flags_,
+1, 1);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, ARGBUnattenuate_Invert) {
TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Invert) {
int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
benchmark_iterations_, disable_cpu_flags_,
-1, 0);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, ARGBUnattenuate_Opt) {
TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Opt) {
int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
benchmark_iterations_, disable_cpu_flags_,
+1, 0);
EXPECT_LE(max_diff, 2);
}
TEST_F(libyuvTest, TestARGBComputeCumulativeSum) {
TEST_F(LibYUVPlanarTest, TestARGBComputeCumulativeSum) {
SIMD_ALIGNED(uint8 orig_pixels[16][16][4]);
SIMD_ALIGNED(int32 added_pixels[16][16][4]);
......@@ -264,7 +272,7 @@ TEST_F(libyuvTest, TestARGBComputeCumulativeSum) {
}
}
TEST_F(libyuvTest, TestARGBGray) {
TEST_F(LibYUVPlanarTest, TestARGBGray) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
memset(orig_pixels, 0, sizeof(orig_pixels));
......@@ -335,7 +343,7 @@ TEST_F(libyuvTest, TestARGBGray) {
}
}
TEST_F(libyuvTest, TestARGBGrayTo) {
TEST_F(LibYUVPlanarTest, TestARGBGrayTo) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
SIMD_ALIGNED(uint8 gray_pixels[1280][4]);
memset(orig_pixels, 0, sizeof(orig_pixels));
......@@ -407,7 +415,7 @@ TEST_F(libyuvTest, TestARGBGrayTo) {
}
}
TEST_F(libyuvTest, TestARGBSepia) {
TEST_F(LibYUVPlanarTest, TestARGBSepia) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
memset(orig_pixels, 0, sizeof(orig_pixels));
......@@ -479,7 +487,7 @@ TEST_F(libyuvTest, TestARGBSepia) {
}
}
TEST_F(libyuvTest, TestARGBColorMatrix) {
TEST_F(LibYUVPlanarTest, TestARGBColorMatrix) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels_opt[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels_c[1280][4]);
......@@ -557,7 +565,7 @@ TEST_F(libyuvTest, TestARGBColorMatrix) {
}
}
TEST_F(libyuvTest, TestRGBColorMatrix) {
TEST_F(LibYUVPlanarTest, TestRGBColorMatrix) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
// Matrix for Sepia.
......@@ -619,7 +627,7 @@ TEST_F(libyuvTest, TestRGBColorMatrix) {
}
}
TEST_F(libyuvTest, TestARGBColorTable) {
TEST_F(LibYUVPlanarTest, TestARGBColorTable) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
memset(orig_pixels, 0, sizeof(orig_pixels));
......@@ -678,7 +686,7 @@ TEST_F(libyuvTest, TestARGBColorTable) {
}
// Same as TestARGBColorTable except alpha does not change.
TEST_F(libyuvTest, TestRGBColorTable) {
TEST_F(LibYUVPlanarTest, TestRGBColorTable) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
memset(orig_pixels, 0, sizeof(orig_pixels));
......@@ -736,7 +744,7 @@ TEST_F(libyuvTest, TestRGBColorTable) {
}
}
TEST_F(libyuvTest, TestARGBQuantize) {
TEST_F(LibYUVPlanarTest, TestARGBQuantize) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
for (int i = 0; i < 1280; ++i) {
......@@ -760,7 +768,7 @@ TEST_F(libyuvTest, TestARGBQuantize) {
}
}
TEST_F(libyuvTest, TestARGBMirror) {
TEST_F(LibYUVPlanarTest, TestARGBMirror) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels[1280][4]);
......@@ -783,7 +791,7 @@ TEST_F(libyuvTest, TestARGBMirror) {
}
}
TEST_F(libyuvTest, TestShade) {
TEST_F(LibYUVPlanarTest, TestShade) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
SIMD_ALIGNED(uint8 shade_pixels[1280][4]);
memset(orig_pixels, 0, sizeof(orig_pixels));
......@@ -841,7 +849,7 @@ TEST_F(libyuvTest, TestShade) {
}
}
TEST_F(libyuvTest, TestInterpolate) {
TEST_F(LibYUVPlanarTest, TestInterpolate) {
SIMD_ALIGNED(uint8 orig_pixels_0[1280][4]);
SIMD_ALIGNED(uint8 orig_pixels_1[1280][4]);
SIMD_ALIGNED(uint8 interpolate_pixels[1280][4]);
......@@ -925,7 +933,7 @@ TEST_F(libyuvTest, TestInterpolate) {
#define TESTTERP(FMT_A, BPP_A, STRIDE_A, \
FMT_B, BPP_B, STRIDE_B, \
W1280, TERP, DIFF, N, NEG, OFF) \
TEST_F(libyuvTest, ARGBInterpolate##TERP##N) { \
TEST_F(LibYUVPlanarTest, ARGBInterpolate##TERP##N) { \
const int kWidth = ((W1280) > 0) ? (W1280) : 1; \
const int kHeight = benchmark_height_; \
const int kStrideA = (kWidth * BPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \
......@@ -935,10 +943,10 @@ TEST_F(libyuvTest, ARGBInterpolate##TERP##N) { \
align_buffer_64(dst_argb_c, kStrideB * kHeight); \
align_buffer_64(dst_argb_opt, kStrideB * kHeight); \
for (int i = 0; i < kStrideA * kHeight; ++i) { \
src_argb_a[i + OFF] = (fastrand() & 0xff); \
src_argb_b[i + OFF] = (fastrand() & 0xff); \
src_argb_a[i + OFF] = (fastrand() & 0xff); \
src_argb_b[i + OFF] = (fastrand() & 0xff); \
} \
MaskCpuFlags(disable_cpu_flags_); \
MaskCpuFlags(disable_cpu_flags_); \
ARGBInterpolate(src_argb_a + OFF, kStrideA, \
src_argb_b + OFF, kStrideA, \
dst_argb_c, kStrideB, \
......@@ -1034,31 +1042,31 @@ static int TestBlend(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBBlend_Any) {
TEST_F(LibYUVPlanarTest, ARGBBlend_Any) {
int max_diff = TestBlend(benchmark_width_ - 4, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlend_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBBlend_Unaligned) {
int max_diff = TestBlend(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlend_Invert) {
TEST_F(LibYUVPlanarTest, ARGBBlend_Invert) {
int max_diff = TestBlend(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlend_Opt) {
TEST_F(LibYUVPlanarTest, ARGBBlend_Opt) {
int max_diff = TestBlend(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, TestAffine) {
TEST_F(LibYUVPlanarTest, TestAffine) {
SIMD_ALIGNED(uint8 orig_pixels_0[1280][4]);
SIMD_ALIGNED(uint8 interpolate_pixels_C[1280][4]);
......@@ -1092,7 +1100,7 @@ TEST_F(libyuvTest, TestAffine) {
#endif
}
TEST_F(libyuvTest, TestSobelX) {
TEST_F(LibYUVPlanarTest, TestSobelX) {
SIMD_ALIGNED(uint8 orig_pixels_0[1280 + 2]);
SIMD_ALIGNED(uint8 orig_pixels_1[1280 + 2]);
SIMD_ALIGNED(uint8 orig_pixels_2[1280 + 2]);
......@@ -1134,7 +1142,7 @@ TEST_F(libyuvTest, TestSobelX) {
}
}
TEST_F(libyuvTest, TestSobelY) {
TEST_F(LibYUVPlanarTest, TestSobelY) {
SIMD_ALIGNED(uint8 orig_pixels_0[1280 + 2]);
SIMD_ALIGNED(uint8 orig_pixels_1[1280 + 2]);
SIMD_ALIGNED(uint8 sobel_pixels_c[1280]);
......@@ -1170,7 +1178,7 @@ TEST_F(libyuvTest, TestSobelY) {
}
}
TEST_F(libyuvTest, TestSobel) {
TEST_F(LibYUVPlanarTest, TestSobel) {
SIMD_ALIGNED(uint8 orig_sobelx[1280]);
SIMD_ALIGNED(uint8 orig_sobely[1280]);
SIMD_ALIGNED(uint8 sobel_pixels_c[1280 * 4]);
......@@ -1214,7 +1222,7 @@ TEST_F(libyuvTest, TestSobel) {
}
}
TEST_F(libyuvTest, TestSobelToPlane) {
TEST_F(LibYUVPlanarTest, TestSobelToPlane) {
SIMD_ALIGNED(uint8 orig_sobelx[1280]);
SIMD_ALIGNED(uint8 orig_sobely[1280]);
SIMD_ALIGNED(uint8 sobel_pixels_c[1280]);
......@@ -1252,7 +1260,7 @@ TEST_F(libyuvTest, TestSobelToPlane) {
}
}
TEST_F(libyuvTest, TestSobelXY) {
TEST_F(LibYUVPlanarTest, TestSobelXY) {
SIMD_ALIGNED(uint8 orig_sobelx[1280]);
SIMD_ALIGNED(uint8 orig_sobely[1280]);
SIMD_ALIGNED(uint8 sobel_pixels_c[1280 * 4]);
......@@ -1292,7 +1300,7 @@ TEST_F(libyuvTest, TestSobelXY) {
}
}
TEST_F(libyuvTest, TestCopyPlane) {
TEST_F(LibYUVPlanarTest, TestCopyPlane) {
int err = 0;
int yw = benchmark_width_;
int yh = benchmark_height_;
......@@ -1401,25 +1409,25 @@ static int TestMultiply(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBMultiply_Any) {
TEST_F(LibYUVPlanarTest, ARGBMultiply_Any) {
int max_diff = TestMultiply(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBMultiply_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBMultiply_Unaligned) {
int max_diff = TestMultiply(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBMultiply_Invert) {
TEST_F(LibYUVPlanarTest, ARGBMultiply_Invert) {
int max_diff = TestMultiply(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBMultiply_Opt) {
TEST_F(LibYUVPlanarTest, ARGBMultiply_Opt) {
int max_diff = TestMultiply(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
......@@ -1471,25 +1479,25 @@ static int TestAdd(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBAdd_Any) {
TEST_F(LibYUVPlanarTest, ARGBAdd_Any) {
int max_diff = TestAdd(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBAdd_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBAdd_Unaligned) {
int max_diff = TestAdd(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBAdd_Invert) {
TEST_F(LibYUVPlanarTest, ARGBAdd_Invert) {
int max_diff = TestAdd(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBAdd_Opt) {
TEST_F(LibYUVPlanarTest, ARGBAdd_Opt) {
int max_diff = TestAdd(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
......@@ -1541,25 +1549,25 @@ static int TestSubtract(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBSubtract_Any) {
TEST_F(LibYUVPlanarTest, ARGBSubtract_Any) {
int max_diff = TestSubtract(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBSubtract_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBSubtract_Unaligned) {
int max_diff = TestSubtract(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBSubtract_Invert) {
TEST_F(LibYUVPlanarTest, ARGBSubtract_Invert) {
int max_diff = TestSubtract(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBSubtract_Opt) {
TEST_F(LibYUVPlanarTest, ARGBSubtract_Opt) {
int max_diff = TestSubtract(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_LE(max_diff, 1);
......@@ -1607,25 +1615,25 @@ static int TestSobel(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBSobel_Any) {
TEST_F(LibYUVPlanarTest, ARGBSobel_Any) {
int max_diff = TestSobel(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobel_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBSobel_Unaligned) {
int max_diff = TestSobel(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobel_Invert) {
TEST_F(LibYUVPlanarTest, ARGBSobel_Invert) {
int max_diff = TestSobel(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobel_Opt) {
TEST_F(LibYUVPlanarTest, ARGBSobel_Opt) {
int max_diff = TestSobel(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_EQ(0, max_diff);
......@@ -1675,27 +1683,31 @@ static int TestSobelToPlane(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBSobelToPlane_Any) {
TEST_F(LibYUVPlanarTest, ARGBSobelToPlane_Any) {
int max_diff = TestSobelToPlane(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
benchmark_iterations_, disable_cpu_flags_,
+1, 0);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobelToPlane_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBSobelToPlane_Unaligned) {
int max_diff = TestSobelToPlane(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
benchmark_iterations_, disable_cpu_flags_,
+1, 1);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobelToPlane_Invert) {
TEST_F(LibYUVPlanarTest, ARGBSobelToPlane_Invert) {
int max_diff = TestSobelToPlane(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
benchmark_iterations_, disable_cpu_flags_,
-1, 0);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobelToPlane_Opt) {
TEST_F(LibYUVPlanarTest, ARGBSobelToPlane_Opt) {
int max_diff = TestSobelToPlane(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
benchmark_iterations_, disable_cpu_flags_,
+1, 0);
EXPECT_EQ(0, max_diff);
}
......@@ -1741,25 +1753,25 @@ static int TestSobelXY(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBSobelXY_Any) {
TEST_F(LibYUVPlanarTest, ARGBSobelXY_Any) {
int max_diff = TestSobelXY(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobelXY_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBSobelXY_Unaligned) {
int max_diff = TestSobelXY(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobelXY_Invert) {
TEST_F(LibYUVPlanarTest, ARGBSobelXY_Invert) {
int max_diff = TestSobelXY(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBSobelXY_Opt) {
TEST_F(LibYUVPlanarTest, ARGBSobelXY_Opt) {
int max_diff = TestSobelXY(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0);
EXPECT_EQ(0, max_diff);
......@@ -1812,56 +1824,64 @@ static int TestBlur(int width, int height, int benchmark_iterations,
}
static const int kBlurSize = 55;
TEST_F(libyuvTest, ARGBBlur_Any) {
TEST_F(LibYUVPlanarTest, ARGBBlur_Any) {
int max_diff = TestBlur(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0, kBlurSize);
benchmark_iterations_, disable_cpu_flags_,
+1, 0, kBlurSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlur_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBBlur_Unaligned) {
int max_diff = TestBlur(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1, kBlurSize);
benchmark_iterations_, disable_cpu_flags_,
+1, 1, kBlurSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlur_Invert) {
TEST_F(LibYUVPlanarTest, ARGBBlur_Invert) {
int max_diff = TestBlur(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0, kBlurSize);
benchmark_iterations_, disable_cpu_flags_,
-1, 0, kBlurSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlur_Opt) {
TEST_F(LibYUVPlanarTest, ARGBBlur_Opt) {
int max_diff = TestBlur(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0, kBlurSize);
benchmark_iterations_, disable_cpu_flags_,
+1, 0, kBlurSize);
EXPECT_LE(max_diff, 1);
}
static const int kBlurSmallSize = 5;
TEST_F(libyuvTest, ARGBBlurSmall_Any) {
TEST_F(LibYUVPlanarTest, ARGBBlurSmall_Any) {
int max_diff = TestBlur(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0, kBlurSmallSize);
benchmark_iterations_, disable_cpu_flags_,
+1, 0, kBlurSmallSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlurSmall_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBBlurSmall_Unaligned) {
int max_diff = TestBlur(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 1, kBlurSmallSize);
benchmark_iterations_, disable_cpu_flags_,
+1, 1, kBlurSmallSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlurSmall_Invert) {
TEST_F(LibYUVPlanarTest, ARGBBlurSmall_Invert) {
int max_diff = TestBlur(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, -1, 0, kBlurSmallSize);
benchmark_iterations_, disable_cpu_flags_,
-1, 0, kBlurSmallSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, ARGBBlurSmall_Opt) {
TEST_F(LibYUVPlanarTest, ARGBBlurSmall_Opt) {
int max_diff = TestBlur(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_, +1, 0, kBlurSmallSize);
benchmark_iterations_, disable_cpu_flags_,
+1, 0, kBlurSmallSize);
EXPECT_LE(max_diff, 1);
}
TEST_F(libyuvTest, TestARGBPolynomial) {
TEST_F(LibYUVPlanarTest, TestARGBPolynomial) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels_opt[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels_c[1280][4]);
......@@ -1948,7 +1968,7 @@ TEST_F(libyuvTest, TestARGBPolynomial) {
}
}
TEST_F(libyuvTest, TestARGBLumaColorTable) {
TEST_F(LibYUVPlanarTest, TestARGBLumaColorTable) {
SIMD_ALIGNED(uint8 orig_pixels[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels_opt[1280][4]);
SIMD_ALIGNED(uint8 dst_pixels_c[1280][4]);
......@@ -2026,7 +2046,7 @@ TEST_F(libyuvTest, TestARGBLumaColorTable) {
free_aligned_buffer_64(lumacolortable);
}
TEST_F(libyuvTest, TestARGBCopyAlpha) {
TEST_F(LibYUVPlanarTest, TestARGBCopyAlpha) {
const int kSize = benchmark_width_ * benchmark_height_ * 4;
align_buffer_64(orig_pixels, kSize);
align_buffer_64(dst_pixels_opt, kSize);
......@@ -2056,7 +2076,7 @@ TEST_F(libyuvTest, TestARGBCopyAlpha) {
free_aligned_buffer_64(orig_pixels);
}
TEST_F(libyuvTest, TestARGBCopyYToAlpha) {
TEST_F(LibYUVPlanarTest, TestARGBCopyYToAlpha) {
const int kPixels = benchmark_width_ * benchmark_height_;
align_buffer_64(orig_pixels, kPixels);
align_buffer_64(dst_pixels_opt, kPixels * 4);
......@@ -2130,56 +2150,56 @@ static int TestARGBRect(int width, int height, int benchmark_iterations,
return max_diff;
}
TEST_F(libyuvTest, ARGBRect_Any) {
TEST_F(LibYUVPlanarTest, ARGBRect_Any) {
int max_diff = TestARGBRect(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
+1, 0, 4);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBRect_Unaligned) {
TEST_F(LibYUVPlanarTest, ARGBRect_Unaligned) {
int max_diff = TestARGBRect(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
+1, 1, 4);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBRect_Invert) {
TEST_F(LibYUVPlanarTest, ARGBRect_Invert) {
int max_diff = TestARGBRect(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
-1, 0, 4);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, ARGBRect_Opt) {
TEST_F(LibYUVPlanarTest, ARGBRect_Opt) {
int max_diff = TestARGBRect(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
+1, 0, 4);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, SetPlane_Any) {
TEST_F(LibYUVPlanarTest, SetPlane_Any) {
int max_diff = TestARGBRect(benchmark_width_ - 1, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
+1, 0, 1);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, SetPlane_Unaligned) {
TEST_F(LibYUVPlanarTest, SetPlane_Unaligned) {
int max_diff = TestARGBRect(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
+1, 1, 1);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, SetPlane_Invert) {
TEST_F(LibYUVPlanarTest, SetPlane_Invert) {
int max_diff = TestARGBRect(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
-1, 0, 1);
EXPECT_EQ(0, max_diff);
}
TEST_F(libyuvTest, SetPlane_Opt) {
TEST_F(LibYUVPlanarTest, SetPlane_Opt) {
int max_diff = TestARGBRect(benchmark_width_, benchmark_height_,
benchmark_iterations_, disable_cpu_flags_,
+1, 0, 1);
......
......@@ -93,49 +93,49 @@ static void ARGBTestRotate(int src_width, int src_height,
mode, benchmark_iterations, disable_cpu_flags, 4);
}
TEST_F(libyuvTest, ARGBRotate0) {
TEST_F(LibYUVRotateTest, ARGBRotate0) {
ARGBTestRotate(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate90) {
TEST_F(LibYUVRotateTest, ARGBRotate90) {
ARGBTestRotate(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate180) {
TEST_F(LibYUVRotateTest, ARGBRotate180) {
ARGBTestRotate(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate270) {
TEST_F(LibYUVRotateTest, ARGBRotate270) {
ARGBTestRotate(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate0_Odd) {
TEST_F(LibYUVRotateTest, ARGBRotate0_Odd) {
ARGBTestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate90_Odd) {
TEST_F(LibYUVRotateTest, ARGBRotate90_Odd) {
ARGBTestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate180_Odd) {
TEST_F(LibYUVRotateTest, ARGBRotate180_Odd) {
ARGBTestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, ARGBRotate270_Odd) {
TEST_F(LibYUVRotateTest, ARGBRotate270_Odd) {
ARGBTestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
......@@ -150,49 +150,49 @@ static void TestRotatePlane(int src_width, int src_height,
mode, benchmark_iterations, disable_cpu_flags, 1);
}
TEST_F(libyuvTest, RotatePlane0) {
TEST_F(LibYUVRotateTest, RotatePlane0) {
TestRotatePlane(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane90) {
TEST_F(LibYUVRotateTest, RotatePlane90) {
TestRotatePlane(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane180) {
TEST_F(LibYUVRotateTest, RotatePlane180) {
TestRotatePlane(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane270) {
TEST_F(LibYUVRotateTest, RotatePlane270) {
TestRotatePlane(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane0_Odd) {
TEST_F(LibYUVRotateTest, RotatePlane0_Odd) {
TestRotatePlane(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane90_Odd) {
TEST_F(LibYUVRotateTest, RotatePlane90_Odd) {
TestRotatePlane(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane180_Odd) {
TEST_F(LibYUVRotateTest, RotatePlane180_Odd) {
TestRotatePlane(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, RotatePlane270_Odd) {
TEST_F(LibYUVRotateTest, RotatePlane270_Odd) {
TestRotatePlane(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
......
......@@ -82,49 +82,49 @@ static void I420TestRotate(int src_width, int src_height,
free_aligned_buffer_64(src_i420);
}
TEST_F(libyuvTest, I420Rotate0) {
TEST_F(LibYUVRotateTest, I420Rotate0) {
I420TestRotate(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate90) {
TEST_F(LibYUVRotateTest, I420Rotate90) {
I420TestRotate(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate180) {
TEST_F(LibYUVRotateTest, I420Rotate180) {
I420TestRotate(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate270) {
TEST_F(LibYUVRotateTest, I420Rotate270) {
I420TestRotate(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate0_Odd) {
TEST_F(LibYUVRotateTest, I420Rotate0_Odd) {
I420TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate90_Odd) {
TEST_F(LibYUVRotateTest, I420Rotate90_Odd) {
I420TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate180_Odd) {
TEST_F(LibYUVRotateTest, I420Rotate180_Odd) {
I420TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, I420Rotate270_Odd) {
TEST_F(LibYUVRotateTest, I420Rotate270_Odd) {
I420TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
......@@ -147,7 +147,8 @@ static void NV12TestRotate(int src_width, int src_height,
dst_height = 1;
}
int src_nv12_y_size = src_width * Abs(src_height);
int src_nv12_uv_size = ((src_width + 1) / 2) * ((Abs(src_height) + 1) / 2) * 2;
int src_nv12_uv_size =
((src_width + 1) / 2) * ((Abs(src_height) + 1) / 2) * 2;
int src_nv12_size = src_nv12_y_size + src_nv12_uv_size;
align_buffer_64(src_nv12, src_nv12_size);
for (int i = 0; i < src_nv12_size; ++i) {
......@@ -192,73 +193,73 @@ static void NV12TestRotate(int src_width, int src_height,
free_aligned_buffer_64(src_nv12);
}
TEST_F(libyuvTest, NV12Rotate0) {
TEST_F(LibYUVRotateTest, NV12Rotate0) {
NV12TestRotate(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate90) {
TEST_F(LibYUVRotateTest, NV12Rotate90) {
NV12TestRotate(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate180) {
TEST_F(LibYUVRotateTest, NV12Rotate180) {
NV12TestRotate(benchmark_width_, benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate270) {
TEST_F(LibYUVRotateTest, NV12Rotate270) {
NV12TestRotate(benchmark_width_, benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate0_Odd) {
TEST_F(LibYUVRotateTest, NV12Rotate0_Odd) {
NV12TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate90_Odd) {
TEST_F(LibYUVRotateTest, NV12Rotate90_Odd) {
NV12TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate180_Odd) {
TEST_F(LibYUVRotateTest, NV12Rotate180_Odd) {
NV12TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_width_ - 3, benchmark_height_ - 1,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate270_Odd) {
TEST_F(LibYUVRotateTest, NV12Rotate270_Odd) {
NV12TestRotate(benchmark_width_ - 3, benchmark_height_ - 1,
benchmark_height_ - 1, benchmark_width_ - 3,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate0_Inverted) {
TEST_F(LibYUVRotateTest, NV12Rotate0_Inverted) {
NV12TestRotate(benchmark_width_, -benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate0, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate90_Inverted) {
TEST_F(LibYUVRotateTest, NV12Rotate90_Inverted) {
NV12TestRotate(benchmark_width_, -benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate90, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate180_Inverted) {
TEST_F(LibYUVRotateTest, NV12Rotate180_Inverted) {
NV12TestRotate(benchmark_width_, -benchmark_height_,
benchmark_width_, benchmark_height_,
kRotate180, benchmark_iterations_, disable_cpu_flags_);
}
TEST_F(libyuvTest, NV12Rotate270_Inverted) {
TEST_F(LibYUVRotateTest, NV12Rotate270_Inverted) {
NV12TestRotate(benchmark_width_, -benchmark_height_,
benchmark_height_, benchmark_width_,
kRotate270, benchmark_iterations_, disable_cpu_flags_);
......
......@@ -214,11 +214,11 @@ static int ARGBClipTestFilter(int src_width, int src_height,
// The following adjustments in dimensions ensure the scale factor will be
// exactly achieved.
#define DX(x, nom, denom) ((int)(Abs(x) / nom) * nom)
#define SX(x, nom, denom) ((int)(x / nom) * denom)
#define DX(x, nom, denom) static_cast<int>((Abs(x) / nom) * nom)
#define SX(x, nom, denom) static_cast<int>((x / nom) * denom)
#define TEST_FACTOR1(name, filter, nom, denom, max_diff) \
TEST_F(libyuvTest, ARGBScaleDownBy##name##_##filter) { \
TEST_F(LibYUVScaleTest, ARGBScaleDownBy##name##_##filter) { \
int diff = ARGBTestFilter(SX(benchmark_width_, nom, denom), \
SX(benchmark_height_, nom, denom), \
DX(benchmark_width_, nom, denom), \
......@@ -227,7 +227,7 @@ static int ARGBClipTestFilter(int src_width, int src_height,
disable_cpu_flags_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, ARGBScaleDownClipBy##name##_##filter) { \
TEST_F(LibYUVScaleTest, ARGBScaleDownClipBy##name##_##filter) { \
int diff = ARGBClipTestFilter(SX(benchmark_width_, nom, denom), \
SX(benchmark_height_, nom, denom), \
DX(benchmark_width_, nom, denom), \
......@@ -256,27 +256,27 @@ TEST_FACTOR(3, 1, 3)
#undef DX
#define TEST_SCALETO1(name, width, height, filter, max_diff) \
TEST_F(libyuvTest, name##To##width##x##height##_##filter) { \
TEST_F(LibYUVScaleTest, name##To##width##x##height##_##filter) { \
int diff = ARGBTestFilter(benchmark_width_, benchmark_height_, \
width, height, \
kFilter##filter, benchmark_iterations_, \
disable_cpu_flags_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, name##From##width##x##height##_##filter) { \
TEST_F(LibYUVScaleTest, name##From##width##x##height##_##filter) { \
int diff = ARGBTestFilter(width, height, \
Abs(benchmark_width_), Abs(benchmark_height_), \
kFilter##filter, benchmark_iterations_, \
disable_cpu_flags_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, name##ClipTo##width##x##height##_##filter) { \
TEST_F(LibYUVScaleTest, name##ClipTo##width##x##height##_##filter) { \
int diff = ARGBClipTestFilter(benchmark_width_, benchmark_height_, \
width, height, \
kFilter##filter, benchmark_iterations_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, name##ClipFrom##width##x##height##_##filter) { \
TEST_F(LibYUVScaleTest, name##ClipFrom##width##x##height##_##filter) { \
int diff = ARGBClipTestFilter(width, height, \
Abs(benchmark_width_), \
Abs(benchmark_height_), \
......
......@@ -37,7 +37,7 @@ namespace libyuv {
#endif
#define TESTCS(TESTNAME, YUVTOARGB, ARGBTOYUV, HS1, HS, HN, DIFF) \
TEST_F(libyuvTest, TESTNAME) { \
TEST_F(LibYUVScaleTest, TESTNAME) { \
const int kPixels = benchmark_width_ * benchmark_height_; \
const int kHalfPixels = ((benchmark_width_ + 1) / 2) * \
((benchmark_height_ + HS1) / HS); \
......@@ -251,7 +251,7 @@ static void YUVJToRGBReference(int y, int u, int v, int* r, int* g, int* b) {
*b = RoundToByte(y - (u - 128) * -1.77200);
}
TEST_F(libyuvTest, ScaleTestYUV) {
TEST_F(LibYUVScaleTest, ScaleTestYUV) {
int r0, g0, b0, r1, g1, b1;
// cyan (less red)
......@@ -297,7 +297,7 @@ TEST_F(libyuvTest, ScaleTestYUV) {
}
}
TEST_F(libyuvTest, ScaleTestGreyYUV) {
TEST_F(LibYUVScaleTest, ScaleTestGreyYUV) {
int r0, g0, b0, r1, g1, b1, r2, g2, b2;
// black
......@@ -376,7 +376,7 @@ static void ScalePrintHistogram(int rh[256], int gh[256], int bh[256]) {
printf("\n");
}
TEST_F(libyuvTest, ScaleTestFullYUV) {
TEST_F(LibYUVScaleTest, ScaleTestFullYUV) {
int rh[256] = { 0, }, gh[256] = { 0, }, bh[256] = { 0, };
for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) {
......@@ -397,7 +397,7 @@ TEST_F(libyuvTest, ScaleTestFullYUV) {
ScalePrintHistogram(rh, gh, bh);
}
TEST_F(libyuvTest, ScaleTestFullYUVJ) {
TEST_F(LibYUVScaleTest, ScaleTestFullYUVJ) {
int rh[256] = { 0, }, gh[256] = { 0, }, bh[256] = { 0, };
for (int u = 0; u < 256; ++u) {
for (int v = 0; v < 256; ++v) {
......@@ -418,7 +418,7 @@ TEST_F(libyuvTest, ScaleTestFullYUVJ) {
ScalePrintHistogram(rh, gh, bh);
}
TEST_F(libyuvTest, ScaleTestGreyYUVJ) {
TEST_F(LibYUVScaleTest, ScaleTestGreyYUVJ) {
int r0, g0, b0, r1, g1, b1, r2, g2, b2;
// black
......
......@@ -274,11 +274,11 @@ static int TestFilter_16(int src_width, int src_height,
// The following adjustments in dimensions ensure the scale factor will be
// exactly achieved.
// 2 is chroma subsample
#define DX(x, nom, denom) ((int)(Abs(x) / nom / 2) * nom * 2)
#define SX(x, nom, denom) ((int)(x / nom / 2) * denom * 2)
#define DX(x, nom, denom) static_cast<int>((Abs(x) / nom / 2) * nom * 2)
#define SX(x, nom, denom) static_cast<int>((x / nom / 2) * denom * 2)
#define TEST_FACTOR1(name, filter, nom, denom, max_diff) \
TEST_F(libyuvTest, ScaleDownBy##name##_##filter) { \
TEST_F(LibYUVScaleTest, ScaleDownBy##name##_##filter) { \
int diff = TestFilter(SX(benchmark_width_, nom, denom), \
SX(benchmark_height_, nom, denom), \
DX(benchmark_width_, nom, denom), \
......@@ -287,7 +287,7 @@ static int TestFilter_16(int src_width, int src_height,
disable_cpu_flags_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, DISABLED_ScaleDownBy##name##_##filter##_16) { \
TEST_F(LibYUVScaleTest, DISABLED_ScaleDownBy##name##_##filter##_16) { \
int diff = TestFilter_16(SX(benchmark_width_, nom, denom), \
SX(benchmark_height_, nom, denom), \
DX(benchmark_width_, nom, denom), \
......@@ -316,28 +316,28 @@ TEST_FACTOR(3, 1, 3)
#undef DX
#define TEST_SCALETO1(name, width, height, filter, max_diff) \
TEST_F(libyuvTest, name##To##width##x##height##_##filter) { \
TEST_F(LibYUVScaleTest, name##To##width##x##height##_##filter) { \
int diff = TestFilter(benchmark_width_, benchmark_height_, \
width, height, \
kFilter##filter, benchmark_iterations_, \
disable_cpu_flags_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, name##From##width##x##height##_##filter) { \
TEST_F(LibYUVScaleTest, name##From##width##x##height##_##filter) { \
int diff = TestFilter(width, height, \
Abs(benchmark_width_), Abs(benchmark_height_), \
kFilter##filter, benchmark_iterations_, \
disable_cpu_flags_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, \
TEST_F(LibYUVScaleTest, \
DISABLED_##name##To##width##x##height##_##filter##_16) { \
int diff = TestFilter_16(benchmark_width_, benchmark_height_, \
width, height, \
kFilter##filter, benchmark_iterations_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, \
TEST_F(LibYUVScaleTest, \
DISABLED_##name##From##width##x##height##_##filter##_16) { \
int diff = TestFilter_16(width, height, \
Abs(benchmark_width_), Abs(benchmark_height_), \
......
......@@ -20,7 +20,147 @@
int fastrand_seed = 0xfb;
libyuvTest::libyuvTest() : rotate_max_w_(128), rotate_max_h_(128),
LibYUVConvertTest::LibYUVConvertTest() : rotate_max_w_(128), rotate_max_h_(128),
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
benchmark_height_(72), disable_cpu_flags_(0) {
const char* repeat = getenv("LIBYUV_REPEAT");
if (repeat) {
benchmark_iterations_ = atoi(repeat); // NOLINT
// For quicker unittests, default is 128 x 72. But when benchmarking,
// default to 720p. Allow size to specify.
if (benchmark_iterations_ > 1) {
benchmark_width_ = 1280;
benchmark_height_ = 720;
}
}
const char* width = getenv("LIBYUV_WIDTH");
if (width) {
benchmark_width_ = atoi(width); // NOLINT
}
const char* height = getenv("LIBYUV_HEIGHT");
if (height) {
benchmark_height_ = atoi(height); // NOLINT
}
const char* cpu_flags = getenv("LIBYUV_FLAGS");
if (cpu_flags) {
disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
}
benchmark_pixels_div256_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
benchmark_pixels_div1280_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
}
LibYUVScaleTest::LibYUVScaleTest() : rotate_max_w_(128), rotate_max_h_(128),
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
benchmark_height_(72), disable_cpu_flags_(0) {
const char* repeat = getenv("LIBYUV_REPEAT");
if (repeat) {
benchmark_iterations_ = atoi(repeat); // NOLINT
// For quicker unittests, default is 128 x 72. But when benchmarking,
// default to 720p. Allow size to specify.
if (benchmark_iterations_ > 1) {
benchmark_width_ = 1280;
benchmark_height_ = 720;
}
}
const char* width = getenv("LIBYUV_WIDTH");
if (width) {
benchmark_width_ = atoi(width); // NOLINT
}
const char* height = getenv("LIBYUV_HEIGHT");
if (height) {
benchmark_height_ = atoi(height); // NOLINT
}
const char* cpu_flags = getenv("LIBYUV_FLAGS");
if (cpu_flags) {
disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
}
benchmark_pixels_div256_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
benchmark_pixels_div1280_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
}
LibYUVRotateTest::LibYUVRotateTest() : rotate_max_w_(128), rotate_max_h_(128),
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
benchmark_height_(72), disable_cpu_flags_(0) {
const char* repeat = getenv("LIBYUV_REPEAT");
if (repeat) {
benchmark_iterations_ = atoi(repeat); // NOLINT
// For quicker unittests, default is 128 x 72. But when benchmarking,
// default to 720p. Allow size to specify.
if (benchmark_iterations_ > 1) {
benchmark_width_ = 1280;
benchmark_height_ = 720;
}
}
const char* width = getenv("LIBYUV_WIDTH");
if (width) {
benchmark_width_ = atoi(width); // NOLINT
}
const char* height = getenv("LIBYUV_HEIGHT");
if (height) {
benchmark_height_ = atoi(height); // NOLINT
}
const char* cpu_flags = getenv("LIBYUV_FLAGS");
if (cpu_flags) {
disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
}
benchmark_pixels_div256_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
benchmark_pixels_div1280_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
}
LibYUVPlanarTest::LibYUVPlanarTest() : rotate_max_w_(128), rotate_max_h_(128),
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
benchmark_height_(72), disable_cpu_flags_(0) {
const char* repeat = getenv("LIBYUV_REPEAT");
if (repeat) {
benchmark_iterations_ = atoi(repeat); // NOLINT
// For quicker unittests, default is 128 x 72. But when benchmarking,
// default to 720p. Allow size to specify.
if (benchmark_iterations_ > 1) {
benchmark_width_ = 1280;
benchmark_height_ = 720;
}
}
const char* width = getenv("LIBYUV_WIDTH");
if (width) {
benchmark_width_ = atoi(width); // NOLINT
}
const char* height = getenv("LIBYUV_HEIGHT");
if (height) {
benchmark_height_ = atoi(height); // NOLINT
}
const char* cpu_flags = getenv("LIBYUV_FLAGS");
if (cpu_flags) {
disable_cpu_flags_ = atoi(cpu_flags); // NOLINT
}
benchmark_pixels_div256_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 255.0) / 256.0);
benchmark_pixels_div1280_ = static_cast<int>((
static_cast<double>(Abs(benchmark_width_)) *
static_cast<double>(Abs(benchmark_height_)) *
static_cast<double>(benchmark_iterations_) + 1279.0) / 1280.0);
}
LibYUVBaseTest::LibYUVBaseTest() : rotate_max_w_(128), rotate_max_h_(128),
benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128),
benchmark_height_(72), disable_cpu_flags_(0) {
const char* repeat = getenv("LIBYUV_REPEAT");
......
......@@ -72,9 +72,69 @@ static inline void MemRandomize(uint8* dst, int64 len) {
}
}
class libyuvTest : public ::testing::Test {
class LibYUVConvertTest : public ::testing::Test {
protected:
libyuvTest();
LibYUVConvertTest();
const int rotate_max_w_;
const int rotate_max_h_;
int benchmark_iterations_; // Default 1. Use 1000 for benchmarking.
int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA.
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
};
class LibYUVScaleTest : public ::testing::Test {
protected:
LibYUVScaleTest();
const int rotate_max_w_;
const int rotate_max_h_;
int benchmark_iterations_; // Default 1. Use 1000 for benchmarking.
int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA.
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
};
class LibYUVRotateTest : public ::testing::Test {
protected:
LibYUVRotateTest();
const int rotate_max_w_;
const int rotate_max_h_;
int benchmark_iterations_; // Default 1. Use 1000 for benchmarking.
int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA.
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
};
class LibYUVPlanarTest : public ::testing::Test {
protected:
LibYUVPlanarTest();
const int rotate_max_w_;
const int rotate_max_h_;
int benchmark_iterations_; // Default 1. Use 1000 for benchmarking.
int benchmark_width_; // Default 1280. Use 640 for benchmarking VGA.
int benchmark_height_; // Default 720. Use 360 for benchmarking VGA.
int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
int benchmark_pixels_div1280_; // Total pixels to benchmark / 1280.
int disable_cpu_flags_; // Default 0. Use -1 for benchmarking.
};
class LibYUVBaseTest : public ::testing::Test {
protected:
LibYUVBaseTest();
const int rotate_max_w_;
const int rotate_max_h_;
......
......@@ -20,7 +20,7 @@ namespace libyuv {
// Tests SVN version against include/libyuv/version.h
// SVN version is bumped by documentation changes as well as code.
// Although the versions should match, once checked in, a tolerance is allowed.
TEST_F(libyuvTest, DISABLED_TestVersion) {
TEST_F(LibYUVBaseTest, DISABLED_TestVersion) {
EXPECT_GE(LIBYUV_VERSION, 169); // 169 is first version to support version.
printf("LIBYUV_VERSION %d\n", LIBYUV_VERSION);
#ifdef LIBYUV_SVNREVISION
......
......@@ -41,7 +41,7 @@ static bool TestValidFourCC(uint32 fourcc, int bpp) {
return true;
}
TEST_F(libyuvTest, TestCanonicalFourCC) {
TEST_F(LibYUVBaseTest, TestCanonicalFourCC) {
EXPECT_EQ(FOURCC_I420, CanonicalFourCC(FOURCC_IYUV));
EXPECT_EQ(FOURCC_I422, CanonicalFourCC(FOURCC_YU16));
EXPECT_EQ(FOURCC_I444, CanonicalFourCC(FOURCC_YU24));
......@@ -60,7 +60,7 @@ TEST_F(libyuvTest, TestCanonicalFourCC) {
EXPECT_EQ(FOURCC_RGBO, CanonicalFourCC(FOURCC_5551));
}
TEST_F(libyuvTest, TestFourCC) {
TEST_F(LibYUVBaseTest, TestFourCC) {
EXPECT_TRUE(TestValidFourCC(FOURCC_I420, FOURCC_BPP_I420));
EXPECT_TRUE(TestValidFourCC(FOURCC_I420, FOURCC_BPP_I420));
EXPECT_TRUE(TestValidFourCC(FOURCC_I422, FOURCC_BPP_I422));
......
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