20 template <
typename T, u
int32 B>
34#if PLATFORM_LITTLE_ENDIAN
35 for (
int32 ByteIndex = 0; ByteIndex <
sizeof(T); ++ByteIndex)
37 for (
int32 ByteIndex =
sizeof(T) - 1; ByteIndex >= 0; --ByteIndex)
40 ValueRaw |= ByteStream[ReadIndex++] << 8 * ByteIndex;
45#if PLATFORM_LITTLE_ENDIAN
46 for (
int32 ByteIndex =
sizeof(T) - 1; ByteIndex >= 0; --ByteIndex)
48 for (
int32 ByteIndex = 0; ByteIndex <
sizeof(T); ++ByteIndex)
51 ValueRaw |= ByteStream[ReadIndex++] << 8 * ByteIndex;
63#if PLATFORM_LITTLE_ENDIAN
64 for (
int32 ByteIndex = 0; ByteIndex <
sizeof(T); ++ByteIndex)
66 for (
int32 ByteIndex =
sizeof(T) - 1; ByteIndex >= 0; --ByteIndex)
69 ByteStream[WriteIndex++] = (
Value >> (8 * ByteIndex)) & 0xFF;
74#if PLATFORM_LITTLE_ENDIAN
75 for (
int32 ByteIndex =
sizeof(T) - 1; ByteIndex >= 0; --ByteIndex)
77 for (
int32 ByteIndex = 0; ByteIndex <
sizeof(T); ++ByteIndex)
80 ByteStream[WriteIndex++] = (
Value >> (8 * ByteIndex)) & 0xFF;
90 if (ReadIndex >= 0 && ReadIndex < NumElements)
93 ReadIndex += IndexStride;
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void WriteToByteStream(T Value, uint8 *ByteStream, int32 &WriteIndex, bool bLittleEndian=true)
Definition Adpcm.h:59
T SignExtend(const T ValueToExtend)
Definition Adpcm.h:21
T ReadFromArray(const T *ElementArray, int32 &ReadIndex, int32 NumElements, int32 IndexStride=1)
Definition Adpcm.h:86
T ReadFromByteStream(const uint8 *ByteStream, int32 &ReadIndex, bool bLittleEndian=true)
Definition Adpcm.h:28
bool DecodeBlock(const uint8 *EncodedADPCMBlock, int32 BlockSize, int16 *DecodedPCMData)
Definition Adpcm.cpp:64