Commit 11c6d32a authored by fbarchard@google.com's avatar fbarchard@google.com

I420ToARGB1555, I420ToARGB4444, I420ToRGB565, ARGBToARGB1555, ARGBToARGB4444,…

I420ToARGB1555, I420ToARGB4444, I420ToRGB565, ARGBToARGB1555, ARGBToARGB4444, and ARGBToRGB565 done with shared macro for conversion in 1 step NEON.
BUG=139
TEST=libyuv_unittest --gtest_filter=*I420To*RGB???*_*
Review URL: https://webrtc-codereview.appspot.com/928013

git-svn-id: http://libyuv.googlecode.com/svn/trunk@460 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent af1aa56f
......@@ -939,7 +939,7 @@ int I420ToARGB1555(const uint8* src_y, int src_stride_y,
uint8* rgb_buf,
int width) = I422ToARGB1555Row_C;
#if defined(HAS_I422TOARGB1555ROW_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8) {
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width <= kMaxStride * 4) {
I422ToARGB1555Row = I422ToARGB1555Row_Any_SSSE3;
if (IS_ALIGNED(width, 8)) {
I422ToARGB1555Row = I422ToARGB1555Row_SSSE3;
......@@ -990,7 +990,7 @@ int I420ToARGB4444(const uint8* src_y, int src_stride_y,
uint8* rgb_buf,
int width) = I422ToARGB4444Row_C;
#if defined(HAS_I422TOARGB4444ROW_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8) {
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8 && width <= kMaxStride * 4) {
I422ToARGB4444Row = I422ToARGB4444Row_Any_SSSE3;
if (IS_ALIGNED(width, 8)) {
I422ToARGB4444Row = I422ToARGB4444Row_SSSE3;
......@@ -1040,7 +1040,11 @@ int I420ToRGB565(const uint8* src_y, int src_stride_y,
uint8* rgb_buf,
int width) = I422ToRGB565Row_C;
#if defined(HAS_I422TORGB565ROW_SSSE3)
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8) {
if (TestCpuFlag(kCpuHasSSSE3) && width >= 8
#if defined(__x86_64__) || defined(__i386__)
&& width <= kMaxStride * 4
#endif
) {
I422ToRGB565Row = I422ToRGB565Row_Any_SSSE3;
if (IS_ALIGNED(width, 8)) {
I422ToRGB565Row = I422ToRGB565Row_SSSE3;
......
......@@ -1275,7 +1275,10 @@ void I422ToUYVYRow_C(const uint8* src_y,
dst_frame[3] = src_y[0]; // duplicate last y
}
}
#if !defined(YUV_DISABLE_ASM)
// row_win.cc has asm version, but GCC uses 2 step wrapper. 5% slower.
// TODO(fbarchard): Handle width > kMaxStride here instead of calling code.
#if defined(__x86_64__) || defined(__i386__)
void I422ToRGB565Row_SSSE3(const uint8* y_buf,
const uint8* u_buf,
......@@ -1309,28 +1312,8 @@ void I422ToARGB4444Row_SSSE3(const uint8* y_buf,
ARGBToARGB4444Row_SSE2(row, rgb_buf, width);
}
#endif // defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)
#if defined(__ARM_NEON__)
void I422ToARGB1555Row_NEON(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
int width) {
SIMD_ALIGNED(uint8 row[kMaxStride]);
I422ToARGBRow_NEON(y_buf, u_buf, v_buf, row, width);
ARGBToARGB1555Row_NEON(row, rgb_buf, width);
}
void I422ToARGB4444Row_NEON(const uint8* y_buf,
const uint8* u_buf,
const uint8* v_buf,
uint8* rgb_buf,
int width) {
SIMD_ALIGNED(uint8 row[kMaxStride]);
I422ToARGBRow_NEON(y_buf, u_buf, v_buf, row, width);
ARGBToARGB4444Row_NEON(row, rgb_buf, width);
}
#endif // defined(__ARM_NEON__)
#endif // !defined(YUV_DISABLE_ASM)
#ifdef __cplusplus
} // extern "C"
} // namespace libyuv
......
This diff is collapsed.
......@@ -32,7 +32,7 @@ TEST_F(libyuvTest, TestVersion) {
}
int svn_revision = atoi(ver); // NOLINT
printf("LIBYUV_SVNREVISION %d\n", svn_revision);
EXPECT_NEAR(LIBYUV_VERSION, svn_revision, 3); // Allow version to be close.
EXPECT_NEAR(LIBYUV_VERSION, svn_revision, 20); // Allow version to be close.
if (LIBYUV_VERSION != svn_revision) {
printf("WARNING - Versions do not match.\n");
}
......
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