[x265] [PATCH 4 of 4] asm: filter_vsp[2x4], filter_vss[2x4] in avx2: 292c->189c, 248c->184c

Divya Manivannan divya at multicorewareinc.com
Mon Mar 16 05:54:53 CET 2015


# HG changeset patch
# User Divya Manivannan <divya at multicorewareinc.com>
# Date 1426481503 -19800
#      Mon Mar 16 10:21:43 2015 +0530
# Node ID 3e0e29b5c90babc8f3b45ff2d00dfe1c5adf059d
# Parent  90e0a1ae833dfa0e01628b490eafa98bf138440b
asm: filter_vsp[2x4], filter_vss[2x4] in avx2: 292c->189c, 248c->184c

diff -r 90e0a1ae833d -r 3e0e29b5c90b source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Mon Mar 16 10:17:10 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Mon Mar 16 10:21:43 2015 +0530
@@ -1653,6 +1653,7 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].filter_vsp = x265_interp_4tap_vert_sp_8x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].filter_vsp = x265_interp_4tap_vert_sp_16x16_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].filter_vsp = x265_interp_4tap_vert_sp_32x32_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_vsp = x265_interp_4tap_vert_sp_2x4_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vsp = x265_interp_4tap_vert_sp_4x2_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].filter_vsp = x265_interp_4tap_vert_sp_4x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].filter_vsp = x265_interp_4tap_vert_sp_4x16_avx2;
@@ -1664,6 +1665,7 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].filter_vss = x265_interp_4tap_vert_ss_8x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].filter_vss = x265_interp_4tap_vert_ss_16x16_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].filter_vss = x265_interp_4tap_vert_ss_32x32_avx2;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].filter_vss = x265_interp_4tap_vert_ss_2x4_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].filter_vss = x265_interp_4tap_vert_ss_4x2_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].filter_vss = x265_interp_4tap_vert_ss_4x8_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].filter_vss = x265_interp_4tap_vert_ss_4x16_avx2;
diff -r 90e0a1ae833d -r 3e0e29b5c90b source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Mon Mar 16 10:17:10 2015 +0530
+++ b/source/common/x86/ipfilter8.asm	Mon Mar 16 10:21:43 2015 +0530
@@ -13152,6 +13152,76 @@
 FILTER_VER_CHROMA_S_AVX2_4x2 sp
 FILTER_VER_CHROMA_S_AVX2_4x2 ss
 
+%macro FILTER_VER_CHROMA_S_AVX2_2x4 1
+INIT_YMM avx2
+cglobal interp_4tap_vert_%1_2x4, 4, 6, 6
+    mov             r4d, r4m
+    shl             r4d, 6
+    add             r1d, r1d
+    sub             r0, r1
+
+%ifdef PIC
+    lea             r5, [pw_ChromaCoeffV]
+    add             r5, r4
+%else
+    lea             r5, [pw_ChromaCoeffV + r4]
+%endif
+
+    lea             r4, [r1 * 3]
+%ifidn %1,sp
+    mova            m5, [pd_526336]
+%else
+    add             r3d, r3d
+%endif
+    movd            xm0, [r0]
+    movd            xm1, [r0 + r1]
+    punpcklwd       xm0, xm1
+    movd            xm2, [r0 + r1 * 2]
+    punpcklwd       xm1, xm2
+    punpcklqdq      xm0, xm1                        ; m0 = [2 1 1 0]
+    movd            xm3, [r0 + r4]
+    punpcklwd       xm2, xm3
+    lea             r0, [r0 + 4 * r1]
+    movd            xm4, [r0]
+    punpcklwd       xm3, xm4
+    punpcklqdq      xm2, xm3                        ; m2 = [4 3 3 2]
+    vinserti128     m0, m0, xm2, 1                  ; m0 = [4 3 3 2 2 1 1 0]
+    movd            xm1, [r0 + r1]
+    punpcklwd       xm4, xm1
+    movd            xm3, [r0 + r1 * 2]
+    punpcklwd       xm1, xm3
+    punpcklqdq      xm4, xm1                        ; m4 = [6 5 5 4]
+    vinserti128     m2, m2, xm4, 1                  ; m2 = [6 5 5 4 4 3 3 2]
+    pmaddwd         m0, [r5]
+    pmaddwd         m2, [r5 + 1 * mmsize]
+    paddd           m0, m2
+%ifidn %1,sp
+    paddd           m0, m5
+    psrad           m0, 12
+%else
+    psrad           m0, 6
+%endif
+    vextracti128    xm1, m0, 1
+    packssdw        xm0, xm1
+    lea             r4, [r3 * 3]
+%ifidn %1,sp
+    packuswb        xm0, xm0
+    pextrw          [r2], xm0, 0
+    pextrw          [r2 + r3], xm0, 1
+    pextrw          [r2 + 2 * r3], xm0, 2
+    pextrw          [r2 + r4], xm0, 3
+%else
+    movd            [r2], xm0
+    pextrd          [r2 + r3], xm0, 1
+    pextrd          [r2 + 2 * r3], xm0, 2
+    pextrd          [r2 + r4], xm0, 3
+%endif
+    RET
+%endmacro
+
+FILTER_VER_CHROMA_S_AVX2_2x4 sp
+FILTER_VER_CHROMA_S_AVX2_2x4 ss
+
 %macro FILTER_VER_CHROMA_S_AVX2_8x8 1
 INIT_YMM avx2
 cglobal interp_4tap_vert_%1_8x8, 4, 6, 8
diff -r 90e0a1ae833d -r 3e0e29b5c90b source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Mon Mar 16 10:17:10 2015 +0530
+++ b/source/common/x86/ipfilter8.h	Mon Mar 16 10:21:43 2015 +0530
@@ -581,6 +581,7 @@
 CHROMA_420_SS_FILTERS(_sse2);
 CHROMA_420_SS_FILTERS_SSE4(_sse4);
 CHROMA_420_SS_FILTERS(_avx2);
+CHROMA_420_SS_FILTERS_SSE4(_avx2);
 
 CHROMA_422_FILTERS(_sse4);
 CHROMA_422_FILTERS(_avx2);


More information about the x265-devel mailing list