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

Function bitmapFromData

Source/ThirdParty/tinyexr.h:3168–3188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3166const int BITMAP_SIZE = (USHORT_RANGE >> 3);
3167
3168static void bitmapFromData(const unsigned short data[/*nData*/], int nData,
3169 unsigned char bitmap[BITMAP_SIZE],
3170 unsigned short &minNonZero,
3171 unsigned short &maxNonZero) {
3172 for (int i = 0; i < BITMAP_SIZE; ++i) bitmap[i] = 0;
3173
3174 for (int i = 0; i < nData; ++i) bitmap[data[i] >> 3] |= (1 << (data[i] & 7));
3175
3176 bitmap[0] &= ~1; // zero is not explicitly stored in
3177 // the bitmap; we assume that the
3178 // data always contain zeroes
3179 minNonZero = BITMAP_SIZE - 1;
3180 maxNonZero = 0;
3181
3182 for (int i = 0; i < BITMAP_SIZE; ++i) {
3183 if (bitmap[i]) {
3184 if (minNonZero > i) minNonZero = i;
3185 if (maxNonZero < i) maxNonZero = i;
3186 }
3187 }
3188}
3189
3190static unsigned short forwardLutFromBitmap(
3191 const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {

Callers 1

CompressPizFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected