how to know how many number of symbol needed for huffman coding ?

2 ビュー (過去 30 日間)
nur aqila
nur aqila 2018 年 2 月 23 日
コメント済み: nur aqila 2018 年 2 月 24 日
hi, I want to perform Huffman coding for 512x512 image. I'm new to this. how do I know how many numbers of symbols (NOS) do I need to create for Huffman table?

採用された回答

Walter Roberson
Walter Roberson 2018 年 2 月 23 日
The number you need is length(unique(YourMatrix)), possibly plus one for an end of stream marker.
  4 件のコメント
Walter Roberson
Walter Roberson 2018 年 2 月 23 日
Except for the case where the 512 x 512 image is all 0 or all 255, the minimum number of input symbols you can use for the huffman process is 2, one symbol for binary 0 and 1 symbol for binary 1. With the huffman encoding process it is legal to interpret the source numbers bit by bit, or 2 bits at a time, or 3 bits at a time, or any other number of bits at a time that factors into the total number of bits in the data. With the huffman encoding process, if it just happened that the binary stream included a bunch of occurrences of binary 00 and binary 111 it would be legal to create one input symbol for binary 00 and another for binary 111 . The huffman encoding process doesn't care... but your choice of symbols can end up influencing the length of the output.
nur aqila
nur aqila 2018 年 2 月 24 日
i got it. thanks for your help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDenoising and Compression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by