3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - 8<->16 bit buffer transfer header - |
* - 8<->16 bit buffer transfer header - |
5 |
* |
* |
6 |
* Copyright(C) 2002 Michael Militzer <isibaar@xvid.org> |
* Copyright(C) 2001-2003 Peter Ross <pross@xvid.org> |
7 |
* |
* |
8 |
* This file is part of XviD, a free MPEG-4 video encoder/decoder |
* 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 |
|
* XviD is free software; you can redistribute it and/or modify it |
|
|
* under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation; either version 2 of the License, or |
* the Free Software Foundation; either version 2 of the License, or |
11 |
* (at your option) any later version. |
* (at your option) any later version. |
12 |
* |
* |
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 |
* |
* |
|
* Under section 8 of the GNU General Public License, the copyright |
|
|
* holders of XVID explicitly forbid distribution in the following |
|
|
* countries: |
|
|
* |
|
|
* - Japan |
|
|
* - United States of America |
|
|
* |
|
|
* Linking XviD statically or dynamically with other modules is making a |
|
|
* combined work based on XviD. Thus, the terms and conditions of the |
|
|
* GNU General Public License cover the whole combination. |
|
|
* |
|
|
* As a special exception, the copyright holders of XviD give you |
|
|
* permission to link XviD with independent modules that communicate with |
|
|
* XviD solely through the VFW1.1 and DShow interfaces, regardless of the |
|
|
* license terms of these independent modules, and to copy and distribute |
|
|
* the resulting combined work under terms of your choice, provided that |
|
|
* every copy of the combined work is accompanied by a complete copy of |
|
|
* the source code of XviD (the version of XviD used to produce the |
|
|
* combined work), being distributed under the terms of the GNU General |
|
|
* Public License plus this exception. An independent module is a module |
|
|
* which is not derived from or based on XviD. |
|
|
* |
|
|
* Note that people who make modified versions of XviD are not obligated |
|
|
* to grant this special exception for their modified versions; it is |
|
|
* their choice whether to do so. The GNU General Public License gives |
|
|
* permission to release a modified version without this exception; this |
|
|
* exception also makes it possible to release a modified version which |
|
|
* carries forward this exception. |
|
|
* |
|
22 |
* $Id$ |
* $Id$ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
40 |
extern TRANSFER_8TO16COPY_PTR transfer_8to16copy; |
extern TRANSFER_8TO16COPY_PTR transfer_8to16copy; |
41 |
|
|
42 |
/* Implemented functions */ |
/* Implemented functions */ |
43 |
TRANSFER_8TO16COPY transfer_8to16copy_c; |
extern TRANSFER_8TO16COPY transfer_8to16copy_c; |
44 |
TRANSFER_8TO16COPY transfer_8to16copy_mmx; |
|
45 |
TRANSFER_8TO16COPY transfer_8to16copy_ia64; |
#ifdef ARCH_IS_IA32 |
46 |
|
extern TRANSFER_8TO16COPY transfer_8to16copy_mmx; |
47 |
|
extern TRANSFER_8TO16COPY transfer_8to16copy_3dne; |
48 |
|
#endif |
49 |
|
|
50 |
|
#ifdef ARCH_IS_IA64 |
51 |
|
extern TRANSFER_8TO16COPY transfer_8to16copy_ia64; |
52 |
|
#endif |
53 |
|
|
54 |
/***************************************************************************** |
/***************************************************************************** |
55 |
* transfer16to8 API |
* transfer16to8 API |
64 |
extern TRANSFER_16TO8COPY_PTR transfer_16to8copy; |
extern TRANSFER_16TO8COPY_PTR transfer_16to8copy; |
65 |
|
|
66 |
/* Implemented functions */ |
/* Implemented functions */ |
67 |
TRANSFER_16TO8COPY transfer_16to8copy_c; |
extern TRANSFER_16TO8COPY transfer_16to8copy_c; |
68 |
TRANSFER_16TO8COPY transfer_16to8copy_mmx; |
|
69 |
TRANSFER_16TO8COPY transfer_16to8copy_ia64; |
#ifdef ARCH_IS_IA32 |
70 |
|
extern TRANSFER_16TO8COPY transfer_16to8copy_mmx; |
71 |
|
extern TRANSFER_16TO8COPY transfer_16to8copy_3dne; |
72 |
|
#endif |
73 |
|
|
74 |
|
#ifdef ARCH_IS_IA64 |
75 |
|
extern TRANSFER_16TO8COPY transfer_16to8copy_ia64; |
76 |
|
#endif |
77 |
|
|
78 |
/***************************************************************************** |
/***************************************************************************** |
79 |
* transfer8to16 + substraction op API |
* transfer8to16 + substraction *writeback* op API |
80 |
****************************************************************************/ |
****************************************************************************/ |
81 |
|
|
82 |
typedef void (TRANSFER_8TO16SUB) (int16_t * const dct, |
typedef void (TRANSFER_8TO16SUB) (int16_t * const dct, |
90 |
extern TRANSFER_8TO16SUB_PTR transfer_8to16sub; |
extern TRANSFER_8TO16SUB_PTR transfer_8to16sub; |
91 |
|
|
92 |
/* Implemented functions */ |
/* Implemented functions */ |
93 |
TRANSFER_8TO16SUB transfer_8to16sub_c; |
extern TRANSFER_8TO16SUB transfer_8to16sub_c; |
94 |
TRANSFER_8TO16SUB transfer_8to16sub_mmx; |
|
95 |
TRANSFER_8TO16SUB transfer_8to16sub_ia64; |
#ifdef ARCH_IS_IA32 |
96 |
|
extern TRANSFER_8TO16SUB transfer_8to16sub_mmx; |
97 |
|
extern TRANSFER_8TO16SUB transfer_8to16sub_3dne; |
98 |
|
#endif |
99 |
|
|
100 |
|
#ifdef ARCH_IS_IA64 |
101 |
|
extern TRANSFER_8TO16SUB transfer_8to16sub_ia64; |
102 |
|
#endif |
103 |
|
|
104 |
|
/***************************************************************************** |
105 |
|
* transfer8to16 + substraction *readonly* op API |
106 |
|
****************************************************************************/ |
107 |
|
|
108 |
|
typedef void (TRANSFER_8TO16SUBRO) (int16_t * const dct, |
109 |
|
const uint8_t * const cur, |
110 |
|
const uint8_t * ref, |
111 |
|
const uint32_t stride); |
112 |
|
|
113 |
|
typedef TRANSFER_8TO16SUBRO *TRANSFER_8TO16SUBRO_PTR; |
114 |
|
|
115 |
|
/* Our global function pointer - Initialized in xvid.c */ |
116 |
|
extern TRANSFER_8TO16SUBRO_PTR transfer_8to16subro; |
117 |
|
|
118 |
|
/* Implemented functions */ |
119 |
|
extern TRANSFER_8TO16SUBRO transfer_8to16subro_c; |
120 |
|
|
121 |
|
#ifdef ARCH_IS_IA32 |
122 |
|
extern TRANSFER_8TO16SUBRO transfer_8to16subro_mmx; |
123 |
|
extern TRANSFER_8TO16SUBRO transfer_8to16subro_3dne; |
124 |
|
#endif |
125 |
|
|
126 |
/***************************************************************************** |
/***************************************************************************** |
127 |
* transfer8to16 + substraction op API - Bidirectionnal Version |
* transfer8to16 + substraction op API - Bidirectionnal Version |
139 |
extern TRANSFER_8TO16SUB2_PTR transfer_8to16sub2; |
extern TRANSFER_8TO16SUB2_PTR transfer_8to16sub2; |
140 |
|
|
141 |
/* Implemented functions */ |
/* Implemented functions */ |
142 |
TRANSFER_8TO16SUB2 transfer_8to16sub2_c; |
extern TRANSFER_8TO16SUB2 transfer_8to16sub2_c; |
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx; |
|
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm; |
|
|
TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64; |
|
143 |
|
|
144 |
|
#ifdef ARCH_IS_IA32 |
145 |
|
extern TRANSFER_8TO16SUB2 transfer_8to16sub2_mmx; |
146 |
|
extern TRANSFER_8TO16SUB2 transfer_8to16sub2_xmm; |
147 |
|
extern TRANSFER_8TO16SUB2 transfer_8to16sub2_3dne; |
148 |
|
#endif |
149 |
|
|
150 |
|
#ifdef ARCH_IS_IA64 |
151 |
|
extern TRANSFER_8TO16SUB2 transfer_8to16sub2_ia64; |
152 |
|
#endif |
153 |
|
|
154 |
/***************************************************************************** |
/***************************************************************************** |
155 |
* transfer16to8 + addition op API |
* transfer16to8 + addition op API |
165 |
extern TRANSFER_16TO8ADD_PTR transfer_16to8add; |
extern TRANSFER_16TO8ADD_PTR transfer_16to8add; |
166 |
|
|
167 |
/* Implemented functions */ |
/* Implemented functions */ |
168 |
TRANSFER_16TO8ADD transfer_16to8add_c; |
extern TRANSFER_16TO8ADD transfer_16to8add_c; |
169 |
TRANSFER_16TO8ADD transfer_16to8add_mmx; |
|
170 |
TRANSFER_16TO8ADD transfer_16to8add_ia64; |
#ifdef ARCH_IS_IA32 |
171 |
|
extern TRANSFER_16TO8ADD transfer_16to8add_mmx; |
172 |
|
extern TRANSFER_16TO8ADD transfer_16to8add_3dne; |
173 |
|
#endif |
174 |
|
|
175 |
|
#ifdef ARCH_IS_IA64 |
176 |
|
extern TRANSFER_16TO8ADD transfer_16to8add_ia64; |
177 |
|
#endif |
178 |
|
|
179 |
/***************************************************************************** |
/***************************************************************************** |
180 |
* transfer8to8 + no op |
* transfer8to8 + no op |
190 |
extern TRANSFER8X8_COPY_PTR transfer8x8_copy; |
extern TRANSFER8X8_COPY_PTR transfer8x8_copy; |
191 |
|
|
192 |
/* Implemented functions */ |
/* Implemented functions */ |
193 |
TRANSFER8X8_COPY transfer8x8_copy_c; |
extern TRANSFER8X8_COPY transfer8x8_copy_c; |
194 |
TRANSFER8X8_COPY transfer8x8_copy_mmx; |
|
195 |
TRANSFER8X8_COPY transfer8x8_copy_ia64; |
#ifdef ARCH_IS_IA32 |
196 |
|
extern TRANSFER8X8_COPY transfer8x8_copy_mmx; |
197 |
|
extern TRANSFER8X8_COPY transfer8x8_copy_3dne; |
198 |
|
#endif |
199 |
|
|
200 |
|
#ifdef ARCH_IS_IA64 |
201 |
|
extern TRANSFER8X8_COPY transfer8x8_copy_ia64; |
202 |
|
#endif |
203 |
|
|
204 |
|
static __inline void |
205 |
|
transfer16x16_copy(uint8_t * const dst, |
206 |
|
const uint8_t * const src, |
207 |
|
const uint32_t stride) |
208 |
|
{ |
209 |
|
transfer8x8_copy(dst, src, stride); |
210 |
|
transfer8x8_copy(dst + 8, src + 8, stride); |
211 |
|
transfer8x8_copy(dst + 8*stride, src + 8*stride, stride); |
212 |
|
transfer8x8_copy(dst + 8*stride + 8, src + 8*stride + 8, stride); |
213 |
|
} |
214 |
|
|
215 |
|
static __inline void |
216 |
|
transfer32x32_copy(uint8_t * const dst, |
217 |
|
const uint8_t * const src, |
218 |
|
const uint32_t stride) |
219 |
|
{ |
220 |
|
transfer16x16_copy(dst, src, stride); |
221 |
|
transfer16x16_copy(dst + 16, src + 16, stride); |
222 |
|
transfer16x16_copy(dst + 16*stride, src + 16*stride, stride); |
223 |
|
transfer16x16_copy(dst + 16*stride + 16, src + 16*stride + 16, stride); |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
#endif |
#endif |