mirror of
https://github.com/GerbilSoft/zlib-ng.git
synced 2025-06-18 11:35:35 -04:00
Discard repeated words
This commit is contained in:
parent
e841518da7
commit
73bbb54cf6
@ -54,7 +54,7 @@ Z_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const uint8_t *buf, size_t len
|
|||||||
if (len < 16 + align_offset) {
|
if (len < 16 + align_offset) {
|
||||||
/* Let's eat the cost of this one unaligned load so that
|
/* Let's eat the cost of this one unaligned load so that
|
||||||
* we don't completely skip over the vectorization. Doing
|
* we don't completely skip over the vectorization. Doing
|
||||||
* 16 bytes at a time unaligned is is better than 16 + <= 15
|
* 16 bytes at a time unaligned is better than 16 + <= 15
|
||||||
* sums */
|
* sums */
|
||||||
vbuf = _mm_loadu_si128((__m128i*)buf);
|
vbuf = _mm_loadu_si128((__m128i*)buf);
|
||||||
len -= 16;
|
len -= 16;
|
||||||
|
@ -44,7 +44,7 @@ typedef struct {
|
|||||||
examples/enough.c found in the zlib distributions. The arguments to that
|
examples/enough.c found in the zlib distributions. The arguments to that
|
||||||
program are the number of symbols, the initial root table size, and the
|
program are the number of symbols, the initial root table size, and the
|
||||||
maximum bit length of a code. "enough 286 10 15" for literal/length codes
|
maximum bit length of a code. "enough 286 10 15" for literal/length codes
|
||||||
returns returns 1332, and "enough 30 9 15" for distance codes returns 592.
|
returns 1332, and "enough 30 9 15" for distance codes returns 592.
|
||||||
The initial root table size (10 or 9) is found in the fifth argument of the
|
The initial root table size (10 or 9) is found in the fifth argument of the
|
||||||
inflate_table() calls in inflate.c and infback.c. If the root table size is
|
inflate_table() calls in inflate.c and infback.c. If the root table size is
|
||||||
changed, then these maximum sizes would be need to be recalculated and
|
changed, then these maximum sizes would be need to be recalculated and
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Update a hash value with the given input byte
|
* Update a hash value with the given input byte
|
||||||
* IN assertion: all calls to to UPDATE_HASH are made with consecutive
|
* IN assertion: all calls to UPDATE_HASH are made with consecutive
|
||||||
* input characters, so that a running hash key can be computed from the
|
* input characters, so that a running hash key can be computed from the
|
||||||
* previous key instead of complete recalculation each time.
|
* previous key instead of complete recalculation each time.
|
||||||
*/
|
*/
|
||||||
@ -81,7 +81,7 @@ Z_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, uint32_t str) {
|
|||||||
* Insert string str in the dictionary and set match_head to the previous head
|
* Insert string str in the dictionary and set match_head to the previous head
|
||||||
* of the hash chain (the most recent string with same hash key). Return
|
* of the hash chain (the most recent string with same hash key). Return
|
||||||
* the previous length of the hash chain.
|
* the previous length of the hash chain.
|
||||||
* IN assertion: all calls to to INSERT_STRING are made with consecutive
|
* IN assertion: all calls to INSERT_STRING are made with consecutive
|
||||||
* input characters and the first STD_MIN_MATCH bytes of str are valid
|
* input characters and the first STD_MIN_MATCH bytes of str are valid
|
||||||
* (except for the last STD_MIN_MATCH-1 bytes of the input file).
|
* (except for the last STD_MIN_MATCH-1 bytes of the input file).
|
||||||
*/
|
*/
|
||||||
|
@ -109,7 +109,7 @@ void gz_compress(FILE *in, gzFile out) {
|
|||||||
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
|
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
|
||||||
|
|
||||||
/* Try compressing the input file at once using mmap. Return Z_OK if
|
/* Try compressing the input file at once using mmap. Return Z_OK if
|
||||||
* if success, Z_ERRNO otherwise.
|
* success, Z_ERRNO otherwise.
|
||||||
*/
|
*/
|
||||||
int gz_compress_mmap(FILE *in, gzFile out) {
|
int gz_compress_mmap(FILE *in, gzFile out) {
|
||||||
int len;
|
int len;
|
||||||
|
@ -129,7 +129,7 @@ void gz_compress(FILE *in, gzFile out) {
|
|||||||
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
|
#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */
|
||||||
|
|
||||||
/* Try compressing the input file at once using mmap. Return Z_OK if
|
/* Try compressing the input file at once using mmap. Return Z_OK if
|
||||||
* if success, Z_ERRNO otherwise.
|
* success, Z_ERRNO otherwise.
|
||||||
*/
|
*/
|
||||||
int gz_compress_mmap(FILE *in, gzFile out) {
|
int gz_compress_mmap(FILE *in, gzFile out) {
|
||||||
int len;
|
int len;
|
||||||
|
@ -924,7 +924,7 @@ Z_EXTERN int Z_EXPORT inflateSync(z_stream *strm);
|
|||||||
inflateSync returns Z_OK if a possible full flush point has been found,
|
inflateSync returns Z_OK if a possible full flush point has been found,
|
||||||
Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
|
Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
|
||||||
has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
|
has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
|
||||||
In the success case, the application may save the current current value of
|
In the success case, the application may save the current value of
|
||||||
total_in which indicates where valid compressed data was found. In the
|
total_in which indicates where valid compressed data was found. In the
|
||||||
error case, the application may repeatedly call inflateSync, providing more
|
error case, the application may repeatedly call inflateSync, providing more
|
||||||
input each time, until success or end of the input data.
|
input each time, until success or end of the input data.
|
||||||
|
Loading…
Reference in New Issue
Block a user