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

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue Mar 10 07:58:57 CET 2015


# HG changeset patch
# User Sumalatha Polureddy<sumalatha at multicorewareinc.com>
# Date 1425970730 -19800
# Node ID 71fea29034b0de0d3361069628ddb6f933391851
# Parent  726fe4088f31710af174c18b1e26fdc759efb300
asm: avx2 code for sad_x3[8x4] for 8bpp

SSE3
sad_x3[  8x4]  48.74x   234.10          11409.16

AVX2
sad_x3[  8x4]  50.47x   226.70          11442.29

diff -r 726fe4088f31 -r 71fea29034b0 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Mar 09 19:21:25 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Tue Mar 10 12:28:50 2015 +0530
@@ -1442,6 +1442,8 @@
         p.pu[LUMA_8x16].satd  = x265_pixel_satd_8x16_avx2;
         p.pu[LUMA_8x8].satd   = x265_pixel_satd_8x8_avx2;
 
+        p.pu[LUMA_8x4].sad_x3 = x265_pixel_sad_x3_8x4_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;
         p.pu[LUMA_16x16].sad_x4 = x265_pixel_sad_x4_16x16_avx2;
diff -r 726fe4088f31 -r 71fea29034b0 source/common/x86/sad-a.asm
--- a/source/common/x86/sad-a.asm	Mon Mar 09 19:21:25 2015 -0500
+++ b/source/common/x86/sad-a.asm	Tue Mar 10 12:28:50 2015 +0530
@@ -3710,3 +3710,60 @@
 SADX34_CACHELINE_FUNC 16, 16, 64, sse2, ssse3, ssse3
 SADX34_CACHELINE_FUNC 16,  8, 64, sse2, ssse3, ssse3
 
+%if HIGH_BIT_DEPTH==0
+INIT_YMM avx2
+cglobal pixel_sad_x3_8x4, 6,6,5
+    xorps           m0, m0
+    xorps           m1, m1
+
+    sub             r2, r1          ; rebase on pointer r1
+    sub             r3, r1
+
+    ; 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
+    add             r1, r4
+
+    ; row 2
+    vpbroadcastq   xm2, [r0 + 2 * 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 3
+    vpbroadcastq   xm2, [r0 + 3 * 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
+
+    pshufd          xm0, xm0, q0020
+    movq            [r5 + 0], xm0
+    movd            [r5 + 8], xm1
+    RET
+%endif


More information about the x265-devel mailing list