History

x86/flacdsp: add a SSE2 version of wasted32

flac_wasted_32_c: 851.3 flac_wasted_32_sse2: 41.3

James Almer committed 2 years ago

Commit 0664cbd1 parent 5acec182 files · +27 −0Browse files

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

Unified · Split

2 files
  1. libavcodec/x86/flacdsp.asm +24 −0
  2. libavcodec/x86/flacdsp_init.c +3 −0
libavcodec/x86/flacdsp.asm+24−0
@@ -89,6 +89,30 @@ LPC_32 sse4, 32, psrlq · 88 unmodified lines
89LPC_32 xop, 32, psrlq89LPC_32 xop, 32, psrlq
90%endif90%endif
91 91
92INIT_XMM sse2
93cglobal flac_wasted_32, 3,3,5, decoded, wasted, len
94 shl lend, 2
95 add decodedq, lenq
96 neg lenq
97 movd m4, wastedd
98ALIGN 16
99.loop:
100 mova m0, [decodedq+lenq+mmsize*0]
101 mova m1, [decodedq+lenq+mmsize*1]
102 mova m2, [decodedq+lenq+mmsize*2]
103 mova m3, [decodedq+lenq+mmsize*3]
104 pslld m0, m4
105 pslld m1, m4
106 pslld m2, m4
107 pslld m3, m4
108 mova [decodedq+lenq+mmsize*0], m0
109 mova [decodedq+lenq+mmsize*1], m1
110 mova [decodedq+lenq+mmsize*2], m2
111 mova [decodedq+lenq+mmsize*3], m3
112 add lenq, mmsize * 4
113 jl .loop
114 RET
115
92;----------------------------------------------------------------------------------116;----------------------------------------------------------------------------------
93;void ff_flac_decorrelate_[lrm]s_16_sse2(uint8_t **out, int32_t **in, int channels,117;void ff_flac_decorrelate_[lrm]s_16_sse2(uint8_t **out, int32_t **in, int channels,
94; int len, int shift);118; int len, int shift);
libavcodec/x86/flacdsp_init.c+3−0
@@ -30,6 +30,8 @@ void ff_flac_lpc_32_sse4(int32_t *samples, const int coeffs[32], int order, · 29 unmodified lines
30void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order,30void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order,
31 int qlevel, int len);31 int qlevel, int len);
32 32
33void ff_flac_wasted_32_sse2(int32_t *decoded, int wasted, int len);
34
33#define DECORRELATE_FUNCS(fmt, opt) \35#define DECORRELATE_FUNCS(fmt, opt) \
34void ff_flac_decorrelate_ls_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \36void ff_flac_decorrelate_ls_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
35 int len, int shift); \37 int len, int shift); \
@@ -63,6 +65,7 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int · 27 unmodified lines
63 int cpu_flags = av_get_cpu_flags();65 int cpu_flags = av_get_cpu_flags();
64 66
65 if (EXTERNAL_SSE2(cpu_flags)) {67 if (EXTERNAL_SSE2(cpu_flags)) {
68 c->wasted32 = ff_flac_wasted_32_sse2;
66 if (fmt == AV_SAMPLE_FMT_S16) {69 if (fmt == AV_SAMPLE_FMT_S16) {
67 c->decorrelate[1] = ff_flac_decorrelate_ls_16_sse2;70 c->decorrelate[1] = ff_flac_decorrelate_ls_16_sse2;
68 c->decorrelate[2] = ff_flac_decorrelate_rs_16_sse2;71 c->decorrelate[2] = ff_flac_decorrelate_rs_16_sse2;

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