Video encoder, video decoder, and corresponding method

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

JP2026062908APending Publication Date: 2026-04-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2026-01-05
Publication Date
2026-04-10

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 speeds.

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 coded 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 2026062908000001_ABST
    Figure 2026062908000001_ABST
Patent Text Reader

Abstract

The present invention provides a video encoder, video decoder, and method for improving encoding and decoding performance. [Solution] The method includes the steps of: parsing a bitstream to obtain an index for indicating a target candidate motion vector group for the currently encoded block; and determining, based on the index, a target candidate motion vector group in an affine candidate motion vector list that 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 encoded block, which is determined based on the relative position of the coding tree unit CTU with respect to the currently encoded block, and the first neighboring affine encoded block is located within the CTU. The method also includes the step of predicting a predicted sample value for the currently encoded block based on the target candidate motion vector group.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the field of video encoding and decoding technology, and more particularly to encoding methods, decoding methods, corresponding encoding devices, and corresponding decoding devices. [Background technology]

[0002] Digital video functionality can be incorporated into a wide variety of devices, including digital televisions, digital live broadcasting systems, wireless broadcasting 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, mobile phones or satellite radio phones (so-called "smartphones"), video conferencing equipment, and video streaming devices. Digital video devices implement video compression technologies, such as those defined by standards including MPEG-2, MPEG-4, ITU-T H.263, and ITU-T H.264 / MPEG-4 Part 10: Advanced Video Coding (AVC), the H.265 / High Efficiency Video Coding (HEVC) standard, and extensions of such standards. By implementing such video compression technologies, video devices can transmit, receive, encode, decode, and / or store digital video information more efficiently.

[0003] Video compression techniques are used to reduce or eliminate intrinsic redundancy in video sequences by performing spatial (intra-picture) and / or temporal (inter-picture) predictions. In block-based video coding, a video slice (i.e., a video frame or part of a video frame) may be divided into picture blocks, which may also be called tree blocks, 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 used for picture blocks. Specifically, the block to be coded is predicted based on coded video data blocks. In intra-predictive mode, the current block is predicted based on one or more previously decoded neighboring blocks within the same picture as the current block. In inter-predictive mode, the current block is predicted based on decoded blocks in different pictures.

[0005] Motion vector prediction is a crucial technique that impacts encoding / decoding performance. Existing motion vector prediction processes include methods based on translational motion models for translational objects in a picture, and methods based on motion models and control point combinations for non-translational objects. Motion vector prediction methods based on motion models require reading a large amount of information from memory, resulting in relatively low encoding / decoding speeds. Reducing the number of memory reads in the motion vector prediction process is a technical challenge that has been studied by those skilled in the art. [Overview of the project]

[0006] Embodiments of the present invention 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 in order to improve encoding and decoding performance.

[0007] In a first aspect, an embodiment of the present application discloses an encoding method. The method includes the steps of: determining a target candidate motion vector group in an affine candidate motion vector list (also called a candidate motion vector list) according to a rate-distortion cost criterion, wherein the target candidate motion vector group represents a motion vector predictor of a group of control points of a currently encoded block (e.g., a currently affine encoded block), 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 encoded block, the first group of control points of the first neighboring affine encoded block is a control point determined based on the relative position of an encoding tree unit CTU with respect to the currently encoded block, the first neighboring affine encoded block is located within the CTU, or the first group of control points of the first neighboring affine encoded block includes the lower left and lower right control points of the first neighboring affine encoded block; and encoding an index corresponding to the target candidate motion vector group into a bitstream to be transmitted.

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

[0009] Optionally, an embodiment of constructing an affine candidate motion vector list may be: determining one or more neighboring affine coding 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 Figure 7A), wherein the one or more neighboring affine coding blocks include a first neighboring affine coding block; constructing a first affine model based on the motion vectors of the first group of control points of the first neighboring affine coding block and the position coordinates of the control points of the first group; and then obtaining a motion vector predictor for a first group of control points of the current coding block by using the first affine model, wherein the motion vector predictor for a first group of control points of the current coding block is used as the first candidate motion vector group in the affine candidate motion vector list.

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

[0011] In the method described above, the affine candidate motion vector list may contain only one candidate motion vector group, or it may contain multiple candidate motion vector groups. Each candidate motion vector group may be a motion vector 2-tuple or a motion vector triplet. If multiple candidate motion vector groups exist, the first candidate motion vector group is one of the multiple candidate motion vector groups. The derivation process for another candidate motion vector group in the multiple candidate motion vector groups may be the same as the derivation process for the first candidate motion vector group, or it may be different from the derivation process for the first candidate motion vector group. Furthermore, the target candidate motion vector group is the best candidate motion vector group selected from the affine candidate motion vector list according to the rate-distortion cost criterion. If the first candidate motion vector group is best (for example, 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 best, the selected target candidate motion vector group is not the first candidate motion vector group. The first neighboring affine coding block is a specific affine coding block in the neighboring blocks of the current coding block, and is not particularly limited herein. Figure 7A is used as an example for description. The first neighboring affine coding block may be the coding block where neighboring position A is located, the coding block where neighboring position B is located, or other neighboring coding blocks. 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 embodiments of this application refer to specific objects, respectively. The specific object referred to by "first," the specific object referred to by "second," and the specific object referred to by "third" refer to 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, "first," "second," etc., in the embodiments of this application do not indicate order.

[0012] If the coding tree unit CTU in which the first neighboring affine coding block is located is above the current coding block, it can be understood that information (e.g., position coordinates and motion vectors) about the lowest control points of the first neighboring affine coding block (e.g., the lower-left and lower-right control points) has been read from memory. If the coding tree unit CTU in which the first neighboring affine coding block is located is to the left of the current coding block, then information about the rightmost control points of the first neighboring affine coding block (e.g., the upper-right and lower-right control points) has been read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on a first group of control points of a first neighboring affine coding block, the first group of control points is determined based on the relative position of the coding tree unit CTU with respect to the current coding block, wherein the first neighboring affine coding block is located within its 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 coding block, instead of using the upper left, upper right, and lower left control points (6-parameter affine model) of the first neighboring coding block as fixed control points of the first group, or using the upper left and upper right control points (4-parameter affine model) of the first neighboring coding block as fixed control points of the first group. Thus, according to the method for determining the first group of control points in this application, there is a very high probability 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 reads from memory and improving encoding performance.

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

[0014] In some arbitrary solution, the affine candidate motion vector list further includes a second group of candidate motion vectors, the second group of candidate motion vectors obtained based on a second group of control points of a second neighboring affine coding block. The position 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 is different from the position 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 (for example, the control points included in the first group of control points of the first neighboring affine coding block are the lower-left, lower-right, and upper-left control points 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 upper-right, lower-right, and lower-left control points of the second neighboring affine coding block), or the second group of control points of the second neighboring affine coding block includes the lower-left and lower-right control points of the second neighboring affine coding block. For example, the first neighboring affine coding block and the second neighboring affine coding block are different affine coding blocks in the spatial neighboring blocks around the currently coded block.

[0015] In another possible implementation, in advanced motion vector prediction (AMVP) mode, the method further includes: using the target candidate motion vector group as a starting search point, searching within a preset search range according to a rate-distortion cost criterion for the motion vector of a group of control points that has the lowest cost; and then determining the 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, then the motion vector difference (MVD) between the motion vector of the first control point and the motion vector predictor of the first control point in the group of control points, represented by the target candidate motion vector group, needs to be determined, and the motion vector difference (MVD) between the motion vector of the second control point and the motion vector predictor of the second control point in the group of control points, represented by the target candidate motion vector group, 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, encoding the index corresponding to the target candidate motion vector group in the bitstream to be transmitted in merge mode may specifically include encoding the index corresponding to the target candidate motion vector group, the reference frame index, and the prediction direction in the bitstream to be transmitted. In merge mode, it should be understood that the target candidate motion vector group represents the motion vector of the group of control points of the currently encoded block. In other words, in merge mode, the motion vector predictor is equal to the motion vector.

[0017] In a possible implementation, the first group of control points of the first neighboring affine coding block is a control point determined based on the relative position of the coding tree unit CTU for the current coding block, and the first neighboring affine coding block is located within the CTU. That is, when the first neighboring affine coding block is located within the coding tree unit CTU above the current coding block, the first group of control points of the first neighboring affine coding block may include the lower left control point and the lower right control point of the first neighboring affine coding block. When the coding tree unit CTU where the first neighboring affine coding block is located is above the current coding block, information regarding the lowest control point of the first neighboring affine coding block is read from the 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 lower left control point and the lower right control point (both belonging to the lowest control point) of the first neighboring affine coding block, and it is clear that additional information regarding these two control points does not need to be read from the memory, thereby reducing the number of reads from the memory and improving the encoding performance.

[0018] Optionally, when the first neighboring affine coding block is located within the CTU above the current block, the first group of control points of the first neighboring affine coding block further includes the upper left control point or the upper right control point of the first neighboring affine coding 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.

[0019] Optionally, both the position coordinates (x6, y6) of the bottom - left control point and the position coordinates (x7, y7) of the bottom - right control point of the first - order neighborhood affine - coded block are calculated and derived based on the position coordinates (x4, y4) of the top - left control point of the first - order neighborhood affine - coded block. The position coordinates (x6, y6) of the bottom - left control point of the first - order neighborhood affine - coded block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the bottom - right control point of the first - order neighborhood affine - coded block are (x4+cuW, y4 + cuH). Here, cuW is the width of the first - order neighborhood affine - coded block, and cuH is the height of the first - order neighborhood affine - coded block. Further, the motion vector of the bottom - left control point of the first - order neighborhood affine - coded block is the motion vector of the bottom - left sub - block of the first - order neighborhood affine - coded block, and the motion vector of the bottom - right control point of the first - order neighborhood affine - coded block is the motion vector of the bottom - right sub - block of the first - order neighborhood 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 - order neighborhood affine - coded block is cuW, and the horizontal distance between the top - left control point and the top - right control point of the first - order neighborhood affine - coded block is cuW. Since cuW is usually a power of 2, in the process of deriving the motion vector of the control point of the current coded block, a right - shift method may be used instead of a division operation to reduce the 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 - order neighborhood affine - coded block are obtained through derivation rather than being read from memory. Therefore, according to this method, the number of memory reads can be further reduced, and the encoding performance can be improved. In another optional solution, the position coordinates of the bottom - left control point and the position coordinates of the bottom - right control point may alternatively be stored in memory in advance 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 is a control point 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 specifically includes: if the first neighboring affine coding block is located within the CTU to the left of the current coding block, then the first group of control points of the first neighboring affine coding block includes the upper right and lower right control points of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is to the left of the current coding block, then information regarding 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 a first group of control points of the first neighboring affine coding block, the first group of control points includes the upper right and lower right control points of the first neighboring affine coding block (both belonging to the rightmost control point), and it is clear that information about these two control points does not need to be read additionally from memory, thereby reducing the number of reads from memory and improving encoding performance.

[0021] Optionally, if the first neighboring affine coding block is located within the left CTU of the currently coded block, the first group of control points of the first neighboring affine coding block further includes the upper-left or lower-left control point of the first neighboring affine coding block. If the first group of control points includes three control points, it can be understood that the accuracy of the first candidate motion vector group calculated based on the first group of control points will be higher.

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

[0023] In another optional solution, if the first group of control points of the first neighboring affine coding block includes the lower-left and lower-right control points of the first neighboring affine coding block, then the first group of control points of the first neighboring affine coding block may further include the upper-left or upper-right control point of the first neighboring affine coding block. It can be understood that if the first group of control points includes three control points, the accuracy of the first candidate motion vector group calculated based on the first group of control points will be higher.

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

[0025] Optionally, for any coding block (for example, the current coding block or a neighboring coding block), if the coordinates of the top-left control point of the coding block are (x, y), then 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 comprising several functional units configured to implement any method in the first aspect. For example, the video encoder includes: An interprediction unit configured to determine a target candidate motion vector group in an affine candidate motion vector list according to a rate-distortion cost criterion, wherein the target candidate motion vector group represents a motion vector predictor of a group of control points of a currently coded block, 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 is a control point determined based on the relative position of the coding tree unit CTU with respect to the currently coded block, 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 the lower left and lower right control points of the first neighboring affine coded block, and the interprediction unit may be referred to as an interprediction module, in particular a motion estimation module; and It may include an entropy encoding unit configured to encode in the bitstream to be transmitted an index corresponding to a target candidate motion vector group.

[0027] According to a third aspect, one embodiment of the present application provides a video data encoding device, which includes a video encoder configured to implement any of the methods in the first aspect. For example, the device: Memory configured to store video data in the form of a bitstream; The video encoder may include the steps of: determining a target candidate motion vector group in an affine candidate motion vector list according to a rate-distortion cost criterion, wherein the target candidate motion vector group represents a motion vector predictor of a group of control points of a currently coded block, 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 is a control point determined based on the relative position of a coding tree unit CTU with respect to the currently coded block, 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 the lower left and lower right control points 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, one embodiment of the present application provides a video data encoding apparatus. The apparatus includes coupled non-volatile memory and a processor. The memory is configured to store program instructions. The processor is configured to invoke program code to perform some or all of the steps of the first aspect and any method in the first aspect. For example, the processor is configured to invoke program code to perform the following steps: The steps of: 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 in a bitstream to be transmitted. Here, the target candidate motion vector group represents a motion vector predictor of a group of control points of the currently coded block, 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 is a control point determined based on the relative position of the coding tree unit CTU with respect to the currently coded block, 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 the lower left and lower right control points of the first neighboring affine coded block.

[0029] According to a fifth aspect, one embodiment of the present application provides a computer-readable storage medium that stores program code, which includes instructions used to perform some or all of the steps of any method in the first aspect.

[0030] According to the sixth aspect, one embodiment of the present application provides a computer program product. When the computer program product is executed on a computer, the computer is enabled to perform some or all of the steps of any of the methods in the first aspect.

[0031] It should be understood that the technical solutions in Aspects 2 through 6 of this Application are consistent with the technical solutions in Aspect 1 of this Application, and that the beneficial effects achieved by those aspects and their corresponding feasible implementations are similar. Further details will not be provided again.

[0032] According to the seventh aspect, an embodiment of the present application discloses a decoding method. The method comprises the steps of: parsing a bitstream to obtain an index, which is used to indicate a target candidate motion vector group of a currently encoded block (e.g., a currently affine encoded 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), wherein the target candidate motion vector group represents a motion vector predictor of a group of control points of the currently encoded block, and the affine candidate motion vector list includes at least a first candidate motion vector group. The steps include: a first candidate motion vector group is obtained based on a first group of control points of a first neighboring affine coding block, wherein the first group of control points of the first neighboring affine coding block is a control point 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, or the first group of control points of the first neighboring affine coding block includes the lower left and lower right control points of the first neighboring affine coding block; obtaining motion vectors of one or more subblocks 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 one or more subblocks of the current coding block.

[0033] Optionally, an embodiment of constructing an affine candidate motion vector list may be, for example: determining one or more neighboring affine coding 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 Figure 7A), wherein the one or more neighboring affine coding blocks include a first neighboring affine coding block; and obtaining motion vector predictors for a first group of control points of the current coding block by using a first affine model, wherein the motion vector predictors for a first group of control points of the current coding block are used as a first candidate motion vector group in the affine candidate motion vector list, and the model parameters of the first affine model are determined based on the motion vectors of the first group of control points of the first neighboring affine coding block and the position coordinates of the first group of control points of the first neighboring affine coding block.

