0% found this document useful (0 votes)
156 views

Predictive Coding I

This document discusses predictive coding techniques for data compression. It begins by explaining that predictive coding makes use of past data history to encode information. It is mainly used for text and images. One example given is JPEG 2000, which uses lossless predictive coding. The document then gives an example of how a numeric sequence could be differentially encoded based on predicting the next value from the previous. It describes how prediction schemes work by using preceding symbols to determine a probability model for arithmetic coding. Prediction with partial match (PPM) is introduced as a well-known context-based algorithm that adaptively estimates symbol probabilities based on the largest available context.

Uploaded by

Rakesh Inani
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views

Predictive Coding I

This document discusses predictive coding techniques for data compression. It begins by explaining that predictive coding makes use of past data history to encode information. It is mainly used for text and images. One example given is JPEG 2000, which uses lossless predictive coding. The document then gives an example of how a numeric sequence could be differentially encoded based on predicting the next value from the previous. It describes how prediction schemes work by using preceding symbols to determine a probability model for arithmetic coding. Prediction with partial match (PPM) is introduced as a well-known context-based algorithm that adaptively estimates symbol probabilities based on the largest available context.

Uploaded by

Rakesh Inani
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

PREDICTIVE CODING I

Predictive Coding

Makes use of the past history of the data being encoded.

Principally used for text and images

JPEG 2000 : Lossless method Predictive coding

In a message, if certain symbols occur with much higher


probability than others (skewed) more compression can
be achieved
One way transform the sequence into another sequence
that has the desired property- If the transformation is based
on the history of the sequence such schemes are called
predictive schemes.

Predictive Coding - Example

1, 2, 5, 7, 2, -2, 0, -5, -3, -1, 1, -2 ,-7, -4, -2, 1, 3, 4

If we form another sequence by adding 2 to the previous


no. in the sequence and send the difference between the
current element in the sequence and this predicted value

Entropy is 4 bits/symbol
If Huffman or arithmetic Min. 4 bits/symbol needed

Transmitted sequence will be


1, -1, 1, 0, -7, -6 , 0, -7, 0, 0, 0, -5, -7, 1, 0, 1, 0, -1

If this rule is known to the decoder, decoding can be done


from the above residual sequence whose entropy is very
much less than the original sequence. Hence more
compression can be achieved

Prediction Schemes

Use the preceding symbols to predict the


probability model and with this probability model
(Cum.Distr.Function) arithmetic coding can be
done.

Adaptive Arithmetic Coding : Probability model


changes while encoding process.

Preceding symbols form the context.

Prediction Schemes

Consider the encoding of the word probability. Suppose we


have already encoded the first 4 letters, and we want to code
the fifth letter a
1.
2.
3.
4.

First order context for a b


Second order context for a ob
Third order context for a rob
Fourth order context for a prob

Encode each letter using the probability of its occurrence


w.r.t a context of high order
But we cannot find the contexts for all symbols of the
alphabet at the beginning itself.
We use a prediction with partial match (ppm)
Prediction assigning the probability to a symbol based on
its context

Prediction Schemes

PPM (Prediction with Partial Match)


1.
2.

3.

4.

Best known context based algorithm


Use large contexts to determine the prob. of the
symbol being encoded
Estimates the probabilities as the coding
proceeds.
Instead of storing all possible contexts, we store
those contexts that have occurred in the
sequence being encoded.

Prediction with Partial Match (ppm)

At the beginning we have to code letters


that have not occurred previously in this
context
To handle this, source coder alphabet
always contains an escape symbol which
is used to signal that the letter to be encoded
has not seen in this context.

Prediction with Partial Match (ppm)


BASIC ALGORITHM

The size of the largest context is fixed first.

If the symbol to be encoded is not previously encountered in this


context, an escape symbol is encoded.

Size of the context is reduced.

Continues until we obtain a context that has previously been


encountered with this symbol or we arrive at a conclusion that the
symbol has not been encountered previously in any context then
probability =1/M is assigned to encode that symbol where M is the
size of the alphabet.

ppm Example

Coding a of probability
Highest context =4
First checks whether a had previously occurred
with the context prob
If not, code Escape symbol and switch to next
lower context i.e., 3 checks whether a had
previously occurred after rob
Therefore the development of probabilities w.r.t
context is an adaptive process.

Example

The following table shows contexts and


frequency counts for orders 4 through 0
after the 11 symbol string xyzzxyxyzzx has
been input and encoded.

Example Building context table

Example Building context table


Let the 12th symbol is z. The updated table is shown below

Example

Encode the sequence assanissimassa


The table shows the contexts upto order 2
collected while reading and encoding the 14
symbol string

PPM - Encoding

You might also like