brotli 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/brotli/brotli.cc +114 -24
- data/ext/brotli/brotli.h +0 -1
- data/ext/brotli/extconf.rb +30 -23
- data/lib/brotli/version.rb +1 -1
- data/vendor/brotli/LICENSE +1 -1
- data/vendor/brotli/dec/Makefile +1 -1
- data/vendor/brotli/dec/bit_reader.c +3 -3
- data/vendor/brotli/dec/bit_reader.h +25 -27
- data/vendor/brotli/dec/context.h +4 -4
- data/vendor/brotli/dec/decode.c +410 -486
- data/vendor/brotli/dec/decode.h +101 -105
- data/vendor/brotli/dec/dictionary.c +1 -1
- data/vendor/brotli/dec/dictionary.h +7 -8
- data/vendor/brotli/dec/huffman.c +103 -105
- data/vendor/brotli/dec/huffman.h +18 -18
- data/vendor/brotli/dec/port.h +52 -40
- data/vendor/brotli/dec/prefix.h +2 -0
- data/vendor/brotli/dec/state.c +13 -19
- data/vendor/brotli/dec/state.h +25 -39
- data/vendor/brotli/dec/transform.h +38 -44
- data/vendor/brotli/dec/types.h +2 -2
- data/vendor/brotli/enc/Makefile +1 -1
- data/vendor/brotli/enc/backward_references.cc +455 -359
- data/vendor/brotli/enc/backward_references.h +79 -3
- data/vendor/brotli/enc/bit_cost.h +54 -32
- data/vendor/brotli/enc/block_splitter.cc +285 -193
- data/vendor/brotli/enc/block_splitter.h +4 -12
- data/vendor/brotli/enc/brotli_bit_stream.cc +623 -324
- data/vendor/brotli/enc/brotli_bit_stream.h +76 -37
- data/vendor/brotli/enc/cluster.h +161 -120
- data/vendor/brotli/enc/command.h +60 -37
- data/vendor/brotli/enc/compress_fragment.cc +701 -0
- data/vendor/brotli/enc/compress_fragment.h +47 -0
- data/vendor/brotli/enc/compress_fragment_two_pass.cc +524 -0
- data/vendor/brotli/enc/compress_fragment_two_pass.h +40 -0
- data/vendor/brotli/enc/compressor.h +15 -0
- data/vendor/brotli/enc/context.h +1 -1
- data/vendor/brotli/enc/dictionary.h +2 -2
- data/vendor/brotli/enc/encode.cc +819 -286
- data/vendor/brotli/enc/encode.h +38 -15
- data/vendor/brotli/enc/encode_parallel.cc +40 -42
- data/vendor/brotli/enc/entropy_encode.cc +144 -147
- data/vendor/brotli/enc/entropy_encode.h +32 -8
- data/vendor/brotli/enc/entropy_encode_static.h +572 -0
- data/vendor/brotli/enc/fast_log.h +7 -40
- data/vendor/brotli/enc/find_match_length.h +9 -9
- data/vendor/brotli/enc/hash.h +462 -154
- data/vendor/brotli/enc/histogram.cc +6 -6
- data/vendor/brotli/enc/histogram.h +13 -13
- data/vendor/brotli/enc/literal_cost.cc +45 -45
- data/vendor/brotli/enc/metablock.cc +92 -89
- data/vendor/brotli/enc/metablock.h +12 -12
- data/vendor/brotli/enc/port.h +7 -16
- data/vendor/brotli/enc/prefix.h +23 -22
- data/vendor/brotli/enc/ringbuffer.h +75 -29
- data/vendor/brotli/enc/static_dict.cc +56 -48
- data/vendor/brotli/enc/static_dict.h +5 -5
- data/vendor/brotli/enc/streams.cc +1 -1
- data/vendor/brotli/enc/streams.h +5 -5
- data/vendor/brotli/enc/transform.h +40 -35
- data/vendor/brotli/enc/types.h +2 -0
- data/vendor/brotli/enc/utf8_util.cc +3 -2
- data/vendor/brotli/enc/write_bits.h +6 -6
- metadata +9 -5
- data/vendor/brotli/dec/streams.c +0 -102
- data/vendor/brotli/dec/streams.h +0 -95
@@ -18,10 +18,10 @@ namespace brotli {
|
|
18
18
|
// Separate implementation for little-endian 64-bit targets, for speed.
|
19
19
|
#if defined(__GNUC__) && defined(_LP64) && defined(IS_LITTLE_ENDIAN)
|
20
20
|
|
21
|
-
static inline
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
static inline size_t FindMatchLengthWithLimit(const uint8_t* s1,
|
22
|
+
const uint8_t* s2,
|
23
|
+
size_t limit) {
|
24
|
+
size_t matched = 0;
|
25
25
|
size_t limit2 = (limit >> 3) + 1; // + 1 is for pre-decrement in while
|
26
26
|
while (PREDICT_TRUE(--limit2)) {
|
27
27
|
if (PREDICT_FALSE(BROTLI_UNALIGNED_LOAD64(s2) ==
|
@@ -31,7 +31,7 @@ static inline int FindMatchLengthWithLimit(const uint8_t* s1,
|
|
31
31
|
} else {
|
32
32
|
uint64_t x =
|
33
33
|
BROTLI_UNALIGNED_LOAD64(s2) ^ BROTLI_UNALIGNED_LOAD64(s1 + matched);
|
34
|
-
|
34
|
+
size_t matching_bits = static_cast<size_t>(__builtin_ctzll(x));
|
35
35
|
matched += matching_bits >> 3;
|
36
36
|
return matched;
|
37
37
|
}
|
@@ -48,10 +48,10 @@ static inline int FindMatchLengthWithLimit(const uint8_t* s1,
|
|
48
48
|
return matched;
|
49
49
|
}
|
50
50
|
#else
|
51
|
-
static inline
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
static inline size_t FindMatchLengthWithLimit(const uint8_t* s1,
|
52
|
+
const uint8_t* s2,
|
53
|
+
size_t limit) {
|
54
|
+
size_t matched = 0;
|
55
55
|
const uint8_t* s2_limit = s2 + limit;
|
56
56
|
const uint8_t* s2_ptr = s2;
|
57
57
|
// Find out how long the match is. We loop over the data 32 bits at a
|