Transform Coding. Transform Coding Principle

Similar documents
Transform coding - topics. Principle of block-wise transform coding

Transform Coding. Transform Coding Principle

Multimedia Networking ECE 599

Waveform-Based Coding: Outline

Basic Principles of Video Coding

IMAGE COMPRESSION-II. Week IX. 03/6/2003 Image Compression-II 1

L. Yaroslavsky. Fundamentals of Digital Image Processing. Course

SYDE 575: Introduction to Image Processing. Image Compression Part 2: Variable-rate compression

IMAGE COMPRESSION IMAGE COMPRESSION-II. Coding Redundancy (contd.) Data Redundancy. Predictive coding. General Model

Information and Entropy

Compression methods: the 1 st generation

Image Data Compression

Image Compression. Fundamentals: Coding redundancy. The gray level histogram of an image can reveal a great deal of information about the image

Overview. Analog capturing device (camera, microphone) PCM encoded or raw signal ( wav, bmp, ) A/D CONVERTER. Compressed bit stream (mp3, jpg, )

Introduction p. 1 Compression Techniques p. 3 Lossless Compression p. 4 Lossy Compression p. 5 Measures of Performance p. 5 Modeling and Coding p.

Predictive Coding. Prediction Prediction in Images

Predictive Coding. Prediction

The Karhunen-Loeve, Discrete Cosine, and Related Transforms Obtained via the Hadamard Transform

EE67I Multimedia Communication Systems

Objectives of Image Coding

3 rd Generation Approach to Video Compression for Multimedia

Compression. What. Why. Reduce the amount of information (bits) needed to represent image Video: 720 x 480 res, 30 fps, color

6. H.261 Video Coding Standard

at Some sort of quantization is necessary to represent continuous signals in digital form

Contents. Acknowledgments

Basics of DCT, Quantization and Entropy Coding

BASICS OF COMPRESSION THEORY

Objective: Reduction of data redundancy. Coding redundancy Interpixel redundancy Psychovisual redundancy Fall LIST 2

Digital communication system. Shannon s separation principle

Wavelet Scalable Video Codec Part 1: image compression by JPEG2000

Laboratory 1 Discrete Cosine Transform and Karhunen-Loeve Transform

Source Coding: Part I of Fundamentals of Source and Video Coding

JPEG Standard Uniform Quantization Error Modeling with Applications to Sequential and Progressive Operation Modes

Image Compression. Qiaoyong Zhong. November 19, CAS-MPG Partner Institute for Computational Biology (PICB)

Source Coding for Compression

Wavelet-based Image Coding: An Overview

Basics of DCT, Quantization and Entropy Coding. Nimrod Peleg Update: Dec. 2005

encoding without prediction) (Server) Quantization: Initial Data 0, 1, 2, Quantized Data 0, 1, 2, 3, 4, 8, 16, 32, 64, 128, 256

Proyecto final de carrera

Compression and Coding

Compressing a 1D Discrete Signal

Filterbank Optimization with Convex Objectives and the Optimality of Principal Component Forms

Lecture 7 Predictive Coding & Quantization

on a per-coecient basis in large images is computationally expensive. Further, the algorithm in [CR95] needs to be rerun, every time a new rate of com

On Compression Encrypted Data part 2. Prof. Ja-Ling Wu The Graduate Institute of Networking and Multimedia National Taiwan University

Digital Image Processing

Multiscale Image Transforms

Compressing a 1D Discrete Signal

Compression and Coding. Theory and Applications Part 1: Fundamentals

SIGNAL COMPRESSION. 8. Lossy image compression: Principle of embedding

Digital Image Processing Lectures 25 & 26

Multimedia & Computer Visualization. Exercise #5. JPEG compression

Audio Coding. Fundamentals Quantization Waveform Coding Subband Coding P NCTU/CSIE DSPLAB C.M..LIU

Linear, Worst-Case Estimators for Denoising Quantization Noise in Transform Coded Images

