diff options
-rw-r--r-- | Alc/hrtf.c | 40 |
1 files changed, 14 insertions, 26 deletions
@@ -158,23 +158,21 @@ ALuint BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH][ { DEG2RAD(-90.0f), DEG2RAD( 0.0f) }, }; static const ALfloat Ambi3DMatrix[14][2][MAX_AMBI_COEFFS] = { - { { 0.078851598f, 0.000000000f, 0.070561967f, 0.000000000f }, { 0.0714285714f, 0.0000000000f, 0.1237180798f, 0.0000000000f } }, - { { 0.124051278f, 0.059847972f, 0.059847972f, 0.059847972f }, { 0.0714285714f, 0.0714285714f, 0.0714285714f, 0.0714285714f } }, - { { 0.124051278f, -0.059847972f, 0.059847972f, 0.059847972f }, { 0.0714285714f, -0.0714285714f, 0.0714285714f, 0.0714285714f } }, - { { 0.124051278f, -0.059847972f, 0.059847972f, -0.059847972f }, { 0.0714285714f, -0.0714285714f, 0.0714285714f, -0.0714285714f } }, - { { 0.124051278f, 0.059847972f, 0.059847972f, -0.059847972f }, { 0.0714285714f, 0.0714285714f, 0.0714285714f, -0.0714285714f } }, - { { 0.078851598f, 0.000000000f, 0.000000000f, 0.070561967f }, { 0.0714285714f, 0.0000000000f, 0.0000000000f, 0.1237180798f } }, - { { 0.078851598f, -0.070561967f, 0.000000000f, 0.000000000f }, { 0.0714285714f, -0.1237180798f, 0.0000000000f, 0.0000000000f } }, - { { 0.078851598f, 0.000000000f, 0.000000000f, -0.070561967f }, { 0.0714285714f, 0.0000000000f, 0.0000000000f, -0.1237180798f } }, - { { 0.078851598f, 0.070561967f, 0.000000000f, 0.000000000f }, { 0.0714285714f, 0.1237180798f, 0.0000000000f, 0.0000000000f } }, - { { 0.124051278f, 0.059847972f, -0.059847972f, 0.059847972f }, { 0.0714285714f, 0.0714285714f, -0.0714285714f, 0.0714285714f } }, - { { 0.124051278f, -0.059847972f, -0.059847972f, 0.059847972f }, { 0.0714285714f, -0.0714285714f, -0.0714285714f, 0.0714285714f } }, - { { 0.124051278f, -0.059847972f, -0.059847972f, -0.059847972f }, { 0.0714285714f, -0.0714285714f, -0.0714285714f, -0.0714285714f } }, - { { 0.124051278f, 0.059847972f, -0.059847972f, -0.059847972f }, { 0.0714285714f, 0.0714285714f, -0.0714285714f, -0.0714285714f } }, - { { 0.078851598f, 0.000000000f, -0.070561967f, 0.000000000f }, { 0.0714285714f, 0.0000000000f, -0.1237180798f, 0.0000000000f } }, + { { 0.1889822365f, 0.0000000000f, 0.1889822365f, 0.0000000000f }, { 0.0714285714f, 0.0000000000f, 0.1237180798f, 0.0000000000f } }, + { { 0.1889822365f, 0.1091089451f, 0.1091089451f, 0.1091089451f }, { 0.0714285714f, 0.0714285714f, 0.0714285714f, 0.0714285714f } }, + { { 0.1889822365f, -0.1091089451f, 0.1091089451f, 0.1091089451f }, { 0.0714285714f, -0.0714285714f, 0.0714285714f, 0.0714285714f } }, + { { 0.1889822365f, -0.1091089451f, 0.1091089451f, -0.1091089451f }, { 0.0714285714f, -0.0714285714f, 0.0714285714f, -0.0714285714f } }, + { { 0.1889822365f, 0.1091089451f, 0.1091089451f, -0.1091089451f }, { 0.0714285714f, 0.0714285714f, 0.0714285714f, -0.0714285714f } }, + { { 0.1889822365f, 0.0000000000f, 0.0000000000f, 0.1889822365f }, { 0.0714285714f, 0.0000000000f, 0.0000000000f, 0.1237180798f } }, + { { 0.1889822365f, -0.1889822365f, 0.0000000000f, 0.0000000000f }, { 0.0714285714f, -0.1237180798f, 0.0000000000f, 0.0000000000f } }, + { { 0.1889822365f, 0.0000000000f, 0.0000000000f, -0.1889822365f }, { 0.0714285714f, 0.0000000000f, 0.0000000000f, -0.1237180798f } }, + { { 0.1889822365f, 0.1889822365f, 0.0000000000f, 0.0000000000f }, { 0.0714285714f, 0.1237180798f, 0.0000000000f, 0.0000000000f } }, + { { 0.1889822365f, 0.1091089451f, -0.1091089451f, 0.1091089451f }, { 0.0714285714f, 0.0714285714f, -0.0714285714f, 0.0714285714f } }, + { { 0.1889822365f, -0.1091089451f, -0.1091089451f, 0.1091089451f }, { 0.0714285714f, -0.0714285714f, -0.0714285714f, 0.0714285714f } }, + { { 0.1889822365f, -0.1091089451f, -0.1091089451f, -0.1091089451f }, { 0.0714285714f, -0.0714285714f, -0.0714285714f, -0.0714285714f } }, + { { 0.1889822365f, 0.1091089451f, -0.1091089451f, -0.1091089451f }, { 0.0714285714f, 0.0714285714f, -0.0714285714f, -0.0714285714f } }, + { { 0.1889822365f, 0.0000000000f, -0.1889822365f, 0.0000000000f }, { 0.0714285714f, 0.0000000000f, -0.1237180798f, 0.0000000000f } }, }; -#define AMBIHF_GAIN 1.0f -#define AMBILF_GAIN 0.553914423f /* -5.13dB */ /* Change this to 2 for dual-band HRTF processing. May require a higher quality * band-splitter, or better calculation of the new IR length to deal with the @@ -236,11 +234,6 @@ ALuint BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH][ for(i = 0;i < Hrtf->irSize;i++) temps[2][i] = fir[i] / 32767.0f; bandsplit_process(&splitter, temps[0], temps[1], temps[2], HRIR_LENGTH); - /* Scale the low and high frequency responses. */ - for(i = 0;i < HRIR_LENGTH;i++) - temps[0][i] *= AMBIHF_GAIN; - for(i = 0;i < HRIR_LENGTH;i++) - temps[1][i] *= AMBILF_GAIN; } /* Add to the left output coefficients with the specified delay. */ @@ -270,11 +263,6 @@ ALuint BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH][ for(i = 0;i < Hrtf->irSize;i++) temps[2][i] = fir[i] / 32767.0f; bandsplit_process(&splitter, temps[0], temps[1], temps[2], HRIR_LENGTH); - /* Scale the low and high frequency responses. */ - for(i = 0;i < HRIR_LENGTH;i++) - temps[0][i] *= AMBIHF_GAIN; - for(i = 0;i < HRIR_LENGTH;i++) - temps[1][i] *= AMBILF_GAIN; } /* Add to the right output coefficients with the specified delay. */ |