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

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Oct 23 16:37:58 CEST 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1382539062 -19800
# Node ID 3f32eb263bf0a2c4f620fa7bff63bf118884adce
# Parent  6d96d64c4e9a2c526b57274760a7147241328cb3
asm code for interp_4tap_vert_pp_8x2

diff -r 6d96d64c4e9a -r 3f32eb263bf0 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Tue Oct 22 23:36:36 2013 +0530
+++ b/source/common/x86/ipfilter8.asm	Wed Oct 23 20:07:42 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,73 @@
     IPFILTER_LUMA 48, 64
     IPFILTER_LUMA 64, 16
     IPFILTER_LUMA 16, 64
+
+%macro FILTER_V8_W8_H2 0
+punpcklbw   m1,        m2
+punpcklbw   m7,        m3,        m0
+
+pmaddubsw   m1,        m6
+pmaddubsw   m7,        m5
+
+paddw       m1,        m7
+
+pmulhrsw    m1,        m4
+packuswb    m1,        m1
+%endmacro
+
+%macro FILTER_V8_W8_8x2 2
+FILTER_V8_W8 %1, %2
+movq        m0,        [r0 + 4 * r1]
+
+FILTER_V8_W8_H2
+
+movh        [r2 + r3], m1
+%endmacro
+
+;-----------------------------------------------------------------------------
+; void interp_4tap_vert_pp_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_V8_W8 2
+INIT_XMM sse4
+cglobal interp_4tap_vert_pp_%1x%2, 4, 7, 8
+
+mov         r4d,       r4m
+
+sub         r0,        r1
+movq        m0,        [r0]
+movq        m1,        [r0 + r1]
+movq        m2,        [r0 + 2 * r1]
+lea         r5,        [r0 + 2 * r1]
+movq        m3,        [r5 + r1]
+
+punpcklbw   m0,        m1
+punpcklbw   m4,        m2,          m3
+
+%ifdef PIC
+lea         r6,        [tab_ChromaCoeff]
+movd        m5,        [r6 + r4 * 4]
+%else
+movd        m5,        [tab_ChromaCoeff + r4 * 4]
+%endif
+
+pshufb      m6,        m5,       [tab_Vm]
+pmaddubsw   m0,        m6
+
+pshufb      m5,        [tab_Vm + 16]
+pmaddubsw   m4,        m5
+
+paddw       m0,        m4
+
+mova        m4,        [tab_c_512]
+
+pmulhrsw    m0,        m4
+packuswb    m0,        m0
+movh        [r2],      m0
+%endmacro
+
+;-----------------------------------------------------------------------------
+; void interp_4tap_vert_pp_8x2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+FILTER_V8_W8_8x2 8, 2
+
+RET


More information about the x265-devel mailing list