ENSC 424 - Multimedia Communications Engineering: Topic 6: Arithmetic Coding 1
ENSC 424 - Multimedia Communications Engineering: Topic 6: Arithmetic Coding 1
Communications Engineering
Topic 6: Arithmetic Coding 1
Jie Liang
Engineering Science
Simon Fraser University
JieL@sfu.ca
abcd…..
dcba….. 0 1
J. Liang: SFU ENSC 424 9/20/2005 5
0 1
Arithmetic Coding a b c
Disjoint and complete partition of the range [0, 1)
[0, 0.8), [0.8, 0.82), [0.82, 1)
Each interval corresponds to one symbol
Interval size is proportional to symbol probability
The first symbol restricts the tag
0 1
position to be in one of the intervals
The reduced interval is partitioned
0 1
recursively as more symbols are
processed.
0 1
Observation: once the tag falls into an interval, it
never gets out of it
J. Liang: SFU ENSC 424 9/20/2005 6
Some Questions to think about:
Why compression is achieved this way?
How to implement it efficiently?
How to decode the sequence?
Why is it better than Huffman code?
a b c EOF
1 2 3
Range 0.144
0.656 0.7712 0.77408 0.8
1 2 3
Range 0.00288
0.7712 0.773504 0.7735616 0.77408
Termination: Encode the lower end (0.7712) to signal the end.
Difficulties: 1. Shrinking of interval requires very high precision for long sequence.
2. No output is generated until the entire sequence has been processed.
J. Liang: SFU ENSC 424 9/20/2005 10
Encoder Pseudo Code
Probability Mass Function
Cumulative Density Function (CDF)
0.4
For continuous distribution:
x 0.2
0.2 0.2
FX ( x) = P ( X ≤ x) =
−∞
∫ p( x)dx
1 2 3 4 X
For discrete distribution:
i 1.0
FX (i ) = P( X ≤ i ) = ∑ P( X = k )
k = −∞
CDF 0.8
0.4
Properties: 0.2
Non-decreasing
Piece-wise constant X
1 2 3 4
Each segment is closed at the lower end.
1 2 3
Decode 1
0 0.8 0.82 1.0
1 2 3
Decode 3
0 0.64 0.656 0.8
1 2 3
Decode 2
0.656 0.7712 0.77408 0.8
1 2 3
Decode 1
0.7712 0.773504 0.7735616 0.77408
0.0848 0.09632
E1: 2x, Output 0
0.1696 0.19264 E1: Output 0