ffmpeg | branch: master | sunyuechi <sunyue...@iscas.ac.cn> | Wed Mar 6 12:46:03 2024 +0800| [7d0673db7eb285ffe6da51fa2ab981b38a6f7542] | committer: Rémi Denis-Courmont
lavc/blockdsp: R-V V fill_block C908: blockdsp.fill_block_tab[0]_c: 549.7 blockdsp.fill_block_tab[0]_rvv_i64: 48.2 blockdsp.fill_block_tab[1]_c: 77.0 blockdsp.fill_block_tab[1]_rvv_i64: 19.7 Signed-off-by: Rémi Denis-Courmont <r...@remlab.net> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d0673db7eb285ffe6da51fa2ab981b38a6f7542 --- libavcodec/riscv/blockdsp_init.c | 6 ++++++ libavcodec/riscv/blockdsp_rvv.S | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/libavcodec/riscv/blockdsp_init.c b/libavcodec/riscv/blockdsp_init.c index 59b2f9d47b..42c8e87fa7 100644 --- a/libavcodec/riscv/blockdsp_init.c +++ b/libavcodec/riscv/blockdsp_init.c @@ -27,6 +27,10 @@ void ff_clear_block_rvv(int16_t *block); void ff_clear_blocks_rvv(int16_t *block); +void ff_fill_block16_rvv(uint8_t *block, uint8_t value, ptrdiff_t line_size, + int h); +void ff_fill_block8_rvv(uint8_t *block, uint8_t value, ptrdiff_t line_size, + int h); av_cold void ff_blockdsp_init_riscv(BlockDSPContext *c) { @@ -36,6 +40,8 @@ av_cold void ff_blockdsp_init_riscv(BlockDSPContext *c) if (flags & AV_CPU_FLAG_RVV_I64 && ff_get_rv_vlenb() >= 16) { c->clear_block = ff_clear_block_rvv; c->clear_blocks = ff_clear_blocks_rvv; + c->fill_block_tab[0] = ff_fill_block16_rvv; + c->fill_block_tab[1] = ff_fill_block8_rvv; } #endif } diff --git a/libavcodec/riscv/blockdsp_rvv.S b/libavcodec/riscv/blockdsp_rvv.S index 8bb00bb467..18ab17da00 100644 --- a/libavcodec/riscv/blockdsp_rvv.S +++ b/libavcodec/riscv/blockdsp_rvv.S @@ -40,3 +40,24 @@ func ff_clear_blocks_rvv, zve64x ret endfunc + +func ff_fill_block16_rvv, zve32x + vsetivli t0, 16, e8, m1, ta, ma + vmv.v.x v8, a1 +1: + addi a3, a3, -1 + vse8.v v8, (a0) + add a0, a0, a2 + bnez a3, 1b + + ret +endfunc + +func ff_fill_block8_rvv, zve64x + vsetvli t0, zero, e8, m4, ta, ma + vmv.v.x v8, a1 + vsetvli t0, a3, e64, m4, ta, ma + vsse64.v v8, (a0), a2 + + ret +endfunc _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".