Motion vector prediction method and related device

The motion vector prediction method using affine transformation models for neighboring blocks improves coding efficiency and accuracy, addressing the challenge of further bitrate reductions in video coding.

JP2025188076AActive Publication Date: 2025-12-25HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2025150294
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-07-18
Filing Date
2025-09-10
Publication Date
2025-12-25
Estimated Expiration
2038-11-22

AI Technical Summary

Technical Problem

Existing video coding techniques struggle to achieve further bitrate reductions without compromising image quality, particularly in predicting motion vectors for video images.

Method used

A motion vector prediction method using an affine transformation model to construct a candidate motion vector list based on neighboring blocks, allowing for improved prediction accuracy and efficiency by utilizing different affine transformation models for current and neighboring blocks.

Benefits of technology

Enhances coding efficiency and accuracy in predicting motion vectors, achieving better balance between model complexity and modeling ability, thereby improving user requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025188076000001_ABST
    Figure 2025188076000001_ABST
Patent Text Reader

Abstract

To provide a motion vector prediction method and a related device.SOLUTION: The method includes: parsing a bitstream to obtain an index value of a candidate motion vector list; constructing the candidate motion vector list, where the candidate motion vector list includes candidate motion vectors of K control points of a current block, the candidate motion vectors of the K control points are obtained on the basis of a 2N-parameter affine transform model used for a neighboring block of the current block, where N is an integer of 2 or more and 4 or less, K is an integer of 2 or more and 4 or less, and N is not equal to K; determining, in the candidate motion vector list, target candidate motion vectors of the K control points on the basis of an index value; and obtaining a predicted motion vector of each subblock of the current block on the basis of the target candidate motion vectors of the K control points. The present application helps improve coding efficiency in an audio and video coding process and satisfies user requirements.SELECTED DRAWING: Figure 9
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] FIELD OF THE INVENTION Embodiments of the present invention relate to the field of video coding techniques, and in particular to methods and apparatus for predicting motion vectors of video images and corresponding encoders and decoders. [Background technology]

[0002] Video coding (video encoding and decoding) is used in a wide range of digital video applications, such as broadcast digital TV, video transmission over the Internet and mobile networks, real-time interactive applications such as video chat and video conferencing, DVD and Blu-ray discs, video content acquisition and editing systems, and camcorders for security applications.

[0003] Since the development of the block-based hybrid video coding approach in the H.261 standard in 1990, new video coding techniques and tools have been developed, forming the basis for new video coding standards. Additional video coding standards include MPEG-1 video, MPEG-2 video, ITU-T H.262 / MPEG-2, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), and extensions, such as scalability and / or three-dimensional (3D) extensions, of these standards. As video production and use become more ubiquitous, video traffic represents a significant burden on communication networks and data storage. Therefore, one of the goals of most video coding standards has been to achieve bitrate reductions compared to their predecessors without sacrificing image quality. The latest High Efficiency Video Coding (HEVC) can compress video approximately twice as fast as AVC without sacrificing image quality, but new techniques that compress video even more than HEVC are still needed. Summary of the Invention

[0004] SUMMARY OF THE INVENTION The embodiments of the present invention provide a motion vector prediction method and related apparatus to improve coding efficiency and satisfy user requirements.

[0005] According to a first aspect, an embodiment of the present invention provides a motion vector prediction method. The method is described from the perspective of a decoder side or an encoder side. The method may be used to predict an image block to be processed. The image block to be processed is obtained by dividing a video image. On the encoder side, the image block to be processed is a current affine coding block, and decoded image blocks spatially adjacent to the image block to be processed are neighboring affine coding blocks. On the decoder side, the image block to be processed is a current affine decoding block, and decoded image blocks spatially adjacent to the image block to be processed are neighboring affine decoding blocks. For ease of description, the image block to be processed may be referred to as a current block, and reference blocks spatially adjacent to the image block to be processed may be referred to as neighboring blocks. The method includes parsing the bitstream to obtain index values ​​of a candidate motion vector list; constructing a candidate motion vector list including candidate motion vectors for K control points of a current block, where the candidate motion vectors for the K control points are obtained based on a 2×N parameter affine transformation model used in neighboring blocks of the current block, the 2×N parameter affine transformation model being obtained based on the motion vectors of the N control points of the neighboring blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, and N is not equal to K; determining target candidate motion vectors for the K control points in the candidate motion vector list based on the index values; and obtaining predicted motion vectors corresponding to positions of each sub-block of the current block based on the target candidate motion vectors of the K control points. The predicted motion vectors corresponding to positions of various sub-blocks may be used for motion compensation of multiple sub-blocks, respectively.

[0006] It can be seen that in this embodiment of the present invention, in the process of predicting the current block, the decoder side can construct an affine transformation model of the current block by using the affine transformation model of a neighboring block in the phase of constructing a candidate list of the current block (for example, in the phase of constructing a candidate motion vector list for the AMVP mode or merge mode based on the affine transformation model). The affine transformation models of the two blocks may be different. The affine transformation model of the current block better satisfies the actual motion state / actual requirements of the current block. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0007] According to the first aspect, in a possible implementation, the availability of one or more predetermined spatially neighboring blocks of a current block may be determined in a predetermined order, and then the available neighboring blocks in the predetermined order are obtained sequentially. The predetermined available neighboring blocks may include neighboring image blocks located above, to the left, to the right, to the bottom left, or to the top left of the image block to be processed. For example, the availability of the neighboring image block located to the left, the neighboring image block located above, the neighboring image block located to the right, the neighboring image block located to the bottom left, and the neighboring image block located to the top left is checked sequentially.

[0008] According to the first aspect, in a possible implementation, N = 2 and K = 3. Specifically, when a four-parameter affine transformation model is used for the affine decoding block (affine coding block on the encoder side) and a six-parameter affine transformation model is used for the current block, the candidate motion vectors for the three control points of the current block are obtained based on the four-parameter affine transformation models used for the neighboring blocks of the current block.

[0009] For example, the candidate motion vectors for the three control points of the current block include a motion vector (vx0,vy0) at the top left sample position (or called the top left corner, hereinafter the same) (x0,y0) of the current block, a motion vector (vx1,vy1) at the top right sample position (or called the top right corner, hereinafter the same) (x1,y1) of the current block, and a motion vector (vx2,vy2) at the bottom left sample position (or called the bottom left corner, hereinafter the same) (x2,y2) of the current block.

[0010] The candidate motion vectors of the three control points of the current block are obtained based on the four-parameter affine transformation model used for the neighboring blocks of the current block, that is, the motion vector (vx0,vy0) at the upper left corner (x0,y0) of the current block, the motion vector (vx1,vy1) at the upper right corner (x1,y1) of the current block, and the motion vector (vx2,vy2) at the lower left corner (x2,y2) of the current block are first calculated using the following formula:

number

[0011] According to the first aspect, in a possible implementation, N = 3 and K = 2. Specifically, when a 6-parameter affine transformation model is used for the affine decoding block (affine coding block on the encoder side) and a 4-parameter affine transformation model is used for the current block, the candidate motion vectors for the two control points of the current block are obtained based on the 6-parameter affine transformation models used for the neighboring blocks of the current block.

[0012] For example, the candidate motion vectors of the two control points of the current block include a motion vector (vx0,vy0) at the top left sample position (or referred to as the top left corner, hereinafter the same) (x0,y0) of the current block and a motion vector (vx1,vy1) at the top right sample position (or referred to as the top right corner, hereinafter the same) (x1,y1) of the current block. The candidate motion vectors of the two control points of the current block are obtained based on the six-parameter affine transformation model used for the neighboring blocks of the current block, which can be expressed as follows:

number

[0013] It can be seen that in this embodiment of the present invention, in the phase of parsing the current block (e.g., in the phase of constructing a candidate motion vector list), the affine transformation model of the current block can be constructed by using the affine transformation models of neighboring blocks. The affine transformation models of the two blocks may be different. The affine transformation model of the current block better satisfies the actual motion state / actual requirements of the current block. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and satisfy user requirements.

[0014] According to the first aspect, in an embodiment of the phase of reconstructing a current block, the process of obtaining a predicted motion vector for each sub-block of the current block includes the following procedures: obtaining a 2×K parameter affine transformation model of the current block based on target candidate motion vectors of K control points; and obtaining a predicted motion vector for each sub-block of the current block based on the 2×K parameter affine transformation model.

[0015] For example, if a six-parameter affine motion model is used for the current affine decoding block, the six-parameter affine transformation model of the current block is constructed based on the candidate motion vectors of three control points (i.e., K=3) of the current block. (i,j) ,y (i,j) ) is substituted into the equation for the six-parameter affine motion model to obtain the motion vector corresponding to the sample coordinates within each sub-block, and the obtained motion vector is then used to calculate the motion vectors (vx (i,j) ,vy (i,j) ) is used as

number

[0016] As another example, if a four-parameter affine motion model is used for the current affine decoding block, the four-parameter affine transformation model of the current block is constructed based on the candidate motion vectors of two control points (i.e., K=2) of the current block. (i,j) ,y (i,j) ) is substituted into the equation for the four-parameter affine motion model to obtain the motion vector corresponding to the sample coordinates within each sub-block, and the obtained motion vector is then used to calculate the motion vectors (vx (i,j) ,vy (i,j) ) is used as

number

[0017] In another embodiment of the phase of reconstructing a current block according to the first aspect, the process of obtaining a predicted motion vector for each sub-block of the current block includes the following procedures: obtaining a current block six-parameter affine transformation model based on target candidate motion vectors of K control points of the current block; and obtaining a predicted motion vector for each sub-block of the current block based on the six-parameter affine transformation model of the current block.

[0018] That is, in this solution, regardless of the affine transformation model used for the current block in the parsing phase (list construction phase), in the phase of reconstructing the current block, a 6-parameter affine transformation model is uniformly used to obtain motion vector information for each sub-block of the current block so as to reconstruct each sub-block. For example, if a 4-parameter affine transformation model or an 8-parameter bilinear model is used in the parsing phase, a 6-parameter affine transformation model for the current block is further constructed. For example, if a 6-parameter affine transformation model is used in the parsing phase, the 6-parameter affine transformation model for the current block is still used in the reconstruction phase.

[0019] For example, a four-parameter affine transformation model may be used for the current block in the perspective phase, and a four-parameter affine transformation model or another parameter affine transformation model may be used for the adjacent block. Therefore, after the motion vectors of two control points of the current block are obtained, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block are obtained, in the phase of reconstructing the current block, a six-parameter affine transformation model needs to be constructed based on the motion vectors of the two control points of the current block.

[0020] For example, based on the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, the motion vector of the third control point may be obtained according to the following formula: The motion vector of the third control point is, for example, the motion vector (vx2,vy2) of the bottom-left corner (x2,y2) of the current block.

number

[0021] Then, the six-parameter affine transformation model of the current block in the reconstruction phase is obtained by using the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block, the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, and the motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block. The formula for the six-parameter affine transformation model is as follows:

number

[0022] Then, the coordinates (x, y) of the sample at a preset position (e.g., center point) of each sub-block (or each motion compensation unit) of the current block relative to the upper left corner (or other reference point) of the current block are calculated. (i,j) ,y (i,j) ) is substituted into the above equation for the six-parameter affine transformation model to obtain the motion information of samples at the preset positions of each sub-block (or each motion compensation unit) so as to subsequently reconstruct each sub-block.

[0023] In this embodiment of the present invention, in the phase of reconstructing the current block, a six-parameter affine transformation model can be uniformly used to predict the current block. The more parameters of the motion model describing the affine motion of the current block, the higher the accuracy and the higher the computational complexity. In this solution, the six-parameter affine transformation model constructed in the reconstruction phase describes the affine transformations of the image block, such as translation, scaling, and rotation, and can achieve a good balance between model complexity and modeling ability. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0024] According to the first aspect, in a possible implementation, in an AMVP mode based on an affine transformation model, obtaining a 2×K parameter affine transformation model based on a target candidate motion vector of K control points includes obtaining motion vectors for K control points based on the target candidate motion vector of the K control points and motion vector differences for the K control points, where the motion vector differences for the K control points are obtained by parsing the bitstream, and obtaining a 2×K parameter affine transformation model of a current block based on the motion vectors of the K control points.

[0025] According to a first aspect, in a possible implementation, the encoder side and the decoder side use an AMVP mode based on an affine transformation model to perform inter-prediction, and the constructed list is a candidate motion vector list for the AMVP mode based on an affine transformation model.

[0026] In some specific embodiments of the present invention, candidate motion vectors for control points of the current block may be obtained by using the motion vector prediction method based on the first motion model described in this specification and added to a candidate motion vector list corresponding to the AMVP mode.

[0027] In some other specific embodiments of the present invention, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using a motion vector prediction method based on the first motion model and a constructive control point motion vector prediction method, and added to a candidate motion vector list corresponding to the AMVP mode.

[0028] According to a first aspect, in a possible implementation, the encoder side and the decoder side use a merge mode based on an affine transformation model to perform inter prediction, and the constructed list is a candidate motion vector list for the merge mode based on an affine transformation model.

[0029] In some specific embodiments of the present invention, candidate motion vectors of the control points of the current block may also be obtained by using the motion vector prediction method based on the first motion model described in this specification and added to the candidate motion vector list corresponding to the merge mode.

[0030] In some other specific embodiments of the present invention, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using a motion vector prediction method based on the first motion model and a constructive control point motion vector prediction method, and added to a candidate motion vector list corresponding to the merge mode.

[0031] According to the first aspect, in a possible implementation, when there are multiple neighboring blocks, i.e., when the current block has multiple neighboring affine-decoded blocks, in a possible embodiment, both the encoder and decoder sides can first obtain candidate motion vectors for the control points of the current block by using an affine-decoded block whose number of model parameters is the same as that of the current block, and add the obtained candidate motion vectors for the control points to a candidate motion vector list corresponding to the AMVP mode. Then, candidate motion vectors for the control points of the current block can be obtained by using an affine-decoded block whose number of model parameters is different from that of the current block, and added to a candidate motion vector list corresponding to the AMVP mode. In this way, the candidate motion vectors for the control points of the current block obtained by using an affine-decoded block whose number of model parameters is the same as that of the current block are positioned at the front of the list. This design helps reduce the number of bits transmitted in the bitstream.

[0032] According to the first aspect, in a possible implementation, in the process of the decoder deriving candidate motion vectors for the control points of the current block, flag information (flag) of the affine transformation model of the affine-decoded block may need to be obtained. The flag is locally pre-stored at the decoder and is used to indicate the affine transformation model of the affine-decoded block that is actually used to predict the sub-blocks of the affine-decoded block.

[0033] For example, in an application scenario, if the decoder side determines by identifying the flag of the affine-decoded block that the number of model parameters of the affine transformation model actually used for the affine-decoded block is different (or the same) from that of the affine transformation model used for the current block, the decoder side is triggered to derive candidate motion vectors for the control points of the current block by using the affine transformation model actually used for the affine-decoded block.

[0034] According to the first aspect, in a possible implementation, in the process in which the decoder side derives candidate motion vectors for the control points of the current block, the flag of the affine transformation model of the affine-decoded block may not be needed.

[0035] For example, in an application scenario, after the decoder side determines the affine transformation model used for the current block, the decoder side obtains a specific number of control points of the affine-decoded block (the specific number is the same as or different from the number of control points of the current block), constructs an affine transformation model by using the specific number of control points of the affine-decoded block, and then derives candidate motion vectors for the control points of the current block by using the affine transformation model.

[0036] According to a second aspect, an embodiment of the present invention provides another motion vector prediction method, which includes: parsing a bitstream to obtain index values ​​of a candidate motion vector list; constructing a candidate motion vector list including candidate motion vectors for K control points of a current block, where the candidate motion vectors for the K control points of the current block are obtained based on a 2N-parameter affine transformation model used for neighboring blocks of the current block, the 2N-parameter affine transformation model being obtained based on motion vectors for N control points of the neighboring blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, the neighboring blocks being decoded image blocks spatially adjacent to the current block, and the current block including multiple sub-blocks; determining target candidate motion vectors for the K control points of the current block based on the index values ​​in the candidate motion vector list; obtaining a 6-parameter affine transformation model for the current block based on the target candidate motion vectors for the K control points of the current block; and obtaining a predicted motion vector for each sub-block of the current block based on the 6-parameter affine transformation model of the current block.

[0037] It can be seen that in this embodiment of the present invention, a six-parameter affine transformation model can be uniformly used to predict the current block in the current block reconstruction phase. The more parameters of the motion model describing the affine motion of the current block, the higher the accuracy and the higher the computational complexity. In this solution, the six-parameter affine transformation model constructed in the reconstruction phase describes the affine transformations, such as translation, scaling, and rotation, of the image block, achieving a good balance between model complexity and modeling ability. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0038] According to the second aspect, in a possible implementation, N=2 and K=3.

[0039] Correspondingly, the candidate motion vectors of the two control points of the current block are obtained based on the four-parameter affine transformation model used in the neighboring blocks of the current block.

[0040] According to the second aspect, in a possible implementation, N = 3 and K = 2. Correspondingly, the candidate motion vectors of the two control points of the current block are obtained based on the six-parameter affine transformation model used in the neighboring blocks of the current block.

[0041] According to a second aspect, in a possible implementation, obtaining a six-parameter affine transformation model of the current block based on target candidate motion vectors of the K control points of the current block includes: Obtaining a four-parameter affine transformation model of the current block according to the target candidate motion vectors of the two control points of the current block; Obtaining a motion vector of a third control point of the current block according to a four-parameter affine transformation model of the current block; Obtaining a six-parameter affine transformation model of the current block based on the candidate motion vectors of the two control points of the current block and the motion vector of the third control point; Includes.

[0042] According to a second aspect, in a possible implementation, obtaining a four-parameter affine transformation model of the current block based on the target candidate motion vectors of two control points of the current block includes: Obtaining motion vectors of the two control points of the current block according to candidate motion vectors of the two control points of the current block and a motion vector difference between the two control points of the current block, where the motion vector difference between the two control points of the current block is obtained by parsing the bitstream; Obtaining a four-parameter affine transformation model of the current block according to the motion vectors of the two control points of the current block; Including, Accordingly, obtaining a six-parameter affine transformation model of the current block according to the candidate motion vectors of the two control points of the current block and the motion vector of the third control point of the current block specifically includes: Obtaining a six-parameter affine transformation model of the current block based on the motion vectors of the two control points and the motion vector of the third control point of the current block.

[0043] According to the second aspect, in a possible implementation, N = 2 and K = 3. Correspondingly, the candidate motion vectors of the three control points of the current block are obtained based on the four-parameter affine transformation model used in the neighboring blocks of the current block.

