https://github.com/habibslim/jpegdecoder
A JPEG (JFIF\Progressive) entirely written in C
https://github.com/habibslim/jpegdecoder
image-compression jpeg-decoder
Last synced: 2 months ago
JSON representation
A JPEG (JFIF\Progressive) entirely written in C
- Host: GitHub
- URL: https://github.com/habibslim/jpegdecoder
- Owner: HabibSlim
- Created: 2019-06-01T14:41:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-26T23:37:08.000Z (over 3 years ago)
- Last Synced: 2025-01-14T14:45:50.348Z (4 months ago)
- Topics: image-compression, jpeg-decoder
- Language: C
- Homepage:
- Size: 18.7 MB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
JPEG Decoder[](https://en.wikipedia.org/wiki/C99)
\[[Specification](./docs/itu-t81.pdf)\]
JFIF-compliant decoder (ISO/IEC 10918-5:2013)
![]()
## Summary
* [Introduction](#introduction)
* [Running](#running)
* [Implementation](#implementation)
* [Credits](#credits)## Introduction
This repository contains an implementation of a decoder for the [JPEG](https://wacv2022.thecvf.com/) image format, written entirely in C without any dependency, following its [official specification](./docs/itu-t81.pdf). It supports JFIF files in the sequential format, or progressive format without upsampling. It uses an [implementation](./docs/loeffler.pdf) of the Loeffler algoritm for fast DCT computation.
## Running
You may compile using make after positioning in the root folder:
```bash
cd ./jpegdecoder/
make
```Run the executable as follows:
```bash
./bin/jpeg2ppm img.jpeg -opt
```Where `opt` can be either:
- `-v` to have the verbose mode which displays the header of the image
- `-b` to have the blabla mode which does not export in ppm but displays the results of each - step for each MCU
- `-p` to save all intermediate images when decompressing a progressive image## Implementation
Our decoder supports images compressed according to the JFIF-APP0 sequential or progressive format. Corrupted images or non-compliant images will cause an appropriate error message.
Images with progressive upsampling are currently unsupported.
The supported subsampling modes are the 4 most common ones:
- vertical subsampling
- horizontal subsampling
- vertical and horizontal subsamplingThe `autotest` folder contains an automatized test to compare uncompressed images to image rasters in the `ppm` format.
```bash
source ./autotest/autotest.sh
```## Credits
This decoder was written from scratch by Habib Slim, Nathan Boulanger and Lucas Druart.