-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding multiple frames without decoder create/destroy #306
Comments
Hi, The included test application CharLSTest can be used to run performance tests. With -decodeperformance:10 it is for example possible to decode the same image 10 times. Do you have a specific scenario for which you see a significant performance improvement by re-using the same decoder instance? Note: internal CharLS will also perform 2
|
Hello, The specific scenario I have is one where thousands of monochrome, 16 bit-depth, and same-sized images are compressed with JPEG-LS and placed into a binary file. Very similar to the basic operating principle of MJPEG, except other structures besides imagery are also embedded in the file. Due to the high quantity of imagery, it is prudent to minimize superfluous calls to I believe I was able to accomplish this on the encoding side through use of |
I will see if it is possible to create a proof of concept for charls_jpegls_decoder_rewind. |
I have created in the branch rewind-poc a version that has a method charls_jpegls_decoder_rewind. Note: deep inside the decoding there are still 2 allocations done. It might be possible to reuse these also. |
Much appreciated! I pulled the branch down and found that my rather old C++ compiler (VS2015) does not support CharLS 3.x, with its migration to C++17. I was originally working from the 2.4.2 tag. I will attempt a manual merge/transcription the commit's substantive changes for throughput testing. |
I completed a manual merge/transcription into the 2.4.2 baseline (the primary inconsistency is omission of thresholds/reset_value checks in the new function
Memory usage went up by 100kB (but that's the only resolution I had on task manager) for the duration of the test, and the average decode time difference was negligible for my case (~0.4% slower, and interestingly decoding with rewind was slower). I'll defer to you for the determination on whether these results warrant being part of the next tag. |
Similar to #86 for encoding, it would be great if an enhancement was made to implement a function similar to
charls_jpegls_encoder_rewind
, except on the decoding side of things.The ideal state would be if, when decoding multiple same-sized images, no additional
new
/delete
calls are made. This would be achieved in part by not needing to create and destroy acharls_jpegls_decoder
object for each image that needs decoding.Or, if it is possible to calculate memory needs for the encode/decode operation, enabling custom allocators would solve this as well. But that seems like a longer-term enhancement.
The text was updated successfully, but these errors were encountered: