SlideShare a Scribd company logo
NS Talal Khaliq
Project Supervisor:
Dr. Shoiab A Khan
Outline
Motivation
‘A picture is worth a thousands words.’
If this holds true, how a moving picture (video) which
contains so much information is transmitted so efficiently?
Problem background
Example an single video frame with 720x576 pixels with color depth of 24
bits per pixel with 29.97 frames per second uses approximately 200Mbs,
thus for a two hour program at this rate takes over 200 GB which is
practically impossible to store.
What is Video Compression?
It refers to reducing the quantity of data, and is
a combination of spatial image compression and
temporal motion compensation.
Temporal
Correlation
Spatial Correlation
Temporal Model
 It reduces redundancy between transmitted frames by
forming a predicted frame and subtracting this from the
current frame.
 The resulting residual (difference) frame contains less
energy.
 The residual frame is then encoded.
Block-based Motion Estimation
This method is used to ‘compensate’ for motion of
rectangular frames or ‘blocks’ in current frame.
 It involves finding a 4x4 sample region in a reference frame
that closely matches the current macroblock.
 Macroblock with minimum energy is chosen as ‘best match.’
Cost Function
Mean Absolute Difference(MAD),
Mean Squared Error(MSE),
where N is the side of macroblock, Cij and Rij are the pixels being compared.






1
0
1
0
2
||
1 N
i
N
j
ijij RC
N
MAD






