<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 31, 2013 at 6:18 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 Gorade <<a href="mailto:dnyaneshwar@multicorewareinc.com">dnyaneshwar@multicorewareinc.com</a>><br>
# Date 1383218218 -19800<br>
# Thu Oct 31 16:46:58 2013 +0530<br>
# Node ID 515b0af5eb805407d40ead87fd29a8c32118d3a2<br>
# Parent 86ff1a3ec89720a73325148e8ac01ec1dbdab3c2<br>
asm: Optimized sad_48x64: +5x and sad_24x32: +2x asm routines<br></blockquote><div><br></div><div>this doesn't apply either</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff -r 86ff1a3ec897 -r 515b0af5eb80 source/common/x86/sad-a.asm<br>
--- a/source/common/x86/sad-a.asm Thu Oct 31 16:21:35 2013 +0530<br>
+++ b/source/common/x86/sad-a.asm Thu Oct 31 16:46:58 2013 +0530<br>
@@ -175,39 +175,37 @@<br>
%macro PROCESS_SAD_24x4 0<br>
movu m1, [r2]<br>
movq m2, [r2 + 16]<br>
- lea r2, [r2 + r3]<br>
- movu m3, [r2]<br>
- movq m4, [r2 + 16]<br>
+ movu m3, [r2 + r3]<br>
+ movq m4, [r2 + r3 + 16]<br>
psadbw m1, [r0]<br>
psadbw m3, [r0 + r1]<br>
paddd m0, m1<br>
paddd m0, m3<br>
movq m1, [r0 + 16]<br>
- lea r0, [r0 + r1]<br>
- movq m3, [r0 + 16]<br>
+ movq m3, [r0 + r1 + 16]<br>
punpcklqdq m2, m4<br>
punpcklqdq m1, m3<br>
psadbw m2, m1<br>
paddd m0, m2<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
+ lea r2, [r2 + 2 * r3]<br>
+ lea r0, [r0 + 2 * r1]<br>
<br>
movu m1, [r2]<br>
movq m2, [r2 + 16]<br>
- lea r2, [r2 + r3]<br>
- movu m3, [r2]<br>
- movq m4, [r2 + 16]<br>
+ movu m3, [r2 + r3]<br>
+ movq m4, [r2 + r3 + 16]<br>
psadbw m1, [r0]<br>
psadbw m3, [r0 + r1]<br>
paddd m0, m1<br>
paddd m0, m3<br>
movq m1, [r0 + 16]<br>
- lea r0, [r0 + r1]<br>
- movq m3, [r0 + 16]<br>
+ movq m3, [r0 + r1 + 16]<br>
punpcklqdq m2, m4<br>
punpcklqdq m1, m3<br>
psadbw m2, m1<br>
paddd m0, m2<br>
+ lea r2, [r2 + 2 * r3]<br>
+ lea r0, [r0 + 2 * r1]<br>
%endmacro<br>
<br>
%macro PROCESS_SAD_32x4 0<br>
@@ -255,8 +253,18 @@<br>
paddd m1, m2<br>
paddd m0, m1<br>
paddd m0, m3<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
+<br>
+ movu m1, [r2 + r3]<br>
+ movu m2, [r2 + r3 + 16]<br>
+ movu m3, [r2 + r3 + 32]<br>
+ psadbw m1, [r0 + r1]<br>
+ psadbw m2, [r0 + r1 + 16]<br>
+ psadbw m3, [r0 + r1 + 32]<br>
+ paddd m1, m2<br>
+ paddd m0, m1<br>
+ paddd m0, m3<br>
+ lea r2, [r2 + 2 * r3]<br>
+ lea r0, [r0 + 2 * r1]<br>
<br>
movu m1, [r2]<br>
movu m2, [r2 + 16]<br>
@@ -267,30 +275,18 @@<br>
paddd m1, m2<br>
paddd m0, m1<br>
paddd m0, m3<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
<br>
- movu m1, [r2]<br>
- movu m2, [r2 + 16]<br>
- movu m3, [r2 + 32]<br>
- psadbw m1, [r0]<br>
- psadbw m2, [r0 + 16]<br>
- psadbw m3, [r0 + 32]<br>
+ movu m1, [r2 + r3]<br>
+ movu m2, [r2 + r3 + 16]<br>
+ movu m3, [r2 + r3 + 32]<br>
+ psadbw m1, [r0 + r1]<br>
+ psadbw m2, [r0 + r1 + 16]<br>
+ psadbw m3, [r0 + r1 + 32]<br>
paddd m1, m2<br>
paddd m0, m1<br>
paddd m0, m3<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
-<br>
- movu m1, [r2]<br>
- movu m2, [r2 + 16]<br>
- movu m3, [r2 + 32]<br>
- psadbw m1, [r0]<br>
- psadbw m2, [r0 + 16]<br>
- psadbw m3, [r0 + 32]<br>
- paddd m1, m2<br>
- paddd m0, m1<br>
- paddd m0, m3<br>
+ lea r2, [r2 + 2 * r3]<br>
+ lea r0, [r0 + 2 * r1]<br>
%endmacro<br>
<br>
%macro PROCESS_SAD_8x4 0<br>
@@ -725,27 +721,17 @@<br>
;-----------------------------------------------------------------------------<br>
; int pixel_sad_48x64( uint8_t *, intptr_t, uint8_t *, intptr_t )<br>
;-----------------------------------------------------------------------------<br>
-cglobal pixel_sad_48x64, 4,4,5<br>
+cglobal pixel_sad_48x64, 4,5,5<br>
pxor m0, m0<br>
- mov r4, 64<br>
+ mov r4d, 4<br>
<br>
.loop<br>
PROCESS_SAD_48x4<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
-<br>
PROCESS_SAD_48x4<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
-<br>
- sub r4, 8<br>
- cmp r4, 8<br>
-<br>
-jnz .loop<br>
PROCESS_SAD_48x4<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
PROCESS_SAD_48x4<br>
+ dec r4d<br>
+ jnz .loop<br>
<br>
movhlps m1, m0<br>
paddd m0, m1<br>
@@ -755,24 +741,17 @@<br>
;-----------------------------------------------------------------------------<br>
; int pixel_sad_24x32( uint8_t *, intptr_t, uint8_t *, intptr_t )<br>
;-----------------------------------------------------------------------------<br>
-cglobal pixel_sad_24x32, 4,4,4<br>
+cglobal pixel_sad_24x32, 4,5,4<br>
pxor m0, m0<br>
- mov r4, 32<br>
+ mov r4d, 2<br>
<br>
.loop<br>
PROCESS_SAD_24x4<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
PROCESS_SAD_24x4<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
- sub r4, 8<br>
- cmp r4, 8<br>
+ PROCESS_SAD_24x4<br>
+ PROCESS_SAD_24x4<br>
+ dec r4d<br>
jnz .loop<br>
- PROCESS_SAD_24x4<br>
- lea r2, [r2 + r3]<br>
- lea r0, [r0 + r1]<br>
- PROCESS_SAD_24x4<br>
<br>
movhlps m1, m0<br>
paddd m0, m1<br>
_______________________________________________<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" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Steve Borho
</div></div>