History

lavc/takdsp: R-V V decorrelate_sm

C908: decorrelate_sm_c: 130.0 decorrelate_sm_rvv_i32: 43.2

sunyuechi committed 2 years ago

Commit 3d39b8d1 parent 0c6203c2 files · +20 −0Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/riscv/takdsp_init.c +2 −0
  2. libavcodec/riscv/takdsp_rvv.S +18 −0
libavcodec/riscv/takdsp_init.c+2−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727
2828 void ff_decorrelate_ls_rvv(const int32_t *p1, int32_t *p2, int length);
2929 void ff_decorrelate_sr_rvv(int32_t *p1, const int32_t *p2, int length);
30+void ff_decorrelate_sm_rvv(int32_t *p1, int32_t *p2, int length);
3031
3132 av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp)
3233 {
@@ -36,6 +37,7 @@ av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp) · 3 unmodified lines
3637 if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) {
3738 dsp->decorrelate_ls = ff_decorrelate_ls_rvv;
3839 dsp->decorrelate_sr = ff_decorrelate_sr_rvv;
40+ dsp->decorrelate_sm = ff_decorrelate_sm_rvv;
3941 }
4042 #endif
4143 }
libavcodec/riscv/takdsp_rvv.S+18−0
@@ -47,3 +47,21 @@ func ff_decorrelate_sr_rvv, zve32x · 46 unmodified lines
4747 bnez a2, 1b
4848 ret
4949 endfunc
50+
51+func ff_decorrelate_sm_rvv, zve32x
52+1:
53+ vsetvli t0, a2, e32, m8, ta, ma
54+ vle32.v v8, (a1)
55+ sub a2, a2, t0
56+ vle32.v v0, (a0)
57+ vsra.vi v16, v8, 1
58+ vsub.vv v0, v0, v16
59+ vse32.v v0, (a0)
60+ sh2add a0, t0, a0
61+ vadd.vv v8, v0, v8
62+ vse32.v v8, (a1)
63+ sh2add a1, t0, a1
64+ bnez a2, 1b
65+
66+ ret
67+endfunc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t