Coverage Report

Created: 2025-07-11 06:54

/src/aac/libSYS/include/genericStds.h
Line
Count
Source (jump to first uncovered line)
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
/************************* System integration library **************************
96
97
   Author(s):
98
99
   Description:
100
101
*******************************************************************************/
102
103
/** \file   genericStds.h
104
    \brief  Generic Run-Time Support function wrappers and heap allocation
105
   monitoring.
106
 */
107
108
#if !defined(GENERICSTDS_H)
109
#define GENERICSTDS_H
110
111
#include "machine_type.h"
112
113
#ifndef M_PI
114
#define M_PI 3.14159265358979323846 /*!< Pi. Only used in example projects. */
115
#endif
116
117
/**
118
 * Identifiers for various memory locations. They are used along with memory
119
 * allocation functions like FDKcalloc_L() to specify the requested memory's
120
 * location.
121
 */
122
typedef enum {
123
  /* Internal */
124
  SECT_DATA_L1 = 0x2000,
125
  SECT_DATA_L2,
126
  SECT_DATA_L1_A,
127
  SECT_DATA_L1_B,
128
  SECT_CONSTDATA_L1,
129
130
  /* External */
131
  SECT_DATA_EXTERN = 0x4000,
132
  SECT_CONSTDATA_EXTERN
133
134
} MEMORY_SECTION;
135
136
/*! \addtogroup SYSLIB_MEMORY_MACROS FDK memory macros
137
 *
138
 * The \c H_ prefix indicates that the macro is to be used in a header file, the
139
 * \c C_ prefix indicates that the macro is to be used in a source file.
140
 *
141
 * Declaring memory areas requires to specify a unique name and a data type.
142
 *
143
 * For defining a memory area you require additionally one or two sizes,
144
 * depending if the memory should be organized into one or two dimensions.
145
 *
146
 * The macros containing the keyword \c AALLOC instead of \c ALLOC additionally
147
 * take care of returning aligned memory addresses (beyond the natural alignment
148
 * of its type). The preprocesor macro
149
 * ::ALIGNMENT_DEFAULT indicates the aligment to be used (this is hardware
150
 * specific).
151
 *
152
 * The \c _L suffix indicates that the memory will be located in a specific
153
 * section. This is useful to allocate critical memory section into fast
154
 * internal SRAM for example.
155
 *
156
 * @{
157
 */
158
159
/** See \ref SYSLIB_MEMORY_MACROS for description. */
160
#define H_ALLOC_MEM(name, type) \
161
  type *Get##name(int n = 0);   \
162
  void Free##name(type **p);    \
163
  UINT GetRequiredMem##name(void);
164
165
/** See \ref SYSLIB_MEMORY_MACROS for description. */
166
#define H_ALLOC_MEM_OVERLAY(name, type) \
167
  type *Get##name(int n = 0);           \
168
  void Free##name(type **p);            \
169
  UINT GetRequiredMem##name(void);
170
171
/** See \ref SYSLIB_MEMORY_MACROS for description. */
172
#define C_ALLOC_MEM(name, type, num)               \
173
232k
  type *Get##name(int n) {                         \
174
232k
    FDK_ASSERT((n) == 0);                          \
175
232k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
232k
  }                                                \
Unexecuted instantiation: GetRam_aacEnc_AacEncoder(int)
Unexecuted instantiation: GetRam_aacEnc_PsyInternal(int)
Unexecuted instantiation: GetRam_aacEnc_QCstate(int)
Unexecuted instantiation: GetRam_aacEnc_AdjustThreshold(int)
Unexecuted instantiation: GetRam_aacEnc_BitCntrState(int)
GetAacDecoder(int)
Line
Count
Source
173
27.3k
  type *Get##name(int n) {                         \
174
27.3k
    FDK_ASSERT((n) == 0);                          \
175
27.3k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
27.3k
  }                                                \
GetDrcInfo(int)
Line
Count
Source
173
27.3k
  type *Get##name(int n) {                         \
174
27.3k
    FDK_ASSERT((n) == 0);                          \
175
27.3k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
27.3k
  }                                                \
GetCpePersistentData(int)
Line
Count
Source
173
3.58k
  type *Get##name(int n) {                         \
174
3.58k
    FDK_ASSERT((n) == 0);                          \
175
3.58k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
3.58k
  }                                                \
GetCplxPredictionData(int)
Line
Count
Source
173
3.58k
  type *Get##name(int n) {                         \
174
3.58k
    FDK_ASSERT((n) == 0);                          \
175
3.58k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
3.58k
  }                                                \
Unexecuted instantiation: Get_AacEncoder(int)
GetArcoData(int)
Line
Count
Source
173
59.2k
  type *Get##name(int n) {                         \
174
59.2k
    FDK_ASSERT((n) == 0);                          \
175
59.2k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
59.2k
  }                                                \
GetPcmDmxInstance(int)
Line
Count
Source
173
27.3k
  type *Get##name(int n) {                         \
174
27.3k
    FDK_ASSERT((n) == 0);                          \
175
27.3k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
27.3k
  }                                                \
GetRam_SbrDecoder(int)
Line
Count
Source
173
27.3k
  type *Get##name(int n) {                         \
174
27.3k
    FDK_ASSERT((n) == 0);                          \
175
27.3k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
27.3k
  }                                                \
GetRam_ps_dec(int)
Line
Count
Source
173
2.02k
  type *Get##name(int n) {                         \
174
2.02k
    FDK_ASSERT((n) == 0);                          \
175
2.02k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
2.02k
  }                                                \
Unexecuted instantiation: GetRam_SbrEncoder(int)
Unexecuted instantiation: GetRam_ParamStereo(int)
GetRam_TransportDecoder(int)
Line
Count
Source
173
27.3k
  type *Get##name(int n) {                         \
174
27.3k
    FDK_ASSERT((n) == 0);                          \
175
27.3k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
27.3k
  }                                                \
GetRam_TransportDecoderBuffer(int)
Line
Count
Source
173
27.3k
  type *Get##name(int n) {                         \
174
27.3k
    FDK_ASSERT((n) == 0);                          \
175
27.3k
    return ((type *)FDKcalloc(num, sizeof(type))); \
176
27.3k
  }                                                \
Unexecuted instantiation: GetRam_TransportEncoder(int)
177
232k
  void Free##name(type **p) {                      \
178
232k
    if (p != NULL) {                               \
179
232k
      FDKfree(*p);                                 \
180
232k
      *p = NULL;                                   \
181
232k
    }                                              \
182
232k
  }                                                \
Unexecuted instantiation: FreeRam_aacEnc_AacEncoder(AAC_ENC**)
Unexecuted instantiation: FreeRam_aacEnc_PsyInternal(PSY_INTERNAL**)
Unexecuted instantiation: FreeRam_aacEnc_QCstate(QC_STATE**)
Unexecuted instantiation: FreeRam_aacEnc_AdjustThreshold(ADJ_THR_STATE**)
Unexecuted instantiation: FreeRam_aacEnc_BitCntrState(BITCNTR_STATE**)
FreeAacDecoder(AAC_DECODER_INSTANCE**)
Line
Count
Source
177
27.3k
  void Free##name(type **p) {                      \
178
27.3k
    if (p != NULL) {                               \
179
27.3k
      FDKfree(*p);                                 \
180
27.3k
      *p = NULL;                                   \
181
27.3k
    }                                              \
182
27.3k
  }                                                \
