[svn] / trunk / xvidcore / src / bitstream / x86_asm / cbp_mmx.asm Repository:
ViewVC logotype

Annotation of /trunk/xvidcore/src/bitstream/x86_asm/cbp_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (view) (download)

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 :     ; * 24.11.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>
36 :     ; *
37 :     ; *************************************************************************/
38 :    
39 :    
40 :     bits 32
41 :    
42 :     section .data
43 :    
44 :     %macro cglobal 1
45 :     %ifdef PREFIX
46 :     global _%1
47 :     %define %1 _%1
48 :     %else
49 :     global %1
50 :     %endif
51 :     %endmacro
52 :    
53 :     ignore_dc dw 0, -1, -1, -1
54 :    
55 :    
56 :     section .text
57 :    
58 :    
59 :     ;===========================================================================
60 :     ;
61 :     ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
62 :     ;
63 :     ;===========================================================================
64 :    
65 :     align 16
66 :     cglobal calc_cbp_mmx
67 :     calc_cbp_mmx
68 :     push ebx
69 :     push ecx
70 :     push edx
71 :     push esi
72 :    
73 :     mov esi, [esp + 16 + 4] ; coeff
74 :     movq mm7, [ignore_dc]
75 :    
76 :     xor eax, eax ; cbp = 0
77 :     mov edx, 6
78 :     .loop
79 :     movq mm0, [esi]
80 :     pand mm0, mm7
81 :     movq mm1, [esi+8]
82 :    
83 :     por mm0, [esi+16]
84 :     por mm1, [esi+24]
85 :    
86 :     por mm0, [esi+32]
87 :     por mm1, [esi+40]
88 :    
89 :     por mm0, [esi+48]
90 :     por mm1, [esi+56]
91 :    
92 :     por mm0, [esi+64]
93 :     por mm1, [esi+72]
94 :    
95 :     por mm0, [esi+80]
96 :     por mm1, [esi+88]
97 :    
98 :     por mm0, [esi+96]
99 :     por mm1, [esi+104]
100 :    
101 :     por mm0, [esi+112]
102 :     por mm1, [esi+120]
103 :    
104 :     por mm0, mm1
105 :     movq mm1, mm0
106 :     psrlq mm1, 32
107 :     por mm0, mm1
108 :     movd ebx, mm0
109 :    
110 :     add esi, 128
111 :    
112 :     or ebx, ebx
113 :     jz .iterate
114 :    
115 :     ; cbp |= 1 << (edx-1)
116 :    
117 :     mov ecx, edx
118 :     dec ecx
119 :     mov ebx, 1
120 :     shl ebx, cl
121 :     or eax, ebx
122 :    
123 :     .iterate dec edx
124 :     jnz .loop
125 :    
126 :     pop esi
127 :     pop edx
128 :     pop ecx
129 :     pop ebx
130 :    
131 :     ret

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