[svn] / trunk / xvidcore / src / image / x86_asm / postprocessing_sse2.asm Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/image/x86_asm/postprocessing_sse2.asm

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

revision 1519, Sat Jul 24 11:46:08 2004 UTC revision 1793, Tue Nov 11 20:46:24 2008 UTC
# Line 26  Line 26 
26    
27  %macro cglobal 1  %macro cglobal 1
28          %ifdef PREFIX          %ifdef PREFIX
29                    %ifdef MARK_FUNCS
30                            global _%1:function %1.endfunc-%1
31                            %define %1 _%1:function %1.endfunc-%1
32                            %define ENDFUNC .endfunc
33                    %else
34                  global _%1                  global _%1
35                  %define %1 _%1                  %define %1 _%1
36                            %define ENDFUNC
37                    %endif
38            %else
39                    %ifdef MARK_FUNCS
40                            global %1:function %1.endfunc-%1
41                            %define ENDFUNC .endfunc
42          %else          %else
43                  global %1                  global %1
44                            %define ENDFUNC
45                    %endif
46          %endif          %endif
47  %endmacro  %endmacro
48    
 %macro FILLBYTES 2  
   
         mov [%1], %2  
         mov [%1 + 1], %2  
         mov [%1 + 2], %2  
         mov [%1 + 3], %2  
         mov [%1 + 4], %2  
         mov [%1 + 5], %2  
         mov [%1 + 6], %2  
         mov [%1 + 7], %2  
         mov [%1 + 8], %2  
         mov [%1 + 9], %2  
         mov [%1 + 10], %2  
         mov [%1 + 11], %2  
         mov [%1 + 12], %2  
         mov [%1 + 13], %2  
         mov [%1 + 14], %2  
         mov [%1 + 15], %2  
   
 %endmacro  
   
   
49  ;===========================================================================  ;===========================================================================
50  ; read only data  ; read only data
51  ;===========================================================================  ;===========================================================================
# Line 68  Line 59 
59  xmm_0x80:  xmm_0x80:
60          times 16 db 0x80          times 16 db 0x80
61    
 offset_xmm:  
         times 16 db 0x00  
   
62  ;=============================================================================  ;=============================================================================
63  ; Code  ; Code
64  ;=============================================================================  ;=============================================================================
# Line 79  Line 67 
67    
68  cglobal image_brightness_sse2  cglobal image_brightness_sse2
69    
   
70  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
71  ;// image_brightness_sse2  ;// image_brightness_sse2
72  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
73    
74  align 16  %macro CREATE_OFFSET_VECTOR 2
75      mov [%1 +  0], %2
76      mov [%1 +  1], %2
77      mov [%1 +  2], %2
78      mov [%1 +  3], %2
79      mov [%1 +  4], %2
80      mov [%1 +  5], %2
81      mov [%1 +  6], %2
82      mov [%1 +  7], %2
83      mov [%1 +  8], %2
84      mov [%1 +  9], %2
85      mov [%1 + 10], %2
86      mov [%1 + 11], %2
87      mov [%1 + 12], %2
88      mov [%1 + 13], %2
89      mov [%1 + 14], %2
90      mov [%1 + 15], %2
91    %endmacro
92    
93    ALIGN 16
94  image_brightness_sse2:  image_brightness_sse2:
95    
96          push esi          push esi
97          push edi    push edi    ; 8 bytes offset for push
98      sub esp, 32 ; 32 bytes for local data (16bytes will be used, 16bytes more to align correctly mod 16)
99    
100          movdqa xmm6, [xmm_0x80]          movdqa xmm6, [xmm_0x80]
101    
102          mov eax, [esp+8+20] ; offset    ; Create a offset...offset vector
103      mov eax, [esp+8+32+20] ; brightness offset value
104      mov edx, esp           ; edx will be esp aligned mod 16
105      add edx, 15            ; edx = esp + 15
106      and edx, ~15           ; edx = (esp + 15)&(~15)
107      CREATE_OFFSET_VECTOR edx, al
108      movdqa xmm7, [edx]
109    
110      mov edx, [esp+8+32+4]  ; Dst
111      mov ecx, [esp+8+32+8]  ; stride
112      mov esi, [esp+8+32+12] ; width
113      mov edi, [esp+8+32+16] ; height
114    
115          FILLBYTES offset_xmm, al  .yloop:
   
         movdqa xmm7, [offset_xmm]  
   
         mov edx, [esp+8+4]  ; Dst  
         mov ecx, [esp+8+8]  ; stride  
         mov esi, [esp+8+12] ; width  
         mov edi, [esp+8+16] ; height  
   
 .yloop  
116          xor     eax, eax          xor     eax, eax
117    
118  .xloop  .xloop:
119          movdqa xmm0, [edx + eax]          movdqa xmm0, [edx + eax]
120          movdqa xmm1, [edx + eax + 16]   ; xmm0 = [dst]          movdqa xmm1, [edx + eax + 16]   ; xmm0 = [dst]
121    
# Line 128  Line 137 
137          sub edi, 1          sub edi, 1
138          jg .yloop          jg .yloop
139    
140      add esp, 32
141          pop edi          pop edi
142          pop esi          pop esi
143    
144          ret          ret
145    ENDFUNC
146  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
147    
148    %ifidn __OUTPUT_FORMAT__,elf
149    section ".note.GNU-stack" noalloc noexec nowrite progbits
150    %endif
151    

Legend:
Removed from v.1519  
changed lines
  Added in v.1793

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