FreeDrcInfo(CDrcInfo**)
Line
Count
Source
177
27.3k
  void Free##name(type **p) {                      \
178
27.3k
    if (p != NULL) {                               \
179
27.3k
      FDKfree(*p);                                 \
180
27.3k
      *p = NULL;                                   \
181
27.3k
    }                                              \
182
27.3k
  }                                                \
FreeCpePersistentData(CpePersistentData**)
Line
Count
Source
177
3.58k
  void Free##name(type **p) {                      \
178
3.58k
    if (p != NULL) {                               \
179
3.58k
      FDKfree(*p);                                 \
180
3.58k
      *p = NULL;                                   \
181
3.58k
    }                                              \
182
3.58k
  }                                                \
FreeCplxPredictionData(CCplxPredictionData**)
Line
Count
Source
177
3.58k
  void Free##name(type **p) {                      \
178
3.58k
    if (p != NULL) {                               \
179
3.58k
      FDKfree(*p);                                 \
180
3.58k
      *p = NULL;                                   \
181
3.58k
    }                                              \
182
3.58k
  }                                                \
Unexecuted instantiation: Free_AacEncoder(AACENCODER**)
FreeArcoData(CArcoData**)
Line
Count
Source
177
59.2k
  void Free##name(type **p) {                      \
178
59.2k
    if (p != NULL) {                               \
179
59.2k
      FDKfree(*p);                                 \
180
59.2k
      *p = NULL;                                   \
181
59.2k
    }                                              \
182
59.2k
  }                                                \
FreePcmDmxInstance(PCM_DMX_INSTANCE**)
Line
Count
Source
177
27.3k
  void Free##name(type **p) {                      \
178
27.3k
    if (p != NULL) {                               \
179
27.3k
      FDKfree(*p);                                 \
180
27.3k
      *p = NULL;                                   \
181
27.3k
    }                                              \
182
27.3k
  }                                                \
FreeRam_SbrDecoder(SBR_DECODER_INSTANCE**)
Line
Count
Source
177
27.3k
  void Free##name(type **p) {                      \
178
27.3k
    if (p != NULL) {                               \
179
27.3k
      FDKfree(*p);                                 \
180
27.3k
      *p = NULL;                                   \
181
27.3k
    }                                              \
182
27.3k
  }                                                \
FreeRam_ps_dec(PS_DEC**)
Line
Count
Source
177
2.02k
  void Free##name(type **p) {                      \
178
2.02k
    if (p != NULL) {                               \
179
2.02k
      FDKfree(*p);                                 \
180
2.02k
      *p = NULL;                                   \
181
2.02k
    }                                              \
182
2.02k
  }                                                \
Unexecuted instantiation: FreeRam_SbrEncoder(SBR_ENCODER**)
Unexecuted instantiation: FreeRam_ParamStereo(T_PARAMETRIC_STEREO**)
FreeRam_TransportDecoder(TRANSPORTDEC**)
Line
Count
Source
177
27.3k
  void Free##name(type **p) {                      \
178
27.3k
    if (p != NULL) {                               \
179
27.3k
      FDKfree(*p);                                 \
180
27.3k
      *p = NULL;                                   \
181
27.3k
    }                                              \
182
27.3k
  }                                                \
FreeRam_TransportDecoderBuffer(unsigned char**)
Line
Count
Source
177
27.3k
  void Free##name(type **p) {                      \
178
27.3k
    if (p != NULL) {                               \
179
27.3k
      FDKfree(*p);                                 \
180
27.3k
      *p = NULL;                                   \
181
27.3k
    }                                              \
182
27.3k
  }                                                \
Unexecuted instantiation: FreeRam_TransportEncoder(TRANSPORTENC**)
183
0
  UINT GetRequiredMem##name(void) {                \
184
0
    return ALGN_SIZE_EXTRES((num) * sizeof(type)); \
185
0
  }
Unexecuted instantiation: GetRequiredMemRam_aacEnc_AacEncoder()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyInternal()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_QCstate()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_AdjustThreshold()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_BitCntrState()
Unexecuted instantiation: GetRequiredMemAacDecoder()
Unexecuted instantiation: GetRequiredMemDrcInfo()
Unexecuted instantiation: GetRequiredMemCpePersistentData()
Unexecuted instantiation: GetRequiredMemCplxPredictionData()
Unexecuted instantiation: GetRequiredMem_AacEncoder()
Unexecuted instantiation: GetRequiredMemArcoData()
Unexecuted instantiation: GetRequiredMemPcmDmxInstance()
Unexecuted instantiation: GetRequiredMemRam_SbrDecoder()
Unexecuted instantiation: GetRequiredMemRam_ps_dec()
Unexecuted instantiation: GetRequiredMemRam_SbrEncoder()
Unexecuted instantiation: GetRequiredMemRam_ParamStereo()
Unexecuted instantiation: GetRequiredMemRam_TransportDecoder()
Unexecuted instantiation: GetRequiredMemRam_TransportDecoderBuffer()
Unexecuted instantiation: GetRequiredMemRam_TransportEncoder()
186
187
/** See \ref SYSLIB_MEMORY_MACROS for description. */
188
#define C_ALLOC_MEM2(name, type, n1, n2)                 \
189
1.74M
  type *Get##name(int n) {                               \
190
1.74M
    FDK_ASSERT((n) < (n2));                              \
191
1.74M
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
1.74M
  }                                                      \
GetQmfSlotsReal(int)
Line
Count
Source
189
48.1k
  type *Get##name(int n) {                               \
190
48.1k
    FDK_ASSERT((n) < (n2));                              \
191
48.1k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
48.1k
  }                                                      \
GetQmfSlotsImag(int)
Line
Count
Source
189
48.1k
  type *Get##name(int n) {                               \
190
48.1k
    FDK_ASSERT((n) < (n2));                              \
191
48.1k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
48.1k
  }                                                      \
GetQmfSlotsReal16(int)
Line
Count
Source
189
6.73k
  type *Get##name(int n) {                               \
190
6.73k
    FDK_ASSERT((n) < (n2));                              \
191
6.73k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
6.73k
  }                                                      \
GetQmfSlotsReal32(int)
Line
Count
Source
189
22.7k
  type *Get##name(int n) {                               \
190
22.7k
    FDK_ASSERT((n) < (n2));                              \
191
22.7k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
22.7k
  }                                                      \
GetQmfSlotsImag16(int)
Line
Count
Source
189
6.73k
  type *Get##name(int n) {                               \
190
6.73k
    FDK_ASSERT((n) < (n2));                              \
191
6.73k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
6.73k
  }                                                      \
GetQmfSlotsImag32(int)
Line
Count
Source
189
22.7k
  type *Get##name(int n) {                               \
190
22.7k
    FDK_ASSERT((n) < (n2));                              \
191
22.7k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
22.7k
  }                                                      \
Unexecuted instantiation: GetRam_aacEnc_PsyElement(int)
Unexecuted instantiation: GetRam_aacEnc_PsyStatic(int)
Unexecuted instantiation: GetRam_aacEnc_PsyInputBuffer(int)
Unexecuted instantiation: GetRam_aacEnc_PsyOut(int)
Unexecuted instantiation: GetRam_aacEnc_PsyOutElements(int)
Unexecuted instantiation: GetRam_aacEnc_PsyOutChannel(int)
Unexecuted instantiation: GetRam_aacEnc_AdjThrStateElement(int)
Unexecuted instantiation: GetRam_aacEnc_ElementBits(int)
Unexecuted instantiation: GetRam_aacEnc_QCout(int)
Unexecuted instantiation: GetRam_aacEnc_QCelement(int)
GetAacDecoderStaticChannelInfo(int)
Line
Count
Source
189
1.31M
  type *Get##name(int n) {                               \
