[x265] [PATCH Review Only] asm code for interp_4tap_vert_pp_12x16
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Mon Oct 28 09:24:28 CET 2013
# HG changeset patch
# User Praveen Tiwari
# Date 1382948648 -19800
# Node ID 1438266dbde617130d04ae13bd0d6e9c0993581c
# Parent ef2428fd32feddd60168f3430c50f4d7e6f02741
asm code for interp_4tap_vert_pp_12x16
diff -r ef2428fd32fe -r 1438266dbde6 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Mon Oct 28 00:08:06 2013 -0500
+++ b/source/common/x86/ipfilter8.asm Mon Oct 28 13:54:08 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
@@ -623,3 +626,101 @@
IPFILTER_LUMA 48, 64
IPFILTER_LUMA 64, 16
IPFILTER_LUMA 16, 64
+
+;-----------------------------------------------------------------------------
+; void interp_4tap_vert_pp_12x16(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_V8_W12_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
+
+movh [r2], m4
+pextrd [r2 + 8], m4, 2
+
+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
+
+movh [r2 + r3], m4
+pextrd [r2 + r3 + 8], m4, 2
+
+lea r0, [r0 + 2 * r1]
+lea r2, [r2 + 2 * r3]
+
+sub r4, 2
+jnz .loop
+RET
+%endmacro
+
+FILTER_V8_W12_H2 12, 16
More information about the x265-devel
mailing list