SAF
Loading...
Searching...
No Matches
_common.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
25
26#ifndef __COMMON_H_INCLUDED__
27#define __COMMON_H_INCLUDED__
28
29#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
33#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__)
34 #include <stdatomic.h>
35#endif
36
37/* ========================================================================== */
38/* Presets + Constants */
39/* ========================================================================== */
40
54
56#define MAX_SH_ORDER ( 10 )
57
63typedef enum {
64 CH_ACN = 1,
66
67} CH_ORDER;
68
70#define NUM_CH_ORDERINGS ( 2 )
71
78typedef enum {
82
84
86#define NUM_NORM_TYPES ( 3 )
87
94typedef enum {
95 MIC_PRESET_IDEAL = 1,
96 MIC_PRESET_ZYLIA,
97 MIC_PRESET_EIGENMIKE32,
98 MIC_PRESET_DTU_MIC
99
101
103typedef enum {
104 LOUDSPEAKER_ARRAY_PRESET_DEFAULT = 1,
105 LOUDSPEAKER_ARRAY_PRESET_STEREO,
106 LOUDSPEAKER_ARRAY_PRESET_5PX,
107 LOUDSPEAKER_ARRAY_PRESET_7PX,
108 LOUDSPEAKER_ARRAY_PRESET_8PX,
109 LOUDSPEAKER_ARRAY_PRESET_9PX,
110 LOUDSPEAKER_ARRAY_PRESET_10PX,
111 LOUDSPEAKER_ARRAY_PRESET_11PX,
112 LOUDSPEAKER_ARRAY_PRESET_11PX_7_4,
113 LOUDSPEAKER_ARRAY_PRESET_13PX,
114 LOUDSPEAKER_ARRAY_PRESET_22PX,
115 LOUDSPEAKER_ARRAY_PRESET_22P2_9_10_3,
116 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_STEREO,
117 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_LCR,
118 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_QUAD,
119 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0,
120 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0_2,
121 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0_4,
122 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0,
123 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_2,
124 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_4,
125 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_6,
126 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_9_0_4,
127 LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_9_0_6,
128 LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC,
129 LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC_SUBSET,
130 LOUDSPEAKER_ARRAY_PRESET_AALTO_APAJA,
131 LOUDSPEAKER_ARRAY_PRESET_AALTO_LR,
132 LOUDSPEAKER_ARRAY_PRESET_DTU_AVIL,
133 LOUDSPEAKER_ARRAY_PRESET_ZYLIA_LAB,
134 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_4,
135 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_12,
136 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_24,
137 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_36,
138 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_48,
139 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_60,
140 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_9,
141 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_16,
142 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_25,
143 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_49,
144 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_64
145
147
149typedef enum {
150 SOURCE_CONFIG_PRESET_DEFAULT = 1,
151 SOURCE_CONFIG_PRESET_MONO,
152 SOURCE_CONFIG_PRESET_STEREO,
153 SOURCE_CONFIG_PRESET_5PX,
154 SOURCE_CONFIG_PRESET_7PX,
155 SOURCE_CONFIG_PRESET_8PX,
156 SOURCE_CONFIG_PRESET_9PX,
157 SOURCE_CONFIG_PRESET_10PX,
158 SOURCE_CONFIG_PRESET_11PX,
159 SOURCE_CONFIG_PRESET_11PX_7_4,
160 SOURCE_CONFIG_PRESET_13PX,
161 SOURCE_CONFIG_PRESET_22PX,
162 SOURCE_CONFIG_PRESET_22P2_9_10_3,
163 SOURCE_CONFIG_PRESET_PROTOOLS_STEREO,
164 SOURCE_CONFIG_PRESET_PROTOOLS_LCR,
165 SOURCE_CONFIG_PRESET_PROTOOLS_QUAD,
166 SOURCE_CONFIG_PRESET_PROTOOLS_5_0,
167 SOURCE_CONFIG_PRESET_PROTOOLS_5_0_2,
168 SOURCE_CONFIG_PRESET_PROTOOLS_5_0_4,
169 SOURCE_CONFIG_PRESET_PROTOOLS_7_0,
170 SOURCE_CONFIG_PRESET_PROTOOLS_7_0_2,
171 SOURCE_CONFIG_PRESET_PROTOOLS_7_0_4,
172 SOURCE_CONFIG_PRESET_PROTOOLS_7_0_6,
173 SOURCE_CONFIG_PRESET_PROTOOLS_9_0_4,
174 SOURCE_CONFIG_PRESET_PROTOOLS_9_0_6,
175 SOURCE_CONFIG_PRESET_AALTO_MCC,
176 SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET,
177 SOURCE_CONFIG_PRESET_AALTO_APAJA,
178 SOURCE_CONFIG_PRESET_AALTO_LR,
179 SOURCE_CONFIG_PRESET_DTU_AVIL,
180 SOURCE_CONFIG_PRESET_ZYLIA_LAB,
181 SOURCE_CONFIG_PRESET_T_DESIGN_4,
182 SOURCE_CONFIG_PRESET_T_DESIGN_12,
183 SOURCE_CONFIG_PRESET_T_DESIGN_24,
184 SOURCE_CONFIG_PRESET_T_DESIGN_36,
185 SOURCE_CONFIG_PRESET_T_DESIGN_48,
186 SOURCE_CONFIG_PRESET_T_DESIGN_60,
187 SOURCE_CONFIG_PRESET_SPH_COV_9,
188 SOURCE_CONFIG_PRESET_SPH_COV_16,
189 SOURCE_CONFIG_PRESET_SPH_COV_25,
190 SOURCE_CONFIG_PRESET_SPH_COV_49,
191 SOURCE_CONFIG_PRESET_SPH_COV_64
192
194
202
204#define NUM_STATIC_BEAM_TYPES ( 3 )
205
214
222
238
253
255#define PROGRESSBARTEXT_CHAR_LENGTH ( 256 )
256
258#define MAX_NUM_CHANNELS ( 128 )
259
261#define MAX_NUM_INPUTS ( MAX_NUM_CHANNELS )
262
264#define MAX_NUM_OUTPUTS ( MAX_NUM_CHANNELS )
265
267#define MAX_NUM_SH_SIGNALS ( MAX_NUM_CHANNELS )
268
269#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__)
270 typedef _Atomic CH_ORDER _Atomic_CH_ORDER;
271 typedef _Atomic NORM_TYPES _Atomic_NORM_TYPES;
272 typedef _Atomic SH_ORDERS _Atomic_SH_ORDERS;
273 typedef _Atomic MIC_PRESETS _Atomic_MIC_PRESETS;
274 typedef _Atomic LOUDSPEAKER_ARRAY_PRESETS _Atomic_LOUDSPEAKER_ARRAY_PRESETS;
275 typedef _Atomic SOURCE_CONFIG_PRESETS _Atomic_SOURCE_CONFIG_PRESETS;
276 typedef _Atomic STATIC_BEAM_TYPES _Atomic_STATIC_BEAM_TYPES;
277 typedef _Atomic HFOV_OPTIONS _Atomic_HFOV_OPTIONS;
278 typedef _Atomic ASPECT_RATIO_OPTIONS _Atomic_ASPECT_RATIO_OPTIONS;
279 typedef _Atomic CODEC_STATUS _Atomic_CODEC_STATUS;
280 typedef _Atomic PROC_STATUS _Atomic_PROC_STATUS;
281#else
282 typedef CH_ORDER _Atomic_CH_ORDER;
283 typedef NORM_TYPES _Atomic_NORM_TYPES;
284 typedef SH_ORDERS _Atomic_SH_ORDERS;
285 typedef MIC_PRESETS _Atomic_MIC_PRESETS;
286 typedef LOUDSPEAKER_ARRAY_PRESETS _Atomic_LOUDSPEAKER_ARRAY_PRESETS;
287 typedef SOURCE_CONFIG_PRESETS _Atomic_SOURCE_CONFIG_PRESETS;
288 typedef STATIC_BEAM_TYPES _Atomic_STATIC_BEAM_TYPES;
289 typedef HFOV_OPTIONS _Atomic_HFOV_OPTIONS;
290 typedef ASPECT_RATIO_OPTIONS _Atomic_ASPECT_RATIO_OPTIONS;
291 typedef CODEC_STATUS _Atomic_CODEC_STATUS;
292 typedef PROC_STATUS _Atomic_PROC_STATUS;
293#endif
294
295
296#ifdef __cplusplus
297} /* extern "C" { */
298#endif /* __cplusplus */
299
300#endif /* __COMMON_H_INCLUDED__ */
STATIC_BEAM_TYPES
Available static beamforming approaches.
Definition _common.h:196
@ STATIC_BEAM_TYPE_MAX_EV
hyper-cardioid with max_rE weighting
Definition _common.h:199
@ STATIC_BEAM_TYPE_HYPERCARDIOID
hyper-cardioid
Definition _common.h:198
@ STATIC_BEAM_TYPE_CARDIOID
cardioid
Definition _common.h:197
LOUDSPEAKER_ARRAY_PRESETS
Available loudspeaker array presets.
Definition _common.h:103
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
Definition _common.h:149
PROC_STATUS
Current status of the processing loop.
Definition _common.h:247
@ PROC_STATUS_ONGOING
Codec is processing input audio, and should not be reinitialised at this time.
Definition _common.h:248
@ PROC_STATUS_NOT_ONGOING
Codec is not processing input audio, and may be reinitialised if needed.
Definition _common.h:250
HFOV_OPTIONS
Available horizontal field-of-view (FOV) options.
Definition _common.h:207
@ HFOV_60
60 degrees
Definition _common.h:211
@ HFOV_360
360 degrees
Definition _common.h:208
@ HFOV_180
180 degrees
Definition _common.h:209
@ HFOV_90
90 degrees
Definition _common.h:210
NORM_TYPES
Available Ambisonic normalisation conventions.
Definition _common.h:78
@ NORM_SN3D
Schmidt semi-normalisation (SN3D)
Definition _common.h:80
@ NORM_FUMA
(Legacy) Furse-Malham scaling
Definition _common.h:81
@ NORM_N3D
orthonormalised (N3D)
Definition _common.h:79
MIC_PRESETS
Available microphone array presets.
Definition _common.h:94
CH_ORDER
Available Ambisonic channel ordering conventions.
Definition _common.h:63
@ CH_ACN
Ambisonic Channel Numbering (ACN)
Definition _common.h:64
@ CH_FUMA
(Legacy) Furse-Malham/B-format (WXYZ)
Definition _common.h:65
SH_ORDERS
Available spherical harmonic (SH) input/output order options.
Definition _common.h:42
@ SH_ORDER_SECOND
Second-order (9 channels)
Definition _common.h:44
@ SH_ORDER_FOURTH
Fourth-order (25 channels)
Definition _common.h:46
@ SH_ORDER_FIRST
First-order (4 channels)
Definition _common.h:43
@ SH_ORDER_THIRD
Third-order (16 channels)
Definition _common.h:45
@ SH_ORDER_FIFTH
Fifth-order (36 channels)
Definition _common.h:47
@ SH_ORDER_EIGHTH
Eighth-order (81 channels)
Definition _common.h:50
@ SH_ORDER_NINTH
Ninth-order (100 channels)
Definition _common.h:51
@ SH_ORDER_TENTH
Tenth-order (121 channels)
Definition _common.h:52
@ SH_ORDER_SIXTH
Sixth-order (49 channels)
Definition _common.h:48
@ SH_ORDER_SEVENTH
Seventh-order (64 channels)
Definition _common.h:49
CODEC_STATUS
Current status of the codec.
Definition _common.h:229
@ CODEC_STATUS_NOT_INITIALISED
Codec has not yet been initialised, or the codec configuration has changed.
Definition _common.h:232
@ CODEC_STATUS_INITIALISED
Codec is initialised and ready to process input audio.
Definition _common.h:230
@ CODEC_STATUS_INITIALISING
Codec is currently being initialised, input audio should not be processed.
Definition _common.h:235
ASPECT_RATIO_OPTIONS
Available aspect ratios.
Definition _common.h:216
@ ASPECT_RATIO_4_3
ASPECT_RATIO_4_3 - 4:3.
Definition _common.h:219
@ ASPECT_RATIO_16_9
ASPECT_RATIO_16_9 - 16:9.
Definition _common.h:218
@ ASPECT_RATIO_2_1
ASPECT_RATIO_2_1 - 2:1.
Definition _common.h:217