21 |
; * along with this program ; if not, write to the Free Software |
; * along with this program ; if not, write to the Free Software |
22 |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 |
; * |
; * |
24 |
; * $Id: mem_transfer_mmx.asm,v 1.13 2004-07-24 11:46:08 edgomez Exp $ |
; * $Id: mem_transfer_mmx.asm,v 1.17 2005-09-13 12:12:15 suxen_drol Exp $ |
25 |
; * |
; * |
26 |
; ***************************************************************************/ |
; ***************************************************************************/ |
27 |
|
|
29 |
|
|
30 |
%macro cglobal 1 |
%macro cglobal 1 |
31 |
%ifdef PREFIX |
%ifdef PREFIX |
32 |
|
%ifdef MARK_FUNCS |
33 |
|
global _%1:function %1.endfunc-%1 |
34 |
|
%define %1 _%1:function %1.endfunc-%1 |
35 |
|
%else |
36 |
global _%1 |
global _%1 |
37 |
%define %1 _%1 |
%define %1 _%1 |
38 |
|
%endif |
39 |
|
%else |
40 |
|
%ifdef MARK_FUNCS |
41 |
|
global %1:function %1.endfunc-%1 |
42 |
%else |
%else |
43 |
global %1 |
global %1 |
44 |
%endif |
%endif |
45 |
|
%endif |
46 |
%endmacro |
%endmacro |
47 |
|
|
48 |
;============================================================================= |
;============================================================================= |
71 |
cglobal transfer_8to16subro_mmx |
cglobal transfer_8to16subro_mmx |
72 |
cglobal transfer_8to16sub2_mmx |
cglobal transfer_8to16sub2_mmx |
73 |
cglobal transfer_8to16sub2_xmm |
cglobal transfer_8to16sub2_xmm |
74 |
|
cglobal transfer_8to16sub2ro_xmm |
75 |
cglobal transfer_16to8add_mmx |
cglobal transfer_16to8add_mmx |
76 |
cglobal transfer8x8_copy_mmx |
cglobal transfer8x8_copy_mmx |
77 |
|
cglobal transfer8x4_copy_mmx |
78 |
|
|
79 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
80 |
; |
; |
113 |
COPY_8_TO_16 2 |
COPY_8_TO_16 2 |
114 |
COPY_8_TO_16 3 |
COPY_8_TO_16 3 |
115 |
ret |
ret |
116 |
|
.endfunc |
117 |
|
|
118 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
119 |
; |
; |
149 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
150 |
COPY_16_TO_8 3 |
COPY_16_TO_8 3 |
151 |
ret |
ret |
152 |
|
.endfunc |
153 |
|
|
154 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
155 |
; |
; |
213 |
|
|
214 |
pop ebx |
pop ebx |
215 |
ret |
ret |
216 |
|
.endfunc |
217 |
|
|
218 |
|
|
219 |
ALIGN 16 |
ALIGN 16 |
232 |
|
|
233 |
pop ebx |
pop ebx |
234 |
ret |
ret |
235 |
|
.endfunc |
236 |
|
|
237 |
|
|
238 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
331 |
pop esi |
pop esi |
332 |
pop ebx |
pop ebx |
333 |
ret |
ret |
334 |
|
.endfunc |
335 |
|
|
336 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
337 |
; |
; |
399 |
pop esi |
pop esi |
400 |
pop ebx |
pop ebx |
401 |
ret |
ret |
402 |
|
.endfunc |
403 |
|
|
404 |
|
|
405 |
|
;----------------------------------------------------------------------------- |
406 |
|
; |
407 |
|
; void transfer_8to16sub2ro_xmm(int16_t * const dct, |
408 |
|
; const uint8_t * const cur, |
409 |
|
; const uint8_t * ref1, |
410 |
|
; const uint8_t * ref2, |
411 |
|
; const uint32_t stride) |
412 |
|
; |
413 |
|
;----------------------------------------------------------------------------- |
414 |
|
|
415 |
|
%macro COPY_8_TO_16_SUB2RO_SSE 1 |
416 |
|
movq mm0, [eax] ; cur |
417 |
|
movq mm2, [eax+edx] |
418 |
|
movq mm1, mm0 |
419 |
|
movq mm3, mm2 |
420 |
|
|
421 |
|
punpcklbw mm0, mm7 |
422 |
|
punpcklbw mm2, mm7 |
423 |
|
movq mm4, [ebx] ; ref1 |
424 |
|
pavgb mm4, [esi] ; ref2 |
425 |
|
punpckhbw mm1, mm7 |
426 |
|
punpckhbw mm3, mm7 |
427 |
|
movq mm5, [ebx+edx] ; ref |
428 |
|
pavgb mm5, [esi+edx] ; ref2 |
429 |
|
|
430 |
|
movq mm6, mm4 |
431 |
|
punpcklbw mm4, mm7 |
432 |
|
punpckhbw mm6, mm7 |
433 |
|
psubsw mm0, mm4 |
434 |
|
psubsw mm1, mm6 |
435 |
|
lea esi, [esi+2*edx] |
436 |
|
movq mm6, mm5 |
437 |
|
punpcklbw mm5, mm7 |
438 |
|
punpckhbw mm6, mm7 |
439 |
|
psubsw mm2, mm5 |
440 |
|
lea eax, [eax+2*edx] |
441 |
|
psubsw mm3, mm6 |
442 |
|
lea ebx, [ebx+2*edx] |
443 |
|
|
444 |
|
movq [ecx+%1*32+ 0], mm0 ; dst |
445 |
|
movq [ecx+%1*32+ 8], mm1 |
446 |
|
movq [ecx+%1*32+16], mm2 |
447 |
|
movq [ecx+%1*32+24], mm3 |
448 |
|
%endmacro |
449 |
|
|
450 |
|
ALIGN 16 |
451 |
|
transfer_8to16sub2ro_xmm: |
452 |
|
pxor mm7, mm7 |
453 |
|
mov ecx, [esp + 4] ; Dst |
454 |
|
mov eax, [esp + 8] ; Cur |
455 |
|
push ebx |
456 |
|
mov ebx, [esp+4+12] ; Ref1 |
457 |
|
push esi |
458 |
|
mov esi, [esp+8+16] ; Ref2 |
459 |
|
mov edx, [esp+8+20] ; Stride |
460 |
|
|
461 |
|
COPY_8_TO_16_SUB2RO_SSE 0 |
462 |
|
COPY_8_TO_16_SUB2RO_SSE 1 |
463 |
|
COPY_8_TO_16_SUB2RO_SSE 2 |
464 |
|
COPY_8_TO_16_SUB2RO_SSE 3 |
465 |
|
|
466 |
|
pop esi |
467 |
|
pop ebx |
468 |
|
ret |
469 |
|
.endfunc |
470 |
|
|
471 |
|
|
472 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
473 |
; |
; |
512 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
513 |
COPY_16_TO_8_ADD 3 |
COPY_16_TO_8_ADD 3 |
514 |
ret |
ret |
515 |
|
.endfunc |
516 |
|
|
517 |
;----------------------------------------------------------------------------- |
;----------------------------------------------------------------------------- |
518 |
; |
; |
545 |
lea ecx,[ecx+2*edx] |
lea ecx,[ecx+2*edx] |
546 |
COPY_8_TO_8 |
COPY_8_TO_8 |
547 |
ret |
ret |
548 |
|
.endfunc |
549 |
|
|
550 |
|
;----------------------------------------------------------------------------- |
551 |
|
; |
552 |
|
; void transfer8x4_copy_mmx(uint8_t * const dst, |
553 |
|
; const uint8_t * const src, |
554 |
|
; const uint32_t stride); |
555 |
|
; |
556 |
|
; |
557 |
|
;----------------------------------------------------------------------------- |
558 |
|
|
559 |
|
ALIGN 16 |
560 |
|
transfer8x4_copy_mmx: |
561 |
|
mov ecx, [esp+ 4] ; Dst |
562 |
|
mov eax, [esp+ 8] ; Src |
563 |
|
mov edx, [esp+12] ; Stride |
564 |
|
|
565 |
|
COPY_8_TO_8 |
566 |
|
lea ecx,[ecx+2*edx] |
567 |
|
COPY_8_TO_8 |
568 |
|
ret |
569 |
|
.endfunc |
570 |
|
|