Giter Club home page Giter Club logo

jpegdecoder's Introduction

Jpeg Decoder

First year C project at Ensimag - Grenoble INP - 2017

Screen Shot 2017-12-03 at 12.12.23

Conversion of .jpg or .jpeg images into .ppm images. Works with all horizontal and vertical downsampling ratios.

Decoding steps

See JPEG encoding to understand the different steps.

Getting started

Note: To avoid architecture compatibility issues, the use of a linux virtual machine environment is recommended. (Vagrant)

Compilation

make all

Execution

To test the program on a specific image:

./bin/jpeg2ppm ./images/image.jp[e]g

To test the program on all images of the ./images directory:

make test

Cleaning

Cleaning (jpeg2ppm, .ppm, .pgm, .o)

make clean

Code structure

main.c

// Creation of the image (Variable Length Decoding using the Huffman tables)
image * my_image = decompress(jdesc, stream);

// De-quantization using the Quantization tables
de_quantization (jdesc, my_image);

// Unraveling of the zigzag ordering
de_zig_zag(my_image);

// Reverse Discrete Cosine Transform
idct(my_image);

// Decoded image reassembled from blocks
image_to_pixels(my_image);

// Conversion of the image from YCbCr to RGB
rgb(my_image);

// Creation of the .ppm or .pgm file (depending on if its a B&W or RGB image)
ppm(filename, my_image);

Structs used

    ┌───────────────────────────────────────────────────────────┐
    │                           image                           │
    │                                                           │
    │                                                           │
    │  ┌ mcu_table ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐  │
    │    ┌─────────────────────────────────────────────────┐    │
    │  │ │                       mcu                       │ │  │
    │    │                                                 │    │
    │  │ │ ┌ ─block_table─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ │ │  │
    │    │   ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐   │    │
    │  │ │ │ │Block│Block│Block│Block│Block│Block│ ... │ │ │ │  │
    │    │   │  Y  │  Y  │  Y  │  Y  │ Cb  │ Cb  │     │   │    │
    │  │ │ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┘ │ │ │  │
    │    │  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─  │    │
    │  │ └─────────────────────────────────────────────────┘ │  │
    │    ┌─────────────────────────────────────────────────┐    │
    │  │ │                       mcu                       │ │  │
    │    │                                                 │    │
    │  │ │ ┌ ─block_table─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐ │ │  │
    │    │   ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐   │    │
    │  │ │ │ │Block│Block│Block│Block│Block│Block│ ... │ │ │ │  │
    │    │   │  Y  │  Y  │  Y  │  Y  │ Cb  │ Cb  │     │   │    │
    │  │ │ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┘ │ │ │  │
    │    │  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─  │    │
    │  │ └─────────────────────────────────────────────────┘ │  │
    │   ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │
    │                                                           │
    └───────────────────────────────────────────────────────────┘

jpegdecoder's People

Contributors

selimchraibi avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.