Commit 68f0d3df authored by fbarchard@google.com's avatar fbarchard@google.com

NV12ToARGB for linux appears to have a bug in the assembly so this disables the…

NV12ToARGB for linux appears to have a bug in the assembly so this disables the asm for posix.  It still works on Windows.  Unittests updated to show the amount of pixel difference.
BUG=55
TEST=out/Release/libyuv_unittest --gtest_filter=*
Review URL: https://webrtc-codereview.appspot.com/675008

git-svn-id: http://libyuv.googlecode.com/svn/trunk@310 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 25ba0211
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 307 Version: 310
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 307 #define LIBYUV_VERSION 310
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -57,8 +57,6 @@ extern "C" { ...@@ -57,8 +57,6 @@ extern "C" {
#define HAS_I444TOARGBROW_SSSE3 #define HAS_I444TOARGBROW_SSSE3
#define HAS_I422TOARGBROW_SSSE3 #define HAS_I422TOARGBROW_SSSE3
#define HAS_I411TOARGBROW_SSSE3 #define HAS_I411TOARGBROW_SSSE3
#define HAS_NV12TOARGBROW_SSSE3
#define HAS_NV21TOARGBROW_SSSE3
#define HAS_I422TOBGRAROW_SSSE3 #define HAS_I422TOBGRAROW_SSSE3
#define HAS_I422TOABGRROW_SSSE3 #define HAS_I422TOABGRROW_SSSE3
#define HAS_I400TOARGBROW_SSE2 #define HAS_I400TOARGBROW_SSE2
...@@ -87,6 +85,8 @@ extern "C" { ...@@ -87,6 +85,8 @@ extern "C" {
#if !defined(YUV_DISABLE_ASM) && defined(_M_IX86) #if !defined(YUV_DISABLE_ASM) && defined(_M_IX86)
// TODO(fbarchard): Investigate possible issue in this function and reenable. // TODO(fbarchard): Investigate possible issue in this function and reenable.
#define HAS_ARGBCOLORTABLEROW_X86 #define HAS_ARGBCOLORTABLEROW_X86
#define HAS_NV12TOARGBROW_SSSE3
#define HAS_NV21TOARGBROW_SSSE3
#endif #endif
// The following are disabled when SSSE3 is available: // The following are disabled when SSSE3 is available:
......
...@@ -59,17 +59,18 @@ TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##_OptVsC) { \ ...@@ -59,17 +59,18 @@ TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##_OptVsC) { \
dst_argb_opt, kWidth * BPP_B, \ dst_argb_opt, kWidth * BPP_B, \
kWidth, kHeight); \ kWidth, kHeight); \
} \ } \
int err = 0; \ int max_diff = 0; \
for (int i = 0; i < kHeight; ++i) { \ for (int i = 0; i < kHeight; ++i) { \
for (int j = 0; j < kWidth * BPP_B; ++j) { \ for (int j = 0; j < kWidth * BPP_B; ++j) { \
int diff = static_cast<int>(dst_argb_c[i * kWidth * BPP_B + j]) - \ int abs_diff = \
static_cast<int>(dst_argb_opt[i * kWidth * BPP_B + j]); \ abs(static_cast<int>(dst_argb_c[i * kWidth * BPP_B + j]) - \
if (abs(diff) > 2) { \ static_cast<int>(dst_argb_opt[i * kWidth * BPP_B + j])); \
++err; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \ } \
} \ } \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 2);; \
free_aligned_buffer_16(src_y) \ free_aligned_buffer_16(src_y) \
free_aligned_buffer_16(src_u) \ free_aligned_buffer_16(src_u) \
free_aligned_buffer_16(src_v) \ free_aligned_buffer_16(src_v) \
...@@ -119,17 +120,18 @@ TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##_OptVsC) { \ ...@@ -119,17 +120,18 @@ TEST_F(libyuvTest, FMT_PLANAR##To##FMT_B##_OptVsC) { \
dst_argb_opt, kWidth * BPP_B, \ dst_argb_opt, kWidth * BPP_B, \
kWidth, kHeight); \ kWidth, kHeight); \
} \ } \
int err = 0; \ int max_diff = 0; \
for (int i = 0; i < kHeight; ++i) { \ for (int i = 0; i < kHeight; ++i) { \
for (int j = 0; j < kWidth * BPP_B; ++j) { \ for (int j = 0; j < kWidth * BPP_B; ++j) { \
int diff = static_cast<int>(dst_argb_c[i * kWidth * BPP_B + j]) - \ int abs_diff = \
static_cast<int>(dst_argb_opt[i * kWidth * BPP_B + j]); \ abs(static_cast<int>(dst_argb_c[i * kWidth * BPP_B + j]) - \
if (abs(diff) > 2) { \ static_cast<int>(dst_argb_opt[i * kWidth * BPP_B + j])); \
++err; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \ } \
} \ } \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 3);; \
free_aligned_buffer_16(src_y) \ free_aligned_buffer_16(src_y) \
free_aligned_buffer_16(src_uv) \ free_aligned_buffer_16(src_uv) \
free_aligned_buffer_16(dst_argb_c) \ free_aligned_buffer_16(dst_argb_c) \
...@@ -171,37 +173,40 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##_OptVsC) { \ ...@@ -171,37 +173,40 @@ TEST_F(libyuvTest, FMT_A##To##FMT_PLANAR##_OptVsC) { \
dst_v_opt, kWidth / SUBSAMP_X, \ dst_v_opt, kWidth / SUBSAMP_X, \
kWidth, kHeight); \ kWidth, kHeight); \
} \ } \
int err = 0; \ int max_diff = 0; \
for (int i = 0; i < kHeight; ++i) { \ for (int i = 0; i < kHeight; ++i) { \
for (int j = 0; j < kWidth; ++j) { \ for (int j = 0; j < kWidth; ++j) { \
int diff = static_cast<int>(dst_y_c[i * kWidth + j]) - \ int abs_diff = \
static_cast<int>(dst_y_opt[i * kWidth + j]); \ abs(static_cast<int>(dst_y_c[i * kWidth + j]) - \
if (abs(diff) > 2) { \ static_cast<int>(dst_y_opt[i * kWidth + j])); \
++err; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \ } \
} \ } \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 2);; \
for (int i = 0; i < kHeight / SUBSAMP_Y; ++i) { \ for (int i = 0; i < kHeight / SUBSAMP_Y; ++i) { \
for (int j = 0; j < kWidth / SUBSAMP_X; ++j) { \ for (int j = 0; j < kWidth / SUBSAMP_X; ++j) { \
int diff = static_cast<int>(dst_u_c[i * kWidth / SUBSAMP_X + j]) - \ int abs_diff = \
static_cast<int>(dst_u_opt[i * kWidth / SUBSAMP_X + j]); \ abs(static_cast<int>(dst_u_c[i * kWidth / SUBSAMP_X + j]) - \
if (abs(diff) > 2) { \ static_cast<int>(dst_u_opt[i * kWidth / SUBSAMP_X + j])); \
++err; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \ } \
} \ } \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 2);; \
for (int i = 0; i < kHeight / SUBSAMP_Y; ++i) { \ for (int i = 0; i < kHeight / SUBSAMP_Y; ++i) { \
for (int j = 0; j < kWidth / SUBSAMP_X; ++j) { \ for (int j = 0; j < kWidth / SUBSAMP_X; ++j) { \
int diff = static_cast<int>(dst_v_c[i * kWidth / SUBSAMP_X + j]) - \ int abs_diff = \
static_cast<int>(dst_v_opt[i * kWidth / SUBSAMP_X + j]); \ abs(static_cast<int>(dst_v_c[i * kWidth / SUBSAMP_X + j]) - \
if (abs(diff) > 2) { \ static_cast<int>(dst_v_opt[i * kWidth / SUBSAMP_X + j])); \
++err; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \ } \
} \ } \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 2);; \
free_aligned_buffer_16(dst_y_c) \ free_aligned_buffer_16(dst_y_c) \
free_aligned_buffer_16(dst_u_c) \ free_aligned_buffer_16(dst_u_c) \
free_aligned_buffer_16(dst_v_c) \ free_aligned_buffer_16(dst_v_c) \
...@@ -246,14 +251,16 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##_OptVsC) { \ ...@@ -246,14 +251,16 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##_OptVsC) { \
dst_argb_opt, kWidth * BPP_B, \ dst_argb_opt, kWidth * BPP_B, \
kWidth, kHeight); \ kWidth, kHeight); \
} \ } \
int err = 0; \ int max_diff = 0; \
for (int i = 0; i < kHeight * kWidth * BPP_B; ++i) { \ for (int i = 0; i < kHeight * kWidth * BPP_B; ++i) { \
int diff = static_cast<int>(dst_argb_c[i]) - \ int abs_diff = \
static_cast<int>(dst_argb_opt[i]); \ abs(static_cast<int>(dst_argb_c[i]) - \
if (abs(diff) > 2) \ static_cast<int>(dst_argb_opt[i])); \
err++; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 2);; \
free_aligned_buffer_16(src_argb) \ free_aligned_buffer_16(src_argb) \
free_aligned_buffer_16(dst_argb_c) \ free_aligned_buffer_16(dst_argb_c) \
free_aligned_buffer_16(dst_argb_opt) \ free_aligned_buffer_16(dst_argb_opt) \
...@@ -300,14 +307,16 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##_Random) { \ ...@@ -300,14 +307,16 @@ TEST_F(libyuvTest, FMT_A##To##FMT_B##_Random) { \
FMT_A##To##FMT_B(src_argb, kWidth * STRIDE_A, \ FMT_A##To##FMT_B(src_argb, kWidth * STRIDE_A, \
dst_argb_opt, kWidth * BPP_B, \ dst_argb_opt, kWidth * BPP_B, \
kWidth, kHeight); \ kWidth, kHeight); \
int err = 0; \ int max_diff = 0; \
for (int i = 0; i < kHeight * kWidth * BPP_B; ++i) { \ for (int i = 0; i < kHeight * kWidth * BPP_B; ++i) { \
int diff = static_cast<int>(dst_argb_c[i]) - \ int abs_diff = \
static_cast<int>(dst_argb_opt[i]); \ abs(static_cast<int>(dst_argb_c[i]) - \
if (abs(diff) > 2) \ static_cast<int>(dst_argb_opt[i])); \
err++; \ if (abs_diff > max_diff) { \
max_diff = abs_diff; \
} \
} \ } \
EXPECT_EQ(err, 0); \ EXPECT_LE(max_diff, 2);; \
free_aligned_buffer_page_end(src_argb) \ free_aligned_buffer_page_end(src_argb) \
free_aligned_buffer_page_end(dst_argb_c) \ free_aligned_buffer_page_end(dst_argb_c) \
free_aligned_buffer_page_end(dst_argb_opt) \ free_aligned_buffer_page_end(dst_argb_opt) \
...@@ -656,7 +665,6 @@ TEST_F(libyuvTest, TestARGBColorMatrix) { ...@@ -656,7 +665,6 @@ TEST_F(libyuvTest, TestARGBColorMatrix) {
} }
} }
TEST_F(libyuvTest, TestARGBColorTable) { TEST_F(libyuvTest, TestARGBColorTable) {
SIMD_ALIGNED(uint8 orig_pixels[256][4]); SIMD_ALIGNED(uint8 orig_pixels[256][4]);
......
...@@ -90,8 +90,9 @@ static int ARGBTestFilter(int src_width, int src_height, ...@@ -90,8 +90,9 @@ static int ARGBTestFilter(int src_width, int src_height,
for (j = b * 4; j < (dst_width + b) * 4; ++j) { for (j = b * 4; j < (dst_width + b) * 4; ++j) {
int abs_diff = abs(dst_argb_c[(i * dst_stride_argb) + j] - int abs_diff = abs(dst_argb_c[(i * dst_stride_argb) + j] -
dst_argb_opt[(i * dst_stride_argb) + j]); dst_argb_opt[(i * dst_stride_argb) + j]);
if (abs_diff > max_diff) if (abs_diff > max_diff) {
max_diff = abs_diff; max_diff = abs_diff;
}
} }
} }
...@@ -108,10 +109,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy2) { ...@@ -108,10 +109,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy2) {
const int dst_height = src_height / 2; const int dst_height = src_height / 2;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -122,10 +123,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy4) { ...@@ -122,10 +123,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy4) {
const int dst_height = src_height / 4; const int dst_height = src_height / 4;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -136,10 +137,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy5) { ...@@ -136,10 +137,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy5) {
const int dst_height = src_height / 5; const int dst_height = src_height / 5;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -150,10 +151,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy8) { ...@@ -150,10 +151,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy8) {
const int dst_height = src_height / 8; const int dst_height = src_height / 8;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -164,10 +165,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy16) { ...@@ -164,10 +165,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy16) {
const int dst_height = src_height / 16; const int dst_height = src_height / 16;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -178,10 +179,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy34) { ...@@ -178,10 +179,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy34) {
const int dst_height = src_height * 3 / 4; const int dst_height = src_height * 3 / 4;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -192,10 +193,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy38) { ...@@ -192,10 +193,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy38) {
int dst_height = src_height * 3 / 8; int dst_height = src_height * 3 / 8;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -206,10 +207,10 @@ TEST_F(libyuvTest, ARGBScaleTo1366) { ...@@ -206,10 +207,10 @@ TEST_F(libyuvTest, ARGBScaleTo1366) {
int dst_height = 768; int dst_height = 768;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -220,10 +221,10 @@ TEST_F(libyuvTest, ARGBScaleTo4074) { ...@@ -220,10 +221,10 @@ TEST_F(libyuvTest, ARGBScaleTo4074) {
int dst_height = 1272; int dst_height = 1272;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -235,10 +236,10 @@ TEST_F(libyuvTest, ARGBScaleTo853) { ...@@ -235,10 +236,10 @@ TEST_F(libyuvTest, ARGBScaleTo853) {
int dst_height = 480; int dst_height = 480;
for (int f = 0; f < 2; ++f) { for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height, int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f)); static_cast<FilterMode>(f));
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
......
...@@ -170,10 +170,10 @@ TEST_F(libyuvTest, ScaleDownBy2) { ...@@ -170,10 +170,10 @@ TEST_F(libyuvTest, ScaleDownBy2) {
const int dst_height = src_height / 2; const int dst_height = src_height / 2;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -184,10 +184,10 @@ TEST_F(libyuvTest, ScaleDownBy4) { ...@@ -184,10 +184,10 @@ TEST_F(libyuvTest, ScaleDownBy4) {
const int dst_height = src_height / 4; const int dst_height = src_height / 4;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(2, err); // This is the only scale factor with error of 2. EXPECT_LE(max_diff, 2);; // This is the only scale factor with error of 2.
} }
} }
...@@ -198,10 +198,10 @@ TEST_F(libyuvTest, ScaleDownBy5) { ...@@ -198,10 +198,10 @@ TEST_F(libyuvTest, ScaleDownBy5) {
const int dst_height = src_height / 5; const int dst_height = src_height / 5;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -212,10 +212,10 @@ TEST_F(libyuvTest, ScaleDownBy8) { ...@@ -212,10 +212,10 @@ TEST_F(libyuvTest, ScaleDownBy8) {
const int dst_height = src_height / 8; const int dst_height = src_height / 8;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -226,10 +226,10 @@ TEST_F(libyuvTest, ScaleDownBy16) { ...@@ -226,10 +226,10 @@ TEST_F(libyuvTest, ScaleDownBy16) {
const int dst_height = src_height / 16; const int dst_height = src_height / 16;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -240,10 +240,10 @@ TEST_F(libyuvTest, ScaleDownBy34) { ...@@ -240,10 +240,10 @@ TEST_F(libyuvTest, ScaleDownBy34) {
const int dst_height = src_height * 3 / 4; const int dst_height = src_height * 3 / 4;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -254,10 +254,10 @@ TEST_F(libyuvTest, ScaleDownBy38) { ...@@ -254,10 +254,10 @@ TEST_F(libyuvTest, ScaleDownBy38) {
int dst_height = src_height * 3 / 8; int dst_height = src_height * 3 / 8;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -268,10 +268,10 @@ TEST_F(libyuvTest, ScaleTo1366) { ...@@ -268,10 +268,10 @@ TEST_F(libyuvTest, ScaleTo1366) {
int dst_height = 768; int dst_height = 768;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -282,10 +282,10 @@ TEST_F(libyuvTest, ScaleTo4074) { ...@@ -282,10 +282,10 @@ TEST_F(libyuvTest, ScaleTo4074) {
int dst_height = 1272; int dst_height = 1272;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -296,10 +296,10 @@ TEST_F(libyuvTest, ScaleTo853) { ...@@ -296,10 +296,10 @@ TEST_F(libyuvTest, ScaleTo853) {
int dst_height = 480; int dst_height = 480;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -310,10 +310,10 @@ TEST_F(libyuvTest, ScaleTo853Wrong) { ...@@ -310,10 +310,10 @@ TEST_F(libyuvTest, ScaleTo853Wrong) {
int dst_height = 480; int dst_height = 480;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 0); static_cast<FilterMode>(f), 0);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -325,10 +325,10 @@ TEST_F(libyuvTest, ScaleTo684) { ...@@ -325,10 +325,10 @@ TEST_F(libyuvTest, ScaleTo684) {
int dst_height = 552; int dst_height = 552;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -339,10 +339,10 @@ TEST_F(libyuvTest, ScaleTo342) { ...@@ -339,10 +339,10 @@ TEST_F(libyuvTest, ScaleTo342) {
int dst_height = 276; int dst_height = 276;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
...@@ -353,10 +353,10 @@ TEST_F(libyuvTest, ScaleToHalf342) { ...@@ -353,10 +353,10 @@ TEST_F(libyuvTest, ScaleToHalf342) {
int dst_height = 276; int dst_height = 276;
for (int f = 0; f < 3; ++f) { for (int f = 0; f < 3; ++f) {
int err = TestFilter(src_width, src_height, int max_diff = TestFilter(src_width, src_height,
dst_width, dst_height, dst_width, dst_height,
static_cast<FilterMode>(f), 1); static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err); EXPECT_LE(max_diff, 1);
} }
} }
......
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