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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1, Fri Mar 8 02:45:01 2002 UTC revision 1.9.2.1, Tue Oct 28 22:23:03 2003 UTC
# Line 1  Line 1 
1  ;/**************************************************************************  ;/****************************************************************************
2  ; *  ; *
3  ; *     XVID MPEG-4 VIDEO CODEC  ; *     XVID MPEG-4 VIDEO CODEC
4  ; *     mmx 8bit<->16bit transfers  ; *  - 8<->16 bit transfer functions -
5  ; *  ; *
6  ; *     This program is an implementation of a part of one or more MPEG-4  ; *  Copyright (C) 2001 Peter Ross <pross@xvid.org>
7  ; *     Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  ; *                2001 Michael Militzer <isibaar@xvid.org>
8  ; *     to use this software module in hardware or software products are  ; *                2002 Pascal Massimino <skal@planet-d.net>
 ; *     advised that its use may infringe existing patents or copyrights, and  
 ; *     any such use would be at such party's own risk.  The original  
 ; *     developer of this software module and his/her company, and subsequent  
 ; *     editors and their companies, will have no liability for use of this  
 ; *     software or modifications or derivatives thereof.  
9  ; *  ; *
10  ; *     This program is free software; you can redistribute it and/or modify  ; *     This program is free software; you can redistribute it and/or modify
11  ; *     it under the terms of the GNU General Public License as published by  ; *     it under the terms of the GNU General Public License as published by
# Line 24  Line 19 
19  ; *  ; *
20  ; *     You should have received a copy of the GNU General Public License  ; *     You should have received a copy of the GNU General Public License
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., 675 Mass Ave, Cambridge, MA 02139, USA.  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23  ; *  ; *
24  ; *************************************************************************/  ; * $Id$
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
 ; *  
 ; * 07.01.2002  merge functions from compensate_mmx; rename functions  
 ; *     07.11.2001      initial version; (c)2001 peter ross <pross@cs.rmit.edu.au>  
25  ; *  ; *
26  ; *************************************************************************/  ; ***************************************************************************/
27    
28    BITS 32
 bits 32  
29    
30  %macro cglobal 1  %macro cglobal 1
31          %ifdef PREFIX          %ifdef PREFIX
# Line 49  Line 36 
36          %endif          %endif
37  %endmacro  %endmacro
38    
39    ;=============================================================================
40    ; Code
41    ;=============================================================================
42    
43  section .text  SECTION .text
44    
45    cglobal transfer_8to16copy_mmx
46    cglobal transfer_16to8copy_mmx
47    cglobal transfer_8to16sub_mmx
48    cglobal transfer_8to16subro_mmx
49    cglobal transfer_8to16sub2_mmx
50    cglobal transfer_8to16sub2_xmm
51    cglobal transfer_16to8add_mmx
52    cglobal transfer8x8_copy_mmx
53    
54  ;===========================================================================  ;-----------------------------------------------------------------------------
55  ;  ;
56  ; void transfer_8to16copy_mmx(int16_t * const dst,  ; void transfer_8to16copy_mmx(int16_t * const dst,
57  ;                                                       const uint8_t * const src,  ;                                                       const uint8_t * const src,
58  ;                                                       uint32_t stride);  ;                                                       uint32_t stride);
59  ;  ;
60  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer_8to16copy_mmx  
 transfer_8to16copy_mmx  
61    
62                  push    esi  %macro COPY_8_TO_16 1
63                  push    edi    movq mm0, [eax]
64      movq mm1, [eax+edx]
65                  mov     edi, [esp + 8 + 4]              ; dst    movq mm2, mm0
66                  mov     esi, [esp + 8 + 8]              ; src    movq mm3, mm1
67                  mov ecx, [esp + 8 + 12]         ; stride    punpcklbw mm0, mm7
68      movq [ecx+%1*32], mm0
69                  pxor mm7, mm7                           ; mm7 = zero    punpcklbw mm1, mm7
70      movq [ecx+%1*32+16], mm1
71                  mov eax, 8    punpckhbw mm2, mm7
72      punpckhbw mm3, mm7
73  .loop    lea eax, [eax+2*edx]
74                  movq mm0, [esi]    movq [ecx+%1*32+8], mm2
75                  movq mm1, mm0    movq [ecx+%1*32+24], mm3
76                  punpcklbw mm0, mm7              ; mm01 = unpack([src])  %endmacro
                 punpckhbw mm1, mm7  
   
                 movq [edi], mm0                 ; [dst] = mm01  
                 movq [edi + 8], mm1  
