[x265] [PATCH 18 of 29] intrapred: cleanup intra_ang8x8, intra_ang16x16 and intra_ang32x32 older asm code

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Tue Jan 13 08:11:26 CET 2015


# HG changeset patch
# User Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
# Date 1420202786 -19800
#      Fri Jan 02 18:16:26 2015 +0530
# Node ID 38f8903130fddbe71688f17f630d856adf9faaba
# Parent  359749070949b037a78f475d85835dbc0a9c48dd
intrapred: cleanup intra_ang8x8, intra_ang16x16 and intra_ang32x32 older asm code

new asm and unit test code is available for these angular primitives, this older code is no longer used

diff -r 359749070949 -r 38f8903130fd source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Fri Jan 02 17:15:44 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Fri Jan 02 18:16:26 2015 +0530
@@ -947,9 +947,6 @@
 
 #define SETUP_INTRA_ANG_COMMON(mode, fno, cpu) \
     p.intra_pred[mode][BLOCK_4x4] = x265_intra_pred_ang4_ ## fno ## _ ## cpu; \
-    p.intra_pred[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _ ## cpu; \
-    p.intra_pred[mode][BLOCK_16x16] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \
-    p.intra_pred[mode][BLOCK_32x32] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;
 
 #define SETUP_INTRA_ANG_COMMON_NEW(mode, fno, cpu) \
     p.intra_pred_new[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _new_ ## cpu; \
@@ -964,17 +961,12 @@
 #define SETUP_INTRA_ANG4(mode, fno, cpu) \
     p.intra_pred[mode][BLOCK_4x4] = x265_intra_pred_ang4_ ## fno ## _ ## cpu;
 
-#define SETUP_INTRA_ANG16_32(mode, fno, cpu) \
-    p.intra_pred[mode][BLOCK_16x16] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \
-    p.intra_pred[mode][BLOCK_32x32] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;
-
 #define SETUP_INTRA_ANG16_32_NEW(mode, fno, cpu) \
     p.intra_pred_new[mode][BLOCK_16x16] = x265_intra_pred_ang16_ ## fno ## _new_ ## cpu; \
     p.intra_pred_new[mode][BLOCK_32x32] = x265_intra_pred_ang32_ ## fno ## _new_ ## cpu;
 
 #define SETUP_INTRA_ANG4_8(mode, fno, cpu) \
     p.intra_pred[mode][BLOCK_4x4] = x265_intra_pred_ang4_ ## fno ## _ ## cpu; \
-    p.intra_pred[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _ ## cpu;
 
 #define SETUP_INTRA_ANG4_8_NEW(mode, fno, cpu) \
     p.intra_pred_new[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _new_ ## cpu;
@@ -1070,22 +1062,7 @@
     SETUP_INTRA_ANG4_8(30, 6, cpu); \
     SETUP_INTRA_ANG4_8(31, 5, cpu); \
     SETUP_INTRA_ANG4_8(32, 4, cpu); \
-    SETUP_INTRA_ANG4_8(33, 3, cpu); \
-    SETUP_INTRA_ANG16_32(19, 19, cpu); \
-    SETUP_INTRA_ANG16_32(20, 20, cpu); \
-    SETUP_INTRA_ANG16_32(21, 21, cpu); \
-    SETUP_INTRA_ANG16_32(22, 22, cpu); \
-    SETUP_INTRA_ANG16_32(23, 23, cpu); \
-    SETUP_INTRA_ANG16_32(24, 24, cpu); \
-    SETUP_INTRA_ANG16_32(25, 25, cpu); \
-    SETUP_INTRA_ANG16_32(26, 26, cpu); \
-    SETUP_INTRA_ANG16_32(27, 27, cpu); \
-    SETUP_INTRA_ANG16_32(28, 28, cpu); \
-    SETUP_INTRA_ANG16_32(29, 29, cpu); \
-    SETUP_INTRA_ANG16_32(30, 30, cpu); \
-    SETUP_INTRA_ANG16_32(31, 31, cpu); \
-    SETUP_INTRA_ANG16_32(32, 32, cpu); \
-    SETUP_INTRA_ANG16_32(33, 33, cpu);
+    SETUP_INTRA_ANG4_8(33, 3, cpu);
 
 #define INTRA_ANG_SSE4_NEW(cpu) \
     SETUP_INTRA_ANG4_8_NEW(19, 17, cpu); \
diff -r 359749070949 -r 38f8903130fd source/common/x86/intrapred8.asm
--- a/source/common/x86/intrapred8.asm	Fri Jan 02 17:15:44 2015 +0530
+++ b/source/common/x86/intrapred8.asm	Fri Jan 02 18:16:26 2015 +0530
@@ -1121,14 +1121,16 @@
     psrldq      m0, 1
     movd        [r0], m0
     RET
-;-----------------------------------------------------------------------------
-; void intraPredAng8(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------
+;-----------------------------------------------------------------------------------------
+; void intraPredAng8(pixel* dst, intptr_t dstStride, pixel* src, int dirMode, int bFilter)
+;-----------------------------------------------------------------------------------------
 INIT_XMM ssse3
-cglobal intra_pred_ang8_2, 3,5,2
-    cmp         r4m,            byte 34
-    cmove       r2,             r3mp
-    movu        m0,             [r2 + 2]
+cglobal intra_pred_ang8_2_new, 3,5,2
+    lea         r4,             [r2 + 2]
+    add         r2,             18
+    cmp         r3m,            byte 34
+    cmove       r2,             r4
+    movu        m0,             [r2]
     lea         r4,             [r1 * 3]
 
     movh        [r0],           m0
@@ -1149,42 +1151,17 @@
     movh        [r0 + r4],      m1
     RET
 
-INIT_XMM ssse3
-cglobal intra_pred_ang8_2_new, 3,5,2
-    lea         r4,             [r2 + 2]
-    add         r2,             18
-    cmp         r3m,            byte 34
-    cmove       r2,             r4
-    movu        m0,             [r2]
-    lea         r4,             [r1 * 3]
-
-    movh        [r0],           m0
-    palignr     m1,             m0, 1
-    movh        [r0 + r1],      m1
-    palignr     m1,             m0, 2
-    movh        [r0 + r1 * 2],  m1
-    palignr     m1,             m0, 3
-    movh        [r0 + r4],      m1
-    palignr     m1,             m0, 4
-    lea         r0,             [r0 + r1 * 4]
-    movh        [r0],           m1
-    palignr     m1,             m0, 5
-    movh        [r0 + r1],      m1
-    palignr     m1,             m0, 6
-    movh        [r0 + r1 * 2],  m1
-    palignr     m1,             m0, 7
-    movh        [r0 + r4],      m1
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang8_3, 3,5,8
-    cmp         r4m,       byte 33
-    cmove       r2,        r3mp
+INIT_XMM sse4
+cglobal intra_pred_ang8_3_new, 3,5,8
+    lea         r4,        [r2 + 1]
+    add         r2,        17
+    cmp         r3m,       byte 33
+    cmove       r2,        r4
     lea         r3,        [ang_table + 22 * 16]
     lea         r4,        [ang_table +  8 * 16]
     mova        m3,        [pw_1024]
 
-    movu        m0,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+    movu        m0,        [r2]                       ; [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]
@@ -1227,7 +1204,7 @@
     pmaddubsw   m2,        [r3 - 6 * 16]              ; [16]
     pmulhrsw    m2,        m3
     packuswb    m1,        m2
-    jmp        .transpose8x8
+    jmp         .transpose8x8
 
 ALIGN 16
 .transpose8x8:
@@ -1263,145 +1240,6 @@
     movhps      [r0 + r1 * 4],   m1
     RET
 
-cglobal intra_pred_ang8_3_new, 3,5,8
-    lea         r4,        [r2 + 1]
-    add         r2,        17
-    cmp         r3m,       byte 33
-    cmove       r2,        r4
-    lea         r3,        [ang_table + 22 * 16]
-    lea         r4,        [ang_table +  8 * 16]
-    mova        m3,        [pw_1024]
-
-    movu        m0,        [r2]                       ; [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]
-
-    pmaddubsw   m4,        m0, [r3 + 4 * 16]          ; [26]
-    pmulhrsw    m4,        m3
-    pmaddubsw   m1,        [r3 - 2 * 16]              ; [20]
-    pmulhrsw    m1,        m3
-    packuswb    m4,        m1
-
-    palignr     m5,        m2, m0, 4                  ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
-
-    pmaddubsw   m5,        [r3 - 8 * 16]              ; [14]
-    pmulhrsw    m5,        m3
-
-    palignr     m6,        m2, m0, 6                  ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
-
-    pmaddubsw   m6,        [r4]                       ; [ 8]
-    pmulhrsw    m6,        m3
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 8                  ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
-
-    pmaddubsw   m6,        m1, [r4 - 6 * 16]          ; [ 2]
-    pmulhrsw    m6,        m3
-
-    pmaddubsw   m1,        [r3 + 6 * 16]              ; [28]
-    pmulhrsw    m1,        m3
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 10                 ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 6]
-
-    pmaddubsw   m1,        [r3]                       ; [22]
-    pmulhrsw    m1,        m3
-
-    palignr     m2,        m0, 12                     ; [15 14 14 13 13 12 12 11 11 10 10 9 9 8 8 7]
-
-    pmaddubsw   m2,        [r3 - 6 * 16]              ; [16]
-    pmulhrsw    m2,        m3
-    packuswb    m1,        m2
-    jmp         .transpose8x8
-
-ALIGN 16
-.transpose8x8:
-    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
-    add         r0,              r4
-    movh        [r0 + r1],       m6
-    movhps      [r0 + r1 * 2],   m6
-    movh        [r0 + r4],       m1
-    movhps      [r0 + r1 * 4],   m1
-    RET
-
-cglobal intra_pred_ang8_4, 3,5,8
-    cmp         r4m,       byte 32
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 24 * 16]
-    lea         r4,        [ang_table + 10 * 16]
-    mova        m3,        [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]
-    mova        m5,        m1
-
-    pmaddubsw   m4,        m0, [r3 - 3 * 16]          ; [21]
-    pmulhrsw    m4,        m3
-    pmaddubsw   m1,        [r4]                       ; [10]
-    pmulhrsw    m1,        m3
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        [r3 + 7 * 16]              ; [31]
-    pmulhrsw    m5,        m3
-
-    palignr     m6,        m2, m0, 4                  ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
-
-    pmaddubsw   m6,        [r3 - 4 * 16]              ; [ 20]
-    pmulhrsw    m6,        m3
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 6                  ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
-
-    pmaddubsw   m6,        m1, [r4 - 1 * 16]          ; [ 9]
-    pmulhrsw    m6,        m3
-
-    pmaddubsw   m1,        [r3 + 6 * 16]              ; [30]
-    pmulhrsw    m1,        m3
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 8                  ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
-
-    pmaddubsw   m1,        [r3 - 5 * 16]              ; [19]
-    pmulhrsw    m1,        m3
-
-    palignr     m2,        m0, 10                     ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 8]
-
-    pmaddubsw   m2,        [r4 - 2 * 16]              ; [8]
-    pmulhrsw    m2,        m3
-    packuswb    m1,        m2
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_4_new, 3,5,8
     lea         r4,        [r2 + 1]
     add         r2,        17
@@ -1455,57 +1293,6 @@
     packuswb    m1,        m2
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_5, 3,5,8
-    cmp         r4m,       byte 31
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 17 * 16]
-    lea         r4,        [ang_table +  2 * 16]
-    mova        m3,        [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]
-    mova        m5,        m1
-
-    pmaddubsw   m4,        m0, [r3]                   ; [17]
-    pmulhrsw    m4,        m3
-    pmaddubsw   m1,        [r4]                       ; [2]
-    pmulhrsw    m1,        m3
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        [r3 + 2 * 16]              ; [19]
-    pmulhrsw    m5,        m3
-
-    palignr     m6,        m2, m0, 4                  ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
-    mova        m1,        m6
-
-    pmaddubsw   m1,        [r4 + 2 * 16]              ; [4]
-    pmulhrsw    m1,        m3
-    packuswb    m5,        m1
-
-    pmaddubsw   m6,        [r3 + 4 * 16]              ; [21]
-    pmulhrsw    m6,        m3
-
-    palignr     m1,        m2, m0, 6                  ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
-
-    mova        m7,        m1
-    pmaddubsw   m7,        [r4 + 4 * 16]              ; [6]
-    pmulhrsw    m7,        m3
-    packuswb    m6,        m7
-
-    pmaddubsw   m1,        [r3 + 6 * 16]              ; [23]
-    pmulhrsw    m1,        m3
-
-    palignr     m2,        m0, 8                      ; [13 12 12 11 11 10 10 9 9 8 8 7 7 8 8 9]
-
-    pmaddubsw   m2,        [r4 + 6 * 16]              ; [8]
-    pmulhrsw    m2,        m3
-    packuswb    m1,        m2
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_5_new, 3,5,8
     lea         r4,        [r2 + 1]
     add         r2,        17
@@ -1559,55 +1346,6 @@
     packuswb    m1,        m2
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_6, 3,5,8
-    cmp         r4m,       byte 30
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 20 * 16]
-    lea         r4,        [ang_table +  8 * 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]
-    mova        m1,        m0
-
-    pmaddubsw   m4,        m0, [r3 - 7 * 16]          ; [13]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 + 6 * 16]              ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m0, 2                  ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
-
-    pmaddubsw   m5,        m6, [r4 - 1 * 16]          ; [7]
-    pmulhrsw    m5,        m7
-
-    pmaddubsw   m6,        [r3]                       ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 4                  ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
-
-    pmaddubsw   m6,        m1, [r4 - 7 * 16]          ; [1]
-    pmulhrsw    m6,        m7
-
-    mova        m3,        m1
-    pmaddubsw   m3,        [r3 - 6 * 16]              ; [14]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-
-    pmaddubsw   m1,        [r3 + 7 * 16]              ; [27]
-    pmulhrsw    m1,        m7
-
-    palignr     m2,        m0, 6                      ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
-
-    pmaddubsw   m2,        [r4]                       ; [8]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_6_new, 3,5,8
     lea         r4,        [r2 + 1]
     add         r2,        17
@@ -1659,52 +1397,6 @@
     packuswb    m1,        m2
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_7, 3,5,8
-    cmp         r4m,       byte 29
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 24 * 16]
-    lea         r4,        [ang_table +  6 * 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]
-
-    pmaddubsw   m4,        m0, [r4 + 3 * 16]          ; [9]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m0, [r3 - 6 * 16]          ; [18]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m5,        m0, [r3 + 3 * 16]          ; [27]
-    pmulhrsw    m5,        m7
-
-    palignr     m1,        m2, m0, 2                  ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
-
-    pmaddubsw   m6,        m1, [r4 - 2 * 16]          ; [4]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r4 + 7 * 16]          ; [13]
-    pmulhrsw    m6,        m7
-
-    mova        m3,        m1
-    pmaddubsw   m3,        [r3 - 2 * 16]              ; [22]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-
-    pmaddubsw   m1,        [r3 + 7 * 16]              ; [31]
-    pmulhrsw    m1,        m7
-
-    palignr     m2,        m0, 4                      ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
-
-    pmaddubsw   m2,        [r4 + 2 * 16]              ; [8]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_7_new, 3,5,8
     lea         r4,        [r2 + 1]
     add         r2,        17
@@ -1753,48 +1445,6 @@
     packuswb    m1,        m2
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_8, 3,5,8
-    cmp         r4m,       byte 28
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 23 * 16]
-    lea         r4,        [ang_table +  8 * 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     m2,        m0, 2                      ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
-
-    pmaddubsw   m4,        m0, [r4 - 3 * 16]          ; [5]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m0, [r4 + 2 * 16]          ; [10]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m5,        m0, [r3 - 8 * 16]          ; [15]
-    pmulhrsw    m5,        m7
-
-    pmaddubsw   m6,        m0, [r3 - 3 * 16]          ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r3 + 2 * 16]          ; [25]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m0,        [r3 + 7 * 16]              ; [30]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m2, [r4 - 5 * 16]          ; [3]
-    pmulhrsw    m1,        m7
-
-    pmaddubsw   m2,        [r4]                       ; [8]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_8_new, 3,5,8
     lea         r4,        [r2 + 1]
     add         r2,        17
@@ -1839,45 +1489,6 @@
     packuswb    m1,        m2
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_9, 3,5,8
-    cmp         r4m,       byte 27
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 10 * 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]
-
-    punpcklbw   m0,        m1                         ; [9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m0, [r3 - 8 * 16]          ; [2]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m0, [r3 - 6 * 16]          ; [4]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m5,        m0, [r3 - 4 * 16]          ; [6]
-    pmulhrsw    m5,        m7
-
-    pmaddubsw   m6,        m0, [r3 - 2 * 16]          ; [8]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r3]                   ; [10]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m2,        m0, [r3 + 2 * 16]          ; [12]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-
-    pmaddubsw   m1,        m0, [r3 + 4 * 16]          ; [14]
-    pmulhrsw    m1,        m7
-
-    pmaddubsw   m0,        [r3 + 6 * 16]              ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_9_new, 3,5,8
     lea         r4,        [r2 + 1]
     add         r2,        17
@@ -1919,46 +1530,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_10, 4,5,5
-    movh        m0,        [r2 + 1]
-    mova        m4,        [pb_unpackbq]
-    palignr     m1,        m0, 2
-    pshufb      m1,        m4
-    palignr     m2,        m0, 4
-    pshufb      m2,        m4
-    palignr     m3,        m0, 6
-    pshufb      m3,        m4
-    pshufb      m0,        m4
-
-    lea         r4,             [r1 * 3]
-    movhps      [r0 + r1],      m0
-    movh        [r0 + r1 * 2],  m1
-    movhps      [r0 + r4],      m1
-    lea         r2,             [r0 + r1 * 4]
-    movh        [r2],           m2
-    movhps      [r2 + r1],      m2
-    movh        [r2 + r1 * 2],  m3
-    movhps      [r2 + r4],      m3
-
-; filter
-    cmp         r5m, byte 0
-    jz         .quit
-
-    pmovzxbw    m0,        m0
-    movu        m1,        [r3]
-    palignr     m2,        m1, 1
-    pshufb      m1,        m4
-    pmovzxbw    m1,        m1
-    pmovzxbw    m2,        m2
-    psubw       m2,        m1
-    psraw       m2,        1
-    paddw       m0,        m2
-    packuswb    m0,        m0
-
-.quit:
-    movh        [r0],      m0
-    RET
-
 cglobal intra_pred_ang8_10_new, 3,6,5
     movh        m0,        [r2 + 17]
     mova        m4,        [pb_unpackbq]
@@ -1999,47 +1570,6 @@
     movh        [r0],      m0
     RET
 
-cglobal intra_pred_ang8_26, 4,5,3
-    movh        m0,        [r3 + 1]
-
-    lea         r4,             [r1 * 3]
-    movh        [r0],           m0
-    movh        [r0 + r1],      m0
-    movh        [r0 + r1 * 2],  m0
-    movh        [r0 + r4],      m0
-    lea         r3,             [r0 + r1 * 4]
-    movh        [r3],           m0
-    movh        [r3 + r1],      m0
-    movh        [r3 + r1 * 2],  m0
-    movh        [r3 + r4],      m0
-
-; filter
-    cmp         r5m, byte 0
-    jz         .quit
-
-    pshufb      m0,        [pb_unpackbq]
-    pmovzxbw    m0,        m0
-    movu        m1,        [r2]
-    palignr     m2,        m1, 1
-    pshufb      m1,        [pb_unpackbq]
-    pmovzxbw    m1,        m1
-    pmovzxbw    m2,        m2
-    psubw       m2,        m1
-    psraw       m2,        1
-    paddw       m0,        m2
-    packuswb    m0,        m0
-    pextrb      [r0],          m0, 0
-    pextrb      [r0 + r1],     m0, 1
-    pextrb      [r0 + r1 * 2], m0, 2
-    pextrb      [r0 + r4],     m0, 3
-    pextrb      [r3],          m0, 4
-    pextrb      [r3 + r1],     m0, 5
-    pextrb      [r3 + r1 * 2], m0, 6
-    pextrb      [r3 + r4],     m0, 7
-
-.quit:
-    RET
-
 cglobal intra_pred_ang8_26_new, 3,6,3
     movu        m2,             [r2]
     palignr     m0,             m2, 1
