annotate i386/motion_est_mmx.c @ 427:c058624083e1 libavcodec

fixed incorrect buffer handling
author glantau
date Sat, 25 May 2002 22:39:29 +0000
parents 54d86f074a4b
children 718a22dc121f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
1 /*
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
2 * MMX optimized motion estimation
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
3 * Copyright (c) 2001 Gerard Lantau.
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
4 *
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
8 * (at your option) any later version.
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
9 *
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
13 * GNU General Public License for more details.
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
14 *
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
18 *
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
19 * mostly by Michael Niedermayer <michaelni@gmx.at>
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
20 */
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
21 #include "../dsputil.h"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
22 #include "../mangle.h"
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
23
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
24 static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
25 0x0000000000000000,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
26 0x0001000100010001,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
27 0x0002000200020002,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
28 };
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
29
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
30 static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL;
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
31
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
32 static inline void sad8_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
33 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
34 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
35 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
36 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
37 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
38 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
39 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
40 "movq (%2, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
41 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
42 "psubusb %%mm0, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
43 "psubusb %%mm4, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
44 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
45 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
46 "movq (%2, %%eax), %%mm5 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
47 "psubusb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
48 "psubusb %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
49 "por %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
50 "por %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
51 "movq %%mm0, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
52 "movq %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
53 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
54 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
55 "punpcklbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
56 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
57 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
58 "paddw %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
59 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
60 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
61 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
62 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
63 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
64 : "r" (blk1 - len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
65 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
66 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
67
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
68 static inline void sad8_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
69 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
70 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
71 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
72 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
73 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
74 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
75 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
76 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
77 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
78 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
79 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
80 "psadbw %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
81 "paddw %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
82 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
83 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
84 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
85 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
86 : "r" (blk1 - len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
87 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
88 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
89
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
90 static inline void sad8_2_mmx2(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
91 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
92 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
93 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
94 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
95 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
96 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
97 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
98 "pavgb %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
99 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
100 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
101 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
102 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
103 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
104 "pavgb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
105 "movq (%3, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
106 "psadbw %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
107 "paddw %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
108 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
109 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
110 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
111 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
112 : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
113 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
114 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
115
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
116 static inline void sad8_4_mmx2(UINT8 *blk1, UINT8 *blk2, int stride, int h)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
117 { //FIXME reuse src
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
118 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
119 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
120 ".balign 16 \n\t"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
121 "movq "MANGLE(bone)", %%mm5 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
122 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
123 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
124 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
125 "movq 1(%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
126 "movq 1(%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
127 "pavgb %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
128 "pavgb %%mm1, %%mm3 \n\t"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
129 "psubusb %%mm5, %%mm3 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
130 "pavgb %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
131 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
132 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
133 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
134 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
135 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
136 "movq 1(%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
137 "movq 1(%2, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
138 "pavgb %%mm3, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
139 "pavgb %%mm4, %%mm2 \n\t"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
140 "psubusb %%mm5, %%mm2 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
141 "pavgb %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
142 "movq (%3, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
143 "psadbw %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
144 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
145 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
146 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
147 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
148 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
149 : "r" (blk1 - len), "r" (blk1 - len + stride), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
150 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
151 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
152
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
153 static inline void sad8_2_mmx(UINT8 *blk1a, UINT8 *blk1b, UINT8 *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
154 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
155 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
156 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
157 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
158 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
159 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
160 "movq (%2, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
161 "movq (%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
162 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
163 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
164 "punpcklbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
165 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
166 "punpckhbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
167 "paddw %%mm0, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
168 "paddw %%mm2, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
169 "movq (%3, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
170 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
171 "paddw %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
172 "paddw %%mm5, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
173 "psrlw $1, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
174 "psrlw $1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
175 "packuswb %%mm3, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
176 "psubusb %%mm1, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
177 "psubusb %%mm2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
178 "por %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
179 "movq %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
180 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
181 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
182 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
183 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
184 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
185 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
186 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
187 : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
188 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
189 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
190
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
191 static inline void sad8_4_mmx(UINT8 *blk1, UINT8 *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
192 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
193 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
194 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
195 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
196 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
197 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
198 "movq (%2, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
199 "movq %%mm0, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
200 "movq %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
201 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
202 "punpcklbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
203 "punpckhbw %%mm7, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
204 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
205 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
206 "paddw %%mm2, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
207 "movq 1(%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
208 "movq 1(%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
209 "movq %%mm2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
210 "punpcklbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
211 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
212 "paddw %%mm0, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
213 "paddw %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
214 "movq %%mm3, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
215 "punpcklbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
216 "punpckhbw %%mm7, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
217 "paddw %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
218 "paddw %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
219 "movq (%3, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
220 "movq (%3, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
221 "paddw %%mm5, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
222 "paddw %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
223 "psrlw $2, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
224 "psrlw $2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
225 "packuswb %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
226 "psubusb %%mm2, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
227 "psubusb %%mm4, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
228 "por %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
229 "movq %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
230 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
231 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
232 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
233 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
234 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
235 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
236 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
237 : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
238 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
239 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
240
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
241 static inline int sum_mmx()
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
242 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
243 int ret;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
244 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
245 "movq %%mm6, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
246 "psrlq $32, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
247 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
248 "movq %%mm6, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
249 "psrlq $16, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
250 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
251 "movd %%mm6, %0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
252 : "=r" (ret)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
253 );
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
254 return ret&0xFFFF;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
255 }
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
256
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
257 static inline int sum_mmx2()
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
258 {
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
259 int ret;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
260 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
261 "movd %%mm6, %0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
262 : "=r" (ret)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
263 );
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
264 return ret;
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
265 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
266
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
267 #define PIX_SAD(suf)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
268 int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
269 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
270 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
271 "pxor %%mm6, %%mm6 \n\t":);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
272 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
273 sad8_ ## suf(blk1, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
274 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
275 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
276 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
277 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
278 int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
279 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
280 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
281 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
282 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
283 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
284 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
285 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
286 sad8_2_ ## suf(blk1, blk2+1, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
287 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
288 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
289 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
290 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
291 int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
292 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
293 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
294 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
295 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
296 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
297 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
298 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
299 sad8_2_ ## suf(blk1, blk1+stride, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
300 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
301 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
302 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
303 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
304 int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
305 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
306 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
307 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
308 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
309 :: "m"(round_tab[2]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
310 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
311 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
312 sad8_4_ ## suf(blk1, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
313 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
314 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
315 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
316 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
317 int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
318 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
319 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
320 "pxor %%mm6, %%mm6 \n\t":);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
321 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
322 sad8_ ## suf(blk1 , blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
323 sad8_ ## suf(blk1+8, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
324 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
325 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
326 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
327 int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
328 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
329 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
330 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
331 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
332 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
333 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
334 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
335 sad8_2_ ## suf(blk1 , blk1+1, blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
336 sad8_2_ ## suf(blk1+8, blk1+9, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
337 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
338 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
339 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
340 int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
341 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
342 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
343 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
344 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
345 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
346 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
347 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
348 sad8_2_ ## suf(blk1 , blk1+stride, blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
349 sad8_2_ ## suf(blk1+8, blk1+stride+8,blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
350 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
351 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
352 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
353 int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
354 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
355 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
356 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
357 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
358 :: "m"(round_tab[2]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
359 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
360 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
361 sad8_4_ ## suf(blk1 , blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
362 sad8_4_ ## suf(blk1+8, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
363 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
364 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
365 }\
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
366
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
367 PIX_SAD(mmx)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
368 PIX_SAD(mmx2)