Module 4
DATA COMPRESSION
• Analog video signals typically consist of two main components:
luminance (brightness) and chrominance (color). These signals
are combined to produce a composite video signal, which can
be transmitted over various mediums such as coaxial cables,
RF (radio frequency) signals, or composite video cables.
• Analog video technology has been widely used in the past for
television broadcasts, VHS tapes, analog cameras, and other
video recording and playback devices. However, with the
advancements in digital technology, analog video has largely
been replaced by digital video formats, which offer higher
quality, reliability, and flexibility
• The CRT
A television receiver (traditionally a CRT, or cathode ray tube, is a glass
tube with a familiar shape. In the back it has an electron gun (the
cathode) that emits a stream of electrons. Its front surface is positively
charged, so it attracts the electrons (which have a negative electric
charge). The front is coated with a phosphor compound that converts
the kinetic energy of the electrons hitting it to light. The flash of light
lasts only a fraction of a second, so in order to get a constant display,
the picture has to be refreshed several times a second.
• Aspect ratio refers to the proportional relationship between the
width and height of an image or video frame. It is typically
expressed as a ratio of two numbers, where the first number
represents the width and the second number represents the
height. Aspect ratio is used to describe the shape or dimensions
of an image or video frame.
• For example, in a 16:9 aspect ratio, the width is 16 units and the
height is 9 units. This means that for every 16 units of width,
there are 9 units of height.
Composite Signal
MPEG-2 STANDARD
• MPEG-2 has backward compatibility with MPEG-1
• Algorithms employed by MPEG-1 provide lossy coding scheme
• To achieve a high compression ratio both intraframe and interframe
redundancies should be exploited.
• To satisy the requirement of random access,we have to useintraframe
coding from time to time.
• MPEG-1 video algorithm is mainly based on Discrete Cosine
Transform Coding and interframe motion compensation
Principle of Operation
• I frames are larger than P frames and P frames are larger than B
frames.
• No of P and B frames in a GOP influences the compression gain
• More B frames enables higher compression ratios
• Compression of a video frame to produce an I frame is the simplest to
describe because it is compressed without reference to any other
frames.
Discrete Cosine Transform
Weighting and Requantisation
• The number of bits used in sampling determines the accuracy of the
digitized data with respect to the original source.
• Requantization reduces the number of bit levels and introduces
errors.
• Since these errors are largest in high frequency data,detail will be
diminished.
• The challenge is to keep the quality degradation below a perceptible
level.
Entropy Coding
• Variable length Coding uses the statistical probability of a particular
data value to send a smaller amount of data to represent that value.
• In MPEG compression process,coefficients produced by DCT are
assigned codewords.Use of VLC coding produces a considerable
coding gain when applied to DCT coefficients
• Run Length Coding completes the compression process.RLC takes
advantage of the fact that macroblocks have a string of zeros
Exploiting Temporal Redundancy
Exploiting temporal redundancy
• Creation of P frame begins with subtracting the current frame from an
I frame.
• B frames reference more than one frame,whether I,P or other B
frame
• Then only the visual information that is different between the frames
will be compressed and transmitted.
Decoder
Components of a video signal
Video signals are comprised of several components that
collectively represent visual information. These components
include:
1. Luminance (Y): Luminance represents the brightness or
intensity of the video signal. It is the primary component of black
and white images. In color video signals, luminance represents
the brightness of the image, regardless of color.
2. Chrominance (U and V): Chrominance represents the color
information in the video signal. It consists of two components: U
(blue color difference) and V (red color difference). Chrominance
is responsible for encoding color details in the image.
3.RGB Components: In RGB (Red, Green, Blue) color space, video
signals are represented by three components: Red, Green, and Blue.
Each component represents the intensity of the corresponding primary
color. RGB signals are commonly used in display devices like monitors
and TVs.
4.Alpha Channel (A): The alpha channel is an additional component
used in some video signals to represent transparency or opacity
information. It specifies the level of opacity for each pixel, allowing for
compositing and blending of multiple video layers.
5.Audio Component: In addition to visual components, video signals
often include an audio component. This component represents the
audio waveform synchronized with the video frames. It carries sound
information such as dialogue, music, or sound effects.
6.Metadata: Video signals may also contain metadata, which
provides additional information about the video content. Metadata
can include details such as resolution, frame rate, aspect ratio,
color space, encoding parameters, and timestamps.
Difference between MPEG and MPEG4
MPEG (Moving Picture Experts Group) and MPEG-4 are both
standards developed for audio and video compression, but they
differ in various aspects:
Aspect MPEG MPEG-4
Development Timeframe Developed since late 1980s Introduced in 1998
Significant improvement over
Compression Efficiency Good
predecessors
Primarily focused on video Introduced object-based
Object-Based Coding
and audio coding
Wide range including 3D
Multimedia Capabilities Limited
graphics, VR, etc.
Broadcasting, DVDs, digital Streaming media, multimedia
Applications
television messaging, etc.
Flexibility Limited More flexible, adaptable
Improved, especially for
Coding Efficiency Good
diverse content
Composite Signal
Composite video combines all video information into a single
signal. It typically consists of luminance (brightness) and
chrominance (color) information combined. The signal is usually
represented as:
• Where:
Vc(t) is the composite video signal.
Yc(t) is the luminance (brightness) signal.
Uc(t) is the chrominance (color) signal.
α is a constant representing the color subcarrier amplitude.
Component video signal
Component video separates the video signal into multiple components,
typically luminance (Y), red color difference (R-Y), and blue color
difference (B-Y). The signals are represented as:
Y(t) is the luminance (brightness) signal.
Rc(t) is the red component of the video signal.
Bc(t) is the blue component of the video signal.
Differences between MPEG2 AND MPEG4
• MPEG-2: MPEG-2 offers relatively good compression
efficiency for its time, suitable for applications like DVD, digital
television broadcasting, and satellite TV.
• MPEG-4: MPEG-4 provides significantly improved
compression efficiency over MPEG-2, allowing for higher
quality video at lower bitrates. This makes it more suitable for a
broader range of applications, including internet streaming,
mobile video, and multimedia messaging.
Coding Techniques:
• MPEG-2: MPEG-2 primarily uses traditional block-based motion
compensation and Discrete Cosine Transform (DCT) for video
compression.
• MPEG-4: MPEG-4 introduces more advanced coding
techniques such as object-based coding, shape coding, and
texture coding. These techniques allow for more efficient
compression of complex scenes and multimedia content with
diverse characteristics.
Flexibility:
• MPEG-2: MPEG-2 has limited flexibility in handling different
types of multimedia content and lacks support for advanced
features like interactivity and content-based scalability.
• MPEG-4: MPEG-4 offers greater flexibility and versatility,
supporting a wide range of multimedia applications including
interactive multimedia presentations, 3D graphics, virtual reality,
and content adaptation for various devices and network
conditions.
Support for Multimedia Content:
• MPEG-2: MPEG-2 is primarily focused on video compression
and lacks support for advanced multimedia features.
• MPEG-4: MPEG-4 is designed to handle various types of
multimedia content, including audio, video, graphics, text, and
animation. It supports integration of multiple media types within
a single framework, enabling more immersive and interactive
multimedia experiences.
Applications:
• MPEG-2: MPEG-2 is commonly used in applications such as
DVD, digital television broadcasting, satellite TV, and some
video editing and production workflows.
• MPEG-4: MPEG-4 is widely used in internet streaming, mobile
video, video conferencing, multimedia messaging (MMS),
interactive multimedia applications, and digital multimedia
broadcasting (DMB).
Standardization:
• MPEG-2: MPEG-2 was standardized in the early 1990s and has
been widely adopted in various industries.
• MPEG-4: MPEG-4 was introduced in the late 1990s as the
successor to MPEG-2 and has since become the de facto
standard for many multimedia applications, especially those
involving digital video compression.
Motion Compensation
• Motion compensation is a crucial technique in video
compression to reduce redundancy between consecutive
frames by exploiting temporal coherence.
• It involves predicting the current frame from one or more
previous frames, thereby requiring transmission of only the
differences (prediction error) rather than entire frames.
Need for Motion Compensation:
• Video sequences often contain minimal changes between
adjacent frames, with objects typically moving smoothly.
• Directly transmitting pixel values for each frame independently
leads to inefficient use of bandwidth.
• Motion compensation minimizes redundant information
transmission, leading to efficient compression.
• Motion compensation predicts a frame by shifting and adjusting
blocks of pixels from a reference frame to align with
corresponding regions in the current frame.
• It accounts for the motion of objects between frames by
estimating motion vectors that represent the displacement of
blocks.
• The prediction error, i.e., the difference between the predicted
and actual frames, is encoded and transmitted.
Block-Based Motion Compensation:
Divides frames into blocks of fixed size (e.g., 8x8 or 16x16
pixels).
For each block in the current frame, find the best matching block
in the reference frame.
Measure similarity using metrics like sum of absolute differences
(SAD) or sum of squared differences (SSD).
Motion vectors indicate the displacement needed to align the
blocks.
Prediction error is computed and encoded for transmission.
SAD measures the absolute differences between corresponding pixel
values in two blocks and sums up these differences.
Mathematically, for two blocks A and B of the same size
where
N is the total number of pixels in each block.
The block with the minimum SAD represents the best match, indicating the motion vector.
Sum of Squared Differences (SSD):
SSD calculates the squared differences between corresponding pixel
values in two blocks and sums up these squared differences.
Mathematically, for two blocks A and B of the same size:
Similar to SAD, the block with the minimum SSD represents the best match and
gives the motion vector.
• Motion Compensation: Once the motion vectors are calculated, they
are used to predict the position of blocks in the current frame based
on their positions in the reference frame. This prediction helps reduce
temporal redundancy in the video sequence, allowing for more
efficient compression.
• Overall, the process of calculating motion vectors involves searching
for the best matching block in the reference frame and representing
the displacement between the current block and the best match. This
displacement is then encoded and used for motion compensation
during video compression.
Sub-Pixel Motion Compensation:
• Involves finer motion estimation by considering sub-pixel
displacements.
• Interpolates pixels between neighboring pixels to obtain a
"doubled" image.
• Allows for more precise motion vectors, enhancing prediction
accuracy.
• Different compression standards and algorithms employ
variations of motion compensation.
• Variations may include the search range, search algorithm, and
handling of motion discontinuities.
•
• Motion compensation reduces bit-rate requirements for video
transmission and storage.
• Widely used in video compression standards such as MPEG,
H.264/AVC, and HEVC.
• Enables efficient streaming of video content over networks with
limited bandwidth.
• Motion compensation performance may degrade in the
presence of fast or irregular motion.
• Complex scenes with occlusions or scene changes can pose
challenges for accurate motion estimation.
• Sub-pixel motion compensation increases computational
complexity but enhances video quality.
• Motion compensation is a fundamental aspect of video compression,
enabling efficient transmission and storage of video content.
• Understanding motion compensation principles and techniques is
essential for developing and optimizing video compression
algorithms.
MPEG-1 PEL reconstruction
In the context of MPEG-1 video compression, "PEL
reconstruction" refers to the process of reconstructing the original
picture elements (PELs) from the compressed data. MPEG-1
compression involves several steps, including motion
compensation, discrete cosine transform (DCT), quantization,
variable-length coding (VLC), and more. PEL reconstruction
occurs after decoding these compressed data.
1.Decoding: The compressed MPEG-1 bitstream is decoded,
which involves parsing the headers and extracting the encoded
data.
2.Variable Length Decoding (VLD): In this step, the
variable-length coded data is decoded back into the original
quantized values using the appropriate VLC tables.
3.Inverse Quantization: The quantized data is inverse
quantized, which involves reversing the quantization process to
obtain the DCT coefficients.
4.Inverse Discrete Cosine Transform (IDCT): The DCT coefficients
are subjected to the inverse DCT transform to convert them back into
spatial domain pixel values.
5.Motion Compensation: For P-frames and B-frames, motion
compensation is applied to predict the current frame from previously
reconstructed frames. This involves estimating motion vectors and
shifting blocks of pixels accordingly.
6.Adding Predictions: The predictions obtained from motion
compensation are added to the output of the IDCT step to reconstruct
the final PEL values.
7.Post-Processing: Additional post-processing steps may be
applied to enhance the visual quality of the reconstructed image,
such as deblocking filters or smoothing filters.