[x265] [PATCH Review Only] ASM routine for luma filter for 9xN block size

nabajit at multicorewareinc.com nabajit at multicorewareinc.com
Fri Oct 11 15:57:45 CEST 2013


# HG changeset patch
# User Nabajit Deka
# Date 1381499848 -19800
#      Fri Oct 11 19:27:28 2013 +0530
# Node ID 8d1330c448cebc18bc8cff5073adfa108a0cfe81
# Parent  0cc04cb6c2ad2af7a4b89521716577b5f8a3dc0c
ASM routine for luma filter for 9xN block size.

diff -r 0cc04cb6c2ad -r 8d1330c448ce source/common/x86/ipfilter8.asm
--- a/source/common/x86/ipfilter8.asm	Fri Oct 11 19:22:10 2013 +0530
+++ b/source/common/x86/ipfilter8.asm	Fri Oct 11 19:27:28 2013 +0530
@@ -275,3 +275,62 @@
     dec         r4d
     jnz         .loop
     RET
+
+SECTION_RODATA 32
+
+tab_leftmask:   db -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+
+tab_Tm8:    db 0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8
+            db 2, 3, 4, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7, 8, 9, 10
+            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_c_512:  times 8 dw 512
+
+SECTION .text
+
+%macro FILTER_H8 3
+    movu        %1, [srcq - 3]
+    pshufb      %2, %1, [tab_Tm8]
+    pmaddubsw   %2, m3
+    pshufb      m7, %1, [tab_Tm8 + 16]
+    pmaddubsw   m7, m3
+    phaddw      %2, m7
+    pshufb      m7, %1, [tab_Tm8 + 32]
+    pmaddubsw   m7, m3
+    pshufb      %1, %1, [tab_Tm8 + 48]
+    pmaddubsw   %1, m3
+    phaddw      m7, %1
+    phaddw      %2, m7
+    pmulhrsw    %2, %3
+    packuswb    %2, %2
+    movh        [r2], %2
+    movu        %1, [srcq - 3 + 8]
+    pshufb      %2, %1, [tab_Tm8]
+    pmaddubsw   %2, m3
+    phaddw      %2, %2
+    phaddw      %2, %2
+    pmulhrsw    %2, %3
+    packuswb    %2, %2
+    pextrb      [r2 + 8], %2, 0
+%endmacro
+
+;-----------------------------------------------------------------------------
+; void filterHorizontal_p_p_8(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int width, int height, short const *coeff)
+;-----------------------------------------------------------------------------
+INIT_XMM sse4
+cglobal filterHorizontal_p_p_8, 4, 5, 5, src, srcStride, dst, dstStride
+
+    mov       r4, r6m
+    movu      m3, [r4]
+    packsswb  m3, m3
+    mova      m2, [tab_c_512]
+    mov       r4, r5m
+
+.loop
+    FILTER_H8   m0, m1, m2
+    add         srcq, srcStrideq
+    add         dstq, dstStrideq
+    dec         r4d
+    jnz         .loop
+    RET


More information about the x265-devel mailing list