[0044] According to a third aspect, an embodiment of the present invention provides a decoding device, the device including: a storage unit configured to store video data in the form of a bitstream; an entropy decoding unit configured to parse the bitstream to obtain index values ​​of a candidate motion vector list; and a prediction processing unit configured to construct a candidate motion vector list including candidate motion vectors for K control points of a current block, the candidate motion vectors for the K control points of the current block being obtained based on a 2×N parameter affine transformation model used for neighboring blocks of the current block, the 2×N parameter affine transformation model being obtained based on the motion vectors of the N control points of the neighboring blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, and N is not equal to K, the neighboring blocks are decoded image blocks spatially close to the current block, and the current block includes a plurality of sub-blocks; the prediction processing unit configured to determine target candidate motion vectors for the K control points of the current block based on the index values ​​in the candidate motion vector list, and obtain a predicted motion vector for each sub-block of the current block based on the target candidate motion vectors for the K control points of the current block.

[0045] In a specific embodiment, the modules of the device may be configured to perform the method described in the first aspect.

[0046] According to a fourth aspect, an embodiment of the present invention provides a decoding device. The device includes: a storage unit configured to store video data in the form of a bitstream; an entropy decoding unit configured to parse the bitstream to obtain index values ​​of a candidate motion vector list; and a prediction processing unit configured to construct a candidate motion vector list including candidate motion vectors for K control points of a current block, the candidate motion vectors for the K control points of the current block being obtained based on a 2N-parameter affine transformation model used in neighboring blocks of the current block, the 2N-parameter affine transformation model being obtained based on motion vectors for N control points of the neighboring blocks, N being an integer between 2 and 4, and K being an integer between 2 and 4, the neighboring blocks being decoded image blocks spatially close to the current block, and the current block including a plurality of sub-blocks, the prediction processing unit configured to: determine target candidate motion vectors for the K control points of the current block based on the index values ​​in the candidate motion vector list; obtain a 6-parameter affine transformation model for the current block based on the target candidate motion vectors for the K control points of the current block; and obtain a predicted motion vector for each sub-block of the current block based on the 6-parameter affine transformation model of the current block.

[0047] In a specific embodiment, the modules of the device may be configured to perform the method described in the second aspect.

[0048] According to a fifth aspect, an embodiment of the present invention provides a video decoding device, the device comprising: a memory configured to store video data in the form of a bitstream; and a decoder configured to parse the bitstream to obtain index values ​​for a candidate motion vector list and to construct a candidate motion vector list including candidate motion vectors for K control points of a current block, the candidate motion vectors for the K control points of the current block being obtained based on a 2×N parameter affine transformation model used in neighboring blocks of the current block, the 2×N parameter affine transformation model being obtained based on the motion vectors of the N control points of the neighboring blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, and N is not equal to K, the neighboring blocks are decoded image blocks that are spatially close to the current block, and the current block includes a plurality of sub-blocks; and the decoder configured to determine target candidate motion vectors for the K control points of the current block based on the index values ​​in the candidate motion vector list and to obtain a predicted motion vector for each sub-block of the current block based on the target candidate motion vectors for the K control points of the current block.

[0049] According to the fifth aspect, in some implementations, N is equal to 2 and K is equal to 3. Correspondingly, the candidate motion vectors of the three control points of the current block are obtained based on the four-parameter affine transformation model used for the neighboring blocks of the current block.

[0050] In accordance with a fifth aspect, in some implementations, the candidate motion vectors for the three control points of the current block include a motion vector at the top-left sample position of the current block, a motion vector at the top-right sample position of the current block, and a motion vector at the bottom-left sample position of the current block.

[0051] The decoder calculates the candidate motion vectors for the three control points of the current block using the following formula:

number

[0052] According to the fifth aspect, in some implementations, N is equal to 3 and K is equal to 2. Correspondingly, the candidate motion vectors of the two control points of the current block are obtained based on the six-parameter affine transformation model used for the neighboring blocks of the current block.

[0053] According to a fifth aspect, in some implementations, the candidate motion vectors for two control points of the current block include a motion vector at the top-left sample position of the current block and a motion vector at the top-right sample position of the current block.

[0054] The decoder calculates the candidate motion vectors for the two control points of the current block using the following formula:

number

[0055] In accordance with a fifth aspect, in some implementations, the decoder: Obtain a 2×K parameter affine transformation model of the current block based on the target candidate motion vectors of the K control points of the current block; Obtain the predicted motion vectors of each sub-block of the current block based on the 2 × K parameter affine transformation model of the current block. Specifically configured to:

[0056] In accordance with a fifth aspect, in some implementations, the decoder: Obtaining motion vectors for the K control points of the current block based on the candidate motion vectors of the K control points of the current block and motion vector differences of the K control points of the current block, where the motion vector differences of the K control points of the current block are obtained by parsing the bitstream; Obtain a 2 × K parameter affine transformation model of the current block based on the motion vectors of the K control points of the current block. Specifically configured to:

[0057] According to a fifth aspect, in some implementations, after determining target candidate motion vectors for the K control points of the current block based on index values ​​in the candidate motion vector list, the decoder: Obtain a six-parameter affine transformation model of the current block based on the target candidate motion vectors of the K control points of the current block; Obtain the predicted motion vectors of each sub-block of the current block based on the 6-parameter affine transformation model of the current block. It is further configured as follows.

[0058] For the specific functional implementation of the decoder, please refer to the relevant description in the first aspect.

[0059] According to a sixth aspect, an embodiment of the present invention provides another video decoding device, the device comprising: a memory configured to store video data in the form of a bitstream; and a decoder configured to: parse the bitstream to obtain index values ​​of a candidate motion vector list; construct a candidate motion vector list including candidate motion vectors for K control points of the current block, the candidate motion vectors for the K control points of the current block being obtained based on a 2N-parameter affine transformation model used in neighboring blocks of the current block, the 2N-parameter affine transformation model being obtained based on motion vectors for N control points of the neighboring blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, the neighboring blocks being decoded image blocks spatially close to the current block, and the current block including multiple sub-blocks; determine target candidate motion vectors for the K control points of the current block based on the index values ​​in the candidate motion vector list; obtain a 6-parameter affine transformation model for the current block based on the target candidate motion vectors for the K control points of the current block; and obtain a predicted motion vector for each sub-block of the current block based on the 6-parameter affine transformation model of the current block.

[0060] For the specific functional implementation of the decoder, please refer to the relevant description in the second aspect.

[0061] According to a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium storing instructions that, when executed, enable one or more processors to encode video data. The instructions enable the one or more processors to perform a method as described in any possible embodiment of the first aspect.

[0062] According to an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium storing instructions that, when executed, enable one or more processors to encode video data. The instructions enable the one or more processors to perform a method as described in any possible embodiment of the second aspect.

[0063] According to a ninth aspect, an embodiment of the present invention provides a computer program comprising program code which, when run on a computer, performs a method as described in any possible embodiment of the first aspect.

[0064] According to a tenth aspect, an embodiment of the present invention provides a computer program comprising program code which, when run on a computer, performs a method as described in any possible embodiment of the second aspect.

[0065] In an embodiment of the present invention, it can be seen that in the process of encoding and decoding a current block, in the current block parsing phase (e.g., in the phase of constructing a candidate motion vector list for AMVP mode or merge mode), the affine transformation model of the current block can be constructed by using the affine transformation model of an adjacent block. The affine transformation models of the two blocks may be different. The affine transformation model of the current block better satisfies the actual motion state / actual requirements of the current block. Therefore, this solution can improve the efficiency and accuracy of encoding the current block and satisfy user requirements.

[0066] Furthermore, it can be seen that in the process of encoding and decoding the current block, the decoder side can uniformly use the six-parameter affine transformation model to predict the image block in the phase of reconstructing the image block.In this way, in this embodiment of the present invention, in the process of reconstructing the current block, a good balance is achieved between model complexity and modeling ability.Therefore, this solution can improve the coding efficiency and accuracy of predicting the current block, and meet user requirements.

[0067] In order to describe the technical solutions in the embodiments or background of the present invention more clearly, the following will briefly describe the accompanying drawings which describe the embodiments or background of the present invention. [Brief explanation of the drawings]

[0068] [Figure 1] 1 is a block diagram illustrating an example of the structure of a video coding system implementing an embodiment of the present invention; [Figure 2A] 1 is a block diagram illustrating an example of the structure of a video encoder implementing an embodiment of the present invention; [Figure 2B] 1 is a block diagram illustrating an example of the structure of a video decoder implementing an embodiment of the present invention; [Figure 3] 1 is a block diagram illustrating an example of a video coding device implementing an embodiment of the present invention; [Figure 4] 1 is a block diagram illustrating an example of an encoding or decoding device implementing an embodiment of the present invention; [Figure 5] FIG. 1 is a schematic diagram illustrating a scenario in which an example operation is performed on a current block. [Figure 6] FIG. 10 is a schematic diagram illustrating a scenario in which another example operation is performed on a current block. [Figure 7] FIG. 10 is a schematic diagram illustrating a scenario in which another example operation is performed on a current block. [Figure 8] FIG. 10 is a schematic diagram illustrating a scenario in which another example operation is performed on a current block. [Figure 9] 3 is a flowchart of a motion vector prediction method according to an embodiment of the present invention. [Figure 10] FIG. 10 is a schematic diagram illustrating a scenario in which another example operation is performed on a current block. [Figure 11A] 3 is a schematic diagram of a current block and a motion compensation unit for the current block according to an embodiment of the present invention; [Figure 11B] FIG. 10 is a schematic diagram of another current block and a motion compensation unit for the current block according to an embodiment of the present invention; [Figure 12] 10 is a flowchart of another motion vector prediction method according to an embodiment of the present invention. [Figure 13]10 is a flowchart of another motion vector prediction method according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0069] The following first briefly describes related concepts in embodiments of the present invention. The technical solutions in embodiments of the present invention can be applied not only to existing video coding standards (such as H.264 and HEVC standards), but also to future video coding standards (such as H.266 standard).

[0070] Video coding typically refers to processing a sequence of images that constitute a video, or a video sequence. In the field of video coding, the terms "picture," "frame," and "image" are sometimes used synonymously. As used herein, video coding includes video encoding and video decoding. Video encoding occurs at the source side and typically involves processing original video images (e.g., by compressing) to reduce the amount of data representing the video image for more efficient storage and / or transmission. Video decoding occurs at the destination side and typically involves the reverse process compared to the encoder to reconstruct the video image. "Coding" a video image in the embodiments should be understood as "encoding" or "decoding" a video sequence. The combination of the encoding and decoding parts is also called a CODEC (encoding and decoding).

[0071] A video sequence includes a series of pictures, which are further divided into slices, and slices are further divided into blocks. Video coding is performed block-by-block. In some new video coding standards, the concept of a "block" is further expanded. For example, the H.264 standard introduces the macroblock (MB). A macroblock may be further divided into multiple predictor blocks (predictors) that can be used for predictive coding. The high efficiency video coding (HEVC) standard uses basic concepts such as a "coding unit (CU)," a "prediction unit (PU)," and a "transform unit (TU)." Multiple block units are obtained through functional partitioning and described by using a new tree-based structure. For example, a CU may be divided into smaller CUs based on a quadtree, and the smaller CUs may be further divided to generate a quadtree structure. A CU is the basic unit for partitioning and encoding a coded image. PUs and TUs also have similar tree structures. A PU may correspond to a prediction block and is a basic unit for predictive coding. A CU is further divided into multiple PUs based on a division pattern. A TU may correspond to a transform block and is a basic unit for transforming a prediction residual. Note that, essentially, CUs, PUs, and TUs are all conceptually blocks (or image blocks).

[0072] For example, in HEVC, a CTU is divided into multiple CUs by using a quad-tree structure, represented as a coding tree. The decision on whether to encode an image area by using inter-image (temporal) or intra-image (spatial) prediction is made at the CU level. Each CU may be further divided into one, two, or four PUs based on a PU division pattern. Within a PU, the same prediction process is applied, and related information is transmitted to the decoder on a PU-by-PU basis. After obtaining residual blocks by applying the prediction process based on the PU division pattern, the CU may be divided into transform units (TUs) based on another quad-tree structure similar to the coding tree used for the CU. In recent developments in video compression technology, quad-tree plus binary tree (QTBT) partition frames have been used to divide coding blocks. In the QTBT block structure, CUs may be square or rectangular.

[0073] In this specification, for ease of description and understanding, an image block to be coded in a current coded image may be referred to as a current block. For example, in coding, the current block is the block currently being coded, and in decoding, the current block is the block currently being decoded. A decoded image block in a reference image used to predict a current block is referred to as a reference block. That is, a reference block is a block that provides a reference signal for the current block, and the reference signal represents pixel values ​​in the image block. A block that provides a prediction signal for the current block in a reference image may be referred to as a prediction block, and the prediction signal represents pixel values, sampling values, or sampling signals in the prediction block. For example, after multiple reference blocks are traversed, an optimal reference block is found. The optimal reference block provides a prediction for the current block and may be referred to as a prediction block.

[0074] The following describes a video coding system in an embodiment of the present invention. Figure 1 is a block diagram of an example video coding system according to an embodiment of the present invention. As used herein, the term "video codec" generally refers to a video encoder and a video decoder. In embodiments of the present invention, the terms "video coding" or "coding" may generally refer to video encoding or video decoding. A video encoder 100 and a video decoder 200 of the video coding system are configured to predict motion information, e.g., a motion vector, of a current coded image block or a sub-block of the current coded image block according to various example methods described in any one of multiple new inter-prediction modes provided in embodiments of the present invention, so that the predicted motion vector maximally approximates a motion vector obtained by using a motion estimation method. In this way, motion vector differences do not need to be transmitted during encoding, thereby further improving coding performance.

[0075] As shown in FIG. 1 , the video coding system includes a source device 10 and a destination device 20. The source device 10 generates encoded video data. Accordingly, the source device 10 may be referred to as a video encoding device. The destination device 20 may decode the encoded video data generated by the source device 10. Accordingly, the destination device 20 may be referred to as a video decoding device. In various implementation solutions, 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 desired program code in the form of computer-accessible instructions or data structures as described herein.

[0076] 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, mobile phones such as "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, and similar devices.

[0077] The destination device 20 may receive the encoded video data from the source device 10 via a link 30. The link 30 may include one or more media or devices capable of moving the encoded video data from the source device 10 to the destination device 20. In one example, the link 30 may include one or more communication media that enable the source device 10 to send the encoded video data directly 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. The 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 cables. The one or more communication media may be part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from source device 10 to destination device 20 .

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

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

[0080] The motion vector prediction techniques in embodiments of the present invention may be applied to video coding to support multiple multimedia applications, such as over-the-air television broadcasting, wireless television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), encoding video data stored on a data storage medium, decoding video data stored on a data storage medium, or other applications. In some examples, a video coding system may be configured to support unidirectional or bidirectional video transmission to support applications such as streaming video transmission, video playback, video broadcasting, and / or video telephony.

[0081] The video coding system depicted in FIG. 1 is merely an example. Techniques in embodiments of the present invention may be applicable to video coding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between an encoding device and a decoding device. In other examples, data may be read from local memory, transmitted over a network in a streaming manner, etc. A video encoding device may encode data and store the data in memory, and / or a video decoding device may read data from memory and decode the data. In many examples, encoding and decoding are performed by devices that simply encode data, store data in memory, and / or read data from memory, and decode data, but do not communicate with each other.

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

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

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

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

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

[0087] In embodiments of the present invention, video encoder 100 may generally be a device that "sends" or "transmits" some information to another device, such as video decoder 200. The terms "send" or "transmit" may generally refer to the transfer of syntax elements and / or other data used to decode compressed video data. The transfer may occur in real time or near real time. Alternatively, the communication may occur after a period of time. For example, the communication may occur when syntax elements in an encoded bitstream are stored to a computer-readable storage medium during encoding, and a decoding device may then retrieve the syntax elements any time after the syntax elements are stored to the medium.

[0088] Video encoder 100 and video decoder 200 may operate according to a video compression standard such as High Efficiency Video Coding (HEVC) or an extension thereof, and may follow the HEVC Test Model (HM). Alternatively, video encoder 100 and video decoder 200 may operate according to other industry standards, such as the ITU-T H.264 standard, the H.265 standard, or an extension of such standards. However, techniques in embodiments of the present invention are not limited to any particular coding standard.

[0089] In one example, the video encoder 100 is configured to encode syntax elements related to a current image block to be coded into a digital video output bitstream (abbreviated as "bitstream"). Here, syntax elements used for inter prediction of the current image block are abbreviated as "inter prediction data," and the inter prediction data includes, for example, indication information of an inter prediction mode. The inter prediction mode in the embodiment of the present invention includes at least one of an AMVP mode based on an affine transformation model and a merge mode based on an affine transformation model. When the inter prediction data includes indication information of an AMVP mode based on an affine transformation model, the inter prediction data may further include an index value (also referred to as an index number) of a candidate motion vector list corresponding to the AMVP mode and a motion vector difference (MVD) of the control point of the current block. When the inter prediction data includes indication information of a merge mode based on an affine transformation model, the inter prediction data may further include an index value (also referred to as an index number) of a candidate motion vector list corresponding to the merge mode. Furthermore, in any embodiment, the inter prediction data in the above example may further include indication information of an affine transformation model (the number of model parameters) of the current block.

[0090] It should be understood that if the difference (i.e., residual) between the prediction block generated based on the motion information predicted based on the new inter prediction mode provided in the embodiment of the present invention and the current image block to be coded (i.e., the original block) is 0, the video encoder 100 only needs to code the syntax elements related to the current image block to be coded into the bitstream. Otherwise, in addition to the syntax elements, the corresponding residual needs to be further coded into the bitstream.

[0091] In a specific embodiment, the video encoder 100 may be configured to perform the following embodiment described in FIG. 13 to implement the encoder-side application of the motion vector prediction method described in the present invention.

[0092] In one example, the video decoder 200 is configured to decode a bitstream to obtain syntax elements related to a current image block to be decoded (S401). Here, the syntax elements used for inter prediction of the current image block are referred to as inter prediction data for short, and the inter prediction data includes, for example, indication information of an inter prediction mode. The inter prediction mode in the embodiment of the present invention includes at least one of an AMVP mode based on an affine transformation model and a merge mode based on an affine transformation model. If the inter prediction data includes indication information of an AMVP mode based on an affine transformation model, the inter prediction data may further include an index value (also referred to as an index number) of a candidate motion vector list corresponding to the AMVP mode and a motion vector difference (MVD) of the control point of the current block. If the inter prediction data includes indication information of a merge mode based on an affine transformation model, the inter prediction data may further include an index value (also referred to as an index number) of a candidate motion vector list corresponding to the merge mode. Furthermore, in any embodiment, the inter prediction data in the above example may further include indication information of an affine transformation model (the number of model parameters) of the current block.