[0034] In the above method, the affine candidate motion vector list may contain only one candidate motion vector group, or it may contain multiple candidate motion vector groups. Each candidate motion vector group may be a motion vector 2-tuple or a motion vector triplet. If multiple candidate motion vector groups exist, the first candidate motion vector group is one of the multiple candidate motion vector groups. The derivation process for another candidate motion vector group in the multiple candidate motion vector groups may be the same as the derivation process for the first candidate motion vector group, or it may be different from the derivation process for 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 coding block is a specific affine coding block in the neighboring blocks of the current coding block, and is not particularly limited herein. Figure 7A is used as an example for description. The first neighboring affine coding block may be the coding block at neighboring position A, the coding block at neighboring position B, or a coding block in another neighbor. Furthermore, "first," "second," "third," etc., appearing elsewhere in the embodiments of this application, each refer to a specific object. The specific object referred to by "first," the specific object referred to by "second," and the specific object referred to by "third" represent 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, "first," "second," etc., in the embodiments of this application do not imply order.

[0035] If the coding tree unit CTU in which the first neighboring affine coding block is located is above the current coding block, it can be understood that information about the lowest control point of the first neighboring affine coding block has been read from memory. If the coding tree unit CTU in which the first neighboring affine coding block is located is to the left of the current coding block, then information about the rightmost control point of the first neighboring affine coding block has been read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on a first group of control points of a first neighboring affine coding block, the first group of control points is 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 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 coding block, instead of using the upper left, upper right, and lower left control points of the first neighboring coding block as fixed control points of the first group (or using the upper left and upper right control points of the first neighboring coding block as fixed control points of the first group) as in the prior art. Thus, according to the method for determining the first group of control points in the present application, there is a very high probability 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 reads 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 means, specifically: obtaining a first candidate motion vector group based on a first affine model (for example, based on the first affine model and the position coordinates of the group of control points of the current coding block), where the first affine model is determined based on the 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 of one or more subblocks of the current coding block based on a target candidate motion vector group means, specifically: obtaining motion vectors of one or more subblocks of the current coding block based on a second affine model (for example, obtaining motion vectors of one or more subblocks of the current coding block based on a second affine model and the position coordinates of one or more subblocks of the current coding block), where the second affine model is determined based on the target candidate motion vector group and the position coordinates of the 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, the second group of candidate motion vectors obtained based on a second group of control points of a second neighborhood affine coded block. The position 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 is different from the position 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 (for example, the control points included in the first group of control points of the first neighboring affine coding block are the lower-left, lower-right, and upper-left control points 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 upper-right, lower-right, and lower-left control points of the second neighboring affine coding block), or the second group of control points of the second neighboring affine coding block includes the lower-left and lower-right control points of the second neighboring affine coding block.

[0038] In some optional solutions, obtaining motion vectors for one or more subblocks of the currently encoded block based on a target candidate motion vector group in advanced motion vector prediction (AMVP) mode may specifically involve: obtaining a new candidate motion vector group based on the target candidate motion vector group indicated by the motion vector difference (MVD) and index obtained from the bitstream through parsing; and then obtaining motion vectors for one or more subblocks of the currently encoded 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 the position coordinates of the group of control points of the currently encoded block, and motion vectors for one or more subblocks of the currently encoded block are obtained based on the second affine model. For example, motion vectors for one or more subblocks of the currently encoded block are obtained based on the second affine model and the position coordinates of one or more subblocks of the currently encoded block.

[0039] In another possible implementation, predicting the predicted sample value of the currently encoded block based on the motion vectors of one or more subblocks of the currently encoded block in merge mode may specifically include: predicting the predicted sample value of the currently encoded block based on the motion vectors of one or more subblocks of the currently encoded block, a reference frame index, and the prediction direction indicated by the index.

[0040] In another possible implementation, the first group of control points of a first neighboring affine coding block is a control point 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 the coding tree unit CTU above the current coding block, then the first group of control points of the first neighboring affine coding block includes the lower-left and lower-right control points of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is above the current coding block, then information regarding the lowest 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 a first group of control points of the first neighboring affine coding block, the first group of control points includes the lower left and lower right control points of the first neighboring affine coding block (both belonging to the lowest control points), and it is clear that information about these two control points does not need to be read additionally from memory, thereby reducing the number of reads from memory and improving decoding performance.

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

[0042] Optionally, 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 coding block are both calculated and derived based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves decoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may instead 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 is a control point 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 specifically includes: if the first neighboring affine coding block is located within the CTU to the left of the current coding block, the first group of control points of the first neighboring affine coding block includes the upper right and lower right control points of the first neighboring affine coding block. If the coding tree unit CTU in which the first neighboring affine coding block is located is 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 a first group of control points of the first neighboring affine coding block, the first group of control points includes the upper right and lower right control points of the first neighboring affine coding block (both belonging to the rightmost control point), and it is clear that information about these two control points does not need to be read additionally from memory, thereby reducing the number of reads from memory and improving decoding performance.

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

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

[0046] In another possible implementation, if the first group of control points of the first neighboring affine coding block includes the lower-left and lower-right control points of the first neighboring affine coding block, then the first group of control points of the first neighboring affine coding block also includes the upper-left control point of the first neighboring affine coding block. It can be understood that if the first group of control points includes three control points, the accuracy of the first candidate motion vector group calculated based on the first group of control points will be higher.

[0047] In another optional solution, if the motion vectors of one or more subblocks of the currently encoded block are obtained based on a target candidate motion vector group, and the lower boundary of the currently encoded block coincides with the lower boundary of the CTU on which the currently encoded block is located, then the motion vector of the subblock at the lower left corner of the currently encoded block is obtained through a calculation based on the affine model of the currently encoded block and the position coordinates (0,H) of the lower left corner of the currently encoded block, and the motion vector of the subblock at the lower right corner of the currently encoded block is obtained through a calculation based on the affine model of the currently encoded block and the position coordinates (W,H) of the lower right corner of the currently encoded block. For example, the affine model is constructed based on a target candidate motion vector group and the position coordinates of a group of control points of the currently encoded block. The model parameters of the affine model are obtained based on the target candidate motion vectors and the position coordinates of a group of control points of the currently encoded block. Then, the motion vector of the subblock located in the lower left corner of the currently encoded block can be obtained by substituting the position coordinates (0,H) of the lower left corner of the currently encoded block into the affine model (rather than substituting the coordinates of the center point of the subblock in the lower left corner into the affine model for computation), and the motion vector of the subblock located in the lower right corner of the currently encoded block can be obtained by substituting the position coordinates (W,H) of the lower right corner of the currently encoded block into the affine model (rather than substituting the coordinates of the center point of the subblock in the lower right corner into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently encoded block are used (for example, when a list of affine candidate motion vectors for another block is subsequently constructed based on the motion vectors of the lower left and lower right control points of the current block), the exact values ​​are used, not estimates. W is the width of the currently encoded block, and H is the height of the currently encoded block.

[0048] Optionally, for any coding block (for example, the current coding block or a neighboring coding block), if the coordinates of the top-left control point of the coding block are (x, y), then 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 the eighth aspect, one embodiment of the present application provides a video decoder comprising several functional units configured to implement any method in the seventh aspect. For example, the video decoder may include: An entropy decode unit configured to parse a bitstream and obtain an index, the index of which is used to indicate a target candidate motion vector group of the currently encoded block; The interprediction unit may include the steps of: determining a target candidate motion vector group in an affine candidate motion vector list based on an index, wherein the target candidate motion vector group represents a motion vector predictor of a group of control points of the currently coded block, 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 is a control point determined based on the relative position of a coding tree unit CTU with respect to the currently coded block, 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 the lower left and lower right control points of the first neighboring affine coded block; obtaining motion vectors of one or more subblocks 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 one or more subblocks of the currently coded block.

[0050] According to the ninth aspect, one embodiment of the present application provides a video data decoding device, which includes a video decoder configured to implement any of the methods in the seventh aspect. For example, the device: Memory configured to store video data in the form of a bitstream; The video decoder may include the steps of: parsing a bitstream to obtain an index, which is used to indicate a target candidate motion vector group of a currently coded block; and determining a target candidate motion vector group in an affine candidate motion vector list based on the index, where the target candidate motion vector group represents a motion vector predictor of a group of control points of a currently coded block, and the affine candidate motion vector list includes at least a first candidate motion vector group, where the first candidate motion vector group is obtained based on a first group of control points of a first neighboring affine coded block, and the first neighboring affine coded The first group of control points for a block is a control point determined based on the relative position of the coding tree unit CTU with respect to the currently coded block, wherein the first neighboring affine coded block is located within the CTU, or the first group of control points for the first neighboring affine coded block includes the lower left and lower right control points of the first neighboring affine coded block, and the system is configured to perform the steps of: obtaining the motion vectors of one or more subblocks of the currently coded block based on the target candidate motion vector group; and predicting the predicted sample values ​​of the currently coded block based on the motion vectors of one or more subblocks of the currently coded block.

[0051] According to the tenth aspect, one embodiment of the present application provides a video data decoding device. The device includes coupled non-volatile memory and a processor. The memory is configured to store program instructions. The processor is configured to invoke program code to perform some or all of the steps of the seventh aspect and any method in the seventh aspect. For example, the processor is configured to invoke program code to perform the following steps: A bitstream is parsed to obtain an index, which is used to indicate a target candidate motion vector group of the currently coded block; and a target candidate motion vector group in an affine candidate motion vector list is determined based on the index, wherein the target candidate motion vector group represents a motion vector predictor of a group of control points of the currently coded 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, and the first neighboring affine code The first group of control points of a coding block is a control point determined based on the relative position of a coding tree unit CTU with respect to the currently coded block, wherein 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 the lower left and lower right control points of the first neighboring affine coded block; the step of obtaining the motion vector of one or more subblocks of the currently coded block based on the target candidate motion vector group; and the step of predicting a predicted sample value of the currently coded block based on the motion vector of one or more subblocks of the currently coded block.

[0052] According to the eleventh aspect, one embodiment of the present application provides a computer-readable storage medium that stores program code, which includes instructions used to perform some or all of the steps of any method in the seventh aspect.

[0053] According to the twelfth aspect, one embodiment of the present application provides a computer program product. When the computer program product is executed on a computer, the computer is enabled to perform some or all of the steps of any of the methods in the seventh aspect.

[0054] It should be understood that the technical solutions in Aspects 8 through 12 of this Application are consistent with the technical solutions in Aspect 7 of this Application, and that the beneficial effects achieved by those aspects and their corresponding feasible implementations are similar. Further details will not be provided again. [Brief explanation of the drawing]

[0055] To more clearly describe the technical solutions in the embodiments of this application, the accompanying drawings for describing the embodiments of this application are described below.

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

[0057] [Figure 1B] This is a schematic flowchart of video data processing according to one embodiment of the present invention.

[0058] [Figure 2A] This is a schematic block diagram of a video encoder according to one embodiment of the present invention.

[0059] [Figure 2B] This is a schematic block diagram of a video decoder according to one embodiment of the present invention.

[0060] [Figure 3] This is a flowchart of an interpretation method for video-picture encoding according to one embodiment of the present invention.

[0061] [Figure 4] This is a flowchart of an interpretation method for video-picture decoding according to one embodiment of the present invention.

[0062] [Figure 5A] This is a schematic diagram of motion information for the current picture block and reference block according to one embodiment of the present invention.

[0063] [Figure 5B] This is a schematic diagram of an interpretation scenario according to one embodiment of the present invention.

[0064] [Figure 5C] This is a schematic diagram of a scenario for an inter-frame neighborhood block according to one embodiment of the present invention.

[0065] [Figure 5D] This is a schematic diagram of the motion vector of a neighboring affine coding block according to one embodiment of the present invention.

[0066] [Figure 6] This is a schematic flowchart of an encoding method according to one embodiment of the present invention.

[0067] [Figure 7A] This is a schematic diagram of a neighboring block scenario according to one embodiment of the present invention.

[0068] [Figure 7B] This is a schematic diagram of a neighboring block scenario according to one embodiment of the present invention.

[0069] [Figure 8A] This is a schematic diagram of a motion compensation unit according to one embodiment of the present invention.

[0070] [Figure 8B] This is a schematic diagram of another motion compensation unit according to one embodiment of the present invention.

[0071] [Figure 9] This is a schematic flowchart of a decoding method according to one embodiment of the present invention.

[0072] [Figure 9A] This is a schematic flowchart of constructing an affine candidate motion vector list according to one embodiment of the present invention.

[0073] [Figure 9B] This is a schematic flowchart of constructing an affine candidate motion vector list according to one embodiment of the present invention.

[0074] [Figure 9C] This is a schematic flowchart for constructing an affine candidate motion vector list according to one embodiment of the present invention.

[0075] [Figure 9D] This is a schematic flowchart of constructing an affine candidate motion vector list according to one embodiment of the present invention.

[0076] [Figure 10] This is a schematic diagram of an encoding or decoding device according to one embodiment of the present invention.

[0077] [Figure 11] One embodiment is a video encoding system 1100 including an encoder 100 in Figure 2A and / or a decoder 200 in Figure 2B. [Modes for carrying out the invention]

[0078] The embodiments of this application will be described below with reference to the attached drawings of the embodiments.

[0079] For encoding a video stream or a portion of a video stream, such as a video frame or picture block, temporal and spatial similarities within the video stream can be used to improve encoding performance. For example, for a current picture block in a video stream, the 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 the residual) between the predicted block and the current picture block (i.e., the original block) is identified in order to encode the current picture block based on the previously encoded blocks. In this method, only the residual and some parameters used to generate the current picture block, rather than the entire current picture block, are included in the digital video output bitstream. This technique is sometimes called interprediction.

[0080] The motion vector is a crucial parameter in the interpretation process, representing the spatial displacement of a previously encoded block relative to the currently encoded block. Motion estimation methods, such as motion search, may be used to obtain the motion vector. In early interpretation techniques, bits representing the motion vector are included in the encoded bitstream so that the decoder can reconstruct the predicted block and thereby obtain the reconstructed block. To further improve encoding efficiency, it has been proposed to encode the motion vector differentially by using a reference motion vector; that is, instead of encoding the entire motion vector, only the difference between the motion vector and the reference motion vector is encoded. 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 currently encoded motion vector can further reduce the amount of bits included in the encoded video bitstream.

