






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The basics of mpeg-2 video compression, focusing on intra and inter frames. Intra-frames (i) are coded independently, while inter-frames (p and b) rely on predictions from other frames. The role of reference frames, motion vectors, and quantization tables in the compression process.
Typology: Study Guides, Projects, Research
1 / 30
This page cannot be seen from the preview
Don't miss anything!























ECE 434 – Multimedia Networks Spring 2009 David Swiston MPEG2 Computer Project
The following report and accompanying code detail an investigation into the MPEG-2 compression algorithm. The steps and theory involved in encoding and decoding the MPEG-2 bit stream will be discussed. A MATLAB based simulation of the encoding and decoding process is provided along with experimental results using the MATLAB simulation.
The source video frames for this experiment come from the movie Wall-E. They were captured using VLC Media Player 0.9.4 using the image video output option. This allowed for each decoded frame to be output as a lossless PNG file instead of being displayed on the computer screen. The output frames were decimated from 1280 horizontal by 528 vertical pixels to 512 horizontal by 211 (cropped to 208) vertical pixels. The frame rate was also decimated by three from 23.972615 frames per second to 7.99087 frames per second. The decimation in the spacial and temporal dimensions was done to ease computational and memory requirements while working in MATLAB as well as to allow VLC to perform the frame capture without dropping any frames due to my computer hardware limitations.
The MPEG2 based encoder and decoder are implemented in MATLAB. It does not produce an MPEG exact bitstream but it does encompass all of the important features including colorspace conversion, chroma subsampling, inter/intra framing,block based coding, motion compensation, 2D DCT, DCT coefficient quantization, zig-zag reordering, and run-length and variable length coding. The following table details the default settings used. They were chosen and not varied as they are widely used defaults in MPEG Chroma Subsampling 4:2: Macroblock Size 16 Block Size 8 Chroma Upsampling Nearest Neighbor Interpolation Code execution is structured as follows:
Frame 2 Original Decoded Difference Frame 3 Original
Decoded Difference Frame 4 Original Decoded
Original Decoded Difference Frame 7 Original
Decoded Difference Frame 8 Original Decoded
Original Decoded Difference
Hierarchical [ 2 ∗ ceil p 4
2
2 9
2 9N 2 ] Using the MATLAB model, all three search methods were profiled for runtime. Note that the hierarchical search method can use any type of search method to find the initial estimated motion vector. In this simulation, this initial search was done using a sequential search. The following tables provide the average runtime for the motion vector search for the first 10 frames and the MSE of the resulting frames for each search method. A scale factor of 18 was used. Hierarchical Search Frame Runtime (seconds)
Red Green Blue 1 N/A (I Frame) 19.322050 16.198571 20. 2 0.5841 9.084407 18.942899 12. 3 0.5465 10.910673 23.888249 16. 4 0.5401 14.708402 24.684232 18. 5 N/A (I Frame) 15.947172 11.643376 16. 6 0.5460 11.343562 20.374408 14. 7 0.5449 14.893874 25.406973 18. 8 0.5430 17.093994 28.643874 22. 9 N/A (I Frame) 14.310519 10.771259 16. 10 0.5421 8.011503 17.069636 12. Logarithmic Frame Runtime (seconds)
Red Green Blue 1 N/A (I Frame) 19.322050 16.198571 20. 2 0.4092 8.938308 18.562040 12. 3 0.3917 10.980027 23.842989 16. 4 0.3925 15.429133 25.150879 19. 5 N/A (I Frame) 15.947172 11.643376 16. 6 0.3942 10.992563 19.638616 14. 7 0.4111 14.297307 23.897611 18. 8 0.3855 16.308415 27.130587 20. 9 N/A (I Frame) 14.310519 10.771259 16. 10 0.3923 7.531550 16.487849 12. Sequential Frame Runtime MSE
From To Motion Vector Prediction Quiver Plot – Window size = 64 MSE – Red: 7.75 Green: 17.15 Blue: 11. Bits: 0.8630e+ Decoded Source Frame (Frame #2) Decoded Predicted Frame (Frame #3) From To Motion Vector Prediction Quiver Plot – Window size = 64 MSE: Red: 8.90 Green: 21.09 Blue: 13.
Bits: 1.1999e+