| CPC H04N 19/137 (2014.11) [H04N 19/105 (2014.11); H04N 19/176 (2014.11); H04N 19/1883 (2014.11)] | 19 Claims |

|
1. A method, comprising:
obtaining a motion vector of at least one prediction unit comprised in a first coding tree block currently to be processed, and obtaining a reference frame of a video frame corresponding to the first coding tree block;
obtaining a video resolution and a video frame rate of a video, and calculating a threshold based on the video resolution and the video frame rate;
in response to determining that the motion vector is not greater than the threshold according to a preset rule, determining, based on the motion vector, all second coding tree blocks to be referenced by the first coding tree block in the reference frame, wherein the motion vector comprises a value of an abscissa x and a value of an ordinate y, and determining that the motion vector is not greater than the threshold according to the preset rule comprises:
determining that a*|x| is not greater than the threshold; or
determining that a*|y| is not greater than the threshold; or
determining that a*√x2−y2 is not greater than the threshold,
wherein a is a preset constant;
sequentially calculating a first probability that a sample adaptive offset mode is enabled for all coding tree blocks in a preset direction of each of the second coding tree blocks, and
calculating a second probability that the sample adaptive offset mode is enabled for all coding tree blocks in the preset direction of the first coding tree block; and
in response to determining that sample adaptive offset modes of all the second coding tree blocks are trusted based on each first probability and the second probability, obtaining the sample adaptive offset modes of all the second coding tree blocks, and using obtained all types of sample adaptive offset modes as sample adaptive offset modes of the first coding tree block, wherein the sample adaptive offset modes of all the second coding tree blocks are trusted in response to determining that at least one first probability is greater than the second probability.
|