77    
78                  add edi, 16  ALIGN 16
79                  add esi, ecx  transfer_8to16copy_mmx:
                 dec eax  
                 jnz .loop  
80    
81                  pop edi    mov ecx, [esp+ 4] ; Dst
82                  pop esi    mov eax, [esp+ 8] ; Src
83      mov edx, [esp+12] ; Stride
84      pxor mm7, mm7
85    
86      COPY_8_TO_16 0
87      COPY_8_TO_16 1
88      COPY_8_TO_16 2
89      COPY_8_TO_16 3
90                  ret                  ret
91    
92    ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
93  ;  ;
94  ; void transfer_16to8copy_mmx(uint8_t * const dst,  ; void transfer_16to8copy_mmx(uint8_t * const dst,
95  ;                                                       const int16_t * const src,  ;                                                       const int16_t * const src,
96  ;                                                       uint32_t stride);  ;                                                       uint32_t stride);
97  ;  ;
98  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer_16to8copy_mmx  
 transfer_16to8copy_mmx  
   
                 push    esi  
                 push    edi  
   
                 mov     edi, [esp + 8 + 4]              ; dst  
                 mov     esi, [esp + 8 + 8]              ; src  
                 mov ecx, [esp + 8 + 12]         ; stride  
   
                 mov eax, 8  
   
 .loop  
                 movq mm0, [esi]  
                 packuswb mm0, [esi + 8]         ; mm0 = pack([src])  
99    
100                  movq [edi], mm0                         ; [dst] = mm0  %macro COPY_16_TO_8 1
101      movq mm0, [eax+%1*32]
102                  add esi, 16    movq mm1, [eax+%1*32+8]
103                  add edi, ecx    packuswb mm0, mm1
104                  dec eax    movq [ecx], mm0
105                  jnz .loop    movq mm2, [eax+%1*32+16]
106      movq mm3, [eax+%1*32+24]
107      packuswb mm2, mm3
108      movq [ecx+edx], mm2
109    %endmacro
110    
111                  pop edi  ALIGN 16
112                  pop esi  transfer_16to8copy_mmx:
113    
114      mov ecx, [esp+ 4] ; Dst
115      mov eax, [esp+ 8] ; Src
116      mov edx, [esp+12] ; Stride
117    
118      COPY_16_TO_8 0
119      lea ecx,[ecx+2*edx]
120      COPY_16_TO_8 1
121      lea ecx,[ecx+2*edx]
122      COPY_16_TO_8 2
123      lea ecx,[ecx+2*edx]
124      COPY_16_TO_8 3
125                  ret                  ret
126    
127    ;-----------------------------------------------------------------------------
 ;===========================================================================  
128  ;  ;
129  ; void transfer_8to16sub_mmx(int16_t * const dct,  ; void transfer_8to16sub_mmx(int16_t * const dct,
130  ;                               uint8_t * const cur,  ;                               uint8_t * const cur,
131  ;                               const uint8_t * const ref,  ;                               const uint8_t * const ref,
132  ;                               const uint32_t stride);  ;                               const uint32_t stride);
133  ;  ;
134  ;===========================================================================  ;-----------------------------------------------------------------------------
 ;/**************************************************************************  
 ; *  
 ; *     History:  
 ; *  
 ; * 27.12.2001  renamed from 'compensate' to 'transfer_8to16sub'  
 ; * 02.12.2001  loop unrolled, code runs 10% faster now (Isibaar)  
 ; * 30.11.2001  16 pixels are processed per iteration (Isibaar)  
 ; * 30.11.2001  .text missing  
 ; *     06.11.2001      inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>  
 ; *  
 ; *************************************************************************/  
135    
136  align 16  ; when second argument == 1, reference (ebx) block is to current (eax)
137  cglobal transfer_8to16sub_mmx  %macro COPY_8_TO_16_SUB 2
138  transfer_8to16sub_mmx    movq mm0, [eax]      ; cur
139                  push    esi    movq mm2, [eax+edx]
                 push    edi  
                 push    ebx  
   
                 mov     edi, [esp + 12 + 4]             ; dct [out]  
                 mov     edx, [esp + 12 + 8]             ; cur [in/out]  
                 mov     esi, [esp + 12 + 12]            ; ref [in]  
                 mov ecx, [esp + 12 + 16]                ; stride [in]  
   
                 mov eax, edx                            ; cur -> eax  
                 mov ebx, esi                            ; ref -> ebx  
                 add eax, ecx                            ; cur + stride  
                 add ebx, ecx                            ; ref + stride  
   
                 shl ecx, 1  
   
                 pxor mm7, mm7                   ; mm7 = zero  
   
                 movq mm0, [edx]                 ; mm01 = [cur]  
140                  movq mm1, mm0                  movq mm1, mm0
   
                 punpcklbw mm0, mm7  
                 punpckhbw mm1, mm7  
   
                 movq mm4, [eax]  
                 movq mm5, mm4  
   
                 punpcklbw mm4, mm7  
                 punpckhbw mm5, mm7  
   
                 movq mm2, [esi]                 ; mm23 = [ref]  
141                  movq mm3, mm2                  movq mm3, mm2
142    
143                  movq mm6, [ebx]    punpcklbw mm0, mm7
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
144                  punpcklbw mm2, mm7                  punpcklbw mm2, mm7
145      movq mm4, [ebx]      ; ref
146      punpckhbw mm1, mm7
147                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
148      movq mm5, [ebx+edx]  ; ref
149    
150                  psubsw mm0, mm2                 ; mm01 -= mm23    movq mm6, mm4
151    %if %2 == 1
152                  movq mm2, mm6    movq [eax], mm4
153      movq [eax+edx], mm5
154                  punpcklbw mm2, mm7  %endif
155      punpcklbw mm4, mm7
156                  punpckhbw mm6, mm7                  punpckhbw mm6, mm7
157      psubsw mm0, mm4
158      psubsw mm1, mm6
159      movq mm6, mm5
160      punpcklbw mm5, mm7
161      punpckhbw mm6, mm7
162      psubsw mm2, mm5
163      lea eax, [eax+2*edx]
164      psubsw mm3, mm6
165      lea ebx,[ebx+2*edx]
166    
167      movq [ecx+%1*32+ 0], mm0 ; dst
168      movq [ecx+%1*32+ 8], mm1
169      movq [ecx+%1*32+16], mm2
170      movq [ecx+%1*32+24], mm3
171    %endmacro
172    
173                  psubsw mm1, mm3  ALIGN 16
174    transfer_8to16sub_mmx:
175                  psubsw mm4, mm2    mov ecx, [esp  + 4] ; Dst
176                  psubsw mm5, mm6    mov eax, [esp  + 8] ; Cur
177      push ebx
178      mov ebx, [esp+4+12] ; Ref
179      mov edx, [esp+4+16] ; Stride
180      pxor mm7, mm7
181    
182                  movq [edi], mm0                 ; dct[] = mm01    COPY_8_TO_16_SUB 0, 1
183                  movq [edi + 8], mm1    COPY_8_TO_16_SUB 1, 1
184                  movq [edi + 16], mm4    COPY_8_TO_16_SUB 2, 1
185                  movq [edi + 24], mm5    COPY_8_TO_16_SUB 3, 1
   
                 add edx, ecx  
                 add esi, ecx  
                 add eax, ecx  
                 add ebx, ecx  
186    
187                  movq mm0, [edx]                 ; mm01 = [cur]    pop ebx
188                  movq mm1, mm0    ret
   
                 punpcklbw mm0, mm7  
                 punpckhbw mm1, mm7  
189    
                 movq mm4, [eax]  
                 movq mm5, mm4  
