mirror of
https://github.com/google/brotli.git
synced 2024-11-24 12:30:15 +00:00
Optimize out redundant hasher lookups
This commit is contained in:
parent
352b7a01e9
commit
626e0656ac
@ -50,8 +50,13 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
|
||||
const score_t cost_diff_lazy = 175;
|
||||
int delayed_backward_references_in_row = 0;
|
||||
--max_length;
|
||||
for (; BackwardReferenceScoreUsingLastDistance(pos_end - (position + 1))
|
||||
>= sr.score + cost_diff_lazy; --max_length) {
|
||||
for (;; --max_length) {
|
||||
if (BackwardReferenceScoreUsingLastDistance(pos_end - (position + 1))
|
||||
< sr.score + cost_diff_lazy && sr.score > kMinScore
|
||||
+ BROTLI_LITERAL_BYTE_SCORE) {
|
||||
FN(Store)(hasher, ringbuffer, ringbuffer_mask, position + 1);
|
||||
break;
|
||||
}
|
||||
HasherSearchResult sr2;
|
||||
sr2.len = params->quality < MIN_QUALITY_FOR_EXTENSIVE_REFERENCE_SEARCH ?
|
||||
BROTLI_MIN(size_t, sr.len - 1, max_length) : 0;
|
||||
|
Loading…
Reference in New Issue
Block a user