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