Lines Matching refs:nbits
464 static void writeBits(LodePNGBitWriter * writer, unsigned value, size_t nbits) in writeBits() argument
466 if(nbits == 1) { /* compiler should statically compile this case if nbits == 1 */ in writeBits()
472 for(i = 0; i != nbits; ++i) { in writeBits()
479 static void writeBitsReversed(LodePNGBitWriter * writer, unsigned value, size_t nbits) in writeBitsReversed() argument
482 for(i = 0; i != nbits; ++i) { in writeBitsReversed()
484 WRITEBIT(writer, (unsigned char)((value >> (nbits - 1u - i)) & 1u)); in writeBitsReversed()
524 static LODEPNG_INLINE void ensureBits9(LodePNGBitReader * reader, size_t nbits) in ensureBits9() argument
537 (void)nbits; in ensureBits9()
541 static LODEPNG_INLINE void ensureBits17(LodePNGBitReader * reader, size_t nbits) in ensureBits17() argument
556 (void)nbits; in ensureBits17()
560 static LODEPNG_INLINE void ensureBits25(LodePNGBitReader * reader, size_t nbits) in ensureBits25() argument
576 (void)nbits; in ensureBits25()
580 static LODEPNG_INLINE void ensureBits32(LodePNGBitReader * reader, size_t nbits) in ensureBits32() argument
598 (void)nbits; in ensureBits32()
602 static LODEPNG_INLINE unsigned peekBits(LodePNGBitReader * reader, size_t nbits) in peekBits() argument
605 return reader->buffer & ((1u << nbits) - 1u); in peekBits()
609 static LODEPNG_INLINE void advanceBits(LodePNGBitReader * reader, size_t nbits) in advanceBits() argument
611 reader->buffer >>= nbits; in advanceBits()
612 reader->bp += nbits; in advanceBits()
616 static LODEPNG_INLINE unsigned readBits(LodePNGBitReader * reader, size_t nbits) in readBits() argument
618 unsigned result = peekBits(reader, nbits); in readBits()
619 advanceBits(reader, nbits); in readBits()
2846 …gned readBitsFromReversedStream(size_t * bitpointer, const unsigned char * bitstream, size_t nbits) in readBitsFromReversedStream() argument
2850 for(i = 0 ; i < nbits; ++i) { in readBitsFromReversedStream()