Lines Matching refs:lengths

658   unsigned* lengths; /*the lengths of the huffman codes*/  member
668 tree->lengths = 0; in HuffmanTree_init()
675 lodepng_free(tree->lengths); in HuffmanTree_cleanup()
700 unsigned l = tree->lengths[i]; in HuffmanTree_makeTable()
737 unsigned l = tree->lengths[i]; in HuffmanTree_makeTable()
823 for(bits = 0; bits != tree->numcodes; ++bits) ++blcount[tree->lengths[bits]]; in HuffmanTree_makeFromLengths2()
830 if(tree->lengths[n] != 0) { in HuffmanTree_makeFromLengths2()
831 tree->codes[n] = nextcode[tree->lengths[n]]++; in HuffmanTree_makeFromLengths2()
833 tree->codes[n] &= ((1u << tree->lengths[n]) - 1u); in HuffmanTree_makeFromLengths2()
853 tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); in HuffmanTree_makeFromLengths()
854 if(!tree->lengths) return 83; /*alloc fail*/ in HuffmanTree_makeFromLengths()
855 for(i = 0; i != numcodes; ++i) tree->lengths[i] = bitlen[i]; in HuffmanTree_makeFromLengths()
966 unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies, in lodepng_huffman_code_lengths() argument
987 lodepng_memset(lengths, 0, numcodes * sizeof(*lengths)); in lodepng_huffman_code_lengths()
995lengths[0] = lengths[1] = 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed… in lodepng_huffman_code_lengths()
997 lengths[leaves[0].index] = 1; in lodepng_huffman_code_lengths()
998 lengths[leaves[0].index == 0 ? 1 : 0] = 1; in lodepng_huffman_code_lengths()
1030 for(i = 0; i != node->index; ++i) ++lengths[leaves[i].index]; in lodepng_huffman_code_lengths()
1049 tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); in HuffmanTree_makeFromFrequencies()
1050 if(!tree->lengths) return 83; /*alloc fail*/ in HuffmanTree_makeFromFrequencies()
1054 error = lodepng_huffman_code_lengths(tree->lengths, frequencies, numcodes, maxbitlen); in HuffmanTree_makeFromFrequencies()
1786 writeBitsReversed(writer, tree_ll->codes[val], tree_ll->lengths[val]); in writeLZ77data()
1799 writeBitsReversed(writer, tree_d->codes[distance_code], tree_d->lengths[distance_code]); in writeLZ77data()
1904 for(i = 0; i != numcodes_ll; ++i) bitlen_lld[i] = tree_ll.lengths[i]; in deflateDynamic()
1905 for(i = 0; i != numcodes_d; ++i) bitlen_lld[numcodes_ll + i] = tree_d.lengths[i]; in deflateDynamic()
1958 while(numcodes_cl > 4u && tree_cl.lengths[CLCL_ORDER[numcodes_cl - 1u]] == 0) { in deflateDynamic()
1992 for(i = 0; i != numcodes_cl; ++i) writeBits(writer, tree_cl.lengths[CLCL_ORDER[i]], 3); in deflateDynamic()
1996 writeBitsReversed(writer, tree_cl.codes[bitlen_lld_e[i]], tree_cl.lengths[bitlen_lld_e[i]]); in deflateDynamic()
2006 if(tree_ll.lengths[256] == 0) ERROR_BREAK(64); in deflateDynamic()
2009 writeBitsReversed(writer, tree_ll.codes[256], tree_ll.lengths[256]); in deflateDynamic()
2059 writeBitsReversed(writer, tree_ll.codes[data[i]], tree_ll.lengths[data[i]]); in deflateFixed()
2063 if(!error) writeBitsReversed(writer,tree_ll.codes[256], tree_ll.lengths[256]); in deflateFixed()