512 unsigned char *bp = (
unsigned char *)
dest;
513 unsigned char *bstart = bp;
515 bool hist_recycle =
false;
517 const char *dend =
source + slen;
518 unsigned char ctrl_dummy = 0;
519 unsigned char *ctrlp = &ctrl_dummy;
520 unsigned char ctrlb = 0;
521 unsigned char ctrl = 0;
522 bool found_match =
false;
536 if (strategy == NULL)
544 slen < strategy->min_input_size ||
554 else if (good_match < 17)
560 else if (good_drop > 100)
566 else if (need_rate > 99)
574 if (slen > (INT_MAX / 100))
577 result_max = (slen / 100) * (100 - need_rate);
580 result_max = (slen * (100 - need_rate)) / 100;
594 else if (slen < 1024)
618 if (bp - bstart >= result_max)
634 &match_off, good_match, good_drop, mask))
640 pglz_out_tag(ctrlp, ctrlb, ctrl, bp, match_len, match_off);
644 hist_next, hist_recycle,
658 hist_next, hist_recycle,
670 result_size = bp - bstart;
671 if (result_size >= result_max)
static int16 hist_start[PGLZ_MAX_HISTORY_LISTS]
const PGLZ_Strategy *const PGLZ_strategy_default
static int pglz_find_match(int16 *hstart, const char *input, const char *end, int *lenp, int *offp, int good_match, int good_drop, int mask)
static PGLZ_HistEntry hist_entries[PGLZ_HISTORY_SIZE+1]
#define pglz_out_tag(_ctrlp, _ctrlb, _ctrl, _buf, _len, _off)
#define pglz_out_literal(_ctrlp, _ctrlb, _ctrl, _buf, _byte)
#define pglz_hist_add(_hs, _he, _hn, _recycle, _s, _e, _mask)
static rewind_source * source