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

Diff of /branches/dev-api-4/xvidcore/src/utils/x86_asm/interlacing_mmx.asm

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

revision 886, Fri Feb 21 14:49:29 2003 UTC revision 1192, 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  ; *     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.2.2.1 2003-10-28 22:23:03 edgomez Exp $
   
 ;/**************************************************************************  
 ; *  
 ; *     History:  
 ; *  
 ; * 04.09.2002  initial version; (c)2002 daniel smith  
23  ; *  ; *
24  ; *************************************************************************/  ; ***************************************************************************/
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  SECTION .rodata
   
 cglobal MBFieldTest_mmx  
42    
43  ; advances to next block on right  ; advances to next block on right
44  align 16  ALIGN 16
45  nexts   dd 0, 0, 8, 120, 8  nexts:
46            dd 0, 0, 8, 120, 8
47    
48  ; multiply word sums into dwords  ; multiply word sums into dwords
49  align 16  ALIGN 16
50  ones    times 4 dw 1  ones:
51            times 4 dw 1
52    
53    ;=============================================================================
54    ; Code
55    ;=============================================================================
56    
57    SECTION .text
58    
59    cglobal MBFieldTest_mmx
60    
61  ; neater  ; neater
62  %define line0   esi  %define line0   esi
# Line 119  Line 116 
116          paddw   mm7, mm3          paddw   mm7, mm3
117  %endmacro  %endmacro
118    
119  section .text  ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
120  ;  ;
121  ; uint32_t MBFieldTest_mmx(int16_t * const data);  ; uint32_t MBFieldTest_mmx(int16_t * const data);
122  ;  ;
123  ;===========================================================================  ;-----------------------------------------------------------------------------
124    
125  align 16  ALIGN 16
126  MBFieldTest_mmx:  MBFieldTest_mmx:
127    
128          push    esi          push    esi
# Line 142  Line 137 
137    
138          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
139                                                                          ; then left 8 bytes of data[1*64], then last 8 bytes                                                                          ; then left 8 bytes of data[1*64], then last 8 bytes
140    .loop:
 _loop:  
141          movq    m00, [line0]                    ; line0          movq    m00, [line0]                    ; line0
142          movq    m01, [line1]                    ; line1          movq    m01, [line1]                    ; line1
143    
# Line 182  Line 176 
176          add             edi, ecx          add             edi, ecx
177    
178          dec             eax          dec             eax
179          jnz             near _loop    jnz near .loop
180    
181  _decide:  .decide:
182          movq    mm0, [ones]                             ; add packed words into single dwords          movq    mm0, [ones]                             ; add packed words into single dwords
183          pmaddwd mm6, mm0          pmaddwd mm6, mm0
184          pmaddwd mm7, mm0          pmaddwd mm7, mm0
# Line 200  Line 194 
194    
195          add             edx, 350                                ; add bias against field decision          add             edx, 350                                ; add bias against field decision
196          cmp             ecx, edx          cmp             ecx, edx
197          jb              _end                                    ; if frame<field, don't use field dct    jb .end                       ; if frame<field, don't use field dct
198          inc             eax                                             ; if frame>=field, use field dct (return 1)          inc             eax                                             ; if frame>=field, use field dct (return 1)
199    
200  _end:  .end:
201          pop             edi          pop             edi
202          pop             esi          pop             esi
203    

Legend:
Removed from v.886  
changed lines
  Added in v.1192

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