head 1.1; branch 1.1.1; access; symbols trunk-20040613:1.1.1.2 mach64-last-merge:1.1.1.2 driinterface-0-0-3-20040303-merge:1.1.1.2 driinterface-0-0-3-20040303-premerge:1.1.1.2 driinterface-0-0-3-20040303:1.1.1.2 driinterface-0-0-3-branch:1.1.1.2.0.92 mach64-0-0-7-branch:1.1.1.2.0.90 driinterface-0-0-2-branch:1.1.1.2.0.88 newmesa-0-0-1-20031209-merge:1.1.1.2 trunk-20031209:1.1.1.2 newmesa-0-0-1-20031209:1.1.1.2 newmesa-0-0-1-branch:1.1.1.2.0.86 driinterface-0-0-1-branch:1.1.1.2.0.84 savage-2-0-0-branch:1.1.1.2.0.82 savage-2-0-0-fork:1.1.1.2 config-0-0-1-20031005-freeze:1.1.1.2 savage-1_0_0-20031002-trunk-premerge:1.1.1.2 cle266-0-0-1-branch:1.1.1.2.0.80 i865-agp-0-1-20030929:1.1.1.2 trunk-20030916:1.1.1.2 XFree86-4_3_99_12-merge:1.1.1.2 trunk-20030912:1.1.1.2 i865-agp-0-1-20030905:1.1.1.2 i865-agp-0-1-20030728:1.1.1.2 i865-agp-0-1-20030707:1.1.1.2 savage-1_0_0-branch:1.1.1.2.0.78 newdrm-0-0-1-branch:1.1.1.2.0.76 i865-agp-0-1-branch:1.1.1.2.0.74 config-0-0-1-branch:1.1.1.2.0.72 texmem-0-0-1-20030429-merge:1.1.1.2 texmem-0-0-1-20030429-premerge:1.1.1.2 texmem-0-0-1-20030407:1.1.1.2 trident-0-0-2-branch:1.1.1.2.0.70 mach64-0-0-6-20030330:1.1.1.2 mach64-0-0-6-20030329-freeze:1.1.1.2 texmem-0-0-1-20030328-freeze:1.1.1.2 X_4_3_0-20030324-merge:1.1.1.2 X_4_3_0-20020324-preimport:1.1.1.2 drm-filp-0-1-branch:1.1.1.2.0.68 mesa-4-0-4-20030222:1.1.1.2 bsd-4-0-0-20030221-merge:1.1.1.2 bsd-4-0-0-20030220:1.1.1.2 bsd-4-0-0-20030220-freeze:1.1.1.2 mesa-4-0-4-20030216:1.1.1.2 mach64-0-0-6-branch:1.1.1.2.0.66 mesa-4-0-4-20030208:1.1.1.2 texmem-0-0-1-20030204-trunk-merge:1.1.1.2 texmem-0-0-1-20030204-trunk-premerge:1.1.1.2 mesa-4-0-4-20030203:1.1.1.2 mesa-4-0-4-20030129:1.1.1.2 texmem-0-0-1-20030125-trunk-merge:1.1.1.2 texmem-0-0-1-20030123-trunk-premerge:1.1.1.2 mesa-4-0-4-20030114:1.1.1.2 agpgart_2_0_branch:1.1.1.2.0.64 mesa-4-0-4-20021220:1.1.1.2 mesa-4-0-4-20021216:1.1.1.2 mesa-4-0-4-20021215:1.1.1.2 mesa-4-0-4-20021214:1.1.1.2 mesa-4-0-4-branch:1.1.1.2.0.62 dmx-1-0-20021129-final:1.1.1.2 texmem-0-0-1-20021127-mesa-4-1-merge:1.1.1.2 trunk-20021125:1.1.1.2 dmx-1-0-20021115-beta:1.1.1.2 bsd-4-0-0-branch:1.1.1.2.0.60 nv-0-0-1-branch:1.1.1.2.0.58 savage-0-0-1-branch:1.1.1.2.0.56 stable-1-0-branch:1.1.1.2.0.54 r200-stable-1-0-20021028:1.1.1.2 dmx-1-0-20021025-alpha:1.1.1.2 X_4_2_99_2-20021023-merge:1.1.1.2 X_4_2_99_2:1.1.1.2 trunk-20021022:1.1.1.2 r200-stable-1-0-branch:1.1.1.2.0.52 mesa-4-1-branch:1.1.1.2.0.50 texmem-0-0-1:1.1.1.2.0.48 trunk-20021002:1.1.1.2 dmx-1-0-20020926-final:1.1.1.2 dmx-1-0-20020830-beta:1.1.1.2 r200-0-2-branch:1.1.1.2.0.46 r200-0-1-20020822-merge:1.1.1.2 r200-0-1-20020822:1.1.1.2 r200-0-1-20020826-freeze:1.1.1.2 xv845g-0-1-branch:1.1.1.2.0.44 xv845g-0-1-bp:1.1.1.2 GEODE-BASE-DRIVER:1.1.1.2 geode-0-0-1-branch:1.1.1.2.0.42 tdlabs-0-0-1-branch:1.1.1.2.0.40 reinit-0-0-1-branch:1.1.1.2.0.38 dmx-1-0-20020719-alpha:1.1.1.2 r200-0-1-20020715:1.1.1.2 r200-0-1-20020714-freeze:1.1.1.2 bsd-3-0-0-20020705-merge:1.1.1.2 bsd-3-0-0-freeze:1.1.1.2 trunk-20020705:1.1.1.2 bsd-3-0-0-20020705:1.1.1.2 trunk-20020703:1.1.1.2 mach64-0-0-5-branch:1.1.1.2.0.34 trunk-20020626:1.1.1.2 trunk-20020617:1.1.1.2 tcl-0-0-20020612-merge:1.1.1.2 tcl-0-0-20020612:1.1.1.2 tcl-0-0-20020612-freeze:1.1.1.2 r200-0-1-branch:1.1.1.2.0.36 dmx-1-0-20020604-phase1:1.1.1.2 dmx-1-0-20020603-base:1.1.1.2 dmx-1-0-branch:1.1.1.2.0.32 dmx-0-1-20020531-final:1.1.1.2 mach64-0-0-4-dma-branch:1.1.1.2.0.30 dmx-0-1-20020419-beta:1.1.1.2 mach64-0-0-4-branch:1.1.1.2.0.28 drmcommand-0-0-1-20020409-merge:1.1.1.2 drmcommand-0-0-1-20020409:1.1.1.2 drmcommand-0-0-1-20020409-freeze:1.1.1.2 trunk-20020328:1.1.1.2 s3virge-0-0-1-branch:1.1.1.2.0.26 drmcommand-0-0-1-branch:1.1.1.2.0.24 trident-0-0-1-branch:1.1.1.2.0.22 mach64-0-0-3-dma-branch:1.1.1.2.0.20 bsd-3-0-0-branch:1.1.1.2.0.18 dmx-0-1-20020228-alpha:1.1.1.2 mach64-0-0-3-branch:1.1.1.2.0.16 trunk-20020221:1.1.1.2 tcl-0-0-branch:1.1.1.2.0.14 mesa-4-0-20020214-merge:1.1.1.2 mesa-4-0-20020214:1.1.1.2 mesa-4-0-20020213:1.1.1.2 mesa-4-0-20020211-freeze:1.1.1.2 X_4_2_0-20020128-merge:1.1.1.2 X_4_2_0:1.1.1.2 X_4_2_0-20020127-preimport:1.1.1.2 X_4_2_0-20020123-preimport:1.1.1.2 dmx-0-1-20020112:1.1.1.2 dmx-0-1-20011128-snapshot:1.1.1.2 dmx-0-1-20011115:1.1.1.2 dmx-0-1-branch:1.1.1.2.0.12 mach64-0-0-2-branch:1.1.1.2.0.10 mesa-4-0-branch:1.1.1.2.0.8 X_4_1_99_1-20010822-merge:1.1.1.2 X_4_1_99_1:1.1.1.2 X_4_1_99_1-20010822-preimport:1.1.1.2 multihead-1-0-0-20010730:1.1.1.2 multihead-1-0-0-20010730-merge:1.1.1.2 multihead-1-0-0-20010727-freeze:1.1.1.2 X_4_1_0-20010615-merge:1.1.1.2 mesa-3-5-20010621-freeze:1.1.1.1.86.1 X_4_1_0:1.1.1.2 X_4_1_0-20010614-preimport:1.1.1.2 multihead-1-0-0-branch:1.1.1.2.0.6 X_4_0_99_3-20010502-merge:1.1.1.2 X_4_0_99_3:1.1.1.2 X_4_0_99_3-20010501-preimport:1.1.1.2 bsd-2-0-0-branch:1.1.1.2.0.4 X_4_0_99_2-20010410-merge:1.1.1.2 X_4_0_99_2:1.1.1.2 X_4_0_99_2-20010409-preimport:1.1.1.2 ati-pcigart-1-0-0-20010405-merge:1.1.1.2 ati-pcigart-1-0-0-20010405:1.1.1.2 ati-pcigart-1-0-0-20010405-freeze:1.1.1.2 ati-pcigart-1-0-0-branch:1.1.1.2.0.2 mesa-3-5-20010323-freeze:1.1.1.1 X_4_0_99_1-20010321-merge:1.1.1.2 X_4_0_99_1:1.1.1.2 X_4_0_99_1-20010319-preimport:1.1.1.1 full-1-0-0-20010315-head:1.1.1.1 sarea-1-0-0-20010314-merge:1.1.1.1 sarea-1-0-0-20010314:1.1.1.1 full-1-0-0-branch:1.1.1.1 sarea-1-0-0-20010307:1.1.1.1 sarea-1-0-0-20010307-freeze:1.1.1.1 tdfx-3-1-0-20010306-merge:1.1.1.1 tdfx-3-1-0-20010306-freeze:1.1.1.1 tdfx-3-1-0-20010306:1.1.1.1 tdfx-3-1-0-20010305-merge:1.1.1.1 tdfx-3-1-0-20010305-freeze2:1.1.1.1 tdfx-3-1-0-20010305-freeze:1.1.1.1 tdfx-3-1-0-20010301-freeze:1.1.1.1 ati-pcigart-0-0-1-branch-02282001-freeze:1.1.1.1 ati-5-0-1-20010220-head:1.1.1.1 ati-5-0-1-branch:1.1.1.1.0.94 sarea-1-0-0-branch:1.1.1.1.0.92 mga-1-0-0-20010215-merge:1.1.1.1 mga-1-0-0-20010215-freeze:1.1.1.1 tdfx-3-1-0-branch:1.1.1.1.0.90 tdfx-3-0-1-branch:1.1.1.1 ati-pcigart-0-0-1-branch:1.1.1.1.0.88 mesa-3-5-branch:1.1.1.1.0.86 tdfx-3-0-0-20010109-merge:1.1.1.1 tdfx-3-0-0-20010108:1.1.1.1 ati-5-0-0-20010105-merge:1.1.1.1 ati-5-0-0-20010105:1.1.1.1 ati-5-0-0-20000104-freeze:1.1.1.1 tdfx-3-0-0-20010104-freeze:1.1.1.1 ati-5-0-0-20001223-merge:1.1.1.1 ati-5-0-0-20001223-freeze:1.1.1.1 X_4_0_2-20001221-merge:1.1.1.1 X_4_0_2:1.1.1.1 mga-1-0-0-branch:1.1.1.1.0.84 X_4_0_1h-20001207-merge:1.1.1.1 X_4_0_1h-20001205-merge:1.1.1.1 X_4_0_1h:1.1.1.1 ati-4-1-1-20001202-merge-trunk:1.1.1.1 sse-1-0-1-branch:1.1.1.1.0.82 ati-4-1-1-20001202-merge:1.1.1.1 tdfx-3-0-0-20001201:1.1.1.1 ati-4-1-1-20001201-freeze:1.1.1.1 tdfx-3-0-0-20001201-freeze:1.1.1.1 X_4_0_1g-20001130-merge:1.1.1.1 X_4_0_1g:1.1.1.1 X_4_0_1f-20001130-merge:1.1.1.1 X_4_0_1f:1.1.1.1 ati-4-1-1-20001125-freeze:1.1.1.1 mach64-0-0-1-branch:1.1.1.1.0.80 ati-5-0-0-branch:1.1.1.1.0.78 X_4_0_1e-20001107-merge:1.1.1.1 X_4_0_1e:1.1.1.1 X_4_0_1d-20001107-merge:1.1.1.1 X_4_0_1d:1.1.1.1 ppc-1-0-1-branch:1.1.1.1.0.76 radeon-1-0-0-20001017:1.1.1.1 full-0-0-2-branch:1.1.1.1.0.74 full-0-0-1-branch:1.1.1.1.0.72 ati-4-1-1-20001009-freeze:1.1.1.1 mga-readpix-0-0-1-branch:1.1.1.1.0.70 tdfx-3-0-0-branch:1.1.1.1.0.68 X_4_0_1d-pre:1.1.1.1 ati-4-1-1-20000919-stable:1.1.1.1 radeon-1-0-0-branch:1.1.1.1.0.66 ppc-1-0-0-20000912:1.1.1.1 mga-lock-debug-0-2-0-branch:1.1.1.1.0.64 sse-1-0-0-branch:1.1.1.1.0.62 mga-lock-debug-0-0-1-branch:1.1.1.1.0.60 gamma-2-0-0-branch:1.1.1.1.0.58 tdfx-2-1-20000907-merge:1.1.1.1 tdfx-2-1-20000906:1.1.1.1 tdfx-2-1-20000905-freeze:1.1.1.1 ppc-1-0-0-2000-09-01-freeze:1.1.1.1 m3-0-0-1-branch:1.1.1.1.0.56 mach64-0-0-0-branch:1.1.1.1.0.54 ati-4-1-1-branch:1.1.1.1.0.52 X_4_0_1b-20000816-merge:1.1.1.1 X_4_0_1b:1.1.1.1 ati-4-0-2-branch:1.1.1.1.0.50 ppc-1-0-0-branch:1.1.1.1.0.48 tdfx-2-1-20000711:1.1.1.1 tdfx-2-1-20000711-freeze:1.1.1.1 X_4_0_1:1.1.1.1 tdfx-2-1-branch:1.1.1.1.0.46 pre401-20000613-freeze:1.1.1.1 bsd-1-0-1-20000613-merge:1.1.1.1 bsd-1-0-1-20000613:1.1.1.1 bsd-1-0-1-20000612-freeze:1.1.1.1 tdfx-2-0-20000612-merge:1.1.1.1 ati-4-1-0-20000613-merge:1.1.1.1 ati-4-1-0-20000613:1.1.1.1 tdfx-2-0-20000608-merge:1.1.1.1 tdfx-2-0-20000608-freeze:1.1.1.1 ati-4-1-0-branch:1.1.1.1.0.44 glxmisc-3-0-0-20000608-merge:1.1.1.1 glxmisc-3-0-0-20000607:1.1.1.1 glxmisc-3-0-0-20000606-freeze:1.1.1.1 bsd-1-0-1-branch:1.1.1.1.0.42 bsd-1-0-0-20000531-merge:1.1.1.1 bsd-1-0-0-20000530-merge:1.1.1.1 bsd-1-0-0-20000530-freeze:1.1.1.1 tdfx-2-0-20000222-merge:1.1.1.1 tdfx-2-0-20000222-freeze:1.1.1.1 ati-4-0-1-20000518-merge:1.1.1.1 ati-4-0-1-20000518:1.1.1.1 video-1-0-0-branch:1.1.1.1.0.40 gamma-1-0-0-branch:1.1.1.1.0.38 mgadh-0-0-3-branch:1.1.1.1.0.36 glxmisc-3-0-0-branch:1.1.1.1.0.34 glxmisc-2-0-0-20000503-merge:1.1.1.1 bsd-1-0-0-branch:1.1.1.1.0.32 glxmisc-2-0-0-20000503:1.1.1.1 glxmisc-2-0-0-branch:1.1.1.1.0.30 tdfx-2-0-branch:1.1.1.1.0.28 tdfx-2-0-trunk:1.1.1.1 glxmisc-1-0-0-20000420-merge:1.1.1.1 glxmisc-1-0-0-20000420:1.1.1.1 ati-4-0-1-beta:1.1.1.1 glxmisc-1-0-0-branch:1.1.1.1.0.26 mga-0-0-3-branch:1.1.1.1.0.24 mga-0-0-2-20000404-merge:1.1.1.1 ati-4-0-1-alpha:1.1.1.1 ati-4-0-1-20000319-base:1.1.1.1 ati-4-0-1-branch:1.1.1.1.0.22 ati-4-0-0-20000319:1.1.1.1 X_4_0-20000315-merge:1.1.1.1 X_4_0:1.1.1.1 freeze-20000226:1.1.1.1 dispatch-0-0-3-20000225-merge:1.1.1.1 dispatch-0-0-3-20000225:1.1.1.1 mga-0-0-1-20000225-merge:1.1.1.1 mga-0-0-2-branch:1.1.1.1.0.20 smt-0-0-2-branch:1.1.1.1.0.18 smt-0-0-1-20000222-freeze:1.1.1.1 X_3_9_18-20000222-merge:1.1.1.1 X_3_9_18:1.1.1.1 smt-0-0-1-stage2c:1.1.1.1 smt-0-0-1-stage2b:1.1.1.1.0.16 dispatch-0-0-3-branch:1.1.1.1.0.14 i810-20000214-beta2:1.1.1.1 dispatch-0-0-2-20000212:1.1.1.1 dispatch-0-0-2-branch:1.1.1.1.0.12 i810-20000201-beta1:1.1.1.1 dispatch-0-0-1-20000129-merge:1.1.1.1 dispatch-0-0-1-20000128:1.1.1.1 smt-0-0-1-20000112-base:1.1.1.1 smt-0-0-1-branch:1.1.1.1.0.6 dispatch-0-0-1-branch:1.1.1.1.0.10 tdfx-1-1:1.1.1.1.0.4 X_3_9_17:1.1.1.1 ati-4-0-0-branch:1.1.1.1.0.8 mga-0-0-1-branch:1.1.1.1.0.2 X_3_9_16:1.1.1.1 XFree:1.1.1; locks; strict; comment @ * @; 1.1 date 99.12.05.01.04.12; author daryll; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.12.05.01.04.12; author daryll; state Exp; branches 1.1.1.1.86.1; next 1.1.1.2; 1.1.1.2 date 2001.03.19.17.45.24; author dawes; state Exp; branches; next ; 1.1.1.1.86.1 date 2001.03.27.20.03.20; author gareth; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @/* $TOG: deflate.h /main/4 1998/02/04 14:33:24 kaleb $ */ /* deflate.h -- internal compression state * Copyright (C) 1995-1998 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ /* WARNING: this file should *not* be used by applications. It is part of the implementation of the compression library and is subject to change. Applications should only use zlib.h. */ #ifndef _DEFLATE_H #define _DEFLATE_H #include "zutil.h" /* =========================================================================== * Internal compression state. */ #define LENGTH_CODES 29 /* number of length codes, not counting the special END_BLOCK code */ #define LITERALS 256 /* number of literal bytes 0..255 */ #define L_CODES (LITERALS+1+LENGTH_CODES) /* number of Literal or Length codes, including the END_BLOCK code */ #define D_CODES 30 /* number of distance codes */ #define BL_CODES 19 /* number of codes used to transfer the bit lengths */ #define HEAP_SIZE (2*L_CODES+1) /* maximum heap size */ #define MAX_BITS 15 /* All codes must not exceed MAX_BITS bits */ #define INIT_STATE 42 #define BUSY_STATE 113 #define FINISH_STATE 666 /* Stream status */ /* Data structure describing a single value and its code string. */ typedef struct ct_data_s { union { ush freq; /* frequency count */ ush code; /* bit string */ } fc; union { ush dad; /* father node in Huffman tree */ ush len; /* length of bit string */ } dl; } FAR ct_data; #define Freq fc.freq #define Code fc.code #define Dad dl.dad #define Len dl.len typedef struct static_tree_desc_s static_tree_desc; typedef struct tree_desc_s { ct_data *dyn_tree; /* the dynamic tree */ int max_code; /* largest code with non zero frequency */ static_tree_desc *stat_desc; /* the corresponding static tree */ } FAR tree_desc; typedef ush Pos; typedef Pos FAR Posf; typedef unsigned IPos; /* A Pos is an index in the character window. We use short instead of int to * save space in the various tables. IPos is used only for parameter passing. */ typedef struct internal_state { z_streamp strm; /* pointer back to this zlib stream */ int status; /* as the name implies */ Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ int pending; /* nb of bytes in the pending buffer */ int noheader; /* suppress zlib header and adler32 */ Byte data_type; /* UNKNOWN, BINARY or ASCII */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ /* used by deflate.c: */ uInt w_size; /* LZ77 window size (32K by default) */ uInt w_bits; /* log2(w_size) (8..16) */ uInt w_mask; /* w_size - 1 */ Bytef *window; /* Sliding window. Input bytes are read into the second half of the window, * and move to the first half later to keep a dictionary of at least wSize * bytes. With this organization, matches are limited to a distance of * wSize-MAX_MATCH bytes, but this ensures that IO is always * performed with a length multiple of the block size. Also, it limits * the window size to 64K, which is quite useful on MSDOS. * To do: use the user input buffer as sliding window. */ ulg window_size; /* Actual size of window: 2*wSize, except when the user input buffer * is directly used as sliding window. */ Posf *prev; /* Link to older string with same hash index. To limit the size of this * array to 64K, this link is maintained only for the last 32K strings. * An index in this array is thus a window index modulo 32K. */ Posf *head; /* Heads of the hash chains or NIL. */ uInt ins_h; /* hash index of string to be inserted */ uInt hash_size; /* number of elements in hash table */ uInt hash_bits; /* log2(hash_size) */ uInt hash_mask; /* hash_size-1 */ uInt hash_shift; /* Number of bits by which ins_h must be shifted at each input * step. It must be such that after MIN_MATCH steps, the oldest * byte no longer takes part in the hash key, that is: * hash_shift * MIN_MATCH >= hash_bits */ long block_start; /* Window position at the beginning of the current output block. Gets * negative when the window is moved backwards. */ uInt match_length; /* length of best match */ IPos prev_match; /* previous match */ int match_available; /* set if previous match exists */ uInt strstart; /* start of string to insert */ uInt match_start; /* start of matching string */ uInt lookahead; /* number of valid bytes ahead in window */ uInt prev_length; /* Length of the best match at previous step. Matches not greater than this * are discarded. This is used in the lazy match evaluation. */ uInt max_chain_length; /* To speed up deflation, hash chains are never searched beyond this * length. A higher limit improves compression ratio but degrades the * speed. */ uInt max_lazy_match; /* Attempt to find a better match only when the current match is strictly * smaller than this value. This mechanism is used only for compression * levels >= 4. */ # define max_insert_length max_lazy_match /* Insert new strings in the hash table only if the match length is not * greater than this length. This saves time but degrades compression. * max_insert_length is used only for compression levels <= 3. */ int level; /* compression level (1..9) */ int strategy; /* favor or force Huffman coding*/ uInt good_match; /* Use a faster search when the previous match is longer than this */ int nice_match; /* Stop searching when current match exceeds this */ /* used by trees.c: */ /* Didn't use ct_data typedef below to supress compiler warning */ struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ struct tree_desc_s l_desc; /* desc. for literal tree */ struct tree_desc_s d_desc; /* desc. for distance tree */ struct tree_desc_s bl_desc; /* desc. for bit length tree */ ush bl_count[MAX_BITS+1]; /* number of codes at each bit length for an optimal tree */ int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ int heap_len; /* number of elements in the heap */ int heap_max; /* element of largest frequency */ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. * The same heap array is used to build all trees. */ uch depth[2*L_CODES+1]; /* Depth of each subtree used as tie breaker for trees of equal frequency */ uchf *l_buf; /* buffer for literals or lengths */ uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for * limiting lit_bufsize to 64K: * - frequencies can be kept in 16 bit counters * - if compression is not successful for the first block, all input * data is still in the window so we can still emit a stored block even * when input comes from standard input. (This can also be done for * all blocks if lit_bufsize is not greater than 32K.) * - if compression is not successful for a file smaller than 64K, we can * even emit a stored file instead of a stored block (saving 5 bytes). * This is applicable only for zip (not gzip or zlib). * - creating new Huffman trees less frequently may not provide fast * adaptation to changes in the input data statistics. (Take for * example a binary file with poorly compressible code followed by * a highly compressible string table.) Smaller buffer sizes give * fast adaptation but have of course the overhead of transmitting * trees more frequently. * - I can't count above 4 */ uInt last_lit; /* running index in l_buf */ ushf *d_buf; /* Buffer for distances. To simplify the code, d_buf and l_buf have * the same number of elements. To use different lengths, an extra flag * array would be necessary. */ ulg opt_len; /* bit length of current block with optimal trees */ ulg static_len; /* bit length of current block with static trees */ ulg compressed_len; /* total bit length of compressed file */ uInt matches; /* number of string matches in current block */ int last_eob_len; /* bit length of EOB code for last block */ #ifdef DEBUG ulg bits_sent; /* bit length of the compressed data */ #endif ush bi_buf; /* Output buffer. bits are inserted starting at the bottom (least * significant bits). */ int bi_valid; /* Number of valid bits in bi_buf. All bits above the last valid bit * are always zero. */ } FAR deflate_state; /* Output a byte on the stream. * IN assertion: there is enough room in pending_buf. */ #define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) /* Minimum amount of lookahead, except at the end of the input file. * See deflate.c for comments about the MIN_MATCH+1. */ #define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) /* In order to simplify the code, particularly on 16 bit machines, match * distances are limited to MAX_DIST instead of WSIZE. */ /* in trees.c */ void _tr_init OF((deflate_state *s)); int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); ulg _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, int eof)); void _tr_align OF((deflate_state *s)); void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, int eof)); #endif @ 1.1.1.1 log @Import XFree 3.9.16 @ text @@ 1.1.1.1.86.1 log @Initial merge of trunk onto branch. @ text @d1 1 a1 1 /* $Xorg: deflate.h,v 1.3 2000/08/17 19:46:47 cpqbld Exp $ */ @ 1.1.1.2 log @Import of XFree86 4.0.99.1 @ text @d1 1 a1 1 /* $Xorg: deflate.h,v 1.3 2000/08/17 19:46:47 cpqbld Exp $ */ @