[x265] [PATCH Review Only] asm code for interp_4tap_vert_pp_2x8

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Oct 28 16:01:43 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1382972487 -19800
# Node ID 35d2d38d3771c24bf6a1b46aac2271c1ba663cb3
# Parent  d62d12b69145ffdfb5d645ebe1f452c294fa5876
asm code for interp_4tap_vert_pp_2x8

diff -r d62d12b69145 -r 35d2d38d3771 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Mon Oct 28 17:32:50 2013 +0530
+++ b/source/common/x86/ipfilter8.asm	Mon Oct 28 20:31:27 2013 +0530
@@ -801,3 +801,91 @@
 pextrw      [r6 + r3],        m4,    2
 
 RET
+
+;-----------------------------------------------------------------------------
+; void interp_4tap_vert_pp_2x8(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_V4_W2_H4 2
+INIT_XMM sse4
+cglobal interp_4tap_vert_pp_2x8, 4, 7, 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      m0,        [tab_Cm]
+
+mova        m1,        [tab_c_512]
+
+mov         r4d,       %2
+
+.loop
+movd        m2,        [r0]
+movd        m3,        [r0 + r1]
+movd        m4,        [r0 + 2 * r1]
+lea         r5,        [r0 + 2 * r1]
+movd        m5,        [r5 + r1]
+
+punpcklbw   m2,        m3
+punpcklbw   m6,        m4,        m5
+punpcklbw   m2,        m6
+
+pmaddubsw   m2,        m0
+
+movd        m6,        [r0 + 4 * r1]
+
+punpcklbw   m3,        m4
+punpcklbw   m7,        m5,        m6
+punpcklbw   m3,        m7
+
+pmaddubsw   m3,        m0
+
+phaddw      m2,        m3
+
+pmulhrsw    m2,        m1
+packuswb    m2,        m2
+
+pextrw      [r2],      m2,  0
+pextrw      [r2 + r3], m2,  2
+
+lea         r5,        [r0 + 4 * r1]
+movd        m2,        [r5 + r1]
+
+punpcklbw   m4,        m5
+punpcklbw   m3,        m6,        m2
+punpcklbw   m4,        m3
+
+pmaddubsw   m4,        m0
+
+movd        m3,        [r5 + 2 * r1]
+
+punpcklbw   m5,        m6
+punpcklbw   m2,        m3
+punpcklbw   m5,        m2
+
+pmaddubsw   m5,        m0
+
+phaddw      m4,        m5
+
+pmulhrsw    m4,        m1
+packuswb    m4,        m4
+
+pextrw      [r2 + 2 * r3],    m4,    0
+lea         r6,               [r2 + 2 * r3]
+pextrw      [r6 + r3],        m4,    2
+
+lea         r0,        [r0 + 4 * r1]
+lea         r2,        [r2 + 4 * r3]
+
+sub         r4,        4
+jnz        .loop
+RET
+%endmacro
+
+FILTER_V4_W2_H4 2, 8


More information about the x265-devel mailing list