[svn] / branches / release-1_0-branch / xvidcore / src / bitstream / x86_asm / cbp_mmx.asm Repository:
ViewVC logotype

Annotation of /branches/release-1_0-branch/xvidcore/src/bitstream/x86_asm/cbp_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : Isibaar 3 ;/**************************************************************************
2 :     ; *
3 : edgomez 655 ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * mmx cbp calc
5 : Isibaar 3 ; *
6 : edgomez 655 ; * This file is part of XviD, a free MPEG-4 video encoder/decoder
7 : Isibaar 3 ; *
8 : edgomez 655 ; * 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 : Isibaar 3 ; *
13 : edgomez 655 ; * 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 : Isibaar 3 ; *
18 : edgomez 655 ; * 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 : Isibaar 3 ; *
22 : edgomez 655 ; * Under section 8 of the GNU General Public License, the copyright
23 :     ; * holders of XVID explicitly forbid distribution in the following
24 :     ; * countries:
25 : Isibaar 3 ; *
26 : edgomez 655 ; * - Japan
27 :     ; * - United States of America
28 : Isibaar 3 ; *
29 : edgomez 655 ; * Linking XviD statically or dynamically with other modules is making a
30 :     ; * combined work based on XviD. Thus, the terms and conditions of the
31 :     ; * GNU General Public License cover the whole combination.
32 : Isibaar 3 ; *
33 : edgomez 655 ; * As a special exception, the copyright holders of XviD give you
34 :     ; * permission to link XviD with independent modules that communicate with
35 :     ; * XviD solely through the VFW1.1 and DShow interfaces, regardless of the
36 :     ; * license terms of these independent modules, and to copy and distribute
37 :     ; * the resulting combined work under terms of your choice, provided that
38 :     ; * every copy of the combined work is accompanied by a complete copy of
39 :     ; * the source code of XviD (the version of XviD used to produce the
40 :     ; * combined work), being distributed under the terms of the GNU General
41 :     ; * Public License plus this exception. An independent module is a module
42 :     ; * which is not derived from or based on XviD.
43 :     ; *
44 :     ; * Note that people who make modified versions of XviD are not obligated
45 :     ; * to grant this special exception for their modified versions; it is
46 :     ; * their choice whether to do so. The GNU General Public License gives
47 :     ; * permission to release a modified version without this exception; this
48 :     ; * exception also makes it possible to release a modified version which
49 :     ; * carries forward this exception.
50 :     ; *
51 :     ; * $Id: cbp_mmx.asm,v 1.7 2002-11-17 00:57:57 edgomez Exp $
52 :     ; *
53 : Isibaar 3 ; *************************************************************************/
54 :    
55 :     bits 32
56 :    
57 :     section .data
58 :    
59 :     %macro cglobal 1
60 : Isibaar 262 %ifdef PREFIX
61 :     global _%1
62 :     %define %1 _%1
63 :     %else
64 :     global %1
65 :     %endif
66 : Isibaar 3 %endmacro
67 :    
68 : h 126 align 16
69 : Isibaar 3
70 : h 126 ignore_dc dw 0, -1, -1, -1, -1, -1, -1, -1
71 : Isibaar 3
72 :     section .text
73 :    
74 : Isibaar 262 cglobal calc_cbp_mmx
75 : Isibaar 3
76 :     ;===========================================================================
77 :     ;
78 :     ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
79 :     ;
80 :     ;===========================================================================
81 :    
82 :     align 16
83 : Isibaar 262 calc_cbp_mmx:
84 :     push ebx
85 :     push esi
86 : Isibaar 3
87 : Isibaar 262 mov esi, [esp + 8 + 4] ; coeff
88 :     xor eax, eax ; cbp = 0
89 :     mov edx, (1 << 5)
90 : Isibaar 3
91 : Isibaar 262 movq mm7, [ignore_dc]
92 :    
93 : Isibaar 3 .loop
94 : Isibaar 262 movq mm0, [esi]
95 :     movq mm1, [esi+8]
96 :     pand mm0, mm7
97 : Isibaar 3
98 : Isibaar 262 por mm0, [esi+16]
99 :     por mm1, [esi+24]
100 : Isibaar 3
101 : Isibaar 262 por mm0, [esi+32]
102 :     por mm1, [esi+40]
103 : Isibaar 3
104 : Isibaar 262 por mm0, [esi+48]
105 :     por mm1, [esi+56]
106 : Isibaar 3
107 : Isibaar 262 por mm0, [esi+64]
108 :     por mm1, [esi+72]
109 : Isibaar 3
110 : Isibaar 262 por mm0, [esi+80]
111 :     por mm1, [esi+88]
112 : Isibaar 3
113 : Isibaar 262 por mm0, [esi+96]
114 :     por mm1, [esi+104]
115 : Isibaar 3
116 : Isibaar 262 por mm0, [esi+112]
117 :     por mm1, [esi+120]
118 : Isibaar 3
119 : Isibaar 262 por mm0, mm1
120 :     movq mm1, mm0
121 :     psrlq mm1, 32
122 :     lea esi, [esi + 128]
123 : Isibaar 3
124 : Isibaar 262 por mm0, mm1
125 :     movd ebx, mm0
126 : Isibaar 3
127 : Isibaar 262 test ebx, ebx
128 :     jz .next
129 :     or eax, edx ; cbp |= 1 << (5-i)
130 : Isibaar 3
131 : Isibaar 262 .next
132 :     shr edx,1
133 :     jnc .loop
134 : Isibaar 3
135 : Isibaar 262 pop esi
136 :     pop ebx
137 : Isibaar 3
138 : Isibaar 262 ret

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