[x265] [PATCH 7 of 9] asm-intrapred8.asm: added macro 'INTRA_PRED_ANG16_MC4' to reduce code size

praveen at multicorewareinc.com praveen at multicorewareinc.com
Tue Mar 17 06:11:08 CET 2015


# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1426516768 -19800
# Node ID bc57e9c9d93826e9e97752bb01f3e3343fdf7390
# Parent  6296704b4b1873c8f299353acccc412c715e1947
asm-intrapred8.asm: added macro 'INTRA_PRED_ANG16_MC4' to reduce code size

diff -r 6296704b4b18 -r bc57e9c9d938 source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Mon Mar 16 20:02:24 2015 +0530
+++ b/source/common/x86/intrapred8.asm	Mon Mar 16 20:09:28 2015 +0530
@@ -10812,6 +10812,17 @@
     movu              [%1], xm3
 %endmacro
 
+%macro INTRA_PRED_ANG16_MC4 3
+    vperm2i128        m1, m1, m2, 00100000b
+    pmaddubsw         m4, m1, [r4 + (%3 * mmsize)]
+    pmulhrsw          m4, m0
+    packuswb          m3, m4
+    vpermq            m3, m3, 11011000b
+    movu              [%1], xm3
+    vextracti128      xm3, m3, 1
+    movu              [%2], xm3
+%endmacro
+
 INIT_YMM avx2
 cglobal intra_pred_ang16_25, 3, 5, 5
     mova              m0, [pw_1024]
@@ -11079,16 +11090,9 @@
     vperm2i128        m1, m1, m2, 00100000b
     pmaddubsw         m3, m1, [r4 + 0 * mmsize]
     pmulhrsw          m3, m0
-
+
     INTRA_PRED_ANG16_MC2 2
-    vperm2i128        m1, m1, m2, 00100000b
-    pmaddubsw         m4, m1, [r4 + 1 * mmsize]
-    pmulhrsw          m4, m0
-    packuswb          m3, m4
-    vpermq            m3, m3, 11011000b
-    movu              [r0], xm3
-    vextracti128      xm3, m3, 1
-    movu              [r0 + r1], xm3
+    INTRA_PRED_ANG16_MC4 r0, r0 + r1, 1
 
     INTRA_PRED_ANG16_MC2 3
     vperm2i128        m1, m1, m2, 00100000b
@@ -11096,14 +11100,7 @@
     pmulhrsw          m3, m0
 
     INTRA_PRED_ANG16_MC2 4
-    vperm2i128        m1, m1, m2, 00100000b
-    pmaddubsw         m4, m1, [r4 + 3 * mmsize]
-    pmulhrsw          m4, m0
-    packuswb          m3, m4
-    vpermq            m3, m3, 11011000b
-    movu              [r0 + 2 * r1], xm3
-    vextracti128      xm3, m3, 1
-    movu              [r0 + r3], xm3
+    INTRA_PRED_ANG16_MC4 r0 + 2 * r1, r0 + r3, 3
 
     lea              r0, [r0 + 4 * r1]
     add              r4, 4 * mmsize
@@ -11117,14 +11114,7 @@
     pmulhrsw          m3, m0
 
     INTRA_PRED_ANG16_MC2 7
-    vperm2i128        m1, m1, m2, 00100000b
-    pmaddubsw         m4, m1, [r4 + 2 * mmsize]
-    pmulhrsw          m4, m0
-    packuswb          m3, m4
-    vpermq            m3, m3, 11011000b
-    movu              [r0 + 2 * r1], xm3
-    vextracti128      xm3, m3, 1
-    movu              [r0 + r3], xm3
+    INTRA_PRED_ANG16_MC4 r0 + 2 * r1, r0 + r3, 2
 
     INTRA_PRED_ANG16_MC2 8
     lea               r0, [r0 + 4 * r1]
@@ -11140,14 +11130,7 @@
     pmulhrsw          m3, m0
 
     INTRA_PRED_ANG16_MC2 11
-    vperm2i128        m1, m1, m2, 00100000b
-    pmaddubsw         m4, m1, [r4 + 2 * mmsize]
-    pmulhrsw          m4, m0
-    packuswb          m3, m4
-    vpermq            m3, m3, 11011000b
-    movu              [r0 + r3], xm3
-    vextracti128      xm3, m3, 1
-    movu              [r0 + 4 * r1], xm3
+    INTRA_PRED_ANG16_MC4 r0 + r3, r0 + 4 * r1, 2
 
     lea               r0, [r0 + 4 * r1]
 
@@ -11157,14 +11140,7 @@
     pmulhrsw          m3, m0
 
     INTRA_PRED_ANG16_MC2 13
-    vperm2i128        m1, m1, m2, 00100000b
-    pmaddubsw         m4, m1, [r4 + 4 * mmsize]
-    pmulhrsw          m4, m0
-    packuswb          m3, m4
-    vpermq            m3, m3, 11011000b
-    movu              [r0 + r1], xm3
-    vextracti128      xm3, m3, 1
-    movu              [r0 + 2 * r1], xm3
+    INTRA_PRED_ANG16_MC4 r0 + r1, r0 + 2 * r1, 4
 
     add               r4, 4 * mmsize
 


More information about the x265-devel mailing list