Posts Tagged: ‘jpeg’

Easy/Small JPEG compressor program for embedded systems / mono images

11/20/2012 Posted by admin

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)
process MCU
write outputbuffer

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…)