aboutsummaryrefslogtreecommitdiff
path: root/inffast.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:26:49 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:26:49 -0700
commitd004b047838a7e803818b4973a2e39e0ff8c1fa2 (patch)
tree9e8c804f78d73152c70d4ff24c6a7531a0d46782 /inffast.c
parentf6194ef39af5864f792412460c354cc339dde7d1 (diff)
downloadzlib-d004b047838a7e803818b4973a2e39e0ff8c1fa2.tar.gz
zlib-d004b047838a7e803818b4973a2e39e0ff8c1fa2.tar.bz2
zlib-d004b047838a7e803818b4973a2e39e0ff8c1fa2.zip
zlib 1.2.3.5v1.2.3.5
Diffstat (limited to 'inffast.c')
-rw-r--r--inffast.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/inffast.c b/inffast.c
index 97f9a84..0a0761f 100644
--- a/inffast.c
+++ b/inffast.c
@@ -79,7 +79,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
79#endif 79#endif
80 unsigned wsize; /* window size or zero if not using window */ 80 unsigned wsize; /* window size or zero if not using window */
81 unsigned whave; /* valid bytes in the window */ 81 unsigned whave; /* valid bytes in the window */
82 unsigned write; /* window write index */ 82 unsigned wnext; /* window write index */
83 unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ 83 unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
84 unsigned long hold; /* local strm->hold */ 84 unsigned long hold; /* local strm->hold */
85 unsigned bits; /* local strm->bits */ 85 unsigned bits; /* local strm->bits */
@@ -106,7 +106,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
106#endif 106#endif
107 wsize = state->wsize; 107 wsize = state->wsize;
108 whave = state->whave; 108 whave = state->whave;
109 write = state->write; 109 wnext = state->wnext;
110 window = state->window; 110 window = state->window;
111 hold = state->hold; 111 hold = state->hold;
112 bits = state->bits; 112 bits = state->bits;
@@ -214,7 +214,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
214#endif 214#endif
215 } 215 }
216 from = window - OFF; 216 from = window - OFF;
217 if (write == 0) { /* very common case */ 217 if (wnext == 0) { /* very common case */
218 from += wsize - op; 218 from += wsize - op;
219 if (op < len) { /* some from window */ 219 if (op < len) { /* some from window */
220 len -= op; 220 len -= op;
@@ -224,17 +224,17 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
224 from = out - dist; /* rest from output */ 224 from = out - dist; /* rest from output */
225 } 225 }
226 } 226 }
227 else if (write < op) { /* wrap around window */ 227 else if (wnext < op) { /* wrap around window */
228 from += wsize + write - op; 228 from += wsize + wnext - op;
229 op -= write; 229 op -= wnext;
230 if (op < len) { /* some from end of window */ 230 if (op < len) { /* some from end of window */
231 len -= op; 231 len -= op;
232 do { 232 do {
233 PUP(out) = PUP(from); 233 PUP(out) = PUP(from);
234 } while (--op); 234 } while (--op);
235 from = window - OFF; 235 from = window - OFF;
236 if (write < len) { /* some from start of window */ 236 if (wnext < len) { /* some from start of window */
237 op = write; 237 op = wnext;
238 len -= op; 238 len -= op;
239 do { 239 do {
240 PUP(out) = PUP(from); 240 PUP(out) = PUP(from);
@@ -244,7 +244,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
244 } 244 }
245 } 245 }
246 else { /* contiguous in window */ 246 else { /* contiguous in window */
247 from += write - op; 247 from += wnext - op;
248 if (op < len) { /* some from window */ 248 if (op < len) { /* some from window */
249 len -= op; 249 len -= op;
250 do { 250 do {
@@ -327,7 +327,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
327 inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): 327 inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
328 - Using bit fields for code structure 328 - Using bit fields for code structure
329 - Different op definition to avoid & for extra bits (do & for table bits) 329 - Different op definition to avoid & for extra bits (do & for table bits)
330 - Three separate decoding do-loops for direct, window, and write == 0 330 - Three separate decoding do-loops for direct, window, and wnext == 0
331 - Special case for distance > 1 copies to do overlapped load and store copy 331 - Special case for distance > 1 copies to do overlapped load and store copy
332 - Explicit branch predictions (based on measured branch probabilities) 332 - Explicit branch predictions (based on measured branch probabilities)
333 - Deferring match copy and interspersed it with decoding subsequent codes 333 - Deferring match copy and interspersed it with decoding subsequent codes