[FFmpeg-cvslog] lavc/takdsp: R-V V decorrelate_sr
sunyuechi
git at videolan.org
Thu Dec 21 22:43:44 EET 2023
ffmpeg | branch: master | sunyuechi <sunyuechi at iscas.ac.cn> | Mon Dec 18 22:52:20 2023 +0800| [c933ff2779d602cbf6d4b10a9e285007ad457120] | committer: Rémi Denis-Courmont
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 at remlab.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c933ff2779d602cbf6d4b10a9e285007ad457120
---
libavcodec/riscv/takdsp_init.c | 2 ++
libavcodec/riscv/takdsp_rvv.S | 14 ++++++++++++++
2 files changed, 16 insertions(+)
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
More information about the ffmpeg-cvslog
mailing list