[svn] / branches / dev-api-4 / xvidcore / src / utils / x86_asm / mem_transfer_3dne.asm Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/utils/x86_asm/mem_transfer_3dne.asm

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

revision 1191, Mon Oct 27 01:03:43 2003 UTC revision 1192, 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) 2002 Jaan Kalda
 ; *     Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  
 ; *     to use this software module in hardware or software products are  
 ; *     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.  
7  ; *  ; *
8  ; *     This program is free software; you can redistribute it and/or modify  ; *     This program is free software; you can redistribute it and/or modify
9  ; *     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 17 
17  ; *  ; *
18  ; *     You should have received a copy of the GNU General Public License  ; *     You should have received a copy of the GNU General Public License
19  ; *     along with this program; if not, write to the Free Software  ; *     along with this program; if not, write to the Free Software
20  ; *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  ; *  ; *
22  ; *************************************************************************/  ; * $Id: mem_transfer_3dne.asm,v 1.2.2.1 2003-10-28 22:23:03 edgomez Exp $
23    ; *
24  ; these 3dne functions are compatible with iSSE, but are optimized specifically for  ; ***************************************************************************/
 ; K7 pipelines  
 ;  
 ;------------------------------------------------------------------------------  
 ; 09.12.2002  Athlon optimizations contributed by Jaan Kalda  
 ;------------------------------------------------------------------------------  
   
   
 bits 32  
 %ifdef FORMAT_COFF  
 section .data data  
 %else  
 section .data data align=16  
 %endif  
   
25    
26  align 8  ; these 3dne functions are compatible with iSSE, but are optimized specifically
27  mm_zero:  ; for K7 pipelines
 dd 0,0  
28    
29    BITS 32
30    
31  %macro cglobal 1  %macro cglobal 1
32          %ifdef PREFIX          %ifdef PREFIX
# Line 57  Line 36 
36                  global %1                  global %1
37          %endif          %endif
38  %endmacro  %endmacro
39    
40    ;=============================================================================
41    ; Read only data
42    ;=============================================================================
43    
44    SECTION .rodata
45    
46    ALIGN 8
47    mm_zero:
48            dd 0,0
49    ;=============================================================================
50    ; Macros
51    ;=============================================================================
52    
53  %macro nop4 0  %macro nop4 0
54  DB 08Dh,074h,026h,0          db 08Dh, 074h, 026h, 0
55  %endmacro  %endmacro
56    
57  section .text  ;=============================================================================
58    ; Code
59    ;=============================================================================
60    
61    SECTION .text
62    
63  cglobal transfer_8to16copy_3dne  cglobal transfer_8to16copy_3dne
64  cglobal transfer_16to8copy_3dne  cglobal transfer_16to8copy_3dne
# Line 71  Line 68 
68  cglobal transfer_16to8add_3dne  cglobal transfer_16to8add_3dne
69  cglobal transfer8x8_copy_3dne  cglobal transfer8x8_copy_3dne
70    
71  ;===========================================================================  ;-----------------------------------------------------------------------------
72  ;  ;
73  ; void transfer_8to16copy_3dne(int16_t * const dst,  ; void transfer_8to16copy_3dne(int16_t * const dst,
74  ;                                                       const uint8_t * const src,  ;                                                       const uint8_t * const src,
75  ;                                                       uint32_t stride);  ;                                                       uint32_t stride);
76  ;  ;
77  ;===========================================================================  ;-----------------------------------------------------------------------------
78    
79  align 16  ALIGN 16
80  transfer_8to16copy_3dne:  transfer_8to16copy_3dne:
81    
82    mov eax, [esp+ 8] ; Src    mov eax, [esp+ 8] ; Src
# Line 141  Line 138 
138    
139    
140    
141  ;===========================================================================  ;-----------------------------------------------------------------------------
142  ;  ;
143  ; void transfer_16to8copy_3dne(uint8_t * const dst,  ; void transfer_16to8copy_3dne(uint8_t * const dst,
144  ;                                                       const int16_t * const src,  ;                                                       const int16_t * const src,
145  ;                                                       uint32_t stride);  ;                                                       uint32_t stride);
146  ;  ;
147  ;===========================================================================  ;-----------------------------------------------------------------------------
148    
149  align 16  ALIGN 16
150  transfer_16to8copy_3dne:  transfer_16to8copy_3dne:
151    
152    mov eax, [esp+ 8] ; Src    mov eax, [esp+ 8] ; Src
# Line 185  Line 182 
182    movq [ecx+2*edx], mm6    movq [ecx+2*edx], mm6
183    ret    ret
184    
185  ;===========================================================================  ;-----------------------------------------------------------------------------
186  ;  ;
187  ; void transfer_8to16sub_3dne(int16_t * const dct,  ; void transfer_8to16sub_3dne(int16_t * const dct,
188  ;                               uint8_t * const cur,  ;                               uint8_t * const cur,
189  ;                               const uint8_t * const ref,  ;                               const uint8_t * const ref,
190  ;                               const uint32_t stride);  ;                               const uint32_t stride);
191  ;  ;
192  ;===========================================================================  ;-----------------------------------------------------------------------------
 ;/**************************************************************************  
 ; *  
 ; *     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>  
 ; *  
 ; *************************************************************************/  
