Add user-selectable proxy resolution - #24
Closed
emlcpfx wants to merge 1 commit into
Closed
Conversation
Playback > Proxy Resolution picks Full / 2K / 1080p / 720p. The proxy level was fixed at 2K; the right answer depends on the machine and the job. A supervisor on a laptop wants 720p to hold real time on an 8K plate, while someone checking grain or edge detail needs the full frame and will accept slower playback. playback/proxy.py owns the level and the resolution maths. The level is process-wide rather than a constructor argument because the readers, the frame cache and the on-disk preview cache all have to agree on it, and they are built in different places. - The preview-cache key already carried the proxy dimensions, so it now carries the level token instead. Every level has a distinct token, which is what stops a frame cached at 720p being served back to a viewer asking for 2K. There is a test that fails if two levels ever collide. - The movie path still rounds to even dimensions: yuv420 subsamples chroma by two, so an odd proxy size is not representable. The sequence path does not need that constraint. - Sequence cache depth follows the proxy size, since bigger review frames mean fewer of them fit in the same memory budget. - Changing level reloads the current source at the frame the reviewer is sitting on. The open reader and both caches hold frames at the old size, so the level cannot be swapped under a running player. Full resolution disables the proxy entirely rather than scaling by 1.0, so the EXR mip-level shortcut is skipped too. 14 tests. Verified against a real decoded 3840x2160 clip: it lands at 2048x1152 at 2K, 1280x720 at 720p, and 3840x2160 at Full. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TexnzYbmCjjTDB8zzZuUPb
Owner
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.
Playback > Proxy Resolutionpicks Full / 2K / 1080p / 720p.The display proxy was fixed at 2K, but the right answer depends on the machine and the job: a supervisor on a laptop wants 720p to hold real time on an 8K plate, while someone checking grain or edge detail needs the full frame and will happily accept slower playback. The source file and its timeline metadata are never touched — only what the viewer decodes and caches.
playback/proxy.pyowns the level and the resolution maths. The level is process-wide state rather than a constructor argument because the readers, the frame cache and the on-disk preview cache all have to agree on it, and they're constructed in different places.The part that would have bitten
The on-disk preview cache is keyed by proxy size. If the level changed without that key changing, a frame cached at 720p would be served straight back to a viewer that just asked for 2K — the reviewer would silently be looking at the wrong resolution, with no error and nothing on screen to explain it. The key already carried the hardcoded dimensions, so it now carries the level token;
test_each_level_has_a_distinct_cache_tokenfails if two levels ever collide, andtest_preview_cache_path_changes_with_the_proxy_levelchecks the realSequenceReaderpath changes with the level.Other details worth knowing
fit()takes anevenflag rather than forcing it on everyone.Verification
14 new tests, 252 on the branch, green three runs in a row, compile clean.
Not just unit maths — driven end to end against a real decoded 3840x2160 clip through a real
MainWindow, checking the actual decodedQImagedimensions:Menu radio state stays in sync across all of it.
Branches off current
main.