2 /* -----------------------------------------------------------------------------------------------------------
3 Software License for The Fraunhofer FDK AAC Codec Library for Android
5 © Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
9 The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements
10 the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio.
11 This FDK AAC Codec software is intended to be used on a wide variety of Android devices.
13 AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual
14 audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by
15 independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part
16 of the MPEG specifications.
18 Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer)
19 may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners
20 individually for the purpose of encoding or decoding bit streams in products that are compliant with
21 the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license
22 these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec
23 software may already be covered under those patent licenses when it is used for those licensed purposes only.
25 Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality,
26 are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional
27 applications information and documentation.
31 Redistribution and use in source and binary forms, with or without modification, are permitted without
32 payment of copyright license fees provided that you satisfy the following conditions:
34 You must retain the complete text of this software license in redistributions of the FDK AAC Codec or
35 your modifications thereto in source code form.
37 You must retain the complete text of this software license in the documentation and/or other materials
38 provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form.
39 You must make available free of charge copies of the complete source code of the FDK AAC Codec and your
40 modifications thereto to recipients of copies in binary form.
42 The name of Fraunhofer may not be used to endorse or promote products derived from this library without
43 prior written permission.
45 You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec
46 software or your modifications thereto.
48 Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software
49 and the date of any change. For modified versions of the FDK AAC Codec, the term
50 "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term
51 "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android."
55 NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer,
56 ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with
57 respect to this software.
59 You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized
60 by appropriate patent licenses.
64 This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors
65 "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties
66 of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
67 CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages,
68 including but not limited to procurement of substitute goods or services; loss of use, data, or profits,
69 or business interruption, however caused and on any theory of liability, whether in contract, strict
70 liability, or tort (including negligence), arising in any way out of the use of this software, even if
71 advised of the possibility of such damage.
73 5. CONTACT INFORMATION
75 Fraunhofer Institute for Integrated Circuits IIS
76 Attention: Audio and Multimedia Departments - FDK AAC LL
78 91058 Erlangen, Germany
80 www.iis.fraunhofer.de/amm
81 amm-info@iis.fraunhofer.de
82 ----------------------------------------------------------------------------------------------------------- */
84 /************************** Fraunhofer IIS FDK SysLib **********************
88 ******************************************************************************/
90 /** \file machine_type.h
91 * \brief Type defines for various processors and compiler tools.
94 #if !defined(__MACHINE_TYPE_H__)
95 #define __MACHINE_TYPE_H__
98 /* Library calling convention spec. __cdecl and friends might be added here as required. */
104 * collate all corresponding compiler specific macros to detect a debug build, and set the DEBUG macro if that is the case.
111 /* for doxygen the following docu parts must be separated */
113 * Data type representing at least 1 byte signed integer on all supported platforms.
116 * Data type representing at least 1 byte unsigned integer on all supported platforms.
119 * Data type representing at least 4 byte signed integer on all supported platforms.
122 * Data type representing at least 4 byte unsigned integer on all supported platforms.
125 * Data type representing 4 byte signed integer on all supported platforms.
128 * Data type representing 4 byte unsigned integer on all supported platforms.
131 * Data type representing 2 byte signed integer on all supported platforms.
134 * Data type representing 2 byte unsigned integer on all supported platforms.
137 * Data type representing 8 byte signed integer on all supported platforms.
140 * Data type representing 8 byte unsigned integer on all supported platforms.
143 * Number of bits the data type short represents. sizeof() is not suited to get this info,
144 * because a byte is not always defined as 8 bits.
147 * Number of bits the data type char represents. sizeof() is not suited to get this info,
148 * because a byte is not always defined as 8 bits.
151 * Data type representing the width of input and output PCM samples.
155 typedef signed int INT
;
156 typedef unsigned int UINT
;
158 /* force FDK long-datatypes to 4 byte */
159 /* jdr: Use defines to avoid type alias problems on 64 bit machines. */
162 #else /* __x86_64__ */
163 typedef signed long LONG
;
164 typedef unsigned long ULONG
;
165 #endif /* __x86_64__ */
166 typedef signed short SHORT
;
167 typedef unsigned short USHORT
;
168 typedef signed char SCHAR
;
169 typedef unsigned char UCHAR
;
171 #define SHORT_BITS 16
175 /* Define 64 bit base integer type. */
177 typedef __int64 INT64
;
178 typedef unsigned __int64 UINT64
;
180 typedef long long INT64
;
181 typedef unsigned long long UINT64
;
188 #define NULL ((void *)0)
192 /* Assert is functional on x86 PC's and also when debugging is turned on. */
193 #if defined(DEBUG) || defined(__i686__) || defined(__i586__) || defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(FDK_DEBUG) || defined(FDK_ASSERT_ENABLE)
195 #define FDK_ASSERT(x) assert(x)
197 #define FDK_ASSERT(ignore)
200 typedef SHORT INT_PCM
;
202 #define SAMPLE_BITS 16
203 #define SAMPLE_MAX (((LONG)1<<(SAMPLE_BITS-1))-1)
204 #define SAMPLE_MIN (~SAMPLE_MAX)
208 * Used to align memory as prefix before memory declaration. For example:
214 Note, that not all platforms support this mechanism. For example with TI compilers
215 a preprocessor pragma is used, but to do something like
218 #define RAM_ALIGN #pragma DATA_ALIGN(x)
221 would require the preprocessor to process this line twice to fully resolve it. Hence,
222 a fully platform-independant way to use alignment is not supported.
224 * \def ALIGNMENT_DEFAULT
225 * Default alignment in bytes.
227 #if defined(__GNUC__) /* cppp replaced: elif */
228 #define ALIGNMENT_DEFAULT 8
229 #define RAM_ALIGN __attribute__((aligned(ALIGNMENT_DEFAULT)))
231 #define ALIGNMENT_DEFAULT 8
238 * The restrict keyword is supported by some platforms and RESTRICT maps to
239 * either the corresponding keyword on each platform or to void if the
240 * compiler does not provide such feature.
242 * \def WORD_ALIGNED(x)
243 * Tells the compiler that pointer x is WORD aligned.
244 * At the moment only supported by TI compilers.
246 * \def DWORD_ALIGNED(x)
247 * Tells the compiler that pointer x is DWORD aligned.
248 * At the moment only supported by TI compilers.
251 #define WORD_ALIGNED(x)
252 #define DWORD_ALIGNED(x)
255 /*-----------------------------------------------------------------------------------
257 *-----------------------------------------------------------------------------------*/
259 * \brief This macro aligns a given value depending on ::ALIGNMENT_DEFAULT.
261 * For example if #ALIGNMENT_DEFAULT equals 8, then:
262 * - ALIGN_SIZE(3) returns 8
263 * - ALIGN_SIZE(8) returns 8
264 * - ALIGN_SIZE(9) returns 16
266 #define ALIGN_SIZE(a) ((a)+ (((INT)ALIGNMENT_DEFAULT - ((INT)(a) & (ALIGNMENT_DEFAULT-1)) ) & (ALIGNMENT_DEFAULT-1)))
268 /*-----------------------------------------------------------------------------------
270 * cast (a) to width of pointer
271 *-----------------------------------------------------------------------------------*/
273 * \brief This macro aligns a given address depending on ::ALIGNMENT_DEFAULT.
275 #define ALIGN_PTR(a) ( (unsigned char*)(a) + (((INT)ALIGNMENT_DEFAULT - ((INT)(UINT64)(a) & (ALIGNMENT_DEFAULT-1)) ) & (ALIGNMENT_DEFAULT-1)) )
277 /* Alignment macro for libSYS heap implementation */
278 #define ALIGNMENT_EXTRES ( ALIGNMENT_DEFAULT )
279 #define ALGN_SIZE_EXTRES(a) ((a)+ (((INT)ALIGNMENT_EXTRES - ((INT)(a) & (ALIGNMENT_EXTRES-1)) ) & (ALIGNMENT_EXTRES-1)))
284 * Sometimes compiler do not do what they are told to do, and in case of inlining some
285 * additional command might be necessary depending on the platform.
288 * Defines how the compiler is told to inline stuff.
295 #if defined(__GNUC__) /* cppp replaced: elif */
296 #define FORCEINLINE __attribute((always_inline))
303 /* for all other platforms */
304 #define FDK_INLINE inline
308 * \def LNK_SECTION_DATA_L1
309 * The LNK_SECTION_* defines allow memory to be drawn from specific memory
310 * sections. Used as prefix before variable declaration.
312 * \def LNK_SECTION_DATA_L2
313 * See ::LNK_SECTION_DATA_L1
314 * \def LNK_SECTION_L1_DATA_A
315 * See ::LNK_SECTION_DATA_L1
316 * \def LNK_SECTION_L1_DATA_B
317 * See ::LNK_SECTION_DATA_L1
318 * \def LNK_SECTION_CONSTDATA_L1
319 * See ::LNK_SECTION_DATA_L1
320 * \def LNK_SECTION_CONSTDATA
321 * See ::LNK_SECTION_DATA_L1
322 * \def LNK_SECTION_CODE_L1
323 * See ::LNK_SECTION_DATA_L1
324 * \def LNK_SECTION_CODE_L2
325 * See ::LNK_SECTION_DATA_L1
326 * \def LNK_SECTION_INITCODE
327 * See ::LNK_SECTION_DATA_L1
329 /**************************************************
330 * Code Section macros
331 **************************************************/
332 #define LNK_SECTION_CODE_L1
333 #define LNK_SECTION_CODE_L2
334 #define LNK_SECTION_INITCODE
336 /* Memory section macros. */
338 /* default fall back */
339 #define LNK_SECTION_DATA_L1
340 #define LNK_SECTION_DATA_L2
341 #define LNK_SECTION_CONSTDATA
342 #define LNK_SECTION_CONSTDATA_L1
344 #define LNK_SECTION_L1_DATA_A
345 #define LNK_SECTION_L1_DATA_B
350 * Sometimes certain features are excluded from compilation and therefore the warning 4065 may occur:
351 * "switch statement contains 'default' but no 'case' labels"
352 * We consider this warning irrelevant and disable it.
354 #pragma warning( disable : 4065 )
357 #endif /* __MACHINE_TYPE_H__ */