Repository navigation
mixer_keyer: compose only the rectangles of keys that say so - #42
Merged
Merged
Conversation
With keys visible the keyer composes the whole canvas in one launch, the program as a full-size layer under the keys. A key on a third of the picture then pays for all of it. Keys named in bounded_keys (a dsk key's bounded option in a show) may be composed alone: while every visible key is one of them, the output is a copy of the program frame on which the composite kernel runs only over viewports around the keys. The kernel is unchanged: a viewport is handed to it as its canvas, with a table relative to the viewport's origin. At most four rectangles and 60 % of the canvas; otherwise, and for any other key, the whole canvas is composed as before, which stays the default. On a Tesla T4 a 1016x172 key takes 0.091 ms instead of 0.161 ms, a 1920x360 one 0.207 ms instead of 0.252 ms. tests/cuda/test_rect_composite.cu: fifteen cases whose pixels must equal the whole-canvas launch, and timings of both paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
With keys visible the keyer composes the whole canvas in one launch: the program as a full-size layer under the keys. A key on a small part of the picture pays for all of it.
Keys named in
bounded_keys(a dsk key'sboundedoption in a show) may be composed alone. While every visible key is one of them, the output is a copy of the program frame on which the composite kernel runs only over viewports around the keys. Keys that overlap share a viewport.cuda_rect_viewport.h).bounded_keysis an array of key inputs, ortruefor all.Measured
Tesla T4, 1920x1080 NV12, one blended RGBA key, kernel time per frame from
tests/cuda/test_rect_composite.cu:The program frame is shared with the clean output, so it is copied first; that copy costs most of what the bounded launch saves.
Tests
tests/cuda/test_rect_composite.cu: fifteenover:cases (NV12, P010, P210; premultiplied, texture-backed, faded, scaled, overlapping, off-canvas keys) whose pixels must equal the whole-canvas launch. A deliberately wrong chroma origin fails it.tests/mixer/test_graph.py: the show option reaches the node; a non-boolean is refused.🤖 Generated with Claude Code