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

Diff of /branches/dev-api-4/xvidcore/src/motion/x86_asm/sad_3dn.asm

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

trunk/xvidcore/src/motion/x86_asm/sad_3dn.asm revision 851, Sat Feb 15 15:22:19 2003 UTC branches/dev-api-4/xvidcore/src/motion/x86_asm/sad_3dn.asm 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  ; *     3dnow (*but without xmm*) sum of absolute difference  ; *  - 3DNow sad operators w/o XMM instructions -
5  ; *  ; *
6  ; *     This program is free software; you can redistribute it and/or modify  ; *  Copyright(C) 2002 Peter ross <pross@xvid.org>
7  ; *     it under the terms of the GNU General Public License as published by  ; *
8    ; *  This program is free software; you can redistribute it and/or modify it
9    ; *  under the terms of the GNU General Public License as published by
10  ; *     the Free Software Foundation; either version 2 of the License, or  ; *     the Free Software Foundation; either version 2 of the License, or
11  ; *     (at your option) any later version.  ; *     (at your option) any later version.
12  ; *  ; *
# Line 15  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
 ; *  
 ; *************************************************************************/  
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
21  ; *  ; *
22  ; * 23.07.2002  sad[16,8]bi_3dn; <pross@xvid.org>  ; * $Id: sad_3dn.asm,v 1.5.2.1 2003-10-28 22:23:03 edgomez Exp $
23  ; *  ; *
24  ; *************************************************************************/  ; ***************************************************************************/
25    
26  bits 32  BITS 32
27    
28  %macro cglobal 1  %macro cglobal 1
29          %ifdef PREFIX          %ifdef PREFIX
# Line 38  Line 34 
34          %endif          %endif
35  %endmacro  %endmacro
36    
37  section .data  ;=============================================================================
38    ; Read only data
39  align 16  ;=============================================================================
40  mmx_one times 4 dw 1  
41    SECTION .rodata
42  section .text  
43    ALIGN 16
44  cglobal  sad16bi_3dn  mmx_one:
45  cglobal  sad8bi_3dn          times 4 dw 1
46    
47  ;===========================================================================  ;=============================================================================
48  ;  ; Helper macros
49  ; uint32_t sad16bi_3dn(const uint8_t * const cur,  ;=============================================================================
 ; const uint8_t * const ref1,  
 ; const uint8_t * const ref2,  
 ; const uint32_t stride);  
 ;  
 ;===========================================================================  
   
50  %macro SADBI_16x16_3DN 0  %macro SADBI_16x16_3DN 0
51     movq mm0, [eax] ; src     movq mm0, [eax] ; src
52     movq mm2, [eax+8]     movq mm2, [eax+8]
# Line 93  Line 83 
83     paddusw mm6,mm2     paddusw mm6,mm2
84  %endmacro  %endmacro
85    
86  align 16  %macro SADBI_8x8_3DN 0
87      movq mm0, [eax] ; src
88      movq mm2, [eax+ecx]
89    
90      movq mm1, [edx] ; ref1
91      movq mm3, [edx+ecx]
92      pavgusb mm1, [ebx] ; ref2
93      lea edx, [edx+2*ecx]
94      pavgusb mm3, [ebx+ecx]
95      lea ebx, [ebx+2*ecx]
96    
97      movq mm4, mm0
98      lea eax, [eax+2*ecx]
99      psubusb mm0, mm1
100      movq mm5, mm2
101      psubusb mm2, mm3
102    
103      psubusb mm1, mm4
104      por mm0, mm1
105      psubusb mm3, mm5
106      por mm2, mm3
107    
108      movq mm1, mm0
109      movq mm3, mm2
110    
111      punpcklbw mm0,mm7
112      punpckhbw mm1,mm7
113      punpcklbw mm2,mm7
114      punpckhbw mm3,mm7
115    
116      paddusw mm0,mm1
117      paddusw mm2,mm3
118      paddusw mm6,mm0
119      paddusw mm6,mm2
120    %endmacro
121    
122    ;=============================================================================
123    ; Code
124    ;=============================================================================
125    
126    SECTION .text
127    
128    cglobal  sad16bi_3dn
129    cglobal  sad8bi_3dn
130    
131    ;-----------------------------------------------------------------------------
132    ;
133    ; uint32_t sad16bi_3dn(const uint8_t * const cur,
134    ; const uint8_t * const ref1,
135    ; const uint8_t * const ref2,
136    ; const uint32_t stride);
137    ;
138    ;-----------------------------------------------------------------------------
139    
140    ALIGN 16
141  sad16bi_3dn:  sad16bi_3dn:
142     push ebx     push ebx
143     mov eax, [esp+4+ 4] ; Src     mov eax, [esp+4+ 4] ; Src
# Line 133  Line 177 
177    
178     ret     ret
179    
180    ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
181  ;  ;
182  ; uint32_t sad8bi_3dn(const uint8_t * const cur,  ; uint32_t sad8bi_3dn(const uint8_t * const cur,
183  ; const uint8_t * const ref1,  ; const uint8_t * const ref1,
184  ; const uint8_t * const ref2,  ; const uint8_t * const ref2,
185  ; const uint32_t stride);  ; const uint32_t stride);
186  ;  ;
187  ;===========================================================================  ;-----------------------------------------------------------------------------
   
 %macro SADBI_8x8_3DN 0  
    movq mm0, [eax] ; src  
    movq mm2, [eax+ecx]  
   
    movq mm1, [edx] ; ref1  
    movq mm3, [edx+ecx]  
    pavgusb mm1, [ebx] ; ref2  
    lea edx,[edx+2*ecx]  
    pavgusb mm3, [ebx+ecx]  
    lea ebx,[ebx+2*ecx]  
   
    movq mm4, mm0  
    lea eax,[eax+2*ecx]  
    psubusb mm0, mm1  
    movq mm5, mm2  
    psubusb mm2, mm3  
   
    psubusb mm1, mm4  
    por mm0, mm1  
    psubusb mm3, mm5  
    por mm2, mm3  
   
    movq mm1,mm0  
    movq mm3,mm2  
   
    punpcklbw mm0,mm7  
    punpckhbw mm1,mm7  
    punpcklbw mm2,mm7  
    punpckhbw mm3,mm7  
   
    paddusw mm0,mm1  
    paddusw mm2,mm3  
    paddusw mm6,mm0  
    paddusw mm6,mm2  
 %endmacro  
188    
189  align 16  ALIGN 16
190  sad8bi_3dn:  sad8bi_3dn:
191     push ebx     push ebx
192     mov eax, [esp+4+ 4] ; Src     mov eax, [esp+4+ 4] ; Src

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

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