Video Encoders, Video Decoders and Corresponding Methods

The method addresses low encoding/decoding speed in video coding by constructing an affine candidate motion vector list from neighboring blocks, reducing memory reads and improving performance.

JP7801398B2Active Publication Date: 2026-01-16HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024108030
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-09-27
Filing Date
2024-07-04
Publication Date
2026-01-16
Estimated Expiration
2038-10-16

AI Technical Summary

Technical Problem

Existing motion vector prediction methods in video coding require a large number of memory reads, leading to low encoding/decoding speed.

Method used

An encoding and decoding method that determines a target candidate motion vector group based on a rate-distortion cost criterion, using an affine candidate motion vector list constructed from neighboring affine coding blocks, reducing the need for memory reads by reusing information about control points within the coding tree unit.

Benefits of technology

Improves encoding and decoding performance by minimizing memory reads and enhancing computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007801398000053
    Figure 0007801398000053
  • Figure 0007801398000054
    Figure 0007801398000054
  • Figure 0007801398000055
    Figure 0007801398000055
Patent Text Reader

Abstract

To provide a video encoder, a video decoder, and a corresponding method.SOLUTION: A decoding method includes the steps of: parsing a bitstream to obtain an index, the index being used to indicate a target candidate motion vector group of a current coding block; determining the target candidate motion vector group in an affine candidate motion vector list based on the index, the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coding block, which are determined based on a relative location of a coding tree unit CTU with respect to the current coding block, the first neighboring affine coding block being located in the CTU; and predicting a predicted sample value of the current coding block based on the target candidate motion vector group.SELECTED DRAWING: Figure 5D
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present application relates to the field of video encoding and decoding technologies, and in particular to an encoding method, a decoding method, a corresponding encoding device, and a corresponding decoding device. [Background technology]

[0002] Digital video capabilities can be incorporated into a wide variety of devices, including digital televisions, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio telephones (so-called "smartphones"), video conferencing devices, video streaming devices, etc. Digital video devices implement video compression techniques, such as those described in standards defined by MPEG-2, MPEG-4, ITU-T H.263, and ITU-T H.264 / MPEG-4 Part 10: Advanced Video Coding (AVC), the video coding standard H.265 / High Efficiency Video Coding (HEVC), and extensions to such standards. By implementing such video compression techniques, video devices can more efficiently transmit, receive, encode, decode, and / or store digital video information.

[0003] Video compression techniques are used to perform spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove inherent redundancy in video sequences. In block-based video coding, a video slice (i.e., a video frame or a portion of a video frame) may be divided into picture blocks, which may also be called treeblocks, coding units (CUs), and / or coding nodes. Picture blocks in an intra-coded (I) slice of a picture are coded through spatial prediction based on reference samples in neighboring blocks within the same picture. For picture blocks in an inter-coded (P or B) slice of a picture, spatial prediction based on reference samples in neighboring blocks within the same picture or temporal prediction based on reference samples in another reference picture may be used. A picture may also be called a frame, and a reference picture may also be called a reference frame.

[0004] Various video coding standards, including the High Efficiency Video Coding (HEVC) standard, propose predictive coding modes to be used for picture blocks. Specifically, the current block to be coded is predicted based on coded video data blocks. In intra-prediction modes, the current block is predicted based on one or more previously decoded neighboring blocks in the same picture as the current block. In inter-prediction modes, the current block is predicted based on decoded blocks in a different picture.

[0005] Motion vector prediction is an important technology that affects encoding / decoding performance. In existing motion vector prediction processes, for translational objects in a picture, there is a motion vector prediction method based on a translational motion model, and for non-translational objects, there is a motion vector prediction method based on a motion model and a motion vector prediction method based on a control point combination. In the motion model-based motion vector prediction method, a large amount of information needs to be read from memory, resulting in a relatively low encoding / decoding speed. How to reduce the number of memory reads in the motion vector prediction process is a technical problem that has been studied by those skilled in the art. Summary of the Invention

[0006] The embodiments of the present application provide an encoding method, a decoding method, a corresponding encoding device, and a corresponding decoding device for reducing the number of reads from memory to some extent so as to improve encoding and decoding performance.

[0007] According to a first aspect, an embodiment of the present application discloses an encoding method, the method including the steps of: determining a target candidate motion vector group in an affine candidate motion vector list (also referred to as a candidate motion vector list) according to a rate-distortion cost criterion, the target candidate motion vector group representing a motion vector predictor of a group of control points of a current coding block (e.g., a current affine coding block), the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coding block, the first group of control points of the first neighboring affine coding block being control points determined based on a relative position of a coding tree unit (CTU) with respect to the current coding block, the first neighboring affine coding block being located within the CTU, or the first group of control points of the first neighboring affine coding block including a bottom-left control point and a bottom-right control point of the first neighboring affine coding block; and encoding an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0008] For example, if the target candidate motion vector group is a target candidate motion vector 2-tuple, the target candidate motion vector group represents the motion vector predictors of two control points of the current coding block. If the target candidate motion vector group is a target candidate motion vector triplet, the target candidate motion vector group represents the motion vector predictors of three control points of the current coding block.

[0009] Optionally, the manner of constructing the affine candidate motion vector list may be: determining one or more neighboring affine-coded blocks of a current coding block in the order of neighboring block A, neighboring block B, neighboring block C, neighboring block D, and neighboring block E (as shown in FIG. 7A), where the one or more neighboring affine-coded blocks include a first neighboring affine-coded block; constructing a first affine model based on the motion vectors of the first group of control points of the first neighboring affine-coded block and the position coordinates of the first group of control points; and then obtaining motion vector predictors of the first group of control points of the current coding block by using the first affine model, where the motion vector predictors of the first group of control points of the current coding block are used as the first candidate motion vector group in the affine candidate motion vector list.

[0010] Optionally, if the affine candidate motion vector list has length 1, the target motion vector group may not need to be indicated using an index.

[0011] In the above method, the affine candidate motion vector list may include only one candidate motion vector group or may include multiple candidate motion vector groups. Each candidate motion vector group may be a motion vector 2-tuple or a motion vector triplet. When multiple candidate motion vector groups exist, the first candidate motion vector group is one of the multiple candidate motion vector groups. The derivation process of another candidate motion vector group in the multiple candidate motion vector groups may be the same as or different from the derivation process of the first candidate motion vector group. Furthermore, the target candidate motion vector group is the optimal candidate motion vector group selected from the affine candidate motion vector list according to a rate-distortion cost criterion. If the first candidate motion vector group is optimal (e.g., has the lowest rate-distortion cost), the selected target candidate motion vector group is the first candidate motion vector group. If the first candidate motion vector group is not optimal, the selected target candidate motion vector group is not the first candidate motion vector group. The first neighboring affine-coded block is a specific affine-coded block among neighboring blocks of the current coding block, and is not particularly limited in this specification. Figure 7A is used as an example for description. The first neighboring affine-coded block may be the coding block in which neighboring position A is located, the coding block in which neighboring position B is located, or another neighboring coding block. It should be noted that A, B, C, D, and E in Figure 7A are intended merely to indicate neighboring positions and are not actual coding blocks. Also, "first," "second," "third," etc. appearing elsewhere in the embodiments of this application each indicate a specific object. The specific object indicated by "first," the specific object indicated by "second," and the specific object indicated by "third" indicate different objects.For example, if there is a first group of control points and a second group of control points, the first group of control points and the second group of control points represent different control points. Furthermore, the terms "first", "second", etc. in the embodiments of the present application do not imply any order.

[0012] It can be understood that if the coding tree unit CTU in which the first neighboring affine coding block is located is located above the current coding block, information (e.g., position coordinates and motion vectors) regarding the bottommost control points (e.g., the bottom-left control point and the bottom-right control point) of the first neighboring affine coding block is read from memory, and if the coding tree unit CTU in which the first neighboring affine coding block is located is located to the left of the current coding block, information regarding the rightmost control points (e.g., the top-right control point and the bottom-right control point) of the first neighboring affine coding block is read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on the first group of control points of a first neighboring affine coded block, the first group of control points are determined based on the relative position of the coding tree unit CTU with respect to the current coding block, and the first neighboring affine coded block is located within the coding tree unit CTU, or the first group of control points includes the lower left and lower right control points of the first neighboring affine coded block, instead of using the upper left, upper right, and lower left control points (six-parameter affine model) of the first neighboring coded block as the control points of the first group as fixed in the prior art, or the upper left and upper right control points (four-parameter affine model) of the first neighboring coded block as the control points of the first group. Therefore, according to the method of determining the first group of control points in the present application, it is highly likely that information read from memory can be directly reused as information about the first group of control points (e.g., position coordinates and motion vectors), thereby reducing the number of times of reading from memory and improving encoding performance.

[0013] In one possible implementation, the first candidate motion vector group may be obtained based on the first group of control points of the first neighboring affine coded block, specifically: the first candidate motion vector group may be obtained based on a first affine model (e.g., based on the first affine model and position coordinates of the group of control points of the current coded block), and the first affine model may be determined based on the motion vectors and position coordinates of the first group of control points of the first neighboring affine coded block.

[0014] In an optional solution, the affine candidate motion vector list further includes a second group of candidate motion vectors, which is obtained based on a second group of control points of a second neighboring affine-coded block, wherein the positions of one or more control points in the second group of control points of the second neighboring affine-coded block relative to the second neighboring affine-coded block are different from the positions of one or more control points in the first group of control points of the first neighboring affine-coded block relative to the first neighboring affine-coded block (e.g., the control points included in the first group of control points of the first neighboring affine-coded block are the lower-left control point, the lower-right control point, and the upper-left control point of the first neighboring affine-coded block, while the control points included in the second group of control points of the second neighboring affine-coded block are the upper-right control point, the lower-right control point, and the lower-left control point of the second neighboring affine-coded block), or the second group of control points of the second neighboring affine-coded block includes the lower-left control point and the lower-right control point of the second neighboring affine-coded block. For example, the first neighboring affine-coded block and the second neighboring affine-coded block are different affine-coded blocks in the spatial neighborhood around the current coding block.

[0015] In another possible implementation, in an advanced motion vector prediction (AMVP) mode, the method further includes: searching for a motion vector of a group of control points with the lowest cost within a preset search range according to a rate-distortion cost criterion by using the target candidate motion vector group as a starting search point; and then determining a motion vector difference (MVD) between the target candidate motion vector group and the motion vector of the group of control points. For example, if a first group of control points includes a first control point and a second control point, the motion vector difference MVD between the motion vector of the first control point and the motion vector predictor represented by the target candidate motion vector group of the first control point in the group of control points needs to be determined, and the motion vector difference MVD between the motion vector of the second control point and the motion vector predictor represented by the target candidate motion vector group of the second control point in the group of control points needs to be determined. In this case, encoding the indices corresponding to the target candidate motion vector groups into the bitstream to be transmitted may specifically include: encoding their MVDs and the indices corresponding to the target candidate motion vector groups into the bitstream to be transmitted.

[0016] In another optional solution, in the merge mode, encoding an index corresponding to the target candidate motion vector group into the bitstream to be transmitted may specifically include encoding an index corresponding to the target candidate motion vector group, a reference frame index, and an index corresponding to the prediction direction into the bitstream to be transmitted. It should be understood that in the merge mode, the target candidate motion vector group represents the motion vectors of the group of control points of the current coding block. In other words, in the merge mode, the motion vector predictor is equal to the motion vector.

[0017] In one possible implementation, the first group of control points of the first neighboring affine coding block are control points determined based on the relative position of the coding tree unit CTU with respect to the current coding block, and the first neighboring affine coding block is located within the CTU, which may include: if the first neighboring affine coding block is located within a coding tree unit CTU above the current coding block, the first group of control points of the first neighboring affine coding block includes a bottom-left control point and a bottom-right control point of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is located above the current coding block, information regarding the bottommost control point of the first neighboring affine coding block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine coding block, the first group of control points includes the bottom-left control point and the bottom-right control point of the first neighboring affine coding block (both belonging to the bottommost control point), and it is obvious that information about these two control points does not need to be additionally read from memory, thereby reducing the number of reads from memory and improving encoding performance.

[0018] Optionally, if the first neighboring affine-coded block is located within a CTU above the current block, the first group of control points of the first neighboring affine-coded block further includes an upper-left control point or an upper-right control point of the first neighboring affine-coded block. It may be understood that if the first group of control points includes three control points, the accuracy of the first group of candidate motion vectors calculated based on the first group of control points will be higher.

[0019] Optionally, both the position coordinates (x6, y6) of the lower-left control point and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are calculated and derived based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, in the process of deriving the motion vector of the control point of the current coding block, a right-shift method can be used instead of a division operation to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0020] In another optional solution, the first group of control points of the first neighboring affine coding block are control points determined based on the relative position of the coding tree unit CTU with respect to the current coding block, and the first neighboring affine coding block is located within the CTU, which may specifically include: if the first neighboring affine coding block is located within a CTU to the left of the current coding block, the first group of control points of the first neighboring affine coding block includes an upper right control point and a lower right control point of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is located to the left of the current coding block, information about the rightmost control point of the first neighboring affine coding block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine coding block, the first group of control points includes the top-right control point and the bottom-right control point of the first neighboring affine coding block (both belonging to the rightmost control point), and it is obvious that information about these two control points does not need to be additionally read from memory, thereby reducing the number of reads from memory and improving encoding performance.

[0021] Optionally, if the first neighboring affine-coded block is located within a CTU to the left of the current coding block, the first group of control points of the first neighboring affine-coded block may further include an upper-left control point or a lower-left control point of the first neighboring affine-coded block. It may be understood that if the first group of control points includes three control points, the accuracy of the first group of candidate motion vectors calculated based on the first group of control points may be higher.

[0022] Optionally, both the position coordinates (x5, y5) of the top-right control point and the position coordinates (x7, y7) of the bottom-right control point of the first neighboring affine-coded block are calculated and derived based on the position coordinates (x4, y4) of the top-left control point of the first neighboring affine-coded block. The position coordinates (x5, y5) of the top-right control point of the first neighboring affine-coded block are (x4 + cuW, y4), and the position coordinates (x7, y7) of the bottom-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the top-right control point of the first neighboring affine-coded block is the motion vector of the top-right sub-block of the first neighboring affine-coded block, and the motion vector of the bottom-right control point of the first neighboring affine-coded block is the motion vector of the bottom-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the top-right control point and the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the top-right control point and the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0023] In another optional solution, when the first group of control points of the first neighboring affine-coded block includes the lower-left control point and the lower-right control point of the first neighboring affine-coded block, the first group of control points of the first neighboring affine-coded block further includes the upper-left control point or the upper-right control point of the first neighboring affine-coded block. It can be understood that when the first group of control points includes three control points, the accuracy of the first group of candidate motion vectors calculated based on the first group of control points is higher.

[0024] In another optional solution, after determining a target candidate motion vector group in the affine candidate motion vector list according to a rate-distortion cost criterion, the method further includes: obtaining motion vectors of one or more sub-blocks of the currently coded block based on the target candidate motion vector group; and predicting predicted sample values ​​of the currently coded block based on the motion vectors of the one or more sub-blocks of the currently coded block (e.g., predicted sample values ​​of the one or more sub-blocks are predicted based on the motion vectors of the one or more sub-blocks of the currently coded block, and then predicted sample values ​​of the currently coded block are obtained). Optionally, when the motion vectors of the one or more sub-blocks of the current coding block are obtained based on a target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the affine model of the current coding block and the position coordinates (0,H) of the lower left corner of the current coding block, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the affine model of the current coding block and the position coordinates (W,H) of the lower right corner of the current coding block. For example, the affine model is constructed based on the target candidate motion vector group. Model parameters of the affine model of the current coding block are obtained based on the target candidate motion vector group and the position coordinates of the group of control points of the current coding block, which are represented by the target candidate motion vector group.The motion vector of the sub-block located in the lower-left corner of the current coding block can be obtained by substituting the position coordinates (0,H) of the lower-left corner of the current coding block into the affine model (rather than substituting the coordinates of the center point of the sub-block located in the lower-left corner into the affine model for calculation). The motion vector of the sub-block located in the lower-right corner of the current coding block can be obtained by substituting the position coordinates (W,H) of the lower-right corner of the current coding block into the affine model (rather than substituting the coordinates of the center point of the sub-block located in the lower-right corner into the affine model for calculation). In this way, when the motion vectors of the lower-left control point and the lower-right control point of the current coding block are used (e.g., when a list of affine candidate motion vectors for another block is subsequently constructed based on the motion vectors of the lower-left control point and the lower-right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0025] Optionally, for any coding block (e.g., the current coding block or a neighboring coding block), if the position coordinates of the top-left control point of the coding block are (x, y), the coordinates of the top-right control point of the coding block are (x+w, y), the coordinates of the bottom-left control point of the coding block are (x, y+h), and the coordinates of the bottom-right control point of the coding block are (x+w, y+h), where w is the width of the coding block and h is the height of the coding block.

[0026] According to a second aspect, an embodiment of the present application provides a video encoder including several functional units configured to implement any of the methods according to the first aspect. For example, the video encoder may include: an inter prediction unit configured to determine a target candidate motion vector group in an affine candidate motion vector list according to a rate-distortion cost criterion, the target candidate motion vector group representing a motion vector predictor for a group of control points of a current coding block, the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block, the first group of control points of the first neighboring affine coded block being control points determined based on a relative position of a coding tree unit (CTU) with respect to the current coding block, the first neighboring affine coded block being located within the CTU, or the first group of control points of the first neighboring affine coded block including a bottom-left control point and a bottom-right control point of the first neighboring affine coded block, the inter prediction unit may also be referred to as an inter prediction module, in particular a motion estimation module; and The motion vector group may include an entropy encoding unit configured to encode an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0027] According to a third aspect, an embodiment of the present application provides a video data encoding apparatus, including a video encoder configured to implement any of the methods of the first aspect. For example, the apparatus may: a memory configured to store video data in the form of a bitstream; The video encoder may include a video encoder configured to perform the steps of: determining a target candidate motion vector group in an affine candidate motion vector list according to a rate-distortion cost criterion, the target candidate motion vector group representing a motion vector predictor for a group of control points of a current coding block, the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block, the first group of control points of the first neighboring affine coded block being control points determined based on a relative position of a coding tree unit (CTU) with respect to the current coding block, the first neighboring affine coded block being located within the CTU, or the first group of control points of the first neighboring affine coded block including a bottom-left control point and a bottom-right control point of the first neighboring affine coded block; and encoding an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0028] According to a fourth aspect, an embodiment of the present application provides a video data encoding apparatus. The apparatus includes a non-volatile memory and a processor coupled to each other. The memory is configured to store program instructions. The processor is configured to call the program code to perform some or all of the steps of the first aspect and any of the methods in the first aspect. For example, the processor is configured to call the program code to perform the following steps: determining a target candidate motion vector group in an affine candidate motion vector list according to a rate-distortion cost criterion; and encoding an index corresponding to the target candidate motion vector group into a bitstream to be transmitted, wherein the target candidate motion vector group represents a motion vector predictor for a group of control points of a current coding block, and the affine candidate motion vector list includes at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block, the first group of control points of the first neighboring affine coded block being control points determined based on a relative position of a coding tree unit (CTU) with respect to the current coding block, the first neighboring affine coded block being located within the CTU, or the first group of control points of the first neighboring affine coded block including a bottom-left control point and a bottom-right control point of the first neighboring affine coded block.

[0029] According to a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having program code stored thereon, the program code including instructions used to perform some or all of the steps of any of the methods of the first aspect.

[0030] According to a sixth aspect, an embodiment of the present application provides a computer program product which, when run on a computer, causes the computer to perform some or all of the steps of any of the methods of the first aspect.

[0031] It should be understood that the technical solutions in the second to sixth aspects of the present application are consistent with the technical solution in the first aspect of the present application, and the beneficial effects achieved by those aspects and corresponding feasible implementations are similar, and the details will not be described again.

