O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Data compression techniques

8.065 visualizações

Publicada em

Comparison of various data compression techniques and it perfectly differentiates different techniques of data compression. Its likely to be precise and focused on techniques rather than the topic itself.

Publicada em: Tecnologia
  • Seja o primeiro a comentar

Data compression techniques

  1. 1. Data Compression Techniques By, Deep Bhatt
  2. 2. Agenda ● Data Compression ● Basic Types ● Lossless compression ● Lossy compression ● Applications
  3. 3. Data Compression
  4. 4. Data Compression ● What? ● Why it is necessary?
  5. 5. What is Data Compression? The art of representation of information in a compact form is called Data Compression. These representations are created by identifying and using the structure in the data.
  6. 6. Why Data compression? 1) Storage 2) Data Transmission
  7. 7. ● Storage Data Compression reduces the size of a file to reduce the storage space required to store that particular file. ● Data Transmission It saves the time that is required in transmitting a file.
  8. 8. Data Compression Data compression involves two main components: 1. Encoding Algorithm 2. Decoding Algorithm
  9. 9. Components of Data Compression Encoding Algorithm This algorithm takes a message and generates a compressed representation of that message. Decoding Algorithm This algorithm reconstructs the original message or some approximation of it from the compressed representation.
  10. 10. Data Compression Techniques Mainy all the techniques are divided in two basic types. Lossless Compression Lossy Compression
  11. 11. Lossless Compression
  12. 12. Lossless Compression Technique As per its name, No data loss. reconstruct the original message exactly from the compressed message. Generally used for text files, spreadsheet files, important documents. Some examples based on these techniques are RLE, Huffman Coding.
  13. 13. RLE - Run Length Encoding Simple Compression technique. Replace all consecutive numbers or alphabets by first the number of times an alphabet was used followed by the alphabet itself. This method becomes more effective with numbers especially when it is about only two digits 1 and 0
  14. 14. Example For example we have this stream here aaaabbbaabbbbbccccccccdabcbaaabbbbcccd Calculate the repetition 4a3b2a5b8c1d1a1b1c1b3a4b3c1d
  15. 15. Huffman Coding Uses certain method for selecting representation for each symbol which gets certain code which is called as huffman code In fact, assigns fewer bits to symbols that occur more often and more bit to symbols occur less in data. It follows certain algorithm which is described below 1)Make a base node for each code symbol. 2)Count their occurrences.
  16. 16. Example For example, if we have a sentence like following “the essential feature” We exactly have to assign numbers to each symbol and count occurrences By counting we can find 12 different symbols as follows A E F H I L N R S T U 2 5 1 1 1 1 1 1 2 3 1 2
  17. 17. LZ77 Compression LZ77 compression works by finding sequences of data that are repeated It introduces a term called “sliding window”, which means at any point of time, there is a record of what characters went before. For example, a 32K sliding window means the compressor (and decompressor) have a record of what the last 32768 (32 * 1024) characters. When the next sequence of characters to be compressed is identical to one that can be found within the sliding window, The sequence of character is
  18. 18. Example 1)Distance : how far back into the window the sequence starts 2)Length : the number of characters for which the sequence is identical For example, if the word is Blah blah blah blah blah! Here you can see that, data is repeated after another b, and hence our first compression would be like Blah b[D=5,L=5]
  19. 19. Deflate Compression It is totally dependent on above two techniques It gives three different modes to compress data: 1)Not compressed at all 2)Compression, first with LZ77 and then with Huffman coding(The trees that are used to compress in this mode are defined by the Deflate specification itself, and so no extra space needs to be taken to store those trees.) 3)Compression, first with LZ77 and then with Huffman coding with trees that
  20. 20. Lossy Compression
  21. 21. Lossy Compression Unlike Lossless, this method reduces data by eliminating specific information. It can achieve very high compression ratios through data removal. It could happen that if user try to decompress it, only a part of the original information is still there. This method is generally used for video and sound where specific amount of information loss is there and that even not recognised by users. JPEG is
  22. 22. Different Lossy Techniques Comparatively, These methods are less time taking, cheaper as well as it can reduce more space. Methods based on lossy compression, JPEG: Used for pictures and graphics MPEG: used for video compression Audio compression
  23. 23. JPEG Uncompressed Picture Compressed Picture Picture Preprocessi ng Picture Transform ation EncodingQuantization Pictures & graphics compression PreProcessing A picture is divided into 8*8 pixel square block to decrease number of calculations. Picture Preproce
  24. 24. ● Picture preprocessing In this step, there is generation of an appropriate digital representation of the information in the medium being processed. ● Picture transformation This step involves mainly the use of compression algorithm. ● Quantization This step takes place after the data processing part. The values determined in the second part are quantized according to specific properties like resolution. ● Entropy Encoding In this step, There is data streaming of bits and bytes in a sequential way.
  25. 25. Transformation DCT (Discrete Cosine Transform) Method is used further to compress image . -27.500 -213.468 -149.608 -95.281 -103.750 -46.946 -58.717 27.226 168.229 51.611 -21.544 -239.520 -8.238 -24.495 -52.657 -96.621 -27.198 -31.236 -32.278 173.389 -51.141 -56.942 4.002 49.143 30.184 -43.070 -50.473 67.134 -14.115 11.139 71.010 18.039 19.500 8.460 33.589 -53.113 -36.750 2.918 -5.795 -18.387 -70.593 66.878 47.441 -32.614 -8.195 18.132 -22.994 6.631 12.078 -19.127 6.252 -55.157 85.586 -0.603 8.028 11.212 71.152 -38.373 -75.924 29.294 -16.451 -23.436 -4.213 15.624
  26. 26. Quantization Here we have to think about values in the transformed image, Elements near zero will be converted to zero in order to reduce size. All Quantized values will be rounded to integers. This makes it a lossy compression. -2 -19 -15 -6 -4 -1 -1 0 14 4 -2 -13 0 0 -1 -2 -2 -2 -2 7 -1 -1 0 1 2 -3 -2 2 0 0 1 0 1 0 1 -1 -1 0 0 0 -3 2 1 -1 0 0 0 0 0 0 0 -1 1 0 0 0 1 0 -1 0 0 0 0 0
  27. 27. Encoding Finally, Here we encode the quantized image according to regular JPEG standard. As per the example, here we have dimensions 160 * 240 and it means 160 * 240 * 8 = 307.200 bits needed If we use it in JPEG format then, we only need 85143 bits according to the calculation. This interestingly saves Original Image JPEG Compressed Image
  28. 28. MPEG Ultimately it uses JPEG compression technique only. Each frame of it are spatially compressed by JPEG To know this compression, Three frames are necessary to understand 1) I - frame(intra coded) 2) B - frame (Forward prediction)
  29. 29. Audio Compression As name suggests, it is used for speech or music compression. It has so many applications and methods for ex, MP3, PCM, ADPCM Dolby true hd, Direct stream transfer,Apple lossless
  30. 30. Applications Famous applications are: ZIP CSO RAR For Multimedia: GIF JPEG MP3 MPEG and so on.
  31. 31. References ● https://d30y9cdsu7xlg0.cloudfront.net/png/30208-200.png - Image1 ● http://3.bp.blogspot.com/-OvFEEHA2rOs/TwUz57aFqjI/AAAAAAAAB6w/FuhdY- l2ZHo/s1600/data+compression+techniques.png - Image2 ● http://4.bp.blogspot.com/- dm7N1haRYeA/UzPmZ67ZyrI/AAAAAAAAAGo/pTBUre_72aY/s1600/Compress_PDF.png - Image3 ● http://www.walkurdi.com/wp-content/uploads/2014/02/iStock_000018332245Small2.jpg - Image4 ● http://www.sqa.org.uk/e-learning/BitVect01CD/page_81.htm ● http://www.whydomath.org/node/wavlets/basicjpg.html ● http://images.google.de/imgres?imgurl=https%3A%2F%2Fvsr.informatik.tu- chemnitz.de%2F~jan%2FMPEG%2FHTML%2Fframetype.gif&imgrefurl=https%3A%2F%2Fvsr.informa tik.tu- chemnitz.de%2F~jan%2FMPEG%2FHTML%2Fmpeg_tech.html&h=456&w=456&tbnid=50uLrbeNwYA b6M%3A&vet=1&docid=iUQz2h7sXn_7DM&ei=ryUuWNqJJYL4aouPoZgO&tbm=isch&iact=rc&uact=3 &dur=3797&page=0&start=0&ndsp=15&ved=0ahUKEwianau04rDQAhUCvBoKHYtHCOMQMwgeKAE wAQ&bih=638&biw=1366 ● http://www.zlib.net/feldspar.html
  32. 32. Questions if any? Thank You!!!