Parent Directory | Revision Log
Revision 1733 - (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 : | ; * $Id: deintl_sse.asm,v 1.1 2006-10-13 07:38:09 Skal Exp $ | ||
24 : | ; * | ||
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 : | %else | ||
43 : | global _%1 | ||
44 : | %define %1 _%1 | ||
45 : | %endif | ||
46 : | %else | ||
47 : | %ifdef MARK_FUNCS | ||
48 : | global %1:function %1.endfunc-%1 | ||
49 : | %else | ||
50 : | global %1 | ||
51 : | %endif | ||
52 : | %endif | ||
53 : | %endmacro | ||
54 : | |||
55 : | ;////////////////////////////////////////////////////////////////////// | ||
56 : | |||
57 : | cglobal xvid_deinterlace_sse | ||
58 : | |||
59 : | ;////////////////////////////////////////////////////////////////////// | ||
60 : | |||
61 : | %ifdef FORMAT_COFF | ||
62 : | SECTION .rodata | ||
63 : | %else | ||
64 : | SECTION .rodata align=16 | ||
65 : | %endif | ||
66 : | |||
67 : | align 16 | ||
68 : | Mask_6b times 16 db 0x3f | ||
69 : | Rnd_3b: times 16 db 3 | ||
70 : | |||
71 : | SECTION .text | ||
72 : | |||
73 : | ;////////////////////////////////////////////////////////////////////// | ||
74 : | ;// sse version | ||
75 : | |||
76 : | align 16 | ||
77 : | xvid_deinterlace_sse: | ||
78 : | |||
79 : | mov eax, [esp+ 4] ; Pix | ||
80 : | mov ecx, [esp+12] ; Height | ||
81 : | mov edx, [esp+16] ; BpS | ||
82 : | |||
83 : | push ebx | ||
84 : | mov ebx, [esp+4+ 8] ; Width | ||
85 : | |||
86 : | add ebx, 7 | ||
87 : | shr ecx, 1 | ||
88 : | shr ebx, 3 ; Width /= 8 | ||
89 : | dec ecx | ||
90 : | |||
91 : | movq mm6, [Mask_6b] | ||
92 : | |||
93 : | .Loop_x | ||
94 : | push eax | ||
95 : | movq mm1, [eax ] | ||
96 : | movq mm2, [eax+ edx] | ||
97 : | lea eax, [eax+ edx] | ||
98 : | movq mm0, mm2 | ||
99 : | |||
100 : | push ecx | ||
101 : | |||
102 : | .Loop: | ||
103 : | movq mm3, [eax+ edx] | ||
104 : | movq mm4, [eax+2*edx] | ||
105 : | movq mm5, mm2 | ||
106 : | pavgb mm0, mm4 | ||
107 : | pavgb mm1, mm3 | ||
108 : | movq mm7, mm2 | ||
109 : | psubusb mm2, mm0 | ||
110 : | psubusb mm0, mm7 | ||
111 : | paddusb mm0, [Rnd_3b] | ||
112 : | psrlw mm2, 2 | ||
113 : | psrlw mm0, 2 | ||
114 : | pand mm2, mm6 | ||
115 : | pand mm0, mm6 | ||
116 : | paddusb mm1, mm2 | ||
117 : | psubusb mm1, mm0 | ||
118 : | movq [eax], mm1 | ||
119 : | lea eax, [eax+2*edx] | ||
120 : | movq mm0, mm5 | ||
121 : | movq mm1, mm3 | ||
122 : | movq mm2, mm4 | ||
123 : | dec ecx | ||
124 : | jg .Loop | ||
125 : | |||
126 : | pavgb mm0, mm2 ; p0 += p2 | ||
127 : | pavgb mm1, mm1 ; p1 += p1 | ||
128 : | movq mm7, mm2 | ||
129 : | psubusb mm2, mm0 | ||
130 : | psubusb mm0, mm7 | ||
131 : | paddusb mm0, [Rnd_3b] | ||
132 : | psrlw mm2, 2 | ||
133 : | psrlw mm0, 2 | ||
134 : | pand mm2, mm6 | ||
135 : | pand mm0, mm6 | ||
136 : | paddusb mm1, mm2 | ||
137 : | psubusb mm1, mm0 | ||
138 : | movq [eax], mm1 | ||
139 : | |||
140 : | pop ecx | ||
141 : | pop eax | ||
142 : | add eax, 8 | ||
143 : | |||
144 : | dec ebx | ||
145 : | jg .Loop_x | ||
146 : | |||
147 : | pop ebx | ||
148 : | ret | ||
149 : | .endfunc | ||
150 : | |||
151 : | ;////////////////////////////////////////////////////////////////////// |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |