=========================================================================== * Initialize a new block. */
| 403 | * Initialize a new block. |
| 404 | */ |
| 405 | local void init_block(deflate_state *s) |
| 406 | { |
| 407 | int n; /* iterates over tree elements */ |
| 408 | |
| 409 | /* Initialize the trees. */ |
| 410 | for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; |
| 411 | for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; |
| 412 | for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; |
| 413 | |
| 414 | s->dyn_ltree[END_BLOCK].Freq = 1; |
| 415 | s->opt_len = s->static_len = 0L; |
| 416 | s->sym_next = s->matches = 0; |
| 417 | } |
| 418 | |
| 419 | #define SMALLEST 1 |
| 420 | /* Index within the heap array of least frequent node in the Huffman tree */ |