190
1.31M
    FDK_ASSERT((n) < (n2));                              \
191
1.31M
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
1.31M
  }                                                      \
GetTimeDataFlush(int)
Line
Count
Source
189
19.5k
  type *Get##name(int n) {                               \
190
19.5k
    FDK_ASSERT((n) < (n2));                              \
191
19.5k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
19.5k
  }                                                      \
GetRam_SbrDecElement(int)
Line
Count
Source
189
101k
  type *Get##name(int n) {                               \
190
101k
    FDK_ASSERT((n) < (n2));                              \
191
101k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
101k
  }                                                      \
GetRam_SbrDecChannel(int)
Line
Count
Source
189
152k
  type *Get##name(int n) {                               \
190
152k
    FDK_ASSERT((n) < (n2));                              \
191
152k
    return ((type *)FDKcalloc(n1, sizeof(type)));        \
192
152k
  }                                                      \
Unexecuted instantiation: GetRam_SbrChannel(int)
Unexecuted instantiation: GetRam_SbrElement(int)
Unexecuted instantiation: GetRam_Sbr_signMatrix(int)
Unexecuted instantiation: GetRam_Sbr_freqBandTableLO(int)
Unexecuted instantiation: GetRam_Sbr_freqBandTableHI(int)
Unexecuted instantiation: GetRam_Sbr_v_k_master(int)
Unexecuted instantiation: GetRam_Sbr_detectionVectors(int)
Unexecuted instantiation: GetRam_Sbr_prevEnvelopeCompensation(int)
Unexecuted instantiation: GetRam_Sbr_guideScfb(int)
Unexecuted instantiation: GetRam_Sbr_guideVectorDetected(int)
Unexecuted instantiation: GetRam_Sbr_guideVectorDiff(int)
Unexecuted instantiation: GetRam_Sbr_guideVectorOrig(int)
Unexecuted instantiation: GetRam_Sbr_envYBuffer(int)
193
1.75M
  void Free##name(type **p) {                            \
194
1.75M
    if (p != NULL) {                                     \
195
1.75M
      FDKfree(*p);                                       \
196
1.75M
      *p = NULL;                                         \
197
1.75M
    }                                                    \
198
1.75M
  }                                                      \
FreeQmfSlotsReal(int***)
Line
Count
Source
193
48.1k
  void Free##name(type **p) {                            \
194
48.1k
    if (p != NULL) {                                     \
195
48.1k
      FDKfree(*p);                                       \
196
48.1k
      *p = NULL;                                         \
197
48.1k
    }                                                    \
198
48.1k
  }                                                      \
FreeQmfSlotsImag(int***)
Line
Count
Source
193
54.8k
  void Free##name(type **p) {                            \
194
54.8k
    if (p != NULL) {                                     \
195
54.8k
      FDKfree(*p);                                       \
196
54.8k
      *p = NULL;                                         \
197
54.8k
    }                                                    \
198
54.8k
  }                                                      \
FreeQmfSlotsReal16(int***)
Line
Count
Source
193
6.73k
  void Free##name(type **p) {                            \
194
6.73k
    if (p != NULL) {                                     \
195
6.73k
      FDKfree(*p);                                       \
196
6.73k
      *p = NULL;                                         \
197
6.73k
    }                                                    \
198
6.73k
  }                                                      \
FreeQmfSlotsReal32(int***)
Line
Count
Source
193
22.7k
  void Free##name(type **p) {                            \
194
22.7k
    if (p != NULL) {                                     \
195
22.7k
      FDKfree(*p);                                       \
196
22.7k
      *p = NULL;                                         \
197
22.7k
    }                                                    \
198
22.7k
  }                                                      \
FreeQmfSlotsImag16(int***)
Line
Count
Source
193
6.73k
  void Free##name(type **p) {                            \
194
6.73k
    if (p != NULL) {                                     \
195
6.73k
      FDKfree(*p);                                       \
196
6.73k
      *p = NULL;                                         \
197
6.73k
    }                                                    \
198
6.73k
  }                                                      \
FreeQmfSlotsImag32(int***)
Line
Count
Source
193
22.7k
  void Free##name(type **p) {                            \
194
22.7k
    if (p != NULL) {                                     \
195
22.7k
      FDKfree(*p);                                       \
196
22.7k
      *p = NULL;                                         \
197
22.7k
    }                                                    \
198
22.7k
  }                                                      \
Unexecuted instantiation: FreeRam_aacEnc_PsyElement(PSY_ELEMENT**)
Unexecuted instantiation: FreeRam_aacEnc_PsyStatic(PSY_STATIC**)
Unexecuted instantiation: FreeRam_aacEnc_PsyInputBuffer(short**)
Unexecuted instantiation: FreeRam_aacEnc_PsyOut(PSY_OUT**)
Unexecuted instantiation: FreeRam_aacEnc_PsyOutElements(PSY_OUT_ELEMENT**)
Unexecuted instantiation: FreeRam_aacEnc_PsyOutChannel(PSY_OUT_CHANNEL**)
Unexecuted instantiation: FreeRam_aacEnc_AdjThrStateElement(ATS_ELEMENT**)
Unexecuted instantiation: FreeRam_aacEnc_ElementBits(ELEMENT_BITS**)
Unexecuted instantiation: FreeRam_aacEnc_QCout(QC_OUT**)
Unexecuted instantiation: FreeRam_aacEnc_QCelement(QC_OUT_ELEMENT**)
FreeAacDecoderStaticChannelInfo(CAacDecoderStaticChannelInfo**)
Line
Count
Source
193
1.31M
  void Free##name(type **p) {                            \
194
1.31M
    if (p != NULL) {                                     \
195
1.31M
      FDKfree(*p);                                       \
196
1.31M
      *p = NULL;                                         \
197
1.31M
    }                                                    \
198
1.31M
  }                                                      \
FreeTimeDataFlush(int**)
Line
Count
Source
193
19.5k
  void Free##name(type **p) {                            \
194
19.5k
    if (p != NULL) {                                     \
195
19.5k
      FDKfree(*p);                                       \
196
19.5k
      *p = NULL;                                         \
197
19.5k
    }                                                    \
198
19.5k
  }                                                      \
FreeRam_SbrDecElement(SBR_DECODER_ELEMENT**)
Line
Count
Source
193
101k
  void Free##name(type **p) {                            \
194
101k
    if (p != NULL) {                                     \
195
101k
      FDKfree(*p);                                       \
196
101k
      *p = NULL;                                         \
197
101k
    }                                                    \
198
101k
  }                                                      \
FreeRam_SbrDecChannel(SBR_CHANNEL**)
Line
Count
Source
193
152k
  void Free##name(type **p) {                            \
194
152k
    if (p != NULL) {                                     \
195
152k
      FDKfree(*p);                                       \
196
152k
      *p = NULL;                                         \
197
152k
    }                                                    \
198
152k
  }                                                      \
