"""Compare host_test's decoded frames with the encoder's expected pictures. py -3.12 -m r32x.check_host out32/c1v_0/frames.raw out32/c1v_0 """ import json import sys from pathlib import Path import numpy as np from PIL import Image from . import c1 def main() -> None: raw, enc = Path(sys.argv[1]), Path(sys.argv[2]) s = json.loads((enc / "summary.json").read_text()) width, step = s.get("width", 320), s.get("step", 1) x0 = (320 - width) // 2 # the frame buffer's rows are 320 wide, the picture centred words = np.fromfile(raw, "