[x265] [PATCH] asm: avx2 code for addavg[12x32] for 10 bpp (1952 -> 1853)

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Tue May 26 07:04:04 CEST 2015


# HG changeset patch
# User Sumalatha Polureddy
# Date 1432616636 -19800
#      Tue May 26 10:33:56 2015 +0530
# Node ID 4af40cfbfc2af9ce02d78e18df356a288bc3102d
# Parent  9162e9b4edc45c9333889dbd0b8d90374dc32921
asm: avx2 code for addavg[12x32] for 10 bpp (1952 -> 1853)

sse4:
[i422]  addAvg[12x32]  7.76x    1952.76         15160.44
avx2:
[i422]  addAvg[12x32]  8.22x    1853.46         15228.59

diff -r 9162e9b4edc4 -r 4af40cfbfc2a source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp	Tue May 26 10:27:49 2015 +0530
+++ b/source/common/x86/asm-primitives.cpp	Tue May 26 10:33:56 2015 +0530
@@ -1250,6 +1250,7 @@
         p.chroma[X265_CSP_I422].pu[CHROMA_422_16x8].addAvg = x265_addAvg_16x8_avx2;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_8x64].addAvg = x265_addAvg_8x64_avx2;
         p.chroma[X265_CSP_I422].pu[CHROMA_422_24x64].addAvg = x265_addAvg_24x64_avx2;
+        p.chroma[X265_CSP_I422].pu[CHROMA_422_12x32].addAvg = x265_addAvg_12x32_avx2;
 
         p.cu[BLOCK_4x4].psy_cost_ss = x265_psyCost_ss_4x4_avx2;
         p.cu[BLOCK_8x8].psy_cost_ss = x265_psyCost_ss_8x8_avx2;
diff -r 9162e9b4edc4 -r 4af40cfbfc2a source/common/x86/mc-a.asm
--- a/source/common/x86/mc-a.asm	Tue May 26 10:27:49 2015 +0530
+++ b/source/common/x86/mc-a.asm	Tue May 26 10:33:56 2015 +0530
@@ -1200,6 +1200,48 @@
     jnz            .loop
     RET
 
+cglobal addAvg_12x32, 6,7,6, pSrc0, pSrc1, pDst, iStride0, iStride1, iDstStride
+    mova           m4,             [pw_512]
+    mova           m5,             [pw_1023]
+    paddw          m3,             m4,  m4
+    pxor           m1,             m1
+    add            r3,             r3
+    add            r4,             r4
+    add            r5,             r5
+    mov            r6d,            8
+
+.loop:
+%rep 2
+    movu           m0,             [r0]
+    movu           m2,             [r1]
+    paddw          m0,             m2
+    pmulhrsw       m0,             m3
+    paddw          m0,             m4
+    pmaxsw         m0,             m1
+    pminsw         m0,             m5
+    vextracti128   xm2,            m0, 1
+    movu           [r2],           xm0
+    movq           [r2 + 16],      xm2
+
+    movu           m0,             [r0 + r3]
+    movu           m2,             [r1 + r4]
+    paddw          m0,             m2
+    pmulhrsw       m0,             m3
+    paddw          m0,             m4
+    pmaxsw         m0,             m1
+    pminsw         m0,             m5
+    vextracti128   xm2,            m0, 1
+    movu           [r2 + r5],      xm0
+    movq           [r2 + r5 + 16], xm2
+
+    lea            r2,             [r2 + 2 * r5]
+    lea            r0,             [r0 + 2 * r3]
+    lea            r1,             [r1 + 2 * r4]
+%endrep
+    dec            r6d
+    jnz            .loop
+    RET
+
 %macro ADDAVG_W16_H4_AVX2 1
 cglobal addAvg_16x%1, 6,7,6, pSrc0, pSrc1, pDst, iStride0, iStride1, iDstStride
     mova        m4,              [pw_512]


More information about the x265-devel mailing list