added mpeg2 library
This commit is contained in:
181
project/jni/mpeg2/include/alpha_asm.h
Normal file
181
project/jni/mpeg2/include/alpha_asm.h
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Alpha assembly macros
|
||||
* Copyright (c) 2002-2003 Falk Hueffner <falk@debian.org>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_ALPHA_ASM_H
|
||||
#define LIBMPEG2_ALPHA_ASM_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#if defined __GNUC__
|
||||
# define GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
# define GNUC_PREREQ(maj, min) 0
|
||||
#endif
|
||||
|
||||
#define AMASK_BWX (1 << 0)
|
||||
#define AMASK_FIX (1 << 1)
|
||||
#define AMASK_CIX (1 << 2)
|
||||
#define AMASK_MVI (1 << 8)
|
||||
|
||||
#ifdef __alpha_bwx__
|
||||
# define HAVE_BWX() 1
|
||||
#else
|
||||
# define HAVE_BWX() (amask(AMASK_BWX) == 0)
|
||||
#endif
|
||||
#ifdef __alpha_fix__
|
||||
# define HAVE_FIX() 1
|
||||
#else
|
||||
# define HAVE_FIX() (amask(AMASK_FIX) == 0)
|
||||
#endif
|
||||
#ifdef __alpha_max__
|
||||
# define HAVE_MVI() 1
|
||||
#else
|
||||
# define HAVE_MVI() (amask(AMASK_MVI) == 0)
|
||||
#endif
|
||||
#ifdef __alpha_cix__
|
||||
# define HAVE_CIX() 1
|
||||
#else
|
||||
# define HAVE_CIX() (amask(AMASK_CIX) == 0)
|
||||
#endif
|
||||
|
||||
inline static uint64_t BYTE_VEC(uint64_t x)
|
||||
{
|
||||
x |= x << 8;
|
||||
x |= x << 16;
|
||||
x |= x << 32;
|
||||
return x;
|
||||
}
|
||||
inline static uint64_t WORD_VEC(uint64_t x)
|
||||
{
|
||||
x |= x << 16;
|
||||
x |= x << 32;
|
||||
return x;
|
||||
}
|
||||
|
||||
#define ldq(p) (*(const uint64_t *) (p))
|
||||
#define ldl(p) (*(const int32_t *) (p))
|
||||
#define stl(l, p) do { *(uint32_t *) (p) = (l); } while (0)
|
||||
#define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
|
||||
#define sextw(x) ((int16_t) (x))
|
||||
|
||||
#ifdef __GNUC__
|
||||
struct unaligned_long { uint64_t l; } __attribute__((packed));
|
||||
#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
|
||||
#define uldq(a) (((const struct unaligned_long *) (a))->l)
|
||||
|
||||
#if GNUC_PREREQ(3,3)
|
||||
#define prefetch(p) __builtin_prefetch((p), 0, 1)
|
||||
#define prefetch_en(p) __builtin_prefetch((p), 0, 0)
|
||||
#define prefetch_m(p) __builtin_prefetch((p), 1, 1)
|
||||
#define prefetch_men(p) __builtin_prefetch((p), 1, 0)
|
||||
#define cmpbge __builtin_alpha_cmpbge
|
||||
/* Avoid warnings. */
|
||||
#define extql(a, b) __builtin_alpha_extql(a, (uint64_t) (b))
|
||||
#define extwl(a, b) __builtin_alpha_extwl(a, (uint64_t) (b))
|
||||
#define extqh(a, b) __builtin_alpha_extqh(a, (uint64_t) (b))
|
||||
#define zap __builtin_alpha_zap
|
||||
#define zapnot __builtin_alpha_zapnot
|
||||
#define amask __builtin_alpha_amask
|
||||
#define implver __builtin_alpha_implver
|
||||
#define rpcc __builtin_alpha_rpcc
|
||||
#else
|
||||
#define prefetch(p) asm volatile("ldl $31,%0" : : "m"(*(const char *) (p)) : "memory")
|
||||
#define prefetch_en(p) asm volatile("ldq $31,%0" : : "m"(*(const char *) (p)) : "memory")
|
||||
#define prefetch_m(p) asm volatile("lds $f31,%0" : : "m"(*(const char *) (p)) : "memory")
|
||||
#define prefetch_men(p) asm volatile("ldt $f31,%0" : : "m"(*(const char *) (p)) : "memory")
|
||||
#define cmpbge(a, b) ({ uint64_t __r; asm ("cmpbge %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
|
||||
#define extql(a, b) ({ uint64_t __r; asm ("extql %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
|
||||
#define extwl(a, b) ({ uint64_t __r; asm ("extwl %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
|
||||
#define extqh(a, b) ({ uint64_t __r; asm ("extqh %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
|
||||
#define zap(a, b) ({ uint64_t __r; asm ("zap %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
|
||||
#define zapnot(a, b) ({ uint64_t __r; asm ("zapnot %r1,%2,%0" : "=r" (__r) : "rJ" (a), "rI" (b)); __r; })
|
||||
#define amask(a) ({ uint64_t __r; asm ("amask %1,%0" : "=r" (__r) : "rI" (a)); __r; })
|
||||
#define implver() ({ uint64_t __r; asm ("implver %0" : "=r" (__r)); __r; })
|
||||
#define rpcc() ({ uint64_t __r; asm volatile ("rpcc %0" : "=r" (__r)); __r; })
|
||||
#endif
|
||||
#define wh64(p) asm volatile("wh64 (%0)" : : "r"(p) : "memory")
|
||||
|
||||
#if GNUC_PREREQ(3,3) && defined(__alpha_max__)
|
||||
#define minub8 __builtin_alpha_minub8
|
||||
#define minsb8 __builtin_alpha_minsb8
|
||||
#define minuw4 __builtin_alpha_minuw4
|
||||
#define minsw4 __builtin_alpha_minsw4
|
||||
#define maxub8 __builtin_alpha_maxub8
|
||||
#define maxsb8 __builtin_alpha_maxsb8
|
||||
#define maxuw4 __builtin_alpha_maxuw4
|
||||
#define maxsw4 __builtin_alpha_maxsw4
|
||||
#define perr __builtin_alpha_perr
|
||||
#define pklb __builtin_alpha_pklb
|
||||
#define pkwb __builtin_alpha_pkwb
|
||||
#define unpkbl __builtin_alpha_unpkbl
|
||||
#define unpkbw __builtin_alpha_unpkbw
|
||||
#else
|
||||
#define minub8(a, b) ({ uint64_t __r; asm (".arch ev6; minub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define minsb8(a, b) ({ uint64_t __r; asm (".arch ev6; minsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define minuw4(a, b) ({ uint64_t __r; asm (".arch ev6; minuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define minsw4(a, b) ({ uint64_t __r; asm (".arch ev6; minsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define maxub8(a, b) ({ uint64_t __r; asm (".arch ev6; maxub8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define maxsb8(a, b) ({ uint64_t __r; asm (".arch ev6; maxsb8 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define maxuw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxuw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define maxsw4(a, b) ({ uint64_t __r; asm (".arch ev6; maxsw4 %r1,%2,%0" : "=r" (__r) : "%rJ" (a), "rI" (b)); __r; })
|
||||
#define perr(a, b) ({ uint64_t __r; asm (".arch ev6; perr %r1,%r2,%0" : "=r" (__r) : "%rJ" (a), "rJ" (b)); __r; })
|
||||
#define pklb(a) ({ uint64_t __r; asm (".arch ev6; pklb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
|
||||
#define pkwb(a) ({ uint64_t __r; asm (".arch ev6; pkwb %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
|
||||
#define unpkbl(a) ({ uint64_t __r; asm (".arch ev6; unpkbl %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
|
||||
#define unpkbw(a) ({ uint64_t __r; asm (".arch ev6; unpkbw %r1,%0" : "=r" (__r) : "rJ" (a)); __r; })
|
||||
#endif
|
||||
|
||||
#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
|
||||
|
||||
#include <c_asm.h>
|
||||
#define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
|
||||
#define uldq(a) (*(const __unaligned uint64_t *) (a))
|
||||
#define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
|
||||
#define extql(a, b) asm ("extql %a0,%a1,%v0", a, b)
|
||||
#define extwl(a, b) asm ("extwl %a0,%a1,%v0", a, b)
|
||||
#define extqh(a, b) asm ("extqh %a0,%a1,%v0", a, b)
|
||||
#define zap(a, b) asm ("zap %a0,%a1,%v0", a, b)
|
||||
#define zapnot(a, b) asm ("zapnot %a0,%a1,%v0", a, b)
|
||||
#define amask(a) asm ("amask %a0,%v0", a)
|
||||
#define implver() asm ("implver %v0")
|
||||
#define rpcc() asm ("rpcc %v0")
|
||||
#define minub8(a, b) asm ("minub8 %a0,%a1,%v0", a, b)
|
||||
#define minsb8(a, b) asm ("minsb8 %a0,%a1,%v0", a, b)
|
||||
#define minuw4(a, b) asm ("minuw4 %a0,%a1,%v0", a, b)
|
||||
#define minsw4(a, b) asm ("minsw4 %a0,%a1,%v0", a, b)
|
||||
#define maxub8(a, b) asm ("maxub8 %a0,%a1,%v0", a, b)
|
||||
#define maxsb8(a, b) asm ("maxsb8 %a0,%a1,%v0", a, b)
|
||||
#define maxuw4(a, b) asm ("maxuw4 %a0,%a1,%v0", a, b)
|
||||
#define maxsw4(a, b) asm ("maxsw4 %a0,%a1,%v0", a, b)
|
||||
#define perr(a, b) asm ("perr %a0,%a1,%v0", a, b)
|
||||
#define pklb(a) asm ("pklb %a0,%v0", a)
|
||||
#define pkwb(a) asm ("pkwb %a0,%v0", a)
|
||||
#define unpkbl(a) asm ("unpkbl %a0,%v0", a)
|
||||
#define unpkbw(a) asm ("unpkbw %a0,%v0", a)
|
||||
#define wh64(a) asm ("wh64 %a0", a)
|
||||
|
||||
#else
|
||||
#error "Unknown compiler!"
|
||||
#endif
|
||||
|
||||
#endif /* LIBMPEG2_ALPHA_ASM_H */
|
||||
42
project/jni/mpeg2/include/attributes.h
Normal file
42
project/jni/mpeg2/include/attributes.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* attributes.h
|
||||
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
|
||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_ATTRIBUTES_H
|
||||
#define LIBMPEG2_ATTRIBUTES_H
|
||||
|
||||
/* use gcc attribs to align critical data structures */
|
||||
#ifdef ATTRIBUTE_ALIGNED_MAX
|
||||
#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
|
||||
#else
|
||||
#define ATTR_ALIGN(align)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BUILTIN_EXPECT
|
||||
#define likely(x) __builtin_expect ((x) != 0, 1)
|
||||
#define unlikely(x) __builtin_expect ((x) != 0, 0)
|
||||
#else
|
||||
#define likely(x) (x)
|
||||
#define unlikely(x) (x)
|
||||
#endif
|
||||
|
||||
#endif /* LIBMPEG2_ATTRIBUTES_H */
|
||||
176
project/jni/mpeg2/include/config.h
Normal file
176
project/jni/mpeg2/include/config.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/* include/config.h. Generated from config.h.in by configure. */
|
||||
/* include/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* autodetect accelerations */
|
||||
#define ACCEL_DETECT
|
||||
|
||||
/* alpha architecture */
|
||||
/* #undef ARCH_ALPHA */
|
||||
|
||||
/* ARM architecture */
|
||||
/* #undef ARCH_ARM */
|
||||
|
||||
/* ppc architecture */
|
||||
/* #undef ARCH_PPC */
|
||||
|
||||
/* sparc architecture */
|
||||
/* #undef ARCH_SPARC */
|
||||
|
||||
/* x86 architecture */
|
||||
/* #undef ARCH_X86 */
|
||||
|
||||
/* maximum supported data alignment */
|
||||
#define ATTRIBUTE_ALIGNED_MAX 64
|
||||
|
||||
/* debug mode configuration */
|
||||
/* #undef DEBUG */
|
||||
|
||||
/* Define to 1 if you have the <altivec.h> header. */
|
||||
/* #undef HAVE_ALTIVEC_H */
|
||||
|
||||
/* Define if you have the `__builtin_expect' function. */
|
||||
#define HAVE_BUILTIN_EXPECT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `ftime' function. */
|
||||
#define HAVE_FTIME 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if the system has the type `struct timeval'. */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/timeb.h> header file. */
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* libvo DirectX support */
|
||||
/* #undef LIBVO_DX */
|
||||
|
||||
/* libvo SDL support */
|
||||
/* #undef LIBVO_SDL */
|
||||
|
||||
/* libvo X11 support */
|
||||
/* #undef LIBVO_X11 */
|
||||
|
||||
/* libvo Xv support */
|
||||
/* #undef LIBVO_XV */
|
||||
|
||||
/* mpeg2dec profiling */
|
||||
/* #undef MPEG2DEC_GPROF */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libmpeg2"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "libmpeg2"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "libmpeg2 0.5.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "libmpeg2"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.5.1"
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* The size of `char', as computed by sizeof. */
|
||||
/* #undef SIZEOF_CHAR */
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
/* #undef SIZEOF_INT */
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
/* #undef SIZEOF_LONG */
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
/* #undef SIZEOF_SHORT */
|
||||
|
||||
/* The size of `void*', as computed by sizeof. */
|
||||
/* #undef SIZEOF_VOIDP */
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.5.1"
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#define X_DISPLAY_MISSING 1
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#define inline __attribute__ ((__always_inline__))
|
||||
#endif
|
||||
|
||||
/* Define as `__restrict' if that's what the C compiler calls it, or to
|
||||
nothing if it is not supported. */
|
||||
/* #undef restrict */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define to empty if the keyword `volatile' does not work. Warning: valid
|
||||
code using `volatile' can become incorrect without. Disable with care. */
|
||||
/* #undef volatile */
|
||||
175
project/jni/mpeg2/include/config.h.in
Normal file
175
project/jni/mpeg2/include/config.h.in
Normal file
@@ -0,0 +1,175 @@
|
||||
/* include/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* autodetect accelerations */
|
||||
#undef ACCEL_DETECT
|
||||
|
||||
/* alpha architecture */
|
||||
#undef ARCH_ALPHA
|
||||
|
||||
/* ARM architecture */
|
||||
#undef ARCH_ARM
|
||||
|
||||
/* ppc architecture */
|
||||
#undef ARCH_PPC
|
||||
|
||||
/* sparc architecture */
|
||||
#undef ARCH_SPARC
|
||||
|
||||
/* x86 architecture */
|
||||
#undef ARCH_X86
|
||||
|
||||
/* maximum supported data alignment */
|
||||
#undef ATTRIBUTE_ALIGNED_MAX
|
||||
|
||||
/* debug mode configuration */
|
||||
#undef DEBUG
|
||||
|
||||
/* Define to 1 if you have the <altivec.h> header. */
|
||||
#undef HAVE_ALTIVEC_H
|
||||
|
||||
/* Define if you have the `__builtin_expect' function. */
|
||||
#undef HAVE_BUILTIN_EXPECT
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `ftime' function. */
|
||||
#undef HAVE_FTIME
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if the system has the type `struct timeval'. */
|
||||
#undef HAVE_STRUCT_TIMEVAL
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/timeb.h> header file. */
|
||||
#undef HAVE_SYS_TIMEB_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#undef HAVE_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* libvo DirectX support */
|
||||
#undef LIBVO_DX
|
||||
|
||||
/* libvo SDL support */
|
||||
#undef LIBVO_SDL
|
||||
|
||||
/* libvo X11 support */
|
||||
#undef LIBVO_X11
|
||||
|
||||
/* libvo Xv support */
|
||||
#undef LIBVO_XV
|
||||
|
||||
/* mpeg2dec profiling */
|
||||
#undef MPEG2DEC_GPROF
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* The size of `char', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `void*', as computed by sizeof. */
|
||||
#undef SIZEOF_VOIDP
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#undef inline
|
||||
#endif
|
||||
|
||||
/* Define as `__restrict' if that's what the C compiler calls it, or to
|
||||
nothing if it is not supported. */
|
||||
#undef restrict
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to empty if the keyword `volatile' does not work. Warning: valid
|
||||
code using `volatile' can become incorrect without. Disable with care. */
|
||||
#undef volatile
|
||||
292
project/jni/mpeg2/include/mmx.h
Normal file
292
project/jni/mpeg2/include/mmx.h
Normal file
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
* mmx.h
|
||||
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
|
||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_MMX_H
|
||||
#define LIBMPEG2_MMX_H
|
||||
|
||||
/*
|
||||
* The type of an value that fits in an MMX register (note that long
|
||||
* long constant values MUST be suffixed by LL and unsigned long long
|
||||
* values by ULL, lest they be truncated by the compiler)
|
||||
*/
|
||||
|
||||
typedef union {
|
||||
long long q; /* Quadword (64-bit) value */
|
||||
unsigned long long uq; /* Unsigned Quadword */
|
||||
int d[2]; /* 2 Doubleword (32-bit) values */
|
||||
unsigned int ud[2]; /* 2 Unsigned Doubleword */
|
||||
short w[4]; /* 4 Word (16-bit) values */
|
||||
unsigned short uw[4]; /* 4 Unsigned Word */
|
||||
char b[8]; /* 8 Byte (8-bit) values */
|
||||
unsigned char ub[8]; /* 8 Unsigned Byte */
|
||||
float s[2]; /* Single-precision (32-bit) value */
|
||||
} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */
|
||||
|
||||
|
||||
#define mmx_i2r(op,imm,reg) \
|
||||
__asm__ __volatile__ (#op " %0, %%" #reg \
|
||||
: /* nothing */ \
|
||||
: "i" (imm) )
|
||||
|
||||
#define mmx_m2r(op,mem,reg) \
|
||||
__asm__ __volatile__ (#op " %0, %%" #reg \
|
||||
: /* nothing */ \
|
||||
: "m" (mem))
|
||||
|
||||
#define mmx_r2m(op,reg,mem) \
|
||||
__asm__ __volatile__ (#op " %%" #reg ", %0" \
|
||||
: "=m" (mem) \
|
||||
: /* nothing */ )
|
||||
|
||||
#define mmx_r2r(op,regs,regd) \
|
||||
__asm__ __volatile__ (#op " %" #regs ", %" #regd)
|
||||
|
||||
|
||||
#define emms() __asm__ __volatile__ ("emms")
|
||||
|
||||
#define movd_m2r(var,reg) mmx_m2r (movd, var, reg)
|
||||
#define movd_r2m(reg,var) mmx_r2m (movd, reg, var)
|
||||
#define movd_v2r(var,reg) __asm__ __volatile__ ("movd %0, %%" #reg \
|
||||
: /* nothing */ \
|
||||
: "rm" (var))
|
||||
#define movd_r2v(reg,var) __asm__ __volatile__ ("movd %%" #reg ", %0" \
|
||||
: "=rm" (var) \
|
||||
: /* nothing */ )
|
||||
|
||||
#define movq_m2r(var,reg) mmx_m2r (movq, var, reg)
|
||||
#define movq_r2m(reg,var) mmx_r2m (movq, reg, var)
|
||||
#define movq_r2r(regs,regd) mmx_r2r (movq, regs, regd)
|
||||
|
||||
#define packssdw_m2r(var,reg) mmx_m2r (packssdw, var, reg)
|
||||
#define packssdw_r2r(regs,regd) mmx_r2r (packssdw, regs, regd)
|
||||
#define packsswb_m2r(var,reg) mmx_m2r (packsswb, var, reg)
|
||||
#define packsswb_r2r(regs,regd) mmx_r2r (packsswb, regs, regd)
|
||||
|
||||
#define packuswb_m2r(var,reg) mmx_m2r (packuswb, var, reg)
|
||||
#define packuswb_r2r(regs,regd) mmx_r2r (packuswb, regs, regd)
|
||||
|
||||
#define paddb_m2r(var,reg) mmx_m2r (paddb, var, reg)
|
||||
#define paddb_r2r(regs,regd) mmx_r2r (paddb, regs, regd)
|
||||
#define paddd_m2r(var,reg) mmx_m2r (paddd, var, reg)
|
||||
#define paddd_r2r(regs,regd) mmx_r2r (paddd, regs, regd)
|
||||
#define paddw_m2r(var,reg) mmx_m2r (paddw, var, reg)
|
||||
#define paddw_r2r(regs,regd) mmx_r2r (paddw, regs, regd)
|
||||
|
||||
#define paddsb_m2r(var,reg) mmx_m2r (paddsb, var, reg)
|
||||
#define paddsb_r2r(regs,regd) mmx_r2r (paddsb, regs, regd)
|
||||
#define paddsw_m2r(var,reg) mmx_m2r (paddsw, var, reg)
|
||||
#define paddsw_r2r(regs,regd) mmx_r2r (paddsw, regs, regd)
|
||||
|
||||
#define paddusb_m2r(var,reg) mmx_m2r (paddusb, var, reg)
|
||||
#define paddusb_r2r(regs,regd) mmx_r2r (paddusb, regs, regd)
|
||||
#define paddusw_m2r(var,reg) mmx_m2r (paddusw, var, reg)
|
||||
#define paddusw_r2r(regs,regd) mmx_r2r (paddusw, regs, regd)
|
||||
|
||||
#define pand_m2r(var,reg) mmx_m2r (pand, var, reg)
|
||||
#define pand_r2r(regs,regd) mmx_r2r (pand, regs, regd)
|
||||
|
||||
#define pandn_m2r(var,reg) mmx_m2r (pandn, var, reg)
|
||||
#define pandn_r2r(regs,regd) mmx_r2r (pandn, regs, regd)
|
||||
|
||||
#define pcmpeqb_m2r(var,reg) mmx_m2r (pcmpeqb, var, reg)
|
||||
#define pcmpeqb_r2r(regs,regd) mmx_r2r (pcmpeqb, regs, regd)
|
||||
#define pcmpeqd_m2r(var,reg) mmx_m2r (pcmpeqd, var, reg)
|
||||
#define pcmpeqd_r2r(regs,regd) mmx_r2r (pcmpeqd, regs, regd)
|
||||
#define pcmpeqw_m2r(var,reg) mmx_m2r (pcmpeqw, var, reg)
|
||||
#define pcmpeqw_r2r(regs,regd) mmx_r2r (pcmpeqw, regs, regd)
|
||||
|
||||
#define pcmpgtb_m2r(var,reg) mmx_m2r (pcmpgtb, var, reg)
|
||||
#define pcmpgtb_r2r(regs,regd) mmx_r2r (pcmpgtb, regs, regd)
|
||||
#define pcmpgtd_m2r(var,reg) mmx_m2r (pcmpgtd, var, reg)
|
||||
#define pcmpgtd_r2r(regs,regd) mmx_r2r (pcmpgtd, regs, regd)
|
||||
#define pcmpgtw_m2r(var,reg) mmx_m2r (pcmpgtw, var, reg)
|
||||
#define pcmpgtw_r2r(regs,regd) mmx_r2r (pcmpgtw, regs, regd)
|
||||
|
||||
#define pmaddwd_m2r(var,reg) mmx_m2r (pmaddwd, var, reg)
|
||||
#define pmaddwd_r2r(regs,regd) mmx_r2r (pmaddwd, regs, regd)
|
||||
|
||||
#define pmulhw_m2r(var,reg) mmx_m2r (pmulhw, var, reg)
|
||||
#define pmulhw_r2r(regs,regd) mmx_r2r (pmulhw, regs, regd)
|
||||
|
||||
#define pmullw_m2r(var,reg) mmx_m2r (pmullw, var, reg)
|
||||
#define pmullw_r2r(regs,regd) mmx_r2r (pmullw, regs, regd)
|
||||
|
||||
#define por_m2r(var,reg) mmx_m2r (por, var, reg)
|
||||
#define por_r2r(regs,regd) mmx_r2r (por, regs, regd)
|
||||
|
||||
#define pslld_i2r(imm,reg) mmx_i2r (pslld, imm, reg)
|
||||
#define pslld_m2r(var,reg) mmx_m2r (pslld, var, reg)
|
||||
#define pslld_r2r(regs,regd) mmx_r2r (pslld, regs, regd)
|
||||
#define psllq_i2r(imm,reg) mmx_i2r (psllq, imm, reg)
|
||||
#define psllq_m2r(var,reg) mmx_m2r (psllq, var, reg)
|
||||
#define psllq_r2r(regs,regd) mmx_r2r (psllq, regs, regd)
|
||||
#define psllw_i2r(imm,reg) mmx_i2r (psllw, imm, reg)
|
||||
#define psllw_m2r(var,reg) mmx_m2r (psllw, var, reg)
|
||||
#define psllw_r2r(regs,regd) mmx_r2r (psllw, regs, regd)
|
||||
|
||||
#define psrad_i2r(imm,reg) mmx_i2r (psrad, imm, reg)
|
||||
#define psrad_m2r(var,reg) mmx_m2r (psrad, var, reg)
|
||||
#define psrad_r2r(regs,regd) mmx_r2r (psrad, regs, regd)
|
||||
#define psraw_i2r(imm,reg) mmx_i2r (psraw, imm, reg)
|
||||
#define psraw_m2r(var,reg) mmx_m2r (psraw, var, reg)
|
||||
#define psraw_r2r(regs,regd) mmx_r2r (psraw, regs, regd)
|
||||
|
||||
#define psrld_i2r(imm,reg) mmx_i2r (psrld, imm, reg)
|
||||
#define psrld_m2r(var,reg) mmx_m2r (psrld, var, reg)
|
||||
#define psrld_r2r(regs,regd) mmx_r2r (psrld, regs, regd)
|
||||
#define psrlq_i2r(imm,reg) mmx_i2r (psrlq, imm, reg)
|
||||
#define psrlq_m2r(var,reg) mmx_m2r (psrlq, var, reg)
|
||||
#define psrlq_r2r(regs,regd) mmx_r2r (psrlq, regs, regd)
|
||||
#define psrlw_i2r(imm,reg) mmx_i2r (psrlw, imm, reg)
|
||||
#define psrlw_m2r(var,reg) mmx_m2r (psrlw, var, reg)
|
||||
#define psrlw_r2r(regs,regd) mmx_r2r (psrlw, regs, regd)
|
||||
|
||||
#define psubb_m2r(var,reg) mmx_m2r (psubb, var, reg)
|
||||
#define psubb_r2r(regs,regd) mmx_r2r (psubb, regs, regd)
|
||||
#define psubd_m2r(var,reg) mmx_m2r (psubd, var, reg)
|
||||
#define psubd_r2r(regs,regd) mmx_r2r (psubd, regs, regd)
|
||||
#define psubw_m2r(var,reg) mmx_m2r (psubw, var, reg)
|
||||
#define psubw_r2r(regs,regd) mmx_r2r (psubw, regs, regd)
|
||||
|
||||
#define psubsb_m2r(var,reg) mmx_m2r (psubsb, var, reg)
|
||||
#define psubsb_r2r(regs,regd) mmx_r2r (psubsb, regs, regd)
|
||||
#define psubsw_m2r(var,reg) mmx_m2r (psubsw, var, reg)
|
||||
#define psubsw_r2r(regs,regd) mmx_r2r (psubsw, regs, regd)
|
||||
|
||||
#define psubusb_m2r(var,reg) mmx_m2r (psubusb, var, reg)
|
||||
#define psubusb_r2r(regs,regd) mmx_r2r (psubusb, regs, regd)
|
||||
#define psubusw_m2r(var,reg) mmx_m2r (psubusw, var, reg)
|
||||
#define psubusw_r2r(regs,regd) mmx_r2r (psubusw, regs, regd)
|
||||
|
||||
#define punpckhbw_m2r(var,reg) mmx_m2r (punpckhbw, var, reg)
|
||||
#define punpckhbw_r2r(regs,regd) mmx_r2r (punpckhbw, regs, regd)
|
||||
#define punpckhdq_m2r(var,reg) mmx_m2r (punpckhdq, var, reg)
|
||||
#define punpckhdq_r2r(regs,regd) mmx_r2r (punpckhdq, regs, regd)
|
||||
#define punpckhwd_m2r(var,reg) mmx_m2r (punpckhwd, var, reg)
|
||||
#define punpckhwd_r2r(regs,regd) mmx_r2r (punpckhwd, regs, regd)
|
||||
|
||||
#define punpcklbw_m2r(var,reg) mmx_m2r (punpcklbw, var, reg)
|
||||
#define punpcklbw_r2r(regs,regd) mmx_r2r (punpcklbw, regs, regd)
|
||||
#define punpckldq_m2r(var,reg) mmx_m2r (punpckldq, var, reg)
|
||||
#define punpckldq_r2r(regs,regd) mmx_r2r (punpckldq, regs, regd)
|
||||
#define punpcklwd_m2r(var,reg) mmx_m2r (punpcklwd, var, reg)
|
||||
#define punpcklwd_r2r(regs,regd) mmx_r2r (punpcklwd, regs, regd)
|
||||
|
||||
#define pxor_m2r(var,reg) mmx_m2r (pxor, var, reg)
|
||||
#define pxor_r2r(regs,regd) mmx_r2r (pxor, regs, regd)
|
||||
|
||||
|
||||
/* 3DNOW extensions */
|
||||
|
||||
#define pavgusb_m2r(var,reg) mmx_m2r (pavgusb, var, reg)
|
||||
#define pavgusb_r2r(regs,regd) mmx_r2r (pavgusb, regs, regd)
|
||||
|
||||
|
||||
/* AMD MMX extensions - also available in intel SSE */
|
||||
|
||||
|
||||
#define mmx_m2ri(op,mem,reg,imm) \
|
||||
__asm__ __volatile__ (#op " %1, %0, %%" #reg \
|
||||
: /* nothing */ \
|
||||
: "m" (mem), "i" (imm))
|
||||
|
||||
#define mmx_r2ri(op,regs,regd,imm) \
|
||||
__asm__ __volatile__ (#op " %0, %%" #regs ", %%" #regd \
|
||||
: /* nothing */ \
|
||||
: "i" (imm) )
|
||||
|
||||
#define mmx_fetch(mem,hint) \
|
||||
__asm__ __volatile__ ("prefetch" #hint " %0" \
|
||||
: /* nothing */ \
|
||||
: "m" (mem))
|
||||
|
||||
|
||||
#define maskmovq(regs,maskreg) mmx_r2ri (maskmovq, regs, maskreg)
|
||||
|
||||
#define movntq_r2m(mmreg,var) mmx_r2m (movntq, mmreg, var)
|
||||
|
||||
#define pavgb_m2r(var,reg) mmx_m2r (pavgb, var, reg)
|
||||
#define pavgb_r2r(regs,regd) mmx_r2r (pavgb, regs, regd)
|
||||
#define pavgw_m2r(var,reg) mmx_m2r (pavgw, var, reg)
|
||||
#define pavgw_r2r(regs,regd) mmx_r2r (pavgw, regs, regd)
|
||||
|
||||
#define pextrw_r2r(mmreg,reg,imm) mmx_r2ri (pextrw, mmreg, reg, imm)
|
||||
|
||||
#define pinsrw_r2r(reg,mmreg,imm) mmx_r2ri (pinsrw, reg, mmreg, imm)
|
||||
|
||||
#define pmaxsw_m2r(var,reg) mmx_m2r (pmaxsw, var, reg)
|
||||
#define pmaxsw_r2r(regs,regd) mmx_r2r (pmaxsw, regs, regd)
|
||||
|
||||
#define pmaxub_m2r(var,reg) mmx_m2r (pmaxub, var, reg)
|
||||
#define pmaxub_r2r(regs,regd) mmx_r2r (pmaxub, regs, regd)
|
||||
|
||||
#define pminsw_m2r(var,reg) mmx_m2r (pminsw, var, reg)
|
||||
#define pminsw_r2r(regs,regd) mmx_r2r (pminsw, regs, regd)
|
||||
|
||||
#define pminub_m2r(var,reg) mmx_m2r (pminub, var, reg)
|
||||
#define pminub_r2r(regs,regd) mmx_r2r (pminub, regs, regd)
|
||||
|
||||
#define pmovmskb(mmreg,reg) \
|
||||
__asm__ __volatile__ ("movmskps %" #mmreg ", %" #reg)
|
||||
|
||||
#define pmulhuw_m2r(var,reg) mmx_m2r (pmulhuw, var, reg)
|
||||
#define pmulhuw_r2r(regs,regd) mmx_r2r (pmulhuw, regs, regd)
|
||||
|
||||
#define prefetcht0(mem) mmx_fetch (mem, t0)
|
||||
#define prefetcht1(mem) mmx_fetch (mem, t1)
|
||||
#define prefetcht2(mem) mmx_fetch (mem, t2)
|
||||
#define prefetchnta(mem) mmx_fetch (mem, nta)
|
||||
|
||||
#define psadbw_m2r(var,reg) mmx_m2r (psadbw, var, reg)
|
||||
#define psadbw_r2r(regs,regd) mmx_r2r (psadbw, regs, regd)
|
||||
|
||||
|
||||
/* SSE2 */
|
||||
|
||||
typedef union {
|
||||
long long q[2]; /* Quadword (64-bit) value */
|
||||
unsigned long long uq[2]; /* Unsigned Quadword */
|
||||
int d[4]; /* 2 Doubleword (32-bit) values */
|
||||
unsigned int ud[4]; /* 2 Unsigned Doubleword */
|
||||
short w[8]; /* 4 Word (16-bit) values */
|
||||
unsigned short uw[8]; /* 4 Unsigned Word */
|
||||
char b[16]; /* 8 Byte (8-bit) values */
|
||||
unsigned char ub[16]; /* 8 Unsigned Byte */
|
||||
float s[4]; /* Single-precision (32-bit) value */
|
||||
} ATTR_ALIGN(16) sse_t; /* On an 16-byte (128-bit) boundary */
|
||||
|
||||
#define movdqu_m2r(var,reg) mmx_m2r (movdqu, var, reg)
|
||||
#define movdqu_r2m(reg,var) mmx_r2m (movdqu, reg, var)
|
||||
#define movdqu_r2r(regs,regd) mmx_r2r (movdqu, regs, regd)
|
||||
#define movdqa_m2r(var,reg) mmx_m2r (movdqa, var, reg)
|
||||
#define movdqa_r2m(reg,var) mmx_r2m (movdqa, reg, var)
|
||||
#define movdqa_r2r(regs,regd) mmx_r2r (movdqa, regs, regd)
|
||||
|
||||
#define pshufd_r2r(regs,regd,imm) mmx_r2ri(pshufd, regs, regd, imm)
|
||||
|
||||
#define pshufw_m2r(var,reg,imm) mmx_m2ri(pshufw, var, reg, imm)
|
||||
#define pshufw_r2r(regs,regd,imm) mmx_r2ri(pshufw, regs, regd, imm)
|
||||
|
||||
#define sfence() __asm__ __volatile__ ("sfence\n\t")
|
||||
|
||||
#endif /* LIBMPEG2_MMX_H */
|
||||
204
project/jni/mpeg2/include/mpeg2.h
Normal file
204
project/jni/mpeg2/include/mpeg2.h
Normal file
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* mpeg2.h
|
||||
* Copyright (C) 2000-2004 Michel Lespinasse <walken@zoy.org>
|
||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_MPEG2_H
|
||||
#define LIBMPEG2_MPEG2_H
|
||||
|
||||
#define MPEG2_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
|
||||
#define MPEG2_RELEASE MPEG2_VERSION (0, 5, 1) /* 0.5.1 */
|
||||
|
||||
#define SEQ_FLAG_MPEG2 1
|
||||
#define SEQ_FLAG_CONSTRAINED_PARAMETERS 2
|
||||
#define SEQ_FLAG_PROGRESSIVE_SEQUENCE 4
|
||||
#define SEQ_FLAG_LOW_DELAY 8
|
||||
#define SEQ_FLAG_COLOUR_DESCRIPTION 16
|
||||
|
||||
#define SEQ_MASK_VIDEO_FORMAT 0xe0
|
||||
#define SEQ_VIDEO_FORMAT_COMPONENT 0
|
||||
#define SEQ_VIDEO_FORMAT_PAL 0x20
|
||||
#define SEQ_VIDEO_FORMAT_NTSC 0x40
|
||||
#define SEQ_VIDEO_FORMAT_SECAM 0x60
|
||||
#define SEQ_VIDEO_FORMAT_MAC 0x80
|
||||
#define SEQ_VIDEO_FORMAT_UNSPECIFIED 0xa0
|
||||
|
||||
typedef struct mpeg2_sequence_s {
|
||||
unsigned int width, height;
|
||||
unsigned int chroma_width, chroma_height;
|
||||
unsigned int byte_rate;
|
||||
unsigned int vbv_buffer_size;
|
||||
uint32_t flags;
|
||||
|
||||
unsigned int picture_width, picture_height;
|
||||
unsigned int display_width, display_height;
|
||||
unsigned int pixel_width, pixel_height;
|
||||
unsigned int frame_period;
|
||||
|
||||
uint8_t profile_level_id;
|
||||
uint8_t colour_primaries;
|
||||
uint8_t transfer_characteristics;
|
||||
uint8_t matrix_coefficients;
|
||||
} mpeg2_sequence_t;
|
||||
|
||||
#define GOP_FLAG_DROP_FRAME 1
|
||||
#define GOP_FLAG_BROKEN_LINK 2
|
||||
#define GOP_FLAG_CLOSED_GOP 4
|
||||
|
||||
typedef struct mpeg2_gop_s {
|
||||
uint8_t hours;
|
||||
uint8_t minutes;
|
||||
uint8_t seconds;
|
||||
uint8_t pictures;
|
||||
uint32_t flags;
|
||||
} mpeg2_gop_t;
|
||||
|
||||
#define PIC_MASK_CODING_TYPE 7
|
||||
#define PIC_FLAG_CODING_TYPE_I 1
|
||||
#define PIC_FLAG_CODING_TYPE_P 2
|
||||
#define PIC_FLAG_CODING_TYPE_B 3
|
||||
#define PIC_FLAG_CODING_TYPE_D 4
|
||||
|
||||
#define PIC_FLAG_TOP_FIELD_FIRST 8
|
||||
#define PIC_FLAG_PROGRESSIVE_FRAME 16
|
||||
#define PIC_FLAG_COMPOSITE_DISPLAY 32
|
||||
#define PIC_FLAG_SKIP 64
|
||||
#define PIC_FLAG_TAGS 128
|
||||
#define PIC_FLAG_REPEAT_FIRST_FIELD 256
|
||||
#define PIC_MASK_COMPOSITE_DISPLAY 0xfffff000
|
||||
|
||||
typedef struct mpeg2_picture_s {
|
||||
unsigned int temporal_reference;
|
||||
unsigned int nb_fields;
|
||||
uint32_t tag, tag2;
|
||||
uint32_t flags;
|
||||
struct {
|
||||
int x, y;
|
||||
} display_offset[3];
|
||||
} mpeg2_picture_t;
|
||||
|
||||
typedef struct mpeg2_fbuf_s {
|
||||
uint8_t * buf[3];
|
||||
void * id;
|
||||
} mpeg2_fbuf_t;
|
||||
|
||||
typedef struct mpeg2_info_s {
|
||||
const mpeg2_sequence_t * sequence;
|
||||
const mpeg2_gop_t * gop;
|
||||
const mpeg2_picture_t * current_picture;
|
||||
const mpeg2_picture_t * current_picture_2nd;
|
||||
const mpeg2_fbuf_t * current_fbuf;
|
||||
const mpeg2_picture_t * display_picture;
|
||||
const mpeg2_picture_t * display_picture_2nd;
|
||||
const mpeg2_fbuf_t * display_fbuf;
|
||||
const mpeg2_fbuf_t * discard_fbuf;
|
||||
const uint8_t * user_data;
|
||||
unsigned int user_data_len;
|
||||
} mpeg2_info_t;
|
||||
|
||||
typedef struct mpeg2dec_s mpeg2dec_t;
|
||||
typedef struct mpeg2_decoder_s mpeg2_decoder_t;
|
||||
|
||||
typedef enum {
|
||||
STATE_BUFFER = 0,
|
||||
STATE_SEQUENCE = 1,
|
||||
STATE_SEQUENCE_REPEATED = 2,
|
||||
STATE_GOP = 3,
|
||||
STATE_PICTURE = 4,
|
||||
STATE_SLICE_1ST = 5,
|
||||
STATE_PICTURE_2ND = 6,
|
||||
STATE_SLICE = 7,
|
||||
STATE_END = 8,
|
||||
STATE_INVALID = 9,
|
||||
STATE_INVALID_END = 10,
|
||||
STATE_SEQUENCE_MODIFIED = 11
|
||||
} mpeg2_state_t;
|
||||
|
||||
typedef struct mpeg2_convert_init_s {
|
||||
unsigned int id_size;
|
||||
unsigned int buf_size[3];
|
||||
void (* start) (void * id, const mpeg2_fbuf_t * fbuf,
|
||||
const mpeg2_picture_t * picture, const mpeg2_gop_t * gop);
|
||||
void (* copy) (void * id, uint8_t * const * src, unsigned int v_offset);
|
||||
} mpeg2_convert_init_t;
|
||||
typedef enum {
|
||||
MPEG2_CONVERT_SET = 0,
|
||||
MPEG2_CONVERT_STRIDE = 1,
|
||||
MPEG2_CONVERT_START = 2
|
||||
} mpeg2_convert_stage_t;
|
||||
typedef int mpeg2_convert_t (int stage, void * id,
|
||||
const mpeg2_sequence_t * sequence, int stride,
|
||||
uint32_t accel, void * arg,
|
||||
mpeg2_convert_init_t * result);
|
||||
int mpeg2_convert (mpeg2dec_t * mpeg2dec, mpeg2_convert_t convert, void * arg);
|
||||
int mpeg2_stride (mpeg2dec_t * mpeg2dec, int stride);
|
||||
void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id);
|
||||
void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf);
|
||||
|
||||
#define MPEG2_ACCEL_X86_MMX 1
|
||||
#define MPEG2_ACCEL_X86_3DNOW 2
|
||||
#define MPEG2_ACCEL_X86_MMXEXT 4
|
||||
#define MPEG2_ACCEL_X86_SSE2 8
|
||||
#define MPEG2_ACCEL_X86_SSE3 16
|
||||
#define MPEG2_ACCEL_PPC_ALTIVEC 1
|
||||
#define MPEG2_ACCEL_ALPHA 1
|
||||
#define MPEG2_ACCEL_ALPHA_MVI 2
|
||||
#define MPEG2_ACCEL_SPARC_VIS 1
|
||||
#define MPEG2_ACCEL_SPARC_VIS2 2
|
||||
#define MPEG2_ACCEL_ARM 1
|
||||
#define MPEG2_ACCEL_DETECT 0x80000000
|
||||
|
||||
uint32_t mpeg2_accel (uint32_t accel);
|
||||
mpeg2dec_t * mpeg2_init (void);
|
||||
const mpeg2_info_t * mpeg2_info (mpeg2dec_t * mpeg2dec);
|
||||
void mpeg2_close (mpeg2dec_t * mpeg2dec);
|
||||
|
||||
void mpeg2_buffer (mpeg2dec_t * mpeg2dec, uint8_t * start, uint8_t * end);
|
||||
int mpeg2_getpos (mpeg2dec_t * mpeg2dec);
|
||||
mpeg2_state_t mpeg2_parse (mpeg2dec_t * mpeg2dec);
|
||||
|
||||
void mpeg2_reset (mpeg2dec_t * mpeg2dec, int full_reset);
|
||||
void mpeg2_skip (mpeg2dec_t * mpeg2dec, int skip);
|
||||
void mpeg2_slice_region (mpeg2dec_t * mpeg2dec, int start, int end);
|
||||
|
||||
void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2);
|
||||
|
||||
void mpeg2_init_fbuf (mpeg2_decoder_t * decoder, uint8_t * current_fbuf[3],
|
||||
uint8_t * forward_fbuf[3], uint8_t * backward_fbuf[3]);
|
||||
void mpeg2_slice (mpeg2_decoder_t * decoder, int code, const uint8_t * buffer);
|
||||
int mpeg2_guess_aspect (const mpeg2_sequence_t * sequence,
|
||||
unsigned int * pixel_width,
|
||||
unsigned int * pixel_height);
|
||||
|
||||
typedef enum {
|
||||
MPEG2_ALLOC_MPEG2DEC = 0,
|
||||
MPEG2_ALLOC_CHUNK = 1,
|
||||
MPEG2_ALLOC_YUV = 2,
|
||||
MPEG2_ALLOC_CONVERT_ID = 3,
|
||||
MPEG2_ALLOC_CONVERTED = 4
|
||||
} mpeg2_alloc_t;
|
||||
|
||||
void * mpeg2_malloc (unsigned size, mpeg2_alloc_t reason);
|
||||
void mpeg2_free (void * buf);
|
||||
void mpeg2_malloc_hooks (void * malloc (unsigned, mpeg2_alloc_t),
|
||||
int free (void *));
|
||||
|
||||
#endif /* LIBMPEG2_MPEG2_H */
|
||||
48
project/jni/mpeg2/include/mpeg2convert.h
Normal file
48
project/jni/mpeg2/include/mpeg2convert.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* mpeg2convert.h
|
||||
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
|
||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_MPEG2CONVERT_H
|
||||
#define LIBMPEG2_MPEG2CONVERT_H
|
||||
|
||||
mpeg2_convert_t mpeg2convert_rgb32;
|
||||
mpeg2_convert_t mpeg2convert_rgb24;
|
||||
mpeg2_convert_t mpeg2convert_rgb16;
|
||||
mpeg2_convert_t mpeg2convert_rgb15;
|
||||
mpeg2_convert_t mpeg2convert_rgb8;
|
||||
mpeg2_convert_t mpeg2convert_bgr32;
|
||||
mpeg2_convert_t mpeg2convert_bgr24;
|
||||
mpeg2_convert_t mpeg2convert_bgr16;
|
||||
mpeg2_convert_t mpeg2convert_bgr15;
|
||||
mpeg2_convert_t mpeg2convert_bgr8;
|
||||
|
||||
typedef enum {
|
||||
MPEG2CONVERT_RGB = 0,
|
||||
MPEG2CONVERT_BGR = 1
|
||||
} mpeg2convert_rgb_order_t;
|
||||
|
||||
mpeg2_convert_t * mpeg2convert_rgb (mpeg2convert_rgb_order_t order,
|
||||
unsigned int bpp);
|
||||
|
||||
mpeg2_convert_t mpeg2convert_uyvy;
|
||||
|
||||
#endif /* LIBMPEG2_MPEG2CONVERT_H */
|
||||
1
project/jni/mpeg2/include/mpeg2dec
Symbolic link
1
project/jni/mpeg2/include/mpeg2dec
Symbolic link
@@ -0,0 +1 @@
|
||||
.
|
||||
1
project/jni/mpeg2/include/stamp-h1
Normal file
1
project/jni/mpeg2/include/stamp-h1
Normal file
@@ -0,0 +1 @@
|
||||
timestamp for include/config.h
|
||||
40
project/jni/mpeg2/include/tendra.h
Normal file
40
project/jni/mpeg2/include/tendra.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* tendra.h
|
||||
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
|
||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_TENDRA_H
|
||||
#define LIBMPEG2_TENDRA_H
|
||||
|
||||
#pragma TenDRA begin
|
||||
#pragma TenDRA longlong type warning
|
||||
|
||||
#ifdef TenDRA_check
|
||||
|
||||
#pragma TenDRA conversion analysis (pointer-int explicit) off
|
||||
#pragma TenDRA implicit function declaration off
|
||||
|
||||
/* avoid the "No declarations in translation unit" problem */
|
||||
int TenDRA;
|
||||
|
||||
#endif /* TenDRA_check */
|
||||
|
||||
#endif /* LIBMPEG2_TENDRA_H */
|
||||
63
project/jni/mpeg2/include/video_out.h
Normal file
63
project/jni/mpeg2/include/video_out.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* video_out.h
|
||||
* Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
|
||||
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_VIDEO_OUT_H
|
||||
#define LIBMPEG2_VIDEO_OUT_H
|
||||
|
||||
struct mpeg2_sequence_s;
|
||||
struct mpeg2_convert_init_s;
|
||||
typedef struct {
|
||||
int (* convert) (int stage, void * id,
|
||||
const struct mpeg2_sequence_s * sequence,
|
||||
int stride, uint32_t accel, void * arg,
|
||||
struct mpeg2_convert_init_s * result);
|
||||
} vo_setup_result_t;
|
||||
|
||||
typedef struct vo_instance_s vo_instance_t;
|
||||
struct vo_instance_s {
|
||||
int (* setup) (vo_instance_t * instance, unsigned int width,
|
||||
unsigned int height, unsigned int chroma_width,
|
||||
unsigned int chroma_height, vo_setup_result_t * result);
|
||||
void (* setup_fbuf) (vo_instance_t * instance, uint8_t ** buf, void ** id);
|
||||
void (* set_fbuf) (vo_instance_t * instance, uint8_t ** buf, void ** id);
|
||||
void (* start_fbuf) (vo_instance_t * instance,
|
||||
uint8_t * const * buf, void * id);
|
||||
void (* draw) (vo_instance_t * instance, uint8_t * const * buf, void * id);
|
||||
void (* discard) (vo_instance_t * instance,
|
||||
uint8_t * const * buf, void * id);
|
||||
void (* close) (vo_instance_t * instance);
|
||||
};
|
||||
|
||||
typedef vo_instance_t * vo_open_t (void);
|
||||
|
||||
typedef struct {
|
||||
const char * name;
|
||||
vo_open_t * open;
|
||||
} vo_driver_t;
|
||||
|
||||
void vo_accel (uint32_t accel);
|
||||
|
||||
/* return NULL terminated array of all drivers */
|
||||
vo_driver_t const * vo_drivers (void);
|
||||
|
||||
#endif /* LIBMPEG2_VIDEO_OUT_H */
|
||||
333
project/jni/mpeg2/include/vis.h
Normal file
333
project/jni/mpeg2/include/vis.h
Normal file
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
* vis.h
|
||||
* Copyright (C) 2003 David S. Miller <davem@redhat.com>
|
||||
*
|
||||
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
|
||||
* See http://libmpeg2.sourceforge.net/ for updates.
|
||||
*
|
||||
* mpeg2dec is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* mpeg2dec is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* You may be asking why I hard-code the instruction opcodes and don't
|
||||
* use the normal VIS assembler mnenomics for the VIS instructions.
|
||||
*
|
||||
* The reason is that Sun, in their infinite wisdom, decided that a binary
|
||||
* using a VIS instruction will cause it to be marked (in the ELF headers)
|
||||
* as doing so, and this prevents the OS from loading such binaries if the
|
||||
* current cpu doesn't have VIS. There is no way to easily override this
|
||||
* behavior of the assembler that I am aware of.
|
||||
*
|
||||
* This totally defeats what libmpeg2 is trying to do which is allow a
|
||||
* single binary to be created, and then detect the availability of VIS
|
||||
* at runtime.
|
||||
*
|
||||
* I'm not saying that tainting the binary by default is bad, rather I'm
|
||||
* saying that not providing a way to override this easily unnecessarily
|
||||
* ties people's hands.
|
||||
*
|
||||
* Thus, we do the opcode encoding by hand and output 32-bit words in
|
||||
* the assembler to keep the binary from becoming tainted.
|
||||
*/
|
||||
|
||||
#ifndef LIBMPEG2_VIS_H
|
||||
#define LIBMPEG2_VIS_H
|
||||
|
||||
#define vis_opc_base ((0x1 << 31) | (0x36 << 19))
|
||||
#define vis_opf(X) ((X) << 5)
|
||||
#define vis_sreg(X) (X)
|
||||
#define vis_dreg(X) (((X)&0x1f)|((X)>>5))
|
||||
#define vis_rs1_s(X) (vis_sreg(X) << 14)
|
||||
#define vis_rs1_d(X) (vis_dreg(X) << 14)
|
||||
#define vis_rs2_s(X) (vis_sreg(X) << 0)
|
||||
#define vis_rs2_d(X) (vis_dreg(X) << 0)
|
||||
#define vis_rd_s(X) (vis_sreg(X) << 25)
|
||||
#define vis_rd_d(X) (vis_dreg(X) << 25)
|
||||
|
||||
#define vis_ss2s(opf,rs1,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs1_s(rs1) | \
|
||||
vis_rs2_s(rs2) | \
|
||||
vis_rd_s(rd)))
|
||||
|
||||
#define vis_dd2d(opf,rs1,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs1_d(rs1) | \
|
||||
vis_rs2_d(rs2) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_ss2d(opf,rs1,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs1_s(rs1) | \
|
||||
vis_rs2_s(rs2) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_sd2d(opf,rs1,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs1_s(rs1) | \
|
||||
vis_rs2_d(rs2) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_d2s(opf,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs2_d(rs2) | \
|
||||
vis_rd_s(rd)))
|
||||
|
||||
#define vis_s2d(opf,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs2_s(rs2) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_d12d(opf,rs1,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs1_d(rs1) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_d22d(opf,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs2_d(rs2) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_s12s(opf,rs1,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs1_s(rs1) | \
|
||||
vis_rd_s(rd)))
|
||||
|
||||
#define vis_s22s(opf,rs2,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rs2_s(rs2) | \
|
||||
vis_rd_s(rd)))
|
||||
|
||||
#define vis_s(opf,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rd_s(rd)))
|
||||
|
||||
#define vis_d(opf,rd) \
|
||||
__asm__ __volatile__ (".word %0" \
|
||||
: : "i" (vis_opc_base | vis_opf(opf) | \
|
||||
vis_rd_d(rd)))
|
||||
|
||||
#define vis_r2m(op,rd,mem) \
|
||||
__asm__ __volatile__ (#op "\t%%f" #rd ", [%0]" : : "r" (&(mem)) )
|
||||
|
||||
#define vis_r2m_2(op,rd,mem1,mem2) \
|
||||
__asm__ __volatile__ (#op "\t%%f" #rd ", [%0 + %1]" : : "r" (mem1), "r" (mem2) )
|
||||
|
||||
#define vis_m2r(op,mem,rd) \
|
||||
__asm__ __volatile__ (#op "\t[%0], %%f" #rd : : "r" (&(mem)) )
|
||||
|
||||
#define vis_m2r_2(op,mem1,mem2,rd) \
|
||||
__asm__ __volatile__ (#op "\t[%0 + %1], %%f" #rd : : "r" (mem1), "r" (mem2) )
|
||||
|
||||
static inline void vis_set_gsr(unsigned int _val)
|
||||
{
|
||||
register unsigned int val asm("g1");
|
||||
|
||||
val = _val;
|
||||
__asm__ __volatile__(".word 0xa7804000"
|
||||
: : "r" (val));
|
||||
}
|
||||
|
||||
#define VIS_GSR_ALIGNADDR_MASK 0x0000007
|
||||
#define VIS_GSR_ALIGNADDR_SHIFT 0
|
||||
#define VIS_GSR_SCALEFACT_MASK 0x0000078
|
||||
#define VIS_GSR_SCALEFACT_SHIFT 3
|
||||
|
||||
#define vis_ld32(mem,rs1) vis_m2r(ld, mem, rs1)
|
||||
#define vis_ld32_2(mem1,mem2,rs1) vis_m2r_2(ld, mem1, mem2, rs1)
|
||||
#define vis_st32(rs1,mem) vis_r2m(st, rs1, mem)
|
||||
#define vis_st32_2(rs1,mem1,mem2) vis_r2m_2(st, rs1, mem1, mem2)
|
||||
#define vis_ld64(mem,rs1) vis_m2r(ldd, mem, rs1)
|
||||
#define vis_ld64_2(mem1,mem2,rs1) vis_m2r_2(ldd, mem1, mem2, rs1)
|
||||
#define vis_st64(rs1,mem) vis_r2m(std, rs1, mem)
|
||||
#define vis_st64_2(rs1,mem1,mem2) vis_r2m_2(std, rs1, mem1, mem2)
|
||||
|
||||
#define vis_ldblk(mem, rd) \
|
||||
do { register void *__mem asm("g1"); \
|
||||
__mem = &(mem); \
|
||||
__asm__ __volatile__(".word 0xc1985e00 | %1" \
|
||||
: \
|
||||
: "r" (__mem), \
|
||||
"i" (vis_rd_d(rd)) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define vis_stblk(rd, mem) \
|
||||
do { register void *__mem asm("g1"); \
|
||||
__mem = &(mem); \
|
||||
__asm__ __volatile__(".word 0xc1b85e00 | %1" \
|
||||
: \
|
||||
: "r" (__mem), \
|
||||
"i" (vis_rd_d(rd)) \
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
#define vis_membar_storestore() \
|
||||
__asm__ __volatile__(".word 0x8143e008" : : : "memory")
|
||||
|
||||
#define vis_membar_sync() \
|
||||
__asm__ __volatile__(".word 0x8143e040" : : : "memory")
|
||||
|
||||
/* 16 and 32 bit partitioned addition and subtraction. The normal
|
||||
* versions perform 4 16-bit or 2 32-bit additions or subtractions.
|
||||
* The 's' versions perform 2 16-bit or 2 32-bit additions or
|
||||
* subtractions.
|
||||
*/
|
||||
|
||||
#define vis_padd16(rs1,rs2,rd) vis_dd2d(0x50, rs1, rs2, rd)
|
||||
#define vis_padd16s(rs1,rs2,rd) vis_ss2s(0x51, rs1, rs2, rd)
|
||||
#define vis_padd32(rs1,rs2,rd) vis_dd2d(0x52, rs1, rs2, rd)
|
||||
#define vis_padd32s(rs1,rs2,rd) vis_ss2s(0x53, rs1, rs2, rd)
|
||||
#define vis_psub16(rs1,rs2,rd) vis_dd2d(0x54, rs1, rs2, rd)
|
||||
#define vis_psub16s(rs1,rs2,rd) vis_ss2s(0x55, rs1, rs2, rd)
|
||||
#define vis_psub32(rs1,rs2,rd) vis_dd2d(0x56, rs1, rs2, rd)
|
||||
#define vis_psub32s(rs1,rs2,rd) vis_ss2s(0x57, rs1, rs2, rd)
|
||||
|
||||
/* Pixel formatting instructions. */
|
||||
|
||||
#define vis_pack16(rs2,rd) vis_d2s( 0x3b, rs2, rd)
|
||||
#define vis_pack32(rs1,rs2,rd) vis_dd2d(0x3a, rs1, rs2, rd)
|
||||
#define vis_packfix(rs2,rd) vis_d2s( 0x3d, rs2, rd)
|
||||
#define vis_expand(rs2,rd) vis_s2d( 0x4d, rs2, rd)
|
||||
#define vis_pmerge(rs1,rs2,rd) vis_ss2d(0x4b, rs1, rs2, rd)
|
||||
|
||||
/* Partitioned multiply instructions. */
|
||||
|
||||
#define vis_mul8x16(rs1,rs2,rd) vis_sd2d(0x31, rs1, rs2, rd)
|
||||
#define vis_mul8x16au(rs1,rs2,rd) vis_ss2d(0x33, rs1, rs2, rd)
|
||||
#define vis_mul8x16al(rs1,rs2,rd) vis_ss2d(0x35, rs1, rs2, rd)
|
||||
#define vis_mul8sux16(rs1,rs2,rd) vis_dd2d(0x36, rs1, rs2, rd)
|
||||
#define vis_mul8ulx16(rs1,rs2,rd) vis_dd2d(0x37, rs1, rs2, rd)
|
||||
#define vis_muld8sux16(rs1,rs2,rd) vis_ss2d(0x38, rs1, rs2, rd)
|
||||
#define vis_muld8ulx16(rs1,rs2,rd) vis_ss2d(0x39, rs1, rs2, rd)
|
||||
|
||||
/* Alignment instructions. */
|
||||
|
||||
static inline void *vis_alignaddr(void *_ptr)
|
||||
{
|
||||
register void *ptr asm("g1");
|
||||
|
||||
ptr = _ptr;
|
||||
|
||||
__asm__ __volatile__(".word %2"
|
||||
: "=&r" (ptr)
|
||||
: "0" (ptr),
|
||||
"i" (vis_opc_base | vis_opf(0x18) |
|
||||
vis_rs1_s(1) |
|
||||
vis_rs2_s(0) |
|
||||
vis_rd_s(1)));
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static inline void vis_alignaddr_g0(void *_ptr)
|
||||
{
|
||||
register void *ptr asm("g1");
|
||||
|
||||
ptr = _ptr;
|
||||
|
||||
__asm__ __volatile__(".word %2"
|
||||
: "=&r" (ptr)
|
||||
: "0" (ptr),
|
||||
"i" (vis_opc_base | vis_opf(0x18) |
|
||||
vis_rs1_s(1) |
|
||||
vis_rs2_s(0) |
|
||||
vis_rd_s(0)));
|
||||
}
|
||||
|
||||
static inline void *vis_alignaddrl(void *_ptr)
|
||||
{
|
||||
register void *ptr asm("g1");
|
||||
|
||||
ptr = _ptr;
|
||||
|
||||
__asm__ __volatile__(".word %2"
|
||||
: "=&r" (ptr)
|
||||
: "0" (ptr),
|
||||
"i" (vis_opc_base | vis_opf(0x19) |
|
||||
vis_rs1_s(1) |
|
||||
vis_rs2_s(0) |
|
||||
vis_rd_s(1)));
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static inline void vis_alignaddrl_g0(void *_ptr)
|
||||
{
|
||||
register void *ptr asm("g1");
|
||||
|
||||
ptr = _ptr;
|
||||
|
||||
__asm__ __volatile__(".word %2"
|
||||
: "=&r" (ptr)
|
||||
: "0" (ptr),
|
||||
"i" (vis_opc_base | vis_opf(0x19) |
|
||||
vis_rs1_s(1) |
|
||||
vis_rs2_s(0) |
|
||||
vis_rd_s(0)));
|
||||
}
|
||||
|
||||
#define vis_faligndata(rs1,rs2,rd) vis_dd2d(0x48, rs1, rs2, rd)
|
||||
|
||||
/* Logical operate instructions. */
|
||||
|
||||
#define vis_fzero(rd) vis_d( 0x60, rd)
|
||||
#define vis_fzeros(rd) vis_s( 0x61, rd)
|
||||
#define vis_fone(rd) vis_d( 0x7e, rd)
|
||||
#define vis_fones(rd) vis_s( 0x7f, rd)
|
||||
#define vis_src1(rs1,rd) vis_d12d(0x74, rs1, rd)
|
||||
#define vis_src1s(rs1,rd) vis_s12s(0x75, rs1, rd)
|
||||
#define vis_src2(rs2,rd) vis_d22d(0x78, rs2, rd)
|
||||
#define vis_src2s(rs2,rd) vis_s22s(0x79, rs2, rd)
|
||||
#define vis_not1(rs1,rd) vis_d12d(0x6a, rs1, rd)
|
||||
#define vis_not1s(rs1,rd) vis_s12s(0x6b, rs1, rd)
|
||||
#define vis_not2(rs2,rd) vis_d22d(0x66, rs2, rd)
|
||||
#define vis_not2s(rs2,rd) vis_s22s(0x67, rs2, rd)
|
||||
#define vis_or(rs1,rs2,rd) vis_dd2d(0x7c, rs1, rs2, rd)
|
||||
#define vis_ors(rs1,rs2,rd) vis_ss2s(0x7d, rs1, rs2, rd)
|
||||
#define vis_nor(rs1,rs2,rd) vis_dd2d(0x62, rs1, rs2, rd)
|
||||
#define vis_nors(rs1,rs2,rd) vis_ss2s(0x63, rs1, rs2, rd)
|
||||
#define vis_and(rs1,rs2,rd) vis_dd2d(0x70, rs1, rs2, rd)
|
||||
#define vis_ands(rs1,rs2,rd) vis_ss2s(0x71, rs1, rs2, rd)
|
||||
#define vis_nand(rs1,rs2,rd) vis_dd2d(0x6e, rs1, rs2, rd)
|
||||
#define vis_nands(rs1,rs2,rd) vis_ss2s(0x6f, rs1, rs2, rd)
|
||||
#define vis_xor(rs1,rs2,rd) vis_dd2d(0x6c, rs1, rs2, rd)
|
||||
#define vis_xors(rs1,rs2,rd) vis_ss2s(0x6d, rs1, rs2, rd)
|
||||
#define vis_xnor(rs1,rs2,rd) vis_dd2d(0x72, rs1, rs2, rd)
|
||||
#define vis_xnors(rs1,rs2,rd) vis_ss2s(0x73, rs1, rs2, rd)
|
||||
#define vis_ornot1(rs1,rs2,rd) vis_dd2d(0x7a, rs1, rs2, rd)
|
||||
#define vis_ornot1s(rs1,rs2,rd) vis_ss2s(0x7b, rs1, rs2, rd)
|
||||
#define vis_ornot2(rs1,rs2,rd) vis_dd2d(0x76, rs1, rs2, rd)
|
||||
#define vis_ornot2s(rs1,rs2,rd) vis_ss2s(0x77, rs1, rs2, rd)
|
||||
#define vis_andnot1(rs1,rs2,rd) vis_dd2d(0x68, rs1, rs2, rd)
|
||||
#define vis_andnot1s(rs1,rs2,rd) vis_ss2s(0x69, rs1, rs2, rd)
|
||||
#define vis_andnot2(rs1,rs2,rd) vis_dd2d(0x64, rs1, rs2, rd)
|
||||
#define vis_andnot2s(rs1,rs2,rd) vis_ss2s(0x65, rs1, rs2, rd)
|
||||
|
||||
/* Pixel component distance. */
|
||||
|
||||
#define vis_pdist(rs1,rs2,rd) vis_dd2d(0x3e, rs1, rs2, rd)
|
||||
|
||||
#endif /* LIBMPEG2_VIS_H */
|
||||
Reference in New Issue
Block a user