Top Banner
Transform Coding Mei-Chen Yeh 12/04/2009
17

Transform Coding

Jan 02, 2016

Download

Documents

rae-sears

Transform Coding. Mei-Chen Yeh 12/04/2009. Introduction. To compact most of the information into a few elements The weight-height example:. Discard y (2D->1D) and inverse transform. Transform. 68 °. Another example. Slide credit: Bernd Girod. Transform Coding. Three steps - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Transform Coding

Transform Coding

Mei-Chen Yeh12/04/2009

Page 2: Transform Coding

Introduction To compact most of the information into a few

elementsThe weight-height example:

68°

Transform Discard y (2D->1D) and inverse transform

Page 3: Transform Coding

Another example

Slide credit: Bernd Girod

Page 4: Transform Coding

Transform Coding Three steps

Divide a data sequence into blocks of size N and transform each block using a reversible mapping

Quantize the transformed sequence Encode the quantized values

Transform Quantization Binary coding

Page 5: Transform Coding

The Transform Forward transform

Inverse transform

Orthonormal transforms A-1 = AT

Linearity: x is represented as a linear combination of “basis vectors”

Parseval’s Theorem holds: the total energy is preserved

or

or

N-dimensional vectorN-dimensional vector

NxN matrix

Transformx θ

11

101

01

000

1

0

1101

1000

1

0

b

b

b

b

bb

bb

x

x

Page 6: Transform Coding

Two-dimensional transform Separable transforms

Take the transform along one dimension, then repeat the operation along the other direction

Ex: rows -> columns, or columns -> rows Forward transform

Backward transform

NxN matrix

NxN matrix

NxN matrix

Page 7: Transform Coding

Transforms of interest Data-dependent

Discrete Karhunen Lòeve transform (KLT) Data-independent

Discrete cosine transform (DCT)

Page 8: Transform Coding

KLT Also known as Principal Component Analysis

(PCA), or the Hotelling transform Transforms correlated variables into

uncorrelated variables Basis vectors are eigenvectors of the

covariance matrix of the input signal Achieves optimum energy concentration Disadvantages

Dependent on signal statistics Not separable

Page 9: Transform Coding

DCT (1) Part of many standards (JPEG, MPEG, H.261,

…) The transform matrix C

Visualize the rows of C

The frequency increases as we go from top to bottom!

Page 10: Transform Coding

DCT (2) 2-D basis matrices of DCT

Increased variation!

Page 11: Transform Coding

DCT (3) Performs close to the optimum KLT in terms of

compaction

Page 12: Transform Coding

Quantization and coding of transform coefficients (1)

The bit-rate allocation problem Divide bit-rate R among transform coefficients

such that resulting distortion D is minimized

Transform Quantization Binary coding

Page 13: Transform Coding

Quantization and coding (2) The optimal bit allocation

The zonal sampling Compute σ2

θk for each coefficient Set Rk = 0 for all k Sort {σ2

θk}. Suppose σ2θ1 is the max.

Increment R1 by 1, divide σ2θ1 by 2.

Decrement Rb by 1. If Rb=0, stop; Otherwise, go to step 3

variance of the transformcoefficient θk

Rb = 72 bits

Discarded!

Page 14: Transform Coding

Quantization and coding (3) The threshold coding

Transform coefficients that fall below a threshold are discarded

Example: a 8x8 blockSample quantization tableThe zigzag scan

DC component

AC components

Horizontal frequency →

vertical frequency →

noisy

Page 15: Transform Coding

Example: Encode

Remove mean,DCT

Quantize

Quantization table

Zigzag scan

-26 -3 0 -3 -2 -6 2 -4 1 -4 1 1 5 1 2 -1 1 -1 2 0 0 −1 1 −1 2 0 0 0 0 0 −1 −1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

-26 -3 0 -3 -2 -6 2 -4 1 -4 1 1 5 1 2 -1 1 -1 2 0 0 −1 1 −1 2 0 0 0 0 0 −1 −1 EOF

Add EOF

Entropy coding

010001010000101110000011101010011000101111100000……………

Page 16: Transform Coding

Example: Decode

-26 -3 0 -3 -2 -6 2 -4 1 -4 1 1 5 1 2 -1 1 -1 2 0 0 −1 1 −1 2 0 0 0 0 0 −1 −1 EOF

010001010000101110000011101010011000101111100000……………

Entropy decoding

Put into a block

Q-1

Quantization table

Inverse DCT,Add mean

Original block

Reconstructed block

Page 17: Transform Coding

One more example