[x265] [PATCH] asm: avx2 10bit code for chroma_hpp[64xN] for i444

rajesh at multicorewareinc.com rajesh at multicorewareinc.com
Thu May 28 12:24:26 CEST 2015


# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1432806848 -19800
#      Thu May 28 15:24:08 2015 +0530
# Node ID a0df6b36abaaa849d733febb589416cead40d5b8
# Parent  a9d27027fd7702f328544eabc285120b77b4129c
asm: avx2 10bit code for chroma_hpp[64xN] for i444

avx2:
chroma_hpp[64x16]       5.71x    10924.23        62326.83
chroma_hpp[64x32]       6.64x    21404.65        142148.67
chroma_hpp[64x48]       5.85x    31890.50        186660.69
chroma_hpp[64x64]       6.69x    42011.69        280933.78

sse4:
chroma_hpp[64x16]       4.67x    13474.13        62858.80
chroma_hpp[64x32]       3.91x    70028.90        273665.50
chroma_hpp[64x48]       4.94x    37678.32        186258.64
chroma_hpp[64x64]       5.79x    49671.69        287537.69

diff -r a9d27027fd77 -r a0df6b36abaa source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu May 28 15:11:28 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu May 28 15:24:08 2015 +0530
@@ -1545,6 +1545,10 @@
         p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].filter_hpp = x265_interp_4tap_horiz_pp_32x32_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_12x16].filter_hpp = x265_interp_4tap_horiz_pp_12x16_avx2;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].filter_hpp = x265_interp_4tap_horiz_pp_24x32_avx2;
+        p.chroma[X265_CSP_I444].pu[LUMA_64x16].filter_hpp = x265_interp_4tap_horiz_pp_64x16_avx2;
+        p.chroma[X265_CSP_I444].pu[LUMA_64x32].filter_hpp = x265_interp_4tap_horiz_pp_64x32_avx2;
+        p.chroma[X265_CSP_I444].pu[LUMA_64x48].filter_hpp = x265_interp_4tap_horiz_pp_64x48_avx2;
+        p.chroma[X265_CSP_I444].pu[LUMA_64x64].filter_hpp = x265_interp_4tap_horiz_pp_64x64_avx2;
 
         if (cpuMask & X265_CPU_BMI2)
             p.scanPosLast = x265_scanPosLast_avx2_bmi2;
diff -r a9d27027fd77 -r a0df6b36abaa source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm	Thu May 28 15:11:28 2015 +0530
+++ b/source/common/x86/ipfilter16.asm	Thu May 28 15:24:08 2015 +0530
@@ -2884,6 +2884,75 @@
 IPFILTER_CHROMA_avx2_24xN 32
 IPFILTER_CHROMA_avx2_24xN 64
 
+;-------------------------------------------------------------------------------------------------------------
+; void interp_4tap_horiz_pp(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx
+;-------------------------------------------------------------------------------------------------------------
+INIT_YMM avx2
+%macro IPFILTER_CHROMA_avx2_64xN 1
+%if ARCH_X86_64
+cglobal interp_4tap_horiz_pp_64x%1, 5,6,9
+    add             r1d, r1d
+    add             r3d, r3d
+    sub             r0, 2
+    mov             r4d, r4m
+%ifdef PIC
+    lea             r5, [tab_ChromaCoeff]
+    vpbroadcastq    m0, [r5 + r4 * 8]
+%else
+    vpbroadcastq    m0, [tab_ChromaCoeff + r4 * 8]
+%endif
+    mova            m1, [interp8_hpp_shuf]
+    vpbroadcastd    m2, [pd_32]
+    pxor            m5, m5
+    mova            m6, [idct8_shuf2]
+    mova            m7, [pw_pixel_max]
+
+    mov             r6d, %1
+.loop:
+%assign x 0
+%rep 4
+    vbroadcasti128  m3, [r0 + x]
+    vbroadcasti128  m4, [r0 + 8 + x]
+    pshufb          m3, m1
+    pshufb          m4, m1
+
+    pmaddwd         m3, m0
+    pmaddwd         m4, m0
+    phaddd          m3, m4
+    paddd           m3, m2
+    psrad           m3, 6
+
+    vbroadcasti128  m4, [r0 + 16 + x]
+    vbroadcasti128  m8, [r0 + 24 + x]
+    pshufb          m4, m1
+    pshufb          m8, m1
+
+    pmaddwd         m4, m0
+    pmaddwd         m8, m0
+    phaddd          m4, m8
+    paddd           m4, m2
+    psrad           m4, 6
+
+    packusdw        m3, m4
+    vpermq          m3, m3, q3120
+    pshufb          m3, m6
+    CLIPW           m3, m5, m7
+    movu            [r2 + x], m3
+    %assign x x+32
+    %endrep
+
+    add             r0, r1
+    add             r2, r3
+    dec             r6d
+    jnz             .loop
+    RET
+%endif
+%endmacro
+IPFILTER_CHROMA_avx2_64xN 16
+IPFILTER_CHROMA_avx2_64xN 32
+IPFILTER_CHROMA_avx2_64xN 48
+IPFILTER_CHROMA_avx2_64xN 64
+
 ;-----------------------------------------------------------------------------------------------------------------
 ; void interp_4tap_vert_%3_%1x%2(int16_t *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride, int coeffIdx)
 ;-----------------------------------------------------------------------------------------------------------------
diff -r a9d27027fd77 -r a0df6b36abaa source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Thu May 28 15:11:28 2015 +0530
+++ b/source/common/x86/ipfilter8.h	Thu May 28 15:24:08 2015 +0530
@@ -402,6 +402,7 @@
 CHROMA_444_VERT_FILTERS(_sse2);
 CHROMA_444_HORIZ_FILTERS(_sse4);
 CHROMA_420_HORIZ_FILTERS(_avx2);
+CHROMA_444_HORIZ_FILTERS(_avx2);
 
 #undef CHROMA_420_VERT_FILTERS_SSE4
 #undef CHROMA_420_VERT_FILTERS


More information about the x265-devel mailing list