diff options
author | Wang Chen <wangchen20@iscas.ac.cn> | 2023-07-10 09:19:39 +0800 |
---|---|---|
committer | Chen Wang <unicorn_wang@outlook.com> | 2023-07-10 11:15:18 +0800 |
commit | c2814bb8cc32362822b5a546c8de21b3a0e89032 (patch) | |
tree | 8484f4144f8797682fc98e1e020627606a11ca61 /vp8/common | |
parent | b8fdf4909a12c40fd373cfba0e212d45b021549f (diff) | |
download | libvpx-c2814bb8cc32362822b5a546c8de21b3a0e89032.tar libvpx-c2814bb8cc32362822b5a546c8de21b3a0e89032.tar.gz libvpx-c2814bb8cc32362822b5a546c8de21b3a0e89032.tar.bz2 libvpx-c2814bb8cc32362822b5a546c8de21b3a0e89032.zip |
add example how to use rtcd
Just use vp8_sixtap_predict as example but have not
implemented it actually.
Test:
$ CROSS=riscv64-unknown-linux-gnu- ../libvpx/configure --target=riscv64-linux-gcc
$ make
Check if vp8_sixtap_predict functions have been replaced with those
suffixed with "_rvv":
$ riscv64-unknown-linux-gnu-nm ./vp8/decoder/decodeframe.c.o | grep vp8_sixtap_predict16x16
U vp8_sixtap_predict16x16_rvv
Check if vp8_sixtap_predictMxN_rvv work.
$ qemu-riscv64 -L $SYSROOT_RV64 ./build-test/test_libvpx --gtest_filter="RVV/SixtapPredictTest.TestWithPresetData/*"
You should see print log output such as: "--> vp8_sixtap_predict4x4_rvv"
"FAILED" is expected due to we have not implemented the actual
algorithm.
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Co-authored-by: sun min <sunmin89@outlook.com>
Diffstat (limited to 'vp8/common')
-rw-r--r-- | vp8/common/riscv/sixtap_predict_rvv.c | 63 | ||||
-rw-r--r-- | vp8/common/rtcd_defs.pl | 8 |
2 files changed, 67 insertions, 4 deletions
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/; |