/src/aac/libSACdec/src/sac_dec.h
Line  | Count  | Source  | 
1  |  | /* -----------------------------------------------------------------------------  | 
2  |  | Software License for The Fraunhofer FDK AAC Codec Library for Android  | 
3  |  |  | 
4  |  | © Copyright  1995 - 2019 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  |  | /*********************** MPEG surround decoder library *************************  | 
96  |  |  | 
97  |  |    Author(s):  | 
98  |  |  | 
99  |  |    Description: SAC Decoder Library structures  | 
100  |  |  | 
101  |  | *******************************************************************************/  | 
102  |  |  | 
103  |  | #ifndef SAC_DEC_H  | 
104  |  | #define SAC_DEC_H  | 
105  |  |  | 
106  |  | #include "common_fix.h"  | 
107  |  |  | 
108  |  | #include "sac_dec_interface.h" /* library interface in ../include */  | 
109  |  |  | 
110  |  | #include "FDK_qmf_domain.h"  | 
111  |  | #include "sac_qmf.h"  | 
112  |  | #include "FDK_bitstream.h" /* mp4 bitbuffer */  | 
113  |  | #include "sac_calcM1andM2.h"  | 
114  |  | #include "FDK_hybrid.h"  | 
115  |  | #include "FDK_decorrelate.h"  | 
116  |  | #include "sac_reshapeBBEnv.h"  | 
117  |  |  | 
118  |  | #include "sac_dec_conceal.h"  | 
119  |  |  | 
120  |  | #include "sac_tsd.h"  | 
121  |  |  | 
122  |  | #ifndef MAX  | 
123  | 252k  | #define MAX(a, b) ((a) > (b) ? (a) : (b))  | 
124  |  | #endif  | 
125  |  |  | 
126  | 318k  | #define ICCdefault 0  | 
127  | 24.6k  | #define IPDdefault 0  | 
128  | 4.10k  | #define arbdmxGainDefault 0  | 
129  |  | #define CPCdefault 10  | 
130  |  | #define tttCLD1default 15  | 
131  |  | #define tttCLD2default 0  | 
132  |  |  | 
133  |  | #define IS_HQ_ONLY(aot)                                                      \  | 
134  |  |   ((aot) == AOT_ER_AAC_LD || (aot) == AOT_ER_AAC_ELD || (aot) == AOT_USAC || \  | 
135  |  |    (aot) == AOT_RSVD50)  | 
136  |  |  | 
137  |  | #define SCONST(x) FL2FXCONST_DBL(x)  | 
138  |  |  | 
139  | 0  | #define PC_NUM_BANDS (8)  | 
140  | 0  | #define PC_NUM_HYB_BANDS (PC_NUM_BANDS - 3 + 10)  | 
141  |  | #define ABS_THR (1e-9f * 32768 * 32768)  | 
142  |  |  | 
143  |  | #define MAX_HYBRID_BANDS (MAX_NUM_QMF_BANDS - 3 + 10)  | 
144  | 4.67M  | #define HYBRID_FILTER_DELAY (6)  | 
145  |  |  | 
146  |  | #define MAX_RESIDUAL_FRAMES (4)  | 
147  |  | #define MAX_RESIDUAL_BISTREAM \  | 
148  |  |   (836) /*  48000 bps * 3 res / (8 * 44100 / 2048 ) */  | 
149  |  | #define MAX_MDCT_COEFFS (1024)  | 
150  |  | #define SACDEC_RESIDUAL_BS_BUF_SIZE \  | 
151  |  |   (1024) /* used to setup and check residual bitstream buffer */  | 
152  |  |  | 
153  |  | #define MAX_NUM_PARAMS (MAX_NUM_OTT + 4 * MAX_NUM_TTT + MAX_INPUT_CHANNELS)  | 
154  | 252k  | #define MAX_NUM_PARAMETERS (MAX(MAX_NUM_PARAMS, MAX_NUM_OTT))  | 
155  |  |  | 
156  | 1.09M  | #define MAX_PARAMETER_SETS (9)  | 
157  |  |  | 
158  | 0  | #define MAX_M2_INPUT (MAX_OUTPUT_CHANNELS) /* 3 direct + 5 diffuse */  | 
159  |  |  | 
160  |  | #define MAX_QMF_BANDS_TO_HYBRID \  | 
161  | 9.58M  |   (3) /* 3 bands are filtered again in "40 bands" case */  | 
162  | 108k  | #define PROTO_LEN (13)  | 
163  | 54.3k  | #define BUFFER_LEN_LF (PROTO_LEN)  | 
164  | 54.3k  | #define BUFFER_LEN_HF ((PROTO_LEN - 1) / 2)  | 
165  |  |  | 
166  |  | #define MAX_NO_DECORR_CHANNELS (MAX_OUTPUT_CHANNELS)  | 
167  |  | #define HRTF_AZIMUTHS (5)  | 
168  |  |  | 
169  |  | #define MAX_NUM_OTT_AT 0  | 
170  |  |  | 
171  |  | /* left out */  | 
172  |  |  | 
173  |  | typedef enum { | 
174  |  |   UPMIXTYPE_BYPASS = -1, /*just bypass the input channels without processing*/  | 
175  |  |   UPMIXTYPE_NORMAL = 0   /*multichannel loudspeaker upmix with spatial data*/  | 
176  |  | } UPMIXTYPE;  | 
177  |  |  | 
178  | 13.1M  | static inline int isTwoChMode(UPMIXTYPE upmixType) { | 
179  | 13.1M  |   int retval = 0;  | 
180  | 13.1M  |   return retval;  | 
181  | 13.1M  | } Unexecuted instantiation: sac_bitdec.cpp:isTwoChMode(UPMIXTYPE) Unexecuted instantiation: sac_calcM1andM2.cpp:isTwoChMode(UPMIXTYPE) sac_dec.cpp:isTwoChMode(UPMIXTYPE) Line  | Count  | Source  |  178  | 6.58M  | static inline int isTwoChMode(UPMIXTYPE upmixType) { |  179  | 6.58M  |   int retval = 0;  |  180  | 6.58M  |   return retval;  |  181  | 6.58M  | }  |  
 Unexecuted instantiation: sac_dec_lib.cpp:isTwoChMode(UPMIXTYPE) sac_process.cpp:isTwoChMode(UPMIXTYPE) Line  | Count  | Source  |  178  | 6.54M  | static inline int isTwoChMode(UPMIXTYPE upmixType) { |  179  | 6.54M  |   int retval = 0;  |  180  | 6.54M  |   return retval;  |  181  | 6.54M  | }  |  
 Unexecuted instantiation: sac_qmf.cpp:isTwoChMode(UPMIXTYPE) Unexecuted instantiation: sac_reshapeBBEnv.cpp:isTwoChMode(UPMIXTYPE) Unexecuted instantiation: sac_rom.cpp:isTwoChMode(UPMIXTYPE) Unexecuted instantiation: sac_smoothing.cpp:isTwoChMode(UPMIXTYPE) Unexecuted instantiation: sac_stp.cpp:isTwoChMode(UPMIXTYPE)  | 
