jpg decoder works!
Rayman
Posts: 14,665
was looking around for a jpg decoder for PropGCC and found:
Privacy For Pictures pfp.c v 0.05 22.8.07
Made a few changes to the source and it now compiles
Don't know if it is actually working yet, but maybe this weekend I can test it out...
Like MP3, this probably won't be fast enough for P1. But, might be nice for P2.
It includes some kind of cryptography for some reason, but I've cut that out...
Update: It works!
Privacy For Pictures pfp.c v 0.05 22.8.07
Made a few changes to the source and it now compiles
Don't know if it is actually working yet, but maybe this weekend I can test it out...
Like MP3, this probably won't be fast enough for P1. But, might be nice for P2.
It includes some kind of cryptography for some reason, but I've cut that out...
Update: It works!
Comments
void setpict(i) int i;
to this:
void setpict(int i)
I don't think I've seen this first usage before, and PropGCC doesn't like it.
But, supposedly this compiles under GCC in DOS, so that's a bit of a mystery to me...
The newer standardized style is better as it allows the compiler to check the function parameter types.
Combine this with some of the preliminary html decoder I played around with last year and this could be the beginning of a web browser.
I'm working with Eric on ways to get Spin2cpp to use existing spin obex objects in C - with large external memory programs we need a new programming style where we explicitly declare some variables as being in hub and some as being in external memory. This may come up in your jpg decoder as well, as it might make the code run faster if you can buffer the picture data in hub rather than external ram.
Keep up the good work!
It could run faster with optimization, especially in the DCT/IDCT code. It might be feasible to do it on the P2.
The code that I modified is in the attached zip file. The rest of the code is located at the IJG site. The readme.txt file describes how I built the code.
But, this one is tiny and all the code is in one file...
Not sure which one is faster...
Decoded this 160x128 bitmap in 16 seconds:
I guess that's not too bad... Maybe it'd be faster if I reduced the jpg quality...
But, it uses a lot of memory, because it buffers the whole picture in RAM...
However, I'm thinking that with my QMP, maybe I can have it directly write to the lcd's GRAM instead of using up memory.
Then, perhaps this could even work in non-xmm modes... Actually, no, it's still too big to work in anything but xmm-single or -split