[x265] [PATCH] asm: ssse3 10bit code for convert_p2s[8xN]

rajesh at multicorewareinc.com rajesh at multicorewareinc.com
Tue Apr 14 15:59:36 CEST 2015


# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1429016282 -19800
#      Tue Apr 14 18:28:02 2015 +0530
# Node ID ff6353a2def10c00f3d9d1ff76f0682dcc9b450e
# Parent  cabc6ea8231ed3f530d9ffa7e4908dd31a582f5e
asm: ssse3 10bit code for convert_p2s[8xN]

     convert_p2s[8x4](4.06x), convert_p2s[8x8](5.07x), convert_p2s[8x16](6.00x),
     convert_p2s[8x32](6.42x)

diff -r cabc6ea8231e -r ff6353a2def1 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Apr 14 18:10:45 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Apr 14 18:28:02 2015 +0530
@@ -952,6 +952,10 @@
         p.pu[LUMA_4x4].convert_p2s = x265_filterPixelToShort_4x4_ssse3;
         p.pu[LUMA_4x8].convert_p2s = x265_filterPixelToShort_4x8_ssse3;
         p.pu[LUMA_4x16].convert_p2s = x265_filterPixelToShort_4x16_ssse3;
+        p.pu[LUMA_8x4].convert_p2s = x265_filterPixelToShort_8x4_ssse3;
+        p.pu[LUMA_8x8].convert_p2s = x265_filterPixelToShort_8x8_ssse3;
+        p.pu[LUMA_8x16].convert_p2s = x265_filterPixelToShort_8x16_ssse3;
+        p.pu[LUMA_8x32].convert_p2s = x265_filterPixelToShort_8x32_ssse3;
     }
     if (cpuMask & X265_CPU_SSE4)
     {
diff -r cabc6ea8231e -r ff6353a2def1 source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm	Tue Apr 14 18:10:45 2015 +0530
+++ b/source/common/x86/ipfilter16.asm	Tue Apr 14 18:28:02 2015 +0530
@@ -5565,3 +5565,56 @@
 P2S_H_4xN 8
 P2S_H_4xN 16
 P2S_H_4xN 32
+
+;-----------------------------------------------------------------------------
+; 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
+    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       m1, [pw_2000]
+
+.loop
+    movu       m0, [r0]
+    psllw      m0, 4
+    psubw      m0, m1
+    movu       [r2 + r3 * 0], m0
+
+    movu       m0, [r0 + r1]
+    psllw      m0, 4
+    psubw      m0, m1
+    movu       [r2 + r3 * 1], m0
+
+    movu       m0, [r0 + r1 * 2]
+    psllw      m0, 4
+    psubw      m0, m1
+    movu       [r2 + r3 * 2], m0
+
+    movu       m0, [r0 + r5]
+    psllw      m0, 4
+    psubw      m0, m1
+    movu       [r2 + r4], m0
+
+    lea        r0, [r0 + r1 * 4]
+    lea        r2, [r2 + r3 * 4]
+
+    dec        r6d
+    jnz        .loop
+    RET
+%endmacro
+P2S_H_8xN 8
+P2S_H_8xN 4
+P2S_H_8xN 16
+P2S_H_8xN 32
+P2S_H_8xN 12
+P2S_H_8xN 64
diff -r cabc6ea8231e -r ff6353a2def1 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Tue Apr 14 18:10:45 2015 +0530
+++ b/source/common/x86/ipfilter8.h	Tue Apr 14 18:28:02 2015 +0530
@@ -292,6 +292,10 @@
 void x265_filterPixelToShort_4x4_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
 void x265_filterPixelToShort_4x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
 void x265_filterPixelToShort_4x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_8x4_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_8x8_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_8x16_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_8x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
 
 CHROMA_420_VERT_FILTERS(_sse2);
 CHROMA_420_HORIZ_FILTERS(_sse4);


More information about the x265-devel mailing list