You have to implement the technique of motion compensation in video compression and study how it affects the forecasting errors. Suppose that the first part will always be a part I and that the remaining part will be of type P. The hypothesis is true in the case of short video sequences in which editing, which will have a length of 100 frames.
Part (A) In the first part of this work, suppose you want to predict whole P-frames and not in parts. The entire framework of each prediction is based on the previous frame. Implement a function that accepts two input frames, calculate the difference and returns an error box without motion vector calculated.
â€¢ You are invited to view the sequence of frames error. Independently encode each frame error by Huffman and save the resulting flow in binary file, making your own specifications.
â€¢ What else needs to be saved so you can unzip the flow and to reconstruct the original sequence of video frames?
â€¢ Implement a function to the decoder (Admission is only stored binary stream).
Part (B)You have to implement motion prediction technique, which calculates motion vectors per block. Each block will have the MPEG standard size 16 x 16.
â€¢ Implement a function that accepts two input boxes: a reference framework, which will be used during the search of motion vectors, and a target part, which will be provided. Divide the target into context makromplok size 16 x 16. If the width and height of the frame is not a multiple of 16, fill in the appropriate box with black pixels.
â€¢ For each block in the target, see the corresponding position in the reference and find the area that gives the best match, as explained in the book. Use the metric SAD area in search results for k = 16, so that motion vectors have a maximum size of 16 pixels in each direction.
â€¢ Based on the prediction block, calculate the block error as the difference between the original block and the forecast. Once this process is completed for all blocks, there will be an error box. To make the projection errors of all frames. We find that the frameworks have significantly less error entropy compared to the previous case, although more time is needed to calculate them. Independently encode each frame errors in Huffman.
â€¢ Save the compressed stream by selecting your choice of configuration. Be sure to include all the necessary information to be decoded.
â€¢ Implement the decoder.