Run-length & Entropy Coding. Redundancy Removal. Sampling. Quantization. Perform inverse operations at the receiver EEE

RLE = [ ; ], with compression ratio (CR) = 4/8. RLE actually increases the size of the compressed image.

Module 4. Multi-Resolution Analysis. Version 2 ECE IIT, Kharagpur

Multidimensional Signal Processing

CODING SAMPLE DIFFERENCES ATTEMPT 1: NAIVE DIFFERENTIAL CODING

Video Coding with Motion Compensation for Groups of Pictures

Introduction to Video Compression H.261

VIDEO CODING USING A SELF-ADAPTIVE REDUNDANT DICTIONARY CONSISTING OF SPATIAL AND TEMPORAL PREDICTION CANDIDATES. Author 1 and Author 2

EE5356 Digital Image Processing

Fault Tolerance Technique in Huffman Coding applies to Baseline JPEG

Module 3 LOSSY IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

AN IMPROVED CONTEXT ADAPTIVE BINARY ARITHMETIC CODER FOR THE H.264/AVC STANDARD

Image and Multidimensional Signal Processing

Scalable color image coding with Matching Pursuit

Performance Bounds for Joint Source-Channel Coding of Uniform. Departements *Communications et **Signal

Multimedia Communications. Scalar Quantization

Lec 05 Arithmetic Coding

Computer Vision & Digital Image Processing

The Choice of MPEG-4 AAC encoding parameters as a direct function of the perceptual entropy of the audio signal

GRAPH SIGNAL PROCESSING: A STATISTICAL VIEWPOINT

Analysis of Rate-distortion Functions and Congestion Control in Scalable Internet Video Streaming

Compression and Coding. Theory and Applications Part 1: Fundamentals

Lecture 2: Introduction to Audio, Video & Image Coding Techniques (I) -- Fundaments

CSE 408 Multimedia Information System Yezhou Yang

7. Variable extraction and dimensionality reduction

Image Transforms. Digital Image Processing Fundamentals of Digital Image Processing, A. K. Jain. Digital Image Processing.

Lecture 2: Introduction to Audio, Video & Image Coding Techniques (I) -- Fundaments. Tutorial 1. Acknowledgement and References for lectures 1 to 5

Lossless Image and Intra-frame Compression with Integer-to-Integer DST

CHAPTER 3. Transformed Vector Quantization with Orthogonal Polynomials Introduction Vector quantization

Multimedia communications

repetition, part ii Ole-Johan Skrede INF Digital Image Processing

Lossy coding. Lossless coding. Organization: 12 h Lectures + 8 h Labworks. Hybrid coding. Introduction: generalities, elements of information theory

4. Quantization and Data Compression. ECE 302 Spring 2012 Purdue University, School of ECE Prof. Ilya Pollak

A Variation on SVD Based Image Compression

Image Compression - JPEG

Multiple Description Transform Coding of Images

Lecture 9 Video Coding Transforms 2

A Complete Video Coding Chain Based on Multi-Dimensional Discrete Cosine Transform

Image Coding Algorithm Based on All Phase Walsh Biorthogonal Transform

Direction-Adaptive Transforms for Coding Prediction Residuals

Simultaneous SDR Optimality via a Joint Matrix Decomp.

Rate Bounds on SSIM Index of Quantized Image DCT Coefficients

Gaussian source Assumptions d = (x-y) 2, given D, find lower bound of I(X;Y)

Lecture 12. Block Diagram

6.003: Signals and Systems. Sampling and Quantization

Review of Quantization. Quantization. Bring in Probability Distribution. L-level Quantization. Uniform partition

Transcription:

Transform Coding Principle of block-wise transform coding Properties of orthonormal transforms Discrete cosine transform (DCT) Bit allocation for transform coefficients Entropy coding of transform coefficients Typical coding artifacts Fast implementation of the DCT Thomas Wiegand: Digital Image Communication Transform Coding - Transform Coding Principle Structure u U V T Quantizer T - v Transform coder (T α) / decoder ( β T - ) structure u U i V v T α β Τ Insert entropy coding ( γ) and transmission channel u U i b b i V T α γ channel γ β T - v Thomas Wiegand: Digital Image Communication Transform Coding -