[0093] In a specific embodiment, the video decoder 200 may be configured to perform the following embodiments described in FIG. 9 or FIG. 12 to implement the decoder-side application of the motion vector prediction method described in the present invention.

[0094] 2A is a block diagram of an exemplary video encoder 100 according to an embodiment of the present invention. 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 capable of processing encoded video data from the video encoder 100. For example, the video entity may be a media-aware network element (MANE) or a splicing / editing device. In some cases, the post-processing entity 41 may be an example of a network entity. In some video encoding systems, the post-processing entity 41 and the video encoder 100 may be components of separate devices. In other cases, the functionality described with respect to the post-processing entity 41 may be performed by the same device that includes the video encoder 100. In one example, the post-processing entity 41 is an example of the storage device 40 of FIG. 1.

[0095] In the example of FIG. 2A , video encoder 100 includes prediction processing unit 108, filter unit 106, decoded picture buffer (DPB) 107, summer 112, transformer 101, quantizer 102, and entropy encoder 103. Prediction processing unit 108 includes inter predictor 110 and intra predictor 109. For image block reconstruction, video encoder 100 further includes inverse quantizer 104, inverse transformer 105, and summer 111. Filter unit 106 is intended to represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although filter unit 106 is shown as an in-loop filter in FIG. 2A , in other implementations, filter unit 106 may be implemented as a post-loop filter. In one example, video encoder 100 may further include a video data memory and a partitioning unit (not shown).

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

[0097] As shown in FIG. 2A, video encoder 100 receives video data and stores the video data in a video data memory. A partitioning unit divides the video data into several image blocks, which may be further divided into smaller blocks, for example, based on a quadtree structure or a binary tree structure. The division may further include division into slices, tiles, or other larger units. Video encoder 100 is typically a component that encodes image blocks within a video slice to be coded. A slice may be divided into multiple image blocks (and may be divided into sets of image blocks called tiles).

[0098] An intra predictor 109 in prediction processing unit 108 may perform intra predictive coding on the current image block to be coded relative to one or more neighboring blocks in the same frame or slice as the current image block to remove spatial redundancy. An inter predictor 110 in prediction processing unit 108 may perform inter predictive coding on the current image block relative to one or more predictive blocks in one or more reference images to remove temporal redundancy.

[0099] Specifically, the inter predictor 110 may be configured to determine an inter prediction mode to be used for encoding a current image block. For example, the inter predictor 110 may calculate rate-distortion values ​​of various inter prediction modes in a set of candidate inter prediction modes through rate-distortion analysis and select an inter prediction mode with optimal rate-distortion characteristics from the inter prediction modes. The rate-distortion analysis typically involves determining the amount of distortion (or error) between a coded block and an original uncoded block that should be coded to generate the coded block, and the bit rate (i.e., the amount of bits) used to generate the coded block. For example, the inter predictor 110 may determine an inter prediction mode in the set of candidate inter prediction modes that has the minimum rate-distortion cost and is used to code the current block as the inter prediction mode to be used for performing inter prediction on the current image block. The following describes in detail the inter prediction coding process, particularly the process of predicting motion information of one or more sub-blocks (specifically, each or all sub-blocks) in a current image block using various inter prediction modes used for non-directional or directional motion fields in embodiments of the present invention.

[0100] The inter predictor 110 is configured to predict motion information (e.g., motion vectors) of one or more sub-blocks in the current image block based on the determined inter prediction mode, and obtain or generate a predictive block for the current image block by using the motion information (e.g., motion vectors) of one or more sub-blocks in the current image block. The inter predictor 110 finds a predictive block pointed to by the motion vector in one reference image in the reference image list. The inter predictor 110 may further generate syntax elements associated with the image block and the video slice, so that the video decoder 200 uses the syntax elements to decode the image block of the video slice. Alternatively, in one example, the inter predictor 110 performs a motion compensation process by using the motion information of each sub-block to generate a predictive block for the sub-block, thereby obtaining a predictive block for the current image block. It should be understood that the inter predictor 110 here performs a motion estimation process and a motion compensation process.

[0101] Specifically, after selecting the inter prediction mode for the current image block, the inter predictor 110 may provide information indicating the selected inter prediction mode of the current image block to the entropy encoder 103, so that the entropy encoder 103 encodes the information indicating the selected inter prediction mode. In this embodiment of the present invention, the video encoder 100 may add inter prediction data related to the current image block to a bitstream transmitted by the video encoder 100. The inter prediction data, for example, includes indication information of the inter prediction mode. The inter prediction modes in this embodiment of the present invention include at least one of an AMVP mode based on an affine transformation model and a merge mode based on an affine transformation model. If the inter prediction data includes indication information of the AMVP mode based on an affine transformation model, the inter prediction data may further include an index value (also called an index number) of a candidate motion vector list corresponding to the AMVP mode and a motion vector difference (MVD) of the control point of the current block. If the inter prediction data includes indication information of the merge mode based on an affine transformation model, the inter prediction data may further include an index value (also called an index number) of a candidate motion vector list corresponding to the merge mode. Moreover, in any embodiment, the inter prediction data in the above example may further include an indication of the affine transformation model (number of model parameters) of the current block.

[0102] In a specific embodiment, the inter predictor 110 may be configured to perform the relevant steps in the following embodiment described in FIG. 13 to implement an encoder-side application of the motion vector prediction method described in the present invention.

[0103] The intra predictor 109 may perform intra prediction on the current image block. Specifically, the intra predictor 109 may determine an intra prediction mode to be used to encode the current block. For example, the intra predictor 109 may calculate rate-distortion values ​​of various intra prediction modes to be tested through rate-distortion analysis and select an intra prediction mode having optimal rate-distortion characteristics from the tested modes. In any case, after selecting an intra prediction mode for the image block, the intra predictor 109 may provide information indicating the selected intra prediction mode of the current image block to the entropy encoder 103, so that the entropy encoder 103 encodes the information indicating the selected intra prediction mode.

[0104] After prediction processing unit 108 generates a predictive block for a current image block through inter-prediction and intra-prediction, video encoder 100 subtracts the predictive block from the current image block to be coded to generate a residual image block. Adder 112 represents one or more components that perform the subtraction operation. The residual video data in the residual block may be included in one or more TUs and applied to transformer 101. Transformer 101 converts the residual video data into residual transform coefficients through a transform, such as a discrete cosine transform (DCT) or a conceptually similar transform. Transformer 101 may convert the residual video data from the pixel value domain to a transform domain, e.g., the frequency domain.

[0105] The transformer 101 may send the obtained transform coefficients to the quantizer 102. The quantizer 102 quantizes the transform coefficients to further reduce the bit rate. In some examples, the quantizer 102 may further scan a matrix containing the quantized transform coefficients. Alternatively, the entropy encoder 103 may perform the scan.

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

[0107] The inverse quantizer 104 and the inverse transformer 105 apply inverse quantization and inverse transformation, respectively, to reconstruct the residual block in the pixel domain, e.g., for subsequent use as a reference block in a reference image. The adder 111 adds the reconstructed residual block to the prediction block generated by the inter predictor 110 or the intra predictor 109 to generate a reconstructed image block. The filter unit 106 may be applied to the reconstructed image block to reduce distortions, such as blocking artifacts. The reconstructed image block may then be stored as a reference block in the decoded image buffer 107 and used as a reference block by the inter predictor 110 to perform inter prediction on blocks in subsequent video frames or images.

[0108] 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 image blocks or image frames, the video encoder 100 may directly quantize the residual signal, and accordingly, processing by the transformer 101 and the inverse transformer 105 is not required. Alternatively, for some image blocks or image frames, the video encoder 100 does not generate residual data, and accordingly, processing by the transformer 101, the quantizer 102, the inverse quantizer 104, and the inverse transformer 105 is not required. Alternatively, the video encoder 100 may directly store the reconstructed image block as a reference block without processing by the filter unit 106. Alternatively, the quantizer 102 and the inverse quantizer 104 in the video encoder 100 may be combined.

[0109] Specifically, in this embodiment of the present invention, the video encoder 100 is configured to perform the motion vector prediction methods described in the following embodiments.

[0110] 2B is a block diagram of an exemplary video decoder 200 in accordance with an embodiment of the present invention. In the example of FIG. 2B, video decoder 200 includes an entropy decoder 203, a prediction processing unit 208, an inverse quantizer 204, an inverse transformer 205, an adder 211, a filter unit 206, and a decoded image buffer 207. Prediction processing unit 208 may include an inter predictor 210 and an intra predictor 209. In some examples, video decoder 200 may perform a decoding process that is substantially the reverse of the encoding process described with respect to video encoder 100 in FIG. 2A.

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

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

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

[0114] If a video slice is decoded into an intra-decoded (I) slice, intra predictor 209 of prediction processing unit 208 may generate a prediction block for an image block of the current video slice based on the signaled intra prediction mode and data of a previously decoded block of the current frame or image. If a video slice is decoded into an inter-decoded (i.e., B or P) slice, inter predictor 210 of prediction processing unit 208 may determine an inter prediction mode to be used to decode the current image block of the current video slice based on syntax elements received from entropy decoder 203, and decode (e.g., perform inter prediction on) the current image block based on the determined inter prediction mode. Specifically, inter predictor 210 may determine whether to use a new inter prediction mode to predict the current image block of the current video slice. If the syntax element indicates that a new inter prediction mode is to be used to predict the current image block, the inter predictor 210 predicts the motion information of the current image block or the motion information of a sub-block of the current image block of the current video slice based on the new inter prediction mode (e.g., the new inter prediction mode indicated by the syntax element or the default new inter prediction mode) to obtain or generate a predictive block for the current image block or the sub-block of the current image block based on the predicted motion information of the current image block or the predicted motion information of the sub-block of the current image block by using a motion compensation process. The motion information here may include reference image information and a motion vector. The reference image information may include, but is not limited to, unidirectional / bidirectional prediction information, a reference image list number, and a reference image index corresponding to the reference image list. For inter prediction, the predictive block may be generated from one of the reference images in one of the reference image lists. The video decoder 200 may configure the reference image lists, i.e., List 0 and List 1, based on the reference images stored in the DPB 207.The reference frame index of the current image may be included in one or more of Reference Frame List 0 and Reference Frame List 1. It should be understood that the inter predictor 210 here performs a motion compensation process. The following describes in detail the inter prediction process of predicting the motion information of the current image block or the motion information of a sub-block of the current image block by using the motion information of a reference block in various new inter prediction modes.

[0115] In one example, the inter predictor 210 may predict a current image block to be decoded based on syntax elements related to the current image block to be decoded and obtained by decoding the bitstream (S401). Here, syntax elements used for inter prediction of the current image block are referred to as inter prediction data for short, and the inter prediction data includes, for example, indication information of an inter prediction mode. The inter prediction mode in the embodiment of the present invention includes at least one of an AMVP mode based on an affine transformation model and a merge mode based on an affine transformation model. When the inter prediction data includes indication information of an AMVP mode based on an affine transformation model, the inter prediction data may further include an index value (or referred to as an index number) of a candidate motion vector list corresponding to the AMVP mode and a motion vector difference (MVD) of the control point of the current block. When the inter prediction data includes indication information of a merge mode based on an affine transformation model, the inter prediction data may further include an index value (or referred to as an index number) of a candidate motion vector list corresponding to the merge mode. Moreover, in any embodiment, the inter prediction data in the above example may further include an indication of the affine transformation model (number of model parameters) of the current block.

[0116] In a specific embodiment, the inter predictor 210 may be configured to perform the relevant steps in the following embodiments described in Figure 9 or Figure 12 to implement a decoder-side application of the motion vector prediction method described in the present invention.

[0117] The inverse quantizer 204 performs inverse quantization, i.e., dequantization, on the quantized transform coefficients provided in the bitstream and decoded by the entropy decoder 203. The inverse quantization process may include determining the degree of quantization to be applied by using a quantization parameter calculated by the video encoder 100 for each image block in the video slice, and similarly determining the degree of inverse quantization to be applied. The inverse transformer 205 applies an inverse transform, e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process, to the transform coefficients to generate residual blocks in the pixel domain.

[0118] After the inter predictor 210 generates a predictive block used for the current image block or a sub-block of the current image block, the video decoder 200 adds the residual block from the inverse transformer 205 and the corresponding predictive block generated by the inter predictor 210 to obtain a reconstructed block, i.e., a decoded image block. The adder 211 represents a component that performs the addition operation. If necessary, a loop filter (in the decoding loop or after) may be used to further smooth pixels, or the video quality may be improved in other ways. The filter unit 206 may represent one or more loop filters, such as a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) filter. Although the filter unit 206 is shown in FIG. 2B as an in-loop filter, in other implementations, the filter unit 206 may be implemented as a post-loop filter. In one example, the filter unit 206 can be applied to the reconstructed block to reduce blockiness, and the result is output as a decoded video stream. Moreover, decoded image blocks within a given frame or image may be further stored in a decoded image buffer 207, which stores reference images used for subsequent motion compensation. The decoded image buffer 207 may be part of a memory and may further store decoded video for subsequent presentation on a display device (e.g., display device 220 of FIG. 1). Alternatively, the decoded image buffer 207 may be separate from such memory.

[0119] It should be understood that other structural variations of the video decoder 200 may be used to decode the encoded video stream. For example, the video decoder 200 may generate an output video stream without processing by the filter unit 206. Alternatively, for some image blocks or frames, the entropy decoder 203 of the video decoder 200 does not obtain quantized coefficients through decoding, and correspondingly, processing by the inverse quantizer 204 and the inverse transformer 205 is not necessary.

[0120] Specifically, in this embodiment of the present invention, the video decoder 200 is configured to perform the motion vector prediction method described in the following embodiments.

[0121] 3 is a schematic structural diagram of a video coding device 400 (e.g., video encoding device 400 or video decoding device 400) according to an embodiment of the present invention. Video coding device 400 is applicable to the embodiments described herein. In an embodiment, video coding device 400 may be a video decoder (e.g., video decoder 200 of FIG. 1) or a video encoder (e.g., video encoder 100 of FIG. 1). In other embodiments, video coding device 400 may be one or more components in video decoder 200 of FIG. 1 or video encoder 100 of FIG. 1.

[0122] Video coding device 400 includes an ingress port 410 and a receiver unit (Rx) 420 configured to receive data, a processor, logic unit, or central processing unit (CPU) 430 configured to process the data, a transmitter unit (Tx) 440 and an egress port 450 configured to transmit the data, and a memory 460 configured to store the data. Video coding device 400 may further include optical-electrical and electro-optical (EO) conversion components coupled to ingress port 410, receiver unit 420, transmitter unit 440, and egress port 450 for the egress or ingress of optical or electrical signals.

[0123] The processor 430 is implemented by hardware and software. The processor 430 may be implemented as one or more CPU chips, cores (e.g., a multi-core processor), FPGA, ASIC, or DSP. The processor 430 communicates with the ingress port 410, the receiver unit 420, the transmitter unit 440, the egress port 450, and the memory 460. The processor 430 includes a coding module 470 (e.g., an encoding module 470 or a decoding module 470). The encoding / decoding module 470 implements the embodiments disclosed herein to implement the motion vector prediction method provided in the embodiments of the present invention. For example, the encoding / decoding module 470 performs, processes, or provides various coding operations. Thus, the encoding / decoding module 470 substantially improves the functionality of the video coding device 400 and affects the transformation of the video coding device 400 into a different state. Alternatively, the encoding / decoding module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.

[0124] Memory 460 may include one or more disks, tape drives, and solid-state drives, and may be used as overflow data storage devices to store programs when such programs are selectively executed, and to store instructions and data read during program execution. Memory 460 may be volatile and / or nonvolatile, and may be read-only memory (ROM), random access memory (RAM), ternary content-addressable memory (TCAM), and / or static random access memory (SRAM).

[0125] It should be understood that in the video encoder 100 and the video decoder 200 of the present application, the processing result of a procedure may be further processed before being output to the next procedure, for example, after a procedure such as interpolation filtering, motion vector derivation, or loop filtering, an operation such as clipping or shifting may be further performed on the processing result of the corresponding procedure.

[0126] For example, the motion vector of the control point of the current image block, which is derived based on the motion vector of the neighboring affine coding block, may be further processed. This is not limited in the present application. For example, the value range of the motion vector may be restricted so that the motion vector is within a specific bit depth. If the allowed bit depth of the motion vector is bitDepth, the motion vector range is from -2^(bitDepth-1) to 2^(bitDepth-1), where the sign "^" represents the exponent. If bitDepth is 16, the value range is from -32768 to 32767. If bitDepth is 18, the value range is from -131072 to 131071. The value range of the motion vector may be restricted in one of the following two ways.

[0127] Method 1: Overflowing high order bits of motion vectors are removed: ux=(vx+2 bitDepth )%2 bitDepth vx=(ux>=2 bitDepth-1 )?(ux-2 bitDepth ):ux uy=(vy+2 bitDepth )%2 bitDepth vy=(uy>=2 bitDepth-1 )?(uy-2 bitDepth ):uy

[0128] For example, if the value of vx is -32769, 32767 is obtained according to the above formula. Values ​​are stored in the computer in two's complement format, and the two's complement of -32769 is 1, 0111, 1111, 1111, 1111 (17 bits). The process performed by the computer to overflow is to discard the higher bits. Therefore, the value of vx is 0111, 1111, 1111, 1111, i.e., 32767, which matches the result obtained according to the formula.

[0129] Method 2: Clipping is performed on the motion vectors as shown in the following equation: vx=Clip3(-2 bitDepth-1 ,2 bitDepth-1 -1,vx) vy=Clip3(-2 bitDepth-1 ,2 bitDepth-1 -1,vy)

[0130] In the above formula, Clip3 is defined as clipping the value of z to the range [x,y].

number

[0131] 4 is a schematic block diagram of an implementation of an encoding or decoding device (coding device 1200 for short) according to an embodiment of the present invention. The coding device 1200 may include a processor 1210, a memory 1230, and a bus system 1250. The processor and the memory are connected to each other by using the bus system. The memory is configured to store instructions. The processor is configured to execute the instructions stored in the memory. The memory of the encoding device stores program code. The processor may invoke the program code stored in the memory to perform various video encoding or decoding methods described in embodiments of the present invention, in particular, video encoding or decoding methods in various new inter-prediction modes and motion information prediction methods in the new inter-prediction modes. To avoid repetition, details will not be described again here.

[0132] In this embodiment of the invention, processor 1210 may be a central processing unit (CPU), or processor 1210 may be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.

[0133] The memory 1230 may include a read-only memory (ROM) device or a random-access memory (RAM) device. Any other suitable type of storage device may be used as the memory 1230. The memory 1230 may include code and data 1231 accessed by the processor 1210 by using the bus system 1250. The memory 1230 may further include an operating system 1233 and application programs 1235. The application programs 1235 include at least one program that enables the processor 1210 to perform the video encoding or decoding method described in the embodiments of the present invention (particularly, the motion vector prediction method described in the embodiments of the present invention). For example, the application programs 1235 may include applications 1 to N, and further include a video encoding or decoding application (video coding application for short) that performs the video encoding or decoding method described in the embodiments of the present invention.

[0134] In addition to a data bus, the bus system 1250 may further include a power bus, a control bus, a status signal bus, etc. For clarity, various types of buses are labeled in the figures as the bus system 1250.

[0135] Optionally, coding device 1200 may further include one or more output devices, such as a display 1270. In one example, display 1270 may be a touch display that combines a display with a touch unit that operatively detects touch input. Display 1270 may be connected to processor 1210 using bus system 1250.

[0136] In order to better understand the technical solutions in the embodiments of the present invention, the following further describes the inter prediction mode, non-translational motion model, inherited control point motion vector prediction method, and constructive control point motion vector prediction method in the embodiments of the present invention.

[0137] (1) Inter-prediction mode: HEVC uses two inter-prediction modes: advanced motion vector prediction (AMVP) mode and merge mode.

[0138] In AMVP mode, coded blocks (referred to as neighboring blocks) that are spatially or temporally adjacent to the current block are first traversed. A candidate motion vector list (also referred to as a motion information candidate list) is constructed based on the motion information of the neighboring blocks. Then, an optimal motion vector is determined in the candidate motion vector list based on the rate-distortion cost, and the candidate motion information with the smallest rate-distortion cost is used as the motion vector predictor (MVP) for the current block. The position and traversal order of the neighboring blocks are predefined. The rate-distortion cost is calculated according to Equation (1), where J represents the rate-distortion cost RD cost, SAD is the sum of absolute differences (SAD) between the original pixel value and the predicted pixel value obtained through motion estimation by using the candidate motion vector predictor, R represents the bit rate, and λ represents the Lagrange multiplier. The encoder side transfers the index value of the selected motion vector predictor in the candidate motion vector list and the reference frame index value to the decoder side. Furthermore, a motion search is performed in a neighborhood centered on the MVP to obtain the actual motion vector of the current block. The encoder side transfers the difference between the MVP and the actual motion vector (motion vector difference) to the decoder side. J=SAD+λR (1)

[0139] In merge mode, a candidate motion vector list is first constructed based on the motion information of coded blocks spatially or temporally neighboring the current block. Then, a rate-distortion cost is calculated to determine the best motion information in the candidate motion vector list as the motion information of the current block, and the index value of the best motion information's position in the candidate motion vector list (hereinafter referred to as the merge index) is transferred to the decoder side. Figure 5 shows the spatial and temporal candidate motion information of the current block. The spatial candidate motion information is from five spatially neighboring blocks (A0, A1, B0, B1, and B2). If a neighboring block is unavailable (either because the neighboring block does not exist, or because the neighboring block is not coded, or because the prediction mode used for the neighboring block is not inter prediction mode), the motion information of the neighboring block is not added to the candidate motion vector list. The temporal candidate motion information of the current block is obtained by scaling the motion vector of the block at the corresponding position in the reference frame based on the picture order count (POC) of the reference frame and the current frame. It is first determined whether a block at position T in the reference frame is available. If the block is unavailable, then the block at position C is selected.

[0140] Similar to AMVP mode, in merge mode, the positions and traversal order of neighboring blocks are also predefined. Moreover, the positions and traversal order of neighboring blocks may be different in different modes.

[0141] It can be seen that the candidate motion vector list needs to be maintained in both AMVP mode and merge mode. Every time new motion information is added to the candidate list, it is first checked whether the same motion information already exists in the list. If the same motion information exists in the list, the motion information is not added to the list. This checking process is called pruning the candidate motion vector list. The purpose of pruning the list is to avoid the same motion information in the list so as to avoid redundant rate-distortion cost calculation.

[0142] During inter prediction in HEVC, the same motion information is used for all pixels in a coding block (i.e., the motion of all pixels in a coding block is consistent), and then motion compensation is performed based on the motion information to obtain pixel predictors for the coding block. However, in a coding block, not all pixels have the same motion characteristics. Using the same motion information may result in inaccurate motion-compensated predictions and more residual information.

[0143] That is, existing video coding standards use block matching motion estimation based on a translational motion model. However, in the real world, various motions exist. Many objects, such as rotating objects, roller coasters that rotate in different directions, fireworks, and some stunts in movies, do not have translational motion. When these moving objects, especially those in UGC scenarios, are coded by using block motion compensation techniques based on a translational motion model in current coding standards, coding efficiency is greatly affected. Therefore, a non-translational motion model, such as an affine motion model, is introduced to further improve coding efficiency.

[0144] Based on this, with respect to different motion models, AMVP modes may be classified into AMVP modes based on translational motion models and AMVP modes based on non-translational motion models, and merge modes may be classified into merge modes based on translational motion models and merge modes based on non-translational motion models.

[0145] (2) Non-translational Motion Model. In prediction based on a non-translational motion model, the codec side uses one motion model to derive motion information of each motion compensation subunit in the current block, and performs motion compensation based on the motion information of the motion compensation subunit to obtain a prediction block. This can improve prediction efficiency. In an embodiment of the present invention, the motion compensation subunit may be a sample or pixel block with a size of N1×N2 obtained through division according to a specific method, where N1 and N2 are both positive integers, and N1 may or may not be equal to N2.

[0146] Frequently used non-translational motion models include a four-parameter affine model, a six-parameter affine model, and, in possible application scenarios, an eight-parameter bilinear model, which are described separately below.

[0147] The four-parameter affine transformation model is shown in Equation (2):

number

[0148] A four-parameter affine transformation model can be expressed by using motion vectors of two samples and the coordinates of the two samples relative to the sample at the upper-left corner of the current block. The samples used to represent the motion model parameters are called control points. When the sample at the upper-left corner (0,0) and the sample at the upper-right corner (W,0) are used as control points, the motion vectors (vx0,vy0) and (vx1,vy1) of the control points at the upper-left and upper-right corners of the current block are first determined. Then, the motion information of each motion compensation subunit of the current block is obtained according to the following equation (3), where (x,y) are the coordinates of the motion compensation subunit relative to the sample at the upper-left corner of the current block, and W represents the width of the current block.

number

[0149] The six-parameter affine transformation model is shown in Equation (4):

number

[0150] The six-parameter affine transformation model can be expressed by using motion vectors of three samples and the coordinates of the three samples relative to the sample at the upper-left corner of the current block. When the sample at the upper-left corner (0,0), the sample at the upper-right corner (W,0), and the sample at the lower-left corner (0,H) are used as control points, the motion vectors of the control points at the upper-left corner, upper-right corner, and lower-left corner of the current block are first determined and are (vx0,vy0), (vx1,vy1), and (vx2,vy2), respectively. Then, the motion information of each motion compensation subunit of the current block is obtained according to the following equation (5), where (x,y) are the coordinates of the motion compensation subunit relative to the sample at the upper-left corner of the current block, and W and H represent the width and height of the current block, respectively.

number

[0151] The eight-parameter bilinear model is shown in equation (6):

number

[0152] The eight-parameter bilinear model can be expressed by using motion vectors of four samples and the coordinates of the four samples relative to the sample at the upper-left corner of the current coding block. If the sample at the upper-left corner (0,0), the sample at the upper-right corner (W,0), the sample at the lower-left corner (0,H), and the sample at the lower-right corner (W,H) are used as control points, the motion vectors (vx0,vy0), (vx1,vy1), (vx2,vy2), and (vx3,vy3) of the control points at the upper-left corner, upper-right corner, lower-left corner, and lower-right corner of the current coding block are first determined. Then, the motion information of each motion compensation subunit of the current coding block is derived according to the following equation (7), where (x,y) are the coordinates of the motion compensation subunit relative to the sample at the upper-left corner of the current coding block, and W and H are the width and height of the current coding block, respectively.

number

[0153] A coding block predicted by using an affine transformation model may also be called an affine coding block. It can be seen from the above description that the affine transformation model is directly related to the motion information of the control points of an affine coding block.

[0154] Generally, the motion information of the control points of the affine coding block may be obtained by using an AMVP mode based on an affine transformation model or a merge mode based on an affine transformation model. In the AMVP mode based on an affine transformation model or a merge mode based on an affine transformation model, the motion information of the control points of the affine coding block may be obtained according to a successive control point motion vector prediction method or a constructive control point motion vector prediction method. The following will further describe the two methods.

[0155] (3) Inherited control point motion vector prediction method. In the inherited control point motion vector prediction method, the candidate motion vectors of the control points of the current block are determined by using the affine transformation models of the coded affine coding blocks adjacent to the current block. The number of parameters of the affine transformation models of the affine coding blocks (e.g., four parameters, six parameters, or eight parameters) is the same as that of the affine transformation model of the current block.

[0156] The current block shown in FIG. 6 is used as an example. The neighboring blocks of the current block are traversed in a specific order, for example, A1 → B1 → B0 → A0 → B2, to find the affine coding block in which the neighboring blocks of the current block are located and obtain the motion information of the control points of the affine coding block. Furthermore, the motion vectors of the control points (in the merge mode) or the motion vector predictors of the control points (in the AMVP mode) are derived for the current block by using an affine transformation model constructed based on the motion information of the control points of the affine coding block. The order A1 → B1 → B0 → A0 → B2 is used merely as an example. Other combination orders are also applicable to embodiments of the present invention. Moreover, the neighboring blocks are not limited to A1, B1, B0, A0, and B0. The neighboring blocks may be samples or pixel blocks of a preset size obtained according to a specific division method, for example, a 4×4 pixel block, a 4×2 pixel block, or a pixel block of another size. This is not limited. An affine coding block is a coded block (which may also be called a neighboring affine coding block for short) that is close to the current block and is predicted by using an affine transformation model in the coding phase.

[0157] The following uses A1 shown in Figure 6 as an example to explain the process of determining the candidate motion vectors of the control points of the current block. Other cases are estimated by analogy.

[0158] If the affine coding block in which A1 is located is a four-parameter affine coding block (i.e., the affine coding block is predicted by using a four-parameter affine transformation model), a motion vector (vx4,vy4) for the upper left corner (x4,y4) of the affine coding block and a motion vector (vx5,vy5) for the upper right corner (x5,y5) of the affine coding block are obtained.

[0159] Then, the motion vector (vx0,vy0) for the top left corner (x0,y0) of the current block is calculated according to the following equation (8):

number

[0160] The motion vector (vx1, vy1) for the top right corner (x1, y1) of the current block is calculated according to the following equation (9):

number

[0161] The combination of the motion vector (vx0, vy0) at the top left corner (x0, y0) of the current block and the motion vector (vx1, vy1) at the top right corner (x1, y1) of the current block obtained based on the affine coding block in which A1 is located is the candidate motion vector for the control point of the current block.

[0162] If the coding block in which A1 is located is a 6-parameter affine coding block (i.e., the affine coding block is predicted by using a 6-parameter affine transformation model), a motion vector (vx4,vy4) for the upper left corner (x4,y4) of the affine coding block, a motion vector (vx5,vy5) for the upper right corner (x5,y5) of the affine coding block, and a motion vector (vx6,vy6) for the lower left corner (x6,y6) of the affine coding block are obtained.

[0163] Then, the motion vector (vx0,vy0) for the top left corner (x0,y0) of the current block is calculated according to the following equation (10):

number

[0164] The motion vector (vx1, vy1) for the top right corner (x1, y1) of the current block is calculated according to the following equation (11):

number

[0165] The motion vector (vx2, vy2) for the bottom left corner (x2, y2) of the current block is calculated according to the following equation (12):

number

[0166] The combination of the motion vector (vx0, vy0) at the top left corner (x0, y0), the motion vector (vx1, vy1) at the top right corner (x1, y1), and the motion vector (vx2, vy2) at the bottom left corner (x2, y2) of the current block obtained based on the affine coding block in which A1 is located is the candidate motion vector for the control point of the current block.

[0167] It should be noted that other motion models, candidate positions, and search and traversal orders are also applicable to the embodiments of the present invention, the details of which will not be described in the embodiments of the present invention.

[0168] It should be noted that methods of expressing the motion model of the current and neighboring coding blocks by using other control points may also be applicable to embodiments of the present invention, and details will not be described here.

[0169] (4) Constructive control point motion vector prediction method. In the constructive control point motion vector prediction method, the motion vectors of the adjacent coded blocks of the control points of the current block are combined to form the motion vector of the control point of the current affine coding block, and it is not necessary to consider whether the adjacent coded blocks are affine coding blocks. The constructive control point motion vector prediction methods based on different prediction modes (AMVP mode based on affine transformation model and merge mode based on affine transformation model) are different and will be described separately below.

[0170] The constructive control point motion vector prediction method based on the AMVP mode, which is based on the affine transformation model, is first described.

[0171] Figure 7 is used as an example to explain a constructive control point motion vector prediction method that determines the motion vectors for the upper left and upper right corners of the current block by using motion information of adjacent coded blocks of the current coding block.

[0172] If the current block is a four-parameter affine coding block (i.e., the current block is predicted by using a four-parameter affine transformation model), the motion vector of the coded block A2, B2, or B3 adjacent to the upper left corner may be used as a candidate motion vector for the motion vector of the upper left corner of the current block. The motion vector of the coded block B1 or B0 adjacent to the upper right corner is used as a candidate motion vector for the motion vector of the upper right corner of the current block. The candidate motion vectors of the upper left and upper right corners are combined to form multiple 2-tuples. The motion vectors of the two coded blocks included in the 2-tuples may be used as candidate control point motion vectors for the current block. The multiple 2-tuples are shown in (13A) as follows: {v A2 ,v B1},{v A2 ,v B0},{v B2 ,v B1},{v B2 ,v B0},{v B3 ,v B1},{v B3 ,v B0} (13A)

[0173] v A2 represents the motion vector of A2, and v B1 represents the motion vector of B1, and v B0 represents the motion vector of B0, and v B2 represents the motion vector of B2, and v B3 represents the motion vector of B3.

[0174] If the current block is a six-parameter affine coding block (i.e., the current block is predicted by using a six-parameter affine transformation model), the motion vector of the coded block A2, B2, or B3 adjacent to the upper left corner may be used as a candidate motion vector for the motion vector of the upper left corner of the current block. The motion vector of the coded block B1 or B0 adjacent to the upper right corner is used as a candidate motion vector for the motion vector of the upper right corner of the current block. The motion vector of the coded block A0 or A1 adjacent to the lower left corner is used as a candidate motion vector for the motion vector of the lower left corner of the current block. The candidate motion vectors of the upper left, upper right, and lower left corners are combined to form multiple triplets. The motion vectors of the three coded blocks included in the triplet may be used as candidate control point motion vectors for the current block. The multiple triplets are shown as follows ((13B) and (13C)): {v A2 ,v B1 ,v A0},{v A2 ,v B0 ,v A0},{v B2 ,v B1 ,v A0},{v B2 ,v B0 ,v A0},{v B3 ,v B1 ,v A0},{v B3 ,v B0 ,v A0} (13B) {v A2 ,v B1 ,v A1},{v A2 ,v B0 ,v A1},{v B2 ,v B1 ,v A1},{v B2 ,v B0 ,v A1},{v B3 ,v B1 ,v A1},{v B3 ,v B0 ,v A1} (13C)

[0175] v A2 represents the motion vector of A2, and v B1 represents the motion vector of B1, and v B0 represents the motion vector of B0, and v B2 represents the motion vector of B2, and v B3 represents the motion vector of B3, and v A0 represents the motion vector of A0, and v A1 represents the motion vector of A1.

[0176] It should be noted that Figure 7 is just an example. It should be noted that other methods of combining control point motion vectors may also be applicable to embodiments of the present invention. Details will not be described here.

[0177] It should be noted that methods of expressing the motion model of the current and neighboring coding blocks by using other control points may also be applicable to embodiments of the present invention, and details will not be described here.

[0178] The following describes a constructive control point motion vector prediction method based on merge mode based on affine transformation model.

[0179] Figure 8 is used as an example to explain a constructive control point motion vector prediction method, which determines the motion vectors of the upper left and upper right corners of the current block by using the motion information of the adjacent coded blocks of the current coding block. It should be noted that Figure 8 is just an example.

[0180] As shown in FIG. 8, CPk (k=1, 2, 3, 4) represents the kth control point. A0, A1, A2, B0, B1, B2, and B3 are spatially adjacent positions of the current block and are used to predict CP1, CP2, or CP3. T is a temporally adjacent position of the current block and is used to predict CP4. The coordinates of CP1, CP2, CP3, and CP4 are (0, 0), (W, 0), (H, 0), and (W, H), respectively, where W and H represent the width and height of the current block. In this case, the motion information of each control point of the current block is obtained in the following order:

[0181] 1. For CP1, the checking order is B2→A2→B3. If B2 is available, the motion information of B2 is used; otherwise, A2 and B3 are checked. If the motion information of all three positions is unavailable, the motion information of CP1 cannot be obtained.

[0182] 2. For CP2, the checking order is B0 → B1. If B0 is available, the motion information of B0 is used for CP2; otherwise, B1 is checked. If the motion information of both positions is unavailable, the motion information of CP2 cannot be obtained.

[0183] 3. For CP3, the confirmation order is A0 → A1.

[0184] 4. For CP4, the motion information of T is used.

[0185] Here, X is available means that the block at position X (X is A0, A1, A2, B0, B1, B2, B3, or T) has already been coded and an inter prediction mode is used for the block. Otherwise, position X is unavailable. It should be noted that other methods for obtaining control point motion information may also be applicable to embodiments of the present invention. Details will not be described here.

[0186] The control point motion information of the current block is then combined to obtain constructive control point motion information.

[0187] When a four-parameter affine transformation model is used for the current block, the motion information of two control points of the current block is combined to form a 2-tuple to construct the four-parameter affine transformation model. Two control points may be combined as follows: {CP1,CP4}, {CP2,CP3}, {CP1,CP2}, {CP2,CP4}, {CP1,CP3}, and {CP3,CP4}. For example, a four-parameter affine transformation model constructed by using a 2-tuple including control points CP1 and CP2 can be represented as Affine(CP1,CP2).

[0188] When a six-parameter affine transformation model is used for the current block, the motion information of three control points of the current block is combined to form a triplet to construct the six-parameter affine transformation model. The three control points may be combined as follows: {CP1, CP2, CP4}, {CP1, CP2, CP3}, {CP2, CP3, CP4}, and {CP1, CP3, CP4}. For example, a six-parameter affine transformation model constructed by using a triplet including control points CP1, CP2, and CP3 can be represented as Affine(CP1, CP2, CP3).

[0189] When an 8-parameter bilinear model is used for the current block, the motion information of the four control points of the current block is combined to form a quadruple to construct the 8-parameter bilinear model. The 8-parameter bilinear model constructed by using a quadruple including control points CP1, CP2, CP3, and CP4 can be expressed as Bilinear(CP1,CP2,CP3,CP4).

[0190] For ease of description herein, a combination of motion information for two control points (or two coded blocks) is abbreviated as a 2-tuple, a combination of motion information for three control points (or three coded blocks) is abbreviated as a triplet, and a combination of motion information for four control points (or four coded blocks) is abbreviated as a quadruple.

[0191] These models are traversed in a preset order. If the motion information of the control points corresponding to the combined model is unavailable, the model is considered unavailable. Otherwise, the reference frame index of the model is determined, and the motion vectors of the control points are scaled. If the motion information of all the control points after scaling matches, the model is invalid. If the motion information of all the control points that control the model is available and the model is valid, the motion information of the control points used to calibrate the model is added to a motion information candidate list.

[0192] The method for scaling the control point motion vectors is shown in equation (14) below:

number

[0193] CurPoc represents the POC number of the current frame, DesPoc represents the POC number of the reference frame of the current block, SrcPoc represents the POC number of the reference frame of the control point, MVs represents the motion vector obtained through scaling, and MV represents the motion vector of the control point.

[0194] It should be noted that a combination of different control points may alternatively be transformed into a control point at the same location.

[0195] For example, a four-parameter affine transformation model obtained through the combinations {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} is represented by {CP1,CP2} or {CP1,CP2,CP3}. The transformation method is to obtain the model parameters by substituting the motion vectors and coordinate information of the control points into the above formula (2), and then to obtain the motion vectors of the control points by substituting the coordinate information of {CP1,CP2} into the above formula (3).

[0196] More directly, the transformation may be performed according to the following equations (15) to (23), where W represents the width of the current block and H represents the height of the current block. In equations (15) to (23), (vx0, vy0) represents the motion vector of CP1, (vx1, vy1) represents the motion vector of CP2, (vx2, vy2) represents the motion vector of CP3, and (vx3, vy3) represents the motion vector of CP4.

[0197] {CP1, CP2} may be transformed into {CP1, CP2, CP3} according to the following equation (15): That is, the motion vector of CP3 in {CP1, CP2, CP3} may be determined according to the following equation (15):

number

[0198] {CP1,CP3} can be converted to {CP1,CP2} or {CP1,CP2,CP3} according to the following formula (16):

number

[0199] {CP2,CP3} can be converted to {CP1,CP2} or {CP1,CP2,CP3} according to the following formula (17):

number

[0200] {CP1,CP4} can be converted to {CP1,CP2} or {CP1,CP2,CP3} according to the following equations (18) or (19):

number

[0201] {CP2,CP4} can be converted to {CP1,CP2} according to the following equation (20), and {CP2,CP4} can be converted to {CP1,CP2,CP3} according to the following equations (20) and (21):

number

[0202] {CP3,CP4} can be converted to {CP1,CP2} according to the following equation (22), and {CP3,CP4} can be converted to {CP1,CP2,CP3} according to the following equations (22) and (23):

number

[0203] For example, a six-parameter affine transformation model obtained through the combinations {CP1, CP2, CP4}, {CP2, CP3, CP4}, or {CP1, CP3, CP4} is represented by the control points {CP1, CP2, CP3}. The transformation method is to substitute the motion vectors and coordinate information of the control points into the above equation (4) to obtain the model parameters, and then substitute the coordinate information of {CP1, CP2, CP3} into the above equation (5) to obtain the motion vectors of the control points.

[0204] More directly, the transformation may be performed according to the following equations (24) to (26), where W represents the width of the current block and H represents the height of the current block. In equations (24) to (26), (vx0, vy0) represents the motion vector of CP1, (vx1, vy1) represents the motion vector of CP2, (vx2, vy2) represents the motion vector of CP3, and (vx3, vy3) represents the motion vector of CP4.

[0205] {CP1,CP2,CP4} can be transformed into {CP1,CP2,CP3} according to equation (24):

number

[0206] {CP2,CP3,CP4} can be transformed into {CP1,CP2,CP3} according to equation (25):

number

[0207] {CP1,C3,CP4} can be transformed into {CP1,CP2,CP3} according to equation (26):

number

[0208] In a specific embodiment, after the control point motion information currently being constructed is added to the candidate motion vector list, if the length of the candidate list is shorter than the maximum list length (e.g., MaxAffineNumMrgCand), these combinations are traversed in a preset order, and the obtained valid combination is used as the candidate motion information of the control point. If the candidate motion vector list is empty, the candidate motion information of the control point is added to the candidate motion vector list. Otherwise, the motion information in the candidate motion vector list is traversed sequentially to determine whether motion information identical to the candidate motion information of the control point exists in the candidate motion vector list. If motion information identical to the candidate motion information of the control point does not exist in the candidate motion vector list, the candidate motion information of the control point is added to the candidate motion vector list.

[0209] For example, the preset order is: Affine(CP1,CP2,CP3) → Affine(CP1,CP2,CP4) → Affine(CP1,CP3,CP4) → Affine(CP2,CP3,CP4) → Affine(CP1,CP2) → Affine(CP1,CP3) → Affine(CP2,CP3) → Affine(CP1,CP4) → Affine(CP2,CP4) → Affine(CP3,CP4). There are 10 possible combinations in total.

[0210] If the control point motion information corresponding to the combination is unavailable, the combination is deemed unavailable. If the combination is available, the reference frame index of the combination is determined (in the case of two control points, the smallest reference frame index is selected as the reference frame index of the combination; in the case of more than two control points, the most frequently occurring reference frame index is selected; in the case of multiple reference frame indexes that appear the same number of times, the smallest reference frame index is selected as the reference frame index of the combination), and the control point motion vectors are scaled. If the motion information of all control points after scaling is consistent, the combination is invalid.

[0211] Optionally, in an embodiment of the present invention, the candidate motion vector list may alternatively be padded. For example, if after the above traversal process, the length of the candidate motion vector list is shorter than the maximum list length (e.g., MaxAffineNumMrgCand), the candidate motion vector list may be padded until the list length is equal to the maximum list length.

[0212] The padding may be performed by padding zero motion vectors, or by combining or weighted averaging existing candidate motion information in the existing list. It should be noted that other methods of padding the candidate motion vector list may also be applicable to embodiments of the present invention. Details will not be described here.

[0213] In the existing solution, for the inherited control point motion vector prediction method, the non-translational motion model used in the same image sequence is fixed, and the number of parameters of the affine transformation model used in different blocks in the image is the same. That is, the number of parameters of the affine transformation model used in the affine coding block is the same as that of the affine transformation model used in the current block. Therefore, the number of control points of the affine coding block is the same as that of the current block, and the positions of the control points in the affine coding block are the same as those of the current block.

[0214] For example, if a four-parameter affine transformation model is used for an affine coding block, the four-parameter affine transformation model is also used for the current block, and the decoder side obtains motion vector information for each sub-block of the current block based on the four-parameter affine transformation model of the current block to reconstruct each sub-block.

[0215] As another example, when an 8-parameter bilinear model is used for an affine coding block, the 8-parameter bilinear model is also used for the current block, and the decoder side obtains motion vector information for each sub-block of the current block based on the 8-parameter bilinear model of the current block to reconstruct each sub-block.

[0216] Practice shows that the affine motion of different blocks in an image may be different (i.e., the affine motion of the current block may be different from the affine motion of the affine coding block).Therefore, in the existing method in which the current block is parsed (for example, a candidate motion vector list is established) and reconstructed based on the affine transformation model having the same degree as the affine coding block, the coding efficiency and accuracy in predicting the current block are not high, and it is still difficult to meet user requirements in some scenarios.

[0217] In order to eliminate the shortcomings of existing solutions and improve coding efficiency and accuracy during prediction in the coding process, the inherited control point motion vector prediction method is improved in the embodiment of the present invention.There are two improved solutions, namely, a first improved solution and a second improved solution.The first improved solution may also be called a motion vector prediction method based on a first motion model, and the second improved solution may also be called a motion vector prediction method based on a second motion model.The following describes the two methods separately.

[0218] (5) A motion vector prediction method based on a first motion model. In the motion vector prediction method based on the first motion model, the affine transformation model used for different blocks of images in an image sequence is not limited; that is, different affine transformation models may be used for different blocks. In the process of encoding and decoding a current block, the affine transformation model used for the current block is first determined. The affine transformation model used for the current block may be predefined, or may be selected from multiple affine transformation models based on the actual motion state or actual requirements of the current block. It is assumed that a 2×N parameter affine transformation model is used for the current block's neighboring blocks (also called affine coding blocks on the encoder side or affine decoding blocks on the decoder side), and a 2×K parameter affine transformation model is used for the current block, where N≠N. In this case, motion vectors (candidate motion vectors) of K control points of the current block are obtained through interpolation calculation based on the 2×N parameter affine transformation models used for the neighboring blocks.

[0219] The following uses A1 shown in Fig. 10 as an example to explain the process of determining candidate motion vectors for control points of a current block. The determination process is mainly described from the decoder's perspective. In this case, the neighboring block where A1 is located is an affine-decoded block. It can be understood that the implementation on the encoder's side can be deduced by analogy. That is, on the encoder's side, the neighboring block of the current block is an affine-coded block. Details regarding the implementation will not be described again in this specification.

[0220] For example, if a six-parameter affine transformation model is used for the affine-decoded block where A1 is located, and a four-parameter affine transformation model is used for the current block, the motion vector (vx4, vy4) for the upper-left corner (x4, y4) of the affine-decoded block, the motion vector (vx5, vy5) for the upper-right corner (x5, y5) of the affine-decoded block, and the motion vector (vx6, vy6) for the lower-left corner (x6, y6) of the affine-decoded block are obtained. According to the following equations (27) and (28) for the six-parameter affine transformation model, the interpolation calculation is separately performed by using the six-parameter affine transformation model constructed by the motion vectors of the above three control points of the affine-decoded block to obtain the motion vector (vx0, vy0) for the upper-left corner (x0, y0) of the current block and the motion vector (vx1, vy1) for the upper-right corner (x1, y1) of the current block:

number

[0221] As another example, if a four-parameter affine transformation model is used for the affine-decoded block where A1 is located and a six-parameter affine transformation model is used for the current block, a motion vector (vx4,vy4) for the upper-left corner (x4,y4) of the affine-decoded block and a motion vector (vx5,vy5) for the upper-right corner (x5,y5) of the affine-decoded block are obtained. In this case, the motion vectors of two control points of the affine-decoded block are obtained, i.e., the motion vector (vx4,vy4) for the upper-left control point (x4,y4) and the motion vector (vx5,vy5) for the upper-right control point (x5,y5). According to the following equations (29), (30), and (31) for the four-parameter affine transformation model, the interpolation calculation is separately performed by using the four-parameter affine transformation model constructed by the motion vectors of two control points of the affine decoding block to obtain the motion vector (vx0,vy0) for the upper-left corner (x0,y0) of the current block, the motion vector (vx1,vy1) for the upper-right corner (x1,y1) of the current block, and the motion vector (vx2,vy2) for the lower-left corner (x2,y2) of the current block:

number

[0222] It should be noted that the above example is merely used to explain the technical solution of the present invention, and is not intended to limit the present invention. Besides, when other affine transformation models are used for the current block and the neighboring blocks (for example, a 4-parameter affine transformation model is used for the current block, and an 8-parameter bilinear model is used for the neighboring blocks, or a 6-parameter affine transformation model is used for the current block, and an 8-parameter bilinear model is used for the neighboring blocks), please refer to the implementation of the above example. The details will not be described again here.

[0223] It should be further noted that this solution does not limit whether the number of model parameters of the current block is the same as that of the neighboring block. Therefore, in some implementation scenarios, the number of model parameters of the current block may also be the same as that of the neighboring block.

[0224] For example, if a four-parameter affine transformation model is used for the affine-decoded block in which A1 is located, and the four-parameter affine transformation model is also used for the current block, the motion vector (vx4, vy4) for the upper-left corner (x4, y4) of the affine-decoded block and the motion vector (vx5, vy5) for the upper-right corner (x5, y5) of the affine-decoded block are obtained. According to the following equations (32) and (33) for the four-parameter affine transformation model, the interpolation calculation is separately performed by using the four-parameter affine transformation model constructed by the motion vectors of the above two control points of the affine-decoded block to obtain the motion vector (vx0, vy0) for the upper-left corner (x0, y0) of the current block and the motion vector (vx1, vy1) for the upper-right corner (x1, y1) of the current block:

number

[0225] As another example, if a six-parameter affine transformation model is used for the affine-decoded block in which A1 is located and a six-parameter affine transformation model is used for the current block, a motion vector (vx4,vy4) for the upper left corner (x4,y4) of the affine-decoded block, a motion vector (vx5,vy5) for the upper right corner (x5,y5) of the affine-decoded block, and a motion vector (vx6,vy6) for the lower left corner (x6,y6) of the affine-decoded block are obtained. According to the following equations (34), (35), and (36) for the six-parameter affine transformation model, the interpolation calculation is separately performed by using the six-parameter affine transformation model constructed by three control points of the affine decoding block to obtain the motion vector (vx0,vy0) for the upper-left corner (x0,y0) of the current block, the motion vector (vx1,vy1) for the upper-right corner (x1,y1) of the current block, and the motion vector (vx2,vy2) for the lower-left corner (x2,y2) of the current block:

number

[0226] It should be noted that the above example is merely used to explain the technical solution of the present invention, and is not intended to limit the present invention. Besides, when other affine transformation models are used for the current block and the neighboring blocks (for example, an 8-parameter bilinear model is used for both the current block and the neighboring blocks), please refer to the implementation of the above example. The details will not be described again here.

[0227] According to the motion vector prediction method based on the first motion model of the present invention, in the phase of parsing the current block (for example, in the phase of constructing a candidate motion vector list), the affine transformation model of a neighboring block can be used to construct the affine transformation model of the current block. The affine transformation models of the two blocks can be different. The affine transformation model of the current block better satisfies the actual motion state / actual requirements of the current block. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0228] (6) A motion vector prediction method based on a second motion model. In the motion vector prediction method based on a second motion model, the affine transformation model used for different blocks of an image in an image sequence is not limited, and the same or different affine transformation models may be used for different blocks. That is, when a 2×N parameter affine transformation model is used for neighboring blocks (also called affine coding blocks on the encoder side or affine decoding blocks on the decoder side) of the current block and a 2×K parameter affine transformation model is used for the current block, N may or may not be equal to N. In a parsing phase (e.g., a phase for constructing a candidate motion vector list), control points (e.g., two, three, or four control points) of the current block may be obtained according to the inherited control point motion vector prediction method described in “(3)” or the first motion model-based motion vector prediction method described in “(5).” Then, in a phase for reconstructing the current block, a 6-parameter affine transformation model is uniformly used to obtain motion vector information for each sub-block of the current block based on the control points of the current block, so as to reconstruct each sub-block.

[0229] The following also uses A1 shown in Figure 6 as an example to explain the process of determining candidate motion vectors for the control points of the current block (from the decoder's perspective). Other cases are estimated by analogy.

[0230] For example, a four-parameter affine transformation model may be used for the current block in the parsing phase, and a four-parameter affine transformation model or another parameter affine transformation model may be used for the neighboring block. Therefore, the motion vectors of two control points of the current block, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, may be obtained according to the inherited control point motion vector prediction method described in "(3)" or the motion vector prediction method based on the first motion model described in "(5)". Then, in the phase of reconstructing the current block, a six-parameter affine transformation model needs to be constructed based on the motion vectors of the two control points of the current block.

[0231] For example, based on the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, the motion vector of the third control point may be obtained according to the following equation (40): The motion vector of the third control point is, for example, the motion vector (vx2,vy2) of the bottom-left corner (x2,y2) of the current block.

number

[0232] W represents the width of the current block, and H represents the height of the current block.

[0233] Then, the six-parameter affine transformation model of the current block in the reconstruction phase is obtained by using the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block, the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, and the motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block. The formula for the six-parameter affine transformation model is shown in the following formula (37):

number

[0234] Then, the coordinates (x, y) of the center point of each sub-block (or each motion compensation unit) of the current block relative to the upper left corner (or other reference point) of the current block are calculated. (i,j) ,y (i,j) ) is substituted into the above equation (37) to obtain the motion information of the center point of each sub-block (or each motion compensation unit) so as to reconstruct each sub-block thereafter.

[0235] It should be noted that the above example is merely used to explain the technical solution of the present invention, and is not intended to limit the present invention. Besides, when other affine transformation models (such as a 6-parameter affine transformation model or an 8-parameter bilinear model) are used for the current block in the parsing phase, please refer to the implementation of the above example. The details will not be described again here.

[0236] According to the second motion model-based motion vector prediction method of the present invention, in the phase of reconstructing the current block, a six-parameter affine transformation model can be uniformly used to predict the current block. The more parameters of the motion model describing the affine motion of the current block, the higher the accuracy and the computational complexity. In this solution, the six-parameter affine transformation model constructed in the reconstruction phase describes the affine transformations, such as translation, scaling, and rotation, of the image block, achieving a good balance between model complexity and modeling capability. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0237] It may be understood that in some embodiments of the present invention, both the first improved solution and the second improved solution may be alternatively used for implementation.

[0238] For example, when a four-parameter affine transformation model is used for a current block in the parsing phase and a six-parameter affine transformation model is used for an adjacent block, the motion vectors of two control points of the current block may be obtained according to the motion vector prediction method based on the first motion model described in “(5)”. Then, according to the motion vector prediction method based on the second motion model described in “(6)”, the motion vectors of the two control points are converted to the six-parameter affine transformation model in the reconstruction phase so as to subsequently reconstruct each sub-block of the current block.

[0239] As another example, when a six-parameter affine transformation model is used for a current block in the perspective phase and a four-parameter affine transformation model is used for a neighboring block, the motion vectors of the three control points of the current block may be obtained according to the motion vector prediction method based on the first motion model described in (5). Then, according to equation (32) in the motion vector prediction method based on the second motion model described in (6), the motion vectors of the three control points are combined to obtain a six-parameter affine transformation model in the reconstruction phase, so as to subsequently reconstruct each sub-block of the current block.

[0240] Certainly, a solution in which both the first improved solution and the second improved solution are used for implementation may alternatively be implemented as another embodiment, the details of which will not be described here.

[0241] Based on the above description, the following will further describe the Affine AMVP mode based on the affine transformation model and the Affine Merge mode based on the affine transformation model in the embodiment of the present invention.

[0242] The AMVP mode based on the affine transformation model is described first.

