changeset 9586:4d8bf8ee9164

asm-avx2: intra_pred_ang8_7
author Praveen Tiwari <praveen@multicorewareinc.com>
date Thu, 26 Feb 2015 17:55:31 +0530
parents fd00ee151e21
children aef6e6318778
files source/common/x86/asm-primitives.cpp source/common/x86/intrapred.h source/common/x86/intrapred8.asm
diffstat 3 files changed, 48 insertions(+-), 0 deletions(-) [+]
line wrap: on
line diff
--- a/source/common/x86/asm-primitives.cpp	Thu Feb 26 17:20:36 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Thu Feb 26 17:55:31 2015 +0530
@@ -1847,6 +1847,7 @@ void setupAssemblyPrimitives(EncoderPrim
         p.cu[BLOCK_8x8].intra_pred[31] = x265_intra_pred_ang8_31_avx2;
         p.cu[BLOCK_8x8].intra_pred[30] = x265_intra_pred_ang8_30_avx2;
         p.cu[BLOCK_8x8].intra_pred[6] = x265_intra_pred_ang8_6_avx2;
+        p.cu[BLOCK_8x8].intra_pred[7] = x265_intra_pred_ang8_7_avx2;
         p.cu[BLOCK_8x8].intra_pred[29] = x265_intra_pred_ang8_29_avx2;
     }
 }
--- a/source/common/x86/intrapred.h	Thu Feb 26 17:20:36 2015 +0530
+++ b/source/common/x86/intrapred.h	Thu Feb 26 17:55:31 2015 +0530
@@ -166,6 +166,7 @@ void x265_intra_pred_ang8_5_avx2(pixel* 
 void x265_intra_pred_ang8_31_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_intra_pred_ang8_6_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_intra_pred_ang8_30_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
+void x265_intra_pred_ang8_7_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_intra_pred_ang8_29_avx2(pixel* dst, intptr_t dstStride, const pixel* srcPix, int dirMode, int bFilter);
 void x265_all_angs_pred_4x4_sse4(pixel *dest, pixel *refPix, pixel *filtPix, int bLuma);
 void x265_all_angs_pred_8x8_sse4(pixel *dest, pixel *refPix, pixel *filtPix, int bLuma);
--- a/source/common/x86/intrapred8.asm	Thu Feb 26 17:20:36 2015 +0530
+++ b/source/common/x86/intrapred8.asm	Thu Feb 26 17:55:31 2015 +0530
@@ -32466,6 +32466,52 @@ cglobal intra_pred_ang8_30, 3, 4, 5
     movhps            [r0 + r3], xm2
     RET
 
+
+INIT_YMM avx2
+cglobal intra_pred_ang8_7, 3, 4, 5
+    mova              m3, [pw_1024]
+    vbroadcasti128    m0, [r2 + 17]
+
+    pshufb            m1, m0, [c_ang8_src1_9_1_9]
+    pshufb            m2, m0, [c_ang8_src1_9_2_10]
+    pshufb            m4, m0, [c_ang8_src2_10_2_10]
+    pshufb            m0,     [c_ang8_src2_10_3_11]
+
+    pmaddubsw         m1, [c_ang8_9_18]
+    pmulhrsw          m1, m3
+    pmaddubsw         m2, [c_ang8_27_4]
+    pmulhrsw          m2, m3
+    pmaddubsw         m4, [c_ang8_13_22]
+    pmulhrsw          m4, m3
+    pmaddubsw         m0, [c_ang8_31_8]
+    pmulhrsw          m0, m3
+    packuswb          m1, m2
+    packuswb          m4, m0
+
+    vperm2i128        m2, m1, m4, 00100000b
+    vperm2i128        m1, m1, m4, 00110001b
+    punpcklbw         m4, m2, m1
+    punpckhbw         m2, m1
+    punpcklwd         m1, m4, m2
+    punpckhwd         m4, m2
+    mova              m0, [trans8_shuf]
+    vpermd            m1, m0, m1
+    vpermd            m4, m0, m4
+
+    lea               r3, [3 * r1]
+    movq              [r0], xm1
+    movhps            [r0 + r1], xm1
+    vextracti128      xm2, m1, 1
+    movq              [r0 + 2 * r1], xm2
+    movhps            [r0 + r3], xm2
+    lea               r0, [r0 + 4 * r1]
+    movq              [r0], xm4
+    movhps            [r0 + r1], xm4
+    vextracti128      xm2, m4, 1
+    movq              [r0 + 2 * r1], xm2
+    movhps            [r0 + r3], xm2
+    RET
+
 INIT_YMM avx2
 cglobal intra_pred_ang8_29, 3, 4, 5
     mova              m3, [pw_1024]