MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__high_bit

Function stbi__high_bit

include/stb/stb_image.h:5370–5380  ·  view source on GitHub ↗

returns 0..31 for the highest set bit

Source from the content-addressed store, hash-verified

5368
5369// returns 0..31 for the highest set bit
5370static int stbi__high_bit(unsigned int z)
5371{
5372 int n=0;
5373 if (z == 0) return -1;
5374 if (z >= 0x10000) { n += 16; z >>= 16; }
5375 if (z >= 0x00100) { n += 8; z >>= 8; }
5376 if (z >= 0x00010) { n += 4; z >>= 4; }
5377 if (z >= 0x00004) { n += 2; z >>= 2; }
5378 if (z >= 0x00002) { n += 1;/* >>= 1;*/ }
5379 return n;
5380}
5381
5382static int stbi__bitcount(unsigned int a)
5383{

Callers 1

stbi__bmp_loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected