31 template <
typename InputSource,
typename OutputSampleType,
typename ContextType>
41 static_assert(std::is_integral<InputSampleType>::value,
"Input sample type must be integral.");
42 static_assert(std::is_integral<OutputSampleType>::value,
"Output sample type must be integral.");
43 static_assert(std::is_signed<InputSampleType>::value == std::is_signed<OutputSampleType>::value,
"Input sample type and output sample type must have the same signedness.");
44 static_assert(
sizeof(
InputSampleType) <
sizeof(OutputSampleType),
"Output sample type must be larger than the input sample type.");
47 static constexpr
size_t SampleRate = InputSource::SampleRate;
66 size_t bitsToShift = (
sizeof(OutputSampleType) -
sizeof(
InputSampleType)) * 8;
67 return static_cast<OutputSampleType
>(
mInputSource[index]) << static_cast<OutputSampleType>(bitsToShift);
Definition: increasebitdepthoperator.h:32
typename InputSource::SampleType InputSampleType
Definition: increasebitdepthoperator.h:40
IncreaseBitDepthOperator(ContextType &context)
Definition: increasebitdepthoperator.h:35
OutputSampleType SampleType
Definition: increasebitdepthoperator.h:46
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
#define assert(expr)
Definition: assertion.h:47
Definition: dsputilities.h:60
SampleType operator[](size_t index) const
Definition: increasebitdepthoperator.h:61
InputSource mInputSource
Definition: increasebitdepthoperator.h:71
InputSource & GetInputSource()
Definition: increasebitdepthoperator.h:49
SampleRange GetSampleRange() const
Definition: increasebitdepthoperator.h:55
static constexpr size_t SampleRate
Definition: increasebitdepthoperator.h:47