Skip to main content

Module deflate_scan

Module deflate_scan 

Source
Expand description

DEFLATE full-flush boundary scanner.

A Z_FULL_FLUSH point resets the LZ77 back-reference window to empty, making all bytes that follow independently decompressible. In the compressed byte stream this always produces the 5-byte sequence:

00 BFINAL=0, BTYPE=00 (stored), 5 padding zero-bits 00 00 LEN = 0x0000 (zero-length stored block) FF FF NLEN = 0xFFFF (one’s complement)

We scan for the 4-byte LEN+NLEN pattern 00 00 FF FF. The next independently-decompressible segment starts at match_pos + 4.

Mirrors lbzip2-rs block_scan.rs: parallel candidate-offset forward-scan, one task per physical core, no look-behind verification (Q1 resolved).

Structs§

FlushBoundary
A full-flush boundary.

Functions§

find_all_flushes
Find all full-flush boundaries in buf.
find_next_flush
Scan forward from from for the next 00 00 FF FF pattern.
split_boundaries_parallel
Parallel split-point search: N−1 rayon tasks each find the nearest flush boundary at or after their nominal byte offset.