Presentation is loading. Please wait.

Presentation is loading. Please wait.

Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007.

Similar presentations


Presentation on theme: "Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007."— Presentation transcript:

1 Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007

2 Lossy Compression  Apart from lossless compression, we can further reduce the bits to represent media data by discarding “unnecessary” information.  Media such as image, audio and video can be “modified” without seriously affecting the perceived quality.  Lossy multimedia data compression standards include JPEG, MPEG, etc.

3 Methods of Discarding Information  Reducing resolution Original image1/2 resolution and zoom in

4  Reduce pixel color levels ½ color levels Original image

5  For audios and videos we can similarly reduce the sampling rate, the sample levels, etc.  These methods usually introduce large distortion. Smarter schemes are necessary! 2.3bits/pixel (JPEG)

6 Distortion  Distortion: the amount of difference between the encoded media data and the original one.  Distortion measurement –Mean Square Error (MSE) mean( ||x org – x decoded || 2 ) –Signal to Noise Ratio (SNR) SNR = 10log10 (Signal_Power)/(MSE) (dB) –Peak Signal to Noise Ratio PSNR = 10log10(255^2/MSE) (dB)

7 The Relation of Rate and Distortion  The lowest possible rate (average codeword length per symbol) is correlated with the distortion. D Bit Rate 0D_max H

8 Quantization  Maps a continuous or discrete set of values into a smaller set of values.  The basic method to “throw away” information.  Quantization can be used for both scalars (single numbers) or vectors (several numbers together).  After quantization, we can generate a fixed length code directly.

9 Uniform Scalar Quantization x min x max Quantization step  =(x max -x min )/N Decision boundaries Quantization value Assume x is in [xmin, xmax]. We partition the interval uniformly into N nonoverlapping regions. A quantizer Q(x) maps x to the quantization value in the region where x falls in.

10 Quantization Example Q(x) = [floor(x/  ) + 0.5]  Q(x)/  x/  0 1 2 3-3 -2 -1 0.5 1.5 -0.5 -1.5 -2.5 2.5 Midrise quantization

11 Quantization Example Q(x) = [round(x/  )]  Q(x)/  x/  0 1 2 3-3 -2 -1 1 2 -2 -3 3 Midrise quantization

12 Quantization Error  To minimize the possible maximum error, the quantization value should be at the center of each decision interval.  If x randomly occurs, Q(x) is uniformly distributed in [-/2, /2] xnxn x n+1 Quantization error x Quantization value

13 Quantization and Codewords x min x max Each quantization value can be associated with a binary codeword. In the above example, the codeword corresponds to the index of each quantization value. 000 001010 011 100 101

14 Another Coding Scheme  Gray code x min x max 000001011 010 110 111 The above codeword is different in only 1bit for each neighbors. Gray code is more resistant to bit errors than the natural binary code.

15 Bit Assignment  If the # of quantization interval is N, we can use log2(N) bits to represent each quantized value.  For uniform distributed x, The SNR of Q(x) is proportional to 20log(N) = 6.02n, where N=2 n bits dB 1 more bit About 6db gain

16 Non-uniform Quantizer  For audio and visual, the tolerance of a distortion is proportional to the signal size.  So, we can make quantization step  proportional to the signal level.  If signal is not uniformly distributed, we also prefer non-uniform quantization. 0 Perceived distortion ~  / s

17 Vector Quantization Decision Region Quantization Value

18 Predictive Coding  Lossless difference coding revisited 13453210345670 1211-2 31111 0 1345321034567 + + … + + - + - + - … + - encoder decoder

19 Local decoder Predictive Coding in Lossy Compression 1345321034567 0 1111 11111 01234321012345 Q + - Q ++ + + + - … Encoder … - + - Q Q(x) = 1 if x > 0, 0 if x == 0 and –1 if x < 0

20 A Different Notation Buffer + Audio samples or image pixels Entropy coding 0101… Lossless Predictive Encoder Diagram -

21 A Different Notation Buffer + Reconstructed audio samples or image pixels + Entropy decoding Lossless Predictive Decoder Diagram Code stream

22 Local Decompression A different Notation Buffer + Audio samples or image pixels - Coding 0101… Q + Lossy Predictive Coding

23 General Prediction Method  For image:  For Audio:  Issues with Predictive Coding –Not resistant to bit errors. –Random access problem. CB AX ABCDX

24 Transform Coding 134532103456 2 4.52.50.53.55.5 ++++++ 134532103456 ++++++ --- -- - ½½½½½½ -0.50.5 -0.50.5 ½½½½½½

25 Transform and Inverse Transform y1 y2 = ½ ½ -½ x1 x2 We did a transform for a block of input data using The inverse transform is: x1 x2 = 1 1 -1 y1 y2

26 Transform Coding  A proper transform focuses the energy into small number of numbers.  We can then quantize these values differently and achieve high compression ratio.  Useful transforms in compressing multimedia data: –Fourier Transform –Discrete Cosine Transform


Download ppt "Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007."

Similar presentations


Ads by Google