mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-09 11:31:34 -10:00
When the bitstream runs dry between the run/level code of an AC coefficient and its sign or escape bits, the block decoders suspend and are called again. The second half needs only whether the code was an escape and its level; both now travel in ipu_cmd.pos[5], which the savestate carries, and the table entry is local to the call. A state loaded into a fresh process resumes the coefficient from that. pos[5] holds bit 1 to say the resume data is there, bit 0 for the escape, and the level from bit 8 up. A state written by an older build holds 1 there with nothing to go on, and that block ends at the suspension. tests/ipu/slice_hash.cpp decodes every fixture again with the input running dry on every other quadword, so that hundreds of coefficients are split across a suspension, and requires the same hash as the full feed. It also resumes a split coefficient, and a state in the older form, before anything has been decoded in the process.