diff options
author | sunyuechi <sunyuechi@iscas.ac.cn> | 2023-12-18 22:52:20 +0800 |
---|---|---|
committer | Rémi Denis-Courmont <remi@remlab.net> | 2023-12-21 22:42:34 +0200 |
commit | c933ff2779d602cbf6d4b10a9e285007ad457120 (patch) | |
tree | d6d4666a262f76b600bc67d96d0c1a7153cac9d3 /libavcodec | |
parent | 864174dd002af1b849210dc3a02e229eacdb19b4 (diff) | |
download | ffmpeg-c933ff2779d602cbf6d4b10a9e285007ad457120.tar.gz |
lavc/takdsp: R-V V decorrelate_sr
C908:
decorrelate_sr_c: 95.5
decorrelate_sr_rvv_i32: 28.2
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/riscv/takdsp_init.c | 2 | ||||
-rw-r--r-- | libavcodec/riscv/takdsp_rvv.S | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/riscv/takdsp_init.c b/libavcodec/riscv/takdsp_init.c index fcf0c5f37b..0b4ec18086 100644 --- a/libavcodec/riscv/takdsp_init.c +++ b/libavcodec/riscv/takdsp_init.c @@ -26,6 +26,7 @@ #include "libavcodec/takdsp.h" void ff_decorrelate_ls_rvv(int32_t *p1, int32_t *p2, int length); +void ff_decorrelate_sr_rvv(int32_t *p1, int32_t *p2, int length); av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp) { @@ -34,6 +35,7 @@ av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp) if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { dsp->decorrelate_ls = ff_decorrelate_ls_rvv; + dsp->decorrelate_sr = ff_decorrelate_sr_rvv; } #endif } diff --git a/libavcodec/riscv/takdsp_rvv.S b/libavcodec/riscv/takdsp_rvv.S index c662049f3d..65672cdfb8 100644 --- a/libavcodec/riscv/takdsp_rvv.S +++ b/libavcodec/riscv/takdsp_rvv.S @@ -33,3 +33,17 @@ func ff_decorrelate_ls_rvv, zve32x bnez a2, 1b ret endfunc + +func ff_decorrelate_sr_rvv, zve32x +1: + vsetvli t0, a2, e32, m8, ta, ma + vle32.v v0, (a0) + sub a2, a2, t0 + vle32.v v8, (a1) + sh2add a1, t0, a1 + vsub.vv v16, v8, v0 + vse32.v v16, (a0) + sh2add a0, t0, a0 + bnez a2, 1b + ret +endfunc |