mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Previous attempts to correct slant by altering R-channel placement and buffer consumption caused cascading failures: a false positive in B pixel data would misplace R, then the wrong consumed value misaligned the next line's G, and the error compounded across all 256 lines. New approach (safe by design): - Sync search is measurement-only: never touches pos or consumed, so a noisy or wrong measurement cannot corrupt the current or future lines. - Per-line deviation (measured sync position minus expected) is recorded in self._sync_deviations throughout the decode. - get_image() fits a line through the deviations (linear regression) to estimate the per-line SDR clock drift rate, then applies a horizontal shear to the assembled PIL image: each row is shifted by -round(row × drift_rate × width / channel_samples) pixels. - Worst case (all measurements fail): no correction applied, image quality identical to the pre-change baseline. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>