History

lavc/lpc: optimise RVV vector type for compute_autocorr

On SpacemiT X60 (with len == 4000): autocorr_10_c: 2303.7 autocorr_10_rvv_f64: 1411.5 (before) autocorr_10_rvv_f64: 842.2 (after)

Rémi Denis-Courmont committed 2 years ago

Commit c53d4231 parent d82c5032 files · +5 −3Browse files

Unified · Split

2 files
  1. libavcodec/riscv/lpc_init.c +2 −1
  2. libavcodec/riscv/lpc_rvv.S +3 −2
libavcodec/riscv/lpc_init.c+2−1
@@ -36,7 +36,8 @@ av_cold void ff_lpc_init_riscv(LPCContext *c) · 35 unmodified lines
36 if ((flags & AV_CPU_FLAG_RVV_F64) && (flags & AV_CPU_FLAG_RVB_ADDR)) {36 if ((flags & AV_CPU_FLAG_RVV_F64) && (flags & AV_CPU_FLAG_RVB_ADDR)) {
37 c->lpc_apply_welch_window = ff_lpc_apply_welch_window_rvv;37 c->lpc_apply_welch_window = ff_lpc_apply_welch_window_rvv;
38 38
39 if (ff_get_rv_vlenb() > c->max_order)39 if ((flags & AV_CPU_FLAG_RVB_BASIC) &&
40 ff_get_rv_vlenb() > c->max_order)
40 c->lpc_compute_autocorr = ff_lpc_compute_autocorr_rvv;41 c->lpc_compute_autocorr = ff_lpc_compute_autocorr_rvv;
41 }42 }
42#endif43#endif
libavcodec/riscv/lpc_rvv.S+3−2
@@ -86,10 +86,11 @@ func ff_lpc_apply_welch_window_rvv, zve64d · 85 unmodified lines
86 ret86 ret
87endfunc87endfunc
88 88
89func ff_lpc_compute_autocorr_rvv, zve64d89func ff_lpc_compute_autocorr_rvv, zve64d, zbb
90 addi a2, a2, 190 addi a2, a2, 1
91 vtype_vli t1, a2, t2, e64, ta, ma
91 li t0, 192 li t0, 1
92 vsetvli zero, a2, e64, m8, ta, ma93 vsetvl zero, a2, t1
93 fcvt.d.l ft0, t094 fcvt.d.l ft0, t0
94 vle64.v v0, (a0)95 vle64.v v0, (a0)
95 sh3add a0, a2, a0 # data += lag96 sh3add a0, a2, a0 # data += lag

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