diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 9f4d2663a..4e3bd1389 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -603,6 +603,7 @@ extern "C" { #define HAS_RAWTOARGBROW_SVE2 #define HAS_RAWTORGB24ROW_SVE2 #define HAS_RAWTORGBAROW_SVE2 +#define HAS_RGB24TOARGBROW_SVE2 #define HAS_RGBATOUVROW_SVE2 #define HAS_UYVYTOARGBROW_SVE2 #define HAS_YUY2TOARGBROW_SVE2 @@ -3506,6 +3507,9 @@ void ARGB4444ToARGBRow_AVX2(const uint8_t* src_argb4444, void RGB24ToARGBRow_NEON(const uint8_t* src_rgb24, uint8_t* dst_argb, int width); +void RGB24ToARGBRow_SVE2(const uint8_t* src_rgb24, + uint8_t* dst_argb, + int width); void RGB24ToARGBRow_MSA(const uint8_t* src_rgb24, uint8_t* dst_argb, int width); void RGB24ToARGBRow_LSX(const uint8_t* src_rgb24, uint8_t* dst_argb, int width); void RGB24ToARGBRow_LASX(const uint8_t* src_rgb24, diff --git a/source/convert_argb.cc b/source/convert_argb.cc index 73f004b81..4ef0e1439 100644 --- a/source/convert_argb.cc +++ b/source/convert_argb.cc @@ -3475,6 +3475,11 @@ int RGB24ToARGB(const uint8_t* src_rgb24, } } #endif +#if defined(HAS_RGB24TOARGBROW_SVE2) + if (TestCpuFlag(kCpuHasSVE2)) { + RGB24ToARGBRow = RGB24ToARGBRow_SVE2; + } +#endif #if defined(HAS_RGB24TOARGBROW_MSA) if (TestCpuFlag(kCpuHasMSA)) { RGB24ToARGBRow = RGB24ToARGBRow_Any_MSA; diff --git a/source/row_sve.cc b/source/row_sve.cc index 5a243e168..dca5bc653 100644 --- a/source/row_sve.cc +++ b/source/row_sve.cc @@ -1178,6 +1178,13 @@ void RAWToRGBARow_SVE2(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { 0x000000ffU); } +void RGB24ToARGBRow_SVE2(const uint8_t* src_rgb24, + uint8_t* dst_argb, + int width) { + RAWToWXYZRow_SVE2(src_rgb24, dst_argb, width, 0xff020100U, 0x00030303U, + 0xff000000U); +} + static const uint8_t kRAWToRGB24Indices[] = { 2, 1, 0, 5, 4, 3, 8, 7, 6, 11, 10, 9, 14, 13, 12, 17, 16, 15, 20, 19, 18, 23, 22, 21, 26, 25, 24, 29, 28, 27,