CPC H04N 19/107 (2014.11) [H04N 19/105 (2014.11); H04N 19/14 (2014.11); H04N 19/176 (2014.11); H04N 19/46 (2014.11)] | 11 Claims |
1. A video encoding method, comprising:
obtaining a target prediction unit in a target image block and a mode information set of the target prediction unit, the mode information set comprising a plurality of candidate prediction modes and mode costs of the candidate prediction modes for the target prediction unit;
performing abnormal distortion point detection on the target prediction unit in at least one candidate prediction mode in the mode information set, to obtain a detection result corresponding to the at least one candidate prediction mode by:
performing pixel value prediction on pixels in the target prediction unit by using a reference prediction mode, to obtain predicted values of the pixels, the reference prediction mode being any one of the at least one candidate prediction mode;
calculating absolute values of residuals between pixel values and the predicted values of the pixels in the target prediction unit;
determining, when there is a pixel having an absolute value of residual greater than a target threshold in the target prediction unit, that the detection result corresponding to the reference prediction mode indicates that there is an abnormal distortion point in the target prediction unit in the reference prediction mode; and
determining, when there is no pixel having an absolute value of residual greater than the target threshold in the target prediction unit, that the detection result corresponding to the reference prediction mode indicates that there is no abnormal distortion point in the target prediction unit in the reference prediction mode;
calibrating at least one of the mode costs corresponding to the at least one candidate prediction mode in the mode information set according to the detection result to obtain calibrated mode costs of the candidate prediction modes and a calibrated mode information set comprising the plurality of candidate prediction modes and calibrated mode costs of the candidate prediction modes;
selecting a target prediction mode from the plurality of candidate prediction modes according to the calibrated mode costs of the candidate prediction modes in the calibrated mode information set; and
performing prediction on the target prediction unit by using the target prediction mode, to obtain encoded data of the target image block;
wherein:
the at least one candidate prediction mode comprises an inter mode, the inter mode comprising at least one of a first prediction mode, a second prediction mode, or a third prediction mode;
the first prediction mode comprises a mode in which index information of a reference image block related to the target image block is to be transmitted;
the second prediction mode comprises a mode in which residual information of the target image block and the index information of the reference image block related to the target image block are to be transmitted; and
the third prediction mode comprises a mode in which the residual information of the target image block, motion vector data of the target image block, and the index information of the reference image block related to the target image block are to be transmitted;
the target threshold is associated with the reference prediction mode;
when the reference prediction mode is the first prediction mode of the inter mode, the target threshold is equal to a first threshold, the first threshold being greater than an invalid value and less than a maximum of a pixel value range; and
when the reference prediction mode is the second prediction mode or the third prediction mode of the inter mode, the target threshold is equal to a second threshold, the second threshold being greater than or equal to the first threshold and less than the maximum of the pixel value range.
|