Lines Matching refs:leaves

918 static void bpmnode_sort(BPMNode* leaves, size_t num) {  in bpmnode_sort()  argument
919 BPMNode* mem = (BPMNode*)lodepng_malloc(sizeof(*leaves) * num); in bpmnode_sort()
922 BPMNode* a = (counter & 1) ? mem : leaves; in bpmnode_sort()
923 BPMNode* b = (counter & 1) ? leaves : mem; in bpmnode_sort()
936 if(counter & 1) lodepng_memcpy(leaves, mem, sizeof(*leaves) * num); in bpmnode_sort()
941 static void boundaryPM(BPMLists* lists, BPMNode* leaves, size_t numpresent, int c, int num) { in boundaryPM() argument
947 lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, 0); in boundaryPM()
952 if(lastindex < numpresent && sum > leaves[lastindex].weight) { in boundaryPM()
953 …lists->chains1[c] = bpmnode_create(lists, leaves[lastindex].weight, lastindex + 1, lists->chains1[… in boundaryPM()
960 boundaryPM(lists, leaves, numpresent, c - 1, num); in boundaryPM()
961 boundaryPM(lists, leaves, numpresent, c - 1, num); in boundaryPM()
971 BPMNode* leaves; /*the symbols, only those with > 0 frequency*/ in lodepng_huffman_code_lengths() local
976 leaves = (BPMNode*)lodepng_malloc(numcodes * sizeof(*leaves)); in lodepng_huffman_code_lengths()
977 if(!leaves) return 83; /*alloc fail*/ in lodepng_huffman_code_lengths()
981 leaves[numpresent].weight = (int)frequencies[i]; in lodepng_huffman_code_lengths()
982 leaves[numpresent].index = i; 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()
1003 bpmnode_sort(leaves, numpresent); in lodepng_huffman_code_lengths()
1018 bpmnode_create(&lists, leaves[0].weight, 1, 0); in lodepng_huffman_code_lengths()
1019 bpmnode_create(&lists, leaves[1].weight, 2, 0); in lodepng_huffman_code_lengths()
1027 …for(i = 2; i != 2 * numpresent - 2; ++i) boundaryPM(&lists, leaves, numpresent, (int)maxbitlen - 1… in lodepng_huffman_code_lengths()
1030 for(i = 0; i != node->index; ++i) ++lengths[leaves[i].index]; in lodepng_huffman_code_lengths()
1040 lodepng_free(leaves); in lodepng_huffman_code_lengths()