MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__bitreverse16

Function stbi__bitreverse16

lite/example/cpp_example/mge/cv/stb_image.h:4443–4449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4441} stbi__zhuffman;
4442
4443stbi_inline static int stbi__bitreverse16(int n) {
4444 n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
4445 n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
4446 n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
4447 n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
4448 return n;
4449}
4450
4451stbi_inline static int stbi__bit_reverse(int v, int bits) {
4452 STBI_ASSERT(bits <= 16);

Callers 1

stbi__bit_reverseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected