[x265] [PATCH] asm: sse4 8bpp code for chroma_p2s[2xN]

rajesh at multicorewareinc.com rajesh at multicorewareinc.com
Thu Apr 9 15:37:43 CEST 2015


# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1428586639 -19800
#      Thu Apr 09 19:07:19 2015 +0530
# Node ID 4a9556d2152e9e6a63fcf2a820a4a194645e8651
# Parent  7f2d92923de47e7e40f04ff27ed70074b0dca9d3
asm: sse4 8bpp code for chroma_p2s[2xN]

     chroma_p2s[2x4][i420](1.54x), chroma_p2s[2x8][i420](1.68x),
     chroma_p2s[2x8][i422](1.64x), chroma_p2s[2x16][i422](1.73x)

diff -r 7f2d92923de4 -r 4a9556d2152e source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Wed Apr 08 14:51:00 2015 -0500
+++ b/source/common/x86/asm-primitives.cpp	Thu Apr 09 19:07:19 2015 +0530
@@ -1438,11 +1438,15 @@
         p.pu[LUMA_4x8].convert_p2s = x265_filterPixelToShort_4x8_sse4;
         p.pu[LUMA_4x16].convert_p2s = x265_filterPixelToShort_4x16_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_4x2].p2s = x265_filterPixelToShort_4x2_sse4;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].p2s = x265_filterPixelToShort_4x4_sse4;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].p2s = x265_filterPixelToShort_4x8_sse4;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].p2s = x265_filterPixelToShort_4x16_sse4;
         p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].p2s = x265_filterPixelToShort_6x8_sse4;
+        p.chroma[X265_CSP_I422].pu[CHROMA_422_2x8].p2s = x265_filterPixelToShort_2x8_sse4;
+        p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].p2s = x265_filterPixelToShort_2x16_sse4;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_4x4].p2s = x265_filterPixelToShort_4x4_sse4;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_4x8].p2s = x265_filterPixelToShort_4x8_sse4;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_4x16].p2s = x265_filterPixelToShort_4x16_sse4;
diff -r 7f2d92923de4 -r 4a9556d2152e source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed Apr 08 14:51:00 2015 -0500
+++ b/source/common/x86/ipfilter8.asm	Thu Apr 09 19:07:19 2015 +0530
@@ -7741,6 +7741,37 @@
 FILTER_V4_W16n_H2 48, 64
 FILTER_V4_W16n_H2 64, 16
 
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, int16_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_2xN 1
+INIT_XMM sse4
+cglobal filterPixelToShort_2x%1, 3, 4, 3
+    mov         r3d, r3m
+    add         r3d, r3d
+
+    ; load constant
+    mova        m1, [pb_128]
+    mova        m2, [tab_c_64_n64]
+
+%rep %1/2
+    movd        m0, [r0]
+    pinsrd      m0, [r0 + r1], 1
+    punpcklbw   m0, m1
+    pmaddubsw   m0, m2
+
+    movd        [r2 + r3 * 0], m0
+    pextrd      [r2 + r3 * 1], m0, 2
+
+    lea         r0, [r0 + r1 * 2]
+    lea         r2, [r2 + r3 * 2]
+%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, int16_t dstStride)
 ;-----------------------------------------------------------------------------
diff -r 7f2d92923de4 -r 4a9556d2152e source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Wed Apr 08 14:51:00 2015 -0500
+++ b/source/common/x86/ipfilter8.h	Thu Apr 09 19:07:19 2015 +0530
@@ -574,6 +574,8 @@
     void x265_filterPixelToShort_ ## W ## x ## H ## cpu(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
 
 #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(4, 2, cpu); \
     SETUP_CHROMA_P2S_FUNC_DEF(6, 8, cpu); 
 
@@ -582,6 +584,8 @@
     SETUP_CHROMA_P2S_FUNC_DEF(8, 6, cpu);
 
 #define CHROMA_422_P2S_FILTERS_SSE4(cpu) \
+    SETUP_CHROMA_P2S_FUNC_DEF(2, 8, cpu); \
+    SETUP_CHROMA_P2S_FUNC_DEF(2, 16, cpu); \
     SETUP_CHROMA_P2S_FUNC_DEF(6, 16, cpu); \
     SETUP_CHROMA_P2S_FUNC_DEF(4, 32, cpu);
 


More information about the x265-devel mailing list