190    
191                  punpcklbw mm4, mm7  ALIGN 16
192                  punpckhbw mm5, mm7  transfer_8to16subro_mmx:
193      mov ecx, [esp  + 4] ; Dst
194      mov eax, [esp  + 8] ; Cur
195      push ebx
196      mov ebx, [esp+4+12] ; Ref
197      mov edx, [esp+4+16] ; Stride
198      pxor mm7, mm7
199    
200                  movq mm2, [esi]                 ; mm23 = [ref]    COPY_8_TO_16_SUB 0, 0
201                  movq mm3, mm2    COPY_8_TO_16_SUB 1, 0
202      COPY_8_TO_16_SUB 2, 0
203      COPY_8_TO_16_SUB 3, 0
204    
205                  movq mm6, [ebx]    pop ebx
206      ret
207    
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
208    
209                  punpcklbw mm2, mm7  ;-----------------------------------------------------------------------------
210    ;
211    ; void transfer_8to16sub2_mmx(int16_t * const dct,
212    ;                               uint8_t * const cur,
213    ;                               const uint8_t * ref1,
214    ;                               const uint8_t * ref2,
215    ;                               const uint32_t stride)
216    ;
217    ;-----------------------------------------------------------------------------
218    
219    %macro COPY_8_TO_16_SUB2_MMX 1
220      movq mm0, [eax]      ; cur
221      movq mm2, [eax+edx]
222    
223      ; mm4 <- (ref1+ref2+1) / 2
224      movq mm4, [ebx]      ; ref1
225      movq mm1, [esi]      ; ref2
226      movq mm6, mm4
227      movq mm3, mm1
228      punpcklbw mm4, mm7
229      punpcklbw mm1, mm7
230      punpckhbw mm6, mm7
231                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
232      paddusw mm4, mm1
233                  psubsw mm0, mm2                 ; mm01 -= mm23    paddusw mm6, mm3
234      psrlw mm4, 1
235                  movq mm2, mm6    psrlw mm6, 1
236      packuswb mm4, mm6
237                  punpcklbw mm2, mm7  
238        ; mm5 <- (ref1+ref2+1) / 2
239      movq mm5, [ebx+edx]  ; ref1
240      movq mm1, [esi+edx]  ; ref2
241      movq mm6, mm5
242      movq mm3, mm1
243      punpcklbw mm5, mm7
244      punpcklbw mm1, mm7
245                  punpckhbw mm6, mm7                  punpckhbw mm6, mm7
246      punpckhbw mm3, mm7
247      paddusw mm5, mm1
248      paddusw mm6, mm3
249      lea esi, [esi+2*edx]
250      psrlw mm5, 1
251      psrlw mm6, 1
252      packuswb mm5, mm6
253    
                 psubsw mm1, mm3  
   
                 psubsw mm4, mm2  
                 psubsw mm5, mm6  
   
                 movq [edi + 32], mm0                    ; dct[] = mm01  
                 movq [edi + 40], mm1  
                 movq [edi + 48], mm4  
                 movq [edi + 56], mm5  
   
                 add edx, ecx  
                 add esi, ecx  
                 add eax, ecx  
                 add ebx, ecx  
254    
                 movq mm0, [edx]                 ; mm01 = [cur]  
255                  movq mm1, mm0                  movq mm1, mm0
   
                 punpcklbw mm0, mm7  
                 punpckhbw mm1, mm7  
   
                 movq mm4, [eax]  
                 movq mm5, mm4  
   
                 punpcklbw mm4, mm7  
                 punpckhbw mm5, mm7  
   
                 movq mm2, [esi]                 ; mm23 = [ref]  
256                  movq mm3, mm2                  movq mm3, mm2
257      punpcklbw mm0, mm7
                 movq mm6, [ebx]  
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
258                  punpcklbw mm2, mm7                  punpcklbw mm2, mm7
259      punpckhbw mm1, mm7
260                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
261    
262                  psubsw mm0, mm2                 ; mm01 -= mm23    movq mm6, mm4
263      punpcklbw mm4, mm7
264                  movq mm2, mm6    punpckhbw mm6, mm7
265      psubsw mm0, mm4
266                  punpcklbw mm2, mm7    psubsw mm1, mm6
267      movq mm6, mm5
268      punpcklbw mm5, mm7
269                  punpckhbw mm6, mm7                  punpckhbw mm6, mm7
270      psubsw mm2, mm5
271      lea eax, [eax+2*edx]
272      psubsw mm3, mm6
273      lea ebx, [ebx+2*edx]
274    
275      movq [ecx+%1*32+ 0], mm0 ; dst
276      movq [ecx+%1*32+ 8], mm1
277      movq [ecx+%1*32+16], mm2
278      movq [ecx+%1*32+24], mm3
279    %endmacro
280    
281                  psubsw mm1, mm3  ALIGN 16
282    transfer_8to16sub2_mmx:
283      mov ecx, [esp  + 4] ; Dst
284      mov eax, [esp  + 8] ; Cur
285      push ebx
286      mov ebx, [esp+4+12] ; Ref1
287      push esi
288      mov esi, [esp+8+16] ; Ref2
289      mov edx, [esp+8+20] ; Stride
290      pxor mm7, mm7
291    
292                  psubsw mm4, mm2    COPY_8_TO_16_SUB2_MMX 0
293                  psubsw mm5, mm6    COPY_8_TO_16_SUB2_MMX 1
294      COPY_8_TO_16_SUB2_MMX 2
295      COPY_8_TO_16_SUB2_MMX 3
296    
297                  movq [edi + 64], mm0                    ; dct[] = mm01    pop esi
298                  movq [edi + 72], mm1    pop ebx
299                  movq [edi + 80], mm4    ret
                 movq [edi + 88], mm5  
   
                 add edx, ecx  
                 add esi, ecx  
                 add eax, ecx  
                 add ebx, ecx  
300    
301                  movq mm0, [edx]                 ; mm01 = [cur]  ;-----------------------------------------------------------------------------
302    ;
303    ; void transfer_8to16sub2_xmm(int16_t * const dct,
304    ;                               uint8_t * const cur,
305    ;                               const uint8_t * ref1,
306    ;                               const uint8_t * ref2,
307    ;                               const uint32_t stride)
308    ;
309    ;-----------------------------------------------------------------------------
310    
311    %macro COPY_8_TO_16_SUB2_SSE 1
312      movq mm0, [eax]      ; cur
313      movq mm2, [eax+edx]
314                  movq mm1, mm0                  movq mm1, mm0
   
                 punpcklbw mm0, mm7  
                 punpckhbw mm1, mm7  
   
                 movq mm4, [eax]  
                 movq mm5, mm4  
   
                 punpcklbw mm4, mm7  
                 punpckhbw mm5, mm7  
   
                 movq mm2, [esi]                 ; mm23 = [ref]  
315                  movq mm3, mm2                  movq mm3, mm2
316    
317                  movq mm6, [ebx]    punpcklbw mm0, mm7
   
                 movq [edx], mm2                 ; [cur] = [ref]  
                 movq [eax], mm6  
   
318                  punpcklbw mm2, mm7                  punpcklbw mm2, mm7
319      movq mm4, [ebx]     ; ref1
320      pavgb mm4, [esi]     ; ref2
321      punpckhbw mm1, mm7
322                  punpckhbw mm3, mm7                  punpckhbw mm3, mm7
323      movq mm5, [ebx+edx] ; ref
324      pavgb mm5, [esi+edx] ; ref2
325    
326                  psubsw mm0, mm2                 ; mm01 -= mm23    movq mm6, mm4
327      punpcklbw mm4, mm7
                 movq mm2, mm6  
   
                 punpcklbw mm2, mm7  
328                  punpckhbw mm6, mm7                  punpckhbw mm6, mm7
329      psubsw mm0, mm4
330      psubsw mm1, mm6
331      lea esi, [esi+2*edx]
332      movq mm6, mm5
333      punpcklbw mm5, mm7
334      punpckhbw mm6, mm7
335      psubsw mm2, mm5
336      lea eax, [eax+2*edx]
337      psubsw mm3, mm6
338      lea ebx, [ebx+2*edx]
339    
340      movq [ecx+%1*32+ 0], mm0 ; dst
341      movq [ecx+%1*32+ 8], mm1
342      movq [ecx+%1*32+16], mm2
343      movq [ecx+%1*32+24], mm3
344    %endmacro
345    
346                  psubsw mm1, mm3  ALIGN 16
347    transfer_8to16sub2_xmm:
348                  psubsw mm4, mm2    mov ecx, [esp  + 4] ; Dst
349                  psubsw mm5, mm6    mov eax, [esp  + 8] ; Cur
350      push ebx
351      mov ebx, [esp+4+12] ; Ref1
352      push esi
353      mov esi, [esp+8+16] ; Ref2
354      mov edx, [esp+8+20] ; Stride
355      pxor mm7, mm7
356    
357                  movq [edi + 96], mm0                    ; dct[] = mm01    COPY_8_TO_16_SUB2_SSE 0
358                  movq [edi + 104], mm1    COPY_8_TO_16_SUB2_SSE 1
359                  movq [edi + 112], mm4    COPY_8_TO_16_SUB2_SSE 2
360                  movq [edi + 120], mm5    COPY_8_TO_16_SUB2_SSE 3
361    
                 pop ebx  
                 pop edi  
362                  pop esi                  pop esi
363      pop ebx
364                  ret                  ret
365    
366    ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
367  ;  ;
368  ; void transfer_16to8add_mmx(uint8_t * const dst,  ; void transfer_16to8add_mmx(uint8_t * const dst,
369  ;                                               const int16_t * const src,  ;                                               const int16_t * const src,
370  ;                                               uint32_t stride);  ;                                               uint32_t stride);
371  ;  ;
372  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer_16to8add_mmx  
 transfer_16to8add_mmx  
   
                 push    esi  
                 push    edi  
