im trying huffman encoding in matlab and reached the part where i get a table with huffman codes, what's next ?

2 views (last 30 days)
Hello, so i have being trying to implement huffman encoding for an image compression project i got, and in my code im able to reach where i get a table of each symbol and it's code such as the one im posting below, but im not quite sure what i do after this, should i replace each pixel in my image with the new code as a string, or should i combine multiple codes and store each 8 bits on it own, or what ? since you cant save a value as binary in matlab im not quite sure where to go from this
Symbol Probablity Code
1 0.947429656982422 "0"
8 0.0165405273437500 "100"
7 0.00766372680664063 "101"
9 0.00628662109375000 "1100"
15 0.00466156005859375 "11010"
6 0.00458145141601563 "11011"
5 0.00319671630859375 "11100"
10 0.00265502929687500 "11101"
4 0.00210571289062500 "111100"
11 0.00152206420898438 "111101"
3 0.00105667114257813 "1111100"
12 0.00102996826171875 "1111101"
13 0.000568389892578125 "1111110"
2 0.000389099121093750 "11111110"
14 0.000308990478515625 "111111110"
0 3.81469726562500e-06 "111111111"

Answers (0)

Categories

Find more on Denoising and Compression in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!