diff options
author | Chris Robinson <[email protected]> | 2021-03-31 09:37:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-03-31 09:37:30 -0700 |
commit | 35a0f2665f834c107e39ec2dcfc3d9ae0a0b33ce (patch) | |
tree | 5e889ba0dfb6664b9035c856b333f79c5aeecb88 /alc/voice.h | |
parent | 8793055e666d2019dd48422c2e4ece1d3118e2f7 (diff) |
Decode UHJ buffers to B-Format for mixing
This should also have an adjustment for the shelf filter. Although it's not
clear what the appropriate adjustments should be.
Diffstat (limited to 'alc/voice.h')
-rw-r--r-- | alc/voice.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/alc/voice.h b/alc/voice.h index 96975efa..8f3476f1 100644 --- a/alc/voice.h +++ b/alc/voice.h @@ -15,6 +15,7 @@ #include "core/filters/splitter.h" #include "core/mixer/defs.h" #include "core/mixer/hrtfdefs.h" +#include "core/uhjfilter.h" #include "vector.h" struct ALCcontext; @@ -37,6 +38,12 @@ enum class DirectMode : unsigned char { }; +/* Maximum number of extra source samples that may need to be loaded, for + * resampling or conversion purposes. + */ +constexpr uint MaxPostVoiceLoad{MaxResamplerEdge + UhjDecoder::sFilterDelay}; + + enum { AF_None = 0, AF_LowPass = 1, @@ -191,11 +198,13 @@ struct Voice { FmtChannels mFmtChannels; FmtType mFmtType; uint mFrequency; - uint mSampleSize; + uint mFrameSize; AmbiLayout mAmbiLayout; AmbiScaling mAmbiScaling; uint mAmbiOrder; + std::unique_ptr<UhjDecoder> mDecoder; + /** Current target parameters used for mixing. */ uint mStep{0}; @@ -218,7 +227,9 @@ struct Voice { * now current (which may be overwritten if the buffer data is still * available). */ - using BufferLine = std::array<float,BufferLineSize+MaxResamplerPadding>; + static constexpr size_t LineSize{BufferLineSize + MaxResamplerPadding + + UhjDecoder::sFilterDelay}; + using BufferLine = std::array<float,LineSize>; al::vector<BufferLine,16> mVoiceSamples{2}; struct ChannelData { |