View License

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

» Watch video

Highlights from
Arithmetic Encoding & Decoding

4.5 | 2 ratings Rate this file 29 Downloads (last 30 days) File Size: 2.67 KB File ID: #36377 Version: 1.0

Arithmetic Encoding & Decoding



Arithmetic coding is a popular encoding technique in compression engines.

| Watch this File

File Information

Incremental encoding and decoding techniques are implemented.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
19 Sep 2016 Paolo Marchelo R. Sandoval

sir, the Tag_bits produced by the encoding part is more than 52 bits and an error asks for Tag_bits w/ less than 52. How can I overcome this problem?

Comment only
21 Jul 2016 Debarpita Chaudhuri

Sir, I am applying Discrete Wavelet transform on an image and then doing quantization. I want to apply arithmetic coding of the quantized signal. How do I go about doing it? Kindly help

19 Jan 2016 Maysa

Maysa (view profile)

plz sir, how to apply this code after implementing wavelet transform on the selected image?

Comment only
01 Nov 2014 Utkarsh Singh

I get the following error while running the Arithmetic_dec.m file.

??? Input argument "sym" is undefined.

Error in ==> ARM_deco at 10
if(length(sym)==length(p) && sum(p)==1)

Kindly debug the error.

Comment only
23 Apr 2014 priya

priya (view profile)

respected sir,
how to display an image in the form of a matrix?
how to find the probability of each of the intensities of the image?

Comment only
01 Dec 2013 Vinay Kumar Tadepalli

Dear Rathnam,

Bitplane coding is nothing but chopping off bits for each image plane (incase of color image) to reduce amount of memory utilized. And important point is that most signifcant bit contains the most information, while the least signifcant bit contains only minute information of image. For example, if you set the 2 LSBs to 0, then you will see a blurred version of the image.
After using bit-plane coding, you may use run-length/level encoding to perform compression.

Comment only
30 Nov 2013 Rathnam

Respected sir vinay kumar i need Bitplane encoding and decoding for image compression will plz send me

Comment only
28 Nov 2013 R2F6K

R2F6K (view profile)

can you try to find WTF encooding too?

26 Jul 2013 GRAN BADSHAH

Dear Vinay Kumar! can u provide me the file provided to Le Hung because i want to use it for the same purpose, thank in advance.

Comment only
04 Mar 2013 Vinay Kumar Tadepalli

Dear Le Hung,

Its working fine. I have checked after you commented. Please tell me your issue with the execution of code!!

Comment only
04 Mar 2013 Le Hung

It doesn't work

Comment only
07 May 2012 Rahmat Hussein

I don't understand yet. can you write it into .m files please....

Comment only
06 May 2012 Vinay Kumar Tadepalli

After reading the image, You will obtain a matrix of pixel intensities. We know that for a gray-scale image, the intensity values range from 0 to 255. But all the intensities may not be used by the image you have chosen.

For example, a Lena image of 512 x 512 has min. intensity value of 32 and max. intensity value of 192. Also, some of the intensity values b/w 32 and 192 may not be used.

All you have to do is make a list of all the intensity values i.e., 0 - 255 and find out the no. of pixels that belong to each of these intensities. some entries of intensities may have no pixels belonging to it. So, you can discard them and use the intensity values which has non-zero number of pixels belonging to it. And you can divide those numbers in each entry by total number of pixels to obtain the frequency (probability) of each of these intensities in your image. Then these intensities are your symbols with their corresponding probabilities.

Now you have the familiar parameters to use the Arithmetic Coding. :)

Comment only
06 May 2012 Rahmat Hussein

I don't understand in step 2 and 3.
can you make an example please..

Comment only
02 May 2012 Vinay Kumar Tadepalli

Any source coding technique is the final step in encoding. If you want to directly implement this method on Image, you need to add a few steps.
1. Read an image using "imread" command.
2. From the image matrix, find out the different intensity values that are used in the image and make out a list of them.
3. Find the freq. of occurence (probability) of each of intensity values in the image.

Now the Intensity values list make up the source symbols and freq. of occurence will be their corresponding probabilities. Then you can supply the those parameters to this function.

I hope i have clarified your question. If not, please elaborate your question.

Comment only
02 May 2012 Rahmat Hussein

how to use this function to compress and decompress an image??

Comment only

Contact us