AgendaLZW ExampleHuffman ExampleShanon Fano ExampleArithmetic Coding ExampleAdvantages for Every method
BILLGATES1BB B BILLGATES1 2B IBI I ILLGATES1 2 3B I LBIL L LLGATES 1 2 3 B I LBIL3 L LGATES 1 2 3 4 B I L GBIL3G G GATES 1 2 3 4 5 B I L G ABIL3G A A ATES
1 2 3 4 5 6B I L G A TBIL3G AT T TES1 2 3 4 5 6 7B I L G A T EBIL3G ATE E ES1 2 3 4 5 6 7 8B I L G A T E SBIL3G ATES S S
Advantages and Disadvantages ofLZWAdvantage: Is a lossless compression algorithm.Hence no informationis lost.One need not pass the code table between the twocompression and the decompression.Simple ,fast and good compressionDisadvantage:What happens when the dictionary becomes too largeOne approach is to throw the dictionary away when itreaches a certain sizeUseful only for a large amount of test data whereredundancy is high
Shannon–FanoAlgorithmBILLGATESSymbols B I L G A T E SProbabilities 1/9 1/9 2/9 1/9 1/9 1/9 1/9 1/9
For a given list of symbols, develop acorresponding list of probabilities orfrequency counts so that eachsymbol’s relative frequency ofoccurrence is known.Sort the lists of symbols according tofrequency, with the most frequentlyoccurring symbols at the left and theleast common at the right.
Divide the list into two parts,with the total frequencycounts of the left part beingas close to the total of theright as possible.
Create a leaf node for each symbol and add it to frequency of occurrence. While there is more than one node in the queue: Remove the two nodes of lowest probability or frequency from the queue Prepend 0 and 1 respectively to any code already assigned to these nodes Create a new internal node with these two nodes as children and with probability equal to the sum of the two nodes probabilities. Add the new node to the queue. The remaining node is the root node and the tree is complete.
Advantages anddisadvantages ofHuffmanThis compression algorithm is mainlyefficient in compressing text orprogram files. Images like they areoften used in prepress are betterhandled by other compressionalgorithms.
What are the advantages of Huffmancoding?Algorithm is easy toimplementProduce a losslesscompression of images
Adaptive Huffman Coding(Dynamic HuffmanCoding) Advantage: Source is encoded in real time. Disadvantage: More chance for transmission error.
What are the Advantages ofarithmetic coding over Huffmancoding? 1.the compression ratio is higher compared to huffman coding. 2.efficiency is greater comparatively. 3.Redundancy is much reduced.