#!/usr/bin/env python3 """bench-rows-parity.py REF.f32 OUT.f32 CHANNELS: per-channel correlation of two interleaved float32 streams (ffmpeg reference vs the crate's output). Prints one line per channel and the sample counts. Run as: python3 -I ...""" import sys import numpy as np ref = np.fromfile(sys.argv[1], dtype=" 0 and b.std() > 0 else float("nan") err = np.max(np.abs(a - b)) worst = min(worst, corr) print(f"ch{c} corr={corr:.6f} max_abs_err={err:.6f}") print(f"min_corr={worst:.6f} tolerance=0.999 {'PASS' if worst >= 0.999 else 'FAIL'}")