The main focus of this project is to explore and implement a lossy encoder and decoder for static images and videos. Building upon the existing foundation, optimizations have been introduced, including fractional-sample-accurate motion compensation (MCP) and intra-coding for both inter- and intra-prediction.
- In the process of encoding still images, the main techniques applied include Discrete Cosine Transform (DCT), quantization, zigzag scanning, run-level coding, and Huffman coding

- In the process of encoding static images, the main techniques applied include Discrete Cosine Transform (DCT), quantization, zigzag scanning, run-level coding, and Huffman coding

Here we want to use fractional-pixel (e.g half-pixel) instead of full pixel for higher accuracy. We use linear interpolation and assign the mean of the four surrounding points to the interpolation point. In intra coding we encode the residual difference between predicted and actual block samples from different direction.
- Based on prediction from previously decoded spatially neighboring samples.
- Different location of blocks have different prediction method
- Calculate SAD, the winning mode is the one with the smallest error

- Use the neighboring 6 pixels to predict the value of the center pixel
- e.g.
$b = \frac{E-5F+20G+20H-5I+J}{32}$ 
- Please open and run main.m until it finishes running, It will take about 20 minutes.

