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 Tools ***********************
86 Author(s): Oliver Moser
87 Description: ROM tables used by FDK tools
89 ******************************************************************************/
91 #ifndef __FDK_TOOLS_ROM_H__
92 #define __FDK_TOOLS_ROM_H__
94 #include "common_fix.h"
95 #include "FDK_audio.h"
98 /* None radix2 rotation vectors */
99 extern const FIXP_STB RotVectorReal60
[60];
100 extern const FIXP_STB RotVectorImag60
[60];
101 extern const FIXP_STB RotVectorReal240
[240];
102 extern const FIXP_STB RotVectorImag240
[240];
103 extern const FIXP_STB RotVectorReal480
[480];
104 extern const FIXP_STB RotVectorImag480
[480];
107 /* Regular sine tables */
108 extern const FIXP_STP SineTable512
[];
109 extern const FIXP_STP SineTable480
[];
112 extern const FIXP_WTP SineWindow1024
[];
113 extern const FIXP_WTP KBDWindow1024
[];
114 extern const FIXP_WTP SineWindow128
[];
115 extern const FIXP_WTP KBDWindow128
[];
117 extern const FIXP_WTP SineWindow960
[];
118 extern const FIXP_WTP KBDWindow960
[];
119 extern const FIXP_WTP SineWindow120
[];
120 extern const FIXP_WTP KBDWindow120
[];
123 extern const FIXP_WTP SineWindow512
[];
124 #define LowOverlapWindow512 SineWindow128
125 extern const FIXP_WTP SineWindow480
[];
126 #define LowOverlapWindow480 SineWindow120
130 extern const FIXP_WTP SineWindow64
[];
131 extern const FIXP_WTP SineWindow32
[];
134 * \brief Helper table for window slope mapping. You should prefer the usage of the
135 * function FDKgetWindowSlope(), this table is only made public for some optimized
136 * access inside dct.cpp.
138 extern const FIXP_WTP
*const windowSlopes
[2][3][9];
141 * \brief Window slope access helper. Obtain a window of given length and shape.
142 * \param length Length of the window slope.
143 * \param shape Shape index of the window slope. 0: sine window, 1: Kaiser-Bessel. Any other
144 * value is applied a mask of 1 to, mapping it to either 0 or 1.
145 * \param Pointer to window slope or NULL if the requested window slope is not available.
147 const FIXP_WTP
* FDKgetWindowSlope(int length
, int shape
);
149 extern const FIXP_WTP sin_twiddle_L64
[];
152 * Filter coefficient type definition
155 #if defined(ARCH_PREFER_MULT_16x16) || defined(ARCH_PREFER_MULT_32x16)
156 #define QMF_COEFF_16BIT
159 #define QMF_FILTER_PROTOTYPE_SIZE 640
160 #define QMF_NO_POLY 5
162 #ifdef QMF_COEFF_16BIT
163 #define FIXP_PFT FIXP_SGL
164 #define FIXP_QTW FIXP_SGL
166 #define FIXP_PFT FIXP_DBL
167 #define FIXP_QTW FIXP_DBL
170 #define QMF640_PFT_TABLE_SIZE (640/2 + QMF_NO_POLY)
172 extern const FIXP_QTW qmf_phaseshift_cos32
[32];
173 extern const FIXP_QTW qmf_phaseshift_sin32
[32];
174 /* Adapted analysis post-twiddles for down-sampled HQ SBR */
175 extern const FIXP_QTW qmf_phaseshift_cos_downsamp32
[32];
176 extern const FIXP_QTW qmf_phaseshift_sin_downsamp32
[32];
177 extern const FIXP_QTW qmf_phaseshift_cos64
[64];
178 extern const FIXP_QTW qmf_phaseshift_sin64
[64];
180 extern const FIXP_PFT qmf_64
[QMF640_PFT_TABLE_SIZE
+QMF_NO_POLY
];
186 #define QMF640_CLDFB_PFT_TABLE_SIZE (640)
187 #define QMF320_CLDFB_PFT_TABLE_SIZE (320)
188 #define QMF_CLDFB_PFT_SCALE 1
190 extern const FIXP_QTW qmf_phaseshift_cos32_cldfb
[32];
191 extern const FIXP_QTW qmf_phaseshift_sin32_cldfb
[32];
192 extern const FIXP_QTW qmf_phaseshift_cos64_cldfb
[64];
193 extern const FIXP_QTW qmf_phaseshift_sin64_cldfb
[64];
195 extern const FIXP_PFT qmf_cldfb_640
[QMF640_CLDFB_PFT_TABLE_SIZE
];
196 extern const FIXP_PFT qmf_cldfb_320
[QMF320_CLDFB_PFT_TABLE_SIZE
];
203 * Raw Data Block list stuff.
206 element_instance_tag
,
209 ics_info
, /* ics_reserved_bit, window_sequence, window_shape, max_sfb, scale_factor_grouping, predictor_data_present, ltp_data_present, ltp_data */
211 ms
, /* ms_mask_present, ms_used */
212 /*predictor_data_present,*/ /* part of ics_info */
217 pulse
, /* pulse_data_present, pulse_data */
220 gain_control_data_present
,
226 scale_factor_data_usac
,
234 tns_active
, /* introduced in MPEG-D usac CD */
235 tns_data_present_usac
,
239 /* Non data list items */
252 struct element_list
{
254 const struct element_list
*next
[2];
257 typedef struct element_list element_list_t
;
259 * \brief get elementary stream pieces list for given parameters.
260 * \param aot audio object type
261 * \param epConfig the epConfig value from the current Audio Specific Config
262 * \param nChannels amount of channels contained in the current element.
263 * \param layer the layer of the current element.
264 * \return element_list_t parser guidance structure.
266 const element_list_t
* getBitstreamElementList(AUDIO_OBJECT_TYPE aot
, SCHAR epConfig
, UCHAR nChannels
, UCHAR layer
);