[svn] / trunk / xvidcore / src / dct / x86_asm / fdct_mmx_ffmpeg.asm Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/dct/x86_asm/fdct_mmx_ffmpeg.asm

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

revision 1794, Fri Nov 14 15:43:28 2008 UTC revision 1795, Wed Nov 26 01:04:34 2008 UTC
# Line 19  Line 19 
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  ; *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  ; *  ; *
22  ; * $Id: fdct_mmx_ffmpeg.asm,v 1.7 2008-11-11 20:46:24 Isibaar Exp $  ; * $Id: fdct_mmx_ffmpeg.asm,v 1.8 2008-11-26 01:04:34 Isibaar Exp $
23  ; *  ; *
24  ; ***************************************************************************/  ; ***************************************************************************/
25    
# Line 42  Line 42 
42  ; *  respective work in order to have a nice/fast mmx fDCT.  ; *  respective work in order to have a nice/fast mmx fDCT.
43  ; ***************************************************************************/  ; ***************************************************************************/
44    
 BITS 32  
   
45  ;=============================================================================  ;=============================================================================
46  ; Macros and other preprocessor constants  ; Macros and other preprocessor constants
47  ;=============================================================================  ;=============================================================================
48    
49  %macro cglobal 1  %include "nasm.inc"
         %ifdef PREFIX  
                 %ifdef MARK_FUNCS  
                         global _%1:function %1.endfunc-%1  
                         %define %1 _%1:function %1.endfunc-%1  
                         %define ENDFUNC .endfunc  
                 %else  
                         global _%1  
                         %define %1 _%1  
                         %define ENDFUNC  
                 %endif  
         %else  
                 %ifdef MARK_FUNCS  
                         global %1:function %1.endfunc-%1  
                         %define ENDFUNC .endfunc  
                 %else  
                         global %1  
                         %define ENDFUNC  
                 %endif  
         %endif  
 %endmacro  
50    
51  ;;; Define this if you want an unrolled version of the code  ;;; Define this if you want an unrolled version of the code
52  %define UNROLLED_LOOP  %define UNROLLED_LOOP
# Line 83  Line 61 
61  ; Local Data (Read Only)  ; Local Data (Read Only)
62  ;=============================================================================  ;=============================================================================
63    
64  %ifdef FORMAT_COFF  DATA
 SECTION .rodata  
 %else  
 SECTION .rodata align=16  
 %endif  
65    
66  ALIGN 8  ALIGN SECTION_ALIGN
67  tab_frw_01234567:  tab_frw_01234567:
68    dw  16384,   16384,   -8867,  -21407    dw  16384,   16384,   -8867,  -21407
69    dw  16384,   16384,   21407,    8867    dw  16384,   16384,   21407,    8867
# Line 163  Line 137 
137    dw  17855,  -31521,   26722,  -31521    dw  17855,  -31521,   26722,  -31521
138    dw   6270,   26722,    6270,  -17855    dw   6270,   26722,    6270,  -17855
139    
140  ALIGN 8  ALIGN SECTION_ALIGN
141  fdct_one_corr:  fdct_one_corr:
142    dw 1, 1, 1, 1    dw 1, 1, 1, 1
143    
144  ALIGN 8  ALIGN SECTION_ALIGN
145  fdct_tg_all_16:  fdct_tg_all_16:
146    dw  13036,    13036,  13036,  13036    dw  13036,    13036,  13036,  13036
147    dw  27146,    27146,  27146,  27146    dw  27146,    27146,  27146,  27146
148    dw -21746, -21746, -21746, -21746    dw -21746, -21746, -21746, -21746
149    
150  ALIGN 8  ALIGN SECTION_ALIGN
151  cos_4_16:  cos_4_16:
152    dw -19195, -19195, -19195, -19195    dw -19195, -19195, -19195, -19195
153    
154  ALIGN 8  ALIGN SECTION_ALIGN
155  ocos_4_16:  ocos_4_16:
156    dw 23170, 23170, 23170, 23170    dw 23170, 23170, 23170, 23170
157    
158  ALIGN 8  ALIGN SECTION_ALIGN
159  fdct_r_row:  fdct_r_row:
160    dd RND_FRW_ROW, RND_FRW_ROW    dd RND_FRW_ROW, RND_FRW_ROW
161    
# Line 375  Line 349 
349  %endmacro  %endmacro
350    
351  %macro MAKE_FDCT_FUNC 2  %macro MAKE_FDCT_FUNC 2
352  ALIGN 16  ALIGN SECTION_ALIGN
353  cglobal %1  cglobal %1
354  %1:  %1:
355          ;; Move the destination/source address to the eax register          ;; Move the destination/source address to the eax register
356    mov eax, [esp + 4]    mov _EAX, prm1
357    
358          ;; Process the columns (4 at a time)          ;; Process the columns (4 at a time)
359    FDCT_COLUMN_COMMON eax, eax, 0 ; columns 0..3    FDCT_COLUMN_COMMON _EAX, _EAX, 0 ; columns 0..3
360    FDCT_COLUMN_COMMON eax, eax, 4 ; columns 4..7    FDCT_COLUMN_COMMON _EAX, _EAX, 4 ; columns 4..7
361    
362  %ifdef UNROLLED_LOOP  %ifdef UNROLLED_LOOP
363          ; Unrolled loop version          ; Unrolled loop version
364  %assign i 0  %assign i 0
365  %rep 8  %rep 8
366          ;; Process the 'i'th row          ;; Process the 'i'th row
367    %2 eax+2*i*8, eax+2*i*8, tab_frw_01234567+2*32*i    %2 _EAX+2*i*8, _EAX+2*i*8, tab_frw_01234567+2*32*i
368          %assign i i+1          %assign i i+1
369  %endrep  %endrep
370  %else  %else
371    mov ecx, 8    mov _ECX, 8
372    mov edx, tab_frw_01234567    mov _EDX, tab_frw_01234567
373  ALIGN 8  ALIGN SECTION_ALIGN
374  .loop  .loop
375    %2 eax, eax, edx    %2 _EAX, _EAX,_EDX
376    add eax, 2*8    add _EAX, 2*8
377    add edx, 2*32    add _EDX, 2*32
378    dec ecx    dec _ECX
379    jne .loop    jne .loop
380  %endif  %endif
381    
# Line 413  Line 387 
387  ; Code  ; Code
388  ;=============================================================================  ;=============================================================================
389    
390  SECTION .text  SECTION .rotext align=SECTION_ALIGN
391    
392  ;-----------------------------------------------------------------------------  ;-----------------------------------------------------------------------------
393  ; void fdct_mmx_ffmpeg(int16_t block[64]);  ; void fdct_mmx_ffmpeg(int16_t block[64]);

Legend:
Removed from v.1794  
changed lines
  Added in v.1795

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