summaryrefslogtreecommitdiff
path: root/src/libfaad/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libfaad/common.h')
-rw-r--r--src/libfaad/common.h106
1 files changed, 65 insertions, 41 deletions
diff --git a/src/libfaad/common.h b/src/libfaad/common.h
index 31f07708a..4d2769526 100644
--- a/src/libfaad/common.h
+++ b/src/libfaad/common.h
@@ -1,28 +1,31 @@
/*
** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**
+** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
+**
** This program 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.
-**
+**
** This program 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
+** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
** Any non-GPL usage of this software or parts of this software is strictly
** forbidden.
**
+** The "appropriate copyright message" mentioned in section 2c of the GPLv2
+** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
+**
** Commercial non-GPL licensing of this software is possible.
-** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
+** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
**
-** $Id: common.h,v 1.17 2006/06/17 20:43:57 dgp85 Exp $
+** $Id: common.h,v 1.72 2007/11/01 12:33:30 menno Exp $
**/
#ifndef __COMMON_H__
@@ -32,13 +35,16 @@
extern "C" {
#endif
-#ifdef __CYGWIN__
-#define __STRICT_ANSI__
+#ifdef HAVE_CONFIG_H
+# include <config.h>
#endif
-#include "config.h"
-
+#if 1
#define INLINE __inline
+#else
+#define INLINE inline
+#endif
+
#if 0 //defined(_WIN32) && !defined(_WIN32_WCE)
#define ALIGN __declspec(align(16))
#else
@@ -63,10 +69,13 @@ extern "C" {
/* Use if target platform has address generators with autoincrement */
//#define PREFER_POINTERS
-#if defined(_WIN32_WCE) || defined(__arm__)
+#ifdef _WIN32_WCE
#define FIXED_POINT
#endif
+#ifdef __BFIN__
+#define FIXED_POINT
+#endif
#define ERROR_RESILIENCE
@@ -79,8 +88,6 @@ extern "C" {
#define LTP_DEC
/* Allow decoding of LD profile AAC */
#define LD_DEC
-/* Allow decoding of scalable profiles */
-//#define SCALABLE_DEC
/* Allow decoding of Digital Radio Mondiale (DRM) */
//#define DRM
//#define DRM_PS
@@ -114,20 +121,25 @@ extern "C" {
//#define SBR_LOW_POWER
#define PS_DEC
+#ifdef SBR_LOW_POWER
+#undef PS_DEC
+#endif
+
/* FIXED POINT: No MAIN decoding */
#ifdef FIXED_POINT
# ifdef MAIN_DEC
# undef MAIN_DEC
# endif
-# ifdef SBR_DEC
-# undef SBR_DEC
-# endif
#endif // FIXED_POINT
#ifdef DRM
-# ifndef SCALABLE_DEC
-# define SCALABLE_DEC
+# ifndef ALLOW_SMALL_FRAMELENGTH
+# define ALLOW_SMALL_FRAMELENGTH
# endif
+# undef LD_DEC
+# undef LTP_DEC
+# undef MAIN_DEC
+# undef SSR_DEC
#endif
@@ -152,6 +164,23 @@ extern "C" {
/* END COMPILE TIME DEFINITIONS */
+#if defined(_WIN32) && !defined(__MINGW32__)
+
+#include <stdlib.h>
+
+typedef unsigned __int64 uint64_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int8 uint8_t;
+typedef __int64 int64_t;
+typedef __int32 int32_t;
+typedef __int16 int16_t;
+typedef __int8 int8_t;
+typedef float float32_t;
+
+
+#else
+
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -176,8 +205,6 @@ extern "C" {
#if HAVE_STRINGS_H
# include <strings.h>
#endif
-
-/* precedence defining int-types by header files for all platforms */
#if HAVE_INTTYPES_H
# include <inttypes.h>
#else
@@ -185,30 +212,23 @@ extern "C" {
# include <stdint.h>
# else
/* we need these... */
-# ifdef WIN32
-typedef unsigned __int64 uint64_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int8 uint8_t;
-typedef __int64 int64_t;
-typedef __int32 int32_t;
-typedef __int16 int16_t;
-typedef __int8 int8_t;
-# else /* WIN32 */
-typedef float float32_t;
+#ifndef __TCS__
typedef unsigned long long uint64_t;
+typedef long long int64_t;
+#else
+typedef unsigned long uint64_t;
+typedef long int64_t;
+#endif
typedef unsigned long uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
-typedef long long int64_t;
typedef long int32_t;
typedef short int16_t;
typedef char int8_t;
-# endif /* WIN32 */
# endif
#endif
#if HAVE_UNISTD_H
-# include <unistd.h>
+//# include <unistd.h>
#endif
#ifndef HAVE_FLOAT32_T
@@ -229,6 +249,8 @@ char *strchr(), *strrchr();
# endif
#endif
+#endif
+
#ifdef WORDS_BIGENDIAN
#define ARCH_IS_BIG_ENDIAN
#endif
@@ -289,7 +311,6 @@ char *strchr(), *strrchr();
}
-#ifndef HAVE_LRINTF
#if defined(_WIN32) && !defined(__MINGW32__)
#define HAS_LRINTF
static INLINE int lrintf(float f)
@@ -302,7 +323,9 @@ char *strchr(), *strrchr();
}
return i;
}
- #elif (defined(__i386__) && defined(__GNUC__))
+ #elif (defined(__i386__) && defined(__GNUC__) && \
+ !defined(__CYGWIN__) && !defined(__MINGW32__))
+ #ifndef HAVE_LRINTF
#define HAS_LRINTF
// from http://www.stereopsis.com/FPU.html
static INLINE int lrintf(float f)
@@ -315,8 +338,9 @@ char *strchr(), *strrchr();
: "m" (f));
return i;
}
+ #endif /* HAVE_LRINTF */
#endif
-#endif
+
#ifdef __ICL /* only Intel C compiler has fmath ??? */
@@ -331,8 +355,6 @@ char *strchr(), *strrchr();
#else
-#include <math.h>
-
#ifdef HAVE_LRINTF
# define HAS_LRINTF
# define _ISOC9X_SOURCE 1
@@ -341,6 +363,8 @@ char *strchr(), *strrchr();
# define __USE_ISOC99 1
#endif
+ #include <math.h>
+
#ifdef HAVE_SINF
# define sin sinf
#error
@@ -380,7 +404,7 @@ typedef real_t complex_t[2];
/* common functions */
uint8_t cpu_has_sse(void);
-uint32_t random_int(void);
+uint32_t ne_rng(uint32_t *__r1, uint32_t *__r2);
uint32_t ones32(uint32_t x);
uint32_t floor_log2(uint32_t x);
uint32_t wl_min_lzc(uint32_t x);