Line data Source code
1 : /******************************************************************************************************
2 :
3 : (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
4 : Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
5 : Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
6 : Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
7 : contributors to this repository. All Rights Reserved.
8 :
9 : This software is protected by copyright law and by international treaties.
10 : The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
11 : Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
12 : Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
13 : Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
14 : contributors to this repository retain full ownership rights in their respective contributions in
15 : the software. This notice grants no license of any kind, including but not limited to patent
16 : license, nor is any license granted by implication, estoppel or otherwise.
17 :
18 : Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
19 : contributions.
20 :
21 : This software is provided "AS IS", without any express or implied warranties. The software is in the
22 : development stage. It is intended exclusively for experts who have experience with such software and
23 : solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
24 : and fitness for a particular purpose are hereby disclaimed and excluded.
25 :
26 : Any dispute, controversy or claim arising under or in relation to providing this software shall be
27 : submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
28 : accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
29 : the United Nations Convention on Contracts on the International Sales of Goods.
30 :
31 : *******************************************************************************************************/
32 :
33 : /*====================================================================================
34 : EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0
35 : ====================================================================================*/
36 :
37 : /* options.h needed for debugging/development features
38 : * It should be stripped for delivery along with debugging switches */
39 : #include "options.h"
40 :
41 : #ifndef IVAS_ERROR_H
42 : #define IVAS_ERROR_H
43 :
44 : typedef enum
45 : {
46 : /*----------------------------------------*
47 : * no error *
48 : *----------------------------------------*/
49 : IVAS_ERR_OK = 0x0000,
50 :
51 : /*----------------------------------------*
52 : * API errors *
53 : *----------------------------------------*/
54 : IVAS_ERR_INVALID_BANDWIDTH = 0x1000,
55 : IVAS_ERR_INVALID_DTX_UPDATE_RATE,
56 : IVAS_ERR_INVALID_SAMPLING_RATE,
57 : IVAS_ERR_NOT_CONFIGURED,
58 : IVAS_ERR_INVALID_STEREO_MODE,
59 : IVAS_ERR_INVALID_MC_LAYOUT,
60 : IVAS_ERR_INVALID_BITRATE,
61 : IVAS_ERR_INVALID_MASA_CONFIG,
62 : IVAS_ERR_TOO_MANY_INPUTS,
63 : IVAS_ERR_MISSING_METADATA,
64 : IVAS_ERR_RECONFIGURE_NOT_SUPPORTED,
65 : IVAS_ERR_INVALID_FEC_CONFIG,
66 : IVAS_ERR_INVALID_FEC_OFFSET,
67 : IVAS_ERR_INVALID_INPUT_BUFFER_SIZE,
68 : IVAS_ERR_INVALID_OUTPUT_BUFFER_SIZE,
69 : IVAS_ERR_DTX_NOT_SUPPORTED,
70 : IVAS_ERR_UNEXPECTED_NULL_POINTER,
71 : IVAS_ERR_METADATA_NOT_EXPECTED,
72 : IVAS_ERR_WRONG_PARAMS,
73 : IVAS_ERR_INIT_ERROR,
74 : IVAS_ERR_WRONG_MODE,
75 : IVAS_ERR_INVALID_OUTPUT_FORMAT,
76 : IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED,
77 : IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED,
78 : IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED,
79 : IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED,
80 : IVAS_ERR_INVALID_HRTF,
81 : #ifdef FIX_989_TD_REND_ROM
82 : IVAS_ERR_INVALID_HRTF_SAMPLING_RATE,
83 : #endif
84 : IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA,
85 : IVAS_ERR_INVALID_INPUT_FORMAT,
86 : IVAS_ERR_INVALID_INDEX,
87 : IVAS_ERR_NOT_SUPPORTED_OPTION,
88 : IVAS_ERR_NOT_IMPLEMENTED,
89 : IVAS_ERR_WAITING_FOR_BITSTREAM,
90 : IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT,
91 : IVAS_ERR_ISM_INVALID_METADATA_VALUE,
92 : IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE,
93 : IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED,
94 : IVAS_ERR_TSM_NOT_ENABLED,
95 : IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS,
96 : #ifdef DEBUGGING
97 : IVAS_ERR_INVALID_FORCE_MODE,
98 : #endif
99 :
100 : /*----------------------------------------*
101 : * input data errors *
102 : *----------------------------------------*/
103 : IVAS_ERR_INVALID_BITSTREAM = 0x2000,
104 : IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM,
105 : IVAS_ERR_UNEXPECTED_LC3PLUS_BITSTREAM_CONFIG,
106 :
107 : /*----------------------------------------*
108 : * hardware errors *
109 : *----------------------------------------*/
110 : IVAS_ERR_FAILED_ALLOC = 0x3000,
111 :
112 : /*----------------------------------------*
113 : * internal errors *
114 : *----------------------------------------*/
115 : IVAS_ERR_INTERNAL = 0x4000,
116 : IVAS_ERR_INTERNAL_FATAL,
117 :
118 : /*----------------------------------------*
119 : * file I/O errors (lib_util only) *
120 : *----------------------------------------*/
121 : IVAS_ERR_FAILED_FILE_OPEN = 0x5000,
122 : IVAS_ERR_FAILED_FILE_WRITE,
123 : IVAS_ERR_FAILED_FILE_READ,
124 : IVAS_ERR_FAILED_FILE_PARSE,
125 : IVAS_ERR_END_OF_FILE,
126 : IVAS_ERR_BITSTREAM_WRITER_INVALID_FORMAT,
127 : IVAS_ERR_BITSTREAM_READER_INVALID_DATA,
128 : IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT,
129 : IVAS_ERR_NO_FILE_OPEN,
130 : IVAS_ERR_SAMPLING_RATE_UNKNOWN,
131 :
132 : /*----------------------------------------*
133 : * renderer (lib_rend only) *
134 : *----------------------------------------*/
135 : IVAS_ERR_NUM_CHANNELS_UNKNOWN = 0x6000,
136 : IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT,
137 : IVAS_ERR_INVALID_INPUT_ID,
138 : IVAS_ERR_WRONG_NUM_CHANNELS,
139 : IVAS_ERR_INVALID_BUFFER_SIZE,
140 : IVAS_ERR_INVALID_RENDER_CONFIG,
141 : IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING,
142 : IVAS_ERR_INVALID_ER_PARAM,
143 : IVAS_ERR_DIRECTIVITY_PATTERN_ID_MISSING,
144 : IVAS_ERR_LC3PLUS_INVALID_BITRATE,
145 : IVAS_ERR_INVALID_SPLIT_REND_CONFIG,
146 :
147 : /*----------------------------------------*
148 : * unknown error *
149 : *----------------------------------------*/
150 : IVAS_ERR_UNKNOWN = 0xF000, /* fallback error code */
151 :
152 : } ivas_error;
153 :
154 :
155 0 : static inline const char *ivas_error_to_string( ivas_error error_code )
156 : {
157 : /* Try to match to a specific string */
158 0 : switch ( error_code )
159 : {
160 0 : case IVAS_ERR_OK:
161 0 : return "No error";
162 0 : case IVAS_ERR_FAILED_ALLOC:
163 0 : return "Failed allocation error";
164 0 : case IVAS_ERR_INTERNAL:
165 0 : return "Internal error";
166 0 : case IVAS_ERR_INTERNAL_FATAL:
167 0 : return "Internal fatal error";
168 0 : case IVAS_ERR_INVALID_SAMPLING_RATE:
169 0 : return "Invalid sampling rate";
170 0 : case IVAS_ERR_INVALID_OUTPUT_FORMAT:
171 0 : return "Invalid output format";
172 0 : case IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT:
173 0 : return "Invalid custom loudspeaker layout";
174 0 : case IVAS_ERR_INVALID_INPUT_ID:
175 0 : return "Invalid input ID";
176 0 : case IVAS_ERR_WRONG_NUM_CHANNELS:
177 0 : return "Wrong number of channels";
178 0 : case IVAS_ERR_INVALID_BUFFER_SIZE:
179 0 : return "Invalid buffer size";
180 0 : case IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED:
181 0 : return "Unsupported input/output config pair";
182 0 : case IVAS_ERR_FAILED_FILE_OPEN:
183 0 : return "File open error";
184 0 : case IVAS_ERR_FAILED_FILE_WRITE:
185 0 : return "File write error";
186 0 : case IVAS_ERR_FAILED_FILE_READ:
187 0 : return "File read error";
188 0 : case IVAS_ERR_FAILED_FILE_PARSE:
189 0 : return "Parse error";
190 0 : case IVAS_ERR_END_OF_FILE:
191 0 : return "End of file";
192 0 : case IVAS_ERR_WRONG_PARAMS:
193 0 : return "Wrong function parameters";
194 0 : case IVAS_ERR_INVALID_BANDWIDTH:
195 0 : return "Invalid bandwidth";
196 0 : case IVAS_ERR_INVALID_DTX_UPDATE_RATE:
197 0 : return "Invalid DTX update rate";
198 0 : case IVAS_ERR_NOT_CONFIGURED:
199 0 : return "Handle has not been configured";
200 0 : case IVAS_ERR_INVALID_STEREO_MODE:
201 0 : return "Invalid stereo mode";
202 0 : case IVAS_ERR_INVALID_MC_LAYOUT:
203 0 : return "Invalid speaker layout";
204 0 : case IVAS_ERR_INVALID_BITRATE:
205 0 : return "Invalid bitrate";
206 0 : case IVAS_ERR_INVALID_MASA_CONFIG:
207 0 : return "Invalid MASA config";
208 0 : case IVAS_ERR_TOO_MANY_INPUTS:
209 0 : return "Too many object inputs provided";
210 0 : case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED:
211 0 : return "Reconfigure not supported";
212 0 : case IVAS_ERR_INVALID_FEC_OFFSET:
213 0 : return "Invalid FEC offset";
214 0 : case IVAS_ERR_INVALID_INPUT_BUFFER_SIZE:
215 0 : return "Invalid input buffer size";
216 0 : case IVAS_ERR_INVALID_OUTPUT_BUFFER_SIZE:
217 0 : return "Invalid output buffer size";
218 0 : case IVAS_ERR_DTX_NOT_SUPPORTED:
219 0 : return "DTX is not supported in this IVAS format and element mode";
220 0 : case IVAS_ERR_UNEXPECTED_NULL_POINTER:
221 0 : return "Unexpected NULL pointer";
222 0 : case IVAS_ERR_METADATA_NOT_EXPECTED:
223 0 : return "Metadata input not expected for current configuration";
224 : #ifdef DEBUGGING
225 : case IVAS_ERR_INVALID_FORCE_MODE:
226 : return "Invalid force mode";
227 : #endif
228 0 : case IVAS_ERR_NOT_IMPLEMENTED:
229 0 : return "Not implemented";
230 0 : case IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT:
231 0 : return "Invalid metadata file format";
232 0 : case IVAS_ERR_ISM_INVALID_METADATA_VALUE:
233 0 : return "Invalid metadata value provided";
234 0 : case IVAS_ERR_NOT_SUPPORTED_OPTION:
235 0 : return "Option not supported in this set-up";
236 0 : case IVAS_ERR_INIT_ERROR:
237 0 : return "Initialization error";
238 0 : case IVAS_ERR_INVALID_BITSTREAM:
239 0 : return "Invalid bitstream";
240 0 : case IVAS_ERR_WRONG_MODE:
241 0 : return "Wrong mode";
242 0 : case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED:
243 0 : return "Head rotation not supported";
244 0 : case IVAS_ERR_LC3PLUS_INVALID_BITRATE:
245 0 : return "Specified split rendering bit rate is not supported";
246 0 : case IVAS_ERR_INVALID_SPLIT_REND_CONFIG:
247 0 : return "Specified split rendering configuration is invalid";
248 0 : case IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED:
249 0 : return "External orientation not supported";
250 0 : case IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED:
251 0 : return "Directivity not supported";
252 0 : case IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED:
253 0 : return "Acoustic environment not supported";
254 0 : case IVAS_ERR_INVALID_HRTF:
255 0 : return "Unsupported HRTF filter set";
256 : #ifdef FIX_989_TD_REND_ROM
257 0 : case IVAS_ERR_INVALID_HRTF_SAMPLING_RATE:
258 0 : return "Wrong sampling rate in HRTF binary file";
259 : #endif
260 0 : case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA:
261 0 : return "Renderer data missing in HRTF binary file";
262 0 : case IVAS_ERR_INVALID_INPUT_FORMAT:
263 0 : return "Invalid input format";
264 0 : case IVAS_ERR_INVALID_INDEX:
265 0 : return "Invalid index";
266 0 : default:
267 0 : break;
268 : }
269 :
270 : /* For error categories that are likely to still have many changes to
271 : * specific error codes, return one string per category */
272 0 : if ( ( error_code & 0xF000 ) == 0x1000 )
273 : {
274 0 : return "API error";
275 : }
276 0 : if ( ( error_code & 0xF000 ) == 0x2000 )
277 : {
278 0 : return "data error";
279 : }
280 :
281 0 : return "Unknown error";
282 : }
283 :
284 : #endif /* IVAS_ERROR_H */
|