fix(hdr): inject AV1 metadata for full-range clients - #166
Merged
Conversation
The injection gate compares the encoder color description against the exact limited-range BT.2020+PQ preset, so full-range HDR sessions never get MDCV/CLL metadata and the client tone-maps blind. The gate guarded against the malformed AV1 metadata OBUs fixed in PR 154 (trailing bits, AV1 units); with those in, the injected stream is spec-valid, so gate on is_hdr() - the same check the control-stream HDR state uses. Verified on a live 4K AV1 full-range HDR session (RTX 5060 Ti host, driver 610.43.03; moonlight-qt/VAAPI client): the SDR->HDR transition plays with metadata injected, and the captured wire bitstream with the injected OBUs decodes clean under dav1d and ffmpeg -err_detect explode.
Owner
|
Thanks 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
inject_hdrgate still compares against the exact limited-range BT.2020+PQ preset, so full-range HDR sessions never carry MDCV/CLL metadata OBUs and the client tone-maps blind. The gate (and its comment) predates #154 - with the trailing-bits + AV1-units fixes in, the injected stream is spec-valid, so this drops the gate tois_hdr(), the same check the control-stream HDR state already uses.Verified live: 4K AV1 full-range HDR session (moonlight-qt/VAAPI client), SDR→HDR transition plays with metadata injected. Also offline: captured the wire bitstream and the injected OBUs pass dav1d and
ffmpeg -err_detect explode. Note this needs hgaiser/pixelforge#31 on the host to get a decodable transition key frame in the first place - independent bugs, but this one is only observable with that one fixed.This finally fixes all of my troubles with AC4 on AV1 path, so I can finally start playing it rather than tinkering with the setup lol. (all of this was only for 1ms decode latency improvement vs HEVC path, heh).
Closes #155.
Host: NVidia 5060 Ti (driver 610.43.03), Arch