[FFmpeg-cvslog] x86/vf_blend: Move multiplying to a macro

Timothy Gu git at videolan.org
Wed Feb 10 20:26:35 CET 2016


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Tue Feb  9 01:59:46 2016 +0000| [c8b1612af03b6ad1e6bcf56fad73544ba2a2893c] | committer: Timothy Gu

x86/vf_blend: Move multiplying to a macro

Reviewed-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8b1612af03b6ad1e6bcf56fad73544ba2a2893c
---

 libavfilter/x86/vf_blend.asm |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/libavfilter/x86/vf_blend.asm b/libavfilter/x86/vf_blend.asm
index 9388a74..50b5f8a 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



More information about the ffmpeg-cvslog mailing list