1 |
;/***************************************************************************** |
;/***************************************************************************** |
2 |
; * |
; * |
3 |
; * XVID MPEG-4 VIDEO CODEC |
; * XVID MPEG-4 VIDEO CODEC |
4 |
; * 3dnow 8x8 block-based halfpel interpolation |
; * - 3dnow 8x8 block-based halfpel interpolation - |
5 |
; * |
; * |
6 |
; * Copyright(C) 2002 Peter Ross <pross@xvid.org> |
; * Copyright(C) 2001 Peter Ross <pross@xvid.org> |
7 |
; * Copyright(C) 2002 Michael Militzer <michael@xvid.org> |
; * 2002 Michael Militzer <isibaar@xvid.org> |
8 |
; * |
; * 2002 Pascal Massimino <skal@planet-d.net> |
|
; * This program is an implementation of a part of one or more MPEG-4 |
|
|
; * 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. |
|
9 |
; * |
; * |
10 |
; * This program is free software; you can redistribute it and/or modify |
; * This program is free software; you can redistribute it and/or modify |
11 |
; * 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 |
23 |
; * |
; * |
24 |
; ****************************************************************************/ |
; ****************************************************************************/ |
25 |
|
|
26 |
bits 32 |
BITS 32 |
27 |
|
|
28 |
%macro cglobal 1 |
%macro cglobal 1 |
29 |
%ifdef PREFIX |
%ifdef PREFIX |
34 |
%endif |
%endif |
35 |
%endmacro |
%endmacro |
36 |
|
|
37 |
section .data |
;============================================================================= |
38 |
|
; Read Only data |
39 |
|
;============================================================================= |
40 |
|
|
41 |
align 16 |
%ifdef FORMAT_COFF |
42 |
|
SECTION .rodata |
43 |
|
%else |
44 |
|
SECTION .rodata align=16 |
45 |
|
%endif |
46 |
|
|
47 |
mmx_one |
ALIGN 16 |
48 |
|
mmx_one: |
49 |
times 8 db 1 |
times 8 db 1 |
50 |
|
|
51 |
section .text |
;============================================================================= |
52 |
|
; Code |
53 |
|
;============================================================================= |
54 |
|
|
55 |
|
SECTION .text |
56 |
|
|
57 |
cglobal interpolate8x8_halfpel_h_3dn |
cglobal interpolate8x8_halfpel_h_3dn |
58 |
cglobal interpolate8x8_halfpel_v_3dn |
cglobal interpolate8x8_halfpel_v_3dn |
59 |
cglobal interpolate8x8_halfpel_hv_3dn |
cglobal interpolate8x8_halfpel_hv_3dn |
60 |
|
|
61 |
|
;----------------------------------------------------------------------------- |
|
;=========================================================================== |
|
62 |
; |
; |
63 |
; void interpolate8x8_halfpel_h_3dn(uint8_t * const dst, |
; void interpolate8x8_halfpel_h_3dn(uint8_t * const dst, |
64 |
; const uint8_t * const src, |
; const uint8_t * const src, |
65 |
; const uint32_t stride, |
; const uint32_t stride, |
66 |
; const uint32_t rounding); |
; const uint32_t rounding); |
67 |
; |
; |
68 |
;=========================================================================== |
;----------------------------------------------------------------------------- |
69 |
|
|
70 |
%macro COPY_H_3DN_RND0 0 |
%macro COPY_H_3DN_RND0 0 |
71 |
movq mm0, [eax] |
movq mm0, [eax] |
97 |
movq [ecx+edx], mm1 |
movq [ecx+edx], mm1 |
98 |
%endmacro |
%endmacro |
99 |
|
|
100 |
align 16 |
ALIGN 16 |
101 |
interpolate8x8_halfpel_h_3dn: |
interpolate8x8_halfpel_h_3dn: |
102 |
|
|
103 |
mov eax, [esp+16] ; rounding |
mov eax, [esp+16] ; rounding |
130 |
ret |
ret |
131 |
|
|
132 |
|
|
133 |
;=========================================================================== |
;----------------------------------------------------------------------------- |
134 |
; |
; |
135 |
; void interpolate8x8_halfpel_v_3dn(uint8_t * const dst, |
; void interpolate8x8_halfpel_v_3dn(uint8_t * const dst, |
136 |
; const uint8_t * const src, |
; const uint8_t * const src, |
137 |
; const uint32_t stride, |
; const uint32_t stride, |
138 |
; const uint32_t rounding); |
; const uint32_t rounding); |
139 |
; |
; |
140 |
;=========================================================================== |
;----------------------------------------------------------------------------- |
141 |
|
|
142 |
%macro COPY_V_3DN_RND0 0 |
%macro COPY_V_3DN_RND0 0 |
143 |
movq mm0, [eax] |
movq mm0, [eax] |
168 |
movq [ecx+edx], mm1 |
movq [ecx+edx], mm1 |
169 |
%endmacro |
%endmacro |
170 |
|
|
171 |
align 16 |
ALIGN 16 |
172 |
interpolate8x8_halfpel_v_3dn: |
interpolate8x8_halfpel_v_3dn: |
173 |
|
|
174 |
mov eax, [esp+16] ; rounding |
mov eax, [esp+16] ; rounding |
206 |
ret |
ret |
207 |
|
|
208 |
|
|
209 |
;=========================================================================== |
;----------------------------------------------------------------------------- |
210 |
; |
; |
211 |
; void interpolate8x8_halfpel_hv_3dn(uint8_t * const dst, |
; void interpolate8x8_halfpel_hv_3dn(uint8_t * const dst, |
212 |
; const uint8_t * const src, |
; const uint8_t * const src, |
214 |
; const uint32_t rounding); |
; const uint32_t rounding); |
215 |
; |
; |
216 |
; |
; |
217 |
;=========================================================================== |
;----------------------------------------------------------------------------- |
218 |
|
|
219 |
; The trick is to correct the result of 'pavgusb' with some combination of the |
; The trick is to correct the result of 'pavgusb' with some combination of the |
220 |
; lsb's of the 4 input values i,j,k,l, and their intermediate 'pavgusb' (s and t). |
; lsb's of the 4 input values i,j,k,l, and their intermediate 'pavgusb' (s and t). |
306 |
movq [ecx], mm0 |
movq [ecx], mm0 |
307 |
%endmacro |
%endmacro |
308 |
|
|
309 |
align 16 |
ALIGN 16 |
310 |
interpolate8x8_halfpel_hv_3dn |
interpolate8x8_halfpel_hv_3dn |
311 |
mov eax, [esp+16] ; rounding |
mov eax, [esp+16] ; rounding |
312 |
mov ecx, [esp+ 4] ; Dst |
mov ecx, [esp+ 4] ; Dst |