[0032] According to a seventh aspect, an embodiment of the present application discloses a decoding method, which includes the steps of: parsing a bitstream to obtain an index, the index being used to indicate a target candidate motion vector group of a current coding block (e.g., a current affine coding block); and determining a target candidate motion vector group in an affine candidate motion vector list (also referred to as a candidate motion vector list) based on the index (optionally, if the length of the affine candidate motion vector list is 1, the bitstream does not need to be parsed to obtain the index, and the target motion vector group can be determined directly), where the target candidate motion vector group represents a motion vector predictor of a group of control points of the current coding block, and the affine candidate motion vector list includes at least a first candidate motion vector group. the first candidate motion vector group is obtained based on a first group of control points of a first neighboring affine coded block, the first group of control points of the first neighboring affine coded block being control points determined based on the relative position of a coding tree unit (CTU) with respect to a current coding block, and the first neighboring affine coded block is located within the CTU, or the first group of control points of the first neighboring affine coded block includes a bottom-left control point and a bottom-right control point of the first neighboring affine coded block; obtaining motion vectors of one or more sub-blocks of the current coding block based on the target candidate motion vector group; and predicting predicted sample values ​​of the current coding block based on the motion vectors of the one or more sub-blocks of the current coding block.

[0033] Optionally, the manner of constructing the affine candidate motion vector list may include, for example: determining one or more neighboring affine-coded blocks of the current coding block in the order of neighboring block A, neighboring block B, neighboring block C, neighboring block D, and neighboring block E (as shown in FIG. 7A), where the one or more neighboring affine-coded blocks include a first neighboring affine-coded block; and obtaining motion vector predictors of a first group of control points of the current coding block by using a first affine model, where the motion vector predictors of the first group of control points of the current coding block are used as the first candidate motion vector group in the affine candidate motion vector list, and model parameters of the first affine model may be determined based on the motion vectors of the control points of the first group of the first neighboring affine-coded blocks and the position coordinates of the control points of the first group of the first neighboring affine-coded blocks.

[0034] In the above method, the affine candidate motion vector list may include only one candidate motion vector group or multiple candidate motion vector groups. Each candidate motion vector group may be a motion vector 2-tuple or a motion vector triplet. When multiple candidate motion vector groups exist, the first candidate motion vector group is one of the multiple candidate motion vector groups. The derivation process of another candidate motion vector group in the multiple candidate motion vector groups may be the same as or different from the derivation process of the first candidate motion vector group. Furthermore, the target candidate motion vector group is a candidate motion vector group selected from the affine candidate motion vector list based on an index obtained from the bitstream through parsing. If the index points to the first candidate motion vector group, the target candidate motion vector group is the first candidate motion vector group. If the index points to another candidate motion vector group, the target candidate motion vector group is not the first candidate motion vector group. The first neighboring affine-coded block is a specific affine-coded block in the neighboring blocks of the current coding block, and is not particularly limited in this specification. Figure 7A is used as an example for description. The first neighboring affine-coded block may be a coding block at neighboring position A, a coding block at neighboring position B, or another neighboring coding block. Furthermore, "first," "second," "third," etc. appearing elsewhere in the present embodiment each indicate a specific object. The specific object indicated by "first," the specific object indicated by "second," and the specific object indicated by "third" represent different objects. For example, if there are a first group of control points and a second group of control points, the first group of control points and the second group of control points represent different control points. Furthermore, "first," "second," etc. in the present embodiment do not imply any order.

[0035] It can be understood that if the coding tree unit CTU in which the first neighboring affine coding block is located is located above the current coding block, information about the bottommost control point of the first neighboring affine coding block is read from memory, and if the coding tree unit CTU in which the first neighboring affine coding block is located is located to the left of the current coding block, information about the rightmost control point of the first neighboring affine coding block is read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on the first group of control points of a first neighboring affine coded block, the first group of control points are control points determined based on the relative position of the coding tree unit CTU with respect to the current coding block, and the first neighboring affine coded block is located within the coding tree unit CTU, or the first group of control points includes the lower-left control point and the lower-right control point of the first neighboring affine coded block, instead of fixedly using the upper-left control point, the upper-right control point, and the lower-left control point of the first neighboring coded block as the control points of the first group (or fixedly using the upper-left control point and the upper-right control point of the first neighboring coded block as the control points of the first group) as in the prior art. Therefore, according to the method of determining the first group of control points in the present application, it is highly likely that information read from memory can be directly reused as information about the first group of control points (e.g., position coordinates and motion vectors), thereby reducing the number of times of reading from memory and improving decoding performance.

[0036] In one possible implementation, obtaining a first candidate motion vector group based on a first group of control points of a first neighboring affine coding block specifically means: obtaining a first candidate motion vector group based on a first affine model (e.g., based on the first affine model and position coordinates of a group of control points of the current coding block), and the first affine model is determined based on motion vectors and position coordinates of the first group of control points of the first neighboring affine coding block. In this case, obtaining motion vectors for one or more sub-blocks of the current coding block based on a target candidate motion vector group specifically means: obtaining motion vectors for one or more sub-blocks of the current coding block based on a second affine model (e.g., obtaining motion vectors for one or more sub-blocks of the current coding block based on the second affine model and position coordinates of the one or more sub-blocks of the current coding block), and the second affine model is determined based on the target candidate motion vector group and position coordinates of a group of control points of the current coding block.

[0037] In another optional solution, the affine candidate motion vector list further includes a second group of candidate motion vectors, which is obtained based on a second group of control points of a second neighboring affine coded block. The positions of one or more control points in the second group of control points of the second neighboring affine coding block relative to the second neighboring affine coding block are different from the positions of one or more control points in the first group of control points of the first neighboring affine coding block relative to the first neighboring affine coding block (e.g., the control points included in the first group of control points of the first neighboring affine coding block are the bottom-left control point, the bottom-right control point, and the top-left control point of the first neighboring affine coding block, while the control points included in the second group of control points of the second neighboring affine coding block are the top-right control point, the bottom-right control point, and the bottom-left control point of the second neighboring affine coding block), or the second group of control points of the second neighboring affine coding block includes the bottom-left control point and the bottom-right control point of the second neighboring affine coding block.

[0038] In an optional solution, in an advanced motion vector prediction (AMVP) mode, obtaining motion vectors for one or more sub-blocks of a currently coded block based on a target candidate motion vector group may specifically include obtaining a new candidate motion vector group based on a motion vector difference (MVD) obtained from the bitstream through parsing and the target candidate motion vector group indicated by an index, and then obtaining motion vectors for one or more sub-blocks of the currently coded block based on the new candidate motion vector group. For example, a second affine model is first determined based on the new candidate motion vector group and position coordinates of a group of control points of the currently coded block, and motion vectors for one or more sub-blocks of the currently coded block are obtained based on the second affine model. For example, motion vectors for one or more sub-blocks of the currently coded block are obtained based on the second affine model and position coordinates of the one or more sub-blocks of the currently coded block.

[0039] In another possible implementation, in merge mode, predicting the predicted sample values ​​of the currently coded block based on the motion vectors of one or more sub-blocks of the currently coded block may specifically include: predicting the predicted sample values ​​of the currently coded block based on the motion vectors of one or more sub-blocks of the currently coded block, a reference frame index and a prediction direction indicated by said index.

[0040] In another possible implementation, the first group of control points of the first neighboring affine coding block are control points determined based on the relative position of the coding tree unit CTU with respect to the current coding block, and the first neighboring affine coding block is located within the CTU, which may include: if the first neighboring affine coding block is located within a coding tree unit CTU above the current coding block, the first group of control points of the first neighboring affine coding block includes a bottom-left control point and a bottom-right control point of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is located above the current coding block, information regarding the bottommost control point of the first neighboring affine coding block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine-coded block, the first group of control points includes the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block (both belonging to the bottommost control point), and it is obvious that information about these two control points does not need to be additionally read from memory, thereby reducing the number of reads from memory and improving decoding performance.

[0041] In another optional solution, if the first neighboring affine-coded block is located within a CTU above the current block, the first group of control points of the first neighboring affine-coded block further includes an upper-left control point or an upper-right control point of the first neighboring affine-coded block. It can be understood that if the first group of control points includes three control points, the accuracy of the first group of candidate motion vectors calculated based on the first group of control points will be higher.

[0042] Optionally, both the position coordinates (x6, y6) of the lower-left control point and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are calculated and derived based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, in the process of deriving the motion vector of the control point of the current coding block, a right-shift method can be used instead of a division operation to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve decoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0043] In another possible implementation, the first group of control points of the first neighboring affine coding block are control points determined based on the relative position of the coding tree unit CTU with respect to the current coding block, and the first neighboring affine coding block is located within the CTU, which may specifically include: if the first neighboring affine coding block is located within a CTU to the left of the current coding block, the first group of control points of the first neighboring affine coding block includes an upper right control point and a lower right control point of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is located to the left of the current coding block, information about the rightmost control point of the first neighboring affine coding block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine-coded block, the first group of control points includes the top-right control point and the bottom-right control point of the first neighboring affine-coded block (both belonging to the rightmost control point), and it is obvious that information about these two control points does not need to be additionally read from memory, thereby reducing the number of reads from memory and improving decoding performance.

[0044] In another possible implementation, if the first neighboring affine-coded block is located within a CTU to the left of the current coding block, the first group of control points of the first neighboring affine-coded block further includes an upper-left control point or a lower-left control point of the first neighboring affine-coded block. It can be understood that if the first group of control points includes three control points, the accuracy of the first group of candidate motion vectors calculated based on the first group of control points will be higher.

[0045] Optionally, both the position coordinates (x5, y5) of the top-right control point and the position coordinates (x7, y7) of the bottom-right control point of the first neighboring affine-coded block are calculated based on the position coordinates (x4, y4) of the top-left control point of the first neighboring affine-coded block. The position coordinates (x5, y5) of the top-right control point of the first neighboring affine-coded block are (x4 + cuW, y4), and the position coordinates (x7, y7) of the bottom-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the top-right control point of the first neighboring affine-coded block is the motion vector of the top-right sub-block of the first neighboring affine-coded block, and the motion vector of the bottom-right control point of the first neighboring affine-coded block is the motion vector of the bottom-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, in the process of deriving the motion vector of the control point of the current coding block, a right-shift method can be used instead of a division operation to reduce implementation complexity. It can be seen that both the position coordinates of the top-right control point and the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve decoding performance. In another optional solution, the position coordinates of the top-right control point and the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0046] In another possible implementation, when the first group of control points of the first neighboring affine-coded block includes the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block, the first group of control points of the first neighboring affine-coded block further includes the top-left control point of the first neighboring affine-coded block. It can be understood that when the first group of control points includes three control points, the accuracy of the first group of candidate motion vectors calculated based on the first group of control points is higher.

[0047] In another optional solution, when the motion vectors of one or more sub-blocks of a current coding block are obtained based on a target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the affine model of the current coding block and the position coordinates (0,H) of the lower left corner of the current coding block, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the affine model of the current coding block and the position coordinates (W,H) of the lower right corner of the current coding block. For example, the affine model is constructed based on the target candidate motion vector group and the position coordinates of the group of control points of the current coding block. The model parameters of the affine model are obtained based on the target candidate motion vector and the position coordinates of the group of control points of the current coding block. The motion vector of the sub-block located in the lower-left corner of the current coding block can be obtained by substituting the position coordinates (0,H) of the lower-left corner of the current coding block into the affine model (rather than substituting the coordinates of the center point of the sub-block located in the lower-left corner into the affine model for calculation), and the motion vector of the sub-block located in the lower-right corner of the current coding block can be obtained by substituting the position coordinates (W,H) of the lower-right corner of the current coding block into the affine model (rather than substituting the coordinates of the center point of the sub-block located in the lower-right corner into the affine model for calculation). In this way, when the motion vectors of the lower-left control point and the lower-right control point of the current coding block are used (e.g., when an affine candidate motion vector list for another block is subsequently constructed based on the motion vectors of the lower-left control point and the lower-right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0048] Optionally, for any coding block (e.g., the current coding block or a neighboring coding block), if the position coordinates of the top-left control point of the coding block are (x, y), the coordinates of the top-right control point of the coding block are (x+w, y), the coordinates of the bottom-left control point of the coding block are (x, y+h), and the coordinates of the bottom-right control point of the coding block are (x+w, y+h), where w is the width of the coding block and h is the height of the coding block.

[0049] According to an eighth aspect, an embodiment of the present application provides a video decoder including several functional units configured to implement any of the methods of the seventh aspect. For example, the video decoder may include: an entropy decoding unit configured to parse the bitstream to obtain an index, the index being used to indicate a target candidate motion vector group for a current coding block; determining a target candidate motion vector group in an affine candidate motion vector list based on the index, the target candidate motion vector group representing motion vector predictors for a group of control points of a current coding block, the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block, the first group of control points of the first neighboring affine coded block being control points determined based on a relative position of a coding tree unit (CTU) with respect to the current coding block, the first neighboring affine coded block being located within the CTU, or the first group of control points of the first neighboring affine coded block including a bottom-left control point and a bottom-right control point of the first neighboring affine coded block; obtaining motion vectors for one or more sub-blocks of the current coding block based on the target candidate motion vector group; and predicting predicted sample values ​​of the current coding block based on the motion vectors of the one or more sub-blocks of the current coding block.

[0050] According to a ninth aspect, an embodiment of the present application provides a video data decoding apparatus, including a video decoder configured to implement any of the methods of the seventh aspect. For example, the apparatus may: a memory configured to store video data in the form of a bitstream; The video decoder may include a step of: parsing a bitstream to obtain an index, the index being used to indicate a target candidate motion vector group of a currently coded block; and a step of determining a target candidate motion vector group in an affine candidate motion vector list based on the index, the target candidate motion vector group representing a motion vector predictor of a group of control points of the currently coded block, the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block, the first group of block control points are control points determined based on the relative position of a coding tree unit (CTU) with respect to a current coding block, and the first neighboring affine coding block is located within the CTU, or the first group of control points of the first neighboring affine coding block includes a bottom-left control point and a bottom-right control point of the first neighboring affine coding block; obtaining motion vectors of one or more sub-blocks of the current coding block based on the target candidate motion vector group; and predicting predicted sample values ​​of the current coding block based on the motion vectors of the one or more sub-blocks of the current coding block.

[0051] According to a tenth aspect, an embodiment of the present application provides a video data decoding device. The device includes a non-volatile memory and a processor coupled to each other. The memory is configured to store program instructions. The processor is configured to call the program code to perform some or all of the steps of the seventh aspect and any of the methods in the seventh aspect. For example, the processor is configured to call the program code to perform the following steps: a step of parsing the bitstream to obtain an index, the index being used to indicate a target candidate motion vector group of a currently coded block; a step of determining a target candidate motion vector group in an affine candidate motion vector list based on the index, the target candidate motion vector group representing a motion vector predictor of a group of control points of the currently coded block, the affine candidate motion vector list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block, the first group of control points of the coding block are control points determined based on the relative position of a coding tree unit (CTU) with respect to the current coding block, and the first neighboring affine coding block is located within the CTU, or the first group of control points of the first neighboring affine coding block includes a bottom-left control point and a bottom-right control point of the first neighboring affine coding block; obtaining motion vectors of one or more sub-blocks of the current coding block based on the target candidate motion vector group; and predicting predicted sample values ​​of the current coding block based on the motion vectors of the one or more sub-blocks of the current coding block.

[0052] According to an eleventh aspect, an embodiment of the present application provides a computer-readable storage medium having stored thereon program code, the program code including instructions used to perform some or all of the steps of any of the methods of the seventh aspect.

[0053] According to a twelfth aspect, an embodiment of the present application provides a computer program product which, when run on a computer, causes the computer to perform some or all of the steps of any of the methods of the seventh aspect.

[0054] It should be understood that the technical solutions in the eighth to twelfth aspects of the present application are consistent with the technical solution in the seventh aspect of the present application, and the beneficial effects achieved by those aspects and corresponding feasible implementations are similar, and the details will not be described again. [Brief explanation of the drawings]

[0055] In order to describe the technical solutions in the embodiments of the present application more clearly, the following describes the accompanying drawings to describe the embodiments of the present application.

[0056] [Figure 1A] 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application.

[0057] [Figure 1B] 1 is a schematic flow chart of video data processing according to an embodiment of the present application;

[0058] [Figure 2A] 1 is a schematic block diagram of a video encoder according to an embodiment of the present application;

[0059] [Figure 2B] 1 is a schematic block diagram of a video decoder according to an embodiment of the present application;

[0060] [Figure 3] 1 is a flowchart of an inter-prediction method for video picture encoding according to an embodiment of the present application;

[0061] [Figure 4] 1 is a flowchart of an inter-prediction method for video picture decoding according to an embodiment of the present application.

[0062] [Figure 5A] 1 is a schematic diagram of motion information of a current picture block and a reference block according to an embodiment of the present application;

[0063] [Figure 5B] FIG. 1 is a schematic diagram of an inter-prediction scenario according to an embodiment of the present application;

[0064] [Figure 5C] FIG. 2 is a schematic diagram of an inter-frame neighboring block scenario according to an embodiment of the present application;

[0065] [Figure 5D] 2 is a schematic diagram of motion vectors of neighboring affine coded blocks according to an embodiment of the present application;

[0066] [Figure 6] 1 is a schematic flowchart of an encoding method according to an embodiment of the present application;

[0067] [Figure 7A] FIG. 1 is a schematic diagram of a neighboring block scenario according to an embodiment of the present application;

[0068] [Figure 7B] FIG. 1 is a schematic diagram of a neighboring block scenario according to an embodiment of the present application;

[0069] [Figure 8A] 1 is a schematic structural diagram of a motion compensation unit according to an embodiment of the present application;

[0070] [Figure 8B] FIG. 10 is a schematic structural diagram of another motion compensation unit according to an embodiment of the present application;

[0071] [Figure 9] 1 is a schematic flowchart of a decoding method according to an embodiment of the present application;

[0072] [Figure 9A] 1 is a schematic flowchart of constructing an affine candidate motion vector list according to an embodiment of the present application;

[0073] [Figure 9B] 1 is a schematic flowchart of constructing an affine candidate motion vector list according to an embodiment of the present application;

[0074] [Figure 9C] 1 is a schematic flowchart of constructing an affine candidate motion vector list according to an embodiment of the present application;

[0075] [Figure 9D] 1 is a schematic flowchart of constructing an affine candidate motion vector list according to an embodiment of the present application;

[0076] [Figure 10] 1 is a schematic structural diagram of an encoding device or a decoding device according to an embodiment of the present application;

[0077] [Figure 11] 1 is a video encoding system 1100 including the encoder 100 of FIG. 2A and / or the decoder 200 of FIG. 2B, according to an embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0078] The following describes embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.

[0079] For encoding a video stream or a portion of a video stream, such as a video frame or a picture block, temporal and spatial similarities in the video stream can be used to improve encoding performance. For example, for a current picture block in the video stream, motion information used for the current picture block may be predicted based on previously encoded blocks in the video stream, and the difference (also called a residual) between the predicted block and the current picture block (i.e., the original block) is identified to encode the current picture block based on the previously encoded blocks. In this manner, only the residual and some parameters used to generate the current picture block are included in the digital video output bitstream, rather than the entire current picture block. This technique is sometimes referred to as inter-prediction.

[0080] A motion vector is an important parameter in the inter-prediction process and represents the spatial displacement of a previously coded block relative to a currently coded block. To obtain the motion vector, a motion estimation method such as motion search may be used. In early inter-prediction techniques, bits representing the motion vector are included in the encoded bitstream to enable a decoder to reconstruct the predicted block and thereby obtain a reconstructed block. To further improve encoding efficiency, it has been proposed to differentially encode motion vectors by using reference motion vectors, i.e., to encode only the difference between a motion vector and a reference motion vector instead of encoding the entire motion vector. In some cases, the reference motion vector may be selected from motion vectors previously used in the video stream. Selecting a previously used motion vector to encode the current motion vector can further reduce the amount of bits included in the encoded video bitstream.

