diff --git a/README.chromium b/README.chromium index 5b01f155a..305a56b57 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 426 +Version: 427 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index ae0d40f53..e912cedbd 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 426 +#define LIBYUV_VERSION 427 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/convert_from_argb.cc b/source/convert_from_argb.cc index 22c72c9d6..cd7186592 100644 --- a/source/convert_from_argb.cc +++ b/source/convert_from_argb.cc @@ -37,11 +37,26 @@ int ARGBToI400(const uint8* src_argb, int src_stride_argb, void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = ARGBToYRow_C; #if defined(HAS_ARGBTOYROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && - IS_ALIGNED(width, 4) && - IS_ALIGNED(src_argb, 16) && IS_ALIGNED(src_stride_argb, 16) && - IS_ALIGNED(dst_y, 16) && IS_ALIGNED(dst_stride_y, 16)) { - ARGBToYRow = ARGBToYRow_SSSE3; + if (TestCpuFlag(kCpuHasSSSE3)) { + if (width > 16) { + ARGBToYRow = ARGBToYRow_Any_SSSE3; + } + if (IS_ALIGNED(width, 16)) { + ARGBToYRow = ARGBToYRow_Unaligned_SSSE3; + if (IS_ALIGNED(src_argb, 16) && IS_ALIGNED(src_stride_argb, 16) && + IS_ALIGNED(dst_y, 16) && IS_ALIGNED(dst_stride_y, 16)) { + ARGBToYRow = ARGBToYRow_SSSE3; + } + } + } +#elif defined(HAS_ARGBTOYROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + if (width > 8) { + ARGBToYRow = ARGBToYRow_Any_NEON; + } + if (IS_ALIGNED(width, 8)) { + ARGBToYRow = ARGBToYRow_NEON; + } } #endif @@ -69,10 +84,10 @@ int ARGBToI422(const uint8* src_argb, int src_stride_argb, src_argb = src_argb + (height - 1) * src_stride_argb; src_stride_argb = -src_stride_argb; } - void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = - ARGBToYRow_C; void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; + void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = + ARGBToYRow_C; #if defined(HAS_ARGBTOYROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3)) { if (width > 16) { @@ -90,6 +105,15 @@ int ARGBToI422(const uint8* src_argb, int src_stride_argb, } } } +#elif defined(HAS_ARGBTOYROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + if (width > 8) { + ARGBToYRow = ARGBToYRow_Any_NEON; + } + if (IS_ALIGNED(width, 8)) { + ARGBToYRow = ARGBToYRow_NEON; + } + } #endif for (int y = 0; y < height; ++y) { diff --git a/source/format_conversion.cc b/source/format_conversion.cc index 41c7de4ab..95ce4713e 100644 --- a/source/format_conversion.cc +++ b/source/format_conversion.cc @@ -299,22 +299,33 @@ int BayerToI420(const uint8* src_bayer, int src_stride_bayer, uint8* dst_argb, int pix); void (*BayerRow1)(const uint8* src_bayer, int src_stride_bayer, uint8* dst_argb, int pix); - void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = - ARGBToYRow_C; + void (*ARGBToUVRow)(const uint8* src_argb0, int src_stride_argb, uint8* dst_u, uint8* dst_v, int width) = ARGBToUVRow_C; - SIMD_ALIGNED(uint8 row[kMaxStride * 2]); - + void (*ARGBToYRow)(const uint8* src_argb, uint8* dst_y, int pix) = + ARGBToYRow_C; #if defined(HAS_ARGBTOYROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && - IS_ALIGNED(width, 16) && - IS_ALIGNED(dst_y, 16) && IS_ALIGNED(dst_stride_y, 16)) { - ARGBToYRow = ARGBToYRow_SSSE3; + if (TestCpuFlag(kCpuHasSSSE3)) { + if (width > 16) { + ARGBToUVRow = ARGBToUVRow_Any_SSSE3; + ARGBToYRow = ARGBToYRow_Any_SSSE3; + } + if (IS_ALIGNED(width, 16)) { + ARGBToUVRow = ARGBToUVRow_SSSE3; + ARGBToYRow = ARGBToYRow_Unaligned_SSSE3; + if (IS_ALIGNED(dst_y, 16) && IS_ALIGNED(dst_stride_y, 16)) { + ARGBToYRow = ARGBToYRow_SSSE3; + } + } } -#endif -#if defined(HAS_ARGBTOUVROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && IS_ALIGNED(width, 16)) { - ARGBToUVRow = ARGBToUVRow_SSSE3; +#elif defined(HAS_ARGBTOYROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + if (width > 8) { + ARGBToYRow = ARGBToYRow_Any_NEON; + } + if (IS_ALIGNED(width, 8)) { + ARGBToYRow = ARGBToYRow_NEON; + } } #endif @@ -339,6 +350,7 @@ int BayerToI420(const uint8* src_bayer, int src_stride_bayer, return -1; // Bad FourCC } + SIMD_ALIGNED(uint8 row[kMaxStride * 2]); for (int y = 0; y < height - 1; y += 2) { BayerRow0(src_bayer, src_stride_bayer, row, width); BayerRow1(src_bayer + src_stride_bayer, -src_stride_bayer,