This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 71db4f3cc1a682cab77343707d383d22aa4b426b Author: Rémi Denis-Courmont <[email protected]> AuthorDate: Thu Dec 11 17:24:28 2025 +0200 Commit: Rémi Denis-Courmont <[email protected]> CommitDate: Sun Dec 14 10:33:40 2025 +0200 lavc/llvidencdsp: R-V V sub_median_pred SpacemiT X60: sub_median_pred_c: 297862.8 ( 1.00x) sub_median_pred_rvb_b: 101992.2 ( 2.92x) sub_median_pred_rvv_i32: 4820.0 (61.80x) --- libavcodec/riscv/llvidencdsp_init.c | 4 ++++ libavcodec/riscv/llvidencdsp_rvv.S | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/libavcodec/riscv/llvidencdsp_init.c b/libavcodec/riscv/llvidencdsp_init.c index 75f8438ab4..017aa778d9 100644 --- a/libavcodec/riscv/llvidencdsp_init.c +++ b/libavcodec/riscv/llvidencdsp_init.c @@ -32,6 +32,9 @@ void ff_llvidenc_sub_median_pred_rvb(uint8_t *dst, const uint8_t *src1, int *left, int *left_top); void ff_llvidenc_diff_bytes_rvv(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, intptr_t w); +void ff_llvidenc_sub_median_pred_rvv(uint8_t *dst, const uint8_t *src1, + const uint8_t *src2, intptr_t width, + int *left, int *left_top); void ff_llvidenc_sub_left_predict_rvv(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, ptrdiff_t width, int height); @@ -47,6 +50,7 @@ av_cold void ff_llvidencdsp_init_riscv(LLVidEncDSPContext *c) #if HAVE_RVV if (flags & AV_CPU_FLAG_RVV_I32) { c->diff_bytes = ff_llvidenc_diff_bytes_rvv; + c->sub_median_pred = ff_llvidenc_sub_median_pred_rvv; c->sub_left_predict = ff_llvidenc_sub_left_predict_rvv; } #endif diff --git a/libavcodec/riscv/llvidencdsp_rvv.S b/libavcodec/riscv/llvidencdsp_rvv.S index a862b776e0..068f36aea3 100644 --- a/libavcodec/riscv/llvidencdsp_rvv.S +++ b/libavcodec/riscv/llvidencdsp_rvv.S @@ -37,6 +37,37 @@ func ff_llvidenc_diff_bytes_rvv, zve32x ret endfunc +func ff_llvidenc_sub_median_pred_rvv, zve32x + lpad 0 + lw t4, (a4) + lw t5, (a5) +1: + vsetvli t3, a3, e8, m4, ta, ma + vle8.v v16, (a1) # src1 + sub a3, a3, t3 + vle8.v v24, (a2) # src2 + add a1, t3, a1 + vslide1up.vx v20, v16, t5 # lt + add a2, t3, a2 + vslide1up.vx v28, v24, t4 # l + lbu t5, -1(a1) + vsub.vv v20, v16, v20 + lbu t4, -1(a2) + vmaxu.vv v8, v28, v16 + vadd.vv v20, v28, v20 # l + src1 - lt + vminu.vv v12, v28, v16 + vminu.vv v8, v8, v20 + vmaxu.vv v8, v12, v8 # mid_pred(...) + vsub.vv v8, v24, v8 + vse8.v v8, (a0) + add a0, t3, a0 + bnez a3, 1b + + sw t4, (a4) + sw t5, (a5) + ret +endfunc + func ff_llvidenc_sub_left_predict_rvv, zve32x lpad 0 li a5, -0x80 _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