[0081] FIG. 1A is a block diagram of an exemplary video coding system 1 according to an embodiment of the present application. As used herein, the term "video codec" generally refers to a video encoder and a video decoder. In the present application, the terms "video coding" or "coding" may generally refer to video encoding or video decoding. A video encoder 100 and a video decoder 200 in the video coding system 1 are configured to predict motion information, e.g., motion vectors, of a currently coded picture block or a sub-block of the currently coded picture block according to various example methods described in any one of several new inter-prediction modes provided herein, so that the predicted motion vectors are as close as possible to the motion vectors obtained using a motion estimation method. In this way, motion vector differentials do not need to be transmitted during encoding, thereby further improving encoding and decoding performance.

[0082] As shown in FIG. 1A, the video encoding system 1 includes a source device 10 and a destination device 20. The source device 10 generates encoded video data. Therefore, the source device 10 may be referred to as a video encoding device. The destination device 20 can decode the encoded video data generated by the source device 10. Therefore, the destination device 20 may be referred to as a video decoding device. Various implementation solutions of the source device 10, the destination device 20, or both the source device 10 and the destination device 20 may include one or more processors and memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other medium usable for storing required program code in the form of computer-accessible instructions or data structures, as described herein. For ease of understanding, FIG. 1B further illustrates a scenario in which video data is collected, encoded, and transmitted by the source device 10 and received, decoded, and rendered by the destination device 20.

[0083] The source device 10 and destination device 20 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, handheld telephones such as "smart" phones, television sets, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and similar devices.

[0084] Destination device 20 can receive encoded video data from source device 10 over link 30. Link 30 may include one or more media or devices capable of transferring encoded video data from source device 10 to destination device 20. In one example, link 30 may include one or more communication media that enable source device 10 to transmit encoded video data directly to destination device 20 in real time. In this example, source device 10 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol) and transmit the modulated video data to destination device 20. The one or more communication media may include wireless communication media and / or wired communication media, e.g., radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may be part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from source device 10 to destination device 20.

[0085] In another example, the encoded data may be output to storage device 40 through output interface 140. Similarly, the encoded data may be accessed from storage device 40 through input interface 240. Storage device 40 may include any one of a number of distributed or locally accessed data storage media, such as a hard disk drive, a Blu-ray disc, a DVD, a CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium configured to store encoded video data.

[0086] In another example, storage device 40 may correspond to a file server or another intermediate storage device capable of maintaining the encoded video generated by source device 10. Destination device 20 can access the stored video data from storage device 40 through streaming transmission or download. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to destination device 20. For example, the file server may be a network server (e.g., used for a website), an FTP server, a network-attached storage (NAS) device, or a local disk drive. Destination device 20 can access the encoded video data through any standard data connection (including an Internet connection). Standard data connections may include wireless channels (e.g., Wi-Fi connections), wired connections (e.g., DSL or cable modems), or combinations thereof suitable for accessing encoded video data stored on a file server. Transmission of the encoded video data from storage device 40 may be streaming transmission, download transmission, or a combination thereof.

[0087] The motion vector prediction techniques herein may be used for video encoding and decoding to support multiple multimedia applications, such as over-the-air television broadcasting, cable television broadcasting, satellite television broadcasting, streaming video transmission (e.g., over the Internet), encoding video data stored on a data storage medium, decoding video data stored on a data storage medium, or other applications. In some examples, the video encoding system 1 may be configured to support one-way or two-way video transmission to support applications such as video streaming transmission, video playback, video broadcasting, and / or video telephony.

[0088] The video encoding system 1 depicted in FIG. 1A is merely an example, and the techniques herein are applicable to video encoding settings (e.g., video encoding or video decoding) that do not necessarily involve any data communication between an encoding device and a decoding device. In another example, data may be retrieved from local memory, transmitted over a network in a streaming manner, etc. A video encoding device may encode data and store the data in memory, and / or a video decoding device may retrieve data from memory and decode the data. In many examples, encoding and decoding are performed by devices that only encode data, store the data in memory, and / or retrieve data from memory, and decode the data, but do not communicate with each other.

[0089] 1A, source device 10 includes video source 120, video encoder 100, and output interface 140. In some examples, output interface 140 may include a modulator / demodulator (modem) and / or a transmitter. Video source 120 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video feed-in interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of the above video data sources.

[0090] Video encoder 100 may encode video data from video source 120. In some examples, source device 10 transmits the encoded video data directly to destination device 20 through output interface 140. In other examples, the encoded video data may alternatively be stored in storage device 40, such that destination device 20 subsequently accesses the encoded video data for decoding and / or playback.

[0091] In the example of FIG. 1A , destination device 20 includes input interface 240, video decoder 200, and display device 220. In some examples, input interface 240 includes a receiver and / or a modem. Input interface 240 can receive encoded video data over link 30 and / or from storage device 40. Display device 220 may be integrated with destination device 20 or may be located external to destination device 20. Typically, display device 220 displays the decoded video data. Display device 220 may include multiple types of display devices, such as a liquid crystal display (LCD), a plasma display, an organic light-emitting diode (OLED) display, or another type of display device.

[0092] 1A, in some aspects, video encoder 100 and video decoder 200 may be integrated with audio encoders and decoders, respectively, and may include appropriate multiplexer-demultiplexer units or other hardware and software to encode audio and video in a combined or separate data stream. In some examples, if applicable, the MUX-DEMUX units may conform to the ITU H.223 multiplexer protocol or another protocol such as User Datagram Protocol (UDP).

[0093] The video encoder 100 and the video decoder 200 may each be implemented as any one of the following circuits: one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the present application is implemented in part through software, the device may store instructions for the software on a suitable non-volatile computer-readable storage medium and use one or more processors to execute the instructions in hardware to implement the techniques herein. Any one of the above (including hardware, software, a combination of hardware and software, etc.) may be considered one or more processors. The video encoder 100 and the video decoder 200 may each be included in one or more encoders or decoders, or the encoders or decoders may be integrated as part of a combined encoder / decoder (codec) within the corresponding device.

[0094] As used herein, video encoder 100 may be loosely referred to as another device that "signals" or "transmits" some information, for example, to video decoder 200. The terms "signaling" or "transmitting" may loosely refer to the transfer of syntax elements and / or other data used to decode compressed video data. The transfer may occur in real time or near real time. Alternatively, the communication may occur after a period of time. For example, the communication may occur when syntax elements in an encoded bitstream are stored in a computer-readable storage medium during encoding, and a decoding device may then retrieve the syntax elements at any time after they are stored in the medium.

[0095] Video encoder 100 and video decoder 200 may operate in accordance with a video compression standard such as High Efficiency Video Coding (HEVC) or an extension thereof, and may conform to the HEVC Test Model (HM). Alternatively, video encoder 100 and video decoder 200 may operate in accordance with another industry standard, such as the ITU-T H.264 standard, the H.265 standard, or an extension of such a standard. However, the technology herein is not limited to any particular encoding and decoding standard.

[0096] 3, in one example, video encoder 100 is configured to encode syntax elements related to a current picture block to be encoded into a digital video output bitstream (abbreviated as "bitstream"). Here, the syntax elements used to perform inter prediction on the current picture block are abbreviated as "inter prediction data." To determine an inter prediction mode to be used to encode the current picture block, video encoder 100 is further configured to: determine or select an inter prediction mode from a set of candidate inter prediction modes to be used to perform inter prediction on the current picture block (S301) (e.g., select an inter prediction mode with a compromised or lowest rate-distortion cost from a plurality of new inter prediction modes for encoding the current picture block); and encode the current picture block based on the determined inter prediction mode (S303). The encoding process in this specification may include: predicting motion information of one or more sub-blocks in the current picture block based on the determined inter-prediction mode (the motion information may specifically be the motion information of each sub-block or the motion information of all sub-blocks); and predicting predicted sample values ​​of the one or more sub-blocks by using the motion information of the one or more sub-blocks in the current picture block to obtain a predicted block of the current picture block.

[0097] It should be understood that if the difference (i.e., residual) between the prediction block generated using the motion information predicted based on the inter prediction mode and the current picture block to be encoded (i.e., the original block) is 0, video encoder 100 only needs to encode the syntax elements related to the current picture block to be encoded into the bitstream (also referred to as bitstream). Otherwise, in addition to the syntax elements, the corresponding residual needs to be encoded into the bitstream.

[0098] 4, video decoder 200 is configured to: decode a bitstream to obtain syntax elements related to a current picture block to be decoded (S401); if the inter prediction data indicates that a particular inter prediction mode (e.g., advanced motion vector prediction (AMVP) mode, merge mode, affine merge mode, or affine motion vector prediction mode) is to be used to predict the current picture block (S403); and decode the current picture block based on the determined inter prediction mode (S405). The decoding process here may include: predicting motion information of one or more sub-blocks within the current picture block; and performing inter prediction on the current picture block by using the motion information of one or more sub-blocks within the current picture block.

[0099] Optionally, if the inter prediction data further includes an index used to indicate a target candidate motion vector group for the current picture block, video decoder 200 is configured to determine a target candidate motion vector group in the affine candidate motion vector list. The target candidate motion vector group represents a motion vector predictor for a group of control points for the current picture block. It should be understood that when video decoder 200 uses merge mode, the motion vector predictor for the group of control points for the current picture block represented by the target candidate motion vector group is used as the motion vector for the group of control points for the current picture block.

[0100] FIG. 2A is a block diagram of an exemplary video encoder 100 according to an embodiment of the present application. The video encoder 100 is configured to output video to a post-processing entity 41. The post-processing entity 41 represents an example of a video entity that can process encoded video data from the video encoder 100. For example, the video entity may be a media-aware network element (MANE) or a stitching / editing device. In some cases, the post-processing entity 41 may be an example of a network entity. In some video encoding systems, the post-processing entity 41 and the video encoder 100 may be components of separate devices; in other cases, the functionality described with respect to the post-processing entity 41 may be implemented by the same device that includes the video encoder 100. In one example, the post-processing entity 41 is an example of the storage device 40 of FIG. 1A.

[0101] Video encoder 100 may encode a video picture block, e.g., perform inter prediction on a video picture block, based on any new inter prediction mode in the set of candidate inter prediction modes proposed herein, including modes 0, 1, 2, ..., 10.

[0102] In the example of FIG. 2A , video encoder 100 includes prediction processing unit 108, filter unit 106, decoded picture buffer (DPB) 107, summing unit 114, transform unit 101, quantization unit 102, and entropy encoding unit 103. Prediction processing unit 108 includes inter prediction unit 110 and intra prediction unit 109. For picture block reconstruction, video encoder 100 further includes inverse quantization unit 104, inverse transform unit 105, and summing unit 113. Filter unit 106 is intended to represent one or more loop filter units, such as a deblocking filter unit, an adaptive loop filter (ALF) unit, and a sample adaptive offset (SAO) filter unit. Although filter unit 106 is shown as an in-loop filter in FIG. 2A , in another implementation, filter unit 106 may be implemented as a post-filter. In one example, the video encoder 100 may further include a video data storage unit and a splitting unit (not shown).

[0103] The video data storage unit can store video data encoded by components of the video encoder 100. The video data stored in the video data storage unit can be obtained from the video source 120. The DPB 107 can be a reference picture storage unit that stores reference video data used by the video encoder 100 to encode video data in intra- or inter-coding modes. The video data storage unit and the DPB 107 can each include one of multiple storage unit devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or another type of storage unit device. The video data storage unit and the DPB 107 can be provided by the same storage unit device or separate storage unit devices. In various examples, the video data storage unit can be integrated on a chip with other components of the video encoder 100 or can be located off-chip relative to those components.

[0104] As shown in FIG. 2A , video encoder 100 receives video data and stores it in a video data storage unit. A partitioning unit divides the video data into several picture blocks, which may be further divided into smaller blocks. For example, picture block partitioning based on a quadtree structure or a binary tree structure is performed. The partitioning may further include dividing the video data into slices, tiles, or other larger units. Video encoder 100 is typically a component for encoding picture blocks within a video slice to be encoded. A slice may be divided into multiple picture blocks (or groups of picture blocks called tiles). Prediction processing unit 108 may select one of several possible coding modes to be used for the current picture block, such as one of several intra-coding modes or one of several inter-coding modes. The multiple inter-coding modes may include, but are not limited to, one or more of modes 0, 1, 2, 3, ..., 10 proposed herein. Prediction processing unit 108 may provide the resulting intra-coded and inter-coded blocks to summation unit 114 to generate residual blocks, which may then be provided to summation unit 113 to reconstruct encoded blocks to be used as reference pictures.

[0105] Intra prediction unit 109 in prediction processing unit 108 may perform intra predictive encoding on the current picture block based on one or more neighboring blocks in the same frame or slice as the current block to be encoded to remove spatial redundancy. Inter prediction unit 110 in prediction processing unit 108 may perform inter predictive encoding on the current picture block based on one or more predictive blocks in one or more reference pictures to remove temporal redundancy.

[0106] Specifically, the inter prediction unit 110 may be configured to determine the inter prediction mode to be used to encode the current picture block. For example, the inter prediction unit 110 may calculate rate-distortion values ​​of various inter prediction modes in a set of candidate inter prediction modes through rate-distortion analysis and select an inter prediction mode with optimal rate-distortion characteristics from the inter prediction modes. The rate-distortion analysis is typically used to determine the amount of distortion (or error) between an encoded block and an original block that is not encoded and that must be encoded to generate the encoded block, as well as the bitrate (i.e., the amount of bits) to be used to generate the encoded block. For example, the inter prediction unit 110 may determine the inter prediction mode to be used to encode the current picture block that has the lowest rate-distortion cost as the inter prediction mode to be used to perform inter prediction on the current picture block. The following describes in detail an inter-prediction encoding process, particularly a process of predicting motion information of one or more sub-blocks (specifically, each sub-block or all sub-blocks) in a current picture block in an affine mode (e.g., an advanced motion vector prediction mode based on affine transformation or a merged prediction mode based on affine transformation) in the present application. In other words, the following describes in detail a motion vector prediction process based on a motion model, for example, a four-parameter affine model or a six-parameter affine model.

[0107] The inter prediction unit 110 is configured to predict motion information (e.g., motion vectors) of one or more sub-blocks in the current picture block based on the determined inter prediction mode, and obtain or generate a prediction block for the current picture block using the motion information (e.g., motion vectors) of one or more sub-blocks in the current picture block. The inter prediction unit 110 can locate the prediction block to which the motion vector points in a reference picture in a reference picture list. The inter prediction unit 110 can further generate syntax elements related to the picture block and the video slice, so that the video decoder 200 can use the syntax elements to decode the picture block of the video slice. Alternatively, in one example, the inter prediction unit 110 performs a motion compensation process using the motion information of each sub-block to generate a prediction block for each sub-block, thereby obtaining a prediction block for the current picture block. It should be understood here that the inter prediction unit 110 specifically includes a motion estimation unit 111 and a motion compensation unit 112. The motion estimation unit 111 is configured to perform a motion estimation (ME) process, and the motion compensation unit 112 is configured to perform a motion compensation (MC) process.

[0108] Specifically, after selecting the inter prediction mode for the current picture block, the inter prediction unit 110 may provide information indicating the selected inter prediction mode of the current picture block to the entropy encoding unit 103, so that the entropy encoding unit 103 encodes the information indicating the selected inter prediction mode. The intra prediction unit 109 may perform intra prediction on the current picture block. Specifically, the intra prediction unit 109 may determine the intra prediction mode to be used to encode the current block. For example, the intra prediction unit 109 may calculate rate-distortion values ​​of various intra prediction modes to be tested through rate-distortion analysis and select an intra prediction mode with optimal rate-distortion characteristics from the tested modes. In either case, after selecting the intra prediction mode for the picture block, the intra prediction unit 109 may provide information indicating the selected intra prediction mode of the current picture block to the entropy encoding unit 103, so that the entropy encoding unit 103 encodes the information indicating the selected intra prediction mode.

[0109] After prediction processing unit 108 generates a prediction block for a current picture block through inter-prediction and intra-prediction, video encoder 100 subtracts the prediction block from the current picture block to be encoded to form a residual picture block. Addition unit 114 represents one or more components that perform the subtraction operation. The residual video data in the residual block may be included in one or more TUs for use by transform unit 101. Transform unit 101 converts the residual video data into residual transform coefficients through a transform, such as a discrete cosine transform (DCT) or a conceptually similar transform. Transform unit 101 may convert the residual video data from the sample-value domain to a transform domain, such as the frequency domain.

[0110] The transform unit 101 may send the resulting transform coefficients to the quantization unit 102, which quantizes the transform coefficients to further reduce the bit rate. In some examples, the quantization unit 102 may further scan the matrix containing the quantized transform coefficients. Alternatively, the entropy encoding unit 103 may perform the scanning.

[0111] After quantization, entropy encoding unit 103 performs entropy encoding on the quantized transform coefficients. For example, entropy encoding unit 103 may perform context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or other entropy encoding methods or techniques. After entropy encoding unit 103 performs entropy encoding, the encoded bitstream may be transmitted to video decoder 200 or archived for subsequent transmission or retrieval by video decoder 200. Entropy encoding unit 103 may further perform entropy encoding on syntax elements of the current picture block to be encoded.

[0112] The inverse quantization unit 104 and the inverse transform unit 105 apply inverse quantization and inverse transform, respectively, to reconstruct a residual block in the sample domain for subsequent use, e.g., as a reference block in a reference picture. The addition unit 113 adds the reconstructed residual block to a prediction block generated by the inter prediction unit 110 or the intra prediction unit 109 to generate a reconstructed picture block. The filter unit 106 can be applied to the reconstructed picture block to reduce distortions, such as blocking artifacts. The reconstructed picture block is then stored as a reference block in the decoded picture buffer 107 and can be used as a reference block by the inter prediction unit 110 to perform inter prediction on blocks in a subsequent video frame or picture.

[0113] It should be understood that other structural variations of the video encoder 100 may be used to encode the video stream. For example, for some picture blocks or picture frames, the video encoder 100 may directly quantize the residual signal. In this case, processing by the transform unit 101 and the inverse transform unit 105 is not required. Alternatively, for some picture blocks or picture frames, the video encoder 100 does not generate residual data. In this case, processing by the transform unit 101, the quantization unit 102, the inverse quantization unit 104, and the inverse transform unit 105 is not required. Alternatively, the video encoder 100 may directly store the reconstructed picture block as a reference block, and processing by the filter unit 106 is not required. Alternatively, the quantization unit 102 and the inverse quantization unit 104 in the video encoder 100 may be combined. The loop filter unit is optional. Also, for lossless compression encoding, the transform unit 101, the quantization unit 102, the inverse quantization unit 104, and the inverse transform unit 105 are optional. It should be understood that in different application scenarios, the inter prediction unit and the intra prediction unit may be selectively enabled. In this solution, the inter prediction unit is enabled.

[0114] 2B is a block diagram of an exemplary video decoder 200 according to an embodiment of the present application. In the example of FIG. 2B, the video decoder 200 includes an entropy decoding unit 203, a prediction processing unit 208, an inverse quantization unit 204, an inverse transform unit 205, a summing unit 211, a filter unit 206, and a decoded picture buffer 207. The prediction processing unit 208 may include a motion compensation unit 210 (also referred to as an inter prediction unit) 210 and an intra prediction unit 209. In some examples, the video decoder 200 may perform a decoding process that is substantially the reverse of the encoding process described with respect to the video encoder 100 in FIG. 2A.

[0115] During decoding, video decoder 200 receives an encoded video bitstream representing picture blocks and associated syntax elements of encoded video slices from video encoder 100. Video decoder 200 may also receive video data from network entity 42 and, optionally, may further store the video data in a video data storage unit (not shown). The video data storage unit may store video data, such as an encoded video bitstream, to be decoded by components of video decoder 200. The video data stored in the video data storage unit may be obtained from storage device 40 or a local video source, such as a camera, through wired or wireless network communication of video data, or by accessing a physical data storage medium. The video data storage unit may be used as a decoded picture buffer (DPB) configured to store encoded video data from the encoded video bitstream. 2B , the video data storage unit and DPB 207 may be the same storage unit or may be separately located storage units. The video data storage unit and DPB 207 may each include one of a number of storage unit devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or another type of storage unit device. In various examples, the video data storage unit may be integrated on-chip with other components of video decoder 200 or may be located off-chip relative to those components.

