annotate libfaad2/common.h @ 12614:d873777f0acf

Prefer libavcodec for cvid files
author rtognimp
date Sun, 20 Jun 2004 22:11:28 +0000
parents 4a370c80fe5c
children d81145997036
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
1 /*
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
4 **
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
5 ** This program is free software; you can redistribute it and/or modify
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
6 ** it under the terms of the GNU General Public License as published by
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
7 ** the Free Software Foundation; either version 2 of the License, or
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
8 ** (at your option) any later version.
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
9 **
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
10 ** This program is distributed in the hope that it will be useful,
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
13 ** GNU General Public License for more details.
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
14 **
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
16 ** along with this program; if not, write to the Free Software
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
18 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
19 ** Any non-GPL usage of this software or parts of this software is strictly
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
20 ** forbidden.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
21 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
22 ** Commercial non-GPL licensing of this software is possible.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
24 **
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
25 ** $Id$
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
26 **/
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
27
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
28 #ifndef __COMMON_H__
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
29 #define __COMMON_H__
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
30
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
31 #ifdef __cplusplus
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
32 extern "C" {
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
33 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
34
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
35 /* Allow build on cygwin*/
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
36 #if defined(__CYGWIN__)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
37 #define __STRICT_ANSI__
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
38 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
39
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
40 #define INLINE __inline
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
41 #if defined(_WIN32) && !defined(_WIN32_WCE)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
42 #define ALIGN __declspec(align(16))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
43 #else
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
44 #define ALIGN
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
45 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
46
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
47 #ifndef max
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
48 #define max(a, b) (((a) > (b)) ? (a) : (b))
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
49 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
50 #ifndef min
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
51 #define min(a, b) (((a) < (b)) ? (a) : (b))
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
52 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
53
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
54 /* COMPILE TIME DEFINITIONS */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
55
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
56 /* use double precision */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
57 /* #define USE_DOUBLE_PRECISION */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
58 /* use fixed point reals */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
59 //#define FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
60
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
61 #ifdef _WIN32_WCE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
62 #define FIXED_POINT
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
63 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
64
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
65
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
66 #define ERROR_RESILIENCE
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
67
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
68
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
69 /* Allow decoding of MAIN profile AAC */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
70 #define MAIN_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
71 /* Allow decoding of SSR profile AAC */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
72 //#define SSR_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
73 /* Allow decoding of LTP profile AAC */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
74 #define LTP_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
75 /* Allow decoding of LD profile AAC */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
76 #define LD_DEC
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
77 /* Allow decoding of scalable profiles */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
78 //#define SCALABLE_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
79 /* Allow decoding of Digital Radio Mondiale (DRM) */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
80 //#define DRM
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
81 //#define DRM_PS
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
82
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
83 /* LD can't do without LTP */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
84 #ifdef LD_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
85 #ifndef ERROR_RESILIENCE
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
86 #define ERROR_RESILIENCE
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
87 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
88 #ifndef LTP_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
89 #define LTP_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
90 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
91 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
92
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
93 #define ALLOW_SMALL_FRAMELENGTH
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
94
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
95
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
96 // Define LC_ONLY_DECODER if you want a pure AAC LC decoder (independant of SBR_DEC)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
97 //#define LC_ONLY_DECODER
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
98 #ifdef LC_ONLY_DECODER
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
99 #undef LTP_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
100 #undef MAIN_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
101 #undef SSR_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
102 #undef DRM
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
103 #undef ALLOW_SMALL_FRAMELENGTH
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
104 #undef ERROR_RESILIENCE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
105 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
106
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
107 #define SBR_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
108 //#define SBR_LOW_POWER
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
109 //#define PS_DEC
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
110
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
111 /* FIXED POINT: No MAIN decoding, no SBR decoding */
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
112 #ifdef FIXED_POINT
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
113 # ifdef MAIN_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
114 # undef MAIN_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
115 # endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
116 //# ifndef SBR_LOW_POWER
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
117 //# define SBR_LOW_POWER
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
118 //# endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
119 # ifdef SBR_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
120 # undef SBR_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
121 # endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
122 #endif // FIXED_POINT
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
123
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
124 #ifdef DRM
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
125 # ifndef SCALABLE_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
126 # define SCALABLE_DEC
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
127 # endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
128 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
129
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
130 #if ((defined(_WIN32) && !defined(_WIN32_WCE)) /* || ((__GNUC__ >= 3) && defined(__i386__)) */ )
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
131 #ifndef FIXED_POINT
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
132 /* includes <xmmintrin.h> to enable SSE intrinsics */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
133 //#define USE_SSE
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
134 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
135 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
136
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
137 #ifdef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
138 #define SBR_DIV(A, B) (((int64_t)A << REAL_BITS)/B)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
139 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
140 #define SBR_DIV(A, B) ((A)/(B))
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
141 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
142
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
143 #ifndef SBR_LOW_POWER
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
144 #define qmf_t complex_t
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
145 #define QMF_RE(A) RE(A)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
146 #define QMF_IM(A) IM(A)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
147 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
148 #define qmf_t real_t
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
149 #define QMF_RE(A) (A)
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
150 #define QMF_IM(A)
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
151 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
152
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
153
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
154 /* END COMPILE TIME DEFINITIONS */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
155
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
156 #if defined(_WIN32)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
157
10805
125a35fc47a5 fixed win32 compile problems and broken bigendian support
alex
parents: 10725
diff changeset
158 #if 0
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
159 typedef unsigned __int64 uint64_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
160 typedef unsigned __int32 uint32_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
161 typedef unsigned __int16 uint16_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
162 typedef unsigned __int8 uint8_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
163 typedef __int64 int64_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
164 typedef __int32 int32_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
165 typedef __int16 int16_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
166 typedef __int8 int8_t;
10805
125a35fc47a5 fixed win32 compile problems and broken bigendian support
alex
parents: 10725
diff changeset
167 #else
125a35fc47a5 fixed win32 compile problems and broken bigendian support
alex
parents: 10725
diff changeset
168 #include <inttypes.h>
125a35fc47a5 fixed win32 compile problems and broken bigendian support
alex
parents: 10725
diff changeset
169 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
170 typedef float float32_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
171
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
172
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
173 #else
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
174 /* Define if needed */
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
175
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
176 /* #undef HAVE_FLOAT32_T */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
177 /* Define if you have the <inttypes.h> header file. */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
178 #define HAVE_INTTYPES_H 1
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
179
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
180 /* Define if you have the `memcpy' function. */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
181 #define HAVE_MEMCPY 1
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
182
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
183 /* Define if you have the <stdint.h> header file. */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
184 #define HAVE_STDINT_H 1
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
185
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
186 /* Define if you have the `strchr' function. */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
187 #define HAVE_STRCHR 1
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
188
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
189 /* Define if you have the ANSI C header files. */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
190 #define STDC_HEADERS 1
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
191
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
192 #ifdef HAVE_CONFIG_H
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
193 # include "../config.h"
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
194 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
195
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
196 #include <stdio.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
197 #if HAVE_SYS_TYPES_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
198 # include <sys/types.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
199 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
200 #if HAVE_SYS_STAT_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
201 # include <sys/stat.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
202 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
203 #if STDC_HEADERS
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
204 # include <stdlib.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
205 # include <stddef.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
206 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
207 # if HAVE_STDLIB_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
208 # include <stdlib.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
209 # endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
210 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
211 #if HAVE_STRING_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
212 # if !STDC_HEADERS && HAVE_MEMORY_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
213 # include <memory.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
214 # endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
215 # include <string.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
216 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
217 #if HAVE_STRINGS_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
218 # include <strings.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
219 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
220 #if HAVE_INTTYPES_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
221 # include <inttypes.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
222 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
223 # if HAVE_STDINT_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
224 # include <stdint.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
225 # else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
226 /* we need these... */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
227 typedef unsigned long long uint64_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
228 typedef unsigned long uint32_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
229 typedef unsigned short uint16_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
230 typedef unsigned char uint8_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
231 typedef long long int64_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
232 typedef long int32_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
233 typedef short int16_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
234 typedef char int8_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
235 # endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
236 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
237 #if HAVE_UNISTD_H
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
238 # include <unistd.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
239 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
240
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
241 #ifndef HAVE_FLOAT32_T
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
242 typedef float float32_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
243 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
244
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
245 #if STDC_HEADERS
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
246 # include <string.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
247 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
248 # if !HAVE_STRCHR
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
249 # define strchr index
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
250 # define strrchr rindex
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
251 # endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
252 char *strchr(), *strrchr();
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
253 # if !HAVE_MEMCPY
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
254 # define memcpy(d, s, n) bcopy((s), (d), (n))
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
255 # define memmove(d, s, n) bcopy((s), (d), (n))
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
256 # endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
257 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
258
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
259 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
260
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
261 #ifdef WORDS_BIGENDIAN
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
262 #define ARCH_IS_BIG_ENDIAN
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
263 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
264
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
265 /* FIXED_POINT doesn't work with MAIN and SSR yet */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
266 #ifdef FIXED_POINT
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
267 #undef MAIN_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
268 #undef SSR_DEC
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
269 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
270
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
271
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
272 #if defined(FIXED_POINT)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
273
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
274 #include "fixed.h"
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
275
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
276 #elif defined(USE_DOUBLE_PRECISION)
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
277
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
278 typedef double real_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
279
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
280 #include <math.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
281
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
282 #define MUL_R(A,B) ((A)*(B))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
283 #define MUL_C(A,B) ((A)*(B))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
284 #define MUL_F(A,B) ((A)*(B))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
285
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
286 /* Complex multiplication */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
287 static INLINE void ComplexMult(real_t *y1, real_t *y2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
288 real_t x1, real_t x2, real_t c1, real_t c2)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
289 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
290 *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
291 *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
292 }
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
293
10989
3185f64f6350 synced with current cvs
alex
parents: 10805
diff changeset
294 #define REAL_CONST(A) ((real_t)(A))
3185f64f6350 synced with current cvs
alex
parents: 10805
diff changeset
295 #define COEF_CONST(A) ((real_t)(A))
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
296 #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
297
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
298 #else /* Normal floating point operation */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
299
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
300 typedef float real_t;
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
301
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
302 #ifdef USE_SSE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
303 # include <xmmintrin.h>
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
304 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
305
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
306 #define MUL_R(A,B) ((A)*(B))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
307 #define MUL_C(A,B) ((A)*(B))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
308 #define MUL_F(A,B) ((A)*(B))
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
309
10989
3185f64f6350 synced with current cvs
alex
parents: 10805
diff changeset
310 #define REAL_CONST(A) ((real_t)(A))
3185f64f6350 synced with current cvs
alex
parents: 10805
diff changeset
311 #define COEF_CONST(A) ((real_t)(A))
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
312 #define FRAC_CONST(A) ((real_t)(A)) /* pure fractional part */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
313
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
314 /* Complex multiplication */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
315 static INLINE void ComplexMult(real_t *y1, real_t *y2,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
316 real_t x1, real_t x2, real_t c1, real_t c2)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
317 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
318 *y1 = MUL_F(x1, c1) + MUL_F(x2, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
319 *y2 = MUL_F(x2, c1) - MUL_F(x1, c2);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
320 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
321
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
322
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
323 #if defined(_WIN32) && !defined(__MINGW32__)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
324 #define HAS_LRINTF
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
325 static INLINE int lrintf(float f)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
326 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
327 int i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
328 __asm
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
329 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
330 fld f
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
331 fistp i
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
332 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
333 return i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
334 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
335 #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
336 #define HAS_LRINTF
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
337 // from http://www.stereopsis.com/FPU.html
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
338 static INLINE int lrintf(float f)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
339 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
340 int i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
341 __asm__ __volatile__ (
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
342 "flds %1 \n\t"
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
343 "fistpl %0 \n\t"
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
344 : "=m" (i)
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
345 : "m" (f));
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
346 return i;
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
347 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
348 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
349
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
350
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
351 #ifdef __ICL /* only Intel C compiler has fmath ??? */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
352
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
353 #include <mathf.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
354
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
355 #define sin sinf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
356 #define cos cosf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
357 #define log logf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
358 #define floor floorf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
359 #define ceil ceilf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
360 #define sqrt sqrtf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
361
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
362 #else
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
363
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
364 #ifdef HAVE_LRINTF
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
365 # define HAS_LRINTF
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
366 # define _ISOC9X_SOURCE 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
367 # define _ISOC99_SOURCE 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
368 # define __USE_ISOC9X 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
369 # define __USE_ISOC99 1
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
370 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
371
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
372 #include <math.h>
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
373
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
374 #ifdef HAVE_SINF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
375 # define sin sinf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
376 #error
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
377 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
378 #ifdef HAVE_COSF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
379 # define cos cosf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
380 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
381 #ifdef HAVE_LOGF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
382 # define log logf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
383 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
384 #ifdef HAVE_EXPF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
385 # define exp expf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
386 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
387 #ifdef HAVE_FLOORF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
388 # define floor floorf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
389 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
390 #ifdef HAVE_CEILF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
391 # define ceil ceilf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
392 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
393 #ifdef HAVE_SQRTF
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
394 # define sqrt sqrtf
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
395 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
396
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
397 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
398
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
399 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
400
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
401 #ifndef HAS_LRINTF
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
402 /* standard cast */
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
403 #define lrintf(f) ((int32_t)(f))
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
404 #endif
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
405
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
406 typedef real_t complex_t[2];
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
407 #define RE(A) A[0]
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
408 #define IM(A) A[1]
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
409
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
410
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
411 /* common functions */
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
412 uint8_t cpu_has_sse(void);
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
413 uint32_t random_int(void);
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
414 uint8_t get_sr_index(const uint32_t samplerate);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
415 uint8_t max_pred_sfb(const uint8_t sr_index);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
416 uint8_t max_tns_sfb(const uint8_t sr_index, const uint8_t object_type,
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
417 const uint8_t is_short);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
418 uint32_t get_sample_rate(const uint8_t sr_index);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
419 int8_t can_decode_ot(const uint8_t object_type);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
420
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
421 void *faad_malloc(int32_t size);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
422 void faad_free(void *b);
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
423
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
424 //#define PROFILE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
425 #ifdef PROFILE
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
426 static int64_t faad_get_ts()
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
427 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
428 __asm
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
429 {
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
430 rdtsc
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
431 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
432 }
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
433 #endif
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
434
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
435 #ifndef M_PI
12527
4a370c80fe5c update to the 2.0 release of faad, patch by adland
diego
parents: 10989
diff changeset
436 #define M_PI 3.14159265358979323846
10725
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
437 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
438 #ifndef M_PI_2 /* PI/2 */
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
439 #define M_PI_2 1.57079632679489661923
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
440 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
441
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
442
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
443 #ifdef __cplusplus
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
444 }
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
445 #endif
e989150f8216 libfaad2 v2.0rc1 imported
arpi
parents:
diff changeset
446 #endif