std/brotli: support compound dictionaries at qualities 10 and 11

Mirror the Zopfli path's compound dictionary code in
backward_references_hq.c and hash.h: LookupAllCompoundDictionaryMatches,
FindAllCompoundDictionaryMatches, MergeMatches, the lz_matches_offset
and shadow_matches scratch space, the gap in ComputeDistanceShortcut,
UpdateNodes (including its compound dictionary last distance branch)
and BrotliZopfliCreateCommands, and the dictionary distance passed to
FindAllMatchesH10.

Remove the quality 10 and 11 dictionary gate (and its now unused
status), size the quality 11 variable region for the shadow matches
and turn the gate's test into a byte-exact check. The mimic dictionary
grid, big and rejections tests now also cover qualities 10 and 11.
This commit is contained in:
Claude committed 2026-10-27 09:02:50 +00:00
1 parent d72d46ea97
commit ec99ba2a01
8 files changed
+854 -120

No files matched your search

+1 -2
View File
@@ -30,8 +30,7 @@
// When this quirk is set, it sets the encoder's BROTLI_PARAM_QUALITY
// parameter: 0 to 11. The default is 11. Like the C code, out of range values
// are clamped (and a value with its high bit set is negative, so it is
// clamped to 0). Only qualities 0 and 1 are currently supported: transform_io
// returns "#unsupported encoder quality" for the others.
// clamped to 0).
//
// It is not named QUIRK_QUALITY because the base package already has a
// base.QUIRK_QUALITY key (with different value semantics).