JPEG decoder

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

JPEG decoder

Post by mic_ » Sat Nov 28, 2009 5:27 pm

I've built a version of libjpeg for the 32X so I thought I should post it here.

Decoding demo ROM plus source code and a prebuilt version of libjpeg.a (tested and works on a real 32X): http://jiggawatt.org/badc0de/djpeg32x.zip


And here are my modified libjpeg sources: http://jiggawatt.org/badc0de/jpeg-7-32x.zip

To build the library just do make -f makefile.unix libjpeg.a
If you're on a non-Windows system you'll have to rebuild ansi2knr first with your regular gcc, i.e:
gcc ansi2knr.c
make -f makefile.unix libjpeg.a

I borrowed the memory allocator from the Wolf32X sources. Since bss_end isn't known at the time when the library is built I just hardcoded the heap address (you can find it in jdapimin.c - look for the call to MSYS_Init). The library should work on the Saturn as well if you modify the heap start/endpoint and rebuild it.

Note that I've removed the compression parts of the library in the makefile since I only considered the decompression routines to be relevant.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat Nov 28, 2009 7:23 pm

This is pretty cool :D

it would have been fun if you'd show the decoding process rather than showing black and then the result :P
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Sat Nov 28, 2009 7:46 pm

Well, go ahead and modify read_JPEG_file to flip the frame buffer every once in a while if you want to :wink:

I decided to start porting libpng as well. I've managed to build libpng (and libz) for the 32X already, as well as a decoding test much like the one I did for JPEG. It's not working properly though, so I'll have to do some debugging.

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Sun Dec 06, 2009 9:29 pm

I've cleaned up the library code a bit so that there's now a single archive for both the 32X and Saturn, with different makefiles depending on your target: http://jiggawatt.org/badc0de/jpeg-7-32x_sat.zip

Use:

make -f makefile.32x libjpeg.a

or

make -f makefile.saturn libjpeg.a

Post Reply