[x265] [PATCH Review Only] ASM routine for interp_8tap_vert_pp_8xN function, (N = 4, 8, 16, 32)
nabajit at multicorewareinc.com
nabajit at multicorewareinc.com
Fri Oct 25 09:19:07 CEST 2013
# HG changeset patch
# User Nabajit Deka
# Date 1382685529 -19800
# Fri Oct 25 12:48:49 2013 +0530
# Node ID 7538cd6f4a54544aa380a248273855ca7e1bc02d
# Parent 570be4b532d1597929e5296c6531c8a378bf5b5a
ASM routine for interp_8tap_vert_pp_8xN function,(N = 4,8,16,32).
diff -r 570be4b532d1 -r 7538cd6f4a54 source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm Fri Oct 25 12:38:20 2013 +0530
+++ b/source/common/x86/ipfilter8.asm Fri Oct 25 12:48:49 2013 +0530
@@ -35,6 +35,11 @@
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
+ db 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5
+ db 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7
+
tab_c_512: times 8 dw 512
tab_ChromaCoeff: db 0, 64, 0, 0
@@ -623,3 +628,80 @@
IPFILTER_LUMA 48, 64
IPFILTER_LUMA 64, 16
IPFILTER_LUMA 16, 64
+
+;-----------------------------------------------------------------------------
+; void interp_8tap_vert_pp_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx)
+;-----------------------------------------------------------------------------
+%macro FILTER_VER_8xN 2
+INIT_XMM sse4
+cglobal interp_8tap_vert_pp_%1x%2, 4, 7, 8
+
+mov r4d, r4m
+
+lea r5, [r1 + 2 * r1]
+sub r0, r5
+
+%ifdef PIC
+lea r6, [tab_LumaCoeff]
+movh m0, [r6 + r4 * 8]
+%else
+movh m0, [tab_LumaCoeff + r4 * 8]
+%endif
+
+pshufb m1, m0, [tab_Vm + 16]
+pshufb m2, m0, [tab_Vm + 32]
+pshufb m3, m0, [tab_Vm + 48]
+pshufb m0, m0, [tab_Vm]
+
+xor r4, r4
+add r4d, %2
+
+.loop
+movq m4, [r0]
+movq m5, [r0 + r1]
+punpcklbw m4, m5
+pmaddubsw m4, m0
+
+movq m5, [r0 + 2 * r1]
+lea r5, [r1 + 2 * r1]
+movq m6, [r0 + r5]
+punpcklbw m5, m6
+pmaddubsw m5, m1
+
+paddw m4, m5
+
+movq m5, [r0 + 4 * r1]
+lea r5, [r5 + 2 * r1]
+movq m6, [r0 + r5]
+punpcklbw m5, m6
+pmaddubsw m5, m2
+
+lea r5, [r5 + r1]
+movq m6, [r0 + r5]
+lea r5, [r5 + r1]
+movq m7, [r0 + r5]
+punpcklbw m6, m7
+pmaddubsw m6, m3
+
+paddw m5, m6
+paddw m4, m5
+
+mova m5, [tab_c_512]
+
+pmulhrsw m4, m5
+packuswb m4, m4
+movh [r2], m4
+
+lea r0, [r0 + r1]
+lea r2, [r2 + r3]
+
+dec r4
+jnz .loop
+
+RET
+%endmacro
+
+FILTER_VER_8xN 8,4
+FILTER_VER_8xN 8,8
+FILTER_VER_8xN 8,16
+FILTER_VER_8xN 8,32
More information about the x265-devel
mailing list