Predictive Coding
by Erol Seke
For the course “Data Compression”
ESKİŞEHİR OSMANGAZİ UNIVERSITY
Differences over Predictions
Assumption is that the correlation between consecutive sample sets are high
( e.g. difference between consecutive samples are small ),
so that the difference between new sample(s) and their estimates are small,
so that the difference(s) can be coded using fewer number of bits.
difference
channel lossless
lossless
x x
coding decoding
-
Memory Memory
Predict Predict
encoder decoder
𝑥ො 𝑥ො
Principle of predictive coding
Simplest case
difference sum
channel
x x
-
hold hold
last value last value
𝑥ො
𝑥ො
encoder decoder
differentiator integrator
Differences over Prediction (not good)
Since the predictors do not use the same values, error builds up.
Predictions on erroneous values generates values with larger errors,
eventually causing large error build-ups.
difference
channel
lossy
𝑥 decoding 𝑥+𝑒
∆𝑥 coding ∆𝑥ሶ
-
Memory Memory
Predict Predict
encoder decoder
𝑥ො 𝑥ො + 𝑒Ƹ
Therefore, this model cannot be used in practice.
Differences over Prediction (solution)
When the encoding is lossy, it is logical to perform prediction
using possibly erroneous history so that no error build-up occurs.
Predictors are using the same input values.
diff. Channel
Lossy
𝑥 Decoding Memory Predict 𝑥ො
encoding
-
𝑥ො
Predict Decoding
Memory
Encoder Decoder
There will be errors resulting from lossy encoding, but there will be no error build-up.
∆Σ or Σ∆
can just be a quantization
diff. Channel
Lossy
x Accumulator 𝑥ො
encoding
-
𝑥ො
∆
Accumulator
Encoder Decoder
Quantization can be as simple as single bit representing + or - differences
∆Σ with single bit quantization
Assume that the
continuous curve
represents the
analog/digital Granular noise
consecutive values
Slope
overload
∆ is small
∆ is large
∆t
Example with digital input sequence
𝑥[𝑛], 𝑥[𝑛]
ො
error (loss)
1 bit code: 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 n
Adaptive ∆Σ
Increase the step size if last two outputs have the same sign
Decrease the step size if last two outputs have the opposite sign
The rule to determine the step size is simply n n1K n n1
Note: to keep the figure simple, only 2 values of step size are used here
2D
Current
Previous block
block
∆𝑥 = -
∆𝑥
∆𝑥
basic approach : encode the difference
another approach : in order to have small
numbers in ∆𝑥, find the best matching block
within previous blocks and encode both
position and difference.
yet another approach : do the encoding on a
linear transformation of the difference.
END