[0116] Network entity 42 may be, for example, a server, a MANE, a video editor / splitter, or another device configured to implement one or more of the techniques described above. Network entity 42 may or may not include a video encoder, e.g., video encoder 100. Before network entity 42 sends the encoded video bitstream to video decoder 200, network entity 42 may implement some of the techniques described herein. In some video decoding systems, network entity 42 and video decoder 200 may be components of separate devices. In other cases, the functionality described with respect to network entity 42 may be implemented by the same device that includes video decoder 200. In some cases, network entity 42 may be an example of storage device 40 in FIG. 1A.

[0117] The entropy decoding unit 203 of the video decoder 200 performs entropy decoding on the bitstream to generate quantized coefficients and some syntax elements. The entropy decoding unit 203 forwards the syntax elements to the prediction processing unit 208. The video decoder 200 may receive the syntax element(s) at the video slice level and / or the picture block level.

[0118] When a video slice is decoded into an intra-decoded (I) slice, intra prediction unit 209 of prediction processing unit 208 may generate a prediction block for a picture block of the current video slice based on the signaled intra prediction mode and data of a previously decoded block of the current frame or picture. When a video slice is decoded into an inter-decoded (i.e., B or P) slice, inter prediction unit 210 of prediction processing unit 208 may determine an inter prediction mode to be used to decode the current picture block of the current video slice based on the syntax element received from entropy decoding unit 203 and decode the current picture block (e.g., perform inter prediction on the current picture block) based on the determined inter prediction mode. Specifically, motion information for the current picture block or a sub-block of the current picture block of the current video slice is predicted based on the inter prediction mode (e.g., the inter prediction mode specified by the syntax element or the default inter prediction mode). In this way, a predictive block of a sub-block of the current picture block or a predictive block of the current picture block is obtained or generated using predicted motion information of the current picture block or a sub-block of the current picture block in a motion compensation process. The motion information here may include reference picture information and a motion vector. The reference picture information may include, but is not limited to, unidirectional / bidirectional prediction information, a reference picture list number, and a reference picture index corresponding to the reference picture list. For inter-prediction, the predictive block may be generated from one of the reference pictures in one of the reference picture lists. The video decoder 200 may construct the reference picture lists, i.e., List 0 and List 1, based on the reference pictures stored in the DPB 207.The reference frame index of the current picture may be included in one or both of Reference Frame List 0 and Reference Frame List 1. It should be understood that the inter prediction unit 210 performs a motion compensation process. The following describes in detail the inter prediction process for predicting motion information of a current picture block or a sub-block of the current picture block using motion information of a reference block in various new inter prediction modes. The following describes in detail the process for predicting motion information of one or more sub-blocks (specifically, each sub-block or all sub-blocks) in a current picture block in an affine mode (e.g., an advanced motion vector prediction mode based on an affine transformation or a merged prediction mode based on an affine transformation) in the present application. In other words, the following describes in detail the motion vector prediction process based on a motion model, for example, a four-parameter affine model or a six-parameter affine model.

[0119] Inverse quantization unit 204 performs inverse quantization, i.e., dequantization, on the quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit 203. The inverse quantization process may include determining the degree of quantization to be applied by using quantization parameters calculated by video encoder 100 for each picture block in the video slice, and similarly determining the degree of inverse quantization to be applied. Inverse transform unit 205 applies an inverse transform, e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process, to the transform coefficients, producing residual blocks in the sample domain.

[0120] After inter prediction unit 210 generates a predictive block to be used for the current picture block or a sub-block of the current picture block, video decoder 200 adds the residual block from inverse transform unit 205 and the corresponding predictive block generated by inter prediction unit 210 to obtain a reconstructed block, i.e., a decoded picture block. Addition unit 211 represents a component that performs the addition operation. If necessary, a loop filter unit may be further used (in or after the decoding loop) to smooth samples or otherwise improve video quality. Filter unit 206 may represent one or more loop filter units, such as a deblocking filter unit, an adaptive loop filter (ALF) unit, and a sample adaptive offset (SAO) filter unit. Although filter unit 206 is shown in FIG. 2B as an in-loop filter unit, in another implementation, filter unit 206 may be implemented as a post-loop filter unit. In one example, filter unit 206 can apply block reconstruction to reduce blockiness, and the result is output as a decoded video stream. Additionally, decoded picture blocks within a given frame or picture may be further stored in decoded picture buffer 207, which stores reference pictures used for subsequent motion compensation. Decoded picture buffer 207 may be part of a storage unit and may also store decoded video for subsequent presentation on a display device (e.g., display device 220 in FIG. 1A), or may be separate from such a storage unit.

[0121] It should be understood that other structural variations of the video decoder 200 may be used to decode the encoded video bitstream. For example, the video decoder 200 may generate an output video stream without processing by the filter unit 206. Alternatively, for some picture blocks or picture frames, the entropy decode unit 203 of the video decoder 200 does not obtain quantized coefficients through decoding. In this case, processing by the inverse quantization unit 204 and the inverse transform unit 205 is not required. The loop filter unit is optional. Furthermore, for lossless compression, the inverse quantization unit 204 and the inverse transform unit 205 are optional. It should be understood that in different application scenarios, the inter prediction unit and the intra prediction unit may be selectively enabled. In this solution, the inter prediction unit is enabled.

[0122] FIG. 5A is an exemplary schematic diagram of motion information of a current picture block 600 and a reference block according to an embodiment of the present application. As shown in FIG. 5A, W and H are the width and height of the current picture block 600 and the width and height of the co-located block 600' of the current picture block 600. The reference blocks of the current picture block 600 include a spatial neighboring block above the current picture block 600, a spatial neighboring block to the left of the current picture block 600, a spatial neighboring block below the co-located block 600', and a spatial neighboring block to the right of the co-located block 600'. The co-located block 600' is a picture block in the reference picture that has the same size, shape, and coordinates as the current picture block 600. It should be noted that motion information for the spatial neighboring block below the current picture block and the spatial neighboring block to the right of the current picture block does not exist and is not encoded. It should be understood that the current picture block 600 and the co-located block 600' can have any block size. For example, the current picture block 600 and the co-located block 600' can include, but are not limited to, 16x16 samples, 32x32 samples, 32x16 samples, 16x32 samples, etc. As described above, each picture frame may be divided into picture blocks for encoding. These picture blocks may be further divided into smaller blocks. For example, the current picture block 600 and the co-located block 600' may be divided into multiple MxN sub-blocks. In other words, the size of each sub-block is MxN samples. Furthermore, the size of each reference block is also MxN samples, i.e., the same as the size of the sub-block of the current picture block. The coordinates in FIG. 5A are measured in MxN blocks. "MxN" and "M times N" may be used interchangeably to refer to the sample size of a picture block in the horizontal and vertical dimensions. In other words, there are M samples in the horizontal direction and N samples in the vertical direction, where M and N represent non-negative integer values.Furthermore, the number of samples in the horizontal direction and the number of samples in the vertical direction within a block do not necessarily have to be the same. For example, M=N=4 here. Of course, the size of the sub-blocks of the current picture block and the size of the reference block may alternatively be 8x8 samples, 8x4 samples, 4x8 samples, or the smallest prediction block size. Furthermore, the picture block described herein may be understood as, but is not limited to, a prediction unit (PU), a coding unit (CU), a transform unit (TU), etc. According to the provisions of various video compression coding standards, a CU may include one or more prediction units (PUs), or the size of a PU may be the same as the size of a CU. Picture blocks can have a fixed or variable size, and the size may vary depending on different video compression coding standards. Additionally, a current picture block is a picture block currently to be encoded or decoded, e.g., a prediction unit to be encoded or decoded.

[0123] In one example, the availability of each spatial neighboring block to the left of the current picture block 600 may be determined sequentially along direction 1, and the availability of each spatial neighboring block above the current picture block 600 may be determined sequentially along direction 2. For example, it is determined whether a neighboring block (also referred to as a reference block; herein, "neighboring block" and "reference block" may be used interchangeably) is inter-coded, and if the neighboring block exists and is inter-coded, the neighboring block is available, or if the neighboring block does not exist or is intra-coded, the neighboring block is unavailable. If the neighboring block is intra-coded, the motion information of another neighboring reference block is copied as the motion information of the neighboring block. The availability of spatial neighboring blocks below the co-located block 600' and to the right of the co-located block 600' is detected by using a similar method, and details will not be described here.

[0124] Also, if the size of the available reference block and the size of the sub-block of the current picture block are 4x4, the motion information of the available reference block can be directly fetched. If the size of the available reference block is, for example, 8x4 or 8x8, the motion information of the central 4x4 block of the available reference block can be fetched and used as the motion information of the available reference block. The coordinates of the upper left vertex of the central 4x4 block relative to the upper left vertex of the reference block are ((W / 4) / 2x4, (H / 4) / 2x4). The division operation here is an exact division operation. If M=8 and N=4, the coordinates of the upper left vertex of the central 4x4 block relative to the upper left vertex of the reference block are (4,0). Optionally, the motion information of the upper left 4x4 block of the reference block can be fetched instead and used as the motion information of the available reference block. However, the present application is not limited to this.

[0125] For ease of description, the following will use sub-block to represent an M×N sub-block and neighboring block to represent a neighboring M×N block for purposes of explanation.

[0126] Inter-prediction is an important step in the embodiment of the present application. From the decoder's perspective, inter-prediction is to search a reconstructed picture for a matching reference block for a currently coded block in a current picture. As shown in FIG. 5B, sample values ​​of samples in a reference block (e.g., reference block Fr1 or reference block Fr2) are used as predicted information or predicted values ​​("information" and "value" are not distinguished below) of sample values ​​of samples in a currently coded block Fc. This process is called motion estimation (ME). Also, motion information of the currently coded block is transmitted. From the decoder's perspective, motion information needs to be obtained through parsing during inter-prediction. Based on the obtained motion information, a reference block is determined in the reconstructed picture, and sample values ​​of samples in the block are used as predicted information. This process is called motion compensation (MC). The reconstructed information is obtained by combining predicted information and residual information and performing a filtering operation on the combined information. The idea in this application may be used in HEVC or other video encoding / decoding standards. The following describes the possible cases of inter prediction modes on the encoder side using an example where this idea is used in HEVC. The possible cases of inter prediction modes on the decoder side are similar, so no additional description is provided.

[0127] HEVC has two modes: Advanced Motion Vector Prediction (AMVP) and Merge. The following describes these two modes separately.

[0128] In AMVP mode, an affine candidate motion vector list is first constructed using the motion information of encoded blocks that are spatially or temporally neighboring the current coding block. Then, the optimal motion vector from the affine candidate motion vector list is determined as the motion vector predictor (MVP) of the current coding block. The rate-distortion cost is calculated using the formula (0-1). Here, J is the rate-distortion cost (RD cost), SAD is the sum of absolute differences (SAD) between the predicted sample value and the original sample value obtained through motion estimation using the candidate motion vector predictor, R is the bit rate, and λ is the Lagrange multiplier. The encoder side transfers the index value of the selected motion vector predictor in the affine candidate motion vector list and the reference frame index value to the decoder side. Furthermore, a motion search is performed in the neighborhood domain centered on the MVP to obtain the actual motion vector of the current coding block. The encoder side transfers the difference between the MVP and the actual motion vector (motion vector difference) to the decoder side. J=SAD+λR (0-1)

[0129] In merge mode, a candidate motion information list is first constructed using the motion information of encoded blocks spatially or temporally neighboring the current coding block. Then, the best motion information from the candidate motion information list is determined based on the rate-distortion cost and used as the motion information for the current coding block. The index value of the best motion information's position in the candidate motion information list (referred to as the merge index; the same applies below) is transmitted to the decoder. The spatial and temporal candidate motion information for the current coding block is shown in Figure 5C. The spatial candidate motion information comes from five spatial neighboring blocks (A0, A1, B0, B1, B2). If a neighboring block is unavailable or in intra-coding mode, the neighboring block is not added to the candidate motion information list. The temporal candidate motion information for the current coding block is obtained after the MV of the block at the corresponding position in the reference frame is scaled based on the picture order count (POC) of the reference frame and the current frame. It is first determined whether the block at position T in the reference frame is available. If that block is not available, the block at position C is selected.

[0130] In inter prediction in HEVC, all samples in a current coding block use the same motion information, and then motion compensation is performed based on the motion information to obtain predictors for the samples of the coding block. However, not all samples in a current coding block have the same motion characteristics. Using the same motion information may lead to inaccurate motion compensation prediction and more residual information.

[0131] Existing video coding standards use block-matching motion estimation based on a translational motion model, which assumes that the motion of all samples within a block is consistent. However, in the real world, there are diverse motions. Many objects, such as rotating objects, roller coasters that rotate in various directions, fireworks, and some stunts in movies, do not exhibit translational motion. For these moving objects, especially in UGC scenarios, coding efficiency is significantly affected when block motion compensation techniques based on the translational motion model in existing coding standards are used. Therefore, research on non-translational motion models has been conducted in the industry and by Huawei. In particular, in-depth research has been conducted on affine transformation-based motion models to further improve coding efficiency.

[0132] In prediction based on a non-translational motion model, the same motion model is used at the encoder and decoder sides to estimate the motion information of each sub-motion compensation unit in the current coding block, and motion compensation is performed based on the motion information of the sub-motion compensation unit to obtain a predicted block, thereby improving prediction efficiency. Commonly used motion models include a six-parameter affine model and a four-parameter affine transformation model.

[0133] The four-parameter affine transformation model is shown as Equation (0-2):

number

[0134] A four-parameter affine transformation model can be expressed by the motion vectors of two samples and their coordinates relative to the top-left sample of the current coding block. The samples used to express the motion model parameters are referred to as control points. If the sample at the top-left vertex (0,0) and the sample at the top-right vertex (W,0) are used as control points, the position coordinates (x0,y0) and motion vector (vx0,vy0) of the top-left control point of the current coding block and the position coordinates (x1,y1) and motion vector (vx1,vy1) of the top-right control point of the current coding block are first determined. Then, the motion information of each sub-motion compensation unit within the current coding block is derived according to Equations (0-3). Here, (x,y) are the coordinates of the sub-motion compensation unit relative to the top-left sample of the current coding block, and W is the width of the current coding block.

number

[0135] The six-parameter affine transformation model is shown as equations (0-4).

number

[0136] A six-parameter affine transformation model can be expressed by motion vectors of three samples and their coordinates relative to the top-left sample of the current coding block. When the sample at the top-left vertex (0,0), the sample at the top-right vertex (W,0), and the sample at the bottom-left vertex (0,H) are used as control points, the position coordinates (x0,y0) and motion vector (vx0,vy0) of the top-left control point of the current coding block, the position coordinates (x1,y1) and motion vector (vx1,vy1) of the top-right control point of the current coding block, and the position coordinates (x2,y2) and motion vector (vx2,vy2) of the bottom-left control point of the current coding block are first determined. Then, the motion information of each sub-motion compensation unit within the current coding block is derived according to Equations (0-5). Here, (x,y) are the coordinates of the sub-motion compensation unit relative to the top-left sample of the current coding block, and W and H are the width and height of the current coding block, respectively.

number

[0137] The eight-parameter bilinear model is shown as equations (0-6).

number

[0138] The eight-parameter bilinear model may be expressed by motion vectors of four samples and their coordinates relative to the top-left sample of the currently coded block. When the sample at the top-left vertex (0,0), the sample at the top-right vertex (W,0), the sample at the bottom-left vertex (0,H), and the sample at the bottom-right vertex (W,H) are used as control points, the position coordinates (x0,y0) and motion vector (vx0,vy0) of the top-left control point of the currently coded block, the position coordinates (x1,y1) and motion vector (vx1,vy1) of the top-right control point of the currently coded block, the position coordinates (x2,y2) and motion vector (vx2,vy2) of the bottom-left control point of the currently coded block, and the position coordinates (x3,y3) and motion vector (vx3,vy3) of the bottom-right control point of the currently coded block are first determined, and then the motion information of each sub-motion compensation unit in the currently coded block is derived according to Equations (0-7). Here, (x, y) are the coordinates of the sub-motion compensation unit relative to the top-left sample of the current coding block, and W and H are the width and height of the current coding block, respectively.

number

[0139] A coding block that is predicted using a non-translational motion model is called a non-translational coding block.

[0140] Typically, motion information for control points of non-translational coding blocks may be obtained by using an affine-transform-based advanced motion vector prediction (AMVP) mode or an affine-transform-based merge mode.

[0141] The following describes how to obtain the motion vector of the current coding block or the control point of the current coding block from the encoder's perspective and the decoder's perspective separately, using the motion information of two control points in a four-parameter affine transformation model as an example.

[0142] (1) Construct a candidate motion vector 2-tuple.

[0143] The motion vectors of the top-left control point and the top-right control point of the current coding block are determined based on the motion information of the neighboring encoded blocks of the current coding block. As shown in Figure 7B, the motion vectors of the top-left neighboring encoded blocks A, B, and C are used as candidate motion vectors for the motion vector of the top-left control point of the current coding block, and the motion vectors of the top-right neighboring encoded blocks D and E are used as candidate motion vectors for the motion vector of the top-right control point of the current coding block. The candidate motion vectors of the top-left control point and the candidate motion vectors of the top-right control point are combined to form a candidate motion vector 2-tuple queue for the two control points.

number

[0144] where v0 represents the candidate motion vector for the top-left control point, v1 represents the candidate motion vector for the top-right control point, and the position of the 2-tuple in the queue is indexed, with index values ​​0, 1, 2, 3, 4, and 5, respectively.

[0145] Optionally, the candidate motion vector 2-tuple queue may be pruned, sorted, truncated to a particular amount, or padded according to a particular rule.

[0146] (2) Determine the best candidate motion vector 2-tuple.

[0147] On the encoder side, a motion vector for each sub-motion compensation unit (a sample or an N1 × N2 sample block obtained through a specific division) in the current coding block is obtained based on each candidate motion vector 2-tuple according to Equation (3). The sample value at the position in the reference frame to which the motion vector of each sub-motion compensation unit points is then obtained. This sample value is used as a predictor to perform motion compensation based on an affine transformation. The average difference between the original values ​​of all samples in the current coding block and the predictor is calculated, and the motion vector in the candidate motion vector 2-tuple corresponding to the smallest average difference is selected as the motion vector predictor for two control points in the current coding block. An index representing the position of the 2-tuple in the candidate motion vector 2-tuple queue is encoded in the bitstream and sent to the decoder.

[0148] At the decoder side, the index is parsed to obtain the motion vector predictors for the two control points.

[0149] (3) Determine the motion vectors of the control points.

[0150] At the encoder side, the motion vector predictors of the two control points are used as starting search points to perform a motion search within a certain search range to obtain the motion vectors of the two control points. The difference between the motion vectors of the two control points and the motion vector predictors is transmitted to the decoder side.

[0151] At the decoder side, the motion vector difference of the two control points is parsed and added to the motion vector predictor to obtain the motion vector of the control point.

[0152] It should be noted that the currently mainstream motion model-based motion vector prediction method involves: tracing the neighboring blocks of the current coding block in the order of A, B, C, D, and E in FIG. 7A (as shown in FIG. 5D, neighboring blocks A, B, C, D, and E are distributed around the CTU 502 where the current coding block is located), finding an affine coding block, obtaining the motion vectors of the control points of the affine coding block, constructing a motion model based on the position coordinates and motion vectors of the control points of the affine coding block, and then substituting the position coordinates of the control points of the current coding block into the motion model to estimate the motion vector predictor of the control points of the current block. Specifically, the upper left control point and the upper right control point of the affine coding block are used to construct the motion model (sometimes information about the lower left control point is also used). FIG. 5D is used as an example. If neighboring block E is a neighboring affine coding block, the position coordinates and motion vector of the upper left control point of neighboring block E are:

number

number

number

number

number

number

[0153] FIG. 6 is a flowchart of a process 700 of an encoding method according to an embodiment of the present application. The process 700 may be performed by the video encoder 100, specifically, by the inter-prediction unit (also referred to as inter-predictor) 110 and the entropy encoding unit (also referred to as entropy encoder) 103 of the video encoder 100. The process 700 is described as a series of steps or operations. It should be understood that the steps or operations of the process 700 may be performed in various sequences and / or simultaneously and are not limited to the execution sequence shown in FIG. 6. A video data stream including multiple video frames is assumed to be used by the video encoder. If a first neighboring affine-coded block is located within a coding tree unit (CTU) above the current coding block, a group of candidate motion vector predictors is determined based on the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block. Corresponding to the process shown in FIG. 6, the relevant description is as follows.

[0154] Step S700: The video encoder determines an inter prediction mode for the current coding block.

[0155] Specifically, the inter prediction mode may be an advanced motion vector prediction (AMVP) mode or a merge mode.

[0156] If the determined inter prediction mode for the current coding block is the AMVP mode, steps S711 to S713 are executed.

[0157] If the determined inter prediction mode for the current coding block is the merge mode, steps S721 to S723 are executed.

[0158] AMVP mode:

[0159] Step S711: The video encoder constructs a candidate motion vector predictor MVP list.

[0160] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion vector predictor MVP list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion vector predictor MVP list may be a triplet candidate motion vector predictor MVP list or a 2-tuple candidate motion vector predictor MVP list. The two ways are specifically as follows:

[0161] Aspect 1: The candidate motion vector predictor MVP list is constructed using a motion model based motion vector prediction method.

[0162] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0163] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine-coded block. Further, the motion vectors of the control points of the current coding block are predicted based on the first affine model. The manner of predicting the motion vectors of the control points of the current coding block based on the motion vectors of the control points of the first neighboring affine-coded block varies depending on the parameter model of the current coding block. Therefore, the following provides a description of different cases.

[0164] A: The parameter model of the current coding block is a four-parameter affine transformation model. The derivation manner can be as follows:

[0165] If the first neighboring affine-coded block is located within a coding tree unit (CTU) above the current coding block, the motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0166] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors and position coordinates of the two bottom-most control points of the first neighboring affine-coded block.

[0167] The motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the upper left control point of the current coding block and the position coordinates of the upper right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the upper left control point of the current coding block and the motion vector of the upper right control point of the current coding block. Details are shown in equations (1) and (2).

number

[0168] In equations (1) and (2), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, and (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block.

[0169] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0170] In this case, in equations (1) and (2), (x7-x6) is equal to cuW, (vx7, vy7) may be obtained by reading the motion vector at position (x4+cuW-1, y4+cuH-1) in the picture, and (vx6, vy6) may be obtained by reading the motion vector at position (x4, y4+cuH-1) in the picture.

[0171] When the first neighboring affine-coded block is not located in a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.

[0172] B: The parameter model of the current coding block is a six-parameter affine transformation model. The derivation manner can be as follows:

[0173] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0174] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0175] The motion vectors of the control points of the currently coded block are predicted based on a first affine model. For example, the position coordinates of the upper left control point of the currently coded block, the position coordinates of the upper right control point of the currently coded block, and the position coordinates of the lower left control point of the currently coded block may be substituted into the first affine model to predict the motion vectors of the upper left control point of the currently coded block, the motion vectors of the upper right control point of the currently coded block, and the motion vectors of the lower left control point of the currently coded block. Details are shown in equations (1), (2), and (3).

number

[0176] Equations (1) and (2) are described above. In equations (1), (2), and (3), (x0, y0) are the coordinates of the upper-left control point of the current coding block, (x1, y1) are the coordinates of the upper-right control point of the current coding block, (x2, y2) are the coordinates of the lower-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the upper-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the upper-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the lower-left control point of the current coding block.

[0177] When the first neighboring affine-coded block is not located in a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.

[0178] Aspect 2: Candidate motion vector predictor The MVP list is constructed using a motion vector prediction method based on a combination of control points.

[0179] The manner in which the candidate motion vector predictor MVP list is constructed depends on the parameter model of the current coding block, as described in detail below.

[0180] A: The parameter model of the current coding block is a four-parameter affine transformation model. The derivation manner can be as follows:

[0181] The motion vectors of the top-left and top-right vertices of the currently coded block are estimated based on the motion information of the neighboring encoded blocks of the currently coded block. As shown in Figure 7B, first, the motion vector of the encoded block A and / or B and / or C neighboring the top-left vertex is used as the candidate motion vector for the motion vector of the top-left vertex of the currently coded block, and the motion vector of the encoded block D and / or E neighboring the top-right vertex is used as the candidate motion vector for the motion vector of the top-right vertex of the currently coded block. The candidate motion vector of the top-left vertex and the candidate motion vector of the top-right vertex may be combined to obtain a group of candidate motion vector predictors. The multiple records obtained through this combination may form a candidate motion vector predictor MVP list.

[0182] B: The parameter model of the current coding block is a 6-parameter affine transformation model. The derivation manner can be as follows:

[0183] The motion vectors of the top-left vertex, top-right vertex, and bottom-left vertex of the currently coded block are estimated based on the motion information of the encoded blocks neighboring the currently coded block. As shown in Figure 7B, first, the motion vector of the encoded blocks A and / or B and / or C neighboring the top-left vertex is used as the candidate motion vector for the motion vector of the top-left vertex of the currently coded block, the motion vector of the encoded blocks D and / or E neighboring the top-right vertex is used as the candidate motion vector for the motion vector of the top-right vertex of the currently coded block, and the motion vector of the encoded blocks F and / or G neighboring the bottom-left vertex is used as the candidate motion vector for the motion vector of the bottom-left vertex of the currently coded block. The candidate motion vectors of the top-left vertex, the top-right vertex, and the bottom-left vertex may be combined to obtain a group of candidate motion vector predictors. The multiple groups of candidate motion vector predictors obtained through this combination may form a candidate motion vector predictor MVP list.

[0184] It should be noted that the candidate motion vector predictor MVP list may be constructed using only candidate motion vector predictors predicted in aspect 1, or the candidate motion vector predictor MVP list may be constructed using only candidate motion vector predictors predicted in aspect 2, or the candidate motion vector predictor MVP list may be constructed using both candidate motion vector predictors predicted in aspect 1 and candidate motion vector predictors predicted in aspect 2. In addition, the candidate motion vector predictor MVP list may be further pruned and sorted according to a preconfigured rule, and then truncated or padded to a specific amount. If each group of candidate motion vector predictors in the candidate motion vector predictor MVP list includes motion vector predictors of three control points, the candidate motion vector predictor MVP list may be referred to as a triplet list; or, if each group of candidate motion vector predictors in the candidate motion vector predictor MVP list includes motion vector predictors of two control points, the candidate motion vector predictor MVP list may be referred to as a 2-tuple list.

[0185] Step S712: The video encoder determines a target candidate motion vector group in the candidate motion vector predictor MVP list according to a rate-distortion cost criterion. Specifically, for each candidate motion vector group in the candidate motion vector predictor MVP list, the motion vector of each subblock of the current block is calculated, and motion compensation is performed to obtain a predictor for each subblock to obtain a predictor for the current block. The candidate motion vector group with the smallest error between the predictor and the original value is selected as the optimal motion vector predictor group, i.e., the target candidate motion vector group. Furthermore, the determined target candidate motion vector group is used as the optimal candidate motion vector predictor for the group of control points, and the target candidate motion vector group corresponds to a unique index number in the candidate motion vector predictor MVP list.

[0186] Step S713: The video encoder encodes the motion vector difference MVD and an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0187] Specifically, the video encoder may use the target candidate motion vector group as a starting search point to further search for a group of control points with the lowest cost motion vector within a preset search range according to a rate-distortion cost criterion, and then determine a motion vector difference MVD between the target candidate motion vector group and the motion vector of the group of control points. For example, if the first group of control points includes a first control point and a second control point, it is necessary to determine a motion vector difference MVD between the motion vector of the first control point and the motion vector predictor represented by the target candidate motion vector group of the first control point in the group of control points, and a motion vector difference MVD between the motion vector of the second control point and the motion vector predictor represented by the target candidate motion vector group of the second control point in the group of control points.

[0188] Optionally, in addition to the above steps S711 to S713, steps S714 and S715 may be further executed in the AMVP mode.

[0189] Step S714: The video encoder obtains a motion vector of each sub-block of the current coding block according to the determined motion vector of the control point of the current coding block using the affine transformation model.

[0190] Specifically, the target candidate motion vector group and the new candidate motion vector group obtained based on the MVD include motion vectors for two control points (the upper-left control point and the upper-right control point) or three control points (e.g., the upper-left control point, the upper-right control point, and the lower-left control point). For each subblock of the current coding block (one subblock may be equivalent to one motion compensation unit), the motion information of a sample at a preset position within the motion compensation unit may be used to represent the motion information of all samples within the motion compensation unit. If the size of the motion compensation unit is M × N (M is less than or equal to the width W of the current coding block, N is less than or equal to the height H of the current coding block, and M, N, W, and H are positive integers, typically powers of two, e.g., 4, 8, 16, 32, 64, or 128), the sample at the preset position may be the center point (M / 2, N / 2) of the motion compensation unit, the upper-left sample (0, 0), the upper-right sample (M-1, 0), or a sample at another position. 8A shows a 4 x 4 motion compensation unit, and FIG. 8B shows an 8 x 8 motion compensation unit. The center points of the corresponding motion compensation units are represented by triangles.

[0191] The coordinates of the center point of the motion compensation unit relative to the sample at the top-left vertex of the current coding block are calculated according to equation (5), where i is the ith motion compensation unit in the horizontal direction (from left to right), j is the jth motion compensation unit in the vertical direction (from top to bottom), and (x (i,j) ,y (i,j) ) represents the coordinates of the center point of the (i,j)th motion compensation unit relative to the sample at the top-left control point of the current coding block. Then, based on the affine model type (6 parameters or 4 parameters) of the current coding block, (x (i,j) ,y (i,j) ) is substituted into the six-parameter affine model equation (6-1), or (x (i,j) ,y (i,j) ) is substituted into the four-parameter affine model equation (6-2) to obtain the motion information of the center point of each motion compensation unit, which is then used to calculate the motion vectors (vx(i,j) ,vy (i,j) ) is used as

number

[0192] Optionally, when the current coding block is a six-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a six-parameter affine model constructed using three control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a six-parameter affine model constructed using three control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinate (0,H) of the lower left corner of the current coding block into a six-parameter affine model (rather than substituting the coordinate of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinate (W,H) of the lower right corner of the current coding block into a six-parameter affine model (rather than substituting the coordinate of the center point of the subblock in the lower right corner into the affine model for calculation). In this way, when the motion vectors of the lower left control point and the motion vectors of the lower right control point of the current coding block are used (e.g., when candidate motion vector predictor MVP lists for other blocks are subsequently constructed based on the motion vectors of the lower left control point and the lower right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0193] Optionally, when the current coding block is a four-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a four-parameter affine model constructed using two control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinates (0,H) of the lower left corner of the current coding block into a four-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinates (W,H) of the lower right corner of the current coding block into a four-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower right corner into the affine model for calculation). In this way, when the motion vectors of the lower left control point and the motion vectors of the lower right control point of the current coding block are used (e.g., when candidate motion vector predictor MVP lists for other blocks are subsequently constructed based on the motion vectors of the lower left control point and the lower right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0194] Step S715: The video encoder performs motion compensation based on the motion vector of each sub-block of the current coding block to obtain a predicted sample value of each sub-block. For example, the video encoder finds a corresponding sub-block in the reference frame based on the motion vector of each sub-block and the reference frame index, and performs interpolation filtering to obtain a predicted sample value of each sub-block.

[0195] Merge Mode:

[0196] Step S721: The video encoder constructs a candidate motion information list.

[0197] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion information list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion information list is a triplet candidate motion information list. The two ways are specifically as follows:

[0198] Aspect 1: The candidate motion information list is constructed using a motion model-based motion vector prediction method.

[0199] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0200] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine coding block, and the motion vectors of the control points of the current coding block are predicted based on the first affine model.

[0201] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0202] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0203] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block, the position coordinates of the top-right control point of the current coding block, and the position coordinates of the bottom-left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block, the motion vectors of the top-right control point of the current coding block, and the motion vectors of the bottom-left control point of the current coding block. A candidate motion vector triplet is formed and added to a candidate motion information list. Details are shown in Equations (1), (2), and (3).

[0204] Optionally, the motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. A candidate motion vector 2-tuple is formed and added to a candidate motion information list. Details are shown in Equations (1) and (2).

[0205] In equations (1), (2), and (3), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0206] When the first neighboring affine-coded block is not located in a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.

[0207] Aspect 2: The candidate motion information list is constructed using a motion vector prediction method based on control point combinations.

[0208] Below are two solutions, denoted as Solution A and Solution B.

[0209] Solution A: The motion information of two control points of the current coding block is combined to construct a four-parameter affine transformation model. Two control points are combined as follows: {CP1,CP4}, {CP2,CP3}, {CP1,CP2}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4}. For example, a four-parameter affine transformation model constructed using control points CP1 and CP2 is denoted as Affine(CP1,CP2).

[0210] It should be noted that different combinations of control points can be transformed into control points at the same position. For example, a four-parameter affine transformation model obtained based on the combinations {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} is transformed to be represented by control points {CP1,CP2} or {CP1,CP2,CP3}. The transformation method is as follows: The motion vector and coordinate information of a control point are substituted into Equation (7) to obtain the model parameters. Then, the configuration information of {CP1,CP2} is substituted into the equation to obtain the motion vectors of {CP1,CP2}. These motion vectors are used as a group of candidate motion vector predictors.

number

[0211] In equation (7), a0, a1, a2, and a3 are all parameters in the parameter model, and (x, y) represent the position coordinates.

[0212] More directly, this transformation may be performed according to the following equations to obtain a group of motion vector predictors represented by the top-left control point and the top-right control point, and this group of motion vector predictors is added to the candidate motion information list:

[0213] Equation (8) for transforming {CP1,CP2} to {CP1,CP2,CP3} is:

number

[0214] Equation (9) for transforming {CP1,CP3} to {CP1,CP2,CP3} is as follows:

number

[0215] Equation (10) for converting {CP2,CP3} to {CP1,CP2,CP3} is as follows:

number

[0216] Equation (11) for transforming {CP1,CP4} to {CP1,CP2,CP3} is as follows:

number

[0217] Equation (12) for transforming {CP2,CP4} to {CP1,CP2,CP3} is as follows:

number

[0218] Equation (13) for converting {CP3,CP4} to {CP1,CP2,CP3} is as follows:

number

[0219] Solution B: The motion information of three control points of the current coding block is combined to construct a six-parameter affine transformation model. Three control points are combined as follows: {CP1,CP2,CP4}, {CP1,CP2,CP3}, {CP2,CP3,CP4}, or {CP1,CP3,CP4}. For example, a six-parameter affine transformation model constructed using control points CP1, CP2, and CP3 is denoted as Affine(CP1,CP2,CP3).

[0220] It should be noted that different combinations of control points can be transformed into control points at the same location. For example, a six-parameter affine transformation model obtained based on the combinations {CP1,CP2,CP4}, {CP2,CP3,CP4}, or {CP1,CP3,CP4} is transformed to be represented by the control points {CP1,CP2,CP3}. The transformation method is as follows: The motion vector and coordinate information of a control point are substituted into Equation (14) to obtain the model parameters. Then, the configuration information of {CP1,CP2,CP3} is substituted into the equation to obtain the motion vectors of {CP1,CP2,CP3}. These motion vectors are used as a group of candidate motion vector predictors.

number

[0221] In equation (14), a1, a2, a3, a4, a5, and a6 are parameters in the parameter model, and (x, y) represent the position coordinates.

[0222] More directly, this transformation may be performed according to the following equations to obtain a group of motion vector predictors represented by the top left control point, the top right control point, and the bottom left control point, and this group of motion vector predictors is added to the candidate motion information list.

[0223] Equation (15) converts {CP1,CP2,CP4} to {CP1,CP2,CP3} as follows:

number

[0224] Equation (16) converts {CP2,CP3,CP4} to {CP1,CP2,CP3} as follows:

number

[0225] Equation (17) converts {CP1,CP3,CP4} to {CP1,CP2,CP3} as follows:

number

[0226] It should be noted that the candidate motion information list may be constructed using only the candidate motion vector predictors predicted in aspect 1, or the candidate motion information list may be constructed using only the candidate motion vector predictors predicted in aspect 2, or the candidate motion information list may be constructed using both the candidate motion vector predictors predicted in aspect 1 and the candidate motion vector predictors predicted in aspect 2. Furthermore, the candidate motion information list may be further pruned and sorted according to a preconfigured rule, and then truncated or padded to a specific number. If each group of candidate motion vector predictors in the candidate motion information list includes motion vector predictors for three control points, the candidate motion information list may be referred to as a triplet list; or if each group of candidate motion vector predictors in the candidate motion information list includes motion vector predictors for two control points, the candidate motion information list may be referred to as a 2-tuple list.

[0227] Step S722: The video encoder determines a target candidate motion vector group in the candidate motion information list according to a rate-distortion cost criterion. Specifically, for each candidate motion vector group in the candidate motion information list, a motion vector for each sub-block of the current block is calculated, and motion compensation is performed to obtain a predictor for each sub-block to obtain a predictor for the current block. The candidate motion vector group with the smallest error between the predictor and the original value is selected as the optimal motion vector predictor group, i.e., the target candidate motion vector group. Furthermore, the determined target candidate motion vector group is used as the optimal candidate motion vector predictor for the group of control points, and the target candidate motion vector group corresponds to a unique index number in the candidate motion information list.

[0228] Step S723: The video encoder encodes an index corresponding to the target candidate motion vector group, a reference frame index, and an index corresponding to the prediction direction into a bitstream to be transmitted.

[0229] Optionally, in addition to the above steps S721 to S723, steps S724 and S725 may also be performed in the merge mode.

[0230] Step S724: The video encoder obtains motion vectors of each sub-block of the current coding block based on the determined motion vectors of the control points of the current coding block using the parameter-based affine transformation model.

[0231] Specifically, the target candidate motion vector group includes motion vectors for two control points (e.g., the upper-left control point and the upper-right control point) or three control points (e.g., the upper-left control point, the upper-right control point, and the lower-left control point). For each subblock of the current coding block (one subblock may be equivalent to one motion compensation unit), motion information of a sample at a preset position within the motion compensation unit may be used to represent motion information of all samples within the motion compensation unit. If the size of the motion compensation unit is M × N (M is equal to or less than the width W of the current coding block, N is equal to or less than the height H of the current coding block, and M, N, W, and H are positive integers, typically powers of two, e.g., 4, 8, 16, 32, 64, or 128), the sample at the preset position may be the center point (M / 2, N / 2) of the motion compensation unit, the top-left sample (0, 0), the top-right sample (M-1, 0), or a sample at another position. FIG. 8A shows a 4×4 motion compensation unit, and FIG. 8B shows an 8×8 motion compensation unit.

[0232] The coordinates of the center point of the motion compensation unit relative to the sample at the top-left vertex of the current coding block are calculated according to equation (5), where i is the ith motion compensation unit in the horizontal direction (from left to right), j is the jth motion compensation unit in the vertical direction (from top to bottom), and (x (i,j) ,y (i,j)) represents the coordinates of the center point of the (i,j)th motion compensation unit relative to the sample at the top-left control point of the current coding block. Then, based on the affine model type (6 parameters or 4 parameters) of the current coding block, (x (i,j) ,y (i,j) ) is substituted into the six-parameter affine model equation (6-1), or (x (i,j) ,y (i,j) ) is substituted into the four-parameter affine model equation (6-2) to obtain the motion information of the center point of each motion compensation unit, which is then used to calculate the motion vectors (vx (i,j) ,vy (i,j) ) is used as

[0233] Optionally, when the current coding block is a six-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a six-parameter affine model constructed using three control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a six-parameter affine model constructed using three control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinates (0,H) of the lower left corner of the current coding block into a six-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinates (W,H) of the lower right corner of the current coding block into a six-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower right corner into the affine model for calculation). In this way, when the motion vectors of the lower left control point and the motion vectors of the lower right control point of the current coding block are used (e.g., when candidate motion information lists for other blocks are subsequently constructed based on the motion vectors of the lower left control point and the lower right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0234] Optionally, when the current coding block is a four-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a four-parameter affine model constructed using two control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinates (0,H) of the lower left corner of the current coding block into a four-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinates (W,H) of the lower right corner of the current coding block into a four-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower right corner into the affine model for calculation). In this way, when the motion vectors of the lower left control point and the motion vectors of the lower right control point of the current coding block are used (e.g., when candidate motion information lists for other blocks are subsequently constructed based on the motion vectors of the lower left control point and the lower right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0235] Step S725: The video encoder performs motion compensation based on the motion vectors of each sub-block of the current coding block to obtain predicted sample values ​​of each sub-block. Specifically, the predicted sample values ​​of the current coding block are predicted based on the motion vectors of one or more sub-blocks of the current coding block, the reference frame index, and the prediction direction indicated by the index.

[0236] It can be understood that if the coding tree unit CTU in which the first neighboring affine-coded block is located is located above the current coding block, information about the bottommost control point of the first neighboring affine-coded block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine-coded block, the first group of control points includes the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block, instead of the fixed use of the top-left control point, the top-right control point, and the bottom-left control point of the first neighboring affine-coded block as the first group of control points in the prior art. Therefore, according to the method for determining the first group of control points in the present application, the information read from memory can be directly reused as information about the first group of control points (e.g., position coordinates and motion vectors), thereby reducing the number of times of reading from memory and improving encoding performance.

[0237] In another optional embodiment on the encoder side, if the first neighboring affine-coded block is located in a coding tree unit (CTU) above the current coding block, the group of candidate motion vector predictors is determined based on the lower-left control point and the lower-right control point of the first neighboring affine-coded block; or if the first neighboring affine-coded block is located in a CTU to the left of the current coding block, the group of candidate motion vector predictors is determined based on the upper-right control point and the lower-right control point of the first neighboring affine-coded block. Details are as follows.

[0238] Step S900: The video encoder determines the inter prediction mode of the current coding block.

[0239] Specifically, the inter prediction mode may be an advanced motion vector prediction (AMVP) mode or a merge mode.

[0240] If the determined inter prediction mode for the current coding block is the AMVP mode, steps S911 to S913 are executed.

[0241] If the determined inter prediction mode for the current coding block is the merge mode, steps S921 to S923 are executed.

[0242] AMVP mode:

[0243] Step S911: The video encoder constructs a candidate motion vector predictor MVP list.

[0244] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion vector predictor MVP list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion vector predictor MVP list may be a triplet candidate motion vector predictor MVP list or a 2-tuple candidate motion vector predictor MVP list. The two ways are specifically as follows:

[0245] Aspect 1: The candidate motion vector predictor MVP list is constructed using a motion model based motion vector prediction method.

[0246] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0247] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine-coded block. Further, the motion vectors of the control points of the current coding block are predicted based on the first affine model. The manner of predicting the motion vectors of the control points of the current coding block based on the motion vectors of the control points of the first neighboring affine-coded block varies depending on the parameter model of the current coding block. Therefore, the following provides a description of different cases.

[0248] A: The parameter model of the current coding block is a four-parameter affine transformation model. The derivation manner can be as follows:

[0249] If the first neighboring affine-coded block is located within a coding tree unit (CTU) above the current coding block, the motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0250] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors and position coordinates of the two bottom-most control points of the first neighboring affine-coded block.

[0251] The motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the upper left control point of the current coding block and the position coordinates of the upper right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the upper left control point of the current coding block and the motion vector of the upper right control point of the current coding block. Details are shown in equations (1) and (2).

[0252] In equations (1) and (2), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, and (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block.

[0253] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0254] In this case, in equations (1) and (2), (x7-x6) is equal to cuW, (vx7, vy7) may be obtained by reading the motion vector at position (x4+cuW-1, y4+cuH-1) in the picture, and (vx6, vy6) may be obtained by reading the motion vector at position (x4, y4+cuH-1) in the picture.

[0255] If the first neighboring affine-coded block is located within the left coding tree unit (CTU) of the current coding block, the motion vectors of the two rightmost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x5, y5) and motion vector (vx5, vy5) of the top-right control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0256] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors and position coordinates of the two rightmost control points of the first neighboring affine-coded block.

[0257] The motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the upper left control point of the current coding block and the position coordinates of the upper right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the upper left control point of the current coding block and the motion vector of the upper right control point of the current coding block. Details are shown in Equation (18) and Equation (19).

number

[0258] In equations (18) and (19), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, and (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block.

[0259] When the first neighboring affine-coded block is not located in a CTU above the current coding block and is not located in a CTU to the left of the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification.For example, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.In another example, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU to the left of the current coding block.

[0260] Optionally, the candidate motion vector predictor MVP list further includes a second candidate motion vector group, the second candidate motion vector group being obtained based on a second group of control points of a second neighboring Affine-coded block, wherein one or more control points in the second group of control points of the second neighboring Affine-coded block have positions relative to the second neighboring Affine-coded block that are different from positions of one or more control points in the first group of control points of the first neighboring Affine-coded block relative to the first neighboring Affine-coded block (e.g., the control points included in the first group of control points of the first neighboring Affine-coded block are the lower-left control point, the lower-right control point, and the upper-left control point of the first neighboring Affine-coded block, while the control points included in the second group of control points of the second neighboring Affine-coded block are the upper-right control point, the lower-right control point, and the lower-left control point of the second neighboring Affine-coded block).

[0261] B: The parameter model of the current coding block is a six-parameter affine transformation model. The derivation manner can be as follows:

[0262] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0263] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0264] The motion vectors of the control points of the currently coded block are predicted based on a first affine model. For example, the position coordinates of the upper left control point of the currently coded block, the position coordinates of the upper right control point of the currently coded block, and the position coordinates of the lower left control point of the currently coded block may be substituted into the first affine model to predict the motion vectors of the upper left control point of the currently coded block, the motion vectors of the upper right control point of the currently coded block, and the motion vectors of the lower left control point of the currently coded block. Details are shown in equations (1), (2), and (3).

[0265] In equations (1), (2), and (5), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0266] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0267] If the first neighboring affine-coded block is located within a CTU to the left of the current coding block, the position coordinates and motion vectors of the two rightmost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x5, y5) and motion vector (vx5, vy5) of the top-right control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0268] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0269] The motion vectors of the control points of the currently coded block are predicted based on a first affine model. For example, the position coordinates of the upper left control point of the currently coded block, the position coordinates of the upper right control point of the currently coded block, and the position coordinates of the lower left control point of the currently coded block may be substituted into the first affine model to predict the motion vectors of the upper left control point of the currently coded block, the motion vectors of the upper right control point of the currently coded block, and the motion vectors of the lower left control point of the currently coded block. Details are shown in equations (18), (19), and (20).

number

[0270] In equations (18), (19), and (20), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0271] When the first neighboring affine-coded block is not located in a CTU above the current coding block and not located in a CTU to the left of the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. For example, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block. As another example, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU to the left of the current coding block.

[0272] Optionally, the candidate motion vector predictor MVP list further includes a second candidate motion vector group, the second candidate motion vector group being obtained based on a second group of control points of a second neighboring Affine-coded block, wherein one or more control points in the second group of control points of the second neighboring Affine-coded block have positions relative to the second neighboring Affine-coded block that are different from positions of one or more control points in the first group of control points of the first neighboring Affine-coded block relative to the first neighboring Affine-coded block (e.g., the control points included in the first group of control points of the first neighboring Affine-coded block are the lower-left control point, the lower-right control point, and the upper-left control point of the first neighboring Affine-coded block, while the control points included in the second group of control points of the second neighboring Affine-coded block are the upper-right control point, the lower-right control point, and the lower-left control point of the second neighboring Affine-coded block).

[0273] Aspect 2: Candidate motion vector predictor The MVP list is constructed using a motion vector prediction method based on a combination of control points.

[0274] Specifically, the principle of the second aspect is the same as that of step S711, so the details will not be described again here.

[0275] Step S912: The video encoder determines a target candidate motion vector group in the candidate motion vector predictor MVP list according to a rate-distortion cost criterion.

[0276] For details, please refer to the description of step S712, and the details will not be described again here.

[0277] Step S913: The video encoder encodes the motion vector difference MVD and an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0278] For details, please refer to the description of step S713, and the details will not be explained again here.

[0279] Merge Mode:

[0280] Step S921: The video encoder constructs a candidate motion information list.

[0281] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion information list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion information list is a triplet candidate motion information list. The two ways are specifically as follows:

[0282] Aspect 1: The candidate motion information list is constructed using a motion model-based motion vector prediction method.

[0283] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0284] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine coding block, and the motion vectors of the control points of the current coding block are predicted based on the first affine model.

[0285] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0286] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0287] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block, the position coordinates of the top-right control point of the current coding block, and the position coordinates of the bottom-left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block, the motion vectors of the top-right control point of the current coding block, and the motion vectors of the bottom-left control point of the current coding block. A candidate motion vector triplet is formed and added to a candidate motion information list. Details are shown in Equations (1), (2), and (3).

[0288] Optionally, the motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. A candidate motion vector 2-tuple is formed and added to a candidate motion information list. Details are shown in Equations (1) and (2).

[0289] In equations (1), (2), and (3), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0290] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0291] If the first neighboring affine-coded block is located within a CTU to the left of the current coding block, the position coordinates and motion vectors of the two rightmost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x5, y5) and motion vector (vx5, vy5) of the top-right control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0292] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0293] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block, the position coordinates of the top-right control point of the current coding block, and the position coordinates of the bottom-left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block, the motion vectors of the top-right control point of the current coding block, and the motion vectors of the bottom-left control point of the current coding block. A candidate motion vector triplet is formed and added to a candidate motion information list. Details are shown in equations (18), (19), and (20).

[0294] Optionally, the motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. A candidate motion vector 2-tuple is formed and added to the candidate motion information list. Details are shown in equations (18) and (19).

[0295] In equations (18), (19), and (20), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0296] When the first neighboring affine-coded block is not located in a CTU above the current coding block and not located in a CTU to the left of the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. For example, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block. As another example, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU to the left of the current coding block.

[0297] Optionally, the candidate motion information list further includes a second group of candidate motion vectors, the second group of candidate motion vectors being obtained based on a second group of control points of a second neighboring Affine-coded block, wherein the positions of one or more control points in the second group of control points of the second neighboring Affine-coded block relative to the second neighboring Affine-coded block are different from the positions of one or more control points in the first group of control points of the first neighboring Affine-coded block relative to the first neighboring Affine-coded block (e.g., the control points included in the first group of control points of the first neighboring Affine-coded block are the lower-left control point, the lower-right control point, and the upper-left control point of the first neighboring Affine-coded block, while the control points included in the second group of control points of the second neighboring Affine-coded block are the upper-right control point, the lower-right control point, and the lower-left control point of the second neighboring Affine-coded block).

[0298] Aspect 2: The candidate motion information list is constructed using a motion vector prediction method based on a combination of control points.

[0299] Specifically, the principle of the second aspect is the same as that of step S721, so the details will not be described again here.

[0300] Step S922: The video encoder determines a target candidate motion vector group in the candidate motion information list according to a rate-distortion cost criterion.

[0301] For details, please refer to the description of step S722, and the details will not be described again here.

[0302] Step S923: The video encoder encodes an index corresponding to the target candidate motion vector group, an index corresponding to a reference frame index, and an index corresponding to a prediction direction into a bitstream to be transmitted.

[0303] For details, please refer to the description of step S723, and the details will not be described again here.

[0304] Step S924: The video encoder obtains a motion vector of each sub-block of the current coding block based on the motion vectors of the three control points of the current coding block using the six-parameter affine transformation model.

[0305] For details, please refer to the description of step S724, and the details will not be described again here.

[0306] Step S925: The video encoder performs motion compensation based on the motion vector of each sub-block of the current coding block to obtain predicted sample values ​​of each sub-block.

[0307] For details, please refer to the description of step S725, and the details will not be described again here.

[0308] It can be understood that if the coding tree unit CTU in which the first neighboring affine-coded block is located is located above the current coding block, information about the bottommost control point of the first neighboring affine-coded block is read from memory. If the coding tree unit CTU in which the first neighboring affine-coded block is located is located to the left of the current coding block, information about the rightmost control point of the first neighboring affine-coded block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine-coded block, the first group of control points are determined based on the relative position of the coding tree unit CTU with respect to the current coding block, instead of fixedly using the top-left control point, the top-right control point, and the bottom-left control point of the first neighboring coding block as the first group of control points in the prior art. Here, the first neighboring affine-coded block is located within the CTU. Therefore, according to the method for determining the first group of control points in the present application, the information read from memory can be directly reused as information about the first group of control points (e.g., position coordinates and motion vectors), thereby reducing the number of reads from memory and improving encoding performance.

[0309] In another optional embodiment on the encoder side, if the first neighboring affine-coded block is located in a coding tree unit (CTU) above the current coding block, the group of candidate motion vector predictors is determined based on the bottom-left control point, the bottom-right control point, and the top-right control point of the first neighboring affine-coded block.

[0310] Step S1000: The video encoder determines an inter-prediction mode for the current coding block.

[0311] Specifically, the inter prediction mode may be an advanced motion vector prediction (AMVP) mode or a merge mode.

[0312] If the determined inter prediction mode for the current coding block is the AMVP mode, steps S1011 to S1013 are executed.

[0313] If the determined inter prediction mode for the current coding block is the merge mode, steps S1021 to S1023 are executed.

[0314] AMVP mode:

[0315] Step S1011: The video encoder constructs a candidate motion vector predictor MVP list.

[0316] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion vector predictor MVP list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion vector predictor MVP list may be a triplet candidate motion vector predictor MVP list or a 2-tuple candidate motion vector predictor MVP list. The two ways are specifically as follows:

[0317] Aspect 1: The candidate motion vector predictor MVP list is constructed using a motion model based motion vector prediction method.

[0318] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0319] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine-coded block. Further, the motion vectors of the control points of the current coding block are predicted based on the first affine model. The manner of predicting the motion vectors of the control points of the current coding block based on the motion vectors of the control points of the first neighboring affine-coded block varies depending on the parameter model of the current coding block. Therefore, the following provides a description of different cases.

[0320] A: The parameter model of the current coding block is a four-parameter affine transformation model. The derivation manner can be as follows:

[0321] If the first neighboring affine-coded block is located within a coding tree unit (CTU) above the current coding block, the motion vectors of the top-left control point and the two bottom-most control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x4, y4) and motion vector (vx4, vy4) of the top-left control point of the first neighboring affine-coded block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0322] A first affine model (in this case, the first affine model obtained is a six-parameter affine model) is formed based on the position coordinates and motion vector of the upper left control point of the first neighboring affine coding block, the position coordinates and motion vector of the lower left control point of the first neighboring affine coding block, and the position coordinates and motion vector of the lower right control point of the first neighboring affine coding block.

[0323] The motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. Details are shown in Equations (21) and (22).

number

[0324] In equations (21) and (22), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, and (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block.

[0325] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0326] In this case, in equations (21) and (22), (x7-x6) is equal to cuW, (vx7, vy7) may be obtained by reading the motion vector at position (x4+cuW-1, y4+cuH-1) in the picture, and (vx6, vy6) may be obtained by reading the motion vector at position (x4, y4+cuH-1) in the picture.

[0327] When the first neighboring affine-coded block is not located within a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located within a CTU above the current coding block.

[0328] B: The parameter model of the current coding block is a six-parameter affine transformation model. The derivation manner can be as follows:

[0329] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the top-left control point and the two bottom-most control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x4, y4) and motion vector (vx4, vy4) of the top-left control point of the first neighboring affine-coded block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0330] A first affine model (in this case, the first affine model obtained is a six-parameter affine model) is formed based on the position coordinates and motion vector of the upper left control point of the first neighboring affine coding block, the position coordinates and motion vector of the lower left control point of the first neighboring affine coding block, and the position coordinates and motion vector of the lower right control point of the first neighboring affine coding block.

[0331] The motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the upper left control point of the current coding block, the position coordinates of the upper right control point of the current coding block, and the position coordinates of the lower left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the upper left control point of the current coding block, the motion vectors of the upper right control point of the current coding block, and the motion vectors of the lower left control point of the current coding block. Details are shown in Equations (21), (22), and (23).

number

[0332] In equations (21), (22), and (23), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0333] When the first neighboring affine-coded block is not located within a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located within a CTU above the current coding block.

[0334] Aspect 2: Candidate motion vector predictor The MVP list is constructed using a motion vector prediction method based on a combination of control points.

[0335] Specifically, the principle of the second aspect is the same as that of step S711, so the details will not be described again here.

[0336] Step S1012: The video encoder determines a target candidate motion vector group in the candidate motion vector predictor MVP list according to a rate-distortion cost criterion.

[0337] For details, please refer to the description of step S712, and the details will not be described again here.

[0338] Step S1013: The video encoder encodes the motion vector difference MVD and an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0339] For details, please refer to the description of step S713, and the details will not be explained again here.

[0340] Merge Mode:

[0341] Step S1021: The video encoder constructs a candidate motion information list.

[0342] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion information list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion information list is a triplet candidate motion information list. The two ways are specifically as follows:

[0343] Aspect 1: The candidate motion information list is constructed using a motion model-based motion vector prediction method.

[0344] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0345] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine coding block, and the motion vectors of the control points of the current coding block are predicted based on the first affine model.

[0346] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the top-left control point and the two bottom-most control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x4, y4) and motion vector (vx4, vy4) of the top-left control point of the first neighboring affine-coded block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0347] A first affine model (in this case, the first affine model obtained is a six-parameter affine model) is formed based on the position coordinates and motion vector of the upper left control point of the first neighboring affine coding block, the position coordinates and motion vector of the lower left control point of the first neighboring affine coding block, and the position coordinates and motion vector of the lower right control point of the first neighboring affine coding block.

[0348] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block, the position coordinates of the top-right control point of the current coding block, and the position coordinates of the bottom-left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block, the motion vectors of the top-right control point of the current coding block, and the motion vectors of the bottom-left control point of the current coding block. A candidate motion vector triplet is formed and added to a candidate motion information list. Details are shown in Equations (21), (22), and (23).

[0349] Optionally, the motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. A candidate motion vector 2-tuple is formed and added to the candidate motion information list. Details are shown in equations (21) and (22).

[0350] In equations (21), (22), and (23), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0351] When the first neighboring affine-coded block is not located within a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located within a CTU above the current coding block.

[0352] Aspect 2: The candidate motion information list is constructed using a motion vector prediction method based on a combination of control points.

[0353] Specifically, the principle of the second aspect is the same as that of step S721, so the details will not be described again here.

[0354] Step S1022: The video encoder determines a target candidate motion vector group in the candidate motion information list according to a rate-distortion cost criterion.

[0355] For details, please refer to the description of step S722, and the details will not be described again here.

[0356] Step S1023: The video encoder encodes an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0357] For details, please refer to the description of step S723, and the details will not be described again here.

[0358] It can be understood that if the coding tree unit CTU in which the first neighboring affine-coded block is located is located above the current coding block, information about the bottommost control point of the first neighboring affine-coded block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine-coded block, the first group of control points includes the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block, instead of the fixed use of the top-left control point, the top-right control point, and the bottom-left control point of the first neighboring affine-coded block as the first group of control points in the prior art. Therefore, according to the method for determining the first group of control points in the present application, the information read from memory can be directly reused as information about the first group of control points (e.g., position coordinates and motion vectors), thereby reducing the number of times of reading from memory and improving encoding performance.

[0359] In another optional embodiment on the encoder side, regardless of the position of the first neighboring affine coded block relative to the current coded block, the group of candidate motion vector predictors is determined directly based on the bottom-left control point and the bottom-right control point of the first neighboring affine coded block, as detailed below.

[0360] Step S1100: The video encoder determines an inter prediction mode of the current coding block.

[0361] Specifically, the inter prediction mode may be an advanced motion vector prediction (AMVP) mode or a merge mode.

[0362] If the determined inter prediction mode for the current coding block is the AMVP mode, steps S1111 to S1113 are executed.

[0363] If the determined inter prediction mode for the current coding block is the merge mode, steps S1121 to S1123 are executed.

[0364] AMVP mode:

[0365] Step S1111: The video encoder constructs a candidate motion vector predictor MVP list.

[0366] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion vector predictor MVP list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion vector predictor MVP list may be a triplet candidate motion vector predictor MVP list or a 2-tuple candidate motion vector predictor MVP list. The two ways are specifically as follows:

[0367] Aspect 1: The candidate motion vector predictor MVP list is constructed using a motion model based motion vector prediction method.

[0368] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0369] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine-coded block. Further, the motion vectors of the control points of the current coding block are predicted based on the first affine model. The manner of predicting the motion vectors of the control points of the current coding block based on the motion vectors of the control points of the first neighboring affine-coded block varies depending on the parameter model of the current coding block. Therefore, the following provides a description of different cases.

[0370] A: The parameter model of the current coding block is a four-parameter affine transformation model. The derivation manner can be as follows:

[0371] Regardless of the position of the first neighboring affine-coded block relative to the current coding block, the motion vectors of the top-left control point and the two bottom-most control points of the first neighboring affine-coded block can be directly obtained. For example, the position coordinates (x4, y4) and motion vector (vx4, vy4) of the top-left control point of the first neighboring affine-coded block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block can be obtained.

[0372] A first affine model (in this case, the first affine model obtained is a six-parameter affine model) is formed based on the position coordinates and motion vector of the upper left control point of the first neighboring affine coding block, the position coordinates and motion vector of the lower left control point of the first neighboring affine coding block, and the position coordinates and motion vector of the lower right control point of the first neighboring affine coding block.

[0373] The motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. Details are shown in Equations (21) and (22).

number

[0374] In equations (21) and (22), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, and (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block.

[0375] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve encoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0376] In this case, in equations (21) and (22), (x7-x6) is equal to cuW, (vx7, vy7) may be obtained by reading the motion vector at position (x4+cuW-1, y4+cuH-1) in the picture, and (vx6, vy6) may be obtained by reading the motion vector at position (x4, y4+cuH-1) in the picture.

[0377] Optionally, the candidate motion vector predictor MVP list further includes a second candidate motion vector group, which is obtained based on a second group of control points of a second neighboring affine coded block, and which second group of control points of the second neighboring affine coded block includes a bottom-left control point and a bottom-right control point of the second neighboring affine coded block.

[0378] B: The parameter model of the current coding block is a six-parameter affine transformation model. The derivation manner can be as follows:

[0379] Regardless of the position of the first neighboring affine-coded block relative to the current coding block, the position coordinates and motion vectors of the top-left control point and the two bottom-most control points of the first neighboring affine-coded block can be directly obtained. For example, the position coordinates (x4, y4) and motion vector (vx4, vy4) of the top-left control point of the first neighboring affine-coded block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block can be obtained.

[0380] A first affine model (in this case, the first affine model obtained is a six-parameter affine model) is formed based on the position coordinates and motion vector of the upper left control point of the first neighboring affine coding block, the position coordinates and motion vector of the lower left control point of the first neighboring affine coding block, and the position coordinates and motion vector of the lower right control point of the first neighboring affine coding block.

[0381] The motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the upper left control point of the current coding block, the position coordinates of the upper right control point of the current coding block, and the position coordinates of the lower left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the upper left control point of the current coding block, the motion vectors of the upper right control point of the current coding block, and the motion vectors of the lower left control point of the current coding block. Details are shown in Equations (21), (22), and (23).

[0382] In equations (21), (22), and (23), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0383] Optionally, the candidate motion vector predictor MVP list further includes a second candidate motion vector group, which is obtained based on a second group of control points of a second neighboring affine coded block, and which second group of control points of the second neighboring affine coded block includes a bottom-left control point and a bottom-right control point of the second neighboring affine coded block.

[0384] Aspect 2: Candidate motion vector predictor The MVP list is constructed using a motion vector prediction method based on a combination of control points.

[0385] Specifically, the principle of the second aspect is the same as that of step S711, so the details will not be described again here.

[0386] Step S1112: The video encoder determines a target candidate motion vector group in the candidate motion vector predictor MVP list according to a rate-distortion cost criterion.

[0387] For details, please refer to the description of step S712, and the details will not be described again here.

[0388] Step S1113: The video encoder encodes the motion vector difference MVD and an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0389] For details, please refer to the description of step S713, and the details will not be explained again here.

[0390] Merge Mode:

[0391] Step S1121: The video encoder constructs an affine candidate motion vector list.

[0392] Specifically, the video encoder uses an inter prediction unit (also referred to as an inter prediction module) to construct an affine candidate motion vector list (also referred to as a candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed affine candidate motion vector list is a triplet affine candidate motion vector list. The two ways are specifically as follows:

[0393] Aspect 1: The affine candidate motion vector list is constructed using a motion model-based motion vector prediction method.

[0394] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0395] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine coding block, and the motion vectors of the control points of the current coding block are predicted based on the first affine model.

[0396] Regardless of the position of the first neighboring affine-coded block relative to the current coding block, the position coordinates and motion vectors of the top-left control point and the two bottom-most control points of the first neighboring affine-coded block can be directly obtained. For example, the position coordinates (x4, y4) and motion vector (vx4, vy4) of the top-left control point of the first neighboring affine-coded block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block can be obtained.

[0397] A first affine model (in this case, the first affine model obtained is a six-parameter affine model) is formed based on the position coordinates and motion vector of the upper left control point of the first neighboring affine coding block, the position coordinates and motion vector of the lower left control point of the first neighboring affine coding block, and the position coordinates and motion vector of the lower right control point of the first neighboring affine coding block.

[0398] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block, the position coordinates of the top-right control point of the current coding block, and the position coordinates of the bottom-left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block, the motion vectors of the top-right control point of the current coding block, and the motion vectors of the bottom-left control point of the current coding block. A candidate motion vector triplet is formed and added to an affine candidate motion vector list. Details are shown in Equations (21), (22), and (23).

[0399] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block and the motion vectors of the top-right control point of the current coding block. A candidate motion vector 2-tuple is formed and added to an affine candidate motion vector list. Details are shown in equations (21) and (22).

[0400] In equations (21), (22), and (23), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0401] Optionally, the affine candidate motion vector list further includes a second candidate motion vector group, which is obtained based on a second group of control points of a second neighboring affine coded block, and which second group of control points of the second neighboring affine coded block includes a bottom-left control point and a bottom-right control point of the second neighboring affine coded block.

[0402] Aspect 2: The affine candidate motion vector list is constructed using a motion vector prediction method based on a combination of control points.

[0403] Specifically, the principle of the second aspect is the same as that of step S721, so the details will not be described again here.

[0404] Step S1122: The video encoder determines a target candidate motion vector group in the affine candidate motion vector list according to a rate-distortion cost criterion.

[0405] For details, please refer to the description of step S712, and the details will not be described again here.

[0406] Step S1123: The video encoder encodes an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

[0407] For details, please refer to the description of step S713, and the details will not be explained again here.

[0408] It can be understood that if the coding tree unit CTU in which the first neighboring affine-coded block is located is located above the current coding block, information about the bottommost control point of the first neighboring affine-coded block is read from memory. Therefore, in the above solution, in the process of constructing a candidate motion vector based on the first group of control points of the first neighboring affine-coded block, the first group of control points includes the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block, instead of the fixed use of the top-left control point, the top-right control point, and the bottom-left control point of the first neighboring affine-coded block as the first group of control points in the prior art. Therefore, according to the method for determining the first group of control points in the present application, it is highly likely that the information read from memory can be directly reused as information about the first group of control points (e.g., position coordinates and motion vectors), thereby reducing the number of times of reading from memory and improving encoding performance.

[0409] FIG. 9 is a flowchart of a process 900 of a decoding method according to an embodiment of the present application. Process 900 may be performed by video decoder 200, specifically, by inter-prediction unit (also referred to as inter-predictor) 210 and entropy decoding unit (also referred to as entropy decoder) 203 of video decoder 200. Process 900 is described as a series of steps or operations. It should be understood that the steps or operations of process 900 can be performed in various sequences and / or simultaneously and are not limited to the execution sequence shown in FIG. 9 . It is assumed that a video data stream including multiple video frames is being used by the video decoder. If a first neighboring affine-coded block is located within a coding tree unit (CTU) above the current coding block, a group of candidate motion vector predictors is determined based on the bottom-left control point and bottom-right control point of the first neighboring affine-coded block. Corresponding to the process shown in FIG. 9 , the relevant description is as follows:

[0410] In an optional decoder-side embodiment, if the first neighboring affine-coded block is located in a coding tree unit (CTU) above the current coding block, the group of candidate motion vector predictors is determined based on the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block.

[0411] Step S1200: The video decoder determines an inter prediction mode for the current coding block.

[0412] Specifically, the inter prediction mode may be an advanced motion vector prediction (AMVP) mode or a merge mode.

[0413] If the determined inter prediction mode for the current coding block is the AMVP mode, steps S1211 to S1216 are executed.

[0414] If the determined inter prediction mode for the current coding block is the merge mode, steps S1221 to S1225 are executed.

[0415] AMVP mode:

[0416] Step S1211: The video decoder builds a candidate motion vector predictor MVP list.

[0417] Specifically, the video decoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion vector predictor MVP list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion vector predictor MVP list may be a triplet candidate motion vector predictor MVP list or a 2-tuple candidate motion vector predictor MVP list. The two ways are specifically as follows:

[0418] Aspect 1: The candidate motion vector predictor MVP list is constructed using a motion model based motion vector prediction method.

[0419] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0420] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine-coded block. Further, the motion vectors of the control points of the current coding block are predicted based on the first affine model. The manner of predicting the motion vectors of the control points of the current coding block based on the motion vectors of the control points of the first neighboring affine-coded block varies depending on the parameter model of the current coding block. Therefore, the following provides a description of different cases.

[0421] A: The parameter model of the current coding block is a four-parameter affine transformation model, which can be derived as follows (shown in FIG. 9A):

[0422] If the first neighboring affine-coded block is located within a coding tree unit (CTU) above the current coding block, the motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained (step S1201).

[0423] A first affine model (in this case, the first affine model obtained is a four-parameter affine model) is formed based on the motion vectors and position coordinates of the two bottom-most control points of the first neighboring affine-coded block (step S1202).

[0424] The motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block and the motion vectors of the top-right control point of the current coding block. Details are shown in equations (1) and (2) (step S1203).

number

[0425] In equations (1) and (2), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, and (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block.

[0426] Optionally, both the position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block and the position coordinates (x7, y7) of the lower-right control point are calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine-coded block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine-coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine-coded block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine-coded block is the motion vector of the lower-left sub-block of the first neighboring affine-coded block, and the motion vector of the lower-right control point of the first neighboring affine-coded block is the motion vector of the lower-right sub-block of the first neighboring affine-coded block. In this case, it can be seen that the horizontal distance between the bottom-left control point and the bottom-right control point of the first neighboring affine-coded block is cuW, and the horizontal distance between the top-left control point and the top-right control point of the first neighboring affine-coded block is cuW. Since cuW is typically a power of two, a right-shift method can be used instead of a division operation in the process of deriving the motion vector of the control point of the current coding block to reduce implementation complexity. It can be seen that both the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point of the first neighboring affine-coded block are obtained through derivation rather than being read from memory. Therefore, this method can further reduce the number of reads from memory and improve decoding performance. In another optional solution, the position coordinates of the bottom-left control point and the position coordinates of the bottom-right control point can alternatively be pre-stored in memory and read from memory for use when needed.

[0427] In this case, in equations (1) and (2), (x7-x6) is equal to cuW, (vx7, vy7) may be obtained by reading the motion vector at position (x4+cuW-1, y4+cuH-1) in the picture, and (vx6, vy6) may be obtained by reading the motion vector at position (x4, y4+cuH-1) in the picture.

[0428] When the first neighboring affine-coded block is not located in a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.

[0429] B: The parameter model of the current coding block is a six-parameter affine transformation model. The derivation manner can be as follows:

[0430] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0431] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0432] The motion vectors of the control points of the currently coded block are predicted based on a first affine model. For example, the position coordinates of the upper left control point of the currently coded block, the position coordinates of the upper right control point of the currently coded block, and the position coordinates of the lower left control point of the currently coded block may be substituted into the first affine model to predict the motion vectors of the upper left control point of the currently coded block, the motion vectors of the upper right control point of the currently coded block, and the motion vectors of the lower left control point of the currently coded block. Details are shown in equations (1), (2), and (3).

number

[0433] Equations (1) and (2) are described above. In equations (1), (2), and (3), (x0, y0) are the coordinates of the upper-left control point of the current coding block, (x1, y1) are the coordinates of the upper-right control point of the current coding block, (x2, y2) are the coordinates of the lower-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the upper-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the upper-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the lower-left control point of the current coding block.

[0434] When the first neighboring affine-coded block is not located in a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.

[0435] Aspect 2: Candidate motion vector predictor The MVP list is constructed using a motion vector prediction method based on a combination of control points.

[0436] The manner in which the candidate motion vector predictor MVP list is constructed depends on the parameter model of the current coding block, as described in detail below.

[0437] A: The parameter model of the current coding block is a four-parameter affine transformation model. The derivation manner can be as follows:

[0438] The motion vectors of the top-left and top-right vertices of the currently coded block are estimated based on the motion information of the decoded blocks neighboring the currently coded block. As shown in Figure 7B, first, the motion vectors of the decoded blocks A and / or B and / or C neighboring the top-left vertex are used as candidate motion vectors for the motion vector of the top-left vertex of the currently coded block, and the motion vectors of the decoded blocks D and / or E neighboring the top-right vertex are used as candidate motion vectors for the motion vector of the top-right vertex of the currently coded block. The candidate motion vectors of the top-left vertex and the candidate motion vectors of the top-right vertex may be combined to obtain a group of candidate motion vector predictors. The multiple records obtained through this combination may form a candidate motion vector predictor MVP list.

[0439] B: The parameter model of the current coding block is a 6-parameter affine transformation model. The derivation manner can be as follows:

[0440] The motion vectors of the top-left vertex, top-right vertex, and bottom-left vertex of the currently coded block are estimated based on the motion information of the decoded blocks neighboring the currently coded block. As shown in Figure 7B, first, the motion vector of the decoded blocks A and / or B and / or C neighboring the top-left vertex is used as the candidate motion vector for the motion vector of the top-left vertex of the currently coded block, the motion vector of the decoded blocks D and / or E neighboring the top-right vertex is used as the candidate motion vector for the motion vector of the top-right vertex of the currently coded block, and the motion vector of the decoded blocks F and / or G neighboring the bottom-left vertex is used as the candidate motion vector for the motion vector of the bottom-left vertex of the currently coded block. The candidate motion vector of the top-left vertex, the candidate motion vector of the top-right vertex, and the candidate motion vector of the bottom-left vertex may be combined to obtain a group of candidate motion vector predictors. The multiple groups of candidate motion vector predictors obtained through the combination in this embodiment may constitute a candidate motion vector predictor MVP list.

[0441] It should be noted that the candidate motion vector predictor MVP list may be constructed using only candidate motion vector predictors predicted in aspect 1, or the candidate motion vector predictor MVP list may be constructed using only candidate motion vector predictors predicted in aspect 2, or the candidate motion vector predictor MVP list may be constructed using both candidate motion vector predictors predicted in aspect 1 and candidate motion vector predictors predicted in aspect 2. In addition, the candidate motion vector predictor MVP list may be further pruned and sorted according to a preconfigured rule, and then truncated or padded to a specific amount. If each group of candidate motion vector predictors in the candidate motion vector predictor MVP list includes motion vector predictors of three control points, the candidate motion vector predictor MVP list may be referred to as a triplet list; or, if each group of candidate motion vector predictors in the candidate motion vector predictor MVP list includes motion vector predictors of two control points, the candidate motion vector predictor MVP list may be referred to as a 2-tuple list.

[0442] Step S1212: The video decoder parses the bitstream to obtain an index and a motion vector differential MVD.

[0443] Specifically, the video decoder may parse the bitstream using an entropy decoding unit, where the index is used to indicate a target candidate motion vector group for the current coding block, and the target candidate motion vector group represents a motion vector predictor for a group of control points of the current coding block.

[0444] Step S1213: The video decoder determines a target motion vector group in the candidate motion vector predictor MVP list based on the index.

[0445] Specifically, the target candidate motion vector group determined by the video decoder in the candidate motion vector predictor MVP list based on the index is used as the optimal candidate motion vector predictor (optionally, if the length of the candidate motion vector predictor MVP list is 1, there is no need to parse the bitstream to obtain the index, and the target motion vector group can be determined directly). The following briefly describes the optimal candidate motion vector predictor.

[0446] If the parameter model of the current coding block is a four-parameter affine transformation model, the best motion vector predictor for two control points is selected from the constructed candidate motion vector predictor MVP list. For example, the video decoder parses the bitstream to obtain index numbers, and then determines the best motion vector predictor for two control points in the 2-tuple candidate motion vector predictor MVP list based on the index numbers. Each group of candidate motion vector predictors in the candidate motion vector predictor MVP list corresponds to a different index number.

[0447] If the parameter model of the current coding block is a six-parameter affine transformation model, the optimal motion vector predictor for three control points is selected from the constructed candidate motion vector predictor MVP list. For example, the video decoder parses the bitstream to obtain index numbers, and then determines the optimal motion vector predictor for three control points in the triplet candidate motion vector predictor MVP list based on the index numbers. Each group of candidate motion vector predictors in the candidate motion vector predictor MVP list corresponds to a respective index number.

[0448] Step S1214: The video decoder determines the motion vector of the control point of the current coding block according to the target candidate motion vector group and the motion vector differential MVD obtained through parsing from the bitstream.

[0449] If the parameter model of the current coding block is a four-parameter affine transformation model, the motion vector differentials of the two control points of the current coding block are obtained through decoding from the bitstream, and a new candidate motion vector group is obtained based on the motion vector differentials of these control points and the target candidate motion vector group indicated by the index. For example, the motion vector differential MVD of the upper-left control point and the motion vector differential MVD of the upper-right control point are obtained through decoding from the bitstream, and are added to the motion vectors of the upper-left control point and the motion vectors of the upper-right control point in the target candidate motion vector group, respectively, to obtain a new candidate motion vector group. Thus, the new candidate motion vector group includes new motion vectors for the upper-left control point and the upper-right control point of the current coding block.

[0450] Optionally, by using a four-parameter affine transformation model, a motion vector of a third control point in the new candidate motion vector group may be further obtained based on the motion vectors of the two control points of the current coding block. For example, the motion vector (vx0, vy0) of the upper-left control point of the current coding block and the motion vector (vx1, vy1) of the upper-right control point of the current coding block are obtained. Then, the motion vector (vx2, vy2) of the lower-left control point (x2, y2) of the current coding block is obtained through calculation according to Equation (4).

number

[0451] Here, (x0, y0) is the position coordinate of the upper left control point, (x1, y1) is the position coordinate of the upper right control point, W is the width of the current coding block, and H is the height of the current coding block.

[0452] If the parameter model of the current coding block is a 6-parameter affine transformation model, the motion vector differentials of the three control points of the current coding block are decoded from the bitstream, and a new candidate motion vector group is obtained based on the motion vector differentials MVD of those control points and the target candidate motion vector group indicated by the index. For example, the motion vector differential MVD of the upper-left control point, the motion vector differential MVD of the upper-right control point, and the motion vector differential MVD of the lower-left control point are decoded from the bitstream and added to the motion vectors of the upper-left control point, the motion vector of the upper-right control point, and the motion vector of the lower-left control point in the target candidate motion vector group, respectively, to obtain a new candidate motion vector group. Thus, the new candidate motion vector group includes the motion vectors of the upper-left control point, the upper-right control point, and the lower-left control point of the current coding block.

