diff options
author | sunyuechi <sunyuechi@iscas.ac.cn> | 2024-01-31 19:04:11 +0800 |
---|---|---|
committer | Rémi Denis-Courmont <remi@remlab.net> | 2024-02-17 14:33:35 +0200 |
commit | 89189dd9e7aa9c90d5104a768b3397dc804a9f42 (patch) | |
tree | 38493c1292e19d6f083003e51cad70cee9fbb6d8 | |
parent | d133e52790b39137c6be77437746d3e6274e6acb (diff) | |
download | ffmpeg-89189dd9e7aa9c90d5104a768b3397dc804a9f42.tar.gz |
lavc/rv34dsp: R-V V rv34_idct_dc_add
C908:
rv34_idct_dc_add_c: 134.7
rv34_idct_dc_add_rvv_i32: 45.5
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
-rw-r--r-- | libavcodec/riscv/rv34dsp_init.c | 2 | ||||
-rw-r--r-- | libavcodec/riscv/rv34dsp_rvv.S | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/riscv/rv34dsp_init.c b/libavcodec/riscv/rv34dsp_init.c index 852c8ad9a8..7dcadc7e43 100644 --- a/libavcodec/riscv/rv34dsp_init.c +++ b/libavcodec/riscv/rv34dsp_init.c @@ -26,6 +26,7 @@ #include "libavcodec/rv34dsp.h" void ff_rv34_inv_transform_dc_rvv(int16_t *block); +void ff_rv34_idct_dc_add_rvv(uint8_t *dst, ptrdiff_t stride, int dc); av_cold void ff_rv34dsp_init_riscv(RV34DSPContext *c) { @@ -34,6 +35,7 @@ av_cold void ff_rv34dsp_init_riscv(RV34DSPContext *c) if (flags & AV_CPU_FLAG_RVV_I32 && ff_get_rv_vlenb() >= 16) { c->rv34_inv_transform_dc = ff_rv34_inv_transform_dc_rvv; + c->rv34_idct_dc_add = ff_rv34_idct_dc_add_rvv; } #endif } diff --git a/libavcodec/riscv/rv34dsp_rvv.S b/libavcodec/riscv/rv34dsp_rvv.S index 21c203c0c4..f1f6345012 100644 --- a/libavcodec/riscv/rv34dsp_rvv.S +++ b/libavcodec/riscv/rv34dsp_rvv.S @@ -31,3 +31,23 @@ func ff_rv34_inv_transform_dc_rvv, zve32x ret endfunc + +func ff_rv34_idct_dc_add_rvv, zve32x + vsetivli zero, 4, e8, mf4, ta, ma + vlse32.v v0, (a0), a1 + li t1, 169 + mul t1, t1, a2 + li a2, 255 + addi t1, t1, 512 + srai t1, t1, 10 + vsetivli zero, 4*4, e16, m2, ta, ma + vzext.vf2 v2, v0 + vadd.vx v2, v2, t1 + vmax.vx v2, v2, zero + vsetvli zero, zero, e8, m1, ta, ma + vnclipu.wi v0, v2, 0 + vsetivli zero, 4, e8, mf4, ta, ma + vsse32.v v0, (a0), a1 + + ret +endfunc |