Digital Communication System
Digital Communication System
Representation of the source signal by a stream of (binary) symbols Adaptation to the properties of the transmission channel
information source
source coder
channel coder
modulation
binary symbols
channel noise
information sink
source decoder
channel decoder
demodulation
digital channel
Source
Source Source Adapt to source statistics coder coder (and distortion measure)
Channel
Bernd Girod: EE368b Image and Video Compression Lossless Compression no. 2
Exploit redundancy.
l l l
Take advantage of patterns in the signal. Describe frequently occuring events efficiently. Lossless coding: completely reversible Remove information that the humans cannot perceive. Match the signal resolution (in space, time, amplitude) to the application Lossy coding: irreversible distortion of the signal
Almost every lossy compression system contains a lossless compression system Lossy compression system
Quantizer Encoder Lossless Encoder Lossless Decoder Quantizer Decoder
We will discuss the basics of lossless compression first, then move on to lossy compression
Bernd Girod: EE368b Image and Video Compression Lossless Compression no. 4
Binary decision trees and variable length coding Entropy and bit-rate Huffman codes Statistical dependencies in image signals Sources with memory Arithmetic coding Redundancy reduction by prediction
Example: 20 Questions
n
Alice thinks of an outcome (from a finite set), but does not disclose his selection. Bob asks a series of yes-no questions to uniquely determine the outcome chosen. The goal of the game is to ask as few questions as possible on average. Our goal: Design the best strategy for Bob.
Observation: The collection of questions and answers yield a binary code for each outcome.
0 0 0
1 1 0 1 1 0 0 1
0 1 0
1 1 1
B C
0
C D 0 E
D
n
A
n n n
B C
DE
F G
Average description length for K outcomes lav = log2 K Optimum for equally likely outcomes Verify by modifying tree
Use shorter descriptions for likely outcomes Use longer descriptions for less likely outcomes Optimum balanced code trees, i.e., with equally likely outcomes, can be pruned to yield unbalanced trees with unequal probabilities. The unbalanced code trees such obtained are also optimum. Hence, an outcome of probability p should require about
Intuition:
l
l l
1 log 2 bits p
Let a memoryless source be characterized by an ensemble U0 with: Alphabet {a0 , a1 , a2 ,..., aK 1} Probabilities {P(a0 ), P(a1 ), P(a2 ),..., P(aK 1 )}
Shannon: information conveyed by message ak : I(ak ) = log(P(ak )) Entropy of the source is the average information contents: H (U0 ) = E{I ( ak )} = P( ak ) log( P( ak )) = P(u0 ) log( P(u0 ))
k =0 u0 K 1
Properties of entropy:
The entropy H(U 0 ) is a lower bound for the average word length l av of a decodable variable-length code for the symbols u 0 . Conversely, the average wordlength l av can approach H(U 0 ), if sufficiently large blocks of symbols are encoded jointly. Redundancy of a code:
R = lav H(U 0 )
Bernd Girod: EE368b Image and Video Compression Lossless Compression no. 11
Example
lav = H(U 0 )
is achieved, if all individual code word length
ai P(a i ) a0 a1 a2 a3
0.500 0.250 0.125 0.125
For binary code words, all probabilities would have to be binary fractions:
P(a k ) = 2 l
cw (a k
Huffman-Code
n
Design algorithm for variable length codes proposed by Huffman (1952) always finds a code with minimum redundancy. Obtain code tree as follows: 1 Pick the two symbols with lowest probabilities and merge them into a new auxiliary symbol. 2 Calculate the probability of the auxiliary symbol. 3 If more than one symbol remains, repeat steps 1 and 2 for the new auxiliary alphabet. 4 Convert the code tree into a prefix code.
Bernd Girod: EE368b Image and Video Compression Lossless Compression no. 13
Huffman-Code - Example
Fixed length coding: l =3.00 Huffman code: lav =2.71 Entropy H(U0 )=2.68 Redundancy of the Huffman code: R=0.03
Probability density function of the color difference signals R-Y and B-Y
Joint sources
n
Joint sources generate N symbols simultaneously. A coding gain can be achieved by encoding those symbols jointly. The lower bound for the average code word length is the joint entropy:
Data: 3 EBU-, 3 SMPTE test slides, each component Y, R-Y, B-Y uniformly quantized to 64 levels
18
bits/sample
= 2.174 bits/sample
Statistical dependency between R, G, B is much stronger. If joint source Y, R-Y, B-Y is treated as a source with memory, the possible gain by joint coding is much smaller.
Markov process
n
Neighboring samples of the video signal are not statistically independent: source with memory
A source with memory can be modeled by a Markov random process. Conditional probabilities of the source symbols u T of a Markov source of order N:
H(U T | ZT ) H(UT )
n
Average code word length can approach H(U T | ZT ) e.g. with a switched Huffman code. Number of states for an 8-bit video signal:
10