History

lavc/flacdsp: R-V V decorrelate_ms packed

flac_decorrelate_ms_16_c: 585.5 flac_decorrelate_ms_16_rvv_i32: 263.0 flac_decorrelate_ms_32_c: 584.7 flac_decorrelate_ms_32_rvv_i32: 250.0

Rémi Denis-Courmont committed 3 years ago

Commit 6183a691 parent 636ae0e2 files · +55 −0Browse files

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

Unified · Split

2 files
  1. libavcodec/riscv/flacdsp_init.c +6 −0
  2. libavcodec/riscv/flacdsp_rvv.S +49 −0
libavcodec/riscv/flacdsp_init.c+6−0
@@ -28,10 +28,14 @@ void ff_flac_decorrelate_ls_16_rvv(uint8_t **out, int32_t **in, · 27 unmodified lines
2828 int channels, int len, int shift);
2929 void ff_flac_decorrelate_rs_16_rvv(uint8_t **out, int32_t **in,
3030 int channels, int len, int shift);
31+void ff_flac_decorrelate_ms_16_rvv(uint8_t **out, int32_t **in,
32+ int channels, int len, int shift);
3133 void ff_flac_decorrelate_ls_32_rvv(uint8_t **out, int32_t **in,
3234 int channels, int len, int shift);
3335 void ff_flac_decorrelate_rs_32_rvv(uint8_t **out, int32_t **in,
3436 int channels, int len, int shift);
37+void ff_flac_decorrelate_ms_32_rvv(uint8_t **out, int32_t **in,
38+ int channels, int len, int shift);
3539
3640 av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt,
3741 int channels)
@@ -44,10 +48,12 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, · 6 unmodified lines
4448 case AV_SAMPLE_FMT_S16:
4549 c->decorrelate[1] = ff_flac_decorrelate_ls_16_rvv;
4650 c->decorrelate[2] = ff_flac_decorrelate_rs_16_rvv;
51+ c->decorrelate[3] = ff_flac_decorrelate_ms_16_rvv;
4752 break;
4853 case AV_SAMPLE_FMT_S32:
4954 c->decorrelate[1] = ff_flac_decorrelate_ls_32_rvv;
5055 c->decorrelate[2] = ff_flac_decorrelate_rs_32_rvv;
56+ c->decorrelate[3] = ff_flac_decorrelate_ms_32_rvv;
5157 break;
5258 }
5359 }
libavcodec/riscv/flacdsp_rvv.S+49−0
@@ -69,6 +69,32 @@ func ff_flac_decorrelate_rs_16_rvv, zve32x · 68 unmodified lines
6969 ret
7070 endfunc
7171
72+func ff_flac_decorrelate_ms_16_rvv, zve32x
73+ ld a0, (a0)
74+ ld a2, 8(a1)
75+ ld a1, (a1)
76+1:
77+ vsetvli t0, a3, e32, m8, ta, ma
78+ vle32.v v8, (a2)
79+ sub a3, a3, t0
80+ vle32.v v0, (a1)
81+ sh2add a1, t0, a1
82+ vsra.vi v16, v8, 1
83+ sh2add a2, t0, a2
84+ vsub.vv v24, v0, v16
85+ vadd.vv v16, v24, v8
86+ vsll.vx v8, v24, a4
87+ vsll.vx v0, v16, a4
88+ vsetvli zero, zero, e16, m4, ta, ma
89+ vncvt.x.x.w v0, v0
90+ vncvt.x.x.w v4, v8
91+ vsseg2e16.v v0, (a0)
92+ sh2add a0, t0, a0
93+ bnez a3, 1b
94+
95+ ret
96+endfunc
97+
7298 func ff_flac_decorrelate_ls_32_rvv, zve32x
7399 ld a0, (a0)
74100 ld a2, 8(a1)
@@ -110,4 +136,27 @@ func ff_flac_decorrelate_rs_32_rvv, zve32x · 35 unmodified lines
110136
111137 ret
112138 endfunc
139+
140+func ff_flac_decorrelate_ms_32_rvv, zve32x
141+ ld a0, (a0)
142+ ld a2, 8(a1)
143+ ld a1, (a1)
144+1:
145+ vsetvli t0, a3, e32, m4, ta, ma
146+ vle32.v v4, (a2)
147+ sub a3, a3, t0
148+ vle32.v v0, (a1)
149+ sh2add a1, t0, a1
150+ vsra.vi v8, v4, 1
151+ sh2add a2, t0, a2
152+ vsub.vv v12, v0, v8
153+ vadd.vv v8, v12, v4
154+ vsll.vx v4, v12, a4
155+ vsll.vx v0, v8, a4
156+ vsseg2e32.v v0, (a0)
157+ sh3add a0, t0, a0
158+ bnez a3, 1b
159+
160+ ret
161+endfunc
113162 #endif

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