tonemap_cuda: native 4:2:2 in and out - #35
Merged
Merged
Conversation
…n the same pass The kernel handled one 2x2 luma block with a single shared chroma sample, i.e. 4:2:0 only, so every conversion touching a P210 canvas needed a scale_cuda pass to P010 before and one back to P210 after. It now takes NV12/P010/NV16/P210 and writes any of them: 4:2:2 input keeps one chroma sample per luma row, 4:2:0 output averages the block, 4:2:2 output keeps the rows. The default output keeps the input subsampling (8 bits for SDR, 10 for HDR); `format=` selects it explicitly. Passthrough requires matching subsampling as well. conversion_graph drops the P010 sandwich: converted sources on a P210 canvas stay 4:2:2, and a rendition off a P210 canvas subsamples once, inside the tone mapper, instead of scale, tonemap, scale. That is one fewer 156 us pass per converted source and per rendition on the T4. Planar CUDA storage is still re-laid out by scale_cuda first. Series re-pinned on n8.0 and n8.1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
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.
Stacked on #33.
tonemap_cudahandled 4:2:0 only, so every colour conversion touching a P210 canvas was wrapped inscale_cuda=format=p010lebefore andscale_cuda=format=p210leafter. The kernel now takes NV12/P010/NV16/P210 and writes any of them, resampling 4:2:2/4:2:0 in the same pass.conversion_graphloses its P010 round trip; unit tests updated; series re-pinned on n8.0 and n8.1.Verified on the T4: transfers, mixer, interop, v210 and output-qualification smokes.
🤖 Generated with Claude Code