summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/make/Makefile4
-rw-r--r--test/predict_test.cc9
-rw-r--r--vp8/common/riscv/sixtap_predict_rvv.c63
-rw-r--r--vp8/common/rtcd_defs.pl8
-rw-r--r--vp8/vp8_common.mk3
5 files changed, 83 insertions, 4 deletions
diff --git a/build/make/Makefile b/build/make/Makefile
index 65ac2290c..427330fd8 100644
--- a/build/make/Makefile
+++ b/build/make/Makefile
@@ -157,6 +157,10 @@ $(BUILD_PFX)%_lsx.c.o: CFLAGS += -mlsx
$(BUILD_PFX)%_lasx.c.d: CFLAGS += -mlasx
$(BUILD_PFX)%_lasx.c.o: CFLAGS += -mlasx
+# RISCV
+$(BUILD_PFX)%_rvv.c.d: CFLAGS += -march=rv64gcv
+$(BUILD_PFX)%_rvv.c.o: CFLAGS += -march=rv64gcv
+
$(BUILD_PFX)%.c.d: %.c
$(if $(quiet),@echo " [DEP] $@")
$(qexec)mkdir -p $(dir $@)
diff --git a/test/predict_test.cc b/test/predict_test.cc
index 747297057..d686a9161 100644
--- a/test/predict_test.cc
+++ b/test/predict_test.cc
@@ -350,6 +350,15 @@ INSTANTIATE_TEST_SUITE_P(
make_tuple(4, 4, &vp8_sixtap_predict4x4_mmi)));
#endif
+#if HAVE_RVV
+INSTANTIATE_TEST_SUITE_P(
+ RVV, SixtapPredictTest,
+ ::testing::Values(make_tuple(16, 16, &vp8_sixtap_predict16x16_rvv),
+ make_tuple(8, 8, &vp8_sixtap_predict8x8_rvv),
+ make_tuple(8, 4, &vp8_sixtap_predict8x4_rvv),
+ make_tuple(4, 4, &vp8_sixtap_predict4x4_rvv)));
+#endif
+
class BilinearPredictTest : public PredictTestBase {};
TEST_P(BilinearPredictTest, TestWithRandomData) {
diff --git a/vp8/common/riscv/sixtap_predict_rvv.c b/vp8/common/riscv/sixtap_predict_rvv.c
new file mode 100644
index 000000000..0345d026e
--- /dev/null
+++ b/vp8/common/riscv/sixtap_predict_rvv.c
@@ -0,0 +1,63 @@
+#include <riscv_vector.h>
+#include <stdio.h>
+#include "./vpx_config.h"
+#include "./vp8_rtcd.h"
+
+#define UNUSED(x) (void)(x)
+
+void vp8_sixtap_predict4x4_rvv(unsigned char *src_ptr, int src_pixels_per_line,
+ int xoffset, int yoffset,
+ unsigned char *dst_ptr, int dst_pitch)
+{
+ UNUSED(src_ptr);
+ UNUSED(src_pixels_per_line);
+ UNUSED(xoffset);
+ UNUSED(yoffset);
+ UNUSED(dst_ptr);
+ UNUSED(dst_pitch);
+
+ printf("--> vp8_sixtap_predict4x4_rvv\n");
+}
+
+void vp8_sixtap_predict8x4_rvv(unsigned char *src_ptr, int src_pixels_per_line,
+ int xoffset, int yoffset,
+ unsigned char *dst_ptr, int dst_pitch)
+{
+ UNUSED(src_ptr);
+ UNUSED(src_pixels_per_line);
+ UNUSED(xoffset);
+ UNUSED(yoffset);
+ UNUSED(dst_ptr);
+ UNUSED(dst_pitch);
+
+ printf("--> vp8_sixtap_predict8x4_rvv\n");
+}
+
+void vp8_sixtap_predict8x8_rvv(unsigned char *src_ptr, int src_pixels_per_line,
+ int xoffset, int yoffset,
+ unsigned char *dst_ptr, int dst_pitch)
+{
+ UNUSED(src_ptr);
+ UNUSED(src_pixels_per_line);
+ UNUSED(xoffset);
+ UNUSED(yoffset);
+ UNUSED(dst_ptr);
+ UNUSED(dst_pitch);
+
+ printf("--> vp8_sixtap_predict8x8_rvv\n");
+}
+
+void vp8_sixtap_predict16x16_rvv(unsigned char *src_ptr,
+ int src_pixels_per_line, int xoffset,
+ int yoffset, unsigned char *dst_ptr,
+ int dst_pitch)
+{
+ UNUSED(src_ptr);
+ UNUSED(src_pixels_per_line);
+ UNUSED(xoffset);
+ UNUSED(yoffset);
+ UNUSED(dst_ptr);
+ UNUSED(dst_pitch);
+
+ printf("--> vp8_sixtap_predict16x16_rvv\n");
+}
diff --git a/vp8/common/rtcd_defs.pl b/vp8/common/rtcd_defs.pl
index 739a61284..3831a3c35 100644
--- a/vp8/common/rtcd_defs.pl
+++ b/vp8/common/rtcd_defs.pl
@@ -146,16 +146,16 @@ if (vpx_config("CONFIG_POSTPROC") eq "yes") {
# Subpixel
#
add_proto qw/void vp8_sixtap_predict16x16/, "unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch";
-specialize qw/vp8_sixtap_predict16x16 sse2 ssse3 neon dspr2 msa mmi lsx/;
+specialize qw/vp8_sixtap_predict16x16 sse2 ssse3 neon dspr2 msa mmi lsx rvv/;
add_proto qw/void vp8_sixtap_predict8x8/, "unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch";
-specialize qw/vp8_sixtap_predict8x8 sse2 ssse3 neon dspr2 msa mmi lsx/;
+specialize qw/vp8_sixtap_predict8x8 sse2 ssse3 neon dspr2 msa mmi lsx rvv/;
add_proto qw/void vp8_sixtap_predict8x4/, "unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch";
-specialize qw/vp8_sixtap_predict8x4 sse2 ssse3 neon dspr2 msa mmi/;
+specialize qw/vp8_sixtap_predict8x4 sse2 ssse3 neon dspr2 msa mmi rvv/;
add_proto qw/void vp8_sixtap_predict4x4/, "unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch";
-specialize qw/vp8_sixtap_predict4x4 mmx ssse3 neon dspr2 msa mmi lsx/;
+specialize qw/vp8_sixtap_predict4x4 mmx ssse3 neon dspr2 msa mmi lsx rvv/;
add_proto qw/void vp8_bilinear_predict16x16/, "unsigned char *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, unsigned char *dst_ptr, int dst_pitch";
specialize qw/vp8_bilinear_predict16x16 sse2 ssse3 neon msa/;
diff --git a/vp8/vp8_common.mk b/vp8/vp8_common.mk
index d485965d3..54bb5eadb 100644
--- a/vp8/vp8_common.mk
+++ b/vp8/vp8_common.mk
@@ -146,4 +146,7 @@ VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/mbloopfilter_neon.c
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/shortidct4x4llm_neon.c
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/sixtappredict_neon.c
+# common (rvv intrinsics)
+VP8_COMMON_SRCS-$(HAVE_RVV) += common/riscv/sixtap_predict_rvv.c
+
$(eval $(call rtcd_h_template,vp8_rtcd,vp8/common/rtcd_defs.pl))