Parent Directory | Revision Log
Revision 1.7 - (view) (download)
1 : | Isibaar | 1.1 | ;/************************************************************************** |
2 : | ; * | ||
3 : | edgomez | 1.7 | ; * XVID MPEG-4 VIDEO CODEC |
4 : | ; * mmx cbp calc | ||
5 : | Isibaar | 1.1 | ; * |
6 : | edgomez | 1.7 | ; * This file is part of XviD, a free MPEG-4 video encoder/decoder |
7 : | Isibaar | 1.1 | ; * |
8 : | edgomez | 1.7 | ; * 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 : | ; * Under section 8 of the GNU General Public License, the copyright | ||
23 : | ; * holders of XVID explicitly forbid distribution in the following | ||
24 : | ; * countries: | ||
25 : | ; * | ||
26 : | ; * - Japan | ||
27 : | ; * - United States of America | ||
28 : | ; * | ||
29 : | ; * 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 : | ; * | ||
33 : | ; * 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 : | Isibaar | 1.1 | ; * |
51 : | edgomez | 1.7 | ; * $Id$ |
52 : | Isibaar | 1.1 | ; * |
53 : | ; *************************************************************************/ | ||
54 : | |||
55 : | bits 32 | ||
56 : | |||
57 : | section .data | ||
58 : | |||
59 : | %macro cglobal 1 | ||
60 : | Isibaar | 1.5 | %ifdef PREFIX |
61 : | global _%1 | ||
62 : | %define %1 _%1 | ||
63 : | %else | ||
64 : | global %1 | ||
65 : | %endif | ||
66 : | Isibaar | 1.1 | %endmacro |
67 : | |||
68 : | h | 1.3 | align 16 |
69 : | |||
70 : | ignore_dc dw 0, -1, -1, -1, -1, -1, -1, -1 | ||
71 : | Isibaar | 1.1 | |
72 : | section .text | ||
73 : | |||
74 : | Isibaar | 1.5 | cglobal calc_cbp_mmx |
75 : | Isibaar | 1.1 | |
76 : | ;=========================================================================== | ||
77 : | ; | ||
78 : | ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]); | ||
79 : | ; | ||
80 : | ;=========================================================================== | ||
81 : | |||
82 : | align 16 | ||
83 : | Isibaar | 1.5 | calc_cbp_mmx: |
84 : | push ebx | ||
85 : | push esi | ||
86 : | |||
87 : | mov esi, [esp + 8 + 4] ; coeff | ||
88 : | xor eax, eax ; cbp = 0 | ||
89 : | mov edx, (1 << 5) | ||
90 : | Isibaar | 1.1 | |
91 : | Isibaar | 1.5 | movq mm7, [ignore_dc] |
92 : | Isibaar | 1.1 | |
93 : | .loop | ||
94 : | Isibaar | 1.5 | movq mm0, [esi] |
95 : | movq mm1, [esi+8] | ||
96 : | pand mm0, mm7 | ||
97 : | |||
98 : | por mm0, [esi+16] | ||
99 : | por mm1, [esi+24] | ||
100 : | Isibaar | 1.1 | |
101 : | Isibaar | 1.5 | por mm0, [esi+32] |
102 : | por mm1, [esi+40] | ||
103 : | Isibaar | 1.1 | |
104 : | Isibaar | 1.5 | por mm0, [esi+48] |
105 : | por mm1, [esi+56] | ||
106 : | Isibaar | 1.1 | |
107 : | Isibaar | 1.5 | por mm0, [esi+64] |
108 : | por mm1, [esi+72] | ||
109 : | Isibaar | 1.1 | |
110 : | Isibaar | 1.5 | por mm0, [esi+80] |
111 : | por mm1, [esi+88] | ||
112 : | Isibaar | 1.1 | |
113 : | Isibaar | 1.5 | por mm0, [esi+96] |
114 : | por mm1, [esi+104] | ||
115 : | Isibaar | 1.1 | |
116 : | Isibaar | 1.5 | por mm0, [esi+112] |
117 : | por mm1, [esi+120] | ||
118 : | Isibaar | 1.1 | |
119 : | Isibaar | 1.5 | por mm0, mm1 |
120 : | movq mm1, mm0 | ||
121 : | psrlq mm1, 32 | ||
122 : | lea esi, [esi + 128] | ||
123 : | Isibaar | 1.1 | |
124 : | Isibaar | 1.5 | por mm0, mm1 |
125 : | movd ebx, mm0 | ||
126 : | Isibaar | 1.1 | |
127 : | Isibaar | 1.5 | test ebx, ebx |
128 : | jz .next | ||
129 : | or eax, edx ; cbp |= 1 << (5-i) | ||
130 : | Isibaar | 1.1 | |
131 : | Isibaar | 1.5 | .next |
132 : | shr edx,1 | ||
133 : | jnc .loop | ||
134 : | Isibaar | 1.1 | |
135 : | Isibaar | 1.5 | pop esi |
136 : | pop ebx | ||
137 : | Isibaar | 1.1 | |
138 : | Isibaar | 1.5 | ret |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |