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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1883 - (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 : Isibaar 1883 ; * Xvid is free software; you can redistribute it and/or modify it
9 : suxen_drol 1397 ; * 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 : Isibaar 1883 ; * $Id: postprocessing_mmx.asm,v 1.14 2010-03-09 10:00:14 Isibaar Exp $
23 : suxen_drol 1397 ; *
24 :     ; *************************************************************************/
25 :    
26 : Isibaar 1795 %include "nasm.inc"
27 : suxen_drol 1397
28 :     ;===========================================================================
29 :     ; read only data
30 :     ;===========================================================================
31 :    
32 : Isibaar 1795 DATA
33 : suxen_drol 1397
34 :     mmx_0x80:
35 :     times 8 db 0x80
36 :    
37 :     mmx_offset:
38 :     %assign i -128
39 :     %rep 256
40 :     times 8 db i
41 :     %assign i i+1
42 :     %endrep
43 :    
44 :    
45 :     ;=============================================================================
46 :     ; Code
47 :     ;=============================================================================
48 :    
49 : Isibaar 1844 TEXT
50 : suxen_drol 1397
51 :     cglobal image_brightness_mmx
52 :    
53 :    
54 :     ;//////////////////////////////////////////////////////////////////////
55 :     ;// image_brightness_mmx
56 :     ;//////////////////////////////////////////////////////////////////////
57 :    
58 : Isibaar 1795 align SECTION_ALIGN
59 : suxen_drol 1397 image_brightness_mmx:
60 :    
61 :     movq mm6, [mmx_0x80]
62 :    
63 : Isibaar 1795 %ifdef ARCH_IS_X86_64
64 : Isibaar 1845 XVID_MOVSXD _EAX, prm5d
65 : Isibaar 1803 lea TMP0, [mmx_offset]
66 :     movq mm7, [TMP0 + (_EAX + 128)*8] ; being lazy
67 : Isibaar 1795 %else
68 : Isibaar 1798 mov eax, prm5d ; offset
69 : Isibaar 1795 movq mm7, [mmx_offset + (_EAX + 128)*8] ; being lazy
70 :     %endif
71 : suxen_drol 1397
72 : Isibaar 1795 mov TMP1, prm1 ; Dst
73 :     mov TMP0, prm2 ; stride
74 : suxen_drol 1397
75 : Isibaar 1795 push _ESI
76 :     push _EDI
77 :     %ifdef ARCH_IS_X86_64
78 : Isibaar 1803 mov _ESI, prm3
79 : Isibaar 1795 mov _EDI, prm4
80 :     %else
81 :     mov _ESI, [_ESP+8+12] ; width
82 :     mov _EDI, [_ESP+8+16] ; height
83 :     %endif
84 :    
85 : Isibaar 1793 .yloop:
86 : Isibaar 1795 xor _EAX, _EAX
87 : suxen_drol 1397
88 : Isibaar 1793 .xloop:
89 : Isibaar 1795 movq mm0, [TMP1 + _EAX]
90 :     movq mm1, [TMP1 + _EAX + 8] ; mm0 = [dst]
91 : suxen_drol 1397
92 :     paddb mm0, mm6 ; unsigned -> signed domain
93 :     paddb mm1, mm6
94 :     paddsb mm0, mm7
95 :     paddsb mm1, mm7 ; mm0 += offset
96 :     psubb mm0, mm6
97 :     psubb mm1, mm6 ; signed -> unsigned domain
98 :    
99 : Isibaar 1795 movq [TMP1 + _EAX], mm0
100 :     movq [TMP1 + _EAX + 8], mm1 ; [dst] = mm0
101 : suxen_drol 1397
102 : Isibaar 1795 add _EAX,16
103 :     cmp _EAX,_ESI
104 : suxen_drol 1397 jl .xloop
105 :    
106 : Isibaar 1795 add TMP1, TMP0 ; dst += stride
107 : Isibaar 1834 dec _EDI
108 : suxen_drol 1397 jg .yloop
109 :    
110 : Isibaar 1795 pop _EDI
111 :     pop _ESI
112 : suxen_drol 1397
113 :     ret
114 : Isibaar 1793 ENDFUNC
115 : suxen_drol 1397 ;//////////////////////////////////////////////////////////////////////
116 : Isibaar 1790
117 : Isibaar 1877 NON_EXEC_STACK

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