[x265] [PATCH 5 of 7] asm: avx2 code for sad[32x8] for 8bpp

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue Mar 17 06:42:44 CET 2015


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1426570670 -19800
# Node ID 210785652131c6a8a2c300a69dc411b0ac026649
# Parent  5f1176737636b1b6f51ff424f99bcadcdc61d235
asm: avx2 code for sad[32x8] for 8bpp

see3
sad[ 32x8]  25.35x   206.66          5238.90

avx2
sad[ 32x8]  34.37x   152.41          5238.04

diff -r 5f1176737636 -r 210785652131 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Mar 17 11:03:45 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Mar 17 11:07:50 2015 +0530
@@ -1444,6 +1444,7 @@
         p.pu[LUMA_8x16].satd  = x265_pixel_satd_8x16_avx2;
         p.pu[LUMA_8x8].satd   = x265_pixel_satd_8x8_avx2;
 
+        p.pu[LUMA_32x8].sad = x265_pixel_sad_32x8_avx2;
         p.pu[LUMA_32x32].sad = x265_pixel_sad_32x32_avx2;
         p.pu[LUMA_64x16].sad = x265_pixel_sad_64x16_avx2;
         p.pu[LUMA_64x32].sad = x265_pixel_sad_64x32_avx2;
diff -r 5f1176737636 -r 210785652131 source/common/x86/sad-a.asm
--- a/source/common/x86/sad-a.asm	Tue Mar 17 11:03:45 2015 +0530
+++ b/source/common/x86/sad-a.asm	Tue Mar 17 11:07:50 2015 +0530
@@ -3897,6 +3897,68 @@
     movq            [r6 + 8], xm1
     RET
 
+INIT_YMM avx2
+cglobal pixel_sad_32x8, 4,4,6
+    xorps           m0, m0
+    xorps           m5, m5
+
+    movu           m1, [r0]               ; row 0 of pix0
+    movu           m2, [r2]               ; row 0 of pix1
+    movu           m3, [r0 + r1]          ; row 1 of pix0
+    movu           m4, [r2 + r3]          ; row 1 of pix1
+
+    psadbw         m1, m2
+    psadbw         m3, m4
+    paddd          m0, m1
+    paddd          m5, m3
+
+    lea     r2,     [r2 + 2 * r3]
+    lea     r0,     [r0 + 2 * r1]
+
+    movu           m1, [r0]               ; row 2 of pix0
+    movu           m2, [r2]               ; row 2 of pix1
+    movu           m3, [r0 + r1]          ; row 3 of pix0
+    movu           m4, [r2 + r3]          ; row 3 of pix1
+
+    psadbw         m1, m2
+    psadbw         m3, m4
+    paddd          m0, m1
+    paddd          m5, m3
+
+    lea     r2,     [r2 + 2 * r3]
+    lea     r0,     [r0 + 2 * r1]
+
+    movu           m1, [r0]               ; row 4 of pix0
+    movu           m2, [r2]               ; row 4 of pix1
+    movu           m3, [r0 + r1]          ; row 5 of pix0
+    movu           m4, [r2 + r3]          ; row 5 of pix1
+
+    psadbw         m1, m2
+    psadbw         m3, m4
+    paddd          m0, m1
+    paddd          m5, m3
+
+    lea     r2,     [r2 + 2 * r3]
+    lea     r0,     [r0 + 2 * r1]
+
+    movu           m1, [r0]               ; row 6 of pix0
+    movu           m2, [r2]               ; row 6 of pix1
+    movu           m3, [r0 + r1]          ; row 7 of pix0
+    movu           m4, [r2 + r3]          ; row 7 of pix1
+
+    psadbw         m1, m2
+    psadbw         m3, m4
+    paddd          m0, m1
+    paddd          m5, m3
+
+    paddd          m0, m5
+    vextracti128   xm1, m0, 1
+    paddd          xm0, xm1
+    pshufd         xm1, xm0, 2
+    paddd          xm0,xm1
+    movd           eax, xm0
+    RET
+
 INIT_YMM avx2
 cglobal pixel_sad_32x32, 4,7,5
     xorps           m0, m0


More information about the x265-devel mailing list