diff options
Diffstat (limited to 'core/converter.h')
-rw-r--r-- | core/converter.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/core/converter.h b/core/converter.h index 49ca124d..3dc2babb 100644 --- a/core/converter.h +++ b/core/converter.h @@ -7,6 +7,7 @@ #include "almalloc.h" #include "devformat.h" +#include "flexarray.h" #include "mixer/defs.h" using uint = unsigned int; @@ -25,22 +26,22 @@ struct SampleConverter { InterpState mState{}; ResamplerFunc mResample{}; - alignas(16) float mSrcSamples[BufferLineSize]{}; - alignas(16) float mDstSamples[BufferLineSize]{}; + alignas(16) FloatBufferLine mSrcSamples{}; + alignas(16) FloatBufferLine mDstSamples{}; struct ChanSamples { - alignas(16) float PrevSamples[MaxResamplerPadding]; + alignas(16) std::array<float,MaxResamplerPadding> PrevSamples; }; al::FlexArray<ChanSamples> mChan; SampleConverter(size_t numchans) : mChan{numchans} { } - uint convert(const void **src, uint *srcframes, void *dst, uint dstframes); - uint convertPlanar(const void **src, uint *srcframes, void *const*dst, uint dstframes); - uint availableOut(uint srcframes) const; + [[nodiscard]] auto convert(const void **src, uint *srcframes, void *dst, uint dstframes) -> uint; + [[nodiscard]] auto convertPlanar(const void **src, uint *srcframes, void *const*dst, uint dstframes) -> uint; + [[nodiscard]] auto availableOut(uint srcframes) const -> uint; using SampleOffset = std::chrono::duration<int64_t, std::ratio<1,MixerFracOne>>; - SampleOffset currentInputDelay() const noexcept + [[nodiscard]] auto currentInputDelay() const noexcept -> SampleOffset { const int64_t prep{int64_t{mSrcPrepCount} - MaxResamplerEdge}; return SampleOffset{(prep<<MixerFracBits) + mFracOffset}; @@ -59,7 +60,7 @@ struct ChannelConverter { uint mChanMask{}; DevFmtChannels mDstChans{}; - bool is_active() const noexcept { return mChanMask != 0; } + [[nodiscard]] auto is_active() const noexcept -> bool { return mChanMask != 0; } void convert(const void *src, float *dst, uint frames) const; }; |