Download presentation
Presentation is loading. Please wait.
1
Scalar Quantization – Mathematical Model
Multimedia Compression דחיסת מולטימדיה January 27, 2009 Lecture 9A: Scalar Quantization – Mathematical Model
2
Definition of Quantization
Quantization: a process of representing a large – possible infinite – set of values with a much smaller set. Scalar quantization: a mapping of an input value x into a finite number of output values, y: Q:x ® y One of the most simplest and most general idea in lossy compression.
3
Definition of Quantization (Cont.)
Many of the fundamental ideas of quantization and compression are most easily introduced in the simple context of scalar quantization. Any real number x can be rounded off to the nearest integer, say q(x) = round(x) Maps the real line R (a continuous space) into a discrete space.
4
An example of uniform quantization
5
Input vs. Output
6
Quantization
7
Example of a Quantized Waveform
8
Noise Quantization resulting quantization error (‘noise’) so that
9
Quantizer definition The design of the quantizer has a significant impact on the amount of compression obtained and loss incurred in a lossy compression scheme. Quantizer: encoder mapping and decode mapping. Encoder mapping – The encoder divides the range of source into a number of intervals – Each interval is represented by a distinct codeword Decoder mapping – For each received codeword, the decoder generates a reconstruct value
10
Quantization operation
– Let M be the number of reconstruction levels where the decision boundaries are and the reconstruction levels are
11
Quantization Problem MSQE (mean squared quantization error)
If the quantization operation is Q Suppose the input is modeled by a random variable X with pdf fX(x). The MSQE is
12
Quantization Problem Rate of the quantizer
The average number of bits required to represent a single quantizer output –For fixed-length coding, the rate R is: For variable-length coding, the rate will depend on the probability of occurrence of the outputs
13
Quantization Problem Quantizer design problem Fixed -length coding
Variable-length coding If li is the length of the codeword corresponding to the output yi, and the probability of occurrence of yi is: The rate is given by:
14
Uniform Quantization
15
Quantization Levels
16
Quantizer: Midtreader vs. Midrizer
17
Quantizer: Uniform vs. Nonuniform
18
Uniform Quantizer Zero is one of the output levels M is odd
Zero is not one of the output levels M is even
19
Uniform Quantization of A Uniformly Distributed Source
20
Uniform Quantization of A Uniformly Distributed Source
21
Uniform Quantization of A Non-uniformly Distributed Source
22
Image Compression Original 8bits/pixel 3bits/pixel
23
Image Compression 2bits/pixel 1bit/pixel
24
Lloyd-Max Quantization
Problem : For a signal u with given pdf pu(u) find a quantizer with N representative levels such that Solution : Lloid-Max quantizer (Lloid, 1967; Max, 1960) N-1 decision thresholds exactly half way between representative levels N representative levels in the centroid of the pdf between two successive decision thresholds
25
Lloid-Max Quantizer vs. Best Uniform Quantizer
26
Optimal Quantization squares error (MMSE) sense
The optimal reconstruction levels, {rj }, in minimum mean squares error (MMSE) sense
27
Optimal Quantization (Cont.)
If J is large p(f) p(rj) for optimal If p(f) is uniformly distributed:
28
Optimal Quantization (Cont.)
In general To minimize D, with d0 = -, dL = Max-Lloid Quantizer:
29
Optimal Quantization (Cont.)
The integration can be replaced by summation if f is discrete valued In practice, various distributions ( e.g., uniform, Gaussian, or Laplacian) are used to model the source p(f). If p(f) is unknown, histogram can be used to obtain p(f), after normalization
30
Uniform and Optimal Quantization
Uniform Quantization The error Eq is unifirmly distributed with zero mean and variance - Let the range of f be A. Its variance is - The signal-to-noise ratio for a uniform quantizer is 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.