[0081] Figure 1A is a block diagram of an exemplary video coding system 1 according to one embodiment of the present invention. As used herein, the term “video codec” typically refers to video encoders and video decoders. In this application, the terms “video coding” or “coding” can typically refer to video encoding or video decoding. The video encoder 100 and video decoder 200 in video coding system 1 are configured to predict motion information, such as motion vectors, of the picture block currently being coded, or of subblocks of the picture block currently being coded, according to various method examples described in any one of the multiple novel interprediction modes provided herein, so that the predicted motion vectors are as close as possible to motion vectors obtained using a motion estimation method. In this way, the motion vector difference does not need to be transmitted during encoding, thereby further improving encoding and decoding performance.

[0082] As shown in Figure 1A, the video encoding system 1 includes a source device 10 and a destination device 20. The source device 10 generates encoded video data. Thus, the source device 10 may be referred to as the video encoding device. The destination device 20 can decode the encoded video data generated by the source device 10. Thus, the destination device 20 may be referred to as the 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 that can be used to store program code required in the form of computer-accessible instructions or data structures, as described herein. For ease of understanding, Figure 1B further illustrates a scenario in which video data is collected, encoded, transmitted by the source device 10, 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 phones such as "smartphones," television sets, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and similar devices.

[0084] The destination device 20 can receive encoded video data from the source device 10 via link 30. Link 30 may include one or more media or devices that can transfer the encoded video data from the source device 10 to the destination device 20. In one example, link 30 may include one or more communication media that enable the source device 10 to directly transmit the encoded video data to the destination device 20 in real time. In this example, the 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 the destination device 20. One or more communication media may include wireless communication media and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission lines. 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). One or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the source device 10 to the destination device 20.

[0085] In another example, the encoded data may be output to the storage device 40 through the output interface 140. Similarly, the encoded data may be accessed from the storage device 40 through the input interface 240. The storage device 40 may include any one of several distributed or locally accessed data storage media. For example, it may be a hard disk drive, Blu-ray disc, DVD, 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, the storage device 40 may correspond to a file server or another intermediate storage device capable of maintaining the encoded video generated by the source device 10. The destination device 20 can access the stored video data from the storage device 40 via streaming transmission or download. The file server can be any type of server capable of storing and transmitting the encoded video data to the 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. The destination device 20 can access the encoded video data via 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 any combination thereof suitable for accessing the encoded video data stored on the file server. Transmission of the encoded video data from the storage device 40 may be via streaming transmission, download transmission, or a combination thereof.

[0087] The motion vector prediction technology in this application may be used for video encoding and decoding to support multiple multimedia applications, such as wireless television broadcasting, cable television broadcasting, satellite television broadcasting, streaming video transmission (e.g., over the Internet), encoding of video data stored on a data storage medium, decoding of 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 phone.

[0088] The video encoding system 1 shown in Figure 1A is merely an example, and the technology described herein is 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 other examples, the data may be retrieved from local memory, transmitted over a network in a streaming manner, etc. The video encoding device may encode the data and store the data in memory, and / or the video decoding device may retrieve the data from memory and decode the data. In many examples, the encoding and decoding are performed by devices that only encode the data, store the data in memory, and / or retrieve the data from memory and decode the data, without communicating with each other.

[0089] In the example shown in Figure 1A, the source device 10 includes a video source 120, a video encoder 100, and an output interface 140. In some examples, the output interface 140 may include a modulator / demodulator (modem) and / or transmitter. The 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] The video encoder 100 may encode video data from the video source 120. In some examples, the source device 10 sends the encoded video data directly to the destination device 20 through the output interface 140. In other examples, the encoded video data may instead be stored in a storage device 40, so that the destination device 20 can then access the encoded video data for decoding and / or playback.

[0091] In the example shown in Figure 1A, the destination device 20 includes an input interface 240, a video decoder 200, and a display device 220. In some examples, the input interface 240 includes a receiver and / or a modem. The input interface 240 can receive encoded video data through link 30 and / or from storage device 40. The display device 220 may be integrated with the destination device 20 or located outside of the destination device 20. Typically, the display device 220 displays the decoded video data. The display device 220 may include several types of display devices, such as liquid crystal displays (LCDs), plasma displays, organic light-emitting diode (OLED) displays, or other types of display devices.

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

[0093] The video encoder 100 and video decoder 200 may each be implemented as, for example, one or more 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 application is partially implemented through software, the device may store instructions used for the software in a suitable non-volatile computer-readable storage medium, and one or more processors may be used in hardware to execute such instructions in order to implement the technology in the application. Any one of the above (including hardware, software, and combinations of hardware and software) may be considered as one or more processors. The video encoder 100 and video decoder 200 may each be included in one or more encoders or decoders, and the encoders or decoders may be integrated as part of a combined encoder / decoder (codec) in the corresponding device.

[0094] In this application, the video encoder 100 may broadly be referred to as another device that “signales” or “transmits” some information to, for example, the video decoder 200. The terms “signaling” or “transmitting” may broadly 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 the syntax elements in the encoded bitstream are stored in a computer-readable storage medium during encoding, and the decoding device may retrieve the syntax elements at any point after they have been stored in the medium.

[0095] The video encoder 100 and video decoder 200 may operate in accordance with a video compression standard such as High Efficiency Video Coding (HEVC) or its extensions, and may conform to the HEVC Test Model (HM). Alternatively, the 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 extensions of such standards. However, the technology in this application is not limited to any particular encoding and decoding standard.

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

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

[0098] In another example, referring together with Figure 4, the video decoder 200 is configured to decode the bitstream to obtain syntax elements related to the current picture block to be decoded (S401), and to decode the current picture block based on the determined inter-prediction mode 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) should be used to predict the current picture block (S403) (S405). The decoding process here may include: predicting the motion information of one or more subblocks within the current picture block, and performing inter-prediction on the current picture block by using the motion information of one or more subblocks within the current picture block.

[0099] Optionally, if the interprediction data further includes indices used to indicate target candidate motion vector groups for the current picture block, the video decoder 200 is configured to determine target candidate motion vector groups in the affine candidate motion vector list. A target candidate motion vector group represents a motion vector predictor for a group of control points in the current picture block. When the video decoder 200 uses merge mode, it should be understood that the motion vector predictor for a group of control points in the current picture block, represented by the target candidate motion vector group, is used as the motion vector for a group of control points in the current picture block.

[0100] Figure 2A is a block diagram of an exemplary video encoder 100 according to one 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 is 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, and in other cases, the functions described with respect to the post-processing entity 41 may be implemented by the same device including the video encoder 100. In one example, the post-processing entity 41 is an example of the storage device 40 in Figure 1A.

[0101] The video encoder 100 can encode a video-picture block, for example, by performing inter-prediction on a video-picture block, based on any new inter-prediction mode in the proposed set of candidate inter-prediction modes, including modes 0, 1, 2, ..., 10.

[0102] In the example in Figure 2A, the video encoder 100 includes a prediction processing unit 108, a filter unit 106, a decoded picture buffer (DPB) 107, an additive unit 114, a transform unit 101, a quantization unit 102, and an entropy encoding unit 103. The prediction processing unit 108 includes an interprediction unit 110 and an intraprediction unit 109. For picture block reconstruction, the video encoder 100 further includes an inverse quantization unit 104, an inverse transform unit 105, and an additive unit 113. The filter unit 106 is intended to represent one or more loop filter units, such as an unblocking filter unit, an adaptive loop filter (ALF) unit, and a sample-adaptive offset (SAO) filter unit. Although the filter unit 106 is shown as an in-loop filter in Figure 2A, in other implementations, the 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 in the figure).

[0103] The video data storage unit can store video data encoded by the components of the video encoder 100. The video data stored in the video data storage unit may be obtained from the video source 120. The DPB 107 may be a reference picture storage unit that stores reference video data used by the video encoder 100 to encode the video data in intra or inter-encoded mode. The video data storage unit and the DPB 107 may each include one of several 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 may be provided by the same storage unit device or separate storage unit devices. In various examples, the video data storage unit may be integrated on a chip together with the other components of the video encoder 100, or it may be located outside the chip relative to those components.

[0104] As shown in Figure 2A, the video encoder 100 receives video data and stores the video data in a video data storage unit. The 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 or binary tree structure is performed. Partitioning may further include dividing into slices, tiles, or other larger units. The 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 into sets of picture blocks called tiles). The prediction processing unit 108 may select one of several possible encoding modes currently used for the picture blocks, for example, one or more inter-encoding modes from several intra-encoding modes. The several inter-encoding modes include, but are not limited to, one or more of the modes 0, 1, 2, 3, ..., 10 proposed herein. The prediction processing unit 108 may provide the obtained intra-encoded and inter-encoded blocks to the addition unit 114 to generate residual blocks, and may provide those blocks to the addition unit 113 to reconstruct the encoded blocks to be used as a reference picture.

[0105] The intra-prediction unit 109 within the 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 block currently to be encoded, in order to eliminate spatial redundancy. The inter-prediction unit 110 within the prediction processing unit 108 may perform inter-predictive encoding on the current picture block based on one or more predicted blocks in one or more reference pictures, in order to eliminate temporal redundancy.

[0106] Specifically, the interpretation unit 110 may be configured to determine the interpretation mode currently used to encode the picture block. For example, the interpretation unit 110 can calculate the rate-distortion values ​​of various interpretation modes in a set of candidate interpretation modes set up through rate-distortion analysis, and from those interpretation modes, select the interpretation mode with the optimal rate-distortion characteristics. Rate-distortion analysis is typically used to determine the amount of distortion (or error) between the encoded block and the original block that is not encoded and should be encoded to produce the encoded block, as well as the bit rate (i.e., the amount of bits) used to produce the encoded block. For example, the interpretation unit 110 can determine the interpretation mode currently used to encode the picture block that has the lowest rate-distortion cost, as the interpretation mode currently used to perform interpretation on the picture block. The following describes in detail the process of predicting motion information of one or more subblocks (specifically, each subblock or all subblocks) in a current picture block in the interpredictive encoding process, particularly in the affine mode as described herein (e.g., advanced motion vector prediction mode based on affine transform or merge prediction mode based on affine transform). In other words, the following describes in detail the motion vector prediction process based on a motion model, for example, a 4-parameter affine model or a 6-parameter affine model.

[0107] The interprediction unit 110 is configured to predict motion information (e.g., motion vectors) of one or more subblocks within the current picture block based on a determined interprediction mode, and to obtain or generate predicted blocks for the current picture block using the motion information (e.g., motion vectors) of one or more subblocks within the current picture block. The interprediction unit 110 can locate the predicted block pointed to by the motion vector in one reference picture in the reference picture list. The interprediction unit 110 can further generate syntax elements related to picture blocks and video slices, so that the video decoder 200 can use these syntax elements to decode the picture blocks of the video slices. Alternatively, in one example, the interprediction unit 110 performs a motion compensation process using the motion information of each subblock to generate predicted blocks for each subblock and obtain predicted blocks for the current picture block. Here, it should be understood that the interprediction 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 an inter-prediction mode for the current picture block, the inter-prediction unit 110 can provide the entropy encoding unit 103 with information indicating the selected inter-prediction mode for the current picture block, thereby allowing the entropy encoding unit 103 to encode the information indicating the selected inter-prediction mode. The intra-prediction unit 109 can perform intra-prediction on the current picture block. Specifically, the intra-prediction unit 109 can determine the intra-prediction mode to be used to encode the current block. For example, the intra-prediction unit 109 can calculate the rate-distortion values ​​of various intra-prediction modes to be tested through rate-distortion analysis and select the intra-prediction mode with the optimal rate-distortion characteristics from those modes to be tested. In either case, after selecting an intra-prediction mode for the picture block, the intra-prediction unit 109 can provide the entropy encoding unit 103 with information indicating the selected intra-prediction mode for the current picture block, thereby allowing the entropy encoding unit 103 to encode the information indicating the selected intra-prediction mode.

[0109] After the prediction processing unit 108 generates prediction blocks of the current picture block through interpretation and intraprediction, the video encoder 100 subtracts the prediction blocks from the current picture block to be encoded to form a residual picture block. The addition unit 114 represents one or more components that perform subtraction operations. The residual video data in the residual block may be contained in one or more TUs and used by the conversion unit 101. The conversion unit 101 converts the residual video data into residual conversion coefficients through a transformation such as a discrete cosine transform (DCT) or a conceptually similar transformation. The conversion unit 101 can convert the residual video data from the sample value domain to a transformation domain, such as the frequency domain.

[0110] The conversion unit 101 may transmit the obtained conversion coefficients to the quantization unit 102. The quantization unit 102 quantizes the conversion coefficients to further reduce the bitrate. In some examples, the quantization unit 102 may further scan a matrix containing the quantized conversion coefficients. Alternatively, the entropy encoding unit 103 may perform this scan.

[0111] After quantization, the entropy encoding unit 103 performs entropy encoding on the quantized transformation coefficients. For example, the 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), stochastic interval partitioning entropy (PIPE) coding, or other entropy encoding methods or techniques. After the entropy encoding unit 103 has performed entropy encoding, the encoded bitstream may be transmitted to the video decoder 200 or archived for subsequent transmission or retrieval by the video decoder 200. The entropy encoding unit 103 may further perform entropy encoding on the syntax elements of the picture block currently to be encoded.

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

[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 conversion unit 101 and the inverse conversion unit 105 is not required. Alternatively, for some picture blocks or picture frames, the video encoder 100 may not generate residual data. In this case, processing by the conversion unit 101, the quantization unit 102, the inverse quantization unit 104, and the inverse conversion unit 105 is not required. Alternatively, the video encoder 100 may directly store the reconstructed picture blocks as reference blocks, and processing by the filter unit 106 is not required. Alternatively, the quantization unit 102 and the inverse quantization unit 104 within the video encoder 100 may be combined. The loop filter unit is optional. Furthermore, for lossless compression coding, the transform unit 101, quantization unit 102, inverse quantization unit 104, and inverse transform unit 105 are optional. It should be understood that in different application scenarios, the inter-prediction unit and intra-prediction unit may be selectively enabled. In this solution, the inter-prediction unit is enabled.

[0114] Figure 2B is a block diagram of an exemplary video decoder 200 according to one embodiment of the present invention. In the example of Figure 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, an additive 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 called an interprediction unit) 210 and an intraprediction unit 209. In some examples, the video decoder 200 can perform a decoding process that is substantially the reverse of the encoding process described with respect to the video encoder 100 in Figure 2A.

