[x265] [PATCH] asm: sse4 10bit code for chroma_p2s[6xN] for i420, i422

rajesh at multicorewareinc.com rajesh at multicorewareinc.com
Thu Apr 16 08:18:37 CEST 2015


# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1429161813 -19800
#      Thu Apr 16 10:53:33 2015 +0530
# Node ID 96cc21821c57e15fbb72d690745c4ceb28e6aca5
# Parent  fbfcf28a6485f61ea5ed707e4ca04b9e348f29e2
asm: sse4 10bit code for chroma_p2s[6xN] for i420, i422

     chroma_p2s[i420][6x8](2.89x), chroma_p2s[i422][6x16](3.37x)

diff -r fbfcf28a6485 -r 96cc21821c57 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Apr 15 19:16:10 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Apr 16 10:53:33 2015 +0530
@@ -1017,6 +1017,9 @@
         ALL_LUMA_TU_S(copy_cnt, copy_cnt_, sse4);
         ALL_LUMA_CU(psy_cost_pp, psyCost_pp, sse4);
         ALL_LUMA_CU(psy_cost_ss, psyCost_ss, sse4);
+
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].p2s = x265_filterPixelToShort_6x8_sse4;
+        p.chroma[X265_CSP_I422].pu[CHROMA_422_6x16].p2s = x265_filterPixelToShort_6x16_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
     {
diff -r fbfcf28a6485 -r 96cc21821c57 source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm	Wed Apr 15 19:16:10 2015 +0530
+++ b/source/common/x86/ipfilter16.asm	Thu Apr 16 10:53:33 2015 +0530
@@ -5587,6 +5587,59 @@
 ;-----------------------------------------------------------------------------
 ; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
 ;-----------------------------------------------------------------------------
+%macro P2S_H_6xN 1
+INIT_XMM sse4
+cglobal filterPixelToShort_6x%1, 3, 7, 3
+    add        r1d, r1d
+    mov        r3d, r3m
+    add        r3d, r3d
+    lea        r4, [r3 * 3]
+    lea        r5, [r1 * 3]
+
+    ; load height
+    mov        r6d, %1/4
+
+    ; load constant
+    mova       m2, [pw_2000]
+
+.loop
+    movu       m0, [r0]
+    movu       m1, [r0 + r1]
+    psllw      m0, 4
+    psubw      m0, m2
+    psllw      m1, 4
+    psubw      m1, m2
+
+    movh       [r2 + r3 * 0], m0
+    pextrd     [r2 + r3 * 0 + 8], m0, 2
+    movh       [r2 + r3 * 1], m1
+    pextrd     [r2 + r3 * 1 + 8], m1, 2
+
+    movu       m0, [r0 + r1 * 2]
+    movu       m1, [r0 + r5]
+    psllw      m0, 4
+    psubw      m0, m2
+    psllw      m1, 4
+    psubw      m1, m2
+
+    movh       [r2 + r3 * 2], m0
+    pextrd     [r2 + r3 * 2 + 8], m0, 2
+    movh       [r2 + r4], m1
+    pextrd     [r2 + r4 + 8], m1, 2
+
+    lea        r0, [r0 + r1 * 4]
+    lea        r2, [r2 + r3 * 4]
+
+    dec        r6d
+    jnz        .loop
+    RET
+%endmacro
+P2S_H_6xN 8
+P2S_H_6xN 16
+
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
+;-----------------------------------------------------------------------------
 %macro P2S_H_8xN 1
 INIT_XMM ssse3
 cglobal filterPixelToShort_8x%1, 3, 7, 2
diff -r fbfcf28a6485 -r 96cc21821c57 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Wed Apr 15 19:16:10 2015 +0530
+++ b/source/common/x86/ipfilter8.h	Thu Apr 16 10:53:33 2015 +0530
@@ -323,14 +323,22 @@
     SETUP_CHROMA_P2S_FUNC_DEF(8, 2, cpu); \
     SETUP_CHROMA_P2S_FUNC_DEF(8, 6, cpu);
 
+#define CHROMA_420_P2S_FILTERS_SSE4(cpu) \
+    SETUP_CHROMA_P2S_FUNC_DEF(6, 8, cpu);
+
+#define CHROMA_422_P2S_FILTERS_SSE4(cpu) \
+    SETUP_CHROMA_P2S_FUNC_DEF(6, 16, cpu);
+
 CHROMA_420_VERT_FILTERS(_sse2);
 CHROMA_420_HORIZ_FILTERS(_sse4);
 CHROMA_420_VERT_FILTERS_SSE4(_sse4);
 CHROMA_420_P2S_FILTERS_SSSE3(_ssse3);
+CHROMA_420_P2S_FILTERS_SSE4(_sse4);
 
 CHROMA_422_VERT_FILTERS(_sse2);
 CHROMA_422_HORIZ_FILTERS(_sse4);
 CHROMA_422_VERT_FILTERS_SSE4(_sse4);
+CHROMA_422_P2S_FILTERS_SSE4(_sse4);
 
 CHROMA_444_VERT_FILTERS(_sse2);
 CHROMA_444_HORIZ_FILTERS(_sse4);


More information about the x265-devel mailing list