Here is a code I created long time ago for PPC target (there is still some asm statements that might work, although I have not tested them recently).
It should be pretty simple to re-use it on any other target that can do 16×16 multiplications.
The main loop looks like this :
For each group of 8x8 block(MCU)
Code is around 15K in standard C, and results in a static executable file of around the same size (14440 on my machine).
In the example, the input file is ‘image.y’ (Netpbm PGM « rawbits » image data , 1280×1024).
Output file is ‘testout.jpg’.
The jpeg header & related quantification tables are all fixed and pre-calculated (in included files).
(Lire la suite…)