aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-04-16 18:51:01 -0700
committerChris Robinson <[email protected]>2018-04-16 18:54:41 -0700
commite619b641750a00e188a067376ffebdc8d24da126 (patch)
tree8d2c24b62c65639c163ec8b85bdc7c8414ef4e1c /Alc/hrtf.c
parent795ed65797016a286c38587f772d824afda493a2 (diff)
Don't minimize the HRTF per-response delay
The reverts both fa9ab9af7cb559ff9ecc1846f2996265bfbea1ec and 79604c3c0e0f3f71832a09348cc273a38882cc3e. As helpful as it was for the high frequencies, the overall response's gain suffered.
Diffstat (limited to 'Alc/hrtf.c')
-rw-r--r--Alc/hrtf.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index e0323146..3523bf34 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -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
}