[svn] / branches / dev-api-4 / xvidcore / src / bitstream / x86_asm / cbp_mmx.asm Repository:
ViewVC logotype

Annotation of /branches/dev-api-4/xvidcore/src/bitstream/x86_asm/cbp_mmx.asm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1192 - (view) (download)

1 : edgomez 1192 ;/****************************************************************************
2 : Isibaar 3 ; *
3 : edgomez 1192 ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * - MMX CBP computation -
5 : Isibaar 3 ; *
6 : edgomez 1192 ; * Copyright (C) 2001-2003 Peter Ross <pross@xvid.org>
7 :     ; * 2002-2003 Pascal Massimino <skal@planet-d.net>
8 : Isibaar 3 ; *
9 : edgomez 1192 ; * 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 1192 ; * 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 1192 ; * 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 1192 ; * $Id: cbp_mmx.asm,v 1.8.2.1 2003-10-28 22:23:03 edgomez Exp $
24 : Isibaar 3 ; *
25 : edgomez 1192 ; ***************************************************************************/
26 : Isibaar 3
27 : edgomez 1192 BITS 32
28 : edgomez 851
29 : edgomez 1192 ;=============================================================================
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 1192 ;=============================================================================
43 :     ; Local data
44 :     ;=============================================================================
45 : Isibaar 3
46 : edgomez 1192 SECTION .rodata
47 : Isibaar 3
48 : edgomez 1192 ALIGN 16
49 : Isibaar 3
50 : edgomez 1192 ignore_dc:
51 :     dw 0, -1, -1, -1, -1, -1, -1, -1
52 :    
53 :     ;=============================================================================
54 :     ; Code
55 :     ;=============================================================================
56 :    
57 :     SECTION .text
58 :    
59 : Isibaar 262 cglobal calc_cbp_mmx
60 : Isibaar 3
61 : edgomez 1192 ;-----------------------------------------------------------------------------
62 : Isibaar 3 ; uint32_t calc_cbp_mmx(const int16_t coeff[6][64]);
63 : edgomez 1192 ;-----------------------------------------------------------------------------
64 : Isibaar 3
65 : edgomez 1192 ALIGN 16
66 : Isibaar 262 calc_cbp_mmx:
67 : edgomez 1192 push ebx
68 :     push esi
69 : Isibaar 3
70 : edgomez 1192 mov esi, [esp + 8 + 4] ; coeff
71 :     xor eax, eax ; cbp = 0
72 :     mov edx, (1 << 5)
73 : Isibaar 3
74 : edgomez 1192 movq mm7, [ignore_dc]
75 : Isibaar 262
76 : Isibaar 3 .loop
77 : edgomez 1192 movq mm0, [esi]
78 :     movq mm1, [esi+8]
79 :     pand mm0, mm7
80 : Isibaar 3
81 : edgomez 1192 por mm0, [esi+16]
82 :     por mm1, [esi+24]
83 : Isibaar 3
84 : edgomez 1192 por mm0, [esi+32]
85 :     por mm1, [esi+40]
86 : Isibaar 3
87 : edgomez 1192 por mm0, [esi+48]
88 :     por mm1, [esi+56]
89 : Isibaar 3
90 : edgomez 1192 por mm0, [esi+64]
91 :     por mm1, [esi+72]
92 : Isibaar 3
93 : edgomez 1192 por mm0, [esi+80]
94 :     por mm1, [esi+88]
95 : Isibaar 3
96 : edgomez 1192 por mm0, [esi+96]
97 :     por mm1, [esi+104]
98 : Isibaar 3
99 : edgomez 1192 por mm0, [esi+112]
100 :     por mm1, [esi+120]
101 : Isibaar 3
102 : edgomez 1192 por mm0, mm1
103 :     movq mm1, mm0
104 :     psrlq mm1, 32
105 :     lea esi, [esi + 128]
106 : Isibaar 3
107 : edgomez 1192 por mm0, mm1
108 :     movd ebx, mm0
109 : Isibaar 3
110 : edgomez 1192 test ebx, ebx
111 :     jz .next
112 :     or eax, edx ; cbp |= 1 << (5-i)
113 : Isibaar 3
114 : Isibaar 262 .next
115 : edgomez 1192 shr edx,1
116 :     jnc .loop
117 : Isibaar 3
118 : edgomez 1192 pop esi
119 :     pop ebx
120 :    
121 :     ret

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