diff --git a/README.chromium b/README.chromium index 7e25f590c..646ee5fa5 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 144 +Version: 145 License: BSD License File: LICENSE diff --git a/source/planar_functions.cc b/source/planar_functions.cc index 5b3b17c10..1c760d7cb 100644 --- a/source/planar_functions.cc +++ b/source/planar_functions.cc @@ -1512,12 +1512,16 @@ int I420ToARGB(const uint8* src_y, int src_stride_y, #if defined(HAS_FASTCONVERTYUVTOARGBROW_NEON) if (TestCpuFlag(kCpuHasNEON) && IS_ALIGNED(width, 16)) { FastConvertYUVToARGBRow = FastConvertYUVToARGBRow_NEON; + } else if (TestCpuFlag(kCpuHasNEON)) { + FastConvertYUVToARGBRow = FastConvertYUVToARGBAnyRow_NEON; } else #elif defined(HAS_FASTCONVERTYUVTOARGBROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3) && IS_ALIGNED(width, 8) && IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) { FastConvertYUVToARGBRow = FastConvertYUVToARGBRow_SSSE3; + } else if (TestCpuFlag(kCpuHasSSSE3)) { + FastConvertYUVToARGBRow = FastConvertYUVToARGBAnyRow_SSSE3; } else #endif { diff --git a/source/row.h b/source/row.h index 62a86f59e..ae3043dbd 100644 --- a/source/row.h +++ b/source/row.h @@ -38,11 +38,6 @@ #define HAS_FASTCONVERTYUVTOARGBROW_SSSE3 #define HAS_FASTCONVERTYUVTOBGRAROW_SSSE3 #define HAS_FASTCONVERTYUVTOABGRROW_SSSE3 -#define HAS_FASTCONVERTYUVTORGB565ROW_SSSE3 -#define HAS_FASTCONVERTYUVTOARGB1555ROW_SSSE3 -#define HAS_FASTCONVERTYUVTOARGB4444ROW_SSSE3 -#define HAS_FASTCONVERTYUVTORGB24ROW_SSSE3 -#define HAS_FASTCONVERTYUVTORAWROW_SSSE3 #define HAS_FASTCONVERTYUV444TOARGBROW_SSSE3 #define HAS_REVERSE_ROW_SSSE3 #define HAS_REVERSE_ROW_SSE2 @@ -67,11 +62,6 @@ #define HAS_FASTCONVERTYUVTOARGBROW_NEON #define HAS_FASTCONVERTYUVTOBGRAROW_NEON #define HAS_FASTCONVERTYUVTOABGRROW_NEON -#define HAS_FASTCONVERTYUVTORGB565ROW_NEON -#define HAS_FASTCONVERTYUVTOARGB1555ROW_NEON -#define HAS_FASTCONVERTYUVTOARGB4444ROW_NEON -#define HAS_FASTCONVERTYUVTORGB24ROW_NEON -#define HAS_FASTCONVERTYUVTORAWROW_NEON #endif #ifdef __cplusplus @@ -91,7 +81,6 @@ typedef unsigned char __attribute__((vector_size(16))) uvec8; typedef signed short __attribute__((vector_size(16))) vec16; #endif - void FastConvertYUVToARGBRow_NEON(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, @@ -107,31 +96,6 @@ void FastConvertYUVToABGRRow_NEON(const uint8* y_buf, const uint8* v_buf, uint8* rgb_buf, int width); -void FastConvertYUVToRGB565Row_NEON(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); -void FastConvertYUVToARGB1555Row_NEON(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); -void FastConvertYUVToARGB4444Row_NEON(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); -void FastConvertYUVToRGB24Row_NEON(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); -void FastConvertYUVToRAWRow_NEON(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); void BGRAToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); @@ -181,8 +145,6 @@ void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -// ARGBToABGRRow_C is same as ABGRToARGB -// ARGBToBGRARow_C is same as BGRAToARGB void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix); void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); @@ -220,34 +182,6 @@ void FastConvertYToARGBRow_C(const uint8* y_buf, uint8* rgb_buf, int width); -void FastConvertYUVToARGBRow_SSE2(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); - -void FastConvertYUVToBGRARow_SSE2(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); - -void FastConvertYUVToABGRRow_SSE2(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); - -void FastConvertYUV444ToARGBRow_SSE2(const uint8* y_buf, - const uint8* u_buf, - const uint8* v_buf, - uint8* rgb_buf, - int width); - -void FastConvertYToARGBRow_SSE2(const uint8* y_buf, - uint8* rgb_buf, - int width); - void FastConvertYUVToARGBRow_SSSE3(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, @@ -276,6 +210,19 @@ void FastConvertYToARGBRow_SSE2(const uint8* y_buf, uint8* rgb_buf, int width); +// 'Any' wrappers use memcpy() +void FastConvertYUVToARGBAnyRow_SSSE3(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width); + +void FastConvertYUVToARGBAnyRow_NEON(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width); + #ifdef __cplusplus } // extern "C" } // namespace libyuv diff --git a/source/row_common.cc b/source/row_common.cc index eb5d0b414..3d3ab956a 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -11,6 +11,7 @@ #include "row.h" #include "libyuv/basic_types.h" +#include // For memcpy #ifdef __cplusplus namespace libyuv { @@ -367,6 +368,39 @@ void ReverseRow_C(const uint8* src, uint8* dst, int width) { } } +// Wrappers to handle odd sizes/alignments +#if defined(HAS_FASTCONVERTYUVTOARGBROW_SSSE3) +void FastConvertYUVToARGBAnyRow_SSSE3(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width) { + SIMD_ALIGNED(uint8 row[kMaxStride]); + FastConvertYUVToARGBRow_SSSE3(y_buf, + u_buf, + v_buf, + row, + width); + memcpy(rgb_buf, row, width << 2); +} +#endif + +#if defined(HAS_FASTCONVERTYUVTOARGBROW_NEON) +void FastConvertYUVToARGBAnyRow_NEON(const uint8* y_buf, + const uint8* u_buf, + const uint8* v_buf, + uint8* rgb_buf, + int width) { + SIMD_ALIGNED(uint8 row[kMaxStride]); + FastConvertYUVToARGBRow_NEON(y_buf, + u_buf, + v_buf, + row, + width); + memcpy(rgb_buf, row, width << 2); +} +#endif + #ifdef __cplusplus } // extern "C" } // namespace libyuv