diff options
Diffstat (limited to 'core/buffer_storage.h')
-rw-r--r-- | core/buffer_storage.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/buffer_storage.h b/core/buffer_storage.h index ec934681..a4d1b289 100644 --- a/core/buffer_storage.h +++ b/core/buffer_storage.h @@ -18,6 +18,7 @@ enum FmtType : unsigned char { FmtDouble, FmtMulaw, FmtAlaw, + FmtIMA4, }; enum FmtChannels : unsigned char { FmtMono, @@ -83,6 +84,7 @@ struct BufferStorage { FmtChannels mChannels{FmtMono}; FmtType mType{FmtShort}; uint mSampleLen{0u}; + uint mBlockAlign{0u}; AmbiLayout mAmbiLayout{AmbiLayout::FuMa}; AmbiScaling mAmbiScaling{AmbiScaling::FuMa}; @@ -93,6 +95,12 @@ struct BufferStorage { { return ChannelsFromFmt(mChannels, mAmbiOrder); } inline uint frameSizeFromFmt() const noexcept { return channelsFromFmt() * bytesFromFmt(); } + inline uint blockSizeFromFmt() const noexcept + { + if(mType == FmtIMA4) return ((mBlockAlign-1)/2 + 4) * channelsFromFmt(); + return frameSizeFromFmt(); + }; + inline bool isBFormat() const noexcept { return IsBFormat(mChannels); } }; |