oj-codec-v2: [ version 2.4 of ICSP Codec ]
I am sure that this document can help your ICSP Codec design. Main purpose of this document is descriptions for encoder and decoder. First of all, read suggestions in the next page, if you think that you need more study or understanding and then try after studying that. we just deal with 4:2:0 formatted sequence for encoder and decoder descriptions. 4:2:2 and 4:4:4 formats can be generated by 4:2:0 format sequence using interpolation.
In this document, we just deal with 4:2:0 formatted sequence for encoder and decoder descriptions. 4:2:2 and 4:4:4 formats can be generated by 4:2:0 format sequence using interpolation.
Fig 2. shows coding order of 4:2:0 format. As you can see, large character numbers mean macro-block order (raster scan order) and small character numbers mean real coding order after transform. In case of 4:2:0 format, sizes of Cb and Cr are half of luma.
In this section, we define some parameters such as size, quantization parameter, and some modes.
Size 352x288 (CIF), DPCM modes for DC prediction and pixel prediction
- Mode 0 : Median prediction mode
- Mode 6 : no prediction Intra prediction flag
- Mode 0/1 : Disable / Enable Intra period for frame type
- Range : 0 ~ 10, 0 means all predicted frame except first frame. Quantization Parameter
- For DC, 1 ~ 16
- For AC, 1 ~ 16
The ICSP encoder structure. T and Q mean transform and quantization each. We use simplified intra 8x8 prediction, Discrete Cosine Transform (DCT) as T and uniform quantization with simple dead zone as Q. Zig-zag scan is used for reordering and entropy coder which is like JPEG’s is used. For inter frame, Motion Estimation (ME) and Motion Compensation (MC) are used. Reconstructed frame has to be made using inverse transform and inverse quantization.
Fig. 3. Block diagram of ICSP encoder.
T : transform DCT
Q : quantization general uniform quantization with simple dead zone
Reorder zig-zag scan
Entropy encoder like JPEG
For encoding the intra frame, green units in Fig. 4 are used.
Fig. 4. Block diagram of intra frame.
In case of I frame, first of all, current frame is divided by macro-block. In raster macro-block scan order, after simplified intra 8x8 prediction, pixel based DPCM, discrete cosine transform, and quantization, we also use DPCM for reconstructed (i.e, quantized and inverse quantized) DC component. And then use the reordering (just zig-zag scan) and entropy encoder (like Huffman coding). While doing this forward process, we save the reconstructed data using inverse quantization, inverse transform, inverse DPCM and simplified intra 8x8 prediction for reference of next frame.
To reduce the mode bit for intra mode, we use prediction using neighboring blocks. If median of Upper, Left, and Upper Left is equal to current mode, MPM_flag will be set to one. If not, MPM_flag will be set to zero and additional fixed mode bit is coded.
For encoding the inter frame, green units in Fig. 5 are used.
Fig. 5. Block diagram of inter frame.In case of P frame, using previous reconstructed frame for reference, we use motion estimation to search the best motion vector of current macro-block. After motion estimation, we use DCT, quantization, DPCM for DC, reordering, and entropy coding for error image. We use motion compensation for reconstructed frame. In the inter prediction, we do not use pixel based DPCM.
Generally, encoder contains decoder. Therefore decoder is very simple. Fig. 12 shows the structure of ICSP decoder. As you know, Fig. 3 contains Fig. 12.
On the Fast Motion Estimation Algorithm for Inter Prediction.
MPEG and H.264 standards use motion estimation-based inter prediction, which removes temporal redundancy between frames for image compression.
Based on Block matching algorithm that finds the most similar regions in the frame, various methods for psnr and fast algorithm have been proposed.
This full search technique, the most classic block-based motion estimation method for video encoding, compares SAD values at all locations within the search area of the previous frame. Therefore, the exact Motion Vector can be found, but computational cost is much higher.
This project aims to find out the difference between the two fast block matching algorithms, PDE, which is a lossless ME, and PDS, which is a lossy ME, compared to Full Search Algorithm.
MotionEstimation_BasketballDrive_FHD.mp4