@@ -2079,45 +1609,6 @@
 .quit:
     RET
 
-cglobal intra_pred_ang8_11, 3,5,8
-    cmp         r4m,       byte 25
-    cmove       r2,        r3mp
-    lea         r3,        [ang_table + 23 * 16]
-    mova        m7,        [pw_1024]
-
-    movu        m0,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    palignr     m1,        m0, 1                      ; [x 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-
-    punpcklbw   m0,        m1                         ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m0, [r3 + 7 * 16]          ; [30]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m0, [r3 + 5 * 16]          ; [28]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m5,        m0, [r3 + 3 * 16]          ; [26]
-    pmulhrsw    m5,        m7
-
-    pmaddubsw   m6,        m0, [r3 + 1 * 16]          ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r3 - 1 * 16]          ; [22]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m2,        m0, [r3 - 3 * 16]          ; [20]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-
-    pmaddubsw   m1,        m0, [r3 - 5 * 16]          ; [18]
-    pmulhrsw    m1,        m7
-
-    pmaddubsw   m0,        [r3 - 7 * 16]              ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_11_new, 3,5,8
     xor         r4,        r4
     cmp         r3m,       byte 25
@@ -2161,51 +1652,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_12, 4,5,8
-    cmp         r4m,       byte 24
-    mov         r4,        r2
-    cmovz       r2,        r3
-    cmovz       r3,        r4
-
-    lea         r4,        [ang_table + 22 * 16]
-    mova        m7,        [pw_1024]
-
-    movu        m1,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    pslldq      m0,        m1, 1                      ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
-    pinsrb      m0,        [r3 + 6], 0
-    punpckhbw   m2,        m0, m1                     ; [15 14 14 13 13 12 12 11 11 10 10 9 9 8 8 7]
-    punpcklbw   m0,        m1                         ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    palignr     m2,        m0, 2                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m2, [r4 + 5 * 16]          ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m2, [r4]                   ; [22]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m1,        m0, [r4 + 7 * 16]          ; [29]
-    pmulhrsw    m1,        m7
-
-    pmaddubsw   m0,        [r4 + 2 * 16]              ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    pmaddubsw   m5,        m2, [r4 - 5 * 16]          ; [17]
-    pmulhrsw    m5,        m7
-
-    lea         r4,        [ang_table + 7 * 16]
-    pmaddubsw   m6,        m2, [r4 + 5 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m2, [r4]                   ; [7]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m2,        [r4 - 5 * 16]              ; [2]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_12_new, 3,5,8
     xor         r4,        r4
     cmp         r3m,       byte 24
@@ -2255,55 +1701,6 @@
     packuswb    m6,        m2
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_13, 4,5,8
-    cmp         r4m,       byte 23
-    mov         r4,        r2
-    cmovz       r2,        r3
-    cmovz       r3,        r4
-
-    lea         r4,        [ang_table + 24 * 16]
-    mova        m7,        [pw_1024]
-
-    movu        m1,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    pslldq      m1,        1                          ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
-    pinsrb      m1,        [r3 + 4], 0
-    pslldq      m0,        m1, 1                      ; [13 12 11 10 9 8 7 6 5 4 3 2 1 0 a b]
-    pinsrb      m0,        [r3 + 7], 0
-    punpckhbw   m5,        m0, m1                     ; [14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 6]
-    punpcklbw   m0,        m1                         ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
-    palignr     m1,        m5, m0, 2                  ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    palignr     m5,        m0, 4                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m5, [r4 - 1 * 16]          ; [23]
-    pmulhrsw    m4,        m7
-
-    pmaddubsw   m6,        m1, [r4 + 4 * 16]          ; [28]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m0,        [r4]                       ; [24]
-    pmulhrsw    m0,        m7
-
-    lea         r4,        [ang_table + 13 * 16]
-    pmaddubsw   m3,        m5, [r4 + 1 * 16]          ; [14]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m5,        [r4 - 8 * 16]              ; [5]
-    pmulhrsw    m5,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r4 + 6 * 16]          ; [19]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m2,        m1, [r4 - 3 * 16]          ; [10]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-
-    pmaddubsw   m1,        [r4 - 12 * 16]             ; [1]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_13_new, 4,5,8
     xor         r4,        r4
     cmp         r3m,       byte 23
@@ -2356,56 +1753,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_14, 4,5,8
-    cmp         r4m,       byte 22
-    mov         r4,        r2
-    cmovz       r2,        r3
-    cmovz       r3,        r4
-
-    lea         r4,        [ang_table + 24 * 16]
-    mova        m3,        [pw_1024]
-
-    movu        m1,        [r2 - 2]                   ; [13 12 11 10 9 8 7 6 5 4 3 2 1 0 a b]
-    pinsrb      m1,        [r3 + 2], 1
-    pinsrb      m1,        [r3 + 5], 0
-    pslldq      m0,        m1, 1                      ; [12 11 10 9 8 7 6 5 4 3 2 1 0 a b c]
-    pinsrb      m0,        [r3 + 7], 0
-    punpckhbw   m2,        m0, m1                     ; [13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 5]
-    punpcklbw   m0,        m1                         ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
-    palignr     m1,        m2, m0, 2                  ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
-    palignr     m6,        m2, m0, 4                  ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    palignr     m2,        m0, 6                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m2, [r4 - 5 * 16]          ; [19]
-    pmulhrsw    m4,        m3
-
-    pmaddubsw   m0,        [r4]                       ; [24]
-    pmulhrsw    m0,        m3
-
-    pmaddubsw   m5,        m6, [r4 + 1 * 16]          ; [25]
-    pmulhrsw    m5,        m3
-
-    lea         r4,        [ang_table + 12 * 16]
-    pmaddubsw   m6,        [r4]                       ; [12]
-    pmulhrsw    m6,        m3
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r4 + 19 * 16]         ; [31]
-    pmulhrsw    m6,        m3
-
-    pmaddubsw   m2,        [r4 - 6 * 16]              ; [6]
-    pmulhrsw    m2,        m3
-    packuswb    m4,        m2
-
-    pmaddubsw   m2,        m1, [r4 + 6 * 16]          ; [18]
-    pmulhrsw    m2,        m3
-    packuswb    m6,        m2
-
-    pmaddubsw   m1,        [r4 - 7 * 16]              ; [5]
-    pmulhrsw    m1,        m3
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_14_new, 4,5,8
     xor         r4,        r4
     cmp         r3m,       byte 22
@@ -2459,58 +1806,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_15, 4,5,8
-    cmp         r4m,       byte 21
-    mov         r4,        r2
-    cmovz       r2,        r3
-    cmovz       r3,        r4
-
-    lea         r4,        [ang_table + 23 * 16]
-    mova        m3,        [pw_1024]
-
-    movu        m1,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_15]
-    palignr     m1,        m2, 13                     ; [12 11 10 9 8 7 6 5 4 3 2 1 0 a b c]
-    pslldq      m0,        m1, 1                      ; [11 10 9 8 7 6 5 4 3 2 1 0 a b c d]
-    pinsrb      m0,        [r3 + 8], 0
-    punpckhbw   m4,        m0, m1                     ; [12 11 11 10 10 9 9 8 8 7 7 6 6 5 5 4]
-    punpcklbw   m0,        m1                         ; [4 3 3 2 2 1 1 0 0 a a b b c c d]
-    palignr     m1,        m4, m0, 2                  ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
-    palignr     m6,        m4, m0, 4                  ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
-    palignr     m5,        m4, m0, 6                  ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    palignr     m4,        m0, 8                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 8 * 16]              ; [15]
-    pmulhrsw    m4,        m3
-
-    pmaddubsw   m2,        m5, [r4 + 7 * 16]          ; [30]
-    pmulhrsw    m2,        m3
-    packuswb    m4,        m2
-
-    pmaddubsw   m5,        [r4 - 10 * 16]             ; [13]
-    pmulhrsw    m5,        m3
-
-    pmaddubsw   m2,        m6, [r4 + 5 * 16]          ; [28]
-    pmulhrsw    m2,        m3
-    packuswb    m5,        m2
-
-    pmaddubsw   m2,        m1, [r4 + 3 * 16]          ; [26]
-    pmulhrsw    m2,        m3
-
-    pmaddubsw   m0,        [r4 + 1 * 16]              ; [24]
-    pmulhrsw    m0,        m3
-
-    lea         r4,        [ang_table + 11 * 16]
-    pmaddubsw   m6,        [r4]                       ; [11]
-    pmulhrsw    m6,        m3
-    packuswb    m6,        m2
-
-    pmaddubsw   m1,        [r4 - 2 * 16]              ; [9]
-    pmulhrsw    m1,        m3
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_15_new, 4,5,8
     xor         r4,        r4
     cmp         r3m,       byte 21
@@ -2566,61 +1861,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_16, 4,5,8
-    cmp         r4m,       byte 20
-    mov         r4,        r2
-    cmovz       r2,        r3
-    cmovz       r3,        r4
-
-    lea         r4,        [ang_table + 22 * 16]
-    mova        m7,        [pw_1024]
-
-    movu        m1,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_16]
-    palignr     m1,        m2, 12                     ; [11 10 9 8 7 6 5 4 3 2 1 0 a b c d]
-    pslldq      m0,        m1, 1                      ; [10 9 8 7 6 5 4 3 2 1 0 a b c d e]
-    pinsrb      m0,        [r3 + 8], 0
-    punpckhbw   m4,        m0, m1                     ; [11 10 10 9 9 8 8 7 7 6 6 5 5 4 4 3]
-    punpcklbw   m0,        m1                         ; [3 2 2 1 1 0 0 a a b b c c d d e]
-    palignr     m1,        m4, m0, 2                  ; [4 3 3 2 2 1 1 0 0 a a b b c c d]
-    palignr     m6,        m4, m0, 4                  ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
-    palignr     m2,        m4, m0, 6                  ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
-    palignr     m5,        m4, m0, 8                  ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    palignr     m4,        m0, 10                     ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m3,        m5, [r4]                   ; [22]
-    pmulhrsw    m3,        m7
-
-    pmaddubsw   m0,        [r4 + 2 * 16]              ; [24]
-    pmulhrsw    m0,        m7
-
-    lea         r4,        [ang_table + 9 * 16]
-
-    pmaddubsw   m4,        [r4 + 2 * 16]              ; [11]
-    pmulhrsw    m4,        m7
-    packuswb    m4,        m3
-
-    pmaddubsw   m2,        [r4 + 3 * 16]              ; [12]
-    pmulhrsw    m2,        m7
-
-    pmaddubsw   m5,        [r4 - 8 * 16]              ; [1]
-    pmulhrsw    m5,        m7
-    packuswb    m5,        m2
-
-    mova        m2,        m6
-    pmaddubsw   m6,        [r4 + 14 * 16]             ; [23]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m2,        [r4 -  7 * 16]             ; [2]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-
-    pmaddubsw   m1,        [r4 + 4 * 16]              ; [13]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_16_new, 4,5,8
     xor         r4,        r4
     cmp         r3m,       byte 20
@@ -2679,62 +1919,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_17, 4,5,8
-    cmp         r4m,       byte 19
-    mov         r4,        r2
-    cmovz       r2,        r3
-    cmovz       r3,        r4
-
-    lea         r4,        [ang_table + 17 * 16]
-    mova        m3,        [pw_1024]
-
-    movu        m2,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    movu        m1,        [r3]
-    pshufb      m1,        [c_mode16_17]
-    palignr     m2,        m1, 11                     ; [10 9 8 7 6 5 4 3 2 1 0 a b c d e]
-    pslldq      m0,        m2, 1                      ; [9 8 7 6 5 4 3 2 1 0 a b c d e f]
-    pinsrb      m0,        [r3 + 7], 0
-    punpckhbw   m1,        m0, m2                     ; [10 9 9 8 8 7 7 6 6 5 5 4 4 3 3 2]
-    punpcklbw   m0,        m2                         ; [2 1 1 0 0 a a b b c c d d e e f]
-
-    palignr     m5,        m1, m0, 8                  ; [6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
-    palignr     m2,        m1, m0, 10                 ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    palignr     m4,        m1, m0, 12                 ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-
-    pmaddubsw   m2,        [r4 - 5 * 16]              ; [12]
-    pmulhrsw    m2,        m3
-
-    pmaddubsw   m4,        [r4 - 11 * 16]             ; [6]
-    pmulhrsw    m4,        m3
-    packuswb    m4,        m2
-
-    pmaddubsw   m5,        [r4 + 1 * 16]              ; [18]
-    pmulhrsw    m5,        m3
-
-    palignr     m2,        m1, m0, 6                  ; [5 4 4 3 3 2 2 1 1 0 0 a a b b c]
-    pmaddubsw   m2,        [r4 + 7 * 16]              ; [24]
-    pmulhrsw    m2,        m3
-    packuswb    m5,        m2
-
-    palignr     m6,        m1, m0, 4                  ; [4 3 3 2 2 1 1 0 0 a a b b c c d]
-    mova        m2,        m6
-    pmaddubsw   m6,        [r4 + 13 * 16]             ; [30]
-    pmulhrsw    m6,        m3
-
-    pmaddubsw   m2,        [r4 - 13 * 16]             ; [4]
-    pmulhrsw    m2,        m3
-    packuswb    m6,        m2
-
-    palignr     m1,        m0, 2                      ; [3 2 2 1 1 0 0 a a b b c c d d e]
-    pmaddubsw   m1,        [r4 - 7 * 16]              ; [10]
-    pmulhrsw    m1,        m3
-
-    pmaddubsw   m0,        [r4 - 1 * 16]              ; [16]
-    pmulhrsw    m0,        m3
-    packuswb    m1,        m0
-    jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3 %+ SUFFIX %+ .transpose8x8)
-
 cglobal intra_pred_ang8_17_new, 4,5,8
     xor         r4,        r4
     cmp         r3m,       byte 19
@@ -2793,29 +1977,6 @@
     packuswb    m1,        m0
     jmp         mangle(private_prefix %+ _ %+ intra_pred_ang8_3_new %+ SUFFIX %+ .transpose8x8)
 
-cglobal intra_pred_ang8_18, 4,4,1
-    movu        m0, [r2]
-    pshufb      m0, [pb_swap8]
-    movhps      m0, [r3 + 1]
-    lea         r2, [r0 + r1 * 4]
-    lea         r3, [r1 * 3]
-    movh        [r2 + r3], m0
-    psrldq      m0, 1
-    movh        [r2 + r1 * 2], m0
-    psrldq      m0, 1
-    movh        [r2 + r1], m0
-    psrldq      m0, 1
-    movh        [r2], m0
-    psrldq      m0, 1
-    movh        [r0 + r3], m0
-    psrldq      m0, 1
-    movh        [r0 + r1 * 2], m0
-    psrldq      m0, 1
-    movh        [r0 + r1], m0
-    psrldq      m0, 1
-    movh        [r0], m0
-    RET
-
 cglobal intra_pred_ang8_18_new, 4,4,1
     movu        m0, [r2 + 16]
     pinsrb      m0, [r2], 0
@@ -2840,55 +2001,6 @@
     movh        [r0], m0
     RET
 
