1
2/* -----------------------------------------------------------------------------------------------------------
3Software License for The Fraunhofer FDK AAC Codec Library for Android
4
5© Copyright  1995 - 2012 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):   Oliver Moser
87   Description: ROM tables used by FDK tools
88
89******************************************************************************/
90
91#ifndef __FDK_TOOLS_ROM_H__
92#define __FDK_TOOLS_ROM_H__
93
94#include "common_fix.h"
95#include "FDK_audio.h"
96
97
98/* None radix2 rotation vectors */
99extern const FIXP_STB RotVectorReal60[60];
100extern const FIXP_STB RotVectorImag60[60];
101extern const FIXP_STB RotVectorReal240[240];
102extern const FIXP_STB RotVectorImag240[240];
103extern const FIXP_STB RotVectorReal480[480];
104extern const FIXP_STB RotVectorImag480[480];
105
106
107/* Regular sine tables */
108extern const FIXP_STP SineTable512[];
109extern const FIXP_STP SineTable480[];
110
111/* AAC-LC windows */
112extern const FIXP_WTP SineWindow1024[];
113extern const FIXP_WTP KBDWindow1024[];
114extern const FIXP_WTP SineWindow128[];
115extern const FIXP_WTP KBDWindow128[];
116
117extern const FIXP_WTP SineWindow960[];
118extern const FIXP_WTP KBDWindow960[];
119extern const FIXP_WTP SineWindow120[];
120extern const FIXP_WTP KBDWindow120[];
121
122/* AAC-LD windows */
123extern const FIXP_WTP SineWindow512[];
124#define LowOverlapWindow512 SineWindow128
125extern const FIXP_WTP SineWindow480[];
126#define LowOverlapWindow480 SineWindow120
127
128
129
130extern const FIXP_WTP SineWindow64[];
131extern const FIXP_WTP SineWindow32[];
132
133/**
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.
137 */
138extern const FIXP_WTP *const windowSlopes[2][3][9];
139
140/**
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.
146 */
147const FIXP_WTP * FDKgetWindowSlope(int length, int shape);
148
149extern const FIXP_WTP sin_twiddle_L64[];
150
151/*
152 * Filter coefficient type definition
153 */
154
155#if defined(ARCH_PREFER_MULT_16x16) || defined(ARCH_PREFER_MULT_32x16)
156  #define QMF_COEFF_16BIT
157#endif
158
159#define QMF_FILTER_PROTOTYPE_SIZE    640
160#define QMF_NO_POLY                  5
161
162#ifdef QMF_COEFF_16BIT
163  #define FIXP_PFT FIXP_SGL
164  #define FIXP_QTW FIXP_SGL
165#else
166  #define FIXP_PFT FIXP_DBL
167  #define FIXP_QTW FIXP_DBL
168#endif
169
170#define QMF640_PFT_TABLE_SIZE       (640/2 + QMF_NO_POLY)
171
172extern const FIXP_QTW qmf_phaseshift_cos32[32];
173extern const FIXP_QTW qmf_phaseshift_sin32[32];
174extern const FIXP_QTW qmf_phaseshift_cos64[64];
175extern const FIXP_QTW qmf_phaseshift_sin64[64];
176
177extern const FIXP_PFT qmf_64[QMF640_PFT_TABLE_SIZE+QMF_NO_POLY];
178
179
180
181
182
183#define QMF640_CLDFB_PFT_TABLE_SIZE (640)
184#define QMF320_CLDFB_PFT_TABLE_SIZE (320)
185#define QMF_CLDFB_PFT_SCALE 1
186
187extern const FIXP_QTW qmf_phaseshift_cos32_cldfb[32];
188extern const FIXP_QTW qmf_phaseshift_sin32_cldfb[32];
189extern const FIXP_QTW qmf_phaseshift_cos64_cldfb[64];
190extern const FIXP_QTW qmf_phaseshift_sin64_cldfb[64];
191
192extern const FIXP_PFT qmf_cldfb_640[QMF640_CLDFB_PFT_TABLE_SIZE];
193extern const FIXP_PFT qmf_cldfb_320[QMF320_CLDFB_PFT_TABLE_SIZE];
194
195
196
197
198
199/*
200 * Raw Data Block list stuff.
201 */
202typedef enum {
203  element_instance_tag,
204  common_window,
205  global_gain,
206  ics_info, /* ics_reserved_bit, window_sequence, window_shape, max_sfb, scale_factor_grouping, predictor_data_present, ltp_data_present, ltp_data */
207  max_sfb,
208  ms, /* ms_mask_present, ms_used */
209  /*predictor_data_present,*/ /* part of ics_info */
210  ltp_data_present,
211  ltp_data,
212  section_data,
213  scale_factor_data,
214  pulse, /* pulse_data_present, pulse_data  */
215  tns_data_present,
216  tns_data,
217  gain_control_data_present,
218  gain_control_data,
219  esc1_hcr,
220  esc2_rvlc,
221  spectral_data,
222
223  scale_factor_data_usac,
224  core_mode,
225  common_tw,
226  lpd_channel_stream,
227  tw_data,
228  noise,
229  ac_spectral_data,
230  fac_data,
231  tns_active, /* introduced in MPEG-D usac CD */
232  tns_data_present_usac,
233  common_max_sfb,
234
235
236  /* Non data list items */
237  adtscrc_start_reg1,
238  adtscrc_start_reg2,
239  adtscrc_end_reg1,
240  adtscrc_end_reg2,
241  drmcrc_start_reg,
242  drmcrc_end_reg,
243  next_channel,
244  next_channel_loop,
245  link_sequence,
246  end_of_sequence
247} rbd_id_t;
248
249struct element_list {
250  const rbd_id_t *id;
251  const struct element_list *next[2];
252};
253
254typedef struct element_list element_list_t;
255/**
256 * \brief get elementary stream pieces list for given parameters.
257 * \param aot audio object type
258 * \param epConfig the epConfig value from the current Audio Specific Config
259 * \param nChannels amount of channels contained in the current element.
260 * \param layer the layer of the current element.
261 * \return element_list_t parser guidance structure.
262 */
263const element_list_t * getBitstreamElementList(AUDIO_OBJECT_TYPE aot, SCHAR epConfig, UCHAR nChannels, UCHAR layer);
264
265
266#endif
267
268