373    
374                  mov     edi, [esp + 8 + 4]              ; dst  %macro COPY_16_TO_8_ADD 1
375                  mov     esi, [esp + 8 + 8]              ; src    movq mm0, [ecx]
376                  mov ecx, [esp + 8 + 12]         ; stride    movq mm2, [ecx+edx]
   
                 pxor mm7, mm7  
   
                 mov eax, 8  
   
 .loop  
                 movq mm0, [edi]  
377                  movq mm1, mm0                  movq mm1, mm0
378                  punpcklbw mm0, mm7              ; mm23 = unpack([dst])    movq mm3, mm2
379      punpcklbw mm0, mm7
380      punpcklbw mm2, mm7
381                  punpckhbw mm1, mm7                  punpckhbw mm1, mm7
382      punpckhbw mm3, mm7
383      paddsw mm0, [eax+%1*32+ 0]
384      paddsw mm1, [eax+%1*32+ 8]
385      paddsw mm2, [eax+%1*32+16]
386      paddsw mm3, [eax+%1*32+24]
387      packuswb mm0, mm1
388      movq [ecx], mm0
389      packuswb mm2, mm3
390      movq [ecx+edx], mm2
391    %endmacro
392    
                 movq mm2, [esi]                 ; mm01 = [src]  
                 movq mm3, [esi + 8]  
   
                 paddsw mm0, mm2                 ; mm01 += mm23  
                 paddsw mm1, mm3  
   
                 packuswb mm0, mm1               ; [dst] = pack(mm01)  
                 movq [edi], mm0  
   
                 add esi, 16  
                 add edi, ecx  
                 dec eax  
                 jnz .loop  
393    
394                  pop edi  ALIGN 16
395                  pop esi  transfer_16to8add_mmx:
396      mov ecx, [esp+ 4] ; Dst
397      mov eax, [esp+ 8] ; Src
398      mov edx, [esp+12] ; Stride
399      pxor mm7, mm7
400    
401      COPY_16_TO_8_ADD 0
402      lea ecx,[ecx+2*edx]
403      COPY_16_TO_8_ADD 1
404      lea ecx,[ecx+2*edx]
405      COPY_16_TO_8_ADD 2
406      lea ecx,[ecx+2*edx]
407      COPY_16_TO_8_ADD 3
408                  ret                  ret
409    
410    ;-----------------------------------------------------------------------------
 ;===========================================================================  
411  ;  ;
412  ; void transfer8x8_copy_mmx(uint8_t * const dst,  ; void transfer8x8_copy_mmx(uint8_t * const dst,
413  ;                                       const uint8_t * const src,  ;                                       const uint8_t * const src,
414  ;                                       const uint32_t stride);  ;                                       const uint32_t stride);
415  ;  ;
416  ;  ;
417  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 align 16  
 cglobal transfer8x8_copy_mmx  
 transfer8x8_copy_mmx  
                 push    esi  
                 push    edi  
   
                 mov     edi, [esp + 8 + 4]              ; dst [out]  
                 mov     esi, [esp + 8 + 8]              ; src [in]  
                 mov eax, [esp + 8 + 12]         ; stride [in]  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
   
                 movq mm0, [esi]  
                 movq mm1, [esi+eax]  
                 movq [edi], mm0  
                 movq [edi+eax], mm1  
   
                 add esi, eax  
                 add edi, eax  
                 add esi, eax  
                 add edi, eax  
418    
419                  pop edi  %macro COPY_8_TO_8 0
420                  pop esi    movq mm0, [eax]
421      movq mm1, [eax+edx]
422      movq [ecx], mm0
423      lea eax, [eax+2*edx]
424      movq [ecx+edx], mm1
425    %endmacro
426    
427    ALIGN 16
428    transfer8x8_copy_mmx:
429      mov ecx, [esp+ 4] ; Dst
430      mov eax, [esp+ 8] ; Src
431      mov edx, [esp+12] ; Stride
432    
433      COPY_8_TO_8
434      lea ecx,[ecx+2*edx]
435      COPY_8_TO_8
436      lea ecx,[ecx+2*edx]
437      COPY_8_TO_8
438      lea ecx,[ecx+2*edx]
439      COPY_8_TO_8
440                  ret                  ret

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.9.2.1

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