The first release on the repo will be later (maybe next week or so), but I'll already start a thread about this to let you know what I'm currently working on, and maybe already get some early feedback (like suggestions for names).
Edit: repo link: http://repo.openpandora.org/?page=detail&app=piv.wb
I want to use my Pandora to view pictures taken with my digital camera. The Pandora is quite nice for this, because I can just insert the SD card from my camera in my Pandora.
However, the default image viewer (ristretto) is quite slow, and I don't think the other viewers on the repo are much faster. My camera makes 10 megapixel JPEG files, about 5MB each. On my 1GHz unit, using ristretto, it takes about 2.5 seconds per image to load it and show it scaled to fit the screen. That is not an acceptable speed. Also, zooming in and out is not practical at all in ristretto.
So I decided to make something better, tailored to the Pandora. I'll call it "Pandora Image Viewer" for now, unless someone has a better name for it - suggestions are welcome.
Edit: decided to keep the name, "Pandora Image Viewer" or "PIV"
Advantages:
Disadvantages or limitations:
So how did I get it 5 times faster than ristretto?
Edit: repo link: http://repo.openpandora.org/?page=detail&app=piv.wb
I want to use my Pandora to view pictures taken with my digital camera. The Pandora is quite nice for this, because I can just insert the SD card from my camera in my Pandora.
However, the default image viewer (ristretto) is quite slow, and I don't think the other viewers on the repo are much faster. My camera makes 10 megapixel JPEG files, about 5MB each. On my 1GHz unit, using ristretto, it takes about 2.5 seconds per image to load it and show it scaled to fit the screen. That is not an acceptable speed. Also, zooming in and out is not practical at all in ristretto.
So I decided to make something better, tailored to the Pandora. I'll call it "Pandora Image Viewer" for now, unless someone has a better name for it - suggestions are welcome.
Edit: decided to keep the name, "Pandora Image Viewer" or "PIV"
Advantages:
- It's fast. About 5 times faster than ristretto (less than 0.5 second per image when viewing those 10MP JPEG files).
- Full 24-bit color. It uses notaz' SDL so you don't get 16-bit color like in all other image viewers.
- Nice zooming. Press X/Y to zoom in/out, use the nubs to navigate (left nub for fast movement, right nub for precision movement)
- It does a lot of preloading, so in practice, it feels extremely snappy (no delay at all when pressing the next/previous button)
Disadvantages or limitations:
- Only supports full-screen, not windowed. In my opinion, that's the only thing you need anyway, especially on a small screen like that of the Pandora.
- No advanced features at all. Just "next", "previous", "zoom in/out", "start/stop slideshow" and that's it. No image editing stuff. No thumbnails. No photo collection management stuff. Maybe I'll add more features when someone requests them or when I feel the need, but this is not going to be anything advanced. Just a simple image viewer. Let me know what you think it should be able to do. Edit: it is starting to get more features
- Very minimal interface: at the moment it's just a zenity dialog that lets you select a folder, and then it will show all images in that folder.
- It will eat all your RAM - I could change that, but I prefer to preload as much as possible, to make everything as snappy as possible. It does not need a lot of RAM though, so if you're low on memory, it will just do less preloading.
- It only uses the CPU - not the GPU or the DSP. Probably it could be even faster if those would be used effectively. But unless you want to view extremely huge images, I don't think it's worth the effort.
So how did I get it 5 times faster than ristretto?
First of all, it uses libjpeg-turbo, which uses NEON to speed up the decoding of JPEG files. That already helps quite a bit - by the way, I would recommend to use this in the default firmware too.
Next, it loads large JPEG at 1/4 or 1/2 resolution at first (until you start zooming in), which means decoding is faster and there's less downscaling effort needed afterwards.
Then, in order to fit the image to the screen, it uses the hardware scaler to downscale (or upscale, in case you're zooming in a lot) the image.
For example: say you have a 4800x3600 JPEG file (17.2 MP). At first, it gets loaded at 1/4 resolution, which gives us a 1200x900 surface. The hardware scaler then downscales it from that. If you zoom in, higher res decodings are done and we simply adjust the size of the screen to the desired zoom level. For example, if you zoom in to 4 times the original resolution, I simply set the screen size to 200x120 and blit parts of the 4800x3600 image to that.
I make sure that the JPEG decoding goes straight to the right surface format (XBGR) - this is something that libjpeg-turbo supports, but the default libjpeg doesn't, meaning that after decoding the JPEG file, you still need to convert the resulting surface to the screen format.
The above steps are enough to speed up things by a factor of 5. Then by preloading as much as possible, things become really very snappy.
Next, it loads large JPEG at 1/4 or 1/2 resolution at first (until you start zooming in), which means decoding is faster and there's less downscaling effort needed afterwards.
Then, in order to fit the image to the screen, it uses the hardware scaler to downscale (or upscale, in case you're zooming in a lot) the image.
For example: say you have a 4800x3600 JPEG file (17.2 MP). At first, it gets loaded at 1/4 resolution, which gives us a 1200x900 surface. The hardware scaler then downscales it from that. If you zoom in, higher res decodings are done and we simply adjust the size of the screen to the desired zoom level. For example, if you zoom in to 4 times the original resolution, I simply set the screen size to 200x120 and blit parts of the 4800x3600 image to that.
I make sure that the JPEG decoding goes straight to the right surface format (XBGR) - this is something that libjpeg-turbo supports, but the default libjpeg doesn't, meaning that after decoding the JPEG file, you still need to convert the resulting surface to the screen format.
The above steps are enough to speed up things by a factor of 5. Then by preloading as much as possible, things become really very snappy.
Last edited by a moderator: