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
47void panner_setCodecStatus(void* const hPan, CODEC_STATUS newStatus)
48{
49 panner_data *pData = (panner_data*)(hPan);
50 if(newStatus==CODEC_STATUS_NOT_INITIALISED){
51 /* Pause until current initialisation is complete */
53 SAF_SLEEP(10);
54 }
55 pData->codecStatus = newStatus;
56}
57
58void panner_initGainTables(void* const hPan)
59{
60 panner_data *pData = (panner_data*)(hPan);
61#ifndef FORCE_3D_LAYOUT
62 int i;
63 float sum_elev;
64
65 /* determine dimensionality */
66 sum_elev = 0.0f;
67 for(i=0; i<pData->nLoudpkrs; i++)
68 sum_elev += fabsf(pData->loudpkrs_dirs_deg[i][1]);
69 if(sum_elev < 0.01f)
70 pData->output_nDims = 2;
71 else
72 pData->output_nDims = 3;
73#endif
74
75 strcpy(pData->progressBarText,"Generating VBAP Gain Table");
76 pData->progressBar0_1 = 0.7f;
77
78 /* generate VBAP gain table */
79 free(pData->vbap_gtable);
80 pData->vbapTableRes[0] = 1;
81 pData->vbapTableRes[1] = 1;
82#ifdef FORCE_3D_LAYOUT
83 pData->output_nDims = 3;
84 generateVBAPgainTable3D((float*)pData->loudpkrs_dirs_deg, pData->nLoudpkrs, pData->vbapTableRes[0], pData->vbapTableRes[1], 1, 1, pData->spread_deg,
85 &(pData->vbap_gtable), &(pData->N_vbap_gtable), &(pData->nTriangles));
86#else
87 if(pData->output_nDims==2)
88 generateVBAPgainTable2D((float*)pData->loudpkrs_dirs_deg, pData->nLoudpkrs, pData->vbapTableRes[0],
89 &(pData->vbap_gtable), &(pData->N_vbap_gtable), &(pData->nTriangles));
90 else{
91 generateVBAPgainTable3D((float*)pData->loudpkrs_dirs_deg, pData->nLoudpkrs, pData->vbapTableRes[0], pData->vbapTableRes[1], 1, 1, pData->spread_deg,
92 &(pData->vbap_gtable), &(pData->N_vbap_gtable), &(pData->nTriangles));
93 if(pData->vbap_gtable==NULL){
94 /* if generating vbap gain tabled failed, re-calculate with 2D VBAP */
95 pData->output_nDims = 2;
97 }
98 }
99#endif
100}
101
103(
104 void* const hPan
105)
106{
107 panner_data *pData = (panner_data*)(hPan);
108
109 if(pData->hSTFT==NULL)
111 else if (pData->new_nSources!=pData->nSources || pData->new_nLoudpkrs!=pData->nLoudpkrs){
113 afSTFT_clearBuffers(pData->hSTFT);
114 }
115 pData->nSources = pData->new_nSources;
116 pData->nLoudpkrs = pData->new_nLoudpkrs;
117}
118
120(
122 _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2],
123 _Atomic_INT32* newNCH,
124 int* nDims
125)
126{
127 float sum_elev;
128 int ch, i, nCH;
129
130 switch(preset){
131 default:
132 case SOURCE_CONFIG_PRESET_DEFAULT:
133 nCH = 1;
134 for(ch=0; ch<nCH; ch++)
135 for(i=0; i<2; i++)
136 dirs_deg[ch][i] = 0.0f;
137 break;
138 case SOURCE_CONFIG_PRESET_MONO:
139 nCH = 1;
140 for(ch=0; ch<nCH; ch++)
141 for(i=0; i<2; i++)
142 dirs_deg[ch][i] = __mono_dirs_deg[ch][i];
143 break;
144 case SOURCE_CONFIG_PRESET_STEREO:
145 nCH = 2;
146 for(ch=0; ch<nCH; ch++)
147 for(i=0; i<2; i++)
148 dirs_deg[ch][i] = __stereo_dirs_deg[ch][i];
149 break;
150 case SOURCE_CONFIG_PRESET_5PX:
151 nCH = 5;
152 for(ch=0; ch<nCH; ch++)
153 for(i=0; i<2; i++)
154 dirs_deg[ch][i] = __5pX_dirs_deg[ch][i];
155 break;
156 case SOURCE_CONFIG_PRESET_7PX:
157 nCH = 7;
158 for(ch=0; ch<nCH; ch++)
159 for(i=0; i<2; i++)
160 dirs_deg[ch][i] = __7pX_dirs_deg[ch][i];
161 break;
162 case SOURCE_CONFIG_PRESET_8PX:
163 nCH = 8;
164 for(ch=0; ch<nCH; ch++)
165 for(i=0; i<2; i++)
166 dirs_deg[ch][i] = __8pX_dirs_deg[ch][i];
167 break;
168 case SOURCE_CONFIG_PRESET_9PX:
169 nCH = 9;
170 for(ch=0; ch<nCH; ch++)
171 for(i=0; i<2; i++)
172 dirs_deg[ch][i] = __9pX_dirs_deg[ch][i];
173 break;
174 case SOURCE_CONFIG_PRESET_10PX:
175 nCH = 10;
176 for(ch=0; ch<nCH; ch++)
177 for(i=0; i<2; i++)
178 dirs_deg[ch][i] = __10pX_dirs_deg[ch][i];
179 break;
180 case SOURCE_CONFIG_PRESET_11PX:
181 nCH = 11;
182 for(ch=0; ch<nCH; ch++)
183 for(i=0; i<2; i++)
184 dirs_deg[ch][i] = __11pX_dirs_deg[ch][i];
185 break;
186 case SOURCE_CONFIG_PRESET_11PX_7_4:
187 nCH = 11;
188 for(ch=0; ch<nCH; ch++)
189 for(i=0; i<2; i++)
190 dirs_deg[ch][i] = __11pX_7_4_dirs_deg[ch][i];
191 break;
192 case SOURCE_CONFIG_PRESET_13PX:
193 nCH = 13;
194 for(ch=0; ch<nCH; ch++)
195 for(i=0; i<2; i++)
196 dirs_deg[ch][i] = __13pX_dirs_deg[ch][i];
197 break;
198 case SOURCE_CONFIG_PRESET_22PX:
199 nCH = 22;
200 for(ch=0; ch<nCH; ch++)
201 for(i=0; i<2; i++)
202 dirs_deg[ch][i] = __22pX_dirs_deg[ch][i];
203 break;
204 case SOURCE_CONFIG_PRESET_22P2_9_10_3:
205 nCH = 24;
206 for(ch=0; ch<nCH; ch++)
207 for(i=0; i<2; i++)
208 dirs_deg[ch][i] = __9_10_3p2_dirs_deg[ch][i];
209 break;
210 case SOURCE_CONFIG_PRESET_AALTO_MCC:
211 nCH = 45;
212 for(ch=0; ch<nCH; ch++)
213 for(i=0; i<2; i++)
214 dirs_deg[ch][i] = __Aalto_MCC_dirs_deg[ch][i];
215 break;
216 case SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET:
217 nCH = 37;
218 for(ch=0; ch<nCH; ch++)
219 for(i=0; i<2; i++)
220 dirs_deg[ch][i] = __Aalto_MCCsubset_dirs_deg[ch][i];
221 break;
222 case SOURCE_CONFIG_PRESET_AALTO_APAJA:
223 nCH = 29;
224 for(ch=0; ch<nCH; ch++)
225 for(i=0; i<2; i++)
226 dirs_deg[ch][i] = __Aalto_Apaja_dirs_deg[ch][i];
227 break;
228 case SOURCE_CONFIG_PRESET_AALTO_LR:
229 nCH = 13;
230 for(ch=0; ch<nCH; ch++)
231 for(i=0; i<2; i++)
232 dirs_deg[ch][i] = __Aalto_LR_dirs_deg[ch][i];
233 break;
234 case SOURCE_CONFIG_PRESET_DTU_AVIL:
235 nCH = 64;
236 for(ch=0; ch<nCH; ch++)
237 for(i=0; i<2; i++)
238 dirs_deg[ch][i] = __DTU_AVIL_dirs_deg[ch][i];
239 break;
240 case SOURCE_CONFIG_PRESET_T_DESIGN_4:
241 nCH = 4;
242 for(ch=0; ch<nCH; ch++)
243 for(i=0; i<2; i++)
244 dirs_deg[ch][i] = __Tdesign_degree_2_dirs_deg[ch][i];
245 break;
246 case SOURCE_CONFIG_PRESET_T_DESIGN_12:
247 nCH = 12;
248 for(ch=0; ch<nCH; ch++)
249 for(i=0; i<2; i++)
250 dirs_deg[ch][i] = __Tdesign_degree_4_dirs_deg[ch][i];
251 break;
252 case SOURCE_CONFIG_PRESET_T_DESIGN_24:
253 nCH = 24;
254 for(ch=0; ch<nCH; ch++)
255 for(i=0; i<2; i++)
256 dirs_deg[ch][i] = __Tdesign_degree_6_dirs_deg[ch][i];
257 break;
258 case SOURCE_CONFIG_PRESET_T_DESIGN_36:
259 nCH = 36;
260 for(ch=0; ch<nCH; ch++)
261 for(i=0; i<2; i++)
262 dirs_deg[ch][i] = __Tdesign_degree_8_dirs_deg[ch][i];
263 break;
264 case SOURCE_CONFIG_PRESET_T_DESIGN_48:
265 nCH = 48;
266 for(ch=0; ch<nCH; ch++)
267 for(i=0; i<2; i++)
268 dirs_deg[ch][i] = __Tdesign_degree_9_dirs_deg[ch][i];
269 break;
270 case SOURCE_CONFIG_PRESET_T_DESIGN_60:
271 nCH = 60;
272 for(ch=0; ch<nCH; ch++)
273 for(i=0; i<2; i++)
274 dirs_deg[ch][i] = __Tdesign_degree_10_dirs_deg[ch][i];
275 break;
276 case SOURCE_CONFIG_PRESET_SPH_COV_9:
277 nCH = 9;
278 for(ch=0; ch<nCH; ch++)
279 for(i=0; i<2; i++)
280 dirs_deg[ch][i] = __SphCovering_9_dirs_deg[ch][i];
281 break;
282 case SOURCE_CONFIG_PRESET_SPH_COV_16:
283 nCH = 16;
284 for(ch=0; ch<nCH; ch++)
285 for(i=0; i<2; i++)
286 dirs_deg[ch][i] = __SphCovering_16_dirs_deg[ch][i];
287 break;
288 case SOURCE_CONFIG_PRESET_SPH_COV_25:
289 nCH = 25;
290 for(ch=0; ch<nCH; ch++)
291 for(i=0; i<2; i++)
292 dirs_deg[ch][i] = __SphCovering_25_dirs_deg[ch][i];
293 break;
294 case SOURCE_CONFIG_PRESET_SPH_COV_49:
295 nCH = 49;
296 for(ch=0; ch<nCH; ch++)
297 for(i=0; i<2; i++)
298 dirs_deg[ch][i] = __SphCovering_49_dirs_deg[ch][i];
299 break;
300 case SOURCE_CONFIG_PRESET_SPH_COV_64:
301 nCH = 64;
302 for(ch=0; ch<nCH; ch++)
303 for(i=0; i<2; i++)
304 dirs_deg[ch][i] = __SphCovering_64_dirs_deg[ch][i];
305 break;
306 }
307
308 /* Fill remaining slots with default coords */
309 for(; ch<MAX_NUM_INPUTS; ch++){
310 for(i=0; i<2; i++){
311 dirs_deg[ch][i] = __default_LScoords128_deg[ch][i];
312 }
313 }
314
315 /* For dynamically changing the number of TFT channels */
316 (*newNCH) = nCH;
317
318 /* estimate number of dimensions. (Obviously fails if using 2D setups thare are on an angle.
319 However, in these cases, triangulation should fail and revert to 2D anyway) */
320 sum_elev = 0.0f;
321 for(i=0; i<nCH; i++)
322 sum_elev += fabsf((float)dirs_deg[i][1]);
323 if(sum_elev < 0.01f)
324 (*nDims) = 2;
325 else
326 (*nDims) = 3;
327}
328
330(
332 _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2],
333 _Atomic_INT32* newNCH,
334 int* nDims
335)
336{
337 float sum_elev;
338 int ch, i, nCH;
339
340 switch(preset){
341 default:
342 case LOUDSPEAKER_ARRAY_PRESET_DEFAULT:
343 case LOUDSPEAKER_ARRAY_PRESET_STEREO:
344 nCH = 2;
345 for(ch=0; ch<nCH; ch++)
346 for(i=0; i<2; i++)
347 dirs_deg[ch][i] = __stereo_dirs_deg[ch][i];
348 break;
349 case LOUDSPEAKER_ARRAY_PRESET_5PX:
350 nCH = 5;
351 for(ch=0; ch<nCH; ch++)
352 for(i=0; i<2; i++)
353 dirs_deg[ch][i] = __5pX_dirs_deg[ch][i];
354 break;
355 case LOUDSPEAKER_ARRAY_PRESET_7PX:
356 nCH = 7;
357 for(ch=0; ch<nCH; ch++)
358 for(i=0; i<2; i++)
359 dirs_deg[ch][i] = __7pX_dirs_deg[ch][i];
360 break;
361 case LOUDSPEAKER_ARRAY_PRESET_8PX:
362 nCH = 8;
363 for(ch=0; ch<nCH; ch++)
364 for(i=0; i<2; i++)
365 dirs_deg[ch][i] = __8pX_dirs_deg[ch][i];
366 break;
367 case LOUDSPEAKER_ARRAY_PRESET_9PX:
368 nCH = 9;
369 for(ch=0; ch<nCH; ch++)
370 for(i=0; i<2; i++)
371 dirs_deg[ch][i] = __9pX_dirs_deg[ch][i];
372 break;
373 case LOUDSPEAKER_ARRAY_PRESET_10PX:
374 nCH = 10;
375 for(ch=0; ch<nCH; ch++)
376 for(i=0; i<2; i++)
377 dirs_deg[ch][i] = __10pX_dirs_deg[ch][i];
378 break;
379 case LOUDSPEAKER_ARRAY_PRESET_11PX:
380 nCH = 11;
381 for(ch=0; ch<nCH; ch++)
382 for(i=0; i<2; i++)
383 dirs_deg[ch][i] = __11pX_dirs_deg[ch][i];
384 break;
385 case LOUDSPEAKER_ARRAY_PRESET_11PX_7_4:
386 nCH = 11;
387 for(ch=0; ch<nCH; ch++)
388 for(i=0; i<2; i++)
389 dirs_deg[ch][i] = __11pX_7_4_dirs_deg[ch][i];
390 break;
391 case LOUDSPEAKER_ARRAY_PRESET_13PX:
392 nCH = 13;
393 for(ch=0; ch<nCH; ch++)
394 for(i=0; i<2; i++)
395 dirs_deg[ch][i] = __13pX_dirs_deg[ch][i];
396 break;
397 case LOUDSPEAKER_ARRAY_PRESET_22PX:
398 nCH = 22;
399 for(ch=0; ch<nCH; ch++)
400 for(i=0; i<2; i++)
401 dirs_deg[ch][i] = __22pX_dirs_deg[ch][i];
402 break;
403 case LOUDSPEAKER_ARRAY_PRESET_22P2_9_10_3:
404 nCH = 24;
405 for(ch=0; ch<nCH; ch++)
406 for(i=0; i<2; i++)
407 dirs_deg[ch][i] = __9_10_3p2_dirs_deg[ch][i];
408 break;
409 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC:
410 nCH = 45;
411 for(ch=0; ch<nCH; ch++)
412 for(i=0; i<2; i++)
413 dirs_deg[ch][i] = __Aalto_MCC_dirs_deg[ch][i];
414 break;
415 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC_SUBSET:
416 nCH = 37;
417 for(ch=0; ch<nCH; ch++)
418 for(i=0; i<2; i++)
419 dirs_deg[ch][i] = __Aalto_MCCsubset_dirs_deg[ch][i];
420 break;
421 case LOUDSPEAKER_ARRAY_PRESET_AALTO_APAJA:
422 nCH = 29;
423 for(ch=0; ch<nCH; ch++)
424 for(i=0; i<2; i++)
425 dirs_deg[ch][i] = __Aalto_Apaja_dirs_deg[ch][i];
426 break;
427 case LOUDSPEAKER_ARRAY_PRESET_AALTO_LR:
428 nCH = 13;
429 for(ch=0; ch<nCH; ch++)
430 for(i=0; i<2; i++)
431 dirs_deg[ch][i] = __Aalto_LR_dirs_deg[ch][i];
432 break;
433 case LOUDSPEAKER_ARRAY_PRESET_DTU_AVIL:
434 nCH = 64;
435 for(ch=0; ch<nCH; ch++)
436 for(i=0; i<2; i++)
437 dirs_deg[ch][i] = __DTU_AVIL_dirs_deg[ch][i];
438 break;
439 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_4:
440 nCH = 4;
441 for(ch=0; ch<nCH; ch++)
442 for(i=0; i<2; i++)
443 dirs_deg[ch][i] = __Tdesign_degree_2_dirs_deg[ch][i];
444 break;
445 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_12:
446 nCH = 12;
447 for(ch=0; ch<nCH; ch++)
448 for(i=0; i<2; i++)
449 dirs_deg[ch][i] = __Tdesign_degree_4_dirs_deg[ch][i];
450 break;
451 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_24:
452 nCH = 24;
453 for(ch=0; ch<nCH; ch++)
454 for(i=0; i<2; i++)
455 dirs_deg[ch][i] = __Tdesign_degree_6_dirs_deg[ch][i];
456 break;
457 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_36:
458 nCH = 36;
459 for(ch=0; ch<nCH; ch++)
460 for(i=0; i<2; i++)
461 dirs_deg[ch][i] = __Tdesign_degree_8_dirs_deg[ch][i];
462 break;
463 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_48:
464 nCH = 48;
465 for(ch=0; ch<nCH; ch++)
466 for(i=0; i<2; i++)
467 dirs_deg[ch][i] = __Tdesign_degree_9_dirs_deg[ch][i];
468 break;
469 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_60:
470 nCH = 60;
471 for(ch=0; ch<nCH; ch++)
472 for(i=0; i<2; i++)
473 dirs_deg[ch][i] = __Tdesign_degree_10_dirs_deg[ch][i];
474 break;
475 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_9:
476 nCH = 9;
477 for(ch=0; ch<nCH; ch++)
478 for(i=0; i<2; i++)
479 dirs_deg[ch][i] = __SphCovering_9_dirs_deg[ch][i];
480 break;
481 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_16:
482 nCH = 16;
483 for(ch=0; ch<nCH; ch++)
484 for(i=0; i<2; i++)
485 dirs_deg[ch][i] = __SphCovering_16_dirs_deg[ch][i];
486 break;
487 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_25:
488 nCH = 25;
489 for(ch=0; ch<nCH; ch++)
490 for(i=0; i<2; i++)
491 dirs_deg[ch][i] = __SphCovering_25_dirs_deg[ch][i];
492 break;
493 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_49:
494 nCH = 49;
495 for(ch=0; ch<nCH; ch++)
496 for(i=0; i<2; i++)
497 dirs_deg[ch][i] = __SphCovering_49_dirs_deg[ch][i];
498 break;
499 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_64:
500 nCH = 64;
501 for(ch=0; ch<nCH; ch++)
502 for(i=0; i<2; i++)
503 dirs_deg[ch][i] = __SphCovering_64_dirs_deg[ch][i];
504 break;
505 }
506
507 /* Fill remaining slots with default coords */
508 for(; ch<MAX_NUM_INPUTS; ch++){
509 for(i=0; i<2; i++){
510 dirs_deg[ch][i] = __default_LScoords128_deg[ch][i];
511 }
512 }
513
514 /* For dynamically changing the number of TFT channels */
515 (*newNCH) = nCH;
516
517 /* estimate number of dimensions. (Obviously fails if using 2D setups thare are on an angle.
518 However, in these cases, triangulation should fail and revert to 2D anyway) */
519 sum_elev = 0.0f;
520 for(i=0; i<nCH; i++)
521 sum_elev += fabsf((float)dirs_deg[i][1]);
522 if(sum_elev < 0.01f)
523 (*nDims) = 2;
524 else
525 (*nDims) = 3;
526}
527
LOUDSPEAKER_ARRAY_PRESETS
Available loudspeaker array presets.
Definition _common.h:103
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
Definition _common.h:237
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
Definition _common.h:137
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_INITIALISING
Codec is currently being initialised, input audio should not be processed.
Definition _common.h:211
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 __9pX_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 9.x setup.
const float __SphCovering_16_dirs_deg[16][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 16 dirs.
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 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 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 __Aalto_MCCsubset_dirs_deg[37][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC) ...
const float __Aalto_Apaja_dirs_deg[29][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the audio-visual listening room (Apaja),...
const float __SphCovering_9_dirs_deg[9][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 9 dirs.
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 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 __Tdesign_degree_6_dirs_deg[24][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 6.
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 float __22pX_dirs_deg[22][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 22.x setup.
const float __SphCovering_25_dirs_deg[25][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 25 dirs.
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],...
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].