[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 1382 - (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 1382 ; * $Id: cbp_mmx.asm,v 1.9 2004-03-22 22:36:23 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 :     global _%1
36 :     %define %1 _%1
37 :     %else
38 :     global %1
39 :     %endif
40 : Isibaar 3 %endmacro
41 :    
42 : edgomez 1382 ;=============================================================================
43 :     ; Local data
44 :     ;=============================================================================
45 : Isibaar 3
46 : edgomez 1382 %ifdef FORMAT_COFF
47 :     SECTION .rodata data
48 :     %else
49 :     SECTION .rodata data align=16
50 :     %endif
51 : Isibaar 3
52 : edgomez 1382 ALIGN 16
53 : Isibaar 3
54 : edgomez 1382 ignore_dc:
55 :     dw 0, -1, -1, -1, -1, -1, -1, -1
56 :    
57 :     ;=============================================================================
58 :     ; Code
59 :     ;=============================================================================
60 :    
61 :     SECTION .text
62 :    
63 : Isibaar 262 cglobal calc_cbp_mmx
64 : Isibaar 3
65 : edgomez 1382 ;-----------------------------------------------------------------------------
66 : Isibaar 3 ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
67 : edgomez 1382 ;-----------------------------------------------------------------------------
68 : Isibaar 3
69 : edgomez 1382 ALIGN 16
70 : Isibaar 262 calc_cbp_mmx:
71 : edgomez 1382 push ebx
72 :     push esi
73 : Isibaar 3
74 : edgomez 1382 mov esi, [esp + 8 + 4] ; coeff
75 :     xor eax, eax ; cbp = 0
76 :     mov edx, (1 << 5)
77 : Isibaar 3
78 : edgomez 1382 movq mm7, [ignore_dc]
79 : Isibaar 262
80 : Isibaar 3 .loop
81 : edgomez 1382 movq mm0, [esi]
82 :     movq mm1, [esi+8]
83 :     pand mm0, mm7
84 : Isibaar 3
85 : edgomez 1382 por mm0, [esi+16]
86 :     por mm1, [esi+24]
87 : Isibaar 3
88 : edgomez 1382 por mm0, [esi+32]
89 :     por mm1, [esi+40]
90 : Isibaar 3
91 : edgomez 1382 por mm0, [esi+48]
92 :     por mm1, [esi+56]
93 : Isibaar 3
94 : edgomez 1382 por mm0, [esi+64]
95 :     por mm1, [esi+72]
96 : Isibaar 3
97 : edgomez 1382 por mm0, [esi+80]
98 :     por mm1, [esi+88]
99 : Isibaar 3
100 : edgomez 1382 por mm0, [esi+96]
101 :     por mm1, [esi+104]
102 : Isibaar 3
103 : edgomez 1382 por mm0, [esi+112]
104 :     por mm1, [esi+120]
105 : Isibaar 3
106 : edgomez 1382 por mm0, mm1
107 :     movq mm1, mm0
108 :     psrlq mm1, 32
109 :     lea esi, [esi + 128]
110 : Isibaar 3
111 : edgomez 1382 por mm0, mm1
112 :     movd ebx, mm0
113 : Isibaar 3
114 : edgomez 1382 test ebx, ebx
115 :     jz .next
116 :     or eax, edx ; cbp |= 1 << (5-i)
117 : Isibaar 3
118 : Isibaar 262 .next
119 : edgomez 1382 shr edx,1
120 :     jnc .loop
121 : Isibaar 3
122 : edgomez 1382 pop esi
123 :     pop ebx
124 :    
125 :     ret

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