61#ifndef FORCE_3D_LAYOUT
109 if(pData->
hSTFT==NULL)
123 _Atomic_INT32* newNCH,
132 case SOURCE_CONFIG_PRESET_DEFAULT:
134 for(ch=0; ch<nCH; ch++)
136 dirs_deg[ch][i] = 0.0f;
138 case SOURCE_CONFIG_PRESET_MONO:
140 for(ch=0; ch<nCH; ch++)
144 case SOURCE_CONFIG_PRESET_STEREO:
146 for(ch=0; ch<nCH; ch++)
150 case SOURCE_CONFIG_PRESET_5PX:
152 for(ch=0; ch<nCH; ch++)
156 case SOURCE_CONFIG_PRESET_7PX:
158 for(ch=0; ch<nCH; ch++)
162 case SOURCE_CONFIG_PRESET_8PX:
164 for(ch=0; ch<nCH; ch++)
168 case SOURCE_CONFIG_PRESET_9PX:
170 for(ch=0; ch<nCH; ch++)
174 case SOURCE_CONFIG_PRESET_10PX:
176 for(ch=0; ch<nCH; ch++)
180 case SOURCE_CONFIG_PRESET_11PX:
182 for(ch=0; ch<nCH; ch++)
186 case SOURCE_CONFIG_PRESET_11PX_7_4:
188 for(ch=0; ch<nCH; ch++)
192 case SOURCE_CONFIG_PRESET_13PX:
194 for(ch=0; ch<nCH; ch++)
198 case SOURCE_CONFIG_PRESET_22PX:
200 for(ch=0; ch<nCH; ch++)
204 case SOURCE_CONFIG_PRESET_22P2_9_10_3:
206 for(ch=0; ch<nCH; ch++)
210 case SOURCE_CONFIG_PRESET_AALTO_MCC:
212 for(ch=0; ch<nCH; ch++)
216 case SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET:
218 for(ch=0; ch<nCH; ch++)
222 case SOURCE_CONFIG_PRESET_AALTO_APAJA:
224 for(ch=0; ch<nCH; ch++)
228 case SOURCE_CONFIG_PRESET_AALTO_LR:
230 for(ch=0; ch<nCH; ch++)
234 case SOURCE_CONFIG_PRESET_DTU_AVIL:
236 for(ch=0; ch<nCH; ch++)
240 case SOURCE_CONFIG_PRESET_T_DESIGN_4:
242 for(ch=0; ch<nCH; ch++)
246 case SOURCE_CONFIG_PRESET_T_DESIGN_12:
248 for(ch=0; ch<nCH; ch++)
252 case SOURCE_CONFIG_PRESET_T_DESIGN_24:
254 for(ch=0; ch<nCH; ch++)
258 case SOURCE_CONFIG_PRESET_T_DESIGN_36:
260 for(ch=0; ch<nCH; ch++)
264 case SOURCE_CONFIG_PRESET_T_DESIGN_48:
266 for(ch=0; ch<nCH; ch++)
270 case SOURCE_CONFIG_PRESET_T_DESIGN_60:
272 for(ch=0; ch<nCH; ch++)
276 case SOURCE_CONFIG_PRESET_SPH_COV_9:
278 for(ch=0; ch<nCH; ch++)
282 case SOURCE_CONFIG_PRESET_SPH_COV_16:
284 for(ch=0; ch<nCH; ch++)
288 case SOURCE_CONFIG_PRESET_SPH_COV_25:
290 for(ch=0; ch<nCH; ch++)
294 case SOURCE_CONFIG_PRESET_SPH_COV_49:
296 for(ch=0; ch<nCH; ch++)
300 case SOURCE_CONFIG_PRESET_SPH_COV_64:
302 for(ch=0; ch<nCH; ch++)
322 sum_elev += fabsf((
float)dirs_deg[i][1]);
333 _Atomic_INT32* newNCH,
342 case LOUDSPEAKER_ARRAY_PRESET_DEFAULT:
343 case LOUDSPEAKER_ARRAY_PRESET_STEREO:
345 for(ch=0; ch<nCH; ch++)
349 case LOUDSPEAKER_ARRAY_PRESET_5PX:
351 for(ch=0; ch<nCH; ch++)
355 case LOUDSPEAKER_ARRAY_PRESET_7PX:
357 for(ch=0; ch<nCH; ch++)
361 case LOUDSPEAKER_ARRAY_PRESET_8PX:
363 for(ch=0; ch<nCH; ch++)
367 case LOUDSPEAKER_ARRAY_PRESET_9PX:
369 for(ch=0; ch<nCH; ch++)
373 case LOUDSPEAKER_ARRAY_PRESET_10PX:
375 for(ch=0; ch<nCH; ch++)
379 case LOUDSPEAKER_ARRAY_PRESET_11PX:
381 for(ch=0; ch<nCH; ch++)
385 case LOUDSPEAKER_ARRAY_PRESET_11PX_7_4:
387 for(ch=0; ch<nCH; ch++)
391 case LOUDSPEAKER_ARRAY_PRESET_13PX:
393 for(ch=0; ch<nCH; ch++)
397 case LOUDSPEAKER_ARRAY_PRESET_22PX:
399 for(ch=0; ch<nCH; ch++)
403 case LOUDSPEAKER_ARRAY_PRESET_22P2_9_10_3:
405 for(ch=0; ch<nCH; ch++)
409 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC:
411 for(ch=0; ch<nCH; ch++)
415 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC_SUBSET:
417 for(ch=0; ch<nCH; ch++)
421 case LOUDSPEAKER_ARRAY_PRESET_AALTO_APAJA:
423 for(ch=0; ch<nCH; ch++)
427 case LOUDSPEAKER_ARRAY_PRESET_AALTO_LR:
429 for(ch=0; ch<nCH; ch++)
433 case LOUDSPEAKER_ARRAY_PRESET_DTU_AVIL:
435 for(ch=0; ch<nCH; ch++)
439 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_4:
441 for(ch=0; ch<nCH; ch++)
445 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_12:
447 for(ch=0; ch<nCH; ch++)
451 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_24:
453 for(ch=0; ch<nCH; ch++)
457 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_36:
459 for(ch=0; ch<nCH; ch++)
463 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_48:
465 for(ch=0; ch<nCH; ch++)
469 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_60:
471 for(ch=0; ch<nCH; ch++)
475 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_9:
477 for(ch=0; ch<nCH; ch++)
481 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_16:
483 for(ch=0; ch<nCH; ch++)
487 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_25:
489 for(ch=0; ch<nCH; ch++)
493 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_49:
495 for(ch=0; ch<nCH; ch++)
499 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_64:
501 for(ch=0; ch<nCH; ch++)
521 sum_elev += fabsf((
float)dirs_deg[i][1]);
LOUDSPEAKER_ARRAY_PRESETS
Available loudspeaker array presets.
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
CODEC_STATUS
Current status of the codec.
@ CODEC_STATUS_NOT_INITIALISED
Codec has not yet been initialised, or the codec configuration has changed.
@ CODEC_STATUS_INITIALISING
Codec is currently being initialised, input audio should not be processed.
void afSTFT_clearBuffers(void *const hSTFT)
Flushes time-domain buffers with zeros.
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.
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.
@ AFSTFT_BANDS_CH_TIME
nBands x nChannels x nTimeHops
#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...
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.
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].