[0453] Step S1215: The video decoder obtains the motion vectors of each sub-block of the current coding block according to the determined motion vectors of the control points of the current coding block using the affine transformation model.

[0454] Specifically, the new candidate motion vector group obtained based on the target candidate motion vector group and the MVD includes motion vectors for two control points (the upper-left control point and the upper-right control point) or three control points (e.g., the upper-left control point, the upper-right control point, and the lower-left control point). For each subblock of the current coding block (one subblock may be equivalent to one motion compensation unit), motion information of a sample at a preset position within the motion compensation unit may be used to represent motion information of all samples within the motion compensation unit. If the size of the motion compensation unit is M × N (M is equal to or less than the width W of the current coding block, N is equal to or less than the height H of the current coding block, and M, N, W, and H are positive integers, typically powers of two, e.g., 4, 8, 16, 32, 64, or 128), the sample at the preset position may be the center point (M / 2, N / 2) of the motion compensation unit, the upper-left sample (0, 0), the upper-right sample (M-1, 0), or a sample at another position. FIG. 8A shows a 4×4 motion compensation unit, and FIG. 8B shows an 8×8 motion compensation unit.

[0455] The coordinates of the center point of the motion compensation unit relative to the sample at the top-left vertex of the current coding block are calculated according to equation (5), where i is the ith motion compensation unit in the horizontal direction (from left to right), j is the jth motion compensation unit in the vertical direction (from top to bottom), and (x (i,j) ,y (i,j) ) represents the coordinates of the center point of the (i,j)th motion compensation unit relative to the sample at the top-left control point of the current coding block. Then, based on the affine model type (6 parameters or 4 parameters) of the current coding block, (x (i,j) ,y (i,j) ) is substituted into the six-parameter affine model equation (6-1), or (x (i,j) ,y (i,j) ) is substituted into the four-parameter affine model equation (6-2) to obtain the motion information of the center point of each motion compensation unit, which is then used to calculate the motion vectors (vx (i,j) ,vy (i,j)) is used as

number

[0456] Optionally, when the current coding block is a six-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a six-parameter affine model constructed using three control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a six-parameter affine model constructed using three control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinate (0,H) of the lower left corner of the current coding block into a six-parameter affine model (rather than substituting the coordinate of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinate (W,H) of the lower right corner of the current coding block into a six-parameter affine model (rather than substituting the coordinate of the center point of the subblock in the lower right corner into the affine model for calculation). In this way, when the motion vectors of the lower left control point and the motion vectors of the lower right control point of the current coding block are used (e.g., when candidate motion vector predictor MVP lists for other blocks are subsequently constructed based on the motion vectors of the lower left control point and the lower right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0457] Optionally, when the current coding block is a four-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a four-parameter affine model constructed using two control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinates (0,H) of the lower left corner of the current coding block into a four-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinates (W,H) of the lower right corner of the current coding block into a four-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower right corner into the affine model for calculation). In this way, when the motion vectors of the lower left control point and the motion vectors of the lower right control point of the current coding block are used (e.g., when candidate motion vector predictor MVP lists for other blocks are subsequently constructed based on the motion vectors of the lower left control point and the lower right control point of the current block), accurate values ​​are used instead of estimated values. W is the width of the current coding block, and H is the height of the current coding block.

[0458] Step S1216: The video decoder performs motion compensation based on the motion vector of each sub-block of the current coding block to obtain a predicted sample value of each sub-block. For example, based on the motion vector of each sub-block and the reference frame index, the corresponding sub-block is found in the reference frame, and interpolation filtering is performed to obtain a predicted sample value of each sub-block.

[0459] Merge Mode:

[0460] Step S1221: The video decoder builds a candidate motion information list.

[0461] Specifically, the video decoder uses an inter prediction unit (also referred to as an inter prediction module) to construct a candidate motion information list (also referred to as an affine candidate motion vector list). This construction may be performed in one of the following two ways or a combination of the two ways. The constructed candidate motion information list is a triplet candidate motion information list. The two ways are specifically as follows:

[0462] Aspect 1: The candidate motion information list is constructed using a motion model-based motion vector prediction method.

[0463] First, all or some neighboring blocks of a current coding block are traversed in a pre-specified order to determine neighboring affine-coded blocks among the neighboring blocks. There may be one or more determined neighboring affine-coded blocks. For example, neighboring blocks A, B, C, D, and E shown in FIG. 7A may be traversed sequentially to determine neighboring affine-coded blocks among the neighboring blocks A, B, C, D, and E. The inter-prediction unit determines a group of candidate motion vector predictors (each group of candidate motion vector predictors is a 2-tuple or triplet) based on at least one neighboring affine-coded block. The following uses one neighboring affine-coded block as an example for description. For ease of explanation, this neighboring affine-coded block is called the first neighboring affine-coded block. Details are as follows.

[0464] A first affine model is determined based on the motion vectors of the control points of a first neighboring affine coding block, and the motion vectors of the control points of the current coding block are predicted based on the first affine model.

[0465] If the first neighboring affine-coded block is located within a CTU above the current coding block, the position coordinates and motion vectors of the two bottommost control points of the first neighboring affine-coded block are obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine-coded block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine-coded block may be obtained.

[0466] A first affine model (in this case the resulting first affine model is a four-parameter affine model) is formed based on the motion vectors of the two bottom-most control points of the first neighboring affine-coded block.

[0467] Optionally, the motion vectors of the control points of the current coding block are predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block, the position coordinates of the top-right control point of the current coding block, and the position coordinates of the bottom-left control point of the current coding block may be substituted into the first affine model to predict the motion vectors of the top-left control point of the current coding block, the motion vectors of the top-right control point of the current coding block, and the motion vectors of the bottom-left control point of the current coding block. A candidate motion vector triplet is formed and added to a candidate motion information list. Details are shown in Equations (1), (2), and (3).

[0468] Optionally, the motion vector of the control point of the current coding block is predicted based on a first affine model. For example, the position coordinates of the top-left control point of the current coding block and the position coordinates of the top-right control point of the current coding block may be substituted into the first affine model to predict the motion vector of the top-left control point of the current coding block and the motion vector of the top-right control point of the current coding block. A candidate motion vector 2-tuple is formed and added to a candidate motion information list. Details are shown in Equations (1) and (2).

[0469] In equations (1), (2), and (3), (x0, y0) are the coordinates of the top-left control point of the current coding block, (x1, y1) are the coordinates of the top-right control point of the current coding block, (x2, y2) are the coordinates of the bottom-left control point of the current coding block, (vx0, vy0) are the predicted motion vectors of the top-left control point of the current coding block, (vx1, vy1) are the predicted motion vectors of the top-right control point of the current coding block, and (vx2, vy2) are the predicted motion vectors of the bottom-left control point of the current coding block.

[0470] When the first neighboring affine-coded block is not located in a CTU above the current coding block, the manner of predicting the motion vectors of the control points of the current coding block is not limited in this specification. Specifically, in this case, the manner of predicting the motion vectors of the control points of the current coding block may be the same as or different from the prediction manner used when the first neighboring affine-coded block is located in a CTU above the current coding block.

[0471] Aspect 2: The candidate motion information list is constructed using a motion vector prediction method based on control point combinations.

[0472] Below are two solutions, denoted as Solution A and Solution B.

[0473] Solution A: The motion information of two control points of the current coding block is combined to construct a four-parameter affine transformation model. Two control points are combined as follows: {CP1,CP4}, {CP2,CP3}, {CP1,CP2}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4}. For example, a four-parameter affine transformation model constructed using control points CP1 and CP2 is denoted as Affine(CP1,CP2).

[0474] It should be noted that different combinations of control points can be transformed into control points at the same position. For example, a four-parameter affine transformation model obtained based on the combinations {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} is transformed to be represented by control points {CP1,CP2} or {CP1,CP2,CP3}. The transformation method is as follows: The motion vector and coordinate information of a control point are substituted into Equation (7) to obtain the model parameters. Then, the configuration information of {CP1,CP2} is substituted into the equation to obtain the motion vectors of {CP1,CP2}. These motion vectors are used as a group of candidate motion vector predictors.

number

[0475] In equation (7), a0, a1, a2, and a3 are all parameters in the parameter model, and (x, y) represent the position coordinates.

[0476] More directly, this transformation may be performed according to the following equations to obtain a group of motion vector predictors represented by the top-left control point and the top-right control point, and this group of motion vector predictors is added to the candidate motion information list:

[0477] Equation (8) for transforming {CP1,CP2} to {CP1,CP2,CP3} is:

number

[0478] Equation (9) for transforming {CP1,CP3} to {CP1,CP2,CP3} is as follows:

number

[0479] Equation (10) for converting {CP2,CP3} to {CP1,CP2,CP3} is as follows:

number

[0480] Equation (11) for transforming {CP1,CP4} to {CP1,CP2,CP3} is as follows:

number

[0481] Equation (12) for transforming {CP2,CP4} to {CP1,CP2,CP3} is as follows:

number

[0482] Equation (13) for converting {CP3,CP4} to {CP1,CP2,CP3} is as follows:

number

[0483] Solution B: The motion information of three control points of the current coding block is combined to construct a six-parameter affine transformation model. Three control points are combined as follows: {CP1,CP2,CP4}, {CP1,CP2,CP3}, {CP2,CP3,CP4}, or {CP1,CP3,CP4}. For example, a six-parameter affine transformation model constructed using control points CP1, CP2, and CP3 is denoted as Affine(CP1,CP2,CP3).

[0484] It should be noted that different combinations of control points can be transformed into control points at the same location. For example, a six-parameter affine transformation model obtained based on the combinations {CP1,CP2,CP4}, {CP2,CP3,CP4}, or {CP1,CP3,CP4} is transformed to be represented by the control points {CP1,CP2,CP3}. The transformation method is as follows: The motion vector and coordinate information of a control point are substituted into Equation (14) to obtain the model parameters. Then, the configuration information of {CP1,CP2,CP3} is substituted into the equation to obtain the motion vectors of {CP1,CP2,CP3}. These motion vectors are used as a group of candidate motion vector predictors.

number

[0485] In equation (14), a1, a2, a3, a4, a5, and a6 are parameters in the parameter model, and (x, y) represent the position coordinates.

[0486] More directly, this transformation may be performed according to the following equations to obtain a group of motion vector predictors represented by the top left control point, the top right control point, and the bottom left control point, and this group of motion vector predictors is added to the candidate motion information list.

[0487] Equation (15) converts {CP1,CP2,CP4} to {CP1,CP2,CP3} as follows:

number

[0488] Equation (16) converts {CP2,CP3,CP4} to {CP1,CP2,CP3} as follows:

number

[0489] Equation (17) converts {CP1,CP3,CP4} to {CP1,CP2,CP3} as follows:

number

[0490] It should be noted that the candidate motion information list may be constructed using only the candidate motion vector predictors predicted in aspect 1, or the candidate motion information list may be constructed using only the candidate motion vector predictors predicted in aspect 2, or the candidate motion information list may be constructed using both the candidate motion vector predictors predicted in aspect 1 and the candidate motion vector predictors predicted in aspect 2. Furthermore, the candidate motion information list may be further pruned and sorted according to a preconfigured rule, and then truncated or padded to a specific number. If each group of candidate motion vector predictors in the candidate motion information list includes motion vector predictors for three control points, the candidate motion information list may be referred to as a triplet list; or if each group of candidate motion vector predictors in the candidate motion information list includes motion vector predictors for two control points, the candidate motion information list may be referred to as a 2-tuple list.

[0491] Step S1222: The video decoder parses the bitstream to obtain an index.

[0492] Specifically, the video decoder may parse the bitstream using an entropy decoding unit, and the index is used to indicate a target candidate motion vector group for the current coding block, where the target candidate motion vector group represents a motion vector predictor for a group of control points of the current coding block.

[0493] Step S1223: The video decoder determines a target motion vector group in the candidate motion information list based on the index.

[0494] Specifically, a target candidate motion vector group determined by the video decoder in the candidate motion vector predictor MVP list based on the index is used as the optimal candidate motion vector predictor (optionally, if the length of the candidate motion information list is 1, there is no need to parse the bitstream to obtain the index, and the target motion vector group can be determined directly). Specifically, the optimal candidate motion vector predictor is the optimal motion vector predictor for two or three control points. For example, the video decoder obtains an index number from the bitstream through parsing, and then determines the optimal motion vector predictor for two or three control points in the candidate motion information list based on the index number. Each group of candidate motion vector predictors in the candidate motion information list corresponds to a respective index number.

[0495] Step S1224: The video decoder obtains the motion vectors of each sub-block of the current coding block based on the determined motion vectors of the control points of the current coding block using the parameter-based affine transformation model.

[0496] Specifically, the target candidate motion vector group includes motion vectors for two control points (e.g., the upper-left control point and the upper-right control point) or three control points (e.g., the upper-left control point, the upper-right control point, and the lower-left control point). For each subblock of the current coding block (one subblock may be equivalent to one motion compensation unit), motion information of a sample at a preset position within the motion compensation unit may be used to represent motion information of all samples within the motion compensation unit. If the size of the motion compensation unit is M × N (M is less than or equal to the width W of the current coding block, N is less than or equal to the height H of the current coding block, and M, N, W, and H are positive integers, typically powers of two, e.g., 4, 8, 16, 32, 64, or 128), the sample at the preset position may be the center point (M / 2, N / 2) of the motion compensation unit, the top-left sample (0, 0), the top-right sample (M-1, 0), or a sample at another position. FIG. 8A shows a 4×4 motion compensation unit, and FIG. 8B shows an 8×8 motion compensation unit.

[0497] The coordinates of the center point of the motion compensation unit relative to the sample at the top-left vertex of the current coding block are calculated according to equation (5), where i is the ith motion compensation unit in the horizontal direction (from left to right), j is the jth motion compensation unit in the vertical direction (from top to bottom), and (x (i,j) ,y (i,j) ) represents the coordinates of the center point of the (i,j)th motion compensation unit relative to the sample at the top-left control point of the current coding block. Then, based on the affine model type (6 parameters or 4 parameters) of the current coding block, (x (i,j) ,y (i,j) ) is substituted into the six-parameter affine model equation (6-1), or (x (i,j) ,y (i,j) ) is substituted into the four-parameter affine model equation (6-2) to obtain the motion information of the center point of each motion compensation unit, which is then used to calculate the motion vectors (vx (i,j) ,vy (i,j) ) is used as

[0498] Optionally, when the current coding block is a six-parameter coding block and the motion vectors of one or more sub-blocks of the current coding block are obtained based on the target candidate motion vector group, if the bottom boundary of the current coding block overlaps with the bottom boundary of the CTU in which the current coding block is located, the motion vector of the sub-block at the lower left corner of the current coding block is obtained through calculation based on the position coordinates (0,H) of the lower left corner of the current coding block and a six-parameter affine model constructed using three control points, and the motion vector of the sub-block at the lower right corner of the current coding block is obtained through calculation based on the position coordinates (W,H) of the lower right corner of the current coding block and a six-parameter affine model constructed using three control points. For example, the motion vector of the subblock in the lower left corner of the current coding block is obtained by substituting the position coordinates (0,H) of the lower left corner of the current coding block into a six-parameter affine model (rather than substituting the coordinates of the center point of the subblock in the lower left corner into the affine model for calculation), and the motion vector of the subblock in the lower right corner of the current coding block is obtained by substituting the position coordinates (W,H) of the lower right corner of the current coding block int...

Claims

1. 1. A decoding method comprising: in response to an affine inter mode for the current coding block, Parsing the bitstream to obtain an index, which is used to indicate a target candidate motion vector group for a current coding block; determining a target candidate motion vector group in a candidate motion vector predictor list based on the index, the target candidate motion vector group representing a motion vector predictor of a group of control points of the current coding block, the candidate motion vector predictor list including at least a first candidate motion vector group, the first candidate motion vector group being obtained based on a first group of control points of a first neighboring affine coded block of the current coding block, the first group of control points of the first neighboring affine coded block being control points determined based on a relative position of a coding tree unit (CTU) with respect to the current coding block, the first neighboring affine coded block being located within the CTU; obtaining a new candidate motion vector group based on the motion vector difference MVD obtained from the bitstream through parsing and the target candidate motion vector group indicated by the index; obtaining motion vectors for one or more sub-blocks of the current coding block based on the new candidate motion vector group; predicting predicted sample values ​​of the currently coded block based on the motion vectors of the one or more sub-blocks of the currently coded block; method.

2. 2. The method of claim 1, further comprising generating the candidate motion vector predictor (MVP) list for the current coding block, wherein the candidate motion vector predictor list includes a plurality of candidate motion vector groups, the candidate motion vector group including the first candidate motion vector group and a third candidate motion vector group; the first neighboring affine coding block is the lowest coding block in the CTU, which is a first CTU, and the current coding block is the topmost coding block in a second coding tree unit (CTU); and the third candidate motion vector group is a candidate motion vector predictor of a group of control points of the current coding block obtained by combining candidate motion vectors of at least two control points of the current coding block.

3. The parametric model of the current coding block is a four-parameter affine model, and the first group of control points of the first neighboring affine coding block is determined in the following manner: When the first coding tree unit CTU and the second coding tree unit CTU are in an up-down relative positional relationship, the first group of control points of the first neighboring affine coding block is a bottom-left control point and a bottom-right control point of the first neighboring affine coding block; when the first coding tree unit CTU and the second coding tree unit CTU are not in an up-down relative position relationship, the first group of control points of the first neighboring affine coding block is an upper-left control point and an upper-right control point of the first neighboring affine coding block. The method of claim 2.

4. The parametric model of the current coding block is a six-parameter affine model, and the first group of control points of the first neighboring affine coding block is determined in the following manner: When the first coding tree unit CTU and the second coding tree unit CTU are in an up-down relative positional relationship, the first group of control points of the first neighboring affine coding block is a bottom-left control point and a bottom-right control point of the first neighboring affine coding block; when the first coding tree unit CTU and the second coding tree unit CTU are not in an up-down relative position relationship, the first group of control points of the first neighboring affine coding block is an upper-left control point, an upper-right control point, and a lower-left control point of the first neighboring affine coding block. The method of claim 2.

5. predicting predicted sample values ​​of the currently coded block based on the motion vectors of the one or more sub-blocks of the currently coded block; predicting the predicted sample values ​​of the currently coded block based on the motion vectors of the one or more sub-blocks of the currently coded block, a reference frame index, and a prediction direction indicated by the index; 5. The method according to any one of claims 1 to 4.

6. The position coordinates (x 6 ,y 6 ) and the position coordinates (x 7 ,y 7 ) are the position coordinates (x 4 ,y 4 ) and the position coordinates (x 6 ,y 6 ) is (x 4 ,y 4 +cuH), and the position coordinates (x 7 ,y 7 ) is (x 4 +cuW,y 4 6. The method according to claim 3, wherein cuW is the width of the first neighboring affine-coded block and cuH is the height of the first neighboring affine-coded block.

7. 7. The method of claim 6, wherein the motion vector of the bottom-left control point of the first neighboring affine-coded block is the motion vector of the bottom-left sub-block of the first neighboring affine-coded block, and the motion vector of the bottom-right control point of the first neighboring affine-coded block is the motion vector of the bottom-right sub-block of the first neighboring affine-coded block.

8. 8. The method according to claim 1, wherein the first group of candidate motion vectors are candidate motion vector predictors for a group of control points of the current coding block obtained based on motion vectors of the first group of control points of the first neighboring affine coding block.

9. a memory configured to store video data in the form of a bitstream; A video decoder configured to perform any of the methods according to claims 1 to 8; A video data decoding device comprising:

10. A non-transitory computer readable medium storing computer instructions that, when executed by one or more processors, cause the one or more processors to perform any of the methods of claims 1 to 8.

11. a memory containing instructions; a processor in communication with said memory configured to perform any of the methods of claims 1 to 8 upon execution of said instructions; Video data decoding device.

Citation Information

Patent Citations

  • Image decoding device and image decoding method

    WO2014054684A1

  • Affine motion prediction for video coding

    WO2017200771A1