Docsity

Lossy Compression - Multimedia Computing - Lecture Slides, Slides of Multimedia Applications

Partial preview of the text

Download Lossy Compression - Multimedia Computing - Lecture Slides and more Slides Multimedia Applications in PDF only on Docsity!

Lossy Compression

Lossy Compression

  • In order to achieve higher rates of compression, we give up complete reconstruction and consider lossy compression techniques
  • So we need a way to measure how good the compression technique is - How close to the original data the reconstructed data is

Distortion Measures

  • The size of the error relative to the signal is given by the signal-to-noise ratio (SNR)
  • Another common measure is the peak-signal- to-noise ratio (PSNR)

Distortion Measures

  • Each of these last two measures is defined in decibel (dB) units - 1 dB is a tenth of a bel - If a signal has 10 times the power of the error, the SNR is 20 dB - The term โ€œdecibelsโ€ as applied to sounds in our environment usually is in comparison to a just- audible sound with frequency 1kHz

Quantization

  • Quantization is the heart of any scheme
    • The sources we are compressing contains a large number of distinct output values (infinite for analog)
    • We compress the source output by reducing the distinct values to a smaller set via quantization
    • Each quantizer can be uniquely described by its partition of the input range (encoder side) and set of output values (decoder side)

Uniform Scalar Quantization

  • The inputs and output can be either scalar or vector
  • The quantizer can partition the domain of input values into either equally spaced or unequally spaced partitions
  • We now examine uniform scalar quantization

Uniform Scalar Quantization

Uniform Scalar Quantization

  • Midtread quantizer
    • Has zero as one of its output values
    • Has an odd number of output values
  • Midrise quantizer
    • Has a partition interval that brackets zero
    • Has an even number of output values
  • For โˆ† = 1

Uniform Scalar Quantization

  • Assume the input is uniformly distributed in the interval [- X (^) max , X (^) max ] - Then the rate of the quantizer is - R = ๏ฃฎlog 2 M ๏ฃน - R is the number of bits needed to code the M output values - The step size โˆ† is given by โˆ† = 2 X (^) max /M

Quantization Error

  • For bounded input, the quantization error is referred to as granular distortion - That distortion caused by replacing a whole range of values from a maximum values to โˆž (and also on the negative side) is called the overload distortion

Quantization Error

  • The decision boundaries bi for a midrise quantizer are - [( i - 1)โˆ†, i โˆ†], i = 1 .. M /2 (for positive data X )
  • Output values yi are the midpoints
    • i โˆ† - โˆ†/2, i = 1.. M /2 (for positive data)
  • The total distortion (after normalizing) is twice the sum over the positive data

Quantization Error

  • Since the reconstruction values yi are the midpoints of each interval, the quantization error must lie within the range [-โˆ†/2, โˆ†/2] - As shown on a previous slide, the quantization error is uniformly distributed - Therefore the average squared error is the same as the variance ( ฯƒ d ) 2 of from just the interval [0, โˆ†] with errors in the range shown above

Quantization Error

  • In the same way, we can derive the signal

variance ( ฯƒ x ) 2 as (2 X max ) 2 /12, so if the

quantizer is n bits, M = 2 n^ then SQNR = 10log 10 [( ฯƒ x ) 2 /( ฯƒ d ) 2 ] SQNR = 10log 10 {[(2 X (^) max ) 2 /12]ร—[12/โˆ†^2 ]} SQNR = 10log 10 {[(2 X (^) max ) 2 /12]ร—[12/ (2 X (^) max ) 2 ]} SQNR = 10log 10 M^2 = 20 n log 102 SQNR = 6.02 n dB

Nonuniform Scalar Quantization

  • A uniform quantizer may be inefficient for an input source which is not uniformly distributed - Use more decision levels where input is densely distributed - This lowers granular distortion - Use fewer where sparsely distributed - Total number of decision levels remains the same - This is nonuniform quantization