aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/dsputilenc.asm
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2014-05-26 03:49:35 -0300
committerMichael Niedermayer <michaelni@gmx.at>2014-05-27 05:55:11 +0200
commite64e079ece7d037686c4c0f97eac9c62af6300b1 (patch)
tree96227a1b784bbf67a6d3b6e9d4b9640b98ae6db6 /libavcodec/x86/dsputilenc.asm
parenta0c5cd3475fd93930604e4ec5ac1336f5732c04b (diff)
downloadffmpeg-e64e079ece7d037686c4c0f97eac9c62af6300b1.tar.gz
x86/dsputilenc: implement SSE2 version of diff_pixels
Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/dsputilenc.asm')
-rw-r--r--libavcodec/x86/dsputilenc.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm
index 7426c01dbb..ba8a1773c2 100644
--- a/libavcodec/x86/dsputilenc.asm
+++ b/libavcodec/x86/dsputilenc.asm
@@ -419,6 +419,31 @@ cglobal diff_pixels, 4,5
jne .loop
REP_RET
+INIT_XMM sse2
+cglobal diff_pixels, 4, 5, 5
+ movsxdifnidn r3, r3d
+ pxor m4, m4
+ add r0, 128
+ mov r4, -128
+.loop:
+ movh m0, [r1]
+ movh m2, [r2]
+ movh m1, [r1+r3]
+ movh m3, [r2+r3]
+ punpcklbw m0, m4
+ punpcklbw m1, m4
+ punpcklbw m2, m4
+ punpcklbw m3, m4
+ psubw m0, m2
+ psubw m1, m3
+ mova [r0+r4+0 ], m0
+ mova [r0+r4+16], m1
+ lea r1, [r1+r3*2]
+ lea r2, [r2+r3*2]
+ add r4, 32
+ jne .loop
+ RET
+
INIT_MMX mmx
; int ff_pix_sum16_mmx(uint8_t *pix, int line_size)
cglobal pix_sum16, 2, 3