summaryrefslogtreecommitdiffstats
path: root/libavcodec/riscv/pixblockdsp_init.c
diff options
context:
space:
mode:
authorRémi Denis-Courmont <[email protected]>2023-10-29 13:26:30 +0200
committerRémi Denis-Courmont <[email protected]>2023-11-06 19:42:49 +0200
commit02594c8c011ca2cdc20334e9bb812ec8f6f37cf3 (patch)
tree4f6d5d2f123d653ce4abb4c0fb40035155c34865 /libavcodec/riscv/pixblockdsp_init.c
parentf68ad5d2de40e42b57b9f44ec69d9cbc0f709460 (diff)
lavc/pixblockdsp: rework R-V V get_pixels_unaligned
As in the aligned case, we can use VLSE64.V, though the way of doing so gets more convoluted, so the performance gains are more modest: get_pixels_unaligned_c: 126.7 get_pixels_unaligned_rvv_i32: 145.5 (before) get_pixels_unaligned_rvv_i64: 62.2 (after) For the reference, those are the aligned benchmarks (unchanged) on the same T-Head C908 hardware: get_pixels_c: 126.7 get_pixels_rvi: 85.7 get_pixels_rvv_i64: 33.2
Diffstat (limited to 'libavcodec/riscv/pixblockdsp_init.c')
-rw-r--r--libavcodec/riscv/pixblockdsp_init.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/riscv/pixblockdsp_init.c b/libavcodec/riscv/pixblockdsp_init.c
index 6b1efd16f8..3c623a9473 100644
--- a/libavcodec/riscv/pixblockdsp_init.c
+++ b/libavcodec/riscv/pixblockdsp_init.c
@@ -56,20 +56,17 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
#if HAVE_RVV
if ((cpu_flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) {
- if (!high_bit_depth) {
- c->get_pixels = ff_get_pixels_unaligned_8_rvv;
- c->get_pixels_unaligned = ff_get_pixels_unaligned_8_rvv;
- }
-
c->diff_pixels = ff_diff_pixels_unaligned_rvv;
c->diff_pixels_unaligned = ff_diff_pixels_unaligned_rvv;
+ }
- if (cpu_flags & AV_CPU_FLAG_RVV_I64) {
- if (!high_bit_depth)
- c->get_pixels = ff_get_pixels_8_rvv;
-
- c->diff_pixels = ff_diff_pixels_rvv;
+ if ((cpu_flags & AV_CPU_FLAG_RVV_I64) && ff_get_rv_vlenb() >= 16) {
+ if (!high_bit_depth) {
+ c->get_pixels = ff_get_pixels_8_rvv;
+ c->get_pixels_unaligned = ff_get_pixels_unaligned_8_rvv;
}
+
+ c->diff_pixels = ff_diff_pixels_rvv;
}
#endif
}