aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgenii Kliuchnikov <eustas@google.com>2023-03-02 14:49:53 +0000
committerEvgenii Kliuchnikov <eustas.ru@gmail.com>2023-07-04 07:53:33 +0000
commit57c36a4f273f0e71d1a65887f1bbf0edb79d3a11 (patch)
tree5a9fead89eacccd8e39b864bc71644c86f9526b4
parent6db17c87f5b7b31c5fba5ef5be0e00edb0c97147 (diff)
downloadbrotli-57c36a4f273f0e71d1a65887f1bbf0edb79d3a11.zip
brotli-57c36a4f273f0e71d1a65887f1bbf0edb79d3a11.tar.gz
brotli-57c36a4f273f0e71d1a65887f1bbf0edb79d3a11.tar.bz2
1.2-2.3% decoder speedup
PiperOrigin-RevId: 513524040
-rw-r--r--c/dec/decode.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/c/dec/decode.c b/c/dec/decode.c
index 8cea8e7..6389364 100644
--- a/c/dec/decode.c
+++ b/c/dec/decode.c
@@ -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;