Lines Matching refs:tree

1075 #  define SEND_CODE(c, tree) send_bits(tree[c].Code, tree[c].Len)  argument
1077 # define SEND_CODE(c, tree) \ argument
1080 send_bits(tree[c].Code, tree[c].Len); \
1123 #define SMALLER(tree, n, m) \ argument
1124 (tree[n].Freq < tree[m].Freq \
1125 || (tree[n].Freq == tree[m].Freq && G2.depth[n] <= G2.depth[m]))
1127 static void pqdownheap(const ct_data *tree, int k) in pqdownheap() argument
1134 if (j < G2.heap_len && SMALLER(tree, G2.heap[j + 1], G2.heap[j])) in pqdownheap()
1138 if (SMALLER(tree, v, G2.heap[j])) in pqdownheap()
1163 #define tree desc->dyn_tree in gen_bitlen() macro
1175 tree[G2.heap[G2.heap_max]].Len = 0; /* root of the heap */ in gen_bitlen()
1183 bits = tree[tree[n].Dad].Len + 1; in gen_bitlen()
1188 tree[n].Len = (ush) bits; in gen_bitlen()
1198 f = tree[n].Freq; in gen_bitlen()
1235 if (tree[m].Len != (unsigned) bits) { in gen_bitlen()
1236 Trace((stderr, "code %d bits %d->%d\n", m, tree[m].Len, bits)); in gen_bitlen()
1237 G2.opt_len += ((int32_t) bits - tree[m].Len) * tree[m].Freq; in gen_bitlen()
1238 tree[m].Len = bits; in gen_bitlen()
1243 #undef tree in gen_bitlen()
1254 static void gen_codes(ct_data *tree, int max_code) in gen_codes() argument
1276 int len = tree[n].Len; in gen_codes()
1281 tree[n].Code = bi_reverse(next_code[len]++, len); in gen_codes()
1283 Tracec(tree != G2.static_ltree, in gen_codes()
1285 (n > ' ' ? n : ' '), len, tree[n].Code, in gen_codes()
1305 #define PQREMOVE(tree, top) \ argument
1309 pqdownheap(tree, SMALLEST); \
1314 ct_data *tree = desc->dyn_tree; in build_tree() local
1329 if (tree[n].Freq != 0) { in build_tree()
1333 tree[n].Len = 0; in build_tree()
1345 tree[new].Freq = 1; in build_tree()
1358 pqdownheap(tree, n); in build_tree()
1364 PQREMOVE(tree, n); /* n = node of least frequency */ in build_tree()
1371 tree[node].Freq = tree[n].Freq + tree[m].Freq; in build_tree()
1373 tree[n].Dad = tree[m].Dad = (ush) node; in build_tree()
1375 if (tree == G2.bl_tree) { in build_tree()
1377 node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); in build_tree()
1382 pqdownheap(tree, SMALLEST); in build_tree()
1393 gen_codes(tree, max_code); in build_tree()
1402 static void scan_tree(ct_data *tree, int max_code) in scan_tree() argument
1407 int nextlen = tree[0].Len; /* length of next code */ in scan_tree()
1416 tree[max_code + 1].Len = 0xffff; /* guard */ in scan_tree()
1420 nextlen = tree[n + 1].Len; in scan_tree()
1454 static void send_tree(const ct_data *tree, int max_code) in send_tree() argument
1459 int nextlen = tree[0].Len; /* length of next code */ in send_tree()
1470 nextlen = tree[n + 1].Len; in send_tree()