-;-----------------------------------------------------------------------------
-; void intraPredAng16(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------
-INIT_XMM ssse3
-cglobal intra_pred_ang16_2, 3,3,3
-    cmp             r4m, byte 34
-    cmove           r2, r3mp
-    movu            m0, [r2 + 2]
-    movu            m1, [r2 + 18]
-    movu            [r0], m0
-    palignr         m2, m1, m0, 1
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 2
-    movu            [r0], m2
-    palignr         m2, m1, m0, 3
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 4
-    movu            [r0], m2
-    palignr         m2, m1, m0, 5
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 6
-    movu            [r0], m2
-    palignr         m2, m1, m0, 7
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 8
-    movu            [r0], m2
-    palignr         m2, m1, m0, 9
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 10
-    movu            [r0], m2
-    palignr         m2, m1, m0, 11
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 12
-    movu            [r0], m2
-    palignr         m2, m1, m0, 13
-    movu            [r0 + r1], m2
-    lea             r0, [r0 + r1 * 2]
-    palignr         m2, m1, m0, 14
-    movu            [r0], m2
-    palignr         m2, m1, m0, 15
-    movu            [r0 + r1], m2
-    RET
-
 %macro TRANSPOSE_STORE_8x8 6
   %if %2 == 1
     ; transpose 8x8 and then store, used by angle BLOCK_16x16 and BLOCK_32x32
@@ -2930,3763 +2042,6 @@
   %endif
 %endmacro
 
-INIT_XMM sse4
-cglobal intra_pred_ang16_3, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m0,        [r2 + 1]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m1,        m2, m0, 2
-
-    pmaddubsw   m4,        m0, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 + 4 * 16]              ; [20]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m5,        m2, m0, 4
-
-    pmaddubsw   m5,        [r3 - 2 * 16]              ; [14]
-    pmulhrsw    m5,        m7
-
-    palignr     m6,        m2, m0, 6
-
-    pmaddubsw   m6,        [r3 - 8 * 16]              ; [ 8]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 8
-
-    pmaddubsw   m6,        m1, [r3 - 14 * 16]         ; [ 2]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m1,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 10
-
-    pmaddubsw   m1,        [r3 + 6 * 16]              ; [22]
-    pmulhrsw    m1,        m7
-
-    palignr     m2,        m0, 12
-
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    movu        m0,        [r2 + 8]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m5,        m2, m0, 2
-
-    pmaddubsw   m4,        m0, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m5, [r3 - 12 * 16]         ; [04]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        [r3 + 14 * 16]             ; [30]
-    pmulhrsw    m5,        m7
-
-    palignr     m6,        m2, m0, 4
-
-    pmaddubsw   m6,        [r3 + 8 * 16]              ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 6
-
-    pmaddubsw   m6,        m1, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m6,        m7
-
-    palignr     m1,        m2, m0, 8
-
-    pmaddubsw   m1,        [r3 - 4 * 16]              ; [12]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 10
-
-    pmaddubsw   m1,        [r3 - 10 * 16]             ; [06]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m1
-
-    movhps      m1,        [r2 + 14]                  ; [00]
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_33, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m0,        [r2 + 1]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m1,        m2, m0, 2
-
-    pmaddubsw   m4,        m0, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 + 4 * 16]              ; [20]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m5,        m2, m0, 4
-
-    pmaddubsw   m5,        [r3 - 2 * 16]              ; [14]
-    pmulhrsw    m5,        m7
-
-    palignr     m6,        m2, m0, 6
-
-    pmaddubsw   m6,        [r3 - 8 * 16]              ; [ 8]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 8
-
-    pmaddubsw   m6,        m1, [r3 - 14 * 16]         ; [ 2]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m1,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 10
-
-    pmaddubsw   m1,        [r3 + 6 * 16]              ; [22]
-    pmulhrsw    m1,        m7
-
-    palignr     m2,        m0, 12
-
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    movu        m0,        [r2 + 8]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m5,        m2, m0, 2
-
-    pmaddubsw   m4,        m0, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m5, [r3 - 12 * 16]         ; [04]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        [r3 + 14 * 16]             ; [30]
-    pmulhrsw    m5,        m7
-
-    palignr     m6,        m2, m0, 4
-
-    pmaddubsw   m6,        [r3 + 8 * 16]              ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 6
-
-    pmaddubsw   m6,        m1, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m6,        m7
-
-    palignr     m1,        m2, m0, 8
-
-    pmaddubsw   m1,        [r3 - 4 * 16]              ; [12]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 10
-
-    pmaddubsw   m1,        [r3 - 10 * 16]             ; [06]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m1
-
-    movh        m2,        [r2 + 14]                  ; [00]
-
-    movh        [r0         ], m4
-    movhps      [r0 + r1    ], m4
-    movh        [r0 + r1 * 2], m5
-    movhps      [r0 + r5    ], m5
-    lea         r0, [r0 + r1 * 4]
-    movh        [r0         ], m6
-    movhps      [r0 + r1    ], m6
-    movh        [r0 + r1 * 2], m1
-    movh        [r0 + r5    ], m2
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_4, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m0,        [r2 + 1]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m1,        m2, m0, 2
-    mova        m5,        m1
-
-    pmaddubsw   m4,        m0, [r3 + 5 * 16]          ; [21]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 - 6 * 16]              ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        [r3 + 15 * 16]             ; [31]
-    pmulhrsw    m5,        m7
-
-    palignr     m6,        m2, m0, 4
-
-    pmaddubsw   m6,        [r3 + 4 * 16]              ; [ 20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 6
-
-    pmaddubsw   m6,        m1, [r3 - 7 * 16]          ; [ 9]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m1,        [r3 + 14 * 16]             ; [30]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 8
-
-    pmaddubsw   m1,        [r3 + 3 * 16]              ; [19]
-    pmulhrsw    m1,        m7
-
-    palignr     m2,        m0, 10
-
-    pmaddubsw   m3,        m2, [r3 - 8 * 16]          ; [8]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m2, [r3 + 13 * 16]         ; [29]
-    pmulhrsw    m4,        m7
-
-    movu        m0,        [r2 + 6]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m1,        m2, m0, 2
-
-    pmaddubsw   m1,        [r3 +  2 * 16]             ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m5,        m2, m0, 4
-    mova        m6,        m5
-
-    pmaddubsw   m5,        [r3 - 9 * 16]              ; [07]
-    pmulhrsw    m5,        m7
-
-    pmaddubsw   m6,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m6,        m2, m0, 6
-
-    pmaddubsw   m6,        [r3 +      16]             ; [17]
-    pmulhrsw    m6,        m7
-
-    palignr     m1,        m2, m0, 8
-    palignr     m2,        m0, 10
-
-    pmaddubsw   m3,        m1, [r3 - 10 * 16]         ; [06]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-
-    pmaddubsw   m1,        [r3 + 11 * 16]             ; [27]
-    pmulhrsw    m1,        m7
-
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_32, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m0,        [r2 + 1]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m1,        m2, m0, 2
-    mova        m5,        m1
-
-
-    pmaddubsw   m4,        m0, [r3 + 5 * 16]          ; [21]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 - 6 * 16]              ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        [r3 + 15 * 16]             ; [31]
-    pmulhrsw    m5,        m7
-
-    palignr     m6,        m2, m0, 4
-
-    pmaddubsw   m6,        [r3 + 4 * 16]              ; [ 20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m0, 6
-
-    pmaddubsw   m6,        m1, [r3 - 7 * 16]          ; [ 9]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m1,        [r3 + 14 * 16]             ; [30]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    palignr     m1,        m2, m0, 8
-
-    pmaddubsw   m1,        [r3 + 3 * 16]              ; [19]
-    pmulhrsw    m1,        m7
-
-    palignr     m2,        m0, 10
-
-    pmaddubsw   m3,        m2, [r3 - 8 * 16]          ; [8]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m2, [r3 + 13 * 16]         ; [29]
-    pmulhrsw    m4,        m7
-
-    movu        m0,        [r2 + 6]
-    palignr     m1,        m0, 1
-
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m1,        m2, m0, 2
-
-    pmaddubsw   m1,        [r3 +  2 * 16]             ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m5,        m2, m0, 4
-    mova        m6,        m5
-
-    pmaddubsw   m5,        [r3 - 9 * 16]              ; [07]
-    pmulhrsw    m5,        m7
-
-    pmaddubsw   m6,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m6,        m2, m0, 6
-
-    pmaddubsw   m6,        [r3 +      16]             ; [17]
-    pmulhrsw    m6,        m7
-
-    palignr     m1,        m2, m0, 8
-    palignr     m2,        m0, 10
-
-    pmaddubsw   m3,        m1, [r3 - 10 * 16]         ; [06]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-
-    pmaddubsw   m1,        [r3 + 11 * 16]             ; [27]
-    pmulhrsw    m1,        m7
-
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_5, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    movu        m1,        [r2 + 2]                   ;[17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m2,        m3, m1                     ;[17 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m3,        m1                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    palignr     m5,        m2, m3, 2
-
-    pmaddubsw   m4,        m3, [r3 +      16]         ; [17]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m5, [r3 - 14 * 16]         ; [2]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m3, 4
-
-    pmaddubsw   m5,        [r3 + 3 * 16]              ; [19]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m1,        m6, [r3 - 12 * 16]         ; [4]
-    pmulhrsw    m1,        m7
-    packuswb    m5,        m1
-
-    palignr     m1,        m2, m3, 6
-
-    pmaddubsw   m6,        [r3 + 5 * 16]              ; [21]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 - 10 * 16]         ; [6]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m0,        m2, m3, 8
-
-    pmaddubsw   m1,        [r3 + 7 * 16]              ; [23]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        [r3 - 8 * 16]              ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    palignr     m4,        m2, m3, 8
-    palignr     m5,        m2, m3, 10
-
-    pmaddubsw   m4,        [r3 + 9 * 16]              ; [25]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m5, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m3, 12
-
-    pmaddubsw   m5,        [r3 + 11 * 16]             ; [27]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m1,        m6, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m1,        m7
-    packuswb    m5,        m1
-
-    palignr     m1,        m2, m3, 14
-
-    pmaddubsw   m6,        [r3 + 13 * 16]             ; [29]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        [r3 + 15 * 16]             ; [31]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_31, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    movu        m1,        [r2 + 2]                   ;[17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m2,        m3, m1                     ;[17 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m3,        m1                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    palignr     m5,        m2, m3, 2
-
-    pmaddubsw   m4,        m3, [r3 +      16]         ; [17]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m5, [r3 - 14 * 16]         ; [2]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m3, 4
-
-    pmaddubsw   m5,        [r3 + 3 * 16]              ; [19]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m1,        m6, [r3 - 12 * 16]         ; [4]
-    pmulhrsw    m1,        m7
-    packuswb    m5,        m1
-
-    palignr     m1,        m2, m3, 6
-
-    pmaddubsw   m6,        [r3 + 5 * 16]              ; [21]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 - 10 * 16]         ; [6]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m0,        m2, m3, 8
-
-    pmaddubsw   m1,        [r3 + 7 * 16]              ; [23]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        [r3 - 8 * 16]              ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    palignr     m4,        m2, m3, 8
-    palignr     m5,        m2, m3, 10
-
-    pmaddubsw   m4,        [r3 + 9 * 16]              ; [25]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m5, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m3, 12
-
-    pmaddubsw   m5,        [r3 + 11 * 16]             ; [27]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m1,        m6, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m1,        m7
-    packuswb    m5,        m1
-
-    palignr     m1,        m2, m3, 14
-
-    pmaddubsw   m6,        [r3 + 13 * 16]             ; [29]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        [r3 + 15 * 16]             ; [31]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_6, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m1,        m3, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m2,        m3, m1                     ;[x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m3,        m1                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m3, [r3 - 3 * 16]          ; [13]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m3, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m3, 2
-
-    pmaddubsw   m5,        m6, [r3 - 9 * 16]          ; [7]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        [r3 + 4 * 16]              ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m3, 4
-
-    pmaddubsw   m6,        m1, [r3 - 15 * 16]         ; [1]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m0,        m2, m3, 6
-
-    pmaddubsw   m1,        [r3 + 11 * 16]             ; [27]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        [r3 - 8 * 16]              ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    palignr     m4,        m2, m3, 6
-    palignr     m6,        m2, m3, 8
-
-    pmaddubsw   m4,        [r3 +  5 * 16]             ; [21]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m6, [r3 - 14 * 16]         ; [2]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        m6, [r3 - 16]              ; [15]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m0,        m2, m3, 10
-
-    pmaddubsw   m6,        m0, [r3 - 7 * 16]          ; [9]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        [r3 + 6 * 16]              ; [22]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m2,        m3, 12
-
-    pmaddubsw   m1,        m2, [r3 - 13 * 16]         ; [3]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_30, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m1,        m3, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m2,        m3, m1                     ;[x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m3,        m1                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m3, [r3 - 3 * 16]          ; [13]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m3, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m6,        m2, m3, 2
-
-    pmaddubsw   m5,        m6, [r3 - 9 * 16]          ; [7]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        [r3 + 4 * 16]              ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m1,        m2, m3, 4
-
-    pmaddubsw   m6,        m1, [r3 - 15 * 16]         ; [1]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m0,        m2, m3, 6
-
-    pmaddubsw   m1,        [r3 + 11 * 16]             ; [27]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        [r3 - 8 * 16]              ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    palignr     m4,        m2, m3, 6
-    palignr     m6,        m2, m3, 8
-
-    pmaddubsw   m4,        [r3 +  5 * 16]             ; [21]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m6, [r3 - 14 * 16]         ; [2]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        m6, [r3 - 16]              ; [15]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m0,        m2, m3, 10
-
-    pmaddubsw   m6,        m0, [r3 - 7 * 16]          ; [9]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        [r3 + 6 * 16]              ; [22]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m2,        m3, 12
-
-    pmaddubsw   m1,        m2, [r3 - 13 * 16]         ; [3]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_7, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]       ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m1,        m3, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m2,        m3, m1                     ;[x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m3,        m1                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m3, [r3 - 7 * 16]          ; [9]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m3, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    palignr     m1,        m2, m3, 2
-
-    pmaddubsw   m5,        m3, [r3 + 11 * 16]         ; [27]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m1, [r3 - 12 * 16]         ; [4]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r3 - 3 * 16]          ; [13]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 + 6 * 16]          ; [22]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m0,        m2, m3, 4
-
-    pmaddubsw   m1,        [r3 + 15 * 16]             ; [31]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        [r3 - 8 * 16]              ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    palignr     m1,        m2, m3, 4
-
-    pmaddubsw   m4,        m1, [r3 + 16]              ; [17]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 + 10 * 16]             ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m0,        m2, m3, 6
-
-    pmaddubsw   m5,        m0, [r3 - 13 * 16]         ; [03]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m0, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r3 + 5 * 16]          ; [21]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        [r3 + 14 * 16]             ; [30]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m2,        m3, 8
-
-    pmaddubsw   m1,        m2, [r3 - 9 * 16]          ; [07]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_29, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m1,        m3, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m2,        m3, m1                     ;[x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m3,        m1                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m3, [r3 - 7 * 16]          ; [9]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m3, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    palignr     m1,        m2, m3, 2
-
-    pmaddubsw   m5,        m3, [r3 + 11 * 16]         ; [27]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m1, [r3 - 12 * 16]         ; [4]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r3 - 3 * 16]          ; [13]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m1, [r3 + 6 * 16]          ; [22]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m0,        m2, m3, 4
-
-    pmaddubsw   m1,        [r3 + 15 * 16]             ; [31]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        [r3 - 8 * 16]              ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    palignr     m1,        m2, m3, 4
-
-    pmaddubsw   m4,        m1, [r3 + 16]              ; [17]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        [r3 + 10 * 16]             ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    palignr     m0,        m2, m3, 6
-
-    pmaddubsw   m5,        m0, [r3 - 13 * 16]         ; [03]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m0, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r3 + 5 * 16]          ; [21]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        [r3 + 14 * 16]             ; [30]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m2,        m3, 8
-
-    pmaddubsw   m1,        m2, [r3 - 9 * 16]          ; [07]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m2,        [r3]                       ; [16]
-    pmulhrsw    m2,        m7
-    packuswb    m1,        m2
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_8, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m1,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m3,        m1, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m0,        m1, m3                     ;[x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m1,        m3                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m1, [r3 - 11 * 16]         ; [5]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m2,        m1, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m2,        m7
-    packuswb    m4,        m2
-
-    pmaddubsw   m5,        m1, [r3 - 1 * 16]          ; [15]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m1, [r3 + 4 * 16]          ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r3 + 9 * 16]          ; [25]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m2,        m1, [r3 + 14 * 16]         ; [30]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-
-    palignr     m2,        m0, m1, 2
-    palignr     m3,        m0, m1, 4
-
-    pmaddubsw   m1,        m2, [r3 - 13 * 16]         ; [3]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m2, [r3 - 8 * 16]          ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m2, [r3 - 3 * 16]          ; [13]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m2, [r3 + 7 * 16]          ; [23]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m2,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m2,        m7
-    packuswb    m5,        m2
-
-    pmaddubsw   m6,        m3, [r3 - 15 * 16]         ; [01]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r3 - 10 * 16]         ; [06]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r3 - 5 * 16]          ; [11]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r3]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_28, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m1,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m3,        m1, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpckhbw   m0,        m1, m3                     ;[x 16 16 15 15 14 14 13 13 12 12 11 11 10 10 9]
-    punpcklbw   m1,        m3                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m1, [r3 - 11 * 16]         ; [5]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m2,        m1, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m2,        m7
-    packuswb    m4,        m2
-
-    pmaddubsw   m5,        m1, [r3 - 1 * 16]          ; [15]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m1, [r3 + 4 * 16]          ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m1, [r3 + 9 * 16]          ; [25]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m2,        m1, [r3 + 14 * 16]         ; [30]
-    pmulhrsw    m2,        m7
-    packuswb    m6,        m2
-
-    palignr     m2,        m0, m1, 2
-    palignr     m3,        m0, m1, 4
-
-    pmaddubsw   m1,        m2, [r3 - 13 * 16]         ; [3]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m2, [r3 - 8 * 16]          ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m2, [r3 - 3 * 16]          ; [13]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m2, [r3 + 7 * 16]          ; [23]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m2,        [r3 + 12 * 16]             ; [28]
-    pmulhrsw    m2,        m7
-    packuswb    m5,        m2
-
-    pmaddubsw   m6,        m3, [r3 - 15 * 16]         ; [01]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r3 - 10 * 16]         ; [06]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r3 - 5 * 16]          ; [11]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r3]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_9, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m2,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m3,        m2, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpcklbw   m2,        m3                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m2, [r3 - 14 * 16]         ; [2]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m2, [r3 - 12 * 16]         ; [4]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    pmaddubsw   m5,        m2, [r3 - 10 * 16]         ; [6]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r3 - 8 * 16]          ; [8]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m2, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m2, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m2, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m2, [r3]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m2, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r3 + 4 * 16]          ; [20]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m2, [r3 + 6 * 16]          ; [22]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r3 + 8 * 16]          ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m2, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r3 + 12 * 16]         ; [28]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m2, [r3 + 14 * 16]         ; [30]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m1
-
-    punpcklqdq  m1,        m3                         ; [00]
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_27, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2 + 1]                   ;[16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    palignr     m2,        m3, 1                      ;[x 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2]
-    punpcklbw   m3,        m2                         ;[9 8 8 7 7 6 6 5 5 4 4 3 3 2 2 1]
-
-    pmaddubsw   m4,        m3, [r3 - 14 * 16]         ; [2]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m3, [r3 - 12 * 16]         ; [4]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    pmaddubsw   m5,        m3, [r3 - 10 * 16]         ; [6]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r3 - 8 * 16]          ; [8]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r3]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r3 + 4 * 16]          ; [20]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r3 + 6 * 16]          ; [22]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r3 + 8 * 16]          ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r3 + 12 * 16]         ; [28]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r3 + 14 * 16]         ; [30]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m1
-
-    movh        [r0         ], m4
-    movhps      [r0 + r1    ], m4
-    movh        [r0 + r1 * 2], m5
-    movhps      [r0 + r5    ], m5
-    lea         r0, [r0 + r1 * 4]
-    movh        [r0         ], m6
-    movhps      [r0 + r1    ], m6
-    movh        [r0 + r1 * 2], m1
-    movh        [r0 + r5    ], m2
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_10, 6,6,8
-    lea         r4,             [r1 * 3]
-    pxor        m7,        m7
-
-    movu        m0,        [r2 + 1]
-    palignr     m1,        m0, 1
-    pshufb      m1,        m7
-    palignr     m2,        m0, 2
-    pshufb      m2,        m7
-    palignr     m3,        m0, 3
-    pshufb      m3,        m7
-    palignr     m4,        m0, 4
-    pshufb      m4,        m7
-    palignr     m5,        m0, 5
-    pshufb      m5,        m7
-    palignr     m6,        m0, 6
-    pshufb      m6,        m7
-
-    movu        [r0 + r1],      m1
-    movu        [r0 + r1 * 2],  m2
-    movu        [r0 + r4],      m3
-    lea         r2,             [r0 + r1 * 4]
-    movu        [r2],           m4
-    movu        [r2 + r1],      m5
-    movu        [r2 + r1 * 2],  m6
-
-    palignr     m1,        m0, 7
-    pshufb      m1,        m7
-    movhlps     m2,        m0
-    pshufb      m2,        m7
-    palignr     m3,        m0, 9
-    pshufb      m3,        m7
-    palignr     m4,        m0, 10
-    pshufb      m4,        m7
-    palignr     m5,        m0, 11
-    pshufb      m5,        m7
-    palignr     m6,        m0, 12
-    pshufb      m6,        m7
-
-    movu        [r2 + r4],      m1
-    lea         r2,             [r2 + r1 * 4]
-    movu        [r2],           m2
-    movu        [r2 + r1],      m3
-    movu        [r2 + r1 * 2],  m4
-    movu        [r2 + r4],      m5
-    lea         r2,             [r2 + r1 * 4]
-    movu        [r2],           m6
-
-    palignr     m1,        m0, 13
-    pshufb      m1,        m7
-    palignr     m2,        m0, 14
-    pshufb      m2,        m7
-    palignr     m3,        m0, 15
-    pshufb      m3,        m7
-    pshufb      m0,        m7
-
-    movu        [r2 + r1],      m1
-    movu        [r2 + r1 * 2],  m2
-    movu        [r2 + r4],      m3
-
-; filter
-    cmp         r5w, byte 0
-    jz         .quit
-    pmovzxbw    m0,        m0
-    mova        m1,        m0
-    movu        m2,        [r3]
-    movu        m3,        [r3 + 1]
-
-    pshufb      m2,        m7
-    pmovzxbw    m2,        m2
-    movhlps     m4,        m3
-    pmovzxbw    m3,        m3
-    pmovzxbw    m4,        m4
-    psubw       m3,        m2
-    psubw       m4,        m2
-    psraw       m3,        1
-    psraw       m4,        1
-    paddw       m0,        m3
-    paddw       m1,        m4
-    packuswb    m0,        m1
-
-.quit:
-    movu        [r0],      m0
-
-    RET
-
-INIT_XMM sse4
-%if ARCH_X86_64 == 1
-cglobal intra_pred_ang16_26, 4,8,5
-    mov     r7, r5mp
-    %define bfilter r7w
-%else
-    cglobal intra_pred_ang16_26, 6,7,5,0 - 4
-    %define bfilter dword[rsp]
-    mov     bfilter, r5
-%endif
-    movu        m0,             [r3 + 1]
-
-    lea         r4,             [r1 * 3]
-    lea         r3,             [r0 + r1 * 4]
-    lea         r5,             [r3 + r1 * 4]
-    lea         r6,             [r5 + r1 * 4]
-
-    movu        [r0],           m0
-    movu        [r0 + r1],      m0
-    movu        [r0 + r1 * 2],  m0
-    movu        [r0 + r4],      m0
-    movu        [r3],           m0
-    movu        [r3 + r1],      m0
-    movu        [r3 + r1 * 2],  m0
-    movu        [r3 + r4],      m0
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-
-    movu        [r6],           m0
-    movu        [r6 + r1],      m0
-    movu        [r6 + r1 * 2],  m0
-    movu        [r6 + r4],      m0
-
-; filter
-    cmp         bfilter, byte 0
-    jz         .quit
-
-    pxor        m4,        m4
-    pshufb      m0,        m4
-    pmovzxbw    m0,        m0
-    mova        m1,        m0
-    movu        m2,        [r2]
-    movu        m3,        [r2 + 1]
-
-    pshufb      m2,        m4
-    pmovzxbw    m2,        m2
-    movhlps     m4,        m3
-    pmovzxbw    m3,        m3
-    pmovzxbw    m4,        m4
-    psubw       m3,        m2
-    psubw       m4,        m2
-    psraw       m3,        1
-    psraw       m4,        1
-    paddw       m0,        m3
-    paddw       m1,        m4
-    packuswb    m0,        m1
-
-    pextrb      [r0],           m0, 0
-    pextrb      [r0 + r1],      m0, 1
-    pextrb      [r0 + r1 * 2],  m0, 2
-    pextrb      [r0 + r4],      m0, 3
-    pextrb      [r3],           m0, 4
-    pextrb      [r3 + r1],      m0, 5
-    pextrb      [r3 + r1 * 2],  m0, 6
-    pextrb      [r3 + r4],      m0, 7
-    pextrb      [r5],           m0, 8
-    pextrb      [r5 + r1],      m0, 9
-    pextrb      [r5 + r1 * 2],  m0, 10
-    pextrb      [r5 + r4],      m0, 11
-    pextrb      [r6],           m0, 12
-    pextrb      [r6 + r1],      m0, 13
-    pextrb      [r6 + r1 * 2],  m0, 14
-    pextrb      [r6 + r4],      m0, 15
-
-.quit:
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_11, 3,7,8
-
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2]                   ;[15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    mova        m2,        m3
-    palignr     m1,        m3, 1                  ;[15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    punpcklbw   m3,        m1                     ;[8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m3, [r3 + 14 * 16]         ; [30]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m3, [r3 + 12 * 16]         ; [28]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    pmaddubsw   m5,        m3, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r3 + 8 * 16]          ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r3 + 6 * 16]          ; [22]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r3 + 4 * 16]          ; [20]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r3]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r3 - 8 * 16]          ; [08]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r3 - 10 * 16]         ; [06]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r3 - 12 * 16]         ; [04]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r3 - 14 * 16]         ; [02]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m1
-    punpcklqdq  m1,        m2                         ;[00]
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_25, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       2
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-.loop:
-    movu        m3,        [r2]                   ;[15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    mova        m2,        m3
-    palignr     m1,        m3, 1                  ;[15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    punpcklbw   m3,        m1                     ;[8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m3, [r3 + 14 * 16]         ; [30]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m3, [r3 + 12 * 16]         ; [28]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    pmaddubsw   m5,        m3, [r3 + 10 * 16]         ; [26]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r3 + 8 * 16]          ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r3 + 6 * 16]          ; [22]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r3 + 4 * 16]          ; [20]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r3 + 2 * 16]          ; [18]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r3]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r3 - 2 * 16]          ; [14]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r3 - 4 * 16]          ; [12]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r3 - 6 * 16]          ; [10]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r3 - 8 * 16]          ; [08]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r3 - 10 * 16]         ; [06]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r3 - 12 * 16]         ; [04]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r3 - 14 * 16]         ; [02]
-    pmulhrsw    m1,        m7
-    packuswb    m1,        m1
-
-    movh        [r0         ], m4
-    movhps      [r0 + r1    ], m4
-    movh        [r0 + r1 * 2], m5
-    movhps      [r0 + r5    ], m5
-    lea         r0, [r0 + r1 * 4]
-    movh        [r0         ], m6
-    movhps      [r0 + r1    ], m6
-    movh        [r0 + r1 * 2], m1
-    movh        [r0 + r5    ], m2
-
-    lea         r0,        [r6 + 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_12, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m0,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_12]
-
-    palignr     m0,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m0, [r4 + 11 * 16]         ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m0, [r4 + 6 * 16]          ; [22]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        m0, [r4 + 1 * 16]          ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m0, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r4 - 9 * 16]          ; [7]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        [r4 - 14 * 16]             ; [2]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 + 5 * 16]          ; [21]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-
-    movu        m1,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 x x x x x x x]
-
-    pmaddubsw   m4,        m3, [r4 + 11 * 16]         ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 + 6 * 16]          ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 + 1 * 16]          ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 9 * 16]          ; [7]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 14 * 16]         ; [2]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 + 5 * 16]          ; [21]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_24, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r3]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m0,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r2]
-    pshufb      m2,        [c_mode16_12]
-
-    palignr     m0,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m0, [r4 + 11 * 16]         ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m1,        m0, [r4 + 6 * 16]          ; [22]
-    pmulhrsw    m1,        m7
-    packuswb    m4,        m1
-
-    pmaddubsw   m5,        m0, [r4 + 1 * 16]          ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m0, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m0, [r4 - 9 * 16]          ; [7]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        [r4 - 14 * 16]             ; [2]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 + 5 * 16]          ; [21]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-
-    movu        m1,        [r3 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 x x x x x x x]
-
-    pmaddubsw   m4,        m3, [r4 + 11 * 16]         ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 + 6 * 16]          ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 + 1 * 16]          ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 9 * 16]          ; [7]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 14 * 16]         ; [2]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 + 5 * 16]          ; [21]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_13, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m5,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_13]
-
-    palignr     m5,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m5, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m5, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    pmaddubsw   m5,        [r4 - 11 * 16]             ; [05]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 6 * 16]          ; [10]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-
-    movu        m1,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 x x x x x x x]
-
-    pmaddubsw   m4,        m3, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 6 * 16]          ; [10]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_23, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r3]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m5,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r2]
-    pshufb      m2,        [c_mode16_13]
-
-    palignr     m5,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m5, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m0,        m5, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m0,        m7
-    packuswb    m4,        m0
-
-    pmaddubsw   m5,        [r4 - 11 * 16]             ; [05]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 6 * 16]          ; [10]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-
-    movu        m1,        [r3 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 x x x x x x x]
-
-    pmaddubsw   m4,        m3, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 6 * 16]          ; [10]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_14, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m5,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_14]
-
-    palignr     m5,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m5, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        [r4 - 10 * 16]             ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 + 2 * 16]          ; [18]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 + 16]              ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-
-    movu        m1,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 x x x x x x x]
-
-    pmaddubsw   m4,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 + 2 * 16]          ; [18]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 + 16]              ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_22, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r3]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m5,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r2]
-    pshufb      m2,        [c_mode16_14]
-
-    palignr     m5,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        m5, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        [r4 - 10 * 16]             ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 + 2 * 16]          ; [18]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 + 16]              ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-
-    movu        m1,        [r3 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 x x x x x x x]
-
-    pmaddubsw   m4,        m3, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 + 2 * 16]          ; [18]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 + 16]              ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_15, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m4,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_15]
-
-    palignr     m4,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 16]                  ; [15]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 3 * 16]          ; [13]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 9  * 16]         ; [07]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-
-    movu        m1,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 15L]
-
-    pmaddubsw   m4,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 3 * 16]          ; [13]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 -  5 * 16]         ; [11]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 7  * 16]         ; [09]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 9  * 16]         ; [07]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 +  4 * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_21, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r3]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m4,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r2]
-    pshufb      m2,        [c_mode16_15]
-
-    palignr     m4,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 16]                  ; [15]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 3 * 16]          ; [13]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 9  * 16]         ; [07]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-
-    movu        m1,        [r3 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 15L]
-
-    pmaddubsw   m4,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 3 * 16]          ; [13]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 -  5 * 16]         ; [11]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pmaddubsw   m1,        m3, [r4 - 7  * 16]         ; [09]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 9  * 16]         ; [07]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 +  4 * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pmaddubsw   m6,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_16, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m4,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_16]              ; [2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8]
-    palignr     m4,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 5  * 16]             ; [11]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 4  * 16]         ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [3, 5, 6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7  * 16]         ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1                           ; [5, 6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 3  * 16]         ; [13]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1                           ; [6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1                           ; [8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 - 2  * 16]         ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1                           ; [9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 9  * 16]         ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1                           ; [12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1                           ; [14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-
-    movu        m1,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    palignr     m2,        m2, 6                      ; [x, x, x, x, x, x, 14, 15, 0, 2, 3, 5, 6, 8, x, x]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 0, 2, 3, 5, 6, 8, x, x]
-
-    pmaddubsw   m4,        m3, [r4 - 5  * 16]         ; [11]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 4  * 16]         ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7  * 16]         ; [23]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m0,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 3  * 16]         ; [13]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 - 2  * 16]         ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 +  9 * 16]         ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_20, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r3]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m4,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r2]
-    pshufb      m2,        [c_mode16_16]              ; [2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8]
-    palignr     m4,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 5  * 16]             ; [11]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m5,        m7
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 4  * 16]         ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [3, 5, 6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7  * 16]         ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1                           ; [5, 6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 3  * 16]         ; [13]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1                           ; [6, 8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1                           ; [8, 9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 - 2  * 16]         ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1                           ; [9, 11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 9  * 16]         ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [11, 12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1                           ; [12, 14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1                           ; [14, 15, 0, 2, 3, 5, 6, 8, x, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-
-    movu        m1,        [r3 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    palignr     m2,        m2, 6                      ; [x, x, x, x, x, x, 14, 15, 0, 2, 3, 5, 6, 8, x, x]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 0, 2, 3, 5, 6, 8, x, x]
-
-    pmaddubsw   m4,        m3, [r4 - 5  * 16]         ; [11]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 15 * 16]         ; [01]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 4  * 16]         ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 7  * 16]         ; [23]
-    pmulhrsw    m6,        m7
-
-    pmaddubsw   m0,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 3  * 16]         ; [13]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pmaddubsw   m4,        m3, [r4 - 13 * 16]         ; [03]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 - 2  * 16]         ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 +  9 * 16]         ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 16]              ; [15]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pmaddubsw   m1,        m3, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m3,        [r4]                       ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_17, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m4,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r3]
-    pshufb      m2,        [c_mode16_17]              ; [1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4]
-    palignr     m4,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 10 * 16]             ; [06]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 -  4 * 16]         ; [12]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1                           ; [2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, x]
-    pinsrb      m2,       [r3 + 5], 0                 ; [2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 8  * 16]         ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1                           ; [5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1                           ; [6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pslldq      m2,       1                           ; [7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m4,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1                           ; [9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1                           ; [10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 -  8 * 16]         ; [08]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 2  * 16]         ; [14]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1                           ; [12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1                           ; [14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4 - 16 * 16]             ; [00]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-
-    movu        m1,        [r2 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    palignr     m2,        m2, 6                      ; [x, x, x, x, x, x, 14, 15, 0, 1, 2, 4, 5, x, x, x]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 0, 1, 2, 4, 5, x, x, x]
-
-    pmaddubsw   m4,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 - 4  * 16]         ; [12]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 8  * 16]         ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 1, m4, m5, m6, m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m4,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 -  8 * 16]         ; [08]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 -  2 * 16]         ; [14]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4 - 16 * 16]             ; [00]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 1, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_19, 4,7,8
-
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    movu        m3,        [r3]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    punpckhbw   m4,        m3, m3                     ; [15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8]
-    punpcklbw   m3,        m3                         ; [7 7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    movu        m2,        [r2]
-    pshufb      m2,        [c_mode16_17]              ; [1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4]
-    palignr     m4,        m3, 1                      ; [8 7 7 6 6 5 5 4 4 3 3 2 2 1 1 0]
-
-    pmaddubsw   m4,        [r4 - 10 * 16]             ; [06]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 15
-
-    pmaddubsw   m5,        m3, [r4 -  4 * 16]         ; [12]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1                           ; [2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, x]
-    pinsrb      m2,       [r2 + 5], 0                 ; [2, 4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 8  * 16]         ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [4, 5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1                           ; [5, 6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1                           ; [6, 7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pslldq      m2,       1                           ; [7, 9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m4,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1                           ; [9, 10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1                           ; [10, 11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 -  8 * 16]         ; [08]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1                           ; [11, 12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 - 2  * 16]         ; [14]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1                           ; [12, 14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1                           ; [14, 15, 0, 1, 2, 4, 5, x, x, x, x, x, x, x, x, x]
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4 - 16 * 16]             ; [00]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    lea         r0,        [r6 + 8]
-
-    movu        m1,        [r3 + 1]                   ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    pslldq      m3,        m1, 1                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 x]
-    punpckhbw   m3,        m1                         ; [16 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8]
-    palignr     m2,        m2, 6                      ; [x, x, x, x, x, 14, 15, 0, 1, 2, 4, 5, x, x, x]
-    movlhps     m2,        m1                         ; [8 7 6 5 4 3 2 1 0, 2, 3, 5, 6, 8, x, x]
-
-    pmaddubsw   m4,        m3, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m4,        m7
-
-    palignr     m3,        m2, 14
-
-    pmaddubsw   m5,        m3, [r4 - 4  * 16]         ; [12]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 2  * 16]         ; [18]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 8  * 16]         ; [24]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m3, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 - 6  * 16]         ; [10]
-    pmulhrsw    m1,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m0,        m3, [r4]                   ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-
-    TRANSPOSE_STORE_8x8 0, 0, m4, m5, m6, m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m4,        m3, [r4 + 6  * 16]         ; [22]
-    pmulhrsw    m4,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m5,        m3, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-
-    pmaddubsw   m5,        m3, [r4 - 14 * 16]         ; [02]
-    pmulhrsw    m5,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 -  8 * 16]         ; [08]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m6,        m3, [r4 -  2 * 16]         ; [14]
-    pmulhrsw    m6,        m7
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 4  * 16]         ; [20]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-
-    pslldq      m2,       1
-    palignr     m3,       m2, 14
-
-    pmaddubsw   m1,        m3, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        [r4 - 16 * 16]             ; [00]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-
-    TRANSPOSE_STORE_8x8 1, 0, m4, m5, m6, m1
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang16_18, 4,5,3
-
-    movu        m0,         [r3]
-    movu        m1,         [r2]
-    mova        m2,         [c_mode16_18]
-    pshufb      m1,         m2
-
-    lea         r2,         [r1 * 2]
-    lea         r3,         [r1 * 3]
-    lea         r4,         [r1 * 4]
-    movu        [r0],       m0
-    palignr     m2,         m0, m1, 15
-    movu        [r0 + r1],  m2
-    palignr     m2,         m0, m1, 14
-    movu        [r0 + r2],  m2
-    palignr     m2,         m0, m1, 13
-    movu        [r0 + r3],  m2
-    lea         r0,         [r0 + r4]
-    palignr     m2,         m0, m1, 12
-    movu        [r0],       m2
-    palignr     m2,         m0, m1, 11
-    movu        [r0 + r1],  m2
-    palignr     m2,         m0, m1, 10
-    movu        [r0 + r2],  m2
-    palignr     m2,         m0, m1, 9
-    movu        [r0 + r3],  m2
-    lea         r0,         [r0 + r4]
-    palignr     m2,         m0, m1, 8
-    movu        [r0],       m2
-    palignr     m2,         m0, m1, 7
-    movu        [r0 + r1],  m2
-    palignr     m2,         m0, m1, 6
-    movu        [r0 + r2],  m2
-    palignr     m2,         m0, m1, 5
-    movu        [r0 + r3],  m2
-    lea         r0,         [r0 + r4]
-    palignr     m2,         m0, m1, 4
-    movu        [r0],       m2
-    palignr     m2,         m0, m1, 3
-    movu        [r0 + r1],  m2
-    palignr     m2,         m0, m1, 2
-    movu        [r0 + r2],  m2
-    palignr     m0,         m1, 1
-    movu        [r0 + r3],  m0
-    RET
-
 ;------------------------------------------------------------------------------------------
 ; void intraPredAng16(pixel* dst, intptr_t dstStride, pixel* src, int dirMode, int bFilter)
 ;------------------------------------------------------------------------------------------
