0% found this document useful (0 votes)
23 views17 pages

DC (Unit 4)

notes of data

Uploaded by

asamar078
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
23 views17 pages

DC (Unit 4)

notes of data

Uploaded by

asamar078
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 17
Introduction * Predictive coding schemes are the scheme which uses the history of the given sequence in predictive manner in order to decide the encoding. * Predictive coding works on both text and images. *In case of image, predictive coding predicts the value of next pixel with respect to neighboring pixels. *In case of text, predictive coding predicts the value of next symbol to be encoded with respect to past encoded symbol. Prediction with Partial Match (PPM) * PPM was invented by John Cleary and lan Witten back in 1984, * The original paper talked about PPMA and PPMB. The suffix letter ('A' or 'B') denotes the escape code used in the algorithm, however the rest of the algorithm is roughly the same. * PPMC was presented by Alistair Moffat. In the paper by Moffat also PPMC' was presented, which is PPMC but using lazy exclusion. * There are other variants such as PPMD, PPMZ, PPM*. The difference between PPMC and PPMA or PPMB are only the probability computation for the escape code. Prediction with Partial Match (PPM) * The best-know context based algorithm is the ppm algorithm. * The idea of the ppm algorithm is elegantly simple. * The basic algorithm initially attempts to use the largest context. The size of the largest context is predetermined. * If the symbol is encoded has not previously been encountered in this context, an escape symbol is encoded and the algorithm attempts to use the next smaller context. * If the symbol has not occurred in this context either, the size of the context is further reduced. * This process continues until either we obtain a context that has previously been encountered. * In this case we use probability of 1/M encode the symbol, where M is size of the source wr The Basic Algorithm * For example, when coding the “a” of “probability” * We would first attempt to see if the string proba has previously occurred-this is, if a had previously occurred in the context of prob. * If not, we would encode an escape and see if a had occurred in the context of rob. * If the string rob had not occurred previously, we would again send and escape symbol and try the context ob. The Escape Symbol * Escape symbols are inserted when a particular model does not contain the input symbol. * Despite producing excellent compression ratios, PPM based compressors were far less common in practice because of their high demand for memory and computational resources. * In our example we used a count of one for the escape symbol, thus inflating the total count in each context by one. *Cleary and Witten call this Method A, and the corresponding algorithm is referred to as ppma. The Exclusion Principle * The basic idea behind arithmetic coding is the division of the unit interval into subintervals, each of which represents a particular letter. * The smaller the subinterval, the more bits are required to distinguish it from other sub intervals. * If we can reduce the number of symbols to be represented, the number of subintervals goes down as well. This in turn means that the sizes of the subintervals increase, leading to a reduction in the number of bits required for encoding. * The exclusion principle used in ppm provides this kind of reduction in rate. PPM: Example Contexts k=2 | String = ACCBACCACBA | $ means escape values [Context Counts] Context Context | Counts Empty B AC Bea c B $ BA c c $ cA c Q 8 ou poDe 4 BoR@owWs- WHeetcr TRadiscoam (6 * CB®Kiven a Sequence of lengin N- t We craente oN othen Sequences Whene each of these | M-1 Sequences fs A cycle Jet shift of tne oniginor | Seung | |* These NM Sequencas Ore Anrcmgesl fo _lexicoqvaphic ovclen,| + The emceden ther transmits the Sequence of tengin @ | Createct by taping the Jest letten of each eyelicalty, shifted — Sequence fo This sequence of last lettens L. amd the pesitvion of the | Original sequence ty the Semteel Mist kmed os index ane coded ancl sent +o the clecocten. ing sample = Emcacki te using BET: the is Bie the foltowimg ~ Sequence "+ =@ ve Encode ar ¥ = Sequence ant s hn n ¥ 1B) + ne hie e+ ehelh ew [os fa fe iat isaac ? of felalele [¥ fle; ula ms ef < tikes cand yf eButsa y pe Pej al ei ein | 9 ahd) < |e S104 ata |*) S| ce | 29 3 Tidalelel 124 vw & & © hong | ai wie rit a| ate] wl) + a %| d -la] § y oe): 5 o 4% & flv jl l— [9,6 tie | 04 2)? 8 Bitjc dec £ z é & v e A BORPeiis -WHeereR TR & we SFepm Cour) # Receding can decode tre. original sequence by using the Sequence L anct Inder to the onigitat Sequemee in Sontet list. The flash step in obtaiming tne permutation is to qeverete the Sequence E consisting of the Finst oF eneh ews Thenatene . the Sequence Fo le Simpy the sequence Lo im lexicegraphic oreten. We cam “se Lb cmd F te Qenernte the onigiver element coquence a ok Exeenple = Decoding Deroce the fettewing Lb Cssh eth Bit Med Using imeley 19 | by Burress - wheter Troms farm Cour) |Sotawt se , rar efs ] ee uey Indeet 30 ed af Tadenns 4 Cad | sth TH) Fava 'h! - Newer of sweets h ete} a att cam, Indes 25 ULSI mi! SiS) pests i’ = Upper of see's 7 J oped Inder 1H L099 b FOI Ss" - upper & sunts 5 | Indice ° tle? Flel = '* ~ upper ep duets & latew= 6) Ged bed! 211i Cement oe eee | we cs] 's' - lowen @ twels S 2 tr Tt Ne eee crag Wi a tsa “el = Upper cm tents tal hl - Geren oF twe's bh % ., bata Move To Front Coding *A coding scheme that takes advantage of long runs of identical symbols is the move-to-front (mtf) coding. * In this coding scheme, we start with some initial listing of the source alphabet. Arrange initial alphabet in order of special symbol first and then write alphabet sequence as per given source alphabet. * The symbol at the top of the list is assigned the number 0, the next one is assigned the number 1, and so on. * The first time a particular symbol occurs, the number corresponding to its place in the list is transmitted. * Then it is moved to the top of the list. If we have a run of this symbol, we transmit a sequence of Os. * This way, long runs of different symbols get transformed to a large number of Os. Move To Front Coding - Example * Let’s encode L = sshtthbiibe. Let’s assume that the source alphabet is given by A= {b,e,h,i,s,t} * We start out with the assignment * The first element of L is s, which gets encoded as a 4. We then move s to the top of the list, which gives us Example - (L=sshtthbiie ) * The next s is encoded as 0. Because s is already at the top of the list, we do not need to make any changes. The next letter is h, which we encode as 3. We then move h to the top of the list: PILIZ/3 (4/5 afelolelale * The next letter is t, which gets encoded as 5. Moving t to the top of the list, we get O;1;2);3/4]5 t) kl] e|Blepe * The next letter is also a t, so that gets encoded as a 0. * Continuing in this fashion, we get the sequence 4035013505 4036013 6615" Geer] “sspeet Ril Be ey! aie a eat) Wifes 2 meee s” sw le Ee Sst po ee mena 4] | FEFaLS Tele 4 Be SBE | pofrfz rf 4/8 uit te ¢ } PeEREL rsBis gin’ $ A CELE.

You might also like