mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 08:46:47 +08:00
[AArch64] Add SVE2 implementation of I210ToAR30Row
Observed reduction in runtime compared to the existing Neon code: Cortex-A510: -15.5% Cortex-A520: -3.8% Cortex-A715: -15.8% Cortex-A720: -15.8% Cortex-X2: -7.9% Cortex-X3: -6.5% Cortex-X4: -5.0% Cortex-X925: -5.3% Bug: b/42280942 Change-Id: I5171537fd125b3214d25a0ae503a8f40dbeb6042 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/6023583 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Reviewed-by: Justin Green <greenjustin@google.com>
This commit is contained in:
parent
fc3569ad27
commit
7c9c72ab4b
@ -554,6 +554,7 @@ extern "C" {
|
||||
#define HAS_DIVIDEROW_16_SVE2
|
||||
#define HAS_HALFFLOATROW_SVE2
|
||||
#define HAS_I210ALPHATOARGBROW_SVE2
|
||||
#define HAS_I210TOAR30ROW_SVE2
|
||||
#define HAS_I210TOARGBROW_SVE2
|
||||
#define HAS_I212TOAR30ROW_SVE2
|
||||
#define HAS_I212TOARGBROW_SVE2
|
||||
@ -1129,6 +1130,12 @@ void I210ToAR30Row_NEON(const uint16_t* src_y,
|
||||
uint8_t* rgb_buf,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I210ToAR30Row_SVE2(const uint16_t* src_y,
|
||||
const uint16_t* src_u,
|
||||
const uint16_t* src_v,
|
||||
uint8_t* rgb_buf,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width);
|
||||
void I410ToAR30Row_NEON(const uint16_t* src_y,
|
||||
const uint16_t* src_u,
|
||||
const uint16_t* src_v,
|
||||
|
||||
@ -977,6 +977,11 @@ int I010ToAR30Matrix(const uint16_t* src_y,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I210TOAR30ROW_SVE2)
|
||||
if (TestCpuFlag(kCpuHasSVE2)) {
|
||||
I210ToAR30Row = I210ToAR30Row_SVE2;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I210TOAR30ROW_SSSE3)
|
||||
if (TestCpuFlag(kCpuHasSSSE3)) {
|
||||
I210ToAR30Row = I210ToAR30Row_Any_SSSE3;
|
||||
@ -1216,6 +1221,11 @@ int I210ToAR30Matrix(const uint16_t* src_y,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I210TOAR30ROW_SVE2)
|
||||
if (TestCpuFlag(kCpuHasSVE2)) {
|
||||
I210ToAR30Row = I210ToAR30Row_SVE2;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I210TOAR30ROW_SSSE3)
|
||||
if (TestCpuFlag(kCpuHasSSSE3)) {
|
||||
I210ToAR30Row = I210ToAR30Row_Any_SSSE3;
|
||||
|
||||
@ -1962,6 +1962,53 @@ void I210AlphaToARGBRow_SVE2(const uint16_t* src_y,
|
||||
: "cc", "memory", YUVTORGB_SVE_REGS);
|
||||
}
|
||||
|
||||
void I210ToAR30Row_SVE2(const uint16_t* src_y,
|
||||
const uint16_t* src_u,
|
||||
const uint16_t* src_v,
|
||||
uint8_t* dst_ar30,
|
||||
const struct YuvConstants* yuvconstants,
|
||||
int width) {
|
||||
uint64_t vl;
|
||||
asm("cnth %0" : "=r"(vl));
|
||||
int width_last_y = width & (vl - 1);
|
||||
width_last_y = width_last_y == 0 ? vl : width_last_y;
|
||||
uint16_t limit = 0x3ff0;
|
||||
asm volatile(
|
||||
"ptrue p0.b \n" YUVTORGB_SVE_SETUP
|
||||
"dup z23.h, %w[limit] \n"
|
||||
"subs %w[width], %w[width], %w[vl] \n"
|
||||
"b.lt 2f \n"
|
||||
|
||||
// Run bulk of computation with an all-true predicate to avoid predicate
|
||||
// generation overhead.
|
||||
"ptrue p1.h \n"
|
||||
"1: \n" //
|
||||
READI210_SVE I4XXTORGB_SVE STOREAR30_SVE
|
||||
"subs %w[width], %w[width], %w[vl] \n"
|
||||
"b.ge 1b \n"
|
||||
|
||||
"2: \n"
|
||||
"adds %w[width], %w[width], %w[vl] \n"
|
||||
"b.eq 99f \n"
|
||||
|
||||
// Calculate a predicate for the final iteration to deal with the tail.
|
||||
"whilelt p1.h, wzr, %w[width_last_y] \n" //
|
||||
READI210_SVE I4XXTORGB_SVE STOREAR30_SVE
|
||||
|
||||
"99: \n"
|
||||
: [src_y] "+r"(src_y), // %[src_y]
|
||||
[src_u] "+r"(src_u), // %[src_u]
|
||||
[src_v] "+r"(src_v), // %[src_v]
|
||||
[dst_ar30] "+r"(dst_ar30), // %[dst_ar30]
|
||||
[width] "+r"(width) // %[width]
|
||||
: [vl] "r"(vl), // %[vl]
|
||||
[kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff]
|
||||
[kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias), // %[kRGBCoeffBias]
|
||||
[width_last_y] "r"(width_last_y), // %[width_last_y]
|
||||
[limit] "r"(limit) // %[limit]
|
||||
: "cc", "memory", YUVTORGB_SVE_REGS);
|
||||
}
|
||||
|
||||
// P210 has 10 bits in msb of 16 bit NV12 style layout.
|
||||
void P210ToARGBRow_SVE2(const uint16_t* src_y,
|
||||
const uint16_t* src_uv,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user