[0243] For an AMVP mode based on an affine transformation model, in an embodiment, the AMVP-based candidate motion vector list (also referred to as a control point motion vector predictor candidate list) may also be constructed by using a motion vector prediction method based on a first motion model and / or a constructive control point motion vector prediction method. In other embodiments, the AMVP-based candidate motion vector list (also referred to as a control point motion vector predictor candidate list) may also be constructed by using a inherited control point motion vector prediction method and / or a constructive control point motion vector prediction method. The control point motion vector predictors in the list may include two candidate control point motion vectors (e.g., when a four-parameter affine transformation model is used for the current block), three candidate control point motion vectors (e.g., when a six-parameter affine transformation model is used for the current block), or four candidate control point motion vectors (e.g., when an eight-parameter bilinear model is used for the current block).

[0244] In possible application scenarios, the control point motion vector predictor candidate list may be further pruned and sorted according to a specific rule, and may be truncated or padded to obtain a specific number of control point motion vector predictor candidates.

[0245] Then, at the encoder side, the encoder (e.g., video encoder 100) obtains a motion vector for each motion compensation sub-unit of the current coding block by using each control point motion vector predictor in the control point motion vector predictor candidate list and according to the above equation (3), (5), or (7). Furthermore, the encoder obtains pixel values ​​at corresponding positions in the reference frame pointed to by the motion vector of each motion compensation sub-unit, and uses the pixel values ​​as pixel predictors for the motion compensation sub-unit to perform motion compensation based on an affine transformation model. The average difference between the original value and the predictor for each sample in the current coding block is calculated. The control point motion vector predictor corresponding to the smallest average difference is selected as the optimal control point motion vector predictor and used as the motion vector predictor for two, three, or four control points of the current coding block. Furthermore, at the encoder side, the control point motion vector predictor may be further used as a search starting point to perform motion search within a certain search range to obtain control point motion vectors (CPMV), and then the difference between the control point motion vector and the control point motion vector predictor (control point motion vector differences, CPMVD) is calculated. Then, the encoder encodes an index value indicating the position of the control point motion vector predictor in the control point motion vector predictor candidate list and the CPMVD into a bitstream, and transfers the bitstream to the decoder side.

[0246] On the decoder side, the decoder (e.g., video decoder 200) parses the bitstream to obtain the index value and the control point motion vector difference (CPMVD), determines a control point motion vector predictor in the control point motion vector predictor candidate list based on the index value, and adds the CPMVP and CPMVD to obtain the control point motion vector.

[0247] The following describes a merge mode based on an affine transformation model.

[0248] For a merge mode based on an affine transformation model, in an embodiment, the candidate motion vector list for the merge mode (also called a control point motion vector merge candidate list) may be constructed by using a inherited control point motion vector prediction method and / or a constructive control point motion vector prediction method. In other embodiments, the candidate motion vector list for the merge mode (also called a control point motion vector merge candidate list) may alternatively be constructed by using a first motion model based motion vector prediction method and / or a constructive control point motion vector prediction method.

[0249] In possible application scenarios, the control point motion vector merge candidate list may be further pruned and sorted according to a specific rule, and may be truncated or padded to obtain a specific number of control point motion vector candidates.

[0250] Then, at the encoder side, the encoder (e.g., video encoder 100) obtains a motion vector for each motion compensation sub-unit (a sample or pixel block having a size of M×N and obtained by division according to a specific method) of the current coding block by using each control point motion vector in the merge candidate list and according to the above formula (3), (5), or (7). Furthermore, the encoder obtains pixel values ​​at the positions in the reference frame indicated by the motion vectors of each motion compensation sub-unit, and performs affine motion compensation using the pixel values ​​as pixel predictors for the motion compensation sub-unit. The average difference between the original value and the predictor for each sample of the current coding block is calculated. The control point motion vector corresponding to the smallest average difference is selected as the motion vector for two, three, or four control points of the current coding block. An index value indicating the position of the control point motion vector in the candidate list is coded into the bitstream and sent to the decoder side.

[0251] On the decoder side, the decoder (e.g., video decoder 200) parses the bitstream to obtain the index values ​​and determines the control point motion vectors (CPMVP) in the control point motion vector merge candidate list based on the index values.

[0252] Additionally, it should be noted that in embodiments of the present invention, "at least one" means one or more, and "plurality" means two or more. The term "and / or" indicates an association relationship describing related objects, and indicates that three relationships may exist. For example, A and / or B may indicate the following cases: only A is present, both A and B are present, and only B is present, where A and B may be singular or plural. The character " / " generally indicates a "logical or" relationship between related objects. "At least one of the following items" or similar expressions indicates any combination of items, including a single item or any combination of multiple items. For example, at least one of a, b, or c may indicate a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, and c may be singular or plural.

[0253] Please refer to Figure 9. Based on the design solution of the motion vector prediction method based on the first motion model, an embodiment of the present invention provides a motion vector prediction method. The method may be performed by a video decoder 200, and specifically, may be performed by an inter predictor 210 of the video decoder 200. The video decoder 200 may perform some or all of the following steps based on a video data stream having multiple video frames to predict motion information of each sub-block of a current decoded block (referred to as a current block for short) of a current video frame and perform motion compensation. As shown in Figure 9, the method includes, but is not limited to, the following steps:

[0254] Step 601: Parse the bitstream and determine the inter prediction mode of the current decoded block.

[0255] Specifically, the video decoder 200 on the decoder side may parse syntax elements in the bitstream transmitted from the encoder side to obtain the indication information used to indicate the inter-prediction mode and determine the inter-prediction mode of the current block based on the indication information.

[0256] If it is determined that the inter prediction mode of the current block is the AMVP mode based on the affine transformation model, steps 602a to 606a are subsequently executed.

[0257] If it is determined that the inter prediction mode of the current block is a merge mode based on an affine transformation model, steps 602b to 605b are subsequently executed.

[0258] Step 602a: Construct a candidate motion vector list for AMVP mode based on an affine transformation model.

[0259] In some specific embodiments of the present invention, the candidate motion vectors of the control points of the current block may be obtained by using a motion vector prediction method based on a first motion model and added to a candidate motion vector list corresponding to the AMVP mode.

[0260] In some other specific embodiments of the present invention, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using a motion vector prediction method based on the first motion model and a constructive control point motion vector prediction method, and added to a candidate motion vector list corresponding to the AMVP mode.

[0261] When a four-parameter affine transformation model is used for the current block, the candidate motion vector list for AMVP mode may be a two-tuple list that includes one or more two-tuples used to construct the four-parameter affine transformation model.

[0262] When a six-parameter affine transformation model is used for the current block, the candidate motion vector list for AMVP mode may be a triplet list, which includes one or more triplets used to construct the six-parameter affine transformation model.

[0263] When an 8-parameter bilinear model is used for the current block, the candidate motion vector list for AMVP mode may be a quad-list, which includes one or more quads used to construct the 8-parameter bilinear model.

[0264] In possible application scenarios, the candidate motion vector 2-tuple / triplet / quadruple list may be pruned and sorted according to a specific rule, and may be truncated or padded to obtain a specific number of candidate motion vectors.

[0265] For a motion vector prediction method based on the first motion model, for example, as shown in FIG. 10, neighboring blocks of a current block may be traversed in the order of A1 → B1 → B0 → A0 → B2 in FIG. 10 to find the affine-decoded block in which the neighboring block is located (e.g., the affine-decoded block in which A1 is located in FIG. 10). The affine transformation model of the affine-decoded block is constructed by using the control points of the affine-decoded block, and then the candidate motion vectors (e.g., candidate motion vector 2-tuples / triplets / quadruples) of the control points of the current block are derived by using the affine transformation model of the affine-decoded block and added to a candidate motion vector list corresponding to the AMVP mode. It should be noted that other search orders may also be applicable to embodiments of the present invention. Details will not be described here.

[0266] It should be noted that in a possible embodiment, when there are multiple neighboring blocks, i.e., when the current block has multiple neighboring affine-decoded blocks, both the encoder and decoder can first obtain candidate motion vectors for the control points of the current block by using an affine-decoded block whose number of model parameters is the same as that of the current block, and add the obtained candidate motion vectors to a candidate motion vector list corresponding to the AMVP mode. Then, candidate motion vectors for the control points of the current block can be obtained by using an affine-decoded block whose number of model parameters is different from that of the current block, and added to a candidate motion vector list corresponding to the AMVP mode. In this way, the candidate motion vectors for the control points of the current block obtained by using an affine-decoded block whose number of model parameters is the same as that of the current block are positioned at the front of the list. This design helps reduce the number of bits transmitted in the bitstream.

[0267] Figure 10 is used as an example. It is assumed that the parameter model of the current decoding block is a four-parameter affine transformation model. After the neighboring blocks of the current block are traversed, it is determined that the four-parameter affine transformation model is used in the affine decoding block in which B1 is located, and the six-parameter affine transformation model is used in the affine decoding block in which A1 is located. In this case, the motion vectors of the two control points of the current block can be first derived by using the affine decoding block in which B1 is located and added to the list. Then, the motion vectors of the two control points of the current block can be derived by using the affine decoding block in which A1 is located and added to the list.

[0268] Alternatively, it is assumed that the parameter model of the current decoding block is a six-parameter affine transformation model. After the neighboring blocks of the current block are traversed, it is determined that the six-parameter affine transformation model is used in the affine decoding block in which A1 is located, and the four-parameter affine transformation model is used in the affine decoding block in which B1 is located. In this case, the motion vectors of the three control points of the current block can be first derived by using the affine decoding block in which A1 is located and added to the list. Then, the motion vectors of the three control points of the current block can be derived by using the affine decoding block in which B1 is located and added to the list.

[0269] It should be noted that the technical solution of the present invention is not limited to the above example, and other neighboring blocks, motion models, and search orders may also be applicable to the present invention, and details will not be described here.

[0270] In step 602a, the affine transformation models used for different blocks are not limited. That is, the number of parameters of the affine transformation model used for the current block may be different from or the same as that of the affine-decoded block. In an embodiment, the affine transformation model used for the current block may be determined by parsing the bitstream. That is, in this case, the bitstream includes indication information of the affine transformation model of the current block. In an embodiment, the affine transformation model used for the current block may be preset. In an embodiment, the affine transformation model used for the current block may be selected from multiple affine transformation models based on the actual motion state or actual requirements of the current block.

[0271] Some details about obtaining candidate motion vectors for control points of the current block by using the constructive control point motion vector prediction method are described in detail in the above “(4).” For the sake of brevity of this specification, the details will not be described again here.

[0272] Some details about obtaining candidate motion vectors for control points of the current block by using a motion vector prediction method based on the first motion model are described in detail in the above “(5).” For the sake of brevity of this specification, the details will not be described again here.

[0273] It should be noted that in some embodiments in which a motion vector prediction method based on the first motion model is used, in the process in which the decoder side derives candidate motion vectors for the control points of the current block, flag information (flag) of the affine transformation model of the affine-decoded block may need to be obtained. The flag is locally pre-stored at the decoder side and is used to indicate the affine transformation model of the affine-decoded block that is actually used to predict the sub-blocks of the affine-decoded block.

[0274] For example, in an application scenario, if the decoder side determines by identifying the flag of the affine-decoded block that the number of model parameters of the affine transformation model actually used for the affine-decoded block is different (or the same) from that of the affine transformation model used for the current block, the decoder side is triggered to derive candidate motion vectors for the control points of the current block by using the affine transformation model actually used for the affine-decoded block.

[0275] For example, when a four-parameter affine transformation model is used for the current block, the decoder side identifies the flag of the affine-decoded block and determines that the number of model parameters of the affine transformation model actually used for the affine-decoded block is different from that of the affine transformation model used for the current block, for example, if a six-parameter affine transformation model is used for the affine-decoded block, the decoder side obtains the motion vectors of the three control points of the affine-decoded block, i.e., the motion vector (vx4,vy4) of the upper-left corner (x4,y4), the motion vector (vx5,vy5) of the upper-right corner (x5,y5), and the motion vector (vx6,vy6) of the lower-left corner (x6,y6). Based on the six-parameter affine transformation model constructed by the three control points of the affine-decoded block, the candidate motion vectors of the upper-left and upper-right control points of the current block are derived according to equations (27) and (28) for the six-parameter affine transformation model, respectively.

[0276] As another example, when a four-parameter affine transformation model is used for the current block, the decoder side identifies the flag of the affine-decoded block and determines that the number of model parameters of the affine transformation model actually used for the affine-decoded block is the same as that of the affine transformation model used for the current block, for example, if it determines that the four-parameter affine transformation model is also used for the affine-decoded block, the decoder side obtains the motion vectors of two control points of the affine-decoded block, i.e., the motion vector (vx4,vy4) of the upper-left control point (x4,y4) and the motion vector (vx5,vy5) of the upper-right control point (x5,y5). Based on the four-parameter affine transformation model constructed by the two control points of the affine-decoded block, the candidate motion vectors of the upper-left and upper-right control points of the current block are derived according to Equations (32) and (33) for the four-parameter affine transformation model, respectively.

[0277] It should be noted that in some other embodiments in which a motion vector prediction method based on a first motion model is used, the affine transformation model flag of the affine decoding block may not be required in the process in which the decoder side derives candidate motion vectors for the control points of the current block.

[0278] For example, in an application scenario, after the decoder side determines the affine transformation model used for the current block, the decoder side obtains a specific number of control points of the affine-decoded block (the specific number is the same as or different from the number of control points of the current block), constructs an affine transformation model by using the specific number of control points of the affine-decoded block, and then derives candidate motion vectors for the control points of the current block by using the affine transformation model.

[0279] For example, when a four-parameter affine transformation model is used for the current block, the decoder side does not determine the affine transformation model actually used for the affine-decoded block (the affine transformation model actually used for the affine-decoded block may be a four-parameter affine transformation model, a six-parameter affine transformation model, or an eight-parameter bilinear model), but directly obtains the motion vectors of the two control points of the affine-decoded block, i.e., the motion vector (vx4,vy4) of the upper-left control point (x4,y4) and the motion vector (vx5,vy5) of the upper-right control point (x5,y5). Based on the four-parameter affine transformation model constructed by the two control points of the affine-decoded block, the motion vectors of the upper-left and upper-right control points of the current block are derived according to equations (32) and (33) for the four-parameter affine transformation model, respectively.

[0280] It should be noted that the technical solution of the present invention is not limited to the above example, and other control points, motion models, candidate positions, and search orders may also be applicable to the present invention, and details will not be described here.

[0281] Step 603a: Determine the optimal motion vector predictor for the control point based on the index value.

[0282] Specifically, the index values ​​of the candidate motion vector list are obtained by parsing the bitstream, and the optimal motion vector predictor of the control point is determined in the candidate motion vector list constructed in step 602a based on the index values.

[0283] For example, if a four-parameter affine motion model is used for the current block, the index values ​​are obtained by parsing, and the optimal motion vector predictors for the two control points are determined in the candidate motion vector 2-tuple list based on the index values.

[0284] As another example, when a six-parameter affine motion model is used for the current block, the index values ​​are obtained by parsing, and the optimal motion vector predictors for the three control points are determined in the candidate motion vector triplet list based on the index values.

[0285] As another example, when an 8-parameter bilinear model is used for the current block, the index values ​​are obtained by parsing, and the optimal motion vector predictors for the four control points are determined in the candidate motion vector quad-group list based on the index values.

[0286] Step 604a: Determine the actual motion vector of the control point based on the motion vector difference.

[0287] Specifically, the motion vector difference of the control point is obtained by parsing the bitstream, and then the motion vector of the control point is obtained based on the motion vector difference of the control point and the optimal motion vector predictor of the control point determined in step 603a.

[0288] For example, when a four-parameter affine motion model is used for the current block, the motion vector difference of two control points of the current block is obtained by decoding the bitstream. For example, the motion vector difference of the top-left control point and the motion vector difference of the top-right control point can be obtained by decoding the bitstream. Then, the motion vector difference and the motion vector predictor of each control point are added to obtain the actual motion vector of the control point. That is, the motion vectors of the top-left and top-right control points of the current block are obtained.

[0289] As another example, when a six-parameter affine motion model is used for the current block, the motion vector differences of the three control points of the current block are obtained by decoding the bitstream. For example, the motion vector difference of the top-left control point, the motion vector difference of the top-right control point, and the motion vector difference of the bottom-left control point can be obtained by decoding the bitstream. Then, the motion vector difference and the motion vector predictor of each control point are added to obtain the actual motion vector of the control point. That is, the motion vectors of the top-left, top-right, and bottom-left control points of the current block are obtained.

[0290] It should be noted that in this embodiment of the present invention, other affine motion models and other control point positions may also be used, and details will not be described here.

[0291] Step 605a: Obtain the motion vector of each sub-block of the current block according to the affine transformation model used for the current block.

[0292] For each M×N sub-block in the P×Q current block (one sub-block may be equivalent to one motion compensation unit, and at least one of the width or height of the M×N sub-block is smaller than the width or height of the current block), motion information of a sample at a preset position in the motion compensation unit may be used to represent motion information of all samples in the motion compensation unit. Assuming that the motion compensation unit size is M×N, the sample at the preset position may be the center point (M / 2,N / 2), the top-left sample (0,0), the top-right sample (M-1,0), or a sample at another position in the motion compensation unit.

[0293] The following uses the center point of the motion compensation unit as an example for explanation, see Figures 11A and 11B.

[0294] FIG. 11A shows an example of a current block and its motion compensation units. Each small box in the figure represents one motion compensation unit. In the figure, each motion compensation unit has a 4x4 specification, and the gray dot in each motion compensation unit represents the center point of the motion compensation unit. In FIG. 11A, V0 represents the motion vector of the upper-left control point of the current block, V1 represents the motion vector of the upper-right control point of the current block, and V2 represents the motion vector of the lower-left control point of the current block.

[0295] Figure 11B shows an example of another current block and its motion compensation unit. Each small box in the figure represents one motion compensation unit. In the figure, each motion compensation unit has an 8x8 specification, and the gray dot in each motion compensation unit represents the center point of the motion compensation unit. In Figure 11B, V0 represents the motion vector of the upper-left control point of the current block, V1 represents the motion vector of the upper-right control point of the current block, and V2 represents the motion vector of the lower-left control point of the current block.

[0296] The coordinates of the center point of the motion compensation unit relative to the top-left pixel of the current block may be calculated according to the following equation (38):

number

[0297] In the above equation, i is the ith motion compensation unit in the horizontal direction (from left to right), j is the jth motion compensation unit in the vertical direction (from top to bottom), and (x (i,j) ,y (i,j) ) indicates the coordinates of the center point of the (i,j)th motion compensation unit relative to the pixel at the top-left control point of the current affine-decoded block.

