Lines Matching full:symbol
65 * - Catch missing end-of-block symbol error
202 * symbol[] are the symbol values in canonical order, where the number of
208 short *symbol; /* canonically ordered symbols */ member
212 * Decode a code from the stream s using huffman table h. Return the symbol or
241 int index; /* index of first code of length len in symbol table */ in decode()
247 if (code - count < first) /* if length len, return symbol */ in decode()
248 return h->symbol[index + (code - first)]; in decode()
269 int index; /* index of first code of length len in symbol table */ in decode()
284 if (code - count < first) { /* if length len, return symbol */ in decode()
287 return h->symbol[index + (code - first)]; in decode()
318 * enough bits will resolve to a symbol. If the return value is positive, then
325 * one symbol, which is an error in a dynamic block.
334 * codes and any code with a single symbol which in deflate is coded as one
342 int symbol; /* current symbol when stepping through length[] */ in construct() local
345 short offs[MAXBITS+1]; /* offsets in symbol table for each length */ in construct()
350 for (symbol = 0; symbol < n; symbol++) in construct()
351 (h->count[length[symbol]])++; /* assumes lengths are within bounds */ in construct()
364 /* generate offsets into symbol table for each length for sorting */ in construct()
370 * put symbols in table sorted by length, by symbol order within each in construct()
373 for (symbol = 0; symbol < n; symbol++) in construct()
374 if (length[symbol] != 0) in construct()
375 h->symbol[offs[length[symbol]]++] = symbol; in construct()
395 * symbols (257..285), and the end-of-block symbol (256).
399 * by just a length symbol. Lengths 11..257 are represented as a symbol and
401 * of the length symbol. The number of extra bits is determined by the base
402 * length symbol. These are in the static arrays below, lens[] for the base
405 * - The reason that 258 gets its own symbol is that the longest length is used
413 * to a base value represented by the symbol. The distances 1..4 get their
414 * own symbol, but the rest require extra bits. The base distances and
440 int symbol; /* decoded symbol */ in codes() local
460 symbol = decode(s, lencode); in codes()
461 if (symbol < 0) in codes()
462 return symbol; /* invalid symbol */ in codes()
463 if (symbol < 256) { /* literal: symbol is the byte */ in codes()
468 s->out[s->outcnt] = symbol; in codes()
472 else if (symbol > 256) { /* length */ in codes()
474 symbol -= 257; in codes()
475 if (symbol >= 29) in codes()
477 len = lens[symbol] + bits(s, lext[symbol]); in codes()
480 symbol = decode(s, distcode); in codes()
481 if (symbol < 0) in codes()
482 return symbol; /* invalid symbol */ in codes()
483 dist = dists[symbol] + bits(s, dext[symbol]); in codes()
506 } while (symbol != 256); /* end of block symbol */ in codes()
521 * codes and distance codes are fixed. The specific lengths for each symbol
545 int symbol; in fixed() local
550 lencode.symbol = lensym; in fixed()
552 distcode.symbol = distsym; in fixed()
555 for (symbol = 0; symbol < 144; symbol++) in fixed()
556 lengths[symbol] = 8; in fixed()
557 for (; symbol < 256; symbol++) in fixed()
558 lengths[symbol] = 9; in fixed()
559 for (; symbol < 280; symbol++) in fixed()
560 lengths[symbol] = 7; in fixed()
561 for (; symbol < FIXLCODES; symbol++) in fixed()
562 lengths[symbol] = 8; in fixed()
566 for (symbol = 0; symbol < MAXDCODES; symbol++) in fixed()
567 lengths[symbol] = 5; in fixed()
590 * are simply a list of code lengths for each symbol.
596 * - If a symbol is not used in the block, this is represented by a zero as
598 * that no code should be created for this symbol. There is no way in the
605 * interesting consequence. Normally if only one symbol is used for a given
608 * only a single distance base symbol appears in a block, then it will be
611 * and should result in an error. So incomplete distance codes of one symbol
618 * literal/length codes of one symbol should also be permitted.
625 * the list of code lengths, a 0 symbol means no code, a 1..15 symbol means
634 * representing no code (0) or the code length for that symbol (1..7).
679 lencode.symbol = lensym; in dynamic()
681 distcode.symbol = distsym; in dynamic()
704 int symbol; /* decoded value */ in dynamic() local
707 symbol = decode(s, &lencode); in dynamic()
708 if (symbol < 0) in dynamic()
709 return symbol; /* invalid symbol */ in dynamic()
710 if (symbol < 16) /* length in 0..15 */ in dynamic()
711 lengths[index++] = symbol; in dynamic()
714 if (symbol == 16) { /* repeat last length 3..6 times */ in dynamic()
718 symbol = 3 + bits(s, 2); in dynamic()
720 else if (symbol == 17) /* repeat zero 3..10 times */ in dynamic()
721 symbol = 3 + bits(s, 3); in dynamic()
723 symbol = 11 + bits(s, 7); in dynamic()
724 if (index + symbol > nlen + ndist) in dynamic()
726 while (symbol--) /* repeat last or zero symbol times */ in dynamic()