[0115] During decoding, the video decoder 200 receives an encoded video bitstream from the video encoder 100, representing picture blocks and associated syntax elements of the encoded video slice. The video decoder 200 may also receive video data from the network entity 42 and optionally store the video data further in a video data storage unit (not shown in the figure). The video data storage unit can store video data, such as an encoded video bitstream, to be decoded by the components of the video decoder 200. The video data stored in the video data storage unit may be obtained from a storage device 40 or a local video source such as a camera, for example, 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 decode picture buffer (DPB) configured to store encoded video data from the encoded video bitstream. Therefore, although the video data storage unit is not shown in Figure 2B, the video data storage unit and the DPB 207 may be the same storage unit or may be separately located storage units. The video data storage unit and the DPB 207 may each include one of several 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 the chip together with the other components of the video decoder 200, or it may be located outside the chip relative to those components.

[0116] The network entity 42 may be, for example, a server, MANE, video editor / splicer, or another device configured to implement one or more of the above-described technologies. The network entity 42 may or may not include a video encoder, for example, video encoder 100. Before the network entity 42 transmits the encoded video bitstream to the video decoder 200, the network entity 42 may implement some of the technologies described herein. In some video decoding systems, the network entity 42 and the video decoder 200 may be components of separate devices. In other cases, the functions described with respect to the network entity 42 may be implemented by the same device including the video decoder 200. In some cases, the network entity 42 may be an example of the storage device 40 in Figure 1A.

[0117] The entropy decoding unit 203 of the video decoder 200 performs entropy decoding on the bitstream, generating quantized coefficients and several syntax elements. The entropy decoding unit 203 transfers the syntax elements to the prediction processing unit 208. The video decoder 200 may receive the syntax elements (one or more) at the video slice level and / or picture block level.

[0118] When a video slice is decoded into an intra-decoded (I) slice, the intra-prediction unit 209 of the prediction processing unit 208 can generate a predicted block of the picture block of the current video slice based on the signaled intra-prediction mode and the data of the block decoded before the current frame or picture. When a video slice is decoded into an inter-decoded (i.e., B or P) slice, the inter-prediction unit 210 of the prediction processing unit 208 can determine the inter-prediction mode to be used to decode the current picture block of the current video slice based on the syntax element received from the entropy decode unit 203, and decode the current picture block based on the determined inter-prediction mode (for example, perform inter-prediction on the current picture block). Specifically, motion information of the current picture block, or a subblock of the current picture block of the current video slice, is predicted based on the inter-prediction mode (for example, the inter-prediction mode specified by the syntax element or the default inter-prediction mode). In this way, a prediction block of a subblock of the current picture block or a prediction block of the current picture block is obtained or generated in the motion compensation process using predicted motion information of the current picture block or a subblock of the current picture block. The motion information here may include reference picture information and motion vectors. The reference picture information may include, but is not limited to, one-way / two-way prediction information, a reference picture list number, and a reference picture index corresponding to the reference picture list. For interpretation, the prediction block may be generated from one of the reference pictures in one of the reference picture lists. The video decoder 200 may construct 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 either or both of reference frame list 0 and reference frame list 1. It should be understood that the interprediction unit 210 performs a motion compensation process. The following describes in detail an interprediction process that predicts the motion information of the current picture block or its subblocks using the motion information of the reference block in various new interprediction modes. The following describes in detail a process that predicts the motion information of one or more subblocks (specifically, each subblock or all subblocks) in the current picture block in an affine mode in this application (e.g., an advanced motion vector prediction mode based on an affine transformation or a merge prediction mode based on an affine transformation). 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.

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

[0120] After the interprediction unit 210 generates a prediction block to be used for the current picture block or a subblock of the current picture block, the video decoder 200 adds the residual block from the inverse transform unit 205 with the corresponding prediction block generated by the interprediction unit 210 to obtain a reconstructed block, i.e., a decoded picture block. The adder unit 211 represents a component that performs the addition operation. If necessary, a loop filter unit may be used further (in or after the decode loop) to smooth the samples, or the video quality may be improved in other ways. The filter unit 206 may represent one or more loop filter units, for example, an unblock filter unit, an adaptive loop filter (ALF) unit, and a sample-adaptive offset (SAO) filter unit. Although the filter unit 206 is shown as an in-loop filter unit in Figure 2B, in other implementations, the filter unit 206 may be implemented as a post-loop filter unit. In one example, the filter unit 206 can be applied to block reconstruction to reduce block distortion, the result of which is output as a decoded video stream. In addition, decoded picture blocks within a given frame or picture may be further stored in a decoded picture buffer 207, which stores reference pictures used for subsequent motion compensation. The decoded picture buffer 207 may be part of a storage unit, and may further store decoded video for subsequent presentation on a display device (e.g., display device 220 in Figure 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 produce an output video stream without processing by the filter unit 206. Alternatively, for some picture blocks or picture frames, the entropy decoding unit 203 of the video decoder 200 may not obtain quantization 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] Figure 5A is an illustrative schematic diagram of motion information for the current picture block 600 and the reference block according to one embodiment of the present application. As shown in Figure 5A, W and H are the width and height of the current picture block 600 and the width and height of the coposition block 600' of the current picture block 600. The reference block of the current picture block 600 includes a spatial neighbor block above the current picture block 600, a spatial neighbor block to the left of the current picture block 600, a spatial neighbor block below the coposition block 600', and a spatial neighbor block to the right of the coposition block 600'. The coposition block 600' is a picture block located within the reference picture and having the same size, shape, and coordinates as the current picture block 600. It should be noted that there is no motion information for the spatial neighbor block below the current picture block and the spatial neighbor block to the right of the current picture block, and these are not encoded. It should be understood that the current picture block 600 and coposition block 600' can have any block size. For example, the current picture block 600 and coposition block 600' can include, but are not limited to, 16×16 samples, 32×32 samples, 32×16 samples, 16×32 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 coposition block 600' may be divided into multiple M×N subblocks. In other words, the size of each subblock is M×N samples. Furthermore, the size of each reference block is also M×N samples, i.e., the same as the size of the subblocks of the current picture block. The coordinates in Figure 5A are measured in 1 M×N block. "M×N" and "M by N" can be used interchangeably to refer to the sample size of the picture block in the horizontal and vertical dimensions. In other words, there are M samples horizontally and N samples vertically. Here, M and N represent non-negative integer values.Furthermore, in a block, the number of samples in the horizontal direction and the number of samples in the vertical direction do not necessarily have to be the same. For example, here M=N=4. Of course, the size of the subblocks of the current picture block and the size of the reference block may alternatively be 8x8 samples, 8x4 samples, 4x8 samples, or the smallest predicted block size. Also, the picture blocks described herein may be understood as, but are not limited to, predicted units (PUs), encoded units (CUs), or transformed units (TUs). According to the provisions of various video compression encoding standards, a CU may contain one or more predicted units PU, or the size of a PU may be the same as the size of a CU. Picture blocks may have a fixed or variable size, and the size may vary in different video compression encoding standards. In addition, the current picture block is the picture block currently to be encoded or decoded, for example, a predicted unit to be encoded or decoded.

[0123] For example, whether each spatial neighbor block to the left of picture block 600 is currently available may be determined sequentially along direction 1, and whether each spatial neighbor block above picture block 600 is currently available may be determined sequentially along direction 2. For example, it is determined whether a neighbor block (also called a reference block; here, "neighbor block" and "reference block" can be used interchangeably) is inter-encoded, and if the neighbor block exists and is inter-encoded, the neighbor block is available; or if the neighbor block does not exist or is intra-encoded, the neighbor block is unavailable. If the neighbor block is intra-encoded, motion information of another neighboring reference block is copied as motion information of the neighbor block. Whether the spatial neighbor blocks below and to the right of coposition block 600' are available is detected using a similar method, details of which are not described here.

[0124] Furthermore, if the size of the available reference block and the size of the current picture block's subblocks are 4x4, the motion information of the available reference block can be directly retrieved. 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 may be retrieved and used as the motion information of the available reference block. The coordinates of the top-left vertex of the central 4x4 block relative to the top-left vertex of the reference block are ((W / 4) / 2x4, (H / 4) / 2x4). Here, the division operation is an exact division operation. If M=8 and N=4, the coordinates of the top-left vertex of the central 4x4 block relative to the top-left vertex of the reference block are (4,0). Optionally, the motion information of the top-left 4x4 block of the reference block may be retrieved instead and used as the motion information of the available reference block. However, the present invention is not limited to this.

[0125] For ease of explanation, the following uses subblocks to represent M×N subblocks and neighbor blocks to represent neighboring M×N blocks.

[0126] Interpretation is a crucial step in the embodiments of this application. From the decoder's perspective, interpretation involves searching the reconstructed picture for a matching reference block for the currently encoded block in the current picture. As shown in Figure 5B, the 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 "values" are not distinguished below) for the sample values ​​of samples in the currently encoded block Fc. This process is called motion estimation (ME). Motion information for the currently encoded block is also transmitted. From the decoder's perspective, motion information must be obtained through parsing during interpretation, and based on the obtained motion information, a reference block is determined in the reconstructed picture, and the sample values ​​of samples in that block are used as predicted information. This process is called motion compensation (MC). The reconstructed information is obtained by combining the predicted information and residual information and performing a filtering operation on the combined information. The ideas in this application may be used in HEVC or in other video encoding / decoding standards. The following describes the possible cases of interpredictive mode on the encoder side, using an example where this idea is used in HEVC. The possible cases of interpredictive mode on the decoder side are similar, and therefore no further description is provided.

[0127] HEVC offers two modes: Advanced Motion Vector Prediction (AMVP) mode and merge mode. These two modes are described separately below.

[0128] In AMVP mode, an affine candidate motion vector list is first constructed using motion information from encoded blocks that are spatially or temporally neighbors to the currently encoded block. Then, the optimal motion vector is selected from the affine candidate motion vector list as the motion vector predictor (MVP) for the currently encoded block. The rate-distortion cost is calculated using equation (0-1), where 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 performed using the candidate motion vector predictor, R is the bit rate, and λ is the Lagrange multiplier. The encoder 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. Furthermore, a motion search is performed in the neighbor domain centered on the MVP to obtain the actual motion vector of the currently encoded block. The encoder transfers the difference between the MVP and the actual motion vector (motion vector difference) to the decoder. J = SAD + λR (0-1)

[0129] In merge mode, a candidate motion information list is first constructed using motion information from encoded blocks that are spatially or temporally neighbors to the currently encoded block. Then, based on rate-distortion cost, the best motion information is determined from the candidate motion information list and used as the motion information for the currently encoded block. The index value of the position of the best motion information in the candidate motion information list (denoted as the merge index; the same applies hereafter) is transferred to the decoder. The spatial and temporal candidate motion information for the currently encoded block is shown in Figure 5C. The spatial candidate motion information comes from five spatially neighboring blocks (A0, A1, B0, B1, B2). If a neighboring block is unavailable or if it is in intra encoding mode, that neighboring block is not added to the candidate motion information list. The temporal candidate motion information for the currently encoded 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 unavailable, the block at position C is selected.

[0130] In HEVC interpretation, all samples in a currently coded block use the same motion information, and then motion compensation is performed based on this information to obtain predictors for the samples in the coded block. However, not all samples in a currently coded block have the same motion characteristics. Using the same motion information can lead to inaccurate motion-compensated predictions and more residual information.

[0131] Existing video coding standards use block-matching motion estimation based on translational motion models, assuming that the motion of all samples within a block is consistent. However, in the real world, there is a wide variety of motion. Many objects, such as rotating objects, roller coasters rotating 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 translational motion models in existing coding standards are used for coding. Therefore, research on non-translational motion models has been conducted in industry and by Huawei. In particular, in-depth research has been conducted on motion models based on affine transforms to further improve coding efficiency.

[0132] In predictions based on non-translational motion models, the same motion model is used on both the encoder and decoder sides to estimate the motion information of each sub-motion compensation unit within the currently encoded block. Motion compensation is then performed based on this sub-motion compensation unit's motion information to obtain the predicted block, thereby improving prediction efficiency. Commonly used motion models include 6-parameter affine models and 4-parameter affine transformation models.

[0133] The four-parameter affine transformation model is given by equation (0-2):

number

[0134] A four-parameter affine transformation model can be represented by the motion vectors of two samples and the coordinates of those samples relative to the top-left sample of the currently encoded block. The samples used to represent the motion model parameters are denoted as control points. When 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 currently encoded block, as well as the position coordinates (x1,y1) and motion vector (vx1,vy1) of the top-right control point of the currently encoded block, are first determined, and then the motion information of each sub-motion compensation unit within the currently encoded block is derived according to equation (0-3), where (x,y) is the coordinate of the sub-motion compensation unit relative to the top-left sample of the currently encoded block, and W is the width of the currently encoded block.

number

[0135] The 6-parameter affine transformation model is given by equation (0-4).

number

[0136] A 6-parameter affine transformation model can be represented by the motion vectors of three samples and the coordinates of those samples relative to the top-left sample of the currently encoded 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 currently encoded block, the position coordinates (x1,y1) and motion vector (vx1,vy1) of the top-right control point of the currently encoded block, and the position coordinates (x2,y2) and motion vector (vx2,vy2) of the bottom-left control point of the currently encoded block are first determined, and then the motion information of each sub-motion compensation unit within the currently encoded block is derived according to equation (0-5), where (x,y) is the coordinate of the sub-motion compensation unit relative to the top-left sample of the currently encoded block, and W and H are the width and height of the currently encoded block, respectively.

number

[0137] The 8-parameter bilinear model is given by equation (0-6).

number

[0138] An 8-parameter bilinear model can be represented by the motion vectors of four samples and the coordinates of those samples relative to the top-left sample of the currently coded block. When the sample at the top-left vertex (0,0), the top-right vertex (W,0), the bottom-left vertex (0,H), and 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 equation (0-7). Here, (x,y) are the coordinates of the submotion compensation unit relative to the top-left sample of the currently encoded block, and W and H are the width and height of the currently encoded block, respectively.

number

[0139] The coded blocks predicted using a non-translational motion model are called non-translational coded blocks.

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

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

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

[0143] The motion vectors of the top-left and top-right control points of the currently encoded block are determined based on the motion information of the neighboring encoded blocks of the currently encoded 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 top-left control point of the currently encoded block, and the motion vectors of the top-right neighboring encoded blocks D and E are used as candidate motion vectors for the top-right control point of the currently encoded block. The candidate motion vectors for the top-left and top-right control points are combined to form a 2-tuple queue of candidate motion vectors for those two control points.

number

[0144] Here, v0 represents the candidate motion vector for the top-left control point, and v1 represents the candidate motion vector for the top-right control point. The positions of the 2-tuples in the queue are indexed, with index values ​​of 0, 1, 2, 3, 4, and 5 respectively.

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

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

