Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis

Similar presentations


Presentation on theme: "Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis"— Presentation transcript:

1

2 Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis gazepidis@ist.edu.gr

3 2 Introduction  Compress methods are key enabling techniques for multimedia applications.  Raw media takes much storage and bandwidth  A raw video with 30 frame/sec, resolution of 640x480, 24bit color One second of video 30 * 640 * 480 * 3 = 27.6480 Mbytes fps width height 3*8bit (True Colour) One hour video is about 100Gbytes Lossless Compression

4 3 Lossless vs. Lossy (Audio file example) Lossless Compression Losseless Lossless compression data reduction methods also reduce file size, but retain all of the original data or music. Lossless compression is used where the quality of the compressed music/image/video file is critical. Another example of lossless compression is data or text where all of the information must be retained for accuracy. DTS-HD and Dolby True HD are two examples of lossless compression. Lossy Lossy compression is a data reduction method that reduces the amount of data during the coding process, but retains enough information to be useful. For example, an MP3 file is a lossy music file that discards some of the original data but is still acceptable for music listening. The advantage of lossy compression is that the music file takes much less storage space.

5 4 Some Terms Lossless Compression Encoder (compression) Storage or networks Decoder (decompression) Data Input (a sequence of symbols from an alphabet) Recovered data sequence Code (a sequence of codewords) Information source  Lossless compression: The recovered data is exactly the same as the input  Lossy compression: The recovered data approximates the input data Compression ratio = bits used to represent the input data bits of the code

6 5 Properties of Huffman Coding Lossless Compression …in Computer Science and information theory, Huffman coding is an entropy encoding algorithm used for lossless data compression.  Huffman coding uses longer codewords for symbols with smaller probabilities and shorter codewords for symbols that often occur.  The two longest codewords differ only in the last bit.  Huffman coding is not effective for cases when there are small number of symbols

7 6 Properties of Huffman Coding Lossless Compression “this is an example of a huffman tree” CharFreqCode x110010 u100111 r111000 p110011 o100110 l111001 s21011 t20110 m20111 n20010 i21000 h21010 f31101 e4000 a4010 space7111 parent node leaves ‘1’ ‘0’

8 7 Dictionary Based Lossless Compression  Dictionary based method is another way to capture the correlation of symbols.  Static dictionary  Good when the data to be compressed is specific in some application.  For instance, to compress a student database, the world “Name”, “Student ID” will often appear.  Static dictionary method does not work well if the source characteristics change.  Adaptive Dictionary

9 8 Compress Multimedia Data Losslessly Lossless Compression  Model the media (audio, image, graphics data, or video as) as a source that generates symbols.  The naive way of choosing symbols:  Pixels for images and videos  Samples for audios  Characters for text messages  Apply the lossless compression methods to the string of symbols.

10 9 PNG (Portable Network Graphics) Lossless Compression  PNG is a lossless image compressing method based on LZ77  PNG supports three main image types: true color, grayscale and palette- based ("8-bit")  PNG supports alpha channel

11 10 PNG (cont.) Lossless Compression  PNG also supports interlaced coding and decoding 1 6 4 6 2 6 4 6 7 7 7 7 5 6 5 6 7 7 7 7 3 6 4 6 7 7 7 7 5 6 5 6 7 7 7 7  The scanning pattern in a 8x8 block. The whole image is partitioned into 8x8 blocks and scanned based on the pattern in each block.

12 11 File Compression - LZ Algorithm (Lempel & Ziv) Lossless Compression ZIP compression. This compression system is a very handy invention, especially for Web users, because it let users reduce the overall number of bits and bytes in a file so it can be transmitted faster over slower Internet connections, or take up less space on a disk. Compression up to certain %Original files size

13 12 File Compression - LZ Algorithm Lossless Compression “Ask not what your country can do for you - ask what you can do for your country.” Quote by J.F. Kennedy, 1961 The above quote has 17 words made up of: 1.61 letters 2.16 spaces 3.1 dash (-) 4.1 period (.) Total: 79 units WordsFrequency ask2 what2 your2 country2 can2 do2 for2 you2 asknotwhatyourcountrycandoforyou Unique Words

14 13 LZ Algorithm - Dictionary Lossless Compression “Ask not what your country can do for you - ask what you can do for your country.” Dictionary ( words+numbers) 1.ask 2.what 3.your 4.country 5.can 6.do 7.for 8.you According to our dictionary the above quote can be: "1 not 2 3 4 5 6 7 8 - 1 2 8 5 6 7 3 4" 79 units 37 units Quote ‘before’ compression Quote ‘after’ compression Dictionary 37 units 74 units

15 14 LZ Algorithm - Searching for Patterns Lossless Compression “Ask not what your country can do for you - ask what you can do for your country.” Possible patterns in a dictionary  "t" followed by a space  “ou” which appears in both "your" and "country“  “can do for you” which appears 2 times - 14 units Dictionary 1.ask_ 2.what_ 3.you 4.r_country 5._can_do_for_you "1not_2345_-_12354" 79 units 41 units Quote ‘before’ compression Quote ‘after’ compression Dictionary 18 units 59 units

16 15 LZ Algorithm - Searching for Patterns Lossless Compression “Ask not what your country can do for you - ask what you can do for your country.” 79 units 59 units 79 units 74 units ≈ -7.5% ≈ -25% Pattern APattern B

17 16 GIF (Graphics Interchange Format) Lossless Compression  GIF was devised by UNISYS and Compuserve.  GIF is based on LZW lossless compression.  GIF supports 8bit (256) color images only. Each image can have its own color table.  It supports transparency layer and simple animation functions.  It also supports interlaced coding and decoding.

18 17 Audio Compression Lossless Compression  Audio can also be compressed in a similar way to image data.  For lossless audio compression, prediction is usually applied first.  Simple prediction.  Adaptive prediction.  Stereo decorrelation.  Entropy coding.

19 18 Audio Examples Lossless Compression  FLAC (free lossless audio codec)  Polynomial fitting prediction or linear prediction.  Rice coding.  MPEG4-ALS  Lossless audio coding standard in MPEG4.  Adaptive Linear Prediction.  Supports up to 65535 channels.  Fast random access.  Rice coding.  Apple lossless audio coding (ALAC)

20 19 MPEG-4 ALS System Diagram Lossless Compression


Download ppt "Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis"

Similar presentations


Ads by Google