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

Annotation of /trunk/xvidcore/src/image/x86_asm/deintl_sse.asm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1793 - (view) (download)

1 : Skal 1733 ;/*****************************************************************************
2 :     ; *
3 :     ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * - simple de-interlacer
5 :     ; * Copyright(C) 2006 Pascal Massimino <skal@xvid.org>
6 :     ; *
7 :     ; * 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
10 :     ; * under the terms of the GNU General Public License as published by
11 :     ; * the Free Software Foundation; either version 2 of the License, or
12 :     ; * (at your option) any later version.
13 :     ; *
14 :     ; * This program is distributed in the hope that it will be useful,
15 :     ; * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 :     ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 :     ; * GNU General Public License for more details.
18 :     ; *
19 :     ; * You should have received a copy of the GNU General Public License
20 :     ; * along with this program; if not, write to the Free Software
21 :     ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 :     ; *
23 : Isibaar 1793 ; * $Id: deintl_sse.asm,v 1.3 2008-11-11 20:46:24 Isibaar Exp $
24 : Skal 1733 ; *
25 :     ; *************************************************************************/
26 :    
27 :     ;/**************************************************************************
28 :     ; *
29 :     ; * History:
30 :     ; *
31 :     ; * Oct 13 2006: initial version
32 :     ; *
33 :     ; *************************************************************************/
34 :    
35 :     bits 32
36 :    
37 :     %macro cglobal 1
38 :     %ifdef PREFIX
39 :     %ifdef MARK_FUNCS
40 :     global _%1:function %1.endfunc-%1
41 :     %define %1 _%1:function %1.endfunc-%1
42 : Isibaar 1793 %define ENDFUNC .endfunc
43 : Skal 1733 %else
44 :     global _%1
45 :     %define %1 _%1
46 : Isibaar 1793 %define ENDFUNC
47 : Skal 1733 %endif
48 :     %else
49 :     %ifdef MARK_FUNCS
50 :     global %1:function %1.endfunc-%1
51 : Isibaar 1793 %define ENDFUNC .endfunc
52 : Skal 1733 %else
53 :     global %1
54 : Isibaar 1793 %define ENDFUNC
55 : Skal 1733 %endif
56 :     %endif
57 :     %endmacro
58 :    
59 :     ;//////////////////////////////////////////////////////////////////////
60 :    
61 :     cglobal xvid_deinterlace_sse
62 :    
63 :     ;//////////////////////////////////////////////////////////////////////
64 :    
65 :     %ifdef FORMAT_COFF
66 :     SECTION .rodata
67 :     %else
68 :     SECTION .rodata align=16
69 :     %endif
70 :    
71 :     align 16
72 :     Mask_6b times 16 db 0x3f
73 :     Rnd_3b: times 16 db 3
74 :    
75 :     SECTION .text
76 :    
77 :     ;//////////////////////////////////////////////////////////////////////
78 :     ;// sse version
79 :    
80 :     align 16
81 :     xvid_deinterlace_sse:
82 :    
83 :     mov eax, [esp+ 4] ; Pix
84 :     mov ecx, [esp+12] ; Height
85 :     mov edx, [esp+16] ; BpS
86 :    
87 :     push ebx
88 :     mov ebx, [esp+4+ 8] ; Width
89 :    
90 :     add ebx, 7
91 :     shr ecx, 1
92 :     shr ebx, 3 ; Width /= 8
93 :     dec ecx
94 :    
95 :     movq mm6, [Mask_6b]
96 :    
97 : Isibaar 1793 .Loop_x:
98 : Skal 1733 push eax
99 :     movq mm1, [eax ]
100 :     movq mm2, [eax+ edx]
101 :     lea eax, [eax+ edx]
102 :     movq mm0, mm2
103 :    
104 :     push ecx
105 :    
106 :     .Loop:
107 :     movq mm3, [eax+ edx]
108 :     movq mm4, [eax+2*edx]
109 :     movq mm5, mm2
110 :     pavgb mm0, mm4
111 :     pavgb mm1, mm3
112 :     movq mm7, mm2
113 :     psubusb mm2, mm0
114 :     psubusb mm0, mm7
115 :     paddusb mm0, [Rnd_3b]
116 :     psrlw mm2, 2
117 :     psrlw mm0, 2
118 :     pand mm2, mm6
119 :     pand mm0, mm6
120 :     paddusb mm1, mm2
121 :     psubusb mm1, mm0
122 :     movq [eax], mm1
123 :     lea eax, [eax+2*edx]
124 :     movq mm0, mm5
125 :     movq mm1, mm3
126 :     movq mm2, mm4
127 :     dec ecx
128 :     jg .Loop
129 :    
130 :     pavgb mm0, mm2 ; p0 += p2
131 :     pavgb mm1, mm1 ; p1 += p1
132 :     movq mm7, mm2
133 :     psubusb mm2, mm0
134 :     psubusb mm0, mm7
135 :     paddusb mm0, [Rnd_3b]
136 :     psrlw mm2, 2
137 :     psrlw mm0, 2
138 :     pand mm2, mm6
139 :     pand mm0, mm6
140 :     paddusb mm1, mm2
141 :     psubusb mm1, mm0
142 :     movq [eax], mm1
143 :    
144 :     pop ecx
145 :     pop eax
146 :     add eax, 8
147 :    
148 :     dec ebx
149 :     jg .Loop_x
150 :    
151 :     pop ebx
152 :     ret
153 : Isibaar 1793 ENDFUNC
154 : Skal 1733
155 :     ;//////////////////////////////////////////////////////////////////////
156 : Isibaar 1790
157 :     %ifidn __OUTPUT_FORMAT__,elf
158 :     section ".note.GNU-stack" noalloc noexec nowrite progbits
159 :     %endif

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