Motion vector prediction method and related apparatus
The motion vector prediction method using affine transformation models enhances coding efficiency and accuracy by aligning with the actual motion state of video blocks, addressing the challenge of further bitrate reductions in advanced video coding standards.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-09-10
- Publication Date
- 2026-06-29
AI Technical Summary
Existing video coding technologies struggle to achieve further bitrate reductions without compromising image quality, particularly in advanced standards like HEVC.
A motion vector prediction method using a 2×N parameterized affine transformation model to construct candidate motion vectors for K control points, followed by a 6-parameter affine transformation model for predicting motion vectors of subblocks, enhancing coding efficiency and accuracy.
Improves coding efficiency and accuracy by better aligning with the actual motion state of video blocks, achieving a balance between model complexity and modeling capability.
Smart Images

Figure 0007881815000040 
Figure 0007881815000041 
Figure 0007881815000042
Abstract
Description
[Technical Field]
[0001] Embodiments of the present invention relate to the field of video coding technology, and more particularly 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 like video chat and video conferencing, DVDs and Blu-ray discs, video content acquisition and editing systems, and camcorders for security purposes.
[0003] Since the development of the block-based hybrid video coding approach in the 1990 H.261 standard, new video coding techniques and tools have been developed, forming the basis for new video coding standards. Further 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 3D (three-dimensional) extensions of these standards. As video creation and use become more ubiquitous, video traffic is the greatest load 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. While the latest High Efficiency Video Coding (HEVC) can compress video about twice as much as AVC without sacrificing image quality, there is a growing demand for new technologies that can compress video even further than HEVC. [Overview of the project]
[0004] 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, embodiments of the present invention provide a motion vector prediction method. The method is described from the perspective of either the decoder side or the 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 the current affine coding block, and the decoded image block spatially adjacent to the image block to be processed is the adjacent affine coding block. On the decoder side, the image block to be processed is the current affine decoding block, and the decoded image block spatially adjacent to the image block to be processed is the adjacent affine decoding block. For simplicity of description, the image block to be processed may be called the current block, and the reference block spatially adjacent to the image block to be processed may be called the adjacent block. The method includes parsing a bitstream to obtain index values for a list of candidate motion vectors, constructing a list of candidate motion vectors containing candidate motion vectors for K control points of the current block, where the candidate motion vectors for the K control points are obtained based on a 2×N parameterized affine transformation model used for the adjacent blocks of the current block, where the 2×N parameterized affine transformation model is obtained based on the motion vectors of N control points of adjacent blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, where N is not equal to K, determining target candidate motion vectors for the K control points based on their index values in the list of candidate motion vectors, and obtaining predicted motion vectors corresponding to the positions of each subblock of the current block based on the target candidate motion vectors for the K control points. The predicted motion vectors corresponding to the positions of various subblocks may each be used for motion compensation of multiple subblocks.
[0006] In this embodiment of the present invention, in the process of predicting the current block, the decoder can construct the affine transformation model of the current block by using the affine transformation models of adjacent blocks in the phase of constructing the candidate list of the current block (for example, the phase of constructing the candidate motion vector list for 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. Thus, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0007] In a possible implementation according to the first embodiment, the availability of one or more pre-set spatially adjacent blocks of the current block may be determined in a pre-set order, and the available adjacent blocks in the pre-set order are then retrieved sequentially. The pre-set available adjacent blocks may include adjacent image blocks located above, to the left, to the upper right, to the lower left, or to the upper left of the image block to be processed. For example, the adjacent image block located to the left, the adjacent image block located above, the adjacent image block located to the upper right, the adjacent image block located to the lower left, and the adjacent image block located to the upper left are checked for availability sequentially.
[0008] In the first embodiment, in possible implementations, N=2 and K=3. Specifically, when a 4-parameter affine transformation model is used for the affine decoding block (affine coding block on the encoder side) and a 6-parameter affine transformation model is used for the current block, the candidate motion vectors of the three control points of the current block are obtained based on the 4-parameter affine transformation model used for the adjacent blocks of the current block.
[0009] For example, the candidate motion vectors for the three control points of the current block include the motion vector (vx0, vy0) at the top-left sample position (or top-left corner, hereafter the same) (x0, y0) of the current block, the motion vector (vx1, vy1) at the top-right sample position (or top-right corner, hereafter the same) (x1, y1) of the current block, and the motion vector (vx2, vy2) at the bottom-left sample position (or bottom-left corner, hereafter the same) (x2, y2) of the current block.
[0010] The candidate motion vectors for the three control points of the current block are obtained based on the four-parameter affine transformation model used for the adjacent blocks of the current block, where 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 given by the following equation:
number
[0011] In the first embodiment, in possible implementations, 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 of the two control points of the current block are obtained based on the 6-parameter affine transformation model used for the adjacent block of the current block.
[0012] For example, the candidate motion vectors for the two control points of the current block include the motion vector (vx0, vy0) at the top-left sample position (or top-left corner, hereafter the same) (x0, y0) of the current block, and the motion vector (vx1, vy1) at the top-right sample position (or top-right corner, hereafter the same) (x1, y1) of the current block, and the candidate motion vectors for the two control points of the current block are obtained based on the 6-parameter affine transformation model used for the adjacent blocks of the current block, and the candidate motion vectors for the two control points of the current block are given by the following equation
number
[0013] In this embodiment of the present invention, it is found that in the phase of parsing the current block (for example, in the phase of constructing a list of candidate motion vectors), the affine transformation model of the current block can be constructed by using the affine transformation models of adjacent 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. Thus, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0014] In an embodiment of the phase of reconstructing the current block according to the first aspect, the process of obtaining the predicted motion vectors of each subblock of the current block includes the following procedure: obtaining a 2×K parameter affine transformation model of the current block based on the target candidate motion vectors of K control points, and obtaining the predicted motion vectors of each subblock of the current block based on the 2×K parameter affine transformation model.
[0015] For example, when a 6-parameter affine motion model is used for the current affine decoding block, the 6-parameter affine transformation model of the current block is constructed based on the target candidate motion vectors of the three control points (i.e., K=3) of the current block. (x) (i,j) ,y (i,j) ) is substituted into the equation for the 6-parameter affine motion model to obtain the motion vector corresponding to the sample coordinates within each subblock, and the obtained motion vector is the motion vector (vx) of all samples within the subblock. (i,j) ,vy (i,j) It is used as ).
number
[0016] As another example, when 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 target candidate motion vectors of the two control points (i.e., K=2) of the current block. (x) (i,j) ,y (i,j) ) is substituted into the equation for the 4-parameter affine motion model to obtain the motion vector corresponding to the sample coordinates within each subblock, and the obtained motion vector is the motion vector (vx) of all samples within the subblock. (i,j) ,vy (i,j) It is used as ).
number
[0017] In another embodiment of the phase of reconstructing the current block according to the first aspect, the process of obtaining the predicted motion vectors of each subblock of the current block includes the following procedure: obtaining a 6-parameter affine transformation model of the current block based on the target candidate motion vectors of the K control points of the current block, and obtaining the predicted motion vectors of each subblock of the current block based on the 6-parameter affine transformation model of the current block.
[0018] In other words, in this solution, regardless of the affine transformation model used for the current block in the parsing phase (list construction phase), the 6-parameter affine transformation model is uniformly used in the reconstruction phase to obtain motion vector information for each subblock of the current block, so as to reconstruct each subblock. For example, if a 4-parameter affine transformation model or an 8-parameter bilinear model is used in the parsing phase, the 6-parameter affine transformation model of 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 of the current block is subsequently used in the reconstruction phase.
[0019] For example, a 4-parameter affine transformation model may be used for the current block in the parsing phase, and the 4-parameter affine transformation model or other parameter affine transformation models may be used for adjacent blocks. Thus, 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 6-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] Next, the 6-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 equation for the 6-parameter affine transformation model is as follows:
number
[0022] Next, the coordinates (x (i,j) , y (i,j) ) of the samples at the positions (e.g., center points) set in advance for each sub-block (or each motion compensation unit) of the current block with respect to the upper left corner (or other reference point) of the current block are substituted into the above formula for the six-parameter affine transformation model so as to obtain the motion information of the samples at the positions set in advance for each sub-block (or each motion compensation unit) so as to reconstruct each sub-block thereafter.
[0023] In this embodiment of the present invention, in the phase of reconstructing the current block, the six-parameter affine transformation model can be uniformly used to predict the current block. The greater the number of 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 affine transformations such as translation, scaling, and rotation of image blocks, and can achieve a good balance between model complexity and modeling ability. Therefore, this solution can improve the coding efficiency and accuracy when predicting the current block and can satisfy user requirements.
[0024] According to the first aspect, in a possible implementation, in the AMVP mode based on the affine transformation model, obtaining a 2×K parameter affine transformation model based on the target candidate motion vectors of K control points is to obtain the motion vectors of K control points based on the target candidate motion vectors of K control points and the motion vector differences of K control points, the motion vector differences of K control points being obtained by parsing the bitstream, and obtaining a 2×K parameter affine transformation model of the current block based on the motion vectors of K control points.
[0025] In a possible implementation according to the first embodiment, the encoder and decoder use an AMVP mode based on an affine transform model to perform interpretation, and the configured list is a list of candidate motion vectors for the AMVP mode based on the affine transform model.
[0026] In some specific embodiments of the present invention, candidate motion vectors of the control points of the current block are obtained by using a motion vector prediction method based on the first motion model described herein and may be added to a list of candidate motion vectors corresponding to the AMVP mode.
[0027] In some other specific embodiments of the present invention, candidate motion vectors of the control points of the current block may be obtained separately by using a motion vector prediction method based on a first motion model and a constructive control point motion vector prediction method, and added to a list of candidate motion vectors corresponding to the AMVP mode.
[0028] In a possible implementation according to the first embodiment, the encoder and decoder sides use a merge mode based on an affine transformation model to perform interpretation, and the configured list is a list of candidate motion vectors for the merge mode based on the 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 a motion vector prediction method based on the first motion model described herein and added to a list of candidate motion vectors corresponding to the merge mode.
[0030] In some other specific embodiments of the present invention, candidate motion vectors of the control points of the current block may be obtained separately by using a motion vector prediction method based on a first motion model and a constructive control point motion vector prediction method, and added to a list of candidate motion vectors corresponding to the merge mode.
[0031] In a possible embodiment, when there are multiple adjacent blocks, i.e., when the current block has multiple adjacent affine decoding blocks, in a possible embodiment, both the encoder and decoder can first obtain candidate motion vectors for the control points of the current block by using an affine decoding 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 list of candidate motion vectors corresponding to the AMVP mode. Subsequently, candidate motion vectors for the control points of the current block may be obtained by using an affine decoding block whose number of model parameters is different from that of the current block, and added to a list of candidate motion vectors corresponding to the AMVP mode. In this way, candidate motion vectors for the control points of the current block obtained by using an affine decoding 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] In a possible implementation according to the first embodiment, the decoder may need to obtain flag information (flag) of the affine transformation model of the affine decoded block in the process of deriving candidate motion vectors for the control points of the current block. The flag is stored locally in advance on the decoder side and is used to indicate the affine transformation model of the affine decoded block that is actually used to predict the subblocks of the affine decoded block.
[0033] For example, in an application scenario, if the decoder determines, by identifying the flag of an affine decoded block, that the number of model parameters in the affine transformation model actually used for the affine decoded block is different from (or the same as) that of the affine transformation model used for the current block, the decoder 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] In the first embodiment, in possible implementations, the affine transformation model flag of the affine decoded block may not be required in the process by which the decoder derives candidate motion vectors for the control points of the current block.
[0035] For example, in an application scenario, after the decoder determines the affine transformation model used for the current block, the decoder obtains a specific number of control points from the affine decoded block (a specific number that is the same as or different from the number of control points of the current block), constructs an affine transformation model using that specific number of control points from the affine decoded block, and then derives candidate motion vectors for the control points of the current block using the affine transformation model.
[0036] According to a second aspect, embodiments of the present invention provide another motion vector prediction method. The method includes parsing a bitstream to obtain index values for a candidate motion vector list, constructing a candidate motion vector list containing candidate motion vectors for K control points of the current block, 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 adjacent blocks of the current block, the 2N parameter affine transformation model is obtained based on the motion vectors for N control points of adjacent blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, the adjacent blocks are decoded image blocks spatially adjacent to the current block, and the current block includes a plurality of subblocks, determining target candidate motion vectors for the K control points of the current block based on 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 predicted motion vectors for each subblock of the current block based on the 6-parameter affine transformation model for the current block.
[0037] In this embodiment of the present invention, it is found that a six-parameter affine transformation model can be uniformly used to predict the current block in the phase of reconstructing the current block. The more parameters there are in 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 configured in the reconstruction phase can describe affine transformations such as translation, scaling, and rotation of the image block, achieving a good balance between model complexity and modeling capability. Thus, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0038] In a possible implementation according to the second embodiment, N=2 and K=3.
[0039] Accordingly, candidate motion vectors for the two control points of the current block are obtained based on the four-parameter affine transformation model used for the adjacent blocks of the current block.
[0040] In a possible implementation, N=3 and K=2 according to the second embodiment. Accordingly, candidate motion vectors for two control points of the current block are obtained based on the 6-parameter affine transformation model used for the adjacent blocks of the current block.
[0041] In a second embodiment, in a possible implementation, a 6-parameter affine transformation model of the current block is obtained based on the target candidate motion vectors of the K control points of the current block. Obtain a 4-parameter affine transformation model of the current block based on the target candidate motion vectors of the two control points of the current block, Obtain the motion vector of the third control point of the current block based on the four-parameter affine transformation model of the current block, Based on the motion vectors of the two target control points and the motion vector of the third control point of the current block, a 6-parameter affine transformation model of the current block is obtained. Includes.
[0042] In a second embodiment, in a possible implementation, a four-parameter affine transformation model of the current block is obtained based on the target candidate motion vectors of two control points of the current block. The process involves obtaining the motion vectors of the two control points of the current block based on the target candidate motion vectors of the two control points of the current block and the difference between the motion vectors of the two control points of the current block. The difference between the motion vectors of the two control points of the current block is obtained by parsing the bitstream. Obtain a 4-parameter affine transformation model of the current block based on the motion vectors of the two control points of the current block. Includes, Accordingly, obtaining a 6-parameter affine transformation model of the current block based on the target candidate motion vectors of the two control points and the motion vector of the third control point of the current block is, specifically, This includes obtaining a 6-parameter affine transformation model of the current block based on the motion vectors of two control points and a third control point of the current block.
[0043] In a second embodiment, in a possible implementation, N=2 and K=3. Accordingly, candidate motion vectors for the three control points of the current block are obtained based on the four-parameter affine transformation model used for the adjacent blocks of the current block.
[0044] According to a third 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 for a list of candidate motion vectors, and a prediction processing unit configured to constitute a list of candidate motion vectors 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 are obtained based on a 2×N parameterized affine transformation model used for adjacent blocks of the current block, the 2×N parameterized affine transformation model is obtained based on the motion vectors for N control points of adjacent blocks, where N is an integer between 2 and 4, K is an integer between 2 and 4, N is not equal to K, adjacent blocks are decoded image blocks spatially adjacent to the current block, and the current block is a prediction processing unit comprising a plurality of subblocks, the prediction processing unit configured to determine target candidate motion vectors for the K control points of the current block based on index values in the list of candidate motion vectors, and to obtain predicted motion vectors for each subblock 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 device module may be configured to carry out the method described in the first embodiment.
[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 for a list of candidate motion vectors, and a prediction processing unit configured to construct a list of candidate motion vectors containing candidate motion vectors for K control points of the current block, 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 adjacent blocks of the current block, the 2N parameter affine transformation model is obtained based on the motion vectors for N control points of adjacent blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, the adjacent blocks are decoded image blocks spatially adjacent to the current block, and the current block is a prediction processing unit comprising multiple subblocks, the prediction processing unit configured to determine target candidate motion vectors for the K control points of the current block based on index values in the list of candidate motion vectors, 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 predicted motion vectors for each subblock of the current block based on the 6 parameter affine transformation model for the current block.
[0047] In a specific embodiment, the device module may be configured to carry out the method described in the second embodiment.
[0048] According to a fifth aspect, an embodiment of the present invention provides a video decoding device. The device is Memory configured to store video data in the form of a bitstream, The bitstream is parsed to obtain index values for a list of candidate motion vectors, and the decoder is configured to construct a list of candidate motion vectors containing candidate motion vectors for K control points of the current block, the candidate motion vectors for the K control points of the current block are obtained based on a 2×N parameterized affine transformation model used for the adjacent blocks of the current block, the 2×N parameterized affine transformation model is obtained based on the motion vectors for N control points of adjacent blocks, where N is an integer between 2 and 4, K is an integer between 2 and 4, and N is not equal to K, the adjacent blocks are decoded image blocks spatially adjacent to the current block, the current block is a decoder containing multiple subblocks, and the decoder includes a decoder configured to determine target candidate motion vectors for the K control points of the current block based on index values in the list of candidate motion vectors, and to obtain predicted motion vectors for each subblock of the current block based on the target candidate motion vectors for the K control points of the current block.
[0049] In a fifth embodiment, in some implementations, N is equal to 2 and K is equal to 3. Accordingly, candidate motion vectors for the three control points of the current block are obtained based on the four-parameter affine transformation model used for the adjacent blocks of the current block.
[0050] In a fifth embodiment, in some implementations, the candidate motion vectors of the three control points of the current block include the motion vector at the upper left sample position of the current block, the motion vector at the upper right sample position of the current block, and the motion vector at the lower left sample position of the current block.
[0051] The decoder calculates the candidate motion vectors of the three control points of the current block using the following formula:
number
[0052] In a fifth embodiment, in some implementations, N is equal to 3 and K is equal to 2. Accordingly, candidate motion vectors of two control points of the current block are obtained based on the 6-parameter affine transformation model used for the adjacent blocks of the current block.
[0053] In a fifth embodiment, in some implementations, the candidate motion vectors of two control points of the current block include a motion vector at the upper-left sample position of the current block and a motion vector at the upper-right sample position of the current block.
[0054] The decoder calculates the candidate motion vectors of the two control points of the current block using the following formula
number
[0055] In some embodiments according to the fifth aspect, the decoder is: Based on the target candidate motion vectors of the K control points of the current block, we obtain a 2×K parameter affine transformation model for the current block. Obtain the predicted motion vectors for each subblock of the current block based on the 2×K parameter affine transformation model of the current block. It is specifically structured in this way.
[0056] In some embodiments according to the fifth aspect, the decoder is: The motion vectors of the K control points of the current block are obtained based on the target candidate motion vectors of the K control points of the current block and the difference in motion vectors of the K control points of the current block. The difference in motion vectors of the K control points of the current block is obtained by parsing the bitstream. Obtain a 2×K parameter affine transformation model for the current block based on the motion vectors of the K control points of the current block. It is specifically structured in this way.
[0057] In a fifth embodiment, in some implementations, after determining the target candidate motion vectors for K control points of the current block based on their index values in the candidate motion vector list, the decoder then... Based on the target candidate motion vectors of the K control points of the current block, we obtain a 6-parameter affine transform model for the current block. Obtain the predicted motion vectors for each subblock of the current block based on the 6-parameter affine transformation model of the current block. It is further configured.
[0058] For specific details on the decoding function, please refer to the relevant descriptions in the first embodiment.
[0059] According to a sixth aspect, embodiments of the present invention provide another video decoding device. The device is Memory configured to store video data in the form of a bitstream, The decoder includes: parsing a bitstream to obtain index values for a list of candidate motion vectors; constructing a list of candidate motion vectors containing candidate motion vectors for K control points of the 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 the adjacent blocks of the current block, where the 2N parameter affine transformation model is obtained based on the motion vectors for N control points of the adjacent blocks, where N is an integer between 2 and 4, and K is an integer between 2 and 4, where the adjacent blocks are decoded image blocks spatially adjacent to the current block, where the current block contains multiple subblocks; determining target candidate motion vectors for the K control points of the current block based on index values in the list of candidate motion vectors; 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 predicted motion vectors for each subblock of the current block based on the 6-parameter affine transformation model for the current block.
[0060] For specific details on the decoding function, please refer to the relevant descriptions in the second aspect.
[0061] According to a seventh aspect, embodiments of the present invention provide a computer-readable storage medium. The computer-readable storage medium stores instructions and enables one or more processors to encode video data when the instructions are executed. The instructions enable one or more processors to perform a method described in any possible embodiment of the first aspect.
[0062] According to the eighth aspect, embodiments of the present invention provide a computer-readable storage medium. The computer-readable storage medium stores instructions and enables one or more processors to encode video data when the instructions are executed. The instructions enable one or more processors to perform a method described in any possible embodiment of the second aspect.
[0063] According to the ninth aspect, embodiments of the present invention provide a computer program including program code. When the program code is executed on a computer, the methods described in any possible embodiment of the first aspect are performed.
[0064] According to a tenth aspect, embodiments of the present invention provide a computer program including program code. When the program code is executed on a computer, the methods described in any possible embodiment of the second aspect are performed.
[0065] In embodiments of the present invention, it is found that in the process of encoding and decoding the current block, during the current block parsing phase (for example, the phase in which a candidate motion vector list for AMVP mode or merge mode is constructed), the affine transformation model of the current block may be constructed by using the affine transformation models of adjacent 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. Thus, 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 may uniformly use a 6-parameter affine transform model to predict the image block in the phase of reconstructing the image block. In this way, in this embodiment of the present invention, a good balance is achieved between model complexity and modeling capability in the process of reconstructing the current block. Therefore, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0067] To more clearly describe the technical solutions in embodiments or background of the present invention, the following is a brief description of the accompanying drawings illustrating embodiments or background of the present invention. [Brief explanation of the drawing]
[0068] [Figure 1] This is a block diagram showing an example of the structure of a video coding system that implements embodiments of the present invention. [Figure 2A] This block diagram shows an example of the structure of a video encoder that implements an embodiment of the present invention. [Figure 2B] This block diagram shows an example of the structure of a video decoder that implements an embodiment of the present invention. [Figure 3] This block diagram shows an example of a video coding device that implements an embodiment of the present invention. [Figure 4] This block diagram shows an example of an encoding or decoding device that implements an embodiment of the present invention. [Figure 5] This is a schematic diagram illustrating a scenario in which an example action is performed on the current block. [Figure 6] This is a schematic diagram illustrating a scenario in which other example actions are performed on the current block. [Figure 7] This is a schematic diagram illustrating a scenario in which other example actions are performed on the current block. [Figure 8] This is a schematic diagram illustrating a scenario in which other example actions are performed on the current block. [Figure 9] This is a flowchart of a motion vector prediction method according to an embodiment of the present invention. [Figure 10] This is a schematic diagram illustrating a scenario in which other example actions are performed on the current block. [Figure 11A] This 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] This 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] This is a flowchart of another motion vector prediction method according to an embodiment of the present invention. [Figure 13]This is a flowchart of another motion vector prediction method according to an embodiment of the present invention. [Modes for carrying out the invention]
[0069] The following briefly describes the relevant concepts in embodiments of the present invention. The technical solutions in embodiments of the present invention may be applied not only to existing video coding standards (e.g., standards such as H.264 and HEVC) but also to future video coding standards (e.g., the H.266 standard).
[0070] Video coding typically refers to processing a sequence of images that make up 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 is performed at the source and typically involves processing the original video image (e.g., by compression) to reduce the amount of data representing the video image for more efficient storage and / or transmission. Video decoding is performed at the destination and typically involves the reverse processing compared to the encoder to reconstruct the video image. In embodiments, “coding” of a video image should be understood as “encoding” or “decoding” of a video sequence. The combination of the encoding and decoding parts is also called a CODEC (encoding and decoding).
[0071] A video sequence consists of a sequence of images, which are further divided into slices, and slices into blocks. Video coding is performed in block units. In some newer video coding standards, the concept of a "block" is further extended. For example, macroblocks (MB) are introduced in the H.264 standard. Macroblocks may be further divided into multiple predictor blocks that can be used for predictive coding. The high-efficiency video coding (HEVC) standard uses basic concepts such as "coding unit (CU)," "prediction unit (PU)," and "transform unit (TU)." Multiple block units are obtained through functional decomposition 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 dividing and encoding a coded image. PUs and TUs also have similar tree structures. A PU may correspond to a prediction block and is the basic unit for prediction coding. A CU is further divided into multiple PUs based on the division pattern. A TU may correspond to a transformation block and is the basic unit for transforming prediction residuals. 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 quadtree structure represented as a coding tree. Decisions about whether to encode an image area by using inter-image (temporal) or intra-image (spatial) prediction are made at the CU level. Each CU may be further divided into one, two, or four PUs based on the PU partitioning pattern. Within a single PU, the same prediction process is applied, and the relevant information is sent to the decoder on a PU basis. After obtaining residual blocks by applying the prediction process based on the PU partitioning pattern, the CU may be divided into transform units (TUs) based on other quadtree structures similar to the coding tree used for the CU. In recent developments of video compression techniques, quad-tree plus binary tree (QTBT) partition frames are used to partition coding blocks. In a QTBT block structure, CUs may be square or rectangular.
[0073] For the purposes of this specification, and for ease of description and understanding, the image block to be encoded in the current coded image may be referred to as the 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. The decoded image block in the reference image used to predict the current block is referred to as the reference block. That is, the reference block is the block that provides the reference signal for the current block, and the reference signal represents the pixel value in the image block. The block in the reference image that provides the prediction signal for the current block may be referred to as the prediction block, and the prediction signal represents the pixel value, sampled value, or sampled signal in the prediction block. For example, after traversing several reference blocks, the optimal reference block may be found. The optimal reference block provides the prediction for the current block and may be referred to as the 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 of a 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 term “video coding” or “coding” may generally refer to video encoding or video decoding. The video encoder 100 and video decoder 200 of the video coding system are configured to predict motion information, e.g., motion vectors, of the current coded image block or subblock of the current coded image block, according to examples of various methods described in any one of the multiple novel interprediction modes provided in embodiments of the present invention, so that the predicted motion vectors best approximate motion vectors obtained by using motion estimation methods. In this way, the motion vector difference does not need to be transmitted during coding, thereby further improving coding performance.
[0075] As shown in Figure 1, the video coding system includes a source device 10 and a destination device 20. The source device 10 generates encoded video data. Therefore, the source device 10 may be called a video encoder. The destination device 20 may decode the encoded video data generated by the source device 10. Therefore, the destination device 20 may be called a video decoder. In various implementations, 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 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 "smartphones," television receivers, 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 link 30. Link 30 may include one or more media or devices that can move the encoded video data from the source device 10 to the destination device 20. For example, 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. 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. One or more communication media may be parts of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). One or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the source device 10 to the destination device 20.
[0078] In another example, the encoded data may be output to the storage device 40 through the output interface 140. Similarly, the encoded data may be accessed from the storage device 40 through the input interface 240. The storage device 40 may include any one of several distributed or locally accessed data storage media, such as a hard disk drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage media configured to store encoded video data.
[0079] In another example, the storage device 40 may correspond to a file server or other intermediate storage device capable of storing encoded video data generated by the source device 10. The destination device 20 may access the stored video data from the storage device 40 via 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 the destination device 20. For example, the file server may include a network server (e.g., used for a website), an FTP server, a network-attached storage (NAS) device, or a local disk drive. The destination device 20 may access the encoded video data via any standard data connection (including an internet connection). Standard data connections may include wireless channels (e.g., Wi-Fi connection), wired connections (e.g., DSL or cable modem), or a combination thereof, which can be used to access the encoded video data stored on the file server. Transmission of the encoded video data from the storage device 40 may be via streaming transmission, download transmission, or a combination thereof.
[0080] The motion vector prediction technique 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 of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, the video 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 conferencing.
[0081] The video coding system shown in Figure 1 is merely an example. The technology in embodiments of the present invention may be applicable to video coding configurations (e.g., video coding or video decoding) that do not necessarily involve any data communication between the coding device and the decoding device. In other examples, the data may be read from local memory or transmitted over a network in a streaming manner. The video coding device may code the data and store the data in memory, and / or the video decoding device may read the data from memory and decode the data. In many examples, coding and decoding are performed by devices that simply code the data, store the data in memory, and / or read the data from memory and decode the data, without communicating with each other.
[0082] In the example shown in Figure 1, the source device 10 includes a video source 120, a video encoder 100, and an output interface 140. In some examples, the output interface 140 may include a modulator / demodulator (modem) and / or a transmitter. The video source 120 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video feed-in interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of the above video data sources.
[0083] The video encoder 100 may encode video data from the video source 120. In some examples, the source device 10 transmits the encoded video data directly to the destination device 20 through the output interface 140. In other examples, the encoded video data may instead be stored in the storage device 40, so that the destination device 20 can then access the encoded video data for decoding and / or playback.
[0084] In the example in Figure 1, the destination device 20 includes an input interface 240, a video decoder 200, and a display device 220. In some examples, the input interface 240 includes a receiver and / or a modem. The input interface 240 may receive encoded video data via link 30 and / or from storage device 40. The display device 220 may be integrated with the destination device 20 or located outside of the destination device 20. Typically, the display device 220 displays the decoded video data. The display device 220 may include multiple types of display devices, such as liquid crystal displays (LCDs), plasma displays, organic light-emitting diode (OLED) displays, or other types of display devices.
[0085] Although not shown in Figure 1, in some embodiments, the video encoder 100 and video decoder 200 may be integrated with an audio encoder and audio decoder, respectively, and may include a suitable multiplexer-demultiplexer (MUX-DEMUX) unit or other hardware and software to encode audio and video in a combined data stream or separate data streams. Where appropriate and as needed, the MUX-DEMUX unit 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 one of several circuits, for example: 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 partially implemented in software, the device may store instructions used for the software in a suitable non-volatile computer-readable storage medium, and may use one or more processors to execute the instructions in hardware and implement the technology in embodiments of the present invention. Any one of the above (including hardware, software, combinations of hardware and software, etc.) may be considered as one or more processors. The video encoder 100 and the video decoder 200 may each be included in one or more encoders or decoders, and an encoder or decoder may be incorporated as part of a composite encoder / decoder (codec) in the corresponding device.
[0087] In embodiments of the present invention, the video encoder 100 may generally be a device that “transmits” or “transmits” some information to another device, such as a video decoder 200. The terms “transmits” or “transmits” 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 nearly real time. Alternatively, the communication may occur after a period of time. For example, the communication may occur when the syntax elements in the encoded bitstream are stored in a computer-readable storage medium during encoding, and the decoder may then retrieve the syntax elements at any time after they have been stored in the medium.
[0088] The video encoder 100 and video decoder 200 may operate in accordance with a video compression standard such as High Efficiency Video Coding (HEVC) or its extensions, and may also operate in accordance with the HEVC Test Model (HM). Alternatively, the video encoder 100 and video decoder 200 may operate in accordance with other industry standards, such as the ITU-T H.264 standard, the H.265 standard, or extensions of such standards. However, the technology in embodiments of the present invention is not limited to any particular coding standard.
[0089] For example, the video encoder 100 is configured to encode syntax elements relating to the current image block to be encoded into a digital video output bitstream (abbreviated as bitstream). Here, the syntax elements used for interpredicting the current image block are abbreviated as interprediction data, and the interprediction data includes, for example, indication information for the interprediction mode. The interprediction mode in embodiments of the present invention includes at least one of an AMVP mode based on an affine transform model and a merge mode based on an affine transform model. If the interprediction data includes indication information for an AMVP mode based on an affine transform model, the interprediction data may further include an index value (or index number) of a candidate motion vector list corresponding to the AMVP mode and the motion vector difference (MVD) of the control points of the current block. If the interprediction data includes indication information for a merge mode based on an affine transform model, the interprediction data may further include an index value (or index number) of a candidate motion vector list corresponding to the merge mode. Furthermore, in any embodiment, the interprediction data in the above example may further include indication information for the affine transform model (number of model parameters) of the current block.
[0090] It should be understood that if the difference (i.e., residual) between a predicted block generated based on motion information predicted based on a novel interprediction mode provided in an embodiment of the present invention and the current image block to be encoded (i.e., the original block) is 0, the video encoder 100 only needs to encode the syntax elements relating to the current image block to be encoded into the bitstream. Otherwise, in addition to the syntax elements, the corresponding residuals would need to be further encoded into the bitstream.
[0091] In a specific embodiment, the video encoder 100 may be configured to perform the following embodiment shown in Figure 13 to implement the encoder-side application of the motion vector prediction method described in the present invention.
[0092] For example, the video decoder 200 is configured to decode a bitstream so as to obtain syntax elements relating to the current image block to be decoded (S401). Here, the syntax elements used for interprediction of the current image block are abbreviated as interprediction data, and the interprediction data includes, for example, indication information for the interprediction mode. The interprediction mode in embodiments 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 interprediction data includes indication information for an AMVP mode based on an affine transformation model, the interprediction data may further include an index value (or index number) of a candidate motion vector list corresponding to the AMVP mode and the motion vector difference (MVD) of the control points of the current block. If the interprediction data includes indication information for a merge mode based on an affine transformation model, the interprediction data may further include an index value (or index number) of a candidate motion vector list corresponding to the merge mode. Furthermore, in any embodiment, the interprediction data in the above example may further include indication information for the affine transformation model (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 shown in Figure 9 or Figure 12 in order to implement the application of the motion vector prediction method described in the present invention on the decoder side.
[0094] Figure 2A is a block diagram of an example 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 is 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 functions described with respect to the post-processing entity 41 may be performed by the same device including the video encoder 100. In one example, the post-processing entity 41 is an example of the storage device 40 in Figure 1.
[0095] In the example shown in Figure 2A, the video encoder 100 includes a prediction processing unit 108, a filter unit 106, a decoded image buffer (DPB) 107, an adder 112, a converter 101, a quantizer 102, and an entropy encoder 103. The prediction processing unit 108 includes an interpreter 110 and an intrapreter 109. For image block reconstruction, the video encoder 100 further includes an inverse quantizer 104, an inverse converter 105, and an adder 111. The 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 the filter unit 106 is shown as an in-loop filter in Figure 2A, in other implementations, the filter unit 106 may be implemented as a post-loop filter. In one example, the 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 the components of the video encoder 100. The video data stored in the video data memory may be retrieved from the video source 120. The DPB 107 may be a reference image memory that stores reference video data used by the video encoder 100 to encode video data in intra or intercoding mode. The video data memory and the DPB 107 may each consist of one of several memory devices, for example, dynamic random-access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (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 the chip together with the other components of the video encoder 100, or it may be located off-chip relative to those components.
[0097] As shown in Figure 2A, the video encoder 100 receives video data and stores the video data in video data memory. The partitioning unit divides the video data into several image blocks, which may be further divided into smaller blocks, for example, based on a quadtree or binary tree structure. The division may further include division into slices, tiles, or other larger units. The video encoder 100 is typically the component that encodes the image blocks in the video slice to be encoded. A slice may be divided into multiple image blocks (and may be divided into sets of image blocks called tiles).
[0098] The intra-predictor 109 within the prediction processing unit 108 may perform intra-predictive coding on the current image block to be coded for one or more adjacent blocks in the same frame or slice as the current image block, in order to eliminate spatial redundancy. The inter-predictor 110 within the prediction processing unit 108 may perform inter-predictive coding on the current image block for one or more prediction blocks in one or more reference images, in order to eliminate temporal redundancy.
[0099] Specifically, the interpreter 110 may be configured to determine the interprediction mode to be used to encode the current image block. For example, the interpreter 110 may calculate the rate distortion values of various interprediction modes in a candidate set of interprediction modes through rate distortion analysis and select the interprediction mode that has the optimal rate distortion characteristics from among the interprediction modes. Rate distortion analysis typically involves determining the amount of distortion (or error) between the encoded block and the original unencoded block that should be encoded to produce the encoded block, and the bit rate (i.e., the amount of bits) used to produce the encoded block. For example, the interpreter 110 may determine the interprediction mode that has the lowest rate distortion cost among the candidate set of interprediction modes and is used to encode the current block as the interprediction mode to be used to perform interprediction on the current image block. The following describes in detail the interprediction coding process, in particular the process of predicting motion information of one or more subblocks (specifically, each subblock or all subblocks) in the current image block using various interprediction modes used for omnidirectional or directional motion fields in embodiments of the present invention.
[0100] The interpreter 110 is configured to predict motion information (e.g., motion vectors) for one or more subblocks within the current image block based on a determined interpretermination mode, and to obtain or generate a predicted block for the current image block by using the motion information (e.g., motion vectors) for one or more subblocks within the current image block. The interpreter 110 finds the predicted block pointed to by the motion vector in one of the reference images in the reference image list. The interpreter 110 may further generate syntax elements associated with the image block and video slice, so that the video decoder 200 uses the syntax elements to decode the image block of the video slice. Alternatively, for example, the interpreter 110 performs a motion compensation process by using the motion information of each subblock to generate a predicted block for the subblock, thereby obtaining a predicted block for the current image block. It should be understood here that the interpreter 110 performs a motion estimation process and a motion compensation process.
[0101] Specifically, after selecting an interprediction mode for the current image block, the interpredictor 110 may supply information indicating the selected interprediction mode for the current image block to the entropy encoder 103, thereby the entropy encoder 103 encodes the information indicating the selected interprediction mode. In this embodiment of the present invention, the video encoder 100 may add interprediction data related to the current image block to the bitstream transmitted by the video encoder 100. The interprediction data includes, for example, an indication information for the interprediction mode. The interprediction modes in embodiments of the present invention include at least one of an AMVP mode based on an affine transform model and a merge mode based on an affine transform model. If the interprediction data includes an indication information for an AMVP mode based on an affine transform model, the interprediction data may further include an index value (or index number) of a candidate motion vector list corresponding to the AMVP mode and the motion vector difference (MVD) of the control points of the current block. If the interprediction data includes an indication information for a merge mode based on an affine transform model, the interprediction data may further include an index value (or index number) of a candidate motion vector list corresponding to the merge mode. Furthermore, in any embodiment, the interpretation data in the above example may further include information indicating the affine transformation model (number of model parameters) of the current block.
[0102] In a specific embodiment, the interpreter 110 may be configured to perform the relevant steps in the following embodiment shown in Figure 13 to implement the encoder-side application of the motion vector prediction method described in the present invention.
[0103] The intra predictor 109 may perform an intra prediction for the current image block. Specifically, the intra predictor 109 may determine the intra prediction mode to be used to encode the current block. For example, the intra predictor 109 may calculate the rate distortion values of various intra prediction modes to be tested through rate distortion analysis and select the intra prediction mode having the optimal rate distortion characteristics from the modes to be tested. In any case, after selecting an intra prediction mode for the image block, the intra predictor 109 may supply information indicating the selected intra prediction mode for the current image block to the entropy encoder 103, thereby allowing the entropy encoder 103 to encode the information indicating the selected intra prediction mode.
[0104] After the prediction processing unit 108 generates a prediction block of the current image block through interpretation and intraprediction, the video encoder 100 subtracts the prediction block from the current image block to be encoded to generate a residual image block. The adder 112 represents one or more components that perform the subtraction operation. The residual video data in the residual block may be contained in one or more TUs and applied to the converter 101. The converter 101 converts the residual video data into residual conversion coefficients through a transformation such as a discrete cosine transform (DCT) or a conceptually similar transformation. The converter 101 may convert the residual video data from the pixel value domain to a transformation domain, for example, the frequency domain.
[0105] The converter 101 may send the acquired conversion coefficients to the quantizer 102. The quantizer 102 quantizes the conversion coefficients to further reduce the bit rate. In some examples, the quantizer 102 may further scan a matrix containing the quantized conversion coefficients. Alternatively, the entropy encoder 103 may perform the scan.
[0106] After quantization, the entropy encoder 103 performs entropy coding on the quantized transformation coefficients. For example, the 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), stochastic interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques. After the entropy encoder 103 has performed entropy coding, the encoded bitstream may be transmitted to the video decoder 200 or archived for subsequent transmission or to be retrieved by the video decoder 200. The entropy encoder 103 may further perform entropy coding on the syntax elements of the current image block to be encoded.
[0107] The inverse quantizer 104 and inverse transformer 105 apply inverse quantization and inverse transform, respectively, to reconstruct the residual block in the pixel region, for example, so that it may subsequently be used as a reference block in a reference image. The adder 111 adds the reconstructed residual block to the prediction block generated by the interpreter 110 or intrapreter 109 to produce the 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 is then stored as a reference block in the decoded image buffer 107 and may be used by the interpreter 110 to perform interpretation 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 a video stream. For example, for some image blocks or frames, the video encoder 100 may directly quantize the residual signal, and accordingly, processing by the converter 101 and the inverse converter 105 is unnecessary. Alternatively, for some image blocks or frames, the video encoder 100 may not generate residual data, and accordingly, processing by the converter 101, quantizer 102, inverse quantizer 104, and inverse converter 105 is unnecessary. 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 within 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 method described in the following embodiments.
[0110] Figure 2B is a block diagram of an example video decoder 200 according to an embodiment of the present invention. In the example of Figure 2B, the video decoder 200 includes an entropy decoder 203, a prediction processing unit 208, an inverse quantizer 204, an inverse converter 205, an adder 211, a filter unit 206, and a decoded image buffer 207. The prediction processing unit 208 may include an interpreter 210 and an intrapreter 209. In some examples, the video decoder 200 may perform a decoding process that is substantially the reverse of the encoding process described with respect to the video encoder 100 in Figure 2A.
[0111] During decoding, the video decoder 200 receives an encoded video bitstream from the video encoder 100, representing the image blocks and associated syntax elements of the encoded video slice. The video decoder 200 may receive video data from the network entity 42 and optionally store the video data in a video data memory (not shown). The video data memory may store video data to be decoded by the components of the video decoder 200, such as an encoded video bitstream. The video data stored in the video data memory may be obtained, for example, from a local video source such as a storage device 40 or a camera, via 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 image buffer (DPB) configured to store the encoded video data from the encoded video bitstream. Thus, although the video data memory is not shown in Figure 2B, the video data memory and the DPB 207 may be the same memory or may be separately located memories. The video data memory and DPB207 may each consist of one of several memory devices, such as dynamic random-access memory (DRAM) including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The video data memory and DPB107 may be provided by the same memory device or by separate memory devices. In various examples, the video data memory may be integrated on the chip together with the other components of the video decoder 200, or it may be located off-chip relative to those components.
[0112] The network entity 42 may be, for example, a server, MANE, video editor / splicer, or other similar device configured to perform one or more of the above techniques. The network entity 42 may or may not include a video encoder, for example, video encoder 100. Before the network entity 42 sends the encoded video bitstream to the video decoder 200, the network entity 42 may perform some of the techniques described in embodiments of the present invention. In some video decoding systems, the network entity 42 and the video decoder 200 may be components of separate devices. In other cases, the functions described with respect to the network entity 42 may be performed by the same device including the video decoder 200. In some cases, the network entity 42 may be an example of the storage device 40 in Figure 1.
[0113] The entropy decoder 203 of the video decoder 200 performs entropy decoding on the bitstream to generate quantized coefficients and several syntax elements. The entropy decoder 203 transfers the syntax elements to the prediction processing unit 208. The video decoder 200 may receive multiple syntax elements / one syntax element at the video slice level and / or image block level.
[0114] When a video slice is decoded into an intra-decoded (I) slice, the intra-predictor 209 of the prediction processing unit 208 may generate a predicted block for the image block of the current video slice based on the intra-prediction mode transmitted by the signal and the data of a block decoded before the current frame or image. When a video slice is decoded into an inter-decoded (i.e., B or P) slice, the inter-predictor 210 of the prediction processing unit 208 may determine the inter-prediction mode to be used to decode the current image block of the current video slice based on the syntax element received from the entropy decoder 203, and decode the current image block (e.g., perform inter-prediction on it) based on the determined inter-prediction mode. Specifically, the inter-predictor 210 may determine whether a new inter-prediction mode should be used to predict the current image block of the current video slice. When a syntax element indicates that a new inter-prediction mode should 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 subblock of the current image block 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) of the current video slice, so as to obtain or generate a prediction block for the current image block or a subblock of the current image block based on the predicted motion information of the current image block or the predicted motion information of a subblock of the current image block by using a motion compensation process. The motion information here may include reference image information and motion vectors. 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, a prediction block may be generated from one of the reference images in one of the reference image lists. The video decoder 200 may construct 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 interpreter 210 here performs a motion compensation process. The following describes in detail the interpretation process that predicts the motion information of the current image block or the motion information of a subblock of the current image block by using the motion information of the reference block in various new interpretation modes.
[0115] For example, the interpreter 210 may predict the 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, the syntax elements used for interpretation of the current image block are abbreviated as interpretation data, and the interpretation data includes, for example, indication information for the interpretation mode. The interpretation mode in embodiments 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 interpretation data includes indication information for an AMVP mode based on an affine transformation model, the interpretation data may further include an index value (or index number) of a candidate motion vector list corresponding to the AMVP mode and the motion vector difference (MVD) of the control points of the current block. When the interpretation data includes indication information for a merge mode based on an affine transformation model, the interpretation data may further include an index value (or index number) of a candidate motion vector list corresponding to the merge mode. Furthermore, in any embodiment, the interpretation data in the above example may further include information indicating the affine transformation model (number of model parameters) of the current block.
[0116] In a specific embodiment, the interpreter 210 may be configured to perform the relevant steps in the following embodiments shown in Figure 9 or Figure 12 in order to implement the application of the motion vector prediction method described in the present invention on the decoder side.
[0117] The inverse quantizer 204 performs inverse quantization, i.e., dequantization, on the quantized transformation coefficients supplied in the bitstream and decoded by the entropy decoder 203. The inverse quantization process may include determining the degree of quantization to be applied and similarly determining the degree of inverse quantization to be applied by using quantization parameters calculated by the video encoder 100 for each image block in the video slice. The inverse converter 205 applies an inverse transform, e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process to the transformation coefficients to generate a residual block of the pixel region.
[0118] After the interpreter 210 generates a prediction block to be used for the current image block or a subblock of the current image block, the video decoder 200 adds the residual block from the inverse converter 205 and the corresponding prediction block generated by the interpreter 210 to obtain a reconstructed block, i.e., a decoded image block. The adder 211 represents a component that performs the addition operation. Loop filters (in or after the decoding loop) may be used to further smooth pixels if necessary, 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 as an in-loop filter in Figure 2B, in other implementations, the filter unit 206 may be implemented as a post-loop filter. In one example, the filter unit 206 is applicable to the reconstructed block to reduce block distortion, and the result is output as a decoded video stream. Furthermore, the decoded image blocks within a given frame or image may be stored in a decoded image buffer 207, which stores a reference image used for subsequent motion compensation. The decoded image buffer 207 may be part of memory and may further store the decoded video for subsequent presentation on a display device (e.g., display device 220 in Figure 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 an 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 image frames, the entropy decoder 203 of the video decoder 200 does not obtain quantized coefficients through decoding, and accordingly, processing by the inverse quantizer 204 and inverse converter 205 is unnecessary.
[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 embodiment.
[0121] Figure 3 is a schematic diagram of a video coding device 400 (e.g., a video encoding device 400 or a video decoding device 400) according to an embodiment of the present invention. The video coding device 400 is applicable to embodiments described herein. In embodiments, the video coding device 400 may be a video decoder (e.g., the video decoder 200 in Figure 1) or a video encoder (e.g., the video encoder 100 in Figure 1). In other embodiments, the video coding device 400 may be one or more components of the video decoder 200 in Figure 1 or the video encoder 100 in Figure 1.
[0122] The video coding device 400 includes an inlet 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 exit port 450 configured to transmit data, and a memory 460 configured to store data. The video coding device 400 may further include photoelectric and electro-optical (EO) conversion components coupled to the inlet port 410, receiver unit 420, transmitter unit 440, and exit port 450 for the input or output 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), FPGAs, ASICs, or DSPs. The processor 430 communicates with the inlet port 410, the receiver unit 420, the transmitter unit 440, the exit 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 embodiments disclosed herein to implement the motion vector prediction method provided in 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 acts on the transformation of the video coding device 400 to different states. Alternatively, the encoding / decoding module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.
[0124] Memory 460 includes one or more disks, tape drives, and solid-state drives and may be used as an overflow data storage device 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 non-volatile 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 video decoder 200 of this application, the processing result of a procedure may be further processed before being output to the next procedure. For example, after procedures such as interpolation filtering, motion vector derivation, or loop filtering, operations such as clipping or shifting may be further performed on the processing result of the corresponding procedure.
[0126] For example, the motion vector of a control point in the current image block, derived based on the motion vectors of adjacent affine coding blocks, may be further processed. This is not limited to the present invention. For example, the range of values for a motion vector may be restricted such that the motion vector falls within a certain bit depth. If the allowable bit depth of a motion vector is bitDepth, then the range of the motion vector is from -2^(bitDepth-1) to 2^(bitDepth-1), where the sign "^" represents exponentiation. If bitDepth is 16, the range of values is from -32768 to 32767. If bitDepth is 18, the range of values is from -131072 to 131071. The range of values for a motion vector may be restricted in one of two ways.
[0127] Method 1: Overflowing higher-order bits of the motion vector 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, the value of vx is -32769, and 32767 is obtained according to the formula above. The value is stored in the computer in two's complement form, and the two's complement of -32769 is 1,0111,1111,1111,1111 (17 bits). The operation performed by the computer due to overflow is to discard higher-order bits. Thus, 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 vector 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] Figure 4 is a schematic block diagram of an embodiment of an encoding or decoding device (abbreviated as coding device 1200) 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 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 execute various video encoding or decoding methods described in embodiments of the present invention, in particular video encoding or decoding methods in various novel interprediction modes and motion information prediction methods in novel interprediction modes. For the sake of avoiding repetition, further details are not described here again.
[0132] In this embodiment of the present invention, the processor 1210 may be a central processing unit (CPU), or the processor 1210 may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
[0133] 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 memory 1230. Memory 1230 may include code and data 1231 accessed by the processor 1210 using the bus system 1250. Memory 1230 may further include an operating system 1233 and an application program 1235. The application program 1235 includes at least one program that enables the processor 1210 to perform a video coding or decoding method described in embodiments of the present invention (in particular, a motion vector prediction method described in embodiments of the present invention). For example, the application program 1235 may include applications 1 to N, and further include a video coding or decoding application (abbreviated as a video coding application) that performs a video coding or decoding method described in embodiments of the present invention.
[0134] In addition to the data bus, the bus system 1250 may further include a power bus, control bus, status signal bus, etc. For clarity, various types of buses are shown as bus system 1250 in the diagram.
[0135] Optionally, the coding device 1200 may further include one or more output devices, such as a display 1270. For example, the display 1270 may be a touch display that combines a touch unit that detects touch input in operation with a display. The display 1270 may be connected to the processor 1210 by using the bus system 1250.
[0136] To better understand the technical solutions in embodiments of the present invention, the following further describes the interpretation mode, non-translational motion model, inheritance control point motion vector prediction method, and constructive control point motion vector prediction method in embodiments of the present invention.
[0137] (1) Interpretation modes. HEVC uses two interpretation modes: advanced motion vector prediction (AMVP) mode and merge mode.
[0138] In AMVP mode, the currently active block is first traversed through its spatially or temporally adjacent encoded blocks (referred to as adjacent blocks). A candidate motion vector list (also known as a motion information candidate list) is constructed based on the motion information of the adjacent blocks. The optimal motion vector is then determined from 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 positions and traverse order of adjacent 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 using the candidate motion vector predictor, R represents the bit rate, and λ represents the Lagrange multiplier. The encoder transfers the index value and reference frame index value of the selected motion vector predictor in the candidate motion vector list to the decoder. Furthermore, a motion search is performed in the neighborhood centered on the MVP to obtain the actual motion vector of the current block. The encoder then transfers the difference between the MVP and the actual motion vector (motion vector difference) to the decoder. J = SAD + λR (1)
[0139] In merge mode, the candidate motion vector list is initially constructed based on the motion information of spatially or temporally adjacent encoded blocks of the current block. The rate distortion cost is then calculated to determine the optimal motion information in the candidate motion vector list as the motion information for the current block, and the index value of the optimal motion information position in the candidate motion vector list (hereinafter referred to as the merge index) is transferred to the decoder. Figure 5 shows the spatial and temporal candidate motion information for the current block. The spatial candidate motion information comes from five spatially adjacent blocks (A0, A1, B0, B1, and B2). If an adjacent block is unavailable (either it does not exist, or it is not encoded, or the prediction mode used for the adjacent block is not inter-prediction mode), the motion information of the adjacent block is not added to the candidate motion vector list. The temporal candidate motion information for the current block is obtained by scaling the MV 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 the block at position T in the reference frame is available. If the block is unavailable, the block at position C is selected.
[0140] Similar to AMVP mode, in merge mode, the positions and traverse order of adjacent blocks are also predefined. Furthermore, the positions and traverse order of adjacent blocks may differ between modes.
[0141] It is understood that the candidate motion vector list needs to be maintained in both AMVP mode and merge mode. Before new motion information is added to the candidate list each time, it is first checked whether the same motion information already exists in the list. If the same motion information already exists in the list, that motion information is not added to the list. This checking process is called pruning of the candidate motion vector list. The purpose of pruning the list is to avoid duplicate motion information in the list in order to avoid redundant rate distortion cost calculations.
[0142] During interpretation in HEVC, the same motion information is used for all pixels within a coding block (i.e., the motion of all pixels within 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, not all pixels within a coding block may have the same motion characteristics. Using the same motion information can result in inaccurate, motion-compensated predictions and more residual information.
[0143] In other words, existing video coding standards use block-matching motion estimation based on translation motion models. However, in the real world, various types of motion exist. Many objects, such as rotating objects, roller coasters rotating in different directions, fireworks, and some stunts in movies, do not undergo translation motion. When these moving objects, especially those in UGC scenarios, are coded using block motion compensation techniques based on translation motion models in current coding standards, coding efficiency is greatly affected. Therefore, non-translation motion models, such as affine motion models, are 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 uses one motion model to derive motion information for each motion compensation subunit in the current block and performs motion compensation based on the motion information of the motion compensation subunits to obtain a prediction block. This can improve prediction efficiency. The motion compensation subunit in embodiments of the present invention may be a sample or pixel block of size N1 × N2 obtained through partitioning according to a particular method, where N1 and N2 are both positive integers, and N1 may be equal to or not equal to N2.
[0146] Commonly used non-translational motion models include 4-parameter affine transformation models and 6-parameter affine transformation models, and further, in possible application scenarios, 8-parameter bilinear models. These models are described separately below.
[0147] The four-parameter affine transformation model is given by equation (2):
number
[0148] A four-parameter affine transformation model can be represented by using the motion vectors of two samples and the coordinates of the two samples relative to the sample located 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 determined first. Then, the motion information of each motion compensation subunit of the current block is obtained according to equation (3), where (x,y) is the coordinate 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 6-parameter affine transformation model is given by equation (4):
number
[0150] A 6-parameter affine transformation model can be represented by using the 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, upper right, and lower left corners of the current block are first determined to be (vx0,vy0), (vx1,vy1), and (vx2,vy2), respectively. Then, the motion information of each motion-compensated subunit of the current block is obtained according to equation (5), where (x,y) is the coordinate of the motion-compensated 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 8-parameter bilinear model is given by equation (6):
number
[0152] An 8-parameter bilinear model can be represented by using the motion vectors of four samples and the coordinates of the four samples relative to the sample located at the upper left corner of the current coding block. When 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, upper right, lower left, and lower right corners of the current coding block are determined first. Then, the motion information of each motion compensation subunit of the current coding block is derived according to equation (7), where (x,y) is the coordinate 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] The coding blocks predicted by using the affine transformation model can also be called affine coding blocks. From the above explanation, it is clear that the affine transformation model is directly related to the motion information of the control points of the affine coding block.
[0154] Typically, motion information of the control points of an 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 the merge mode based on an affine transformation model, motion information of the control points of an affine coding block may be obtained according to an inherited control point motion vector prediction method or a constitutive control point motion vector prediction method. The following describes two methods in more detail.
[0155] (3) Inherited control point motion vector prediction method. In the inherited control point motion vector prediction method, candidate motion vectors for the control points of the current block are determined by using the affine transformation model of an adjacent coded affine coding block of the current block. The number of parameters in the affine transformation model of the affine coding block (e.g., 4 parameters, 6 parameters, or 8 parameters) is the same as that of the affine transformation model of the current block.
[0156] The current block shown in Figure 6 is used as an example. The adjacent blocks of the current block are traversed in a specific order, e.g., A1→B1→B0→A0→B2, to find the affine coding block in which the adjacent blocks of the current block are located and to obtain motion information of the control points of the affine coding block. Furthermore, the motion vector of the control points (in merge mode) or the motion vector predictor of the control points (in AMVP mode) is 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 combinations of orders are also applicable to embodiments of the present invention. Moreover, the adjacent blocks are not limited to A1, B1, B0, A0, and B0. The adjacent blocks may be samples, or they may be pre-set size pixel blocks obtained according to a specific division method, e.g., 4x4 pixel blocks, 4x2 pixel blocks, or pixel blocks of other sizes. This is not limited. An affine coding block is an encoded block that is adjacent to the current block and is predicted by using an affine transformation model in the coding phase (sometimes abbreviated as an adjacent affine coding block).
[0157] The following uses A1, shown in Figure 6, as an example to illustrate the process of determining candidate motion vectors for the control points of the current block. In other cases, estimation is performed by analogy.
[0158] If the affine coding block where A1 is located is a 4-parameter affine coding block (i.e., the affine coding block is predicted by using a 4-parameter affine transformation model), then the motion vector (vx4, vy4) of the upper left corner (x4, y4) of the affine coding block and the motion vector (vx5, vy5) of the upper right corner (x5, y5) of the affine coding block are obtained.
[0159] Next, the motion vector (vx0, vy0) of the upper left corner (x0, y0) of the current block is calculated according to the following equation (8):
number
[0160] The motion vector (vx1, vy1) of the current upper right corner (x1, y1) of the block is calculated according to the following equation (9):
number
[0161] The combination of the motion vector (vx0, vy0) of the upper left corner (x0, y0) and the motion vector (vx1, vy1) of the upper right corner (x1, y1) of the current block, obtained based on the affine coding block in which A1 is located, is a candidate motion vector for the control point of the current block.
[0162] If the coding block where 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), then the motion vector (vx4, vy4) of the upper left corner (x4, y4) of the affine coding block, the motion vector (vx5, vy5) of the upper right corner (x5, y5) of the affine coding block, and the motion vector (vx6, vy6) of the lower left corner (x6, y6) of the affine coding block are obtained.
[0163] Next, the motion vector (vx0, vy0) of the upper-left corner (x0, y0) of the current block is calculated according to the following equation (10):
number
[0164] The motion vector (vx1, vy1) of the current upper right corner (x1, y1) of the block is calculated according to the following equation (11):
number
[0165] The motion vector (vx2, vy2) of the current block's bottom-left corner (x2, y2) is calculated according to the following equation (12):
number
[0166] The combination of motion vectors (vx0,vy0) for the top-left corner (x0,y0), the top-right corner (x1,y1), and the bottom-left corner (x2,y2) of the current block, obtained based on the affine coding block in which A1 is located, represents the candidate motion vectors for the control points of the current block.
[0167] It should be noted that other motion models, candidate positions, and search and traverse sequences are also applicable to embodiments of the present invention. Details are not described in the embodiments of the present invention.
[0168] It should be noted that methods for representing the motion models of current and adjacent coding blocks by using other control points may also be applicable to embodiments of the present invention. Further details are not described herein.
[0169] (4) Constitutive control point motion vector prediction method. In the constitutive control point motion vector prediction method, the motion vectors of adjacent encoded blocks of the control points of the current block are combined as the motion vectors of the control points of the current affine-coded block, and it is not necessary to consider whether the adjacent encoded block is an affine-coded block. Constitutive control point motion vector prediction methods based on different prediction modes (AMVP mode based on the affine transformation model and merge mode based on the affine transformation model) are different and will be described separately below.
[0170] A method for predicting constitutive control point motion vectors based on AMVP modes derived from an affine transformation model is described first.
[0171] Figure 7 is used as an example to illustrate a constructive control point motion vector prediction method that determines the motion vectors of the upper-left and upper-right corners of the current block by using motion information of adjacent encoded 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 vectors of coded blocks A2, B2, or B3 adjacent to the upper left corner may be used as candidate motion vectors for the upper left corner of the current block. The motion vectors of coded blocks B1 or B0 adjacent to the upper right corner are used as candidate motion vectors for the upper right corner of the current block. The candidate motion vectors for the upper left and upper right corners are combined to form a plurality of 2-tuples. The motion vectors of the two coded blocks contained in the 2-tuple may be used as candidate control point motion vectors for the current block. The plurality of 2-tuples are shown below (13A): {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 This represents the motion vector of A2, and v B1 This represents the motion vector of B1, and v B0 This represents the motion vector of B0, and v B2 This represents the motion vector of B2, and v B3 This represents the motion vector of B3.
[0174] If the current block is a 6-parameter affine coding block (i.e., the current block is predicted by using a 6-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 upper left corner motion vector 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 upper right corner motion vector 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 lower left corner motion vector of the current block. The candidate motion vectors for the upper left, upper right, and lower left corners are combined to form a triplet. The motion vectors of the three coded blocks contained in the triplet may be used as candidate control point motion vectors for the current block. The triplets are shown below ((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 This represents the motion vector of A2, and v B1 This represents the motion vector of B1, and v B0 This represents the motion vector of B0, and v B2 This represents the motion vector of B2, and v B3 This represents the motion vector of B3, and v A0 This represents the motion vector of A0, and v A1 This represents the motion vector of A1.
[0176] It should be noted that Figure 7 is merely an example. It should also be noted that other methods for coupling control point motion vectors may be applicable to embodiments of the present invention. Further details are not described herein.
[0177] It should be noted that methods for representing the motion models of current and adjacent coding blocks by using other control points may also be applicable to embodiments of the present invention. Further details are not described herein.
[0178] The following describes a method for predicting constructive control point motion vectors based on merge modes derived from an affine transformation model.
[0179] Figure 8 is used as an example to illustrate a constructive control point motion vector prediction method that determines the motion vectors of the upper-left and upper-right corners of the current block by using motion information of adjacent encoded blocks of the current coding block. It should be noted that Figure 8 is only an example.
[0180] As shown in Figure 8, CPk(k=1,2,3,4) represents the k-th control point. A0, A1, A2, B0, B1, B2, and B3 are the spatially adjacent positions of the current block and are used to predict CP1, CP2, or CP3. T is the 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 verification order is B2 → A2 → B3. If B2 is available, the movement information for B2 is used. Otherwise, A2 and B3 are checked. If the movement information for all three positions is unavailable, the movement information for CP1 cannot be obtained.
[0182] 2. For CP2, the verification order is B0 → B1. If B0 is available, the motion information of B0 is used for CP2. Otherwise, B1 is verified. If motion information for both locations is unavailable, the motion information for CP2 cannot be obtained.
[0183] 3. Regarding CP3, the order of verification is A0 → A1.
[0184] 4. For CP4, T's movement information is used.
[0185] Here, X being available means that a block at position X (where X is A0, A1, A2, B0, B1, B2, B3, or T) has already been encoded and the interprediction mode is being used for that 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 are not described herein.
[0186] Next, the control point motion information of the current block is combined to obtain the constitutive control point motion information.
[0187] When a four-parameter affine transformation model is used for the current block, the motion information of the two control points of the current block is combined to form a 2-tuple in order to construct the four-parameter affine transformation model. The 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 using a 2-tuple containing control points CP1 and CP2 may be represented as Affine(CP1,CP2).
[0188] When a 6-parameter affine transformation model is used for the current block, the motion information of the three control points of the current block is combined to form a triplet in order to construct the 6-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 6-parameter affine transformation model constructed using a triplet containing control points CP1, CP2, and CP3 may 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 in order to construct the 8-parameter bilinear model. An 8-parameter bilinear model constructed using a quadruple containing control points CP1, CP2, CP3, and CP4 can be represented as Bilinear(CP1,CP2,CP3,CP4).
[0190] In this specification, for ease of description, a combination of motion information for two control points (or two encoded blocks) is abbreviated as a 2-tuple, a combination of motion information for three control points (or three encoded blocks) is abbreviated as a triplet, and a combination of motion information for four control points (or four encoded blocks) is abbreviated as a quadruple.
[0191] These models are traversed in a pre-set order. A model is considered unavailable if motion information for the control points corresponding to the combined model is unavailable. Otherwise, the model's reference frame index is determined, and the motion vectors of the control points are scaled. A model is invalid if all the motion information for the scaled control points matches. If all the motion information for the control points controlling the model is available, and the model is valid, the motion information for the control points used to calibrate the model is added to the motion information candidate list.
[0192] The method for scaling the control point motion vector is shown in equation (14):
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 vectors obtained through scaling, and MV represents the motion vector of the control point.
[0194] It should be noted that different combinations of control points may be alternatively converted to control points at the same location.
[0195] For example, the 4-parameter affine transformation model obtained through combinations {CP1, CP4}, {CP2, CP3}, {CP2, CP4}, {CP1, CP3}, or {CP3, CP4} is represented by {CP1, CP2} or {CP1, CP2, CP3}. The conversion method is to substitute the motion vector and coordinate information of the control points into the above formula (2) to obtain the model parameters, and then substitute the coordinate information of {CP1, CP2} into the above formula (3) to obtain the motion vector of the control points.
[0196] More directly, the conversion may be performed according to the following formulas (15) to (23), where W represents the width of the current block and H represents the height of the current block. In formulas (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} can be converted to {CP1, CP2, CP3} according to the following formula (15). That is, the motion vector of CP3 in {CP1, CP2, CP3} can be determined according to the following formula (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 formula (18) or (19):
Number
[0201] {CP2, CP4} can be converted to {CP1, CP2} according to the following formula (20), and {CP2, CP4} can be converted to {CP1, CP2, CP3} according to the following formulas (20) and (21):
Number
[0202] {CP3, CP4} can be converted to {CP1, CP2} according to the following formula (22), and {CP3, CP4} can be converted to {CP1, CP2, CP3} according to the following formulas (22) and (23):
Number
[0203] For example, a 6-parameter affine transformation model obtained through a combination {CP1, CP2, CP4}, {CP2, CP3, CP4}, or {CP1, CP3, CP4} is represented by control points {CP1, CP2, CP3}. The conversion method is to substitute the motion vectors and coordinate information of the control points into the above formula (4) to obtain the model parameters, and then substitute the coordinate information of {CP1, CP2, CP3} into the above formula (5) to obtain the motion vectors of the control points.
[0204] More directly, the conversion may be performed according to the following formulas (24) to (26), where W represents the width of the current block and H represents the height of the current block. In formulas (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 configured 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 pre-set order, and the obtained valid combination is used as the candidate motion information for the control point. If the candidate motion vector list is empty, the candidate motion information for 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 check if motion information identical to the candidate motion information for the control point exists in the candidate motion vector list. If motion information identical to the candidate motion information for the control point does not exist in the candidate motion vector list, the candidate motion information for the control point is added to the candidate motion vector list.
[0209] For example, the pre-set order is as follows: 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 a total of 10 possible combinations.
[0210] A combination is considered unavailable if the corresponding control point motion information is unavailable. If a combination is available, its reference frame index is determined (for two control points, the minimum reference frame index is selected as the reference frame index for the combination; for more than two control points, the most frequently occurring reference frame index is selected; and if multiple reference frame indices appear the same number of times, the minimum reference frame index is selected as the reference frame index for the combination), and the control point motion vector is scaled. If the motion information for all control points matches after scaling, the combination is invalid.
[0211] Optionally, in embodiments of the present invention, the candidate motion vector list may be padded. For example, if, after the traverse process described above, 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 its list length is equal to the maximum list length.
[0212] Padding may be performed by padding zero motion vectors, or by combining or weighting existing candidate motion information within an existing list. It should be noted that other methods for padding the candidate motion vector list may also be applicable to embodiments of the present invention. Details are not described herein.
[0213] In existing solutions, for the inherited control point motion vector prediction method, the non-parallel motion models used for the same image sequence are fixed, and the number of parameters of the affine transformation models used for different blocks in the image is the same. That is, the number of parameters of the affine transformation model used for the affine coding block is the same as that of the affine transformation model used for 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 within the affine coding block are the same as those of the control points of the current block.
[0214] For example, when a 4-parameter affine transformation model is used for the affine coding block, the 4-parameter affine transformation model is also used for the current block. The decoder side obtains the motion vector information of each sub-block of the current block based on the 4-parameter affine transformation model of the current block so as to reconstruct each sub-block.
[0215] As another example, when an 8-parameter bilinear model is used for the affine coding block, the 8-parameter bilinear model is also used for the current block. The decoder side obtains the motion vector information of each sub-block of the current block based on the 8-parameter bilinear model of the current block so as to reconstruct each sub-block.
[0216] Practice shows that the affine motions of different blocks in the image can be different (that is, the affine motion of the current block can be different from the affine motion of the affine coding block). Therefore, in the existing method where the current block is parsed (for example, a candidate motion vector list is established) and reconstructed based on an 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] To overcome 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 embodiments of the present invention. There are two improved solutions, namely the first improved solution and the second improved solution. The first improved solution may also be called the motion vector prediction method based on the first motion model, and the second improved solution may also be called the motion vector prediction method based on the second motion model. The two methods are described separately below.
[0218] (5) Motion vector prediction method based on a first motion model. In the motion vector prediction method based on a first motion model, the affine transformation model used for different blocks of images in an image sequence is not restricted; that is, different affine transformation models may be used for different blocks. The affine transformation model used for the current block is determined first during the encoding and decoding process of the current block. The affine transformation model used for the current block may be predefined, or it 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 adjacent blocks of the current block (also called the affine coding block on the encoder side or the affine decoding block on the decoder side), and a 2×K parameter affine transformation model is used for the current block, where N≠N. In this case, the motion vectors (candidate motion vectors) of the K control points of the current block are obtained through interpolation calculations based on the 2×N parameter affine transformation model used for the adjacent blocks.
[0219] The following uses A1, shown in Figure 10, as an example to illustrate the process of determining candidate motion vectors for the control points of the current block. The determination process is described primarily from the decoder's perspective. In this case, the adjacent block to which A1 is located is an affine-decoded block. It can be understood that the implementation on the encoder side can be inferred by analogy; that is, on the encoder side, the adjacent block to the current block is an affine-coding block. Further details regarding the implementation are again not described herein.
[0220] For example, if a 6-parameter affine transformation model is used for the affine decoding block where A1 is located, and a 4-parameter affine transformation model is used for the current block, then the motion vector (vx4,vy4) of the upper left corner (x4,y4) of the affine decoding block, the motion vector (vx5,vy5) of the upper right corner (x5,y5) of the affine decoding block, and the motion vector (vx6,vy6) of the lower left corner (x6,y6) of the affine decoding block are obtained. According to equations (27) and (28) below for the 6-parameter affine transformation model, the interpolation calculation is performed separately by using the 6-parameter affine transformation model, which is composed of the motion vectors of the three control points of the affine decoding block, to obtain the motion vector (vx0,vy0) of the upper left corner (x0,y0) of the current block and the motion vector (vx1,vy1) of the upper right corner (x1,y1) of the current block:
number
[0221] As another example, when a 4-parameter affine transformation model is used for the affine decoding block where A1 is located, and a 6-parameter affine transformation model is used for the current block, the motion vector (vx4,vy4) of the upper left corner (x4,y4) of the affine decoding block and the motion vector (vx5,vy5) of the upper right corner (x5,y5) of the affine decoding block are obtained. In this case, the motion vectors of the two control points of the affine decoding block are obtained, namely 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). According to equations (29), (30), and (31) for the 4-parameter affine transformation model, the interpolation calculation is performed separately by using a 4-parameter affine transformation model composed of the motion vectors of two control points of the affine-decoded block to obtain the motion vector (vx0, vy0) of the upper left corner (x0, y0) of the current block, the motion vector (vx1, vy1) of the upper right corner (x1, y1) of the current block, and the motion vector (vx2, vy2) of the lower left corner (x2, y2) of the current block:
number
[0222] It should be noted that the above examples are used merely to illustrate the technical solutions of the present invention and are not intended to limit the invention. Furthermore, for cases where other affine transformation models are used for the current block and adjacent 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 adjacent blocks, or a 6-parameter affine transformation model is used for the current block and an 8-parameter bilinear model is used for the adjacent blocks), please refer to the implementation of the above examples. Further details are not provided here.
[0223] It should be further noted that this solution does not require the current block to have the same number of model parameters as the adjacent block. Therefore, in some implementation scenarios, the number of model parameters in the current block may also be the same as that of the adjacent block.
[0224] For example, if a four-parameter affine transformation model is used for the affine decoding block where A1 is located, and the four-parameter affine transformation model is also used for the current block, then the motion vector (vx4,vy4) of the upper-left corner (x4,y4) and the motion vector (vx5,vy5) of the upper-right corner (x5,y5) of the affine decoding block are obtained. According to equations (32) and (33) below for the four-parameter affine transformation model, the interpolation calculation is performed separately by using the four-parameter affine transformation model, which is composed of the motion vectors of the two control points of the affine decoding block, to obtain the motion vector (vx0,vy0) of the upper-left corner (x0,y0) of the current block and the motion vector (vx1,vy1) of the upper-right corner (x1,y1) of the current block:
number
[0225] As another example, when a 6-parameter affine transformation model is used on the affine decoding block where A1 is located, and the 6-parameter affine transformation model is used on the current block, the motion vector (vx4,vy4) of the upper left corner (x4,y4) of the affine decoding block, the motion vector (vx5,vy5) of the upper right corner (x5,y5) of the affine decoding block, and the motion vector (vx6,vy6) of the lower left corner (x6,y6) of the affine decoding block are obtained. For a 6-parameter affine transformation model, the interpolation calculation is performed separately by using a 6-parameter affine transformation model composed of three control points of the affine-decoded block to obtain the motion vector (vx0,vy0) of the upper-left corner (x0,y0) of the current block, the motion vector (vx1,vy1) of the upper-right corner (x1,y1) of the current block, and the motion vector (vx2,vy2) of the lower-left corner (x2,y2) of the current block:
number
[0226] It should be noted that the above examples are used solely to illustrate the technical solutions of the present invention and are not intended to limit the invention. Furthermore, for cases where other affine transformation models are used for the current block and adjacent blocks (for example, an 8-parameter bilinear model is used for both the current block and adjacent blocks), please refer to the implementation of the above examples. Details are again not described 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 list of candidate motion vectors), the affine transformation models of adjacent blocks may be used to construct the affine transformation model of the current 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. Thus, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0228] (6) 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 images 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 adjacent blocks of the current block (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, N may be equal to or equal to N. In the parse phase (e.g., the phase of constructing a candidate motion vector list), the control points of the current block (e.g., two, three, or four control points) may be obtained according to the inheritance control point motion vector prediction method described in "(3)" or the motion vector prediction method based on a first motion model described in "(5)". Then, in the phase of reconstructing the current block, the 6 parameter affine transformation model is uniformly used to obtain motion vector information for each subblock of the current block based on the control points of the current block, so as to reconstruct each subblock.
[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). In other cases, estimation is performed by analogy.
[0230] For example, a four-parameter affine transformation model may be used for the current block in the parse phase, and a four-parameter affine transformation model or another parameter affine transformation model may be used for adjacent blocks. Thus, the motion vectors of two control points of the current block, for example, the motion vector (vx0,vy0) of the upper-left control point (x0,y0) of the current block and the motion vector (vx1,vy1) of the upper-right control point (x1,y1) of the current block may be obtained according to the inheritance 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] Next, the 6-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 equation for the 6-parameter affine transformation model is given by equation (37):
number
[0234] Next, the coordinates (x) of the center point of each subblock (or each motion compensation unit) of the current block relative to the upper left corner (or other reference point) of the current block. (i,j) ,y (i,j) The above equation (37) is substituted to obtain motion information of the center point of each subblock (or each motion compensation unit) so that each subblock is subsequently reconstructed.
[0235] It should be noted that the above examples are used solely to illustrate the technical solutions of the present invention and are not intended to limit the invention. Furthermore, for cases where other affine transformation models (e.g., a 6-parameter affine transformation model or an 8-parameter bilinear model) are used in the current block during the purse phase, please refer to the implementation of the above examples. Details are again not described here.
[0236] In the motion vector prediction method based on the second motion model of the present invention, a six-parameter affine transformation model can be uniformly used to predict the current block during the phase of reconstructing the current block. The more parameters in the motion model that describe 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 can describe 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 when predicting the current block and satisfy user requirements.
[0237] In some embodiments of the present invention, it may be understood that both the first improved solution and the second improved solution may be used interchangeably for implementation.
[0238] For example, if a 4-parameter affine transformation model is used for the current block in the purse phase and a 6-parameter affine transformation model is used for the adjacent block, the motion vectors of the 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 transformed into a 6-parameter affine transformation model in the reconstruction phase, so as to subsequently reconstruct each subblock of the current block.
[0239] As another example, when a 6-parameter affine transformation model is used for the current block in the purse phase and a 4-parameter affine transformation model is used for the adjacent 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 6-parameter affine transformation model in the reconstruction phase so that each subblock of the current block is subsequently reconstructed.
[0240] Indeed, a solution in which both the first and second improved solutions are used for implementation may be implemented as an alternative embodiment. Further details are not provided herein.
[0241] Based on the above description, the following further explains the AMVP mode and the Merge mode based on the affine transformation model in embodiments of the present invention.
[0242] The AMVP mode, based on the affine transformation model, is described first.
[0243] For AMVP modes based on affine transformation models, in some embodiments, the AMVP-based candidate motion vector list (or control point motion vector predictor candidate list) may also be constructed by using a motion vector prediction method and / or a constitutive control point motion vector prediction method based on a first motion model. In other embodiments, the AMVP mode-based candidate motion vector list (or control point motion vector predictor candidate list) may also be constructed by using an inheritance-based control point motion vector prediction method and / or a constitutive control point motion vector prediction method. A control point motion vector predictor in the list may contain two candidate control point motion vectors (e.g., when a 4-parameter affine transformation model is used for the current block), or three candidate control point motion vectors (e.g., when a 6-parameter affine transformation model is used for the current block), or four candidate control point motion vectors (e.g., when an 8-parameter bilinear model is used for the current block).
[0244] In possible application scenarios, the list of control point motion vector predictor candidates may be further pruned and sorted according to specific rules, and may be truncated or padded to obtain a specific number of control point motion vector predictor candidates.
[0245] Next, on the encoder side, the encoder (e.g., video encoder 100) obtains the motion vector for each motion compensation subunit of the current coding block by using each control point motion vector predictor in the list of control point motion vector predictor candidates and according to equations (3), (5), or (7) above. Furthermore, the encoder obtains the pixel value of the corresponding position in the reference frame pointed to by the motion vector of each motion compensation subunit, and uses that pixel value as the pixel predictor for the motion compensation subunit to perform motion compensation based on the 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 is used as the motion vector predictor for two, three, or four control points in the current coding block. Furthermore, on the encoder side, the control point motion vector predictor may be further used as a search starting point to perform a motion search within a specific search range to obtain control point motion vectors (CPMVs), and the difference between the control point motion vectors and the control point motion vector predictor (control point motion vector differences, CPMVD) is calculated. The encoder then encodes the index value indicating the position of the control point motion vector predictor in the list of candidate control point motion vector predictors, along with 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 index values and control point motion vector differences (CPMVD), determines a control point motion vector predictor from the candidate list based on the index values, and adds CPMVP and CPMD to obtain the control point motion vector.
[0247] The following describes merge modes based on the affine transformation model.
[0248] With respect to merge modes based on affine transformation models, in some embodiments, a list of candidate motion vectors for the merge mode (or referred to as the control point motion vector merge candidate list) may be constructed by using an inheritance-based control point motion vector prediction method and / or a constitutive-based control point motion vector prediction method. In other embodiments, a list of candidate motion vectors for the merge mode (or referred to as the control point motion vector merge candidate list) may alternatively be constructed by using a motion vector prediction method and / or a constitutive-based control point motion vector prediction method based on a first motion model.
[0249] In possible application scenarios, the list of control point motion vector merge candidates may be further pruned and sorted according to specific rules, and may be truncated or padded to obtain a specific number of control point motion vector candidates.
[0250] Next, on the encoder side, the encoder (e.g., video encoder 100) obtains the motion vector of each motion compensation subunit (a sample or pixel block of size M×N, obtained by partitioning 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 equations (3), (5), or (7) above. Furthermore, the encoder obtains the pixel value of the position in the reference frame pointed to by the motion vector of each motion compensation subunit and performs affine motion compensation using that pixel value as the pixel predictor of the motion compensation subunit. The average difference between the original value and the predictor of each sample in the current coding block is calculated. The control point motion vectors corresponding to the minimum average difference are selected as the motion vectors for two, three, or four control points in the current coding block. Index values indicating the positions of the control point motion vectors in the candidate list are encoded into a bitstream and sent to the decoder side.
[0251] On the decoder side, the decoder (e.g., video decoder 200) parses the bitstream to obtain 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] In addition, it should be noted that in embodiments of the present invention, “at least one” means one or more, and “multiple ~” means two or more. The terms “and / or” indicate an association relationship that describes related objects, and indicate that three relationships may exist. For example, A and / or B may indicate that only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The letter “ / ” generally indicates a “logical OR” relationship between related objects. “At least one of the following items (elements)” or similar expressions indicate any combination of those items, including a single item (element) or any combination of multiple items (elements). 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] Refer to Figure 9. Based on a design solution for a motion vector prediction method based on a first motion model, embodiments of the present invention provide a motion vector prediction method. The method may be performed by a video decoder 200, and more specifically, by an interpreter 210 of the video decoder 200. The video decoder 200 may perform some or all of the following steps to predict the motion information of each subblock of the current decoding block (hereinafter referred to as the current block) of the current video frame, based on a video data stream having multiple video frames, and to 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 interprediction mode of the current decoded block.
[0255] Specifically, the video decoder 200 on the decoder side may acquire instruction information used to indicate the interprediction mode and parse the syntax elements in the bitstream transmitted from the encoder side in order to determine the interprediction mode of the current block based on the instruction information.
[0256] If it is determined that the interprediction mode of the current block is the AMVP mode based on the affine transformation model, then steps 602a to 606a are subsequently performed.
[0257] If it is determined that the interprediction mode of the current block is a merge mode based on an affine transformation model, then steps 602b through 605b are subsequently performed.
[0258] Step 602a: Construct a list of candidate motion vectors for AMVP modes based on the affine transformation model.
[0259] In some specific embodiments of the present invention, candidate motion vectors of the control points of the current block are obtained by using a motion vector prediction method based on a first motion model and may be added to a list of candidate motion vectors corresponding to the AMVP mode.
[0260] In some other specific embodiments of the present invention, candidate motion vectors of the control points of the current block may be obtained separately by using a motion vector prediction method based on a first motion model and a constructive control point motion vector prediction method, and added to a list of candidate motion vectors 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 the AMVP mode may be a list of 2-tuples. The list of 2-tuples contains one or more 2-tuples used to construct the four-parameter affine transformation model.
[0262] When a 6-parameter affine transformation model is used for the current block, the candidate motion vector list for AMVP modes may be a triplet list. The triplet list contains one or more triplets used to construct the 6-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 quadruple list. The quadruple list contains one or more quadruples 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 specific rules and truncated or padded to obtain a specific number of candidate motion vector candidates.
[0265] Regarding the motion vector prediction method based on the first motion model, for example, as shown in Figure 10, the adjacent blocks of the current block may be traversed in the order A1→B1→B0→A0→B2 in Figure 10 to find the affine decoding block in which the adjacent block is located (e.g., the affine decoding block in which A1 is located in Figure 10). The affine transformation model of the affine decoding block is constructed by using the control points of the affine decoding block, and then candidate motion vectors of the control points of the current block (e.g., candidate motion vector 2-tuple / triplet / quadruple) are derived by using the affine transformation model of the affine decoding block and added to the 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 are not described herein.
[0266] It should be noted that, when multiple adjacent blocks exist, i.e., when the current block has multiple adjacent affine decoding blocks, in possible embodiments, both the encoder and decoder can first obtain candidate motion vectors for the control points of the current block by using an affine decoding block with the same number of model parameters as the current block, and add the obtained candidate motion vectors to a list of candidate motion vectors corresponding to the AMVP mode. Subsequently, candidate motion vectors for the control points of the current block may be obtained by using an affine decoding block with a different number of model parameters than the current block, and added to a list of candidate motion vectors corresponding to the AMVP mode. In this way, candidate motion vectors for the control points of the current block obtained by using an affine decoding block with the same number of model parameters as 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 4-parameter affine transformation model. After traversing the adjacent blocks of the current block, it is determined that the 4-parameter affine transformation model is used for the affine decoding block where B1 is located, and the 6-parameter affine transformation model is used for the affine decoding block where A1 is located. In this case, the motion vectors of the two control points of the current block can first be derived using the affine decoding block where B1 is located and added to the list. Then, the motion vectors of the two control points of the current block can be derived using the affine decoding block where A1 is located and added to the list.
[0268] Alternatively, it is assumed that the parameter model of the current decoding block is a 6-parameter affine transformation model. After traversing the adjacent blocks of the current block, it is determined that the 6-parameter affine transformation model is used for the affine decoding block where A1 is located, and the 4-parameter affine transformation model is used for the affine decoding block where B1 is located. In this case, the motion vectors of the three control points of the current block can first be derived using the affine decoding block where A1 is located and added to the list. Then, the motion vectors of the three control points of the current block can be derived using the affine decoding block where B1 is located and added to the list.
[0269] It should be noted that the technical solutions of the present invention are not limited to the examples described above, and other adjacent blocks, motion models, and search sequences may also be applicable to the present invention. Further details are not described herein.
[0270] In step 602a, the affine transformation model used for different blocks is not limited. That is, the number of parameters in the affine transformation model used for the current block may be different from or the same as that of the affine decoding block. In an embodiment, the affine transformation model used for the current block may be determined by parsing the bitstream, in which case the bitstream contains information indicating the affine transformation model for the current block. In an embodiment, the affine transformation model used for the current block may be pre-configured. In an embodiment, the affine transformation model used for the current block may be selected from a plurality of affine transformation models based on the actual operating state or actual requirements of the current block.
[0271] Some aspects of obtaining candidate motion vectors for the control points of the current block by using a constructive control point motion vector prediction method are described in detail in "(4)" above. For the sake of brevity in this specification, the details are not described again here.
[0272] Some aspects of obtaining candidate motion vectors for the 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. For the sake of brevity in this specification, the details are not described again here.
[0273] It should be noted that in some embodiments where a motion vector prediction method based on a first motion model is used, the decoder may need to obtain flag information (flag) of the affine transformation model of the affine decoded block in the process of deriving candidate motion vectors for the control points of the current block. The flag is stored locally in advance on the decoder side and is used to indicate the affine transformation model of the affine decoded block that is actually used to predict the subblocks of the affine decoded block.
[0274] For example, in an application scenario, if the decoder determines, by identifying the flag of an affine decoded block, that the number of model parameters in the affine transformation model actually used for the affine decoded block is different from (or the same as) that of the affine transformation model used for the current block, the decoder 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, if a 4-parameter affine transformation model is used for the current block, and the decoder identifies the flag of the affine decoded block, and if 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, then the decoder determines that a 6-parameter affine transformation model is used for the affine decoded block, and obtains the motion vectors of the three control points of the affine decoded block, namely the motion vector of the upper left corner (x4, y4) (vx4, vy4), the motion vector of the upper right corner (x5, y5) (vx5, vy5), and the motion vector of the lower left corner (x6, y6) (vx6, vy6). Based on the 6-parameter affine transformation model composed of 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 6-parameter affine transformation model, respectively.
[0276] As another example, when a four-parameter affine transformation model is used for the current block, the decoder 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 the decoder determines that a four-parameter affine transformation model is also used for the affine decoded block, then the decoder obtains the motion vectors of the two control points of the affine decoded block, namely, 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 from 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 the first motion model is used, the affine transformation model flag of the affine-decoded block may not be required in the process by which the decoder derives candidate motion vectors for the control points of the current block.
[0278] For example, in an application scenario, after the decoder determines the affine transformation model used for the current block, the decoder obtains a specific number of control points from the affine decoded block (a specific number that is the same as or different from the number of control points of the current block), constructs an affine transformation model using that specific number of control points from the affine decoded block, and then derives candidate motion vectors for the control points of the current block using the affine transformation model.
[0279] For example, when a 4-parameter affine transformation model is used for the current block, the decoder does not determine the affine transformation model actually used for the affine decoding block (which may be a 4-parameter affine transformation model, a 6-parameter affine transformation model, or an 8-parameter bilinear model), but directly obtains the motion vectors of the two control points of the affine decoding block, namely 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 4-parameter affine transformation model constructed from the two control points of the affine decoding 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 4-parameter affine transformation model, respectively.
[0280] It should be noted that the technical solutions of the present invention are not limited to the examples described above, and other control points, motion models, candidate positions, and search sequences may also be applicable to the present invention. Further details are not described herein.
[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 for the control point is determined based on the index values within the candidate motion vector list constructed in step 602a.
[0283] For example, if a 4-parameter affine motion model is used for the current block, the index values are obtained by parsing, and the optimal motion vector predictor for the two control points is determined from a list of candidate motion vector 2-tuples based on the index values.
[0284] As another example, when a 6-parameter affine motion model is used for the current block, the index values are obtained by parsing, and the best motion vector predictors for the three control points are determined from a list of candidate motion vector triplets 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 best motion vector predictors for the four control points are determined from a quadruple list of candidate motion vectors 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 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 for the control points determined in step 603a.
[0288] For example, when a four-parameter affine motion model is used for the current block, the motion vector difference between two control points of the current block is obtained by decoding the bitstream. For instance, the motion vector difference between the top-left control point and the motion vector difference between the top-right control point can be obtained by decoding the bitstream. Then, the motion vector difference and motion vector predictor for each control point are added together 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 6-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 differences of the top-left control point, the top-right control point, and the bottom-left control point can be obtained by decoding the bitstream. Then, the motion vector differences and motion vector predictors of each control point are added together 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. Further details are not described herein.
[0291] Step 605a: Obtain the motion vectors of each subblock of the current block based on the affine transformation model used in the current block.
[0292] For each M×N subblock in the current P×Q block (where one subblock may be equivalent to one motion compensation unit, and at least one of the widths or heights of the M×N subblocks is smaller than the width or height of the current block), the motion information of a sample at a pre-set position in the motion compensation unit may be used to represent the motion information of all samples in the motion compensation unit. If the motion compensation unit size is M×N, the sample at the pre-set 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 any other position in the motion compensation unit.
[0293] The following uses the center point of the motion compensation unit as an example for illustrative purposes. Please refer to Figures 11A and 11B.
[0294] Figure 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 configuration, and the gray dots in each motion compensation unit represent the center point of the motion compensation unit. In Figure 11A, V0 represents the motion vector of the top-left control point of the current block, V1 represents the motion vector of the top-right control point of the current block, and V2 represents the motion vector of the bottom-left control point of the current block.
[0295] Figure 11B shows examples of other current blocks and motion compensation units for the current block. Each small box in the figure represents one motion compensation unit. In the figure, each motion compensation unit has an 8x8 configuration, and the gray dots in each motion compensation unit represent the center point of the motion compensation unit. In Figure 11B, V0 represents the motion vector of the top-left control point of the current block, V1 represents the motion vector of the top-right control point of the current block, and V2 represents the motion vector of the bottom-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 can be calculated according to equation (38):
number
[0297] In the above formula, i is the i-th motion compensation unit in the horizontal direction (from left to right), j is the j-th motion compensation unit in the vertical direction (from top to bottom), and (x (i,j) ,y (i,j) ) 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 decoding block.
[0298] When a 6-parameter affine motion model is used in the current affine decoding block, (x (i,j) ,y (i,j)) is substituted into the following equation (37) for the 6-parameter affine motion model to obtain the motion vector of the center point of each motion compensation unit, and the obtained motion vector is used as the motion vector (vx (i,j) , vy (i,j) ) of all samples in the motion compensation unit:
Equation
[0299] When the 4-parameter affine motion model is used for the current affine decoding block, (x (i,j) , y (i,j) ) is substituted into the following equation (39) for the 4-parameter affine motion model to obtain the motion vector of the center point of each motion compensation unit, and the obtained motion vector is used as the motion vector (vx (i,j) , vy (i,j) ) of all samples in the motion compensation unit:
Equation
[0300] Step 606a: For each sub-block, perform motion compensation based on the determined motion vector of the sub-block to obtain the pixel predictor of the sub-block.
[0301] Step 602b: Configure a candidate motion vector list for the merge mode based on the affine transformation model.
[0302] In some specific embodiments of the present invention, the candidate motion vector of the control point of the current block is alternatively obtained by using a motion vector prediction method based on the first motion model and may be added to the candidate motion vector list corresponding to the merge mode.
[0303] In some other specific embodiments of the present invention, candidate motion vectors of the control points of the current block may be obtained separately by using a motion vector prediction method based on a first motion model and a constructive control point motion vector prediction method, and added to a list of candidate motion vectors corresponding to the merge mode.
[0304] Similarly, for candidate motion vector lists corresponding to merge modes, the candidate motion vector list may be a list of 2-tuples when a 4-parameter affine transformation model is used for the current block. The list of 2-tuples contains one or more 2-tuples used to construct the 4-parameter affine transformation model.
[0305] When a 6-parameter affine transformation model is used for the current block, the candidate motion vector list may be a triplet list. The triplet list contains one or more triplets used to construct the 6-parameter affine transformation model.
[0306] When an 8-parameter bilinear model is used for the current block, the candidate motion vector list may be a quadruple list. The quadruple list contains one or more quadruples used to construct the 8-parameter bilinear model.
[0307] In possible application scenarios, the candidate motion vector 2-tuple / triplet / quadruple list may be pruned and sorted according to specific rules and truncated or padded to obtain a specific number of candidate motion vector candidates.
[0308] Similarly, for a motion vector prediction method based on the first motion model, for example, as shown in Figure 10, the adjacent blocks of the current block may be traversed in the order A1→B1→B0→A0→B2 in Figure 10 to find the affine decoding block in which the adjacent block is located. The affine transformation model of the affine decoding block is constructed by using the control points of the affine decoding block, and then candidate motion vectors of the control points of the current block (e.g., candidate motion vector 2-tuple / triplet / quadruple) are derived by using the affine transformation model of the affine decoding 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 are not described herein.
[0309] Specifically, in the traverse process described above, if the candidate motion vector list is empty, the candidate motion information for the control point is added to the candidate list. Otherwise, the motion information within the candidate motion vector list is traversed sequentially to check if motion information identical to the candidate motion information for the control point exists in the candidate motion vector list. If motion information identical to the candidate motion information for the control point does not exist in the candidate motion vector list, the candidate motion information for the control point is added to the candidate motion vector list.
[0310] To determine whether two candidate motion data sets are identical, 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 are the same for both sets of data sets. Two sets of data sets are considered different only if all of their elements are different.
[0311] The candidate list construction is completed when the number of motion information points in the candidate motion vector list reaches the maximum list length; otherwise, the next adjacent block is traversed.
[0312] Some aspects of obtaining candidate motion vectors for the control points of the current block by using a constructive control point motion vector prediction method are described in detail in "(4)" above. For the sake of brevity in this specification, the details are not described again here.
[0313] Some aspects of obtaining candidate motion vectors for the 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. For the sake of brevity in this specification, the details are not described again here.
[0314] In some embodiments in which a motion vector prediction method based on a first motion model is used, it should be noted that in the 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 the image; that is, affine transformation models with the same number of parameters may be used for different blocks.
[0315] For example, a 6-parameter affine transformation model is used for all blocks in the image. A1 in Figure 10 is used as an example. The motion vectors of the three control points of the affine decoding block where A1 is located are obtained: 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 6-parameter affine transformation model constructed from the three control points of adjacent affine decoding blocks, the motion vectors of the upper-left, upper-right, and lower-left control points of the current block are derived according to equations (34), (35), and (36), respectively.
[0316] It should be noted that the technical solutions of the present invention are not limited to the examples described above, and other control points, motion models, candidate positions, and search sequences may also be applicable to the present invention. Further details are not described herein.
[0317] Step 603b: Determine the motion vector of the control point based on the index value.
[0318] Specifically, the index values of the candidate motion vector list are obtained by parsing the bitstream, and the actual motion vectors of the control points are determined based on the index values within the candidate motion vector list constructed in step 602b.
[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 from a list of candidate motion vector 2-tuples based on the index values.
[0320] As another example, when a 6-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 from a list of candidate motion vector triplets 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 from a quadruple list of candidate motion vectors based on the index values.
[0322] Step 604b: Obtain the motion vectors for each subblock of the current block based on the affine transformation model used for the current block. For a detailed implementation of this step, see the description in Step 605a. For the sake of brevity in this specification, the details are not described again here.
[0323] Step 605b: For each subblock, perform motion compensation based on the corresponding motion vector to obtain the pixel predictor for the subblock.
[0324] In this embodiment of the present invention, it is found that the decoder side uses a motion vector prediction method based on a first motion model in the process of predicting the current block. Thus, the affine transformation models of adjacent blocks may be used to construct the affine transformation model of the current block in the phase of parsing the current block (for example, in the phase of constructing a candidate motion vector list for AMVP mode or merge mode). The affine transformation models of the two blocks may 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 when predicting the current block and satisfy user requirements.
[0325] Refer to Figure 12. Based on the design solution of a motion vector prediction method based on a second motion model, embodiments of the present invention provide other motion vector prediction methods. The method may be performed by a video decoder 200, and more specifically, by an interpreter 210 of the video decoder 200. The video decoder 200 may perform some or all of the following steps to predict the motion information of each subblock of the current decoding block (hereinafter referred to as the current block) of the current video frame based on a video data stream having multiple video frames, and to 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 interprediction mode of the current decoded block.
[0327] Specifically, the video decoder 200 on the decoder side may acquire instruction information used to indicate the interprediction mode and parse the syntax elements in the bitstream transmitted from the encoder side in order to determine the interprediction mode of the current block based on the instruction information.
[0328] If it is determined that the interprediction mode of the current block is the AMVP mode based on the affine transformation model, then steps 702a to 706a are subsequently performed.
[0329] If it is determined that the interprediction mode of the current block is a merge mode based on an affine transformation model, then steps 702b through 705b are subsequently performed.
[0330] Step 702a: Construct a list of candidate motion vectors for AMVP modes based on the affine transformation model.
[0331] In this embodiment of the present invention, the affine transformation model used for different blocks of images within an image sequence is not limited; that is, different affine transformation models may be used for different blocks.
[0332] In a specific embodiment, candidate motion vectors for the control points of the current block may be obtained by using an inherited control point motion vector prediction method and added to a list of candidate motion vectors corresponding to the AMVP mode.
[0333] In a specific embodiment, candidate motion vectors for 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 list of candidate motion vectors corresponding to the AMVP mode.
[0334] In a specific embodiment, candidate motion vectors for the control points of the current block may be obtained by using a constructive control point motion vector prediction method and added to a list of candidate motion vectors corresponding to the AMVP mode.
[0335] In some other specific embodiments, candidate motion vectors for the control points of the current block may be obtained separately by using any two of the following methods: inheritance-based control point motion vector prediction method, motion vector prediction method based on a second motion model, or constitutive-based control point motion vector prediction method, and added to a list of candidate motion vectors corresponding to the AMVP mode.
[0336] In some other specific embodiments, candidate motion vectors for the control points of the current block may be obtained separately by using inheritance-based control point motion vector prediction methods, motion vector prediction methods based on a second motion model, and constitutive-based control point motion vector prediction methods, and added to a list of candidate motion vectors corresponding to the AMVP mode.
[0337] Some aspects of obtaining candidate motion vectors for the control points of the current block by using an inherited control point motion vector prediction method are described in detail in "(3)" above. For the sake of brevity in this specification, the details are not described again here.
[0338] Some aspects of obtaining candidate motion vectors for the control points of the current block by using a constructive control point motion vector prediction method are described in detail in "(4)" above. For the sake of brevity in this specification, the details are not described again here.
[0339] Some aspects of obtaining candidate motion vectors for the control points of the current block by using a motion vector prediction method based on a 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, further details are not described here.
[0340] For example, when a four-parameter affine transformation model is used in the current block, the candidate motion vector list for the AMVP mode may be a list of 2-tuples. The list of 2-tuples contains one or more 2-tuples used to construct the four-parameter affine transformation model.
[0341] When a 6-parameter affine transformation model is used for the current block, the candidate motion vector list for AMVP modes may be a triplet list. The triplet list contains one or more triplets used to construct the 6-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 quadruple list. The quadruple list contains one or more quadruples 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 specific rules, and may be truncated or padded to obtain a specific number of candidate motion vector candidates.
[0344] Step 703a: Determine the optimal motion vector predictor for the control point based on the index value. For specific details, please refer to the relevant description of Step 603a in the embodiment shown in Figure 9. Further details are not provided 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 point is obtained based on the motion vector difference of the control points and the optimal motion vector predictor for the control point 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 in step 702a is a 2-tuple list, the index value is obtained by parsing in step 703a, and the motion vector predictor (MVP) for two control points (i.e., 2-tuples) is determined in the candidate motion vector list based on the index value. The motion vector difference (MVD) of two control points in the current block is obtained by parsing the bitstream in step 704a. Then, the motion vectors (MV) of the two control points are obtained based on the MVP and MVD of the two control points, respectively. 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, the 4-parameter affine transformation model is constructed based on the motion vectors of the two control points in the current block. The motion vector of a third control point is obtained according to equation (40) above for the 4-parameter affine transformation model. The motion vector of the third control point is, for example, the motion vector (vx2, vy2) of the current block's lower left corner (x2, y2). In this way, the motion vectors of the current block's upper left, upper right, and lower left control points are determined.
[0348] As another example, if the candidate motion vector list configured by the decoder in step 702a is a triplet list, the index value is obtained by parsing in step 703a, and the motion vector predictors (MVPs) for the three control points (i.e., triplets) are determined in the candidate motion vector list based on the index value. The motion vector difference (MVD) for the three control points of the current block is obtained by parsing the bitstream in step 704a. Then, the motion vectors (MV) for the three control points are obtained based on the MVP and MVD of the three control points, respectively. The motion vectors for the three control points are, for example, the motion vector (vx0,vy0) for the top-left control point (x0,y0) of the current block, the motion vector (vx1,vy1) for the top-right control point (x1,y1) of the current block, and the motion vector (vx2,vy2) for the bottom-left control point (x2,y2) of the current block.
[0349] In this way, the motion vectors of the top-left, top-right, and bottom-left control points of the current block are determined.
[0350] As another example, if the candidate motion vector list configured by the decoder in step 702a is a quadruple list, the 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. The decoder then only needs to use the motion vectors of the top-left, top-right, and bottom-left control points of the current block.
[0351] It should be noted that the technical solutions of the present invention are not limited to the examples described above, and other control points and motion models may also be applicable to the present invention. Further details are not described herein.
[0352] Step 705a: Obtain the motion vector for each subblock based on the three control points of the current block and by using a 6-parameter affine transformation model.
[0353] Specifically, the motion vectors of the three control points of the current block are determined in step 704a. Thus, the 6-parameter affine transformation model may be constructed based on the motion vectors of the three control points of the current block, and the motion vectors of each subblock are obtained by using the 6-parameter affine transformation model.
[0354] For example, the motion vectors of 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 6-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 6-parameter affine transformation model is shown in Formula (37).
[0355] Next, the coordinates (x (i,j) , y (i,j) ) of the samples at the previously set positions in each sub-block (or each motion compensation unit) of the current block with respect to the upper left corner (or other reference point) of the current block are substituted into the above Formula (37) to obtain the motion vector of each sub-block. The samples at the previously set positions may be the center points of each sub-block (or each motion compensation unit). The coordinates (x (i,j) , y (i,j) ) of the center points of each sub-block (or each motion compensation unit) with respect to the upper left pixel of the current block may be calculated according to the above Formula (38). For specific details, refer to the relevant descriptions in the embodiments of FIG. 11A and FIG. 11B. Details are not described again here.
[0356] Step 706a: For each sub-block, perform motion compensation based on the corresponding motion vector to obtain the pixel predictor of the sub-block.
[0357] Step 702b: Construct a candidate motion vector list for the merge mode based on the affine transformation model.
[0358] Similarly, in this embodiment of the present invention, 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.
[0359] In a specific embodiment, candidate motion vectors for the control points of the current block may be obtained by using an inherited control point motion vector prediction method and added to a list of candidate motion vectors corresponding to the merge mode.
[0360] In a specific embodiment, candidate motion vectors for 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 list of candidate motion vectors corresponding to the merge mode.
[0361] In a specific embodiment, candidate motion vectors for the control points of the current block may be obtained by using a constructive control point motion vector prediction method and added to a list of candidate motion vectors corresponding to the merge mode.
[0362] In some other specific embodiments, candidate motion vectors for the control points of the current block may be obtained separately by using any two of the following methods: inheritance-based control point motion vector prediction method, motion vector prediction method based on a second motion model, or constitutive-based control point motion vector prediction method, and added to a candidate motion vector list corresponding to the merge mode.
[0363] In some other specific embodiments, candidate motion vectors for the control points of the current block may be obtained separately by using an inheritance-based control point motion vector prediction method, a motion vector prediction method based on a second motion model, and a constitutive-based control point motion vector prediction method, and added to a candidate motion vector list corresponding to the merge mode.
[0364] Some aspects of obtaining candidate motion vectors for the control points of the current block by using an inherited control point motion vector prediction method are described in detail in "(3)" above. For the sake of brevity in this specification, the details are not described again here.
[0365] Some aspects of obtaining candidate motion vectors for the control points of the current block by using a constructive control point motion vector prediction method are described in detail in "(4)" above. For the sake of brevity in this specification, the details are not described again here.
[0366] Some aspects of obtaining candidate motion vectors for the control points of the current block by using a motion vector prediction method based on a 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, further details are not described 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 may be a list of candidate motion vector 2-tuples / triplets / quadruples. Furthermore, the list of candidate motion vector 2-tuples / triplets / quadruples may be further pruned and sorted according to certain rules and truncated or padded to obtain a certain number of candidate motion vector candidates.
[0368] It should be noted that in some other embodiments, in the case of a merge mode based on an affine transformation model, the affine transformation models, such as the 4-parameter affine transformation model, the 6-parameter affine transformation model, and the 8-parameter bilinear model, do not necessarily have to be distinguished for different blocks in the image; that is, 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 from the candidate motion vector list configured in step 702b based on the index value. For a specific implementation of this step, please refer to the relevant description in step 603b in the embodiment of Figure 9. Further details are not described here again.
[0370] Step 704b: Determine the motion vectors of the three control points of the current block based on the acquired motion vectors of the control points.
[0371] For example, in step 703b, the decoder obtains the motion vectors of two control points (i.e., a 2-tuple). 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. The 4-parameter affine transformation model is then constructed based on the motion vectors of the two control points of the current block. The motion vector of a third control point is obtained according to equation (31) above for the 4-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, top-right, and bottom-left control points of the current block are determined.
[0372] As another example, in step 703b, the decoder obtains the motion vectors of three control points (i.e., triplets). 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, top-right, and bottom-left control points of the current block are determined.
[0373] As another example, the decoder obtains the motion vectors of four control points (i.e., a quadruple) in step 703b. 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. The decoder may then use only the motion vectors of the top-left, top-right, and bottom-left control points of the current block.
[0374] It should be noted that the technical solutions of the present invention are not limited to the examples described above, and other control points and motion models may also be applicable to the present invention. Further details are not described herein.
[0375] Step 705b: Obtain the motion vector for each subblock based on the three control points of the current block and by using a 6-parameter affine transformation model. For specific details on how to perform this step, please refer to the relevant description in Step 705a. Details are not provided again here.
[0376] Step 706b: For each subblock, perform motion compensation based on the corresponding motion vector to obtain the pixel predictor for the subblock.
[0377] In this embodiment of the present invention, the decoder side uses a motion vector prediction method based on a second motion model in the process of predicting the current block. Thus, in the parse phase, 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 transformation model used for adjacent blocks, and a 6-parameter affine transformation model may be uniformly used to predict the current block in the reconstruction phase (including the phase of predicting the motion vectors of subblocks). In this solution, the 6-parameter affine transformation model configured in the reconstruction phase can describe affine transformations such as translation, scaling, and rotation of the image block, and can achieve a good balance between model complexity and modeling capability. Therefore, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0378] Figure 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 a video encoder 100, and more specifically, by an interpreter 110 of the video encoder 100. The video encoder 100 may perform some or all of the following steps to encode the current coding block (abbreviated as the current block) of the current video frame based on a video data stream having multiple video frames. As shown in Figure 13, the method includes, but is not limited to, the following steps.
[0379] 801: Determines the interpretation mode for the current coding block.
[0380] In a specific implementation, multiple interpretation modes may be pre-set on the encoder side for interpretation. For example, the multiple interpretation modes include the AMVP mode and the merge mode based on the affine motion model described above. The encoder side traverses the multiple interpretation modes to determine the optimal interpretation mode for predicting the current block.
[0381] In other specific implementations, only one interprediction mode may be pre-set for interprediction on the encoder side. In this case, the encoder side directly determines that the default interprediction mode is currently in use. The default interprediction mode is either the AMVP mode based on the affine motion model or the merge mode based on the affine motion model.
[0382] In this embodiment of the present invention, if it is determined that the current block's interprediction mode is an AMVP mode based on an affine motion model, steps 802a to 804a are subsequently performed.
[0383] In this embodiment of the present invention, if it is determined that the interprediction mode of the current block is a merge mode based on an affine motion model, then steps 802b to 804b are subsequently performed.
[0384] 802a: Construct a list of candidate motion vectors for AMVP modes based on affine transformations.
[0385] In some embodiments, the encoder side uses a design solution for a motion vector prediction method based on a first motion model. Therefore, for a specific implementation of this step, please refer to the description of step 602a in the embodiment shown in Figure 9. Further details are not provided here.
[0386] In some other embodiments, the encoder side uses a design solution for a motion vector prediction method based on a second motion model. Therefore, for a specific implementation of this step, please refer to the description of step 702a in the embodiment shown in Figure 12. Further details are not described here.
[0387] 803a: Determine the optimal motion vector predictor for the control point based on the rate distortion cost.
[0388] In some examples, the encoder may obtain the motion vectors for each motion compensation subunit in the current block by using control point motion vector predictors (e.g., candidate motion vector 2-tuples / triplets / quadruples) in a list of candidate motion vectors, and according to equations (3), (5), or (7). Furthermore, the encoder obtains the pixel values of the corresponding positions in the reference frame pointed to by the motion vectors of each motion compensation subunit, and uses these pixel values as pixel predictors for the motion compensation subunits to perform motion compensation based on an affine motion model. The average difference between the original values and the predictors for each sample in the current coding block is calculated. The control point motion vector predictors corresponding to the smallest average difference are selected as the optimal control point motion vector predictors and used as the motion vector predictors for two, three, or four control points in the current block.
[0389] 804a: Encode the index value, the motion vector difference of the control point, and the instruction information for the interprediction mode into a bitstream.
[0390] In some examples, the encoder may perform a 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 (CPMVs), and then calculate the control point motion vector differences (CPMVD) between the control point motion vectors and the control point motion vector predictor. The encoder then encodes the CPMVD and an index value indicating the position of the control point motion vector predictor in the candidate motion vector list into a bitstream. Interpretation mode indication information may be further encoded into a bitstream, which is then transmitted to the decoder.
[0391] In another possible example, the encoder may encode instruction information (number of parameters) indicating the affine transformation model used for the current block into a bitstream, and then transmit the bitstream to the decoder. In this way, the decoder determines the affine transformation model used for the current block based on the instruction information.
[0392] 802b: Construct a list of candidate motion vectors for merge modes based on affine transformations.
[0393] In some embodiments, the encoder side uses a design solution for a motion vector prediction method based on a first motion model. Therefore, for a specific implementation of this step, please refer to the description of step 602b in the embodiment shown in Figure 9. Further details are not provided here.
[0394] In some other embodiments, the encoder side uses a design solution for a motion vector prediction method based on a second motion model. Therefore, for a specific implementation of this step, please refer to the description of step 702b in the embodiment shown in Figure 12. Further details are not provided here.
[0395] 803b: Determine the optimal motion vector predictor for the control point.
[0396] In some examples, the encoder may obtain the motion vectors for each motion compensation subunit in the current coding block by using the control point motion vectors (e.g., candidate motion vector 2-tuples / triplets / quadruples) in the candidate motion vector list and according to equations (3), (5), or (7). Furthermore, the encoder obtains the pixel values of the positions in the reference frame pointed to by the motion vectors of each motion compensation subunit and performs affine motion compensation using these pixel values as the pixel predictors for the motion compensation subunits. The average difference between the original values and the predictors 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 vectors for two, three, or four control points in the current coding block.
[0397] 804b: Encodes the index value and interprediction mode indication information into a bitstream.
[0398] For example, the encoder may encode an index value indicating the position of the control point motion vector in the candidate list and the interprediction mode instruction information into a bitstream, which is then transmitted to the decoder.
[0399] In another possible example, the encoder may encode instruction information (number of parameters) indicating the affine transformation model used for the current block into a bitstream, and then transmit the bitstream to the decoder. In this way, the decoder determines the affine transformation model used for the current block based on the instruction information.
[0400] It should be noted that the embodiments described above only describe the process by which the encoder performs encoding and sends the bitstream. Those skilled in the art will understand that, in accordance with the above description, the encoder may perform other procedures to carry out other methods described in the embodiments of the present invention. For example, for a specific implementation of the process of reconstructing the current block during prediction performed by the encoder on the current block, see the relevant methods described above with respect to the decoder (shown in the embodiments of Figure 9 or Figure 12). Further details are not described here again.
[0401] In embodiments of the present invention, it is found that the encoder encodes the current block according to a design solution for a motion vector prediction method based on a first motion model. Thus, the affine transform model of adjacent blocks may be used to construct the affine transform model of the current block in the phase of parsing the current block (e.g., the phase of constructing a candidate motion vector list for AMVP mode or merge mode). The affine transform models of the two blocks may be different or the same. The affine transform 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] In embodiments of the present invention, it is further found that the encoder side encodes the current block according to a design solution for a motion vector prediction method based on a second motion model. This helps the decoder side to uniformly use a six-parameter affine transform model to predict the image block during the phase of reconstructing the image block. Thus, this solution can improve coding efficiency and accuracy when predicting the current block and satisfy user requirements.
[0403] Those skilled in the art will understand that the functions described with reference to the various exemplary logical blocks, modules, and algorithmic steps disclosed and described herein can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, the functions described with reference to the exemplary logical blocks, modules, and steps may be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. The computer-readable medium may include computer-readable storage media corresponding to tangible media such as data storage media, or any communication media that facilitates the transmission of computer programs from one place to another (e.g., according to a communication protocol). Thus, the computer-readable medium may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media such as signals or carrier waves. The data storage medium may be any usable medium that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in embodiments of the present invention. Computer program products may include computer-readable media.
[0404] For example, and not as an limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other compact disk storage devices, magnetic disk storage devices or other magnetic storage devices, 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 appropriately called a computer-readable medium. For example, when instructions are transmitted from a website, server, or other remote source via coaxial cable, optical fiber, twisted pair, digital subscriber line (DSL), or wireless technology such as infrared, radio waves, or microwaves, these are included in the definition of a medium. It should be understood that computer-readable storage media and data storage media are not connections, carriers, signals, or other temporary media, but are actually non-temporary 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. A disk typically reproduces data magnetically, while a disc reproduces data optically using a laser. Any combination of the above should also be included within the scope of computer-readable media.
[0405] Instructions may be executed by one or more processors, such as digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Accordingly, the term “processor” as used herein may refer to any of the above-described structures or any other structures applicable to the techniques described herein. Furthermore, in some embodiments, the functions described with reference to the exemplary logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a composite codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.
[0406] The technology in embodiments of the present invention may be implemented in a variety of devices or apparatus, including wireless handsets, integrated circuits (ICs), or sets of ICs (e.g., chipsets). Various components, modules, or units are described in embodiments of the present invention to highlight the functional aspects of apparatus configured to perform the disclosed technology, but are not necessarily implemented by different hardware units. In practice, as described above, various units may be combined into a codec hardware unit in combination with appropriate software and / or firmware, or may be provided by an interoperable hardware unit (including one or more of the processors described above).
[0407] The above description is merely an example of a specific embodiment of the present invention and is not intended to limit the scope of protection of the embodiments of the present invention. Any modification or substitution that is readily conceivable by a person skilled in the art within the technical scope disclosed in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention. Accordingly, the scope of protection of the embodiments of the present invention should be subject to the scope of protection of the claims.
Claims
1. A video image decoding method performed by a decoding device, The bitstream is parsed to obtain the index values and motion vector differences (MVDs) of the list of candidate control point motion vector predictors for the K control points of the current block. Given that the affine model of the current block is a 2 × K parameter affine transformation model, and the affine transformation model of the neighboring block of the current block is a 2 × N parameter affine transformation model, the method involves 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, where 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, where the neighboring block is a decoded image block spatially adjacent to the current block, and where the current block includes a plurality of subblocks. Constitute a list of candidate control point motion vector predictors that includes the candidate motion vector predictors for the K control points of the current block, From the list of candidate control point motion vector predictors, the target candidate motion vector predictors for the K control points are determined based on the index value. The process involves obtaining the motion vectors of each of the multiple subblocks within the current block based on the motion vectors (MV) of the K control points of the current block, wherein the MV of the K control points of the current block is obtained based on the target candidate motion vector predictors of the K control points of the current block and the MVD of the K control points of the current block. To generate a predicted block for the current block based on the motion vectors of the plurality of sub-blocks within the current block. A method of having.
2. The candidate motion vector predictors for the three control points of the current block are obtained based on a four-parameter affine transformation model for the neighboring block of the current block, wherein the N control points of the neighboring block are the upper-left and upper-right control points of the neighboring block, while the K control points of the current block are the upper-left, lower-left, and upper-right control points of the current block. The method according to claim 1.
3. Obtaining the motion vector of each subblock within the plurality of subblocks in the current block based on the MV of the K control points of the current block is: Based on the target candidate motion vector predictors and the MVD of the K control points of the current block, the MV of the K control points of the current block is obtained. Obtaining the 2 × K parameter affine transformation model of the current block based on the MV of the K control points of the current block, Obtain the motion vector of each subblock of the current block based on the aforementioned 2 × K parameter affine transformation model. including, The method according to claim 1.
4. The method further comprises determining the target candidate motion vector predictors for the K control points in the control point motion vector predictor candidate list based on the index value, and then obtaining the 2 × K parameter affine transformation model of the current block based on the MV of the K control points of the current block. Accordingly, obtaining the motion vector of each subblock within the plurality of subblocks in the current block based on the MV of the K control points of the current block is: This includes obtaining the motion vector of each subblock of the plurality of subblocks within the current block based on the 2 × K parameter affine transformation model of the current block, The method according to claim 1.
5. A decoding device, A non-temporary computer-readable medium configured to store computer-readable instructions, A processor configured to communicate with the non-temporary computer-readable medium and to execute the computer-readable instructions stored in the non-temporary computer-readable medium, The processor executes the computer-readable instructions, The bitstream is parsed to obtain the index values and motion vector differences (MVDs) of the list of candidate control point motion vector predictors for the K control points of the current block. Given that the affine model of the current block is a 2 × K parameter affine transformation model, and the affine transformation model of the neighboring block of the current block is a 2 × N parameter affine transformation model, the method involves 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 subblocks. Constitute a list of candidate control point motion vector predictors that includes the candidate motion vector predictors for the K control points of the current block, From the list of candidate control point motion vector predictors, the target candidate motion vector predictors for the K control points of the current block are determined based on the index value. The process involves obtaining the motion vectors of each of the multiple subblocks within the current block based on the motion vectors (MV) of the K control points of the current block, wherein the MV of the K control points of the current block is obtained based on the target candidate motion vector predictors of the K control points of the current block and the MVD of the K control points of the current block. To generate a predicted block for the current block based on the motion vectors of the plurality of sub-blocks within the current block. Perform an action that includes Decryption device.
6. The candidate motion vector predictors for the three control points of the current block are obtained based on a four-parameter affine transformation model for the neighboring block of the current block, wherein the N control points of the neighboring block are the upper-left and upper-right control points of the neighboring block, while the K control points of the current block are the upper-left, lower-left, and upper-right control points of the current block. The decoding device according to claim 5.
7. The processor executes the computer-readable instructions stored in the non-temporary computer-readable medium, Based on the target candidate motion vector predictors and the MVD of the K control points of the current block, the MV of the K control points of the current block is obtained. Obtaining the 2 × K parameter affine transformation model of the current block based on the MV of the K control points of the current block, Obtain the motion vectors of each subblock of the current block based on the 2 × K parameter affine transformation model of the current block. Further configured to perform actions including, The decoding device according to claim 5.
8. The processor executes the computer-readable instructions stored in the non-temporary computer-readable medium, The system is further configured to determine the target candidate motion vector predictors for the K control points of the current block based on the index values within the control point motion vector predictor candidate list, and then to perform the operation of obtaining the 2 × K parameter affine transformation model of the current block based on the MV of the K control points of the current block. The decoding device according to claim 5.
9. The processor executes the computer-readable instructions stored in the non-temporary computer-readable medium, The system is specifically configured to perform an operation to obtain the motion vector of each subblock of the plurality of subblocks within the current block based on the 2 × K parameter affine transformation model of the current block. The decoding device according to claim 8.
10. When executed by one or more processors, the one or more processors: The bitstream is parsed to obtain the index values and motion vector differences (MVDs) of the list of candidate control point motion vector predictors for the K control points of the current block. Given that the affine model of the current block is a 2 × K parameter affine transformation model, and the affine transformation model of the neighboring block of the current block is a 2 × N parameter affine transformation model, the method involves 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 subblocks. Constitute a list of candidate control point motion vector predictors that includes the candidate motion vector predictors for the K control points of the current block, From the list of candidate control point motion vector predictors, the target candidate motion vector predictors for the K control points are determined based on the index value. The process involves obtaining the motion vectors of each of the multiple subblocks within the current block based on the motion vectors (MV) of the K control points of the current block, wherein the MV of the K control points of the current block is obtained based on the target candidate motion vector predictors of the K control points of the current block and the MVD of the K control points of the current block. To generate a predicted block for the current block based on the motion vectors of the plurality of sub-blocks within the current block. A non-temporary, computer-readable medium that stores computer instructions that cause actions to be performed, including those mentioned above.
11. The candidate motion vector predictors for the three control points of the current block are obtained based on a four-parameter affine transformation model for the neighboring block of the current block, wherein the N control points of the neighboring block are the upper-left and upper-right control points of the neighboring block, while the K control points of the current block are the upper-left, lower-left, and upper-right control points of the current block. A non-temporary computer-readable medium according to claim 10.