Repository navigation
Conversation
Cache ImageMagick-to-QImage conversion once per open cycle. Use Qt implicit sharing with separate QImage wrappers to preserve frame independence. Synchronize reader lifecycle and cache access, and add regression tests. Addresses OpenShot#202.
Contributor
Author
|
When you have an opportunity, could you please review this The change caches the ImageMagick-to-QImage conversion and Validation completed:
Performance benchmark (Debug, warm cache):
The benchmark measures repeated frame retrieval, not One compatibility consideration is that the additional Feedback and requested adjustments are welcome. Thank you! |
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
Optimize
ImageReader::GetFrame()by caching the ImageMagick-to-QImage conversion once per reader open cycle.Previously, each requested frame performed a full image conversion, even though the source image remained unchanged.
Changes
Performance
Measured using the same PNG image, 100 warm-up calls, and five repetitions of 1,000 frame requests per implementation.
Debug build, GCC 15, Qt 5, ImageMagick 7.
Measured speedup: approximately 783.7x.
Both benchmark runs produced the same checksum:
3672000.These measurements represent warm-cache
GetFrame()microbenchmark performance, not end-to-end playback speed.Validation
git diff --check: passed.Compatibility consideration
Adding cached-image and synchronization members changes the
ImageReaderclass layout. This may affect ABI compatibility for existing binary consumers and should be considered during review.Related issue
Addresses #202.