Transform Coding and Quantization u U V v u U V T Q T -!!!! u U V v v Transformation of vector u=(u,u,,u ) into U=(U,U,,U ) Quantizer Q may be applied to coefficients U i separately (scalar quantization: low complexity) jointly (vector quantization, may require high complexity, exploiting of redundancy between U i ) Inverse transformation of vector V=(V,V,,V ) into v=(v,v,,v ) Why should we use a transform? Thomas Wiegand: Digital Image Communication Transform Coding - 3 Geometrical Interpretation A linear transform can decorrelate random variables An orthonormal transform is a rotation of the signal vector around the origin Parseval s Theorem holds for orthonormal transforms DC basis function U u U u u = u = T = u AC basis function U 3 U = = Tu = = U Thomas Wiegand: Digital Image Communication Transform Coding -

Properties of Orthonormal Transforms Forward transform transform coefficients U=Tu Transform matrix of size x input signal block of size Orthonormal transform property: inverse transform u=t U=TT U Linearity: u is represented as linear combination of basis functions Thomas Wiegand: Digital Image Communication Transform Coding - 5 Transform Coding of Images Exploit horizontal and vertical dependencies by processing blocks original image reconstructed image Original image block Reconstructed image block Transform T Transform coefficients Quantization Entropy Coding Transmission Inverse transform T - Quantized transform coefficients Thomas Wiegand: Digital Image Communication Transform Coding -

Separable Orthonormal Transforms, I Problem: size of vectors * (typical value of : 8) An orthonormal transform is separable, if the transform of a signal block of size *-can be expressed by U=TuT * transform coefficients Orthonormal transform matrix of size * * block of input signal The inverse transform is u= T UT Great practical importance: transform requires matrix multiplications of size * instead one multiplication of a vector of size* with a matrix of size * Reduction of the complexity from O( ) to O( 3 ) Thomas Wiegand: Digital Image Communication Transform Coding - 7 Separable Orthonormal Transforms, II Separable -D transform is realized by two -D transforms along rows and columns of the signal block u column-wise Tu row-wise TuTT -transform -transform * block of pixels * block of transform coefficients Thomas Wiegand: Digital Image Communication Transform Coding - 8

Criteria for the Selection of a Particular Transform Decorrelation, energy concentration KLT, DCT, Transform should provide energy compaction Visually pleasant basis functions pseudo-random-noise, m-sequences, lapped transforms, Quantization errors make basis functions visible Low complexity of computation Separability in -D Simple quantization of transform coefficients Thomas Wiegand: Digital Image Communication Transform Coding - 9 Karhunen Loève Transform (KLT) Decorrelate elements of vector u R u =E{uu T },! U=Tu,! R U =E{UU T }=TE{uu T }T T = TR u T T =diag{ } Basis functions are eigenvectors of the covariance matrix of the input signal. KLT achieves optimum energy concentration. Disadvantages: - KLT dependent on signal statistics - KLT not separable for image blocks - Transform matrix cannot be factored into sparse matrices. Thomas Wiegand: Digital Image Communication Transform Coding - α i

Comparison of Various Transforms, I Comparison of D basis functions for block size =8 () Karhunen Loève transform (98/9) () Haar transform (9) (3) Walsh-Hadamard transform (93) () Slant transform (Enomoto, Shibata, 97) () () (3) () (5) (5) Discrete CosineTransform (DCT) (Ahmet, atarajan, Rao, 97) Thomas Wiegand: Digital Image Communication Transform Coding - Comparison of Various Transforms, II Energy concentration measured for typical natural images, block size x3 (Lohscheller) KLT is optimum DCT performs only slightly worse than KLT Thomas Wiegand: Digital Image Communication Transform Coding -

