• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* -----------------------------------------------------------------------------
2 Software License for The Fraunhofer FDK AAC Codec Library for Android
3 
4 © Copyright  1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
5 Forschung e.V. All rights reserved.
6 
7  1.    INTRODUCTION
8 The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
9 that implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
10 scheme for digital audio. This FDK AAC Codec software is intended to be used on
11 a wide variety of Android devices.
12 
13 AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
14 general perceptual audio codecs. AAC-ELD is considered the best-performing
15 full-bandwidth communications codec by independent studies and is widely
16 deployed. AAC has been standardized by ISO and IEC as part of the MPEG
17 specifications.
18 
19 Patent licenses for necessary patent claims for the FDK AAC Codec (including
20 those of Fraunhofer) may be obtained through Via Licensing
21 (www.vialicensing.com) or through the respective patent owners individually for
22 the purpose of encoding or decoding bit streams in products that are compliant
23 with the ISO/IEC MPEG audio standards. Please note that most manufacturers of
24 Android devices already license these patent claims through Via Licensing or
25 directly from the patent owners, and therefore FDK AAC Codec software may
26 already be covered under those patent licenses when it is used for those
27 licensed purposes only.
28 
29 Commercially-licensed AAC software libraries, including floating-point versions
30 with enhanced sound quality, are also available from Fraunhofer. Users are
31 encouraged to check the Fraunhofer website for additional applications
32 information and documentation.
33 
34 2.    COPYRIGHT LICENSE
35 
36 Redistribution and use in source and binary forms, with or without modification,
37 are permitted without payment of copyright license fees provided that you
38 satisfy the following conditions:
39 
40 You must retain the complete text of this software license in redistributions of
41 the FDK AAC Codec or your modifications thereto in source code form.
42 
43 You must retain the complete text of this software license in the documentation
44 and/or other materials provided with redistributions of the FDK AAC Codec or
45 your modifications thereto in binary form. You must make available free of
46 charge copies of the complete source code of the FDK AAC Codec and your
47 modifications thereto to recipients of copies in binary form.
48 
49 The name of Fraunhofer may not be used to endorse or promote products derived
50 from this library without prior written permission.
51 
52 You may not charge copyright license fees for anyone to use, copy or distribute
53 the FDK AAC Codec software or your modifications thereto.
54 
55 Your modified versions of the FDK AAC Codec must carry prominent notices stating
56 that you changed the software and the date of any change. For modified versions
57 of the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
58 must be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
59 AAC Codec Library for Android."
60 
61 3.    NO PATENT LICENSE
62 
63 NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
64 limitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
65 Fraunhofer provides no warranty of patent non-infringement with respect to this
66 software.
67 
68 You may use this FDK AAC Codec software or modifications thereto only for
69 purposes that are authorized by appropriate patent licenses.
70 
71 4.    DISCLAIMER
72 
73 This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
74 holders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
75 including but not limited to the implied warranties of merchantability and
76 fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
77 CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
78 or consequential damages, including but not limited to procurement of substitute
79 goods or services; loss of use, data, or profits, or business interruption,
80 however caused and on any theory of liability, whether in contract, strict
81 liability, or tort (including negligence), arising in any way out of the use of
82 this software, even if advised of the possibility of such damage.
83 
84 5.    CONTACT INFORMATION
85 
86 Fraunhofer Institute for Integrated Circuits IIS
87 Attention: Audio and Multimedia Departments - FDK AAC LL
88 Am Wolfsmantel 33
89 91058 Erlangen, Germany
90 
91 www.iis.fraunhofer.de/amm
92 amm-info@iis.fraunhofer.de
93 ----------------------------------------------------------------------------- */
94 
95 /**************************** SBR encoder library ******************************
96 
97    Author(s):
98 
99    Description:
100 
101 *******************************************************************************/
102 
103 /*!
104   \file
105   \brief Memory layout
106   $Revision: 92864 $
107 
108   This module declares all static and dynamic memory spaces
109 */
110 #include "sbrenc_ram.h"
111 
112 #include "sbr.h"
113 #include "genericStds.h"
114 
115 C_AALLOC_MEM(Ram_SbrDynamic_RAM, FIXP_DBL,
116              ((SBR_ENC_DYN_RAM_SIZE) / sizeof(FIXP_DBL)))
117 
118 /*!
119   \name StaticSbrData
120 
121   Static memory areas, must not be overwritten in other sections of the encoder
122 */
123 /* @{ */
124 
125 /*! static sbr encoder instance for one encoder (2 channels)
126   all major static and dynamic memory areas are located
127   in module sbr_ram and sbr rom
128 */
129 C_ALLOC_MEM(Ram_SbrEncoder, SBR_ENCODER, 1)
130 C_ALLOC_MEM2(Ram_SbrChannel, SBR_CHANNEL, 1, (8))
131 C_ALLOC_MEM2(Ram_SbrElement, SBR_ELEMENT, 1, (8))
132 
133 /*! Filter states for QMF-analysis. <br>
134   Dimension: #MAXNRSBRCHANNELS * #SBR_QMF_FILTER_LENGTH
135 */
136 C_AALLOC_MEM2_L(Ram_Sbr_QmfStatesAnalysis, FIXP_QAS, 640, (8), SECT_DATA_L1)
137 
138 /*! Matrix holding the quota values for all estimates, all channels
139   Dimension #MAXNRSBRCHANNELS * +#SBR_QMF_CHANNELS* #MAX_NO_OF_ESTIMATES
140 */
141 C_ALLOC_MEM2_L(Ram_Sbr_quotaMatrix, FIXP_DBL, (MAX_NO_OF_ESTIMATES * 64), (8),
142                SECT_DATA_L1)
143 
144 /*! Matrix holding the sign values for all estimates, all channels
145   Dimension #MAXNRSBRCHANNELS * +#SBR_QMF_CHANNELS* #MAX_NO_OF_ESTIMATES
146 */
147 C_ALLOC_MEM2(Ram_Sbr_signMatrix, INT, (MAX_NO_OF_ESTIMATES * 64), (8))
148 
149 /*! Frequency band table (low res) <br>
150   Dimension #MAX_FREQ_COEFFS/2+1
151 */
152 C_ALLOC_MEM2(Ram_Sbr_freqBandTableLO, UCHAR, (MAX_FREQ_COEFFS / 2 + 1), (8))
153 
154 /*! Frequency band table (high res) <br>
155   Dimension #MAX_FREQ_COEFFS +1
156 */
157 C_ALLOC_MEM2(Ram_Sbr_freqBandTableHI, UCHAR, (MAX_FREQ_COEFFS + 1), (8))
158 
159 /*! vk matser table <br>
160   Dimension #MAX_FREQ_COEFFS +1
161 */
162 C_ALLOC_MEM2(Ram_Sbr_v_k_master, UCHAR, (MAX_FREQ_COEFFS + 1), (8))
163 
164 /*
165   Missing harmonics detection
166 */
167 
168 /*! sbr_detectionVectors <br>
169   Dimension #MAX_NUM_CHANNELS*#MAX_NO_OF_ESTIMATES*#MAX_FREQ_COEFFS]
170 */
171 C_ALLOC_MEM2(Ram_Sbr_detectionVectors, UCHAR,
172              (MAX_NO_OF_ESTIMATES * MAX_FREQ_COEFFS), (8))
173 
174 /*! sbr_prevCompVec[ <br>
175   Dimension #MAX_NUM_CHANNELS*#MAX_FREQ_COEFFS]
176 */
177 C_ALLOC_MEM2(Ram_Sbr_prevEnvelopeCompensation, UCHAR, MAX_FREQ_COEFFS, (8))
178 /*! sbr_guideScfb[ <br>
179   Dimension #MAX_NUM_CHANNELS*#MAX_FREQ_COEFFS]
180 */
181 C_ALLOC_MEM2(Ram_Sbr_guideScfb, UCHAR, MAX_FREQ_COEFFS, (8))
182 
183 /*! sbr_guideVectorDetected <br>
184   Dimension #MAX_NUM_CHANNELS*#MAX_NO_OF_ESTIMATES*#MAX_FREQ_COEFFS]
185 */
186 C_ALLOC_MEM2(Ram_Sbr_guideVectorDetected, UCHAR,
187              (MAX_NO_OF_ESTIMATES * MAX_FREQ_COEFFS), (8))
188 C_ALLOC_MEM2(Ram_Sbr_guideVectorDiff, FIXP_DBL,
189              (MAX_NO_OF_ESTIMATES * MAX_FREQ_COEFFS), (8))
190 C_ALLOC_MEM2(Ram_Sbr_guideVectorOrig, FIXP_DBL,
191              (MAX_NO_OF_ESTIMATES * MAX_FREQ_COEFFS), (8))
192 
193 /*
194   Static Parametric Stereo memory
195 */
196 C_AALLOC_MEM_L(Ram_PsQmfStatesSynthesis, FIXP_DBL, 640 / 2, SECT_DATA_L1)
197 
198 C_ALLOC_MEM_L(Ram_PsEncode, PS_ENCODE, 1, SECT_DATA_L1)
199 C_ALLOC_MEM(Ram_ParamStereo, PARAMETRIC_STEREO, 1)
200 
201 /* @} */
202 
203 /*!
204   \name DynamicSbrData
205 
206   Dynamic memory areas, might be reused in other algorithm sections,
207   e.g. the core encoder.
208 */
209 /* @{ */
210 
211 /*! Energy buffer for envelope extraction <br>
212   Dimension #MAXNRSBRCHANNELS * +#SBR_QMF_SLOTS *  #SBR_QMF_CHANNELS
213 */
214 C_ALLOC_MEM2(Ram_Sbr_envYBuffer, FIXP_DBL, (32 / 2 * 64), (8))
215 
GetRam_Sbr_envYBuffer(int n,UCHAR * dynamic_RAM)216 FIXP_DBL* GetRam_Sbr_envYBuffer(int n, UCHAR* dynamic_RAM) {
217   FDK_ASSERT(dynamic_RAM != 0);
218   /* The reinterpret_cast is used to suppress a compiler warning. We know that
219    * (dynamic_RAM + OFFSET_NRG + (n*Y_2_BUF_BYTE)) is sufficiently aligned, so
220    * the cast is safe */
221   return reinterpret_cast<FIXP_DBL*>(
222       reinterpret_cast<void*>(dynamic_RAM + OFFSET_NRG + (n * Y_2_BUF_BYTE)));
223 }
224 
225 /*
226  * QMF data
227  */
228 /* The SBR encoder uses a single channel overlapping buffer set (always n=0),
229  * but PS does not. */
GetRam_Sbr_envRBuffer(int n,UCHAR * dynamic_RAM)230 FIXP_DBL* GetRam_Sbr_envRBuffer(int n, UCHAR* dynamic_RAM) {
231   FDK_ASSERT(dynamic_RAM != 0);
232   /* The reinterpret_cast is used to suppress a compiler warning. We know that
233    * (dynamic_RAM + OFFSET_QMF + (n*(ENV_R_BUFF_BYTE+ENV_I_BUFF_BYTE))) is
234    * sufficiently aligned, so the cast is safe */
235   return reinterpret_cast<FIXP_DBL*>(reinterpret_cast<void*>(
236       dynamic_RAM + OFFSET_QMF + (n * (ENV_R_BUFF_BYTE + ENV_I_BUFF_BYTE))));
237 }
GetRam_Sbr_envIBuffer(int n,UCHAR * dynamic_RAM)238 FIXP_DBL* GetRam_Sbr_envIBuffer(int n, UCHAR* dynamic_RAM) {
239   FDK_ASSERT(dynamic_RAM != 0);
240   /* The reinterpret_cast is used to suppress a compiler warning. We know that
241    * (dynamic_RAM + OFFSET_QMF + (ENV_R_BUFF_BYTE) +
242    * (n*(ENV_R_BUFF_BYTE+ENV_I_BUFF_BYTE))) is sufficiently aligned, so the cast
243    * is safe */
244   return reinterpret_cast<FIXP_DBL*>(
245       reinterpret_cast<void*>(dynamic_RAM + OFFSET_QMF + (ENV_R_BUFF_BYTE) +
246                               (n * (ENV_R_BUFF_BYTE + ENV_I_BUFF_BYTE))));
247 }
248 
249 /* @} */
250