wai-rs: TON tools-header parser + codestream→z→i_s chain #21
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/jpegai-e2e-chain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
parse_tools_header decodes the post-filter chain of the TON substream (EFE-linear → ICCI → eICCI → EFE-nonlinear → LEF), each tool gated by its recursive enable flag. Adds
BitReader::read_max/bits_for_max— the headers universal width rulebits = ceil(log2(max+1)); some widths are runtime-dependent (amax_symboldecoded earlier sets the width of the weights after it: 65535⇒16 bits, then 99⇒7).Validated on test256.bin: every TON field matches, end_bit=973 (all consumed, 3-bit pad closes the 63-byte segment). The decoded params ARE the post-filters fixture inputs —
B1/100=125.61/130.91 (efl means), luma_min/max=497/25320 + 8 A1 weights (efn inputs),icci_model_signalled_idx=[Y=0,UV=1] (the per-tile eICCI selection). Header parser and post-filters agree from opposite directions.Plus an end-to-end chain test: test256.bin → container → SOZ → mANS fac → z (2560, 75 nz) → decode_hyper_scale → i_s, byte-exact 40960/40960 vs reference — two independently-built subsystems chained off raw bytes, no fixture input beyond the normative CDF/weight assets.
dcharlot referenced this pull request2026-11-06 13:54:17 -05:00