annotate i386/motion_est_mmx.c @ 294:944632089814 libavcodec

4MV motion estimation (not finished yet) SAD functions rewritten (8x8 support & MMX2 optimizations) HQ inter/intra decission msmpeg4 encoding bugfix (MV where too long)
author michaelni
date Wed, 27 Mar 2002 21:25:22 +0000
parents 3049d6d452a3
children 54d86f074a4b
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"
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
22
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
23 static const __attribute__ ((aligned(8))) UINT64 round_tab[3]={
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
24 0x0000000000000000,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
25 0x0001000100010001,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
26 0x0002000200020002,
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
27 };
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
28
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
29 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
30 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
31 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
32 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
33 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
34 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
35 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
36 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
37 "movq (%2, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
38 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
39 "psubusb %%mm0, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
40 "psubusb %%mm4, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
41 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
42 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
43 "movq (%2, %%eax), %%mm5 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
44 "psubusb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
45 "psubusb %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
46 "por %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
47 "por %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
48 "movq %%mm0, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
49 "movq %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
50 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
51 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
52 "punpcklbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
53 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
54 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
55 "paddw %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
56 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
57 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
58 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
59 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
60 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
61 : "r" (blk1 - len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
62 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
63 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
64
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
65 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
66 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
67 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
68 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
69 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
70 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
71 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
72 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
73 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
74 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
75 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
76 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
77 "psadbw %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
78 "paddw %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
79 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
80 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
81 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
82 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
83 : "r" (blk1 - len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
84 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
85 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
86
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
87 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
88 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
89 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
90 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
91 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
92 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
93 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
94 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
95 "pavgb %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
96 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
97 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
98 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
99 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
100 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
101 "pavgb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
102 "movq (%3, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
103 "psadbw %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
104 "paddw %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
105 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
106 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
107 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
108 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
109 : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
110 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
111 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
112
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
113 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
114 { //FIXME reuse src
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
115 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
116 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
117 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
118 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
119 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
120 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
121 "movq 1(%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
122 "movq 1(%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
123 "pavgb %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
124 "pavgb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
125 "pavgb %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
126 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
127 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
128 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
129 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
130 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
131 "movq 1(%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
132 "movq 1(%2, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
133 "pavgb %%mm3, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
134 "pavgb %%mm4, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
135 "pavgb %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
136 "movq (%3, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
137 "psadbw %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
138 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
139 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
140 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
141 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
142 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
143 : "r" (blk1 - len), "r" (blk1 - len + stride), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
144 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
145 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
146
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
147 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
148 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
149 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
150 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
151 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
152 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
153 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
154 "movq (%2, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
155 "movq (%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
156 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
157 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
158 "punpcklbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
159 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
160 "punpckhbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
161 "paddw %%mm0, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
162 "paddw %%mm2, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
163 "movq (%3, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
164 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
165 "paddw %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
166 "paddw %%mm5, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
167 "psrlw $1, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
168 "psrlw $1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
169 "packuswb %%mm3, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
170 "psubusb %%mm1, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
171 "psubusb %%mm2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
172 "por %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
173 "movq %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
174 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
175 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
176 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
177 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
178 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
179 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
180 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
181 : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
182 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
183 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
184
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
185 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
186 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
187 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
188 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
189 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
190 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
191 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
192 "movq (%2, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
193 "movq %%mm0, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
194 "movq %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
195 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
196 "punpcklbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
197 "punpckhbw %%mm7, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
198 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
199 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
200 "paddw %%mm2, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
201 "movq 1(%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
202 "movq 1(%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
203 "movq %%mm2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
204 "punpcklbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
205 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
206 "paddw %%mm0, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
207 "paddw %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
208 "movq %%mm3, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
209 "punpcklbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
210 "punpckhbw %%mm7, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
211 "paddw %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
212 "paddw %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
213 "movq (%3, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
214 "movq (%3, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
215 "paddw %%mm5, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
216 "paddw %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
217 "psrlw $2, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
218 "psrlw $2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
219 "packuswb %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
220 "psubusb %%mm2, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
221 "psubusb %%mm4, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
222 "por %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
223 "movq %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
224 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
225 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
226 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
227 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
228 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
229 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
230 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
231 : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
232 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
233 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
234
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
235 static inline int sum_mmx()
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
236 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
237 int ret;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
238 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
239 "movq %%mm6, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
240 "psrlq $32, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
241 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
242 "movq %%mm6, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
243 "psrlq $16, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
244 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
245 "movd %%mm6, %0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
246 : "=r" (ret)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
247 );
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
248 return ret&0xFFFF;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
249 }
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
250
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
251 static inline int sum_mmx2()
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
252 {
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
253 int ret;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
254 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
255 "movd %%mm6, %0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
256 : "=r" (ret)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
257 );
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
258 return ret;
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
259 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
260
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
261 #define PIX_SAD(suf)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
262 int pix_abs8x8_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
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 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
265 "pxor %%mm6, %%mm6 \n\t":);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
266 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
267 sad8_ ## suf(blk1, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
268 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
269 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
270 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
271 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
272 int pix_abs8x8_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
273 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
274 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
275 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
276 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
277 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
278 );\
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 sad8_2_ ## suf(blk1, blk2+1, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
281 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
282 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
283 }\
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 int pix_abs8x8_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
286 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
287 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
288 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
289 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
290 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
291 );\
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 sad8_2_ ## suf(blk1, blk1+stride, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
294 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
295 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
296 }\
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 int pix_abs8x8_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
299 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
300 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
301 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
302 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
303 :: "m"(round_tab[2]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
304 );\
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 sad8_4_ ## suf(blk1, blk2, stride, 3);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
307 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
308 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
309 }\
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 int pix_abs16x16_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
312 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
313 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
314 "pxor %%mm6, %%mm6 \n\t":);\
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 sad8_ ## suf(blk1 , blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
317 sad8_ ## suf(blk1+8, blk2+8, stride, 4);\
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 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
320 }\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
321 int pix_abs16x16_x2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
322 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
323 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
324 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
325 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
326 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
327 );\
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 sad8_2_ ## suf(blk1 , blk1+1, blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
330 sad8_2_ ## suf(blk1+8, blk1+9, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
331 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
332 return sum_ ## suf();\
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 int pix_abs16x16_y2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
335 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
336 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
337 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
338 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
339 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
340 );\
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 sad8_2_ ## suf(blk1 , blk1+stride, blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
343 sad8_2_ ## suf(blk1+8, blk1+stride+8,blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
344 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
345 return sum_ ## suf();\
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 int pix_abs16x16_xy2_ ## suf(UINT8 *blk2, UINT8 *blk1, int stride)\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
348 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
349 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
350 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
351 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
352 :: "m"(round_tab[2]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
353 );\
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 sad8_4_ ## suf(blk1 , blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
356 sad8_4_ ## suf(blk1+8, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
357 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
358 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
359 }\
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
360
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
361 PIX_SAD(mmx)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
362 PIX_SAD(mmx2)