Title: Transform Coding
1Transform Coding
2Introductions
Original Data
Transformation
Quantization
Channel
Decoder
Inverse Transformation
Reconstructed Data
3Introductions
- Orthogonal transform
- Decorrelate data into a more compact form so that
redundancy can be discarded more easily. - In some transform form, data can be more
efficiently expressed. - A good question is Why not use non-orthogonal
transforms ?
4Introductions
Row 256 of lenna
2500.00
200.00
absolute dct values of lenna row 256
2000.00
160.00
1500.00
120.00
1000.00
80.00
500.00
40.00
0.00
0.00
0.00
200.00
400.00
600.00
0.00
200.00
400.00
600.00
5Transforms as Coordinate Axes Rotations
6Transforms as Coordinate Axes Rotations
Coordinate Axes Rotated by
7Transforms as Coordinate Axes Rotations
8Transforms as Basis Function Decompositions
9Image Transforms
- Decorrelate (Break) the correlations.
- Basis fns independent on the input images.
- Speed.
- Karhunen-Loeve Transform (KLT)
- Optimal transform
- Basis functions are image dependent
- No fast algorithm exists
- Not so useful in image compression
- Usually used for comparison
10Image Transforms
- Discrete Fourier Transform (DFT)
- Use cos?jsin? as its basis functions
- Fast Fourier Transform (FFT)-O(nlogn)
- Not so popular in image compression because
- performance is not good enough
- computational load for complex number is heavy
11Image Transforms
- Discrete Cosine Transform
- Use cosine function as its basis function
- Performance approaches KLT
- Fast algorithm exists
- Most popular in image compression application
- Adopted in JPEG
- The periodicity implied by DCT implies that it
causes less blocking effect than DFT - Can be implemented by 2n points FFT
12Image Transforms
13Image Transforms
14Image Transforms
- Walsh-Hadamard Transform (WHT)
- Use square functions as its basis functions
- Only addition and subtraction operations are
needed - Popular when efficiency consideration dominates
- Also popular in switching function transformation
- Performance moderate
15Image Transforms
16Image Transforms
17DCT Implementation
- DCT implement
- direct 2-dim O(N4)
- separable basis function O(N3)
1-dim DCT (row)
Memory for transpose
1-dim DCT (column)
output
Input block
18A Typical Transform Coder
Input image
Blocking
DCT
Thresholder
Binary bit stream
Entropy coder
Zigzag Scan 1-D sequencing
Quantizer
Entropy decoder
Inverse Zigzag Scan
Dequantizer
output image
Thresholder compensator
Blocking Integration
IDCT
19A Typical Transform Coder
- DCT/IDCT formula
- Seperable
- BASIS2D(i,ju,v) BASIS1D(iU)?BASSIS1D(j v)
- process row, then column.
20A Typical Transform Coder
output
-T
input
T
21A Typical Transform Coder
T3Q/2
TQ/2
-T-2Q -T-Q -T
T TQ T2Q
-T-Q/2
-T-3Q/2
Tdeadzone threshold Qquantizer step size
22A Typical Transform Coder
- Zonal sampling
- select which DCT coefficients to be sent
- Threshold sample selection
- JPEG
- Coefficients that are greater than a threshold
are sent
23A Typical Transform Coder
- Bit Allocation
- The larger variance occurs, the more bit are
required. - DCT coefficients are usually represented by
Guassian or Laplacian distribution. Based on
these distribution, the optimal quantizer can be
applied.
24A Typical Transform Coder
Run-length of zeros
End-of-block
128,30,-10,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,0
DC component
Nonzero amplitude
Symbol(run,amp)
128,(0,30),(0,-10),(4,-1),(4,1),EOB
25JPEG DCT
- Picture formats
- Up to 65535 lines and 65535 pels/line
- 8 or 12 bit precision
- Typical picture sizes
CGA SIF VGA CCIR 601 SVGA HDTV
Pels/line 320 640 1280
Lines 240 480 960
26JPEG DCT Example
27JPEG DCT Example
28JPEG DCT Example
- 79 0 -2 -1 -1 -1 0 0
-1 EOB
29JPEG DCT Example
- DC difference Huffman codeword/11100101/000/000/00
0/110110/1010
AC coefficient grouping
Example of JPEG AC Huffman code table
30JPEG DCT Example
31JPEG DCT Example
32Results
33Results
34Results
35Results
36Results
37Results
38Results
23116 bytes, Cr34.0
39Results
786488 bytes
33079 bytes, Cr23.78
40Results
786488 bytes
49746 bytes, Cr15.80
41Results
786488 bytes
26614 bytes, Cr29.55
42Results
786488 bytes
25485 bytes, Cr30.86
43JPEG Lossless Coding
Prediction
0 No
1 A
2 B
3 C
4 AB-C
5 A-(B-C)/2
6 B-(A-C)/2
7 (AB)/2
44Conclusions
- DCT, VQ, and SBC(WT) are the three main research
topics in Data Compression area. - Summary of Transform Coding
- DCT is the best choice.
- Performance for typical CCIR 601 pictures
excellent ? 2 bpp - good ? 0.8 bpp
- At very low-bit rate (lt0.5 bpp), block effects
is introduced - Perceptually lossless at 1.5-2 bpp
45Conclusions
- Adjust threshold and quantizer to local
statistics and human visual criterion. - A basic tool employed on JPEG, H.261, MPEG, HDTV
- Extension to video
- Motion JPEG (M-JPEG)
- Compared to MPEG, M-JPEG has
- No error propagation
- Random access
- Low complexity
- But the compression ratio is low