[svn] / branches / dev-api-4 / xvidcore / src / bitstream / x86_asm / cbp_mmx.asm Repository:
ViewVC logotype

Annotation of /branches/dev-api-4/xvidcore/src/bitstream/x86_asm/cbp_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 53 - (view) (download)
Original Path: trunk/xvidcore/src/bitstream/x86_asm/cbp_mmx.asm

1 : Isibaar 3 ;/**************************************************************************
2 :     ; *
3 :     ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * mmx cbp calc
5 :     ; *
6 :     ; * This program is an implementation of a part of one or more MPEG-4
7 :     ; * Video tools as specified in ISO/IEC 14496-2 standard. Those intending
8 :     ; * to use this software module in hardware or software products are
9 :     ; * advised that its use may infringe existing patents or copyrights, and
10 :     ; * any such use would be at such party's own risk. The original
11 :     ; * developer of this software module and his/her company, and subsequent
12 :     ; * editors and their companies, will have no liability for use of this
13 :     ; * software or modifications or derivatives thereof.
14 :     ; *
15 :     ; * This program is free software; you can redistribute it and/or modify
16 :     ; * it under the terms of the GNU General Public License as published by
17 :     ; * the Free Software Foundation; either version 2 of the License, or
18 :     ; * (at your option) any later version.
19 :     ; *
20 :     ; * This program is distributed in the hope that it will be useful,
21 :     ; * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 :     ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 :     ; * GNU General Public License for more details.
24 :     ; *
25 :     ; * You should have received a copy of the GNU General Public License
26 :     ; * along with this program; if not, write to the Free Software
27 :     ; * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 :     ; *
29 :     ; *************************************************************************/
30 :    
31 :     ;/**************************************************************************
32 :     ; *
33 :     ; * History:
34 :     ; *
35 : chenm001 53 ; * 22.03.2002 0.01 ; Min Chen <chenm001@163.com>
36 :     ; * ; use 386 cpu's 'BTS' to replace 'cbp |= 1 << (edx-1)'
37 : Isibaar 3 ; * 24.11.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>
38 :     ; *
39 :     ; *************************************************************************/
40 :    
41 :    
42 :     bits 32
43 :    
44 :     section .data
45 :    
46 :     %macro cglobal 1
47 :     %ifdef PREFIX
48 :     global _%1
49 :     %define %1 _%1
50 :     %else
51 :     global %1
52 :     %endif
53 :     %endmacro
54 :    
55 :     ignore_dc dw 0, -1, -1, -1
56 :    
57 :    
58 :     section .text
59 :    
60 :    
61 :     ;===========================================================================
62 :     ;
63 :     ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
64 :     ;
65 :     ;===========================================================================
66 :    
67 :     align 16
68 :     cglobal calc_cbp_mmx
69 :     calc_cbp_mmx
70 :     push ebx
71 :     push ecx
72 :     push edx
73 :     push esi
74 :    
75 :     mov esi, [esp + 16 + 4] ; coeff
76 :     movq mm7, [ignore_dc]
77 :    
78 :     xor eax, eax ; cbp = 0
79 :     mov edx, 6
80 :     .loop
81 :     movq mm0, [esi]
82 :     pand mm0, mm7
83 :     movq mm1, [esi+8]
84 :    
85 :     por mm0, [esi+16]
86 :     por mm1, [esi+24]
87 :    
88 :     por mm0, [esi+32]
89 :     por mm1, [esi+40]
90 :    
91 :     por mm0, [esi+48]
92 :     por mm1, [esi+56]
93 :    
94 :     por mm0, [esi+64]
95 :     por mm1, [esi+72]
96 :    
97 :     por mm0, [esi+80]
98 :     por mm1, [esi+88]
99 :    
100 :     por mm0, [esi+96]
101 :     por mm1, [esi+104]
102 :    
103 :     por mm0, [esi+112]
104 :     por mm1, [esi+120]
105 :    
106 :     por mm0, mm1
107 :     movq mm1, mm0
108 :     psrlq mm1, 32
109 :     por mm0, mm1
110 :     movd ebx, mm0
111 :    
112 :     add esi, 128
113 :    
114 :     or ebx, ebx
115 :     jz .iterate
116 :    
117 :     ; cbp |= 1 << (edx-1)
118 :    
119 : chenm001 53 ; Change by Chenm001 <chenm001@163.com>
120 :     ;mov ecx, edx
121 :     ;dec ecx
122 :     ;mov ebx, 1
123 :     ;shl ebx, cl
124 :     ;or eax, ebx
125 :     lea ebx,[edx-1]
126 :     bts eax,ebx
127 : Isibaar 3
128 :     .iterate dec edx
129 :     jnz .loop
130 :    
131 :     pop esi
132 :     pop edx
133 :     pop ecx
134 :     pop ebx
135 :    
136 :     ret

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