[cvs] / xvidcore / src / image / x86_asm / deintl_sse.asm Repository:
ViewVC logotype

Diff of /xvidcore/src/image/x86_asm/deintl_sse.asm

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

revision 1.2, Tue Aug 19 09:06:48 2008 UTC revision 1.7, Tue Mar 9 10:00:14 2010 UTC
# Line 4  Line 4 
4  ; *  - simple de-interlacer  ; *  - simple de-interlacer
5  ; *  Copyright(C) 2006 Pascal Massimino <skal@xvid.org>  ; *  Copyright(C) 2006 Pascal Massimino <skal@xvid.org>
6  ; *  ; *
7  ; *  This file is part of XviD, a free MPEG-4 video encoder/decoder  ; *  This file is part of Xvid, a free MPEG-4 video encoder/decoder
8  ; *  ; *
9  ; *  XviD is free software; you can redistribute it and/or modify it  ; *  Xvid is free software; you can redistribute it and/or modify it
10  ; *  under the terms of the GNU General Public License as published by  ; *  under the terms of the GNU General Public License as published by
11  ; *  the Free Software Foundation; either version 2 of the License, or  ; *  the Free Software Foundation; either version 2 of the License, or
12  ; *  (at your option) any later version.  ; *  (at your option) any later version.
# Line 32  Line 32 
32  ; *  ; *
33  ; *************************************************************************/  ; *************************************************************************/
34    
35  bits 32  %include "nasm.inc"
   
 %macro cglobal 1  
         %ifdef PREFIX  
                 %ifdef MARK_FUNCS  
                         global _%1:function %1.endfunc-%1  
                         %define %1 _%1:function %1.endfunc-%1  
                 %else  
                         global _%1  
                         %define %1 _%1  
                 %endif  
         %else  
                 %ifdef MARK_FUNCS  
                         global %1:function %1.endfunc-%1  
                 %else  
                         global %1  
                 %endif  
         %endif  
 %endmacro  
36    
37  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
38    
# Line 58  Line 40 
40    
41  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
42    
43  %ifdef FORMAT_COFF  DATA
 SECTION .rodata  
 %else  
 SECTION .rodata align=16  
 %endif  
44    
45  align 16  align SECTION_ALIGN
46  Mask_6b  times 16 db 0x3f  Mask_6b  times 16 db 0x3f
47  Rnd_3b:  times 16 db 3  Rnd_3b:  times 16 db 3
48    
49  SECTION .text  TEXT
50    
51  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
52  ;// sse version  ;// sse version
53    
54  align 16  align SECTION_ALIGN
55  xvid_deinterlace_sse:  xvid_deinterlace_sse:
56    
57    mov eax, [esp+ 4]  ; Pix    mov _EAX, prm1  ; Pix
58    mov ecx, [esp+12]  ; Height    mov TMP0, prm3  ; Height
59    mov edx, [esp+16]  ; BpS    mov TMP1, prm4  ; BpS
60    
61    push ebx    push _EBX
62    mov ebx, [esp+4+ 8] ; Width  %ifdef ARCH_IS_X86_64
63      mov _EBX,  prm2  ; Width
64    add ebx, 7  %else
65    shr ecx, 1    mov _EBX, [esp+4+ 8] ; Width
66    shr ebx, 3        ; Width /= 8  %endif
67    dec ecx  
68      add _EBX, 7
69      shr TMP0, 1
70      shr _EBX, 3        ; Width /= 8
71      dec TMP0
72    
73    movq mm6, [Mask_6b]    movq mm6, [Mask_6b]
74    
75  .Loop_x  .Loop_x:
76    push eax    push _EAX
77    movq mm1, [eax      ]    movq mm1,  [_EAX      ]
78    movq mm2, [eax+  edx]    movq mm2,  [_EAX+ TMP1]
79    lea  eax, [eax+  edx]    lea  _EAX, [_EAX+ TMP1]
80    movq mm0, mm2    movq mm0, mm2
81    
82    push ecx    push TMP0
83    
84  .Loop:  .Loop:
85    movq    mm3, [eax+  edx]    movq    mm3, [_EAX+  TMP1]
86    movq    mm4, [eax+2*edx]    movq    mm4, [_EAX+2*TMP1]
87    movq    mm5, mm2    movq    mm5, mm2
88    pavgb   mm0, mm4    pavgb   mm0, mm4
89    pavgb   mm1, mm3    pavgb   mm1, mm3
# Line 115  Line 97 
97    pand    mm0, mm6    pand    mm0, mm6
98    paddusb mm1, mm2    paddusb mm1, mm2
99    psubusb mm1, mm0    psubusb mm1, mm0
100    movq   [eax], mm1    movq   [_EAX], mm1
101    lea  eax, [eax+2*edx]    lea  _EAX, [_EAX+2*TMP1]
102    movq mm0, mm5    movq mm0, mm5
103    movq mm1, mm3    movq mm1, mm3
104    movq mm2, mm4    movq mm2, mm4
105    dec ecx    dec TMP0
106    jg .Loop    jg .Loop
107    
108    pavgb mm0, mm2     ; p0 += p2    pavgb mm0, mm2     ; p0 += p2
# Line 135  Line 117 
117    pand    mm0, mm6    pand    mm0, mm6
118    paddusb mm1, mm2    paddusb mm1, mm2
119    psubusb mm1, mm0    psubusb mm1, mm0
120    movq   [eax], mm1    movq   [_EAX], mm1
121    
122    pop ecx    pop TMP0
123    pop eax    pop _EAX
124    add eax, 8    add _EAX, 8
125    
126    dec ebx    dec _EBX
127    jg .Loop_x    jg .Loop_x
128    
129    pop ebx    pop _EBX
130    ret    ret
131  .endfunc  ENDFUNC
132    
133  ;//////////////////////////////////////////////////////////////////////  ;//////////////////////////////////////////////////////////////////////
134    NON_EXEC_STACK
 %ifidn __OUTPUT_FORMAT__,elf  
 section ".note.GNU-stack" noalloc noexec nowrite progbits  
 %endif  

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.7

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