[FFmpeg-cvslog] lavc/huffyuvdsp: optimise RVV vtype for add_hfyu_left_pred_bgr32

Rémi Denis-Courmont git at videolan.org
Sun May 19 18:38:34 EEST 2024


ffmpeg | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 16 19:43:38 2024 +0300| [463c573e6b6489c588bee90124d5cf92db8ccaaa] | committer: Rémi Denis-Courmont

lavc/huffyuvdsp: optimise RVV vtype for add_hfyu_left_pred_bgr32

T-Head C908:
add_hfyu_left_pred_bgr32_c:       237.5
add_hfyu_left_pred_bgr32_rvv_i32: 173.5 (before)
add_hfyu_left_pred_bgr32_rvv_i32: 110.0 (after)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=463c573e6b6489c588bee90124d5cf92db8ccaaa
---

 libavcodec/riscv/huffyuvdsp_init.c | 3 ++-
 libavcodec/riscv/huffyuvdsp_rvv.S  | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/riscv/huffyuvdsp_init.c b/libavcodec/riscv/huffyuvdsp_init.c
index b49b3dc097..79e93e213f 100644
--- a/libavcodec/riscv/huffyuvdsp_init.c
+++ b/libavcodec/riscv/huffyuvdsp_init.c
@@ -35,7 +35,8 @@ av_cold void ff_huffyuvdsp_init_riscv(HuffYUVDSPContext *c,
 
     if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) {
         c->add_int16 = ff_add_int16_rvv;
-        c->add_hfyu_left_pred_bgr32 = ff_add_hfyu_left_pred_bgr32_rvv;
+        if (flags & AV_CPU_FLAG_RVB_BASIC)
+            c->add_hfyu_left_pred_bgr32 = ff_add_hfyu_left_pred_bgr32_rvv;
     }
 #endif
 }
diff --git a/libavcodec/riscv/huffyuvdsp_rvv.S b/libavcodec/riscv/huffyuvdsp_rvv.S
index 9c4434907d..d334f5c6d0 100644
--- a/libavcodec/riscv/huffyuvdsp_rvv.S
+++ b/libavcodec/riscv/huffyuvdsp_rvv.S
@@ -36,8 +36,10 @@ func ff_add_int16_rvv, zve32x
         ret
 endfunc
 
-func ff_add_hfyu_left_pred_bgr32_rvv, zve32x
-        vsetivli zero, 4, e8, m1, ta, ma
+func ff_add_hfyu_left_pred_bgr32_rvv, zve32x, zbb
+        vtype_ivli t1, 4, e8, ta, ma
+        li      t0, 4
+        vsetvl  zero, t0, t1
         vle8.v  v8, (a3)
         sh2add  a2, a2, a1
 1:



More information about the ffmpeg-cvslog mailing list