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_AALTO_MCC,
117 LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC_SUBSET,
118 LOUDSPEAKER_ARRAY_PRESET_AALTO_APAJA,
119 LOUDSPEAKER_ARRAY_PRESET_AALTO_LR,
120 LOUDSPEAKER_ARRAY_PRESET_DTU_AVIL,
121 LOUDSPEAKER_ARRAY_PRESET_ZYLIA_LAB,
122 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_4,
123 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_12,
124 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_24,
125 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_36,
126 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_48,
127 LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_60,
128 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_9,
129 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_16,
130 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_25,
131 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_49,
132 LOUDSPEAKER_ARRAY_PRESET_SPH_COV_64
133
135
137typedef enum {
138 SOURCE_CONFIG_PRESET_DEFAULT = 1,
139 SOURCE_CONFIG_PRESET_MONO,
140 SOURCE_CONFIG_PRESET_STEREO,
141 SOURCE_CONFIG_PRESET_5PX,
142 SOURCE_CONFIG_PRESET_7PX,
143 SOURCE_CONFIG_PRESET_8PX,
144 SOURCE_CONFIG_PRESET_9PX,
145 SOURCE_CONFIG_PRESET_10PX,
146 SOURCE_CONFIG_PRESET_11PX,
147 SOURCE_CONFIG_PRESET_11PX_7_4,
148 SOURCE_CONFIG_PRESET_13PX,
149 SOURCE_CONFIG_PRESET_22PX,
150 SOURCE_CONFIG_PRESET_22P2_9_10_3,
151 SOURCE_CONFIG_PRESET_AALTO_MCC,
152 SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET,
153 SOURCE_CONFIG_PRESET_AALTO_APAJA,
154 SOURCE_CONFIG_PRESET_AALTO_LR,
155 SOURCE_CONFIG_PRESET_DTU_AVIL,
156 SOURCE_CONFIG_PRESET_ZYLIA_LAB,
157 SOURCE_CONFIG_PRESET_T_DESIGN_4,
158 SOURCE_CONFIG_PRESET_T_DESIGN_12,
159 SOURCE_CONFIG_PRESET_T_DESIGN_24,
160 SOURCE_CONFIG_PRESET_T_DESIGN_36,
161 SOURCE_CONFIG_PRESET_T_DESIGN_48,
162 SOURCE_CONFIG_PRESET_T_DESIGN_60,
163 SOURCE_CONFIG_PRESET_SPH_COV_9,
164 SOURCE_CONFIG_PRESET_SPH_COV_16,
165 SOURCE_CONFIG_PRESET_SPH_COV_25,
166 SOURCE_CONFIG_PRESET_SPH_COV_49,
167 SOURCE_CONFIG_PRESET_SPH_COV_64
168
170
178
180#define NUM_STATIC_BEAM_TYPES ( 3 )
181
190
198
214
229
231#define PROGRESSBARTEXT_CHAR_LENGTH ( 256 )
232
234#define MAX_NUM_CHANNELS ( 128 )
235
237#define MAX_NUM_INPUTS ( MAX_NUM_CHANNELS )
238
240#define MAX_NUM_OUTPUTS ( MAX_NUM_CHANNELS )
241
243#define MAX_NUM_SH_SIGNALS ( MAX_NUM_CHANNELS )
244
245#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__)
246 typedef _Atomic CH_ORDER _Atomic_CH_ORDER;
247 typedef _Atomic NORM_TYPES _Atomic_NORM_TYPES;
248 typedef _Atomic SH_ORDERS _Atomic_SH_ORDERS;
249 typedef _Atomic MIC_PRESETS _Atomic_MIC_PRESETS;
250 typedef _Atomic LOUDSPEAKER_ARRAY_PRESETS _Atomic_LOUDSPEAKER_ARRAY_PRESETS;
251 typedef _Atomic SOURCE_CONFIG_PRESETS _Atomic_SOURCE_CONFIG_PRESETS;
252 typedef _Atomic STATIC_BEAM_TYPES _Atomic_STATIC_BEAM_TYPES;
253 typedef _Atomic HFOV_OPTIONS _Atomic_HFOV_OPTIONS;
254 typedef _Atomic ASPECT_RATIO_OPTIONS _Atomic_ASPECT_RATIO_OPTIONS;
255 typedef _Atomic CODEC_STATUS _Atomic_CODEC_STATUS;
256 typedef _Atomic PROC_STATUS _Atomic_PROC_STATUS;
257#else
258 typedef CH_ORDER _Atomic_CH_ORDER;
259 typedef NORM_TYPES _Atomic_NORM_TYPES;
260 typedef SH_ORDERS _Atomic_SH_ORDERS;
261 typedef MIC_PRESETS _Atomic_MIC_PRESETS;
262 typedef LOUDSPEAKER_ARRAY_PRESETS _Atomic_LOUDSPEAKER_ARRAY_PRESETS;
263 typedef SOURCE_CONFIG_PRESETS _Atomic_SOURCE_CONFIG_PRESETS;
264 typedef STATIC_BEAM_TYPES _Atomic_STATIC_BEAM_TYPES;
265 typedef HFOV_OPTIONS _Atomic_HFOV_OPTIONS;
266 typedef ASPECT_RATIO_OPTIONS _Atomic_ASPECT_RATIO_OPTIONS;
267 typedef CODEC_STATUS _Atomic_CODEC_STATUS;
268 typedef PROC_STATUS _Atomic_PROC_STATUS;
269#endif
270
271
272#ifdef __cplusplus
273} /* extern "C" { */
274#endif /* __cplusplus */
275
276#endif /* __COMMON_H_INCLUDED__ */
STATIC_BEAM_TYPES
Available static beamforming approaches.
Definition _common.h:172
@ STATIC_BEAM_TYPE_MAX_EV
hyper-cardioid with max_rE weighting
Definition _common.h:175
@ STATIC_BEAM_TYPE_HYPERCARDIOID
hyper-cardioid
Definition _common.h:174
@ STATIC_BEAM_TYPE_CARDIOID
cardioid
Definition _common.h:173
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:137
PROC_STATUS
Current status of the processing loop.
Definition _common.h:223
@ PROC_STATUS_ONGOING
Codec is processing input audio, and should not be reinitialised at this time.
Definition _common.h:224
@ PROC_STATUS_NOT_ONGOING
Codec is not processing input audio, and may be reinitialised if needed.
Definition _common.h:226
HFOV_OPTIONS
Available horizontal field-of-view (FOV) options.
Definition _common.h:183
@ HFOV_60
60 degrees
Definition _common.h:187
@ HFOV_360
360 degrees
Definition _common.h:184
@ HFOV_180
180 degrees
Definition _common.h:185
@ HFOV_90
90 degrees
Definition _common.h:186
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:205
@ CODEC_STATUS_NOT_INITIALISED
Codec has not yet been initialised, or the codec configuration has changed.
Definition _common.h:208
@ CODEC_STATUS_INITIALISED
Codec is initialised and ready to process input audio.
Definition _common.h:206
@ CODEC_STATUS_INITIALISING
Codec is currently being initialised, input audio should not be processed.
Definition _common.h:211
ASPECT_RATIO_OPTIONS
Available aspect ratios.
Definition _common.h:192
@ ASPECT_RATIO_4_3
ASPECT_RATIO_4_3 - 4:3.
Definition _common.h:195
@ ASPECT_RATIO_16_9
ASPECT_RATIO_16_9 - 16:9.
Definition _common.h:194
@ ASPECT_RATIO_2_1
ASPECT_RATIO_2_1 - 2:1.
Definition _common.h:193