1
0
1
0
2
2
)(
1 N
i
N
j
ijij RC
N
MSE
Motion Compensation
 The selected best matching region in the reference frame is
subtracted from the current macroblock to produce a residual
macroblock.
 This residual macroblock is encoded and transmitted together with a
motion vector describing the position of the best matching
macroblock.
 Motion vector is the offset between the current block and the position
of the candidate region.
Past Frame Current Frame
Frame Segmentation Blocks
Search Threshold
Block Matching
Motion Vectors
Motion vector Correction
Blocks
Prediction Error
Transmission
Example Video
Frame 10 Frame 11
Motion Estimation in h.264 encoder
Adaptive Rood Pattern Search Algorithm
 General motion in the frame is usually coherent.
 It uses the motion vector of macro block to its immediate left to
predict its own motion vector.
 It directly puts the search in an area where there is a high probability
of finding a good matching block.
Predicted motion vector
is (3,-2) and step size S,
S=max(3,-2)=> 3.
Frames
Macro block area defined
Frame Scan
S=max(|X|,|Y|)
SDSP
Calculate min cost
LDSP
Start
loop
again
Motion vectors
Advantages
 We do not have to compute whole frame like in Exhaustive Search.
 It does not waste time doing LDSP. It starts with SDSP unlike in
Diamond Search.
 It does not always start from centre or extreme left and thus saves
computation time.
Video 2
Frame 110 Frame 113
Motion Estimation in h.264 encoder
Video 3
Frame 220 Frame 222
Motion Estimation in h.264 encoder

More Related Content

PDF
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
PPT
Motion estimation overview
PDF
High Performance Architecture for Full Search Block matching Algorithm
PPT
The motion estimation
PDF
Efficient Architecture for Variable Block Size Motion Estimation in H.264/AVC
PDF
3D reconstruction
PPTX
DeepLab V3+: Encoder-Decoder with Atrous Separable Convolution for Semantic I...
PPTX
Convolutional neural network
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
Motion estimation overview
High Performance Architecture for Full Search Block matching Algorithm
The motion estimation
Efficient Architecture for Variable Block Size Motion Estimation in H.264/AVC
3D reconstruction
DeepLab V3+: Encoder-Decoder with Atrous Separable Convolution for Semantic I...
Convolutional neural network

What's hot (20)

PPTX
Rethinking Attention with Performers
PDF
A Novel Background Subtraction Algorithm for Dynamic Texture Scenes
PPTX
Vision Transformer(ViT) / An Image is Worth 16*16 Words: Transformers for Ima...
PDF
[Paper] Multiscale Vision Transformers(MVit)
PDF
PR-302: NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
PDF
PR-317: MLP-Mixer: An all-MLP Architecture for Vision
PPTX
Review-image-segmentation-by-deep-learning
PDF
Background Subtraction Algorithm for Moving Object Detection Using Denoising ...
PPTX
Tree structured partitioning into transform blocks and units and interpicture...
PDF
"Semantic Segmentation for Scene Understanding: Algorithms and Implementation...
PDF
Different Approach of VIDEO Compression Technique: A Study
PDF
DICTA 2017 poster
PPTX
Deep Learning Fast MRI Using Channel Attention in Magnitude Domain
PDF
PR-366: A ConvNet for 2020s
PDF
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
PPTX
ImageNet classification with deep convolutional neural networks(2012)
PDF
Efficient Neural Architecture Search via Parameter Sharing
PDF
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
PDF
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
PPTX
2021 05-04-u2-net
Rethinking Attention with Performers
A Novel Background Subtraction Algorithm for Dynamic Texture Scenes
Vision Transformer(ViT) / An Image is Worth 16*16 Words: Transformers for Ima...
[Paper] Multiscale Vision Transformers(MVit)
PR-302: NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
PR-317: MLP-Mixer: An all-MLP Architecture for Vision
Review-image-segmentation-by-deep-learning
Background Subtraction Algorithm for Moving Object Detection Using Denoising ...
Tree structured partitioning into transform blocks and units and interpicture...
"Semantic Segmentation for Scene Understanding: Algorithms and Implementation...
Different Approach of VIDEO Compression Technique: A Study
DICTA 2017 poster
Deep Learning Fast MRI Using Channel Attention in Magnitude Domain
PR-366: A ConvNet for 2020s
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
ImageNet classification with deep convolutional neural networks(2012)
Efficient Neural Architecture Search via Parameter Sharing
HRNET : Deep High-Resolution Representation Learning for Human Pose Estimation
PR-330: How To Train Your ViT? Data, Augmentation, and Regularization in Visi...
2021 05-04-u2-net
Ad

Similar to Motion Estimation in h.264 encoder (20)

PDF
Motion detection in compressed video using macroblock classification
PDF
Optimization of Macro Block Size for Adaptive Rood Pattern Search Block Match...
PPTX
Multimedia basic video compression techniques
PDF
IRJET- Comparison and Simulation based Analysis of an Optimized Block Mat...
PPTX
ARPS Architecture
PDF
40120140503006
PPTX
An efficient block matching algorithm for fast motion ESTIMATION USING COMBIN...
PDF
An Efficient Block Matching Algorithm Using Logical Image
PDF
A Hardware Model to Measure Motion Estimation with Bit Plane Matching Algorithm
PPTX
ODP
MPEG-1 Part 2 Video Encoding
PDF
538 207-219
PPT
Introduction to Video Compression Techniques - Anurag Jain
PDF
Compression: Video Compression (MPEG and others)
PPT
Design and description of of H.264 PPT.ppt
PDF
Video Compression Advanced.pdf
Motion detection in compressed video using macroblock classification
Optimization of Macro Block Size for Adaptive Rood Pattern Search Block Match...
Multimedia basic video compression techniques
IRJET- Comparison and Simulation based Analysis of an Optimized Block Mat...
ARPS Architecture
40120140503006
An efficient block matching algorithm for fast motion ESTIMATION USING COMBIN...
An Efficient Block Matching Algorithm Using Logical Image
A Hardware Model to Measure Motion Estimation with Bit Plane Matching Algorithm
MPEG-1 Part 2 Video Encoding
538 207-219
Introduction to Video Compression Techniques - Anurag Jain
Compression: Video Compression (MPEG and others)
Design and description of of H.264 PPT.ppt
Video Compression Advanced.pdf
Ad

Recently uploaded (20)

PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Well-logging-methods_new................
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT
Mechanical Engineering MATERIALS Selection
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Sustainable Sites - Green Building Construction
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
additive manufacturing of ss316l using mig welding
PPT
Project quality management in manufacturing
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Welding lecture in detail for understanding
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Internet of Things (IOT) - A guide to understanding
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Well-logging-methods_new................
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Mechanical Engineering MATERIALS Selection
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Sustainable Sites - Green Building Construction
UNIT 4 Total Quality Management .pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
additive manufacturing of ss316l using mig welding
Project quality management in manufacturing
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Lecture Notes Electrical Wiring System Components
Welding lecture in detail for understanding
CYBER-CRIMES AND SECURITY A guide to understanding
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026

Motion Estimation in h.264 encoder

  • 1. NS Talal Khaliq Project Supervisor: Dr. Shoiab A Khan
  • 3. Motivation ‘A picture is worth a thousands words.’ If this holds true, how a moving picture (video) which contains so much information is transmitted so efficiently?
  • 4. Problem background Example an single video frame with 720x576 pixels with color depth of 24 bits per pixel with 29.97 frames per second uses approximately 200Mbs, thus for a two hour program at this rate takes over 200 GB which is practically impossible to store.
  • 5. What is Video Compression? It refers to reducing the quantity of data, and is a combination of spatial image compression and temporal motion compensation.
  • 7. Temporal Model  It reduces redundancy between transmitted frames by forming a predicted frame and subtracting this from the current frame.  The resulting residual (difference) frame contains less energy.  The residual frame is then encoded.
  • 8. Block-based Motion Estimation This method is used to ‘compensate’ for motion of rectangular frames or ‘blocks’ in current frame.  It involves finding a 4x4 sample region in a reference frame that closely matches the current macroblock.  Macroblock with minimum energy is chosen as ‘best match.’
  • 9. Cost Function Mean Absolute Difference(MAD), Mean Squared Error(MSE), where N is the side of macroblock, Cij and Rij are the pixels being compared.       1 0 1 0 2 || 1 N i N j ijij RC N MAD       1 0 1 0 2 2 )( 1 N i N j ijij RC N MSE
  • 10. Motion Compensation  The selected best matching region in the reference frame is subtracted from the current macroblock to produce a residual macroblock.  This residual macroblock is encoded and transmitted together with a motion vector describing the position of the best matching macroblock.  Motion vector is the offset between the current block and the position of the candidate region.
  • 11. Past Frame Current Frame Frame Segmentation Blocks Search Threshold Block Matching Motion Vectors Motion vector Correction Blocks Prediction Error Transmission
  • 14. Adaptive Rood Pattern Search Algorithm  General motion in the frame is usually coherent.  It uses the motion vector of macro block to its immediate left to predict its own motion vector.  It directly puts the search in an area where there is a high probability of finding a good matching block.
  • 15. Predicted motion vector is (3,-2) and step size S, S=max(3,-2)=> 3.
  • 16. Frames Macro block area defined Frame Scan S=max(|X|,|Y|) SDSP Calculate min cost LDSP Start loop again Motion vectors
  • 17. Advantages  We do not have to compute whole frame like in Exhaustive Search.  It does not waste time doing LDSP. It starts with SDSP unlike in Diamond Search.  It does not always start from centre or extreme left and thus saves computation time.
  • 18. Video 2 Frame 110 Frame 113
  • 20. Video 3 Frame 220 Frame 222