SAF
Loading...
Searching...
No Matches
panner_internal.c
Go to the documentation of this file.
1/*
2 * Copyright 2017-2018 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
43
44#include "panner.h"
45#include "panner_internal.h"
46
48
49/* First 1 source(s) are for mono [0 0], the rest are for a 128 point sphere covering */
51{ { 0.0f, 0.0f},
52 { -120.415474946769f, 69.7642225220975f},
53 { 169.426697678052f, -17.3466306179260f},
54 { 107.629281568279f, -10.0793856720614f},
55 { -59.5674172539630f, -69.7763953095265f},
56 { -107.629493132161f, 10.0801907586439f},
57 { 59.5651193014662f, 69.7750019669784f},
58 { -72.3715136529922f, -10.0909592824967f},
59 { 120.418832045969f, -69.7630732527928f},
60 { 72.3705387467529f, 10.0908849630425f},
61 { 10.5699823270029f, 17.3489915451677f},
62 { -169.426851150349f, 17.3476277272366f},
63 { -30.7728814706980f, 68.2546206344998f},
64 { 101.529181734204f, 18.5653877408229f},
65 { 149.250234431564f, 68.2619792676765f},
66 { 18.9183978612362f, -10.9197242075287f},
67 { 78.4729799557400f, -18.5558892226653f},
68 { -18.9161109968480f, 10.9195275229078f},
69 { -78.4723066816396f, 18.5565169424192f},
70 { -161.085243560336f, -10.9220975953767f},
71 { -101.530063994217f, -18.5648176173994f},
72 { 161.085855454581f, 10.9237834974412f},
73 { 30.7790837424989f, -68.2562996173874f},
74 { -149.255648697558f, -68.2594892022576f},
75 { 56.4638592172755f, 41.2645742763346f},
76 { 46.4626904606488f, 24.5386896277818f},
77 { -123.528839291756f, 41.2565889648213f},
78 { 32.1932295461248f, 38.8027347956192f},
79 { 133.534545076742f, -24.5310453346374f},
80 { -32.1935458377634f, -38.8041545028931f},
81 { -133.533477606995f, 24.5319420428588f},
82 { -147.797881221742f, 38.7980990097138f},
83 { -46.4626630742447f, -24.5400749997299f},
84 { 147.799544204027f, -38.7965984357137f},
85 { -56.4649576930965f, -41.2658215291547f},
86 { 123.530547454259f, -41.2555316199835f},
87 { 84.7385596473317f, 27.3132538556364f},
88 { 27.4072860474693f, 4.67593317316088f},
89 { -95.2612516264878f, 27.3036967398252f},
90 { 10.0607591758466f, 62.2287426217158f},
91 { 152.592710471291f, -4.67007594116539f},
92 { -10.0604693351594f, -62.2317767049329f},
93 { -152.592615409799f, 4.67188744845125f},
94 { -169.918387889403f, 62.2272712110016f},
95 { -27.4047652820400f, -4.67684895484045f},
96 { 169.918493477140f, -62.2246416140826f},
97 { -84.7390238025025f, -27.3120311727342f},
98 { 95.2622793653641f, -27.3027426350066f},
99 { 136.272846725200f, -0.726139068263599f},
100 { -1.05456977390436f, -46.2698051615206f},
101 { -43.7263256019408f, -0.737666959763443f},
102 { -91.0084089447853f, 43.7170295842697f},
103 { -178.936314291048f, 46.2682278552731f},
104 { 91.0100541861312f, -43.7163112498585f},
105 { 178.938490558618f, -46.2666218304286f},
106 { 88.9860902890987f, 43.7285680951606f},
107 { 1.05095788619312f, 46.2682407577363f},
108 { -88.9851906686018f, -43.7278600822776f},
109 { -136.273314433943f, 0.726484363994244f},
110 { 43.7273191822901f, 0.733967099281741f},
111 { 55.2321077221357f, 10.8187456245361f},
112 { 13.0867814081219f, 34.0654299770448f},
113 { -124.767898552651f, 10.8099467408727f},
114 { 71.4751302534919f, 53.7984109774923f},
115 { 166.905549455530f, -34.0625862919868f},
116 { -71.4765158530160f, -53.8002805142714f},
117 { -166.904587570338f, 34.0633858486074f},
118 { -108.515564585463f, 53.7864186881779f},
119 { -13.0869589355977f, -34.0644403811701f},
120 { 108.517274377512f, -53.7853093207457f},
121 { -55.2337689585088f, -10.8200079671294f},
122 { 124.767519417537f, -10.8096092876561f},
123 { -105.493359369733f, -68.1345228940484f},
124 { -111.151973933085f, -5.71277564515985f},
125 { 74.5244447329726f, -68.1205741555505f},
126 { -173.885132403874f, -21.0401043953034f},
127 { -68.8521018079939f, 5.70313885775370f},
128 { 173.885050918764f, 21.0419786777516f},
129 { 68.8513569996117f, -5.70297394874866f},
130 { 6.12041448982713f, -21.0387333986971f},
131 { 111.151515131908f, 5.71357243375474f},
132 { -6.11913621739966f, 21.0397756114589f},
133 { 105.487055344890f, 68.1331981897040f},
134 { -74.5188619841755f, 68.1214716326340f},
135 { 35.2822222163987f, -15.1801841162885f},
136 { -25.1732516880600f, 51.9826514887145f},
137 { -144.722913967824f, -15.1859965048827f},
138 { 108.386507250934f, 33.8824333892584f},
139 { -154.839566662519f, -51.9856067440744f},
140 { -108.385758587361f, -33.8826426573830f},
141 { 154.840828582605f, 51.9884126722963f},
142 { -71.6110721306039f, 33.8714084774643f},
143 { 25.1699762263473f, -51.9843011897216f},
144 { 71.6126173250777f, -33.8705490198003f},
145 { -35.2810594358470f, 15.1763090469469f},
146 { 144.722474074749f, 15.1863112389402f},
147 { -125.277803641269f, -28.5561977838671f},
148 { -146.317489805034f, -30.4888082061806f},
149 { 54.7220842889970f, -28.5463137051834f},
150 { -133.292600372594f, -45.8199818171681f},
151 { -33.6854220654234f, 30.4794807422719f},
152 { 133.295169860873f, 45.8200619710773f},
153 { 33.6830420572493f, -30.4828689919959f},
154 { 46.7098267598019f, -45.8106991831118f},
155 { 146.318736830907f, 30.4889588527258f},
156 { -46.7107531920589f, 45.8077510168776f},
157 { 125.278543193551f, 28.5567151663926f},
158 { -54.7226679373581f, 28.5424675755949f},
159 { -144.402199049652f, 54.7141577397485f},
160 { 112.382216591782f, -28.0100385212576f},
161 { 35.5834085793474f, 54.7193853715013f},
162 { -29.9155874729000f, -19.6471282266303f},
163 { 67.6163420587218f, 28.0211878299760f},
164 { 29.9151078604395f, 19.6461577548916f},
165 { -67.6164804090156f, -28.0221553885221f},
166 { 150.081679085309f, -19.6396879622134f},
167 { -112.381365317985f, 28.0105570315277f},
168 { -150.081127534239f, 19.6412999777121f},
169 { 144.402936805264f, -54.7127597303097f},
170 { -35.5837994140428f, -54.7203576209200f},
171 { 68.5348504928164f, -52.8527273534571f},
172 { -54.8218918027732f, 12.7570858971645f},
173 { -111.464947340552f, -52.8652964226689f},
174 { 164.510735700738f, 34.1892226850382f},
175 { -125.181243085238f, -12.7710900404128f},
176 { -164.510172672569f, -34.1865270720665f},
177 { 125.180742749445f, 12.7714932994183f},
178 { -15.4967238792034f, 34.1855682977571f}};
179
181
182/* First 2 loudspeakers are for stereo, the rest are for a 128 point sphere covering */
184{ { 30.0f, 0.0f},
185 { -30.0f, 0.0f},
186 { 169.426697678052f, -17.3466306179260f},
187 { 107.629281568279f, -10.0793856720614f},
188 { -59.5674172539630f, -69.7763953095265f},
189 { -107.629493132161f, 10.0801907586439f},
190 { 59.5651193014662f, 69.7750019669784f},
191 { -72.3715136529922f, -10.0909592824967f},
192 { 120.418832045969f, -69.7630732527928f},
193 { 72.3705387467529f, 10.0908849630425f},
194 { 10.5699823270029f, 17.3489915451677f},
195 { -169.426851150349f, 17.3476277272366f},
196 { -30.7728814706980f, 68.2546206344998f},
197 { 101.529181734204f, 18.5653877408229f},
198 { 149.250234431564f, 68.2619792676765f},
199 { 18.9183978612362f, -10.9197242075287f},
200 { 78.4729799557400f, -18.5558892226653f},
201 { -18.9161109968480f, 10.9195275229078f},
202 { -78.4723066816396f, 18.5565169424192f},
203 { -161.085243560336f, -10.9220975953767f},
204 { -101.530063994217f, -18.5648176173994f},
205 { 161.085855454581f, 10.9237834974412f},
206 { 30.7790837424989f, -68.2562996173874f},
207 { -149.255648697558f, -68.2594892022576f},
208 { 56.4638592172755f, 41.2645742763346f},
209 { 46.4626904606488f, 24.5386896277818f},
210 { -123.528839291756f, 41.2565889648213f},
211 { 32.1932295461248f, 38.8027347956192f},
212 { 133.534545076742f, -24.5310453346374f},
213 { -32.1935458377634f, -38.8041545028931f},
214 { -133.533477606995f, 24.5319420428588f},
215 { -147.797881221742f, 38.7980990097138f},
216 { -46.4626630742447f, -24.5400749997299f},
217 { 147.799544204027f, -38.7965984357137f},
218 { -56.4649576930965f, -41.2658215291547f},
219 { 123.530547454259f, -41.2555316199835f},
220 { 84.7385596473317f, 27.3132538556364f},
221 { 27.4072860474693f, 4.67593317316088f},
222 { -95.2612516264878f, 27.3036967398252f},
223 { 10.0607591758466f, 62.2287426217158f},
224 { 152.592710471291f, -4.67007594116539f},
225 { -10.0604693351594f, -62.2317767049329f},
226 { -152.592615409799f, 4.67188744845125f},
227 { -169.918387889403f, 62.2272712110016f},
228 { -27.4047652820400f, -4.67684895484045f},
229 { 169.918493477140f, -62.2246416140826f},
230 { -84.7390238025025f, -27.3120311727342f},
231 { 95.2622793653641f, -27.3027426350066f},
232 { 136.272846725200f, -0.726139068263599f},
233 { -1.05456977390436f, -46.2698051615206f},
234 { -43.7263256019408f, -0.737666959763443f},
235 { -91.0084089447853f, 43.7170295842697f},
236 { -178.936314291048f, 46.2682278552731f},
237 { 91.0100541861312f, -43.7163112498585f},
238 { 178.938490558618f, -46.2666218304286f},
239 { 88.9860902890987f, 43.7285680951606f},
240 { 1.05095788619312f, 46.2682407577363f},
241 { -88.9851906686018f, -43.7278600822776f},
242 { -136.273314433943f, 0.726484363994244f},
243 { 43.7273191822901f, 0.733967099281741f},
244 { 55.2321077221357f, 10.8187456245361f},
245 { 13.0867814081219f, 34.0654299770448f},
246 { -124.767898552651f, 10.8099467408727f},
247 { 71.4751302534919f, 53.7984109774923f},
248 { 166.905549455530f, -34.0625862919868f},
249 { -71.4765158530160f, -53.8002805142714f},
250 { -166.904587570338f, 34.0633858486074f},
251 { -108.515564585463f, 53.7864186881779f},
252 { -13.0869589355977f, -34.0644403811701f},
253 { 108.517274377512f, -53.7853093207457f},
254 { -55.2337689585088f, -10.8200079671294f},
255 { 124.767519417537f, -10.8096092876561f},
256 { -105.493359369733f, -68.1345228940484f},
257 { -111.151973933085f, -5.71277564515985f},
258 { 74.5244447329726f, -68.1205741555505f},
259 { -173.885132403874f, -21.0401043953034f},
260 { -68.8521018079939f, 5.70313885775370f},
261 { 173.885050918764f, 21.0419786777516f},
262 { 68.8513569996117f, -5.70297394874866f},
263 { 6.12041448982713f, -21.0387333986971f},
264 { 111.151515131908f, 5.71357243375474f},
265 { -6.11913621739966f, 21.0397756114589f},
266 { 105.487055344890f, 68.1331981897040f},
267 { -74.5188619841755f, 68.1214716326340f},
268 { 35.2822222163987f, -15.1801841162885f},
269 { -25.1732516880600f, 51.9826514887145f},
270 { -144.722913967824f, -15.1859965048827f},
271 { 108.386507250934f, 33.8824333892584f},
272 { -154.839566662519f, -51.9856067440744f},
273 { -108.385758587361f, -33.8826426573830f},
274 { 154.840828582605f, 51.9884126722963f},
275 { -71.6110721306039f, 33.8714084774643f},
276 { 25.1699762263473f, -51.9843011897216f},
277 { 71.6126173250777f, -33.8705490198003f},
278 { -35.2810594358470f, 15.1763090469469f},
279 { 144.722474074749f, 15.1863112389402f},
280 { -125.277803641269f, -28.5561977838671f},
281 { -146.317489805034f, -30.4888082061806f},
282 { 54.7220842889970f, -28.5463137051834f},
283 { -133.292600372594f, -45.8199818171681f},
284 { -33.6854220654234f, 30.4794807422719f},
285 { 133.295169860873f, 45.8200619710773f},
286 { 33.6830420572493f, -30.4828689919959f},
287 { 46.7098267598019f, -45.8106991831118f},
288 { 146.318736830907f, 30.4889588527258f},
289 { -46.7107531920589f, 45.8077510168776f},
290 { 125.278543193551f, 28.5567151663926f},
291 { -54.7226679373581f, 28.5424675755949f},
292 { -144.402199049652f, 54.7141577397485f},
293 { 112.382216591782f, -28.0100385212576f},
294 { 35.5834085793474f, 54.7193853715013f},
295 { -29.9155874729000f, -19.6471282266303f},
296 { 67.6163420587218f, 28.0211878299760f},
297 { 29.9151078604395f, 19.6461577548916f},
298 { -67.6164804090156f, -28.0221553885221f},
299 { 150.081679085309f, -19.6396879622134f},
300 { -112.381365317985f, 28.0105570315277f},
301 { -150.081127534239f, 19.6412999777121f},
302 { 144.402936805264f, -54.7127597303097f},
303 { -35.5837994140428f, -54.7203576209200f},
304 { 68.5348504928164f, -52.8527273534571f},
305 { -54.8218918027732f, 12.7570858971645f},
306 { -111.464947340552f, -52.8652964226689f},
307 { 164.510735700738f, 34.1892226850382f},
308 { -125.181243085238f, -12.7710900404128f},
309 { -164.510172672569f, -34.1865270720665f},
310 { 125.180742749445f, 12.7714932994183f},
311 { -15.4967238792034f, 34.1855682977571f}};
312
313void panner_setCodecStatus(void* const hPan, CODEC_STATUS newStatus)
314{
315 panner_data *pData = (panner_data*)(hPan);
316 if(newStatus==CODEC_STATUS_NOT_INITIALISED){
317 /* Pause until current initialisation is complete */
319 SAF_SLEEP(10);
320 }
321 pData->codecStatus = newStatus;
322}
323
324void panner_initGainTables(void* const hPan)
325{
326 panner_data *pData = (panner_data*)(hPan);
327#ifndef FORCE_3D_LAYOUT
328 int i;
329 float sum_elev;
330
331 /* determine dimensionality */
332 sum_elev = 0.0f;
333 for(i=0; i<pData->nLoudpkrs; i++)
334 sum_elev += fabsf(pData->loudpkrs_dirs_deg[i][1]);
335 if(sum_elev < 0.01f)
336 pData->output_nDims = 2;
337 else
338 pData->output_nDims = 3;
339#endif
340
341 strcpy(pData->progressBarText,"Generating VBAP Gain Table");
342 pData->progressBar0_1 = 0.7f;
343
344 /* generate VBAP gain table */
345 free(pData->vbap_gtable);
346 pData->vbapTableRes[0] = 1;
347 pData->vbapTableRes[1] = 1;
348#ifdef FORCE_3D_LAYOUT
349 pData->output_nDims = 3;
350 generateVBAPgainTable3D((float*)pData->loudpkrs_dirs_deg, pData->nLoudpkrs, pData->vbapTableRes[0], pData->vbapTableRes[1], 1, 1, pData->spread_deg,
351 &(pData->vbap_gtable), &(pData->N_vbap_gtable), &(pData->nTriangles));
352#else
353 if(pData->output_nDims==2)
354 generateVBAPgainTable2D((float*)pData->loudpkrs_dirs_deg, pData->nLoudpkrs, pData->vbapTableRes[0],
355 &(pData->vbap_gtable), &(pData->N_vbap_gtable), &(pData->nTriangles));
356 else{
357 generateVBAPgainTable3D((float*)pData->loudpkrs_dirs_deg, pData->nLoudpkrs, pData->vbapTableRes[0], pData->vbapTableRes[1], 1, 1, pData->spread_deg,
358 &(pData->vbap_gtable), &(pData->N_vbap_gtable), &(pData->nTriangles));
359 if(pData->vbap_gtable==NULL){
360 /* if generating vbap gain tabled failed, re-calculate with 2D VBAP */
361 pData->output_nDims = 2;
363 }
364 }
365#endif
366}
367
369(
370 void* const hPan
371)
372{
373 panner_data *pData = (panner_data*)(hPan);
374
375 if(pData->hSTFT==NULL)
377 else if (pData->new_nSources!=pData->nSources || pData->new_nLoudpkrs!=pData->nLoudpkrs){
379 afSTFT_clearBuffers(pData->hSTFT);
380 }
381 pData->nSources = pData->new_nSources;
382 pData->nLoudpkrs = pData->new_nLoudpkrs;
383}
384
386(
388 _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2],
389 _Atomic_INT32* newNCH,
390 int* nDims
391)
392{
393 float sum_elev;
394 int ch, i, nCH;
395
396 switch(preset){
397 default:
398 case SOURCE_CONFIG_PRESET_DEFAULT:
399 nCH = 1;
400 for(ch=0; ch<nCH; ch++)
401 for(i=0; i<2; i++)
402 dirs_deg[ch][i] = 0.0f;
403 break;
404 case SOURCE_CONFIG_PRESET_MONO:
405 nCH = 1;
406 for(ch=0; ch<nCH; ch++)
407 for(i=0; i<2; i++)
408 dirs_deg[ch][i] = __mono_dirs_deg[ch][i];
409 break;
410 case SOURCE_CONFIG_PRESET_STEREO:
411 nCH = 2;
412 for(ch=0; ch<nCH; ch++)
413 for(i=0; i<2; i++)
414 dirs_deg[ch][i] = __stereo_dirs_deg[ch][i];
415 break;
416 case SOURCE_CONFIG_PRESET_5PX:
417 nCH = 5;
418 for(ch=0; ch<nCH; ch++)
419 for(i=0; i<2; i++)
420 dirs_deg[ch][i] = __5pX_dirs_deg[ch][i];
421 break;
422 case SOURCE_CONFIG_PRESET_7PX:
423 nCH = 7;
424 for(ch=0; ch<nCH; ch++)
425 for(i=0; i<2; i++)
426 dirs_deg[ch][i] = __7pX_dirs_deg[ch][i];
427 break;
428 case SOURCE_CONFIG_PRESET_8PX:
429 nCH = 8;
430 for(ch=0; ch<nCH; ch++)
431 for(i=0; i<2; i++)
432 dirs_deg[ch][i] = __8pX_dirs_deg[ch][i];
433 break;
434 case SOURCE_CONFIG_PRESET_9PX:
435 nCH = 9;
436 for(ch=0; ch<nCH; ch++)
437 for(i=0; i<2; i++)
438 dirs_deg[ch][i] = __9pX_dirs_deg[ch][i];
439 break;
440 case SOURCE_CONFIG_PRESET_10PX:
441 nCH = 10;
442 for(ch=0; ch<nCH; ch++)
443 for(i=0; i<2; i++)
444 dirs_deg[ch][i] = __10pX_dirs_deg[ch][i];
445 break;
446 case SOURCE_CONFIG_PRESET_11PX:
447 nCH = 11;
448 for(ch=0; ch<nCH; ch++)
449 for(i=0; i<2; i++)
450 dirs_deg[ch][i] = __11pX_dirs_deg[ch][i];
451 break;
452 case SOURCE_CONFIG_PRESET_11PX_7_4:
453 nCH = 11;
454 for(ch=0; ch<nCH; ch++)
455 for(i=0; i<2; i++)
456 dirs_deg[ch][i] = __11pX_7_4_dirs_deg[ch][i];
457 break;
458 case SOURCE_CONFIG_PRESET_13PX:
459 nCH = 13;
460 for(ch=0; ch<nCH; ch++)
461 for(i=0; i<2; i++)
462 dirs_deg[ch][i] = __13pX_dirs_deg[ch][i];
463 break;
464 case SOURCE_CONFIG_PRESET_22PX:
465 nCH = 22;
466 for(ch=0; ch<nCH; ch++)
467 for(i=0; i<2; i++)
468 dirs_deg[ch][i] = __22pX_dirs_deg[ch][i];
469 break;
470 case SOURCE_CONFIG_PRESET_22P2_9_10_3:
471 nCH = 24;
472 for(ch=0; ch<nCH; ch++)
473 for(i=0; i<2; i++)
474 dirs_deg[ch][i] = __9_10_3p2_dirs_deg[ch][i];
475 break;
476 case SOURCE_CONFIG_PRESET_PROTOOLS_STEREO:
477 nCH = 2;
478 for(ch=0; ch<nCH; ch++)
479 for(i=0; i<2; i++)
481 break;
482 case SOURCE_CONFIG_PRESET_PROTOOLS_LCR:
483 nCH = 3;
484 for(ch=0; ch<nCH; ch++)
485 for(i=0; i<2; i++)
487 break;
488 case SOURCE_CONFIG_PRESET_PROTOOLS_QUAD:
489 nCH = 4;
490 for(ch=0; ch<nCH; ch++)
491 for(i=0; i<2; i++)
493 break;
494 case SOURCE_CONFIG_PRESET_PROTOOLS_5_0:
495 nCH = 5;
496 for(ch=0; ch<nCH; ch++)
497 for(i=0; i<2; i++)
499 break;
500 case SOURCE_CONFIG_PRESET_PROTOOLS_5_0_2:
501 nCH = 7;
502 for(ch=0; ch<nCH; ch++)
503 for(i=0; i<2; i++)
505 break;
506 case SOURCE_CONFIG_PRESET_PROTOOLS_5_0_4:
507 nCH = 9;
508 for(ch=0; ch<nCH; ch++)
509 for(i=0; i<2; i++)
511 break;
512 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0:
513 nCH = 7;
514 for(ch=0; ch<nCH; ch++)
515 for(i=0; i<2; i++)
517 break;
518 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_2:
519 nCH = 9;
520 for(ch=0; ch<nCH; ch++)
521 for(i=0; i<2; i++)
523 break;
524 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_4:
525 nCH = 11;
526 for(ch=0; ch<nCH; ch++)
527 for(i=0; i<2; i++)
529 break;
530 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_6:
531 nCH = 13;
532 for(ch=0; ch<nCH; ch++)
533 for(i=0; i<2; i++)
535 break;
536 case SOURCE_CONFIG_PRESET_PROTOOLS_9_0_4:
537 nCH = 13;
538 for(ch=0; ch<nCH; ch++)
539 for(i=0; i<2; i++)
541 break;
542 case SOURCE_CONFIG_PRESET_PROTOOLS_9_0_6:
543 nCH = 15;
544 for(ch=0; ch<nCH; ch++)
545 for(i=0; i<2; i++)
547 break;
548 case SOURCE_CONFIG_PRESET_AALTO_MCC:
549 nCH = 45;
550 for(ch=0; ch<nCH; ch++)
551 for(i=0; i<2; i++)
552 dirs_deg[ch][i] = __Aalto_MCC_dirs_deg[ch][i];
553 break;
554 case SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET:
555 nCH = 37;
556 for(ch=0; ch<nCH; ch++)
557 for(i=0; i<2; i++)
558 dirs_deg[ch][i] = __Aalto_MCCsubset_dirs_deg[ch][i];
559 break;
560 case SOURCE_CONFIG_PRESET_AALTO_APAJA:
561 nCH = 29;
562 for(ch=0; ch<nCH; ch++)
563 for(i=0; i<2; i++)
564 dirs_deg[ch][i] = __Aalto_Apaja_dirs_deg[ch][i];
565 break;
566 case SOURCE_CONFIG_PRESET_AALTO_LR:
567 nCH = 13;
568 for(ch=0; ch<nCH; ch++)
569 for(i=0; i<2; i++)
570 dirs_deg[ch][i] = __Aalto_LR_dirs_deg[ch][i];
571 break;
572 case SOURCE_CONFIG_PRESET_DTU_AVIL:
573 nCH = 64;
574 for(ch=0; ch<nCH; ch++)
575 for(i=0; i<2; i++)
576 dirs_deg[ch][i] = __DTU_AVIL_dirs_deg[ch][i];
577 break;
578 case SOURCE_CONFIG_PRESET_T_DESIGN_4:
579 nCH = 4;
580 for(ch=0; ch<nCH; ch++)
581 for(i=0; i<2; i++)
582 dirs_deg[ch][i] = __Tdesign_degree_2_dirs_deg[ch][i];
583 break;
584 case SOURCE_CONFIG_PRESET_T_DESIGN_12:
585 nCH = 12;
586 for(ch=0; ch<nCH; ch++)
587 for(i=0; i<2; i++)
588 dirs_deg[ch][i] = __Tdesign_degree_4_dirs_deg[ch][i];
589 break;
590 case SOURCE_CONFIG_PRESET_T_DESIGN_24:
591 nCH = 24;
592 for(ch=0; ch<nCH; ch++)
593 for(i=0; i<2; i++)
594 dirs_deg[ch][i] = __Tdesign_degree_6_dirs_deg[ch][i];
595 break;
596 case SOURCE_CONFIG_PRESET_T_DESIGN_36:
597 nCH = 36;
598 for(ch=0; ch<nCH; ch++)
599 for(i=0; i<2; i++)
600 dirs_deg[ch][i] = __Tdesign_degree_8_dirs_deg[ch][i];
601 break;
602 case SOURCE_CONFIG_PRESET_T_DESIGN_48:
603 nCH = 48;
604 for(ch=0; ch<nCH; ch++)
605 for(i=0; i<2; i++)
606 dirs_deg[ch][i] = __Tdesign_degree_9_dirs_deg[ch][i];
607 break;
608 case SOURCE_CONFIG_PRESET_T_DESIGN_60:
609 nCH = 60;
610 for(ch=0; ch<nCH; ch++)
611 for(i=0; i<2; i++)
612 dirs_deg[ch][i] = __Tdesign_degree_10_dirs_deg[ch][i];
613 break;
614 case SOURCE_CONFIG_PRESET_SPH_COV_9:
615 nCH = 9;
616 for(ch=0; ch<nCH; ch++)
617 for(i=0; i<2; i++)
618 dirs_deg[ch][i] = __SphCovering_9_dirs_deg[ch][i];
619 break;
620 case SOURCE_CONFIG_PRESET_SPH_COV_16:
621 nCH = 16;
622 for(ch=0; ch<nCH; ch++)
623 for(i=0; i<2; i++)
624 dirs_deg[ch][i] = __SphCovering_16_dirs_deg[ch][i];
625 break;
626 case SOURCE_CONFIG_PRESET_SPH_COV_25:
627 nCH = 25;
628 for(ch=0; ch<nCH; ch++)
629 for(i=0; i<2; i++)
630 dirs_deg[ch][i] = __SphCovering_25_dirs_deg[ch][i];
631 break;
632 case SOURCE_CONFIG_PRESET_SPH_COV_49:
633 nCH = 49;
634 for(ch=0; ch<nCH; ch++)
635 for(i=0; i<2; i++)
636 dirs_deg[ch][i] = __SphCovering_49_dirs_deg[ch][i];
637 break;
638 case SOURCE_CONFIG_PRESET_SPH_COV_64:
639 nCH = 64;
640 for(ch=0; ch<nCH; ch++)
641 for(i=0; i<2; i++)
642 dirs_deg[ch][i] = __SphCovering_64_dirs_deg[ch][i];
643 break;
644 }
645
646 /* Fill remaining slots with default coords */
647 for(; ch<MAX_NUM_INPUTS; ch++){
648 for(i=0; i<2; i++){
649 dirs_deg[ch][i] = __default_LScoords128_deg[ch][i];
650 }
651 }
652
653 /* For dynamically changing the number of TFT channels */
654 (*newNCH) = nCH;
655
656 /* estimate number of dimensions. (Obviously fails if using 2D setups thare are on an angle.
657 However, in these cases, triangulation should fail and revert to 2D anyway) */
658 sum_elev = 0.0f;
659 for(i=0; i<nCH; i++)
660 sum_elev += fabsf((float)dirs_deg[i][1]);
661 if(sum_elev < 0.01f)
662 (*nDims) = 2;
663 else
664 (*nDims) = 3;
665}
666
668(
670 _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2],
671 _Atomic_INT32* newNCH,
672 int* nDims
673)
674{
675 float sum_elev;
676 int ch, i, nCH;
677
678 switch(preset){
679 default:
680 case LOUDSPEAKER_ARRAY_PRESET_DEFAULT:
681 case LOUDSPEAKER_ARRAY_PRESET_STEREO:
682 nCH = 2;
683 for(ch=0; ch<nCH; ch++)
684 for(i=0; i<2; i++)
685 dirs_deg[ch][i] = __stereo_dirs_deg[ch][i];
686 break;
687 case LOUDSPEAKER_ARRAY_PRESET_5PX:
688 nCH = 5;
689 for(ch=0; ch<nCH; ch++)
690 for(i=0; i<2; i++)
691 dirs_deg[ch][i] = __5pX_dirs_deg[ch][i];
692 break;
693 case LOUDSPEAKER_ARRAY_PRESET_7PX:
694 nCH = 7;
695 for(ch=0; ch<nCH; ch++)
696 for(i=0; i<2; i++)
697 dirs_deg[ch][i] = __7pX_dirs_deg[ch][i];
698 break;
699 case LOUDSPEAKER_ARRAY_PRESET_8PX:
700 nCH = 8;
701 for(ch=0; ch<nCH; ch++)
702 for(i=0; i<2; i++)
703 dirs_deg[ch][i] = __8pX_dirs_deg[ch][i];
704 break;
705 case LOUDSPEAKER_ARRAY_PRESET_9PX:
706 nCH = 9;
707 for(ch=0; ch<nCH; ch++)
708 for(i=0; i<2; i++)
709 dirs_deg[ch][i] = __9pX_dirs_deg[ch][i];
710 break;
711 case LOUDSPEAKER_ARRAY_PRESET_10PX:
712 nCH = 10;
713 for(ch=0; ch<nCH; ch++)
714 for(i=0; i<2; i++)
715 dirs_deg[ch][i] = __10pX_dirs_deg[ch][i];
716 break;
717 case LOUDSPEAKER_ARRAY_PRESET_11PX:
718 nCH = 11;
719 for(ch=0; ch<nCH; ch++)
720 for(i=0; i<2; i++)
721 dirs_deg[ch][i] = __11pX_dirs_deg[ch][i];
722 break;
723 case LOUDSPEAKER_ARRAY_PRESET_11PX_7_4:
724 nCH = 11;
725 for(ch=0; ch<nCH; ch++)
726 for(i=0; i<2; i++)
727 dirs_deg[ch][i] = __11pX_7_4_dirs_deg[ch][i];
728 break;
729 case LOUDSPEAKER_ARRAY_PRESET_13PX:
730 nCH = 13;
731 for(ch=0; ch<nCH; ch++)
732 for(i=0; i<2; i++)
733 dirs_deg[ch][i] = __13pX_dirs_deg[ch][i];
734 break;
735 case LOUDSPEAKER_ARRAY_PRESET_22PX:
736 nCH = 22;
737 for(ch=0; ch<nCH; ch++)
738 for(i=0; i<2; i++)
739 dirs_deg[ch][i] = __22pX_dirs_deg[ch][i];
740 break;
741 case LOUDSPEAKER_ARRAY_PRESET_22P2_9_10_3:
742 nCH = 24;
743 for(ch=0; ch<nCH; ch++)
744 for(i=0; i<2; i++)
745 dirs_deg[ch][i] = __9_10_3p2_dirs_deg[ch][i];
746 break;
747 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_STEREO:
748 nCH = 2;
749 for(ch=0; ch<nCH; ch++)
750 for(i=0; i<2; i++)
752 break;
753 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_LCR:
754 nCH = 3;
755 for(ch=0; ch<nCH; ch++)
756 for(i=0; i<2; i++)
758 break;
759 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_QUAD:
760 nCH = 4;
761 for(ch=0; ch<nCH; ch++)
762 for(i=0; i<2; i++)
764 break;
765 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0:
766 nCH = 5;
767 for(ch=0; ch<nCH; ch++)
768 for(i=0; i<2; i++)
770 break;
771 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0_2:
772 nCH = 7;
773 for(ch=0; ch<nCH; ch++)
774 for(i=0; i<2; i++)
776 break;
777 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0_4:
778 nCH = 9;
779 for(ch=0; ch<nCH; ch++)
780 for(i=0; i<2; i++)
782 break;
783 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0:
784 nCH = 7;
785 for(ch=0; ch<nCH; ch++)
786 for(i=0; i<2; i++)
788 break;
789 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_2:
790 nCH = 9;
791 for(ch=0; ch<nCH; ch++)
792 for(i=0; i<2; i++)
794 break;
795 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_4:
796 nCH = 11;
797 for(ch=0; ch<nCH; ch++)
798 for(i=0; i<2; i++)
800 break;
801 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_6:
802 nCH = 13;
803 for(ch=0; ch<nCH; ch++)
804 for(i=0; i<2; i++)
806 break;
807 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_9_0_4:
808 nCH = 13;
809 for(ch=0; ch<nCH; ch++)
810 for(i=0; i<2; i++)
812 break;
813 case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_9_0_6:
814 nCH = 15;
815 for(ch=0; ch<nCH; ch++)
816 for(i=0; i<2; i++)
818 break;
819 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC:
820 nCH = 45;
821 for(ch=0; ch<nCH; ch++)
822 for(i=0; i<2; i++)
823 dirs_deg[ch][i] = __Aalto_MCC_dirs_deg[ch][i];
824 break;
825 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC_SUBSET:
826 nCH = 37;
827 for(ch=0; ch<nCH; ch++)
828 for(i=0; i<2; i++)
829 dirs_deg[ch][i] = __Aalto_MCCsubset_dirs_deg[ch][i];
830 break;
831 case LOUDSPEAKER_ARRAY_PRESET_AALTO_APAJA:
832 nCH = 29;
833 for(ch=0; ch<nCH; ch++)
834 for(i=0; i<2; i++)
835 dirs_deg[ch][i] = __Aalto_Apaja_dirs_deg[ch][i];
836 break;
837 case LOUDSPEAKER_ARRAY_PRESET_AALTO_LR:
838 nCH = 13;
839 for(ch=0; ch<nCH; ch++)
840 for(i=0; i<2; i++)
841 dirs_deg[ch][i] = __Aalto_LR_dirs_deg[ch][i];
842 break;
843 case LOUDSPEAKER_ARRAY_PRESET_DTU_AVIL:
844 nCH = 64;
845 for(ch=0; ch<nCH; ch++)
846 for(i=0; i<2; i++)
847 dirs_deg[ch][i] = __DTU_AVIL_dirs_deg[ch][i];
848 break;
849 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_4:
850 nCH = 4;
851 for(ch=0; ch<nCH; ch++)
852 for(i=0; i<2; i++)
853 dirs_deg[ch][i] = __Tdesign_degree_2_dirs_deg[ch][i];
854 break;
855 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_12:
856 nCH = 12;
857 for(ch=0; ch<nCH; ch++)
858 for(i=0; i<2; i++)
859 dirs_deg[ch][i] = __Tdesign_degree_4_dirs_deg[ch][i];
860 break;
861 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_24:
862 nCH = 24;
863 for(ch=0; ch<nCH; ch++)
864 for(i=0; i<2; i++)
865 dirs_deg[ch][i] = __Tdesign_degree_6_dirs_deg[ch][i];
866 break;
867 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_36:
868 nCH = 36;
869 for(ch=0; ch<nCH; ch++)
870 for(i=0; i<2; i++)
871 dirs_deg[ch][i] = __Tdesign_degree_8_dirs_deg[ch][i];
872 break;
873 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_48:
874 nCH = 48;
875 for(ch=0; ch<nCH; ch++)
876 for(i=0; i<2; i++)
877 dirs_deg[ch][i] = __Tdesign_degree_9_dirs_deg[ch][i];
878 break;
879 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_60:
880 nCH = 60;
881 for(ch=0; ch<nCH; ch++)
882 for(i=0; i<2; i++)
883 dirs_deg[ch][i] = __Tdesign_degree_10_dirs_deg[ch][i];
884 break;
885 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_9:
886 nCH = 9;
887 for(ch=0; ch<nCH; ch++)
888 for(i=0; i<2; i++)
889 dirs_deg[ch][i] = __SphCovering_9_dirs_deg[ch][i];
890 break;
891 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_16:
892 nCH = 16;
893 for(ch=0; ch<nCH; ch++)
894 for(i=0; i<2; i++)
895 dirs_deg[ch][i] = __SphCovering_16_dirs_deg[ch][i];
896 break;
897 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_25:
898 nCH = 25;
899 for(ch=0; ch<nCH; ch++)
900 for(i=0; i<2; i++)
901 dirs_deg[ch][i] = __SphCovering_25_dirs_deg[ch][i];
902 break;
903 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_49:
904 nCH = 49;
905 for(ch=0; ch<nCH; ch++)
906 for(i=0; i<2; i++)
907 dirs_deg[ch][i] = __SphCovering_49_dirs_deg[ch][i];
908 break;
909 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_64:
910 nCH = 64;
911 for(ch=0; ch<nCH; ch++)
912 for(i=0; i<2; i++)
913 dirs_deg[ch][i] = __SphCovering_64_dirs_deg[ch][i];
914 break;
915 }
916
917 /* Fill remaining slots with default coords */
918 for(; ch<MAX_NUM_INPUTS; ch++){
919 for(i=0; i<2; i++){
920 dirs_deg[ch][i] = __default_LScoords128_deg[ch][i];
921 }
922 }
923
924 /* For dynamically changing the number of TFT channels */
925 (*newNCH) = nCH;
926
927 /* estimate number of dimensions. (Obviously fails if using 2D setups thare are on an angle.
928 However, in these cases, triangulation should fail and revert to 2D anyway) */
929 sum_elev = 0.0f;
930 for(i=0; i<nCH; i++)
931 sum_elev += fabsf((float)dirs_deg[i][1]);
932 if(sum_elev < 0.01f)
933 (*nDims) = 2;
934 else
935 (*nDims) = 3;
936}
937
LOUDSPEAKER_ARRAY_PRESETS
Available loudspeaker array presets.
Definition _common.h:103
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
Definition _common.h:261
#define MAX_NUM_OUTPUTS
Maximum number of output channels supported.
Definition _common.h:264
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
Definition _common.h:149
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_INITIALISING
Codec is currently being initialised, input audio should not be processed.
Definition _common.h:235
void afSTFT_clearBuffers(void *const hSTFT)
Flushes time-domain buffers with zeros.
Definition afSTFTlib.c:519
void afSTFT_create(void **const phSTFT, int nCHin, int nCHout, int hopsize, int lowDelayMode, int hybridmode, AFSTFT_FDDATA_FORMAT format)
Creates an instance of afSTFT.
Definition afSTFTlib.c:143
void afSTFT_channelChange(void *const hSTFT, int new_nCHin, int new_nCHout)
Re-allocates memory to support a change in the number of input/output channels.
Definition afSTFTlib.c:477
@ AFSTFT_BANDS_CH_TIME
nBands x nChannels x nTimeHops
Definition afSTFTlib.h:80
#define HOP_SIZE
STFT hop size.
const float __protools_Quad_dirs_deg[4][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools Quadraphonic.
const int __protools_mapping_5p0_to_discrete[5]
Indices to map a 5p0 bus to a discrete bus in ProTools.
const int __protools_mapping_7p0p4_to_discrete[11]
Indices to map a 7p0p4 bus to a discrete bus in ProTools.
const float __9pX_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 9.x setup.
const int __protools_mapping_discrete_to_7p0p4[11]
Indices to map a discrete bus to a 7p0p4 bus in ProTools.
const float __SphCovering_16_dirs_deg[16][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 16 dirs.
const int __protools_mapping_discrete_to_9p0p4[13]
Indices to map a discrete bus to a 9p0p4 bus in ProTools.
const float __Aalto_MCC_dirs_deg[45][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC),...
const float __SphCovering_49_dirs_deg[49][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 49 dirs.
const float __mono_dirs_deg[1][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a mono setup.
const float __5pX_dirs_deg[5][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 5.x setup.
const int __protools_mapping_discrete_to_7p0[7]
Indices to map a discrete bus to a 7p0 bus in ProTools.
const float __11pX_dirs_deg[11][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 11.x setup.
const float __Tdesign_degree_9_dirs_deg[48][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 9.
const int __protools_mapping_discrete_to_LCR[3]
Indices to map a discrete bus to a LCR bus in ProTools.
const float __Tdesign_degree_2_dirs_deg[4][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 2.
const float __11pX_7_4_dirs_deg[11][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.4.x setup.
const float __Tdesign_degree_8_dirs_deg[36][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 8.
const float __9_10_3p2_dirs_deg[24][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 9+10+3.2 setup BS 2051 recommedation: h...
const float __default_LScoords128_deg[128][2]
Default Loudspeaker directions [azimuth, Elevation] - to replace above!
const float __protools_7p0_dirs_deg[7][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0 surround L C R Lss Rss Lsr R...
const float __protools_7p0p2_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0.2 surround L C R Lss Rss Lsr...
const float __Aalto_MCCsubset_dirs_deg[37][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC) ...
const int __protools_mapping_stereo_to_discrete[2]
Indices to map a stereo bus to a discrete bus in ProTools.
const float __Aalto_Apaja_dirs_deg[29][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the audio-visual listening room (Apaja),...
const int __protools_mapping_discrete_to_7p0p6[13]
Indices to map a discrete bus to a 7p0p6 bus in ProTools.
const int __protools_mapping_discrete_to_Quad[4]
Indices to map a discrete bus to a Quad bus in ProTools.
const int __protools_mapping_7p0p2_to_discrete[9]
Indices to map a 7p0p2 bus to a discrete bus in ProTools.
const int __protools_mapping_5p0p2_to_discrete[7]
Indices to map a 5p0p2 bus to a discrete bus in ProTools.
const float __SphCovering_9_dirs_deg[9][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 9 dirs.
const int __protools_mapping_LCR_to_discrete[3]
Indices to map a LCR bus to a discrete bus in ProTools.
const float __protools_7p0p6_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0.6 surround L R C Lss Rss Lsr...
const int __protools_mapping_discrete_to_5p0p4[9]
Indices to map a discrete bus to a 5p0p4 bus in ProTools.
const float __protools_5p0_dirs_deg[5][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 5.0 surround (Film) L C R Ls Rs.
const float __stereo_dirs_deg[2][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a stereo setup.
const float __SphCovering_64_dirs_deg[64][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 64 dirs.
const int __protools_mapping_7p0p6_to_discrete[13]
Indices to map a 7p0p6 bus to a discrete bus in ProTools.
const float __Tdesign_degree_4_dirs_deg[12][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 4.
const float __Aalto_LR_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the ITU standard listening room (LR),...
const float __DTU_AVIL_dirs_deg[64][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the Audio Visual Immersion Lab (AVIL),...
const float __8pX_dirs_deg[8][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 8.x setup.
const float __protools_LCR_dirs_deg[3][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools Left-centre-right.
const float __Tdesign_degree_6_dirs_deg[24][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 6.
const int __protools_mapping_discrete_to_9p0p6[15]
Indices to map a discrete bus to a 9p0p6 bus in ProTools.
const float __protools_stereo_dirs_deg[2][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools stereo pair.
const float __protools_9p0p6_dirs_deg[15][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 9.0.6 surround L R C Lss Rss Lsr...
const float __13pX_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 13.x setup.
const float __7pX_dirs_deg[7][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.x setup.
const int __protools_mapping_9p0p4_to_discrete[13]
Indices to map a 9p0p4 bus to a discrete bus in ProTools.
const int __protools_mapping_discrete_to_7p0p2[9]
Indices to map a discrete bus to a 7p0p2 bus in ProTools.
const int __protools_mapping_discrete_to_5p0[5]
Indices to map a discrete bus to a 5p0 bus in ProTools.
const float __22pX_dirs_deg[22][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 22.x setup.
const int __protools_mapping_5p0p4_to_discrete[9]
Indices to map a 5p0p4 bus to a discrete bus in ProTools.
const float __protools_5p0p4_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 5.0.4 surround L R C Ls Rs Ltf R...
const int __protools_mapping_discrete_to_5p0p2[7]
Indices to map a discrete bus to a 5p0p2 bus in ProTools.
const float __SphCovering_25_dirs_deg[25][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 25 dirs.
const int __protools_mapping_Quad_to_discrete[4]
Indices to map a Quad bus to a discrete bus in ProTools.
const int __protools_mapping_7p0_to_discrete[7]
Indices to map a 7p0 bus to a discrete bus in ProTools.
const float __protools_5p0p2_dirs_deg[7][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 5.0.2 surround L R C Ls Rs Ltm R...
const float __protools_7p0p4_dirs_deg[11][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0.4 surround L R C Lss Rss Lsr...
const int __protools_mapping_discrete_to_stereo[2]
Indices to map a discrete bus to a stereo bus in ProTools.
const float __protools_9p0p4_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 9.0.4 surround L R C Lss Rss Lsr...
const int __protools_mapping_9p0p6_to_discrete[15]
Indices to map a 9p0p9 bus to a discrete bus in ProTools.
const float __Tdesign_degree_10_dirs_deg[60][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 10.
const float __10pX_dirs_deg[10][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 10.x setup.
void generateVBAPgainTable3D(float *ls_dirs_deg, int L, int az_res_deg, int el_res_deg, int omitLargeTriangles, int enableDummies, float spread, float **gtable, int *N_gtable, int *nTriangles)
Generates a 3-D VBAP gain table based on specified loudspeaker directions, with optional spreading [2...
Definition saf_vbap.c:172
void generateVBAPgainTable2D(float *ls_dirs_deg, int L, int az_res_deg, float **gtable, int *N_gtable, int *nPairs)
Generates a 2-D VBAP gain table based on specified loudspeaker directions.
Definition saf_vbap.c:429
A frequency-dependent 3D panner based on the Vector-base Amplitude Panning (VBAP) method [1],...
const float panner_defaultSourceDirections[MAX_NUM_INPUTS][2]
Default Loudspeaker directions.
const int panner_defaultNumLoudspeakers
Default number of Loudspeakers.
const float panner_defaultLoudspeakerDirections[MAX_NUM_OUTPUTS][2]
Default Loudspeaker directions.
const int panner_defaultNumSources
Default number of Sources.
void panner_initGainTables(void *const hPan)
Intialises the VBAP gain table used for panning.
void panner_setCodecStatus(void *const hPan, CODEC_STATUS newStatus)
Sets codec status (see CODEC_STATUS enum)
void panner_initTFT(void *const hPan)
Initialise the filterbank used by panner.
void panner_loadSourcePreset(SOURCE_CONFIG_PRESETS preset, _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2], _Atomic_INT32 *newNCH, int *nDims)
Loads source directions from preset.
void panner_loadLoudspeakerPreset(LOUDSPEAKER_ARRAY_PRESETS preset, _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2], _Atomic_INT32 *newNCH, int *nDims)
Loads source/loudspeaker directions from preset.
A frequency-dependent 3D panner based on the Vector-base Amplitude Panning (VBAP) method [1],...
Main structure for panner.
_Atomic_CODEC_STATUS codecStatus
see CODEC_STATUS
int N_vbap_gtable
Number of directions in the VBAP gain table.
int vbapTableRes[2]
[0] azimuth, and [1] elevation grid resolution, in degrees
_Atomic_FLOAT32 loudpkrs_dirs_deg[MAX_NUM_OUTPUTS][2]
Current loudspeaker directions.
int nTriangles
Number of loudspeaker triangles.
int output_nDims
Dimensionality of the loudspeaker array, 2: 2-D, 3: 3-D.
_Atomic_INT32 nSources
Current number of inputs/sources.
_Atomic_FLOAT32 spread_deg
Source spread/MDAP [2].
char * progressBarText
Current (re)initialisation step, string.
float * vbap_gtable
Current VBAP gains; FLAT: N_hrtf_vbap_gtable x nLoudpkrs.
_Atomic_INT32 new_nSources
New number of inputs/sources.
void * hSTFT
afSTFT handle
_Atomic_INT32 nLoudpkrs
Current number of loudspeakers in the array.
_Atomic_INT32 new_nLoudpkrs
New number of loudspeakers in the array.
_Atomic_FLOAT32 progressBar0_1
Current (re)initialisation progress, between [0..1].