3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - Portable macros, types and inlined assembly - |
* - Portable macros, types and inlined assembly - |
5 |
* |
* |
6 |
* Copyright(C) 2002 Michael Militzer |
* Copyright(C) 2002 Michael Militzer <isibaar@xvid.org> |
7 |
|
* 2002 Peter Ross <pross@xvid.org> |
8 |
|
* 2002 Edouard Gomez <ed.gomez@wanadoo.fr> |
9 |
* |
* |
10 |
* This program is an implementation of a part of one or more MPEG-4 |
* This program is an implementation of a part of one or more MPEG-4 |
11 |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
30 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
31 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
32 |
* |
* |
33 |
* $Id: portab.h,v 1.29 2002-09-22 17:25:13 edgomez Exp $ |
* $Id: portab.h,v 1.34 2002-10-19 12:20:33 edgomez Exp $ |
34 |
* |
* |
35 |
****************************************************************************/ |
****************************************************************************/ |
36 |
|
|
111 |
* Some things that are only architecture dependant |
* Some things that are only architecture dependant |
112 |
****************************************************************************/ |
****************************************************************************/ |
113 |
|
|
114 |
#if defined(ARCH_X86) || defined(ARCH_PPC) || defined(ARCH_MIPS) |
#if defined(ARCH_X86) || defined(ARCH_PPC) || defined(ARCH_MIPS) || defined(ARCH_SPARC) |
115 |
# define CACHE_LINE 16 |
# define CACHE_LINE 16 |
116 |
# define ptr_t uint32_t |
# define ptr_t uint32_t |
117 |
#elif defined(ARCH_IA64) || defined(ARCH_SPARC) |
#elif defined(ARCH_IA64) |
118 |
# define CACHE_LINE 32 |
# define CACHE_LINE 32 |
119 |
# define ptr_t uint64_t |
# define ptr_t uint64_t |
120 |
#else |
#else |
168 |
| msvc x86 specific macros/functions |
| msvc x86 specific macros/functions |
169 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
170 |
# if defined(ARCH_X86) |
# if defined(ARCH_X86) |
171 |
# define BSWAP(a) |
# define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax |
|
__asm { \ |
|
|
mov eax,a \ |
|
|
bswap eax \ |
|
|
mov a, eax \ |
|
|
} |
|
172 |
# define EMMS() __asm {emms} |
# define EMMS() __asm {emms} |
173 |
|
|
174 |
static __inline int64_t read_counter(void) |
static __inline int64_t read_counter(void) |
297 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
298 |
# elif defined(ARCH_SPARC) |
# elif defined(ARCH_SPARC) |
299 |
# define BSWAP(a) \ |
# define BSWAP(a) \ |
300 |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
301 |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
302 |
# define EMMS() |
# define EMMS() |
303 |
|
|
311 |
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
312 |
# elif defined(ARCH_MIPS) |
# elif defined(ARCH_MIPS) |
313 |
# define BSWAP(a) \ |
# define BSWAP(a) \ |
314 |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | |
((a) = (((a) & 0xff) << 24) | (((a) & 0xff00) << 8) | \ |
315 |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
(((a) >> 8) & 0xff00) | (((a) >> 24) & 0xff)) |
316 |
# define EMMS() |
# define EMMS() |
317 |
|
|