<div dir="ltr">pushed</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 14, 2017 at 1:35 PM,  <span dir="ltr"><<a href="mailto:jayashri@multicorewareinc.com" target="_blank">jayashri@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 Jayashri Murugan <<a href="mailto:jayashri@multicorewareinc.com">jayashri@multicorewareinc.com</a><wbr>><br>
# Date 1497421166 -19800<br>
#      Wed Jun 14 11:49:26 2017 +0530<br>
# Node ID 0e11a209ad118de136971184fcdf02<wbr>6fa275f9f2<br>
# Parent  65e038ecbbf63a2f449ccf52358c5f<wbr>bbec408b27<br>
avx2: 'integral4h' HIGH_BIT_DEPTH asm code -> 5.37x faster than 'C' version<br>
<br>
    integral_init4h  5.37x    457.68          2456.91<br>
<br>
diff -r 65e038ecbbf6 -r 0e11a209ad11 source/common/x86/asm-<wbr>primitives.cpp<br>
--- a/source/common/x86/asm-<wbr>primitives.cpp      Wed Jun 14 12:03:44 2017 +0530<br>
+++ b/source/common/x86/asm-<wbr>primitives.cpp      Wed Jun 14 11:49:26 2017 +0530<br>
@@ -2164,6 +2164,7 @@<br>
         p.integral_initv[INTEGRAL_16] = PFX(integral16v_avx2);<br>
         p.integral_initv[INTEGRAL_24] = PFX(integral24v_avx2);<br>
         p.integral_initv[INTEGRAL_32] = PFX(integral32v_avx2);<br>
+        p.integral_inith[INTEGRAL_4] = PFX(integral4h_avx2);<br>
<br>
         /* TODO: This kernel needs to be modified to work with HIGH_BIT_DEPTH only<br>
         p.planeClipAndMax = PFX(planeClipAndMax_avx2); */<br>
diff -r 65e038ecbbf6 -r 0e11a209ad11 source/common/x86/seaintegral.<wbr>asm<br>
--- a/source/common/x86/<wbr>seaintegral.asm Wed Jun 14 12:03:44 2017 +0530<br>
+++ b/source/common/x86/<wbr>seaintegral.asm Wed Jun 14 11:49:26 2017 +0530<br>
@@ -172,10 +172,55 @@<br>
     paddw      xm0, xm1<br>
 %endmacro<br>
<br>
+%macro INTEGRAL_FOUR_HORIZONTAL_8_HBD 0<br>
+    pmovzxwd       m0, [r1]<br>
+    pmovzxwd       m1, [r1 + 2]<br>
+    paddd          m0, m1<br>
+    pmovzxwd       m1, [r1 + 4]<br>
+    paddd          m0, m1<br>
+    pmovzxwd       m1, [r1 + 6]<br>
+    paddd          m0, m1<br>
+%endmacro<br>
+<br>
+%macro INTEGRAL_FOUR_HORIZONTAL_4_HBD 0<br>
+    pmovzxwd       xm0, [r1]<br>
+    pmovzxwd       xm1, [r1 + 2]<br>
+    paddd          xm0, xm1<br>
+    pmovzxwd       xm1, [r1 + 4]<br>
+    paddd          xm0, xm1<br>
+    pmovzxwd       xm1, [r1 + 6]<br>
+    paddd          xm0, xm1<br>
+%endmacro<br>
+<br>
 ;-----------------------------<wbr>------------------------------<wbr>------------------<br>
 ;static void integral_init4h(uint32_t *sum, pixel *pix, intptr_t stride)<br>
 ;-----------------------------<wbr>------------------------------<wbr>------------------<br>
 INIT_YMM avx2<br>
+%if HIGH_BIT_DEPTH<br>
+cglobal integral4h, 3, 5, 3<br>
+    lea            r3, [4 * r2]<br>
+    sub            r0, r3<br>
+    sub            r2, 4                      ;stride - 4<br>
+    mov            r4, r2<br>
+    shr            r4, 3<br>
+<br>
+.loop_8:<br>
+    INTEGRAL_FOUR_HORIZONTAL_8_HBD<br>
+    movu           m1, [r0]<br>
+    paddd          m0, m1<br>
+    movu           [r0 + r3], m0<br>
+    add            r1, 16<br>
+    add            r0, 32<br>
+    sub            r2, 8<br>
+    sub            r4, 1<br>
+    jnz            .loop_8<br>
+    INTEGRAL_FOUR_HORIZONTAL_4_HBD<br>
+    movu           xm1, [r0]<br>
+    paddd          xm0, xm1<br>
+    movu           [r0 + r3], xm0<br>
+    RET<br>
+<br>
+%else<br>
 cglobal integral4h, 3, 5, 3<br>
     lea            r3, [4 * r2]<br>
     sub            r0, r3<br>
@@ -227,6 +272,7 @@<br>
<br>
 .end<br>
     RET<br>
+%endif<br>
<br>
 ;-----------------------------<wbr>------------------------------<wbr>------------------<br>
 ;static void integral_init8h_c(uint32_t *sum, pixel *pix, intptr_t stride)<br>
______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
</blockquote></div><br></div>