annotate i386/motion_est_mmx.c @ 1223:fb02fae72a0a libavcodec

looks better (req. for mp-G2)
author arpi_esp
date Sat, 03 May 2003 19:26:52 +0000
parents f59c3f66363b
children c4539ef4d8cb
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
429
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
3 * Copyright (c) 2001 Fabrice Bellard.
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
4 *
429
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
5 * This library is free software; you can redistribute it and/or
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
7 * License as published by the Free Software Foundation; either
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
8 * version 2 of the License, or (at your option) any later version.
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
9 *
429
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
10 * This library is distributed in the hope that it will be useful,
72
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
429
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
13 * Lesser General Public License for more details.
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
14 *
429
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
16 * License along with this library; if not, write to the Free Software
718a22dc121f license/copyright change
glantau
parents: 330
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
72
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
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
23 static const __attribute__ ((aligned(8))) uint64_t round_tab[3]={
294
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
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
29 static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL;
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
30
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
31 static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
32 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
33 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
34 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
35 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
36 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
37 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
38 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
39 "movq (%2, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
40 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
41 "psubusb %%mm0, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
42 "psubusb %%mm4, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
43 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
44 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
45 "movq (%2, %%eax), %%mm5 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
46 "psubusb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
47 "psubusb %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
48 "por %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
49 "por %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
50 "movq %%mm0, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
51 "movq %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
52 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
53 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
54 "punpcklbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
55 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
56 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
57 "paddw %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
58 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
59 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
60 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
61 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
62 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
63 : "r" (blk1 - len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
64 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
65 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
66
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
67 static inline void sad8_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
68 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
69 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
70 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
71 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
72 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
73 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
74 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
75 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
76 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
77 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
78 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
79 "psadbw %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
80 "paddw %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
81 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
82 "addl %3, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
83 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
84 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
85 : "r" (blk1 - len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
86 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
87 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
88
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
89 static inline void sad8_2_mmx2(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
90 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
91 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
92 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
93 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
94 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
95 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
96 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
97 "pavgb %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
98 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
99 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
100 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
101 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
102 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
103 "pavgb %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
104 "movq (%3, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
105 "psadbw %%mm1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
106 "paddw %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
107 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
108 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
109 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
110 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
111 : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
112 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
113 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
114
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
115 static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
116 { //FIXME reuse src
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
117 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
118 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
119 ".balign 16 \n\t"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
120 "movq "MANGLE(bone)", %%mm5 \n\t"
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
121 "1: \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
122 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
123 "movq (%2, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
124 "movq 1(%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
125 "movq 1(%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
126 "pavgb %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
127 "pavgb %%mm1, %%mm3 \n\t"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
128 "psubusb %%mm5, %%mm3 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
129 "pavgb %%mm3, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
130 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
131 "psadbw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
132 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
133 "movq (%1, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
134 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
135 "movq 1(%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
136 "movq 1(%2, %%eax), %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
137 "pavgb %%mm3, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
138 "pavgb %%mm4, %%mm2 \n\t"
330
54d86f074a4b rounding bugfix
michaelni
parents: 294
diff changeset
139 "psubusb %%mm5, %%mm2 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
140 "pavgb %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
141 "movq (%3, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
142 "psadbw %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
143 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
144 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
145 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
146 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
147 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
148 : "r" (blk1 - len), "r" (blk1 - len + stride), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
149 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
150 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
151
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
152 static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
153 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
154 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
155 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
156 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
157 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
158 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
159 "movq (%2, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
160 "movq (%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
161 "movq (%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
162 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
163 "punpcklbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
164 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
165 "punpckhbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
166 "paddw %%mm0, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
167 "paddw %%mm2, %%mm3 \n\t"
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
168 "movq (%3, %%eax), %%mm4 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
169 "movq (%3, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
170 "paddw %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
171 "paddw %%mm5, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
172 "psrlw $1, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
173 "psrlw $1, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
174 "packuswb %%mm3, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
175 "psubusb %%mm1, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
176 "psubusb %%mm2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
177 "por %%mm4, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
178 "movq %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
179 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
180 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
181 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
182 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
183 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
184 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
185 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
186 : "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
187 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
188 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
189
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
190 static inline void sad8_4_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
191 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
192 int len= -(stride<<h);
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
193 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
194 ".balign 16 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
195 "1: \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
196 "movq (%1, %%eax), %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
197 "movq (%2, %%eax), %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
198 "movq %%mm0, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
199 "movq %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
200 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
201 "punpcklbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
202 "punpckhbw %%mm7, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
203 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
204 "paddw %%mm1, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
205 "paddw %%mm2, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
206 "movq 1(%1, %%eax), %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
207 "movq 1(%2, %%eax), %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
208 "movq %%mm2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
209 "punpcklbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
210 "punpckhbw %%mm7, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
211 "paddw %%mm0, %%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 %%mm3, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
214 "punpcklbw %%mm7, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
215 "punpckhbw %%mm7, %%mm4 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
216 "paddw %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
217 "paddw %%mm4, %%mm1 \n\t"
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
218 "movq (%3, %%eax), %%mm3 \n\t"
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
219 "movq (%3, %%eax), %%mm4 \n\t"
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
220 "paddw %%mm5, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
221 "paddw %%mm5, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
222 "psrlw $2, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
223 "psrlw $2, %%mm1 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
224 "packuswb %%mm1, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
225 "psubusb %%mm2, %%mm3 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
226 "psubusb %%mm4, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
227 "por %%mm3, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
228 "movq %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
229 "punpcklbw %%mm7, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
230 "punpckhbw %%mm7, %%mm2 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
231 "paddw %%mm2, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
232 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
233 "addl %4, %%eax \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
234 " js 1b \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
235 : "+a" (len)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
236 : "r" (blk1 - len), "r" (blk1 -len + stride), "r" (blk2 - len), "r" (stride)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
237 );
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
238 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
239
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
240 static inline int sum_mmx(void)
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
241 {
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
242 int ret;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
243 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
244 "movq %%mm6, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
245 "psrlq $32, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
246 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
247 "movq %%mm6, %%mm0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
248 "psrlq $16, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
249 "paddw %%mm0, %%mm6 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
250 "movd %%mm6, %0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
251 : "=r" (ret)
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 return ret&0xFFFF;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
254 }
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
255
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
256 static inline int sum_mmx2(void)
294
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 int ret;
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
259 asm volatile(
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
260 "movd %%mm6, %0 \n\t"
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
261 : "=r" (ret)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
262 );
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
263 return ret;
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
264 }
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
265
900
52c26a143399 100l (sad8x8_x2 had params in wrong order)
michaelni
parents: 429
diff changeset
266
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
267 #define PIX_SAD(suf)\
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
268 static int pix_abs8x8_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
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 }\
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
277 static int sad8x8_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
936
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
278 {\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
279 asm volatile("pxor %%mm7, %%mm7 \n\t"\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
280 "pxor %%mm6, %%mm6 \n\t":);\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
281 \
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
282 sad8_ ## suf(blk1, blk2, stride, 3);\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
283 \
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
284 return sum_ ## suf();\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
285 }\
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
286 \
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
287 static int pix_abs8x8_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
288 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
289 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
290 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
291 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
292 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
293 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
294 \
900
52c26a143399 100l (sad8x8_x2 had params in wrong order)
michaelni
parents: 429
diff changeset
295 sad8_2_ ## suf(blk1, blk1+1, blk2, stride, 3);\
294
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 return sum_ ## suf();\
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 \
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
300 static int pix_abs8x8_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
301 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
302 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
303 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
304 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
305 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
306 );\
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 sad8_2_ ## suf(blk1, blk1+stride, blk2, stride, 3);\
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 return sum_ ## suf();\
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 \
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
313 static int pix_abs8x8_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
314 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
315 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
316 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
317 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
318 :: "m"(round_tab[2]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
319 );\
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 sad8_4_ ## suf(blk1, blk2, stride, 3);\
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 return sum_ ## suf();\
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 \
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
326 static int pix_abs16x16_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
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 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
329 "pxor %%mm6, %%mm6 \n\t":);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
330 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
331 sad8_ ## suf(blk1 , blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
332 sad8_ ## suf(blk1+8, blk2+8, stride, 4);\
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 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
335 }\
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
336 static int sad16x16_ ## suf(void *s, uint8_t *blk2, uint8_t *blk1, int stride)\
936
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
337 {\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
338 asm volatile("pxor %%mm7, %%mm7 \n\t"\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
339 "pxor %%mm6, %%mm6 \n\t":);\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
340 \
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
341 sad8_ ## suf(blk1 , blk2 , stride, 4);\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
342 sad8_ ## suf(blk1+8, blk2+8, stride, 4);\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
343 \
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
344 return sum_ ## suf();\
caa77cd960c0 qpel encoding
michaelni
parents: 900
diff changeset
345 }\
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
346 static int pix_abs16x16_x2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
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 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
349 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
350 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
351 :: "m"(round_tab[1]) \
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 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
354 sad8_2_ ## suf(blk1 , blk1+1, blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
355 sad8_2_ ## suf(blk1+8, blk1+9, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
356 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
357 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
358 }\
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
359 static int pix_abs16x16_y2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
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 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
362 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
363 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
364 :: "m"(round_tab[1]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
365 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
366 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
367 sad8_2_ ## suf(blk1 , blk1+stride, blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
368 sad8_2_ ## suf(blk1+8, blk1+stride+8,blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
369 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
370 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
371 }\
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 1057
diff changeset
372 static int pix_abs16x16_xy2_ ## suf(uint8_t *blk2, uint8_t *blk1, int stride)\
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
373 {\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
374 asm volatile("pxor %%mm7, %%mm7 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
375 "pxor %%mm6, %%mm6 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
376 "movq %0, %%mm5 \n\t"\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
377 :: "m"(round_tab[2]) \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
378 );\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
379 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
380 sad8_4_ ## suf(blk1 , blk2 , stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
381 sad8_4_ ## suf(blk1+8, blk2+8, stride, 4);\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
382 \
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
383 return sum_ ## suf();\
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
384 }\
72
3049d6d452a3 suppressed nasm dependancy - rewrote forward DCT and motion estimation code
glantau
parents:
diff changeset
385
294
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
386 PIX_SAD(mmx)
944632089814 4MV motion estimation (not finished yet)
michaelni
parents: 72
diff changeset
387 PIX_SAD(mmx2)
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
388
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
389 void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx)
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
390 {
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
391 if (mm_flags & MM_MMX) {
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
392 c->pix_abs16x16 = pix_abs16x16_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
393 c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
394 c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
395 c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
396 c->pix_abs8x8 = pix_abs8x8_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
397 c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
398 c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
399 c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
400
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
401 c->sad[0]= sad16x16_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
402 c->sad[1]= sad8x8_mmx;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
403 }
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
404 if (mm_flags & MM_MMXEXT) {
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
405 c->pix_abs16x16 = pix_abs16x16_mmx2;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
406 c->pix_abs8x8 = pix_abs8x8_mmx2;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
407
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
408 c->sad[0]= sad16x16_mmx2;
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
409 c->sad[1]= sad8x8_mmx2;
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
410
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
411 if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
412 c->pix_abs16x16_x2 = pix_abs16x16_x2_mmx2;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
413 c->pix_abs16x16_y2 = pix_abs16x16_y2_mmx2;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
414 c->pix_abs16x16_xy2 = pix_abs16x16_xy2_mmx2;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
415 c->pix_abs8x8_x2 = pix_abs8x8_x2_mmx2;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
416 c->pix_abs8x8_y2 = pix_abs8x8_y2_mmx2;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
417 c->pix_abs8x8_xy2 = pix_abs8x8_xy2_mmx2;
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1065
diff changeset
418 }
1057
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
419 }
bb5de8a59da8 * static,const,compiler warning cleanup
kabi
parents: 936
diff changeset
420 }