Home | History | Annotate | Download | only in lodepng

Lines Matching refs:bitpointer

398 #define addBitToStream(/*size_t**/ bitpointer, /*ucvector**/ bitstream, /*unsigned char*/ bit)\
401 if(((*bitpointer) & 7) == 0) ucvector_push_back(bitstream, (unsigned char)0);\
403 (bitstream->data[bitstream->size - 1]) |= (bit << ((*bitpointer) & 0x7));\
404 (*bitpointer)++;\
407 static void addBitsToStream(size_t* bitpointer, ucvector* bitstream, unsigned value, size_t nbits)
410 for(i = 0; i < nbits; i++) addBitToStream(bitpointer, bitstream, (unsigned char)((value >> i) & 1));
413 static void addBitsToStreamReversed(size_t* bitpointer, ucvector* bitstream, unsigned value, size_t nbits)
416 for(i = 0; i < nbits; i++) addBitToStream(bitpointer, bitstream, (unsigned char)((value >> (nbits - 1 - i)) & 1));
422 #define READBIT(bitpointer, bitstream) ((bitstream[bitpointer >> 3] >> (bitpointer & 0x7)) & (unsigned char)1)
424 static unsigned char readBitFromStream(size_t* bitpointer, const unsigned char* bitstream)
426 unsigned char result = (unsigned char)(READBIT(*bitpointer, bitstream));
427 (*bitpointer)++;
431 static unsigned readBitsFromStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits)
436 result += ((unsigned)READBIT(*bitpointer, bitstream)) << i;
437 (*bitpointer)++;
2319 static unsigned char readBitFromReversedStream(size_t* bitpointer, const unsigned char* bitstream)
2321 unsigned char result = (unsigned char)((bitstream[(*bitpointer) >> 3] >> (7 - ((*bitpointer) & 0x7))) & 1);
2322 (*bitpointer)++;
2326 static unsigned readBitsFromReversedStream(size_t* bitpointer, const unsigned char* bitstream, size_t nbits)
2332 result += (unsigned)readBitFromReversedStream(bitpointer, bitstream) << i;
2338 static void setBitOfReversedStream0(size_t* bitpointer, unsigned char* bitstream, unsigned char bit)
2344 bitstream[(*bitpointer) >> 3] |= (bit << (7 - ((*bitpointer) & 0x7)));
2346 (*bitpointer)++;
2350 static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit)
2353 if(bit == 0) bitstream[(*bitpointer) >> 3] &= (unsigned char)(~(1 << (7 - ((*bitpointer) & 0x7))));
2354 else bitstream[(*bitpointer) >> 3] |= (1 << (7 - ((*bitpointer) & 0x7)));
2355 (*bitpointer)++;