Unexecuted instantiation: FreeRam_SbrChannel(SBR_CHANNEL**)
Unexecuted instantiation: FreeRam_SbrElement(SBR_ELEMENT**)
Unexecuted instantiation: FreeRam_Sbr_signMatrix(int**)
Unexecuted instantiation: FreeRam_Sbr_freqBandTableLO(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_freqBandTableHI(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_v_k_master(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_detectionVectors(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_prevEnvelopeCompensation(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_guideScfb(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_guideVectorDetected(unsigned char**)
Unexecuted instantiation: FreeRam_Sbr_guideVectorDiff(int**)
Unexecuted instantiation: FreeRam_Sbr_guideVectorOrig(int**)
Unexecuted instantiation: FreeRam_Sbr_envYBuffer(int**)
199
0
  UINT GetRequiredMem##name(void) {                      \
200
0
    return ALGN_SIZE_EXTRES((n1) * sizeof(type)) * (n2); \
201
0
  }
Unexecuted instantiation: GetRequiredMemQmfSlotsReal()
Unexecuted instantiation: GetRequiredMemQmfSlotsImag()
Unexecuted instantiation: GetRequiredMemQmfSlotsReal16()
Unexecuted instantiation: GetRequiredMemQmfSlotsReal32()
Unexecuted instantiation: GetRequiredMemQmfSlotsImag16()
Unexecuted instantiation: GetRequiredMemQmfSlotsImag32()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyElement()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyStatic()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyInputBuffer()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyOut()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyOutElements()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_PsyOutChannel()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_AdjThrStateElement()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_ElementBits()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_QCout()
Unexecuted instantiation: GetRequiredMemRam_aacEnc_QCelement()
Unexecuted instantiation: GetRequiredMemAacDecoderStaticChannelInfo()
Unexecuted instantiation: GetRequiredMemTimeDataFlush()
Unexecuted instantiation: GetRequiredMemRam_SbrDecElement()
Unexecuted instantiation: GetRequiredMemRam_SbrDecChannel()
Unexecuted instantiation: GetRequiredMemRam_SbrChannel()
Unexecuted instantiation: GetRequiredMemRam_SbrElement()
Unexecuted instantiation: GetRequiredMemRam_Sbr_signMatrix()
Unexecuted instantiation: GetRequiredMemRam_Sbr_freqBandTableLO()
Unexecuted instantiation: GetRequiredMemRam_Sbr_freqBandTableHI()
Unexecuted instantiation: GetRequiredMemRam_Sbr_v_k_master()
Unexecuted instantiation: GetRequiredMemRam_Sbr_detectionVectors()
Unexecuted instantiation: GetRequiredMemRam_Sbr_prevEnvelopeCompensation()
Unexecuted instantiation: GetRequiredMemRam_Sbr_guideScfb()
Unexecuted instantiation: GetRequiredMemRam_Sbr_guideVectorDetected()
Unexecuted instantiation: GetRequiredMemRam_Sbr_guideVectorDiff()
Unexecuted instantiation: GetRequiredMemRam_Sbr_guideVectorOrig()
Unexecuted instantiation: GetRequiredMemRam_Sbr_envYBuffer()
202
203
/** See \ref SYSLIB_MEMORY_MACROS for description. */
204
#define C_AALLOC_MEM(name, type, num)                                  \
205
0
  type *Get##name(int n) {                                             \
206
0
    type *ap;                                                          \
207
0
    FDK_ASSERT((n) == 0);                                              \
208
0
    ap = ((type *)FDKaalloc((num) * sizeof(type), ALIGNMENT_DEFAULT)); \
209
0
    return ap;                                                         \
210
0
  }                                                                    \
Unexecuted instantiation: GetAACdynamic_RAM(int)
Unexecuted instantiation: GetRam_SbrDynamic_RAM(int)
211
0
  void Free##name(type **p) {                                          \
212
0
    if (p != NULL) {                                                   \
213
0
      FDKafree(*p);                                                    \
214
0
      *p = NULL;                                                       \
215
0
    }                                                                  \
216
0
  }                                                                    \
Unexecuted instantiation: FreeAACdynamic_RAM(int**)
Unexecuted instantiation: FreeRam_SbrDynamic_RAM(int**)
217
0
  UINT GetRequiredMem##name(void) {                                    \
218
0
    return ALGN_SIZE_EXTRES((num) * sizeof(type) + ALIGNMENT_DEFAULT + \
219
0
                            sizeof(void *));                           \
220
0
  }
Unexecuted instantiation: GetRequiredMemAACdynamic_RAM()
Unexecuted instantiation: GetRequiredMemRam_SbrDynamic_RAM()
221
222
/** See \ref SYSLIB_MEMORY_MACROS for description. */
223
#define C_AALLOC_MEM2(name, type, n1, n2)                             \
224
2.83M
  type *Get##name(int n) {                                            \
225
2.83M
    type *ap;                                                         \
226
2.83M
    FDK_ASSERT((n) < (n2));                                           \
227
2.83M
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
2.83M
    return ap;                                                        \
229
2.83M
  }                                                                   \
GetAnaQmfStates(int)
Line
Count
Source
224
2.92k
  type *Get##name(int n) {                                            \
225
2.92k
    type *ap;                                                         \
226
2.92k
    FDK_ASSERT((n) < (n2));                                           \
227
2.92k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
2.92k
    return ap;                                                        \
229
2.92k
  }                                                                   \
GetSynQmfStates(int)
Line
Count
Source
224
89.5k
  type *Get##name(int n) {                                            \
225
89.5k
    type *ap;                                                         \
226
89.5k
    FDK_ASSERT((n) < (n2));                                           \
227
89.5k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
89.5k
    return ap;                                                        \
229
89.5k
  }                                                                   \
GetQmfOverlapBuffer(int)
Line
Count
Source
224
4.22k
  type *Get##name(int n) {                                            \
225
4.22k
    type *ap;                                                         \
226
4.22k
    FDK_ASSERT((n) < (n2));                                           \
227
4.22k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
4.22k
    return ap;                                                        \
229
4.22k
  }                                                                   \
GetAnaQmfStates16(int)
Line
Count
Source
224
12.7k
  type *Get##name(int n) {                                            \
225
12.7k
    type *ap;                                                         \
226
12.7k
    FDK_ASSERT((n) < (n2));                                           \
227
12.7k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
12.7k
    return ap;                                                        \
229
12.7k
  }                                                                   \
GetAnaQmfStates24(int)
Line
Count
Source
224
12.3k
  type *Get##name(int n) {                                            \
225
12.3k
    type *ap;                                                         \
226
12.3k
    FDK_ASSERT((n) < (n2));                                           \
227
12.3k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
12.3k
    return ap;                                                        \
229
12.3k
  }                                                                   \
GetAnaQmfStates32(int)
Line
Count
Source
224
52.4k
  type *Get##name(int n) {                                            \
225
52.4k
    type *ap;                                                         \
226
52.4k
    FDK_ASSERT((n) < (n2));                                           \
227
52.4k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
52.4k
    return ap;                                                        \
229
52.4k
  }                                                                   \
Unexecuted instantiation: GetQmfOverlapBuffer16(int)
GetQmfOverlapBuffer32(int)
Line
Count
Source
224
26.5k
  type *Get##name(int n) {                                            \
225
26.5k
    type *ap;                                                         \
226
26.5k
    FDK_ASSERT((n) < (n2));                                           \
227
26.5k
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
26.5k
    return ap;                                                        \
229
26.5k
  }                                                                   \
GetAacDecoderChannelInfo(int)
Line
Count
Source
224
1.31M
  type *Get##name(int n) {                                            \
225
1.31M
    type *ap;                                                         \
226
1.31M
    FDK_ASSERT((n) < (n2));                                           \
227
1.31M
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
1.31M
    return ap;                                                        \
229
1.31M
  }                                                                   \
