mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
Add non-coroutine read_symbol_fast and read_bits_fast helpers that are tried before the coroutine versions, and a process_commands_fast loop that keeps a 64-bit read-ahead bit buffer and hands back the whole unconsumed bytes when it exits. process_commands now tracks its position in a command (cmd_state) so that both loops can resume each other. LZ77 copies that neither wrap nor reach the ring buffer's end are done in chunks of at most the distance, which matches a byte-by-byte copy. Output is unchanged. On alice29 (decoder reused) decoding is about 1.8x to 2.1x faster for q1, q5, q9 and q11 inputs.