History

lavc/flacdsp: R-V V flac_wasted32

T-Head C908: flac_wasted_32_c: 949.0 flac_wasted_32_rvv_i32: 278.7

Rémi Denis-Courmont committed 2 years ago

Commit 7b470991 parent 83e5fdd2 files · +21 −1Browse files

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

Unified · Split

2 files
  1. libavcodec/riscv/flacdsp_init.c +6 −1
  2. libavcodec/riscv/flacdsp_rvv.S +15 −0
libavcodec/riscv/flacdsp_init.c+6−1
@@ -31,6 +31,7 @@ void ff_flac_lpc32_rvv(int32_t *decoded, const int coeffs[32], · 30 unmodified lines
3131 int pred_order, int qlevel, int len);
3232 void ff_flac_lpc32_rvv_simple(int32_t *decoded, const int coeffs[32],
3333 int pred_order, int qlevel, int len);
34+void ff_flac_wasted32_rvv(int32_t *, int shift, int len);
3435 void ff_flac_decorrelate_indep2_16_rvv(uint8_t **out, int32_t **in,
3536 int channels, int len, int shift);
3637 void ff_flac_decorrelate_indep4_16_rvv(uint8_t **out, int32_t **in,
@@ -79,7 +80,11 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, · 42 unmodified lines
7980 else
8081 c->lpc32 = ff_flac_lpc32_rvv;
8182 }
83+# endif
84+
85+ c->wasted32 = ff_flac_wasted32_rvv;
8286
87+# if (__riscv_xlen >= 64)
8388 switch (fmt) {
8489 case AV_SAMPLE_FMT_S16:
8590 switch (channels) {
@@ -119,8 +124,8 @@ av_cold void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, · 33 unmodified lines
119124 c->decorrelate[2] = ff_flac_decorrelate_rs_32_rvv;
120125 c->decorrelate[3] = ff_flac_decorrelate_ms_32_rvv;
121126 break;
122−# endif
123127 }
128+# endif
124129 }
125130 #endif
126131 }
libavcodec/riscv/flacdsp_rvv.S+15−0
@@ -100,7 +100,22 @@ func ff_flac_lpc32_rvv_simple, zve64x · 99 unmodified lines
100100
101101 ret
102102 endfunc
103+#endif
104+
105+func ff_flac_wasted32_rvv, zve32x
106+1:
107+ vsetvli t0, a2, e32, m8, ta, ma
108+ vle32.v v8, (a0)
109+ sub a2, a2, t0
110+ vsll.vx v8, v8, a1
111+ vse32.v v8, (a0)
112+ sh2add a0, t0, a0
113+ bnez a2, 1b
103114
115+ ret
116+endfunc
117+
118+#if (__riscv_xlen == 64)
104119 func ff_flac_decorrelate_indep2_16_rvv, zve32x
105120 ld a0, (a0)
106121 ld a2, 8(a1)

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