1.2-2.3% decoder speedup

PiperOrigin-RevId: 513524040
This commit is contained in:
Evgenii Kliuchnikov 2023-03-02 14:49:53 +00:00 committed by Evgenii Kliuchnikov
parent 6db17c87f5
commit 57c36a4f27

View File

@ -1962,9 +1962,7 @@ CommandInner:
goto saveStateAndReturn;
}
if (BROTLI_PREDICT_FALSE(s->block_length[0] == 0)) {
BROTLI_SAFE(DecodeLiteralBlockSwitch(s));
PreloadSymbol(safe, s->literal_htree, br, &bits, &value);
if (!s->trivial_literal_context) goto CommandInner;
goto NextLiteralBlock;
}
if (!safe) {
s->ringbuffer[pos] =
@ -1998,8 +1996,7 @@ CommandInner:
goto saveStateAndReturn;
}
if (BROTLI_PREDICT_FALSE(s->block_length[0] == 0)) {
BROTLI_SAFE(DecodeLiteralBlockSwitch(s));
if (s->trivial_literal_context) goto CommandInner;
goto NextLiteralBlock;
}
context = BROTLI_CONTEXT(p1, p2, s->context_lookup);
BROTLI_LOG_UINT(context);
@ -2238,6 +2235,10 @@ CommandPostWrapCopy:
goto CommandBegin;
}
NextLiteralBlock:
BROTLI_SAFE(DecodeLiteralBlockSwitch(s));
goto CommandInner;
saveStateAndReturn:
s->pos = pos;
s->loop_counter = i;