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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1192 - (view) (download)

1 : edgomez 1192 ;/****************************************************************************
2 : edgomez 851 ; *
3 : edgomez 1192 ; * XVID MPEG-4 VIDEO CODEC
4 :     ; * - 3dne CBP computation -
5 : edgomez 851 ; *
6 : edgomez 1192 ; * Copyright (C) 2002 Jaan Kalda
7 : edgomez 851 ; *
8 : edgomez 1192 ; * This program is free software ; you can redistribute it and/or modify
9 :     ; * it under the terms of the GNU General Public License as published by
10 :     ; * the Free Software Foundation ; either version 2 of the License, or
11 :     ; * (at your option) any later version.
12 : edgomez 851 ; *
13 : edgomez 1192 ; * This program is distributed in the hope that it will be useful,
14 :     ; * but WITHOUT ANY WARRANTY ; without even the implied warranty of
15 :     ; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 :     ; * GNU General Public License for more details.
17 : edgomez 851 ; *
18 : edgomez 1192 ; * You should have received a copy of the GNU General Public License
19 :     ; * along with this program ; if not, write to the Free Software
20 :     ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 : edgomez 851 ; *
22 : edgomez 1192 ; * $Id: cbp_3dne.asm,v 1.2.2.1 2003-10-28 22:23:03 edgomez Exp $
23 :     ; *
24 :     ; ***************************************************************************/
25 : edgomez 851
26 : edgomez 1192 ; these 3dne functions are compatible with iSSE, but are optimized
27 :     ; specifically for K7 pipelines
28 : edgomez 851
29 : edgomez 1192 BITS 32
30 : edgomez 851
31 : edgomez 1192 ;=============================================================================
32 :     ; Macros
33 :     ;=============================================================================
34 : edgomez 851
35 :     %macro cglobal 1
36 :     %ifdef PREFIX
37 :     global _%1
38 :     %define %1 _%1
39 :     %else
40 :     global %1
41 :     %endif
42 :     %endmacro
43 :    
44 :    
45 :     %macro calc_cbp 1
46 : edgomez 1192 pshufw mm0, [eax], 229 ; =11100101
47 :     movq mm1, [eax+8]
48 :     por mm0, [eax+64]
49 :     por mm1, [eax+72]
50 :     movq mm2, [eax+16]
51 :     movq mm3, [eax+24]
52 :     por mm2, [eax+80]
53 :     por mm3, [eax+88]
54 :     movq mm4, [eax+32]
55 :     movq mm5, [eax+40]
56 :     por mm4, [eax+96]
57 :     por mm5, [eax+104]
58 :     movq mm6, [eax+48]
59 :     movq mm7, [eax+56]
60 :     por mm6, [eax+112]
61 :     por mm7, [eax+120]
62 :     por mm1, mm0
63 :     %if %1
64 :     sub eax, byte -128 ;ecx ;+= 128; needed 3 bytes for alignment
65 : edgomez 851 %else
66 : edgomez 1192 xor eax, eax
67 :     xor edx, edx
68 :     %endif
69 :     por mm3, mm2
70 :     por mm5, mm4
71 :     por mm7, mm6
72 :     por mm3, mm1
73 :     por mm7, mm5
74 :     por mm7, mm3
75 :     packsswb mm7, mm7
76 :     movd [esp+%1*4], mm7
77 : edgomez 851 %endmacro
78 :    
79 : edgomez 1192 ;=============================================================================
80 :     ; Code
81 :     ;=============================================================================
82 : edgomez 851
83 : edgomez 1192 SECTION .text
84 : edgomez 851
85 : edgomez 1192 cglobal calc_cbp_3dne
86 :    
87 :     ;-----------------------------------------------------------------------------
88 :     ; uint32_t calc_cbp_3dne(const int16_t coeff[6*64]);
89 :     ;-----------------------------------------------------------------------------
90 :     ;AMD K7, in cache: ca 80 clk
91 :    
92 :     ALIGN 16
93 : edgomez 851 calc_cbp_3dne:
94 : edgomez 1192 mov eax, [esp+ 4] ; coeff
95 :     lea esp, [esp-24]
96 : edgomez 851 calc_cbp 5 ;bit 5
97 : edgomez 1192 calc_cbp 4 ;b4
98 : edgomez 851 calc_cbp 3 ;b3
99 :     calc_cbp 2 ;b2
100 :     calc_cbp 1 ;b1
101 :     calc_cbp 0 ;b0
102 : edgomez 1192 cmp eax, [esp+5*4]
103 :     adc eax, eax
104 :     cmp edx, [esp+4*4]
105 :     adc eax, eax
106 :     cmp edx, [esp+3*4]
107 :     adc eax, eax
108 :     cmp edx, [esp+2*4]
109 :     adc eax, eax
110 :     cmp edx, [esp+1*4]
111 :     adc eax, eax
112 :     cmp edx, [esp+0*4]
113 :     adc eax, eax
114 :     add esp, byte 24
115 :     ret

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