Presentation is loading. Please wait.

Presentation is loading. Please wait.

RICO HARTONO JAHJA 20127733 SOURCE CODING: PART IV.

Similar presentations


Presentation on theme: "RICO HARTONO JAHJA 20127733 SOURCE CODING: PART IV."— Presentation transcript:

1 RICO HARTONO JAHJA 20127733 SOURCE CODING: PART IV

2 CONTENTS Introduction Property of Codes Code Length & Entropy Huffman Code Lempel-Ziv Code Audio Compression Video Compression 2

3 SOURCE CODING FOR DIGITAL DATA Why are we using a digital data? Easy computation, error detection, easy to display, and convenience for coding Primary goal of data compression: Reduce number of bits 3

4 PROPERTY OF CODES SymbolCode 1Code 2Code 3Code 4Code 5Code 6 a00 0111 b 011100001 c1110111000111 Properties of Codes: Uniquely Decodable Property Each code can be decoded from the bit correctly Prefix-free Property No codeword be the prefix of any other code word Example: 1.Decode this binary pattern: 1 0 1 1 1 Using code 3: b,a,b,b,b or b,a,b,c or b,a,c,b -> not uniquely decodable Using code 6: a,b,a,a or a,b,c -> not uniquely decodable 2.Transmitting symbol b with code 4 -> receiver cannot determine it is symbol b or part of symbol c -> not prefix-free 4

5 CODE LENGTH & ENTROPY The average length of code can be expressed with: Where: n = code length P(Xi) = probability of the code Entropy: Average amount of uncertainty resolves per use of the alphabet The average number of bits per symbol required to describe the source 5

6 HUFFMAN CODE Huffman code is a prefix-free, variable-length code that can achieve the shortest average code length for a given input alphabet Huffman coding procedure (reordering bubble): 1.Listing all the input alphabet symbols, along with the probabilities in descending order of occurrence 2.Write every probabilities of every symbols on each branch 3.The two lowest entries (lowest probabilities) are merged, form a new branch with the probability value will be the sum of the two lowest probabilities 4.Do step 3 until it can rise no further 5.If the sum of the two lowest probabilities has the same value with one of the branch, the sum will place higher than the existed branch 6

7 HUFFMAN CODE Huffman coding procedure (reordering bubble): 1.Listing all the input alphabet symbols, along with the probabilities in descending order of occurrence 2.Write every probabilities of every symbols on each branch 3.The two lowest entries (lowest probabilities) are merged, form a new branch with the probability value will be the sum of the two lowest probabilities 4.Do step 3 until it can rise no further 5.If the sum of the two lowest probabilities has the same value with one of the branch, the sum will place higher than the existed branch 6.Put the label 1/0 in every branch of node Entropy of the input alphabet = 2.32 bits This code offer Compression ratio: 3/2.4 = 1.25 This code achieve: 2.32/2.4 = 0.967 of the possible compression ratio 7

8 HUFFMAN CODE To increase the compression gain: Create a larger source alphabet -> increase variability Increasing the number of tree branches 8

9 HUFFMAN CODE Facsimile transmission : example of Huffman coding implementation The Huffman coding will decode every pixel in the document with the associate code for black or white color. And every code will be different depend on its location in the paper (paper line) 9

10 LEMPEL-ZIV(ZIP) CODES Drawbacks of the Huffman code: The symbol probabilities must be known or estimated Both encoder and decoder must know the coding tree ZIP codes use the text itself to iteratively construct a parsed sequence of variable length codewords that form a code dictionary The encoded packets will be form as Example: 10

11 AUDIO COMPRESSION Including: CD, DAT, MD, DCC, DVD, DAB, MPEG, MP3 Speech compression for telephony Some parameters of audio compression Audio compression methods: Adaptive Differential Pulse-Code Modulation Subband-Partioned, Adaptive Differential Pulse-Code Modulation Codebook-Excited Linear-Predictive Coding (CELP) MPEG Layers I,II, and III 11

12 ADAPTIVE DIFFERENTIAL PULSE-CODE MODULATION Telephone speech processing Inputs: 64 kbps Outputs: 16,24,32, and 40 kbps 12

13 SUBBAND-PARTIONED ADAPTIVE DIFFERENTIAL PULSE-CODE MODULATION Wideband speech-coding standard Using low-pass and high-pass filter to separate the input into a higher and lower subband Using ADPCM at each to reduce the bandwidth into 48kbps and 16kbps data rate 13

14 CODEBOOK-EXCITED LINEAR- PREDICTIVE CODING (CELP) Linear predictive filters can provide high quality encoded speech at high speed data rate (>16kbps) CELP methods: Form a LPC model of the signal for a short interval Filter the input to the LPC, and every output compare with the original signal in every seconds. And select the one that minimizes the error between the original and the output of the driven model. 14

15 MPEG LAYERS I,II, AND III Input sampling at 32, 44.1, and 48 kHz Bit output: between 32 and 192 kbps per monophonic channel Key factor: using human spectral perception threshold -> a frequency dependent boundary that marks the lower bound of human capacity hearing capability Every input below the threshold will be not encoded in the compression 15

16 MPEG LAYERS I,II, AND III MPEG I and II encoder steps: 16 bit PCM audio signal is windowed Windowed audio signal is converted into spectral subband components and filtered The filtered output signals are downsampled to the Nyquist rate for each bandpass bandwidth The differences between layer I, II and layer III are: Layer III using a modified DCT to the analysis bank, a Huffman coder to the output of the quantizer, and a side information data path Layer III achieve a closely matches critical frequency-resolution bandwidths of the human auditory process 16

17 JPEG A transform-based lossy compression scheme Our eyes more sensitive to Y color component to CB and CR A finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies 17

18 MPEG MPEG is a set of standards designed to support coding of moving pictures and associated audio for digital storage media at up to 1.5 Mbps MPEG-1: to permit full motion video recordings on CD players originally designed for stereo audio playback MPEG-2: addressed greater input-output format flexibility, data rates, and system considerations such as transport and synchronization (neglected in MPEG-1) 18

19 MPEG-2 3 types of pictures: Intra Pictures (I-Pictures) A picture that periodically captured and will be fully compressed using a standard JPEG algorithm Predicted Pictures (P-Pictures) Pictures between the I-pictures that predicts and corrects the location of the image sections that they were found to have moved Bi-directional Prediction Pictures (B-Pictures) The pictures between I and P pictures that incorporate the stationary image sections uncovered by moving sections. A sequence can be formed without any P or B pictures A sequence cannot be formed when only containing P or B pictures only 19

20 MPEG-2 Compression methods: Determining which macroblocks have moved between I- pictures Form the P-frame between the I pictures Forb B-pictures between I and P pictures Data size comparison: I-pictures >> P-pictures >> B-pictures 20

21 MPEG-2 Since B-pictures computation require information from the I and P-pictures, the I and P pictures must be delivered first 21

22 QUESTION Design a binary Huffman code for a discrete source of three independent symbols A, B, and C with probabilities 0.9, 0.08, and 0.02 respectively. Determine the average code length for the code THANK YOU 22


Download ppt "RICO HARTONO JAHJA 20127733 SOURCE CODING: PART IV."

Similar presentations


Ads by Google