DCT - Type II-DCT of blocksize M x M - D basis functions of the DCT: is defined by transform matrix A containing elements π(k + ) i aik = αi cos M ik, =...( M ) with α = M αi = i M Thomas Wiegand: Digital Image Communication Transform Coding - 3 Discrete Cosine Transform and Discrete Fourier Transform Transform coding of images using the Discrete Fourier Transform (DFT): edge For stationary image statistics, the energy folded concentration properties of the DFT converge against those of the KLT for large block sizes. Problem of blockwise DFT coding: blocking effects DFT of larger symmetric block -> DCT due to circular topology of the DFT and Gibbs phenomena. pixel folded Remedy: reflect image at block boundaries Thomas Wiegand: Digital Image Communication Transform Coding -

Histograms of DCT Coefficients: Image: Lena, 5x5 pixel DCT: 8x8 pixels DCT coefficients are approximately distributed like Laplacian pdf Thomas Wiegand: Digital Image Communication Transform Coding - 5 Distribution of the DCT Coefficients Central Limit Theorem requests DCT coefficients to be Gaussian distributed Model variance of Gaussian DCT coefficients distribution as random variable (Lam & Goodmann ) u pu ( σ ) = exp πσ σ Using conditional probability pu ( ) = pu ( σ ) p( σ ) dσ Thomas Wiegand: Digital Image Communication Transform Coding -

Distribution of the Variance Exponential Distribution { } p( σ ) = µ exp µσ Thomas Wiegand: Digital Image Communication Transform Coding - 7 Distribution of the DCT Coefficients pu ( ) = pu ( σ ) p( σ ) dσ u = exp µ exp{ µσ } dσ πσ σ u = µ µσ σ π exp d σ π µ u = µ exp π µ { } µ = exp { µ u } Laplacian Distribution Thomas Wiegand: Digital Image Communication Transform Coding - 8

Bit Allocation for Transform Coefficients I Problem: divide bit-rate R among transform coefficients such that resulting distortion D is minimized. DR ( ) = Di( Ri), s.t. Ri R i= i= Average Average distortion rate Distortion contributed by coefficient i Rate for coefficient i Approach: minimize Lagrangian cost function d ddi( Ri)! Di( Ri) + λ Ri = + λ = dr dr i i= i= Solution: Pareto condition ddi( Ri) = λ dr Move bits from coefficient with small distortion reduction per bit to coefficient with larger distortion reduction per bit Thomas Wiegand: Digital Image Communication Transform Coding - 9 i i Bit Allocation for Transform Coefficients II Assumption: high rate approximations are valid R dd ( ) i i Ri Ri Di( Ri) aσi, alnσi = λ dri σ σ + a ln σ σ λ " + = i R " σ + i log i log Ri log i log R log R ( σ i ) aln aln R = Ri = logσi + log = log + log i= = # i$%$$& λ i = λ #$%$& log " σ " σ Operational Distortion Rate function for transform coding: a a DR ( ) = D( R) = = a σ σ σ σ log i " R Ri R " i i i i σ i= i= i= Thomas Wiegand: Digital Image Communication Transform Coding - Geometric mean: " σ = ( σ i ) i =

Entropy Coding of Transform Coefficients Previous derivation assumes: AC coefficients are very likely to be zero Ordering of the transform coefficients by zig-zag scan Design Huffman code for event: # of zeros and coefficient value Arithmetic code maybe simpler Probability that coefficient is not zero when quantizing with: V i =*round(u i /).5 Ri 3 σ = max[(log i ), ] bit D 5 7 8 DC coefficient 8 7 5 3 Thomas Wiegand: Digital Image Communication Transform Coding - Entropy Coding of Transform Coefficients II Encoder 95 88 93 9 57 9 9 93 88 87 95 93 3 93 8 9 8 95 8 5 99 93 7 7 79 79 5 8 98 83 9 95 9 7 59 85 8 75 3 5 7 73 85 5 7 5 7 8 8 7 73 98 3 5 8 9 9 59 3 Original 8x8 block DCT 8 9 33-5 - 33-38 -5-7 -3-9 3 - - - 9 8 7 7-3 -5-3 - 3-8 -3-3 -5-9 3 3 3-7 - - -9 8-7 -5-8 -7 α 85 3-3 - - - - - - - zig-zag-scan (85 3 - -3 - - - - - - EOB) run-level coding Mean of block: 85 (,3) (,) (,) (,) (,) (,-) (,) (,) (,) (,-3) (,) (,-) (,) (,-) (,-) (,-) (,) (9,-) (,-) (EOB) entropy coding & transmission Thomas Wiegand: Digital Image Communication Transform Coding -

