Predictive Coding i

March 21, 2018 | Author: Rakesh Inani | Category: Data Compression, Code, Applied Mathematics, Algorithms, Areas Of Computer Science


Comments



Description

PREDICTIVE CODING I 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  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. 4 bits/symbol needed Transmitted sequence will be 1. -1. 0. -7. 0. 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    If we form another sequence by adding „2‟ to the previous no. 2. -1 If this rule is known to the decoder. -7. 5.-7. -2. 1. 0. -2 . -2. 0. 0.Predictive Coding . 0. 7. 1. Hence more compression can be achieved . -7. 1. -3. -1. decoding can be done from the above residual sequence whose entropy is very much less than the original sequence. 0. 1. -4. -5. 2. -5. -6 . 3. 1. 0.Example  1. Function) arithmetic coding can be done.  Preceding symbols form the context.Prediction Schemes  Use the preceding symbols to predict the probability model and with this probability model (Cum.  Adaptive Arithmetic Coding : Probability model changes while encoding process. .Distr. 3. We use a prediction with partial match (ppm) Prediction – assigning the probability to a symbol based on its context .r. 4. Suppose we have already encoded the first 4 letters. and we want to code the fifth letter „a‟ 1.     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. 2.t a context of high order But we cannot find the contexts for all symbols of the alphabet at the beginning itself.Prediction Schemes  Consider the encoding of the word „probability‟. Best known context based algorithm Use large contexts to determine the prob. we store those contexts that have occurred in the sequence being encoded. 4. Instead of storing all possible contexts. of the symbol being encoded Estimates the probabilities as the coding proceeds. . 3. 2.Prediction Schemes  PPM (Prediction with Partial Match) 1. 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. ■ 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. an escape symbol is encoded. . ■ If the symbol to be encoded is not previously encountered in this context. ■ Size of the context is reduced. e.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. .. 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 . The updated table is shown below .Example – Building context table ■ Let the 12th symbol is z. Example   Encode the sequence – assanissimassa The table shows the contexts upto order 2 collected while reading and encoding the 14 symbol string . Encoding .PPM .
Copyright © 2024 DOKUMEN.SITE Inc.