diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2014-05-28 17:52:24 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-29 23:56:00 +0400 |
commit | 99a319c4e7538670847ac4633ef8b0f0629deb22 (patch) | |
tree | 5896b2cac40b1e50d28d115c2cd821cc391e78a7 /libavcodec/x86/huffyuvdsp.asm | |
parent | 226700398105075d27d07b652a0b67705aa06a1e (diff) |
x86: huffyuvdsp: port add_bytes to yasm
C MMX SSE2
Cycles: 2972 587 302
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/huffyuvdsp.asm')
-rw-r--r-- | libavcodec/x86/huffyuvdsp.asm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libavcodec/x86/huffyuvdsp.asm b/libavcodec/x86/huffyuvdsp.asm index f183ebee54..a923e70e1e 100644 --- a/libavcodec/x86/huffyuvdsp.asm +++ b/libavcodec/x86/huffyuvdsp.asm @@ -163,3 +163,40 @@ cglobal add_hfyu_left_pred, 3,3,7, dst, src, w, left ADD_HFYU_LEFT_LOOP 0, 1 .src_unaligned: ADD_HFYU_LEFT_LOOP 0, 0 + +%macro ADD_BYTES 0 +cglobal add_bytes, 3,4,2, dst, src, w, size + mov sizeq, wq + and sizeq, -2*mmsize + jz .2 + add dstq, sizeq + add srcq, sizeq + neg sizeq +.1: + mova m0, [srcq + sizeq] + mova m1, [srcq + sizeq + mmsize] + paddb m0, [dstq + sizeq] + paddb m1, [dstq + sizeq + mmsize] + mova [dstq + sizeq], m0 + mova [dstq + sizeq + mmsize], m1 + add sizeq, 2*mmsize + jl .1 +.2: + and wq, 2*mmsize-1 + jz .end + add dstq, wq + add srcq, wq + neg wq +.3 + mov sizeb, [srcq + wq] + add [dstq + wq], sizeb + inc wq + jl .3 +.end: + REP_RET +%endmacro + +INIT_MMX mmx +ADD_BYTES +INIT_XMM sse2 +ADD_BYTES |