diff mbox series

[FFmpeg-devel,2/2] lavc/pixblockdsp: add scalar get_pixels_unaligned

Message ID 20240521175233.31722-2-remi@remlab.net
State Accepted
Commit ba38d0e3282544765bff1110e043c65c7e566db6
Headers show
Series [FFmpeg-devel,1/2] checkasm/riscv: test misaligned before V | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Rémi Denis-Courmont May 21, 2024, 5:52 p.m. UTC
The code is already there, we just need to use it.

get_pixels_unaligned_c: 2.2
get_pixels_unaligned_misaligned: 1.7
---
 libavcodec/riscv/pixblockdsp_init.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/riscv/pixblockdsp_init.c b/libavcodec/riscv/pixblockdsp_init.c
index b205841101..2735776105 100644
--- a/libavcodec/riscv/pixblockdsp_init.c
+++ b/libavcodec/riscv/pixblockdsp_init.c
@@ -55,6 +55,13 @@  av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
             c->get_pixels = ff_get_pixels_8_rvi;
     }
 
+    if (cpu_flags & AV_CPU_FLAG_RV_MISALIGNED) {
+        if (high_bit_depth)
+            c->get_pixels_unaligned = ff_get_pixels_16_rvi;
+        else
+            c->get_pixels_unaligned = ff_get_pixels_8_rvi;
+    }
+
 #if HAVE_RVV
     if ((cpu_flags & AV_CPU_FLAG_RVV_I32) && ff_rv_vlen_least(128)) {
         c->diff_pixels = ff_diff_pixels_unaligned_rvv;