MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / inflate_fast

Function inflate_fast

extlibs/minizip/src/inffast.c:50–348  ·  view source on GitHub ↗

Decode literal, length, and distance codes and write out the resulting literal and match bytes until either not enough input or output is available, an end-of-block is encountered, or a data error is encountered. When large enough input and output buffers are supplied to inflate(), for example, a 16K input buffer and a 64K output buffer, more than 95% of the inflate execution time i

(strm, start)

Source from the content-addressed store, hash-verified

48 output space.
49 */
50void ZLIB_INTERNAL inflate_fast(strm, start)
51z_streamp strm;
52
53unsigned start; /* inflate()'s starting value for strm->avail_out */
54{
55 struct inflate_state FAR * state;
56 z_const unsigned char FAR * in; /* local strm->next_in */
57 z_const unsigned char FAR * last; /* have enough input while in < last */
58 unsigned char FAR * out; /* local strm->next_out */
59 unsigned char FAR * beg; /* inflate()'s initial strm->next_out */
60 unsigned char FAR * end; /* while out < end, enough space available */
61#ifdef INFLATE_STRICT
62 unsigned dmax; /* maximum distance from zlib header */
63#endif
64 unsigned wsize; /* window size or zero if not using window */
65 unsigned whave; /* valid bytes in the window */
66 unsigned wnext; /* window write index */
67 unsigned char FAR * window; /* allocated sliding window, if wsize != 0 */
68 unsigned long hold; /* local strm->hold */
69 unsigned bits; /* local strm->bits */
70 code const FAR * lcode; /* local strm->lencode */
71 code const FAR * dcode; /* local strm->distcode */
72 unsigned lmask; /* mask for first level of length codes */
73 unsigned dmask; /* mask for first level of distance codes */
74 code here; /* retrieved table entry */
75 unsigned op; /* code bits, operation, extra bits, or */
76 /* window position, window bytes to copy */
77 unsigned len; /* match length, unused bytes */
78 unsigned dist; /* match distance */
79 unsigned char FAR * from; /* where to copy match from */
80
81 /* copy state to local variables */
82 state = (struct inflate_state FAR *)strm->state;
83 in = strm->next_in;
84 last = in + (strm->avail_in - 5);
85 out = strm->next_out;
86 beg = out - (start - strm->avail_out);
87 end = out + (strm->avail_out - 257);
88#ifdef INFLATE_STRICT
89 dmax = state->dmax;
90#endif
91 wsize = state->wsize;
92 whave = state->whave;
93 wnext = state->wnext;
94 window = state->window;
95 hold = state->hold;
96 bits = state->bits;
97 lcode = state->lencode;
98 dcode = state->distcode;
99 lmask = (1U << state->lenbits) - 1;
100 dmask = (1U << state->distbits) - 1;
101
102 /* decode literals and length/distances until end-of-block or not enough
103 input data or output space */
104 do
105 {
106 if (bits < 15)
107 {

Callers 2

inflateBackFunction · 0.85
inflate.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected