Lines Matching +full:len +full:- +full:or +full:- +full:define

2 #define DEFUTIL_H
6 #define Assert(err, str)
7 #define Trace(dummy)
8 #define Tracev(dummy)
9 #define Tracecv(err, dummy)
10 #define Tracevv(dummy)
14 #define LENGTH_CODES 29
17 #define LITERALS 256
20 #define L_CODES (LITERALS+1+LENGTH_CODES)
21 /* number of Literal or Length codes, including the END_BLOCK code */
23 #define D_CODES 30
26 #define BL_CODES 19
29 #define HEAP_SIZE (2*L_CODES+1)
32 #define MAX_BITS 15
35 #define INIT_STATE 42
36 #define BUSY_STATE 113
37 #define FINISH_STATE 666
49 ush len; /* length of bit string */ member
53 #define Freq fc.freq
54 #define Code fc.code
55 #define Dad dl.dad
56 #define Len dl.len macro
81 Byte data_type; /* UNKNOWN, BINARY or ASCII */
82 Byte method; /* STORED (for zip only) or DEFLATED */
89 uInt w_mask; /* w_size - 1 */
95 * wSize-MAX_MATCH bytes, but this ensures that IO is always
112 Pos *head; /* Heads of the hash chains or NIL. */
117 uInt hash_mask; /* hash_size-1 */
154 # define max_insert_length max_lazy_match
161 int strategy; /* favor or force Huffman coding*/
192 uch *l_buf; /* buffer for literals or lengths */
197 * - frequencies can be kept in 16 bit counters
198 * - if compression is not successful for the first block, all input
202 * - if compression is not successful for a file smaller than 64K, we can
204 * This is applicable only for zip (not gzip or zlib).
205 * - creating new Huffman trees less frequently may not provide fast
211 * - I can't count above 4
244 #define zlib_deflate_window_memsize(windowBits) \
247 #define zlib_deflate_window_memsize(windowBits) \
250 #define zlib_deflate_prev_memsize(windowBits) \
252 #define zlib_deflate_head_memsize(memLevel) \
254 #define zlib_deflate_overlay_memsize(memLevel) \
260 #define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
263 #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
268 #define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
288 #define put_short(s, w) { \
294 * Reverse the first len bits of a code, using straightforward code (a faster
296 * IN assertion: 1 <= len <= 15
300 int len /* its bit length */ in bi_reverse() argument
307 } while (--len > 0); in bi_reverse()
316 if (s->bi_valid == 16) { in bi_flush()
317 put_short(s, s->bi_buf); in bi_flush()
318 s->bi_buf = 0; in bi_flush()
319 s->bi_valid = 0; in bi_flush()
320 } else if (s->bi_valid >= 8) { in bi_flush()
321 put_byte(s, (Byte)s->bi_buf); in bi_flush()
322 s->bi_buf >>= 8; in bi_flush()
323 s->bi_valid -= 8; in bi_flush()
332 if (s->bi_valid > 8) { in bi_windup()
333 put_short(s, s->bi_buf); in bi_windup()
334 } else if (s->bi_valid > 0) { in bi_windup()
335 put_byte(s, (Byte)s->bi_buf); in bi_windup()
337 s->bi_buf = 0; in bi_windup()
338 s->bi_valid = 0; in bi_windup()
340 s->bits_sent = (s->bits_sent+7) & ~7; in bi_windup()
345 need_more, /* block not completed, need more input or more output */
348 finish_done /* finish done, accept no more input or output */
351 #define Buf_size (8 * 2*sizeof(char))
371 s->bits_sent += (ulg)length; in send_bits()
374 * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) in send_bits()
377 if (s->bi_valid > (int)Buf_size - length) { in send_bits()
378 s->bi_buf |= (value << s->bi_valid); in send_bits()
379 put_short(s, s->bi_buf); in send_bits()
380 s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); in send_bits()
381 s->bi_valid += length - Buf_size; in send_bits()
383 s->bi_buf |= value << s->bi_valid; in send_bits()
384 s->bi_valid += length; in send_bits()
389 #define send_bits(s, value, length) \
390 { int len = length;\
391 if (s->bi_valid > (int)Buf_size - len) {\
393 s->bi_buf |= (val << s->bi_valid);\
394 put_short(s, s->bi_buf);\
395 s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
396 s->bi_valid += len - Buf_size;\
398 s->bi_buf |= (value) << s->bi_valid;\
399 s->bi_valid += len;\
416 * to avoid allocating a large strm->next_out buffer and copying into it.
423 unsigned len; in flush_pending() local
424 deflate_state *s = (deflate_state *) strm->state; in flush_pending()
427 len = s->pending; in flush_pending()
428 if (len > strm->avail_out) len = strm->avail_out; in flush_pending()
429 if (len == 0) return; in flush_pending()
431 if (strm->next_out != NULL) { in flush_pending()
432 memcpy(strm->next_out, s->pending_out, len); in flush_pending()
433 strm->next_out += len; in flush_pending()
435 s->pending_out += len; in flush_pending()
436 strm->total_out += len; in flush_pending()
437 strm->avail_out -= len; in flush_pending()
438 s->pending -= len; in flush_pending()
439 if (s->pending == 0) { in flush_pending()
440 s->pending_out = s->pending_buf; in flush_pending()