61#ifndef FORCE_3D_LAYOUT
106 if(pData->
hSTFT==NULL)
129 case SOURCE_CONFIG_PRESET_DEFAULT:
131 for(ch=0; ch<nCH; ch++)
133 dirs_deg[ch][i] = 0.0f;
135 case SOURCE_CONFIG_PRESET_MONO:
137 for(ch=0; ch<nCH; ch++)
141 case SOURCE_CONFIG_PRESET_STEREO:
143 for(ch=0; ch<nCH; ch++)
147 case SOURCE_CONFIG_PRESET_5PX:
149 for(ch=0; ch<nCH; ch++)
153 case SOURCE_CONFIG_PRESET_7PX:
155 for(ch=0; ch<nCH; ch++)
159 case SOURCE_CONFIG_PRESET_8PX:
161 for(ch=0; ch<nCH; ch++)
165 case SOURCE_CONFIG_PRESET_9PX:
167 for(ch=0; ch<nCH; ch++)
171 case SOURCE_CONFIG_PRESET_10PX:
173 for(ch=0; ch<nCH; ch++)
177 case SOURCE_CONFIG_PRESET_11PX:
179 for(ch=0; ch<nCH; ch++)
183 case SOURCE_CONFIG_PRESET_11PX_7_4:
185 for(ch=0; ch<nCH; ch++)
189 case SOURCE_CONFIG_PRESET_13PX:
191 for(ch=0; ch<nCH; ch++)
195 case SOURCE_CONFIG_PRESET_22PX:
197 for(ch=0; ch<nCH; ch++)
201 case SOURCE_CONFIG_PRESET_22P2_9_10_3:
203 for(ch=0; ch<nCH; ch++)
207 case SOURCE_CONFIG_PRESET_AALTO_MCC:
209 for(ch=0; ch<nCH; ch++)
213 case SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET:
215 for(ch=0; ch<nCH; ch++)
219 case SOURCE_CONFIG_PRESET_AALTO_APAJA:
221 for(ch=0; ch<nCH; ch++)
225 case SOURCE_CONFIG_PRESET_AALTO_LR:
227 for(ch=0; ch<nCH; ch++)
231 case SOURCE_CONFIG_PRESET_DTU_AVIL:
233 for(ch=0; ch<nCH; ch++)
237 case SOURCE_CONFIG_PRESET_T_DESIGN_4:
239 for(ch=0; ch<nCH; ch++)
243 case SOURCE_CONFIG_PRESET_T_DESIGN_12:
245 for(ch=0; ch<nCH; ch++)
249 case SOURCE_CONFIG_PRESET_T_DESIGN_24:
251 for(ch=0; ch<nCH; ch++)
255 case SOURCE_CONFIG_PRESET_T_DESIGN_36:
257 for(ch=0; ch<nCH; ch++)
261 case SOURCE_CONFIG_PRESET_T_DESIGN_48:
263 for(ch=0; ch<nCH; ch++)
267 case SOURCE_CONFIG_PRESET_T_DESIGN_60:
269 for(ch=0; ch<nCH; ch++)
273 case SOURCE_CONFIG_PRESET_SPH_COV_9:
275 for(ch=0; ch<nCH; ch++)
279 case SOURCE_CONFIG_PRESET_SPH_COV_16:
281 for(ch=0; ch<nCH; ch++)
285 case SOURCE_CONFIG_PRESET_SPH_COV_25:
287 for(ch=0; ch<nCH; ch++)
291 case SOURCE_CONFIG_PRESET_SPH_COV_49:
293 for(ch=0; ch<nCH; ch++)
297 case SOURCE_CONFIG_PRESET_SPH_COV_64:
299 for(ch=0; ch<nCH; ch++)
319 sum_elev += fabsf(dirs_deg[i][1]);
339 case LOUDSPEAKER_ARRAY_PRESET_DEFAULT:
340 case LOUDSPEAKER_ARRAY_PRESET_STEREO:
342 for(ch=0; ch<nCH; ch++)
346 case LOUDSPEAKER_ARRAY_PRESET_5PX:
348 for(ch=0; ch<nCH; ch++)
352 case LOUDSPEAKER_ARRAY_PRESET_7PX:
354 for(ch=0; ch<nCH; ch++)
358 case LOUDSPEAKER_ARRAY_PRESET_8PX:
360 for(ch=0; ch<nCH; ch++)
364 case LOUDSPEAKER_ARRAY_PRESET_9PX:
366 for(ch=0; ch<nCH; ch++)
370 case LOUDSPEAKER_ARRAY_PRESET_10PX:
372 for(ch=0; ch<nCH; ch++)
376 case LOUDSPEAKER_ARRAY_PRESET_11PX:
378 for(ch=0; ch<nCH; ch++)
382 case LOUDSPEAKER_ARRAY_PRESET_11PX_7_4:
384 for(ch=0; ch<nCH; ch++)
388 case LOUDSPEAKER_ARRAY_PRESET_13PX:
390 for(ch=0; ch<nCH; ch++)
394 case LOUDSPEAKER_ARRAY_PRESET_22PX:
396 for(ch=0; ch<nCH; ch++)
400 case LOUDSPEAKER_ARRAY_PRESET_22P2_9_10_3:
402 for(ch=0; ch<nCH; ch++)
406 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC:
408 for(ch=0; ch<nCH; ch++)
412 case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC_SUBSET:
414 for(ch=0; ch<nCH; ch++)
418 case LOUDSPEAKER_ARRAY_PRESET_AALTO_APAJA:
420 for(ch=0; ch<nCH; ch++)
424 case LOUDSPEAKER_ARRAY_PRESET_AALTO_LR:
426 for(ch=0; ch<nCH; ch++)
430 case LOUDSPEAKER_ARRAY_PRESET_DTU_AVIL:
432 for(ch=0; ch<nCH; ch++)
436 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_4:
438 for(ch=0; ch<nCH; ch++)
442 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_12:
444 for(ch=0; ch<nCH; ch++)
448 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_24:
450 for(ch=0; ch<nCH; ch++)
454 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_36:
456 for(ch=0; ch<nCH; ch++)
460 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_48:
462 for(ch=0; ch<nCH; ch++)
466 case LOUDSPEAKER_ARRAY_PRESET_T_DESIGN_60:
468 for(ch=0; ch<nCH; ch++)
472 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_9:
474 for(ch=0; ch<nCH; ch++)
478 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_16:
480 for(ch=0; ch<nCH; ch++)
484 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_25:
486 for(ch=0; ch<nCH; ch++)
490 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_49:
492 for(ch=0; ch<nCH; ch++)
496 case LOUDSPEAKER_ARRAY_PRESET_SPH_COV_64:
498 for(ch=0; ch<nCH; ch++)
518 sum_elev += fabsf(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_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