Fix round, items 4 and 3.
Item 4 (decision: build it). §5.6 restores the design's rule for choosing
q per piece from q_candidates under max_sse_px_milli: the candidates read
as a set, encoded from the largest down, the first with
floor(SSE*1000/(3whn)) <= max_sse_px_milli chosen, so candidates that meet
the bound alike are decided by their step; where none meets it, the
smallest. wai_pack::encode::choose_q is the function the packer's base
encode will call. Departure from the design's plan: the rule is specified
and built here, ahead of the stage that writes objects, and states its
ties and its no-candidate case, which the design left open. §5.5 now says
what is true today: wai-pack does not write objects yet and will write
these with int_video_enc at the step §5.6 chooses. Goldens:
pack-conformance/qchoice, every piece of every fixture under two bounds
(one splitting pieces between steps 8 and 4, one that most pieces meet at
no step), with each candidate's SSE, the choice and the chosen payload's
BLAKE3.
Item 3. pack_verify.py no longer trusts a self-consistent closed loop: from
each golden payload's decode it recomputes every motion vector by the §5.5
search (its order and tie-break) on the source and the previous decoded
frame, every coded residual (the stream's symbols) as
quantize(source - prediction), and the residual table and offset as the
§5.5 fit of those residuals. For the step goldens it runs an encoder of its
own (search, quantization, reconstruction) to recompute every candidate's
SSE and the choice.
Co-Authored-By: Claude Opus 5.5 <[email protected]>