x 264 code tracing GROUP 4 BLOCK 3
x 264 code tracing GROUP 4 BLOCK 3 黃柏臻 S 9862581
TRACE FUNCTIONs �X 264_mb_encode_i 8 x 8() �X 264_predict_lossless_8 x 8() �Sub 16 x 16_dct 8() �Sub 8 x 8_dct 8() �dct 4 x 4 dc() x 264_macroblock_encode x 264_predict_lossless_8 x 8 x 264_mb_encode_i 8 x 8 sub 8 x 8_dct 8
x 264_macroblock_encode X 264_mb_encode_i 8 x 8() 架構圖 x 264_mb_encode_i 8 x 8 no mb. b_lossless yes sub 8 x 8_dct 8 x 264_quant_8 x 8 zigzagf. sub_8 x 8 mb. b_trellis STORE_8 x 8_NNZ quantf. quant_8 x 8 x 264_quant_8 x 8_trellis nz nz If(nz) yes no STORE_8 x 8_NNZ zigzagf. scan_8 x 8 dequant_8 x 8 add 8 x 8_idct 8 STORE_8 x 8_NNZ
X 264_mb_encode_i 8 x 8()-1 File: Macroblock. c Target 8 x 8 Macroblock encoding Input X 264_t *h, idx , qp Output Void Caller x 264_mb_analyse_intra(), x 264_macroblock_encode()
X 264_mb_encode_i 8 x 8()-2 � (x, y) : the block is processed � fenc/fdec: the buffer of encoded frame and reconstruted frame
X 264_mb_encode_i 8 x 8()-3 �if use lossless coded : transform Luma block and zigzagf scan �Assign cbp value(coded block pattern)
X 264_mb_encode_i 8 x 8()-4 If(nz) yes zigzagf. scan_8 x 8 dequant_8 x 8 add 8 x 8_idct 8 �X 264_quant_8 x 8() �Scan and reconstruct frame (scan-dequant-idct)
X 264_predict_lossless_8 x 8() 架構圖 x 264_macroblock_encod e x 264_predict_lossless_ 8 x 8 x 264_mb_analyse_intra I_PRED_8 x 8_H Switch(i_mode) I_PRED_8 x 8_V mc. copy[PIXEL_8 x 8] (p_src-stride) mc. copy[PIXEL_8 x 8] p_src-1 others predict_16 x 16
I_8 x 8 ! i_skip_intra predict_8 x 8_ filter mb. b_lossless x 264_predict_ lossless_8 x 8 predict_8 x 8 x 264_mb_encod e_i 8 x 8
X 264_predict_lossless_8 x 8() File: Macroblock. c Target Copy pixel value into decoder memory directly (if neighboring blocks are lossless coded) Input X 264_t *h Reconstruct frame(p_dst) Idx , i_mode , edge[33] Output Void Caller x 264_mb_analyse_intra(), x 264_macroblock_encode()
X 264_predict_lossless_8 x 8()-2 �These functions take a shortcut (mc. copy instead of actual pixel prediction) which assumes that the edge pixels of the reconstructed frame are the same as that of the source frame. �This means they will only work correctly if the neighboring blocks are losslessly coded. �This can be resolved by explicitly copying the edge pixels after doing the mc. copy
X 264_predict_lossless_8 x 8()-3
Sub 16 x 16_dct 8() File: dct. c Target transform 16 x 16 block With dct 8 transform Input int 16_t dct[4][64], uint 8_t *pix 1, uint 8_t *pix 2 Output Void Caller x 264_macroblock_encode()
Sub 16 x 16_dct 8() � 2 residual mode in X. 264(dct 4/dct 8) �Call sub 8 x 8_dct 8() for residual transform
Sub 8 x 8_dct 8() File: dct. c Target transform 8 x 8 block With dct 8 transform Input int 16_t dct[64], uint 8_t *pix 1, uint 8_t *pix 2 Output Void Caller x 264_macroblock_encode_p 8 x 8 sub 16 x 16_dct 8()
Sub 8 x 8_dct 8() �Pixel_Sub_wxh(): calculate the residual between current block and reconstrued 4 x 4 block
dct_4 X 4 dc() File: Dct. c(common) Target transform 4 x 4 dc_term matrix With Hadamard transform int 16_t d[16] Input Output Void Caller x 264_mb_encode_i 16 x 16
dct_4 X 4 dc() -1 INTRA_16 16 H 2 H 1 Cb Cr DCT 17 16 0 1 4 5 2 3 6 7 8 9 12 13 10 11 14 15 Y H 3 18 19 20 21 Cb H 3 22 23 24 25 Cr
dct 4 x 4 dc() YD=[H 2 x WD x H 2]/2
�Thanks
- Slides: 20