From 57c36a4f273f0e71d1a65887f1bbf0edb79d3a11 Mon Sep 17 00:00:00 2001 From: Evgenii Kliuchnikov Date: Thu, 2 Mar 2023 14:49:53 +0000 Subject: 1.2-2.3% decoder speedup PiperOrigin-RevId: 513524040 --- c/dec/decode.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'c/dec/decode.c') 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; -- cgit v1.1