diff options
author | Timothy Gu <timothygu99@gmail.com> | 2016-02-09 01:59:46 +0000 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2016-02-10 11:25:11 -0800 |
commit | c8b1612af03b6ad1e6bcf56fad73544ba2a2893c (patch) | |
tree | 1299d8560b2c905fdca0b47a2847ea8265cd9865 /libavfilter/x86/vf_blend.asm | |
parent | 5486d7fa91f7233e6d9aa9ba8de7fe9287402637 (diff) | |
download | ffmpeg-c8b1612af03b6ad1e6bcf56fad73544ba2a2893c.tar.gz |
x86/vf_blend: Move multiplying to a macro
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/x86/vf_blend.asm')
-rw-r--r-- | libavfilter/x86/vf_blend.asm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavfilter/x86/vf_blend.asm b/libavfilter/x86/vf_blend.asm index 9388a74250..50b5f8a197 100644 --- a/libavfilter/x86/vf_blend.asm +++ b/libavfilter/x86/vf_blend.asm @@ -102,6 +102,15 @@ BLEND_INIT difference128, 4 jl .loop BLEND_END +%macro MULTIPLY 3 ; a, b, pw_1 + pmullw %1, %2 ; xxxxxxxx a * b + paddw %1, %3 + mova %2, %1 + psrlw %2, 8 + paddw %1, %2 + psrlw %1, 8 ; 00xx00xx a * b / 255 +%endmacro + BLEND_INIT multiply, 4 pxor m2, m2 mova m3, [pw_1] @@ -116,12 +125,7 @@ BLEND_INIT multiply, 4 punpcklbw m0, m2 ; 00xx00xx punpcklbw m1, m2 - pmullw m0, m1 ; xxxxxxxx a * b - paddw m0, m3 - mova m1, m0 - psrlw m1, 8 - paddw m0, m1 - psrlw m0, 8 ; 00xx00xx a * b / 255 + MULTIPLY m0, m1, m3 packuswb m0, m0 ; 0000xxxx movh [dstq + xq], m0 |