No BSD License
-
Arith06(xC)
Arith06 Arithmetic encoder or decoder
-
Arith07(xC)
Arith07 Arithmetic encoder or decoder
-
Huff06(xC, ArgLevel, ArgSpeed...
Huff06 Huffman encoder/decoder with (or without) recursive splitting
-
HuffCode(HL,Display)
HuffCode Based on the codeword lengths this function find the Huffman codewords
-
HuffLen(S)
HuffLen Find the lengths of the Huffman code words
-
HuffTabLen(HL)
HuffTabLen Find how many bits we need to store the Huffman Table information
-
HuffTree(HL,HK)
HuffTree Make the Huffman-tree from the lengths of the Huffman codes
-
JPEGlike(arg1, arg2, arg3)
JPEGlike Entropy encoding (or decoding) in a JPEG like manner
-
Mat2Vec(W, Method, K, L)
Mat2Vec Convert an integer matrix to a cell array of vectors,
-
TestBin2(L,N)
TestBin2 Find difference of some coding strategies
-
UniQuant(X, del, thr, ymax)
UniQuant Uniform scalar quantizer (or inverse quantizer) with threshold
-
b=BitEst(N,N1);
TestBin Test coding of binary sequence
-
entropy(S)
entropy Function returns 0th order entropy of a source.
-
eob3(arg1, arg2, arg3, arg4)
-
TestArith.m
-
TestHuff.m
-
TestMat2Vec.m
-
contents.m
-
View all files
from
Huffman Coding and Arithmetic Coding
by Karl Skretting
Functions that compress integer sequences.
|
| entropy(S)
|
function H = entropy(S)
% entropy Function returns 0th order entropy of a source.
%
% H = entropy(S)
% S is probability or count of each symbol
% S should be a vector of non-negative numbers.
% Ver. 1.0 09.10.97 Karl Skretting
% Ver. 1.1 25.12.98 KS, Signal Processing Project 1998, english version
if nargin<1
error('entropy: see help.')
end
N=sum(sum(S)); % if S is probability this is 1
if ((N>0) & (min(S(:))>=0))
Snz=nonzeros(S);
H=log2(N)-sum(Snz.*log2(Snz))/N;
else
H=0;
end
return
|
|
Contact us at files@mathworks.com