Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: third_party/zlib/deflate.h

Issue 677713002: Reland "Integrate SIMD optimisations for zlib" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add MSan suppression, prevent crc_fold_copy reading outside allocated memory, inline insert_string_… Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* deflate.h -- internal compression state 1 /* deflate.h -- internal compression state
2 * Copyright (C) 1995-2010 Jean-loup Gailly 2 * Copyright (C) 1995-2010 Jean-loup Gailly
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6 /* WARNING: this file should *not* be used by applications. It is 6 /* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is 7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h. 8 subject to change. Applications should only use zlib.h.
9 */ 9 */
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 Bytef *pending_buf; /* output still pending */ 100 Bytef *pending_buf; /* output still pending */
101 ulg pending_buf_size; /* size of pending_buf */ 101 ulg pending_buf_size; /* size of pending_buf */
102 Bytef *pending_out; /* next pending byte to output to the stream */ 102 Bytef *pending_out; /* next pending byte to output to the stream */
103 uInt pending; /* nb of bytes in the pending buffer */ 103 uInt pending; /* nb of bytes in the pending buffer */
104 int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ 104 int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
105 gz_headerp gzhead; /* gzip header information to write */ 105 gz_headerp gzhead; /* gzip header information to write */
106 uInt gzindex; /* where in extra, name, or comment */ 106 uInt gzindex; /* where in extra, name, or comment */
107 Byte method; /* STORED (for zip only) or DEFLATED */ 107 Byte method; /* STORED (for zip only) or DEFLATED */
108 int last_flush; /* value of flush param for previous deflate call */ 108 int last_flush; /* value of flush param for previous deflate call */
109 109
110 unsigned zalign(16) crc0[4 * 5];
111
110 /* used by deflate.c: */ 112 /* used by deflate.c: */
111 113
112 uInt w_size; /* LZ77 window size (32K by default) */ 114 uInt w_size; /* LZ77 window size (32K by default) */
113 uInt w_bits; /* log2(w_size) (8..16) */ 115 uInt w_bits; /* log2(w_size) (8..16) */
114 uInt w_mask; /* w_size - 1 */ 116 uInt w_mask; /* w_size - 1 */
115 117
116 Bytef *window; 118 Bytef *window;
117 /* Sliding window. Input bytes are read into the second half of the window, 119 /* Sliding window. Input bytes are read into the second half of the window,
118 * and move to the first half later to keep a dictionary of at least wSize 120 * and move to the first half later to keep a dictionary of at least wSize
119 * bytes. With this organization, matches are limited to a distance of 121 * bytes. With this organization, matches are limited to a distance of
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ 339 s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
338 s->dyn_dtree[d_code(dist)].Freq++; \ 340 s->dyn_dtree[d_code(dist)].Freq++; \
339 flush = (s->last_lit == s->lit_bufsize-1); \ 341 flush = (s->last_lit == s->lit_bufsize-1); \
340 } 342 }
341 #else 343 #else
342 # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) 344 # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
343 # define _tr_tally_dist(s, distance, length, flush) \ 345 # define _tr_tally_dist(s, distance, length, flush) \
344 flush = _tr_tally(s, distance, length) 346 flush = _tr_tally(s, distance, length)
345 #endif 347 #endif
346 348
349 /* Functions that are SIMD optimised on x86 */
350 void ZLIB_INTERNAL crc_fold_init(deflate_state* const s);
351 void ZLIB_INTERNAL crc_fold_copy(deflate_state* const s,
352 unsigned char* dst,
353 const unsigned char* src,
354 long len);
355 unsigned ZLIB_INTERNAL crc_fold_512to32(deflate_state* const s);
356
357 void ZLIB_INTERNAL fill_window_sse(deflate_state* s);
358
347 #endif /* DEFLATE_H */ 359 #endif /* DEFLATE_H */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698