[0147] On the encoder side, the motion vector of each sub-motion compensation unit (an N1 × N2 sample block obtained through sampling or partitioning according to a specific method) in the currently encoded block is obtained based on each candidate motion vector 2-tuple according to equation (3). This gives the sample value at the position in the reference frame that the motion vector of each sub-motion compensation unit points to. This sample value is used as a predictor for performing motion compensation based on affine transform. The average of the differences between the original values ​​and predictors of all samples in the currently encoded block is calculated, and the motion vector in the candidate motion vector 2-tuple corresponding to the minimum difference average is selected as the motion vector predictor for the two control points in the currently encoded block. The 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] On the decoder side, the index is parsed to obtain motion vector predictors for the two control points.

[0149] (3) Determine the motion vector of the control point.

[0150] On the encoder side, motion vector predictors for two control points are used as starting search points to perform a motion search within a specific search range in order 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 sent to the decoder side.

[0151] On the decoder side, the difference in motion vectors between 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 dominant motion model-based motion vector prediction method involves: traversing the neighboring blocks of the current coded block in the order A, B, C, D, E in Figure 7A (as shown in Figure 5D, neighboring blocks A, B, C, D, E are distributed around CTU 502 where the current coded block is located), finding the affine coded block, obtaining the motion vector of the control point of the affine coded block, constructing a motion model based on the position coordinates and motion vector of the control point of the affine coded block, and then substituting the position coordinates of the control point of the current coded block into the motion model to estimate the motion vector predictor of the control point of the current block. Specifically, the upper-left and upper-right control points of the affine coded block are used here to construct the motion model (sometimes information about the lower-left control point is also used). Figure 5D is used as an example. If neighboring block E is a neighboring affine coded block, the position coordinates and motion vector of the upper-left control point of neighboring block E are shown.

number

number

number

number

number

number

[0153] Figure 6 is a flowchart of process 700 of an encoding method according to one embodiment of the present invention. Process 700 may be performed by a video encoder 100, specifically by an interprediction unit (also referred to as an interpredictor) 110 and an entropy encoding unit (also referred to as an entropy encoder) 103 of the video encoder 100. Process 700 is described as a series of steps or operations. It should be understood that the steps or operations of process 700 may be performed in various sequences and / or simultaneously, and are not limited to the execution sequence shown in Figure 6. A video data stream containing multiple video frames is assumed to be using a video encoder. If a first neighboring affine coding 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 lower left and lower right control points of the first neighboring affine coding block. The relevant explanation corresponding to the process shown in Figure 6 is as follows:

[0154] Step S700: The video encoder determines the interpretation mode for the currently encoded block.

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

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

[0157] If the currently determined interpretation mode for the coding block is merge mode, steps S721 to S723 are performed.

[0158] AMVP Mode:

[0159] Step S711: The video encoder builds a list of candidate motion vector predictors (MVPs).

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

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

[0162] First, all or some of the neighboring blocks of the currently coded block are traversed in a predetermined order to determine the nearest neighbor affine coded block among those neighboring blocks. There may be one or more determined nearest neighbor affine coded blocks. For example, neighboring blocks A, B, C, D, and E shown in Figure 7A may be traversed sequentially to determine the nearest neighbor affine coded block among neighboring blocks A, B, C, D, and E. The interpretation unit determines a group of candidate motion vector predictors based on at least one nearest neighbor affine coded block (each group of candidate motion vector predictors is a 2-tuple or triplet). The following uses one nearest neighbor affine coded block as an example for description. For simplicity of explanation, this nearest neighbor affine coded block is called the first nearest neighbor 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. Furthermore, the motion vectors of the control points of the current coded block are predicted based on the first affine model. The manner in which the motion vectors of the control points of the current coded block are predicted 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 coded block. Therefore, the following describes the different cases.

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

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

[0166] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors and position coordinates of the two lowest control points of the first neighborhood affine coding block.

[0167] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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, and (x1, y1) are the coordinates of the top-right control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, and (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block.

[0169] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves encoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, 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 of the position (x4+cuW-1,y4+cuH-1) in the picture, and (vx6,vy6) may be obtained by reading the motion vector of the position (x4,y4+cuH-1) in the picture.

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

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

[0173] If the first neighboring affine coding block is located within the CTU above the currently coded block, the position coordinates and motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can be obtained.

[0174] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

[0175] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left, top-right, and bottom-left control points of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points of the currently encoded 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 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

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

[0178] Embodiment 2: The candidate motion vector predictor MVP list is constructed using a motion vector prediction method based on combinations of control points.

[0179] The manner in which the candidate motion vector predictor (MVP) list is constructed depends on the parameter model of the currently encoded block. Details are described below.

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

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

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

[0183] The motion vectors of the top-left, top-right, and bottom-left vertices of the currently encoded block are estimated based on the motion information of neighboring encoded blocks. As shown in Figure 7B, first, the motion vectors of encoded blocks A and / or B and / or C in the vicinity of the top-left vertex are used as candidate motion vectors for the top-left vertex of the currently encoded block; the motion vectors of encoded blocks D and / or E in the vicinity of the top-right vertex are used as candidate motion vectors for the top-right vertex of the currently encoded block; and the motion vectors of encoded blocks F and / or G in the vicinity of the bottom-left vertex are used as candidate motion vectors for the bottom-left vertex of the currently encoded block. The candidate motion vectors for the top-left, top-right, and bottom-left vertices may be combined to obtain a group of candidate motion vector predictors. Multiple groups of candidate motion vector predictors obtained through the combinations in this embodiment may constitute 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 the candidate motion vector predictors predicted in Embodiment 1, or using only the candidate motion vector predictors predicted in Embodiment 2, or using both the candidate motion vector predictors predicted in Embodiment 1 and the candidate motion vector predictors predicted in Embodiment 2. In addition, the candidate motion vector predictor MVP list may be further pruned, sorted, and then truncated or padded to a certain amount according to pre-configured rules. If each group of candidate motion vector predictors in the candidate motion vector predictor MVP list contains motion vector predictors with three control points, the candidate motion vector predictor MVP list may be called a triplet list; or if each group of candidate motion vector predictors in the candidate motion vector predictor MVP list contains motion vector predictors with two control points, the candidate motion vector predictor MVP list may be called 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 the rate-distortion cost criterion. Specifically, for each candidate motion vector group in the candidate motion vector predictor MVP list, motion compensation is performed to obtain the predictor for each subblock, so that the motion vector for each subblock of the current block is obtained through computation, and the predictor for the current block is obtained. 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 the index corresponding to the target candidate motion vector group into the bitstream to be transmitted.

[0187] Specifically, the video encoder can use a target candidate motion vector group as a starting search point to further search within a preset search range for the lowest cost motion vector, which is a group of control points, according to a rate-distortion cost criterion, and then determine the motion vector difference MVD between the target candidate motion vector group and the motion vectors of the control point group. For example, if the first group of control points includes the first and second control points, it is necessary to determine 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 control point group, and to determine 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 control point group.

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

[0189] Step S714: The video encoder uses an affine transformation model to obtain the motion vectors of each subblock of the currently encoded block based on the determined motion vectors of the control points of the currently encoded block.

[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 (top-left and top-right control points) or three control points (e.g., top-left, top-right, and bottom-left control points). For each subblock of the currently encoded block (one subblock may be equivalent to one motion compensation unit), motion information of a sample at a pre-defined 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 (where M is less than or equal to the width W of the currently encoded block, N is less than or equal to the height H of the currently encoded block, and M, N, W, and H are each positive integers, typically powers of 2, e.g., 4, 8, 16, 32, 64, or 128), then the sample at the pre-defined position may be the center point of the motion compensation unit (M / 2, N / 2), the top-left sample (0, 0), the top-right sample (M-1, 0), or a sample at any other position. Figure 8A shows a 4x4 motion compensation unit, and Figure 8B shows an 8x8 motion compensation unit. The center points of corresponding motion compensation units are represented by triangles.

[0191] Currently, the coordinates of the center point of the motion compensation unit for a sample at the top-left vertex of the coding block are calculated according to equation (5), where i is the i-th motion compensation unit in the horizontal direction (from left to right), j is the j-th 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 currently encoded block. Then, based on the affine model type (6 parameters or 4 parameters) of the currently encoded block, (x (i,j) ,y (i,j) ) is substituted into equation (6-1) of the 6-parameter affine model, or (x (i,j) ,y (i,j) ) is substituted into equation (6-2) of the 4-parameter affine model to obtain motion information of the center point of each motion compensation unit, and this motion information is used to obtain the motion vector (vx) of all samples in this motion compensation unit.(i,j) ,vy (i,j) It is used as ).

number

[0192] Optionally, if the currently coded block is a 6-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a 6-parameter affine model constructed using three control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a 6-parameter affine model constructed using three control points. For example, the motion vector of the subblock at the lower left corner of the currently coded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently coded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently coded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently coded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently coded block are used (for example, when a list of candidate motion vector predictors (MVPs) for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the currently coded block), the exact values ​​are used rather than estimates. W is the width of the currently coded block, and H is the height of the currently coded block.

[0193] Optionally, if the currently coded block is a four-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a four-parameter affine model constructed using two control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock at the lower left corner of the currently coded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently coded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently coded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently coded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently coded block are used (for example, when a list of candidate motion vector predictors (MVPs) for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the currently coded block), the exact values ​​are used rather than estimates. W is the width of the currently coded block, and H is the height of the currently coded block.

[0194] Step S715: The video encoder performs motion compensation based on the motion vectors of each subblock in the currently encoded block to obtain the predicted sample values ​​for each subblock. For example, based on the motion vector and reference frame index of each subblock, the corresponding subblock is found in the reference frame, and interpolation filtering is performed to obtain the predicted sample values ​​for each subblock.

[0195] Merge mode:

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

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

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

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

[0200] A first affine model is determined based on the motion vectors of the control points of the first neighboring affine coding block. Furthermore, the motion vectors of the control points of the currently coding block are predicted based on the first affine model. Details are as follows:

[0201] If the first neighboring affine coding block is located within the CTU above the currently coded block, the position coordinates and motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can be obtained.

[0202] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

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

[0204] Optionally, the motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded block. A candidate motion vector 2-tuple is formed and added to the 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

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

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

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

[0209] Solution A: The motion information of two control points in the currently encoded block is combined to construct a four-parameter affine transformation model. The two control points can be 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 written as Affine(CP1,CP2).

[0210] It should be noted that different combinations of control points may be transformed into control points at the same location. For example, a four-parameter affine transformation model obtained based on the combination {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} may be 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 same 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 the parameters in the parameter model, and (x,y) represents 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 and top-right control points, and this group of motion vector predictors is added to the candidate motion information list.

[0213] The formula (8) that converts {CP1,CP2} to {CP1,CP2,CP3} is as follows:

number

[0214] The formula (9) that converts {CP1,CP3} to {CP1,CP2,CP3} is as follows:

number

[0215] The formula (10) that converts {CP2,CP3} to {CP1,CP2,CP3} is as follows:

number

[0216] The formula (11) that converts {CP1,CP4} to {CP1,CP2,CP3} is as follows:

number

[0217] The formula (12) that converts {CP2,CP4} to {CP1,CP2,CP3} is as follows:

number

[0218] The formula (13) that converts {CP3,CP4} to {CP1,CP2,CP3} is as follows:

number

[0219] Solution B: The motion information of the three control points of the currently encoded block is combined to construct a 6-parameter affine transformation model. The three control points can be combined as follows: {CP1,CP2,CP4}, {CP1,CP2,CP3}, {CP2,CP3,CP4}, or {CP1,CP3,CP4}. For example, a 6-parameter affine transformation model constructed using control points CP1, CP2, and CP3 is written 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 6-parameter affine transformation model obtained based on combinations such as {CP1,CP2,CP4}, {CP2,CP3,CP4}, or {CP1,CP3,CP4} can be transformed to be represented by the control point {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 same 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) represents the position coordinates.

[0222] More directly, this conversion 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] The equation (15) for converting {CP1, CP2, CP4} to {CP1, CP2, CP3} is as follows:

Number

[0224] The equation (16) for converting {CP2, CP3, CP4} to {CP1, CP2, CP3} is as follows:

Number

[0225] The equation (17) for converting {CP1, CP3, CP4} to {CP1, CP2, CP3} is 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 Embodiment 1, or using only the candidate motion vector predictors predicted in Embodiment 2, or using both the candidate motion vector predictors predicted in Embodiment 1 and the candidate motion vector predictors predicted in Embodiment 2. Furthermore, the candidate motion information list may be further pruned, sorted, and then truncated or padded to a certain number according to pre-configured rules. If each group of candidate motion vector predictors in the candidate motion information list contains motion vector predictors with three control points, the candidate motion information list may be called a triplet list; or if each group of candidate motion vector predictors in the candidate motion information list contains motion vector predictors with two control points, the candidate motion information list may be called 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 the rate-distortion cost criterion. Specifically, for each candidate motion vector group in the candidate motion information list, motion compensation is performed to obtain predictors for each subblock, so that the motion vectors for each subblock of the current block are obtained through calculation, and predictors for the current block are obtained. The candidate motion vector group with the smallest error between the predictor and the original value is selected as the group of optimal motion vector predictors, 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 the index, reference frame index, and predicted direction corresponding to the target candidate motion vector group into the bitstream to be transmitted.

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

[0230] Step S724: The video encoder uses an affine transformation model based on parameters to obtain the motion vector of each sub-block of the current encoding block based on the determined motion vector of the control point of the current encoding block.

[0231] Specifically, the target candidate motion vector group includes the motion vectors of two control points (the upper left control point and the upper right control point) or three control points (for example, the upper left control point, the upper right control point, and the lower left control point). For each sub-block of the current encoding block (one sub-block may be equivalent to one motion compensation unit), the motion information of the samples at the preset positions within the motion compensation unit may be used to represent the motion information of all the samples within the motion compensation unit. When the size of the motion compensation unit is M×N (M is less than or equal to the width W of the current encoding block, N is less than or equal to the height H of the current encoding block, M, N, W, and H are positive integers respectively, usually powers of 2, such as 4, 8, 16, 32, 64, or 128), the samples at the preset positions 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 the samples at other positions. 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 with respect to the sample at the upper left vertex of the current encoding block are calculated according to Equation (5). Here, i is the i-th motion compensation unit in the horizontal direction (from left to right), j is the j-th motion compensation unit in the vertical direction (from top to bottom), (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 currently encoded block. Then, based on the affine model type (6 parameters or 4 parameters) of the currently encoded block, (x (i,j) ,y (i,j) ) is substituted into equation (6-1) of the 6-parameter affine model, or (x (i,j) ,y (i,j) ) is substituted into equation (6-2) of the 4-parameter affine model to obtain motion information of the center point of each motion compensation unit, and this motion information is used to obtain the motion vector (vx) of all samples in this motion compensation unit. (i,j) ,vy (i,j) It is used as ).

