Mach1 Spatial SDK
Loading...
Searching...
No Matches
Mach1TranscodeConstants.h
1// Mach1 Spatial SDK
2// Copyright © 2017-2022 Mach1. All rights reserved.
3//
4
5#pragma once
6
7#ifndef Mach1TranscodeConstants_h
8# define Mach1TranscodeConstants_h
9
10# include <map>
11# include <math.h>
12# include <stddef.h>
13# include <string>
14# include <vector>
15
16enum Mach1ChannelType {
17 Mach1ChannelTypeDiscrete = (int)0,
18 Mach1ChannelTypeLFE,
19 Mach1ChannelTypeC
20};
21
23 int index;
24 Mach1ChannelType type;
25};
26
28 std::string name;
29 int numChannels;
30 std::vector<Mach1ChannelDescription> channelTypes;
31};
32
34 Mach1GainCoeff(float _gain = 1.0f, bool _isDecibel = false) {
35 gain = _gain;
36 isDecibel = _isDecibel;
37 }
38 float gain;
39 bool isDecibel;
40};
41
45
47 std::vector<float> data;
48};
49
51 float azimuth;
52 float elevation;
53 float diverge;
54 Mach1GainCoeff outputGain; // can be used to apply pan-law concepts
55};
56
58 public:
59 static Mach1TranscodeCoeffs *Coeffs(std::vector<float> data) {
61 obj->data = data;
62 return obj;
63 }
64
65 static Mach1TranscodePanner *Panner(float azimuthFromMinus180to180, float elevationFromMinus90to90, float divergeFromMinus1To1, const Mach1GainCoeff &outputGain) {
67 obj->azimuth = azimuthFromMinus180to180;
68 obj->elevation = elevationFromMinus90to90;
69 obj->diverge = divergeFromMinus1To1;
70 obj->outputGain = outputGain;
71 return obj;
72 }
73 static Mach1TranscodePanner *Panner(float azimuthFromMinus180to180, float elevationFromMinus90to90, float divergeFromMinus1To1) {
75 Mach1GainCoeff default_gain = {1.0f, false};
76 obj->azimuth = azimuthFromMinus180to180;
77 obj->elevation = elevationFromMinus90to90;
78 obj->diverge = divergeFromMinus1To1;
79 obj->outputGain = default_gain;
80 return obj;
81 }
82};
83
85 std::string formatFrom;
86 std::string formatTo;
87 std::vector<Mach1TranscodeChannelBase *> channels;
88};
89
90namespace Mach1TranscodeConstants {
91
92const int MAXCHANS = 64;
93
94const std::vector<Mach1FormatInfo> formats = {
95 /*
96 * VECTOR (VVBP / SPS)
97 */
98 {"CustomPoints", 0},
99 {"Empty", 0},
100 {"1.0", 1},
101 {"M1Spatial-4", 4}, // MACH1SPATIAL-4
102 {"M1Horizon-4_2", 6}, // MACH1SPATIAL-4 + HEADLOCKED STEREO
103// {"M1HorizonPairs", 8},
104 {"M1Spatial-6", 6}, // MACH1SPATIAL-6 (hexadron planes)
105 {"M1Spatial-8", 8}, // MACH1SPATIAL-8 (cube [default])
106 {"M1Spatial-8_2", 10}, // MACH1SPATIAL-8 + HEADLOCKED STEREO
107 {"M1Spatial-12", 12}, // MACH1SPATIAL-12 (hexadron vertices + horizontal hexadron planes)
108 {"M1Spatial-14", 14}, // MACH1SPATIAL-14 (Tetrakis Hexahedron)
109 /*
110 * SURROUND
111 */
112 {"2.0_M", 2},
113 {"2.0_C", 2},
114 {"3.0_LCR", 3},
115// {"4.0_LCRS", 4},
116// {"4.0_AFormat", 4},
117 {"5.0_M", 5},
118 {"5.0_C", 5},
119 {"5.0_S", 5},
120 {"5.0_R", 5},
121 {"5.0_C_SIM", 5},
122 {"5.1_M", 6},
123 {"5.1_C", 6},
124 {"5.1_S", 6},
125 {"5.1_R", 6},
126 {"5.1_M_SMPTE", 6},
127// {"5.1_C_SMPTE", 6},
128// {"5.1_S_SMPTE", 6},
129// {"5.1_R_SMPTE", 6},
130 {"5.1_M_Dts", 6},
131// {"5.1_C_Dts", 6},
132// {"5.1_S_Dts", 6},
133// {"5.1_R_Dts", 6},
134 {"5.1_C_SIM", 6},
135// {"5.0.2_M", 7},
136 {"5.0.2_C", 7},
137// {"5.0.2_S", 7},
138// {"5.1.2_M", 8},
139 {"5.1.2_C", 8},
140// {"5.1.2_S", 8},
141// {"5.0.4_M", 9},
142 {"5.0.4_C", 9},
143// {"5.0.4_S", 9},
144// {"5.1.4_M", 10},
145 {"5.1.4_C", 10},
146// {"5.1.4_S", 10},
147 {"5.0.5_C", 10},
148// {"5.0.6_C", 11},
149 {"Octahedron_M", 6},
150 {"6.0_M", 6},
151 {"6.0_C", 6},
152 {"7.0_M", 7},
153 {"7.0_C", 7},
154// {"7.0_S", 7},
155 {"7.0_M_SDDS", 7},
156 {"7.0_C_SDDS", 7},
157// {"7.0_M_SMPTE", 7},
158// {"7.0_C_SMPTE", 7},
159// {"7.0_S_SMPTE", 7},
160 {"7.0_C_3D", 7},
161 {"7.0_C_SIM", 7},
162 {"7.1_M", 8},
163 {"7.1_C", 8},
164// {"7.1_S", 8},
165 {"7.1_M_SDDS", 8},
166 {"7.1_C_SDDS", 8},
167// {"7.1_M_SMPTE", 8},
168// {"7.1_C_SMPTE", 8},
169// {"7.1_S_SMPTE", 8},
170 {"7.1_C_SIM", 8},
171 {"7.0.2_M", 9},
172 {"7.0.2_C", 9},
173// {"7.0.2_S", 9},
174// {"7.0.2_M_SDDS", 9},
175// {"7.0.2_C_SDDS", 9},
176// {"7.0.2_M_SMPTE", 9},
177// {"7.0.2_C_SMPTE", 9},
178// {"7.0.2_S_SMPTE", 9},
179 {"7.1.2_M", 10},
180 {"7.1.2_C", 10},
181 {"7.1.2_C_SIM", 10},
182// {"7.1.2_S", 10},
183// {"7.1.2_M_SDDS", 10},
184// {"7.1.2_C_SDDS", 10},
185// {"7.1.2_M_SMPTE", 10},
186// {"7.1.2_C_SMPTE", 10},
187// {"7.1.2_S_SMPTE", 10},
188 {"7.0.4_M", 11},
189 {"7.0.4_C", 11},
190// {"7.0.4_S", 11},
191 {"7.1.4_M", 12},
192 {"7.1.4_C", 12},
193 {"7.1.4_C_SIM", 12},
194// {"7.1.4_S", 12},
195// {"7.0.6_C", 13},
196// {"8.0.2_C_THX", 10},
197// {"9.0_M", 9},
198// {"9.0_C", 9},
199// {"9.1_M", 10},
200// {"9.1_C", 10},
201// {"9.1.6_M", 16},
202// {"9.1.6_C", 16},
203// {"10.0.2_C_THX", 12},
204 {"16.0_M", 16},
205 {"22.0_C", 22},
206 /*
207 * AMBISONIC
208 */
209 {"FOA-Ambix", 4},
210 {"FOA-FuMa", 4},
211 {"FuMa", 4}, // legacy conversion, TODO: deprecate
212 {"ACNSN3D", 4}, // legacy conversion, TODO: deprecate
213 {"TBE", 8},
214 {"TBE_2", 10}, // TBE + Stereo
215 {"ACNSN3DO2A", 9},
216 {"FuMaO2A", 9},
217 {"ACNSN3DO3A", 16},
218 {"FuMaO3A", 16},
219 {"ACNSN3DYorkBasic1oa", 4},
220 {"ACNSN3DYorkmaxRE1oa", 4},
221 {"ACNSN3DmaxRE1oa", 4},
222 {"ACNSN3DmaxRE2oa", 9},
223 {"ACNSN3DmaxRE3oa", 16},
224 {"ACNSN3DmaxRE4oa", 25},
225 {"ACNSN3DmaxRE5oa", 36},
226 {"ACNSN3DmaxRE6oa", 49},
227 {"ACNSN3DmaxRE7oa", 64},
228 /*
229 * MIC ARRAY
230 */
231 {"Ambeo", 4},
232 {"TetraMic", 4},
233 {"SPS-200", 4},
234 {"NT-SF1", 4},
235 {"ORTF3D", 8},
236 {"CoreSound-OctoMic", 8},
237 {"CoreSound-OctoMic_SIM", 8},
238 {"ZM-1", 19},
239 {"ZM-1_SIM", 19},
240};
241}; // namespace Mach1TranscodeConstants
242
243#endif
Definition Mach1TranscodeConstants.h:57
Definition Mach1TranscodeConstants.h:22
Definition Mach1TranscodeConstants.h:27
Definition Mach1TranscodeConstants.h:33
Definition Mach1TranscodeConstants.h:42
Definition Mach1TranscodeConstants.h:46
Definition Mach1TranscodeConstants.h:84
Definition Mach1TranscodeConstants.h:50