aboutsummaryrefslogtreecommitdiff
path: root/source/convert_argb.cc
diff options
context:
space:
mode:
authorDarren Hsieh <darren.hsieh@sifive.com>2023-06-09 05:51:48 -0700
committerlibyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-07-26 18:05:50 +0000
commit10de943a12737be193e4f51df9e37b555ea09710 (patch)
treef31b2b0c07e99a30356fc8b10102123ef45f279e /source/convert_argb.cc
parenta04fbafc5d50d585ee9526a2bed633a38ae69328 (diff)
downloadlibyuv-10de943a12737be193e4f51df9e37b555ea09710.tar.gz
[RVV] Enable ScaleRowUp2_(Bi)linear_RVV/ScaleUVRowUp2_(Bi)linear_RVV
ScaleUVRowUp2_(Bi)linear_RVV function is equal to other platforms' ScaleRowUp2_(Bi)linear_Any_XXX. We process entire row in this function. Other platforms only implement non-edge part of image and process edge with scalar. ScaleRowUp2_(Bi)linear_Any_XXX: Combine ScaleRowUp2_(Bi)linear_XXX(non-edge) + ScaleRowUp2_(Bi)linear_C(edge) by SBUH2LANY/SU2BLANY. * Run on SiFive internal FPGA: Test case RVV function Speedup I444ScaleFrom640x360_Bilinear ScaleRowUp2_Bilinear_RVV 8.21 I444ScaleFrom640x360_Linear ScaleRowUp2_Linear_RVV 8.08 UVScaleFrom640x360_Bilinear ScaleUVRowUp2_Bilinear_RVV 7.80 UVScaleFrom640x360_Linear ScaleUVRowUp2_Linear_RVV 7.03 Change-Id: I539245ce51858f077506a78f0e7e82377ac6a95d Signed-off-by: Darren Hsieh <darren.hsieh@sifive.com> Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4666062 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/convert_argb.cc')
-rw-r--r--source/convert_argb.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/source/convert_argb.cc b/source/convert_argb.cc
index f3a1f913..f6ab0784 100644
--- a/source/convert_argb.cc
+++ b/source/convert_argb.cc
@@ -6040,6 +6040,12 @@ static int I420ToARGBMatrixBilinear(const uint8_t* src_y,
ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON;
}
#endif
+#if defined(HAS_SCALEROWUP2_BILINEAR_RVV)
+ if (TestCpuFlag(kCpuHasRVV)) {
+ Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV;
+ ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV;
+ }
+#endif
// alloc 4 lines temp
const int row_size = (width + 31) & ~31;
@@ -6171,6 +6177,11 @@ static int I422ToARGBMatrixLinear(const uint8_t* src_y,
ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON;
}
#endif
+#if defined(HAS_SCALEROWUP2_LINEAR_RVV)
+ if (TestCpuFlag(kCpuHasRVV)) {
+ ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV;
+ }
+#endif
// alloc 2 lines temp
const int row_size = (width + 31) & ~31;
@@ -6296,6 +6307,12 @@ static int I420ToRGB24MatrixBilinear(const uint8_t* src_y,
ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON;
}
#endif
+#if defined(HAS_SCALEROWUP2_BILINEAR_RVV)
+ if (TestCpuFlag(kCpuHasRVV)) {
+ Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV;
+ ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV;
+ }
+#endif
// alloc 4 lines temp
const int row_size = (width + 31) & ~31;
@@ -6857,6 +6874,12 @@ static int I420AlphaToARGBMatrixBilinear(
ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON;
}
#endif
+#if defined(HAS_SCALEROWUP2_BILINEAR_RVV)
+ if (TestCpuFlag(kCpuHasRVV)) {
+ Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV;
+ ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV;
+ }
+#endif
// alloc 4 lines temp
const int row_size = (width + 31) & ~31;
@@ -7052,6 +7075,11 @@ static int I422AlphaToARGBMatrixLinear(const uint8_t* src_y,
ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON;
}
#endif
+#if defined(HAS_SCALEROWUP2_LINEAR_RVV)
+ if (TestCpuFlag(kCpuHasRVV)) {
+ ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV;
+ }
+#endif
// alloc 2 lines temp
const int row_size = (width + 31) & ~31;
@@ -7790,6 +7818,11 @@ static int I422ToRGB24MatrixLinear(const uint8_t* src_y,
ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON;
}
#endif
+#if defined(HAS_SCALEROWUP2_LINEAR_RVV)
+ if (TestCpuFlag(kCpuHasRVV)) {
+ ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV;
+ }
+#endif
// alloc 2 lines temp
const int row_size = (width + 31) & ~31;