<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small">does this patch need re-review? Not seeing this into public tree?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 11:44 AM,  <span dir="ltr"><<a href="mailto:dnyaneshwar@multicorewareinc.com" target="_blank">dnyaneshwar@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Dnyaneshwar G <<a href="mailto:dnyaneshwar@multicorewareinc.com">dnyaneshwar@multicorewareinc.com</a>><br>
# Date 1426745611 -19800<br>
#      Thu Mar 19 11:43:31 2015 +0530<br>
# Node ID d2b99b5edfde84bd4ad22daaca6f87662d46c2df<br>
# Parent  2807d9a5a494de78340ab6d09867205b6676330b<br>
asm: addAvg avx2 code for chroma sizes width >= 8, reused code from luma<br>
<br>
AVX2:<br>
addAvg[  8x2]  7.79x    84.28           656.61<br>
addAvg[  8x6]  10.92x   334.48          3654.07<br>
<br>
SSE4:<br>
addAvg[  8x2]  7.50x    89.67           672.36<br>
addAvg[  8x6]  10.74x   342.18          3673.41<br>
<br>
diff -r 2807d9a5a494 -r d2b99b5edfde source/common/x86/asm-primitives.cpp<br>
--- a/source/common/x86/asm-primitives.cpp      Thu Mar 19 11:22:06 2015 +0530<br>
+++ b/source/common/x86/asm-primitives.cpp      Thu Mar 19 11:43:31 2015 +0530<br>
@@ -1446,6 +1446,26 @@<br>
         p.pu[LUMA_64x48].addAvg = x265_addAvg_64x48_avx2;<br>
         p.pu[LUMA_64x64].addAvg = x265_addAvg_64x64_avx2;<br>
<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].addAvg = x265_addAvg_8x2_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].addAvg = x265_addAvg_8x4_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x6].addAvg = x265_addAvg_8x6_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].addAvg = x265_addAvg_8x8_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].addAvg = x265_addAvg_8x16_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_8x32].addAvg = x265_addAvg_8x32_avx2;<br>
+<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_12x16].addAvg = x265_addAvg_12x16_avx2;<br>
+<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].addAvg = x265_addAvg_16x4_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_16x8].addAvg = x265_addAvg_16x8_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].addAvg = x265_addAvg_16x12_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].addAvg = x265_addAvg_16x16_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].addAvg = x265_addAvg_16x32_avx2;<br>
+<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].addAvg = x265_addAvg_32x8_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_32x16].addAvg = x265_addAvg_32x16_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_32x24].addAvg = x265_addAvg_32x24_avx2;<br>
+        p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].addAvg = x265_addAvg_32x32_avx2;<br>
+<br>
         <a href="http://p.cu" target="_blank">p.cu</a>[BLOCK_16x16].add_ps = x265_pixel_add_ps_16x16_avx2;<br>
         <a href="http://p.cu" target="_blank">p.cu</a>[BLOCK_32x32].add_ps = x265_pixel_add_ps_32x32_avx2;<br>
         <a href="http://p.cu" target="_blank">p.cu</a>[BLOCK_64x64].add_ps = x265_pixel_add_ps_64x64_avx2;<br>
diff -r 2807d9a5a494 -r d2b99b5edfde source/common/x86/mc-a.asm<br>
--- a/source/common/x86/mc-a.asm        Thu Mar 19 11:22:06 2015 +0530<br>
+++ b/source/common/x86/mc-a.asm        Thu Mar 19 11:43:31 2015 +0530<br>
@@ -1762,6 +1762,84 @@<br>
 ; addAvg avx2 code start<br>
 ;-----------------------------------------------------------------------------<br>
<br>
+INIT_YMM avx2<br>
+cglobal addAvg_8x2, 6,6,4, pSrc0, src0, src1, dst, src0Stride, src1tride, dstStride<br>
+    movu            xm0, [r0]<br>
+    vinserti128     m0, m0, [r0 + 2 * r3], 1<br>
+<br>
+    movu            xm2, [r1]<br>
+    vinserti128     m2, m2, [r1 + 2 * r4], 1<br>
+<br>
+    paddw           m0, m2<br>
+    pmulhrsw        m0, [pw_256]<br>
+    paddw           m0, [pw_128]<br>
+<br>
+    packuswb        m0, m0<br>
+    vextracti128    xm1, m0, 1<br>
+    movq            [r2], xm0<br>
+    movq            [r2 + r5], xm1<br>
+    RET<br>
+<br>
+cglobal addAvg_8x6, 6,6,6, pSrc0, src0, src1, dst, src0Stride, src1tride, dstStride<br>
+    mova            m4, [pw_256]<br>
+    mova            m5, [pw_128]<br>
+    add             r3, r3<br>
+    add             r4, r4<br>
+<br>
+    movu            xm0, [r0]<br>
+    vinserti128     m0, m0, [r0 + r3], 1<br>
+<br>
+    movu            xm2, [r1]<br>
+    vinserti128     m2, m2, [r1 + r4], 1<br>
+<br>
+    paddw           m0, m2<br>
+    pmulhrsw        m0, m4<br>
+    paddw           m0, m5<br>
+<br>
+    packuswb        m0, m0<br>
+    vextracti128    xm1, m0, 1<br>
+    movq            [r2], xm0<br>
+    movq            [r2 + r5], xm1<br>
+<br>
+    lea             r2, [r2 + 2 * r5]<br>
+    lea             r0, [r0 + 2 * r3]<br>
+    lea             r1, [r1 + 2 * r4]<br>
+<br>
+    movu            xm0, [r0]<br>
+    vinserti128     m0, m0, [r0+  r3], 1<br>
+<br>
+    movu            xm2, [r1]<br>
+    vinserti128     m2, m2, [r1 + r4], 1<br>
+<br>
+    paddw           m0, m2<br>
+    pmulhrsw        m0, m4<br>
+    paddw           m0, m5<br>
+<br>
+    packuswb        m0, m0<br>
+    vextracti128    xm1, m0, 1<br>
+    movq            [r2], xm0<br>
+    movq            [r2 + r5], xm1<br>
+<br>
+    lea             r2, [r2 + 2 * r5]<br>
+    lea             r0, [r0 + 2 * r3]<br>
+    lea             r1, [r1 + 2 * r4]<br>
+<br>
+    movu            xm0, [r0]<br>
+    vinserti128     m0, m0, [r0 + r3], 1<br>
+<br>
+    movu            xm2, [r1]<br>
+    vinserti128     m2, m2, [r1 + r4], 1<br>
+<br>
+    paddw           m0, m2<br>
+    pmulhrsw        m0, m4<br>
+    paddw           m0, m5<br>
+<br>
+    packuswb        m0, m0<br>
+    vextracti128    xm1, m0, 1<br>
+    movq            [r2], xm0<br>
+    movq            [r2 + r5], xm1<br>
+    RET<br>
+<br>
 %macro ADDAVG_W8_H4_AVX2 1<br>
 INIT_YMM avx2<br>
 cglobal addAvg_8x%1, 6,7,6, pSrc0, src0, src1, dst, src0Stride, src1tride, dstStride<br>
</blockquote></div><br></div>