Home | History | Annotate | Download | only in lodepng

Lines Matching defs:bit

398 #define addBitToStream(/*size_t**/ bitpointer, /*ucvector**/ bitstream, /*unsigned char*/ bit)\
402 /*earlier bit of huffman code is in a lesser significant bit of an earlier byte*/\
403 (bitstream->data[bitstream->size - 1]) |= (bit << ((*bitpointer) & 0x7));\
534 uninited, a value >= numcodes is an address to another bit, a value < numcodes
535 is a code. The 2 rows are the 2 possible bit values (0 or 1), there are as
551 unsigned char bit = (unsigned char)((tree->tree1d[n] >> (tree->lengths[n] - i - 1)) & 1);
553 if(tree->tree2d[2 * treepos + bit] == 32767) /*not yet filled in*/
555 if(i + 1 == tree->lengths[n]) /*last bit*/
557 tree->tree2d[2 * treepos + bit] = n; /*put the current code in it*/
566 tree->tree2d[2 * treepos + bit] = nodefilled + tree->numcodes;
570 else treepos = tree->tree2d[2 * treepos + bit] - tree->numcodes;
742 symbol, it'd give it the theoritical 0 bits but in practice zlib wants 1 bit*/
949 /*code length code lengths ("clcl"), the bit lengths of the huffman tree used to compress bitlen_ll and bitlen_d*/
953 if((*bp) >> 3 >= inlength - 2) return 49; /*error: the bit pointer is or will go past the memory*/
1003 if(*bp >= inbitlength) ERROR_BREAK(50); /*error, bit pointer jumps past memory*/
1022 if(*bp >= inbitlength) ERROR_BREAK(50); /*error, bit pointer jumps past memory*/
1039 if(*bp >= inbitlength) ERROR_BREAK(50); /*error, bit pointer jumps past memory*/
1125 if(*bp >= inbitlength) ERROR_BREAK(51); /*error, bit pointer will jump past memory*/
1145 if(*bp >= inbitlength) ERROR_BREAK(51); /*error, bit pointer will jump past memory*/
1195 if(p >= inlength - 4) return 52; /*error, bit pointer will jump past memory*/
1199 /*check if 16-bit NLEN is really the one's complement of LEN*/
1220 /*bit pointer in the "in" data, current byte is bp >> 3, current bit is bp & 0x7 (from lsb to msb of the byte)*/
1232 if(bp + 2 >= insize * 8) return 52; /*error, bit pointer will jump past memory*/
1345 even a bit better instead).
1410 /*subtracting two addresses returned as 32-bit number (max value is MAX_SUPPORTED_DEFLATE_LENGTH)*/
1602 /*non compressed deflate block data: 1 bit BFINAL,2 bits BTYPE,(5 bits): it jumps to start of next byte,
1698 /*bitlen_cl is the code length code lengths ("clcl"). The bit lengths of codes to represent tree_cl
1863 addBitToStream(bp, out, 0); /*first bit of BTYPE "dynamic"*/
1864 addBitToStream(bp, out, 1); /*second bit of BTYPE "dynamic"*/
1935 addBitToStream(bp, out, 1); /*first bit of BTYPE*/
1936 addBitToStream(bp, out, 0); /*second bit of BTYPE*/
1969 size_t bp = 0; /*the bit pointer*/
2338 static void setBitOfReversedStream0(size_t* bitpointer, unsigned char* bitstream, unsigned char bit)
2340 /*the current bit in bitstream must be 0 for this to work*/
2341 if(bit)
2343 /*earlier bit of huffman code is in a lesser significant bit of an earlier byte*/
2344 bitstream[(*bitpointer) >> 3] |= (bit << (7 - ((*bitpointer) & 0x7)));
2350 static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit)
2352 /*the current bit in bitstream may be 0 or 1 for this to work*/
2353 if(bit == 0) bitstream[(*bitpointer) >> 3] &= (unsigned char)(~(1 << (7 - ((*bitpointer) & 0x7))));
2945 int bit = 0;
2946 for(bit = 0; bit < 8; bit++)
2948 int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1);
2967 int bit;
2968 for(bit = 0; bit < 8; bit++)
2970 int i = 8 * ((r >> bit) & 1) + 4 * ((g >> bit) & 1) + 2 * ((b >> bit) & 1) + 1 * ((a >> bit) & 1);
3122 unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/
3210 to RGBA or RGB with 8 bit per cannel. buffer must be RGBA or RGB output with
3240 unsigned highest = ((1U << mode->bitdepth) - 1U); /*highest possible value for this bit depth*/
3349 given color type, but the given color type must be 16-bit itself.*/
3353 if(mode->bitdepth != 16) return 85; /*error: this function only supports 16-bit input*/
3383 else return 85; /*error: this function only supports 16-bit input, not palettes*/
3389 converts from any color type to 24-bit or 32-bit (later maybe more supported). return value = LodePNG error code
3472 unsigned short key_r; /*these values are always in 16-bit bitdepth in the profile*/
3484 unsigned greybits; /*amount of bits required for greyscale (1, 2, 4, 8). Does not take 16 bit into account.*/
3542 /*Returns how many bits needed to represent given value (max 8 bit)*/
3546 /*The scaling of 2-bit and 4-bit values uses multiples of 85 and 17*/
3570 /*a color is considered good for 8-bit if the first byte and the second byte are equal,
3579 profile->greybits_done = 1; /*greybits is not applicable anymore at 16-bit*/
3580 profile->numcolors_done = 1; /*counting colors no longer useful, palette doesn't support 16-bit*/
3622 /*assuming 8-bit r, this test does not care about 16-bit*/
3630 /*assuming 8-bit rgba, this test does not care about 16-bit*/
3656 else /* < 16-bit */
3734 /*make the profile's key always 16-bit for consistency*/
3839 else /*8-bit per channel*/
4121 (because that's likely a little bit faster)
4150 else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/
4157 size_t obp, ibp; /*bit pointers (for out and in buffer)*/
4165 unsigned char bit = readBitFromReversedStream(&ibp, in);
4167 setBitOfReversedStream0(&obp, out, bit);
4178 After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need
4188 size_t ibp = 0, obp = 0; /*input and output bit pointers*/
4194 unsigned char bit = readBitFromReversedStream(&ibp, in);
4195 setBitOfReversedStream(&obp, out, bit);
4686 /*error: unknown critical chunk (5th bit of first byte of chunk type is 0)*/
4762 from greyscale input color type, to 8-bit greyscale or greyscale with alpha"*/
4911 ucvector_push_back(&header, (unsigned char)bitdepth); /*bit depth*/
5222 /* log2 approximation. A slight bit faster than std::log. */
5252 * If the image type is Palette, or the bit depth is smaller than 8, then do not filter the image (i.e.
5254 * (The other case) If the image type is Grayscale or RGB (with or without Alpha), and the bit depth is
5410 cases better compression. It does make this a bit less slow, so it's worth doing this.*/
5458 size_t obp = 0, ibp = 0; /*bit pointers*/
5464 unsigned char bit = readBitFromReversedStream(&ibp, in);
5465 setBitOfReversedStream(&obp, out, bit);
5510 else /*bpp < 8: Adam7 with pixels < 8 bit is a bit trickier: with bit pointers*/
5517 size_t obp, ibp; /*bit pointers (for out and in buffer)*/
5525 unsigned char bit = readBitFromReversedStream(&ibp, in);
5526 setBitOfReversedStream(&obp, out, bit);
5963 case 37: return "illegal bit depth for this color type given";
5986 given lenghts. They call this an oversubscribed dynamic bit lengths tree in zlib.*/