[x265] [PATCH Review Only] asm code for interp_4tap_vert_pp_16x4, 16x8, 16x12, 16x16, 16x32

praveen at multicorewareinc.com praveen at multicorewareinc.com
Thu Oct 24 15:37:50 CEST 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1382621854 -19800
# Node ID 3d8eab784c7bc6216cc6ca3e0baaf03d7e920895
# Parent  0cb0692d6c69dbf6c5b49c51f6f528e29674baa9
asm code for interp_4tap_vert_pp_16x4, 16x8, 16x12, 16x16, 16x32

diff -r 0cb0692d6c69 -r 3d8eab784c7b source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Wed Oct 23 20:09:33 2013 +0800
+++ b/source/common/x86/ipfilter8.asm	Thu Oct 24 19:07:34 2013 +0530
@@ -35,6 +35,9 @@
            db 4, 5, 6, 7, 8,  9,  10, 11, 5, 6, 7, 8,  9,  10, 11, 12
            db 6, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 14
 
+tab_Vm:    db 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
+           db 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3
+
 tab_c_512:  times 8 dw 512
 
 tab_ChromaCoeff: db  0, 64,  0,  0
@@ -621,3 +624,103 @@
     IPFILTER_LUMA 48, 64
     IPFILTER_LUMA 64, 16
     IPFILTER_LUMA 16, 64
+
+;-----------------------------------------------------------------------------
+; void interp_4tap_vert_pp_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_V8_W16_H2 2
+INIT_XMM sse4
+cglobal interp_4tap_vert_pp_%1x%2, 4, 6, 8
+
+mov         r4d,       r4m
+sub         r0,        r1
+
+%ifdef PIC
+lea         r5,        [tab_ChromaCoeff]
+movd        m0,        [r5 + r4 * 4]
+%else
+movd        m0,        [tab_ChromaCoeff + r4 * 4]
+%endif
+
+pshufb      m1,        m0,       [tab_Vm]
+pshufb      m0,        [tab_Vm + 16]
+
+xor         r4,        r4
+add         r4d,       %2
+
+.loop
+movu        m2,        [r0]
+movu        m3,        [r0 + r1]
+
+punpcklbw   m4,        m2,        m3,
+punpckhbw   m5,        m2,        m3,
+
+pmaddubsw   m4,        m1
+pmaddubsw   m5,        m1
+
+movu        m2,        [r0 + 2 * r1]
+lea         r5,        [r0 + 2 * r1]
+movu        m3,        [r5 + r1]
+
+punpcklbw   m6,        m2,        m3,
+punpckhbw   m7,        m2,        m3,
+
+pmaddubsw   m6,        m0
+pmaddubsw   m7,        m0
+
+paddw       m4,        m6;
+paddw       m5,        m7;
+
+mova        m6,        [tab_c_512]
+
+pmulhrsw    m4,        m6
+pmulhrsw    m5,        m6
+
+packuswb    m4,        m5
+
+movu        [r2],      m4
+
+movu        m2,        [r0 + r1]
+movu        m3,        [r0 + 2 * r1]
+
+punpcklbw   m4,        m2,        m3,
+punpckhbw   m5,        m2,        m3,
+
+pmaddubsw   m4,        m1
+pmaddubsw   m5,        m1
+
+lea         r5,        [r0 + 2 * r1]
+movu        m2,        [r5 + r1]
+movu        m3,        [r5 + 2 * r1]
+
+punpcklbw   m6,        m2,        m3,
+punpckhbw   m7,        m2,        m3,
+
+pmaddubsw   m6,        m0
+pmaddubsw   m7,        m0
+
+paddw       m4,        m6
+paddw       m5,        m7
+
+mova        m6,        [tab_c_512]
+
+pmulhrsw    m4,        m6
+pmulhrsw    m5,        m6
+
+packuswb    m4,        m5
+
+movu        [r2 + r3],      m4
+
+lea         r0,        [r0 + 2 * r1]
+lea         r2,        [r2 + 2 * r3]
+
+sub         r4,        2
+jnz        .loop
+RET
+%endmacro
+
+FILTER_V8_W16_H2 16,  4
+FILTER_V8_W16_H2 16,  8
+FILTER_V8_W16_H2 16, 12
+FILTER_V8_W16_H2 16, 16
+FILTER_V8_W16_H2 16, 32


More information about the x265-devel mailing list