diff options
author | Chris Robinson <[email protected]> | 2022-01-01 00:10:21 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-01-01 00:10:21 -0800 |
commit | a271484e7c5056a868767a344e63f8f3feb9437e (patch) | |
tree | 998b0449dca744f1b53d732b1b01d39c23136e87 /core/voice.cpp | |
parent | 1337f050dd3654a80403967434939584c87b62e9 (diff) |
Pass a span of pointers to the UHJ/SuperStereo decoder
Diffstat (limited to 'core/voice.cpp')
-rw-r--r-- | core/voice.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/voice.cpp b/core/voice.cpp index 924a8446..424184af 100644 --- a/core/voice.cpp +++ b/core/voice.cpp @@ -53,6 +53,7 @@ struct CopyTag; static_assert(!(sizeof(DeviceBase::MixerBufferLine)&15), "DeviceBase::MixerBufferLine must be a multiple of 16 bytes"); +static_assert(!(MaxResamplerEdge&3), "MaxResamplerEdge is not a multiple of 4"); Resampler ResamplerDefault{Resampler::Linear}; @@ -627,9 +628,13 @@ void Voice::mix(const State vstate, ContextBase *Context, const uint SamplesToDo if(mDecoder) { + std::array<float*,DeviceBase::MixerChannelsMax> chanptrs; + std::transform(MixingSamples.begin(), MixingSamples.end(), chanptrs.begin(), + [](DeviceBase::MixerBufferLine &bufline) noexcept -> float* + { return bufline.data() + MaxResamplerEdge; }); const size_t srcOffset{(increment*DstBufferSize + DataPosFrac)>>MixerFracBits}; SrcBufferSize = SrcBufferSize - PostPadding + MaxResamplerEdge; - ((*mDecoder).*mDecoderFunc)(MixingSamples, MaxResamplerEdge, SrcBufferSize, + ((*mDecoder).*mDecoderFunc)({chanptrs.data(), MixingSamples.size()}, SrcBufferSize, srcOffset * likely(vstate == Playing)); } } |