1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00

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>
This commit is contained in:
sunyuechi 2023-12-18 22:52:20 +08:00 committed by Rémi Denis-Courmont
parent 864174dd00
commit c933ff2779
2 changed files with 16 additions and 0 deletions

View File

@ -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
}

View File

@ -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