3 - - -3 3 - - -3 3 - - -3 3 - - -3 3 - - -3 3 - - -3 Entropy Coding of Transform Coefficients III Decoder transmission Mean of block: 85 (,3) (,) (,) (,) (,) (,- ) (,) (,) (,) (,-3) (,) (,-) (,) (,-) (,-) (,-) (,) (9,-) (,-) (EOB) Inverse zig-zagscan run-leveldecoding (85 3 - -3 - - - - - - EOB) 85 3-3 - - - - - - - Scaling and inverse DCT: β 9 93 87 9 79 7 9 89 98 88 8 98 9 9 8 85 89 9 97 7 59 8 89 7 8 8 77 5 53 87 89 99 78 5 3 85 79 7 93 7 5 79 97 7 9 98 95 93 9 5 8 79 9 9 9 85 9 57 Reconstructed 8x8 block Thomas Wiegand: Digital Image Communication Transform Coding - 3 Detail in a Block vs. DCT Coefficients Transmitted image block DCT coefficients quantized DCT block of block coefficients reconstructed of block from quantized coefficients Thomas Wiegand: Digital Image Communication Transform Coding -

Typical DCT Coding Artifacts DCT coding with increasingly coarse quantization, block size 8x8 quantizer step size quantizer step size quantizer step size for AC coefficients: 5 for AC coefficients: for AC coefficients: Thomas Wiegand: Digital Image Communication Transform Coding - 5 Influence of DCT Block Size Efficiency as a function of block size x, measured for 8 bit Quantization in the original domain and equivalent quantization in the transform domain. = Memoryless entropy of original signal mean entropy of transform coefficients Block size 8x8 is a good compromise between coding efficiency and complexity Thomas Wiegand: Digital Image Communication Transform Coding -

Fast DCT Algorithm I DCT matrix factored into sparse matrices (Arai, Agui, and akajima; 988): y= M x = S P M M M 3 M M 5 M x S = s s s s 3 s s 5 s s 7 P = M = - - M = - - M = 3 C -C C -C -C C M = - M = 5 - - - - M = - - - - Thomas Wiegand: Digital Image Communication Transform Coding - 7 Fast DCT Algorithm II Signal flow graph for fast (scaled) 8-DCT according to Arai, Agui, akajima: x s y scaling x s y x x 3 x x 5 a a a 3 s s s 5 s y y y 5 y only 5 + 8 Multiplications (direct matrix multiplication: multiplications) x a x 7 a 5 s 7 s 3 y 7 y 3 Multiplication: u m m u Addition: u v u v u+v u-v a= C a = C C a3 = C a = C+ C a5 = C s = sk = ; k =... 7 CK CK = cos(ks ) Thomas Wiegand: Digital Image Communication Transform Coding - 8

Transform Coding: Summary Orthonormal transform: rotation of coordinate system in signal space Purpose of transform: decorrelation, energy concentration KLT is optimum, but signal dependent and, hence, without a fast algorithm DCT shows reduced blocking artifacts compared to DFT Bit allocation proportional to logarithm of variance Threshold coding + zig-zag scan + 8x8 block size is widely used today (e.g. JPEG, MPEG-//, ITU-T H.//3) Fast algorithm for scaled 8-DCT: 5 multiplications, 9 additions Thomas Wiegand: Digital Image Communication Transform Coding - 9