diff options
-rw-r--r-- | Alc/hrtf.c | 14 | ||||
-rw-r--r-- | Alc/panning.c | 4 |
2 files changed, 7 insertions, 11 deletions
@@ -204,7 +204,6 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N BandSplitter splitter; ALsizei idx[HRTF_AMBI_MAX_CHANNELS]; ALsizei min_delay = HRTF_HISTORY_LENGTH; - ALsizei max_delay = 0; ALfloat temps[3][HRIR_LENGTH]; ALsizei max_length = 0; ALsizei i, c, b; @@ -229,6 +228,8 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N /* Calculate indices for left and right channels. */ idx[c] = evoffset + azidx; + + min_delay = mini(min_delay, mini(Hrtf->delays[idx[c]][0], Hrtf->delays[idx[c]][1])); } memset(temps, 0, sizeof(temps)); @@ -236,12 +237,8 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N for(c = 0;c < AmbiCount;c++) { const ALfloat (*fir)[2] = &Hrtf->coeffs[idx[c] * Hrtf->irSize]; - const ALsizei res_delay = mini(Hrtf->delays[idx[c]][0], Hrtf->delays[idx[c]][1]); - ALsizei ldelay = Hrtf->delays[idx[c]][0] - res_delay; - ALsizei rdelay = Hrtf->delays[idx[c]][1] - res_delay; - - min_delay = mini(min_delay, res_delay); - max_delay = maxi(max_delay, res_delay); + ALsizei ldelay = Hrtf->delays[idx[c]][0] - min_delay; + ALsizei rdelay = Hrtf->delays[idx[c]][1] - min_delay; max_length = maxi(max_length, mini(maxi(ldelay, rdelay) + Hrtf->irSize, HRIR_LENGTH) @@ -311,8 +308,7 @@ void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei N max_length += MOD_IR_SIZE-1; max_length -= max_length%MOD_IR_SIZE; - TRACE("Skipped delay min: %d, max: %d, new FIR length: %d\n", min_delay, max_delay, - max_length); + TRACE("Skipped delay: %d, new FIR length: %d\n", min_delay, max_length); state->IrSize = max_length; #undef NUM_BANDS } diff --git a/Alc/panning.c b/Alc/panning.c index 7ed27852..774fa4b1 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -872,9 +872,9 @@ static void InitHrtfPanning(ALCdevice *device) { 5.55555556e-02f, 0.00000000e+00f, -1.23717915e-01f, 0.00000000e+00f, 0.00000000e+00f, 0.00000000e+00f }, }; static const ALfloat AmbiOrderHFGainFOA[MAX_AMBI_ORDER+1] = { - 1.00000000e+00f, 5.77350269e-01f + 3.00000000e+00f, 1.73205081e+00f }, AmbiOrderHFGainHOA[MAX_AMBI_ORDER+1] = { - 9.80580676e-01f, 7.59554525e-01f, 3.92232270e-01f + 2.40192231e+00f, 1.86052102e+00f, 9.60768923e-01f }; static const ALsizei IndexMap[6] = { 0, 1, 2, 3, 4, 8 }; const ALfloat (*restrict AmbiMatrix)[MAX_AMBI_COEFFS] = AmbiMatrixFOA; |