Lines 31-52
Link Here
|
31 |
"pxor %%mm6, %%mm6\n\t" |
31 |
"pxor %%mm6, %%mm6\n\t" |
32 |
"pxor %%mm7, %%mm7\n\t" |
32 |
"pxor %%mm7, %%mm7\n\t" |
33 |
|
33 |
|
34 |
"movq -2(%%"XBX"), %%mm0\n\t" // value a from top left |
34 |
"movq -2(%%"XDX"), %%mm0\n\t" // value a from top left |
35 |
"movq -4(%%"XBX", %%"XCX"), %%mm1\n\t" // value m from bottom right |
35 |
"movq -4(%%"XDX", %%"XCX"), %%mm1\n\t" // value m from bottom right |
36 |
|
36 |
|
37 |
"movq %%mm0, %%mm3\n\t" |
37 |
"movq %%mm0, %%mm3\n\t" |
38 |
"psubusb %%mm1, %%mm3\n\t" |
38 |
"psubusb %%mm1, %%mm3\n\t" |
39 |
"psubusb %%mm0, %%mm1\n\t" |
39 |
"psubusb %%mm0, %%mm1\n\t" |
40 |
"por %%mm1, %%mm3\n\t" // abs(a,m) |
40 |
"por %%mm1, %%mm3\n\t" // abs(a,m) |
41 |
|
41 |
|
42 |
"psubusb "MANGLE(DiffThres)", %%mm3\n\t" // nonzero where abs(a,m) > Thres else 0 |
42 |
"psubusb "_DiffThres", %%mm3\n\t" // nonzero where abs(a,m) > Thres else 0 |
43 |
"pxor %%mm4, %%mm4\n\t" |
43 |
"pxor %%mm4, %%mm4\n\t" |
44 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(a,m) < Thres, else 00 |
44 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(a,m) < Thres, else 00 |
45 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(a,m) > Thres, else 00 |
45 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(a,m) > Thres, else 00 |
46 |
|
46 |
|
47 |
|
47 |
|
48 |
"movq -4(%%"XBX"), %%mm0\n\t" // value j |
48 |
"movq -4(%%"XDX"), %%mm0\n\t" // value j |
49 |
"movq 4(%%"XBX", %%"XCX"), %%mm1\n\t" // value n |
49 |
"movq 4(%%"XDX", %%"XCX"), %%mm1\n\t" // value n |
50 |
"movq %%mm0, %%mm2\n\t" |
50 |
"movq %%mm0, %%mm2\n\t" |
51 |
"pavgb %%mm1, %%mm2\n\t" // avg(j,n) |
51 |
"pavgb %%mm1, %%mm2\n\t" // avg(j,n) |
52 |
"movq %%mm0, %%mm3\n\t" |
52 |
"movq %%mm0, %%mm3\n\t" |
Lines 55-61
Link Here
|
55 |
"por %%mm1, %%mm0\n\t" // abs(j,n) |
55 |
"por %%mm1, %%mm0\n\t" // abs(j,n) |
56 |
|
56 |
|
57 |
"movq %%mm0, %%mm1\n\t" |
57 |
"movq %%mm0, %%mm1\n\t" |
58 |
"psubusb "MANGLE(DiffThres)", %%mm1\n\t" // nonzero where abs(j,n) > Thres else 0 |
58 |
"psubusb "_DiffThres", %%mm1\n\t" // nonzero where abs(j,n) > Thres else 0 |
59 |
"pxor %%mm3, %%mm3\n\t" |
59 |
"pxor %%mm3, %%mm3\n\t" |
60 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(j,n) < Thres, else 00 |
60 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(j,n) < Thres, else 00 |
61 |
|
61 |
|
Lines 75-105
Link Here
|
75 |
"por %%mm0, %%mm7\n\t" |
75 |
"por %%mm0, %%mm7\n\t" |
76 |
|
76 |
|
77 |
// k & m |
77 |
// k & m |
78 |
"movq 2(%%"XBX"), %%mm0\n\t" // value c from top left |
78 |
"movq 2(%%"XDX"), %%mm0\n\t" // value c from top left |
79 |
"movq 4(%%"XBX", %%"XCX"), %%mm1\n\t" // value n from bottom right |
79 |
"movq 4(%%"XDX", %%"XCX"), %%mm1\n\t" // value n from bottom right |
80 |
|
80 |
|
81 |
"movq %%mm0, %%mm3\n\t" |
81 |
"movq %%mm0, %%mm3\n\t" |
82 |
"psubusb %%mm1, %%mm3\n\t" |
82 |
"psubusb %%mm1, %%mm3\n\t" |
83 |
"psubusb %%mm0, %%mm1\n\t" |
83 |
"psubusb %%mm0, %%mm1\n\t" |
84 |
"por %%mm1, %%mm3\n\t" // abs(c,n) |
84 |
"por %%mm1, %%mm3\n\t" // abs(c,n) |
85 |
|
85 |
|
86 |
"psubusb "MANGLE(DiffThres)", %%mm3\n\t" // nonzero where abs(c,n) > Thres else 0 |
86 |
"psubusb "_DiffThres", %%mm3\n\t" // nonzero where abs(c,n) > Thres else 0 |
87 |
"pxor %%mm4, %%mm4\n\t" |
87 |
"pxor %%mm4, %%mm4\n\t" |
88 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(c,n) < Thres, else 00 |
88 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(c,n) < Thres, else 00 |
89 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(c,n) > Thres, else 00 |
89 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(c,n) > Thres, else 00 |
90 |
|
90 |
|
91 |
|
91 |
|
92 |
"movq 4(%%"XBX"), %%mm0\n\t" // value k |
92 |
"movq 4(%%"XDX"), %%mm0\n\t" // value k |
93 |
"movq -4(%%"XBX", %%"XCX"), %%mm1\n\t" // value m |
93 |
"movq -4(%%"XDX", %%"XCX"), %%mm1\n\t" // value m |
94 |
"movq %%mm0, %%mm2\n\t" |
94 |
"movq %%mm0, %%mm2\n\t" |
95 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask)) // avg(k,m) |
95 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask) // avg(k,m) |
96 |
"movq %%mm0, %%mm3\n\t" |
96 |
"movq %%mm0, %%mm3\n\t" |
97 |
"psubusb %%mm1, %%mm0\n\t" |
97 |
"psubusb %%mm1, %%mm0\n\t" |
98 |
"psubusb %%mm3, %%mm1\n\t" |
98 |
"psubusb %%mm3, %%mm1\n\t" |
99 |
"por %%mm1, %%mm0\n\t" // abs(k,m) |
99 |
"por %%mm1, %%mm0\n\t" // abs(k,m) |
100 |
|
100 |
|
101 |
"movq %%mm0, %%mm1\n\t" |
101 |
"movq %%mm0, %%mm1\n\t" |
102 |
"psubusb "MANGLE(DiffThres)", %%mm1\n\t" // nonzero where abs(k,m) > Thres else 0 |
102 |
"psubusb "_DiffThres", %%mm1\n\t" // nonzero where abs(k,m) > Thres else 0 |
103 |
"pxor %%mm3, %%mm3\n\t" |
103 |
"pxor %%mm3, %%mm3\n\t" |
104 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(k,m) < Thres, else 00 |
104 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(k,m) < Thres, else 00 |
105 |
|
105 |
|
Lines 120-149
Link Here
|
120 |
|
120 |
|
121 |
|
121 |
|
122 |
// c & d |
122 |
// c & d |
123 |
"movq (%%"XBX"), %%mm0\n\t" // value b from top left |
123 |
"movq (%%"XDX"), %%mm0\n\t" // value b from top left |
124 |
"movq 2(%%"XBX", %%"XCX"), %%mm1\n\t" // value f from bottom right |
124 |
"movq 2(%%"XDX", %%"XCX"), %%mm1\n\t" // value f from bottom right |
125 |
|
125 |
|
126 |
"movq %%mm0, %%mm3\n\t" |
126 |
"movq %%mm0, %%mm3\n\t" |
127 |
"psubusb %%mm1, %%mm3\n\t" |
127 |
"psubusb %%mm1, %%mm3\n\t" |
128 |
"psubusb %%mm0, %%mm1\n\t" |
128 |
"psubusb %%mm0, %%mm1\n\t" |
129 |
"por %%mm1, %%mm3\n\t" // abs(b,f) |
129 |
"por %%mm1, %%mm3\n\t" // abs(b,f) |
130 |
|
130 |
|
131 |
"psubusb "MANGLE(DiffThres)", %%mm3\n\t" // nonzero where abs(b,f) > Thres else 0 |
131 |
"psubusb "_DiffThres", %%mm3\n\t" // nonzero where abs(b,f) > Thres else 0 |
132 |
"pxor %%mm4, %%mm4\n\t" |
132 |
"pxor %%mm4, %%mm4\n\t" |
133 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(b,f) < Thres, else 00 |
133 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(b,f) < Thres, else 00 |
134 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(b,f) > Thres, else 00 |
134 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(b,f) > Thres, else 00 |
135 |
|
135 |
|
136 |
"movq 2(%%"XBX"), %%mm0\n\t" // value c |
136 |
"movq 2(%%"XDX"), %%mm0\n\t" // value c |
137 |
"movq -2(%%"XBX", %%"XCX"), %%mm1\n\t" // value d |
137 |
"movq -2(%%"XDX", %%"XCX"), %%mm1\n\t" // value d |
138 |
"movq %%mm0, %%mm2\n\t" |
138 |
"movq %%mm0, %%mm2\n\t" |
139 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask)) // avg(c,d) |
139 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask) // avg(c,d) |
140 |
"movq %%mm0, %%mm3\n\t" |
140 |
"movq %%mm0, %%mm3\n\t" |
141 |
"psubusb %%mm1, %%mm0\n\t" |
141 |
"psubusb %%mm1, %%mm0\n\t" |
142 |
"psubusb %%mm3, %%mm1\n\t" |
142 |
"psubusb %%mm3, %%mm1\n\t" |
143 |
"por %%mm1, %%mm0\n\t" // abs(c,d) |
143 |
"por %%mm1, %%mm0\n\t" // abs(c,d) |
144 |
|
144 |
|
145 |
"movq %%mm0, %%mm1\n\t" |
145 |
"movq %%mm0, %%mm1\n\t" |
146 |
"psubusb "MANGLE(DiffThres)", %%mm1\n\t" // nonzero where abs(c,d) > Thres else 0 |
146 |
"psubusb "_DiffThres", %%mm1\n\t" // nonzero where abs(c,d) > Thres else 0 |
147 |
"pxor %%mm3, %%mm3\n\t" |
147 |
"pxor %%mm3, %%mm3\n\t" |
148 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(c,d) < Thres, else 00 |
148 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(c,d) < Thres, else 00 |
149 |
|
149 |
|
Lines 163-192
Link Here
|
163 |
"por %%mm0, %%mm7\n\t" |
163 |
"por %%mm0, %%mm7\n\t" |
164 |
|
164 |
|
165 |
// a & f |
165 |
// a & f |
166 |
"movq (%%"XBX"), %%mm0\n\t" // value b from top left |
166 |
"movq (%%"XDX"), %%mm0\n\t" // value b from top left |
167 |
"movq -2(%%"XBX", %%"XCX"), %%mm1\n\t" // value d from bottom right |
167 |
"movq -2(%%"XDX", %%"XCX"), %%mm1\n\t" // value d from bottom right |
168 |
|
168 |
|
169 |
"movq %%mm0, %%mm3\n\t" |
169 |
"movq %%mm0, %%mm3\n\t" |
170 |
"psubusb %%mm1, %%mm3\n\t" |
170 |
"psubusb %%mm1, %%mm3\n\t" |
171 |
"psubusb %%mm0, %%mm1\n\t" |
171 |
"psubusb %%mm0, %%mm1\n\t" |
172 |
"por %%mm1, %%mm3\n\t" // abs(b,d) |
172 |
"por %%mm1, %%mm3\n\t" // abs(b,d) |
173 |
|
173 |
|
174 |
"psubusb "MANGLE(DiffThres)", %%mm3\n\t" // nonzero where abs(b,d) > Thres else 0 |
174 |
"psubusb "_DiffThres", %%mm3\n\t" // nonzero where abs(b,d) > Thres else 0 |
175 |
"pxor %%mm4, %%mm4\n\t" |
175 |
"pxor %%mm4, %%mm4\n\t" |
176 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(b,d) < Thres, else 00 |
176 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where abs(b,d) < Thres, else 00 |
177 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(b,d) > Thres, else 00 |
177 |
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where abs(b,d) > Thres, else 00 |
178 |
|
178 |
|
179 |
"movq -2(%%"XBX"), %%mm0\n\t" // value a |
179 |
"movq -2(%%"XDX"), %%mm0\n\t" // value a |
180 |
"movq 2(%%"XBX", %%"XCX"), %%mm1\n\t" // value f |
180 |
"movq 2(%%"XDX", %%"XCX"), %%mm1\n\t" // value f |
181 |
"movq %%mm0, %%mm2\n\t" |
181 |
"movq %%mm0, %%mm2\n\t" |
182 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask)) // avg(a,f) |
182 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask) // avg(a,f) |
183 |
"movq %%mm0, %%mm3\n\t" |
183 |
"movq %%mm0, %%mm3\n\t" |
184 |
"psubusb %%mm1, %%mm0\n\t" |
184 |
"psubusb %%mm1, %%mm0\n\t" |
185 |
"psubusb %%mm3, %%mm1\n\t" |
185 |
"psubusb %%mm3, %%mm1\n\t" |
186 |
"por %%mm1, %%mm0\n\t" // abs(a,f) |
186 |
"por %%mm1, %%mm0\n\t" // abs(a,f) |
187 |
|
187 |
|
188 |
"movq %%mm0, %%mm1\n\t" |
188 |
"movq %%mm0, %%mm1\n\t" |
189 |
"psubusb "MANGLE(DiffThres)", %%mm1\n\t" // nonzero where abs(a,f) > Thres else 0 |
189 |
"psubusb "_DiffThres", %%mm1\n\t" // nonzero where abs(a,f) > Thres else 0 |
190 |
"pxor %%mm3, %%mm3\n\t" |
190 |
"pxor %%mm3, %%mm3\n\t" |
191 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(a,f) < Thres, else 00 |
191 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(a,f) < Thres, else 00 |
192 |
|
192 |
|
Lines 205-226
Link Here
|
205 |
"por %%mm2, %%mm6\n\t" |
205 |
"por %%mm2, %%mm6\n\t" |
206 |
"por %%mm0, %%mm7\n\t" |
206 |
"por %%mm0, %%mm7\n\t" |
207 |
|
207 |
|
208 |
"pand "MANGLE(YMask)", %%mm5\n\t" // mask out chroma from here |
208 |
"pand "_YMask", %%mm5\n\t" // mask out chroma from here |
209 |
"pand "MANGLE(YMask)", %%mm6\n\t" // mask out chroma from here |
209 |
"pand "_YMask", %%mm6\n\t" // mask out chroma from here |
210 |
"pand "MANGLE(YMask)", %%mm7\n\t" // mask out chroma from here |
210 |
"pand "_YMask", %%mm7\n\t" // mask out chroma from here |
211 |
|
211 |
|
212 |
// b,e |
212 |
// b,e |
213 |
"movq (%%"XBX"), %%mm0\n\t" // value b from top |
213 |
"movq (%%"XDX"), %%mm0\n\t" // value b from top |
214 |
"movq (%%"XBX", %%"XCX"), %%mm1\n\t" // value e from bottom |
214 |
"movq (%%"XDX", %%"XCX"), %%mm1\n\t" // value e from bottom |
215 |
"movq %%mm0, %%mm2\n\t" |
215 |
"movq %%mm0, %%mm2\n\t" |
216 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask)) // avg(b,e) |
216 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask) // avg(b,e) |
217 |
"movq %%mm0, %%mm3\n\t" |
217 |
"movq %%mm0, %%mm3\n\t" |
218 |
"psubusb %%mm1, %%mm0\n\t" |
218 |
"psubusb %%mm1, %%mm0\n\t" |
219 |
"psubusb %%mm3, %%mm1\n\t" |
219 |
"psubusb %%mm3, %%mm1\n\t" |
220 |
"por %%mm1, %%mm0\n\t" // abs(b,e) |
220 |
"por %%mm1, %%mm0\n\t" // abs(b,e) |
221 |
|
221 |
|
222 |
"movq %%mm0, %%mm1\n\t" |
222 |
"movq %%mm0, %%mm1\n\t" |
223 |
"psubusb "MANGLE(DiffThres)", %%mm1\n\t" // nonzero where abs(b,e) > Thres else 0 |
223 |
"psubusb "_DiffThres", %%mm1\n\t" // nonzero where abs(b,e) > Thres else 0 |
224 |
"pxor %%mm3, %%mm3\n\t" |
224 |
"pxor %%mm3, %%mm3\n\t" |
225 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(b,e) < Thres, else 00 |
225 |
"pcmpeqb %%mm3, %%mm1\n\t" // now ff where abs(b,e) < Thres, else 00 |
226 |
|
226 |
|
Lines 238-245
Link Here
|
238 |
"por %%mm0, %%mm7\n\t" |
238 |
"por %%mm0, %%mm7\n\t" |
239 |
|
239 |
|
240 |
// bob in any leftovers |
240 |
// bob in any leftovers |
241 |
"movq (%%"XBX"), %%mm0\n\t" // value b from top |
241 |
"movq (%%"XDX"), %%mm0\n\t" // value b from top |
242 |
"movq (%%"XBX", %%"XCX"), %%mm1\n\t" // value e from bottom |
242 |
"movq (%%"XDX", %%"XCX"), %%mm1\n\t" // value e from bottom |
243 |
|
243 |
|
244 |
|
244 |
|
245 |
// We will also calc here the max/min values to later limit comb |
245 |
// We will also calc here the max/min values to later limit comb |
Lines 271-277
Link Here
|
271 |
"por %%mm2, %%mm3\n\t" // abs diff |
271 |
"por %%mm2, %%mm3\n\t" // abs diff |
272 |
// pmaxub %%mm3, %%mm4 // top or bottom pixel moved most |
272 |
// pmaxub %%mm3, %%mm4 // top or bottom pixel moved most |
273 |
V_PMAXUB ("%%mm3", "%%mm4") // top or bottom pixel moved most |
273 |
V_PMAXUB ("%%mm3", "%%mm4") // top or bottom pixel moved most |
274 |
"psubusb "MANGLE(DiffThres)", %%mm3\n\t" // moved more than allowed? or goes to 0? |
274 |
"psubusb "_DiffThres", %%mm3\n\t" // moved more than allowed? or goes to 0? |
275 |
"pxor %%mm4, %%mm4\n\t" |
275 |
"pxor %%mm4, %%mm4\n\t" |
276 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where low motion, else high motion |
276 |
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where low motion, else high motion |
277 |
|
277 |
|
Lines 283-301
Link Here
|
283 |
V_PMAXUB ("%%mm6", "%%mm2") |
283 |
V_PMAXUB ("%%mm6", "%%mm2") |
284 |
|
284 |
|
285 |
"psubusb %%mm3, %%mm2\n\t" // maybe decrease it to 0000.. if no surround motion |
285 |
"psubusb %%mm3, %%mm2\n\t" // maybe decrease it to 0000.. if no surround motion |
286 |
// "movq %%mm2, "MANGLE(Min_Vals)"\n\t" |
286 |
// "movq %%mm2, "_Min_Vals"\n\t" |
287 |
|
287 |
|
288 |
"movq %%mm0, %%mm2\n\t" |
288 |
"movq %%mm0, %%mm2\n\t" |
289 |
V_PMAXUB ("%%mm2", "%%mm1") |
289 |
V_PMAXUB ("%%mm2", "%%mm1") |
290 |
// pminub %%mm6, %%mm2 // clip our current results so far to be below this |
290 |
// pminub %%mm6, %%mm2 // clip our current results so far to be below this |
291 |
V_PMINUB ("%%mm6", "%%mm2", "%%mm4") |
291 |
V_PMINUB ("%%mm6", "%%mm2", "%%mm4") |
292 |
"paddusb %%mm3, %%mm2\n\t" // maybe increase it to ffffff if no surround motion |
292 |
"paddusb %%mm3, %%mm2\n\t" // maybe increase it to ffffff if no surround motion |
293 |
// "movq %%mm2, "MANGLE(Max_Vals)"\n\t" |
293 |
// "movq %%mm2, "_Max_Vals"\n\t" |
294 |
#endif |
294 |
#endif |
295 |
|
295 |
|
296 |
"movq %%mm0, %%mm2\n\t" |
296 |
"movq %%mm0, %%mm2\n\t" |
297 |
// pavgb %%mm2, %%mm1 // avg(b,e) |
297 |
// pavgb %%mm2, %%mm1 // avg(b,e) |
298 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", MANGLE(ShiftMask)) // avg(b,e) |
298 |
V_PAVGB ("%%mm2", "%%mm1", "%%mm3", _ShiftMask) // avg(b,e) |
299 |
|
299 |
|
300 |
"movq %%mm0, %%mm3\n\t" |
300 |
"movq %%mm0, %%mm3\n\t" |
301 |
"psubusb %%mm1, %%mm3\n\t" |
301 |
"psubusb %%mm1, %%mm3\n\t" |