Compare commits

...

1 Commits

Author SHA1 Message Date
Brotli
fbd3cc7d4f Enable shared_dictionary for quality 3 and 4.
PiperOrigin-RevId: 843477953
2025-12-11 20:03:23 -08:00
2 changed files with 11 additions and 1 deletions

View File

@@ -131,6 +131,14 @@ static BROTLI_INLINE size_t ComputeDistanceCode(size_t distance,
#define PREFIX() D
#define ENABLE_COMPOUND_DICTIONARY 1
#define HASHER() H3
/* NOLINTNEXTLINE(build/include) */
#include "backward_references_inc.h"
#undef HASHER
#define HASHER() H4
/* NOLINTNEXTLINE(build/include) */
#include "backward_references_inc.h"
#undef HASHER
#define HASHER() H5
/* NOLINTNEXTLINE(build/include) */
#include "backward_references_inc.h"
@@ -192,6 +200,8 @@ void BrotliCreateBackwardReferences(size_t num_bytes,
literal_context_lut, params, hasher, dist_cache, \
last_insert_len, commands, num_commands, num_literals); \
return;
CASE_(3)
CASE_(4)
CASE_(5)
CASE_(6)
#if defined(BROTLI_MAX_SIMD_QUALITY)

View File

@@ -168,7 +168,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(
BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask + 1);
out->len_code_delta = 0;
if (prev_ix < cur_ix) {
if (prev_ix < cur_ix && cached_backward <= max_backward) {
prev_ix &= (uint32_t)ring_buffer_mask;
if (compare_char == data[prev_ix + best_len]) {
const size_t len = FindMatchLengthWithLimit(