26#ifndef __AMBI_ENC_INTERNAL_H_INCLUDED__
27#define __AMBI_ENC_INTERNAL_H_INCLUDED__
41#if !defined(AMBI_ENC_FRAME_SIZE)
42# if defined(FRAME_SIZE)
43# define AMBI_ENC_FRAME_SIZE ( FRAME_SIZE )
45# define AMBI_ENC_FRAME_SIZE ( 64 )
57typedef struct _ambi_enc
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
#define MAX_NUM_SH_SIGNALS
Maximum number of spherical harmonic components/signals supported.
A basic Ambisonic encoder.
void loadSourceConfigPreset(SOURCE_CONFIG_PRESETS preset, _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2], _Atomic_INT32 *nCH)
Returns the source directions for a specified source config preset.
#define AMBI_ENC_FRAME_SIZE
Framesize, in time-domain samples.
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Main structure for ambi_enc.
float tempFrame[MAX_NUM_SH_SIGNALS][AMBI_ENC_FRAME_SIZE]
Temporary frame.
float Y[MAX_NUM_SH_SIGNALS][MAX_NUM_INPUTS]
SH weights.
_Atomic_INT32 enablePostScaling
Flag 1: output signals scaled by 1/sqrt(nSources), 0: disabled.
_Atomic_NORM_TYPES norm
Ambisonic normalisation convention (see NORM_TYPES)
float interpolator_fadeIn[AMBI_ENC_FRAME_SIZE]
Linear Interpolator (fade-in)
_Atomic_FLOAT32 src_gains[MAX_NUM_INPUTS]
Gains applied per source.
float inputFrameTD[MAX_NUM_INPUTS][AMBI_ENC_FRAME_SIZE]
Input frame of signals.
float tempFrame_fadeOut[MAX_NUM_SH_SIGNALS][AMBI_ENC_FRAME_SIZE]
Temporary frame with linear interpolation (fade-out) applied.
_Atomic_INT32 nSources
Current number of input signals.
_Atomic_CH_ORDER chOrdering
Ambisonic channel order convention (see CH_ORDER)
_Atomic_SH_ORDERS order
Current SH encoding order.
float outputFrameTD[MAX_NUM_SH_SIGNALS][AMBI_ENC_FRAME_SIZE]
Output frame of SH signals.
_Atomic_INT32 new_nSources
New number of input signals (current value will be replaced by this after next re-init)
_Atomic_FLOAT32 src_dirs_deg[MAX_NUM_INPUTS][2]
Source directions, in degrees.
float prev_Y[MAX_NUM_SH_SIGNALS][MAX_NUM_INPUTS]
Previous SH weights.
float fs
Host sampling rate.
float outputFrameTD_fadeIn[MAX_NUM_SH_SIGNALS][AMBI_ENC_FRAME_SIZE]
Output frame of SH signals with linear interpolation (fade-in) applied.
_Atomic_INT32 recalc_SH_FLAG[MAX_NUM_INPUTS]
Flags, 1: recalc SH weights, 0: do not.
float interpolator_fadeOut[AMBI_ENC_FRAME_SIZE]
Linear Interpolator (fade-out)