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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (view) (download)

1 : edgomez 1.9 ;/****************************************************************************
2 : Isibaar 1.1 ; *
3 : edgomez 1.9 ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * - MMX CBP computation -
5 : Isibaar 1.1 ; *
6 : edgomez 1.9 ; * Copyright (C) 2001-2003 Peter Ross <pross@xvid.org>
7 :     ; * 2002-2003 Pascal Massimino <skal@planet-d.net>
8 : edgomez 1.8 ; *
9 : edgomez 1.9 ; * This program is free software ; you can redistribute it and/or modify
10 :     ; * it under the terms of the GNU General Public License as published by
11 :     ; * the Free Software Foundation ; either version 2 of the License, or
12 :     ; * (at your option) any later version.
13 : edgomez 1.8 ; *
14 : edgomez 1.9 ; * This program is distributed in the hope that it will be useful,
15 :     ; * but WITHOUT ANY WARRANTY ; without even the implied warranty of
16 :     ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 :     ; * GNU General Public License for more details.
18 : edgomez 1.8 ; *
19 : edgomez 1.9 ; * You should have received a copy of the GNU General Public License
20 :     ; * along with this program ; if not, write to the Free Software
21 :     ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 : Isibaar 1.1 ; *
23 : edgomez 1.9 ; * $Id$
24 : Isibaar 1.1 ; *
25 : edgomez 1.9 ; ***************************************************************************/
26 : edgomez 1.8
27 : edgomez 1.9 BITS 32
28 : Isibaar 1.1
29 : edgomez 1.9 ;=============================================================================
30 :     ; Macros
31 :     ;=============================================================================
32 : Isibaar 1.1
33 :     %macro cglobal 1
34 : Isibaar 1.5 %ifdef PREFIX
35 : edgomez 1.11 %ifdef MARK_FUNCS
36 : edgomez 1.12 global _%1:function %1.endfunc-%1
37 :     %define %1 _%1:function %1.endfunc-%1
38 : edgomez 1.11 %else
39 :     global _%1
40 :     %define %1 _%1
41 :     %endif
42 : Isibaar 1.5 %else
43 : edgomez 1.11 %ifdef MARK_FUNCS
44 : edgomez 1.12 global %1:function %1.endfunc-%1
45 : edgomez 1.11 %else
46 :     global %1
47 :     %endif
48 : Isibaar 1.5 %endif
49 : Isibaar 1.1 %endmacro
50 :    
51 : edgomez 1.9 ;=============================================================================
52 :     ; Local data
53 :     ;=============================================================================
54 :    
55 :     %ifdef FORMAT_COFF
56 : edgomez 1.10 SECTION .rodata
57 : edgomez 1.9 %else
58 : edgomez 1.10 SECTION .rodata align=16
59 : edgomez 1.9 %endif
60 :    
61 :     ALIGN 16
62 :    
63 :     ignore_dc:
64 :     dw 0, -1, -1, -1, -1, -1, -1, -1
65 :    
66 :     ;=============================================================================
67 :     ; Code
68 :     ;=============================================================================
69 : Isibaar 1.1
70 : edgomez 1.9 SECTION .text
71 : Isibaar 1.1
72 : Isibaar 1.5 cglobal calc_cbp_mmx
73 : Isibaar 1.1
74 : edgomez 1.9 ;-----------------------------------------------------------------------------
75 : Isibaar 1.1 ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
76 : edgomez 1.9 ;-----------------------------------------------------------------------------
77 : Isibaar 1.1
78 : edgomez 1.9 ALIGN 16
79 : Isibaar 1.5 calc_cbp_mmx:
80 : edgomez 1.9 push ebx
81 :     push esi
82 : Isibaar 1.5
83 : edgomez 1.9 mov esi, [esp + 8 + 4] ; coeff
84 :     xor eax, eax ; cbp = 0
85 :     mov edx, (1 << 5)
86 : Isibaar 1.1
87 : edgomez 1.9 movq mm7, [ignore_dc]
88 : Isibaar 1.1
89 :     .loop
90 : edgomez 1.9 movq mm0, [esi]
91 :     movq mm1, [esi+8]
92 :     pand mm0, mm7
93 : Isibaar 1.5
94 : edgomez 1.9 por mm0, [esi+16]
95 :     por mm1, [esi+24]
96 : Isibaar 1.1
97 : edgomez 1.9 por mm0, [esi+32]
98 :     por mm1, [esi+40]
99 : Isibaar 1.1
100 : edgomez 1.9 por mm0, [esi+48]
101 :     por mm1, [esi+56]
102 : Isibaar 1.1
103 : edgomez 1.9 por mm0, [esi+64]
104 :     por mm1, [esi+72]
105 : Isibaar 1.1
106 : edgomez 1.9 por mm0, [esi+80]
107 :     por mm1, [esi+88]
108 : Isibaar 1.1
109 : edgomez 1.9 por mm0, [esi+96]
110 :     por mm1, [esi+104]
111 : Isibaar 1.1
112 : edgomez 1.9 por mm0, [esi+112]
113 :     por mm1, [esi+120]
114 : Isibaar 1.1
115 : edgomez 1.9 por mm0, mm1
116 :     movq mm1, mm0
117 :     psrlq mm1, 32
118 :     lea esi, [esi + 128]
119 : Isibaar 1.1
120 : edgomez 1.9 por mm0, mm1
121 :     movd ebx, mm0
122 : Isibaar 1.1
123 : edgomez 1.9 test ebx, ebx
124 :     jz .next
125 :     or eax, edx ; cbp |= 1 << (5-i)
126 : Isibaar 1.1
127 : Isibaar 1.5 .next
128 : edgomez 1.9 shr edx,1
129 :     jnc .loop
130 :    
131 :     pop esi
132 :     pop ebx
133 : Isibaar 1.1
134 : edgomez 1.9 ret
135 : edgomez 1.12 .endfunc
136 :    

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