[0233] Optionally, if the currently coded block is a 6-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a 6-parameter affine model constructed using three control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a 6-parameter affine model constructed using three control points. For example, the motion vector of the subblock at the lower left corner of the currently encoded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently encoded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently encoded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently encoded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently encoded block are used (for example, when a list of candidate motion information for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the current block), the exact values ​​are used rather than estimates. W is the width of the currently encoded block, and H is the height of the currently encoded block.

[0234] Optionally, if the currently coded block is a four-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a four-parameter affine model constructed using two control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock at the lower left corner of the currently encoded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently encoded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently encoded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently encoded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently encoded block are used (for example, when a list of candidate motion information for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the current block), the exact values ​​are used rather than estimates. W is the width of the currently encoded block, and H is the height of the currently encoded block.

[0235] Step S725: The video encoder performs motion compensation based on the motion vectors of each subblock in the currently encoded block to obtain the predicted sample values ​​for each subblock. Specifically, the predicted sample values ​​for the currently encoded block are predicted based on the motion vectors of one or more subblocks in the currently encoded block, the reference frame index and the predicted direction indicated by the index.

[0236] If the coding tree unit CTU on which the first neighboring affine coding block is located is currently above the coding block, it can be understood that information about the lowest control point of the first neighboring affine coding block is being read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on a first group of control points of the first neighboring affine coding block, the first group of control points includes the lower left and lower right control points of the first neighboring affine coding block, instead of using the upper left, upper right, and lower left control points of the first neighboring coding block as a fixed first group of control points in the prior art. Thus, according to the method for determining the first group of control points in this application, 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 coding performance.

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

[0238] Step S900: The video encoder determines the interprediction mode of the currently encoded block.

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

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

[0241] If the currently determined interpretation mode for the coding block is merge mode, steps S921 to S923 are performed.

[0242] AMVP Mode:

[0243] Step S911: The video encoder constructs a list of candidate motion vector predictors (MVPs).

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

[0245] Embodiment 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 the current encoded block are traversed in a predetermined order to determine the neighboring affine-encoded blocks among those neighboring blocks. There may be one or more determined neighboring affine-encoded blocks. For example, the neighboring blocks A, B, C, D, E shown in FIG. 7A may be sequentially traversed to determine the neighboring affine-encoded blocks among the neighboring blocks A, B, C, D, E. The inter prediction unit determines a group of candidate motion vector predictors based on at least one neighboring affine-encoded block (each group of candidate motion vector predictors is a 2-tuple or triplet). The following uses one neighboring affine-encoded block as an example for description. For simplicity of explanation, this neighboring affine-encoded block is referred to as the first neighboring affine-encoded block. Details are as follows.

[0247] The first affine model is determined based on the motion vector of the control points of the first neighboring affine-encoded block. Further, the motion vector of the control points of the current encoded block is predicted based on the first affine model. The manner of predicting the motion vector of the control points of the current encoded block based on the motion vector of the control points of the first neighboring affine-encoded block varies depending on the parameter model of the current encoded block. Therefore, the following gives descriptions for different cases.

[0248] A: The parameter model of the current encoded block is a 4-parameter affine transformation model. The derivation manner may be as follows.

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

[0250] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors and position coordinates of the two lowest control points of the first neighborhood affine coding block.

