• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/minidlna/zlib-1.2.3/

Lines Matching refs:heap

92  * need for the L_CODES extra codes used during heap construction. However
427 /* Index within the heap array of least frequent node in the Huffman tree */
431 * Remove the smallest element from the heap and recreate the heap with
432 * one less element. Updates heap and heap_len.
436 top = s->heap[SMALLEST]; \
437 s->heap[SMALLEST] = s->heap[s->heap_len--]; \
450 * Restore the heap property by moving down the tree starting at node k,
452 * when the heap property is re-established (each father smaller than its
460 int v = s->heap[k];
465 smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
469 if (smaller(tree, v, s->heap[j], s->depth)) break;
472 s->heap[k] = s->heap[j]; k = j;
477 s->heap[k] = v;
483 * IN assertion: the fields freq and dad are set, heap[heap_max] and
500 int h; /* heap index */
512 tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
515 n = s->heap[h];
556 m = s->heap[--h];
626 int n, m; /* iterate over heap elements */
630 /* Construct the initial heap, with least frequent element in
631 * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
632 * heap[0] is not used.
638 s->heap[++(s->heap_len)] = max_code = n;
651 node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
659 /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
670 m = s->heap[SMALLEST]; /* m = node of next least frequency */
672 s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
673 s->heap[--(s->heap_max)] = m;
686 /* and insert the new node in the heap */
687 s->heap[SMALLEST] = node++;
692 s->heap[--(s->heap_max)] = s->heap[SMALLEST];