1
2/* -----------------------------------------------------------------------------------------------------------
3Software License for The Fraunhofer FDK AAC Codec Library for Android
4
5� Copyright  1995 - 2013 Fraunhofer-Gesellschaft zur F�rderung der angewandten Forschung e.V.
6  All rights reserved.
7
8 1.    INTRODUCTION
9The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements
10the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio.
11This FDK AAC Codec software is intended to be used on a wide variety of Android devices.
12
13AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual
14audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by
15independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part
16of the MPEG specifications.
17
18Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer)
19may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners
20individually for the purpose of encoding or decoding bit streams in products that are compliant with
21the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license
22these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec
23software may already be covered under those patent licenses when it is used for those licensed purposes only.
24
25Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality,
26are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional
27applications information and documentation.
28
292.    COPYRIGHT LICENSE
30
31Redistribution and use in source and binary forms, with or without modification, are permitted without
32payment of copyright license fees provided that you satisfy the following conditions:
33
34You must retain the complete text of this software license in redistributions of the FDK AAC Codec or
35your modifications thereto in source code form.
36
37You must retain the complete text of this software license in the documentation and/or other materials
38provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form.
39You must make available free of charge copies of the complete source code of the FDK AAC Codec and your
40modifications thereto to recipients of copies in binary form.
41
42The name of Fraunhofer may not be used to endorse or promote products derived from this library without
43prior written permission.
44
45You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec
46software or your modifications thereto.
47
48Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software
49and 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."
52
533.    NO PATENT LICENSE
54
55NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer,
56ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with
57respect to this software.
58
59You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized
60by appropriate patent licenses.
61
624.    DISCLAIMER
63
64This 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
66of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
67CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages,
68including but not limited to procurement of substitute goods or services; loss of use, data, or profits,
69or business interruption, however caused and on any theory of liability, whether in contract, strict
70liability, or tort (including negligence), arising in any way out of the use of this software, even if
71advised of the possibility of such damage.
72
735.    CONTACT INFORMATION
74
75Fraunhofer Institute for Integrated Circuits IIS
76Attention: Audio and Multimedia Departments - FDK AAC LL
77Am Wolfsmantel 33
7891058 Erlangen, Germany
79
80www.iis.fraunhofer.de/amm
81amm-info@iis.fraunhofer.de
82----------------------------------------------------------------------------------------------------------- */
83
84/***************************  Fraunhofer IIS FDK Tools  ***********************
85
86   Author(s):
87   Description:
88
89******************************************************************************/
90
91#ifndef __ARCH_H__
92#define __ARCH_H__
93
94/* Performance / Quality profile selector */
95  #define FDK_HIGH_PERFORMANCE
96
97/* Unify some few toolchain specific defines to avoid having large "or" macro contraptions all over the source code. */
98
99/* Take action against VisualStudio 2005 crosscompile problems. */
100
101/* Use single macro (the GCC built in macro) for architecture identification independent of the particular toolchain */
102#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || (defined(_MSC_VER) && defined(_M_IX86)) || defined (__x86_64__)
103#define __x86__
104#endif
105
106#if (defined(_M_ARM) || defined(__CC_ARM)) && !defined(__arm__) || defined(__TI_TMS470_V5__) && !defined(__arm__)
107#define __arm__
108#endif
109
110
111
112/* Define __ARM_ARCH_5TE__ if armv5te features are supported  */
113#if (__TARGET_ARCH_ARM == 5) || defined(__TARGET_FEATURE_DSPMUL) || (_M_ARM == 5) || defined(__ARM_ARCH_5TEJ__) || defined(__TI_TMS470_V5__) || defined(__ARM_ARCH_7EM__)
114#define __ARM_ARCH_5TE__
115#endif
116
117/* Define __ARM_ARCH_6__ if the armv6 intructions are being supported. */
118#if (__TARGET_ARCH_ARM == 6) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6ZK__)
119#define __ARM_ARCH_5TE__
120#define __ARM_ARCH_6__
121#endif
122
123/* Define __ARM_ARCH_7_A__ if the armv7 intructions are being supported. */
124#if defined(__TARGET_ARCH_7_R) || defined(__ARM_ARCH_7R__)
125#define __ARM_ARCH_5TE__
126#define __ARM_ARCH_6__
127#define __ARM_ARCH_7_R__
128#endif
129
130/* Define __ARM_ARCH_7_A__ if the armv7 intructions are being supported. */
131#if defined(__TARGET_ARCH_7_A) || defined(__ARM_ARCH_7A__)
132#define __ARM_ARCH_5TE__
133#define __ARM_ARCH_6__
134#define __ARM_ARCH_7_A__
135#endif
136
137/* Define __ARM_ARCH_7M__ if the ARMv7-M instructions are being supported, e.g. Cortex-M3. */
138#if defined(__TARGET_ARCH_7_M) || defined(__ARM_ARCH_7_M__)
139#define __ARM_ARCH_7M__
140#endif
141
142/* Define __ARM_ARCH_7EM__ if the ARMv7-ME instructions are being supported, e.g. Cortex-M4. */
143#if defined(__TARGET_ARCH_7E_M) || defined(__ARM_ARCH_7E_M__)
144#define __ARM_ARCH_7EM__
145#endif
146
147/* Detect and unify macros for neon feature. */
148#if defined(__TARGET_FEATURE_NEON) && !defined(__ARM_NEON__)
149#define __ARM_NEON__
150#endif
151
152#ifdef _M_ARM
153#include "cmnintrin.h"
154#include "armintr.h"
155#endif
156
157
158/* Define preferred Multiplication type */
159#if defined(FDK_HIGH_PERFORMANCE) && !defined(FDK_HIGH_QUALITY) /* FDK_HIGH_PERFORMANCE */
160
161#if defined(__mips__) || defined(__powerpc__) || defined(__sh__)
162#define ARCH_PREFER_MULT_16x16
163#undef SINETABLE_16BIT
164#undef POW2COEFF_16BIT
165#undef LDCOEFF_16BIT
166#undef WINDOWTABLE_16BIT
167
168#elif defined(__arm__) && defined(__ARM_ARCH_5TE__)	/* cppp replaced: elif */	/* cppp replaced: elif */
169#define ARCH_PREFER_MULT_32x16
170#define SINETABLE_16BIT
171#define POW2COEFF_16BIT
172#define LDCOEFF_16BIT
173#define WINDOWTABLE_16BIT
174
175#elif defined(__arm__) && defined(__ARM_ARCH_7M__)
176#define ARCH_PREFER_MULT_32x16
177#define SINETABLE_16BIT
178#define POW2COEFF_16BIT
179#define LDCOEFF_16BIT
180#define WINDOWTABLE_16BIT
181
182#elif defined(__arm__) && defined(__ARM_ARCH_7EM__)
183#define ARCH_PREFER_MULT_32x32
184#define ARCH_PREFER_MULT_32x16
185#define SINETABLE_16BIT
186#define POW2COEFF_16BIT
187#define LDCOEFF_16BIT
188#define WINDOWTABLE_16BIT
189
190#elif defined(__arm__) && !defined(__ARM_ARCH_5TE__)
191#define ARCH_PREFER_MULT_16x16
192#undef SINETABLE_16BIT
193#undef WINDOWTABLE_16BIT
194#undef POW2COEFF_16BIT
195#undef LDCOEFF_16BIT
196
197#elif defined(__x86__)	/* cppp replaced: elif */
198#define ARCH_PREFER_MULT_32x16
199#define SINETABLE_16BIT
200#define WINDOWTABLE_16BIT
201#define POW2COEFF_16BIT
202#define LDCOEFF_16BIT
203
204#else
205
206  #warning  >>>> Please set architecture characterization defines for your platform (FDK_HIGH_PERFORMANCE)! <<<<
207
208#endif /* Architecture switches */
209
210#else /* neither FDK_HIGH_QUALITY or FDK_HIGH_PERFORMANCE */
211
212#error Either set FDK_HIGH_QUALITY or FDK_HIGH_PERFORMANCE, but not both nor none of them.
213
214#endif /* End of quality/complexity tradeoff */
215
216#define FDKTOOLS_PACKED_TABLES
217
218
219#ifdef SINETABLE_16BIT
220  #define FIXP_STB FIXP_SGL     /* STB sinus Tab used in transformation */
221  #define FIXP_STP FIXP_SPK
222  #define STC(a) (FX_DBL2FXCONST_SGL(a))
223#else
224  #define FIXP_STB FIXP_DBL
225  #define FIXP_STP FIXP_DPK
226  #define STC(a) ((FIXP_DBL)(LONG)(a))
227#endif /* defined(SINETABLE_16BIT) */
228
229#define STCP(cos,sin) { { STC(cos), STC(sin) } }
230
231
232#ifdef WINDOWTABLE_16BIT
233  #define FIXP_WTB FIXP_SGL /* single FIXP_SGL values */
234  #define FIXP_WTP FIXP_SPK /* packed FIXP_SGL values */
235  #define WTC(a) FX_DBL2FXCONST_SGL(a)
236#else /* SINETABLE_16BIT */
237  #define FIXP_WTB FIXP_DBL
238  #define FIXP_WTP FIXP_DPK
239  #define WTC(a) (FIXP_DBL)(a)
240#endif /* SINETABLE_16BIT */
241
242#define WTCP(a,b) { { WTC(a), WTC(b) } }
243
244
245#endif /* __ARCH_H__ */
246