MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / UnpackB44FlatBlock

Function UnpackB44FlatBlock

Source/ThirdParty/tinyexr.h:3859–3873  ·  view source on GitHub ↗

Unpack a 3-byte flat block (all pixels same value)

Source from the content-addressed store, hash-verified

3857
3858// Unpack a 3-byte flat block (all pixels same value)
3859static void UnpackB44FlatBlock(unsigned short dst[16], const unsigned char src[3]) {
3860 unsigned short t = (static_cast<unsigned short>(src[0]) << 8) | src[1];
3861
3862 // Convert from ordered-magnitude to half-float
3863 unsigned short h;
3864 if (t & 0x8000) {
3865 h = t & 0x7fff;
3866 } else {
3867 h = ~t;
3868 }
3869
3870 for (int i = 0; i < 16; i++) {
3871 dst[i] = h;
3872 }
3873}
3874
3875static bool DecompressB44(unsigned char *outPtr, size_t outBufSize,
3876 const unsigned char *inPtr, size_t inLen,

Callers 1

DecompressB44Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected