<div dir="ltr">Please ignore this patch.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 22, 2013 at 4:02 PM, <span dir="ltr"><<a href="mailto:nabajit@multicorewareinc.com" target="_blank">nabajit@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 Nabajit Deka<br>
# Date 1385116295 -19800<br>
# Fri Nov 22 16:01:35 2013 +0530<br>
# Node ID 18fd67c0d27291012b65bf9c48c675d09b5db1f3<br>
# Parent 5009254d3d3ac92e90b1551444c5eb32ba2f8d31<br>
asm : routine for weightUnidirPixel(), for input width in multiples of 16.<br>
<br>
diff -r 5009254d3d3a -r 18fd67c0d272 source/common/x86/pixel-util.asm<br>
--- a/source/common/x86/pixel-util.asm Fri Nov 22 00:17:46 2013 -0600<br>
+++ b/source/common/x86/pixel-util.asm Fri Nov 22 16:01:35 2013 +0530<br>
@@ -670,3 +670,81 @@<br>
movd eax, m7<br>
<br>
RET<br>
+<br>
+;-------------------------------------------------------------------------------------------------------------------------------------------------------<br>
+;void weightUnidirPixel(pixel *src, pixel *dst, intptr_t srcStride, intptr_t dstStride, int width, int height, int w0, int round, int shift, int offset)<br>
+;-------------------------------------------------------------------------------------------------------------------------------------------------------<br>
+INIT_XMM sse4<br>
+cglobal weightUnidirPixel, 6, 7, 6<br>
+<br>
+ mov r6d, r6m<br>
+ shl r6d, 6<br>
+ movd m0, r6d ; m0 = [w0<<6]<br>
+<br>
+ movd m1, r7m ; m1 = [round]<br>
+ punpcklwd m0, m1 ; assuming both (w0<<6) and round are using maximum of 16 bits each.<br>
+ pshufd m0, m0, 0 ; m0 = [w0<<6 round]<br>
+<br>
+ movd m1, r8m<br>
+<br>
+ movd m2, r9m<br>
+ pshufd m2, m2, 0<br>
+<br>
+ mova m5, [tab_c_1]<br>
+<br>
+ sub r2d, r4d<br>
+ sub r3d, r4d<br>
+<br>
+.loopH<br>
+ mov r6d, r4d<br>
+ shr r6d, 4<br>
+.loopW:<br>
+ movh m4, [r0]<br>
+ pmovzxbw m4, m4<br>
+<br>
+ punpcklwd m3, m4, m5<br>
+ pmaddwd m3, m0<br>
+ psrad m3, m1<br>
+ paddd m3, m2<br>
+<br>
+ punpckhwd m4, m5<br>
+ pmaddwd m4, m0<br>
+ psrad m4, m1<br>
+ paddd m4, m2<br>
+<br>
+ packssdw m3, m4<br>
+ packuswb m3, m3<br>
+<br>
+ movh [r1], m3<br>
+<br>
+ movh m4, [r0 + 8]<br>
+ pmovzxbw m4, m4<br>
+<br>
+ punpcklwd m3, m4, m5<br>
+ pmaddwd m3, m0<br>
+ psrad m3, m1<br>
+ paddd m3, m2<br>
+<br>
+ punpckhwd m4, m5<br>
+ pmaddwd m4, m0<br>
+ psrad m4, m1<br>
+ paddd m4, m2<br>
+<br>
+ packssdw m3, m4<br>
+ packuswb m3, m3<br>
+<br>
+ movh [r1 + 8], m3<br>
+<br>
+ add r0, 16<br>
+ add r1, 16<br>
+<br>
+ dec r6d<br>
+ jnz .loopW<br>
+<br>
+ lea r0, [r0 + r2]<br>
+ lea r1, [r1 + r3]<br>
+<br>
+ dec r5d<br>
+ jnz .loopH<br>
+<br>
+ RET<br>
</blockquote></div><br></div>