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

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


# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1429163674 -19800
#      Thu Apr 16 11:24:34 2015 +0530
# Node ID 7dec3ef187cbf3c1fd5ebfdce1172dc577e11dfe
# Parent  96cc21821c57e15fbb72d690745c4ceb28e6aca5
asm: sse4 10bit code for chroma_p2s[2xN] for i420, i422

     chroma_p2s[i420][2x4](1.71x), chroma_p2s[i420][2x8](1.99x),
     chroma_p2s[i422][2x16](2.14x)

diff -r 96cc21821c57 -r 7dec3ef187cb source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Apr 16 10:53:33 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Apr 16 11:24:34 2015 +0530
@@ -1018,7 +1018,10 @@
         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_2x4].p2s = x265_filterPixelToShort_2x4_sse4;
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].p2s = x265_filterPixelToShort_2x8_sse4;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].p2s = x265_filterPixelToShort_6x8_sse4;
+        p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].p2s = x265_filterPixelToShort_2x16_sse4;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_6x16].p2s = x265_filterPixelToShort_6x16_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
diff -r 96cc21821c57 -r 7dec3ef187cb source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm	Thu Apr 16 10:53:33 2015 +0530
+++ b/source/common/x86/ipfilter16.asm	Thu Apr 16 11:24:34 2015 +0530
@@ -5526,6 +5526,47 @@
     FILTER_VER_LUMA_SS 64, 16
     FILTER_VER_LUMA_SS 16, 64
 
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_2xN 1
+INIT_XMM sse4
+cglobal filterPixelToShort_2x%1, 3, 6, 2
+    add        r1d, r1d
+    mov        r3d, r3m
+    add        r3d, r3d
+    lea        r4, [r1 * 3]
+    lea        r5, [r3 * 3]
+
+    ; load constant
+    mova       m1, [pw_2000]
+
+%rep %1/4
+    movd       m0, [r0]
+    movhps     m0, [r0 + r1]
+    psllw      m0, 4
+    psubw      m0, m1
+
+    movd       [r2 + r3 * 0], m0
+    pextrd     [r2 + r3 * 1], m0, 2
+
+    movd       m0, [r0 + r1 * 2]
+    movhps     m0, [r0 + r4]
+    psllw      m0, 4
+    psubw      m0, m1
+
+    movd       [r2 + r3 * 2], m0
+    pextrd     [r2 + r5], m0, 2
+
+    lea        r0, [r0 + r1 * 4]
+    lea        r2, [r2 + r3 * 4]
+%endrep
+    RET
+%endmacro
+P2S_H_2xN 4
+P2S_H_2xN 8
+P2S_H_2xN 16
+
 ;-----------------------------------------------------------------------------
 ; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
 ;-----------------------------------------------------------------------------
diff -r 96cc21821c57 -r 7dec3ef187cb source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Thu Apr 16 10:53:33 2015 +0530
+++ b/source/common/x86/ipfilter8.h	Thu Apr 16 11:24:34 2015 +0530
@@ -324,9 +324,12 @@
     SETUP_CHROMA_P2S_FUNC_DEF(8, 6, cpu);
 
 #define CHROMA_420_P2S_FILTERS_SSE4(cpu) \
+    SETUP_CHROMA_P2S_FUNC_DEF(2, 4, cpu); \
+    SETUP_CHROMA_P2S_FUNC_DEF(2, 8, cpu); \
     SETUP_CHROMA_P2S_FUNC_DEF(6, 8, cpu);
 
 #define CHROMA_422_P2S_FILTERS_SSE4(cpu) \
+    SETUP_CHROMA_P2S_FUNC_DEF(2, 16, cpu) \
     SETUP_CHROMA_P2S_FUNC_DEF(6, 16, cpu);
 
 CHROMA_420_VERT_FILTERS(_sse2);


More information about the x265-devel mailing list