Lines Matching defs:dist
316 int dist; /* distance index */
346 /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
347 dist = 0;
349 base_dist[code] = dist;
351 _dist_code[dist++] = (uch)code;
354 Assert (dist == 256, "tr_static_init: dist != 256");
355 dist >>= 7; /* from now on, all distances are divided by 128 */
357 base_dist[code] = dist << 7;
359 _dist_code[256 + dist++] = (uch)code;
362 Assert (dist == 256, "tr_static_init: 256 + dist != 512");
925 unsigned dist; /* distance of matched string */
926 int lc; /* match length or unmatched char (if dist == 0) */
933 dist = s->d_buf[sx];
936 dist = s->sym_buf[sx++] & 0xff;
937 dist += (unsigned)(s->sym_buf[sx++] & 0xff) << INDEX_8;
940 if (dist == 0) {
952 dist--; /* dist is now the match distance - 1 */
953 code = d_code(dist);
959 dist -= (unsigned)base_dist[code];
960 send_bits(s, dist, extra); /* send the extra distance bits */
1119 int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) {
1121 s->d_buf[s->sym_next] = (ush)dist;
1124 s->sym_buf[s->sym_next++] = (uch)dist;
1125 s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
1128 if (dist == 0) {
1134 dist--; /* dist = match distance - 1 */
1135 Assert((ush)dist < (ush)MAX_DIST(s) &&
1137 (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
1140 s->dyn_dtree[d_code(dist)].Freq++;