View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
JPEG Baseline Encoder

4.3 | 3 ratings Rate this file 14 Downloads (last 30 days) File Size: 774 KB File ID: #40041 Version: 1.3
image thumbnail

JPEG Baseline Encoder


Jorgenhoc (view profile)


28 Jan 2013 (Updated )

This baseline uses an encoding scheme based on the Discrete Cosine Transform (DCT).

| Watch this File

File Information

 The JPEG compression scheme is divided into the following stages:
1. Transform the image into an optimal color space.
2. Adjust Aspect Ratio 16:9
3. Digitization Scheme 4:2:0.
4. Apply a Discrete Cosine Transform (DCT) to blocks of pixels, thus removing redundant image data.
5. Quantize each block of DCT coefficients using weighting functions optimized for the human eye.
6. Encode the resulting coefficients (image data) using a Huffman variable word-length algorithm to remove redundancies in the coefficients.
7. Byte Stuffing.
8. Header JFIF
9. JPG Data Store

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
31 Oct 2016 Angel Palomares

There is a mistake in the Huffman table. The codeword of the second codeword in the last column is: '1111111110001000'

19 May 2016 Kenn Lu

22 Mar 2016 Madhumidha Boopalan

Kyo ,I encod the Y ,Cb and Cr component.
But I am also facing the same problem in this JFIF header. Pls help me.

Comment only
10 Jan 2016 mohammed

it doesn't support color images and needs significant modification in JFIF header

Comment only
12 May 2014 bipul

bipul (view profile)

Kyo, if your problem is solved , will you like to tell me, i am also facing the same problem, jpg is saving as bw image, i need a color saving

02 May 2013 kyo

kyo (view profile)

Hi, can you check this for me, output image is endomaged :(
this is the link:

Comment only
01 May 2013 kyo

kyo (view profile)

I want to save the jpeg file as color, i did do all process (dct,quantif,entropy coding) for my 3 COMPENENT, so i have 3 arrays binary coded (or we can say 3 vectorseam because stream must be vector):
Y_encoded, Cb_encoded, Cr_encoded
- Can you write me the order of fields that i have to create them on my stream vector to get a color image (with function write of corse)
for exemple: SOI APP0 ..............EOI ?????
thank you

Comment only
01 May 2013 Jorgenhoc

Jorgenhoc (view profile)

Hi kyo,
Please review the update with comments made ​​and ask me any questions.

Comment only
01 May 2013 kyo

kyo (view profile)

thank you for your answer, i need your help urgent in this few days,
please contact me on my email (facebook)

Thank you again

Comment only
29 Apr 2013 Jorgenhoc

Jorgenhoc (view profile)

Hi kyo,
Yes, I can help you, but right now it impossible for me. Tomorrow I will help you.
Good luck. I am sorry, but now I have plenty to do.

Comment only
29 Apr 2013 kyo

kyo (view profile)

can you help me please with some points:
1- how can i créate jfif file for Y Cb Cr file = output file will be a color image
2- more explication for all bytes of your header, marker
waiting you
thank you

Comment only
01 May 2013 1.3

Including comments of the JFIF header.

Contact us