aboutsummaryrefslogtreecommitdiff
path: root/c/enc/backward_references_inc.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/enc/backward_references_inc.h')
-rw-r--r--c/enc/backward_references_inc.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/c/enc/backward_references_inc.h b/c/enc/backward_references_inc.h
index 0479dfd..e7b1665 100644
--- a/c/enc/backward_references_inc.h
+++ b/c/enc/backward_references_inc.h
@@ -38,29 +38,29 @@ static BROTLI_NOINLINE void FN(CreateBackwardReferences)(
size_t max_distance = BROTLI_MIN(size_t, position, max_backward_limit);
HasherSearchResult sr;
sr.len = 0;
- sr.len_x_code = 0;
+ sr.len_code_delta = 0;
sr.distance = 0;
sr.score = kMinScore;
- if (FN(FindLongestMatch)(hasher, dictionary, dictionary_hash,
- ringbuffer, ringbuffer_mask, dist_cache,
- position, max_length, max_distance, &sr)) {
+ FN(FindLongestMatch)(hasher, dictionary, dictionary_hash, ringbuffer,
+ ringbuffer_mask, dist_cache, position,
+ max_length, max_distance, &sr);
+ if (sr.score > kMinScore) {
/* Found a match. Let's look for something even better ahead. */
int delayed_backward_references_in_row = 0;
--max_length;
for (;; --max_length) {
const score_t cost_diff_lazy = 175;
- BROTLI_BOOL is_match_found;
HasherSearchResult sr2;
sr2.len = params->quality < MIN_QUALITY_FOR_EXTENSIVE_REFERENCE_SEARCH ?
BROTLI_MIN(size_t, sr.len - 1, max_length) : 0;
- sr2.len_x_code = 0;
+ sr2.len_code_delta = 0;
sr2.distance = 0;
sr2.score = kMinScore;
max_distance = BROTLI_MIN(size_t, position + 1, max_backward_limit);
- is_match_found = FN(FindLongestMatch)(hasher, dictionary,
- dictionary_hash, ringbuffer, ringbuffer_mask, dist_cache,
- position + 1, max_length, max_distance, &sr2);
- if (is_match_found && sr2.score >= sr.score + cost_diff_lazy) {
+ FN(FindLongestMatch)(hasher, dictionary, dictionary_hash, ringbuffer,
+ ringbuffer_mask, dist_cache, position + 1,
+ max_length, max_distance, &sr2);
+ if (sr2.score >= sr.score + cost_diff_lazy) {
/* Ok, let's just write one byte for now and start a match from the
next byte. */
++position;
@@ -88,7 +88,7 @@ static BROTLI_NOINLINE void FN(CreateBackwardReferences)(
dist_cache[0] = (int)sr.distance;
FN(PrepareDistanceCache)(hasher, dist_cache);
}
- InitCommand(commands++, insert_length, sr.len, sr.len ^ sr.len_x_code,
+ InitCommand(commands++, insert_length, sr.len, sr.len_code_delta,
distance_code);
}
*num_literals += insert_length;