History

lavc/flacdsp: optimise RVV vector type for lpc32

This is pretty much the same as for lpc16, though it only improves half as large prediction orders. With 128-bit vectors, this gives: C V old V new 1 69.2 181.5 95.5 2 107.7 180.7 95.2 3 145.5 180.0 103.5 4 183.0 179.2 102.7 5 220.7 178.5 128.0 6 257.7 194.0 127.5 7 294.5 193.7 126.7 8 331.0 193.0 126.5 Larger prediction orders see no significant changes at that size.

Rémi Denis-Courmont committed 2 years ago

Commit 233066e1 parent 6ab4b922 files · +15 −12Browse files

Unified · Split

2 files
  1. libavcodec/riscv/flacdsp_init.c +8 −7
  2. libavcodec/riscv/flacdsp_rvv.S +7 −5
libavcodec/riscv/flacdsp_init.c+8−7
@@ -71,17 +71,18 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, · 70 unmodified lines
7171 if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) {
7272 int vlenb = ff_get_rv_vlenb();
7373
74− if ((flags & AV_CPU_FLAG_RVB_BASIC) && vlenb >= 16)
74+ if ((flags & AV_CPU_FLAG_RVB_BASIC) && vlenb >= 16) {
7575 c->lpc16 = ff_flac_lpc16_rvv;
7676
7777 # if (__riscv_xlen >= 64)
78− if (flags & AV_CPU_FLAG_RVV_I64) {
79− if (vlenb > 16)
80− c->lpc32 = ff_flac_lpc32_rvv_simple;
81− else
82− c->lpc32 = ff_flac_lpc32_rvv;
83− }
78+ if (flags & AV_CPU_FLAG_RVV_I64) {
79+ if (vlenb > 16)
80+ c->lpc32 = ff_flac_lpc32_rvv_simple;
81+ else
82+ c->lpc32 = ff_flac_lpc32_rvv;
83+ }
8484 # endif
85+ }
8586
8687 c->wasted32 = ff_flac_wasted32_rvv;
8788
libavcodec/riscv/flacdsp_rvv.S+7−5
@@ -76,22 +76,24 @@ func ff_flac_lpc32_rvv, zve64x · 75 unmodified lines
7676 ret
7777 endfunc
7878
79−func ff_flac_lpc32_rvv_simple, zve64x
80− vsetivli zero, 1, e64, m1, ta, ma
79+func ff_flac_lpc32_rvv_simple, zve64x, zbb
80+ vtype_vli t3, a2, t1, e64, ta, ma
81+ vntypei t2, t3
82+ vsetvl zero, a2, t3 // e64
8183 vmv.s.x v0, zero
82− vsetvli zero, a2, e32, m4, ta, ma
84+ vsetvl zero, zero, t2 // e32
8385 vle32.v v8, (a1)
8486 sub a4, a4, a2
8587 vle32.v v16, (a0)
8688 sh2add a0, a2, a0
8789 1:
8890 vwmul.vv v24, v8, v16
89− vsetvli zero, zero, e64, m8, ta, ma
91+ vsetvl zero, zero, t3 // e64
9092 vredsum.vs v24, v24, v0
9193 lw t0, (a0)
9294 addi a4, a4, -1
9395 vmv.x.s t1, v24
94− vsetvli zero, zero, e32, m4, ta, ma
96+ vsetvl zero, zero, t2 // e32
9597 sra t1, t1, a3
9698 add t0, t0, t1
9799 vslide1down.vx v16, v16, t0

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