[x265] [PATCH] assembly code for intra_pred_ang8_3

yuvaraj at multicorewareinc.com yuvaraj at multicorewareinc.com
Fri Jan 17 06:20:28 CET 2014


# HG changeset patch
# User Yuvaraj Venkatesh <yuvaraj at multicorewareinc.com>
# Date 1389935982 -19800
#      Fri Jan 17 10:49:42 2014 +0530
# Node ID b25619a5bb78ca3b1800cd5e8a93a7e6268af8b6
# Parent  3d747041271fad0f9984445882368539e46cd377
assembly code for intra_pred_ang8_3

diff -r 3d747041271f -r b25619a5bb78 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Thu Jan 16 20:08:45 2014 -0600
+++ b/source/common/x86/asm-primitives.cpp	Fri Jan 17 10:49:42 2014 +0530
@@ -1006,6 +1006,9 @@
         SETUP_INTRA_ANG4(32, 4, sse4);
         SETUP_INTRA_ANG4(33, 3, sse4);
 
+        SETUP_INTRA_ANG8(3, 3, sse4);
+        SETUP_INTRA_ANG8(33, 3, sse4);
+
         p.dct[DCT_8x8] = x265_dct8_sse4;
     }
     if (cpuMask & X265_CPU_AVX)
diff -r 3d747041271f -r b25619a5bb78 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Thu Jan 16 20:08:45 2014 -0600
+++ b/source/common/x86/intrapred8.asm	Fri Jan 17 10:49:42 2014 +0530
@@ -1106,7 +1106,7 @@
     movd        [r0], m0
     RET
 ;-----------------------------------------------------------------------------
-; void intraPredAng(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
+; void intraPredAng8(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
 ;-----------------------------------------------------------------------------
 INIT_XMM ssse3
 cglobal intra_pred_ang8_2, 3,5,2
@@ -1133,6 +1133,99 @@
     movh        [r0 + r4],      m1
     RET
 
+INIT_XMM sse4
+cglobal intra_pred_ang8_3, 3,5,8
+    cmp         r4m,       byte 33
+    cmove       r2,        r3mp
+    lea         r3,        [ang_table + 14 * 16]
+    mova        m7,        [pw_1024]
+
+    movu        m0,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+    palignr     m1,        m0, 1                      ; [x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
+
+    punpckhbw   m2,        m0, m1                     ; [x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
+    punpcklbw   m0,        m1                         ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
+    palignr     m1,        m2, m0, 2                  ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
+
+    movu        m3,        [r3 + 12 * 16]             ; [26]
+    movu        m6,        [r3 + 6 * 16]              ; [20]
+
+    pmaddubsw   m4,        m0, m3
+    pmulhrsw    m4,        m7
+    pmaddubsw   m1,        m6
+    pmulhrsw    m1,        m7
+    packuswb    m4,        m1
+
+    palignr     m5,        m2, m0, 4                  ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
+
+    movu        m3,        [r3]                       ; [14]
+    pmaddubsw   m5,        m3
+    pmulhrsw    m5,        m7
+
+    palignr     m6,        m2, m0, 6                  ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
+
+    movu        m3,        [r3 - 6 * 16]              ; [ 8]
+    pmaddubsw   m6,        m3
+    pmulhrsw    m6,        m7
+    packuswb    m5,        m6
+
+    palignr     m1,        m2, m0, 8                  ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
+
+    movu        m3,        [r3 - 12 * 16]             ; [ 2]
+    pmaddubsw   m6,        m1, m3
+    pmulhrsw    m6,        m7
+
+    movu        m3,        [r3 + 14 * 16]             ; [28]
+    pmaddubsw   m1,        m3
+    pmulhrsw    m1,        m7
+    packuswb    m6,        m1
+
+    palignr     m1,        m2, m0, 10                 ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 6]
+
+    movu        m3,        [r3 + 8 * 16]              ; [22]
+    pmaddubsw   m1,        m3
+    pmulhrsw    m1,        m7
+
+    palignr     m2,        m0, 12                     ; [15 14 14 13 13 12 12 11 11 10 10 9 9 8 8 7]
+
+    movu        m3,        [r3 + 2 * 16]              ; [16]
+    pmaddubsw   m2,        m3
+    pmulhrsw    m2,        m7
+    packuswb    m1,        m2
+
+    jz         .store
+
+    ; transpose 8x8
+    punpckhbw   m0,        m4, m5
+    punpcklbw   m4,        m5
+    punpckhbw   m2,        m4, m0
+    punpcklbw   m4,        m0
+
+    punpckhbw   m0,        m6, m1
+    punpcklbw   m6,        m1
+    punpckhbw   m1,        m6, m0
+    punpcklbw   m6,        m0
+
+    punpckhdq   m5,        m4, m6
+    punpckldq   m4,        m6
+    punpckldq   m6,        m2, m1
+    punpckhdq   m2,        m1
+    mova        m1,        m2
+
+.store:
+    lea         r4,              [r1 * 3]
+    movh        [r0],            m4
+    movhps      [r0 + r1],       m4
+    movh        [r0 + r1 * 2],   m5
+    movhps      [r0 + r4],       m5
+    lea         r0,              [r0 + r1 * 4]
+    movh        [r0],            m6
+    movhps      [r0 + r1],       m6
+    movh        [r0 + r1 * 2],   m1
+    movhps      [r0 + r4],       m1
+
+    RET
+
 ;-----------------------------------------------------------------------------
 ; void intraPredAng16(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
 ;-----------------------------------------------------------------------------


More information about the x265-devel mailing list