Image Processing Architecture, © 2001-2004 Oleh TretiakPage 1Lecture 6 ECE-C453 Image Processing Architecture Lecture 6, 2/3/04 Lossy Video Coding Ideas.

Slides:



Advertisements
Similar presentations
Multimedia System Video
Advertisements

INTERNATIONAL CONFERENCE ON TELECOMMUNICATIONS, ICT '09. TAREK OUNI WALID AYEDI MOHAMED ABID NATIONAL ENGINEERING SCHOOL OF SFAX New Low Complexity.
Basics of MPEG Picture sizes: up to 4095 x 4095 Most algorithms are for the CCIR 601 format for video frames Y-Cb-Cr color space NTSC: 525 lines per frame.
1 Audio Compression Techniques MUMT 611, January 2005 Assignment 2 Paul Kolesnik.
Spatial and Temporal Data Mining
Department of Computer Engineering University of California at Santa Cruz Video Compression Hai Tao.
Lecture06 Video Compression. Spatial Vs. Temporal Redundancy Image compression techniques exploit spatial redundancy, the phenomenon that picture contents.
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Multimedia Data The DCT and JPEG Image Compression Dr Mike Spann Electronic, Electrical and Computer.
2007Theo Schouten1 Compression "lossless" : f[x,y]  { g[x,y] = Decompress ( Compress ( f[x,y] ) | “lossy” : quality measures e 2 rms = 1/MN  ( g[x,y]
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
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.
1 Image and Video Compression: An Overview Jayanta Mukhopadhyay Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur,
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
Video Compression Concepts Nimrod Peleg Update: Dec
Image and Video Compression
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
JPEG 2000 Image Type Image width and height: 1 to 2 32 – 1 Component depth: 1 to 32 bits Number of components: 1 to 255 Each component can have a different.
JPEG C OMPRESSION A LGORITHM I N CUDA Group Members: Pranit Patel Manisha Tatikonda Jeff Wong Jarek Marczewski Date: April 14, 2009.
Image Processing Architecture, © Oleh TretiakPage 1Lecture 9 ECEC-453 Image Processing Architecture Lecture 9, 2/12/ 2004 MPEG 1 Oleh Tretiak.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
 Coding efficiency/Compression ratio:  The loss of information or distortion measure:
Video Coding. Introduction Video Coding The objective of video coding is to compress moving images. The MPEG (Moving Picture Experts Group) and H.26X.
Introduction to JPEG and MPEG Ingemar J. Cox University College London.
Abhik Majumdar, Rohit Puri, Kannan Ramchandran, and Jim Chou /24 1 Distributed Video Coding and Its Application Presented by Lei Sun.
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
June, 1999 An Introduction to MPEG School of Computer Science, University of Central Florida, VLSI and M-5 Research Group Tao.
Image Compression Supervised By: Mr.Nael Alian Student: Anwaar Ahmed Abu-AlQomboz ID: IT College “Multimedia”
1 Classification of Compression Methods. 2 Data Compression  A means of reducing the size of blocks of data by removing  Unused material: e.g.) silence.
Directional DCT Presented by, -Shreyanka Subbarayappa, Sadaf Ahamed, Tejas Sathe, Priyadarshini Anjanappa K. R. RAO 1.
Compression video overview 演講者:林崇元. Outline Introduction Fundamentals of video compression Picture type Signal quality measure Video encoder and decoder.
Image Processing Architecture, © 2001, 2002 Oleh TretiakPage 1Lecture 15 ECEC-453 Image Processing Architecture 3/11/2004 Exam Review Oleh Tretiak Drexel.
Chapter 17 Image Compression 17.1 Introduction Redundant and irrelevant information  “Your wife, Helen, will meet you at Logan Airport in Boston.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
Digital Image Processing Lecture 21: Lossy Compression Prof. Charlene Tsai.
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
Page 11/28/2016 CSE 40373/60373: Multimedia Systems Quantization  F(u, v) represents a DCT coefficient, Q(u, v) is a “quantization matrix” entry, and.
Block-based coding Multimedia Systems and Standards S2 IF Telkom University.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Image Processing Architecture, © Oleh TretiakPage 1Midterm 2 review ECEC 453 Image Processing Architecture Midterm Review February 24, 2003.
Image Processing Architecture, © Oleh TretiakPage 1Lecture 4 ECE-C490 Winter 2004 Image Processing Architecture Lecture 4, 1/20/2004 Principles.
Chapter 8 Lossy Compression Algorithms. Fundamentals of Multimedia, Chapter Introduction Lossless compression algorithms do not deliver compression.
Introduction to JPEG m Akram Ben Ahmed
Image Processing Architecture, © Oleh TretiakPage 1Lecture 7 ECEC 453 Image Processing Architecture Lecture 8, February 5, 2004 JPEG: A Standard.
Motion Estimation Multimedia Systems and Standards S2 IF Telkom University.
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.
Principles of Video Compression Dr. S. M. N. Arosha Senanayake, Senior Member/IEEE Associate Professor in Artificial Intelligence Room No: M2.06
Image Processing Architecture, © Oleh TretiakPage 1Lecture 5 ECEC 453 Image Processing Architecture Lecture 5, 1/22/2004 Rate-Distortion Theory,
1שידור ווידיאו ואודיו ברשת האינטרנט Dr. Ofer Hadar Communication Systems Engineering Department Ben-Gurion University of the Negev URL:
Video Compression Video : Sequence of frames Each Frame : 2-D Array of Pixels Video: 3-D data – 2-D Spatial, 1-D Temporal Video has both : – Spatial Redundancy.
CMPT365 Multimedia Systems 1 Media Compression - Video Spring 2015 CMPT 365 Multimedia Systems.
Chapter 8 Lossy Compression Algorithms
JPEG Compression What is JPEG? Motivation
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
Last update on June 15, 2010 Doug Young Suh
JPEG.
CMPT 365 Multimedia Systems
JPEG Still Image Data Compression Standard
Image Coding and Compression
Presentation transcript:

Image Processing Architecture, © Oleh TretiakPage 1Lecture 6 ECE-C453 Image Processing Architecture Lecture 6, 2/3/04 Lossy Video Coding Ideas Technology of DCT and Motion Estimation Oleh Tretiak Drexel University

Image Processing Architecture, © Oleh TretiakPage 2Lecture 6 Decorrelation Ideas Orthogonal Transforms (KLR, DCT)  Main method for intra-frame coding Wavelet  New stuff (JPEG 2000) Predictive coding  Simple  Used for inter-frame coding (video)

Image Processing Architecture, © Oleh TretiakPage 3Lecture 6 Lossy Predictive Coding How to decorrelate?  Predict values  Block coding (DFT)  wavelet Predictive (sample based, feedback) encoder, Differential Pulse Code Modulation (DPCM) Encoder Decoder

Image Processing Architecture, © Oleh TretiakPage 4Lecture 6 Review: Image Decorrelation x = (x 1, x 2,... x n ), a sequence of image gray values Preprocess: convert to y = (y 1, y 2,... y n ), y = Ax, A ~ an orthogonal matrix (A -1 = A T ) Theoretical best (for Gaussian process): A is the Karhunen- Loeve transformation matrix  Images are not Gaussian processes  Karhunen-Loeve matrix is image-dependent, computationally expensive to find  Evaluating y = Ax with K-L transformation is computationally expensive In practice, we use DCT (discrete cosine transform) for decorrelation  Computationally efficient  Almost as good as the K-L transformation

Image Processing Architecture, © Oleh TretiakPage 5Lecture 6 Review: Block-Based Coding Full image DCT - one set of decorrelated coefficients for whole image Block-based coding:  Image divided into ‘small’ blocks  Each block is decorrelated separately Block decorrelation performs almost as well (better?) than full image decorrelation Current standards (JPEG, MPEG) use 8x8 DCT blocks

Image Processing Architecture, © Oleh TretiakPage 6Lecture 6 Rate-Distortion: 1D vs. 2D coding Theory on tradeoff between distortion and least number of bits Interesting tradeoff only if samples are correlated “Water-filling” construction to compute R(d)

Image Processing Architecture, © Oleh TretiakPage 7Lecture 6 Wavelet Transform Filterbank and wavelets 2 D wavelets Wavelet Pyramid

Image Processing Architecture, © Oleh TretiakPage 8Lecture 6 Filterbank Pyramid

Image Processing Architecture, © Oleh TretiakPage 9Lecture 6 Lena: Top Level, next level

Image Processing Architecture, © Oleh TretiakPage 10Lecture 6 This Lecture Idea  Video Coding by Pixel Prediction  Motion Estimation Technology: DCT, and how much it costs Technology: Motion Estimation Algorithms

Image Processing Architecture, © Oleh TretiakPage 11Lecture 6 Video Coding Video: Sequence of images Reason for changes between successive images  Edits  Camera pan, zoom  Intra-frame motion  Intra-frame texture  Noise Model: Successive images are similar Video coding uses intra-frame redundancy to achieve lossy compression

Image Processing Architecture, © Oleh TretiakPage 12Lecture 6 Predicting sequential images f(t-1)f(t)f(t) f(t)–f(t–1)

Image Processing Architecture, © Oleh TretiakPage 13Lecture 6 Motion Compensation Macroblock size  MxN Matching criterion  MAE (mean absolute error) Search window  ±p pixel locations Search algorithm  Full search  Logarithmic search  Parallel Hierarchical One-Dimensional Search  Pixel subsampling and projection  Hierarchical downsampling

Image Processing Architecture, © Oleh TretiakPage 14Lecture 6 Motion Estimation Methods No compensation Full search logarithmic search 3 level hierarchical

Image Processing Architecture, © Oleh TretiakPage 15Lecture 6 DCT Technology DCT Formula How it works  DCT plus quantization DCT implementations and cost  Direct  Separable  Fast  Refinements

Image Processing Architecture, © Oleh TretiakPage 16Lecture 6 What is the DCT? One-dimensional 8 point DCT Input x 0,... x 7, output y 0,... y 7 One-dimensional inverse DCT Input y 0,... y 7, output x 0,... x 7 Matrix form of equations: x, y are one column matrices Note: in these equations, p stands for 

Image Processing Architecture, © Oleh TretiakPage 17Lecture 6 Forward 2DDCT. Input x ij i = 0,... 7, j = 0, Output y kl k = 0,... 7, l = 0,... 7 Matrix form, X, Y ~ 8x8 matrices with coefficients x ij, y kl The 2DDCT is separable! Two-Dimensional DCT Note: in these equations, p stands for 

Image Processing Architecture, © Oleh TretiakPage 18Lecture 6 General DCT One dimension Two dimensions

Image Processing Architecture, © Oleh TretiakPage 19Lecture 6 See 06IPA.xls

Image Processing Architecture, © Oleh TretiakPage 20Lecture 6 Computational Complexity 1D DCT  N input and output samples ~ N 2 = 64 operations (additions + multiplications) 2D DCT - direct implementation  M = N 2 input values, M output values -> M 2 = N 4 2D DCT - separable implementation, Y = TXT T = ZT T, where Z = TX, all matrices are NxN -> 2N 3 operations For N = 8  2D DCT direct — 4096 operations, 64 operations per pixel  2D DCT separable — 1024 operations, 16 ops/pixel Big savings due to separable transform Inverse DFT — same story.

Image Processing Architecture, © Oleh TretiakPage 21Lecture 6 DCT: Encoding in JPEG, MPEG Take 8x8 blocks of pixels Subtract range mean value Compute 8x8 DCT Quantize the DCT coefficients  Typically, many of the samples are equal to zero Lossless entropy coding of the quantized samples Different quantization step is used for different DCT coefficients  y kl — DCT coefficients, q kl — quantizer steps  z kl — quantized values

Image Processing Architecture, © Oleh TretiakPage 22Lecture 6 DCT: Example Data from lena, ‘smooth’ area. RMS error = 3.5 Original DCT DCT, quantizedReconstructed

Image Processing Architecture, © Oleh TretiakPage 23Lecture 6 DCT example Data from lena, ‘busy’ area. RMS error = 7.3 OriginalDCT DCT, quantizedReconstructed

Image Processing Architecture, © Oleh TretiakPage 24Lecture 6 Overview: DCT coding Transformation decorrelates samples Transformed samples are quantized, quantization step depends on the coefficient. Degree of compression and loss can be changed by scaling the quantization steps Many quantized samples are zero —> run length coding At receiver, perform inverse DCT Many calculations! JPEG standard quantization steps

Image Processing Architecture, © Oleh TretiakPage 25Lecture 6 Speeding up the DCT Separable transform - basic speedup Fast DCT transform - like FFT Further speedup through Scaled DCT

Image Processing Architecture, © Oleh TretiakPage 26Lecture 6 Optimized (fast) DCT 1-D Chen DCT diagram. Dashed lines indicate subtraction, — multi- plication by a constant, — multiplication by 0.5 (shift). Characteristics of optimized DCT algorithms

Image Processing Architecture, © Oleh TretiakPage 27Lecture 6 DCT Complexity Direct DCT computation:  64 DCT values, each requires 64 multiplications & additions —> 4096 multiply-accumulate (MA) operations per block  Separable algorithm (operate on rows, then on columns) —> 16 one-dimensional 8 point DCT operations —> 1024 MA operations  Fast implementation ~ Nlog 2 N operations ~ 16x24 = 384 MA ops Special methods ~ many operations involve multiplication by 1 or -1, take advantage of this!

Image Processing Architecture, © Oleh TretiakPage 28Lecture 6 Fast Scaled DCT Picture of a butterfly at last stage of DCT + following quantizer

Image Processing Architecture, © Oleh TretiakPage 29Lecture 6 DCT refinements Multiply-accumulate architectures  Basic operation is a = bc + d, well suited for DCT Super-scalar architectures  Multi-register, multi-ALU processors  Perform several operations in parallel Complexity of scaled DCT algorithms, excluding quantization

Image Processing Architecture, © Oleh TretiakPage 30Lecture 6 Motion Estimation Architecture of Motion Estimation Algorithms and Costs  Full Search  Logarithmic Search  PHODS  Downsample, projection  Hierarchical motion estimation  Other criteria  Multi-image estimation

Image Processing Architecture, © Oleh TretiakPage 31Lecture 6 Baseline Models Previous frame predicts current frame  I(x, y, t) = I(x, y, t-1) + e(x, y, t) Not effective in presence of motion ~ zoom, pan, etc. Prediction to account for motion:  I(x, y, t) = I(x+u, y+v, t-1) + e(x, y, t)  (u, v) — motion (displacement) vector Model works (somewhat) for pan, not for other motion  Compromise: Compute independent motion estimates for rectangular image regions — macroblocks. Macroblocks are, in general, bigger than DCT blocks

Image Processing Architecture, © Oleh TretiakPage 32Lecture 6 Generic Encoder - simplified

Image Processing Architecture, © Oleh TretiakPage 33Lecture 6 Generic Decoder

Image Processing Architecture, © Oleh TretiakPage 34Lecture 6 Motion Compensation Macroblock size  MxN Matching criterion  MAE (mean absolute error) Search window  ±p pixel locations Search algorithm  Full search  Logarithmic search  Parallel Hierarchical One-Dimensional Search  Pixel subsampling and projection  Hierarchical downsampling

Image Processing Architecture, © Oleh TretiakPage 35Lecture 6 Motion Estimation Terminology Issues:  Size of macroblock  Size of search region In video coding standards, M = N = 16

Image Processing Architecture, © Oleh TretiakPage 36Lecture 6 Matching Criterion Matching criterion: what produces the fewest coded bits for the error image Coding for each value of motion vector (u, v) is too time consuming (expensive) In practice, mean absolute error (MAE) is most popular C - current image, R - reference image, (x, y) - macroblock origin

Image Processing Architecture, © Oleh TretiakPage 37Lecture 6 Full-Search Method Compute for (2p+1) 2 values of (i, j). Each location requires 3MN operations Picture dimensions IxJ, F pictures per second  3IJF(2p + 1) 2 operations per second  I = 720, J = 480, F = 30, p = 15 —> 30 GOPS Guaranteed to find best (MAE) displacement How to do it?  Special computers  Smaller p  Faster (suboptimal) algorithm

Image Processing Architecture, © Oleh TretiakPage 38Lecture 6 Logarithmic Search (1D) Goal: find minimum over u in [-p, p] First step: evaluate at -p/2, 0, p/2 (interval ~ p) Next step: choose interval of length p/2 around minimum (2 more evaluations) Continue until interval length is equal to 2. This takes k = ceiling(log 2 p) iterations Example p = 7  Evaluate at -4, 0, 4 —> minimum at -4  Evaluate at -6, (-4), -2 —> minimum at -2  Evaluate at -3, (-2), -1 —> minimum at -3. Done!

Image Processing Architecture, © Oleh TretiakPage 39Lecture 6 Logarithmic Search - 2D First stage requires 3x3 = 9 evaluations Subsequent stages require 8 evaluations k = ceiling(log 2 p) stages (iterations) Rate = 3IJF(8k+1)  p = 15, I = 720, J = 480, F = 30 —> 1 GOPS Can fail to find minimum Bottom line: Faster method, more error than full search

Image Processing Architecture, © Oleh TretiakPage 40Lecture 6 PHODS Parallel Hierarchical One-Dimensional Search 1-st Blue 2-nd Green 3-rd Red Min V Min H ~Twice as fast as logarithmic Less reliable

Image Processing Architecture, © Oleh TretiakPage 41Lecture 6 Other Fast Methods Subsample (do not use all points in macroblock) Projection: Row and column projection of pixels, follow with 1-D search Hierarchical motion estimation  Downsample reference image and current image  Perform low resolution search  Refine

Image Processing Architecture, © Oleh TretiakPage 42Lecture 6 Hierarchical Search Prepare downsampled versions of current and reference images  Full macroblock 16x16  Down 2 macroblock 8x8  Down 4 macroblock 4x4 Full search in Down 4 reference image  16 x speedup, smaller macroblock  16 x speedup, fewer displacement vectors  p = ±16, p’ = ±4 Around point of best match, do local search in Down 2 reference image (3x3 search zone) Repeat for Full reference image (3x3 search zone) Full Down 2 Down 4

Image Processing Architecture, © Oleh TretiakPage 43Lecture 6 Motion Estimation Methods No compensation Full search logarithmic search 3 level hierarchical

Image Processing Architecture, © Oleh TretiakPage 44Lecture 6 Comparison

Image Processing Architecture, © Oleh TretiakPage 45Lecture 6 More Speedup Simpler comparison criteria  Binarize difference, count pixels that do not match  PDC (Pixel Difference Classification)  Binarize current and reference  BPROP (count matching pixels)  DPC (count different pixels)  BMP (operations done on bitplanes) Produce 3-25 fold speedup

Image Processing Architecture, © Oleh TretiakPage 46Lecture 6 Big Picture on Speedup Speedup methods are less accurate  Same Bit Rate, lower SNR  Same SNR, higher bit rate  Binary criteria lose about 0.5 dB Suppose we have adequate computing power? Can we do better?  Sub-pixel motion estimation  First find best match with pixel accuracy in displacement vectors  Interpolate images for half-pixel shifts

Image Processing Architecture, © Oleh TretiakPage 47Lecture 6 Multipicture Motion Estimation Estimate on basis of past and future  Non-sequential image transmission  More chances to find good match  More calculations

Image Processing Architecture, © Oleh TretiakPage 48Lecture 6 Video Compression - Summary Video — sequence of images Can use intraframe compression  Motion JPEG Interframe compression offers great potential for savings No motion compensation — lower compression Motion compensation — greater compression All video standards provide for motion compensation  Compensation done on macroblocks, multiple motion vectors per image  Tradeoff between computing requirement and image quality