Lines Matching refs:bits

624 static unsigned reverseBits(unsigned bits, unsigned num)  in reverseBits()  argument
628 for(i = 0; i < num; i++) result |= ((bits >> (num - i - 1u)) & 1u) << i; in reverseBits()
843 unsigned bits, n; in HuffmanTree_makeFromLengths2() local
853 for(bits = 0; bits != tree->numcodes; ++bits) ++blcount[tree->lengths[bits]]; in HuffmanTree_makeFromLengths2()
855 for(bits = 1; bits <= tree->maxbitlen; ++bits) { in HuffmanTree_makeFromLengths2()
856 nextcode[bits] = (nextcode[bits - 1] + blcount[bits - 1]) << 1u; in HuffmanTree_makeFromLengths2()
3580 static void addColorBits(unsigned char * out, size_t index, unsigned bits, unsigned in) in addColorBits() argument
3582 unsigned m = bits == 1 ? 7 : bits == 2 ? 3 : 1; /*8 / bits - 1*/ in addColorBits()
3585 in &= (1u << bits) - 1u; /*filter out any other bits of the input value*/ in addColorBits()
3586 in = in << (bits * (m - p)); in addColorBits()
3587 if(p == 0) out[index * bits / 8u] = in; in addColorBits()
3588 else out[index * bits / 8u] |= in; in addColorBits()
4220 stats->bits = 1; in lodepng_color_stats_init()
4263 unsigned bits_done = (stats->bits == 1 && bpp == 1) ? 1 : 0; in lodepng_compute_color_stats()
4279 if(stats->bits == 16) numcolors_done = 1; in lodepng_compute_color_stats()
4280 if(stats->bits >= bpp) bits_done = 1; in lodepng_compute_color_stats()
4298 stats->bits = 16; in lodepng_compute_color_stats()
4358 if(!bits_done && stats->bits < 8) { in lodepng_compute_color_stats()
4360 unsigned bits = getValueRequiredBits(r); in lodepng_compute_color_stats() local
4361 if(bits > stats->bits) stats->bits = bits; in lodepng_compute_color_stats()
4363 bits_done = (stats->bits >= bpp); in lodepng_compute_color_stats()
4368 … if(stats->bits < 8) stats->bits = 8; /*PNG has no colored modes with less than 8-bit per channel*/ in lodepng_compute_color_stats()
4377 …if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per chan… in lodepng_compute_color_stats()
4390 …if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per chan… in lodepng_compute_color_stats()
4422 …if(stats->bits < 8) stats->bits = 8; /*PNG has no alphachannel modes with less than 8-bit per chan… in lodepng_compute_color_stats()
4484 unsigned bits = stats->bits; in auto_choose_color() local
4491 if(bits < 8) bits = 8; /*PNG has no alphachannel modes with less than 8-bit per channel*/ in auto_choose_color()
4496 if(!gray_ok && bits < 8) bits = 8; in auto_choose_color()
4500 palette_ok = n <= 256 && bits <= 8 && n != 0; /*n==0 means likely numcolors wasn't computed*/ in auto_choose_color()
4502 if(gray_ok && !alpha && bits <= palettebits) palette_ok = 0; /*gray is less overhead*/ in auto_choose_color()
4524 mode_out->bitdepth = bits; in auto_choose_color()