[svn] / branches / release-1_2-branch / xvidcore / src / bitstream / x86_asm / cbp_sse2.asm Repository:
ViewVC logotype

Diff of /branches/release-1_2-branch/xvidcore/src/bitstream/x86_asm/cbp_sse2.asm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 851, Sat Feb 15 15:22:19 2003 UTC revision 1793, Tue Nov 11 20:46:24 2008 UTC
# Line 1  Line 1 
1  ;/**************************************************************************  ;/****************************************************************************
2  ; *  ; *
3  ; *     XVID MPEG-4 VIDEO CODEC  ; *     XVID MPEG-4 VIDEO CODEC
4  ; *     sse2 cbp calc  ; *  - SSE2 CBP computation -
5  ; *  ; *
6  ; *     This program is an implementation of a part of one or more MPEG-4  ; *  Copyright (C) 2002 Daniel Smith <danielsmith@astroboymail.com>
7  ; *     Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  ; *                2002 Pascal Massimino <skal@planet-d.net>
 ; *     to use this software module in hardware or software products are  
 ; *     advised that its use may infringe existing patents or copyrights, and  
 ; *     any such use would be at such party's own risk.  The original  
 ; *     developer of this software module and his/her company, and subsequent  
 ; *     editors and their companies, will have no liability for use of this  
 ; *     software or modifications or derivatives thereof.  
8  ; *  ; *
9  ; *     This program is free software; you can redistribute it and/or modify  ; *     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  ; *     it under the terms of the GNU General Public License as published by
# Line 24  Line 18 
18  ; *  ; *
19  ; *     You should have received a copy of the GNU General Public License  ; *     You should have received a copy of the GNU General Public License
20  ; *     along with this program; if not, write to the Free Software  ; *     along with this program; if not, write to the Free Software
21  ; *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22  ; *  ; *
23  ; *************************************************************************/  ; * $Id: cbp_sse2.asm,v 1.9 2008-11-11 20:46:24 Isibaar Exp $
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
24  ; *  ; *
25  ; * 14.06.2002  cleanup -Skal-  ; ***************************************************************************/
 ; * 24.04.2002  had to use sse2's movdqu instead of movdqa (???)  
 ; * 17.04.2002  initial version (c) 2002 Daniel Smith  
 ; *  
 ; *************************************************************************/  
   
26    
27  bits 32  BITS 32
28    
29  section .data  ;=============================================================================
30    ; Macros
31    ;=============================================================================
32    
33  %macro cglobal 1  %macro cglobal 1
34          %ifdef PREFIX          %ifdef PREFIX
35                    %ifdef MARK_FUNCS
36                            global _%1:function %1.endfunc-%1
37                            %define %1 _%1:function %1.endfunc-%1
38                            %define ENDFUNC .endfunc
39                    %else
40                  global _%1                  global _%1
41                  %define %1 _%1                  %define %1 _%1
42                            %define ENDFUNC
43                    %endif
44            %else
45                    %ifdef MARK_FUNCS
46                            global %1:function %1.endfunc-%1
47                            %define ENDFUNC .endfunc
48          %else          %else
49                  global %1                  global %1
50                            %define ENDFUNC
51                    %endif
52          %endif          %endif
53  %endmacro  %endmacro
54    
 align 16  
   
 ignore_dc       dw              0, -1, -1, -1, -1, -1, -1, -1  
   
 section .text  
   
 cglobal calc_cbp_sse2  
   
 ;===========================================================================  
 ;  
 ; uint32_t calc_cbp_sse2(const int16_t coeff[6][64]);  
 ;  
 ; not enabled - slower than mmx?  
 ;  
 ;===========================================================================  
   
55  %macro LOOP_SSE2 1  %macro LOOP_SSE2 1
56      movdqa      xmm0, [edx+(%1)*128]      movdqa      xmm0, [edx+(%1)*128]
57          pand    xmm0, xmm7          pand    xmm0, xmm7
# Line 88  Line 72 
72          test    ecx, ecx          test    ecx, ecx
73  %endmacro  %endmacro
74    
75  align 16  ;=============================================================================
76    ; Data (Read Only)
77    ;=============================================================================
78    
79    %ifdef FORMAT_COFF
80    SECTION .rodata
81    %else
82    SECTION .rodata align=16
83    %endif
84    
85    ALIGN 16
86    ignore_dc:
87      dw 0, -1, -1, -1, -1, -1, -1, -1
88    
89    ;=============================================================================
90    ; Code
91    ;=============================================================================
92    
93    SECTION .text
94    
95    ;-----------------------------------------------------------------------------
96    ; uint32_t calc_cbp_sse2(const int16_t coeff[6*64]);
97    ;-----------------------------------------------------------------------------
98    
99    ALIGN 16
100    cglobal calc_cbp_sse2
101  calc_cbp_sse2:  calc_cbp_sse2:
102      mov     edx, [esp+4]        ; coeff[]      mov     edx, [esp+4]        ; coeff[]
103      xor         eax, eax                    ; cbp = 0      xor         eax, eax                    ; cbp = 0
# Line 101  Line 109 
109          test ecx, ecx          test ecx, ecx
110          jz              .blk2          jz              .blk2
111      or eax, (1<<5)      or eax, (1<<5)
112  .blk2  
113    .blk2:
114    LOOP_SSE2 1    LOOP_SSE2 1
115          test ecx, ecx          test ecx, ecx
116          jz              .blk3          jz              .blk3
117    or eax, (1<<4)    or eax, (1<<4)
118  .blk3  
119    .blk3:
120    LOOP_SSE2 2    LOOP_SSE2 2
121          test ecx, ecx          test ecx, ecx
122          jz              .blk4          jz              .blk4
123    or eax, (1<<3)    or eax, (1<<3)
124  .blk4  
125    .blk4:
126    LOOP_SSE2 3    LOOP_SSE2 3
127          test ecx, ecx          test ecx, ecx
128          jz              .blk5          jz              .blk5
129    or eax, (1<<2)    or eax, (1<<2)
130  .blk5  
131    .blk5:
132    LOOP_SSE2 4    LOOP_SSE2 4
133          test ecx, ecx          test ecx, ecx
134          jz              .blk6          jz              .blk6
135    or eax, (1<<1)    or eax, (1<<1)
136  .blk6  
137    .blk6:
138    LOOP_SSE2 5    LOOP_SSE2 5
139          test ecx, ecx          test ecx, ecx
140          jz              .finished          jz              .finished
141    or eax, (1<<0)    or eax, (1<<0)
 .finished  
142    
143    .finished:
144    ret    ret
145    ENDFUNC
146    
147    
148    %ifidn __OUTPUT_FORMAT__,elf
149    section ".note.GNU-stack" noalloc noexec nowrite progbits
150    %endif
151    

Legend:
Removed from v.851  
changed lines
  Added in v.1793

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