Intra-frame prediction: prediction is performed based on blocks in the same band after reverse quantization and Reverse Transformation (no de-block effect is performed.
A, 4x4 brightness block prediction:
Used pixels and prediction directions
A ~ F is the pixel value to be predicted in 4x4 blocks, ~ Q is the reference value after Decoding in the adjacent block. 0 ~ 8 is the 9 prediction direction (mode) of the 4x4 brightness block ). When E ~ If H is not available, use D instead.
A ~ Q is unavailable in the following situations:
Not in the current image or strip; not encoded before the 4x4 block; macro block located between frames, and constrained_intra_pred is 1;
The nine prediction modes are described as follows:
"Mode 0: vertical mode, condition: ~ D is available.
"Mode 1: horizontal mode, condition: I ~ L available.
Mode 2: DC mode, condition: ~ D Or I ~ L available.
"Mode 3 ~ 8: reference books on the direction mode, conditions, and forecast values.
The mode is 0 ~ 5. The prediction value calculation method is as follows:
B. brightness block prediction for 16x16:
The reference pixels are 16 on the left, 16 on the top, and 33 on the top left, respectively recorded as P (-1, Y), P (x,-1), P (-1,-1 ). Reference pixels are unavailable in the following situations:
Is not located in the current image or strip; is located in the macro block between frames, and constrained_intra_pred is 1;
There are four prediction modes:
Mode 0: vertical prediction, condition: p (x,-1) available;
Mode 1: horizontal prediction, condition: P (-1, Y) available;
Mode 2: DC prediction, condition: p (x,-1) or P (-1, Y) available;
Model 3: plane prediction.
Color Block prediction for C and 8x8:
The color block is similar to the brightness block of 16x16. The reference pixels are 17. The prediction modes are vertical, horizontal, DC, and plane 1.
D. Intra-frame prediction mode selection:
There are multiple prediction strategies for intra-Frame Prediction of brightness and color. Therefore, we need to select the best intra-frame prediction strategy in practical application.
For Color Block prediction, only 8x8 blocks can be used. You only need to compare the cost of the 4-medium model (using the rdo model) and select the mode with the minimum cost.
For brightness block prediction, 16x16 and 4x4 blocks can be used. Therefore, the minimum cost (rdo model) of the 4x4 prediction mode in 9 must be calculated successively) and the minimum cost of the 16x16 prediction mode (satd formula) in 4, and then select a smaller prediction mode.
E, 4x4 brightness block prediction mode encoding:
Because 4x4 blocks have 9 prediction modes, if 4 bits is required for full encoding, the prediction mode of the current block is inferred based on the Prediction Method of the 4x4 blocks around the block (and left. If the inferred prediction mode persists, you only need to transmit 1 bit (pred_intra4x4_pred_mode_flags = 0); otherwise, transmission requires 4 (rem_intra4x4_pred_mode is the encoding value of 4x4 brightness block prediction mode) + 1 (pred_intra4x4_pred_mode_flags = 1) = 5 bits.
H.264 Study Notes 2-intra-Frame Prediction