转自TJpgDec - Tiny JPEG Decompressor (elm-chan.org)
TJpgDec is a generic JPEG image decompressor module that highly optimized for small embedded systems. It works with very low memory consumption, so that it can be incorporated into tiny microcontrollers, such as AVR, 8051, PIC, Z80, Cortex-M0 and etc.
Features
- Platform Independent. Written in Plain C (C99).
- Easy to Use Master Mode Operation.
- Fully Re-entrant Architecture.
- Configurable Optimization Level for both 8/16-bit and 32-bit MCUs.
- Very Small Memory Footprint:
- 3.5K Bytes of Work Area Independent of Image Width.
- 3.5-8.5K Bytes of Code in .text + .rodata.
- Output Format:
- Pixel Format: RGB888, RGB565 or Grayscale Pre-configurable.
- Scaling Ratio: 1/1, 1/2, 1/4 or 1/8 Selectable on Decompression.
Application Interface
There are two API functions to analyze and decompress the JPEG image.
- jd_prepare - Prepare decompression of the JPEG image
- jd_decomp - Execute decompression of the JPEG image
I/O functions
To input the JPEG data and output the decompressed image, TJpgDec requires two user defined I/O functions. These are called back from the TJpgDec module in the decompression process.
- Input Funciotn - Read JPEG data from the input stream
- Output Function - Output the decompressed image to the destination object
Resources
The TJpgDec module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility.
- Getting Started: TJpgDec Application Note July 18, 2021
- Download: TJpgDec R0.03 | Latest Patch May 17, 2023
- Download: Archives
- Download: TJpgDec Sample Projects (AVR, PIC24, LPC1114 and Win32) July 1, 2021
- Demo Movie (MP4/3MB)
- TJpgDec highly optimized for ESP32 MCUs by lovyan03 ↗
- Rust version of TJpgDec by Martin Milata ↗