Parent Directory | Revision Log
Revision 1519 - (view) (download)
1 : | suxen_drol | 1397 | ;/***************************************************************************** |
2 : | ; * | ||
3 : | ; * XVID MPEG-4 VIDEO CODEC | ||
4 : | ; * - mmx post processing - | ||
5 : | ; * | ||
6 : | ; * Copyright(C) 2004 Peter Ross <pross@xvid.org> | ||
7 : | ; * | ||
8 : | ; * XviD 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 | ||
11 : | ; * (at your option) any later version. | ||
12 : | ; * | ||
13 : | ; * This program is distributed in the hope that it will be useful, | ||
14 : | ; * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 : | ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 : | ; * GNU General Public License for more details. | ||
17 : | ; * | ||
18 : | ; * You should have received a copy of the GNU General Public License | ||
19 : | ; * along with this program; if not, write to the Free Software | ||
20 : | ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 : | ; * | ||
22 : | edgomez | 1519 | ; * $Id: postprocessing_mmx.asm,v 1.2 2004-07-24 11:46:08 edgomez Exp $ |
23 : | suxen_drol | 1397 | ; * |
24 : | ; *************************************************************************/ | ||
25 : | |||
26 : | BITS 32 | ||
27 : | |||
28 : | %macro cglobal 1 | ||
29 : | %ifdef PREFIX | ||
30 : | global _%1 | ||
31 : | %define %1 _%1 | ||
32 : | %else | ||
33 : | global %1 | ||
34 : | %endif | ||
35 : | %endmacro | ||
36 : | |||
37 : | ;=========================================================================== | ||
38 : | ; read only data | ||
39 : | ;=========================================================================== | ||
40 : | |||
41 : | %ifdef FORMAT_COFF | ||
42 : | edgomez | 1519 | SECTION .rodata |
43 : | suxen_drol | 1397 | %else |
44 : | edgomez | 1519 | SECTION .rodata align=16 |
45 : | suxen_drol | 1397 | %endif |
46 : | |||
47 : | mmx_0x80: | ||
48 : | times 8 db 0x80 | ||
49 : | |||
50 : | mmx_offset: | ||
51 : | %assign i -128 | ||
52 : | %rep 256 | ||
53 : | times 8 db i | ||
54 : | %assign i i+1 | ||
55 : | %endrep | ||
56 : | |||
57 : | |||
58 : | ;============================================================================= | ||
59 : | ; Code | ||
60 : | ;============================================================================= | ||
61 : | |||
62 : | SECTION .text | ||
63 : | |||
64 : | cglobal image_brightness_mmx | ||
65 : | |||
66 : | |||
67 : | ;////////////////////////////////////////////////////////////////////// | ||
68 : | ;// image_brightness_mmx | ||
69 : | ;////////////////////////////////////////////////////////////////////// | ||
70 : | |||
71 : | align 16 | ||
72 : | image_brightness_mmx: | ||
73 : | |||
74 : | push esi | ||
75 : | push edi | ||
76 : | |||
77 : | movq mm6, [mmx_0x80] | ||
78 : | |||
79 : | mov eax, [esp+8+20] ; offset | ||
80 : | movq mm7, [mmx_offset + (eax + 128)*8] ; being lazy | ||
81 : | |||
82 : | mov edx, [esp+8+4] ; Dst | ||
83 : | mov ecx, [esp+8+8] ; stride | ||
84 : | mov esi, [esp+8+12] ; width | ||
85 : | mov edi, [esp+8+16] ; height | ||
86 : | |||
87 : | .yloop | ||
88 : | xor eax, eax | ||
89 : | |||
90 : | .xloop | ||
91 : | movq mm0, [edx + eax] | ||
92 : | movq mm1, [edx + eax + 8] ; mm0 = [dst] | ||
93 : | |||
94 : | paddb mm0, mm6 ; unsigned -> signed domain | ||
95 : | paddb mm1, mm6 | ||
96 : | paddsb mm0, mm7 | ||
97 : | paddsb mm1, mm7 ; mm0 += offset | ||
98 : | psubb mm0, mm6 | ||
99 : | psubb mm1, mm6 ; signed -> unsigned domain | ||
100 : | |||
101 : | movq [edx + eax], mm0 | ||
102 : | movq [edx + eax + 8], mm1 ; [dst] = mm0 | ||
103 : | |||
104 : | add eax,16 | ||
105 : | cmp eax,esi | ||
106 : | jl .xloop | ||
107 : | |||
108 : | add edx, ecx ; dst += stride | ||
109 : | sub edi, 1 | ||
110 : | jg .yloop | ||
111 : | |||
112 : | pop edi | ||
113 : | pop esi | ||
114 : | |||
115 : | ret | ||
116 : | ;////////////////////////////////////////////////////////////////////// |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |