[cvs] / xvidcore / src / utils / x86_asm / mem_transfer_mmx.asm Repository:
ViewVC logotype

Annotation of /xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (view) (download)

1 : Isibaar 1.1 ;/**************************************************************************
2 :     ; *
3 :     ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * mmx 8bit<->16bit transfers
5 :     ; *
6 :     ; * This program is an implementation of a part of one or more MPEG-4
7 :     ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending
8 :     ; * to use this software module in hardware or software products are
9 :     ; * advised that its use may infringe existing patents or copyrights, and
10 :     ; * any such use would be at such party's own risk. The original
11 :     ; * developer of this software module and his/her company, and subsequent
12 :     ; * editors and their companies, will have no liability for use of this
13 :     ; * software or modifications or derivatives thereof.
14 :     ; *
15 :     ; * This program is free software; you can redistribute it and/or modify
16 :     ; * it under the terms of the GNU General Public License as published by
17 :     ; * the Free Software Foundation; either version 2 of the License, or
18 :     ; * (at your option) any later version.
19 :     ; *
20 :     ; * This program is distributed in the hope that it will be useful,
21 :     ; * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 :     ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 :     ; * GNU General Public License for more details.
24 :     ; *
25 :     ; * You should have received a copy of the GNU General Public License
26 :     ; * along with this program; if not, write to the Free Software
27 :     ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 :     ; *
29 :     ; *************************************************************************/
30 :    
31 :     ;/**************************************************************************
32 :     ; *
33 :     ; * History:
34 :     ; *
35 :     ; * 07.01.2002 merge functions from compensate_mmx; rename functions
36 :     ; * 07.11.2001 initial version; (c)2001 peter ross <pross@cs.rmit.edu.au>
37 :     ; *
38 :     ; *************************************************************************/
39 :    
40 :    
41 :     bits 32
42 :    
43 :     %macro cglobal 1
44 :     %ifdef PREFIX
45 :     global _%1
46 :     %define %1 _%1
47 :     %else
48 :     global %1
49 :     %endif
50 :     %endmacro
51 :    
52 :    
53 :     section .text
54 :    
55 :    
56 :     ;===========================================================================
57 :     ;
58 :     ; void transfer_8to16copy_mmx(int16_t * const dst,
59 :     ; const uint8_t * const src,
60 :     ; uint32_t stride);
61 :     ;
62 :     ;===========================================================================
63 :    
64 :     align 16
65 :     cglobal transfer_8to16copy_mmx
66 :     transfer_8to16copy_mmx
67 :    
68 :     push esi
69 :     push edi
70 :    
71 :     mov edi, [esp + 8 + 4] ; dst
72 :     mov esi, [esp + 8 + 8] ; src
73 :     mov ecx, [esp + 8 + 12] ; stride
74 :    
75 :     pxor mm7, mm7 ; mm7 = zero
76 :    
77 :     mov eax, 8
78 :    
79 :     .loop
80 :     movq mm0, [esi]
81 :     movq mm1, mm0
82 :     punpcklbw mm0, mm7 ; mm01 = unpack([src])
83 :     punpckhbw mm1, mm7
84 :    
85 :     movq [edi], mm0 ; [dst] = mm01
86 :     movq [edi + 8], mm1
87 :    
88 :     add edi, 16
89 :     add esi, ecx
90 :     dec eax
91 :     jnz .loop
92 :    
93 :     pop edi
94 :     pop esi
95 :    
96 :     ret
97 :    
98 :    
99 :    
100 :     ;===========================================================================
101 :     ;
102 :     ; void transfer_16to8copy_mmx(uint8_t * const dst,
103 :     ; const int16_t * const src,
104 :     ; uint32_t stride);
105 :     ;
106 :     ;===========================================================================
107 :    
108 :     align 16
109 :     cglobal transfer_16to8copy_mmx
110 :     transfer_16to8copy_mmx
111 :    
112 :     push esi
113 :     push edi
114 :    
115 :     mov edi, [esp + 8 + 4] ; dst
116 :     mov esi, [esp + 8 + 8] ; src
117 :     mov ecx, [esp + 8 + 12] ; stride
118 :    
119 :     mov eax, 8
120 :    
121 :     .loop
122 :     movq mm0, [esi]
123 :     packuswb mm0, [esi + 8] ; mm0 = pack([src])
124 :    
125 :     movq [edi], mm0 ; [dst] = mm0
126 :    
127 :     add esi, 16
128 :     add edi, ecx
129 :     dec eax
130 :     jnz .loop
131 :    
132 :     pop edi
133 :     pop esi
134 :    
135 :     ret
136 :    
137 :    
138 :     ;===========================================================================
139 :     ;
140 :     ; void transfer_8to16sub_mmx(int16_t * const dct,
141 :     ; uint8_t * const cur,
142 :     ; const uint8_t * const ref,
143 :     ; const uint32_t stride);
144 :     ;
145 :     ;===========================================================================
146 :     ;/**************************************************************************
147 :     ; *
148 :     ; * History:
149 :     ; *
150 :     ; * 27.12.2001 renamed from 'compensate' to 'transfer_8to16sub'
151 :     ; * 02.12.2001 loop unrolled, code runs 10% faster now (Isibaar)
152 :     ; * 30.11.2001 16 pixels are processed per iteration (Isibaar)
153 :     ; * 30.11.2001 .text missing
154 :     ; * 06.11.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>
155 :     ; *
156 :     ; *************************************************************************/
157 :    
158 :     align 16
159 :     cglobal transfer_8to16sub_mmx
160 :     transfer_8to16sub_mmx
161 :     push esi
162 :     push edi
163 :     push ebx
164 :    
165 :     mov edi, [esp + 12 + 4] ; dct [out]
166 :     mov edx, [esp + 12 + 8] ; cur [in/out]
167 :     mov esi, [esp + 12 + 12] ; ref [in]
168 :     mov ecx, [esp + 12 + 16] ; stride [in]
169 :    
170 :     mov eax, edx ; cur -> eax
171 :     mov ebx, esi ; ref -> ebx
172 :     add eax, ecx ; cur + stride
173 :     add ebx, ecx ; ref + stride
174 :    
175 :     shl ecx, 1
176 :    
177 :     pxor mm7, mm7 ; mm7 = zero
178 :    
179 :     movq mm0, [edx] ; mm01 = [cur]
180 :     movq mm1, mm0
181 :    
182 :     punpcklbw mm0, mm7
183 :     punpckhbw mm1, mm7
184 :    
185 :     movq mm4, [eax]
186 :     movq mm5, mm4
187 :    
188 :     punpcklbw mm4, mm7
189 :     punpckhbw mm5, mm7
190 :    
191 :     movq mm2, [esi] ; mm23 = [ref]
192 :     movq mm3, mm2
193 :    
194 :     movq mm6, [ebx]
195 :    
196 :     movq [edx], mm2 ; [cur] = [ref]
197 :     movq [eax], mm6
198 :    
199 :     punpcklbw mm2, mm7
200 :     punpckhbw mm3, mm7
201 :    
202 :     psubsw mm0, mm2 ; mm01 -= mm23
203 :    
204 :     movq mm2, mm6
205 :    
206 :     punpcklbw mm2, mm7
207 :     punpckhbw mm6, mm7
208 :    
209 :     psubsw mm1, mm3
210 :    
211 :     psubsw mm4, mm2
212 :     psubsw mm5, mm6
213 :    
214 :     movq [edi], mm0 ; dct[] = mm01
215 :     movq [edi + 8], mm1
216 :     movq [edi + 16], mm4
217 :     movq [edi + 24], mm5
218 :    
219 :     add edx, ecx
220 :     add esi, ecx
221 :     add eax, ecx
222 :     add ebx, ecx
223 :    
224 :     movq mm0, [edx] ; mm01 = [cur]
225 :     movq mm1, mm0
226 :    
227 :     punpcklbw mm0, mm7
228 :     punpckhbw mm1, mm7
229 :    
230 :     movq mm4, [eax]
231 :     movq mm5, mm4
232 :    
233 :     punpcklbw mm4, mm7
234 :     punpckhbw mm5, mm7
235 :    
236 :     movq mm2, [esi] ; mm23 = [ref]
237 :     movq mm3, mm2
238 :    
239 :     movq mm6, [ebx]
240 :    
241 :     movq [edx], mm2 ; [cur] = [ref]
242 :     movq [eax], mm6
243 :    
244 :     punpcklbw mm2, mm7
245 :     punpckhbw mm3, mm7
246 :    
247 :     psubsw mm0, mm2 ; mm01 -= mm23
248 :    
249 :     movq mm2, mm6
250 :    
251 :     punpcklbw mm2, mm7
252 :     punpckhbw mm6, mm7
253 :    
254 :     psubsw mm1, mm3
255 :    
256 :     psubsw mm4, mm2
257 :     psubsw mm5, mm6
258 :    
259 :     movq [edi + 32], mm0 ; dct[] = mm01
260 :     movq [edi + 40], mm1
261 :     movq [edi + 48], mm4
262 :     movq [edi + 56], mm5
263 :    
264 :     add edx, ecx
265 :     add esi, ecx
266 :     add eax, ecx
267 :     add ebx, ecx
268 :    
269 :     movq mm0, [edx] ; mm01 = [cur]
270 :     movq mm1, mm0
271 :    
272 :     punpcklbw mm0, mm7
273 :     punpckhbw mm1, mm7
274 :    
275 :     movq mm4, [eax]
276 :     movq mm5, mm4
277 :    
278 :     punpcklbw mm4, mm7
279 :     punpckhbw mm5, mm7
280 :    
281 :     movq mm2, [esi] ; mm23 = [ref]
282 :     movq mm3, mm2
283 :    
284 :     movq mm6, [ebx]
285 :    
286 :     movq [edx], mm2 ; [cur] = [ref]
287 :     movq [eax], mm6
288 :    
289 :     punpcklbw mm2, mm7
290 :     punpckhbw mm3, mm7
291 :    
292 :     psubsw mm0, mm2 ; mm01 -= mm23
293 :    
294 :     movq mm2, mm6
295 :    
296 :     punpcklbw mm2, mm7
297 :     punpckhbw mm6, mm7
298 :    
299 :     psubsw mm1, mm3
300 :    
301 :     psubsw mm4, mm2
302 :     psubsw mm5, mm6
303 :    
304 :     movq [edi + 64], mm0 ; dct[] = mm01
305 :     movq [edi + 72], mm1
306 :     movq [edi + 80], mm4
307 :     movq [edi + 88], mm5
308 :    
309 :     add edx, ecx
310 :     add esi, ecx
311 :     add eax, ecx
312 :     add ebx, ecx
313 :    
314 :     movq mm0, [edx] ; mm01 = [cur]
315 :     movq mm1, mm0
316 :    
317 :     punpcklbw mm0, mm7
318 :     punpckhbw mm1, mm7
319 :    
320 :     movq mm4, [eax]
321 :     movq mm5, mm4
322 :    
323 :     punpcklbw mm4, mm7
324 :     punpckhbw mm5, mm7
325 :    
326 :     movq mm2, [esi] ; mm23 = [ref]
327 :     movq mm3, mm2
328 :    
329 :     movq mm6, [ebx]
330 :    
331 :     movq [edx], mm2 ; [cur] = [ref]
332 :     movq [eax], mm6
333 :    
334 :     punpcklbw mm2, mm7
335 :     punpckhbw mm3, mm7
336 :    
337 :     psubsw mm0, mm2 ; mm01 -= mm23
338 :    
339 :     movq mm2, mm6
340 :    
341 :     punpcklbw mm2, mm7
342 :     punpckhbw mm6, mm7
343 :    
344 :     psubsw mm1, mm3
345 :    
346 :     psubsw mm4, mm2
347 :     psubsw mm5, mm6
348 :    
349 :     movq [edi + 96], mm0 ; dct[] = mm01
350 :     movq [edi + 104], mm1
351 :     movq [edi + 112], mm4
352 :     movq [edi + 120], mm5
353 :    
354 :     pop ebx
355 :     pop edi
356 :     pop esi
357 :    
358 :     ret
359 :    
360 :    
361 : edgomez 1.2 ;===========================================================================
362 :     ;
363 :     ; void transfer_8to16sub2_xmm(int16_t * const dct,
364 :     ; uint8_t * const cur,
365 :     ; const uint8_t * ref1,
366 :     ; const uint8_t * ref2,
367 :     ; const uint32_t stride);
368 :     ;
369 :     ;===========================================================================
370 :    
371 :     align 16
372 :     cglobal transfer_8to16sub2_xmm
373 :     transfer_8to16sub2_xmm
374 :    
375 :     push edi
376 :     push esi
377 :     push ebx
378 :    
379 :     mov edi, [esp + 12 + 4] ; edi = &dct
380 :     mov esi, [esp + 12 + 8] ; esi = &cur
381 :     mov ebx, [esp + 12 + 12] ; ebx = &ref1
382 :     mov edx, [esp + 12 + 16] ; edx = &ref2
383 :     mov eax, [esp + 12 + 20] ; eax = stride
384 :    
385 :     pxor mm7, mm7 ; mm7 = 0
386 :     shl eax, 1 ; eax = stride<<1
387 :    
388 :     ; Row processing
389 :     ; One row at a time
390 :     movq mm0, [esi + 0] ; mm0 = cur row
391 :     movq mm2, [ebx + 0] ; mm2 = ref1 row
392 :     movq mm3, [edx + 0] ; mm3 = ref2 row
393 :     movq mm1, mm0 ; mm1 = cur row
394 :    
395 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
396 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
397 :    
398 :     movq mm3,mm2 ; mm3 = avg
399 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
400 :    
401 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
402 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
403 :    
404 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
405 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
406 :    
407 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
408 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
409 :    
410 :     ; Increment all pointers
411 :     add edi, eax ; edi = &(next dct row)
412 :    
413 :     ; Row processing
414 :     ; One row at a time
415 :     movq mm0, [esi + 8] ; mm0 = cur row
416 :     movq mm2, [ebx + 8] ; mm2 = ref1 row
417 :     movq mm3, [edx + 8] ; mm3 = ref2 row
418 :     movq mm1, mm0 ; mm1 = cur row
419 :    
420 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
421 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
422 :    
423 :     movq mm3,mm2 ; mm3 = avg
424 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
425 :    
426 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
427 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
428 :    
429 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
430 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
431 :    
432 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
433 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
434 :    
435 :     ; Increment all pointers
436 :     add edi, eax ; edi = &(next dct row)
437 :    
438 :     ; Row processing
439 :     ; One row at a time
440 :     movq mm0, [esi + 16] ; mm0 = cur row
441 :     movq mm2, [ebx + 16] ; mm2 = ref1 row
442 :     movq mm3, [edx + 16] ; mm3 = ref2 row
443 :     movq mm1, mm0 ; mm1 = cur row
444 :    
445 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
446 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
447 :    
448 :     movq mm3,mm2 ; mm3 = avg
449 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
450 :    
451 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
452 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
453 :    
454 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
455 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
456 :    
457 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
458 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
459 :    
460 :     ; Increment all pointers
461 :     add edi, eax ; edi = &(next dct row)
462 :    
463 :     ; Row processing
464 :     ; One row at a time
465 :     movq mm0, [esi + 24] ; mm0 = cur row
466 :     movq mm2, [ebx + 24] ; mm2 = ref1 row
467 :     movq mm3, [edx + 24] ; mm3 = ref2 row
468 :     movq mm1, mm0 ; mm1 = cur row
469 :    
470 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
471 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
472 :    
473 :     movq mm3,mm2 ; mm3 = avg
474 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
475 :    
476 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
477 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
478 :    
479 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
480 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
481 :    
482 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
483 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
484 :    
485 :     ; Increment all pointers
486 :     add edi, eax ; edi = &(next dct row)
487 :    
488 :     ; Row processing
489 :     ; One row at a time
490 :     movq mm0, [esi + 32] ; mm0 = cur row
491 :     movq mm2, [ebx + 32] ; mm2 = ref1 row
492 :     movq mm3, [edx + 32] ; mm3 = ref2 row
493 :     movq mm1, mm0 ; mm1 = cur row
494 :    
495 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
496 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
497 :    
498 :     movq mm3,mm2 ; mm3 = avg
499 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
500 :    
501 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
502 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
503 :    
504 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
505 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
506 :    
507 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
508 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
509 :    
510 :     ; Increment all pointers
511 :     add edi, eax ; edi = &(next dct row)
512 :    
513 :     ; Row processing
514 :     ; One row at a time
515 :     movq mm0, [esi + 40] ; mm0 = cur row
516 :     movq mm2, [ebx + 40] ; mm2 = ref1 row
517 :     movq mm3, [edx + 40] ; mm3 = ref2 row
518 :     movq mm1, mm0 ; mm1 = cur row
519 :    
520 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
521 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
522 :    
523 :     movq mm3,mm2 ; mm3 = avg
524 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
525 :    
526 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
527 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
528 :    
529 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
530 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
531 :    
532 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
533 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
534 :    
535 :     ; Increment all pointers
536 :     add edi, eax ; edi = &(next dct row)
537 :    
538 :     ; Row processing
539 :     ; One row at a time
540 :     movq mm0, [esi + 48] ; mm0 = cur row
541 :     movq mm2, [ebx + 48] ; mm2 = ref1 row
542 :     movq mm3, [edx + 48] ; mm3 = ref2 row
543 :     movq mm1, mm0 ; mm1 = cur row
544 :    
545 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
546 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
547 :    
548 :     movq mm3,mm2 ; mm3 = avg
549 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
550 :    
551 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
552 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
553 :    
554 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
555 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
556 :    
557 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
558 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
559 :    
560 :     ; Increment all pointers
561 :     add edi, eax ; edi = &(next dct row)
562 :    
563 :     ; Row processing
564 :     ; One row at a time
565 :     movq mm0, [esi + 56] ; mm0 = cur row
566 :     movq mm2, [ebx + 56] ; mm2 = ref1 row
567 :     movq mm3, [edx + 56] ; mm3 = ref2 row
568 :     movq mm1, mm0 ; mm1 = cur row
569 :    
570 :     pavgb mm2, mm3 ; mm2 = (ref1 + ref2 + 1)/2 (== avg)
571 :     punpcklbw mm0, mm7 ; mm0 = cur(3-0) <-> 16bit
572 :    
573 :     movq mm3,mm2 ; mm3 = avg
574 :     punpckhbw mm1, mm7 ; mm1 = cur(7-4) <-> 16bit
575 :    
576 :     punpcklbw mm2, mm7 ; mm2 = avg(3-0) <-> 16bit
577 :     punpckhbw mm3, mm7 ; mm3 = avg(7-4) <-> 16bit
578 :    
579 :     psubw mm0, mm2 ; mm0 = cur(3-0) - avg(3-0)
580 :     psubw mm1, mm3 ; mm1 = cur(7-4) - avg(7-4)
581 :    
582 :     movq [edi + 0], mm0 ; dct(3-0) = mm0
583 :     movq [edi + 8], mm1 ; dct(7-4) = mm1
584 :    
585 :     ; Exit
586 :    
587 :     pop ebx
588 :     pop esi
589 :     pop edi
590 :    
591 :     ret
592 : Isibaar 1.1
593 :     ;===========================================================================
594 :     ;
595 :     ; void transfer_16to8add_mmx(uint8_t * const dst,
596 :     ; const int16_t * const src,
597 :     ; uint32_t stride);
598 :     ;
599 :     ;===========================================================================
600 :    
601 :     align 16
602 :     cglobal transfer_16to8add_mmx
603 :     transfer_16to8add_mmx
604 :    
605 :     push esi
606 :     push edi
607 :    
608 :     mov edi, [esp + 8 + 4] ; dst
609 :     mov esi, [esp + 8 + 8] ; src
610 :     mov ecx, [esp + 8 + 12] ; stride
611 :    
612 :     pxor mm7, mm7
613 :    
614 :     mov eax, 8
615 :    
616 :     .loop
617 :     movq mm0, [edi]
618 :     movq mm1, mm0
619 :     punpcklbw mm0, mm7 ; mm23 = unpack([dst])
620 :     punpckhbw mm1, mm7
621 :    
622 :     movq mm2, [esi] ; mm01 = [src]
623 :     movq mm3, [esi + 8]
624 :    
625 :     paddsw mm0, mm2 ; mm01 += mm23
626 :     paddsw mm1, mm3
627 :    
628 :     packuswb mm0, mm1 ; [dst] = pack(mm01)
629 :     movq [edi], mm0
630 :    
631 :     add esi, 16
632 :     add edi, ecx
633 :     dec eax
634 :     jnz .loop
635 :    
636 :     pop edi
637 :     pop esi
638 :    
639 :     ret
640 :    
641 :    
642 :     ;===========================================================================
643 :     ;
644 :     ; void transfer8x8_copy_mmx(uint8_t * const dst,
645 :     ; const uint8_t * const src,
646 :     ; const uint32_t stride);
647 :     ;
648 :     ;
649 :     ;===========================================================================
650 :    
651 :     align 16
652 :     cglobal transfer8x8_copy_mmx
653 :     transfer8x8_copy_mmx
654 :     push esi
655 :     push edi
656 :    
657 :     mov edi, [esp + 8 + 4] ; dst [out]
658 :     mov esi, [esp + 8 + 8] ; src [in]
659 :     mov eax, [esp + 8 + 12] ; stride [in]
660 :    
661 :     movq mm0, [esi]
662 :     movq mm1, [esi+eax]
663 :     movq [edi], mm0
664 :     movq [edi+eax], mm1
665 :    
666 :     add esi, eax
667 :     add edi, eax
668 :     add esi, eax
669 :     add edi, eax
670 :    
671 :     movq mm0, [esi]
672 :     movq mm1, [esi+eax]
673 :     movq [edi], mm0
674 :     movq [edi+eax], mm1
675 :    
676 :     add esi, eax
677 :     add edi, eax
678 :     add esi, eax
679 :     add edi, eax
680 :    
681 :     movq mm0, [esi]
682 :     movq mm1, [esi+eax]
683 :     movq [edi], mm0
684 :     movq [edi+eax], mm1
685 :    
686 :     add esi, eax
687 :     add edi, eax
688 :     add esi, eax
689 :     add edi, eax
690 :    
691 :     movq mm0, [esi]
692 :     movq mm1, [esi+eax]
693 :     movq [edi], mm0
694 :     movq [edi+eax], mm1
695 :    
696 :     add esi, eax
697 :     add edi, eax
698 :     add esi, eax
699 :     add edi, eax
700 :    
701 :     pop edi
702 :     pop esi
703 :    
704 :     ret

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4