An image decoding method, comprising: determining N decoded units from adjacent decoded units of a to-be-decoded unit according to a first preset rule, and N is a positive integer, wherein the adjacent decoded units of the to-be-decoded unit include a lower-left decoded unit A, a left decoded unit B, an upper-left decoded unit C, an upper decoded unit D, and an upper-right decoded unit E, and a motion prediction mode of the to-be-decoded unit is an affine motion prediction mode; determining a motion vector predictor for each of the M control points of the to-be-decoded unit by using a first preset algorithm and based on motion vectors of vertexes of a n th decoded unit of the N decoded units, sample coordinates of the vertexes of the n th decoded unit, and sample coordinates of the M control points, wherein M is a positive integer determined based on the motion prediction mode of the to-be-decoded unit and n comprises any positive integer not greater than N; and generating a n th motion vector group based on the motion vector predictor of each of the M control points;decoding a bitstream corresponding to the to-be-decoded unit, to obtain a prediction residual of each sample unit and an index identifier of a selected motion vector group; determining the selected motion vector group in N motion vector groups based on the index identifier of the selected motion vector group; determining a prediction sample value of each sample unit in the to-be-decoded unit by affine motion prediction based on the selected motion vector group; and determining a reconstruction sample value of each sample unit based on a sum of the prediction sample value of each sample unit and the prediction residual of each sample unit; characterized in that the determining N decoded units from adjacent decoded units of a to-be-decoded unit according to a first preset rule comprises: sequentially traversing the decoded unit A and the decoded unit B, and find a first decoded unit of the decoded units A and B, whose motion prediction mode is the affine motion prediction mode; and sequentially traversing the decoded unit C, the decoded unit D, and the decoded unit E, and find a first decoded unit of the decoded units C, D and E, whose motion prediction mode is the affine motion prediction mode. determining N decoded units from adjacent decoded units of a to-be-decoded unit according to a first preset rule, and N is a positive integer, wherein the adjacent decoded units of the to-be-decoded unit include a lower-left decoded unit A, a left decoded unit B, an upper-left decoded unit C, an upper decoded unit D, and an upper-right decoded unit E, and a motion prediction mode of the to-be-decoded unit is an affine motion prediction mode; determining a motion vector predictor for each of the M control points of the to-be-decoded unit by using a first preset algorithm and based on motion vectors of vertexes of a n th decoded unit of the N decoded units, sample coordinates of the vertexes of the n th decoded unit, and sample coordinates of the M control points, wherein M is a positive integer determined based on the motion prediction mode of the to-be-decoded unit and n comprises any positive integer not greater than N; and generating a n th motion vector group based on the motion vector predictor of each of the M control points;decoding a bitstream corresponding to the to-be-decoded unit, to obtain a prediction residual of each sample unit and an index identifier of a selected motion vector group; determining the selected motion vector group in N motion vector groups based on the index identifier of the selected motion vector group; determining a prediction sample value of each sample unit in the to-be-decoded unit by affine motion prediction based on the selected motion vector group; and determining a reconstruction sample value of each sample unit based on a sum of the prediction sample value of each sample unit and the prediction residual of each sample unit; characterized in that the determining N decoded units from adjacent decoded units of a to-be-decoded unit according to a first preset rule comprises: sequentially traversing the decoded unit A and the decoded unit B, and find a first decoded unit of the decoded units A and B, whose motion prediction mode is the affine motion prediction mode; and sequentially traversing the decoded unit C, the decoded unit D, and the decoded unit E, and find a first decoded unit of the decoded units C, D and E, whose motion prediction mode is the affine motion prediction mode. sequentially traversing the decoded unit A and the decoded unit B, and find a first decoded unit of the decoded units A and B, whose motion prediction mode is the affine motion prediction mode; and sequentially traversing the decoded unit C, the decoded unit D, and the decoded unit E, and find a first decoded unit of the decoded units C, D and E, whose motion prediction mode is the affine motion prediction mode.