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

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

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

revision 1.2, Sat Feb 15 15:22:19 2003 UTC revision 1.8, 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  ; *     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$
   
 ;/**************************************************************************  
 ; *  
 ; *     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
30                    %ifdef MARK_FUNCS
31                            global _%1:function %1.endfunc-%1
32                            %define %1 _%1:function %1.endfunc-%1
33                            %define ENDFUNC .endfunc
34                    %else
35                  global _%1                  global _%1
36                  %define %1 _%1                  %define %1 _%1
37                            %define ENDFUNC
38                    %endif
39            %else
40                    %ifdef MARK_FUNCS
41                            global %1:function %1.endfunc-%1
42                            %define ENDFUNC .endfunc
43          %else          %else
44                  global %1                  global %1
45                            %define ENDFUNC
46                    %endif
47          %endif          %endif
48  %endmacro  %endmacro
49    
50    ;=============================================================================
51    ; Read only data
52    ;=============================================================================
53    
54  section .text  %ifdef FORMAT_COFF
55    SECTION .rodata
56  cglobal MBFieldTest_mmx  %else
57    SECTION .rodata align=16
58    %endif
59    
60  ; advances to next block on right  ; advances to next block on right
61  align 16  ALIGN 16
62  nexts   dd 0, 0, 8, 120, 8  nexts:
63            dd 0, 0, 8, 120, 8
64    
65  ; multiply word sums into dwords  ; multiply word sums into dwords
66  align 16  ALIGN 16
67  ones    times 4 dw 1  ones:
68            times 4 dw 1
69    
70    ;=============================================================================
71    ; Code
72    ;=============================================================================
73    
74    SECTION .text
75    
76    cglobal MBFieldTest_mmx
77    
78  ; neater  ; neater
79  %define line0   esi  %define line0   esi
# Line 119  Line 133 
133          paddw   mm7, mm3          paddw   mm7, mm3
134  %endmacro  %endmacro
135    
136  section .text  ;-----------------------------------------------------------------------------
   
 ;===========================================================================  
137  ;  ;
138  ; uint32_t MBFieldTest_mmx(int16_t * const data);  ; uint32_t MBFieldTest_mmx(int16_t * const data);
139  ;  ;
140  ;===========================================================================  ;-----------------------------------------------------------------------------
141    
142  align 16  ALIGN 16
143  MBFieldTest_mmx:  MBFieldTest_mmx:
144    
145          push    esi          push    esi
# Line 142  Line 154 
154    
155          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
156                                                                          ; then left 8 bytes of data[1*64], then last 8 bytes                                                                          ; then left 8 bytes of data[1*64], then last 8 bytes
157    .loop:
 _loop:  
158          movq    m00, [line0]                    ; line0          movq    m00, [line0]                    ; line0
159          movq    m01, [line1]                    ; line1          movq    m01, [line1]                    ; line1
160    
# Line 182  Line 193 
193          add             edi, ecx          add             edi, ecx
194    
195          dec             eax          dec             eax
196          jnz             near _loop    jnz near .loop
197    
198  _decide:  .decide:
199          movq    mm0, [ones]                             ; add packed words into single dwords          movq    mm0, [ones]                             ; add packed words into single dwords
200          pmaddwd mm6, mm0          pmaddwd mm6, mm0
201          pmaddwd mm7, mm0          pmaddwd mm7, mm0
# Line 200  Line 211 
211    
212          add             edx, 350                                ; add bias against field decision          add             edx, 350                                ; add bias against field decision
213          cmp             ecx, edx          cmp             ecx, edx
214          jb              _end                                    ; if frame<field, don't use field dct    jb .end                       ; if frame<field, don't use field dct
215          inc             eax                                             ; if frame>=field, use field dct (return 1)          inc             eax                                             ; if frame>=field, use field dct (return 1)
216    
217  _end:  .end:
218          pop             edi          pop             edi
219          pop             esi          pop             esi
220    
221          ret          ret
222    ENDFUNC
223    
224    
225    %ifidn __OUTPUT_FORMAT__,elf
226    section ".note.GNU-stack" noalloc noexec nowrite progbits
227    %endif
228    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

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