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

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

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
3636 if ((flags & AV_CPU_FLAG_RVV_F64) && (flags & AV_CPU_FLAG_RVB_ADDR)) {
3737 c->lpc_apply_welch_window = ff_lpc_apply_welch_window_rvv;
3838
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)
4041 c->lpc_compute_autocorr = ff_lpc_compute_autocorr_rvv;
4142 }
4243 #endif
libavcodec/riscv/lpc_rvv.S+3−2
@@ -86,10 +86,11 @@ func ff_lpc_apply_welch_window_rvv, zve64d · 85 unmodified lines
8686 ret
8787 endfunc
8888
89−func ff_lpc_compute_autocorr_rvv, zve64d
89+func ff_lpc_compute_autocorr_rvv, zve64d, zbb
9090 addi a2, a2, 1
91+ vtype_vli t1, a2, t2, e64, ta, ma
9192 li t0, 1
92− vsetvli zero, a2, e64, m8, ta, ma
93+ vsetvl zero, a2, t1
9394 fcvt.d.l ft0, t0
9495 vle64.v v0, (a0)
9596 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