GetOverlapBuffer(int)
Line
Count
Source
224
1.31M
  type *Get##name(int n) {                                            \
225
1.31M
    type *ap;                                                         \
226
1.31M
    FDK_ASSERT((n) < (n2));                                           \
227
1.31M
    ap = ((type *)FDKaalloc((n1) * sizeof(type), ALIGNMENT_DEFAULT)); \
228
1.31M
    return ap;                                                        \
229
1.31M
  }                                                                   \
230
2.83M
  void Free##name(type **p) {                                         \
231
2.83M
    if (p != NULL) {                                                  \
232
2.83M
      FDKafree(*p);                                                   \
233
2.83M
      *p = NULL;                                                      \
234
2.83M
    }                                                                 \
235
2.83M
  }                                                                   \
FreeAnaQmfStates(int**)
Line
Count
Source
230
2.92k
  void Free##name(type **p) {                                         \
231
2.92k
    if (p != NULL) {                                                  \
232
2.92k
      FDKafree(*p);                                                   \
233
2.92k
      *p = NULL;                                                      \
234
2.92k
    }                                                                 \
235
2.92k
  }                                                                   \
FreeSynQmfStates(int**)
Line
Count
Source
230
89.5k
  void Free##name(type **p) {                                         \
231
89.5k
    if (p != NULL) {                                                  \
232
89.5k
      FDKafree(*p);                                                   \
233
89.5k
      *p = NULL;                                                      \
234
89.5k
    }                                                                 \
235
89.5k
  }                                                                   \
FreeQmfOverlapBuffer(int**)
Line
Count
Source
230
4.22k
  void Free##name(type **p) {                                         \
231
4.22k
    if (p != NULL) {                                                  \
232
4.22k
      FDKafree(*p);                                                   \
233
4.22k
      *p = NULL;                                                      \
234
4.22k
    }                                                                 \
235
4.22k
  }                                                                   \
FreeAnaQmfStates16(int**)
Line
Count
Source
230
12.7k
  void Free##name(type **p) {                                         \
231
12.7k
    if (p != NULL) {                                                  \
232
12.7k
      FDKafree(*p);                                                   \
233
12.7k
      *p = NULL;                                                      \
234
12.7k
    }                                                                 \
235
12.7k
  }                                                                   \
FreeAnaQmfStates24(int**)
Line
Count
Source
230
12.3k
  void Free##name(type **p) {                                         \
231
12.3k
    if (p != NULL) {                                                  \
232
12.3k
      FDKafree(*p);                                                   \
233
12.3k
      *p = NULL;                                                      \
234
12.3k
    }                                                                 \
235
12.3k
  }                                                                   \
FreeAnaQmfStates32(int**)
Line
Count
Source
230
52.4k
  void Free##name(type **p) {                                         \
231
52.4k
    if (p != NULL) {                                                  \
232
52.4k
      FDKafree(*p);                                                   \
233
52.4k
      *p = NULL;                                                      \
234
52.4k
    }                                                                 \
235
52.4k
  }                                                                   \
Unexecuted instantiation: FreeQmfOverlapBuffer16(int**)
FreeQmfOverlapBuffer32(int**)
Line
Count
Source
230
26.5k
  void Free##name(type **p) {                                         \
231
26.5k
    if (p != NULL) {                                                  \
232
26.5k
      FDKafree(*p);                                                   \
233
26.5k
      *p = NULL;                                                      \
234
26.5k
    }                                                                 \
235
26.5k
  }                                                                   \
FreeAacDecoderChannelInfo(CAacDecoderChannelInfo**)
Line
Count
Source
230
1.31M
  void Free##name(type **p) {                                         \
231
1.31M
    if (p != NULL) {                                                  \
232
1.31M
      FDKafree(*p);                                                   \
233
1.31M
      *p = NULL;                                                      \
234
1.31M
    }                                                                 \
235
1.31M
  }                                                                   \
FreeOverlapBuffer(int**)
Line
Count
Source
230
1.31M
  void Free##name(type **p) {                                         \
231
1.31M
    if (p != NULL) {                                                  \
232
1.31M
      FDKafree(*p);                                                   \
233
1.31M
      *p = NULL;                                                      \
234
1.31M
    }                                                                 \
235
1.31M
  }                                                                   \
236
0
  UINT GetRequiredMem##name(void) {                                   \
237
0
    return ALGN_SIZE_EXTRES((n1) * sizeof(type) + ALIGNMENT_DEFAULT + \
238
0
                            sizeof(void *)) *                         \
239
0
           (n2);                                                      \
240
0
  }
Unexecuted instantiation: GetRequiredMemAnaQmfStates()
Unexecuted instantiation: GetRequiredMemSynQmfStates()
Unexecuted instantiation: GetRequiredMemQmfOverlapBuffer()
Unexecuted instantiation: GetRequiredMemAnaQmfStates16()
Unexecuted instantiation: GetRequiredMemAnaQmfStates24()
Unexecuted instantiation: GetRequiredMemAnaQmfStates32()
Unexecuted instantiation: GetRequiredMemQmfOverlapBuffer16()
Unexecuted instantiation: GetRequiredMemQmfOverlapBuffer32()
Unexecuted instantiation: GetRequiredMemAacDecoderChannelInfo()
Unexecuted instantiation: GetRequiredMemOverlapBuffer()
241
242
/** See \ref SYSLIB_MEMORY_MACROS for description. */
243
#define C_ALLOC_MEM_L(name, type, num, s)               \
244
0
  type *Get##name(int n) {                              \
245
0
    FDK_ASSERT((n) == 0);                               \
246
0
    return ((type *)FDKcalloc_L(num, sizeof(type), s)); \
247
0
  }                                                     \
248
0
  void Free##name(type **p) {                           \
249
0
    if (p != NULL) {                                    \
250
0
      FDKfree_L(*p);                                    \
251
0
      *p = NULL;                                        \
252
0
    }                                                   \
253
0
  }                                                     \
254
0
  UINT GetRequiredMem##name(void) {                     \
255
0
    return ALGN_SIZE_EXTRES((num) * sizeof(type));      \
256
0
  }
257
258
/** See \ref SYSLIB_MEMORY_MACROS for description. */
259
#define C_ALLOC_MEM2_L(name, type, n1, n2, s)            \
260
0
  type *Get##name(int n) {                               \
261
0
    FDK_ASSERT((n) < (n2));                              \
262
0
    return (type *)FDKcalloc_L(n1, sizeof(type), s);     \
263
0
  }                                                      \
264
0
  void Free##name(type **p) {                            \
265
0
    if (p != NULL) {                                     \
266
0
      FDKfree_L(*p);                                     \
267
0
      *p = NULL;                                         \
268
0
    }                                                    \
269
0
  }                                                      \
270
0
  UINT GetRequiredMem##name(void) {                      \
271
0
    return ALGN_SIZE_EXTRES((n1) * sizeof(type)) * (n2); \
272
0
  }
273
274
/** See \ref SYSLIB_MEMORY_MACROS for description. */
275
#define C_AALLOC_MEM_L(name, type, num, s)                                  \
276
592k
  type *Get##name(int n) {                                                  \
277
592k
    type *ap;                                                               \
278
592k
    FDK_ASSERT((n) == 0);                                                   \
279
592k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
592k
    return ap;                                                              \
281
592k
  }                                                                         \
GetQmfWorkBufferCore1(int)
Line
Count
Source
276
21.2k
  type *Get##name(int n) {                                                  \
