Repository navigation
Description
Follow-up to #529, raised there by @skrew.
#529 gave a host the option to present the HDR10 base layer of a source whose Dolby Vision record is wrong (LoadOptions.dolbyVisionHandling = .baseLayerOnly). That is the right answer when nothing can tell which half of the container is lying. For one class it is not the best answer available, because the file states the contradiction itself.
The class
A container record claiming Profile 5, compatibility 0, over a bitstream whose VUI declares BT.2020 YCbCr with a PQ or HLG transfer. A genuine Profile 5 leaves transfer_characteristics and matrix_coeffs unspecified, IPT-PQ-c2 having no VUI code point, so the pairing is already a contradiction and #529 logs it. The reported instance is a 4K remux of 1917 whose RPU carries disable_residual_flag = 0, an enhancement-layer resampling filter and NLQ, fields only a Profile 7 RPU has.
Why the RPU settles it
A Profile 5 RPU cannot carry a residual or an NLQ, so reading one is not a heuristic, it is a proof that the record is wrong. libdovi already answers this in one field, guessed_profile on dovi_rpu_get_header, and the engine already calls that function for DoviRpuConverter.enhancementLayerType.
Measured here against real media:
| Source | Container record | RPU says |
|---|---|---|
| Dolby test kit Profile 5 | profile 5 compat 0 | dovi_profile: 5, vdr_rpu_profile=0, disable_residual=true |
| A real Profile 8.1 remux | profile 8 compat 1 | dovi_profile: 8, vdr_rpu_profile=1 |
| The reported title | profile 5 compat 0 | 7 (residual + NLQ) |
What should happen
When the record says Profile 5 and the VUI contradicts it, read the first RPU. If it says 7 or 8, believe the RPU and take the route that profile already has: the Profile 7 to 8.1 conversion on a display with Dolby Vision, the HDR10 base on one without, and a truthful dvcC on the way out through the existing compatibility rewrite. Real Dolby Vision, rather than the base layer #529 falls back to.
The audit is gated on the contradiction, so a genuine Profile 5 and every other source read no packets at all. dolbyVisionHandling = .baseLayerOnly keeps precedence, since a host that asks for the base layer is answering a question the engine did not ask.
AV1 Profile 10.0 is out of scope: its RPU lives in an OBU metadata rather than an unspec62 NAL, so this parser cannot audit it, and #529's option stays the answer for that class.
Activity
Merge feat/ae532-rpu-over-record: the RPU settles a contradicted Dolb…
superuser404notfound commentedon Sep 11, 2026
Built and merged as 08ff5ee. @skrew, this is your follow-up from #529.
What landed
DolbyVisionRecordAuditkeeps the three questions apart: the gate (a Profile 5 record over a BT.2020 YCbCr PQ or HLG VUI, and nothing else, so a genuine Profile 5 reads no packet), the read (libdovi'sguessed_profileout of the firstunspec62NAL) and the verdict (7 or 8 correct the record, an RPU that agrees or cannot be read leaves it standing).The correction is applied to the record before the classification, which is why no new packaging was needed: an RPU that reads 7 lands on the Profile 7 branch and one that reads 8 on the Profile 8.1 branch, whose compatibility rewrite turns the record's 0 into the 1 it should have carried. The verdict reaches the four places that were reading the record: the served route, the VT-probe bypass and the software-path refusal from #176, and the reload refusal. A reload reuses it rather than auditing twice.
dolbyVisionHandling = .baseLayerOnlykeeps precedence.The read is a second open on the source, because the session's probe demuxer is handed to the software path as it stands and packets taken out of it here would be packets that path never sees.
Measured
Dolby's own Profile 8.1 signal with two bytes of its
dvvCrewritten to Profile 5 / compatibility 0, bitstream untouched, so the RPU underneath still reads 8. The recipe is inDolbyVisionRecordAuditTests.CODECS="dvh1.05.06"CODECS="hvc1.2.4.L150"+SUPPLEMENTAL-CODECS="dvh1.08.06/db1p"init.mp4dvvCprofile 5 compat 0dvvCprofile 8 compat 1item videoFormat=hdr10 subType='hvc1' transfer=SMPTE_ST_2084_PQdvh1.05.06Profile 8.1, Profile 8.4, plain HDR10 and SDR come out identical to before. Full suite green on both runners (631 XCTest, 2908 swift-testing), CI green on the branch including the tvOS, iOS and visionOS simulator builds.
One trap worth naming, since it cost a red test: the DOVI record and the colour description arrive only with
find_stream_info, so the gate cannot run on the cheap open the packet walk uses, while the extradata that walk needs for its framing survives it.Left open deliberately
The reported title is not available here, so the Profile 7 arm is covered by unit tests only while the Profile 8 arm is measured on real bytes. @skrew, if you still have the 1917 remux, a run on the next release would close that: the line to look for is
AE#532: DV Profile 5 record contradicted by its own RPU (RPU reads profile 7), and the picture should be Dolby Vision rather than the HDR10 base.baseLayerOnlygives you today. Leaving this open until then.AV1 Profile 10.0 stays out: its RPU rides in a T.35 metadata OBU rather than an
unspec62NAL, so #529's option remains the answer for that class.superuser404notfound commentedon Sep 11, 2026
Released in 6.81.0 (
08ff5ee7). Both consumers are pinned to it.@skrew, this is the build to try the 1917 remux on. The line to look for is
AE#532: DV Profile 5 record contradicted by its own RPU (RPU reads profile 7), and the picture should be Dolby Vision rather than the HDR10 base. Leaving this open for that one run, since the Profile 7 arm is the half no file here could measure.skrew commentedon Sep 11, 2026
Run on the 1917 remux with 6.81.0,
dolbyVisionHandling = .automatic(the host's per-title option left at its default), Apple TV 4K, tvOS 26, Dolby Vision panel, same file as #529 (MKV, HEVC Main10 3840x2160 23.976, dvcC Profile 5 / compat 0 / level 6, VUI BT.2020 / PQ / BT.2020-NCL, RPU with residual + NLQ, 11.8 GB over HTTP).The Profile 7 arm fires:
Picture correct, the panel reports Dolby Vision; no green / violet, and no need for
.baseLayerOnlyon this title any more. Segments serve and seek normally (seg10 5.6 MB, seg18 7.9 MB, no restart).Before 6.81.0 the same file logged
DV Profile 5 record over a BT.2020 YCbCr VUIand serveddvh1.05.06, as in the #529 test plan. This closes the Profile 7 arm on real bytes. Thank you for building it.superuser404notfound commentedon Sep 11, 2026
That is the half no file here could measure, so this is done.
The whole verdict chain is visible in one place in that log, which is worth recording for the next report of this shape:
color_primaries=9 color_trc=16 color_space=9)RPU reads profile 7, out of the residual and the NLQ a Profile 5 RPU cannot carrysupplemental=dvh1.08.06/db1pwithDV=profile7, the existing Profile 7 to 8.1 conversion rather than the base layer, and a panel that reports Dolby VisionThanks for making the case for this in #529 and then going back to the file to measure it. The option you contributed there keeps its job for the class the bitstream does not settle, a Dolby Vision record that is wrong while its RPU agrees with it or says nothing that contradicts it. AV1 Profile 10.0 also stays outside this audit, its RPU riding in a T.35 metadata OBU rather than an
unspec62NAL.feat(dv): what the RPU says about a contradicted Profile 5 record (su…
feat(dv): the route believes the RPU over a contradicted record (supe…
feat(dv): a session audits a contradicted record, and says what it fo…
perf(dv): the recordless gate walks four video packets, not sixteen (#…
feat(io): the Dolby Vision audit and the Atmos confirmation read the …