diff options
author | Chris Robinson <[email protected]> | 2020-01-04 00:59:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-01-04 00:59:49 -0800 |
commit | cdd24c7d010a18de26b8c1d20a71a12a7db7aafe (patch) | |
tree | a034ae7ff02127789004ff96070de3278d3f8187 /alc/hrtf.cpp | |
parent | 462bcd4ab7ba1603bef159ec48dc995045ced036 (diff) |
Combine identical arrays
Diffstat (limited to 'alc/hrtf.cpp')
-rw-r--r-- | alc/hrtf.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp index 0d4bf393..e8128cfe 100644 --- a/alc/hrtf.cpp +++ b/alc/hrtf.cpp @@ -292,9 +292,6 @@ void BuildBFormatHrtf(const HrtfStore *Hrtf, DirectHrtfState *state, ALuint ldelay, rdelay; }; - static const int OrderFromChan[MAX_AMBI_CHANNELS]{ - 0, 1,1,1, 2,2,2,2,2, 3,3,3,3,3,3,3, - }; /* Set this to true for dual-band HRTF processing. May require better * calculation of the new IR length to deal with the head and tail * generated by the HF scaling. @@ -384,7 +381,8 @@ void BuildBFormatHrtf(const HrtfStore *Hrtf, DirectHrtfState *state, /* For single-band decoding, apply the HF scale to the response. */ for(size_t i{0u};i < state->Coeffs.size();++i) { - const double mult{double{AmbiOrderHFGain[OrderFromChan[i]]} * AmbiMatrix[c][i]}; + const size_t order{AmbiIndex::OrderFromChannel[i]}; + const double mult{double{AmbiOrderHFGain[order]} * AmbiMatrix[c][i]}; const ALuint numirs{HRIR_LENGTH - maxu(ldelay, rdelay)}; ALuint lidx{ldelay}, ridx{rdelay}; for(ALuint j{0};j < numirs;++j) @@ -425,7 +423,7 @@ void BuildBFormatHrtf(const HrtfStore *Hrtf, DirectHrtfState *state, for(size_t i{0u};i < state->Coeffs.size();++i) { const ALdouble mult{AmbiMatrix[c][i]}; - const ALdouble hfgain{AmbiOrderHFGain[OrderFromChan[i]]}; + const ALdouble hfgain{AmbiOrderHFGain[AmbiIndex::OrderFromChannel[i]]}; ALuint j{HRIR_LENGTH*3 - ldelay}; for(ALuint lidx{0};lidx < HRIR_LENGTH;++lidx,++j) tmpres[i][lidx][0] += (tmpflt[0][j]*hfgain + tmpflt[1][j]) * mult; @@ -445,7 +443,7 @@ void BuildBFormatHrtf(const HrtfStore *Hrtf, DirectHrtfState *state, for(size_t i{0u};i < state->Coeffs.size();++i) { const ALdouble mult{AmbiMatrix[c][i]}; - const ALdouble hfgain{AmbiOrderHFGain[OrderFromChan[i]]}; + const ALdouble hfgain{AmbiOrderHFGain[AmbiIndex::OrderFromChannel[i]]}; ALuint j{HRIR_LENGTH*3 - rdelay}; for(ALuint ridx{0};ridx < HRIR_LENGTH;++ridx,++j) tmpres[i][ridx][1] += (tmpflt[0][j]*hfgain + tmpflt[1][j]) * mult; |