mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 00:51:37 +00:00
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 <remi@remlab.net> Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
d0fe109b59
commit
d9910caa91
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user