[0298] If a 6-parameter affine motion model is used for the current affine decoding block, then (x (i,j) ,y (i,j)) is substituted into the following equation (37) for the six-parameter affine motion model to obtain the motion vector of the center point of each motion compensation unit, and the obtained motion vector is the motion vector (vx (i,j) ,vy (i,j) ) is used as:

number

[0299] If a four-parameter affine motion model is used for the current affine decoding block, then (x (i,j) ,y (i,j) ) is substituted into the following equation (39) for the four-parameter affine motion model to obtain the motion vector of the center point of each motion compensation unit, and the obtained motion vector is the motion vector (vx (i,j) ,vy (i,j) ) is used as:

number

[0300] Step 606a: For each sub-block, perform motion compensation based on the determined motion vector of the sub-block to obtain a pixel predictor of the sub-block.

[0301] Step 602b: Construct a candidate motion vector list for merge mode based on an affine transformation model.

[0302] In some specific embodiments of the present invention, the candidate motion vectors of the control points of the current block may alternatively be obtained by using a motion vector prediction method based on the first motion model and added to the candidate motion vector list corresponding to the merge mode.

[0303] In some other specific embodiments of the present invention, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using a motion vector prediction method based on the first motion model and a constructive control point motion vector prediction method, and added to a candidate motion vector list corresponding to the merge mode.

[0304] Similarly, for a candidate motion vector list corresponding to a merge mode, if a four-parameter affine transformation model is used for the current block, the candidate motion vector list may be a two-tuple list that includes one or more two-tuples used to construct the four-parameter affine transformation model.

[0305] When a six-parameter affine transformation model is used for the current block, the candidate motion vector list may be a triplet list, which includes one or more triplets used to construct the six-parameter affine transformation model.

[0306] If an eight-parameter bilinear model is used for the current block, the candidate motion vector list may be a quadruple list, which includes one or more quadruples used to construct the eight-parameter bilinear model.

[0307] In possible application scenarios, the candidate motion vector 2-tuple / triplet / quadruple list may be pruned and sorted according to a specific rule, and may be truncated or padded to obtain a specific number of candidate motion vectors.

[0308] Similarly, for a motion vector prediction method based on the first motion model, for example, as shown in Figure 10, the neighboring blocks of the current block may be traversed in the order of A1 → B1 → B0 → A0 → B2 in Figure 10 to find the affine-decoded block in which the neighboring block is located. The affine transformation model of the affine-decoded block is constructed by using the control points of the affine-decoded block, and then the candidate motion vectors (e.g., candidate motion vector 2-tuples / triplets / quadruples) of the control points of the current block are derived by using the affine transformation model of the affine-decoded block and added to the candidate motion vector list corresponding to the merge mode. It should be noted that other search orders may also be applicable to embodiments of the present invention. Details will not be described here.

[0309] Specifically, in the above traversal process, if the candidate motion vector list is empty, the candidate motion information of the control point is added to the candidate list. Otherwise, the motion information in the candidate motion vector list is sequentially traversed to determine whether the same motion information as the candidate motion information of the control point exists in the candidate motion vector list. If the same motion information as the candidate motion information of the control point does not exist in the candidate motion vector list, the candidate motion information of the control point is added to the candidate motion vector list.

[0310] To determine whether two candidate motion information are the same, it is necessary to sequentially determine whether the forward reference frame, backward reference frame, horizontal and vertical components of each forward motion vector, and horizontal and vertical components of each backward motion vector in the two candidate motion information are the same. Two candidate motion information are considered different only if all of these elements are different.

[0311] If the number of motion information in the candidate motion vector list reaches the maximum list length, the candidate list construction is completed; otherwise, the next neighboring block is traversed.

[0312] Some details about obtaining candidate motion vectors for control points of the current block by using the constructive control point motion vector prediction method are described in detail in the above “(4).” For the sake of brevity of this specification, the details will not be described again here.

[0313] Some details about obtaining candidate motion vectors for control points of the current block by using a motion vector prediction method based on the first motion model are described in detail in the above “(5).” For the sake of brevity of this specification, the details will not be described again here.

[0314] It should be noted that in some embodiments in which a motion vector prediction method based on a first motion model is used, in the case of a merge mode based on an affine transformation model, affine transformation models such as a 4-parameter affine transformation model, a 6-parameter affine transformation model, and an 8-parameter bilinear model may alternatively not be distinguished for different blocks in an image, i.e., affine transformation models with the same number of parameters may be used for different blocks.

[0315] For example, a six-parameter affine transformation model is used for all blocks in an image. A1 in FIG. 10 is used as an example. The motion vectors of three control points of the affine-decoded block where A1 is located are obtained, namely, the motion vector (vx4,vy4) of the upper-left control point (x4,y4), the motion vector (vx5,vy5) of the upper-right control point (x5,y5), and the motion vector (vx6,vy6) of the lower-left control point (x6,y6). Then, based on the six-parameter affine transformation model constructed by the three control points of the adjacent affine-decoded blocks, the motion vectors of the upper-left control point, the upper-right control point, and the lower-left control point of the current block are derived according to equations (34), (35), and (36), respectively.

[0316] It should be noted that the technical solution of the present invention is not limited to the above example, and other control points, motion models, candidate positions, and search orders may also be applicable to the present invention, and details will not be described here.

[0317] Step 603b: Determine the motion vector of the control point based on the index value.

[0318] Specifically, the index value of the candidate motion vector list is obtained by parsing the bitstream, and the actual motion vector of the control point is determined in the candidate motion vector list constructed in step 602b based on the index value.

[0319] For example, if a four-parameter affine motion model is used for the current block, the index values ​​are obtained by parsing, and the motion vectors of the two control points are determined in the candidate motion vector 2-tuple list based on the index values.

[0320] As another example, when a six-parameter affine motion model is used for the current block, the index values ​​are obtained by parsing, and the motion vectors of the three control points are determined in the candidate motion vector triplet list based on the index values.

[0321] As another example, when an 8-parameter bilinear model is used for the current block, the index values ​​are obtained by parsing, and the motion vectors of the four control points are determined in the candidate motion vector quad-group list based on the index values.

[0322] Step 604b: Obtain a motion vector of each sub-block of the current block based on the affine transformation model used for the current block. For detailed implementation of this step, please refer to the description of step 605a. For the sake of brevity, the details will not be described again here.

[0323] Step 605b: For each sub-block, perform motion compensation based on the corresponding motion vector to obtain a pixel predictor for the sub-block.

[0324] It can be seen that in this embodiment of the present invention, the decoder side uses a motion vector prediction method based on the first motion model in the process of predicting the current block. In this way, the affine transformation model of the neighboring block can be used to construct the affine transformation model of the current block in the phase of parsing the current block (e.g., in the phase of constructing a candidate motion vector list for AMVP mode or merge mode). The affine transformation models of the two blocks can be different or the same. The affine transformation model of the current block better satisfies the actual motion state / actual requirements of the current block. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0325] Please refer to Figure 12. Based on the design solution of the motion vector prediction method based on the second motion model, an embodiment of the present invention provides another motion vector prediction method. The method may be performed by the video decoder 200, specifically, by the inter predictor 210 of the video decoder 200. The video decoder 200 may perform some or all of the following steps based on a video data stream having multiple video frames to predict motion information of each sub-block of a currently decoded block (shortened to as a current block) of a current video frame and perform motion compensation. As shown in Figure 12, the method includes, but is not limited to, the following steps:

[0326] Step 701: Parse the bitstream and determine the inter prediction mode of the current decoded block.

[0327] Specifically, the video decoder 200 on the decoder side may parse syntax elements in the bitstream transmitted from the encoder side to obtain the indication information used to indicate the inter-prediction mode and determine the inter-prediction mode of the current block based on the indication information.

[0328] If it is determined that the inter prediction mode of the current block is the AMVP mode based on the affine transformation model, steps 702a to 706a are subsequently executed.

[0329] If it is determined that the inter prediction mode of the current block is a merge mode based on an affine transformation model, steps 702b to 705b are subsequently executed.

[0330] Step 702a: Construct a candidate motion vector list for AMVP mode based on an affine transformation model.

[0331] In this embodiment of the invention, the affine transformation model used for different blocks of images in an image sequence is not limited, ie different affine transformation models may be used for different blocks.

[0332] In a specific embodiment, the candidate motion vectors of the control points of the current block may be obtained by using a successive control point motion vector prediction method and added to a candidate motion vector list corresponding to the AMVP mode.

[0333] In a specific embodiment, the candidate motion vectors of the control points of the current block may be obtained by using a motion vector prediction method based on the first motion model and added to a candidate motion vector list corresponding to the AMVP mode.

[0334] In a specific embodiment, the candidate motion vectors of the control points of the current block may be obtained by using a constructive control point motion vector prediction method and added to a candidate motion vector list corresponding to the AMVP mode.

[0335] In some other specific embodiments, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using any two of the inherited control point motion vector prediction method, the motion vector prediction method based on the second motion model, or the constructive control point motion vector prediction method, and added to the candidate motion vector list corresponding to the AMVP mode.

[0336] In some other specific embodiments, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using the inherited control point motion vector prediction method, the motion vector prediction method based on the second motion model, and the constructive control point motion vector prediction method, and added to the candidate motion vector list corresponding to the AMVP mode.

[0337] Some details about obtaining candidate motion vectors for control points of a current block by using the inherited control point motion vector prediction method are described in detail in the above “(3).” For the sake of brevity of this specification, the details will not be described again here.

[0338] Some details about obtaining candidate motion vectors for control points of the current block by using the constructive control point motion vector prediction method are described in detail in the above “(4).” For the sake of brevity of this specification, the details will not be described again here.

[0339] Some details about obtaining candidate motion vectors of control points of the current block by using a motion vector prediction method based on the first motion model are described in detail in “(5)” above and in step 602a in the embodiment of Figure 9. For the sake of brevity of this specification, the details will not be described again here.

[0340] For example, if a four-parameter affine transformation model is used for the current block, the candidate motion vector list for AMVP mode may be a two-tuple list that includes one or more two-tuples used to construct the four-parameter affine transformation model.

[0341] When a six-parameter affine transformation model is used for the current block, the candidate motion vector list for AMVP mode may be a triplet list, which includes one or more triplets used to construct the six-parameter affine transformation model.

[0342] When an 8-parameter bilinear model is used for the current block, the candidate motion vector list for AMVP mode may be a quad-list, which includes one or more quads used to construct the 8-parameter bilinear model.

[0343] In possible application scenarios, the candidate motion vector 2-tuple / triplet / quadruple list may be further pruned and sorted according to a specific rule, and may be truncated or padded to obtain a specific number of candidate motion vectors.

[0344] Step 703a: Determine the optimal motion vector predictor of the control point based on the index value. For specific content, please refer to the relevant description of step 603a in the embodiment of Figure 9. The details will not be described again here.

[0345] Step 704a: Determine the motion vectors of the three control points of the current block based on the motion vector difference.

[0346] Specifically, the motion vector difference of the control points is obtained by parsing the bitstream, and then the motion vector of the control points is obtained based on the motion vector difference of the control points and the optimal motion vector predictor of the control points determined in step 703a. Then, the motion vectors of the three control points of the current block are determined based on the obtained motion vectors of the control points.

[0347] For example, if the candidate motion vector list constructed by the decoder side in step 702a is a 2-tuple list, an index value is obtained by parsing in step 703a, and a motion vector predictor (MVP) of two control points (i.e., a 2-tuple) is determined in the candidate motion vector list based on the index value. A motion vector difference (MVD) of two control points of the current block is obtained by parsing the bitstream in step 704a. Then, motion vectors (MV) of the two control points are respectively obtained based on the MVP and MVD of the two control points. The motion vectors of the two control points are, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block. Then, a four-parameter affine transformation model is constructed based on the motion vectors of the two control points of the current block. The motion vector of the third control point is obtained according to the above equation (40) for the four-parameter affine transformation model. The motion vector of the third control point is, for example, the motion vector (vx2, vy2) of the bottom-left corner (x2, y2) of the current block. In this way, the motion vectors of the top-left control point, top-right control point, and bottom-left control point of the current block are determined.

[0348] As another example, if the candidate motion vector list constructed by the decoder side in step 702a is a triplet list, an index value is obtained by parsing in step 703a, and the motion vector predictor (MVP) of three control points (i.e., a triplet) is determined in the candidate motion vector list based on the index value. The motion vector difference (MVD) of the three control points of the current block is obtained by parsing the bitstream in step 704a. Then, the motion vectors (MV) of the three control points are respectively obtained based on the MVP and MVD of the three control points. The motion vectors of the three control points are, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block, the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, and the motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block.

[0349] In this way, the motion vectors of the top-left control point, top-right control point, and bottom-left control point of the current block are determined.

[0350] As another example, if the candidate motion vector list constructed by the decoder side in step 702a is a quadruple list, an index value is obtained by parsing in step 703a, and the motion vector predictors (MVPs) of the four control points (i.e., quadruples) are determined in the candidate motion vector list based on the index value. The motion vector difference (MVD) of the four control points of the current block is obtained by parsing the bitstream in step 704a. Then, the motion vectors (MV) of the four control points are obtained respectively based on the MVP and MVD of the four control points. The motion vectors of the four control points are, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block, the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, the motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block, and the motion vector (vx3,vy3) of the bottom-right control point (x3,y3) of the current block. Then, the decoder side may only use the motion vectors of the top-left control point, the top-right control point, and the bottom-left control point of the current block.

[0351] It should be noted that the technical solution of the present invention is not limited to the above example, and other control points and motion models may also be applicable to the present invention, which will not be described in detail here.

[0352] Step 705a: Obtain the motion vector of each sub-block based on the three control points of the current block and by using a six-parameter affine transformation model.

[0353] Specifically, the motion vectors of the three control points of the current block are determined in step 704a. Therefore, a six-parameter affine transformation model may be constructed based on the motion vectors of the three control points of the current block, and the motion vector of each sub-block is obtained by using the six-parameter affine transformation model.

[0354] For example, the motion vectors of the three control points are, for example, the motion vector (vx0, vy0) of the upper-left control point (x0, y0) of the current block, the motion vector (vx1, vy1) of the upper-right control point (x1, y1) of the current block, and the motion vector (vx2, vy2) of the lower-left control point (x2, y2) of the current block. In this case, the six-parameter affine transformation model of the current block in the reconstruction phase is obtained by using the motion vector (vx0, vy0) of the upper-left control point (x0, y0) of the current block, the motion vector (vx1, vy1) of the upper-right control point (x1, y1) of the current block, and the motion vector (vx2, vy2) of the lower-left control point (x2, y2) of the current block. The formula of the six-parameter affine transformation model is shown in Equation (37).

[0355] Then, the coordinates (x, y) of the sample at a preset position in each sub-block (or each motion compensation unit) of the current block relative to the upper left corner (or other reference point) of the current block are calculated. (i,j) ,y (i,j) ) is substituted into the above equation (37) to obtain the motion vector of each sub-block. The sample at the preset position may be the center point of each sub-block (or each motion compensation unit). The coordinates (x (i,j) ,y (i,j) ) may be calculated according to the above formula (38). For specific details, please refer to the relevant descriptions in the embodiment of FIG. 11A and the embodiment of FIG. 11B. The details will not be described again here.

[0356] Step 706a: For each sub-block, perform motion compensation based on the corresponding motion vector to obtain a pixel predictor for the sub-block.

[0357] Step 702b: Construct a candidate motion vector list for merge mode based on an affine transformation model.

[0358] Similarly, in this embodiment of the invention, the affine transformation model used for different blocks of images in an image sequence is not limited, ie different affine transformation models may be used for different blocks.

[0359] In a specific embodiment, the candidate motion vectors of the control points of the current block may be obtained by using a successive control point motion vector prediction method and added to a candidate motion vector list corresponding to the merge mode.

[0360] In a specific embodiment, the candidate motion vectors of the control points of the current block may be obtained by using a motion vector prediction method based on the first motion model and added to a candidate motion vector list corresponding to the merge mode.

[0361] In a specific embodiment, the candidate motion vectors of the control points of the current block may be obtained by using a constructive control point motion vector prediction method and added to a candidate motion vector list corresponding to the merge mode.

[0362] In some other specific embodiments, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using any two of the inherited control point motion vector prediction method, the motion vector prediction method based on the second motion model, or the constructive control point motion vector prediction method, and added to the candidate motion vector list corresponding to the merge mode.

[0363] In some other specific embodiments, the candidate motion vectors of the control points of the current block may alternatively be obtained separately by using the inherited control point motion vector prediction method, the motion vector prediction method based on the second motion model, and the constructive control point motion vector prediction method, and added to the candidate motion vector list corresponding to the merge mode.

[0364] Some details about obtaining candidate motion vectors for control points of a current block by using the inherited control point motion vector prediction method are described in detail in the above “(3).” For the sake of brevity of this specification, the details will not be described again here.

[0365] Some details about obtaining candidate motion vectors for control points of the current block by using the constructive control point motion vector prediction method are described in detail in the above “(4).” For the sake of brevity of this specification, the details will not be described again here.

[0366] Some details about obtaining candidate motion vectors of control points of the current block by using a motion vector prediction method based on the first motion model are described in detail in “(5)” above and in step 602a in the embodiment of Figure 9. For the sake of brevity of this specification, the details will not be described again here.

[0367] It should be noted that in some other embodiments, in the case of a merge mode based on an affine transformation model, the candidate motion vector list established by the decoder side may be a candidate motion vector 2-tuple / triplet / quadruple list. Moreover, the candidate motion vector 2-tuple / triplet / quadruple list may be further pruned and sorted according to a specific rule, and may be truncated or padded to obtain a specific number of candidate motion vectors.

[0368] It should be noted that in some further embodiments, in the case of a merge mode based on an affine transformation model, affine transformation models such as a 4-parameter affine transformation model, a 6-parameter affine transformation model, and an 8-parameter bilinear model may alternatively not be differentiated for different blocks in an image, i.e., affine transformation models with the same number of parameters may be used for different blocks.

[0369] Step 703b: Obtain the motion vector of the control point based on the index value. Specifically, the index value of the candidate motion vector list is obtained by parsing the bitstream, and the actual motion vector of the control point is determined in the candidate motion vector list constructed in step 702b based on the index value. For the specific implementation of this step, please refer to the relevant description in step 603b in the embodiment of Figure 9. The details will not be described again here.

[0370] Step 704b: Determine the motion vectors of the three control points of the current block according to the obtained motion vectors of the control points.

[0371] For example, the decoder side obtains motion vectors of two control points (i.e., a 2-tuple) in step 703b. The motion vectors of the two control points are, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block. Then, a four-parameter affine transformation model is constructed based on the motion vectors of the two control points of the current block. The motion vector of the third control point is obtained according to the above equation (31) for the four-parameter affine transformation model. The motion vector of the third control point is, for example, the motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block. In this way, the motion vectors of the top-left control point, the top-right control point, and the bottom-left control point of the current block are determined.

