diff --git a/README.chromium b/README.chromium index 0d697ce45..6c76507cb 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 159 +Version: 160 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index e823bbcfc..4e6385d7b 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -16,7 +16,7 @@ namespace libyuv { extern "C" { #endif -#define LIBYUV_VERSION 159 +#define LIBYUV_VERSION 160 #ifdef __cplusplus } // extern "C" diff --git a/source/planar_functions.cc b/source/planar_functions.cc index a98cd348e..a0e83ecd1 100644 --- a/source/planar_functions.cc +++ b/source/planar_functions.cc @@ -1646,10 +1646,12 @@ int I420ToRGB24(const uint8* src_y, int src_stride_y, SIMD_ALIGNED(uint8 row[kMaxStride]); void (*ARGBToRGB24Row)(const uint8* src_argb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTORGB24ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && - IS_ALIGNED(width, 16) && - IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) { - ARGBToRGB24Row = ARGBToRGB24Row_SSSE3; + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBToRGB24Row = ARGBToRGB24AnyRow_SSSE3; + if (IS_ALIGNED(width, 16) && + IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) { + ARGBToRGB24Row = ARGBToRGB24Row_SSSE3; + } } else #endif { @@ -1702,10 +1704,12 @@ int I420ToRAW(const uint8* src_y, int src_stride_y, SIMD_ALIGNED(uint8 row[kMaxStride]); void (*ARGBToRAWRow)(const uint8* src_argb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTORAWROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && - IS_ALIGNED(width, 16) && - IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) { - ARGBToRAWRow = ARGBToRAWRow_SSSE3; + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBToRAWRow = ARGBToRAWAnyRow_SSSE3; + if (IS_ALIGNED(width, 16) && + IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) { + ARGBToRAWRow = ARGBToRAWRow_SSSE3; + } } else #endif { @@ -1758,8 +1762,11 @@ int I420ToRGB565(const uint8* src_y, int src_stride_y, SIMD_ALIGNED(uint8 row[kMaxStride]); void (*ARGBToRGB565Row)(const uint8* src_rgb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTORGB565ROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(width, 4)) { - ARGBToRGB565Row = ARGBToRGB565Row_SSE2; + if (TestCpuFlag(kCpuHasSSE2)) { + ARGBToRGB565Row = ARGBToRGB565AnyRow_SSE2; + if (IS_ALIGNED(width, 4)) { + ARGBToRGB565Row = ARGBToRGB565Row_SSE2; + } } else #endif { @@ -1812,8 +1819,11 @@ int I420ToARGB1555(const uint8* src_y, int src_stride_y, SIMD_ALIGNED(uint8 row[kMaxStride]); void (*ARGBToARGB1555Row)(const uint8* src_argb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTOARGB1555ROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(width, 4)) { - ARGBToARGB1555Row = ARGBToARGB1555Row_SSE2; + if (TestCpuFlag(kCpuHasSSE2)) { + ARGBToARGB1555Row = ARGBToARGB1555AnyRow_SSE2; + if (IS_ALIGNED(width, 4)) { + ARGBToARGB1555Row = ARGBToARGB1555Row_SSE2; + } } else #endif { @@ -1866,8 +1876,11 @@ int I420ToARGB4444(const uint8* src_y, int src_stride_y, SIMD_ALIGNED(uint8 row[kMaxStride]); void (*ARGBToARGB4444Row)(const uint8* src_argb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTOARGB4444ROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2) && IS_ALIGNED(width, 4)) { - ARGBToARGB4444Row = ARGBToARGB4444Row_SSE2; + if (TestCpuFlag(kCpuHasSSE2)) { + ARGBToARGB4444Row = ARGBToARGB4444AnyRow_SSE2; + if (IS_ALIGNED(width, 4)) { + ARGBToARGB4444Row = ARGBToARGB4444Row_SSE2; + } } else #endif { @@ -2193,10 +2206,12 @@ int ARGBToRGB24(const uint8* src_argb, int src_stride_argb, void (*ARGBToRGB24Row)(const uint8* src_argb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTORGB24ROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3) && - IS_ALIGNED(width, 16) && - IS_ALIGNED(src_argb, 16) && IS_ALIGNED(src_stride_argb, 16) && - IS_ALIGNED(dst_rgb24, 16) && IS_ALIGNED(dst_stride_rgb24, 16)) { - ARGBToRGB24Row = ARGBToRGB24Row_SSSE3; + IS_ALIGNED(src_argb, 16) && IS_ALIGNED(src_stride_argb, 16)) { + ARGBToRGB24Row = ARGBToRGB24AnyRow_SSSE3; + if (IS_ALIGNED(width, 16) && + IS_ALIGNED(dst_rgb24, 16) && IS_ALIGNED(dst_stride_rgb24, 16)) { + ARGBToRGB24Row = ARGBToRGB24Row_SSSE3; + } } else #endif { @@ -2223,10 +2238,12 @@ int ARGBToRAW(const uint8* src_argb, int src_stride_argb, void (*ARGBToRAWRow)(const uint8* src_argb, uint8* dst_rgb, int pix); #if defined(HAS_ARGBTORAWROW_SSSE3) if (TestCpuFlag(kCpuHasSSSE3) && - IS_ALIGNED(width, 16) && - IS_ALIGNED(src_argb, 16) && IS_ALIGNED(src_stride_argb, 16) && - IS_ALIGNED(dst_raw, 16) && IS_ALIGNED(dst_stride_raw, 16)) { - ARGBToRAWRow = ARGBToRAWRow_SSSE3; + IS_ALIGNED(src_argb, 16) && IS_ALIGNED(src_stride_argb, 16)) { + ARGBToRAWRow = ARGBToRAWAnyRow_SSSE3; + if (IS_ALIGNED(width, 16) && + IS_ALIGNED(dst_raw, 16) && IS_ALIGNED(dst_stride_raw, 16)) { + ARGBToRAWRow = ARGBToRAWRow_SSSE3; + } } else #endif { diff --git a/source/row.h b/source/row.h index 723c59388..74984ad09 100644 --- a/source/row.h +++ b/source/row.h @@ -229,6 +229,12 @@ void FastConvertYUVToABGRAnyRow_SSSE3(const uint8* y_buf, uint8* rgb_buf, int width); +void ARGBToRGB24AnyRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); +void ARGBToRAWAnyRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); +void ARGBToRGB565AnyRow_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); +void ARGBToARGB1555AnyRow_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); +void ARGBToARGB4444AnyRow_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); + void FastConvertYUVToARGBAnyRow_NEON(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, diff --git a/source/row_common.cc b/source/row_common.cc index e35213732..d247c2b73 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -380,10 +380,26 @@ void NAMEANY(const uint8* y_buf, \ memcpy(rgb_buf, row, width << 2); \ } + +// Wrappers to handle odd sizes/alignments +#define MAKEYUVANYRGB(NAMEANY, ARGBTORGB, BPP) \ +void NAMEANY(const uint8* argb_buf, \ + uint8* rgb_buf, \ + int width) { \ + SIMD_ALIGNED(uint8 row[kMaxStride]); \ + ARGBTORGB(argb_buf, row, width); \ + memcpy(rgb_buf, row, width * BPP); \ +} + #if defined(HAS_FASTCONVERTYUVTOARGBROW_SSSE3) MAKEYUVANY(FastConvertYUVToARGBAnyRow_SSSE3, FastConvertYUVToARGBRow_SSSE3) MAKEYUVANY(FastConvertYUVToBGRAAnyRow_SSSE3, FastConvertYUVToBGRARow_SSSE3) MAKEYUVANY(FastConvertYUVToABGRAnyRow_SSSE3, FastConvertYUVToABGRRow_SSSE3) +MAKEYUVANYRGB(ARGBToRGB24AnyRow_SSSE3, ARGBToRGB24Row_SSSE3, 3) +MAKEYUVANYRGB(ARGBToRAWAnyRow_SSSE3, ARGBToRAWRow_SSSE3, 3) +MAKEYUVANYRGB(ARGBToRGB565AnyRow_SSE2, ARGBToRGB565Row_SSE2, 2) +MAKEYUVANYRGB(ARGBToARGB1555AnyRow_SSE2, ARGBToARGB1555Row_SSE2, 2) +MAKEYUVANYRGB(ARGBToARGB4444AnyRow_SSE2, ARGBToARGB4444Row_SSE2, 2) #endif #if defined(HAS_FASTCONVERTYUVTOARGBROW_NEON) MAKEYUVANY(FastConvertYUVToARGBAnyRow_NEON, FastConvertYUVToARGBRow_NEON)