<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 6:51 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 1496062876 -19800<br>
# Mon May 29 18:31:16 2017 +0530<br>
# Node ID dd8b50b2d936a5f21972563e117101<wbr>f82a1ae9c4<br>
# Parent e75d5f5eeae3413057437af9f7d3ba<wbr>9bc10fa3fa<br>
avx2: 'integral4h' asm code -> 6.01x faster than 'C' version<br>
<br>
integral_init4h 6.01x 353.40 2122.37<br></blockquote><div><br></div><div>Pushed to default branch of x265.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r e75d5f5eeae3 -r dd8b50b2d936 source/common/x86/asm-<wbr>primitives.cpp<br>
--- a/source/common/x86/asm-<wbr>primitives.cpp Mon Jun 05 15:20:44 2017 +0530<br>
+++ b/source/common/x86/asm-<wbr>primitives.cpp Mon May 29 18:31:16 2017 +0530<br>
@@ -3709,6 +3709,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>
}<br>
#endif<br>
diff -r e75d5f5eeae3 -r dd8b50b2d936 source/common/x86/seaintegral.<wbr>asm<br>
--- a/source/common/x86/<wbr>seaintegral.asm Mon Jun 05 15:20:44 2017 +0530<br>
+++ b/source/common/x86/<wbr>seaintegral.asm Mon May 29 18:31:16 2017 +0530<br>
@@ -152,8 +152,67 @@<br>
;static void integral_init4h_c(uint32_t *sum, pixel *pix, intptr_t stride)<br>
;-----------------------------<wbr>------------------------------<wbr>------------------<br>
INIT_YMM avx2<br>
-cglobal integral4h, 3, 3, 0<br>
-<br>
+<br>
+%macro INTEGRAL_FOUR_HORIZONTAL_16 0<br>
+ pmovzxbw m0, [r1]<br>
+ pmovzxbw m1, [r1 + 1]<br>
+ paddw m0, m1<br>
+ pmovzxbw m1, [r1 + 2]<br>
+ paddw m0, m1<br>
+ pmovzxbw m1, [r1 + 3]<br>
+ paddw m0, m1<br>
+%endmacro<br>
+<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, 4<br>
+<br>
+.loop_16:<br>
+ INTEGRAL_FOUR_HORIZONTAL_16<br>
+ vperm2i128 m2, m0, m0, 1<br>
+ pmovzxwd m2, xm2<br>
+ pmovzxwd m0, xm0<br>
+ movu m1, [r0]<br>
+ paddd m0, m1<br>
+ movu [r0 + r3], m0<br>
+ movu m1, [r0 + 32]<br>
+ paddd m2, m1<br>
+ movu [r0 + r3 + 32], m2<br>
+ add r1, 16<br>
+ add r0, 64<br>
+ sub r2, 16<br>
+ sub r4, 1<br>
+ jnz .loop_16<br>
+ cmp r2, 12<br>
+ je .loop_12<br>
+ cmp r2, 4<br>
+ je .loop_4<br>
+<br>
+.loop_12:<br>
+ INTEGRAL_FOUR_HORIZONTAL_16<br>
+ vperm2i128 m2, m0, m0, 1<br>
+ pmovzxwd xm2, xm2<br>
+ pmovzxwd m0, xm0<br>
+ movu m1, [r0]<br>
+ paddd m0, m1<br>
+ movu [r0 + r3], m0<br>
+ movu xm1, [r0 + 32]<br>
+ paddd xm2, xm1<br>
+ movu [r0 + r3 + 32], xm2<br>
+ jmp .end<br>
+<br>
+.loop_4:<br>
+ INTEGRAL_FOUR_HORIZONTAL_16<br>
+ pmovzxwd xm0, xm0<br>
+ movu xm1, [r0]<br>
+ paddd xm0, xm1<br>
+ movu [r0 + r3], xm0<br>
+ jmp .end<br>
+<br>
+.end<br>
RET<br>
<br>
;-----------------------------<wbr>------------------------------<wbr>------------------<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></div>