Look-up table containing channel gains for each direction.
More...
#include <JPLSpatial/Panning/VBAPLUT2D.h>
|
| template<class T > |
| using | Array = std::pmr::vector<T> |
| |
Look-up table containing channel gains for each direction.
◆ Array
◆ LUT2D()
| JPL::VBAP::LUT2D::LUT2D |
( |
| ) |
|
|
default |
◆ AngleNormalizedToLUTPosition()
| JPL_INLINE int JPL::VBAP::LUT2D::AngleNormalizedToLUTPosition |
( |
float | angleNormalised | ) |
const |
|
nodiscard |
Get LUT position from direction angle, where 0.0 is forward
- Parameters
-
| angleNormalised | Angle in radians in [0, 2Pi]. |
◆ AngleToLUTPosition()
| JPL_INLINE int JPL::VBAP::LUT2D::AngleToLUTPosition |
( |
float | angleInRadians | ) |
const |
|
nodiscard |
Get LUT position from direction angle, where 0.0 is forward
- Parameters
-
| angleInRadians | in radians in [-Pi, Pi] |
◆ BuildDiamondToAngleNormLUT()
| void JPL::VBAP::LUT2D::BuildDiamondToAngleNormLUT |
( |
Array< float > & | outCorrectionLUT, |
|
|
uint32 | M_corr = 1024 ) |
|
inlinestatic |
Build p -> normalized angle in [0,1) M_corr: power-of-two size
◆ BuildDiamondToUniformIndexLUT()
| void JPL::VBAP::LUT2D::BuildDiamondToUniformIndexLUT |
( |
Array< uint32 > & | outCorrectionLUT, |
|
|
uint32 | N_uniform, |
|
|
uint32 | M_corr = 1024 ) |
|
inlinestatic |
Build a table of size M_corr that maps diamond-parameter bins to 'uniform-angle' indices in [0, N_uniform).
◆ CartesianToLUTPosition() [1/2]
| JPL_INLINE simd_mask JPL::VBAP::LUT2D::CartesianToLUTPosition |
( |
const simd & | x, |
|
|
const simd & | y ) const |
|
nodiscard |
Get LUT position from direction vector.
For diamond encoding we need to normalize Vec2(x, y) direction
◆ CartesianToLUTPosition() [2/2]
| JPL_INLINE int JPL::VBAP::LUT2D::CartesianToLUTPosition |
( |
float | x, |
|
|
float | y ) const |
|
nodiscard |
Get LUT position from direction vector.
◆ GetLUTResolution()
| JPL_INLINE size_t JPL::VBAP::LUT2D::GetLUTResolution |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ GetLUTSize()
| JPL_INLINE size_t JPL::VBAP::LUT2D::GetLUTSize |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Size of the LUT = LUT Resolution * Number of Channels.
◆ GetLUTValue()
| JPL_INLINE float JPL::VBAP::LUT2D::GetLUTValue |
( |
uint32 | positionInLUT | ) |
const |
|
inlinenodiscard |
Get gain value at LUT position. Channel stride should be handled by the caller.
E.g. to get gain value for channel 3, knowing LUT position (e.g. retrieved by calling AngleToLUTPosition), positionInLUT parameter should be: AngleToLUTPosition * NumberOfChannels + 3.
Channel gain values for each angle are laid out continuously in the LUT. So to get all the target channel gains for a specific angle, simply get the beginning of the gain data, e.g.: GetLUTValue(AngleToLUTPosition * NumberOfChannels) ..and copy the contiguous gains from that position (LFE is inlude if present in the channel map, though the gain for LFE is always 0.0).
◆ GetSpeakerGains() [1/3]
| JPL_INLINE void JPL::VBAP::LUT2D::GetSpeakerGains |
( |
const simd & | dirX, |
|
|
const simd & | dirY, |
|
|
std::span< simd > | outGains ) const |
Get preprocessed speaker gains from LUT based on direction vector.
◆ GetSpeakerGains() [2/3]
| JPL_INLINE void JPL::VBAP::LUT2D::GetSpeakerGains |
( |
const Vec2 & | direction, |
|
|
std::span< float > | outGains ) const |
Get preprocessed speaker gains from LUT based on direction vector.
◆ GetSpeakerGains() [3/3]
| JPL_INLINE void JPL::VBAP::LUT2D::GetSpeakerGains |
( |
int | lutPosition, |
|
|
std::span< float > | outGains ) const |
Get preprocessed speaker gains at specific LUT posotion.
◆ IsInitialized()
| JPL_INLINE bool JPL::VBAP::LUT2D::IsInitialized |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ LUTPositionToAngle()
| JPL_INLINE auto JPL::VBAP::LUT2D::LUTPositionToAngle |
( |
int | pos | ) |
const |
|
nodiscard |
Convert LUT position to angle (within LUT resolution, irrespective of number of channels of the channel map)
◆ operator[]() [1/2]
| JPL_INLINE float & JPL::VBAP::LUT2D::operator[] |
( |
int | i | ) |
|
|
inlinenodiscard |
◆ operator[]() [2/2]
| JPL_INLINE const float & JPL::VBAP::LUT2D::operator[] |
( |
int | i | ) |
const |
|
inlinenodiscard |
◆ LUTBuilder2D
template<auto GetSpeakerAngleFunction>
The documentation for this class was generated from the following file: