Update the HRTF second-order ambisonic decoder
This only needs 14 virtual channels instead of 20.
This commit is contained in:
parent
7ac336b078
commit
c77fd6540c
@ -662,10 +662,7 @@ void InitHrtfPanning(ALCdevice *device)
|
|||||||
constexpr float Deg_90{Deg180 / 2.0f /* 90 degrees*/};
|
constexpr float Deg_90{Deg180 / 2.0f /* 90 degrees*/};
|
||||||
constexpr float Deg_45{Deg_90 / 2.0f /* 45 degrees*/};
|
constexpr float Deg_45{Deg_90 / 2.0f /* 45 degrees*/};
|
||||||
constexpr float Deg135{Deg_45 * 3.0f /*135 degrees*/};
|
constexpr float Deg135{Deg_45 * 3.0f /*135 degrees*/};
|
||||||
constexpr float Deg_35{6.154797086e-01f /* 35~ 36 degrees*/};
|
constexpr float Deg_35{6.154797087e-01f /* 35~ 36 degrees*/};
|
||||||
constexpr float Deg_69{1.205932499e+00f /* 69~ 70 degrees*/};
|
|
||||||
constexpr float Deg111{1.935660155e+00f /*110~111 degrees*/};
|
|
||||||
constexpr float Deg_21{3.648638281e-01f /* 20~ 21 degrees*/};
|
|
||||||
static const AngularPoint AmbiPoints1O[]{
|
static const AngularPoint AmbiPoints1O[]{
|
||||||
{ EvRadians{ Deg_35}, AzRadians{-Deg_45} },
|
{ EvRadians{ Deg_35}, AzRadians{-Deg_45} },
|
||||||
{ EvRadians{ Deg_35}, AzRadians{-Deg135} },
|
{ EvRadians{ Deg_35}, AzRadians{-Deg135} },
|
||||||
@ -676,26 +673,20 @@ void InitHrtfPanning(ALCdevice *device)
|
|||||||
{ EvRadians{-Deg_35}, AzRadians{ Deg_45} },
|
{ EvRadians{-Deg_35}, AzRadians{ Deg_45} },
|
||||||
{ EvRadians{-Deg_35}, AzRadians{ Deg135} },
|
{ EvRadians{-Deg_35}, AzRadians{ Deg135} },
|
||||||
}, AmbiPoints2O[]{
|
}, AmbiPoints2O[]{
|
||||||
|
{ EvRadians{ 0.0f}, AzRadians{ 0.0f} },
|
||||||
|
{ EvRadians{ 0.0f}, AzRadians{ Deg180} },
|
||||||
|
{ EvRadians{ 0.0f}, AzRadians{-Deg_90} },
|
||||||
|
{ EvRadians{ 0.0f}, AzRadians{ Deg_90} },
|
||||||
|
{ EvRadians{ Deg_90}, AzRadians{ 0.0f} },
|
||||||
|
{ EvRadians{-Deg_90}, AzRadians{ 0.0f} },
|
||||||
|
{ EvRadians{ Deg_35}, AzRadians{-Deg_45} },
|
||||||
|
{ EvRadians{ Deg_35}, AzRadians{-Deg135} },
|
||||||
|
{ EvRadians{ Deg_35}, AzRadians{ Deg_45} },
|
||||||
|
{ EvRadians{ Deg_35}, AzRadians{ Deg135} },
|
||||||
{ EvRadians{-Deg_35}, AzRadians{-Deg_45} },
|
{ EvRadians{-Deg_35}, AzRadians{-Deg_45} },
|
||||||
{ EvRadians{-Deg_35}, AzRadians{-Deg135} },
|
{ EvRadians{-Deg_35}, AzRadians{-Deg135} },
|
||||||
{ EvRadians{ Deg_35}, AzRadians{-Deg135} },
|
|
||||||
{ EvRadians{ Deg_35}, AzRadians{ Deg135} },
|
|
||||||
{ EvRadians{ Deg_35}, AzRadians{ Deg_45} },
|
|
||||||
{ EvRadians{-Deg_35}, AzRadians{ Deg_45} },
|
{ EvRadians{-Deg_35}, AzRadians{ Deg_45} },
|
||||||
{ EvRadians{-Deg_35}, AzRadians{ Deg135} },
|
{ EvRadians{-Deg_35}, AzRadians{ Deg135} },
|
||||||
{ EvRadians{ Deg_35}, AzRadians{-Deg_45} },
|
|
||||||
{ EvRadians{-Deg_69}, AzRadians{-Deg_90} },
|
|
||||||
{ EvRadians{ Deg_69}, AzRadians{ Deg_90} },
|
|
||||||
{ EvRadians{-Deg_69}, AzRadians{ Deg_90} },
|
|
||||||
{ EvRadians{ Deg_69}, AzRadians{-Deg_90} },
|
|
||||||
{ EvRadians{ 0.0f}, AzRadians{-Deg_69} },
|
|
||||||
{ EvRadians{ 0.0f}, AzRadians{-Deg111} },
|
|
||||||
{ EvRadians{ 0.0f}, AzRadians{ Deg_69} },
|
|
||||||
{ EvRadians{ 0.0f}, AzRadians{ Deg111} },
|
|
||||||
{ EvRadians{-Deg_21}, AzRadians{ Deg180} },
|
|
||||||
{ EvRadians{ Deg_21}, AzRadians{ Deg180} },
|
|
||||||
{ EvRadians{ Deg_21}, AzRadians{ 0.0f} },
|
|
||||||
{ EvRadians{-Deg_21}, AzRadians{ 0.0f} },
|
|
||||||
};
|
};
|
||||||
static const float AmbiMatrix1O[][MaxAmbiChannels]{
|
static const float AmbiMatrix1O[][MaxAmbiChannels]{
|
||||||
{ 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f },
|
{ 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f },
|
||||||
@ -707,33 +698,27 @@ void InitHrtfPanning(ALCdevice *device)
|
|||||||
{ 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f },
|
{ 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f },
|
||||||
{ 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f },
|
{ 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f },
|
||||||
}, AmbiMatrix2O[][MaxAmbiChannels]{
|
}, AmbiMatrix2O[][MaxAmbiChannels]{
|
||||||
{ 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 0.000000000e+00f, 0.000000000e+00f, 1.237179148e-01f, 0.000000000e+00f, 0.000000000e+00f, -7.453559925e-02f, 0.000000000e+00f, 1.290994449e-01f, },
|
||||||
{ 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 0.000000000e+00f, 0.000000000e+00f, -1.237179148e-01f, 0.000000000e+00f, 0.000000000e+00f, -7.453559925e-02f, 0.000000000e+00f, 1.290994449e-01f, },
|
||||||
{ 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 1.237179148e-01f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, -7.453559925e-02f, 0.000000000e+00f, -1.290994449e-01f, },
|
||||||
{ 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, -1.237179148e-01f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, -7.453559925e-02f, 0.000000000e+00f, -1.290994449e-01f, },
|
||||||
{ 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 0.000000000e+00f, 1.237179148e-01f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 1.490711985e-01f, 0.000000000e+00f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 0.000000000e+00f, -1.237179148e-01f, 0.000000000e+00f, 0.000000000e+00f, 0.000000000e+00f, 1.490711985e-01f, 0.000000000e+00f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, 6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 7.142857143e-02f, 7.142857143e-02f, 7.142857143e-02f, 9.682458366e-02f, 9.682458366e-02f, 0.000000000e+00f, 9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f },
|
{ 7.142857143e-02f, 7.142857143e-02f, 7.142857143e-02f, -7.142857143e-02f, -9.682458366e-02f, 9.682458366e-02f, 0.000000000e+00f, -9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, 3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f },
|
{ 7.142857143e-02f, -7.142857143e-02f, 7.142857143e-02f, 7.142857143e-02f, -9.682458366e-02f, -9.682458366e-02f, 0.000000000e+00f, 9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f },
|
{ 7.142857143e-02f, -7.142857143e-02f, 7.142857143e-02f, -7.142857143e-02f, 9.682458366e-02f, -9.682458366e-02f, 0.000000000e+00f, -9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, -3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, 6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f },
|
{ 7.142857143e-02f, 7.142857143e-02f, -7.142857143e-02f, 7.142857143e-02f, 9.682458366e-02f, -9.682458366e-02f, 0.000000000e+00f, -9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, 6.454972244e-02f, 9.045084972e-02f, 0.000000000e+00f, -1.232790000e-02f },
|
{ 7.142857143e-02f, 7.142857143e-02f, -7.142857143e-02f, -7.142857143e-02f, -9.682458366e-02f, -9.682458366e-02f, 0.000000000e+00f, 9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, 8.090169944e-02f, 0.000000000e+00f, 3.090169944e-02f, 6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f },
|
{ 7.142857143e-02f, -7.142857143e-02f, -7.142857143e-02f, 7.142857143e-02f, -9.682458366e-02f, 9.682458366e-02f, 0.000000000e+00f, -9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, 8.090169944e-02f, 0.000000000e+00f, -3.090169944e-02f, -6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f },
|
{ 7.142857143e-02f, -7.142857143e-02f, -7.142857143e-02f, -7.142857143e-02f, 9.682458366e-02f, 9.682458366e-02f, 0.000000000e+00f, 9.682458366e-02f, 0.000000000e+00f, },
|
||||||
{ 5.000000000e-02f, -8.090169944e-02f, 0.000000000e+00f, 3.090169944e-02f, -6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f },
|
|
||||||
{ 5.000000000e-02f, -8.090169944e-02f, 0.000000000e+00f, -3.090169944e-02f, 6.454972244e-02f, 0.000000000e+00f, -5.590169944e-02f, 0.000000000e+00f, -7.216878365e-02f },
|
|
||||||
{ 5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f },
|
|
||||||
{ 5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, -8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f },
|
|
||||||
{ 5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f },
|
|
||||||
{ 5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f },
|
|
||||||
};
|
};
|
||||||
static const float AmbiOrderHFGain1O[MaxAmbiOrder+1]{
|
static const float AmbiOrderHFGain1O[MaxAmbiOrder+1]{
|
||||||
2.000000000e+00f, 1.154700538e+00f
|
/*ENRGY*/ 2.000000000e+00f, 1.154700538e+00f
|
||||||
}, AmbiOrderHFGain2O[MaxAmbiOrder+1]{
|
}, AmbiOrderHFGain2O[MaxAmbiOrder+1]{
|
||||||
|
/*ENRGY 2.357022604e+00f, 1.825741858e+00f, 9.428090416e-01f*/
|
||||||
/*AMP 1.000000000e+00f, 7.745966692e-01f, 4.000000000e-01f*/
|
/*AMP 1.000000000e+00f, 7.745966692e-01f, 4.000000000e-01f*/
|
||||||
/*RMS*/ 9.128709292e-01f, 7.071067812e-01f, 3.651483717e-01f
|
/*RMS*/ 9.128709292e-01f, 7.071067812e-01f, 3.651483717e-01f
|
||||||
/*ENRGY 2.357022604e+00f, 1.825741858e+00f, 9.428090416e-01f*/
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(al::size(AmbiPoints1O) == al::size(AmbiMatrix1O), "First-Order Ambisonic HRTF mismatch");
|
static_assert(al::size(AmbiPoints1O) == al::size(AmbiMatrix1O), "First-Order Ambisonic HRTF mismatch");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user