x86/flacdsp: add an SSE4 version of wasted33

flac_wasted_33_c: 214.1
flac_wasted_33_sse4: 103.2

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-05-12 12:36:01 -03:00
parent 5ba6f4e63e
commit eb5733f38f
2 changed files with 27 additions and 0 deletions

View File

@ -113,6 +113,31 @@ ALIGN 16
jl .loop
RET
INIT_XMM sse4
cglobal flac_wasted_33, 4,4,5, decoded, residuals, wasted, len
shl lend, 2
lea decodedq, [decodedq+lenq*2]
add residualsq, lenq
neg lenq
movd m4, wastedd
ALIGN 16
.loop:
pmovsxdq m0, [residualsq+lenq+mmsize*0]
pmovsxdq m1, [residualsq+lenq+mmsize/2]
pmovsxdq m2, [residualsq+lenq+mmsize*1]
pmovsxdq m3, [residualsq+lenq+mmsize*1+mmsize/2]
psllq m0, m4
psllq m1, m4
psllq m2, m4
psllq m3, m4
mova [decodedq+lenq*2+mmsize*0], m0
mova [decodedq+lenq*2+mmsize*1], m1
mova [decodedq+lenq*2+mmsize*2], m2
mova [decodedq+lenq*2+mmsize*3], m3
add lenq, mmsize * 2
jl .loop
RET
;----------------------------------------------------------------------------------
;void ff_flac_decorrelate_[lrm]s_16_sse2(uint8_t **out, int32_t **in, int channels,
; int len, int shift);

View File

@ -31,6 +31,7 @@ void ff_flac_lpc_32_xop(int32_t *samples, const int coeffs[32], int order,
int qlevel, int len);
void ff_flac_wasted_32_sse2(int32_t *decoded, int wasted, int len);
void ff_flac_wasted_33_sse4(int64_t *decoded, const int32_t *residual, int wasted, int len);
#define DECORRELATE_FUNCS(fmt, opt) \
void ff_flac_decorrelate_ls_##fmt##_##opt(uint8_t **out, int32_t **in, int channels, \
@ -100,6 +101,7 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
if (EXTERNAL_SSE4(cpu_flags)) {
c->lpc16 = ff_flac_lpc_16_sse4;
c->lpc32 = ff_flac_lpc_32_sse4;
c->wasted33 = ff_flac_wasted_33_sse4;
}
if (EXTERNAL_AVX(cpu_flags)) {
if (fmt == AV_SAMPLE_FMT_S16) {