1 #ifndef CORE_STORAGE_FORMATS_H
2 #define CORE_STORAGE_FORMATS_H
4 using uint
= unsigned int;
7 enum FmtType
: unsigned char {
18 enum FmtChannels
: unsigned char {
23 FmtX51
, /* (WFX order) */
24 FmtX61
, /* (WFX order) */
25 FmtX71
, /* (WFX order) */
28 FmtUHJ2
, /* 2-channel UHJ, aka "BHJ", stereo-compatible */
29 FmtUHJ3
, /* 3-channel UHJ, aka "THJ" */
30 FmtUHJ4
, /* 4-channel UHJ, aka "PHJ" */
31 FmtSuperStereo
, /* Stereo processed with Super Stereo. */
32 FmtMonoDup
, /* Mono duplicated for left/right separation */
35 enum class AmbiLayout
: unsigned char {
39 enum class AmbiScaling
: unsigned char {
46 const char *NameFromFormat(FmtType type
) noexcept
;
47 const char *NameFromFormat(FmtChannels channels
) noexcept
;
49 uint
BytesFromFmt(FmtType type
) noexcept
;
50 uint
ChannelsFromFmt(FmtChannels chans
, uint ambiorder
) noexcept
;
51 inline uint
FrameSizeFromFmt(FmtChannels chans
, FmtType type
, uint ambiorder
) noexcept
52 { return ChannelsFromFmt(chans
, ambiorder
) * BytesFromFmt(type
); }
54 #endif /* CORE_STORAGE_FORMATS_H */