std/brotli: fix the Zopfli starting distance cache order

Also run the encoder parity harness at qualities up to 11, using the
workbuf_len minimum.
This commit is contained in:
Claude committed 2026-10-27 02:43:46 +00:00
1 parent 152ad1d2dd
commit bef6ffc1bd
3 files changed
+12 -4

No files matched your search

+4 -1
View File
@@ -521,6 +521,7 @@ pri func encoder.compute_distance_shortcut(wb: roslice base.u8, block_start: bas
// zp_dc field. The starting distance cache is this.dist_cache.
pri func encoder.compute_distance_cache!(wb: roslice base.u8, pos: base.u64) {
var idx : base.u32
var sdc : base.u32
var p : base.u64
var i_len : base.u64
var c_len : base.u64
@@ -535,9 +536,11 @@ pri func encoder.compute_distance_cache!(wb: roslice base.u8, pos: base.u64) {
// Because of prerequisite, p >= c_len + i_len >= 2.
p = this.zn_u(wb: args.wb, i: (p ~mod- c_len) ~mod- i_len) as base.u64
}
sdc = 0
while idx < 4 {
this.zp_dc[idx] = this.dist_cache[idx]
this.zp_dc[idx] = this.dist_cache[sdc & 3]
idx ~mod+= 1
sdc ~mod+= 1
}
}