# HG changeset patch # User Matti Hamalainen # Date 1425171612 -7200 # Node ID 4a68f8d0adc58cd250e0aac2d5690a385b3ee16e # Parent cd0e0270e1cef8a6cb3bae66a4ec0d27beaf85d5 Rename bitreverse functions. diff -r cd0e0270e1ce -r 4a68f8d0adc5 src/dmzlib.c --- a/src/dmzlib.c Sun Mar 01 02:58:53 2015 +0200 +++ b/src/dmzlib.c Sun Mar 01 03:00:12 2015 +0200 @@ -37,7 +37,7 @@ } -static inline int stbi__bit_reverse_16(int n) +static inline int dmBitReverse16(int n) { n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); @@ -47,12 +47,12 @@ } -static inline int stbi__bit_reverse_n(int v, int bits) +static inline int dmBitReverseN(int v, int bits) { DMSTBI_ASSERT(bits <= 16); // to bit reverse n bits, reverse 16 and shift // e.g. 11 bits, bit reverse and shift away 5 - return stbi__bit_reverse_16(v) >> (16 - bits); + return dmBitReverse16(v) >> (16 - bits); } @@ -109,7 +109,7 @@ ctx->value[c] = (Uint16) i; if (s <= STBI__ZFAST_BITS) { - int k = stbi__bit_reverse_n(next_code[s], s); + int k = dmBitReverseN(next_code[s], s); while (k < STBI__ZFAST_SIZE) { ctx->fast[k] = fastv; @@ -167,7 +167,7 @@ // not resolved by fast table, so compute it the slow way // use jpeg approach, which requires MSbits at top - k = stbi__bit_reverse_16(ctx->codeBuffer); + k = dmBitReverse16(ctx->codeBuffer); for (s = STBI__ZFAST_BITS + 1; ; s++) { if (k < huff->maxCode[s])