Size increases after encoding

1 次查看(过去 30 天)
FIR
FIR 2012-12-25
Finally i got through the problem in huffman encoding,but the size after encoding increases,please help
A=imread('imagcp.bmp');
A=A(:);
YourVector=double(A);
symbols = unique(YourVector(:));
counts = hist(YourVector(:), symbols);
p = double(counts) ./ sum(counts)
[dict,avglen]=huffmandict(symbols,p);
comp=huffmanenco(A,dict);
numel(comp)
ans =
167343
>> numel(A)
ans =
65536

回答(1 个)

Walter Roberson
Walter Roberson 2012-12-25
Remember, comp is representing binary, and so is 1 bit per element, whereas your original data is at least 8 bits per element.
  6 个评论
FIR
FIR 2012-12-26
walter can you please help me in giving the code for restoring image content

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Import, Export, and Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by