[0372] As another example, the decoder side obtains motion vectors of three control points (i.e., a triplet) in step 703b. The motion vectors of the three control points are, for example, the motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block, the motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, and the motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block. In this way, the motion vectors of the top-left control point, the top-right control point, and the bottom-left control point of the current block are determined.

[0373] As another example, the decoder side obtains motion vectors of four control points (i.e., a quadruple) in step 703b. The motion vectors of the four control points are, for example, a motion vector (vx0,vy0) of the top-left control point (x0,y0) of the current block, a motion vector (vx1,vy1) of the top-right control point (x1,y1) of the current block, a motion vector (vx2,vy2) of the bottom-left control point (x2,y2) of the current block, and a motion vector (vx3,vy3) of the bottom-right control point (x3,y3) of the current block. Then, the decoder side may use only the motion vectors of the top-left control point, the top-right control point, and the bottom-left control point of the current block.

[0374] It should be noted that the technical solution of the present invention is not limited to the above example, and other control points and motion models may also be applicable to the present invention, which will not be described in detail here.

[0375] Step 705b: Obtain the motion vector of each sub-block based on the three control points of the current block and by using a six-parameter affine transformation model. For the specific implementation of this step, please refer to the relevant description in step 705a. The details will not be described again here.

[0376] Step 706b: For each sub-block, perform motion compensation based on the corresponding motion vector to obtain a pixel predictor for the sub-block.

[0377] It can be seen that in this embodiment of the present invention, the decoder side uses a motion vector prediction method based on the second motion model in the process of predicting the current block. In this way, in the parsing phase, the number of parameters of the affine transformation model used for the current block can be different or the same as that of the affine transformation model used for the neighboring blocks, and the six-parameter affine transformation model can be uniformly used to predict the current block in the phase of reconstructing the current block (including the phase of predicting the motion vector of a sub-block). In this solution, the six-parameter affine transformation model constructed in the reconstruction phase describes affine transformations such as translation, scaling, and rotation of the image block, achieving a good balance between model complexity and modeling ability. Therefore, this solution can improve coding efficiency and accuracy in predicting the current block and meet user requirements.

[0378] 13 is a flowchart of yet another motion vector prediction method according to an embodiment of the present invention. The method may be performed by video encoder 100, specifically, by inter predictor 110 of video encoder 100. Video encoder 100 may perform some or all of the following steps to encode a current coding block (referred to as current block for short) of a current video frame based on a video data stream having multiple video frames. As shown in FIG. 13, the method includes, but is not limited to, the following steps:

[0379] 801: Determine the inter prediction mode of the current coding block.

[0380] In a specific implementation, multiple inter-prediction modes may be preset for inter prediction at the encoder side. For example, the multiple inter-prediction modes include the above-mentioned affine motion model-based AMVP mode and affine motion model-based merge mode. The encoder side traverses the multiple inter-prediction modes to determine the optimal inter-prediction mode for predicting the current block.

[0381] In another specific implementation, only one inter-prediction mode may be preset for inter-prediction at the encoder side. In this case, the encoder side directly determines that a default inter-prediction mode is currently being used. The default inter-prediction mode is an affine motion model-based AMVP mode or an affine motion model-based merge mode.

[0382] In this embodiment of the present invention, if it is determined that the inter prediction mode of the current block is the AMVP mode based on the affine motion model, steps 802a to 804a are executed successively.

[0383] In this embodiment of the present invention, if the inter prediction mode of the current block is determined to be a merge mode based on an affine motion model, steps 802b to 804b are executed successively.

[0384] 802a: Construct a candidate motion vector list for AMVP mode based on affine transformation.

[0385] In some embodiments, the encoder side uses the design solution of the motion vector prediction method based on the first motion model. Therefore, for the specific implementation of this step, please refer to the description of step 602a in the embodiment of Figure 9. The details will not be described again here.

[0386] In some other embodiments, the encoder side uses the design solution of the motion vector prediction method based on the second motion model. Therefore, for the specific implementation of this step, please refer to the description of step 702a in the embodiment of Figure 12. The details will not be described again here.

[0387] 803a: Determine an optimal motion vector predictor for the control points based on a rate-distortion cost.

[0388] In some examples, the encoder side may obtain a motion vector for each motion compensation sub-unit of the current block by using a control point motion vector predictor (e.g., a candidate motion vector 2-tuple / triplet / quadruple) in the candidate motion vector list and according to equations (3), (5), or (7). Furthermore, the encoder side obtains pixel values ​​at corresponding positions in the reference frame pointed to by the motion vector of each motion compensation sub-unit, and uses the pixel values ​​as pixel predictors for the motion compensation sub-unit to perform motion compensation based on an affine motion model. The average difference between the original value and the predictor for each sample in the current coding block is calculated. The control point motion vector predictor corresponding to the smallest average difference is selected as the optimal control point motion vector predictor and used as the motion vector predictor for two, three, or four control points of the current block.

[0389] 804a: Encode the index value, the motion vector difference of the control point, and the indication information of the inter prediction mode into a bitstream.

[0390] In some examples, the encoder side may perform motion search within a specific search range by using the optimal control point motion vector predictor as the search starting point to obtain control point motion vectors (CPMV), and then calculate the difference between the control point motion vector and the control point motion vector predictor (control point motion vector differences, CPMVD). Then, the encoder side encodes an index value indicating the position of the control point motion vector predictor in the candidate motion vector list and the CPMVD into a bitstream. Indication information of the inter prediction mode may also be encoded into the bitstream, so that the bitstream is then transmitted to the decoder side.

[0391] In another possible example, the encoder side may encode indication information indicating the affine transformation model (number of parameters) used for the current block into the bitstream, and then transmit the bitstream to the decoder side, so that the decoder side can determine the affine transformation model used for the current block based on the indication information.

[0392] 802b: Construct a candidate motion vector list for affine transformation based merge mode.

[0393] In some embodiments, the encoder side uses the design solution of the motion vector prediction method based on the first motion model. Therefore, for the specific implementation of this step, please refer to the description of step 602b in the embodiment of Figure 9. The details will not be described again here.

[0394] In some other embodiments, the encoder side uses the design solution of the motion vector prediction method based on the second motion model. Therefore, for the specific implementation of this step, please refer to the description of step 702b in the embodiment of Figure 12. The details will not be described again here.

[0395] 803b: Determine the best motion vector predictor for the control points.

[0396] In some examples, the encoder side may obtain a motion vector for each motion compensation sub-unit of the current coding block by using a control point motion vector (e.g., a candidate motion vector 2-tuple / triplet / quadruple) in the candidate motion vector list and according to equations (3), (5), or (7). Furthermore, the encoder side obtains pixel values ​​at positions in the reference frame pointed to by the motion vectors of each motion compensation sub-unit, and performs affine motion compensation using the pixel values ​​as pixel predictors for the motion compensation sub-unit. The average difference between the original value and the predictor for each sample in the current coding block is calculated. The control point motion vector corresponding to the smallest average difference is selected as the optimal control point motion vector. The optimal control point motion vector is used as the motion vector for two, three, or four control points of the current coding block.

[0397] 804b: Encoding the index value and the indication information of the inter prediction mode into the bitstream.

[0398] In one example, the encoder side may encode an index value indicating the position of the control point motion vector in the candidate list and an indication information of the inter prediction mode into a bitstream, which is then transmitted to the decoder side.

[0399] In another possible example, the encoder side may encode indication information indicating the affine transformation model (number of parameters) used for the current block into the bitstream, and then transmit the bitstream to the decoder side, so that the decoder side can determine the affine transformation model used for the current block based on the indication information.

[0400] It should be noted that the above embodiment only describes the process in which the encoder side performs encoding and sends a bitstream. According to the above description, those skilled in the art will understand that the encoder side may perform other methods described in the embodiments of the present invention in other procedures. For example, for a specific implementation of the process of reconstructing the current block during the prediction performed by the encoder side for the current block, please refer to the related method described above for the decoder side (shown in the embodiment of FIG. 9 or FIG. 12). The details will not be described again here.

[0401] It can be seen that in an embodiment of the present invention, the encoder side encodes the current block according to the design solution of the motion vector prediction method based on the first motion model. In this way, the affine transformation model of the neighboring block can be used to construct the affine transformation model of the current block in the current block parsing phase (e.g., in the phase of constructing a candidate motion vector list for AMVP mode or merge mode). The affine transformation models of the two blocks can be different or the same. The affine transformation model of the current block better satisfies the actual motion state / actual requirements of the current block. Therefore, this solution can improve the efficiency and accuracy of encoding the current block and satisfy user requirements.

[0402] It can be further seen that in an embodiment of the present invention, the encoder side encodes the current block according to the design solution of the motion vector prediction method based on the second motion model.This helps the decoder side to uniformly use the six-parameter affine transformation model to predict the image block in the phase of reconstructing the image block.Therefore, this solution can improve the coding efficiency and accuracy of predicting the current block and meet user requirements.

[0403] Those skilled in the art will understand that the functions described with reference to the various illustrative logical blocks, modules, and algorithm steps disclosed and described herein may be implemented by hardware, software, firmware, or any combination thereof. When implemented in software, the functions described with reference to the illustrative logical blocks, modules, and steps may be stored on or transmitted as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. A computer-readable medium may include a computer-readable storage medium corresponding to a tangible medium, such as a data storage medium, or any communication medium that facilitates the transfer of a computer program from one place to another (e.g., according to a communication protocol). In this manner, a computer-readable medium may generally correspond to (1) a non-transitory tangible computer-readable storage medium or (2) a communication medium, such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementing the techniques described in embodiments of the present invention. A computer program product may include a computer-readable medium.

[0404] By way of example, and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other compact disc-type storage, magnetic disk or other magnetic storage, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Furthermore, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source over coaxial cable, fiber optic, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio waves, or microwave, the coaxial cable, fiber optic, twisted pair, DSL, or wireless technologies such as infrared, radio waves, or microwave are included within the definition of medium. It should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, and are in fact non-transitory tangible storage media. As used herein, disk and disc include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), and Blu-ray discs. Disks typically reproduce data magnetically, while discs reproduce data optically with a laser. Combinations of the above should also be included within the scope of computer-readable media.

[0405] The instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Accordingly, the term "processor," as used herein, may refer to any one of the above structures or any other structure applicable to the techniques described herein. Furthermore, in some aspects, the functionality described with reference to illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or may be incorporated into a combined codec. Furthermore, the techniques may be implemented entirely in one or more circuit or logic elements.

[0406] The techniques in the embodiments of the present invention may be implemented in a variety of apparatuses or devices, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in the embodiments of the present invention to emphasize functional aspects of apparatuses configured to perform the disclosed techniques, but are not necessarily implemented by different hardware units. In practice, as described above, the various units may be combined with appropriate software and / or firmware into a codec hardware unit, or may be provided by interoperable hardware units (including one or more processors as described above).

[0407] The above description is merely an example of specific implementations of the embodiments of the present invention, and is not intended to limit the protection scope of the embodiments of the present invention. Any modifications or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of the present invention should fall within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be subject to the protection scope of the claims.

Claims

1. 1. A video image decoding method implemented by a decoding device, comprising: Parsing the bitstream to obtain control point motion vector predictor candidate list index values ​​and motion vector differentials (MVDs) for K control points of the current block; When an affine model of the current block is a 2×K parameter affine transformation model and an affine transformation model of a neighboring block of the current block is a 2×N parameter affine transformation model, obtaining candidate motion vector predictors for the K control points of the current block according to the 2×N parameter affine transformation model for the neighboring block, wherein the 2×N parameter affine transformation model is obtained based on the motion vectors of the N control points of the neighboring block, where N is an integer equal to 2 and K is an integer equal to 3, the neighboring block is a decoded image block spatially adjacent to the current block, and the current block includes a plurality of sub-blocks; constructing the control point motion vector predictor candidate list including the candidate motion vector predictors for the K control points of the current block; determining candidate motion vector predictors for the K control points in the control point motion vector predictor candidate list based on the index values; Obtaining a motion vector for each sub-block of the plurality of sub-blocks within the current block based on motion vectors (MVs) of the K control points of the current block, wherein the MVs of the K control points of the current block are obtained based on the candidate motion vector predictors of the K control points of the current block and the MVDs of the K control points of the current block; generating a prediction block for the current block based on the motion vectors of the plurality of sub-blocks within the current block; A method having the following.

2. Candidate motion vector predictors for three control points of the current block are obtained based on a four-parameter affine transformation model for the neighboring blocks of the current block, and the N control points of the neighboring blocks are an upper-left control point and an upper-right control point of the neighboring blocks, while the K control points of the current block are an upper-left control point, a lower-left control point and an upper-right control point of the current block. The method of claim 1.

3. Obtaining a motion vector for each sub-block of the plurality of sub-blocks in the current block based on the motion vectors of the K control points of the current block includes: obtaining the MVs of the K control points of the current block based on the candidate motion vector predictor of the K control points of the current block and the MVDs of the K control points; Obtaining the 2×K parameter affine transformation model of the current block based on the MVs of the K control points of the current block; obtaining a motion vector of each sub-block of the current block based on the 2×K parameter affine transformation model; Including, The method of claim 1.

4. The method further includes, after determining the candidate motion vector predictor of the K control points in the control point motion vector predictor candidate list based on the index value, obtaining the 2×K parameter affine transformation model of the current block based on the motion vectors of the K control points of the current block; Accordingly, obtaining a motion vector for each sub-block of the plurality of sub-blocks in the current block based on the motion vectors of the K control points of the current block includes: obtaining a motion vector for each of the plurality of sub-blocks within the current block based on the 2×K parameter affine transformation model of the current block; The method of claim 1.

5. 1. A decoding device, comprising: a non-transitory computer-readable medium configured to store computer-readable instructions; a processor in communication with the non-transitory computer-readable medium and configured to execute the computer-readable instructions stored on the non-transitory computer-readable medium; The processor executes the computer-readable instructions to: Parsing the bitstream to obtain control point motion vector predictor candidate list index values ​​and motion vector differentials (MVDs) for K control points of the current block; When the affine model of the current block is a 2×K parameter affine transformation model and the affine transformation model of a neighboring block of the current block is a 2×N parameter affine transformation model, obtaining candidate motion vector predictors for the K control points of the current block according to the 2×N parameter affine transformation model used for the neighboring block, wherein the 2×N parameter affine transformation model is obtained based on the motion vectors of the N control points of the neighboring block, where N is an integer equal to 2 and K is an integer equal to 3, the neighboring block is a decoded image block spatially adjacent to the current block, and the current block includes a plurality of sub-blocks; constructing the control point motion vector predictor candidate list including the candidate motion vector predictors for the K control points of the current block; determining candidate motion vector predictors for the K control points of the current block in the control point motion vector predictor candidate list based on the index values; Obtaining a motion vector for each sub-block of the plurality of sub-blocks within the current block based on motion vectors (MVs) of the K control points of the current block, wherein the MVs of the K control points of the current block are obtained based on the candidate motion vector predictors of the K control points of the current block and the MVDs of the K control points of the current block; generating a prediction block for the current block based on the motion vectors of the plurality of sub-blocks within the current block; performing an action including Decryption device.

6. Candidate motion vector predictors for three control points of the current block are obtained based on a four-parameter affine transformation model for the neighboring blocks of the current block, and the N control points of the neighboring blocks are an upper-left control point and an upper-right control point of the neighboring blocks, while the K control points of the current block are an upper-left control point, a lower-left control point and an upper-right control point of the current block. A decoding device according to claim 5.

7. The processor executes the computer-readable instructions stored on the non-transitory computer-readable medium to: obtaining the MVs of the K control points of the current block based on the candidate motion vector predictor of the K control points of the current block and the MVDs of the K control points; Obtaining the 2×K parameter affine transformation model of the current block based on the MVs of the K control points of the current block; obtaining a motion vector of each sub-block of the current block based on the 2×K parameter affine transformation model of the current block; and further configured to perform operations including: A decoding device according to claim 5.

8. The processor executes the computer-readable instructions stored on the non-transitory computer-readable medium to: and after determining the candidate motion vector predictor of the K control points of the current block in the control point motion vector predictor candidate list based on the index value, performing an operation of obtaining the 2×K parameter affine transformation model of the current block based on the motion vectors of the K control points of the current block. A decoding device according to claim 5.

9. The processor executes the computer-readable instructions stored on the non-transitory computer-readable medium to: specifically configured to perform an operation of obtaining a motion vector for each sub-block of the plurality of sub-blocks within the current block based on the 2×K parameter affine transformation model of the current block; 9. A decoding device according to claim 8.

10. When executed by one or more processors, the one or more processors: Parsing the bitstream to obtain control point motion vector predictor candidate list index values ​​and motion vector differentials (MVDs) for K control points of the current block; When the affine model of the current block is a 2×K parameter affine transformation model and the affine transformation model of a neighboring block of the current block is a 2×N parameter affine transformation model, obtaining candidate motion vector predictors for the K control points of the current block according to the 2×N parameter affine transformation model used for the neighboring block, wherein the 2×N parameter affine transformation model is obtained based on the motion vectors of the N control points of the neighboring block, where N is an integer equal to 2 and K is an integer equal to 3, the neighboring block is a decoded image block spatially adjacent to the current block, and the current block includes a plurality of sub-blocks; constructing the control point motion vector predictor candidate list including the candidate motion vector predictors for the K control points of the current block; determining candidate motion vector predictors for the K control points in the control point motion vector predictor candidate list based on the index values; Obtaining a motion vector for each sub-block of the plurality of sub-blocks within the current block based on motion vectors (MVs) of the K control points of the current block, wherein the MVs of the K control points of the current block are obtained based on the candidate motion vector predictors of the K control points of the current block and the MVDs of the K control points of the current block; generating a prediction block for the current block based on the motion vectors of the plurality of sub-blocks within the current block; A non-transitory computer-readable medium storing computer instructions for performing operations including:

11. Candidate motion vector predictors for three control points of the current block are obtained based on a four-parameter affine transformation model for the neighboring blocks of the current block, and the N control points of the neighboring blocks are an upper-left control point and an upper-right control point of the neighboring blocks, while the K control points of the current block are an upper-left control point, a lower-left control point and an upper-right control point of the current block. The non-transitory computer-readable medium of claim 10.

Citation Information

Patent Citations

  • Motion vector prediction for affine motion models in video coding

    US20180098063A1

  • Motion vector generation for affine motion model for video coding

    US20180192069A1

  • Affine motion vector derivation device, prediction image generation device, moving image decoding device, and moving image coding device

    WO2018061563A1

  • Motion vector prediction for affine motion models in video coding

    WO2018067823A1