Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.2 KB

README.md

File metadata and controls

43 lines (34 loc) · 1.2 KB

JPEG

Decoder for jpeg lossy signal compression

Program to decode .jpg/.jpeg files and convert them into uncompressed bitmap (.bmp) image.

No support for decoding of :

  • Progressive DCT mode (yet)
  • Lossless mode
  • Arithmetic Encoding
  • Oops, haven't considered single channel jpg images (normal map, specular map mostly use that)

Build Instructions

With cmake installed,
cmake CMakeLists.txt
make
or
gcc ./Decoder/src/jpeg.c ./Decoder/src/QHTable.c ./Decoder/src/bitstream.c -Og ./utility/bmp.c -lm -o jpeg_decoder
-DDEBUG flag should be passed to gcc to generate debug output

Usage

./jpeg_decoder img.jpg
Output will be saved as jpeg_output.bmp

Sample DCT compressed output

Original Image

DCT Compressed Image

Decoded Image

References

https://en.wikipedia.org/wiki/JPEG
https://www.w3.org/Graphics/JPEG/itu-t81.pdf
https://en.wikipedia.org/wiki/Discrete_cosine_transform
https://www.ietf.org/rfc/rfc1951.txt [Deflate]
https://www.youtube.com/watch?v=CPT4FSkFUgs