Transform Coding Heejune AHN Embedded Communications Laboratory

Slides:



Advertisements
Similar presentations
Low-Complexity Transform and Quantization in H.264/AVC
Advertisements

SWE 423: Multimedia Systems
School of Computing Science Simon Fraser University
ELEC692 VLSI Signal Processing Architecture Lecture 9 VLSI Architecture for Discrete Cosine Transform.
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Computer Graphics Recitation 7. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Department of Computer Engineering University of California at Santa Cruz Data Compression (3) Hai Tao.
SWE 423: Multimedia Systems Chapter 7: Data Compression (3)
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
JPEG Still Image Data Compression Standard
Fourier Analysis Without Tears : Computational Photography Alexei Efros, CMU, Fall 2005 Somewhere in Cinque Terre, May 2005.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Digital Image Processing Final Project Compression Using DFT, DCT, Hadamard and SVD Transforms Zvi Devir and Assaf Eden.
SWE 423: Multimedia Systems Chapter 7: Data Compression (5)
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
CELLULAR COMMUNICATIONS DSP Intro. Signals: quantization and sampling.
1 JPEG Compression CSC361/661 Burg/Wong. 2 Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg.
Image Compression JPEG. Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg and can be embedded.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
Computer Vision – Compression(2) Hanyang University Jong-Il Park.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
Introduction to JPEG and MPEG Ingemar J. Cox University College London.
Quantization Heejune AHN Embedded Communications Laboratory Seoul National Univ. of Technology Fall 2013 Last updated
CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions.
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
EE465: Introduction to Digital Image Processing 1 Data Compression: Advanced Topics  Huffman Coding Algorithm Motivation Procedure Examples  Unitary.
Image and Video Compression Fundamentals Heejune AHN Embedded Communications Laboratory Seoul National Univ. of Technology Fall 2013 Last updated 2013.
CMPT 365 Multimedia Systems
Indiana University Purdue University Fort Wayne Hongli Luo
Image Compression Supervised By: Mr.Nael Alian Student: Anwaar Ahmed Abu-AlQomboz ID: IT College “Multimedia”
Entropy Coding Heejune AHN Embedded Communications Laboratory Seoul National Univ. of Technology Fall 2013 Last updated
Directional DCT Presented by, -Shreyanka Subbarayappa, Sadaf Ahamed, Tejas Sathe, Priyadarshini Anjanappa K. R. RAO 1.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Linear Subspace Transforms PCA, Karhunen- Loeve, Hotelling C306, 2000.
Fourier Transform.
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission ( ) Image Compression Quantization independent samples uniform and optimum correlated.
JPEG.
CS654: Digital Image Analysis
Introduction to Image and Video Coding Algorithms
Chapter 8 Lossy Compression Algorithms. Fundamentals of Multimedia, Chapter Introduction Lossless compression algorithms do not deliver compression.
JPEG. Introduction JPEG (Joint Photographic Experts Group) Basic Concept Data compression is performed in the frequency domain. Low frequency components.
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission ( ) JPEG block based transform coding.... Why DCT for Image transform? DFT DCT.
Chapter 13 Discrete Image Transforms
By Dr. Hadi AL Saadi Lossy Compression. Source coding is based on changing of the original image content. Also called semantic-based coding High compression.
Entropy vs. Average Code-length Important application of Shannon’s entropy measure is in finding efficient (~ short average length) code words The measure.
Image Processing Architecture, © Oleh TretiakPage 1Lecture 5 ECEC 453 Image Processing Architecture Lecture 5, 1/22/2004 Rate-Distortion Theory,
MP3 and AAC Trac D. Tran ECE Department The Johns Hopkins University Baltimore MD
Signal Prediction and Transformation Trac D. Tran ECE Department The Johns Hopkins University Baltimore MD
Chapter 8 Lossy Compression Algorithms
Image Transformation Spatial domain (SD) and Frequency domain (FD)
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
The Johns Hopkins University
Multi-resolution image processing & Wavelet
An Example of 1D Transform with Two Variables
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
Last update on June 15, 2010 Doug Young Suh
Discrete Cosine Transform
CSI-447: Multimedia Systems
4. DIGITAL IMAGE TRANSFORMS 4.1. Introduction
1-D DISCRETE COSINE TRANSFORM DCT
Image Coding and Compression
Fourier Analysis Without Tears
The Report of Monographic Study
Digital Image Processing
Presentation transcript:

Transform Coding Heejune AHN Embedded Communications Laboratory Seoul National Univ. of Technology Fall 2013 Last updated 2013. 9. 30

Agenda Transform Coding Concept Transform Theory Review DCT (Discrete Cosine Transform) DCT in Video coding DCT Implementation & Fast Algorithms Appendix: KL Transform

1. Transform Coding X1= lum(2n), X2= lum(2n+1), neighbor pixels Y1, Y2 X1 ~ U(0, 255), X2~ U(0,255) Quantization of X1 and X2 => same data Cross-Correlation of X1 and X2 Y1, Y2 45 degree rotation Y1 = (X1 + X2) /2 Average or DC value Y2 = (X2 – X1) /2 Difference or AC value Y1 ~ F(0, 255), Y2~ F(-255,255) 255 -255 255

Which ones are easier to encode (quantize)? f(X1) f(X2) 255 255 f(Y1) f(Y2) 255 -255 255

Origins of Transform Coding Benefits Signal Theory Make the representation easier to manipulate energy concentration Image and HVS Properties HVS is more sensitive to Low frequency More dense quantizer to Low frequency Vilfredo Pareto Economist 1848-1923

2. Transform Theory Review Definition of Transform N to M mapping, [Y1, Y2, . . ., YN] = F [X1,X2, . . ., XM] Linear Transform (cf. Non-Linear Transform) if [Y11, Y12] = F [X11,X12] and [Y21, Y22] = F [X21,X22] [Y11 + Y21, Y12 +Y22] = F [X11+X21, X21+X22] Matrix representation of Linear Transform Forward Inverse y = T x N transform coefficients, arranged as a vector Transform matrix of size NxN Input signal block of size N, arranged as a vector x = T-1 y

x = T-1 y = TT y T-1 =TT => ||y||2 = yTy = xTTT Tx = ||x||2 Basis Vectors Orthogonal Vl * Vm = 0 for basis Vector V1, V2, . . ., VN Each vectors are disjointed, separated. Orthonormal || Vl || = 1 for basis Vector V1, V2, . . ., VN Parseval’s Theorem Signal Power/Energy conserves between Transform Domain v1 v2 v3 vN T-1 =TT => x = T-1 y = TT y ||y||2 = yTy = xTTT Tx = ||x||2

Example of Orthonormal transform

2D Transform y = T x x = T-1 y Data Forward Transform 2D pixel value matrix, 2D transform coefs matrix 2D matrix => 1D vector Forward Transform Inverse transform y = T x NxN transform coefficients, arranged as a vector Transform matrix of size N2xN2 Input signal block of size NxN, arranged as a vector x = T-1 y

3. Transforms Various transforms in image compression DFT (Discrete Fourier Transform) DCT (Discrete cosine Transform) DST (Discrete sine Transform) Hadamard Transfrom Discrete Wavelet Transform and more (HAAR etc )

Hadamard transform Core Matrix 1차원 N 차원 2차원 Transform

DCT Transform 1D Forward DCT (pixel domain to frequency domain) 1D Inverse DCT (frequency domain to pixel domain)

2D DCT 2D DCT basis Functions Coef. Distribution DC ~ Uniform dist., AC ~ Laplacian dist.

Properties DCT performance DCT complexity Orthonormal transform Separable transform Real valued coefficients DCT performance very resembles KLT for image input Image input model (1 order Markov chain) xn+1 = rho * xn+1 + e(n) DCT complexity 2D DCT = 1D DCT for vertical * 1D DCT for horizontal Not for 3D (for delay and memory size) DCT size (4x4, 8x8, 16x16, 32x32 …) Larger: better performance, but blocking artifact (?) and HW complexity

Coding Performance of DCT Karhunen Loève transform [1948/1960] Haar transform [1910] Walsh-Hadamard transform [1923] Slant transform [Enomoto, Shibata, 1971] Discrete CosineTransform (DCT) [Ahmet, Natarajan, Rao, 1974] Comparison of 1-d basis functions for block size N=8

Energy concentration Performance measured for typical natural images, block size 1x32 KLT is optimum DCT performs only slightly worse than KLT

