[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 1535 - (view) (download)

1 : edgomez 1382 ;/****************************************************************************
2 : Isibaar 3 ; *
3 : edgomez 1382 ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * - MMX CBP computation -
5 : Isibaar 3 ; *
6 : edgomez 1382 ; * Copyright (C) 2001-2003 Peter Ross <pross@xvid.org>
7 :     ; * 2002-2003 Pascal Massimino <skal@planet-d.net>
8 : Isibaar 3 ; *
9 : edgomez 1382 ; * 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 : Isibaar 3 ; *
14 : edgomez 1382 ; * 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 : Isibaar 3 ; *
19 : edgomez 1382 ; * 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 3 ; *
23 : edgomez 1535 ; * $Id: cbp_mmx.asm,v 1.11 2004-08-22 11:46:09 edgomez Exp $
24 : Isibaar 3 ; *
25 : edgomez 1382 ; ***************************************************************************/
26 : Isibaar 3
27 : edgomez 1382 BITS 32
28 : edgomez 851
29 : edgomez 1382 ;=============================================================================
30 :     ; Macros
31 :     ;=============================================================================
32 : Isibaar 3
33 :     %macro cglobal 1
34 : Isibaar 262 %ifdef PREFIX
35 : edgomez 1535 %ifdef MARK_FUNCS
36 :     global _%1:function
37 :     %define %1 _%1:function
38 :     %else
39 :     global _%1
40 :     %define %1 _%1
41 :     %endif
42 : Isibaar 262 %else
43 : edgomez 1535 %ifdef MARK_FUNCS
44 :     global %1:function
45 :     %else
46 :     global %1
47 :     %endif
48 : Isibaar 262 %endif
49 : Isibaar 3 %endmacro
50 :    
51 : edgomez 1382 ;=============================================================================
52 :     ; Local data
53 :     ;=============================================================================
54 : Isibaar 3
55 : edgomez 1382 %ifdef FORMAT_COFF
56 : edgomez 1519 SECTION .rodata
57 : edgomez 1382 %else
58 : edgomez 1519 SECTION .rodata align=16
59 : edgomez 1382 %endif
60 : Isibaar 3
61 : edgomez 1382 ALIGN 16
62 : Isibaar 3
63 : edgomez 1382 ignore_dc:
64 :     dw 0, -1, -1, -1, -1, -1, -1, -1
65 :    
66 :     ;=============================================================================
67 :     ; Code
68 :     ;=============================================================================
69 :    
70 :     SECTION .text
71 :    
72 : Isibaar 262 cglobal calc_cbp_mmx
73 : Isibaar 3
74 : edgomez 1382 ;-----------------------------------------------------------------------------
75 : Isibaar 3 ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
76 : edgomez 1382 ;-----------------------------------------------------------------------------
77 : Isibaar 3
78 : edgomez 1382 ALIGN 16
79 : Isibaar 262 calc_cbp_mmx:
80 : edgomez 1382 push ebx
81 :     push esi
82 : Isibaar 3
83 : edgomez 1382 mov esi, [esp + 8 + 4] ; coeff
84 :     xor eax, eax ; cbp = 0
85 :     mov edx, (1 << 5)
86 : Isibaar 3
87 : edgomez 1382 movq mm7, [ignore_dc]
88 : Isibaar 262
89 : Isibaar 3 .loop
90 : edgomez 1382 movq mm0, [esi]
91 :     movq mm1, [esi+8]
92 :     pand mm0, mm7
93 : Isibaar 3
94 : edgomez 1382 por mm0, [esi+16]
95 :     por mm1, [esi+24]
96 : Isibaar 3
97 : edgomez 1382 por mm0, [esi+32]
98 :     por mm1, [esi+40]
99 : Isibaar 3
100 : edgomez 1382 por mm0, [esi+48]
101 :     por mm1, [esi+56]
102 : Isibaar 3
103 : edgomez 1382 por mm0, [esi+64]
104 :     por mm1, [esi+72]
105 : Isibaar 3
106 : edgomez 1382 por mm0, [esi+80]
107 :     por mm1, [esi+88]
108 : Isibaar 3
109 : edgomez 1382 por mm0, [esi+96]
110 :     por mm1, [esi+104]
111 : Isibaar 3
112 : edgomez 1382 por mm0, [esi+112]
113 :     por mm1, [esi+120]
114 : Isibaar 3
115 : edgomez 1382 por mm0, mm1
116 :     movq mm1, mm0
117 :     psrlq mm1, 32
118 :     lea esi, [esi + 128]
119 : Isibaar 3
120 : edgomez 1382 por mm0, mm1
121 :     movd ebx, mm0
122 : Isibaar 3
123 : edgomez 1382 test ebx, ebx
124 :     jz .next
125 :     or eax, edx ; cbp |= 1 << (5-i)
126 : Isibaar 3
127 : Isibaar 262 .next
128 : edgomez 1382 shr edx,1
129 :     jnc .loop
130 : Isibaar 3
131 : edgomez 1382 pop esi
132 :     pop ebx
133 :    
134 :     ret

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