[x265] [PATCH] asm: avx2 code for sad_x3[8x16] for 8bpp

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue Mar 10 08:21:07 CET 2015


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1425972058 -19800
# Node ID f50217c5971c36f942dc542f411ae9e33f47e402
# Parent  881ed7b0739f896a22f11b524aac6466e1972111
asm: avx2 code for sad_x3[8x16] for 8bpp

SSE3
sad_x3[ 8x16]  82.79x   540.02          44707.11

AVX2
sad_x3[ 8x16]  83.93x   525.21          44082.39

diff -r 881ed7b0739f -r f50217c5971c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Mar 10 12:40:45 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Mar 10 12:50:58 2015 +0530
@@ -1444,6 +1444,7 @@
 
         p.pu[LUMA_8x4].sad_x3 = x265_pixel_sad_x3_8x4_avx2;
         p.pu[LUMA_8x8].sad_x3 = x265_pixel_sad_x3_8x8_avx2;
+        p.pu[LUMA_8x16].sad_x3 = x265_pixel_sad_x3_8x16_avx2;
 
         p.pu[LUMA_16x8].sad_x4  = x265_pixel_sad_x4_16x8_avx2;
         p.pu[LUMA_16x12].sad_x4 = x265_pixel_sad_x4_16x12_avx2;
diff -r 881ed7b0739f -r f50217c5971c source/common/x86/sad-a.asm
--- a/source/common/x86/sad-a.asm	Tue Mar 10 12:40:45 2015 +0530
+++ b/source/common/x86/sad-a.asm	Tue Mar 10 12:50:58 2015 +0530
@@ -3809,4 +3809,46 @@
     movd            [r5 + 8], xm1
     RET
 
+INIT_YMM avx2
+cglobal pixel_sad_x3_8x16, 6,6,5
+    xorps           m0, m0
+    xorps           m1, m1
+
+    sub             r2, r1          ; rebase on pointer r1
+    sub             r3, r1
+%assign x 0
+%rep 8
+    ; row 0
+    vpbroadcastq   xm2, [r0 + 0 * FENC_STRIDE]
+    movq           xm3, [r1]
+    movhps         xm3, [r1 + r2]
+    movq           xm4, [r1 + r3]
+    psadbw         xm3, xm2
+    psadbw         xm4, xm2
+    paddd          xm0, xm3
+    paddd          xm1, xm4
+    add             r1, r4
+
+    ; row 1
+    vpbroadcastq   xm2, [r0 + 1 * FENC_STRIDE]
+    movq           xm3, [r1]
+    movhps         xm3, [r1 + r2]
+    movq           xm4, [r1 + r3]
+    psadbw         xm3, xm2
+    psadbw         xm4, xm2
+    paddd          xm0, xm3
+    paddd          xm1, xm4
+
+%assign x x+1
+  %if x < 8
+    add             r1, r4
+    add             r0, 2 * FENC_STRIDE
+  %endif
+%endrep
+
+    pshufd          xm0, xm0, q0020
+    movq            [r5 + 0], xm0
+    movd            [r5 + 8], xm1
+    RET
+
 %endif


More information about the x265-devel mailing list