diff options
author | Brotli <no-reply@google.com> | 2024-05-30 09:50:58 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-05-30 09:51:43 -0700 |
commit | fe754f3459f4fd60d41aae7e87b5053b2ab3a7a3 (patch) | |
tree | 6fb83737ed90ccb3e93425075364aa2dc6686e85 /c/enc/quality.h | |
parent | 8a626fd486b5fbad245aec29e4e436eeb16041b3 (diff) | |
download | brotli-fe754f3459f4fd60d41aae7e87b5053b2ab3a7a3.zip brotli-fe754f3459f4fd60d41aae7e87b5053b2ab3a7a3.tar.gz brotli-fe754f3459f4fd60d41aae7e87b5053b2ab3a7a3.tar.bz2 |
Use a hash table header and SIMD to speed up hash table operations (similar to [Swiss Tables](https://abseil.io/about/design/swisstables)).
PiperOrigin-RevId: 638686412
Diffstat (limited to 'c/enc/quality.h')
-rw-r--r-- | c/enc/quality.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/c/enc/quality.h b/c/enc/quality.h index ffdfd72..4fe649e 100644 --- a/c/enc/quality.h +++ b/c/enc/quality.h @@ -128,16 +128,16 @@ static BROTLI_INLINE size_t LiteralSpreeLengthForSparseSearch( - q04: h04 (longest_match_quickly), b17, l5 - q04: h54 (longest_match_quickly), b20, l7 | for large files - - q05: h05 (longest_match ), b14, l4 - - q05: h06 (longest_match64 ), b15, l5 | for large files + - q05: h58 (longest_match_simd ), b14, l4 + - q05: h68 (longest_match64_simd ), b15, l5 | for large files - q05: h40 (forgetful_chain ), b15, l4 | for small window - - q06: h05 (longest_match ), b14, l4 - - q06: h06 (longest_match64 ), b15, l5 | for large files + - q06: h58 (longest_match_simd ), b14, l4 + - q06: h68 (longest_match64_simd ), b15, l5 | for large files - q06: h40 (forgetful_chain ), b15, l4 | for small window - - q07: h05 (longest_match ), b15, l4 - - q07: h06 (longest_match64 ), b15, l5 | for large files + - q07: h58 (longest_match_simd ), b15, l4 + - q07: h68 (longest_match64_simd ), b15, l5 | for large files - q07: h41 (forgetful_chain ), b15, l4 | for small window - q08: h05 (longest_match ), b15, l4 @@ -165,7 +165,11 @@ static BROTLI_INLINE void ChooseHasher(const BrotliEncoderParams* params, } else if (params->lgwin <= 16) { hparams->type = params->quality < 7 ? 40 : params->quality < 9 ? 41 : 42; } else if (params->size_hint >= (1 << 20) && params->lgwin >= 19) { +#if defined(BROTLI_MAX_SIMD_QUALITY) + hparams->type = params->quality <= BROTLI_MAX_SIMD_QUALITY ? 68 : 6; +#else hparams->type = 6; +#endif hparams->block_bits = params->quality - 1; hparams->bucket_bits = 15; hparams->num_last_distances_to_check = @@ -173,7 +177,11 @@ static BROTLI_INLINE void ChooseHasher(const BrotliEncoderParams* params, } else { /* TODO(eustas): often previous setting (H6) is faster and denser; consider adding an option to use it. */ +#if defined(BROTLI_MAX_SIMD_QUALITY) + hparams->type = params->quality <= BROTLI_MAX_SIMD_QUALITY ? 58 : 5; +#else hparams->type = 5; +#endif hparams->block_bits = params->quality - 1; hparams->bucket_bits = params->quality < 7 ? 14 : 15; hparams->num_last_distances_to_check = |