277
21.2k
    type *ap;                                                               \
278
21.2k
    FDK_ASSERT((n) == 0);                                                   \
279
21.2k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
21.2k
    return ap;                                                              \
281
21.2k
  }                                                                         \
GetQmfWorkBufferCore3(int)
Line
Count
Source
276
6.45k
  type *Get##name(int n) {                                                  \
277
6.45k
    type *ap;                                                               \
278
6.45k
    FDK_ASSERT((n) == 0);                                                   \
279
6.45k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
6.45k
    return ap;                                                              \
281
6.45k
  }                                                                         \
GetQmfWorkBufferCore4(int)
Line
Count
Source
276
3.63k
  type *Get##name(int n) {                                                  \
277
3.63k
    type *ap;                                                               \
278
3.63k
    FDK_ASSERT((n) == 0);                                                   \
279
3.63k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
3.63k
    return ap;                                                              \
281
3.63k
  }                                                                         \
GetQmfWorkBufferCore6(int)
Line
Count
Source
276
34.2k
  type *Get##name(int n) {                                                  \
277
34.2k
    type *ap;                                                               \
278
34.2k
    FDK_ASSERT((n) == 0);                                                   \
279
34.2k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
34.2k
    return ap;                                                              \
281
34.2k
  }                                                                         \
GetQmfWorkBufferCore7(int)
Line
Count
Source
276
500
  type *Get##name(int n) {                                                  \
277
500
    type *ap;                                                               \
278
500
    FDK_ASSERT((n) == 0);                                                   \
279
500
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
500
    return ap;                                                              \
281
500
  }                                                                         \
GetWorkBufferCore2(int)
Line
Count
Source
276
27.3k
  type *Get##name(int n) {                                                  \
277
27.3k
    type *ap;                                                               \
278
27.3k
    FDK_ASSERT((n) == 0);                                                   \
279
27.3k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
27.3k
    return ap;                                                              \
281
27.3k
  }                                                                         \
GetWorkBufferCore6(int)
Line
Count
Source
276
222k
  type *Get##name(int n) {                                                  \
277
222k
    type *ap;                                                               \
278
222k
    FDK_ASSERT((n) == 0);                                                   \
279
222k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
222k
    return ap;                                                              \
281
222k
  }                                                                         \
GetWorkBufferCore1(int)
Line
Count
Source
276
249k
  type *Get##name(int n) {                                                  \
277
249k
    type *ap;                                                               \
278
249k
    FDK_ASSERT((n) == 0);                                                   \
279
249k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
249k
    return ap;                                                              \
281
249k
  }                                                                         \
GetWorkBufferCore5(int)
Line
Count
Source
276
27.3k
  type *Get##name(int n) {                                                  \
277
27.3k
    type *ap;                                                               \
278
27.3k
    FDK_ASSERT((n) == 0);                                                   \
279
27.3k
    ap = ((type *)FDKaalloc_L((num) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
280
27.3k
    return ap;                                                              \
281
27.3k
  }                                                                         \
Unexecuted instantiation: GetRam_PsQmfStatesSynthesis(int)
282
592k
  void Free##name(type **p) {                                               \
283
592k
    if (p != NULL) {                                                        \
284
592k
      FDKafree_L(*p);                                                       \
285
592k
      *p = NULL;                                                            \
286
592k
    }                                                                       \
287
592k
  }                                                                         \
FreeQmfWorkBufferCore1(int**)
Line
Count
Source
282
21.2k
  void Free##name(type **p) {                                               \
283
21.2k
    if (p != NULL) {                                                        \
284
21.2k
      FDKafree_L(*p);                                                       \
285
21.2k
      *p = NULL;                                                            \
286
21.2k
    }                                                                       \
287
21.2k
  }                                                                         \
FreeQmfWorkBufferCore3(int**)
Line
Count
Source
282
6.45k
  void Free##name(type **p) {                                               \
283
6.45k
    if (p != NULL) {                                                        \
284
6.45k
      FDKafree_L(*p);                                                       \
285
6.45k
      *p = NULL;                                                            \
286
6.45k
    }                                                                       \
287
6.45k
  }                                                                         \
FreeQmfWorkBufferCore4(int**)
Line
Count
Source
282
3.63k
  void Free##name(type **p) {                                               \
283
3.63k
    if (p != NULL) {                                                        \
284
3.63k
      FDKafree_L(*p);                                                       \
285
3.63k
      *p = NULL;                                                            \
286
3.63k
    }                                                                       \
287
3.63k
  }                                                                         \
FreeQmfWorkBufferCore6(int**)
Line
Count
Source
282
34.2k
  void Free##name(type **p) {                                               \
283
34.2k
    if (p != NULL) {                                                        \
284
34.2k
      FDKafree_L(*p);                                                       \
285
34.2k
      *p = NULL;                                                            \
286
34.2k
    }                                                                       \
287
34.2k
  }                                                                         \
FreeQmfWorkBufferCore7(int**)
Line
Count
Source
282
500
  void Free##name(type **p) {                                               \
283
500
    if (p != NULL) {                                                        \
284
500
      FDKafree_L(*p);                                                       \
285
500
      *p = NULL;                                                            \
286
500
    }                                                                       \
287
500
  }                                                                         \
FreeWorkBufferCore2(int**)
Line
Count
Source
282
27.3k
  void Free##name(type **p) {                                               \
283
27.3k
    if (p != NULL) {                                                        \
284
27.3k
      FDKafree_L(*p);                                                       \
285
27.3k
      *p = NULL;                                                            \
286
27.3k
    }                                                                       \
287
27.3k
  }                                                                         \
FreeWorkBufferCore6(signed char**)
Line
Count
Source
282
222k
  void Free##name(type **p) {                                               \
283
222k
    if (p != NULL) {                                                        \
284
222k
      FDKafree_L(*p);                                                       \
285
222k
      *p = NULL;                                                            \
286
222k
    }                                                                       \
287
222k
  }                                                                         \
FreeWorkBufferCore1(CWorkBufferCore1**)
Line
Count
Source
282
249k
  void Free##name(type **p) {                                               \
283
249k
    if (p != NULL) {                                                        \
284
249k
      FDKafree_L(*p);                                                       \
285
249k
      *p = NULL;                                                            \
286
249k
    }                                                                       \
287
249k
  }                                                                         \
FreeWorkBufferCore5(int**)
Line
Count
Source
282
27.3k
  void Free##name(type **p) {                                               \
283
27.3k
    if (p != NULL) {                                                        \
284
27.3k
      FDKafree_L(*p);                                                       \
285
27.3k
      *p = NULL;                                                            \
286
27.3k
    }                                                                       \
287
27.3k
  }                                                                         \
Unexecuted instantiation: FreeRam_PsQmfStatesSynthesis(int**)
288
41.0k
  UINT GetRequiredMem##name(void) {                                         \
289
41.0k
    return ALGN_SIZE_EXTRES((num) * sizeof(type) + ALIGNMENT_DEFAULT +      \
290
41.0k
                            sizeof(void *));                                \
291
41.0k
  }
Unexecuted instantiation: GetRequiredMemQmfWorkBufferCore1()
Unexecuted instantiation: GetRequiredMemQmfWorkBufferCore3()
Unexecuted instantiation: GetRequiredMemQmfWorkBufferCore4()
Unexecuted instantiation: GetRequiredMemQmfWorkBufferCore6()
Unexecuted instantiation: GetRequiredMemQmfWorkBufferCore7()
Unexecuted instantiation: GetRequiredMemWorkBufferCore2()
Unexecuted instantiation: GetRequiredMemWorkBufferCore6()
GetRequiredMemWorkBufferCore1()
Line
Count
Source
288
13.7k
  UINT GetRequiredMem##name(void) {                                         \
