13/03/2012, 02:52 AM
Finally got the packJPG plugin working and doesn't seem to crash any more!
Now just need to do some code cleanup etc and release it.
Unfortunately, packJPG decompression is very slow. My random 3072x2304 "8MP" image takes like 2 seconds to show up. A random 3648x2736 "10MP" image took around 4 seconds. I guess most people won't really have >8MP photos around, and seeing that an i7 2600K should be like 2x faster than my Q6600 (possibly more with an overclock), I guess you could get somewhat acceptable results on a good CPU. The only issue is thumbnail generation - XnView scans the full image for thumbnails, and oddly, although it uses multi-threading, it doesn't appear to be using more than 25% of my CPU - weird - maybe the multi-threading is only used for doing multiple events (eg building thumbnails whilst displaying a preview) as opposed to multi-threaded thumbnail generation.
Speed not helped that much by the fact that it needs to go PJG » JPEG » image. Maybe there's some way to go PJG » image without going through JPEG, though it seems JPEG decompression at least is fast, thanks to libjpeg-turbo.
Had been spending ages trying to find the issue, which turned out to be some static variables in a different class. Couldn't get them to be thread local (GCC requires pthreads or something like that to do it) so had to push them to the main class and pass as arguments. Fortunately it wasn't too difficult.
Now just need to do some code cleanup etc and release it.
Unfortunately, packJPG decompression is very slow. My random 3072x2304 "8MP" image takes like 2 seconds to show up. A random 3648x2736 "10MP" image took around 4 seconds. I guess most people won't really have >8MP photos around, and seeing that an i7 2600K should be like 2x faster than my Q6600 (possibly more with an overclock), I guess you could get somewhat acceptable results on a good CPU. The only issue is thumbnail generation - XnView scans the full image for thumbnails, and oddly, although it uses multi-threading, it doesn't appear to be using more than 25% of my CPU - weird - maybe the multi-threading is only used for doing multiple events (eg building thumbnails whilst displaying a preview) as opposed to multi-threaded thumbnail generation.
Speed not helped that much by the fact that it needs to go PJG » JPEG » image. Maybe there's some way to go PJG » image without going through JPEG, though it seems JPEG decompression at least is fast, thanks to libjpeg-turbo.
Had been spending ages trying to find the issue, which turned out to be some static variables in a different class. Couldn't get them to be thread local (GCC requires pthreads or something like that to do it) so had to push them to the main class and pass as arguments. Fortunately it wasn't too difficult.