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

rajesh at multicorewareinc.com rajesh at multicorewareinc.com
Tue Apr 14 16:00:53 CEST 2015


# HG changeset patch
# User Rajesh Paulraj<rajesh at multicorewareinc.com>
# Date 1429019326 -19800
#      Tue Apr 14 19:18:46 2015 +0530
# Node ID 30b44e2ddf5983289b12ee379d2b1b87a187ebed
# Parent  ecc15210425c2430a184c5647b0a97cdd2a3e597
asm: ssse3 10bit code for convert_p2s[24xN]

     convert_p2s[24x32](14.57x)

diff -r ecc15210425c -r 30b44e2ddf59 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue Apr 14 19:05:49 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue Apr 14 19:18:46 2015 +0530
@@ -971,6 +971,7 @@
         p.pu[LUMA_64x32].convert_p2s = x265_filterPixelToShort_64x32_ssse3;
         p.pu[LUMA_64x48].convert_p2s = x265_filterPixelToShort_64x48_ssse3;
         p.pu[LUMA_64x64].convert_p2s = x265_filterPixelToShort_64x64_ssse3;
+        p.pu[LUMA_24x32].convert_p2s = x265_filterPixelToShort_24x32_ssse3;
     }
     if (cpuMask & X265_CPU_SSE4)
     {
diff -r ecc15210425c -r 30b44e2ddf59 source/common/x86/ipfilter16.asm
--- a/source/common/x86/ipfilter16.asm	Tue Apr 14 19:05:49 2015 +0530
+++ b/source/common/x86/ipfilter16.asm	Tue Apr 14 19:18:46 2015 +0530
@@ -5972,3 +5972,86 @@
 P2S_H_64xN 16
 P2S_H_64xN 32
 P2S_H_64xN 48
+
+;-----------------------------------------------------------------------------
+; void filterPixelToShort(pixel *src, intptr_t srcStride, int16_t *dst, intptr_t dstStride)
+;-----------------------------------------------------------------------------
+%macro P2S_H_24xN 1
+INIT_XMM ssse3
+cglobal filterPixelToShort_24x%1, 3, 7, 5
+    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       m4, [pw_2000]
+
+.loop
+    movu       m0, [r0]
+    movu       m1, [r0 + r1]
+    movu       m2, [r0 + r1 * 2]
+    movu       m3, [r0 + r5]
+    psllw      m0, 4
+    psubw      m0, m4
+    psllw      m1, 4
+    psubw      m1, m4
+    psllw      m2, 4
+    psubw      m2, m4
+    psllw      m3, 4
+    psubw      m3, m4
+
+    movu       [r2 + r3 * 0], m0
+    movu       [r2 + r3 * 1], m1
+    movu       [r2 + r3 * 2], m2
+    movu       [r2 + r4], m3
+
+    movu       m0, [r0 + 16]
+    movu       m1, [r0 + r1 + 16]
+    movu       m2, [r0 + r1 * 2 + 16]
+    movu       m3, [r0 + r5 + 16]
+    psllw      m0, 4
+    psubw      m0, m4
+    psllw      m1, 4
+    psubw      m1, m4
+    psllw      m2, 4
+    psubw      m2, m4
+    psllw      m3, 4
+    psubw      m3, m4
+
+    movu       [r2 + r3 * 0 + 16], m0
+    movu       [r2 + r3 * 1 + 16], m1
+    movu       [r2 + r3 * 2 + 16], m2
+    movu       [r2 + r4 + 16], m3
+
+    movu       m0, [r0 + 32]
+    movu       m1, [r0 + r1 + 32]
+    movu       m2, [r0 + r1 * 2 + 32]
+    movu       m3, [r0 + r5 + 32]
+    psllw      m0, 4
+    psubw      m0, m4
+    psllw      m1, 4
+    psubw      m1, m4
+    psllw      m2, 4
+    psubw      m2, m4
+    psllw      m3, 4
+    psubw      m3, m4
+
+    movu       [r2 + r3 * 0 + 32], m0
+    movu       [r2 + r3 * 1 + 32], m1
+    movu       [r2 + r3 * 2 + 32], m2
+    movu       [r2 + r4 + 32], m3
+
+    lea        r0, [r0 + r1 * 4]
+    lea        r2, [r2 + r3 * 4]
+
+    dec        r6d
+    jnz        .loop
+    RET
+%endmacro
+P2S_H_24xN 32
+P2S_H_24xN 64
diff -r ecc15210425c -r 30b44e2ddf59 source/common/x86/ipfilter8.h
--- a/source/common/x86/ipfilter8.h	Tue Apr 14 19:05:49 2015 +0530
+++ b/source/common/x86/ipfilter8.h	Tue Apr 14 19:18:46 2015 +0530
@@ -311,6 +311,7 @@
 void x265_filterPixelToShort_64x32_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
 void x265_filterPixelToShort_64x48_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
 void x265_filterPixelToShort_64x64_ssse3(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride);
+void x265_filterPixelToShort_24x32_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