diff --git a/README.chromium b/README.chromium index 5d6d1ab99..3462416ed 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1219 +Version: 1220 License: BSD License File: LICENSE diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 42669f09e..a597a53b5 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -302,7 +302,7 @@ extern "C" { #define HAS_RGB565TOYROW_NEON #define HAS_RGBATOUVROW_NEON #define HAS_RGBATOYROW_NEON -#define HAS_SETROW_NEON +// #define HAS_SETROW_NEON #define HAS_SPLITUVROW_NEON #define HAS_UYVYTOARGBROW_NEON #define HAS_UYVYTOUV422ROW_NEON @@ -332,7 +332,7 @@ extern "C" { #define HAS_SOBELXYROW_NEON #define HAS_SOBELYROW_NEON #define HAS_ARGBCOLORMATRIXROW_NEON -#define HAS_ARGBSETROWS_NEON +// #define HAS_ARGBSETROWS_NEON #define HAS_ARGBSHUFFLEROW_NEON #endif diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 0da2a63ba..8b59f5e17 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 1219 +#define LIBYUV_VERSION 1220 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/row_neon.cc b/source/row_neon.cc index 5e5ffac3d..4b1883f8e 100644 --- a/source/row_neon.cc +++ b/source/row_neon.cc @@ -845,12 +845,28 @@ void CopyRow_NEON(const uint8* src, uint8* dst, int count) { ); } -// SetRow8 writes 'count' bytes using a 32 bit value repeated. -void SetRow_NEON(uint8* dst, uint32 v32, int count) { +// SetRow writes 'count' bytes using an 8 bit value repeated. +void SetRow_NEON(uint8* dst, uint32 v8, int count) { + asm volatile ( + "vdup.8 q0, %2 \n" // duplicate 16 bytes + "1: \n" + "subs %1, %1, #16 \n" // 16 bytes per loop + MEMACCESS(0) + "vst1.8 {q0}, [%0]! \n" // store + "bgt 1b \n" + : "+r"(dst), // %0 + "+r"(count) // %1 + : "r"(v8) // %2 + : "cc", "memory", "q0" + ); +} + +// ARGBSetRow writes 'count' pixels using an 32 bit value repeated. +void ARGBSetRow_NEON(uint8* dst, uint32 v8, int count) { asm volatile ( "vdup.u32 q0, %2 \n" // duplicate 4 ints - "1: \n" - "subs %1, %1, #16 \n" // 16 bytes per loop + "1: \n" + "subs %1, %1, #4 \n" // 4 pixels per loop MEMACCESS(0) "vst1.8 {q0}, [%0]! \n" // store "bgt 1b \n" @@ -861,16 +877,6 @@ void SetRow_NEON(uint8* dst, uint32 v32, int count) { ); } -// TODO(fbarchard): Make fully assembler -// SetRow32 writes 'count' words using a 32 bit value repeated. -void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width, - int dst_stride, int height) { - for (int y = 0; y < height; ++y) { - SetRow_NEON(dst, v32, width << 2); - dst += dst_stride; - } -} - void MirrorRow_NEON(const uint8* src, uint8* dst, int width) { asm volatile ( // Start at end of source row. diff --git a/source/row_neon64.cc b/source/row_neon64.cc index fc2deaac5..7914aadee 100644 --- a/source/row_neon64.cc +++ b/source/row_neon64.cc @@ -735,13 +735,27 @@ void CopyRow_NEON(const uint8* src, uint8* dst, int count) { } #endif // HAS_COPYROW_NEON -// SetRow8 writes 'count' bytes using a 32 bit value repeated. -#ifdef HAS_SETROW_NEON -void SetRow_NEON(uint8* dst, uint32 v32, int count) { +// SetRow writes 'count' bytes using an 8 bit value repeated. +void SetRow_NEON(uint8* dst, uint32 v8, int count) { + asm volatile ( + "dup v0.16b, %w2 \n" // duplicate 16 bytes + "1: \n" + "subs %1, %1, #16 \n" // 16 bytes per loop + MEMACCESS(0) + "st1 {v0.16b}, [%0], #16 \n" // store + "b.gt 1b \n" + : "+r"(dst), // %0 + "+r"(count) // %1 + : "r"(v8) // %2 + : "cc", "memory", "v0" + ); +} + +void ARGBSetRow_NEON(uint8* dst, uint32 v32, int count) { asm volatile ( "dup v0.4s, %w2 \n" // duplicate 4 ints - "1: \n" - "subs %1, %1, #16 \n" // 16 bytes per loop + "1: \n" + "subs %1, %1, #4 \n" // 4 ints per loop MEMACCESS(0) "st1 {v0.16b}, [%0], #16 \n" // store "b.gt 1b \n" @@ -751,19 +765,6 @@ void SetRow_NEON(uint8* dst, uint32 v32, int count) { : "cc", "memory", "v0" ); } -#endif // HAS_SETROW_NEON - -// TODO(fbarchard): Make fully assembler -// SetRow32 writes 'count' words using a 32 bit value repeated. -#ifdef HAS_ARGBSETROWS_NEON -void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width, - int dst_stride, int height) { - for (int y = 0; y < height; ++y) { - SetRow_NEON(dst, v32, width << 2); - dst += dst_stride; - } -} -#endif // HAS_ARGBSETROWS_NEON #ifdef HAS_MIRRORROW_NEON void MirrorRow_NEON(const uint8* src, uint8* dst, int width) {