Complexity Performance of DCT Separation of 2D DCT Cascading 1-D DCT Reduction of the complexity (multiplication) from O(N4) to O(N3) 8x8 DCT For 64 each Coefs, 64 multiplications 2 times 64 Coefs x 8 Can you derive this ? NxN block of transform coefficients NxN block of pixels N column-wise N-transform row-wise N-transform

4. Transform in Image Coding Transform coding Procedure Transform T(x) usually invertible Quantization not invertible, introduces distortion Combination of encoder and decoder lossless

DCT in Image Coding Original 8x8 block Transformed 8x8 block Q Run-level coding Original 8x8 block Transformed 8x8 block Zig-zag scan Transmission Reconstructed 8x8 block Scaling and inverse DCT Inverse zig-zag scan

DCT in Image Coding Uniform deadzone quantizer Entrphy coding transform coefficients that fall below a threshold are discarded. Entrphy coding Positions of non-zero transform coefficients are transmitted in addition to their amplitude values. Efficient encoding of the position of non-zero transform coefficients: zig-zag-scan + run-level-coding Baseline JPEG does not use deadzone

DCT Examples Note that only a few coefficients has sizable value.

quantizer stepsize for AC coefficients: 25 quantizer stepsize DCT coding with increasingly coarse quantization, block size 8x8 quantizer stepsize for AC coefficients: 25 quantizer stepsize for AC coefficients: 100 quantizer stepsize for AC coefficients: 200

4. Implementation Implementation issue HW or SW Computational Cost, Speed, Implementation Size Performance Cost Implementation complexity SW Implementation decision factors Computational cost of multiplication Whether Fixed or Float point operation (esp. multiplication) Special Coprocessor and Instruction set (e.g. MMX)

Fast DCT Algorithm Original DCT/IDCT Fast DCT Computation load Scaling 64 Add + 64 Mult. 8 (7) Addition + 8 multiplication / one coeff. (from eqn.) Scaling input range [0, 255] => output range [-2024, 2024] Fast DCT Similar to Fast DFT Share same computation between nodes. O(NxN) => O (N log2N) N : Width (num of coeff.) log2N : Steps of algorithm Several version : Chen, Lee, Arai etc

Chen’s FDCT See Code at http://www.cmlab.csie.ntu.edu.tw/~chenhsiu/tech/fastdct.cpp

How the fast algorithm works? Exploiting the symmetry of cosine function. STEP 1 STEP 2

HW Implementation 2D DCT using 1D DCT Function Block 1-D DCT 8x8 RAM Input sample 1-D DCT Output coef MUX 8x8 RAM Row order input Column order output

Distributed Arithmetic DCT Multiplier-less architecture Lookup, Shift, accumulators only 4 bits from u input Shift(2-1) LUT (ROM) accumulator Output coef Fx Add or subtract

IDCT Mismatch DCT x IDCT = I ? DCT mismatch in MC-DCT DCT is defined: in “floating point” and “direct form.” Integer Implementation induces ‘error’ after Inverse DCT. different FDCT has different ‘error’s. DCT mismatch in MC-DCT different reference image at encoder and decoder very small error but it accumulates. orgE DCT Q VLC VLD IQ IQ IDCTE IDCTD Should Equal but Mismatch ! recE recD

IDCT Mismatch control Minimum accuracy of DCT algorithm is defined in SPEC. H.261/3,MPEG-1/2 Restrict the sum of coefficients values Oddification rule of sum of all DCT coefficients, Make LSB of F[63], the last Coef. Decoder check and correct the values H.264 (modified) Integer DCT is used adding random error cancelation

KL Transform, The Optimal Transform Appendix KL Transform, The Optimal Transform

Optimal Transform Optimality K-L (Karhunen-Loeve) transform (No) Redundancy in input signal => (No) Redundant Quantization Result No cross-correlation between different components (coefs) K-L (Karhunen-Loeve) transform Assumption Input Covariance is given Problem Definition find a transform (Y=T X) such that RY,Y = T RX,X TT meets diagonal matrix (i.e., completely uncorrelated Y)

Optimal Transform Solution Issue in KLT Build T with eigenvectors of RX,X as basis vector Then, by the definition of Eigen-vectors & values (of RX,X) So. Issue in KLT RX,X is varying for image to image: Need to calculate new T, transmit it to decoder Not Separable (vertical, horizontal) But, good for benchmarking performance of other transform.