aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
Diffstat (limited to 'alc')
-rw-r--r--alc/panning.cpp61
1 files changed, 28 insertions, 33 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 832fc202..1288197d 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -551,39 +551,37 @@ void InitHrtfPanning(ALCdevice *device)
{ Deg2Rad(-35.264390f), Deg2Rad( 135.000000f) },
};
static const float AmbiMatrix[][MAX_AMBI_CHANNELS]{
- { 3.84615387e-02f, 0.00000000e+00f, 0.00000000e+00f, 8.33950391e-02f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 8.60662966e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -7.49473409e-02f, 0.00000000e+00f, 9.67566016e-02f },
- { 3.84615387e-02f, 0.00000000e+00f, 0.00000000e+00f, -8.33950391e-02f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 8.60662966e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 7.49473409e-02f, 0.00000000e+00f, -9.67566016e-02f },
- { 3.84615387e-02f, 8.33950391e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, -8.60662966e-02f, -9.67566016e-02f, 0.00000000e+00f, -7.49473409e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f },
- { 3.84615387e-02f, -8.33950391e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, -8.60662966e-02f, 9.67566016e-02f, 0.00000000e+00f, 7.49473409e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f },
- { 3.84615379e-02f, 0.00000000e+00f, 8.33950384e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 9.93807988e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 1.22388497e-01f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f },
- { 3.84615379e-02f, 0.00000000e+00f, -8.33950384e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 9.93807988e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -1.22388497e-01f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f },
- { 3.84615383e-02f, 4.53609209e-02f, 4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, 6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f, -3.21963528e-02f, 0.00000000e+00f, 6.23479680e-02f, -1.27267260e-02f, 0.00000000e+00f, -6.90065559e-02f, 0.00000000e+00f },
- { 3.84615383e-02f, 4.53609209e-02f, -4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, -6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f, -3.21963528e-02f, 0.00000000e+00f, 6.23479680e-02f, 1.27267260e-02f, 0.00000000e+00f, 6.90065559e-02f, 0.00000000e+00f },
- { 3.84615383e-02f, -4.53609209e-02f, 4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, -6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f, 3.21963528e-02f, 0.00000000e+00f, -6.23479680e-02f, -1.27267260e-02f, 0.00000000e+00f, -6.90065559e-02f, 0.00000000e+00f },
- { 3.84615383e-02f, -4.53609209e-02f, -4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, 6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f, 3.21963528e-02f, 0.00000000e+00f, -6.23479680e-02f, 1.27267260e-02f, 0.00000000e+00f, 6.90065559e-02f, 0.00000000e+00f },
- { 3.84615383e-02f, 0.00000000e+00f, 4.53609209e-02f, 4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, 6.83467647e-02f, 4.30331483e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -1.27267260e-02f, 6.23479680e-02f, 6.90065559e-02f, 3.21963528e-02f },
- { 3.84615383e-02f, 0.00000000e+00f, -4.53609209e-02f, 4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, -6.83467647e-02f, 4.30331483e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 1.27267260e-02f, 6.23479680e-02f, -6.90065559e-02f, 3.21963528e-02f },
- { 3.84615383e-02f, 0.00000000e+00f, 4.53609209e-02f, -4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, -6.83467647e-02f, 4.30331483e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -1.27267260e-02f, -6.23479680e-02f, 6.90065559e-02f, -3.21963528e-02f },
- { 3.84615383e-02f, 0.00000000e+00f, -4.53609209e-02f, -4.53609209e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, 6.83467647e-02f, 4.30331483e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 1.27267260e-02f, -6.23479680e-02f, -6.90065559e-02f, -3.21963528e-02f },
- { 3.84615387e-02f, 4.53609217e-02f, 0.00000000e+00f, 4.53609217e-02f, 6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f, 5.23190735e-02f, 0.00000000e+00f, -4.67609766e-02f, 0.00000000e+00f, -4.67609766e-02f, 0.00000000e+00f, -5.23190735e-02f },
- { 3.84615387e-02f, -4.53609217e-02f, 0.00000000e+00f, 4.53609217e-02f, -6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f, -5.23190735e-02f, 0.00000000e+00f, 4.67609766e-02f, 0.00000000e+00f, -4.67609766e-02f, 0.00000000e+00f, -5.23190735e-02f },
- { 3.84615387e-02f, 4.53609217e-02f, 0.00000000e+00f, -4.53609217e-02f, -6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f, 5.23190735e-02f, 0.00000000e+00f, -4.67609766e-02f, 0.00000000e+00f, 4.67609766e-02f, 0.00000000e+00f, 5.23190735e-02f },
- { 3.84615387e-02f, -4.53609217e-02f, 0.00000000e+00f, -4.53609217e-02f, 6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f, -5.23190735e-02f, 0.00000000e+00f, 4.67609766e-02f, 0.00000000e+00f, 4.67609766e-02f, 0.00000000e+00f, 5.23190735e-02f },
- { 3.84615385e-02f, 3.33333332e-02f, 3.33333335e-02f, 3.33333332e-02f, 4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f, 2.95742381e-02f, 6.33865691e-02f, 2.29081068e-02f, -3.74087810e-02f, 2.29081068e-02f, 0.00000000e+00f, -2.95742381e-02f },
- { 3.84615385e-02f, 3.33333332e-02f, -3.33333335e-02f, 3.33333332e-02f, 4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f, 2.95742381e-02f, -6.33865691e-02f, 2.29081068e-02f, 3.74087810e-02f, 2.29081068e-02f, 0.00000000e+00f, -2.95742381e-02f },
- { 3.84615385e-02f, -3.33333332e-02f, 3.33333335e-02f, 3.33333332e-02f, -4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f, -2.95742381e-02f, -6.33865691e-02f, -2.29081068e-02f, -3.74087810e-02f, 2.29081068e-02f, 0.00000000e+00f, -2.95742381e-02f },
- { 3.84615385e-02f, -3.33333332e-02f, -3.33333335e-02f, 3.33333332e-02f, -4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f, -2.95742381e-02f, 6.33865691e-02f, -2.29081068e-02f, 3.74087810e-02f, 2.29081068e-02f, 0.00000000e+00f, -2.95742381e-02f },
- { 3.84615385e-02f, 3.33333332e-02f, 3.33333335e-02f, -3.33333332e-02f, -4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f, 2.95742381e-02f, -6.33865691e-02f, 2.29081068e-02f, -3.74087810e-02f, -2.29081068e-02f, 0.00000000e+00f, 2.95742381e-02f },
- { 3.84615385e-02f, 3.33333332e-02f, -3.33333335e-02f, -3.33333332e-02f, -4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f, 2.95742381e-02f, 6.33865691e-02f, 2.29081068e-02f, 3.74087810e-02f, -2.29081068e-02f, 0.00000000e+00f, 2.95742381e-02f },
- { 3.84615385e-02f, -3.33333332e-02f, 3.33333335e-02f, -3.33333332e-02f, 4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f, -2.95742381e-02f, 6.33865691e-02f, -2.29081068e-02f, -3.74087810e-02f, -2.29081068e-02f, 0.00000000e+00f, 2.95742381e-02f },
- { 3.84615385e-02f, -3.33333332e-02f, -3.33333335e-02f, -3.33333332e-02f, 4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f, -2.95742381e-02f, -6.33865691e-02f, -2.29081068e-02f, 3.74087810e-02f, -2.29081068e-02f, 0.00000000e+00f, 2.95742381e-02f },
+ { 3.84615387e-02f, 0.00000000e+00f, 0.00000000e+00f, 6.66173389e-02f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 8.60662966e-02f },
+ { 3.84615387e-02f, 0.00000000e+00f, 0.00000000e+00f, -6.66173389e-02f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 8.60662966e-02f },
+ { 3.84615387e-02f, 6.66173389e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, -8.60662966e-02f },
+ { 3.84615387e-02f, -6.66173389e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, -8.60662966e-02f },
+ { 3.84615379e-02f, 0.00000000e+00f, 6.66173384e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 9.93807988e-02f, 0.00000000e+00f, 0.00000000e+00f },
+ { 3.84615379e-02f, 0.00000000e+00f, -6.66173384e-02f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f, 9.93807988e-02f, 0.00000000e+00f, 0.00000000e+00f },
+ { 3.84615383e-02f, 4.71055721e-02f, 4.71055717e-02f, 0.00000000e+00f, 0.00000000e+00f, 6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f },
+ { 3.84615383e-02f, 4.71055721e-02f, -4.71055717e-02f, 0.00000000e+00f, 0.00000000e+00f, -6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f },
+ { 3.84615383e-02f, -4.71055721e-02f, 4.71055717e-02f, 0.00000000e+00f, 0.00000000e+00f, -6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f },
+ { 3.84615383e-02f, -4.71055721e-02f, -4.71055717e-02f, 0.00000000e+00f, 0.00000000e+00f, 6.83467647e-02f, 2.48451995e-02f, 0.00000000e+00f, -4.30331483e-02f },
+ { 3.84615383e-02f, 0.00000000e+00f, 4.71055717e-02f, 4.71055721e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, 6.83467647e-02f, 4.30331483e-02f },
+ { 3.84615383e-02f, 0.00000000e+00f, -4.71055717e-02f, 4.71055721e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, -6.83467647e-02f, 4.30331483e-02f },
+ { 3.84615383e-02f, 0.00000000e+00f, 4.71055717e-02f, -4.71055721e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, -6.83467647e-02f, 4.30331483e-02f },
+ { 3.84615383e-02f, 0.00000000e+00f, -4.71055717e-02f, -4.71055721e-02f, 0.00000000e+00f, 0.00000000e+00f, 2.48451995e-02f, 6.83467647e-02f, 4.30331483e-02f },
+ { 3.84615387e-02f, 4.71055721e-02f, 0.00000000e+00f, 4.71055721e-02f, 6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f },
+ { 3.84615387e-02f, -4.71055721e-02f, 0.00000000e+00f, 4.71055721e-02f, -6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f },
+ { 3.84615387e-02f, 4.71055721e-02f, 0.00000000e+00f, -4.71055721e-02f, -6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f },
+ { 3.84615387e-02f, -4.71055721e-02f, 0.00000000e+00f, -4.71055721e-02f, 6.83467654e-02f, 0.00000000e+00f, -4.96903997e-02f, 0.00000000e+00f, 0.00000000e+00f },
+ { 3.84615385e-02f, 3.84615384e-02f, 3.84615386e-02f, 3.84615384e-02f, 4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, 3.84615384e-02f, -3.84615386e-02f, 3.84615384e-02f, 4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, -3.84615384e-02f, 3.84615386e-02f, 3.84615384e-02f, -4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, -3.84615384e-02f, -3.84615386e-02f, 3.84615384e-02f, -4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, 3.84615384e-02f, 3.84615386e-02f, -3.84615384e-02f, -4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, 3.84615384e-02f, -3.84615386e-02f, -3.84615384e-02f, -4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, -3.84615384e-02f, 3.84615386e-02f, -3.84615384e-02f, 4.55645099e-02f, -4.55645100e-02f, 0.00000000e+00f, -4.55645100e-02f, 0.00000000e+00f },
+ { 3.84615385e-02f, -3.84615384e-02f, -3.84615386e-02f, -3.84615384e-02f, 4.55645099e-02f, 4.55645100e-02f, 0.00000000e+00f, 4.55645100e-02f, 0.00000000e+00f },
};
static const float AmbiOrderHFGain1O[MAX_AMBI_ORDER+1]{
3.60555128e+00f, 2.08166600e+00f
}, AmbiOrderHFGain2O[MAX_AMBI_ORDER+1]{
2.68741925e+00f, 2.08166600e+00f, 1.07496770e+00f
- }, AmbiOrderHFGain3O[MAX_AMBI_ORDER+1]{
- 2.12652604e+00f, 1.83122879e+00f, 1.30214339e+00f, 6.48052398e-01f
};
static const ALuint ChansPerOrder[MAX_AMBI_ORDER+1]{ 1, 3, 5, 7 };
const float *AmbiOrderHFGain{AmbiOrderHFGain1O};
@@ -606,11 +604,10 @@ void InitHrtfPanning(ALCdevice *device)
{ "full", HrtfRender, 1 },
{ "ambi1", NormalRender, 1 },
{ "ambi2", NormalRender, 2 },
- { "ambi3", NormalRender, 3 },
};
const char *mode{modeopt->c_str()};
- if(al::strcasecmp(mode, "basic") == 0)
+ if(al::strcasecmp(mode, "basic") == 0 || al::strcasecmp(mode, "ambi3") == 0)
{
ERR("HRTF mode \"%s\" deprecated, substituting \"%s\"\n", mode, "ambi2");
mode = "ambi2";
@@ -635,9 +632,7 @@ void InitHrtfPanning(ALCdevice *device)
(device->mRenderMode == HrtfRender) ? "+ Full " : "",
device->HrtfName.c_str());
- if(ambi_order >= 3)
- AmbiOrderHFGain = AmbiOrderHFGain3O;
- else if(ambi_order == 2)
+ if(ambi_order >= 2)
AmbiOrderHFGain = AmbiOrderHFGain2O;
else if(ambi_order == 1)
AmbiOrderHFGain = AmbiOrderHFGain1O;