AppleGVA parses a stream's SPS and PPS itself and hands the video driver
only its parsed records, one 32-bit field per syntax element, with each
picture's slices. The host decodes access units as a stream gives them, so
the driver writes the parameter sets back out as Annex-B NAL units: the SPS
without its VUI, which holds nothing a decoder needs, and the PPS whole. A
scaling list's trailing run is cut short only where that is no longer, as
encoders write it, so the PPS comes out byte for byte.
The records' layout is placed by H.264's syntax order between the fields
the calls' use states. On the guest, the sets written from AppleGVA's
records of six x264 streams equal the streams' own (the SPS up to its VUI
flag): Constrained Baseline with POC type 2, Main with B-frames and weighted
prediction, High with cropping, default and custom scaling matrices (stored
in coded order) and chroma QP offsets. That check also showed each record
starts with a word that is no syntax element. The tests check the writer
against those streams' parameter sets on the Mac (`make test`).