Home | History | Annotate | Download | only in zopfli

Lines Matching defs:leaves

33 Nodes forming chains. Also used to represent leaves.
38 int count; /* Leaf symbol index, or number of leaves before this chain. */
98 leaves: The leaves, one per symbol.
99 numsymbols: Number of leaves.
106 Node* leaves, int numsymbols, NodePool* pool, int index, char final) {
123 InitNode(leaves[lastcount].weight, lastcount + 1, 0, newchain);
126 if (lastcount < numsymbols && sum > leaves[lastcount].weight) {
128 InitNode(leaves[lastcount].weight, lastcount + 1, oldchain->tail,
134 BoundaryPM(lists, maxbits, leaves, numsymbols, pool, index - 1, 0);
135 BoundaryPM(lists, maxbits, leaves, numsymbols, pool, index - 1, 0);
142 Initializes each list with as lookahead chains the two leaves with lowest
146 NodePool* pool, const Node* leaves, int maxbits, Node* (*lists)[2]) {
150 InitNode(leaves[0].weight, 1, 0, node0);
151 InitNode(leaves[1].weight, 2, 0, node1);
160 last chain of the last list contains the amount of active leaves in each list.
163 static void ExtractBitLengths(Node* chain, Node* leaves, unsigned* bitlengths) {
168 bitlengths[leaves[i].count]++;
174 Comparator for sorting the leaves. Has the function signature for qsort.
191 /* One leaf per symbol. Only numsymbols leaves will be used. */
192 Node* leaves = (Node*)malloc(n * sizeof(*leaves));
199 /* Count used symbols and place them in the leaves. */
202 leaves[numsymbols].weight = frequencies[i];
203 leaves[numsymbols].count = i; /* Index of symbol this leaf represents. */
210 free(leaves);
214 free(leaves);
218 bitlengths[leaves[0].count] = 1;
219 free(leaves);
223 /* Sort the leaves from lightest to heaviest. */
224 qsort(leaves, numsymbols, sizeof(Node), LeafComparator);
235 InitLists(&pool, leaves, maxbits, lists);
242 BoundaryPM(lists, maxbits, leaves, numsymbols, &pool, maxbits - 1, final);
245 ExtractBitLengths(lists[maxbits - 1][1], leaves, bitlengths);
248 free(leaves);