[0251] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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, and (x1, y1) are the coordinates of the top-right control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, and (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block.

[0253] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves encoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, 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 of the position (x4+cuW-1,y4+cuH-1) in the picture, and (vx6,vy6) may be obtained by reading the motion vector of the position (x4,y4+cuH-1) in the picture.

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

[0256] The 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 rightmost control points of the first neighborhood affine coding block.

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

number

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

[0259] If the first neighboring affine coding block is not located within the CTU above the current coding block and is not located within the CTU to the left of the current coding block, the manner in which the motion vectors of the control points of the current coding block are predicted is not limited herein. For example, in this case, the manner in which the motion vectors of the control points of the current coding block are predicted may be the same as or different from the prediction manner used when the first neighboring affine coding block is located within the CTU above the current coding block. In another example, in this case, the manner in which the motion vectors of the control points of the current coding block are predicted may be the same as or different from the prediction manner used when the first neighboring affine coding block is located within the 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 is obtained based on a second group of control points for a second neighboring affine coding block. The position of one or more control points in the second group of control points for the second neighboring affine coding block relative to the second neighboring affine coding block is different from the position of one or more control points in the first group of control points for the first neighboring affine coding block relative to the first neighboring affine coding block (for example, the control points included in the first group of control points for the first neighboring affine coding block are the lower-left, lower-right, and upper-left control points of the first neighboring affine coding block, while the control points included in the second group of control points for the second neighboring affine coding block are the upper-right, lower-right, and lower-left control points of the second neighboring affine coding block).

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

[0262] If the first neighboring affine coding block is located within the CTU above the currently coded block, the position coordinates and motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can be obtained.

[0263] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

[0264] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left, top-right, and bottom-left control points of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points of the currently encoded 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

[0266] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves encoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, alternatively, be pre-stored in memory and read from memory for use when needed.

[0267] If the first neighboring affine coding block is located within the 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 coding block can be obtained. For example, the position coordinates (x5, y5) and motion vector (vx5, vy5) of the upper right control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block, may be obtained.

[0268] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding 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 top-left, top-right, and bottom-left control points of the currently coded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points 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 currently encoded block, (x1, y1) are the coordinates of the top-right control point of the currently encoded block, and (x2, y2) are the coordinates of the bottom-left control point of the currently encoded block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the currently encoded block, (vx1, vy1) is the predicted motion vector of the top-right control point of the currently encoded block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the currently encoded block.

[0271] When a first neighboring affine coding block is not located within the CTU above the current coding block and is not located within the CTU to the left of the current coding block, the manner in which the motion vectors of the control points of the current coding block are predicted is not limited herein. For example, in this case, the manner in which the motion vectors of the control points of the current coding block are predicted may be the same as or different from the prediction manner used when the first neighboring affine coding block is located within the CTU above the current coding block. As another example, in this case, the manner in which the motion vectors of the control points of the current coding block are predicted may be the same as or different from the prediction manner used when the first neighboring affine coding block is located within the 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 is obtained based on a second group of control points for a second neighboring affine coding block. The position of one or more control points in the second group of control points for the second neighboring affine coding block relative to the second neighboring affine coding block is different from the position of one or more control points in the first group of control points for the first neighboring affine coding block relative to the first neighboring affine coding block (for example, the control points included in the first group of control points for the first neighboring affine coding block are the lower-left, lower-right, and upper-left control points of the first neighboring affine coding block, while the control points included in the second group of control points for the second neighboring affine coding block are the upper-right, lower-right, and lower-left control points of the second neighboring affine coding block).

[0273] Embodiment 2: The candidate motion vector predictor MVP list is constructed using a motion vector prediction method based on combinations of control points.

[0274] Specifically, the principle of Embodiment 2 is the same as the principle of Embodiment 2 in step S711. Therefore, the details will not be explained again here.

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

[0276] For further details, please refer to the explanation in step S712. Further details will not be explained again here.

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

[0278] For further details, please refer to the explanation in step S713. Further details will not be explained again here.

[0279] Merge mode:

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

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

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

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

[0284] A first affine model is determined based on the motion vectors of the control points of the first neighboring affine coding block. Furthermore, the motion vectors of the control points of the currently coding block are predicted based on the first affine model. Details are as follows:

[0285] If the first neighboring affine coding block is located within the CTU above the currently coded block, the position coordinates and motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can be obtained.

[0286] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

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

[0288] Optionally, the motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded block. A candidate motion vector 2-tuple is formed and added to the 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

[0290] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves encoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, alternatively, be pre-stored in memory and read from memory for use when needed.

[0291] If the first neighboring affine coding block is located within the 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 coding block can be obtained. For example, the position coordinates (x5, y5) and motion vector (vx5, vy5) of the upper right control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block, may be obtained.

[0292] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

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

[0294] Optionally, the motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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 currently encoded block, (x1, y1) are the coordinates of the top-right control point of the currently encoded block, and (x2, y2) are the coordinates of the bottom-left control point of the currently encoded block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the currently encoded block, (vx1, vy1) is the predicted motion vector of the top-right control point of the currently encoded block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the currently encoded block.

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

[0297] Optionally, the candidate motion information list further includes a second candidate motion vector group, the second candidate motion vector group is obtained based on a second group of control points of a second neighboring affine coding block. The position 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 is different from the position 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 (for example, the control points included in the first group of control points of the first neighboring affine coding block are the lower-left, lower-right, and upper-left control points 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 upper-right, lower-right, and lower-left control points of the second neighboring affine coding block).

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

[0299] Specifically, the principle of Embodiment 2 is the same as the principle of Embodiment 2 in step S721. Therefore, the details will not be explained again here.

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

[0301] For further details, please refer to the explanation in step S722. Further details will not be explained again here.

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

[0303] For further details, please refer to the explanation in step S723. Further details will not be explained again here.

[0304] Step S924: The video encoder uses a 6-parameter affine transform model to obtain the motion vectors of each subblock of the currently encoded block based on the motion vectors of the three control points of the currently encoded block.

[0305] For further details, please refer to the explanation in step S724. Further details will not be explained again here.

[0306] Step S925: The video encoder performs motion compensation based on the motion vectors of each subblock in the currently encoded block to obtain the predicted sample values ​​for each subblock.

[0307] For further details, please refer to the explanation in step S725. Further details will not be explained again here.

[0308] If the coding tree unit CTU in which the first neighboring affine coding block is located is above the current coding block, it can be understood that information about the lowest control point of the first neighboring affine coding block is read from memory. If the coding tree unit CTU in which the first neighboring affine coding block is located is to the left of the current coding block, then 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 a first group of control points of the first neighboring affine coding block, the first group of control points is determined based on the relative position of the coding tree unit CTU with respect to the current coding block, instead of using the upper-left, upper-right, and lower-left control points of the first neighboring coding block as a fixed first group of control points in the prior art. Here, the first neighboring affine coding block is located within the CTU. Therefore, according to the method for determining the first group of control points in this 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 coding block is located within a coding tree unit (CTU) above the current coding block, the group of candidate motion vector predictors is determined based on the lower left, lower right, and upper right control points of the first neighboring affine coding block. Details are as follows:

[0310] Step S1000: The video encoder determines the interpretation mode for the currently encoded block.

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

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

[0313] If the currently determined interpretation mode for the coding block is merge mode, steps S1021 to S1023 are performed.

[0314] AMVP Mode:

[0315] Step S1011: The video encoder constructs a list of candidate motion vector predictors (MVPs).

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

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

[0318] First, all or some of the neighboring blocks of the currently coded block are traversed in a predetermined order to determine the nearest neighbor affine coded block among those neighboring blocks. There may be one or more determined nearest neighbor affine coded blocks. For example, neighboring blocks A, B, C, D, and E shown in Figure 7A may be traversed sequentially to determine the nearest neighbor affine coded block among neighboring blocks A, B, C, D, and E. The interpretation unit determines a group of candidate motion vector predictors based on at least one nearest neighbor affine coded block (each group of candidate motion vector predictors is a 2-tuple or triplet). The following uses one nearest neighbor affine coded block as an example for description. For simplicity of explanation, this nearest neighbor affine coded block is called the first nearest neighbor 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. Furthermore, the motion vectors of the control points of the current coded block are predicted based on the first affine model. The manner in which the motion vectors of the control points of the current coded block are predicted 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 coded block. Therefore, the following describes the different cases.

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

[0321] If the first neighboring affine coding 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 bottommost control points of the first neighboring affine coding 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 coding block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine coding block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine coding block may be obtained.

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

[0323] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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, and (x1, y1) are the coordinates of the top-right control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, and (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block.

[0325] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves encoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, 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 of the position (x4+cuW-1,y4+cuH-1) in the picture, and (vx6,vy6) may be obtained by reading the motion vector of the position (x4,y4+cuH-1) in the picture.

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

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

[0329] If the first neighboring affine coding block is located within the CTU above the current coding block, the position coordinates and motion vectors of the top-left control point and the two bottommost control points of the first neighboring affine coding 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 coding block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine coding block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine coding block may be obtained.

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

[0331] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left, top-right, and bottom-left control points of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points of the currently encoded 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

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

[0334] Embodiment 2: The candidate motion vector predictor MVP list is constructed using a motion vector prediction method based on combinations of control points.

[0335] Specifically, the principle of Embodiment 2 is the same as the principle of Embodiment 2 in step S711. Therefore, the details will not be explained again here.

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

[0337] For further details, please refer to the explanation in step S712. Further details will not be explained again here.

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

[0339] For further details, please refer to the explanation in step S713. Further details will not be explained again here.

[0340] Merge mode:

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

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

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

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

[0345] A first affine model is determined based on the motion vectors of the control points of the first neighboring affine coding block. Furthermore, the motion vectors of the control points of the currently coding block are predicted based on the first affine model. Details are as follows:

[0346] If the first neighboring affine coding block is located within the CTU above the current coding block, the position coordinates and motion vectors of the top-left control point and the two bottommost control points of the first neighboring affine coding 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 coding block, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the bottom-left control point of the first neighboring affine coding block, and the position coordinates (x7, y7) and motion vector (vx7, vy7) of the bottom-right control point of the first neighboring affine coding block may be obtained.

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

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

[0349] Optionally, the motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

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

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

[0353] Specifically, the principle of Embodiment 2 is the same as the principle of Embodiment 2 in step S721. Therefore, the details will not be explained again here.

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

[0355] For further details, please refer to the explanation in step S722. Further details will not be explained again here.

[0356] Step S1023: The video encoder encodes indices corresponding to target candidate motion vector groups into the bitstream to be transmitted.

[0357] For further details, please refer to the explanation in step S723. Further details will not be explained again here.

[0358] If the coding tree unit CTU on which the first neighboring affine coding block is located is currently above the coding block, it can be understood that information about the lowest control point of the first neighboring affine coding block is being read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on a first group of control points of the first neighboring affine coding block, the first group of control points includes the lower left and lower right control points of the first neighboring affine coding block, instead of using the upper left, upper right, and lower left control points of the first neighboring coding block as a fixed first group of control points in the prior art. Thus, according to the method for determining the first group of control points in this application, 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 coding performance.

[0359] In another optional embodiment on the encoder side, the group of candidate motion vector predictors is determined directly based on the lower-left and lower-right control points of the first neighboring affine coding block, regardless of the position of the first neighboring affine coding block relative to the current coding block. Details are as follows:

[0360] Step S1100: The video encoder determines the interprediction mode of the currently encoded block.

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

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

[0363] If the currently determined interpretation mode for the coding block is merge mode, steps S1121 to S1123 are performed.

[0364] AMVP Mode:

[0365] Step S1111: The video encoder constructs a list of candidate motion vector predictors (MVPs).

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

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

[0368] First, all or some of the neighboring blocks of the currently coded block are traversed in a predetermined order to determine the nearest neighbor affine coded block among those neighboring blocks. There may be one or more determined nearest neighbor affine coded blocks. For example, neighboring blocks A, B, C, D, and E shown in Figure 7A may be traversed sequentially to determine the nearest neighbor affine coded block among neighboring blocks A, B, C, D, and E. The interpretation unit determines a group of candidate motion vector predictors based on at least one nearest neighbor affine coded block (each group of candidate motion vector predictors is a 2-tuple or triplet). The following uses one nearest neighbor affine coded block as an example for description. For simplicity of explanation, this nearest neighbor affine coded block is called the first nearest neighbor 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. Furthermore, the motion vectors of the control points of the current coded block are predicted based on the first affine model. The manner in which the motion vectors of the control points of the current coded block are predicted 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 coded block. Therefore, the following describes the different cases.

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

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

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

[0373] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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, and (x1, y1) are the coordinates of the top-right control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, and (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block.

[0375] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves encoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, 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 of the position (x4+cuW-1,y4+cuH-1) in the picture, and (vx6,vy6) may be obtained by reading the motion vector of the 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, the second candidate motion vector group is obtained based on a second group of control points of a second neighboring affine coding block, the second group of control points of a second neighboring affine coding block includes the lower left and lower right control points of the second neighboring affine coding block.

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

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

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

[0381] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left, top-right, and bottom-left control points of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points of the currently encoded 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector 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, the second candidate motion vector group is obtained based on a second group of control points of a second neighboring affine coding block, the second group of control points of a second neighboring affine coding block includes the lower left and lower right control points of the second neighboring affine coding block.

[0384] Embodiment 2: The candidate motion vector predictor MVP list is constructed using a motion vector prediction method based on combinations of control points.

[0385] Specifically, the principle of Embodiment 2 is the same as the principle of Embodiment 2 in step S711. Therefore, the details will not be explained again here.

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

[0387] For further details, please refer to the explanation in step S712. Further details will not be explained again here.

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

[0389] For further details, please refer to the explanation in step S713. Further details will not be explained again here.

[0390] Merge mode:

[0391] Step S1121: The video encoder constructs a list of affine candidate motion vectors.

[0392] Specifically, the video encoder uses an interpretation unit (also called an interpretation module) to construct an affine candidate motion vector list (also called a candidate motion vector list). This construction can be performed in one of two embodiments or a combination of both embodiments. The constructed affine candidate motion vector list is a triplet affine candidate motion vector list. The two embodiments are specifically as follows:

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

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

[0395] A first affine model is determined based on the motion vectors of the control points of the first neighboring affine coding block. Furthermore, the motion vectors of the control points of the currently coding block are predicted based on the first affine model. Details are as follows:

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

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

[0398] Optionally, the motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left, top-right, and bottom-left control points of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points of the currently encoded block. A candidate motion vector triplet is formed and added to the 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 currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded block. A candidate motion vector 2-tuple is formed and added to the 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector 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, the second candidate motion vector group is obtained based on a second group of control points of a second neighboring affine coding block, the second group of control points of a second neighboring affine coding block includes the lower left and lower right control points of the second neighboring affine coding block.

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

[0403] Specifically, the principle of Embodiment 2 is the same as the principle of Embodiment 2 in step S721. Therefore, the details will not be explained again here.

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

[0405] For further details, please refer to the explanation in step S712. Further details will not be explained again here.

[0406] Step S1123: The video encoder encodes indices corresponding to target candidate motion vector groups into the bitstream to be transmitted.

[0407] For further details, please refer to the explanation in step S713. Further details will not be explained again here.

[0408] If the coding tree unit CTU on which the first neighboring affine coding block is located is currently above the coding block, it can be understood that information about the lowest control point of the first neighboring affine coding block is being read from memory. Therefore, in the above solution, in the process of constructing candidate motion vectors based on a first group of control points of the first neighboring affine coding block, the first group of control points includes the lower left and lower right control points of the first neighboring affine coding block, instead of using the upper left, upper right, and lower left control points of the first neighboring coding block as a fixed first group of control points in the prior art. Thus, according to the method for determining the first group of control points in this application, there is a very high probability 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 reads from memory and improving encoding performance.

[0409] Figure 9 is a flowchart of process 900 of a decoding method according to one embodiment of the present invention. Process 900 may be performed by the video decoder 200, specifically by the interprediction unit (also called the interpredictor) 210 and the entropy decoding unit (also called the entropy decoder) 203 of the 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 Figure 9. Assume that a video data stream containing multiple video frames is using the video decoder. If the first neighboring affine coding block is located within a coding tree unit (CTU) above the coding block, the group of candidate motion vector predictors is determined based on the lower left and lower right control points of the first neighboring affine coding block. The relevant explanation corresponding to the process shown in Figure 9 is as follows:

[0410] In any embodiment of the decoder, if the first neighboring affine coding block is located within a coding tree unit (CTU) above the current coding block, the group of candidate motion vector predictors is determined based on the lower left and lower right control points of the first neighboring affine coding block. Details are as follows:

[0411] Step S1200: The video decoder determines the interprediction mode for the currently encoded block.

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

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

[0414] If the currently determined interpretation mode for the coding block is merge mode, steps S1221 to S1225 are performed.

[0415] AMVP Mode:

[0416] Step S1211: The video decoder constructs a list of candidate motion vector predictors (MVPs).

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

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

[0419] First, all or some of the neighboring blocks of the currently coded block are traversed in a predetermined order to determine the nearest neighbor affine coded block among those neighboring blocks. There may be one or more determined nearest neighbor affine coded blocks. For example, neighboring blocks A, B, C, D, and E shown in Figure 7A may be traversed sequentially to determine the nearest neighbor affine coded block among neighboring blocks A, B, C, D, and E. The interpretation unit determines a group of candidate motion vector predictors based on at least one nearest neighbor affine coded block (each group of candidate motion vector predictors is a 2-tuple or triplet). The following uses one nearest neighbor affine coded block as an example for description. For simplicity of explanation, this nearest neighbor affine coded block is called the first nearest neighbor 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. Furthermore, the motion vectors of the control points of the current coded block are predicted based on the first affine model. The manner in which the motion vectors of the control points of the current coded block are predicted 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 coded block. Therefore, the following describes the different cases.

[0421] A: The current parameter model for the coding block is a four-parameter affine transform model. The derivation can be as follows (shown in Figure 9A).

[0422] If the first neighboring affine coding block is located within a coding tree unit (CTU) above the current coding block, the motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can 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 lowest control points of the first neighborhood affine coding block (step S1202).

[0424] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded 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, and (x1, y1) are the coordinates of the top-right control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, and (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block.

[0426] Optionally, 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 coding block are both calculated based on the position coordinates (x4, y4) of the upper-left control point of the first neighboring affine coding block. The position coordinates (x6, y6) of the lower-left control point of the first neighboring affine coding block are (x4, y4 + cuH), and the position coordinates (x7, y7) of the lower-right control point of the first neighboring affine coding block are (x4 + cuW, y4 + cuH), where cuW is the width of the first neighboring affine coding block and cuH is the height of the first neighboring affine coding block. Furthermore, the motion vector of the lower-left control point of the first neighboring affine coding block is the motion vector of the lower-left subblock of the first neighboring affine coding block, and the motion vector of the lower-right control point of the first neighboring affine coding block is the motion vector of the lower-right subblock of the first neighboring affine coding block. In this case, the horizontal distance between the lower-left and lower-right control points of the first neighboring affine coding block is cuW, and the horizontal distance between the upper-left and upper-right control points of the first neighboring affine coding block is also cuW. Since cuW is typically a power of 2, a right-shift method may be used instead of division in the process of deriving the motion vectors of the control points of the coding block to reduce implementation complexity. It can be seen that both the position coordinates of the lower-left and lower-right control points of the first neighboring affine coding block are obtained through derivation rather than being read from memory. Thus, this method further reduces the number of reads from memory and improves decoding performance. In another optional solution, the position coordinates of the lower-left and lower-right control points may, 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 of the position (x4+cuW-1,y4+cuH-1) in the picture, and (vx6,vy6) may be obtained by reading the motion vector of the position (x4,y4+cuH-1) in the picture.

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

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

[0430] If the first neighboring affine coding block is located within the CTU above the currently coded block, the position coordinates and motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can be obtained.

[0431] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

[0432] The motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left, top-right, and bottom-left control points of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left, top-right, and bottom-left control points of the currently encoded 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 top-left control point of the currently encoded block, (x1, y1) are the coordinates of the top-right control point of the currently encoded block, and (x2, y2) are the coordinates of the bottom-left control point of the currently encoded block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the currently encoded block, (vx1, vy1) is the predicted motion vector of the top-right control point of the currently encoded block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the currently encoded block.

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

[0435] Embodiment 2: The candidate motion vector predictor MVP list is constructed using a motion vector prediction method based on combinations of control points.

[0436] The manner in which the candidate motion vector predictor (MVP) list is constructed depends on the parameter model of the currently encoded block. Details are described below.

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

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

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

[0440] The motion vectors of the top-left, top-right, and bottom-left vertices of the currently encoded block are estimated based on the motion information of the decoded blocks in the vicinity of the currently encoded block. As shown in Figure 7B, first, the motion vectors of decoded blocks A and / or B and / or C in the vicinity of the top-left vertex are used as candidate motion vectors for the top-left vertex of the currently encoded block, the motion vectors of decoded blocks D and / or E in the vicinity of the top-right vertex are used as candidate motion vectors for the top-right vertex of the currently encoded block, and the motion vectors of decoded blocks F and / or G in the vicinity of the bottom-left vertex are used as candidate motion vectors for the bottom-left vertex of the currently encoded block. The candidate motion vectors for the top-left, top-right, and bottom-left vertices may be combined to obtain a group of candidate motion vector predictors. Multiple groups of candidate motion vector predictors obtained through the combinations 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 the candidate motion vector predictors predicted in Embodiment 1, or using only the candidate motion vector predictors predicted in Embodiment 2, or using both the candidate motion vector predictors predicted in Embodiment 1 and the candidate motion vector predictors predicted in Embodiment 2. In addition, the candidate motion vector predictor MVP list may be further pruned, sorted, and then truncated or padded to a certain amount according to pre-configured rules. If each group of candidate motion vector predictors in the candidate motion vector predictor MVP list contains motion vector predictors with three control points, the candidate motion vector predictor MVP list may be called a triplet list; or if each group of candidate motion vector predictors in the candidate motion vector predictor MVP list contains motion vector predictors with two control points, the candidate motion vector predictor MVP list may be called a 2-tuple list.

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

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

[0444] Step S1213: The video decoder determines the 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, it is not necessary to parse the bitstream to obtain the index, and the target motion vector group can be determined directly). The optimal candidate motion vector predictor is briefly described below.

[0446] If the parameter model of the currently encoded block is a four-parameter affine transform model, the best motion vector predictor for two control points is selected from a constructed list of candidate motion vector predictors (MVPs). For example, a video decoder parses the bitstream to obtain index numbers, and then, based on these index numbers, determines the best motion vector predictor for two control points in a list of two-tuple candidate motion vector predictors (MVPs). Each group of candidate motion vector predictors in the list of candidate motion vector predictors corresponds to its respective index number.

[0447] If the parameter model of the currently encoded block is a 6-parameter affine transform model, the best motion vector predictor for the three control points is selected from a constructed list of candidate motion vector predictors (MVPs). For example, a video decoder parses the bitstream to obtain index numbers, and then, based on these index numbers, determines the best motion vector predictor for the three control points in the triplet candidate motion vector predictor MVP list. Each group of candidate motion vector predictors in the candidate motion vector predictor MVP list corresponds to its respective index number.

[0448] Step S1214: The video decoder determines the motion vectors of the control points of the currently encoded block based on the target candidate motion vector group and the motion vector difference MVD obtained through parsing from the bitstream.

[0449] If the parameter model of the currently encoded block is a four-parameter affine transform model, the motion vector differences of two control points of the currently encoded block are obtained by decoding from the bitstream, and a new candidate motion vector group is obtained based on the motion vector differences of those control points and the target candidate motion vector group indicated by the index. For example, the motion vector differences (MVD) of the top-left control point and the motion vector differences (MVD) of the top-right control point are obtained by decoding from the bitstream and are added to the motion vectors of the top-left and top-right control points in the target candidate motion vector group, respectively, to obtain a new candidate motion vector group. Thus, the new candidate motion vector group contains the new motion vectors of the top-left and top-right control points of the currently encoded block.

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

number

[0451] Here, (x0, y0) is the coordinate of the top-left control point, (x1, y1) is the coordinate of the top-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 currently encoded block is a 6-parameter affine transform model, the motion vector differences of the three control points of the currently encoded block are obtained by decoding from the bitstream, and a new candidate motion vector group is obtained based on the motion vector differences (MVD) of those control points and the target candidate motion vector group indicated by the index. For example, the motion vector differences (MVD) of the top-left control point, the top-right control point, and the bottom-left control point are obtained by decoding from the bitstream and are added to the motion vectors of the top-left, top-right, and bottom-left control points 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 top-left, top-right, and bottom-left control points of the currently encoded block.

[0453] Step S1215: The video decoder uses an affine transform model to obtain the motion vectors of each subblock of the currently encoded block based on the determined motion vectors of the control points of the currently encoded block.

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

[0455] Currently, the coordinates of the center point of the motion compensation unit for a sample at the top-left vertex of the coding block are calculated according to equation (5), where i is the i-th motion compensation unit in the horizontal direction (from left to right), j is the j-th 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 currently encoded block. Then, based on the affine model type (6 parameters or 4 parameters) of the currently encoded block, (x (i,j) ,y (i,j) ) is substituted into equation (6-1) of the 6-parameter affine model, or (x (i,j) ,y (i,j) ) is substituted into equation (6-2) of the 4-parameter affine model to obtain motion information of the center point of each motion compensation unit, and this motion information is used to obtain the motion vector (vx) of all samples in this motion compensation unit. (i,j) ,vy (i,j)It is used as ).

number

[0456] Optionally, if the currently coded block is a 6-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a 6-parameter affine model constructed using three control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a 6-parameter affine model constructed using three control points. For example, the motion vector of the subblock at the lower left corner of the currently coded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently coded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently coded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently coded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently coded block are used (for example, when a list of candidate motion vector predictors (MVPs) for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the currently coded block), the exact values ​​are used rather than estimates. W is the width of the currently coded block, and H is the height of the currently coded block.

[0457] Optionally, if the currently coded block is a four-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a four-parameter affine model constructed using two control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock at the lower left corner of the currently coded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently coded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently coded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently coded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently coded block are used (for example, when a list of candidate motion vector predictors (MVPs) for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the currently coded block), the exact values ​​are used rather than estimates. W is the width of the currently coded block, and H is the height of the currently coded block.

[0458] Step S1216: The video decoder performs motion compensation based on the motion vectors of each subblock in the currently encoded block to obtain the predicted sample values ​​for each subblock. For example, based on the motion vector and reference frame index of each subblock, the corresponding subblock is found in the reference frame, and interpolation filtering is performed to obtain the predicted sample values ​​for each subblock.

[0459] Merge mode:

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

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

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

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

[0464] A first affine model is determined based on the motion vectors of the control points of the first neighboring affine coding block. Furthermore, the motion vectors of the control points of the currently coding block are predicted based on the first affine model. Details are as follows:

[0465] If the first neighboring affine coding block is located within the CTU above the currently coded block, the position coordinates and motion vectors of the two lowest control points of the first neighboring affine coding block can be obtained. For example, the position coordinates (x6, y6) and motion vector (vx6, vy6) of the lower left control point of the first neighboring affine coding block, as well as the position coordinates (x7, y7) and motion vector (vx7, vy7) of the lower right control point of the first neighboring affine coding block can be obtained.

[0466] A first affine model (in this case, a four-parameter affine model) is formed based on the motion vectors of the two lowest control points of the first neighborhood affine coding block.

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

[0468] Optionally, the motion vectors of the control points of the currently encoded block are predicted based on a first affine model. For example, the position coordinates of the top-left control point and the position coordinates of the top-right control point of the currently encoded block may be substituted into the first affine model to predict the motion vectors of the top-left and top-right control points of the currently encoded block. A candidate motion vector 2-tuple is formed and added to the 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, and (x2, y2) are the coordinates of the bottom-left control point of the current coding block. Also, (vx0, vy0) is the predicted motion vector of the top-left control point of the current coding block, (vx1, vy1) is the predicted motion vector of the top-right control point of the current coding block, and (vx2, vy2) is the predicted motion vector of the bottom-left control point of the current coding block.

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

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

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

[0473] Solution A: The motion information of two control points in the currently encoded block is combined to construct a four-parameter affine transformation model. The two control points can be 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 written as Affine(CP1,CP2).

[0474] It should be noted that different combinations of control points may be transformed into control points at the same location. For example, a four-parameter affine transformation model obtained based on the combination {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} may be 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 same 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 the parameters in the parameter model, and (x,y) represents 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 and top-right control points, and this group of motion vector predictors is added to the candidate motion information list.

[0477] The formula (8) that converts {CP1,CP2} to {CP1,CP2,CP3} is as follows:

number

[0478] The formula (9) that converts {CP1,CP3} to {CP1,CP2,CP3} is as follows:

number

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

number

[0480] The formula (11) for converting {CP1,CP4} to {CP1,CP2,CP3} is as follows:

number

[0481] The formula (12) that converts {CP2,CP4} to {CP1,CP2,CP3} is as follows:

number

[0482] The formula (13) that converts {CP3,CP4} to {CP1,CP2,CP3} is as follows:

number

[0483] Solution B: The motion information of the three control points of the currently encoded block is combined to construct a 6-parameter affine transformation model. The three control points can be combined as follows: {CP1,CP2,CP4}, {CP1,CP2,CP3}, {CP2,CP3,CP4}, or {CP1,CP3,CP4}. For example, a 6-parameter affine transformation model constructed using control points CP1, CP2, and CP3 is written 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 6-parameter affine transformation model obtained based on combinations such as {CP1,CP2,CP4}, {CP2,CP3,CP4}, or {CP1,CP3,CP4} can be transformed to be represented by the control point {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 same 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) represents 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] The formula (15) for converting {CP1,CP2,CP4} to {CP1,CP2,CP3} is as follows:

number

[0488] The formula (16) for converting {CP2,CP3,CP4} to {CP1,CP2,CP3} is as follows:

number

[0489] The formula (17) for converting {CP1,CP3,CP4} to {CP1,CP2,CP3} is 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 Embodiment 1, or using only the candidate motion vector predictors predicted in Embodiment 2, or using both the candidate motion vector predictors predicted in Embodiment 1 and the candidate motion vector predictors predicted in Embodiment 2. Furthermore, the candidate motion information list may be further pruned, sorted, and then truncated or padded to a certain number according to pre-configured rules. If each group of candidate motion vector predictors in the candidate motion information list contains motion vector predictors with three control points, the candidate motion information list may be called a triplet list; or if each group of candidate motion vector predictors in the candidate motion information list contains motion vector predictors with two control points, the candidate motion information list may be called 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. An index is used to indicate a target candidate motion vector group of the currently encoded block, which represents a motion vector predictor of a group of control points of the currently encoded block.

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

[0494] 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 information list is 1, it is not necessary 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 the index number from the bitstream through parsing, and then, based on the index number, determines the optimal motion vector predictor for two or three control points in the candidate motion information list. Each group of candidate motion vector predictors in the candidate motion information list corresponds to its respective index number.

[0495] Step S1224: The video decoder uses a parameter-based affine transformation model to obtain the motion vectors of each subblock of the currently encoded block, based on the determined motion vectors of the control points of the currently encoded block.

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

[0497] Currently, the coordinates of the center point of the motion compensation unit for a sample at the top-left vertex of the coding block are calculated according to equation (5), where i is the i-th motion compensation unit in the horizontal direction (from left to right), j is the j-th 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 currently encoded block. Then, based on the affine model type (6 parameters or 4 parameters) of the currently encoded block, (x (i,j) ,y (i,j) ) is substituted into equation (6-1) of the 6-parameter affine model, or (x (i,j) ,y (i,j) ) is substituted into equation (6-2) of the 4-parameter affine model to obtain motion information of the center point of each motion compensation unit, and this motion information is used to obtain the motion vector (vx) of all samples in this motion compensation unit. (i,j) ,vy (i,j) It is used as ).

