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
URL: http://code.google.com/p/libyuv/
Version: 307
Version: 310
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 307
#define LIBYUV_VERSION 310
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -57,8 +57,6 @@ extern "C" {
#define HAS_I444TOARGBROW_SSSE3
#define HAS_I422TOARGBROW_SSSE3
#define HAS_I411TOARGBROW_SSSE3
#define HAS_NV12TOARGBROW_SSSE3
#define HAS_NV21TOARGBROW_SSSE3
#define HAS_I422TOBGRAROW_SSSE3
#define HAS_I422TOABGRROW_SSSE3
#define HAS_I400TOARGBROW_SSE2
......@@ -87,6 +85,8 @@ extern "C" {
#if !defined(YUV_DISABLE_ASM) && defined(_M_IX86)
// TODO(fbarchard): Investigate possible issue in this function and reenable.
#define HAS_ARGBCOLORTABLEROW_X86
#define HAS_NV12TOARGBROW_SSSE3
#define HAS_NV21TOARGBROW_SSSE3
#endif
// The following are disabled when SSSE3 is available:
......
This diff is collapsed.
......@@ -90,8 +90,9 @@ static int ARGBTestFilter(int src_width, int src_height,
for (j = b * 4; j < (dst_width + b) * 4; ++j) {
int abs_diff = abs(dst_argb_c[(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;
}
}
}
......@@ -108,10 +109,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy2) {
const int dst_height = src_height / 2;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -122,10 +123,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy4) {
const int dst_height = src_height / 4;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -136,10 +137,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy5) {
const int dst_height = src_height / 5;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -150,10 +151,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy8) {
const int dst_height = src_height / 8;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -164,10 +165,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy16) {
const int dst_height = src_height / 16;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -178,10 +179,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy34) {
const int dst_height = src_height * 3 / 4;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -192,10 +193,10 @@ TEST_F(libyuvTest, ARGBScaleDownBy38) {
int dst_height = src_height * 3 / 8;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -206,10 +207,10 @@ TEST_F(libyuvTest, ARGBScaleTo1366) {
int dst_height = 768;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -220,10 +221,10 @@ TEST_F(libyuvTest, ARGBScaleTo4074) {
int dst_height = 1272;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......@@ -235,10 +236,10 @@ TEST_F(libyuvTest, ARGBScaleTo853) {
int dst_height = 480;
for (int f = 0; f < 2; ++f) {
int err = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_GE(1, err);
int max_diff = ARGBTestFilter(src_width, src_height,
dst_width, dst_height,
static_cast<FilterMode>(f));
EXPECT_LE(max_diff, 1);
}
}
......
......@@ -170,10 +170,10 @@ TEST_F(libyuvTest, ScaleDownBy2) {
const int dst_height = src_height / 2;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -184,10 +184,10 @@ TEST_F(libyuvTest, ScaleDownBy4) {
const int dst_height = src_height / 4;
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,
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) {
const int dst_height = src_height / 5;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -212,10 +212,10 @@ TEST_F(libyuvTest, ScaleDownBy8) {
const int dst_height = src_height / 8;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -226,10 +226,10 @@ TEST_F(libyuvTest, ScaleDownBy16) {
const int dst_height = src_height / 16;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -240,10 +240,10 @@ TEST_F(libyuvTest, ScaleDownBy34) {
const int dst_height = src_height * 3 / 4;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -254,10 +254,10 @@ TEST_F(libyuvTest, ScaleDownBy38) {
int dst_height = src_height * 3 / 8;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -268,10 +268,10 @@ TEST_F(libyuvTest, ScaleTo1366) {
int dst_height = 768;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -282,10 +282,10 @@ TEST_F(libyuvTest, ScaleTo4074) {
int dst_height = 1272;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -296,10 +296,10 @@ TEST_F(libyuvTest, ScaleTo853) {
int dst_height = 480;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -310,10 +310,10 @@ TEST_F(libyuvTest, ScaleTo853Wrong) {
int dst_height = 480;
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,
static_cast<FilterMode>(f), 0);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -325,10 +325,10 @@ TEST_F(libyuvTest, ScaleTo684) {
int dst_height = 552;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -339,10 +339,10 @@ TEST_F(libyuvTest, ScaleTo342) {
int dst_height = 276;
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,
static_cast<FilterMode>(f), 1);
EXPECT_GE(1, err);
EXPECT_LE(max_diff, 1);
}
}
......@@ -353,10 +353,10 @@ TEST_F(libyuvTest, ScaleToHalf342) {
int dst_height = 276;
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,
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