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.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 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 : IVAS_ERR_INVALID_INPUT_FORMAT,
82 : IVAS_ERR_INVALID_INDEX,
83 : IVAS_ERR_NOT_SUPPORTED_OPTION,
84 : IVAS_ERR_NOT_IMPLEMENTED,
85 : IVAS_ERR_WAITING_FOR_BITSTREAM,
86 : IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT,
87 : IVAS_ERR_ISM_INVALID_METADATA_VALUE,
88 : IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE,
89 : IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED,
90 : IVAS_ERR_TSM_NOT_ENABLED,
91 : IVAS_ERR_FETCH_SIZE_NO_MULTIPLE_OF_5MS,
92 : #ifdef DEBUGGING
93 : IVAS_ERR_INVALID_FORCE_MODE,
94 : #endif
95 :
96 : /*----------------------------------------*
97 : * input data errors *
98 : *----------------------------------------*/
99 : IVAS_ERR_INVALID_BITSTREAM = 0x2000,
100 :
101 : /*----------------------------------------*
102 : * hardware errors *
103 : *----------------------------------------*/
104 : IVAS_ERR_FAILED_ALLOC = 0x3000,
105 :
106 : /*----------------------------------------*
107 : * internal errors *
108 : *----------------------------------------*/
109 : IVAS_ERR_INTERNAL = 0x4000,
110 : IVAS_ERR_INTERNAL_FATAL,
111 :
112 : /*----------------------------------------*
113 : * file I/O errors (lib_util only) *
114 : *----------------------------------------*/
115 : IVAS_ERR_FAILED_FILE_OPEN = 0x5000,
116 : IVAS_ERR_FAILED_FILE_WRITE,
117 : IVAS_ERR_FAILED_FILE_READ,
118 : IVAS_ERR_FAILED_FILE_PARSE,
119 : IVAS_ERR_END_OF_FILE,
120 : IVAS_ERR_BITSTREAM_WRITER_INVALID_FORMAT,
121 : IVAS_ERR_BITSTREAM_READER_INVALID_DATA,
122 : IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT,
123 : IVAS_ERR_NO_FILE_OPEN,
124 : IVAS_ERR_SAMPLING_RATE_UNKNOWN,
125 :
126 : /*----------------------------------------*
127 : * renderer (lib_rend only) *
128 : *----------------------------------------*/
129 : IVAS_ERR_NUM_CHANNELS_UNKNOWN = 0x6000,
130 : IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT,
131 : IVAS_ERR_INVALID_INPUT_ID,
132 : IVAS_ERR_WRONG_NUM_CHANNELS,
133 : IVAS_ERR_INVALID_BUFFER_SIZE,
134 : IVAS_ERR_INVALID_RENDER_CONFIG,
135 : IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING,
136 : IVAS_ERR_INVALID_ER_PARAM,
137 : IVAS_ERR_DIRECTIVITY_PATTERN_ID_MISSING,
138 :
139 : /*----------------------------------------*
140 : * unknown error *
141 : *----------------------------------------*/
142 : IVAS_ERR_UNKNOWN = 0xF000, /* fallback error code */
143 :
144 : } ivas_error;
145 :
146 :
147 6 : static inline const char *ivas_error_to_string( ivas_error error_code )
148 : {
149 : /* Try to match to a specific string */
150 6 : switch ( error_code )
151 : {
152 0 : case IVAS_ERR_OK:
153 0 : return "No error";
154 0 : case IVAS_ERR_FAILED_ALLOC:
155 0 : return "Failed allocation error";
156 0 : case IVAS_ERR_INTERNAL:
157 0 : return "Internal error";
158 0 : case IVAS_ERR_INTERNAL_FATAL:
159 0 : return "Internal fatal error";
160 0 : case IVAS_ERR_INVALID_SAMPLING_RATE:
161 0 : return "Invalid sampling rate";
162 6 : case IVAS_ERR_INVALID_OUTPUT_FORMAT:
163 6 : return "Invalid output format";
164 0 : case IVAS_ERR_INVALID_CUSTOM_LS_LAYOUT:
165 0 : return "Invalid custom loudspeaker layout";
166 0 : case IVAS_ERR_INVALID_INPUT_ID:
167 0 : return "Invalid input ID";
168 0 : case IVAS_ERR_WRONG_NUM_CHANNELS:
169 0 : return "Wrong number of channels";
170 0 : case IVAS_ERR_INVALID_BUFFER_SIZE:
171 0 : return "Invalid buffer size";
172 0 : case IVAS_ERR_IO_CONFIG_PAIR_NOT_SUPPORTED:
173 0 : return "Unsupported input/output config pair";
174 0 : case IVAS_ERR_FAILED_FILE_OPEN:
175 0 : return "File open error";
176 0 : case IVAS_ERR_FAILED_FILE_WRITE:
177 0 : return "File write error";
178 0 : case IVAS_ERR_FAILED_FILE_READ:
179 0 : return "File read error";
180 0 : case IVAS_ERR_FAILED_FILE_PARSE:
181 0 : return "Parse error";
182 0 : case IVAS_ERR_END_OF_FILE:
183 0 : return "End of file";
184 0 : case IVAS_ERR_WRONG_PARAMS:
185 0 : return "Wrong function parameters";
186 0 : case IVAS_ERR_INVALID_BANDWIDTH:
187 0 : return "Invalid bandwidth";
188 0 : case IVAS_ERR_INVALID_DTX_UPDATE_RATE:
189 0 : return "Invalid DTX update rate";
190 0 : case IVAS_ERR_NOT_CONFIGURED:
191 0 : return "Handle has not been configured";
192 0 : case IVAS_ERR_INVALID_STEREO_MODE:
193 0 : return "Invalid stereo mode";
194 0 : case IVAS_ERR_INVALID_MC_LAYOUT:
195 0 : return "Invalid speaker layout";
196 0 : case IVAS_ERR_INVALID_BITRATE:
197 0 : return "Invalid bitrate";
198 0 : case IVAS_ERR_INVALID_MASA_CONFIG:
199 0 : return "Invalid MASA config";
200 0 : case IVAS_ERR_TOO_MANY_INPUTS:
201 0 : return "Too many object inputs provided";
202 0 : case IVAS_ERR_RECONFIGURE_NOT_SUPPORTED:
203 0 : return "Reconfigure not supported";
204 0 : case IVAS_ERR_INVALID_FEC_OFFSET:
205 0 : return "Invalid FEC offset";
206 0 : case IVAS_ERR_INVALID_INPUT_BUFFER_SIZE:
207 0 : return "Invalid input buffer size";
208 0 : case IVAS_ERR_INVALID_OUTPUT_BUFFER_SIZE:
209 0 : return "Invalid output buffer size";
210 0 : case IVAS_ERR_DTX_NOT_SUPPORTED:
211 0 : return "DTX is not supported in this IVAS format and element mode";
212 0 : case IVAS_ERR_UNEXPECTED_NULL_POINTER:
213 0 : return "Unexpected NULL pointer";
214 0 : case IVAS_ERR_METADATA_NOT_EXPECTED:
215 0 : return "Metadata input not expected for current configuration";
216 : #ifdef DEBUGGING
217 : case IVAS_ERR_INVALID_FORCE_MODE:
218 : return "Invalid force mode";
219 : #endif
220 0 : case IVAS_ERR_NOT_IMPLEMENTED:
221 0 : return "Not implemented";
222 0 : case IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT:
223 0 : return "Invalid metadata file format";
224 0 : case IVAS_ERR_ISM_INVALID_METADATA_VALUE:
225 0 : return "Invalid metadata value provided";
226 0 : case IVAS_ERR_NOT_SUPPORTED_OPTION:
227 0 : return "Option not supported in this set-up";
228 0 : case IVAS_ERR_INIT_ERROR:
229 0 : return "Initialization error";
230 0 : case IVAS_ERR_INVALID_BITSTREAM:
231 0 : return "Invalid bitstream";
232 0 : case IVAS_ERR_WRONG_MODE:
233 0 : return "Wrong mode";
234 0 : case IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED:
235 0 : return "Head rotation not supported";
236 0 : case IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED:
237 0 : return "External orientation not supported";
238 0 : case IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED:
239 0 : return "Directivity not supported";
240 0 : case IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED:
241 0 : return "Acoustic environment not supported";
242 0 : case IVAS_ERR_INVALID_HRTF:
243 0 : return "Unsupported HRTF filter set";
244 0 : case IVAS_ERR_INVALID_INPUT_FORMAT:
245 0 : return "Invalid input format";
246 0 : case IVAS_ERR_INVALID_INDEX:
247 0 : return "Invalid index";
248 0 : default:
249 0 : break;
250 : }
251 :
252 : /* For error categories that are likely to still have many changes to
253 : * specific error codes, return one string per category */
254 0 : if ( ( error_code & 0xF000 ) == 0x1000 )
255 : {
256 0 : return "API error";
257 : }
258 0 : if ( ( error_code & 0xF000 ) == 0x2000 )
259 : {
260 0 : return "data error";
261 : }
262 :
263 0 : return "Unknown error";
264 : }
265 :
266 : #endif /* IVAS_ERROR_H */
|