diff mbox series

[FFmpeg-devel,4/6] lavc/idctdsp: improve R-V V put_signed_pixels_clamped

Message ID 20231027192540.27373-4-remi@remlab.net
State Accepted
Commit 600c6f1b5575c5d8f3a6544d53dbff88a9cbe7fb
Headers show
Series [FFmpeg-devel,1/6] lavc/pixblockdsp: rename unaligned R-V V functions | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Rémi Denis-Courmont Oct. 27, 2023, 7:25 p.m. UTC
This follows the same idea as with pixblockdsp, but applied at the
other end, whilst writing data at the end of the function.
---
 libavcodec/riscv/idctdsp_rvv.S | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/riscv/idctdsp_rvv.S b/libavcodec/riscv/idctdsp_rvv.S
index 06e64e6529..4ff72f48d2 100644
--- a/libavcodec/riscv/idctdsp_rvv.S
+++ b/libavcodec/riscv/idctdsp_rvv.S
@@ -42,24 +42,15 @@  func ff_put_pixels_clamped_rvv, zve32x
         ret
 endfunc
 
-func ff_put_signed_pixels_clamped_rvv, zve32x
-        vsetivli    zero, 8, e16, m1, ta, ma
-        vlseg8e16.v v24, (a0)
-
-        li          t1, 128
-        vsetivli    zero, 8, e8, mf2, ta, ma
-        vnclip.wi   v16, v24, 0
-        vnclip.wi   v17, v25, 0
-        vnclip.wi   v18, v26, 0
-        vnclip.wi   v19, v27, 0
-        vnclip.wi   v20, v28, 0
-        vnclip.wi   v21, v29, 0
-        vnclip.wi   v22, v30, 0
-        vnclip.wi   v23, v31, 0
-        vsetvli     t0, zero, e8, m8, ta, ma
-        vadd.vx     v16, v16, t1
-        vsetivli    zero, 8, e8, mf2, ta, ma
-        vssseg8e8.v v16, (a1), a2
+func ff_put_signed_pixels_clamped_rvv, zve64x
+        li      t0, 8 * 8
+        vsetvli zero, t0, e8, m4, ta, ma
+        vle16.v v24, (a0)
+        li      t1, 128
+        vnclip.wi v16, v24, 0
+        vadd.vx v16, v16, t1
+        vsetivli zero, 8, e8, mf2, ta, ma
+        vsse64.v v16, (a1), a2
         ret
 endfunc