diff --git a/README.chromium b/README.chromium index 9852a988f..66e61c053 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1157 +Version: 1158 License: BSD License File: LICENSE diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 818d32c5b..5f8b558de 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -185,7 +185,6 @@ extern "C" { // The code supports NaCL but requires a new compiler and validator. #if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) -// Effects: #define HAS_COPYROW_AVX #define HAS_ARGBPOLYNOMIALROW_AVX2 #define HAS_ARGBSHUFFLEROW_AVX2 @@ -200,6 +199,9 @@ extern "C" { #define HAS_UYVYTOUVROW_AVX2 #define HAS_SPLITUVROW_AVX2 #define HAS_MERGEUVROW_AVX2 + +// Effects: +#define HAS_ARGBADDROW_AVX2 #endif // The following are require VS2012. @@ -215,7 +217,6 @@ extern "C" { #define HAS_MIRRORROW_AVX2 // Effects: -#define HAS_ARGBADDROW_AVX2 #define HAS_ARGBATTENUATEROW_AVX2 #define HAS_ARGBMIRRORROW_AVX2 #define HAS_ARGBMULTIPLYROW_AVX2 diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 36a2f8e56..e4406a4ca 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 1157 +#define LIBYUV_VERSION 1158 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/row_posix.cc b/source/row_posix.cc index b53c93abf..57139c040 100644 --- a/source/row_posix.cc +++ b/source/row_posix.cc @@ -3955,6 +3955,36 @@ void ARGBAddRow_SSE2(const uint8* src_argb0, const uint8* src_argb1, } #endif // HAS_ARGBADDROW_SSE2 +#ifdef HAS_ARGBADDROW_AVX2 +// Add 2 rows of ARGB pixels together, 4 pixels at a time. +void ARGBAddRow_AVX2(const uint8* src_argb0, const uint8* src_argb1, + uint8* dst_argb, int width) { + asm volatile ( + // 4 pixel loop. + LABELALIGN + "1: \n" + "vmovdqu " MEMACCESS(0) ",%%ymm0 \n" + "lea " MEMLEA(0x20,0) ",%0 \n" + "vpaddusb " MEMACCESS(1) ",%%ymm0,%%ymm0 \n" + "lea " MEMLEA(0x20,1) ",%1 \n" + "vmovdqu %%ymm0," MEMACCESS(2) " \n" + "lea " MEMLEA(0x20,2) ",%2 \n" + "sub $0x8,%3 \n" + "jg 1b \n" + "vzeroupper \n" + : "+r"(src_argb0), // %0 + "+r"(src_argb1), // %1 + "+r"(dst_argb), // %2 + "+r"(width) // %3 + : + : "memory", "cc" +#if defined(__SSE2__) + , "xmm0" +#endif + ); +} +#endif // HAS_ARGBADDROW_AVX2 + #ifdef HAS_ARGBSUBTRACTROW_SSE2 // Subtract 2 rows of ARGB pixels, 4 pixels at a time. void ARGBSubtractRow_SSE2(const uint8* src_argb0, const uint8* src_argb1,