Repository navigation
feat(ui): cache recently decoded frames - #75
Merged
Merged
Conversation
Add a bounded LRU FrameCache (256 MB default) keyed by frame index. ShowFrame stores the full-resolution image; ShowFrameAt checks the cache first when not playing and displays the cached frame without touching the decoder. Because a cache hit leaves the decoder at an older position, a resync flag forces SeekToFrame() before the next decode so the displayed frame and the decoder cannot diverge. Opening a file clears the cache, and the performance log records cache hits. Adds FrameCache eviction/LRU tests and a GUI test that revisits a cached frame.
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.
Summary
Fixes #69: recently decoded frames are cached and re-displayed instantly.
FrameCache(LRU, 256 MB default, byte-based eviction) storing full-resolutionQImageframes.ShowFrame()inserts the displayed frame;ShowFrameAt()checks the cache first when not playing, displaying a hit without seeking or decoding.SeekToFrame(target)to realign. This prevents the "right frame number, wrong image" failure mode.cache file frame=N).Verification
FrameCacheTest.EvictsLeastRecentlyUsedMainWindowTest.CacheServesRevisitedFrames(load -> step right -> step left, log containscache)ctest: 75/75 passtidy.shon the changed files: 0 issuesLimitations
Fixes #69