Porting libjpeg to bare boards

Hi all,

I just want to ask..in theory is it possible to port algorithm only software to bare board ?

I have ATMega128 connected to graphic LCD. I want to make an electronic picture/photo frame (so I can change the photo using SDCARD or other solid state disk). So I need to have JPEG decoder (the GPL ones..since this is just for my fun..).

So I'm thinking to port libJPEG for ATMega128. But this libJPEG use Linux/Unix and 32-bits processors.

So, my second question is : did anyone have some success for this idea ? :-)

Thank you so much for your help.

-daniel

Reply to
kunil
Loading thread data ...

I think you mean "can I port C code to my microcontroller" and the answer is yes.

It depends on your coding ability and the complexity of the software.

It might be easier to just read bitmaps :)

ttyl,

--buddy

Reply to
Buddy Smith

I don't know about libjpeg, I'm sure it's possible to port with enought effort, but there are other JPEG decoders that certainly are easy to port. I ported this decoder: ftp://137.193.64.130/pub/jpeg/pfp.zip to a NIOS processor. I'm not sure how good this decoder is compared to the reference implementation or libjpeg but it did work on several of my test images and it's a breeze to port. Just replace win.c with your main program and you're done. The code in pfp.c will try to open a file stored in the "filename" string and return pixels in the "bgr" array. "hdim and "vdim" is the size of the result image in the bgr array.

I found a couple other libs but this one was so small and easy to grasp that I went with it.

Andrew

Reply to
andrew queisser

[snip]

I'd be interested in this code too but the site seems to have gone. Any chance of posting it somewhere?

Peter

Reply to
Peter

No it doesn't. It's simply a piece of C code. I've ported the standard JPEG6A source (which comprises libjpeg) to many OS-less platforms.

However, the mega128 doesn't have enough RAM to do this job. It's also too slow (though it would eventually get there, of course). And how do you display the result?

Use an ARM7.

Reply to
larwe

Peter,

Check your email, I sent you a copy of what I downloaded since I don't have a website to put it on. The FTP site still seems to work, though.

Andrew

Reply to
andrew queisser

Ouw..I dont know that.

I though 18MIPS is enough to display static picture.

Do you have any reference on MIPS vs JPEG decoding speed ? Is there any equation that I should know ?

Let's just say, the photo frame should be able to display 3MB JPEG

32-bits (from digicam).

But you're right on the memory. I'm planning to add SRAM to the board.

But if the MIPS is too far (from decoding speed), I'll take your suggestion to take it to ARM7.

Thank you for your help.

-daniel

Reply to
kunil

Actually, anything larger than 0.0 MIPS will be a waste of CPU speed on a static picture, what with there being exactly _nothing_ left to do for the CPU once the picture's on the screen ;-)

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.