289
13.7k
    return ALGN_SIZE_EXTRES((num) * sizeof(type) + ALIGNMENT_DEFAULT +      \
290
13.7k
                            sizeof(void *));                                \
291
13.7k
  }
GetRequiredMemWorkBufferCore5()
Line
Count
Source
288
27.3k
  UINT GetRequiredMem##name(void) {                                         \
289
27.3k
    return ALGN_SIZE_EXTRES((num) * sizeof(type) + ALIGNMENT_DEFAULT +      \
290
27.3k
                            sizeof(void *));                                \
291
27.3k
  }
Unexecuted instantiation: GetRequiredMemRam_PsQmfStatesSynthesis()
292
293
/** See \ref SYSLIB_MEMORY_MACROS for description. */
294
#define C_AALLOC_MEM2_L(name, type, n1, n2, s)                             \
295
0
  type *Get##name(int n) {                                                 \
296
0
    type *ap;                                                              \
297
0
    FDK_ASSERT((n) < (n2));                                                \
298
0
    ap = ((type *)FDKaalloc_L((n1) * sizeof(type), ALIGNMENT_DEFAULT, s)); \
299
0
    return ap;                                                             \
300
0
  }                                                                        \
301
0
  void Free##name(type **p) {                                              \
302
0
    if (p != NULL) {                                                       \
303
0
      FDKafree_L(*p);                                                      \
304
0
      *p = NULL;                                                           \
305
0
    }                                                                      \
306
0
  }                                                                        \
307
0
  UINT GetRequiredMem##name(void) {                                        \
308
0
    return ALGN_SIZE_EXTRES((n1) * sizeof(type) + ALIGNMENT_DEFAULT +      \
309
0
                            sizeof(void *)) *                              \
310
0
           (n2);                                                           \
311
0
  }
312
313
/** See \ref SYSLIB_MEMORY_MACROS for description. */
314
#define C_ALLOC_MEM_OVERLAY(name, type, num, sect, tag) \
315
  C_AALLOC_MEM_L(name, type, num, sect)
316
317
/** See \ref SYSLIB_MEMORY_MACROS for description. */
318
#define C_AALLOC_SCRATCH_START(name, type, n)                 \
319
33.9M
  type _##name[(n) + (ALIGNMENT_DEFAULT + sizeof(type) - 1)]; \
320
33.9M
  type *name = (type *)ALIGN_PTR(_##name);                    \
321
33.9M
  C_ALLOC_ALIGNED_REGISTER(name, (n) * sizeof(type));
322
323
/** See \ref SYSLIB_MEMORY_MACROS for description. */
324
58.9M
#define C_ALLOC_SCRATCH_START(name, type, n) type name[n];
325
326
/** See \ref SYSLIB_MEMORY_MACROS for description. */
327
33.9M
#define C_AALLOC_SCRATCH_END(name, type, n) C_ALLOC_ALIGNED_UNREGISTER(name);
328
/** See \ref SYSLIB_MEMORY_MACROS for description. */
329
#define C_ALLOC_SCRATCH_END(name, type, n)
330
331
/** See \ref SYSLIB_MEMORY_MACROS for description. */
332
#define C_AALLOC_STACK_START(name, type, n)                   \
333
  type _##name[(n) + (ALIGNMENT_DEFAULT + sizeof(type) - 1)]; \
334
  type *name = (type *)ALIGN_PTR(_##name);                    \
335
  C_ALLOC_ALIGNED_REGISTER(name, (n) * sizeof(type));
336
337
/** See \ref SYSLIB_MEMORY_MACROS for description. */
338
#define C_AALLOC_STACK_END(name, type, n) C_ALLOC_ALIGNED_UNREGISTER(name);
339
340
/*! @} */
341
342
#define C_ALLOC_ALIGNED_REGISTER(x, size)
343
#define C_ALLOC_ALIGNED_UNREGISTER(x)
344
#define C_ALLOC_ALIGNED_CHECK(x)
345
#define C_ALLOC_ALIGNED_CHECK2(x, y)
346
#define FDK_showBacktrace(a, b)
347
348
/*! \addtogroup SYSLIB_EXITCODES Unified exit codes
349
 *  Exit codes to be used as return values of FDK software test and
350
 * demonstration applications. Not as return values of product modules and/or
351
 * libraries.
352
 *  @{
353
 */
354
#define FDK_EXITCODE_OK 0 /*!< Successful termination. No errors. */
355
#define FDK_EXITCODE_USAGE                                                  \
356
  64 /*!< The command/application was used incorrectly, e.g. with the wrong \
357
        number of arguments, a bad flag, a bad syntax in a parameter, or    \
358
        whatever. */
359
#define FDK_EXITCODE_DATAERROR                                               \
360
  65 /*!< The input data was incorrect in some way. This should only be used \
361
        for user data and not system files. */
362
#define FDK_EXITCODE_NOINPUT                                                   \
363
  66 /*!< An input file (not a system file) did not exist or was not readable. \
364
      */
365
#define FDK_EXITCODE_UNAVAILABLE                                              \
366
  69 /*!< A service is unavailable. This can occur if a support program or    \
367
        file does not exist. This can also be used as a catchall message when \
368
        something you wanted to do doesn't work, but you don't know why. */
369
#define FDK_EXITCODE_SOFTWARE                                                  \
370
  70 /*!< An internal software error has been detected. This should be limited \
371
        to non- operating system related errors as possible. */
372
#define FDK_EXITCODE_CANTCREATE \
373
  73 /*!< A (user specified) output file cannot be created. */
374
#define FDK_EXITCODE_IOERROR \
375
  74 /*!< An error occurred while doing I/O on some file. */
376
/*! @} */
377
378
/*--------------------------------------------
379
 * Runtime support declarations
380
 *---------------------------------------------*/
381
#ifdef __cplusplus
382
extern "C" {
383
#endif
384
385
void FDKprintf(const char *szFmt, ...);
386
387
void FDKprintfErr(const char *szFmt, ...);
388
389
/** Wrapper for <stdio.h>'s getchar(). */
390
int FDKgetchar(void);
391
392
INT FDKfprintf(void *stream, const char *format, ...);
393
INT FDKsprintf(char *str, const char *format, ...);
394
395
char *FDKstrchr(char *s, INT c);
396
const char *FDKstrstr(const char *haystack, const char *needle);
397
char *FDKstrcpy(char *dest, const char *src);
398
char *FDKstrncpy(char *dest, const char *src, const UINT n);
399
400
#define FDK_MAX_OVERLAYS 8 /**< Maximum number of memory overlays. */
401
402
void *FDKcalloc(const UINT n, const UINT size);
403
void *FDKmalloc(const UINT size);
404
void FDKfree(void *ptr);
405
406
/**
407
 *  Allocate and clear an aligned memory area. Use FDKafree() instead of
408
 * FDKfree() for these memory areas.
409
 *
410
 * \param size       Size of requested memory in bytes.
411
 * \param alignment  Alignment of requested memory in bytes.
412
 * \return           Pointer to allocated memory.
413
 */
414
void *FDKaalloc(const UINT size, const UINT alignment);
415
416
/**
417
 *  Free an aligned memory area.
418
 *
419
 * \param ptr  Pointer to be freed.
420
 */
421
void FDKafree(void *ptr);
422
423
/**
424
 *  Allocate memory in a specific memory section.
425
 *  Requests can be made for internal or external memory. If internal memory is
426
 *  requested, FDKcalloc_L() first tries to use L1 memory, which sizes are
427
 * defined by ::DATA_L1_A_SIZE and ::DATA_L1_B_SIZE. If no L1 memory is
428
 * available, then FDKcalloc_L() tries to use L2 memory. If that fails as well,
429
 * the requested memory is allocated at an extern location using the fallback
430
 * FDKcalloc().
431
 *
432
 * \param n     See MSDN documentation on calloc().
433
 * \param size  See MSDN documentation on calloc().
434
 * \param s     Memory section.
435
 * \return      See MSDN documentation on calloc().
436
 */
437
void *FDKcalloc_L(const UINT n, const UINT size, MEMORY_SECTION s);
438
439
/**
440
 *  Allocate aligned memory in a specific memory section.
441
 *  See FDKcalloc_L() description for details - same applies here.
442
 */
443
void *FDKaalloc_L(const UINT size, const UINT alignment, MEMORY_SECTION s);
444
445
/**
446
 *  Free memory that was allocated in a specific memory section.
447
 */
448
void FDKfree_L(void *ptr);
449
450
/**
451
 *  Free aligned memory that was allocated in a specific memory section.
452
 */
453
void FDKafree_L(void *ptr);
454
455
/**
456
 * Copy memory. Source and destination memory must not overlap.
457
 * Either use implementation from a Standard Library, or, if no Standard Library
458
 * is available, a generic implementation.
459
 * The define ::USE_BUILTIN_MEM_FUNCTIONS in genericStds.cpp controls what to
460
 * use. The function arguments correspond to the standard memcpy(). Please see
461
 * MSDN documentation for details on how to use it.
462
 */
463
void FDKmemcpy(void *dst, const void *src, const UINT size);
464
465
/**
466
 * Copy memory. Source and destination memory are allowed to overlap.
467
 * Either use implementation from a Standard Library, or, if no Standard Library
468
 * is available, a generic implementation.
469
 * The define ::USE_BUILTIN_MEM_FUNCTIONS in genericStds.cpp controls what to
470
 * use. The function arguments correspond to the standard memmove(). Please see
471
 * MSDN documentation for details on how to use it.
472
 */
473
void FDKmemmove(void *dst, const void *src, const UINT size);
474
475
/**
476
 * Clear memory.
477
 * Either use implementation from a Standard Library, or, if no Standard Library
478
 * is available, a generic implementation.
479
 * The define ::USE_BUILTIN_MEM_FUNCTIONS in genericStds.cpp controls what to
480
 * use. The function arguments correspond to the standard memclear(). Please see
481
 * MSDN documentation for details on how to use it.
482
 */
483
void FDKmemclear(void *memPtr, const UINT size);
484
485
/**
486
 * Fill memory with values.
487
 * The function arguments correspond to the standard memset(). Please see MSDN
488
 * documentation for details on how to use it.
489
 */
490
void FDKmemset(void *memPtr, const INT value, const UINT size);
491
492
/* Compare function wrappers */
493
INT FDKmemcmp(const void *s1, const void *s2, const UINT size);
494
INT FDKstrcmp(const char *s1, const char *s2);
495
INT FDKstrncmp(const char *s1, const char *s2, const UINT size);
496
497
UINT FDKstrlen(const char *s);
498
499
0
#define FDKmax(a, b) ((a) > (b) ? (a) : (b))
500
0
#define FDKmin(a, b) ((a) < (b) ? (a) : (b))
501
502
0
#define FDK_INT_MAX ((INT)0x7FFFFFFF)
503
0
#define FDK_INT_MIN ((INT)0x80000000)
504
505
/* FILE I/O */
506
507
/*!
508
 *  Check platform for endianess.
509
 *
510
 * \return  1 if platform is little endian, non-1 if platform is big endian.
511
 */
512
int IS_LITTLE_ENDIAN(void);
513
514
/*!
515
 *  Convert input value to little endian format.
516
 *
517
 * \param val  Value to be converted. It may be in both big or little endian.
518
 * \return     Value in little endian format.
519
 */
520
UINT TO_LITTLE_ENDIAN(UINT val);
521
522
/*!
523
 * \fn     FDKFILE *FDKfopen(const char *filename, const char *mode);
524
 *         Standard fopen() wrapper.
525
 * \fn     INT FDKfclose(FDKFILE *FP);
526
 *         Standard fclose() wrapper.
527
 * \fn     INT FDKfseek(FDKFILE *FP, LONG OFFSET, int WHENCE);
528
 *         Standard fseek() wrapper.
529
 * \fn     INT FDKftell(FDKFILE *FP);
530
 *         Standard ftell() wrapper.
531
 * \fn     INT FDKfflush(FDKFILE *fp);
532
 *         Standard fflush() wrapper.
533
 * \fn     UINT FDKfwrite(const void *ptrf, INT size, UINT nmemb, FDKFILE *fp);
534
 *         Standard fwrite() wrapper.
535
 * \fn     UINT FDKfread(void *dst, INT size, UINT nmemb, FDKFILE *fp);
536
 *         Standard fread() wrapper.
537
 */
538
typedef void FDKFILE;
539
extern const INT FDKSEEK_SET, FDKSEEK_CUR, FDKSEEK_END;
540
541
FDKFILE *FDKfopen(const char *filename, const char *mode);
542
INT FDKfclose(FDKFILE *FP);
543
INT FDKfseek(FDKFILE *FP, LONG OFFSET, int WHENCE);
544
INT FDKftell(FDKFILE *FP);
545
INT FDKfflush(FDKFILE *fp);
546
UINT FDKfwrite(const void *ptrf, INT size, UINT nmemb, FDKFILE *fp);
547
UINT FDKfread(void *dst, INT size, UINT nmemb, FDKFILE *fp);
548
char *FDKfgets(void *dst, INT size, FDKFILE *fp);
549
void FDKrewind(FDKFILE *fp);
550
INT FDKfeof(FDKFILE *fp);
551
552
/**
553
 * \brief        Write each member in little endian order. Convert automatically
554
 * to host endianess.
555
 * \param ptrf   Pointer to memory where to read data from.
556
 * \param size   Size of each item to be written.
557
 * \param nmemb  Number of items to be written.
558
 * \param fp     File pointer of type FDKFILE.
559
 * \return       Number of items read on success and fread() error on failure.
560
 */
561
UINT FDKfwrite_EL(const void *ptrf, INT size, UINT nmemb, FDKFILE *fp);
562
563
/**
564
 * \brief        Read variable of size "size" as little endian. Convert
565
 * automatically to host endianess. 4-byte alignment is enforced for 24 bit
566
 * data, at 32 bit full scale.
567
 * \param dst    Pointer to memory where to store data into.
568
 * \param size   Size of each item to be read.
569
 * \param nmemb  Number of items to be read.
570
 * \param fp     File pointer of type FDKFILE.
571
 * \return       Number of items read on success and fread() error on failure.
572
 */
573
UINT FDKfread_EL(void *dst, INT size, UINT nmemb, FDKFILE *fp);
574
575
/**
576
 * \brief  Print FDK software disclaimer.
577
 */
578
void FDKprintDisclaimer(void);
579
580
#ifdef __cplusplus
581
}
582
#endif
583
584
#endif /* GENERICSTDS_H */