aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/flacdsp.asm
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-05-12 12:36:01 -0300
committerJames Almer <jamrial@gmail.com>2024-05-13 12:18:10 -0300
commiteb5733f38f56ca79e3bbcf2e3c12483d219f0523 (patch)
tree82427c5d4f3dbc468d3f9de2fd1c39d1541921c7 /libavcodec/x86/flacdsp.asm
parent5ba6f4e63e49c815a2964a6e4139f62700eebf0a (diff)
downloadffmpeg-eb5733f38f56ca79e3bbcf2e3c12483d219f0523.tar.gz
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>
Diffstat (limited to 'libavcodec/x86/flacdsp.asm')
-rw-r--r--libavcodec/x86/flacdsp.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavcodec/x86/flacdsp.asm b/libavcodec/x86/flacdsp.asm
index 21b2439bc0..15fcec4f08 100644
--- a/libavcodec/x86/flacdsp.asm
+++ b/libavcodec/x86/flacdsp.asm
@@ -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);