1 2 /* ----------------------------------------------------------------------------------------------------------- 3 Software 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 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. 12 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. 17 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. 24 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. 28 29 2. COPYRIGHT LICENSE 30 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: 33 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. 36 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. 41 42 The name of Fraunhofer may not be used to endorse or promote products derived from this library without 43 prior written permission. 44 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. 47 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." 52 53 3. NO PATENT LICENSE 54 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. 58 59 You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized 60 by appropriate patent licenses. 61 62 4. DISCLAIMER 63 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. 72 73 5. CONTACT INFORMATION 74 75 Fraunhofer Institute for Integrated Circuits IIS 76 Attention: Audio and Multimedia Departments - FDK AAC LL 77 Am Wolfsmantel 33 78 91058 Erlangen, Germany 79 80 www.iis.fraunhofer.de/amm 81 amm-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