[0498] Optionally, if the currently coded block is a 6-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a 6-parameter affine model constructed using three control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a 6-parameter affine model constructed using three control points. For example, the motion vector of the subblock at the lower left corner of the currently encoded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently encoded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently encoded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently encoded block into a 6-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently encoded block are used (for example, when a list of candidate motion information for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the current block), the exact values ​​are used rather than estimates. W is the width of the currently encoded block, and H is the height of the currently encoded block.

[0499] Optionally, if the currently coded block is a four-parameter coded block and the motion vectors of one or more subblocks of the currently coded block are obtained based on a target candidate motion vector group, then if the lower boundary of the currently coded block coincides with the lower boundary of the CTU on which the currently coded block is located, the motion vector of the subblock at the lower left corner of the currently coded block is obtained through calculations based on the position coordinates (0,H) of the lower left corner of the currently coded block and a four-parameter affine model constructed using two control points, and the motion vector of the subblock at the lower right corner of the currently coded block is obtained through calculations based on the position coordinates (W,H) of the lower right corner of the currently coded block and a four-parameter affine model constructed using two control points. For example, the motion vector of the subblock at the lower left corner of the currently encoded block is obtained by substituting the position coordinates (0,H) of the lower left corner of the currently encoded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower left corner subblock into the affine model for computation), and the motion vector of the subblock at the lower right corner of the currently encoded block is obtained by substituting the position coordinates (W,H) of the lower right corner of the currently encoded block into a four-parameter affine model (rather than substituting the coordinates of the center point of the lower right corner subblock into the affine model for computation). In this way, when the motion vectors of the lower left and lower right control points of the currently encoded block are used (for example, when a list of candidate motion information for other blocks is subsequently constructed based on the motion vectors of the lower left and lower right control points of the current block), the exact values ​​are used rather than estimates. W is the width of the currently encoded block, and H is the height of the currently encoded block.

[0500] Step S1225: The video decoder performs motion compensation based on the motion vectors of each subblock in the currently encoded block to obtain the predicted sample values ​​for each subblock. Specifically, the predicted sample values ​​for the currently encoded block are obtained based on the motion vectors of one or more subblocks in the currently encoded block, the reference frame index, and the predicted direction indicated by the index.

[0501] If the coding tree unit CTU on which the first neighboring affine coding block is located is currently above the coding block, it can be understood that information about the lowest 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 a first group of control points of the first neighboring affine coding block, the first group of control points includes the lower left and lower right control points of the first neighboring affine coding block, instead of using the upper left, upper right, and lower left control points of the first neighboring coding block as fixed control points of the first group (or using the upper left and upper right control points of the first neighboring coding block as fixed control points of the first group) as in the prior art. Thus, according to the method for determining the first group of control points in this application, 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 decoding performance.

[0502] In another optional embodiment on the decoder side, if the first neighboring affine coding block is located within a coding tree unit (CTU) above the current coding block, the group of candidate motion vector predictors is determined based on the lower left and lower right control points of the first neighboring affine coding block; or, if the first neighboring affine coding block is located within a CTU to the left of the current coding block, the group of candidate motion vector predictors is determined based on the upper right and lower right control points of the first neighboring affine coding block. Further details are as follows:

[0503] Step S1300: The video decoder determines the interprediction mode of the currently encoded block.

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

[0505] If the currently determined interpretation mode for the coding block is AMVP mode, steps S1311 to S1313 are executed.

[0506] If the currently determined interpretation mode for the coding block is merge mode, steps S1321 to S1325 are performed.

[0507] AMVP Mode: ...

Claims

1. An encoding method performed by a video encoder for use in merge mode: The current stage is to construct a list of candidate motion vectors for the currently coded block (S721), wherein the list of candidate motion vectors includes multiple groups of candidate motion vectors, and each group of candidate motion vectors represents a group of candidate motion vector predictors for the control points of the currently coded block. The neighboring blocks of the current coding block are traversed in a predetermined order, and a certain neighboring affine coding block is determined within those neighboring blocks. One candidate motion vector group from the candidate motion vector list is obtained based on the affine model for the neighboring affine coding block and the position coordinates of the control points of the group of the current coding block, and the affine model for the neighboring affine coding block is determined based on the position coordinates and motion vectors of the group of control points of the neighboring affine coding block of the current coding block. The neighboring affine coding block is located within a coding tree unit CTU above the current coding block, the group of control points of the neighboring affine coding block consists of the lower left and lower right control points of the neighboring affine coding block, and the group of control points of the current coding block includes the upper left and upper right control points of the current coding block, in stages; Step (S722) of determining a target candidate motion vector group in the candidate motion vector list according to a rate-distortion cost criterion, wherein the target candidate motion vector group represents the motion vector predictor of the control point of the currently encoded block; The step (723) involves encoding the index corresponding to the target candidate motion vector group into the bitstream to be transmitted. Methods that include...

2. The position coordinates x 6 , y 6 of the control point at the lower left of the neighboring affine encoding block and the position coordinates x 7 , y 7 of the control point at the lower right of the neighboring affine encoding block are both derived based on the position coordinates x 4 , y 4 of the control point at the upper left of the neighboring affine encoding block. The position coordinates x 6 , y 6 of the control point at the lower left of the neighboring affine encoding block are represented by x 4 , y 4 + cuH, and the position coordinates x 7 , y 7 of the control point at the lower right of the neighboring affine encoding block are x 4 + cuW, y 4 + cuH, where cuW is the width of the neighboring affine encoding block and cuH is the height of the neighboring affine encoding block, and the affine model for the neighboring affine encoding block is a four-parameter affine model. The method according to claim 1.

3. The method according to claim 2, wherein the motion vector of the lower left control point of the neighboring affine coding block is the motion vector of the lower left subblock of the neighboring affine coding block, and the motion vector of the lower right control point of the neighboring affine coding block is the motion vector of the lower right subblock of the neighboring affine coding block.

4. A decoding method performed by a video decoder for use in merge mode, wherein: Currently, we are in the stage of constructing a list of candidate motion vectors for the coding block (S1221), The candidate motion vector list includes multiple candidate motion vector groups, each candidate motion vector group representing a candidate motion vector predictor for a group of control points in the currently encoded block. The neighboring blocks of the current coding block are traversed in a predetermined order, and a certain neighboring affine coding block is determined within those neighboring blocks. One candidate motion vector group from the candidate motion vector list is obtained based on the affine model for the neighboring affine coding block and the position coordinates of the group of control points of the current coding block, and the affine model is determined based on the position coordinates and motion vectors of the group of control points of the neighboring affine coding block of the current coding block. The neighboring affine coding block is located within a coding tree unit CTU above the current coding block, the group of control points of the neighboring affine coding block consists of the lower left and lower right control points of the neighboring affine coding block, and the group of control points of the current coding block includes the upper left and upper right control points of the current coding block, in stages; The step of parsing the bitstream and obtaining an index (S1222), wherein the index is used to indicate the target candidate motion vector group of the currently encoded block; Step (S1223) of determining the target candidate motion vector group in the candidate motion vector list based on the index, wherein the target candidate motion vector group represents the motion vector predictor of the group of control points of the currently encoded block; Step (S1224) of obtaining motion vectors of one or more sub-blocks of the currently encoded block based on an affine model for the currently encoded block and the position coordinates of the one or more sub-blocks of the currently encoded block, wherein the affine model for the currently encoded block is determined based on the target candidate motion vector group and the position coordinates of the group of control points of the currently encoded block; The step of predicting the predicted sample value of the current coding block based on the motion vector of one or more sub-blocks of the current coding block (S1221) Methods that include...

5. The position coordinate x of the lower left control point of the aforementioned neighboring affine coding block. 6 ,y 6 and the position coordinate x of the lower right control point of the neighboring affine coding block. 7 ,y 7 Both are the position coordinates x of the upper left control point of the neighboring affine coding block. 4 ,y 4 Derived based on the position coordinate x of the lower left control point of the neighboring affine coding block. 6 ,y 6 is x 4 ,y 4 Represented by +cuH, the position coordinate x of the lower right control point of the neighboring affine coding block. 7 ,y 7 is x 4 +cuW,y 4 The method according to claim 4, wherein +cuH, where cuW is the width of the neighboring affine coding block and cuH is the height of the neighboring affine coding block, and the affine model for the neighboring affine coding block is a four-parameter affine model.

6. The method according to claim 5, wherein the motion vector of the lower left control point of the neighboring affine coding block is the motion vector of the lower left subblock of the neighboring affine coding block, and the motion vector of the lower right control point of the neighboring affine coding block is the motion vector of the lower right subblock of the neighboring affine coding block.

7. Memory configured to store video data in the form of a bitstream; A video encoder configured to perform any of the methods described in claims 1 to 3, A video data encoding device having [a specific feature / feature].

8. Memory configured to store video data in the form of a bitstream; A video decoder configured to perform any of the methods described in claims 4 to 6, A video data decoding device having [a specific feature / function].

9. A computer program that stores computer instructions that, when executed by one or more processors, cause one or more processors to execute any of the methods described in claims 1 to 6.