[x265] [PATCH] asm: luma_vpp[16x16] in avx2: improve 2141c->1488c

Divya Manivannan divya at multicorewareinc.com
Mon Nov 17 12:14:55 CET 2014


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1416222868 -19800
#      Mon Nov 17 16:44:28 2014 +0530
# Node ID 95571420e32c02f51d41fc45d286a2619a5052e5
# Parent  5fec38f8c75606ddf4d5b7c9244dfd373892af5d
asm: luma_vpp[16x16] in avx2: improve 2141c->1488c

diff -r 5fec38f8c756 -r 95571420e32c source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Nov 17 14:48:11 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Nov 17 16:44:28 2014 +0530
@@ -1801,6 +1801,7 @@
         p.luma_hpp[LUMA_4x4] = x265_interp_8tap_horiz_pp_4x4_avx2;
         p.luma_vpp[LUMA_4x4] = x265_interp_8tap_vert_pp_4x4_avx2;
         p.luma_vpp[LUMA_8x8] = x265_interp_8tap_vert_pp_8x8_avx2;
+        p.luma_vpp[LUMA_16x16] = x265_interp_8tap_vert_pp_16x16_avx2;
     }
 #endif // if HIGH_BIT_DEPTH
 }
diff -r 5fec38f8c756 -r 95571420e32c source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Mon Nov 17 14:48:11 2014 +0530
+++ b/source/common/x86/ipfilter8.asm	Mon Nov 17 16:44:28 2014 +0530
@@ -3696,7 +3696,7 @@
 %endmacro
 
 INIT_YMM avx2
-cglobal interp_8tap_vert_pp_8x8, 4,7,7
+cglobal interp_8tap_vert_pp_8x8, 4, 7, 7
     mov             r4d, r4m
     shl             r4d, 7
     lea             r5, [r1 * 3]
@@ -3875,6 +3875,57 @@
     RET
 %endmacro
 
+INIT_YMM avx2
+cglobal interp_8tap_vert_pp_16x16, 4, 7, 7, 0-gprsize
+    mov             r4d, r4m
+    shl             r4d, 7
+    lea             r5, [r1 * 3]
+    sub             r0, r5
+
+%ifdef PIC
+    lea             r5, [tab_LumaCoeffVer_32]
+    lea             r5, [r5 + r4]
+%else
+    lea             r5, [tab_LumaCoeffVer_32 + r4]
+%endif
+
+    mov             dword [rsp], 2
+
+.loopH:
+    mov             r4d, 2
+.loopW:
+    PROCESS_LUMA_AVX2_W8_8R
+    lea             r6, [r2]
+    pmulhrsw        m5, [pw_512]                    ; m5 = word: row 0, row 1
+    pmulhrsw        m2, [pw_512]                    ; m2 = word: row 2, row 3
+    pmulhrsw        m1, [pw_512]                    ; m1 = word: row 4, row 5
+    pmulhrsw        m4, [pw_512]                    ; m4 = word: row 6, row 7
+    packuswb        m5, m2
+    packuswb        m1, m4
+    vextracti128    xm2, m5, 1
+    vextracti128    xm4, m1, 1
+    movq            [r6], xm5
+    movq            [r6 + r3], xm2
+    lea             r6, [r6 + r3 * 2]
+    movhps          [r6], xm5
+    movhps          [r6 + r3], xm2
+    lea             r6, [r6 + r3 * 2]
+    movq            [r6], xm1
+    movq            [r6 + r3], xm4
+    lea             r6, [r6 + r3 * 2]
+    movhps          [r6], xm1
+    movhps          [r6 + r3], xm4
+
+    add             r0, 8
+    add             r2, 8
+    dec             r4d
+    jnz             .loopW
+    lea             r2, [r2 + r3 * 8 - 16]
+    lea             r0, [r0 + r1 * 8 - 16]
+    dec             dword [rsp]
+    jnz             .loopH
+    RET
+
 ;-------------------------------------------------------------------------------------------------------------
 ; void interp_8tap_vert_pp_12x16(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
 ;-------------------------------------------------------------------------------------------------------------


More information about the x265-devel mailing list