193    
194  ; when second argument == 1, reference (ebx) block is to current (eax)  ; when second argument == 1, reference (ebx) block is to current (eax)
195  %macro COPY_8_TO_16_SUB 2  %macro COPY_8_TO_16_SUB 2
# Line 217  Line 203 
203    punpckhbw mm1, mm7    punpckhbw mm1, mm7
204    punpckhbw mm6, mm7    punpckhbw mm6, mm7
205    punpcklbw mm4, mm7    punpcklbw mm4, mm7
206  align 8  ALIGN 8
207    movq mm2, [byte eax+edx]    movq mm2, [byte eax+edx]
208    punpcklbw mm0, mm7    punpcklbw mm0, mm7
209    movq mm3, [byte eax+edx]    movq mm3, [byte eax+edx]
# Line 248  Line 234 
234    movq [edi+%1*32+24], mm3    movq [edi+%1*32+24], mm3
235  %endmacro  %endmacro
236    
237  align 16  ALIGN 16
238  transfer_8to16sub_3dne:  transfer_8to16sub_3dne:
239    mov eax, [esp + 8] ; Cur    mov eax, [esp + 8] ; Cur
240    mov ecx, [esp +12] ; Ref    mov ecx, [esp +12] ; Ref
# Line 257  Line 243 
243    mov edi, [esp+4+ 4] ; Dst    mov edi, [esp+4+ 4] ; Dst
244    pxor mm7, mm7    pxor mm7, mm7
245    nop    nop
246  align 4  ALIGN 4
247    COPY_8_TO_16_SUB 0, 1    COPY_8_TO_16_SUB 0, 1
248    COPY_8_TO_16_SUB 1, 1    COPY_8_TO_16_SUB 1, 1
249    COPY_8_TO_16_SUB 2, 1    COPY_8_TO_16_SUB 2, 1
# Line 265  Line 251 
251    mov edi,ecx    mov edi,ecx
252    ret    ret
253    
254  align 16  ALIGN 16
255  transfer_8to16subro_3dne:  transfer_8to16subro_3dne:
256    mov eax, [esp + 8] ; Cur    mov eax, [esp + 8] ; Cur
257    mov ecx, [esp +12] ; Ref    mov ecx, [esp +12] ; Ref
# Line 274  Line 260 
260    mov edi, [esp+4+ 4] ; Dst    mov edi, [esp+4+ 4] ; Dst
261    pxor mm7, mm7    pxor mm7, mm7
262    nop    nop
263  align 4  ALIGN 4
264    COPY_8_TO_16_SUB 0, 0    COPY_8_TO_16_SUB 0, 0
265    COPY_8_TO_16_SUB 1, 0    COPY_8_TO_16_SUB 1, 0
266    COPY_8_TO_16_SUB 2, 0    COPY_8_TO_16_SUB 2, 0
# Line 283  Line 269 
269    ret    ret
270    
271    
272  ;===========================================================================  ;-----------------------------------------------------------------------------
273  ;  ;
274  ; void transfer_8to16sub2_3dne(int16_t * const dct,  ; void transfer_8to16sub2_3dne(int16_t * const dct,
275  ;                               uint8_t * const cur,  ;                               uint8_t * const cur,
# Line 291  Line 277 
277  ;                               const uint8_t * ref2,  ;                               const uint8_t * ref2,
278  ;                               const uint32_t stride)  ;                               const uint32_t stride)
279  ;  ;
280  ;===========================================================================  ;-----------------------------------------------------------------------------
281    
282  %macro COPY_8_TO_16_SUB2_SSE 1  %macro COPY_8_TO_16_SUB2_SSE 1
283   db 0Fh, 6Fh, 44h, 20h, 00  ;movq mm0, [byte eax]      ; cur   db 0Fh, 6Fh, 44h, 20h, 00  ;movq mm0, [byte eax]      ; cur
# Line 332  Line 318 
318    movq [ecx+%1*32+24], mm3    movq [ecx+%1*32+24], mm3
319  %endmacro  %endmacro
320    
321  align 16  ALIGN 16
322  transfer_8to16sub2_3dne:  transfer_8to16sub2_3dne:
323    mov edx, [esp +20] ; Stride    mov edx, [esp +20] ; Stride
324    mov ecx, [esp  + 4] ; Dst    mov ecx, [esp  + 4] ; Dst
# Line 352  Line 338 
338    ret    ret
339    
340    
341  ;===========================================================================  ;-----------------------------------------------------------------------------
342  ;  ;
343  ; void transfer_16to8add_3dne(uint8_t * const dst,  ; void transfer_16to8add_3dne(uint8_t * const dst,
344  ;                                               const int16_t * const src,  ;                                               const int16_t * const src,
345  ;                                               uint32_t stride);  ;                                               uint32_t stride);
346  ;  ;
347  ;===========================================================================  ;-----------------------------------------------------------------------------
348    
349  %macro COPY_16_TO_8_ADD 1  %macro COPY_16_TO_8_ADD 1
350    db 0Fh, 6Fh, 44h, 21h, 00 ;movq mm0, [byte ecx]    db 0Fh, 6Fh, 44h, 21h, 00 ;movq mm0, [byte ecx]
# Line 381  Line 367 
367  %endmacro  %endmacro
368    
369    
370  align 16  ALIGN 16
371  transfer_16to8add_3dne:  transfer_16to8add_3dne:
372    mov ecx, [esp+ 4] ; Dst    mov ecx, [esp+ 4] ; Dst
373    mov edx, [esp+12] ; Stride    mov edx, [esp+12] ; Stride
# Line 398  Line 384 
384    COPY_16_TO_8_ADD 3    COPY_16_TO_8_ADD 3
385    ret    ret
386    
387  ;===========================================================================  ;-----------------------------------------------------------------------------
388  ;  ;
389  ; void transfer8x8_copy_3dne(uint8_t * const dst,  ; void transfer8x8_copy_3dne(uint8_t * const dst,
390  ;                                       const uint8_t * const src,  ;                                       const uint8_t * const src,
391  ;                                       const uint32_t stride);  ;                                       const uint32_t stride);
392  ;  ;
393  ;  ;
394  ;===========================================================================  ;-----------------------------------------------------------------------------
395    
396  %macro COPY_8_TO_8 0  %macro COPY_8_TO_8 0
397    movq mm0, [byte  eax]    movq mm0, [byte  eax]
# Line 415  Line 401 
401    movq [ecx+edx], mm1    movq [ecx+edx], mm1
402  %endmacro  %endmacro
403    
404  align 16  ALIGN 16
405  transfer8x8_copy_3dne:  transfer8x8_copy_3dne:
406    mov eax, [esp+ 8] ; Src    mov eax, [esp+ 8] ; Src
407    mov edx, [esp+12] ; Stride    mov edx, [esp+12] ; Stride

Legend:
Removed from v.1191  
changed lines
  Added in v.1192

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