Image and Video Compression
Image and Video Compression
Image and Video Compression
VEERENDESWARI
UNIT III
Image and video compression: Quantization-JPEG standards-motion
compensation-MPEG-1- MPEG-2-MPEG-4, H.26x standards.
In this particular unit we are going to deal with the compression technique for image &
video information also this unit is organized with process of explanation.
1. Quantization (going to discuss uniform & non uniform)
2. JPEG standard (joint picture expert group)
i. Features of JPEG
3. Motion compensation
Need for compensation
Compensation techniques
Interpolative technique
Predictive technique
4. MPEG standard
i. MPEG1 standard
Introduction
Features
Video format
Introduction
Macro block
Interleast video
Scalable extension
Other improvements
Introduction
MPEG4 system
Error resilence
Synthetic images
Quantization:
It is a process of representing continous time valid signal into continous valid samples with a
finite no.of states termed discrete time valued signal.
(i.e) CTS to DTS.
If each sample is quantized independently then the quantization process is called scalar
quantization which is
Q(s)= ri if S € [di-1,d] , i=1,2,….L
L is the no of output states
On the other hand the vector Quantization refers to representing a set of vector each formed by
continous valued sample with finite no. of vector states.
Note:
In image compression scalar or vector Quantization is applied to transform domain image
representation
Any Quantizer performance Quantified by a distortion measure D which is a function of
quantization error
D=f(e) where e=S-s
Generally there are two types of Quantization
1) Uniform Quantization
shown in figure.
JPEG:(Joint photographic Expert Group)
JPEG modes of operation:
1. Sequential mode(Base Line)
2. Lossless mode
3. Progressive mode
4. Hierarchial mode
2. DCT computation
3. Quantization
4. Entropy coding
Vector coding
Differential coding
Run-length coding
Huffman coding
Frame building
Decoding
Block diagram of JPEG Baseline mode
In the late 70’s and early 80’s various types of image compression schemes introduced with
algorithm the two worldwide organization CCITTR and ISO worked actively to propose new
algorithm for image compression there one of the standard is JPEG standard which is a lossy
compression scheme.
It has the following features
1. Resolution Independent
2. High precesion
5. Extensible
Modes of operations:
This standard defines the range of different compression modes. Each mode is intended
for use in a particular application domain.
The modes are Sequential mode, Lossless mode, Progressive mode, Hierarchical mode.
The JPEG is not a complete architecture for image exchange which gives the data streams
of images for a decoder needs to compress it.
2. DCT computation
3. Quantization
4. Entropy coding
a) Vector coding
b) Differtial
c) Run-length coding
d) Huffman coding
5.Frame building
Image/block preparation:
Source image as 2-d matrix of pixel values.
R,G,B format requires three matrices one each for R,G,B Quantized values.
Smaller block size helps DCT computation and individual blocks are equally fed
to the DCT which transforms each block separately.
The image preparation of 8*8 matrix will look like this
We having various image format has monochrome, RGB format and chrominous format
after the selection of any of the image format the block preparation will be carried to forward to
the DCT(Discrete Cosine Transform)
Has DCT computation is a time consuming process the total matrix is divided into set of
smaller 8*8 sub matrix.
DCT computation:
Is the mathematical transformation includes FFT (Fast Fourier Transforms) they take the
signal has i/p and transform it into another type of transformation. It takes a set of points from
the special
Domain and converted into an identical representation of frequency of spectral domain.
The steps are:
Each pixel value in the 2D matrix is Quantized using 8bits which produces a value in the
range of 0 to 225 for the intensity/luminance values and the of -128to 127 for the
chrominance values. All values are shifted to the range of -128 to 127 before computing
DCT.
All 64 values in input matrix contribute to each entry in the transformed matrix.
The other 63 values are called the AC coefficients and have a frequency coefficient
associated with them.
The value in the location F[0,0] of the transformed matrix is called the DC coefficient
and is the average of all 64 values in the matrix.
Spatial frequency coefficients increase as we move from left or right (horizontal) or from
top to bottom(vertically) Low spatial frequencies are clustered in the left top corner.
The formula for DCT computation is given below which perform on NXN square matrix of
pixel values & yield on NXN frequency values.
This is a lossless transformation which does not perform compression in the OP occupies
more space to make it compressed image we can go for quantization.
Quantization:
It consists of the following steps.
The human eye responds to the DC coefficient and the lower spatial frequency
coefficients.
If the magnitude of a higher frequency coefficient is below a certain threshold, the eye
will not detect it.
Set the frequency coefficient in the transformed matrix whose amplitudes are lees than a
defind threshold to zero.
Division operation is performed using the predefined threshold value as the division.
This quantization rounding the coefficient into nearest integer value this is being
performed by a quantization table.
Quantization table:
Threshold values vary for each of the 64 DCT coefficient and are held in a 2-D matrix.
Trade off between the level of compression required and the info loss that is acceptable.
Two default quantization tables one of the luminance co efficient & other for the
chromance coefficients & customized tables may be used.
Entropy coding:
Vectoring -2D matrix of quantized DCT coefficient are represented in the form of a
single dimensional vector.
zigzag scans allows all the DC coefficient & lower frequency AC coefficient to be
scanned first.
DC are encoded using differential encoding & AC coefficient are encoded using run-
length coding, huffman coding is used to encode both after that.
Differential encoding:
DC coefficient is largest in transformed matrix.
The difference values are encoded in the form (SSS value) where SSS field indicate
no. of bits needed to encode the value field indicate binary form.
Each AC coefficient encoded has a pair of values (skip, value) skip indicates the no. of
zeros in the run and values is the next non-zero coefficient.
Huffman encoding:
Long strings of binary digits replaced by shorter code words.
Prefix property of the huffman code words enable decoding the encoded bit stream
unambiguously.
Frame building:
Encapsulates the information relating to an encoded image for remote computer to get
encoded image the JPEG includes a definition of the total bit stream which known as
frame which is outlined in the diagram.
DECODING:
Jpeg decoder is made up of no: of stages which are simply the corresponding
decoder section of those used in the encoder hence the decoding function is similar to perform in
the encoding function
JPEG PROGRESSIVE MODE:
JPEG HEIRARCHICAL MODE: (REFER BOOK)
NOTES :
The remaining modes of JPEG standard
Progressive mode
Lossless mode
Which refers no: of colors displayed at any one time also concerned
with color format of RGB,YUB.
SPACIAL RESOLUTION:
Which deals with the size of the picture .Thus reducing the amount of data needed
to reproduce video saved storage space increase accessing speed as well as enable us to
view the video in the digital manner.
Interpolative technique
Predictive technique
In interpolative aims to send a subset of the picture and interpolate to reconstruct the
information
The predictive technique use with differential PCM and ADOPTIVE PCM
The transform coding converts data into an alternate form which is more
convenient for some particular purpose it follows the principle of DCT has the
entropy coding
MPEG-1
MPEG-2
MPEG-4
This MPEG activity started at 1988 and defined with various algorithm and
simulation models and completed by 1990 MPEG1was formally approved by IS
by late 1992.
MPEG1 FEATURES:
It is a generic standard standardized the syntax for the representation of encoded bit
stream and method of decoding. This operation supports
1. Motion estimation
2. Motion compensation and prediction
3. DCT
4. Quantization
For defining data stream does not follow any standard instead it has flexibility for data
streaming.
SPECIFIC APPLICATIONAREA:-
Provide random access to video
The input video first converted into a format of MPEG1 standard called SIF where the
Luminance channel is 352 pixels and 240 lines and 30 frames per second the hardware
implementation of MPEG1 standard is
I-picture,B-picture,P-picture,D-picture
P-FRAME:
If the block can be skipped, we just send a “skip” code. Otherwise, we compare
the number of total bits of inter and intra coding, choose the more efficient one.
B-FRAME:
MPEG deals with two intra frame compression mode and inter frame
compression mode.
In intra frame we have the process of Quantization and the coding with run
length.
(1) In summary MPEG I performs the following steps decide the labels I,P,B pictures of
GOP.
(2) Estimation of motion vector for each macro block in P and B pictures.
(4) Setting the Quantization scale and Quantization and coding algorithm.
NOTE:
The quality of MPEG 1 compression video at 1.5 Mbps has found that not acceptable for most
entertainment based application thus MPEG 2 introduced has a competable extension of
MPEG 1 to serve a wide range of application at various bit rate 2 to 20 Mbps. It allows for
interlaced input, high definition input, sub sampling input as well as it offers a scalable bit
stream. It provides improved Quantization and coding.