[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.2, Sun Nov 17 00:57:58 2002 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 file is part of XviD, a free MPEG-4 video encoder/decoder  ; *  Copyright (C) 2002 Daniel Smith <danielsmith@astroboymail.com>
7    ; *                2002 Pascal Massimino <skal@planet-d.net>
8  ; *  ; *
9  ; *  XviD is free software; you can redistribute it and/or modify it  ; *  This program is free software ; you can redistribute it and/or modify
10  ; *  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
11  ; *  the Free Software Foundation; either version 2 of the License, or  ; *  the Free Software Foundation; either version 2 of the License, or
12  ; *  (at your option) any later version.  ; *  (at your option) any later version.
13  ; *  ; *
# Line 19  Line 20 
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22  ; *  ; *
 ; *  Under section 8 of the GNU General Public License, the copyright  
 ; *  holders of XVID explicitly forbid distribution in the following  
 ; *  countries:  
 ; *  
 ; *    - Japan  
 ; *    - United States of America  
 ; *  
 ; *  Linking XviD statically or dynamically with other modules is making a  
 ; *  combined work based on XviD.  Thus, the terms and conditions of the  
 ; *  GNU General Public License cover the whole combination.  
 ; *  
 ; *  As a special exception, the copyright holders of XviD give you  
 ; *  permission to link XviD with independent modules that communicate with  
 ; *  XviD solely through the VFW1.1 and DShow interfaces, regardless of the  
 ; *  license terms of these independent modules, and to copy and distribute  
 ; *  the resulting combined work under terms of your choice, provided that  
 ; *  every copy of the combined work is accompanied by a complete copy of  
 ; *  the source code of XviD (the version of XviD used to produce the  
 ; *  combined work), being distributed under the terms of the GNU General  
 ; *  Public License plus this exception.  An independent module is a module  
 ; *  which is not derived from or based on XviD.  
 ; *  
 ; *  Note that people who make modified versions of XviD are not obligated  
 ; *  to grant this special exception for their modified versions; it is  
 ; *  their choice whether to do so.  The GNU General Public License gives  
 ; *  permission to release a modified version without this exception; this  
 ; *  exception also makes it possible to release a modified version which  
 ; *  carries forward this exception.  
 ; *  
23  ; * $Id$  ; * $Id$
24  ; *  ; *
25  ; *************************************************************************/  ; ***************************************************************************/
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
# Line 65  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 101  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 114  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.2  
changed lines
  Added in v.1.3.2.1

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