Revision [19782]

This is an old revision of HuffmannCodierung made by ToBo on 2014-10-06 03:47:28.

 

Huffmann-Codierung


1. Prinzip

2. Implementierungen


Huffman Encoder/Decoder
http://sourceforge.net/projects/huffman/

Interface
int huffman_encode_memory(const unsigned char *bufin,
                          uint32_t bufinlen,
                          unsigned char **pbufout,
                          uint32_t *pbufoutlen);
int huffman_decode_memory(const unsigned char *bufin,
                          uint32_t bufinlen,
                          unsigned char **bufout,
                          uint32_t *pbufoutlen);


3. Häufigkeitsanalyse


clear
clc

s = [];
for k=1:100
s = [s 0xA0 0x01 randi(2).'-1 0xE0];
s = [s 0xA0 0x02 randi(2).'-1 0x00 randi(256).'-1 randi(256).'-1 randi(256).'-1 0xE0];
end

a = unique(s).';  % Alphabet



for k=1:length(a)
    c(k) = sum(s==a(k));
end

p = c/sum(c);

ps=sort(p);
tres=min(ps(end-10:end));
sel = p>tres;
dec2hex(a(sel))
p(sel).'



Siehe auch
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki