Waveform-Based Coding: Outline

Similar documents
Basic Principles of Video Coding

Multimedia Networking ECE 599

Transform Coding. Transform Coding Principle

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

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

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

Image Data Compression

Compression methods: the 1 st generation

L. Yaroslavsky. Fundamentals of Digital Image Processing. Course

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

BASICS OF COMPRESSION THEORY

Laboratory 1 Discrete Cosine Transform and Karhunen-Loeve Transform

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

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

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

Objectives of Image Coding

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

Digital Image Processing Lectures 25 & 26

EE67I Multimedia Communication Systems

Contents. Acknowledgments

3 rd Generation Approach to Video Compression for Multimedia

Compression and Coding

Lecture 7 Predictive Coding & Quantization

Image and Multidimensional Signal Processing

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

Wavelet Scalable Video Codec Part 1: image compression by JPEG2000

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

Multimedia Communications Fall 07 Midterm Exam (Close Book)

Wavelet-based Image Coding: An Overview

Image Compression - JPEG

7. Variable extraction and dimensionality reduction

Video Coding with Motion Compensation for Groups of Pictures

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

CODING SAMPLE DIFFERENCES ATTEMPT 1: NAIVE DIFFERENTIAL CODING

Principal Component Analysis -- PCA (also called Karhunen-Loeve transformation)

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

Half-Pel Accurate Motion-Compensated Orthogonal Video Transforms

Compression and Coding. Theory and Applications Part 1: Fundamentals

Intraframe Prediction with Intraframe Update Step for Motion-Compensated Lifted Wavelet Video Coding

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

Introduction to Video Compression H.261

Generalized Triangular Transform Coding

Quantization. Introduction. Roadmap. Optimal Quantizer Uniform Quantizer Non Uniform Quantizer Rate Distorsion Theory. Source coding.

GRAPH SIGNAL PROCESSING: A STATISTICAL VIEWPOINT

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

SIMON FRASER UNIVERSITY School of Engineering Science

Vector Quantization and Subband Coding

Maximum variance formulation

Predictive Coding. Prediction Prediction in Images

12.4 Known Channel (Water-Filling Solution)

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

Predictive Coding. Prediction

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

1 Principal Components Analysis

Compressing a 1D Discrete Signal

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

Rate-Distortion Based Temporal Filtering for. Video Compression. Beckman Institute, 405 N. Mathews Ave., Urbana, IL 61801

Vector Quantization. Institut Mines-Telecom. Marco Cagnazzo, MN910 Advanced Compression

Multiple Description Transform Coding of Images

ECE 521. Lecture 11 (not on midterm material) 13 February K-means clustering, Dimensionality reduction

Department of Electrical Engineering, Polytechnic University, Brooklyn Fall 05 EL DIGITAL IMAGE PROCESSING (I) Final Exam 1/5/06, 1PM-4PM

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

Basics of DCT, Quantization and Entropy Coding

SUBOPTIMALITY OF THE KARHUNEN-LOÈVE TRANSFORM FOR FIXED-RATE TRANSFORM CODING. Kenneth Zeger

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

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

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

Compression and Coding. Theory and Applications Part 1: Fundamentals

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

Principal Component Analysis CS498

STA 414/2104: Lecture 8

Compressing a 1D Discrete Signal

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

Modelling of produced bit rate through the percentage of null quantized transform coefficients ( zeros )

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

4x4 Transform and Quantization in H.264/AVC

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

THE currently prevalent video coding framework (e.g. A Novel Video Coding Framework using Self-adaptive Dictionary

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

CHAPTER 4 PRINCIPAL COMPONENT ANALYSIS-BASED FUSION

2. the basis functions have different symmetries. 1 k = 0. x( t) 1 t 0 x(t) 0 t 1

EE368B Image and Video Compression

CSE 126 Multimedia Systems Midterm Exam (Form A)

Multimedia & Computer Visualization. Exercise #5. JPEG compression

LORD: LOw-complexity, Rate-controlled, Distributed video coding system

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

Compression. Encryption. Decryption. Decompression. Presentation of Information to client site

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

Karhunen-Loève Transform KLT. JanKees van der Poel D.Sc. Student, Mechanical Engineering

EE 121: Introduction to Digital Communication Systems. 1. Consider the following discrete-time communication system. There are two equallly likely

A TWO-STAGE VIDEO CODING FRAMEWORK WITH BOTH SELF-ADAPTIVE REDUNDANT DICTIONARY AND ADAPTIVELY ORTHONORMALIZED DCT BASIS

6.003: Signals and Systems. Sampling and Quantization

Rate-Constrained Multihypothesis Prediction for Motion-Compensated Video Compression

Signal Analysis. Principal Component Analysis

EE-597 Notes Quantization

EECS490: Digital Image Processing. Lecture #26

Multimedia Communications. Differential Coding

IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 12, DECEMBER

6. H.261 Video Coding Standard

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

Transcription:

Waveform-Based Coding: Transform and Predictive Coding Yao Wang Polytechnic University, Brooklyn, NY11201 http://eeweb.poly.edu/~yao Based on: Y. Wang, J. Ostermann, and Y.-Q. Zhang, Video Processing and Communications, Prentice Hall, 2002. Outline Overview of video coding systems Transform coding Predictive coding Yao Wang, 2003 Waveform-based video coding 1

Components in a Coding System Focus of this lecture Yao Wang, 2003 Waveform-based video coding 3 Encoder Block Diagram of a Typical Block-Based Video Coder (Assuming No Intra Prediction) Lectures 3&4: Motion estimation Lecture 5: Variable Length Coding Last lecture: Scalar and Vector Quantization This lecture: DCT, wavelet and predictive coding Yao Wang, 2006 Waveform-based video coding 4 2

A Review of Vector Quantization Motivation: quantize a group of samples (a vector) together, th to exploit the correlation between samples Each sample vector is replaced by one of the representative vectors (or patterns) that often occur in the signal Typically a block of 4x4 pixels Design is limited by ability to obtain training samples Implementation is limited by large number of nearest neighbor comparisons exponential in the block size Yao Wang, 2003 Coding: Quantization 5 Transform Coding Motivation: Represent a vector (e.g. a block of image samples) as the superposition of some typical vectors (block patterns) Quantize and code the coefficients Can be thought of as a constrained vector quantizer + t 1 t 2 t 3 t 4 Yao Wang, 2003 Waveform-based video coding 6 3

Block Diagram Yao Wang, 2003 Waveform-based video coding 7 General Linear Transform Basis vectors (or blocks): Inverse transform represents a vector or block as the superposition of basis vectors or blocks Forward transform determines the contribution (weight) of each basis vector Yao Wang, 2003 Waveform-based video coding 8 4

Unitary Transform Unitary (orthonormal) basis: Basis vectors are orthogonal to each other and each has length 1 Transform coefficient associated with a basis vector is simply the projection of the input vector onto the basis vector Yao Wang, 2003 Waveform-based video coding 9 Transform design What are desirable properties of a transform for image and video? Nearly decorrelating improves efficiency of scalar quantizer High energy compaction a few large coefficients to send Easy to compute (few operations) Separable compute 1-D transform first on rows, then on columns What size transform should we use? Entire image? Small? 2-D (on an image) or 3-D (incorporating time also)? From Amy Reibman Yao Wang, 2003 Waveform-based video coding 10 5

Karhunen Loève Transform (KLT) Optimal transform Requires statistics of the input source Known covariance function Coefficients are completely uncorrelated The best energy compaction Sort coefficients from largest to smallest expected squared magnitude; then the sum of the energies of the first M coefficients is as large as possible No computationally efficient algorithm We ll derive it later From Amy Reibman Yao Wang, 2003 Waveform-based video coding 11 Other Transform Bases Suboptimal transforms many available! Discrete Fourier Transform (DFT): complex values; discontinuities Discrete Cosine transform (DCT): nearly as good as KLT for common image signals Hadamard and Haar: basis functions contain only +1,0,-1 Waveform-based video coding 12 6

Discrete Cosine Transform: Basis Images Example: D=dctmtx(8); X=zeros(8); X(4,3)=1; Basis=D *X*D; Yao Wang, 2003 Waveform-based video coding 13 Hadamard Transform: Basis images Example: D=hadamard(8); reindex=[1,8,4,5,2,7,3,6]; 8452736]; D(reindex,:)=D; X=zeros(8); X(4,3)=1; Basis=D *X*D; From Amy Reibman Waveform-based video coding 14 7

Energy Distribution of DCT Coefficients in Typical Images Yao Wang, 2003 Waveform-based video coding 15 Images Approximated by Different Number of DCT Coefficients Original With 16/64 Coefficients With 8/64 Coefficients With 4/64 Coefficients Yao Wang, 2003 Waveform-based video coding 16 8

Demos Use matlab demo to demonstrate approximation using different number of DCT coefficients i (dctdemo.m) Yao Wang, 2003 Waveform-based video coding 17 Distortion in Transform Coding Distortion in sample (image) domain Distortion in coefficient (transform) domain With a unitary transform, the two distortions are equal Yao Wang, 2003 Waveform-based video coding 18 9

Modeling of Distortion Due to Coefficient Quantization High Resolution Approximation of Scalar Quantization With the MMSE quantizer, when each coefficient is scalar quantized with sufficient high rates, so that the pdf in each quantization bin is approximately flat One coefficient Average over all coefficients Depends on the pdf of the k-th coefficient. Yao Wang, 2003 Waveform-based video coding 19 Optimal Bit Allocation Among Coefficients How Many Bits to Use For Each Coefficient? Can be formulated as an constrained optimization problem: Minimize: Subject to: The constrained problem can be converted to unconstrained one using the Lagrange multiplier method Minimize: Yao Wang, 2003 Waveform-based video coding 20 10

Derivation and Result Multiply to obtain: Substitute into first equation: Result: all distortions are equal! Yao Wang, 2003 Waveform-based video coding 21 Implication of Optimal Bit Allocation Bit rate for a coefficient proportional to its variance (energy) Geometric mean Distortion is equalized among all coefficients and depends on the geometric mean of the coefficient variances Yao Wang, 2003 Waveform-based video coding 22 11

Transform Coding Gain Over PCM PCM: quantize each sample in the image domain directly Distortion for PCM if each sampled is quantized to R bit: Gain over PCM: Arithmetic mean For Gaussian source each sample is Gaussian, so that coefficients are also Gaussian, are all the same Geometric mean Yao Wang, 2003 Waveform-based video coding 23 Example Determine the optimal bit allocation and corresponding TC gain for coding 2x2 image block using 2x2 DCT. Assuming the image is a Gaussian process with inter-sample correlation as shown below. Yao Wang, 2003 Waveform-based video coding 24 12

Example Continued (Convert 2x2 into 4x1) Correlation matrix DCT basis images Equivalent transform matrix Yao Wang, 2003 Waveform-based video coding 25 Example Continued (for R=2) Yao Wang, 2003 Waveform-based video coding 26 13

Optimal Transform Optimal transform Should minimize the distortion for a given average bit rate Equivalent to minimize the geometric mean of the coefficient variances When the source is Gaussian, the optimal transform is the Karhunen- Loeve transfrom, which depends on the covariance matrix between samples Basis vectors are the eigen vectors of the covariance matrix, the coefficient variances are the eigen values Yao Wang, 2003 Waveform-based video coding 27 Example Determine the KLT for the 2x2 image block in the previous example Determine the eigenvalues by solving: Determine the eigenvectors by solving (same as the coefficient variances with DCT) Resulting transform is the DCT Yao Wang, 2003 Waveform-based video coding 28 14

Properties of KLT Optimal transform for Gaussian sources Nearly optimal transform for non-gaussian sources Minimal approximation error for K<N coefficients among all unitary transforms KLT has highest energy compaction Coefficients are uncorrelated Requires a stationary source with known covariance matrix most sources vary spatially and temporally No fast algorithms and not signal independent Yao Wang, 2003 Waveform-based video coding 29 JPEG Image Coder Uses 8x8 DCT Each coefficient is quantized using a uniform quantizer, but the step sizes vary based on coefficient variances and their visual importance Quantized coefficients are converted into binary bitstreams using runlength coding plus Huffman coding Yao Wang, 2003 Waveform-based video coding 30 15

JPEG: a bit more detail Perceptual based quantization matrix: Zig-zag ordering of DCT coefficients: Runlength coding example: Yao Wang, 2003 Waveform-based video coding 31 Predictive Coding Motivation: Predicts a sample from past samples and quantize and code the error only If the prediction error is typically small, then it can be represented with a lower average bit rate Optimal predictor: minimize the prediction error A B C D E F G H I J K L fk aff bfg cfh d fj Yao Wang, 2003 Waveform-based video coding 32 16

Encoder and Decoder Block Diagram (Closed Loop Prediction) Yao Wang, 2003 Waveform-based video coding 33 Distortion in Predictive Coder With closed-loop prediction, reconstruction error in a sample is equal to the quantization error for the prediction error. Yao Wang, 2003 Waveform-based video coding 34 17

Optimal Predictor Question: what predictor should we use? Minimize the bit rate for coding the prediction error Because quantization error with a given bit rate depends on the variance of the signal, minimizing the quantization error = minimizing the prediction error variance. We will limit our consideration to linear predictor only Yao Wang, 2003 Waveform-based video coding 35 Linear Minimal MSE Predictor Prediction error: Optimal coefficients must satisfy: (*) Note (*) is also known as the orthogonality principle in estimation theory Yao Wang, 2003 Waveform-based video coding 36 18

Matrix Form The previous equation can be rewritten as: Optimal solution: Yao Wang, 2003 Waveform-based video coding 37 Predictive Coding Gain K -> 1/K TC=PC if the block length in TC and the predictive order in PC both go to infinity PC is better for any finite length Yao Wang, 2003 Waveform-based video coding 38 19

Example Dˆ a1c a2b a3a Yao Wang, 2003 Waveform-based video coding 39 Example Continued (DPCM is better than TC for this case!) Yao Wang, 2003 Waveform-based video coding 40 20

Predictive Coding for Video For video, we apply prediction both among pixels in the same frame (intra-prediction ti or spatial prediction), and also among pixels in adjacent frames (interprediction or temporal prediction) Temporal prediction is done with motion compensation More on this subject in the next lecture. Yao Wang, 2003 Waveform-based video coding 41 Homework Reading assignment: Sec. 9.1,9.2 Written assignment: Prob. 9.3,9.4,9.5, 9.6, 9.7 Computer assignment Prob. 9.8,9.9 Yao Wang, 2003 Waveform-based video coding 42 21