182  |  |  | 
183  |  |   /* left out end */  | 
184  |  |  | 
185  | 416k  | #define MPEGS_BYPASSMODE (0x00000001)  | 
186  | 827k  | #define MPEGS_CONCEAL (0x00000002)  | 
187  |  |  | 
188  |  | typedef struct STP_DEC *HANDLE_STP_DEC;  | 
189  |  |  | 
190  |  | typedef struct { | 
191  |  |   SCHAR bsQuantCoarseXXXprev;  | 
192  |  |   SCHAR bsQuantCoarseXXXprevParse;  | 
193  |  | } LOSSLESSSTATE;  | 
194  |  |  | 
195  |  | typedef struct { | 
196  |  |   SCHAR bsXXXDataMode[MAX_PARAMETER_SETS];  | 
197  |  |   SCHAR bsQuantCoarseXXX[MAX_PARAMETER_SETS];  | 
198  |  |   SCHAR bsFreqResStrideXXX[MAX_PARAMETER_SETS];  | 
199  |  |   SCHAR nocmpQuantCoarseXXX[MAX_PARAMETER_SETS];  | 
200  |  |   LOSSLESSSTATE *state; /* Link to persistent state information */  | 
201  |  | } LOSSLESSDATA;  | 
202  |  |  | 
203  |  | struct SPATIAL_BS_FRAME_struct { | 
204  |  |   UCHAR bsIndependencyFlag;  | 
205  |  |   UCHAR newBsData;  | 
206  |  |   UCHAR numParameterSets;  | 
207  |  |  | 
208  |  |   /*  | 
209  |  |   If bsFramingType == 0, then the paramSlot[ps] for 0 <= ps < numParamSets is  | 
210  |  |   calculated as follows: paramSlot[ps] = ceil(numSlots*(ps+1)/numParamSets) - 1  | 
211  |  |   Otherwise, it is  | 
212  |  |     paramSlot[ps] = bsParamSlot[ps]  | 
213  |  |   */  | 
214  |  |   INT paramSlot[MAX_PARAMETER_SETS];  | 
215  |  |  | 
216  |  |   /* These arrays contain the compact indices, only one value per pbstride, only  | 
217  |  |    * paramsets actually containing data. */  | 
218  |  |   /* These values are written from the parser in ecDataDec() and read during  | 
219  |  |    * decode in mapIndexData() */  | 
220  |  |   SCHAR cmpOttCLDidx[MAX_NUM_OTT + MAX_NUM_OTT_AT][MAX_PARAMETER_SETS]  | 
221  |  |                     [MAX_PARAMETER_BANDS];  | 
222  |  |   SCHAR cmpOttICCidx[MAX_NUM_OTT][MAX_PARAMETER_SETS][MAX_PARAMETER_BANDS];  | 
223  |  |  | 
224  |  |   /* Smoothing */  | 
225  |  |   UCHAR bsSmoothMode[MAX_PARAMETER_SETS];  | 
226  |  |   UCHAR bsSmoothTime[MAX_PARAMETER_SETS];  | 
227  |  |   UCHAR bsFreqResStrideSmg[MAX_PARAMETER_SETS];  | 
228  |  |   UCHAR bsSmgData[MAX_PARAMETER_SETS]  | 
229  |  |                  [MAX_PARAMETER_BANDS]; /* smoothing flags, one if band is  | 
230  |  |                                            smoothed, otherwise zero */  | 
231  |  |  | 
232  |  |   /* Arbitrary Downmix */  | 
233  |  |   SCHAR (*cmpArbdmxGainIdx)[MAX_PARAMETER_SETS][MAX_PARAMETER_BANDS];  | 
234  |  |  | 
235  |  |   /* Lossless control */  | 
236  |  |   LOSSLESSDATA *CLDLosslessData;  | 
237  |  |   LOSSLESSDATA *ICCLosslessData;  | 
238  |  |   /* LOSSLESSDATA *ADGLosslessData; -> is stored in CLDLosslessData[offset] */  | 
239  |  |  | 
240  |  |   LOSSLESSDATA *IPDLosslessData;  | 
241  |  |   SCHAR (*cmpOttIPDidx)[MAX_PARAMETER_SETS][MAX_PARAMETER_BANDS];  | 
242  |  |   int phaseMode;  | 
243  |  |   int OpdSmoothingMode;  | 
244  |  |  | 
245  |  |   UCHAR tempShapeEnableChannelGES[MAX_OUTPUT_CHANNELS]; /*!< GES side info. */  | 
246  |  |   UCHAR bsEnvShapeData[MAX_OUTPUT_CHANNELS]  | 
247  |  |                       [MAX_TIME_SLOTS]; /*!< GES side info (quantized). */  | 
248  |  |  | 
249  |  |   UCHAR tempShapeEnableChannelSTP[MAX_OUTPUT_CHANNELS]; /*!< STP side info. */  | 
250  |  |  | 
251  |  |   TSD_DATA TsdData[1]; /*!< TSD data structure. */  | 
252  |  | };  | 
253  |  |  | 
254  |  | typedef struct { | 
255  |  |   /* Lossless state */  | 
256  |  |   LOSSLESSSTATE CLDLosslessState[MAX_NUM_PARAMETERS];  | 
257  |  |   LOSSLESSSTATE ICCLosslessState[MAX_NUM_PARAMETERS];  | 
258  |  |   LOSSLESSSTATE IPDLosslessState[MAX_NUM_PARAMETERS];  | 
259  |  | } BS_LL_STATE;  | 
260  |  |  | 
261  |  | typedef struct { | 
262  |  |   int prevParamSlot;  | 
263  |  |   int prevSmgTime;  | 
264  |  |   UCHAR prevSmgData[MAX_PARAMETER_BANDS];  | 
265  |  |  | 
266  |  |   FIXP_DBL opdLeftState__FDK[MAX_PARAMETER_BANDS];  | 
267  |  |   FIXP_DBL opdRightState__FDK[MAX_PARAMETER_BANDS];  | 
268  |  |  | 
269  |  | } SMOOTHING_STATE;  | 
270  |  |  | 
271  |  | typedef struct { | 
272  |  |   FIXP_DBL alpha__FDK;  | 
273  |  |   FIXP_DBL beta__FDK;  | 
274  |  |   FIXP_DBL partNrgPrev__FDK[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS]  | 
275  |  |                            [BB_ENV_SIZE];  | 
276  |  |   FIXP_DBL normNrgPrev__FDK[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS];  | 
277  |  |   FIXP_DBL frameNrgPrev__FDK[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS];  | 
278  |  |   INT partNrgPrevSF[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS];  | 
279  |  |   INT partNrgPrev2SF[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS];  | 
280  |  |   INT normNrgPrevSF[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS];  | 
281  |  |   INT frameNrgPrevSF[2 * MAX_OUTPUT_CHANNELS + MAX_INPUT_CHANNELS];  | 
282  |  | } RESHAPE_BBENV_STATE;  | 
283  |  |  | 
284  |  | typedef struct { | 
285  |  |   int maxNumInputChannels;  | 
286  |  |   int maxNumOutputChannels;  | 
287  |  |   int maxNumQmfBands;  | 
288  |  |   int maxNumHybridBands;  | 
289  |  |   int maxNumXChannels;  | 
290  |  |   int maxNumVChannels;  | 
291  |  |   int maxNumDecorChannels;  | 
292  |  |   int maxNumCmplxQmfBands;  | 
293  |  |   int maxNumCmplxHybBands;  | 
294  |  |   int maxNumResChannels;  | 
295  |  |   int bProcResidual; /* process residual */  | 
296  |  |   int maxNumResidualChannels;  | 
297  |  |   int maxNumOttBoxes;  | 
298  |  |   int maxNumParams;  | 
299  |  |  | 
300  |  | } SACDEC_CREATION_PARAMS;  | 
301  |  |  | 
302  |  | struct spatialDec_struct { | 
303  |  |   SACDEC_ERROR  | 
304  |  |   errInt;             /* Field to store internal errors.  | 
305  |  |                          Will be clear at the very beginning of each process call. */  | 
306  |  |   int staticDecScale; /* static scale of decoder */  | 
307  |  |  | 
308  |  |   /* GENERAL */  | 
309  |  |   int samplingFreq;       /* [Hz] */  | 
310  |  |   CFG_LEVEL decoderLevel; /* 0..5 */  | 
311  |  |   CFG_EXTENT decoderMode;  | 
312  |  |   CFG_BINAURAL binauralMode;  | 
313  |  |  | 
314  |  |   SACDEC_CREATION_PARAMS createParams;  | 
315  |  |  | 
316  |  |   int numComplexProcessingBands;  | 
317  |  |  | 
318  |  |   int treeConfig; /* TREE_5151 = 5151, TREE_5152 = 5152, TREE_525 = 525, defined  | 
319  |  |                      in sac_bitdec.h */  | 
320  |  |  | 
321  |  |   int numInputChannels;  /* 1 (M) or 2 (L,R) */  | 
322  |  |   int numOutputChannels; /* 6 for 3/2.1 (FL,FR,FC,LF,BL,BR) */  | 
323  |  |   int numOttBoxes;       /* number of ott boxes */  | 
324  |  |   int numM2rows;  | 
325  |  |  | 
326  |  |   int numOutputChannelsAT; /* Number of output channels after arbitrary tree  | 
327  |  |                               processing */  | 
328  |  |  | 
329  |  |   int quantMode; /* QUANT_FINE, QUANT_EBQ1, QUANT_EBQ2, defined in sac_bitdec.h  | 
330  |  |                   */  | 
331  |  |   int arbitraryDownmix; /* (arbitraryDownmix != 0) 1 arbitrary downmix data  | 
332  |  |                            present, 2 arbitrary downmix residual data present*/  | 
333  |  |   int residualCoding;   /* (residualCoding != 0) => residual coding data present  | 
334  |  |                          */  | 
335  |  |   UCHAR nrResidualFrame;  | 
336  |  |   UCHAR nrArbDownmixResidualFrame;  | 
337  |  |   FDK_BITSTREAM **hResidualBitstreams;  | 
338  |  |   int tempShapeConfig; /* */  | 
339  |  |   int decorrType;      /* Indicates to use PS or none PS decorrelator. */  | 
340  |  |   int decorrConfig;    /* chosen decorrelator */  | 
341  |  |   int envQuantMode;    /* quantization mode of envelope reshaping data */  | 
342  |  |  | 
343  |  |   FIXP_DBL clipProtectGain__FDK; /* global gain for upmix */  | 
344  |  |   char clipProtectGainSF__FDK;   /* global gain for upmix */  | 
345  |  |  | 
346  |  |   /* Currently ignoring center decorr  | 
347  |  |      numVChannels = numDirektSignals + numDecorSignals */  | 
348  |  |   int numDirektSignals;  /* needed for W, Number of direkt signals 515 -> 1 525  | 
349  |  |                             -> 3 */  | 
350  |  |   int wStartResidualIdx; /* Where to start read residuals for W, = 0 for 515, =  | 
351  |  |                             1 for 525 since one residual is used in V */  | 
352  |  |   int numDecorSignals;   /* needed for W, Number of residual and decorrelated  | 
353  |  |                             signals, = 2, 3 for center deccorelation*/  | 
354  |  |   int numVChannels;      /* direct signals + decorelator signals */  | 
355  |  |   int numXChannels;      /* direct input signals + TTT-residuals */  | 
356  |  |  | 
357  |  |   int timeSlots;    /* length of spatial frame in QMF samples */  | 
358  |  |   int curTimeSlot;  /* pointer to the current time slot used for hyperframing */  | 
359  |  |   int prevTimeSlot; /*  */  | 
360  |  |   int curPs;  | 
361  |  |   int frameLength; /* number of output waveform samples/channel/frame */  | 
362  |  |   UPMIXTYPE upmixType;  | 
363  |  |   int partiallyComplex;  | 
364  |  |   int useFDreverb;  | 
365  |  |  | 
366  |  |   int bShareDelayWithSBR;  | 
367  |  |  | 
368  |  |   int tp_hybBandBorder; /* Hybrid band indicating the HP filter cut-off. */  | 
369  |  |  | 
370  |  |   /* FREQUENCY MAPPING */  | 
371  |  |   int qmfBands;  | 
372  |  |   int hybridBands;  | 
373  |  |   const SCHAR *kernels; /* Mapping hybrid band to parameter band. */  | 
374  |  |  | 
375  |  |   int TsdTs; /**< TSD QMF slot counter 0<= ts < numSlots */  | 
376  |  |  | 
377  |  |   int *param2hyb; /* Mapping parameter bands to hybrid bands */  | 
378  |  |   int kernels_width[MAX_PARAMETER_BANDS]; /* Mapping parmeter band to hybrid  | 
379  |  |                                              band offsets. */  | 
380  |  |  | 
381  |  |   /* Residual coding */  | 
382  |  |   int residualSamplingFreq;  | 
383  |  |   UCHAR residualPresent[MAX_NUM_OTT + MAX_NUM_TTT];  | 
384  |  |   UCHAR residualBands[MAX_NUM_OTT + MAX_NUM_TTT];    /* 0, if no residual data  | 
385  |  |                                                         present for this box */  | 
386  |  |   UCHAR residualQMFBands[MAX_NUM_OTT + MAX_NUM_TTT]; /* needed for optimized  | 
387  |  |                                                         mdct2qmf calculation */  | 
388  |  |   SPATIAL_SPECIFIC_CONFIG *pConfigCurrent;  | 
389  |  |  | 
390  |  |   int arbdmxFramesPerSpatialFrame;  | 
391  |  |   int arbdmxUpdQMF;  | 
392  |  |  | 
393  |  |   int numParameterBands; /* Number of parameter bands 40, 28, 20, 14, 10, ...  | 
394  |  |                             .*/  | 
395  |  |   int bitstreamParameterBands;  | 
396  |  |   int *numOttBands; /* number of bands for each ott, is != numParameterBands for  | 
397  |  |                        LFEs */  | 
398  |  |  | 
399  |  |   /* 1 MAPPING */  | 
400  |  |   UCHAR extendFrame;  | 
401  |  |   UCHAR numParameterSetsPrev;  | 
402  |  |  | 
403  |  |   int *smgTime;  | 
404  |  |   UCHAR **smgData;  | 
405  |  |  | 
406  |  |   /* PARAMETER DATA decoded and dequantized */  | 
407  |  |  | 
408  |  |   /* Last parameters from prev frame required during decode in mapIndexData()  | 
409  |  |    * and not touched during parse */  | 
410  |  |   SCHAR **ottCLDidxPrev;  | 
411  |  |   SCHAR **ottICCidxPrev;  | 
412  |  |   SCHAR **arbdmxGainIdxPrev;  | 
413  |  |   SCHAR **ottIPDidxPrev;  | 
414  |  |   SCHAR ***outIdxData; /* is this really persistent memory ? */  | 
415  |  |  | 
416  |  |   /* State mem required during parse in SpatialDecParseFrameData() */  | 
417  |  |   SCHAR **cmpOttCLDidxPrev;  | 
418  |  |   SCHAR **cmpOttICCidxPrev;  | 
419  |  |   SCHAR ***ottICCdiffidx;  | 
420  |  |   SCHAR **cmpOttIPDidxPrev;  | 
421  |  |  | 
422  |  |   /* State mem required in parseArbitraryDownmixData */  | 
423  |  |   SCHAR **cmpArbdmxGainIdxPrev;  | 
424  |  |  | 
425  |  |   SCHAR ***ottCLD__FDK;  | 
426  |  |   SCHAR ***ottICC__FDK;  | 
427  |  |  | 
428  |  |   SCHAR ***arbdmxGain__FDK; /* Holds the artistic downmix correction index.*/  | 
429  |  |  | 
430  |  |   FIXP_DBL *arbdmxAlpha__FDK;  | 
431  |  |   FIXP_DBL *arbdmxAlphaPrev__FDK;  | 
432  |  |  | 
433  |  |   UCHAR stereoConfigIndex;  | 
434  |  |   int highRateMode;  | 
435  |  |  | 
436  |  |   int phaseCoding;  | 
437  |  |  | 
438  |  |   SCHAR ***ottIPD__FDK;  | 
439  |  |  | 
440  |  |   FIXP_DBL PhaseLeft__FDK[MAX_PARAMETER_BANDS];  | 
441  |  |   FIXP_DBL PhaseRight__FDK[MAX_PARAMETER_BANDS];  | 
442  |  |   FIXP_DBL PhasePrevLeft__FDK[MAX_PARAMETER_BANDS];  | 
443  |  |   FIXP_DBL PhasePrevRight__FDK[MAX_PARAMETER_BANDS];  | 
444  |  |   int numOttBandsIPD;  | 
445  |  |  | 
446  |  |   /* GAIN MATRICIES FOR CURRENT and PREVIOUS PARMATER SET(s)*/  | 
447  |  |   FIXP_DBL ***M2Real__FDK;  | 
448  |  |   FIXP_DBL ***M2Imag__FDK;  | 
449  |  |   FIXP_DBL ***M2RealPrev__FDK;  | 
450  |  |   FIXP_DBL ***M2ImagPrev__FDK;  | 
451  |  |  | 
452  |  |   /* INPUT SIGNALS */  | 
453  |  |   FIXP_DBL ***qmfInputRealDelayBuffer__FDK;  | 
454  |  |   FIXP_DBL ***qmfInputImagDelayBuffer__FDK;  | 
455  |  |  | 
456  |  |   int pc_filterdelay; /* additional delay to align HQ with LP before hybird  | 
457  |  |                          analysis */  | 
458  |  |   int qmfInputDelayBufPos;  | 
459  |  |   FIXP_DBL **qmfInputReal__FDK;  | 
460  |  |   FIXP_DBL **qmfInputImag__FDK;  | 
461  |  |  | 
462  |  |   FIXP_DBL **hybInputReal__FDK;  | 
463  |  |   FIXP_DBL **hybInputImag__FDK;  | 
464  |  |  | 
465  |  |   FIXP_DBL **binInputReverb;  | 
466  |  |  | 
467  |  |   FIXP_DBL binGain, reverbGain;  | 
468  |  |   FIXP_DBL binCenterGain, reverbCenterGain;  | 
469  |  |  | 
470  |  |   /* RESIDUAL SIGNALS */  | 
471  |  |  | 
472  |  |   FIXP_DBL ***qmfResidualReal__FDK;  | 
473  |  |   FIXP_DBL ***qmfResidualImag__FDK;  | 
474  |  |  | 
475  |  |   FIXP_DBL **hybResidualReal__FDK;  | 
476  |  |   FIXP_DBL **hybResidualImag__FDK;  | 
477  |  |  | 
478  |  |   int qmfOutputRealDryDelayBufPos;  | 
479  |  |   FIXP_DBL ***qmfOutputRealDryDelayBuffer__FDK;  | 
480  |  |   FIXP_DBL ***qmfOutputImagDryFilterBuffer__FDK;  | 
481  |  |   FIXP_DBL *qmfOutputImagDryFilterBufferBase__FDK;  | 
482  |  |  | 
483  |  |   /* TEMPORARY SIGNALS */  | 
484  |  |  | 
485  |  |   FIXP_DBL **wReal__FDK;  | 
486  |  |   FIXP_DBL **wImag__FDK;  | 
487  |  |  | 
488  |  |   /* OUTPUT SIGNALS */  | 
489  |  |   FIXP_DBL **hybOutputRealDry__FDK;  | 
490  |  |   FIXP_DBL **hybOutputImagDry__FDK;  | 
491  |  |   FIXP_DBL **hybOutputRealWet__FDK;  | 
492  |  |   FIXP_DBL **hybOutputImagWet__FDK;  | 
493  |  |   PCM_MPS *timeOut__FDK;  | 
494  |  |  | 
495  |  |   HANDLE_FDK_QMF_DOMAIN pQmfDomain;  | 
496  |  |  | 
497  |  |   FDK_ANA_HYB_FILTER  | 
498  |  |   *hybridAnalysis; /*!< pointer Analysis hybrid filterbank array. */  | 
499  |  |   FDK_SYN_HYB_FILTER  | 
500  |  |   *hybridSynthesis; /*!< pointer Synthesis hybrid filterbank array. */  | 
501  |  |   FIXP_DBL **  | 
502  |  |       pHybridAnaStatesLFdmx; /*!< pointer to analysis hybrid filter states LF */  | 
503  |  |   FIXP_DBL **  | 
504  |  |       pHybridAnaStatesHFdmx; /*!< pointer to analysis hybrid filter states HF */  | 
505  |  |   FIXP_DBL **  | 
506  |  |       pHybridAnaStatesLFres; /*!< pointer to analysis hybrid filter states LF */  | 
507  |  |   FIXP_DBL **  | 
508  |  |       pHybridAnaStatesHFres; /*!< pointer to analysis hybrid filter states HF */  | 
509  |  |  | 
510  |  |   DECORR_DEC *apDecor; /*!< pointer decorrelator array. */  | 
511  |  |   FIXP_DBL **pDecorBufferCplx;  | 
512  |  |  | 
513  |  |   SMOOTHING_STATE *smoothState; /*!< Pointer to smoothing states. */  | 
514  |  |  | 
515  |  |   RESHAPE_BBENV_STATE *reshapeBBEnvState; /*!< GES handle. */  | 
516  |  |   SCHAR row2channelDmxGES[MAX_OUTPUT_CHANNELS];  | 
517  |  |  | 
518  |  |   HANDLE_STP_DEC hStpDec; /*!< STP handle. */  | 
519  |  |  | 
520  |  |   const UCHAR *pActivM2ParamBands;  | 
521  |  |  | 
522  |  |   int bOverwriteM1M2prev; /* Overwrite previous M2/M2 params with first set of  | 
523  |  |                              new frame after SSC change (aka  | 
524  |  |                              decodeAfterConfigHasChangedFlag). */  | 
525  |  |   SpatialDecConcealmentInfo concealInfo;  | 
526  |  |  | 
527  |  |   INT sacInDataHeadroom; /* Headroom of the SAC input time signal to prevent  | 
528  |  |                             clipping */  | 
529  |  | };  | 
530  |  |  | 
531  |  | #define SACDEC_SYNTAX_MPS 1  | 
532  | 21.1M  | #define SACDEC_SYNTAX_USAC 2  | 
533  | 6.80M  | #define SACDEC_SYNTAX_RSVD50 4  | 
534  |  | #define SACDEC_SYNTAX_L2 8  | 
535  |  | #define SACDEC_SYNTAX_L3 16  | 
536  | 24.4M  | #define SACDEC_SYNTAX_LD 32  | 
537  |  |  | 
538  | 0  | static inline int GetProcBand(spatialDec_struct *self, int qs) { | 
539  | 0  |   return self->kernels[qs];  | 
540  | 0  | } Unexecuted instantiation: sac_bitdec.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_calcM1andM2.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_dec.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_dec_lib.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_process.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_qmf.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_reshapeBBEnv.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_rom.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_smoothing.cpp:GetProcBand(spatialDec_struct*, int) Unexecuted instantiation: sac_stp.cpp:GetProcBand(spatialDec_struct*, int)  | 
541  |  |  | 
542  |  | #endif /* SAC_DEC_H */  |