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