Multimedia Systems: Chapter 7: Data Compression
Multimedia Systems: Chapter 7: Data Compression
Multimedia Systems: Chapter 7: Data Compression
• Decoding Algorithm
Algorithm ArithmeticDecoding
// Input: code: binary code
// : Low[] and High[]: all symbols’ ranges
// Output: The decoded message value
= convert2decimal(code);
Do { find a symbol s so
that
Low(s) <= value < High(s);
output s;
Entropy Encoding: Arithmetic Coding
low = Low(s); high = High(s); range = high – low;
value = (value – low) / range;
} while s is not the terminator symbol;
• Example
Predictive Coding
• Predictive coding simply means transmitting
differences
– Predict the next sample as being equal to the
current sample
• More complex prediction schemes can be used
– Instead of sending the current sample, send the
error involved in the previous assumption
Predictive Coding: Why?
• The idea of forming differences is to make
the histogram of sample values more peaked.
– In this case, what happens to the entropy?
– As a result, which is better to compress?
Predictive Coding: Why?
Lossless Predictive Coding
• Formally, define the integer signal as the set of
values fn. Then, we predict values f^n and compute
the error en as follows:
t
en = fn − fˆn
Show how to code the following sequence
(
fˆn =⎢⎢ 12 ~fn−1 +
)
~fn−2 ⎥⎥⎦ ⎣
25516+en ⎦⎥⎥−256+8
~fn = fˆ +e~n
Lossy Predictive Coding: DPCM
n