Download presentation

Presentation is loading. Please wait.

Published byEthen Hazzard Modified about 1 year ago

1
Multimedia communications EG-371Dr Matt Roach Multimedia Communications EG 371 and EG 348 Dr Matthew Roach Lecture 4 Compression &formats cont.

2
Multimedia communications EG-371Dr Matt Roach Lossless: Huffman compression Huffman compression –reduces average code length –to represent symbols of an alphabet –occur frequently short length codes constructing a binary tree arranging the symbols adding two lowest probabilities Sum of last two symbols is 1. Code words formed tracing tree path –assigning 0s and 1s to the branches

3
Multimedia communications EG-371Dr Matt Roach Huffman coding Determine the Huffman code for the following set of symbols: Step 1 – List symbols in order of decreasing probability Symbolm0m1m2m3m4 Probability Symbolm1m3m4m2m0 Probability

4
Multimedia communications EG-371Dr Matt Roach Step 2 – Get 2 symbols with lowest probability. Give the combined symbol a new name: –m2(0.15) + m0(0.1.0) A(0.25) Step 3 – Create a new list and repeat the process: Symbolm1Am3m4 Probability SymbolBm1A Probability SymbolBC Probability SymbolD Probability1.0

5
Multimedia communications EG-371Dr Matt Roach m m3 0.20A 0.25 m m m m m m B 0.39 m A 0.25 C 0.61 B 0.39 D 1.0 An alternative approach is to construct this tree

6
Multimedia communications EG-371Dr Matt Roach Assign bits (0,1) to the tree branches Codewords determined by tracing the path from root node to symbol leaf: SymbolProbabilityCodewords m m m m m Compression is achieved by allocating frequently occurring symbols with shorter codewords B 0.39 C 0.61 m A 0.25 m m m Root m

7
Multimedia communications EG-371Dr Matt Roach How much compression? 5 symbols –3-bits for each symbol. message [m0m1m2m3m4] –require 5x3=15 bits. Huffman coding –require 12 bits compression of 15:12

8
Multimedia communications EG-371Dr Matt Roach Example Consider the message babbage babble baggage label bagel Construct a Huffman code and determine the compression ratio.

9
Multimedia communications EG-371Dr Matt Roach Solution construct a probability table – counting occurrence of each letters LetterOccurrenceProbability b90.3 a g e5 l Total:301

10
Multimedia communications EG-371Dr Matt Roach b 0.3 a 0.233A g e b 0.3 a g B 0.4 b 0.3 A 0.3 C 0.6 B 0.4 D 1.0 Solution

11
Multimedia communications EG-371Dr Matt Roach B 0.4 C 0.6 b 0.3 A 0.3 e g a Root l SymbolProbabilitiesCodewords b0.400 a g e l Solution

12
Multimedia communications EG-371Dr Matt Roach Solution babbage babble baggage label bagel 5 symbols (bagel) 30 characters uncompressed 3 bits/symbol 90 bits. Huffman gives a compression of approx. 9:7 LetterOccurrenceCodewordsNo. bits b90018 a71014 g51110 e l Total bits:69

13
Multimedia communications EG-371Dr Matt Roach Multimedia Communications EG 371 and EG 348 Dr Matthew Roach Lecture 4 Formats cont.

14
Multimedia communications EG-371Dr Matt Roach Common Container Formats AVI (.avi) –M-JPEG, DivX, nearly any format (not Sorenson). Quicktime –Locked Apple Sorenson codec, or for Cinepak (free), also mjpeg WMV (.wmv) –MPEG4; nearly any codec, Microsoft spinoffs of MPEG-4 ASF ("Advanced Streaming Format",.asf) –a subset of wmv, intended primarily for streaming: an early Microsoft implementation of an MPEG4 codec.

15
Multimedia communications EG-371Dr Matt Roach Common Codecs MPEG-1 –Old, supported by everything (at least up to 352x240), reasonably efficient. –A good format for the web –Video quality is not as crisp as MPEG-2 –Small file size –Good picture quality –Compressed format –Require special playback program –Cannot Edit MPEG-2 –A souped-up version of MPEG-1, with better compression. 720x480. Used in HDTV, DVD, and SVCD. –Good Quality, Can burn onto DVD disc –Large file size, 4.7GB for 2 hours of video MPEG-4 –A family of codecs, some of which are open, others Microsoft proprietary. MJPEG ("Motion JPEG") –A codec consisting of a stream of JPEG images. Common in video from digital cameras, but it doesn't compress well, so it's not good for web distribution.

16
Multimedia communications EG-371Dr Matt Roach Common Codecs cont. WMV ("Windows Media Video") –A collection of Microsoft proprietary video codecs. –Since version 7, it has used a special version of MPEG4. –Small file size –Good picture quality –Ideal for web transmission –Compressed format –Cannot Edit RM ("Real Media") –a closed codec developed by Real Networks for streaming video and audio. Maybe also a container? DivX –incomplete early MPEG-4 codec inside an AVI container; DivX 4 and later are a more full MPEG-4 codec.. No resolution limit. Requires more horsepower to play than mpeg1, but less than mpeg2. –Hard to find mac and windows players. –Good Quality with reasonably small file size –Not a standard video format –Cannot produce video onto DVD or CD

17
Multimedia communications EG-371Dr Matt Roach Common Codecs cont. DV ("Digital Video") –Usually used for video grabbed via firewire off a video camera. Fixed at 29.97FPS, or 25 FPS. Not very highly compressed. –Superb quality, record back to DV tape –Large file size, 25GB for 60 min of video Sorenson 3: – Apple's proprietary codec, commonly used for distributing movie trailers (inside a quicktime container). Quicktime 6: –Apple's implementation of an MPEG4 codec. –Good picture quality –Ideal for web transmission –Larger file size (compare to other streamable formats) –Cannot Edit

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google