[cvs] / xvidcore / src / bitstream / x86_asm / cbp_sse2.asm Repository:
ViewVC logotype

Diff of /xvidcore/src/bitstream/x86_asm/cbp_sse2.asm

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

revision 1.3, Sat Feb 15 15:22:18 2003 UTC revision 1.3.2.1, Tue Oct 28 22:23:03 2003 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$
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
 ; *  
 ; * 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  
24  ; *  ; *
25  ; *************************************************************************/  ; ***************************************************************************/
26    
27    BITS 32
28    
29  bits 32  ;=============================================================================
30    ; Macros
31  section .data  ;=============================================================================
32    
33  %macro cglobal 1  %macro cglobal 1
34          %ifdef PREFIX          %ifdef PREFIX
# Line 52  Line 39 
39          %endif          %endif
40  %endmacro  %endmacro
41    
 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?  
 ;  
 ;===========================================================================  
   
42  %macro LOOP_SSE2 1  %macro LOOP_SSE2 1
43      movdqa      xmm0, [edx+(%1)*128]      movdqa      xmm0, [edx+(%1)*128]
44          pand    xmm0, xmm7          pand    xmm0, xmm7
# Line 88  Line 59 
59          test    ecx, ecx          test    ecx, ecx
60  %endmacro  %endmacro
61    
62  align 16  ;=============================================================================
63    ; Data (Read Only)
64    ;=============================================================================
65    
66    SECTION .rodata
67    
68    ALIGN 16
69    ignore_dc:
70      dw 0, -1, -1, -1, -1, -1, -1, -1
71    
72    ;=============================================================================
73    ; Code
74    ;=============================================================================
75    
76    SECTION .text
77    
78    ;-----------------------------------------------------------------------------
79    ; uint32_t calc_cbp_sse2(const int16_t coeff[6*64]);
80    ;-----------------------------------------------------------------------------
81    
82    ALIGN 16
83    cglobal calc_cbp_sse2
84  calc_cbp_sse2:  calc_cbp_sse2:
85      mov     edx, [esp+4]        ; coeff[]      mov     edx, [esp+4]        ; coeff[]
86      xor         eax, eax                    ; cbp = 0      xor         eax, eax                    ; cbp = 0
# Line 101  Line 92 
92          test ecx, ecx          test ecx, ecx
93          jz              .blk2          jz              .blk2
94      or eax, (1<<5)      or eax, (1<<5)
95    
96  .blk2  .blk2
97    LOOP_SSE2 1    LOOP_SSE2 1
98          test ecx, ecx          test ecx, ecx
99          jz              .blk3          jz              .blk3
100    or eax, (1<<4)    or eax, (1<<4)
101    
102  .blk3  .blk3
103    LOOP_SSE2 2    LOOP_SSE2 2
104          test ecx, ecx          test ecx, ecx
105          jz              .blk4          jz              .blk4
106    or eax, (1<<3)    or eax, (1<<3)
107    
108  .blk4  .blk4
109    LOOP_SSE2 3    LOOP_SSE2 3
110          test ecx, ecx          test ecx, ecx
111          jz              .blk5          jz              .blk5
112    or eax, (1<<2)    or eax, (1<<2)
113    
114  .blk5  .blk5
115    LOOP_SSE2 4    LOOP_SSE2 4
116          test ecx, ecx          test ecx, ecx
117          jz              .blk6          jz              .blk6
118    or eax, (1<<1)    or eax, (1<<1)
119    
120  .blk6  .blk6
121    LOOP_SSE2 5    LOOP_SSE2 5
122          test ecx, ecx          test ecx, ecx
123          jz              .finished          jz              .finished
124    or eax, (1<<0)    or eax, (1<<0)
 .finished  
125    
126    .finished
127    ret    ret

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.2.1

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