@@ -10504,167 +5859,6 @@
     movu        [r0 + r3],  m0
     RET
 
-;---------------------------------------------------------------------------------------------------------------
-; void intraPredAng32(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;---------------------------------------------------------------------------------------------------------------
-INIT_XMM ssse3
-cglobal intra_pred_ang32_2, 3,4,4
-    cmp             r4m, byte 34
-    cmove           r2, r3mp
-    movu            m0, [r2 + 2]
-    movu            m1, [r2 + 18]
-    movu            m3, [r2 + 34]
-
-    lea             r3, [r1 * 3]
-
-    movu            [r0], m0
-    movu            [r0 + 16], m1
-    palignr         m2, m1, m0, 1
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 1
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 2
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 2
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 3
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 3
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m1, m0, 4
-    movu            [r0], m2
-    palignr         m2, m3, m1, 4
-    movu            [r0 + 16], m2
-    palignr         m2, m1, m0, 5
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 5
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 6
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 6
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 7
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 7
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m1, m0, 8
-    movu            [r0], m2
-    palignr         m2, m3, m1, 8
-    movu            [r0 + 16], m2
-    palignr         m2, m1, m0, 9
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 9
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 10
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 10
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 11
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 11
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m1, m0, 12
-    movu            [r0], m2
-    palignr         m2, m3, m1, 12
-    movu            [r0 + 16], m2
-    palignr         m2, m1, m0, 13
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 13
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 14
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 14
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 15
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 15
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    movu            [r0], m1
-    movu            m0, [r2 + 50]
-    movu            [r0 + 16], m3
-    palignr         m2, m3, m1, 1
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 1
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 2
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 2
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 3
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 3
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m3, m1, 4
-    movu            [r0], m2
-    palignr         m2, m0, m3, 4
-    movu            [r0 + 16], m2
-    palignr         m2, m3, m1, 5
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 5
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 6
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 6
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 7
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 7
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m3, m1, 8
-    movu            [r0], m2
-    palignr         m2, m0, m3, 8
-    movu            [r0 + 16], m2
-    palignr         m2, m3, m1, 9
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 9
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 10
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 10
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 11
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 11
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m3, m1, 12
-    movu            [r0], m2
-    palignr         m2, m0, m3, 12
-    movu            [r0 + 16], m2
-    palignr         m2, m3, m1, 13
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 13
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 14
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 14
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 15
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 15
-    movu            [r0 + r3 + 16], m2
-    RET
-
 ; Process Intra32x32, input 8x8 in [m0, m1, m2, m3, m4, m5, m6, m7], output 8x8
 %macro PROC32_8x8 10  ; col4, transpose[0/1] c0, c1, c2, c3, c4, c5, c6, c7
   %if %3 == 0
@@ -10912,24 +6106,6 @@
 
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_3(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_3, 3,7,8
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_3_33 1
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         r4
-    jnz        .loop
-    RET
 
 %macro MODE_4_32 1
     movu        m0,        [r2 + 1]
@@ -11063,24 +6239,6 @@
 
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;-----------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_4(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_4, 3,7,8
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                    ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]               ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_4_32 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
 
 %macro MODE_5_31 1
     movu        m0,        [r2 + 1]
@@ -11214,24 +6372,6 @@
 
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_5(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_5, 3,7,8
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_5_31 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
 
 %macro MODE_6_30 1
     movu        m0,        [r2 + 1]
@@ -11354,24 +6494,6 @@
 
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_6(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_6, 3,7,8
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                  ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]             ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_6_30 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
 
 %macro MODE_7_29 1
     movu        m0,        [r2 + 1]
@@ -11487,24 +6609,6 @@
 
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_7(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_7, 3,7,8
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]               ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]          ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_7_29 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
 
 %macro MODE_8_28 1
     movu        m0,        [r2 + 1]
@@ -11617,24 +6721,6 @@
 
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_8(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_8, 3,7,8
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]       ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_8_28 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
 
 %macro MODE_9_27 1
     movu        m2,        [r2 + 1]
@@ -11737,11 +6823,383 @@
 
      TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_9(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_9, 3,7,8
+
+%macro MODE_12_24 1
+    movu        m2,        [r2]
+    palignr     m1,        m2, 1
+    punpckhbw   m0,        m2, m1
+    punpcklbw   m2,        m1
+    palignr     m0,        m2, 2
+    pmaddubsw   m4,        m0, [r4 + 11 * 16]         ; [27]
+    pmulhrsw    m4,        m7
+    pmaddubsw   m3,        m0, [r4 + 6 * 16]          ; [22]
+    pmulhrsw    m3,        m7
+    packuswb    m4,        m3
+    pmaddubsw   m5,        m0, [r4 + 16]              ; [17]
+    pmulhrsw    m5,        m7
+    pmaddubsw   m6,        m0, [r4 - 4 * 16]          ; [12]
+    pmulhrsw    m6,        m7
+    packuswb    m5,        m6
+    pmaddubsw   m6,        m0, [r4 - 9 * 16]          ; [7]
+    pmulhrsw    m6,        m7
+    pmaddubsw   m3,        m0, [r4 - 14 * 16]         ; [2]
+    pmulhrsw    m3,        m7
+    packuswb    m6,        m3
+    pmaddubsw   m1,        m2, [r4 + 13 * 16]         ; [29]
+    pmulhrsw    m1,        m7
+    pmaddubsw   m3,        m2, [r4 + 8 * 16]          ; [24]
+    pmulhrsw    m3,        m7
+    packuswb    m1,        m3
+    TRANSPOSE_STORE_8x8 0, %1, m4, m5, m6, m1
+    pmaddubsw   m4,        m2, [r4 + 3 * 16]          ; [19]
+    pmulhrsw    m4,        m7
+    pmaddubsw   m5,        m2, [r4 - 2 * 16]          ; [14]
+    pmulhrsw    m5,        m7
+    packuswb    m4,        m5
+    pmaddubsw   m5,        m2, [r4 - 7 * 16]          ; [09]
+    pmulhrsw    m5,        m7
+    pmaddubsw   m6,        m2, [r4 - 12 * 16]         ; [04]
+    pmulhrsw    m6,        m7
+    packuswb    m5,        m6
+    movu        m0,        [r2 - 2]
+    palignr     m1,        m0, 1
+    punpckhbw   m2,        m0, m1
+    punpcklbw   m0,        m1
+    palignr     m2,        m0, 2
+    pmaddubsw   m6,        m2, [r4 + 15 * 16]         ; [31]
+    pmulhrsw    m6,        m7
+    pmaddubsw   m1,        m2, [r4 + 10 * 16]         ; [26]
+    pmulhrsw    m1,        m7
+    packuswb    m6,        m1
+    pmaddubsw   m1,        m2, [r4 + 5 * 16]          ; [21]
+    pmulhrsw    m1,        m7
+    pmaddubsw   m3,        m2, [r4]                   ; [16]
+    pmulhrsw    m3,        m7
+    packuswb    m1,        m3
+    TRANSPOSE_STORE_8x8 1, %1, m4, m5, m6, m1
+    pmaddubsw   m4,        m2, [r4 - 5 * 16]          ; [11]
+    pmulhrsw    m4,        m7
+    pmaddubsw   m3,        m2, [r4 - 10 * 16]         ; [06]
+    pmulhrsw    m3,        m7
+    packuswb    m4,        m3
+    pmaddubsw   m5,        m2, [r4 - 15 * 16]         ; [1]
+    pmulhrsw    m5,        m7
+    movu        m0,        [r2 - 3]
+    palignr     m1,        m0, 1
+    punpckhbw   m2,        m0, m1
+    punpcklbw   m0,        m1
+    palignr     m2,        m0, 2
+    pmaddubsw   m6,        m2, [r4 + 12 * 16]         ; [28]
+    pmulhrsw    m6,        m7
+    packuswb    m5,        m6
+    pmaddubsw   m6,        m2, [r4 + 7 * 16]          ; [23]
+    pmulhrsw    m6,        m7
+    pmaddubsw   m3,        m2, [r4 + 2 * 16]          ; [18]
+    pmulhrsw    m3,        m7
+    packuswb    m6,        m3
+    pmaddubsw   m1,        m2, [r4 - 3 * 16]          ; [13]
+    pmulhrsw    m1,        m7
+    pmaddubsw   m3,        m2, [r4 - 8 * 16]          ; [8]
+    pmulhrsw    m3,        m7
+    packuswb    m1,        m3
+    TRANSPOSE_STORE_8x8 2, %1, m4, m5, m6, m1
+    pmaddubsw   m4,        m2, [r4 - 13 * 16]         ; [3]
+    pmulhrsw    m4,        m7
+    movu        m2,        [r2 - 4]
+    palignr     m1,        m2, 1
+    punpckhbw   m0,        m2, m1
+    punpcklbw   m2,        m1
+    palignr     m0,        m2, 2
+    pmaddubsw   m5,        m0, [r4 + 14 * 16]         ; [30]
+    pmulhrsw    m5,        m7
+    packuswb    m4,        m5
+    pmaddubsw   m5,        m0, [r4 + 9 * 16]          ; [25]
+    pmulhrsw    m5,        m7
+    pmaddubsw   m6,        m0, [r4 + 4 * 16]          ; [20]
+    pmulhrsw    m6,        m7
+    packuswb    m5,        m6
+    pmaddubsw   m6,        m0, [r4 - 16]              ; [15]
+    pmulhrsw    m6,        m7
+    pmaddubsw   m1,        m0, [r4 - 6 * 16]          ; [10]
+    pmulhrsw    m1,        m7
+    packuswb    m6,        m1
+    pmaddubsw   m1,        m0, [r4 - 11 * 16]         ; [05]
+    pmulhrsw    m1,        m7
+    movu        m2,        [pb_fact0]
+    pshufb      m0,        m2
+    pmovzxbw    m0,        m0
+    packuswb    m1,        m0
+    TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
+%endmacro
+
+;------------------------------------------------------------------------------------------
+; void intraPredAng32(pixel* dst, intptr_t dstStride, pixel* src, int dirMode, int bFilter)
+;------------------------------------------------------------------------------------------
+INIT_XMM ssse3
+cglobal intra_pred_ang32_2_new, 3,5,4
+    lea             r4, [r2]
+    add             r2, 64
+    cmp             r3m, byte 34
+    cmove           r2, r4
+    movu            m0, [r2 + 2]
+    movu            m1, [r2 + 18]
+    movu            m3, [r2 + 34]
+
+    lea             r3, [r1 * 3]
+
+    movu            [r0], m0
+    movu            [r0 + 16], m1
+    palignr         m2, m1, m0, 1
+    movu            [r0 + r1], m2
+    palignr         m2, m3, m1, 1
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m1, m0, 2
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m3, m1, 2
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m1, m0, 3
+    movu            [r0 + r3], m2
+    palignr         m2, m3, m1, 3
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    palignr         m2, m1, m0, 4
+    movu            [r0], m2
+    palignr         m2, m3, m1, 4
+    movu            [r0 + 16], m2
+    palignr         m2, m1, m0, 5
+    movu            [r0 + r1], m2
+    palignr         m2, m3, m1, 5
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m1, m0, 6
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m3, m1, 6
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m1, m0, 7
+    movu            [r0 + r3], m2
+    palignr         m2, m3, m1, 7
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    palignr         m2, m1, m0, 8
+    movu            [r0], m2
+    palignr         m2, m3, m1, 8
+    movu            [r0 + 16], m2
+    palignr         m2, m1, m0, 9
+    movu            [r0 + r1], m2
+    palignr         m2, m3, m1, 9
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m1, m0, 10
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m3, m1, 10
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m1, m0, 11
+    movu            [r0 + r3], m2
+    palignr         m2, m3, m1, 11
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    palignr         m2, m1, m0, 12
+    movu            [r0], m2
+    palignr         m2, m3, m1, 12
+    movu            [r0 + 16], m2
+    palignr         m2, m1, m0, 13
+    movu            [r0 + r1], m2
+    palignr         m2, m3, m1, 13
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m1, m0, 14
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m3, m1, 14
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m1, m0, 15
+    movu            [r0 + r3], m2
+    palignr         m2, m3, m1, 15
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    movu            [r0], m1
+    movu            m0, [r2 + 50]
+    movu            [r0 + 16], m3
+    palignr         m2, m3, m1, 1
+    movu            [r0 + r1], m2
+    palignr         m2, m0, m3, 1
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m3, m1, 2
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m0, m3, 2
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m3, m1, 3
+    movu            [r0 + r3], m2
+    palignr         m2, m0, m3, 3
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    palignr         m2, m3, m1, 4
+    movu            [r0], m2
+    palignr         m2, m0, m3, 4
+    movu            [r0 + 16], m2
+    palignr         m2, m3, m1, 5
+    movu            [r0 + r1], m2
+    palignr         m2, m0, m3, 5
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m3, m1, 6
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m0, m3, 6
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m3, m1, 7
+    movu            [r0 + r3], m2
+    palignr         m2, m0, m3, 7
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    palignr         m2, m3, m1, 8
+    movu            [r0], m2
+    palignr         m2, m0, m3, 8
+    movu            [r0 + 16], m2
+    palignr         m2, m3, m1, 9
+    movu            [r0 + r1], m2
+    palignr         m2, m0, m3, 9
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m3, m1, 10
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m0, m3, 10
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m3, m1, 11
+    movu            [r0 + r3], m2
+    palignr         m2, m0, m3, 11
+    movu            [r0 + r3 + 16], m2
+
+    lea             r0, [r0 + r1 * 4]
+
+    palignr         m2, m3, m1, 12
+    movu            [r0], m2
+    palignr         m2, m0, m3, 12
+    movu            [r0 + 16], m2
+    palignr         m2, m3, m1, 13
+    movu            [r0 + r1], m2
+    palignr         m2, m0, m3, 13
+    movu            [r0 + r1 + 16], m2
+    palignr         m2, m3, m1, 14
+    movu            [r0 + r1 * 2], m2
+    palignr         m2, m0, m3, 14
+    movu            [r0 + r1 * 2 + 16], m2
+    palignr         m2, m3, m1, 15
+    movu            [r0 + r3], m2
+    palignr         m2, m0, m3, 15
+    movu            [r0 + r3 + 16], m2
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_3_new, 3,7,8
+    add         r2,        64
+    lea         r3,        [ang_table + 16 * 16]
+    mov         r4d,       4
+    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
+    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
+    mova        m7,        [pw_1024]
+.loop:
+    MODE_3_33 1
+    lea         r0, [r6 + r1 * 4]
+    lea         r6, [r6 + r1 * 8]
+    add         r2, 8
+    dec         r4
+    jnz        .loop
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_4_new, 3,7,8
+    add         r2,        64
+    lea         r3,        [ang_table + 16 * 16]
+    mov         r4d,       4
+    lea         r5,        [r1 * 3]                    ; r5 -> 3 * stride
+    lea         r6,        [r0 + r1 * 4]               ; r6 -> 4 * stride
+    mova        m7,        [pw_1024]
+.loop:
+    MODE_4_32 1
+    lea         r0,        [r6 + r1 * 4]
+    lea         r6,        [r6 + r1 * 8]
+    add         r2,        8
+    dec         r4
+    jnz        .loop
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_5_new, 3,7,8
+    add         r2,        64
+    lea         r3,        [ang_table + 16 * 16]
+    mov         r4d,       4
+    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
+    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
+    mova        m7,        [pw_1024]
+.loop:
+    MODE_5_31 1
+    lea         r0,        [r6 + r1 * 4]
+    lea         r6,        [r6 + r1 * 8]
+    add         r2,        8
+    dec         r4
+    jnz        .loop
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_6_new, 3,7,8
+    add         r2,        64
+    lea         r3,        [ang_table + 16 * 16]
+    mov         r4d,       4
+    lea         r5,        [r1 * 3]                  ; r5 -> 3 * stride
+    lea         r6,        [r0 + r1 * 4]             ; r6 -> 4 * stride
+    mova        m7,        [pw_1024]
+.loop:
+    MODE_6_30 1
+    lea         r0,        [r6 + r1 * 4]
+    lea         r6,        [r6 + r1 * 8]
+    add         r2,        8
+    dec         r4
+    jnz        .loop
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_7_new, 3,7,8
+    add         r2,        64
+    lea         r3,        [ang_table + 16 * 16]
+    mov         r4d,       4
+    lea         r5,        [r1 * 3]               ; r5 -> 3 * stride
+    lea         r6,        [r0 + r1 * 4]          ; r6 -> 4 * stride
+    mova        m7,        [pw_1024]
+.loop:
+    MODE_7_29 1
+    lea         r0,        [r6 + r1 * 4]
+    lea         r6,        [r6 + r1 * 8]
+    add         r2,        8
+    dec         r4
+    jnz        .loop
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_8_new, 3,7,8
+    add         r2,        64
+    lea         r3,        [ang_table + 16 * 16]
+    mov         r4d,       4
+    lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
+    lea         r6,        [r0 + r1 * 4]       ; r6 -> 4 * stride
+    mova        m7,        [pw_1024]
+.loop:
+    MODE_8_28 1
+    lea         r0,        [r6 + r1 * 4]
+    lea         r6,        [r6 + r1 * 8]
+    add         r2,        8
+    dec         r4
+    jnz        .loop
+    RET
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_9_new, 3,7,8
+    add         r2,        64
     lea         r3,        [ang_table + 16 * 16]
     mov         r4d,       4
     lea         r5,        [r1 * 3]         ; r5 -> 3 * stride
@@ -11756,24 +7214,21 @@
     jnz        .loop
     RET
 
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_10(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_10, 6,7,8,0-(2*mmsize)
+INIT_XMM sse4
+cglobal intra_pred_ang32_10_new, 5,7,8,0-(2*mmsize)
 %define m8 [rsp + 0 * mmsize]
 %define m9 [rsp + 1 * mmsize]
-    lea         r4, [r1 * 3]
     pxor        m7, m7
     mov         r6, 2
-    movu        m0, [r3]
-    movu        m1, [r3 + 1]
+    movu        m0, [r2]
+    movu        m1, [r2 + 1]
     mova        m8, m0
     mova        m9, m1
-    mov         r3d, r5d
-
-.loop:
-    movu        m0, [r2 + 1]
+    mov         r3d, r4d
+    lea         r4, [r1 * 3]
+
+.loop:
+    movu        m0, [r2 + 1 + 64]
     palignr     m1, m0, 1
     pshufb      m1, m7
     palignr     m2, m0, 2
@@ -11875,26 +7330,23 @@
     jnz         .loop
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_11(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_11, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_11_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-
     mov         r6, rsp
     sub         rsp, 64+gprsize
     and         rsp, ~63
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3 + 16]
+    movu        m0, [r2 + 16]
     pxor        m1, m1
     pshufb      m0, m1                   ; [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
     mova        [rsp], m0
-    movu        m0, [r2]
-    movu        m1, [r2 + 16]
-    movu        m2, [r2 + 32]
+    movu        m0, [r2 + 64]
+    pinsrb      m0, [r2], 0
+    movu        m1, [r2 + 16 + 64]
+    movu        m2, [r2 + 32 + 64]
     movu        [rsp + 1], m0
     movu        [rsp + 1 + 16], m1
     movu        [rsp + 1 + 32], m2
@@ -11962,12 +7414,15 @@
     mov         rsp, [rsp+64]
     RET
 
-%macro MODE_12_24_ROW0 1
+%macro MODE_12_24_ROW0_NEW 1
     movu        m0,        [r3 + 6]
     pshufb      m0,        [c_mode32_12_0]
     pinsrb      m0,        [r3 + 26], 12
     mova        above,     m0
     movu        m2,        [r2]
+  %if %1 == 1
+    pinsrb      m2,        [r3], 0
+  %endif
     palignr     m1,        m2, 1
     punpcklbw   m2,        m1
     pmaddubsw   m4,        m2, [r4 + 11 * 16]         ; [27]
@@ -11986,6 +7441,9 @@
     pmulhrsw    m3,        m7
     packuswb    m6,        m3
     movu        m1,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+  %if %1 == 1
+    pinsrb      m1,        [r3], 0
+  %endif
     palignr     m2,        m1, above, 15              ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
     punpcklbw   m2,        m1                         ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
     pmaddubsw   m1,        m2, [r4 + 13 * 16]             ; [29]
@@ -12065,126 +7523,17 @@
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
 
-%macro MODE_12_24 1
-    movu        m2,        [r2]
-    palignr     m1,        m2, 1
-    punpckhbw   m0,        m2, m1
-    punpcklbw   m2,        m1
-    palignr     m0,        m2, 2
-    pmaddubsw   m4,        m0, [r4 + 11 * 16]         ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m0, [r4 + 6 * 16]          ; [22]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m0, [r4 + 16]              ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m0, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m0, [r4 - 9 * 16]          ; [7]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m3,        m0, [r4 - 14 * 16]         ; [2]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-    pmaddubsw   m1,        m2, [r4 + 13 * 16]         ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 0, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m2, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    movu        m0,        [r2 - 2]
-    palignr     m1,        m0, 1
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m2,        m0, 2
-    pmaddubsw   m6,        m2, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pmaddubsw   m1,        m2, [r4 + 5 * 16]          ; [21]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4]                   ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 1, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m2, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m2, [r4 - 15 * 16]         ; [1]
-    pmulhrsw    m5,        m7
-    movu        m0,        [r2 - 3]
-    palignr     m1,        m0, 1
-    punpckhbw   m2,        m0, m1
-    punpcklbw   m0,        m1
-    palignr     m2,        m0, 2
-    pmaddubsw   m6,        m2, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m3,        m2, [r4 + 2 * 16]          ; [18]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-    pmaddubsw   m1,        m2, [r4 - 3 * 16]          ; [13]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4 - 8 * 16]          ; [8]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 2, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 - 13 * 16]         ; [3]
-    pmulhrsw    m4,        m7
-    movu        m2,        [r2 - 4]
-    palignr     m1,        m2, 1
-    punpckhbw   m0,        m2, m1
-    punpcklbw   m2,        m1
-    palignr     m0,        m2, 2
-    pmaddubsw   m5,        m0, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m0, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m0, [r4 + 4 * 16]          ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m0, [r4 - 16]              ; [15]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m0, [r4 - 6 * 16]          ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pmaddubsw   m1,        m0, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-    movu        m2,        [pb_fact0]
-    pshufb      m0,        m2
-    pmovzxbw    m0,        m0
-    packuswb    m1,        m0
-    TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
-%endmacro
-;-----------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_12(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_12, 4,7,8,0-(1*mmsize)
+INIT_XMM sse4
+cglobal intra_pred_ang32_12_new, 3,7,8,0-(1*mmsize)
   %define above    [rsp + 0 * mmsize]
-
+    mov         r3,        r2
+    add         r2,        64
     lea         r4,        [ang_table + 16 * 16]
     lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
     lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
     mova        m7,        [pw_1024]
 
-    MODE_12_24_ROW0 1
+    MODE_12_24_ROW0_NEW 1
     lea         r0,        [r6 + r1 * 4]
     lea         r6,        [r6 + r1 * 8]
     add         r2,        7
@@ -12198,7 +7547,7 @@
     jnz         .loop
     RET
 
-%macro MODE_13_23_ROW0 1
+%macro MODE_13_23_ROW0_NEW 1
     movu        m0,        [r3 + 1]
     movu        m1,        [r3 + 15]
     pshufb      m0,        [c_mode32_13_0]
@@ -12207,6 +7556,9 @@
     pshufb      m0,        [c_mode32_13_shuf]
     mova        above,     m0
     movu        m2,        [r2]
+  %if (%1 == 1)
+    pinsrb      m2,        [r3], 0
+  %endif
     palignr     m1,        m2, 1
     punpcklbw   m2,        m1
     pmaddubsw   m4,        m2, [r4 + 7 * 16]         ; [23]
@@ -12217,6 +7569,9 @@
     pmaddubsw   m5,        m2, [r4 - 11 * 16]        ; [5]
     pmulhrsw    m5,        m7
     movu        m1,        [r2]                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+  %if (%1 == 1)
+    pinsrb      m1,        [r3], 0
+  %endif
     palignr     m2,        m1, above, 15             ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
     punpcklbw   m2,        m1                        ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
     pmaddubsw   m6,        m2, [r4 + 12 * 16]        ; [28]
@@ -12311,7 +7666,7 @@
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
 
-%macro MODE_13_23 1
+%macro MODE_13_23_NEW 2
     movu        m2,        [r2]                      ; [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
     palignr     m1,        m2, 1                     ; [x ,15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
     punpckhbw   m0,        m2, m1                    ; [x, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8]
@@ -12408,6 +7763,9 @@
     pmulhrsw    m6,        m7
     packuswb    m5,        m6
     movu        m2,        [r2 - 7]                  ; [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
+  %if ((%1 & %2) == 1)
+    pinsrb      m2,        [r3], 0
+  %endif
     palignr     m1,        m2, 1                     ; [x ,15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
     punpcklbw   m2,        m1                        ; [8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0]
     pmaddubsw   m6,        m2, [r4 + 11 * 16]        ; [27]
@@ -12423,24 +7781,29 @@
     packuswb    m1,        m2
     TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
 %endmacro
-;-----------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_13(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_13, 4,7,8,0-(1*mmsize)
+
+INIT_XMM sse4
+cglobal intra_pred_ang32_13_new, 3,7,8,0-(1*mmsize)
 %define above [rsp + 0 * mmsize]
+    mov         r3,        r2
+    add         r2,        64
     lea         r4,        [ang_table + 16 * 16]
     lea         r5,        [r1 * 3]                  ; r5 -> 3 * stride
     lea         r6,        [r0 + r1 * 4]             ; r6 -> 4 * stride
     mova        m7,        [pw_1024]
 
-    MODE_13_23_ROW0 1
+    MODE_13_23_ROW0_NEW 1
     lea         r0,        [r6 + r1 * 4]
     lea         r6,        [r6 + r1 * 8]
     add         r2,        7
-    mov         r3,        3
-.loop:
-    MODE_13_23 1
+
+    MODE_13_23_NEW 1, 1
+    lea         r0,        [r6 + r1 * 4]
+    lea         r6,        [r6 + r1 * 8]
+    add         r2,        8
+    mov         r3,        2
+.loop:
+    MODE_13_23_NEW 1, 0
     lea         r0,        [r6 + r1 * 4]
     lea         r6,        [r6 + r1 * 8]
     add         r2,        8
@@ -12448,11 +7811,8 @@
     jnz         .loop
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_14(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_14, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_14_new, 3,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
     mov         r6, rsp
     sub         rsp, 64+gprsize
@@ -12460,15 +7820,15 @@
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 15]
+    movu        m0, [r2]
+    movu        m1, [r2 + 15]
     pshufb      m0, [c_mode32_14_0]      ; [x x x x x x x x x 0 2 5 7 10 12 15]
     pshufb      m1, [c_mode32_14_0]      ; [x x x x x x x x x 15 17 20 22 25 27 30]
     pslldq      m1, 10                   ; [17 20 22 25 27 30 x x x x x x x x x x x]
     palignr     m0, m1, 10               ; [x x x 0 2 5 7 10 12 15 17 20 22 25 27 30]
     mova        [rsp], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
+    movu        m0, [r2 + 1 + 64]
+    movu        m1, [r2 + 1 + 16 + 64]
     movu        [rsp + 13], m0
     movu        [rsp + 13 + 16], m1
     mov         [rsp + 63], byte 4
@@ -12535,11 +7895,8 @@
     mov         rsp, [rsp+64]
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_15(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_15, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_15_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
     mov         r6, rsp
     sub         rsp, 64+gprsize
@@ -12547,14 +7904,14 @@
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 15]
+    movu        m0, [r2]
+    movu        m1, [r2 + 15]
     pshufb      m0, [c_mode32_15_0]      ; [x x x x x x x 0 2 4 6 8 9 11 13 15]
     pshufb      m1, [c_mode32_15_0]      ; [x x x x x x x 15 17 19 21 23 24 26 28 30]
     mova        [rsp], m1
     movu        [rsp + 8], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
+    movu        m0, [r2 + 1 + 64]
+    movu        m1, [r2 + 1 + 16 + 64]
     movu        [rsp + 17], m0
     movu        [rsp + 17 + 16], m1
     mov         [rsp + 63], byte 4
@@ -12621,11 +7978,8 @@
     mov         rsp, [rsp+64]
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_16(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_16, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_16_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
     mov         r6, rsp
     sub         rsp, 64+gprsize
@@ -12633,14 +7987,14 @@
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 15]
+    movu        m0, [r2]
+    movu        m1, [r2 + 15]
     pshufb      m0, [c_mode32_16_0]      ; [x x x x x 0 2 3 5 6 8 9 11 12 14 15]
     pshufb      m1, [c_mode32_16_0]      ; [x x x x x 15 17 18 20 21 23 24 26 27 29 30]
     mova        [rsp], m1
     movu        [rsp + 10], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
+    movu        m0, [r2 + 1 + 64]
+    movu        m1, [r2 + 1 + 16 + 64]
     movu        [rsp + 21], m0
     movu        [rsp + 21 + 16], m1
     mov         [rsp + 63], byte 4
@@ -12707,11 +8061,8 @@
     mov         rsp, [rsp+64]
     RET
 
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_17(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_17, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_17_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
     mov         r6, rsp
     sub         rsp, 64+gprsize
@@ -12719,14 +8070,14 @@
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 16]
+    movu        m0, [r2]
+    movu        m1, [r2 + 16]
     pshufb      m0, [c_mode32_17_0]
     pshufb      m1, [c_mode32_17_0]
     mova        [rsp     ], m1
     movu        [rsp + 13], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
+    movu        m0, [r2 + 1 + 64]
+    movu        m1, [r2 + 1 + 16 + 64]
     movu        [rsp + 26], m0
     movu        [rsp + 26 + 16], m1
     mov         [rsp + 63], byte 4
@@ -12794,15 +8145,12 @@
 
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_18(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_18, 4,5,5
-    movu        m0, [r3]               ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    movu        m1, [r3 + 16]          ; [31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16]
-    movu        m2, [r2 + 1]           ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    movu        m3, [r2 + 17]          ; [32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17]
+INIT_XMM sse4
+cglobal intra_pred_ang32_18_new, 4,5,5
+    movu        m0, [r2]               ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
+    movu        m1, [r2 + 16]          ; [31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16]
+    movu        m2, [r2 + 1 + 64]      ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
+    movu        m3, [r2 + 17 + 64]     ; [32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17]
 
     lea         r2, [r1 * 2]
     lea         r3, [r1 * 3]
@@ -12959,21 +8307,18 @@
     movu        [r0 + r3 + 16], m4
     RET
 
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_19(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_19, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_19_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    xchg        r2, r3
     mov         r6, rsp
     sub         rsp, 64+gprsize
     and         rsp, ~63
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 16]
+    movu        m0, [r2 + 64]
+    pinsrb      m0, [r2], 0
+    movu        m1, [r2 + 16 + 64]
     pshufb      m0, [c_mode32_17_0]
     pshufb      m1, [c_mode32_17_0]
     mova        [rsp     ], m1
@@ -13049,21 +8394,18 @@
     mov         rsp, [rsp+64]
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_20(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_20, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_20_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    xchg        r2, r3
     mov         r6, rsp
     sub         rsp, 64+gprsize
     and         rsp, ~63
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 15]
+    movu        m0, [r2 + 64]
+    pinsrb      m0, [r2], 0
+    movu        m1, [r2 + 15 + 64]
     pshufb      m0, [c_mode32_16_0]      ; [x x x x x 0 2 3 5 6 8 9 11 12 14 15]
     pshufb      m1, [c_mode32_16_0]      ; [x x x x x 15 17 18 20 21 23 24 26 27 29 30]
     mova        [rsp], m1
@@ -13139,21 +8481,18 @@
     mov         rsp, [rsp+64]
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_21(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_21, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_21_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    xchg        r2, r3
     mov         r6, rsp
     sub         rsp, 64+gprsize
     and         rsp, ~63
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 15]
+    movu        m0, [r2 + 64]
+    pinsrb      m0, [r2], 0
+    movu        m1, [r2 + 15 + 64]
     pshufb      m0, [c_mode32_15_0]      ; [x x x x x x x 0 2 4 6 8 9 11 13 15]
     pshufb      m1, [c_mode32_15_0]      ; [x x x x x x x 15 17 19 21 23 24 26 28 30]
     mova        [rsp], m1
@@ -13229,22 +8568,18 @@
     mov         rsp, [rsp+64]
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_22(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_22, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_22_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-
-    xchg        r2, r3
     mov         r6, rsp
     sub         rsp, 64+gprsize
     and         rsp, ~63
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3]
-    movu        m1, [r3 + 15]
+    movu        m0, [r2 + 64]
+    pinsrb      m0, [r2], 0
+    movu        m1, [r2 + 15 + 64]
     pshufb      m0, [c_mode32_14_0]      ; [x x x x x x x x x 0 2 5 7 10 12 15]
     pshufb      m1, [c_mode32_14_0]      ; [x x x x x x x x x 15 17 20 22 25 27 30]
     pslldq      m1, 10                   ; [17 20 22 25 27 30 x x x x x x x x x x x]
@@ -13321,25 +8656,22 @@
     mov         rsp, [rsp+64]
     RET
 
-;-----------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_23(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_23, 4,7,8,0-(1*mmsize)
+INIT_XMM sse4
+cglobal intra_pred_ang32_23_new, 4,7,8,0-(1*mmsize)
 %define above [rsp + 0 * mmsize]
-    xchg        r2,        r3
+    lea         r3,        [r2 + 64]
     lea         r4,        [ang_table + 16 * 16]
     lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
     mov         r6,        r0
     mova        m7,        [pw_1024]
 
-    MODE_13_23_ROW0 0
+    MODE_13_23_ROW0_NEW 0
     add         r6,        8
     mov         r0,        r6
     add         r2,        7
     mov         r3,        3
 .loop:
-    MODE_13_23 0
+    MODE_13_23_NEW 0, 0
     add         r6,        8
     mov         r0,        r6
     add         r2,        8
@@ -13347,19 +8679,16 @@
     jnz         .loop
     RET
 
-;-----------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_24(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_24, 4,7,8,0-(1*mmsize)
+INIT_XMM sse4
+cglobal intra_pred_ang32_24_new, 4,7,8,0-(1*mmsize)
   %define above    [rsp + 0 * mmsize]
-    xchg        r2,        r3
+    lea         r3,        [r2 + 64]
     lea         r4,        [ang_table + 16 * 16]
     lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
     mov         r6,        r0
     mova        m7,        [pw_1024]
 
-    MODE_12_24_ROW0 0
+    MODE_12_24_ROW0_NEW 0
     add         r6,        8
     mov         r0,        r6
     add         r2,        7
@@ -13373,20 +8702,16 @@
     jnz         .loop
     RET
 
-;-------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_11(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_25, 4,7,8
+INIT_XMM sse4
+cglobal intra_pred_ang32_25_new, 4,7,8
     ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    xchg        r2, r3
     mov         r6, rsp
     sub         rsp, 64+gprsize
     and         rsp, ~63
     mov         [rsp+64], r6
 
     ; collect reference pixel
-    movu        m0, [r3 + 16]
+    movu        m0, [r2 + 16 + 64]
     pxor        m1, m1
     pshufb      m0, m1                   ; [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
     mova        [rsp], m0
@@ -13463,23 +8788,21 @@
     mov         rsp, [rsp+64]
     RET
 
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_26(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_26, 6,7,7,0-(2*mmsize)
+INIT_XMM sse4
+cglobal intra_pred_ang32_26_new, 5,7,7,0-(2*mmsize)
 %define m8 [rsp + 0 * mmsize]
 %define m9 [rsp + 1 * mmsize]
-    lea         r4,             [r1 * 3]
     mov         r6,             2
-    movu        m0,             [r2]
-    movu        m1,             [r2 + 1]
+    movu        m0,             [r2 + 64]
+    pinsrb      m0,             [r2], 0
+    movu        m1,             [r2 + 1 + 64]
     mova        m8,             m0
     mova        m9,             m1
-    mov         r2d,            r5d
-
-.loop:
-    movu        m0,             [r3 + 1]
+    mov         r3d,            r4d
+    lea         r4,             [r1 * 3]
+
+.loop:
+    movu        m0,             [r2 + 1]
 
     movu        [r0],           m0
     movu        [r0 + r1],      m0
@@ -13537,2124 +8860,6 @@
     movu        [r5 + r4],      m0
 
 ; filter
-    cmp         r2d, byte 0
-    jz         .quit
-
-    pxor        m4,        m4
-    pshufb      m0,        m4
-    pmovzxbw    m0,        m0
-    mova        m1,        m0
-    movu        m2,        m8
-    movu        m3,        m9
-
-    pshufb      m2,        m4
-    pmovzxbw    m2,        m2
-    movhlps     m4,        m3
-    pmovzxbw    m3,        m3
-    pmovzxbw    m4,        m4
-    psubw       m3,        m2
-    psubw       m4,        m2
-    psraw       m3,        1
-    psraw       m4,        1
-    paddw       m0,        m3
-    paddw       m1,        m4
-    packuswb    m0,        m1
-
-    pextrb      [r0],           m0, 0
-    pextrb      [r0 + r1],      m0, 1
-    pextrb      [r0 + r1 * 2],  m0, 2
-    pextrb      [r0 + r4],      m0, 3
-    lea         r5,             [r0 + r1 * 4]
-    pextrb      [r5],           m0, 4
-    pextrb      [r5 + r1],      m0, 5
-    pextrb      [r5 + r1 * 2],  m0, 6
-    pextrb      [r5 + r4],      m0, 7
-    lea         r5,             [r5 + r1 * 4]
-    pextrb      [r5],           m0, 8
-    pextrb      [r5 + r1],      m0, 9
-    pextrb      [r5 + r1 * 2],  m0, 10
-    pextrb      [r5 + r4],      m0, 11
-    lea         r5,             [r5 + r1 * 4]
-    pextrb      [r5],           m0, 12
-    pextrb      [r5 + r1],      m0, 13
-    pextrb      [r5 + r1 * 2],  m0, 14
-    pextrb      [r5 + r4],      m0, 15
-
-.quit:
-    lea         r3, [r3 + 16]
-    add         r0, 16
-    dec         r6d
-    jnz         .loop
-    RET
-
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_27(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_27, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_9_27 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_28(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_28, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_8_28 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_29(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_29, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_7_29 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_30(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_30, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_6_30 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_31(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_31, 3,7,8
-    mov         r2,        r3mp
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_5_31 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-;-----------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_32(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;-----------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_32, 3,7,8
-    mov         r2,     r3mp
-    lea         r3,     [ang_table + 16 * 16]
-    mov         r4d,    4
-    lea         r5,     [r1 * 3]
-    mov         r6,     r0
-    mova        m7,     [pw_1024]
-.loop:
-    MODE_4_32 0
-    add         r6,      8
-    mov         r0,     r6
-    add         r2,     8
-    dec         r4
-    jnz        .loop
-    RET
-
-;------------------------------------------------------------------------------------------------------------------
-; void intraPredAng32_33(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------------------------------
-INIT_XMM sse4
-cglobal intra_pred_ang32_33, 3,7,8
-    xchg        r2,    r3mp
-    lea         r3,    [ang_table + 16 * 16]
-    mov         r4d,   4
-    lea         r5,    [r1 * 3]
-    mov         r6,    r0
-    mova        m7,    [pw_1024]
-.loop:
-    MODE_3_33 0
-    add         r6,    8
-    mov         r0,    r6
-    add         r2,    8
-    dec         r4
-    jnz        .loop
-    RET
-
-;------------------------------------------------------------------------------------------
-; void intraPredAng32(pixel* dst, intptr_t dstStride, pixel* src, int dirMode, int bFilter)
-;------------------------------------------------------------------------------------------
-INIT_XMM ssse3
-cglobal intra_pred_ang32_2_new, 3,5,4
-    lea             r4, [r2]
-    add             r2, 64
-    cmp             r3m, byte 34
-    cmove           r2, r4
-    movu            m0, [r2 + 2]
-    movu            m1, [r2 + 18]
-    movu            m3, [r2 + 34]
-
-    lea             r3, [r1 * 3]
-
-    movu            [r0], m0
-    movu            [r0 + 16], m1
-    palignr         m2, m1, m0, 1
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 1
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 2
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 2
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 3
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 3
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m1, m0, 4
-    movu            [r0], m2
-    palignr         m2, m3, m1, 4
-    movu            [r0 + 16], m2
-    palignr         m2, m1, m0, 5
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 5
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 6
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 6
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 7
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 7
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m1, m0, 8
-    movu            [r0], m2
-    palignr         m2, m3, m1, 8
-    movu            [r0 + 16], m2
-    palignr         m2, m1, m0, 9
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 9
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 10
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 10
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 11
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 11
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m1, m0, 12
-    movu            [r0], m2
-    palignr         m2, m3, m1, 12
-    movu            [r0 + 16], m2
-    palignr         m2, m1, m0, 13
-    movu            [r0 + r1], m2
-    palignr         m2, m3, m1, 13
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m1, m0, 14
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m3, m1, 14
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m1, m0, 15
-    movu            [r0 + r3], m2
-    palignr         m2, m3, m1, 15
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    movu            [r0], m1
-    movu            m0, [r2 + 50]
-    movu            [r0 + 16], m3
-    palignr         m2, m3, m1, 1
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 1
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 2
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 2
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 3
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 3
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m3, m1, 4
-    movu            [r0], m2
-    palignr         m2, m0, m3, 4
-    movu            [r0 + 16], m2
-    palignr         m2, m3, m1, 5
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 5
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 6
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 6
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 7
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 7
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m3, m1, 8
-    movu            [r0], m2
-    palignr         m2, m0, m3, 8
-    movu            [r0 + 16], m2
-    palignr         m2, m3, m1, 9
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 9
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 10
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 10
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 11
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 11
-    movu            [r0 + r3 + 16], m2
-
-    lea             r0, [r0 + r1 * 4]
-
-    palignr         m2, m3, m1, 12
-    movu            [r0], m2
-    palignr         m2, m0, m3, 12
-    movu            [r0 + 16], m2
-    palignr         m2, m3, m1, 13
-    movu            [r0 + r1], m2
-    palignr         m2, m0, m3, 13
-    movu            [r0 + r1 + 16], m2
-    palignr         m2, m3, m1, 14
-    movu            [r0 + r1 * 2], m2
-    palignr         m2, m0, m3, 14
-    movu            [r0 + r1 * 2 + 16], m2
-    palignr         m2, m3, m1, 15
-    movu            [r0 + r3], m2
-    palignr         m2, m0, m3, 15
-    movu            [r0 + r3 + 16], m2
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_3_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_3_33 1
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_4_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                    ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]               ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_4_32 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_5_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_5_31 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_6_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]                  ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]             ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_6_30 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_7_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]               ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]          ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_7_29 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_8_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]       ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_8_28 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_9_new, 3,7,8
-    add         r2,        64
-    lea         r3,        [ang_table + 16 * 16]
-    mov         r4d,       4
-    lea         r5,        [r1 * 3]         ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]    ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-.loop:
-    MODE_9_27 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r4
-    jnz        .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_10_new, 5,7,8,0-(2*mmsize)
-%define m8 [rsp + 0 * mmsize]
-%define m9 [rsp + 1 * mmsize]
-    pxor        m7, m7
-    mov         r6, 2
-    movu        m0, [r2]
-    movu        m1, [r2 + 1]
-    mova        m8, m0
-    mova        m9, m1
-    mov         r3d, r4d
-    lea         r4, [r1 * 3]
-
-.loop:
-    movu        m0, [r2 + 1 + 64]
-    palignr     m1, m0, 1
-    pshufb      m1, m7
-    palignr     m2, m0, 2
-    pshufb      m2, m7
-    palignr     m3, m0, 3
-    pshufb      m3, m7
-    palignr     m4, m0, 4
-    pshufb      m4, m7
-    palignr     m5, m0, 5
-    pshufb      m5, m7
-    palignr     m6, m0, 6
-    pshufb      m6, m7
-
-    movu        [r0 + r1], m1
-    movu        [r0 + r1 + 16], m1
-    movu        [r0 + r1 * 2], m2
-    movu        [r0 + r1 * 2 + 16], m2
-    movu        [r0 + r4], m3
-    movu        [r0 + r4 + 16], m3
-    lea         r5, [r0 + r1 * 4]
-    movu        [r5], m4
-    movu        [r5 + 16], m4
-    movu        [r5 + r1], m5
-    movu        [r5 + r1 + 16], m5
-    movu        [r5 + r1 * 2], m6
-    movu        [r5 + r1 * 2 + 16], m6
-
-    palignr     m1, m0, 7
-    pshufb      m1, m7
-    movhlps     m2, m0
-    pshufb      m2, m7
-    palignr     m3, m0, 9
-    pshufb      m3, m7
-    palignr     m4, m0, 10
-    pshufb      m4, m7
-    palignr     m5, m0, 11
-    pshufb      m5, m7
-    palignr     m6, m0, 12
-    pshufb      m6, m7
-
-    movu        [r5 + r4], m1
-    movu        [r5 + r4 + 16], m1
-    lea         r5, [r5 + r1 * 4]
-    movu        [r5], m2
-    movu        [r5 + 16], m2
-    movu        [r5 + r1], m3
-    movu        [r5 + r1 + 16], m3
-    movu        [r5 + r1 * 2], m4
-    movu        [r5 + r1 * 2 + 16], m4
-    movu        [r5 + r4], m5
-    movu        [r5 + r4 + 16], m5
-    lea         r5, [r5 + r1 * 4]
-    movu        [r5], m6
-    movu        [r5 + 16], m6
-
-    palignr     m1, m0, 13
-    pshufb      m1, m7
-    palignr     m2, m0, 14
-    pshufb      m2, m7
-    palignr     m3, m0, 15
-    pshufb      m3, m7
-    pshufb      m0, m7
-
-    movu        [r5 + r1], m1
-    movu        [r5 + r1 + 16], m1
-    movu        [r5 + r1 * 2], m2
-    movu        [r5 + r1 * 2 + 16], m2
-    movu        [r5 + r4], m3
-    movu        [r5 + r4 + 16], m3
-
-; filter
-    cmp         r3d, byte 0
-    jz         .quit
-    movhlps     m1, m0
-    pmovzxbw    m0, m0
-    mova        m1, m0
-    movu        m2, m8
-    movu        m3, m9
-
-    pshufb      m2, m7
-    pmovzxbw    m2, m2
-    movhlps     m4, m3
-    pmovzxbw    m3, m3
-    pmovzxbw    m4, m4
-    psubw       m3, m2
-    psubw       m4, m2
-    psraw       m3, 1
-    psraw       m4, 1
-    paddw       m0, m3
-    paddw       m1, m4
-    packuswb    m0, m1
-
-.quit:
-    movu        [r0], m0
-    movu        [r0 + 16], m0
-    dec         r6
-    lea         r0, [r5 + r1 * 4]
-    lea         r2, [r2 + 16]
-    jnz         .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_11_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2 + 16]
-    pxor        m1, m1
-    pshufb      m0, m1                   ; [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-    mova        [rsp], m0
-    movu        m0, [r2 + 64]
-    pinsrb      m0, [r2], 0
-    movu        m1, [r2 + 16 + 64]
-    movu        m2, [r2 + 32 + 64]
-    movu        [rsp + 1], m0
-    movu        [rsp + 1 + 16], m1
-    movu        [rsp + 1 + 32], m2
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 1]            ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0 + r1 * 4]        ; r6 -> 4 * stride
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    PROC32_8x8  0, 1, 30,28,26,24,22,20,18,16
-
-    ; Row[8 - 15]
-    movu        m7, [r2]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    PROC32_8x8  1, 1, 14,12,10,8,6,4,2,0
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 1]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    PROC32_8x8  2, 1, 30,28,26,24,22,20,18,16
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 1]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    PROC32_8x8  3, 1, 14,12,10,8,6,4,2,0
-
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-%macro MODE_12_24_ROW0_NEW 1
-    movu        m0,        [r3 + 6]
-    pshufb      m0,        [c_mode32_12_0]
-    pinsrb      m0,        [r3 + 26], 12
-    mova        above,     m0
-    movu        m2,        [r2]
-  %if %1 == 1
-    pinsrb      m2,        [r3], 0
-  %endif
-    palignr     m1,        m2, 1
-    punpcklbw   m2,        m1
-    pmaddubsw   m4,        m2, [r4 + 11 * 16]         ; [27]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m2, [r4 + 6 * 16]          ; [22]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m2, [r4 + 16]              ; [17]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 4 * 16]          ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 - 9 * 16]          ; [7]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m3,        m2, [r4 - 14 * 16]         ; [2]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-    movu        m1,        [r2]                       ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-  %if %1 == 1
-    pinsrb      m1,        [r3], 0
-  %endif
-    palignr     m2,        m1, above, 15              ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
-    punpcklbw   m2,        m1                         ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0 a]
-    pmaddubsw   m1,        m2, [r4 + 13 * 16]             ; [29]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4 + 8 * 16]          ; [24]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 0, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 + 3 * 16]          ; [19]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r4 - 2 * 16]          ; [14]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m2, [r4 - 7 * 16]          ; [09]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 12 * 16]         ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    palignr     m2,        above, 14                  ;[6 5 5 4 4 3 3 2 2 1 1 0 0 a a b]
-    pmaddubsw   m6,        m2, [r4 + 15 * 16]         ; [31]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 + 10 * 16]         ; [26]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pmaddubsw   m1,        m2, [r4 + 5 * 16]          ; [21]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4]                   ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 1, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 - 5 * 16]          ; [11]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m2, [r4 - 10 * 16]         ; [06]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m2, [r4 - 15 * 16]         ; [1]
-    pmulhrsw    m5,        m7
-    pslldq      m1,        above, 1
-    palignr     m2,        m1, 14
-    pmaddubsw   m6,        m2, [r4 + 12 * 16]         ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 + 7 * 16]          ; [23]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m3,        m2, [r4 + 2 * 16]          ; [18]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-    pmaddubsw   m1,        m2, [r4 - 3 * 16]          ; [13]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4 - 8 * 16]          ; [8]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 2, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 - 13 * 16]         ; [3]
-    pmulhrsw    m4,        m7
-    pslldq      m1,        above, 2
-    palignr     m2,        m1, 14
-    pmaddubsw   m5,        m2, [r4 + 14 * 16]         ; [30]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m2, [r4 + 9 * 16]          ; [25]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 + 4 * 16]          ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 - 16]              ; [15]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 - 6 * 16]          ; [10]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pmaddubsw   m1,        m2, [r4 - 11 * 16]         ; [05]
-    pmulhrsw    m1,        m7
-    movu        m0,        [pb_fact0]
-    pshufb      m2,        m0
-    pmovzxbw    m2,        m2
-    packuswb    m1,        m2
-    TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
-%endmacro
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_12_new, 3,7,8,0-(1*mmsize)
-  %define above    [rsp + 0 * mmsize]
-    mov         r3,        r2
-    add         r2,        64
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                   ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]              ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    MODE_12_24_ROW0_NEW 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        7
-    mov         r3,        3
-.loop:
-    MODE_12_24 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r3
-    jnz         .loop
-    RET
-
-%macro MODE_13_23_ROW0_NEW 1
-    movu        m0,        [r3 + 1]
-    movu        m1,        [r3 + 15]
-    pshufb      m0,        [c_mode32_13_0]
-    pshufb      m1,        [c_mode32_13_0]
-    punpckldq   m0,        m1
-    pshufb      m0,        [c_mode32_13_shuf]
-    mova        above,     m0
-    movu        m2,        [r2]
-  %if (%1 == 1)
-    pinsrb      m2,        [r3], 0
-  %endif
-    palignr     m1,        m2, 1
-    punpcklbw   m2,        m1
-    pmaddubsw   m4,        m2, [r4 + 7 * 16]         ; [23]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m2, [r4 - 2 * 16]         ; [14]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m2, [r4 - 11 * 16]        ; [5]
-    pmulhrsw    m5,        m7
-    movu        m1,        [r2]                      ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-  %if (%1 == 1)
-    pinsrb      m1,        [r3], 0
-  %endif
-    palignr     m2,        m1, above, 15             ; [14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 a]
-    punpcklbw   m2,        m1                        ; [7 6 6 5 5 4 4 3 3 2 2 1 1 0 0]
-    pmaddubsw   m6,        m2, [r4 + 12 * 16]        ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 + 3 * 16]         ; [19]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m0,        m2, [r4 - 6 * 16]         ; [10]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-    pmaddubsw   m1,        m2, [r4 - 15 * 16]        ; [1]
-    pmulhrsw    m1,        m7
-    palignr     m2,        above, 14
-    pmaddubsw   m3,        m2, [r4 + 8 * 16]         ; [24]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 0, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 - 16]             ; [15]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r4 - 10 * 16]        ; [6]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pslldq      m0,        above, 1
-    palignr     m2,        m0, 14
-    pmaddubsw   m5,        m2, [r4 + 13 * 16]        ; [29]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 + 4 * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 - 5 * 16]         ; [11]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 - 14 * 16]        ; [2]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pslldq      m0,        1
-    palignr     m2,        m0, 14
-    pmaddubsw   m1,        m2, [r4 + 9 * 16]         ; [25]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m2, [r4]                  ; [16]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-    TRANSPOSE_STORE_8x8 1, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 - 9 * 16]         ; [7]
-    pmulhrsw    m4,        m7
-    pslldq      m0,        above, 3
-    palignr     m2,        m0, 14
-    pmaddubsw   m3,        m2, [r4 + 14 * 16]        ; [30]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m2, [r4 + 5 * 16]         ; [21]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 4 * 16]         ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 - 13 * 16]        ; [3]
-    pmulhrsw    m6,        m7
-    pslldq      m0,        1
-    palignr     m2,        m0, 14
-    pmaddubsw   m0,        m2, [r4 + 10 * 16]        ; [26]
-    pmulhrsw    m0,        m7
-    packuswb    m6,        m0
-    pmaddubsw   m1,        m2, [r4 + 16]             ; [17]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m0,        m2, [r4 - 8 * 16]         ; [8]
-    pmulhrsw    m0,        m7
-    packuswb    m1,        m0
-    TRANSPOSE_STORE_8x8 2, %1, m4, m5, m6, m1
-    pslldq      m0,        above, 5
-    palignr     m2,        m0, 14
-    pmaddubsw   m4,        m2, [r4 + 15 * 16]        ; [31]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r4 + 6 * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m2, [r4 - 3 * 16]         ; [13]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 12 * 16]        ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pslldq      m0,        1
-    palignr     m2,        m0, 14
-    pmaddubsw   m6,        m2, [r4 + 11 * 16]        ; [27]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 + 2 * 16]         ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pmaddubsw   m1,        m2, [r4 - 7 * 16]         ; [09]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m2, [r4 - 16 * 16]        ; [00]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
-%endmacro
-
-%macro MODE_13_23_NEW 2
-    movu        m2,        [r2]                      ; [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-    palignr     m1,        m2, 1                     ; [x ,15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
-    punpckhbw   m0,        m2, m1                    ; [x, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8]
-    punpcklbw   m2,        m1                        ; [8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0]
-    palignr     m0,        m2, 2                     ; [9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1]
-    pmaddubsw   m4,        m0, [r4 + 7 * 16]         ; [23]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m0, [r4 - 2 * 16]         ; [14]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m0, [r4 - 11 * 16]        ; [05]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 + 12 * 16]        ; [28]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 + 3 * 16]         ; [19]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m3,        m2, [r4 - 6 * 16]         ; [10]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-    pmaddubsw   m1,        m2, [r4 - 15 * 16]        ; [1]
-    pmulhrsw    m1,        m7
-    movu        m2,        [r2 - 2]                  ; [14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1]
-    palignr     m3,        m2, 1                     ; [x, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-    punpckhbw   m0,        m2, m3
-    punpcklbw   m2,        m3
-    palignr     m0,        m2, 2
-    pmaddubsw   m3,        m0, [r4 + 8 * 16]         ; [24]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    mova        m3,        m0
-    TRANSPOSE_STORE_8x8 0, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m3, [r4 - 16]             ; [15]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m3, [r4 - 10 * 16]        ; [6]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m2, [r4 + 13 * 16]        ; [29]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 + 4 * 16]         ; [20]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 - 5 * 16]         ; [11]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 - 14 * 16]        ; [2]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    movu        m2,        [r2 - 4]                  ; [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-    palignr     m1,        m2, 1                     ; [x ,15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
-    punpckhbw   m0,        m2, m1                    ; [x, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8]
-    punpcklbw   m2,        m1                        ; [8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0]
-    palignr     m0,        m2, 2                     ; [9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1]
-    pmaddubsw   m1,        m0, [r4 + 9 * 16]         ; [25]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m0, [r4]                  ; [16]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    mova        m3,        m0
-    TRANSPOSE_STORE_8x8 1, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m3, [r4 - 9 * 16]         ; [7]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m3,        m2, [r4 + 14 * 16]        ; [30]
-    pmulhrsw    m3,        m7
-    packuswb    m4,        m3
-    pmaddubsw   m5,        m2, [r4 + 5 * 16]         ; [21]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 4 * 16]         ; [12]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    pmaddubsw   m6,        m2, [r4 - 13 * 16]        ; [3]
-    pmulhrsw    m6,        m7
-    movu        m2,        [r2 - 6]                  ; [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-    palignr     m1,        m2, 1                     ; [x ,15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
-    punpckhbw   m0,        m2, m1                    ; [x, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 8]
-    punpcklbw   m2,        m1                        ; [8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0]
-    palignr     m0,        m2, 2                     ; [9, 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1]
-    pmaddubsw   m3,        m0, [r4 + 10 * 16]        ; [26]
-    pmulhrsw    m3,        m7
-    packuswb    m6,        m3
-    pmaddubsw   m1,        m0, [r4 + 16]             ; [17]
-    pmulhrsw    m1,        m7
-    pmaddubsw   m3,        m0, [r4 - 8 * 16]         ; [8]
-    pmulhrsw    m3,        m7
-    packuswb    m1,        m3
-    TRANSPOSE_STORE_8x8 2, %1, m4, m5, m6, m1
-    pmaddubsw   m4,        m2, [r4 + 15 * 16]        ; [31]
-    pmulhrsw    m4,        m7
-    pmaddubsw   m5,        m2, [r4 + 6 * 16]         ; [22]
-    pmulhrsw    m5,        m7
-    packuswb    m4,        m5
-    pmaddubsw   m5,        m2, [r4 - 3 * 16]         ; [13]
-    pmulhrsw    m5,        m7
-    pmaddubsw   m6,        m2, [r4 - 12 * 16]        ; [04]
-    pmulhrsw    m6,        m7
-    packuswb    m5,        m6
-    movu        m2,        [r2 - 7]                  ; [15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
-  %if ((%1 & %2) == 1)
-    pinsrb      m2,        [r3], 0
-  %endif
-    palignr     m1,        m2, 1                     ; [x ,15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
-    punpcklbw   m2,        m1                        ; [8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0]
-    pmaddubsw   m6,        m2, [r4 + 11 * 16]        ; [27]
-    pmulhrsw    m6,        m7
-    pmaddubsw   m1,        m2, [r4 + 2 * 16]         ; [18]
-    pmulhrsw    m1,        m7
-    packuswb    m6,        m1
-    pmaddubsw   m1,        m2, [r4 - 7 * 16]         ; [09]
-    pmulhrsw    m1,        m7
-    movu        m0,        [pb_fact0]
-    pshufb      m2,        m0
-    pmovzxbw    m2,        m2
-    packuswb    m1,        m2
-    TRANSPOSE_STORE_8x8 3, %1, m4, m5, m6, m1
-%endmacro
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_13_new, 3,7,8,0-(1*mmsize)
-%define above [rsp + 0 * mmsize]
-    mov         r3,        r2
-    add         r2,        64
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]                  ; r5 -> 3 * stride
-    lea         r6,        [r0 + r1 * 4]             ; r6 -> 4 * stride
-    mova        m7,        [pw_1024]
-
-    MODE_13_23_ROW0_NEW 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        7
-
-    MODE_13_23_NEW 1, 1
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    mov         r3,        2
-.loop:
-    MODE_13_23_NEW 1, 0
-    lea         r0,        [r6 + r1 * 4]
-    lea         r6,        [r6 + r1 * 8]
-    add         r2,        8
-    dec         r3
-    jnz         .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_14_new, 3,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2]
-    movu        m1, [r2 + 15]
-    pshufb      m0, [c_mode32_14_0]      ; [x x x x x x x x x 0 2 5 7 10 12 15]
-    pshufb      m1, [c_mode32_14_0]      ; [x x x x x x x x x 15 17 20 22 25 27 30]
-    pslldq      m1, 10                   ; [17 20 22 25 27 30 x x x x x x x x x x x]
-    palignr     m0, m1, 10               ; [x x x 0 2 5 7 10 12 15 17 20 22 25 27 30]
-    mova        [rsp], m0
-    movu        m0, [r2 + 1 + 64]
-    movu        m1, [r2 + 1 + 16 + 64]
-    movu        [rsp + 13], m0
-    movu        [rsp + 13 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 13]           ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0 + r1 * 4]        ; r6 -> 4 * stride
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 4]
-    palignr     m0, m7, 3
-    mova        m1, m0
-    palignr     m2, m7, 2
-    mova        m3, m2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m4
-    PROC32_8x8  0, 1, 19,6,25,12,31,18,5,24
-
-    ; Row[8 - 15]
-    movu        m7, [r2 - 7]
-    palignr     m0, m7, 3
-    palignr     m1, m7, 2
-    mova        m2, m1
-    mova        m3, m1
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    PROC32_8x8  1, 1, 11,30,17,4,23,10,29,16
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 10]
-    palignr     m0, m7, 3
-    palignr     m1, m7, 2
-    mova        m2, m1
-    palignr     m3, m7, 1
-    mova        m4, m3
-    mova        m5, m3
-    mova        m6, m7
-    PROC32_8x8  2, 1, 3,22,9,28,15,2,21,8
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 13]
-    palignr     m0, m7, 2
-    mova        m1, m0
-    mova        m2, m0
-    palignr     m3, m7, 1
-    mova        m4, m3
-    mova        m5, m7
-    mova        m6, m7
-    PROC32_8x8  3, 1, 27,14,1,20,7,26,13,0
-
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_15_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2]
-    movu        m1, [r2 + 15]
-    pshufb      m0, [c_mode32_15_0]      ; [x x x x x x x 0 2 4 6 8 9 11 13 15]
-    pshufb      m1, [c_mode32_15_0]      ; [x x x x x x x 15 17 19 21 23 24 26 28 30]
-    mova        [rsp], m1
-    movu        [rsp + 8], m0
-    movu        m0, [r2 + 1 + 64]
-    movu        m1, [r2 + 1 + 16 + 64]
-    movu        [rsp + 17], m0
-    movu        [rsp + 17 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 17]           ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0 + r1 * 4]        ; r6 -> 4 * stride
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 5]
-    palignr     m0, m7, 4
-    palignr     m1, m7, 3
-    mova        m2, m1
-    palignr     m3, m7, 2
-    mova        m4, m3
-    palignr     m5, m7, 1
-    mova        m6, m5
-    PROC32_8x8  0, 1, 15,30,13,28,11,26,9,24
-
-    ; Row[8 - 15]
-    movu        m7, [r2 - 9]
-    palignr     m0, m7, 4
-    palignr     m1, m7, 3
-    mova        m2, m1
-    palignr     m3, m7, 2
-    mova        m4, m3
-    palignr     m5, m7, 1
-    mova        m6, m5
-    PROC32_8x8  1, 1, 7,22,5,20,3,18,1,16
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 13]
-    palignr     m0, m7, 3
-    mova        m1, m0
-    palignr     m2, m7, 2
-    mova        m3, m2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    PROC32_8x8  2, 1, 31,14,29,12,27,10,25,8
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 17]
-    palignr     m0, m7, 3
-    mova        m1, m0
-    palignr     m2, m7, 2
-    mova        m3, m2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    PROC32_8x8  3, 1, 23,6,21,4,19,2,17,0
-
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_16_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2]
-    movu        m1, [r2 + 15]
-    pshufb      m0, [c_mode32_16_0]      ; [x x x x x 0 2 3 5 6 8 9 11 12 14 15]
-    pshufb      m1, [c_mode32_16_0]      ; [x x x x x 15 17 18 20 21 23 24 26 27 29 30]
-    mova        [rsp], m1
-    movu        [rsp + 10], m0
-    movu        m0, [r2 + 1 + 64]
-    movu        m1, [r2 + 1 + 16 + 64]
-    movu        [rsp + 21], m0
-    movu        [rsp + 21 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 21]           ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0 + r1 * 4]        ; r6 -> 4 * stride
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 6]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    mova        m2, m1
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    mova        m5, m4
-    palignr     m6, m7, 1
-    PROC32_8x8  0, 1, 11,22,1,12,23,2,13,24
-
-    ; Row[8 - 15]
-    movu        m7, [r2 - 11]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    palignr     m2, m7, 3
-    mova        m3, m2
-    palignr     m4, m7, 2
-    palignr     m5, m7, 1
-    mova        m6, m5
-    PROC32_8x8  1, 1, 3,14,25,4,15,26,5,16
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 16]
-    palignr     m0, m7, 4
-    mova        m1, m0
-    palignr     m2, m7, 3
-    palignr     m3, m7, 2
-    mova        m4, m3
-    palignr     m5, m7, 1
-    mova        m6, m7
-    PROC32_8x8  2, 1, 27,6,17,28,7,18,29,8
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 21]
-    palignr     m0, m7, 4
-    palignr     m1, m7, 3
-    mova        m2, m1
-    palignr     m3, m7, 2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    PROC32_8x8  3, 1, 19,30,9,20,31,10,21,0
-
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_17_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2]
-    movu        m1, [r2 + 16]
-    pshufb      m0, [c_mode32_17_0]
-    pshufb      m1, [c_mode32_17_0]
-    mova        [rsp     ], m1
-    movu        [rsp + 13], m0
-    movu        m0, [r2 + 1 + 64]
-    movu        m1, [r2 + 1 + 16 + 64]
-    movu        [rsp + 26], m0
-    movu        [rsp + 26 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 25]          ; r2 -> [0]
-    lea         r3, [c_shuf8_0]         ; r3 -> shuffle8
-    lea         r4, [ang_table]         ; r4 -> ang_table
-    lea         r5, [r1 * 3]            ; r5 -> 3 * stride
-    lea         r6, [r0 + r1 * 4]       ; r6 -> 4 * stride
-    mova        m5, [pw_1024]           ; m5 -> 1024
-    mova        m6, [c_deinterval8]     ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 6]
-    palignr     m0, m7, 6
-    palignr     m1, m7, 5
-    palignr     m2, m7, 4
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    mova        m5, m4
-    palignr     m6, m7, 1
-    PROC32_8x8  0, 1, 6,12,18,24,30,4,10,16
-
-    ; Row[7 - 15]
-    movu        m7, [r2 - 12]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    mova        m2, m1
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    palignr     m5, m7, 1
-    mova        m6, m7
-    PROC32_8x8  1, 1, 22,28,2,8,14,20,26,0
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 19]
-    palignr     m0, m7, 6
-    palignr     m1, m7, 5
-    palignr     m2, m7, 4
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    mova        m5, m4
-    palignr     m6, m7, 1
-    PROC32_8x8  2, 1, 6,12,18,24,30,4,10,16
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 25]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    mova        m2, m1
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    palignr     m5, m7, 1
-    mova        m6, m7
-    PROC32_8x8  3, 1, 22,28,2,8,14,20,26,0
-
-    lea         r0, [r6 + r1 * 4]
-    lea         r6, [r6 + r1 * 8]
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_18_new, 4,5,5
-    movu        m0, [r2]               ; [15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
-    movu        m1, [r2 + 16]          ; [31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16]
-    movu        m2, [r2 + 1 + 64]      ; [16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
-    movu        m3, [r2 + 17 + 64]     ; [32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17]
-
-    lea         r2, [r1 * 2]
-    lea         r3, [r1 * 3]
-    lea         r4, [r1 * 4]
-
-    movu        [r0], m0
-    movu        [r0 + 16], m1
-
-    pshufb      m2, [c_mode32_18_0]    ; [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
-    pshufb      m3, [c_mode32_18_0]    ; [17 18 19 20 21 22 23 24 25 26 27 28 19 30 31 32]
-
-    palignr     m4, m0, m2, 15
-    movu        [r0 + r1], m4
-    palignr     m4, m1, m0, 15
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m0, m2, 14
-    movu        [r0 + r2], m4
-    palignr     m4, m1, m0, 14
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m0, m2, 13
-    movu        [r0 + r3], m4
-    palignr     m4, m1, m0, 13
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    palignr     m4, m0, m2, 12
-    movu        [r0], m4
-    palignr     m4, m1, m0, 12
-    movu        [r0 + 16], m4
-    palignr     m4, m0, m2, 11
-    movu        [r0 + r1], m4
-    palignr     m4, m1, m0, 11
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m0, m2, 10
-    movu        [r0 + r2], m4
-    palignr     m4, m1, m0, 10
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m0, m2, 9
-    movu        [r0 + r3], m4
-    palignr     m4, m1, m0, 9
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    palignr     m4, m0, m2, 8
-    movu        [r0], m4
-    palignr     m4, m1, m0, 8
-    movu        [r0 + 16], m4
-    palignr     m4, m0, m2, 7
-    movu        [r0 + r1], m4
-    palignr     m4, m1, m0, 7
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m0, m2, 6
-    movu        [r0 + r2], m4
-    palignr     m4, m1, m0, 6
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m0, m2, 5
-    movu        [r0 + r3], m4
-    palignr     m4, m1, m0, 5
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    palignr     m4, m0, m2, 4
-    movu        [r0], m4
-    palignr     m4, m1, m0, 4
-    movu        [r0 + 16], m4
-    palignr     m4, m0, m2, 3
-    movu        [r0 + r1], m4
-    palignr     m4, m1, m0, 3
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m0, m2, 2
-    movu        [r0 + r2], m4
-    palignr     m4, m1, m0, 2
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m0, m2, 1
-    movu        [r0 + r3], m4
-    palignr     m4, m1, m0, 1
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    movu        [r0], m2
-    movu        [r0 + 16], m0
-    palignr     m4, m2, m3, 15
-    movu        [r0 + r1], m4
-    palignr     m4, m0, m2, 15
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m2, m3, 14
-    movu        [r0 + r2], m4
-    palignr     m4, m0, m2, 14
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m2, m3, 13
-    movu        [r0 + r3], m4
-    palignr     m4, m0, m2, 13
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    palignr     m4, m2, m3, 12
-    movu        [r0], m4
-    palignr     m4, m0, m2, 12
-    movu        [r0 + 16], m4
-    palignr     m4, m2, m3, 11
-    movu        [r0 + r1], m4
-    palignr     m4, m0, m2, 11
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m2, m3, 10
-    movu        [r0 + r2], m4
-    palignr     m4, m0, m2, 10
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m2, m3, 9
-    movu        [r0 + r3], m4
-    palignr     m4, m0, m2, 9
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    palignr     m4, m2, m3, 8
-    movu        [r0], m4
-    palignr     m4, m0, m2, 8
-    movu        [r0 + 16], m4
-    palignr     m4, m2, m3, 7
-    movu        [r0 + r1], m4
-    palignr     m4, m0, m2, 7
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m2, m3, 6
-    movu        [r0 + r2], m4
-    palignr     m4, m0, m2, 6
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m2, m3, 5
-    movu        [r0 + r3], m4
-    palignr     m4, m0, m2, 5
-    movu        [r0 + r3 + 16], m4
-
-    lea         r0, [r0 + r4]
-
-    palignr     m4, m2, m3, 4
-    movu        [r0], m4
-    palignr     m4, m0, m2, 4
-    movu        [r0 + 16], m4
-    palignr     m4, m2, m3, 3
-    movu        [r0 + r1], m4
-    palignr     m4, m0, m2, 3
-    movu        [r0 + r1 + 16], m4
-    palignr     m4, m2, m3, 2
-    movu        [r0 + r2], m4
-    palignr     m4, m0, m2, 2
-    movu        [r0 + r2 + 16], m4
-    palignr     m4, m2, m3, 1
-    movu        [r0 + r3], m4
-    palignr     m4, m0, m2, 1
-    movu        [r0 + r3 + 16], m4
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_19_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2 + 64]
-    pinsrb      m0, [r2], 0
-    movu        m1, [r2 + 16 + 64]
-    pshufb      m0, [c_mode32_17_0]
-    pshufb      m1, [c_mode32_17_0]
-    mova        [rsp     ], m1
-    movu        [rsp + 13], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
-    movu        [rsp + 26], m0
-    movu        [rsp + 26 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 25]          ; r2 -> [0]
-    lea         r3, [c_shuf8_0]         ; r3 -> shuffle8
-    lea         r4, [ang_table]         ; r4 -> ang_table
-    lea         r5, [r1 * 3]            ; r5 -> 3 * stride
-    lea         r6, [r0]                ; r6 -> r0
-    mova        m5, [pw_1024]           ; m5 -> 1024
-    mova        m6, [c_deinterval8]     ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 6]
-    palignr     m0, m7, 6
-    palignr     m1, m7, 5
-    palignr     m2, m7, 4
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    mova        m5, m4
-    palignr     m6, m7, 1
-    PROC32_8x8  0, 0, 6,12,18,24,30,4,10,16
-
-    ; Row[7 - 15]
-    movu        m7, [r2 - 12]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    mova        m2, m1
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    palignr     m5, m7, 1
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  1, 0, 22,28,2,8,14,20,26,0
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 19]
-    palignr     m0, m7, 6
-    palignr     m1, m7, 5
-    palignr     m2, m7, 4
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    mova        m5, m4
-    palignr     m6, m7, 1
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  2, 0, 6,12,18,24,30,4,10,16
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 25]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    mova        m2, m1
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    palignr     m5, m7, 1
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  3, 0, 22,28,2,8,14,20,26,0
-
-    add         r6, 8
-    mov         r0, r6
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_20_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2 + 64]
-    pinsrb      m0, [r2], 0
-    movu        m1, [r2 + 15 + 64]
-    pshufb      m0, [c_mode32_16_0]      ; [x x x x x 0 2 3 5 6 8 9 11 12 14 15]
-    pshufb      m1, [c_mode32_16_0]      ; [x x x x x 15 17 18 20 21 23 24 26 27 29 30]
-    mova        [rsp], m1
-    movu        [rsp + 10], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
-    movu        [rsp + 21], m0
-    movu        [rsp + 21 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 21]           ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0]                 ; r6 -> r0
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 6]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    mova        m2, m1
-    palignr     m3, m7, 3
-    palignr     m4, m7, 2
-    mova        m5, m4
-    palignr     m6, m7, 1
-    PROC32_8x8  0, 0, 11,22,1,12,23,2,13,24
-
-    ; Row[8 - 15]
-    movu        m7, [r2 - 11]
-    palignr     m0, m7, 5
-    palignr     m1, m7, 4
-    palignr     m2, m7, 3
-    mova        m3, m2
-    palignr     m4, m7, 2
-    palignr     m5, m7, 1
-    mova        m6, m5
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  1, 0, 3,14,25,4,15,26,5,16
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 16]
-    palignr     m0, m7, 4
-    mova        m1, m0
-    palignr     m2, m7, 3
-    palignr     m3, m7, 2
-    mova        m4, m3
-    palignr     m5, m7, 1
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  2, 0, 27,6,17,28,7,18,29,8
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 21]
-    palignr     m0, m7, 4
-    palignr     m1, m7, 3
-    mova        m2, m1
-    palignr     m3, m7, 2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  3, 0, 19,30,9,20,31,10,21,0
-
-    add         r6, 8
-    mov         r0, r6
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_21_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2 + 64]
-    pinsrb      m0, [r2], 0
-    movu        m1, [r2 + 15 + 64]
-    pshufb      m0, [c_mode32_15_0]      ; [x x x x x x x 0 2 4 6 8 9 11 13 15]
-    pshufb      m1, [c_mode32_15_0]      ; [x x x x x x x 15 17 19 21 23 24 26 28 30]
-    mova        [rsp], m1
-    movu        [rsp + 8], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
-    movu        [rsp + 17], m0
-    movu        [rsp + 17 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 17]           ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0]                 ; r6 -> r0
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 5]
-    palignr     m0, m7, 4
-    palignr     m1, m7, 3
-    mova        m2, m1
-    palignr     m3, m7, 2
-    mova        m4, m3
-    palignr     m5, m7, 1
-    mova        m6, m5
-    PROC32_8x8  0, 0, 15,30,13,28,11,26,9,24
-
-    ; Row[8 - 15]
-    movu        m7, [r2 - 9]
-    palignr     m0, m7, 4
-    palignr     m1, m7, 3
-    mova        m2, m1
-    palignr     m3, m7, 2
-    mova        m4, m3
-    palignr     m5, m7, 1
-    mova        m6, m5
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  1, 0, 7,22,5,20,3,18,1,16
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 13]
-    palignr     m0, m7, 3
-    mova        m1, m0
-    palignr     m2, m7, 2
-    mova        m3, m2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  2, 0, 31,14,29,12,27,10,25,8
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 17]
-    palignr     m0, m7, 3
-    mova        m1, m0
-    palignr     m2, m7, 2
-    mova        m3, m2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  3, 0, 23,6,21,4,19,2,17,0
-
-    add         r6, 8
-    mov         r0, r6
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_22_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2 + 64]
-    pinsrb      m0, [r2], 0
-    movu        m1, [r2 + 15 + 64]
-    pshufb      m0, [c_mode32_14_0]      ; [x x x x x x x x x 0 2 5 7 10 12 15]
-    pshufb      m1, [c_mode32_14_0]      ; [x x x x x x x x x 15 17 20 22 25 27 30]
-    pslldq      m1, 10                   ; [17 20 22 25 27 30 x x x x x x x x x x x]
-    palignr     m0, m1, 10               ; [x x x 0 2 5 7 10 12 15 17 20 22 25 27 30]
-    mova        [rsp], m0
-    movu        m0, [r2 + 1]
-    movu        m1, [r2 + 1 + 16]
-    movu        [rsp + 13], m0
-    movu        [rsp + 13 + 16], m1
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 13]           ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0]                 ; r6 -> r0
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2 - 4]
-    palignr     m0, m7, 3
-    mova        m1, m0
-    palignr     m2, m7, 2
-    mova        m3, m2
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m4
-    PROC32_8x8  0, 0, 19,6,25,12,31,18,5,24
-
-    ; Row[8 - 15]
-    movu        m7, [r2 - 7]
-    palignr     m0, m7, 3
-    palignr     m1, m7, 2
-    mova        m2, m1
-    mova        m3, m1
-    palignr     m4, m7, 1
-    mova        m5, m4
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  1, 0, 11,30,17,4,23,10,29,16
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 10]
-    palignr     m0, m7, 3
-    palignr     m1, m7, 2
-    mova        m2, m1
-    palignr     m3, m7, 1
-    mova        m4, m3
-    mova        m5, m3
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  2, 0, 3,22,9,28,15,2,21,8
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 13]
-    palignr     m0, m7, 2
-    mova        m1, m0
-    mova        m2, m0
-    palignr     m3, m7, 1
-    mova        m4, m3
-    mova        m5, m7
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  3, 0, 27,14,1,20,7,26,13,0
-
-    add         r6, 8
-    mov         r0, r6
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_23_new, 4,7,8,0-(1*mmsize)
-%define above [rsp + 0 * mmsize]
-    lea         r3,        [r2 + 64]
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    MODE_13_23_ROW0_NEW 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        7
-    mov         r3,        3
-.loop:
-    MODE_13_23_NEW 0, 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r3
-    jnz         .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_24_new, 4,7,8,0-(1*mmsize)
-  %define above    [rsp + 0 * mmsize]
-    lea         r3,        [r2 + 64]
-    lea         r4,        [ang_table + 16 * 16]
-    lea         r5,        [r1 * 3]            ; r5 -> 3 * stride
-    mov         r6,        r0
-    mova        m7,        [pw_1024]
-
-    MODE_12_24_ROW0_NEW 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        7
-    mov         r3,        3
-.loop:
-    MODE_12_24 0
-    add         r6,        8
-    mov         r0,        r6
-    add         r2,        8
-    dec         r3
-    jnz         .loop
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_25_new, 4,7,8
-    ; NOTE: alignment stack to 64 bytes, so all of local data in same cache line
-    mov         r6, rsp
-    sub         rsp, 64+gprsize
-    and         rsp, ~63
-    mov         [rsp+64], r6
-
-    ; collect reference pixel
-    movu        m0, [r2 + 16 + 64]
-    pxor        m1, m1
-    pshufb      m0, m1                   ; [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
-    mova        [rsp], m0
-    movu        m0, [r2]
-    movu        m1, [r2 + 16]
-    movu        m2, [r2 + 32]
-    movu        [rsp + 1], m0
-    movu        [rsp + 1 + 16], m1
-    movu        [rsp + 1 + 32], m2
-    mov         [rsp + 63], byte 4
-
-    ; filter
-    lea         r2, [rsp + 1]            ; r2 -> [0]
-    lea         r3, [c_shuf8_0]          ; r3 -> shuffle8
-    lea         r4, [ang_table]          ; r4 -> ang_table
-    lea         r5, [r1 * 3]             ; r5 -> 3 * stride
-    lea         r6, [r0]                 ; r6 -> r0
-    mova        m5, [pw_1024]            ; m5 -> 1024
-    mova        m6, [c_deinterval8]      ; m6 -> c_deinterval8
-
-.loop:
-    ; Row[0 - 7]
-    movu        m7, [r2]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    PROC32_8x8  0, 0, 30,28,26,24,22,20,18,16
-
-    ; Row[8 - 15]
-    movu        m7, [r2]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  1, 0, 14,12,10,8,6,4,2,0
-
-    ; Row[16 - 23]
-    movu        m7, [r2 - 1]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  2, 0, 30,28,26,24,22,20,18,16
-
-    ; Row[24 - 31]
-    movu        m7, [r2 - 1]
-    mova        m0, m7
-    mova        m1, m7
-    mova        m2, m7
-    mova        m3, m7
-    mova        m4, m7
-    mova        m5, m7
-    mova        m6, m7
-    lea         r0, [r0 + r1 * 4]
-    PROC32_8x8  3, 0, 14,12,10,8,6,4,2,0
-
-    add         r6, 8
-    mov         r0, r6
-    add         r2, 8
-    dec         byte [rsp + 63]
-    jnz        .loop
-    mov         rsp, [rsp+64]
-    RET
-
-INIT_XMM sse4
-cglobal intra_pred_ang32_26_new, 5,7,7,0-(2*mmsize)
-%define m8 [rsp + 0 * mmsize]
-%define m9 [rsp + 1 * mmsize]
-    mov         r6,             2
-    movu        m0,             [r2 + 64]
-    pinsrb      m0,             [r2], 0
-    movu        m1,             [r2 + 1 + 64]
-    mova        m8,             m0
-    mova        m9,             m1
-    mov         r3d,            r4d
-    lea         r4,             [r1 * 3]
-
-.loop:
-    movu        m0,             [r2 + 1]
-
-    movu        [r0],           m0
-    movu        [r0 + r1],      m0
-    movu        [r0 + r1 * 2],  m0
-    movu        [r0 + r4],      m0
-    lea         r5,             [r0 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r0 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-    lea         r5,             [r5 + r1 * 4]
-    movu        [r5],           m0
-    movu        [r5 + r1],      m0
-    movu        [r5 + r1 * 2],  m0
-    movu        [r5 + r4],      m0
-
-; filter
     cmp         r3d, byte 0
     jz         .quit
 



More information about the x265-devel mailing list