[svn] / trunk / xvidcore / src / utils / x86_asm / interlacing_mmx.asm Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/utils/x86_asm/interlacing_mmx.asm

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

revision 851, Sat Feb 15 15:22:19 2003 UTC revision 1382, Mon Mar 22 22:36:25 2004 UTC
# Line 1  Line 1 
1  ;/**************************************************************************  ;/****************************************************************************
2  ; *  ; *
3  ; *     XVID MPEG-4 VIDEO CODEC  ; *     XVID MPEG-4 VIDEO CODEC
4  ; *     mmx interlacing decision  ; *  - Interlacing Field test -
5  ; *  ; *
6  ; *     This program is an implementation of a part of one or more MPEG-4  ; *  Copyright(C) 2002 Daniel Smith <danielsmith@astroboymail.com>
 ; *     Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  
 ; *     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.  
7  ; *  ; *
8  ; *     This program is free software; you can redistribute it and/or modify  ; *     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  ; *     it under the terms of the GNU General Public License as published by
# Line 24  Line 17 
17  ; *  ; *
18  ; *     You should have received a copy of the GNU General Public License  ; *     You should have received a copy of the GNU General Public License
19  ; *     along with this program; if not, write to the Free Software  ; *     along with this program; if not, write to the Free Software
20  ; *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  ; *  ; *
22  ; *************************************************************************/  ; * $Id: interlacing_mmx.asm,v 1.3 2004-03-22 22:36:24 edgomez Exp $
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
23  ; *  ; *
24  ; * 04.09.2002  initial version; (c)2002 daniel smith  ; ***************************************************************************/
 ; *  
 ; *************************************************************************/  
   
25    
26  bits 32  BITS 32
27    
28  %macro cglobal 1  %macro cglobal 1
29          %ifdef PREFIX          %ifdef PREFIX
# Line 48  Line 34 
34          %endif          %endif
35  %endmacro  %endmacro
36    
37    ;=============================================================================
38    ; Read only data
39    ;=============================================================================
40    
41  section .text  %ifdef FORMAT_COFF
42    SECTION .rodata data
43  cglobal MBFieldTest_mmx  %else
44    SECTION .rodata data align=16
45    %endif
46    
47  ; advances to next block on right  ; advances to next block on right
48  align 16  ALIGN 16
49  nexts   dd 0, 0, 8, 120, 8  nexts:
50            dd 0, 0, 8, 120, 8
51    
52  ; multiply word sums into dwords  ; multiply word sums into dwords
53  align 16  ALIGN 16
54  ones    times 4 dw 1  ones:
55            times 4 dw 1
56    
57    ;=============================================================================
58    ; Code
59    ;=============================================================================
60    
61    SECTION .text
62    
63    cglobal MBFieldTest_mmx
64    
65  ; neater  ; neater
66  %define line0   esi  %define line0   esi
# Line 119  Line 120 
120          paddw   mm7, mm3          paddw   mm7, mm3
121  %endmacro  %endmacro
122    
123  section .text  ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
124  ;  ;
125  ; uint32_t MBFieldTest_mmx(int16_t * const data);  ; uint32_t MBFieldTest_mmx(int16_t * const data);
126  ;  ;
127  ;===========================================================================  ;-----------------------------------------------------------------------------
128    
129  align 16  ALIGN 16
130  MBFieldTest_mmx:  MBFieldTest_mmx:
131    
132          push    esi          push    esi
# Line 142  Line 141 
141    
142          mov             eax, 4                                  ; we do left 8 bytes of data[0*64], then right 8 bytes          mov             eax, 4                                  ; we do left 8 bytes of data[0*64], then right 8 bytes
143                                                                          ; then left 8 bytes of data[1*64], then last 8 bytes                                                                          ; then left 8 bytes of data[1*64], then last 8 bytes
144    .loop:
 _loop:  
145          movq    m00, [line0]                    ; line0          movq    m00, [line0]                    ; line0
146          movq    m01, [line1]                    ; line1          movq    m01, [line1]                    ; line1
147    
# Line 182  Line 180 
180          add             edi, ecx          add             edi, ecx
181    
182          dec             eax          dec             eax
183          jnz             near _loop    jnz near .loop
184    
185  _decide:  .decide:
186          movq    mm0, [ones]                             ; add packed words into single dwords          movq    mm0, [ones]                             ; add packed words into single dwords
187          pmaddwd mm6, mm0          pmaddwd mm6, mm0
188          pmaddwd mm7, mm0          pmaddwd mm7, mm0
# Line 200  Line 198 
198    
199          add             edx, 350                                ; add bias against field decision          add             edx, 350                                ; add bias against field decision
200          cmp             ecx, edx          cmp             ecx, edx
201          jb              _end                                    ; if frame<field, don't use field dct    jb .end                       ; if frame<field, don't use field dct
202          inc             eax                                             ; if frame>=field, use field dct (return 1)          inc             eax                                             ; if frame>=field, use field dct (return 1)
203    
204  _end:  .end:
205          pop             edi          pop             edi
206          pop             esi          pop             esi
207    

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

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