20 #ifndef MPD_PCM_SHIFT_CONVERT_HXX 21 #define MPD_PCM_SHIFT_CONVERT_HXX 36 typedef typename SrcTraits::value_type
SV;
37 typedef typename DstTraits::value_type
DV;
39 static_assert(SrcTraits::BITS < DstTraits::BITS,
40 "Source format must be smaller than destination format");
43 return DV(src) << (DstTraits::BITS - SrcTraits::BITS);
58 typedef typename SrcTraits::value_type
SV;
59 typedef typename DstTraits::value_type
DV;
61 static_assert(SrcTraits::BITS > DstTraits::BITS,
62 "Source format must be smaller than destination format");
65 return src >> (SrcTraits::BITS - DstTraits::BITS);
This template describes the specified SampleFormat.
Convert from one integer sample format to another by shifting bits to the right.
static constexpr DV Convert(SV src)
Convert from one integer sample format to another by shifting bits to the left.
static constexpr DV Convert(SV src)