Jpeg routines out there ?
pjr
Posts: 14
I need a routine to decode and render a jpeg file. Did a search on obex and found nothing.
Can anyone help ?
Can anyone help ?
Comments
I'd also like to be able to decode a jpeg. I have one of these LinkSprite cameras I'd like to be able to use with a Prop.
Even with the ablity to decode a jpeg, a Prop is going to have a hard time displaying anything except very small images because of the memory limitations of the Propeller.
One of them can decode and encode jpg files either from memory or an attached SD card.
Still dreaming of getting that working with the Prop one day...
But, Prop2 might come sooner and then you can uses existing C code to do it...
However, the bigger question is what are you going to do with the bitmap once it's decoded. About the only external memory video driver I know of is Dr.Acula's http://forums.parallax.com/showthread.php?134209-256x224-video-driver
The IJG code is a good starting point, but it will require a lot of optimization to make it work well on the Prop. The DCT/.IDCT can be made much faster by running it in a cog and using a fast butterfly algorithm. Other areas that would need optimizing are the variable length encoder/decoder and the quantizer. The memory usage needs to be made more efficient. You will need a 16-line buffer for each component that is the full width of the image. For an image that is 256 pixels wide, you would need 256x16x3 = 12K of memory to buffer 16 lines.
I am sure a handful of COGs can be dedicated to the encode/decode. I remember that my 286 @ 16 MHz was able to decode a 256x256 pixel JPG in a few minutes.... minutes!! , and it had multiplier !
BTW, I ran a 386DX-40 with windows using Winsock and Netscape 0.9, by the power of grayskull it can be done!
If I could find time, I *WOULD* write a JPEG decoder and perhaps encoder in PASM, since I see this as one of the hurdles that should be jumped to extend the Prop further into other areas. There are a lot of $10 CMOS cameras that spit out JPEG directly, and for machine vision I think this will be necessary, not to mention the fact that JPEG can store an image in much smaller space, so it's memory efficient for OSD graphics.