A packager could say nothing of a programme's loudness, and a broadcast or streaming chain must deliver at a target (ATSC A/85, EBU R 128) and show it did. packaging §12 measures integrated loudness as ITU-R BS.1770 does — K-weighting, 400 ms blocks every 100 ms, the absolute gate at −70 LKFS and the relative gate 10 LU below — in integers only: the coefficients at 48 kHz in units of 2^−30, exact sums of squares, and a stated integer logarithm, so every implementation gives the same figure to the thousandth of an LU; BS.1770's calibration tone measures −3 004. It states the sample peak and the gain to a target under a peak ceiling. The packager signs a loudness statement (wai.pack.loudness, bs1770-int/1) naming the component, the SHA-256 of its samples, every figure, the target, the ceiling, the gain and its package receipt; a verifier holds the gain to the figures with no samples and recomputes every figure with them. `wai-pack loudness measure` writes one from a WAV source, verified against it before it is written, and `wai-pack loudness verify` checks one. Packaging's reasons are §13 now. The reference is the loudness module of wai-rs; the corpus is pack-conformance/loudness/ (10 programmes given as formulas of integers, the logarithm of ten integers, 26 statements), the tone's table and the filter's coefficients held to the text, with loudness_verify.py its second implementation: every case agrees, 10 of 10 mutated copies fail and 12 of 12 weakened verifiers are caught. Fourteen faults planted in the reference (the absolute gate, a 20 LU relative gate, the surround and LFE weights, the block step, the filter's rounding, the logarithm's last bit, the peak figure, the ceiling, the gain check, the source digest, the receipt, the first filter section, a coefficient off by one) each fail its tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2.1 KiB
pack-conformance/loudness — integer loudness and the loudness statement
The corpus of extensions/packaging.md §12, in one file,
vectors.json.
Provenance. Generated here by wai_loudness_vectors gen (wai-rs, feature loudness):
programmes given as formulas of integers (one period of a 1 kHz tone at 48 kHz, sine_1k, which
the text and the generator state; a linear congruential generator's noise; silence), their
measurements, and statements signed with an Ed25519 key on a fixed 32-byte seed; no recording
and no input from outside this repository.
programmes(§12.2, §12.3) are each arate, a number ofchannelsandsegments, each offramessample frames with a source a channel:zero;tone,sine_1k[k mod 48] × num / den, floored, for the segment's framek;noise, fromx=seed, each samplex ← (x × 1 103 515 245 + 12 345) mod 2^31then⌊x / 2^8⌋ mod (2·amp + 1) − amp;spike, the same noise with frameatat 32 767.outcomeis the measurement:frames,blocks,gated,integrated_milli,peak,peak_milli.logarithms(§12.3) are pairs of an integer and its L, both in decimal, the integer from 1 to 2^128 − 1.statements(§12.5, §12.6) are each astatement's text, thereceipt_hasha verifier expects (ornull) and the programme it holds as itssource(ornull);outcomeisverified, with the component, loudness, gain andlimited, orrefuseand the reason.
Everything is synthetic: the key attests nothing. The generator holds each programme to the loudness BS.1770's calibration or the programme's construction declares, and each statement's outcome is the one it was written to have.
wai_loudness_vectors verify and tests/loudness.rs check that the file regenerates byte for
byte and that wai-rs reaches every stated outcome. ../loudness_verify.py is the second
implementation, written from the extension's text, which also mutates copies of the corpus and
drops each of its own checks in turn and requires each to be caught.