Exported from http://code.google.com/p/picojpeg. Original author is Rich Geldreich at richgel99 at gmail.com.
picojpeg is a public domain JPEG decompressor written in plain C in a single source file picojpeg.c and a single header picojpeg.h. It has several fairly unique properties that make it useful on small 8/16-bit embedded devices or in very memory constrained environments:
picojpeg has several disadantages and known issues compared to other implementations:
A close variant of picojpeg has been successfully compiled and executed on Microchip's PIC18F4610 microcontroller using SourceBoost Technologies BoostC embedded compiler. (Please email if you would like to see this variant.) picojpeg.c has also been used on the MSP430 and ARM Cortex-M4 CPU's. (For an example usage, see Using picojpeg library on a PIC with ILI9341 320x240 LCD module).
The source distribution includes a sample VS2005 project and precompiled Win32/Win64 command line executables that convert JPG to TGA files using picojpeg for decompression. Sean Barrett's public domain stb_image.c module is used to write TGA files.
picojpeg was originally based off my jpgd decompressor C++ class, which (on modern CPU's) is faster and more capable than picojpeg.c but uses a lot more memory and assumes int's are 32-bits.
Here's picojpeg working on a 6809 CPU (a Tandy Color Computer 3), compiled using gcc6809: picojpeg: Decoding Lena on a Tandy Color Computer 3.
v1.1 - 3/23/2020: Fixed unsigned/signed issue in macro, fixed overflow issue in decoder preventing the decode of very large JPEG's
v1.1 - Feb. 19, 2013: Dual licensed as both public domain and (where public domain is not acceptable) the MIT license. Please contact me for the source drop.
v1.1 - Feb. 9, 2013: Optimized the IDCT row/col loops to avoid the full inverse transform when only the DC component is non-zero, added "reduce" mode for fast 1/8th res decoding, better error handling, added support for H2V1/H1V2 chroma subsampling factors, ported jpg2tga.cpp to jpg2jpg.c (so all modules are written in plain C now), added code to compare picojpeg's decoded output vs. stb_image'c for testing/verification.
v1.0 - Nov. 10, 2010: Initial release. Derived from the original version which was tested on a PIC18F series CPU.
Thanks to Daniel Swenson [email protected] for contributing to picojpeg's development, and Chris Phoenix [email protected] for his MSP430 patches.
For any questions or problems with this module please contact Rich Geldreich at richgel99 at gmail.com. Here's my twitter page.