Mercurial > hg > dmlib
changeset 998:4a68f8d0adc5
Rename bitreverse functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 01 Mar 2015 03:00:12 +0200 |
parents | cd0e0270e1ce |
children | b3b8794c4915 |
files | src/dmzlib.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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])