CN110891176B - Motion vector prediction method and device based on affine motion model - Google Patents

Motion vector prediction method and device based on affine motion model Download PDF

Info

Publication number
CN110891176B
CN110891176B CN201811096702.9A CN201811096702A CN110891176B CN 110891176 B CN110891176 B CN 110891176B CN 201811096702 A CN201811096702 A CN 201811096702A CN 110891176 B CN110891176 B CN 110891176B
Authority
CN
China
Prior art keywords
block
processed
motion vector
image block
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811096702.9A
Other languages
Chinese (zh)
Other versions
CN110891176A (en
Inventor
陈焕浜
杨海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP19858748.7A priority Critical patent/EP3840380A4/en
Priority to BR112021004505-8A priority patent/BR112021004505A2/en
Priority to PCT/CN2019/091364 priority patent/WO2020052304A1/en
Priority to SG11202102361WA priority patent/SG11202102361WA/en
Priority to JP2021513246A priority patent/JP7279154B2/en
Priority to CA3112368A priority patent/CA3112368A1/en
Priority to KR1020217010006A priority patent/KR102620024B1/en
Publication of CN110891176A publication Critical patent/CN110891176A/en
Priority to US17/196,642 priority patent/US11539975B2/en
Application granted granted Critical
Publication of CN110891176B publication Critical patent/CN110891176B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/527Global motion vector estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/149Data rate or code amount at the encoder output by estimating the code amount by means of a model, e.g. mathematical model or statistical model
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Abstract

The application discloses a motion vector prediction method and equipment based on an affine motion model, wherein the method comprises the following steps: acquiring a spatial domain reference block of an image block to be processed; determining a plurality of preset sub-block positions in the spatial domain reference block; according to the motion vector corresponding to the position of the preset sub-block, calculating a motion vector corresponding to the position of a preset pixel point of the image block to be processed through interpolation; and calculating motion vectors corresponding to the positions of a plurality of sub-blocks in the image block to be processed by interpolation according to the motion vectors corresponding to the positions of the preset pixel points. By the method and the device, prediction accuracy in encoding and decoding can be improved, and encoding efficiency is improved.

Description

Motion vector prediction method and device based on affine motion model
Technical Field
The invention relates to the field of video coding and decoding, in particular to a motion vector prediction method and device based on an affine motion model.
Background
Video encoding (video encoding and decoding) is widely used in digital video applications such as broadcast digital television, video dissemination over the internet and mobile networks, real-time session applications such as video chat and video conferencing, DVD and blu-ray discs, video content capture and editing systems, and security applications for camcorders.
With the development of the hybrid block-based video coding scheme in the h.261 standard in 1990, new video coding techniques and tools have been developed and form the basis for new video coding standards. Other 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) \\ 8230, and extensions to such standards, such as scalability and/or 3D (three-dimensional) extensions. As video creation and usage becomes more widespread, video traffic becomes the largest burden on communication networks and data storage. One of the goals of most video coding standards is therefore to reduce the bit rate without sacrificing picture quality compared to previous standards. Even though the latest High Efficiency Video Coding (HEVC) can compress video about twice as much as AVC without sacrificing picture quality, there is still a need for a new technology to further compress video relative to HEVC.
Disclosure of Invention
The embodiment of the invention provides a motion vector prediction method and device based on an affine motion model, which can improve the accuracy of prediction in video coding and decoding and improve the coding efficiency.
In a first aspect, the present invention provides a motion vector prediction method based on an affine motion model, described from the perspective of an encoding end or a decoding end, including: the method comprises the steps of obtaining a spatial domain reference block of a to-be-processed image block, wherein the to-be-processed image block is obtained by dividing a video image, and the spatial domain reference block is a decoded block which is adjacent to a spatial domain of the to-be-processed image block. At the encoding end, the image block to be processed is a current affine encoding block, and the spatial domain reference block is an adjacent affine encoding block. At the decoding end, the image block to be processed is a current affine decoding block, and the spatial domain reference block is an adjacent affine decoding block. For convenience of description, the image blocks to be processed may be collectively referred to as a current block, and the spatial reference blocks may be collectively referred to as neighboring blocks; then, determining the preset sub-block positions of two or more sub-blocks in the spatial domain reference block, wherein each sub-block has a corresponding preset sub-block position, and the preset sub-block positions are consistent with the positions adopted when the motion vectors of the sub-blocks are calculated in encoding and decoding, namely the sub-blocks of adjacent affine decoding blocks adopt the motion vectors of the pixels at the preset positions in the sub-blocks to express the motion vectors of all pixels in the sub-blocks; then, according to the motion vectors corresponding to the preset sub-block positions of the two or more sub-blocks, calculating the motion vectors corresponding to the preset pixel point positions of the image block to be processed in an interpolation mode, wherein the preset pixel point positions are control points of the image block to be processed; and then, forming an affine motion model of the current block according to the motion vectors corresponding to the positions of the preset pixel points, and calculating the motion vectors corresponding to the positions of a plurality of sub-blocks in the image block to be processed through interpolation.
And respectively using the motion vectors corresponding to the plurality of sub-block positions for prediction of the motion vectors of the plurality of sub-blocks.
It can be seen that, by implementing the embodiment of the present invention, motion vectors of control points of adjacent blocks are not required to be utilized, but motion vectors of at least two sub-blocks of the adjacent blocks are utilized to derive a motion vector of a control point of a current block, and then a motion vector of each sub-block of the current block is derived according to the motion vector of the control point. The motion vector of the control point of the current block will not need to be stored subsequently, i.e. the motion vector of the control point of the current block is only used for the derivation of the motion vector of the sub-block of the current decoded block and not for the prediction of the motion vectors of the neighboring blocks. Therefore, the scheme of the invention only needs to store the motion vector of the subblock, and adopts the motion vector of the subblock to carry out motion compensation, thereby solving the problem of motion vector storage, avoiding the subblock where the control point is positioned from using the motion vector inconsistent with other subblocks to carry out motion compensation and improving the accuracy of prediction.
Based on the first aspect, in a possible implementation manner, two sub-blocks in the spatial domain reference block may be determined, a distance between two preset sub-block positions corresponding to the two sub-blocks is S, S is a power of K of 2, and K is a non-negative integer, which is beneficial to implementation in a shifting manner when motion vector derivation is performed subsequently, thereby reducing implementation complexity.
Based on the first aspect, in a possible implementation manner, the preset sub-block position may be a position of a pixel point at the upper left corner in the sub-block; or the position of the geometric center of the sub-block, or the position of a pixel point closest to the geometric center in the sub-block; or the position of the top right pixel point in the sub-block, etc.
Based on the first aspect, in a possible implementation, the availability of candidate reference blocks for one or more preset spatial positions of the current block may be determined in a preset order, and then the first available candidate reference block in the preset order is obtained as the spatial reference block. Wherein the candidate reference block of the preset spatial position comprises: and the adjacent image blocks are positioned right above, right left, right above, left lower part and left upper part of the image block to be processed. For example, the availability of the candidate reference blocks is sequentially checked according to the sequence of the positive left adjacent image block, the positive top adjacent image block, the right top adjacent image block, the left bottom adjacent image block and the left top adjacent image block until the first available candidate reference block is determined.
Specifically, whether the candidate reference block is available may be determined according to the following method: determining that the candidate reference block is available when the candidate reference block and the image block to be processed are located in the same image area and the candidate reference block obtains a motion vector based on the affine motion model.
Based on the first aspect, in a possible implementation manner, if the affine motion model of the current block is a 4-parameter affine motion model, the multiple preset subblock positions of the spatial domain reference block include a first preset position (x 4+ M/2, y4+ N/2) and a second preset position (x 4+ M/2+ P, y4+ N/2), where x4 is a position abscissa of a top left pixel in the spatial domain reference block, y4 is a position ordinate of a top left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, P is a kth power of 2, K is a non-negative integer, K is smaller than U, and U is a width of the spatial domain reference block. Therefore, the subsequent motion vector derivation can be realized in a shifting mode, and the complexity of the realization is reduced.
Based on the first aspect, in a possible implementation, if the affine motion model of the current block is a 4-parameter affine motion model, the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ n/2) and a third preset position (x 4+ M/2,
y4+ N/2+ Q), wherein x4 is the position abscissa of the upper left pixel in the spatial domain reference block, y4 is the position ordinate of the upper left pixel in the spatial domain reference block, M is the subblock width, N is the subblock height, Q is the power of R of 2, R is a non-negative integer, Q is smaller than V, and V is the height of the spatial domain reference block. Therefore, the subsequent motion vector derivation can be realized in a shifting mode, and the complexity of the realization is reduced.
In an example, if the affine motion model of the current block is a 6-parameter affine motion model, the plurality of predetermined subblock positions include a first predetermined position (x 4+ M/2, y4+ N/2), a second predetermined position (x 4+ M/2+ P, y4+ N/2) and a third predetermined position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, P is a K power of 2, Q is an R power of 2, K and R are nonnegative integers, P is smaller than U, Q is smaller than V, U is a width of the spatial domain reference block, and V is a height of the spatial domain reference block. Therefore, the method is beneficial to realizing the subsequent motion vector derivation in a shifting mode, and the complexity of realization is reduced.
In another example, if the straight line of the top edge of the current block coincides with the straight line of the top edge of the Code Tree Unit (CTU) of the current block, and the spatial reference block is located directly above, above left, or above right the image block to be processed, at least two of the sub blocks corresponding to the plurality of preset sub block positions are adjacent to the top edge of the current block.
Based on the first aspect, in a possible implementation manner, if a straight line where a left edge of the current block is located coincides with a straight line where a left edge of a Code Tree Unit (CTU) where the current block is located, and the spatial reference block is located right left, above left, or below left of the current block, at least two sub blocks of the sub blocks corresponding to the plurality of preset sub block positions are adjacent to the left edge of the current block.
Based on the first aspect, in a possible implementation manner, a candidate control point motion vector of a current block is determined by using an improved inherited control point motion vector prediction method, that is, a motion vector of a preset pixel point position of the current block is obtained by interpolation calculation by using motion vectors of at least two sub-blocks of adjacent affine coding blocks (or adjacent affine decoding blocks), where the preset pixel point position is a control point of the current block, for example, if an affine motion model of the current block is a 4-parameter affine motion model, the control points of the current block may be an upper-left pixel point and an upper-right pixel point in the sub-blocks. If the affine motion model of the current block is a 6-parameter affine motion model, the control points of the current block may be an upper-left pixel point, an upper-right pixel point, and a lower-left pixel point in the sub-block, and so on.
Based on the first aspect, in a possible implementation manner, if the affine motion model of the current block is a 4-parameter affine motion model, the control point of the current block may include at least two of a top-left pixel point position in the to-be-processed image block, a top-right pixel point position in the to-be-processed image block, and a bottom-left pixel point position in the to-be-processed image block, and the interpolating, according to the motion vector corresponding to the preset sub-block position, of the to-be-processed image block to calculate the motion vector corresponding to the preset pixel point position of the to-be-processed image block, including calculating the motion vector corresponding to the preset pixel point position of the to-be-processed image block according to the following formula:
Figure BDA0001805725400000031
Figure BDA0001805725400000032
Figure BDA0001805725400000033
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left corner pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first predetermined position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Vertical component, x, of motion vector corresponding to the second predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left corner pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the pixel point at the upper left corner in the image block to be processed 1 The horizontal coordinate, y, of the position of the upper right corner pixel point in the image block to be processed 1 Is the vertical coordinate, x, of the upper right corner pixel point position in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
Based on the first aspect, in a possible implementation manner, if the affine motion model of the current block is a 6-parameter affine motion model, the control point of the current block may include a position of an upper-left pixel point in the to-be-processed image block, a position of an upper-right pixel point in the to-be-processed image block, and a position of a lower-left pixel point in the to-be-processed image block, and the interpolating, according to the motion vector corresponding to the preset sub-block position, the motion vector corresponding to the preset pixel point position of the to-be-processed image block is calculated by interpolation, including calculating the motion vector corresponding to the preset pixel point position of the to-be-processed image block according to the following formula:
Figure BDA0001805725400000041
Figure BDA0001805725400000042
Figure BDA0001805725400000043
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first preset position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Is the vertical component, vx, of the motion vector corresponding to the second predetermined position 6 As the third preliminary treatmentLet the horizontal component of the position-corresponding motion vector, vy 6 Vertical component, x, of motion vector corresponding to said third predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the upper left corner pixel point in the image block to be processed 1 Is the horizontal coordinate, y, of the position of the pixel point at the upper right corner in the image block to be processed 1 Is the vertical coordinate, x, of the upper right corner pixel point position in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
Based on the first aspect, in a possible implementation manner, for each sub-block of the current block (a sub-block may also be equivalent to a motion compensation unit, and the width and height of the sub-block are smaller than those of the current block), motion information of a pixel point at a preset position in the motion compensation unit may be used to represent motion information of all pixel points in the motion compensation unit. Assuming that the size of the motion compensation unit is MxN, the pixels at the predetermined positions may be the motion compensation unit center point (M/2, N/2), the upper left pixel point (0, 0), the upper right pixel point (M-1, 0), or pixels at other positions. Then, according to the motion information of the control point of the current block and the currently adopted affine motion model, the motion vector value of each sub-block in the current block can be obtained, and then motion compensation can be performed according to the motion vector value of the sub-block to obtain the pixel prediction value of the sub-block.
Based on the first aspect, in a possible implementation manner, if the affine motion model of the current block is a 4-parameter affine motion model, the preset pixel point position includes a top-left pixel point position in the image block to be processed and a top-right pixel point position in the image block to be processed, and the interpolation calculates motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to a motion vector corresponding to the preset pixel point position, including calculating motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure BDA0001805725400000044
wherein W is the width of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, and vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
Based on the first aspect, in a possible implementation manner, if the affine motion model of the current block is a 6-parameter affine motion model, the interpolating and calculating motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the motion vector corresponding to the preset pixel point position includes calculating motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure BDA0001805725400000051
wherein W is the width of the image block to be processed, H is the height of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
In a second aspect, an embodiment of the present invention provides an apparatus, including: the reference block acquisition module is used for acquiring a spatial domain reference block of the image block to be processed in the video data; the subblock determining module is used for determining a plurality of preset subblock positions in the spatial domain reference block; the first calculation module is used for calculating a motion vector corresponding to a preset pixel point position of the image block to be processed in an interpolation mode according to the motion vector corresponding to the preset sub-block position; and the second calculation module is used for calculating motion vectors corresponding to the positions of a plurality of sub-blocks in the image block to be processed through interpolation according to the motion vectors corresponding to the positions of the preset pixel points.
In a specific embodiment, each module of the apparatus may be configured to implement the method described in the first aspect.
In a third aspect, an embodiment of the present invention provides an apparatus for decoding video, where the apparatus includes:
the memorizer, is used for storing the video data of the code stream form;
the decoder is used for acquiring a spatial domain reference block of the image block to be processed in the video data; determining a plurality of preset sub-block positions in the spatial domain reference block; according to the motion vector corresponding to the position of the preset sub-block, calculating a motion vector corresponding to the position of a preset pixel point of the image block to be processed through interpolation; and calculating motion vectors corresponding to a plurality of subblock positions in the image block to be processed by interpolation according to the motion vectors corresponding to the preset pixel point positions, wherein the motion vectors corresponding to the plurality of subblock positions are respectively used for predicting the motion vectors of the plurality of subblocks.
Based on the third aspect, in a possible embodiment, the decoder is specifically configured to: determining the availability of candidate reference blocks at one or more preset spatial domain positions of the image block to be processed according to a preset sequence; obtaining a candidate reference block available first in the preset order as the spatial reference block.
Based on the third aspect, in a possible embodiment, the candidate reference block is determined to be available when the candidate reference block is located within the same image area as the image block to be processed and the candidate reference block obtains a motion vector based on the affine motion model.
In a possible embodiment, based on the third aspect, the candidate reference block in the preset spatial position comprises: adjacent image blocks which are positioned right above, right left, right above, left lower and left upper of the image block to be processed;
the decoder is specifically configured to: and sequentially checking the availability of the candidate reference blocks according to the sequence of the positive left adjacent image block, the positive upper adjacent image block, the right upper adjacent image block, the left lower adjacent image block and the left upper adjacent image block until determining the first available candidate reference block.
Wherein the sub-block locations comprise: the position of the pixel point at the upper left corner in the sub-block; or the position of the geometric center of the sub-block, or the position of a pixel point in the sub-block closest to the geometric center.
Based on the third aspect, in a possible embodiment, a distance between two of the plurality of preset subblock positions is S, S being a power of K of 2, K being a non-negative integer.
Based on the third aspect, in a possible embodiment, the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2) and a second preset position (x 4+ M/2+ P, y4+ N/2), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, P is a power of K of 2, K is a non-negative integer, K is smaller than U, and U is a width of the spatial domain reference block.
Based on the third aspect, in a possible embodiment, the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2) and a third preset position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, Q is an R-th power of 2, R is a non-negative integer, Q is smaller than V, and V is a height of the spatial domain reference block.
Based on the third aspect, in a possible embodiment, the affine motion model is a 4-parameter affine motion model, the preset pixel point position includes a position of an upper-left pixel point in the image block to be processed, and the decoder is specifically configured to calculate a motion vector corresponding to the preset pixel point position of the image block to be processed according to the following formula:
Figure BDA0001805725400000061
Figure BDA0001805725400000062
Figure BDA0001805725400000063
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first predetermined position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Vertical component, x, of motion vector corresponding to the second predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the upper left corner pixel point in the image block to be processed 1 Is the horizontal coordinate, y, of the position of the pixel point at the upper right corner in the image block to be processed 1 Is the vertical coordinate, x, of the upper right corner pixel point position in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
Based on the third aspect, in a possible embodiment, the affine motion model is a 4-parameter affine motion model, the preset pixel point position includes a position of an upper-left pixel point in the image block to be processed and a position of an upper-right pixel point in the image block to be processed, and the decoder is specifically configured to calculate motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure BDA0001805725400000071
wherein W is the width of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
Based on the third aspect, in a possible embodiment, the affine motion model is a 6-parameter affine motion model, and the plurality of preset subblock positions include a first preset position (x 4+ M/2, y4+ N/2), a second preset position (x 4+ M/2+ P, y4+ N/2), and a third preset position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of a top left pixel in the spatial domain reference block, y4 is a position ordinate of a top left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, P is a power of K2, Q is a power of R of 2, K and R are nonnegative integers, P is smaller than U, Q is smaller than V, U is a width of the spatial domain reference block, and V is a height of the reference block.
Based on the third aspect, in a possible embodiment, the affine motion model is a 6-parameter affine motion model, the preset pixel point position includes a position of an upper-left pixel point in the to-be-processed image block, a position of an upper-right pixel point in the to-be-processed image block and a position of a lower-left pixel point in the to-be-processed image block, and the decoder is specifically configured to calculate a motion vector corresponding to the position of the preset pixel point of the to-be-processed image block according to the following formula:
Figure BDA0001805725400000072
Figure BDA0001805725400000073
Figure BDA0001805725400000074
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first preset position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Is the vertical component, vx, of the motion vector corresponding to the second preset position 6 Is the horizontal component, vy, of the motion vector corresponding to the third preset position 6 Vertical component, x, of motion vector corresponding to the third predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the upper left corner pixel point in the image block to be processed 1 The horizontal coordinate, y, of the position of the upper right corner pixel point in the image block to be processed 1 Is the vertical coordinate, x, of the upper right corner pixel point position in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
Based on the third aspect, in a possible embodiment, the affine motion model is a 6-parameter affine motion model, and the decoder is specifically configured to calculate motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure BDA0001805725400000081
wherein W is the width of the image block to be processed, H is the height of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
Based on the third aspect, in a possible embodiment, when a straight line where the upper edge of the to-be-processed image block is located coincides with a straight line where the upper edge of the coding tree unit CTU where the to-be-processed image block is located, and the spatial domain reference block is located right above, left above, or right above the to-be-processed image block, at least two sub-blocks of the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the upper edge of the to-be-processed image block.
Based on the third aspect, in a possible embodiment, when the straight line where the left edge of the to-be-processed image block is located coincides with the straight line where the left edge of the coding tree unit CTU where the to-be-processed image block is located, and the spatial reference block is located at the right left, upper left, or lower left of the to-be-processed image block, at least two sub-blocks of the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the left edge of the to-be-processed image block.
The method described in the first aspect of the invention may be performed by an apparatus according to the third aspect of the invention. Further features and implementations of the method of the first aspect of the invention are directly dependent on the functionality of the device according to the third aspect of the invention and its different implementations.
In a fourth aspect, an embodiment of the present invention provides an apparatus for encoding video, where the apparatus includes:
the memory is used for storing video data in a code stream form;
the encoder is used for acquiring a spatial domain reference block of a to-be-processed image block in the video data; determining a plurality of preset sub-block positions in the spatial domain reference block; according to the motion vector corresponding to the position of the preset sub-block, calculating a motion vector corresponding to the position of a preset pixel point of the image block to be processed through interpolation; and calculating motion vectors corresponding to a plurality of subblock positions in the image block to be processed by interpolation according to the motion vectors corresponding to the preset pixel point positions, wherein the motion vectors corresponding to the plurality of subblock positions are respectively used for predicting the motion vectors of the plurality of subblocks.
The specific functional implementation of the encoder may refer to the functional description of the decoder described in the third aspect, which is not described herein again.
The method of the first aspect of the invention may be performed by an apparatus as described in accordance with the fourth aspect of the invention. Further features and implementations of the method of the first aspect of the invention are directly dependent on the functionality of the device according to the fourth aspect of the invention and its different implementations.
In a fifth aspect, the present invention is directed to an apparatus, comprising a processor and a memory, for decoding a video stream. The memory stores instructions that cause the processor to perform the method according to the first aspect.
In a sixth aspect, an embodiment of the present invention provides an apparatus for decoding a video stream, including a processor and a memory. The memory stores instructions that cause the processor to perform the method according to the first aspect.
In a seventh aspect, an embodiment of the present invention provides an apparatus for encoding a video stream, including a processor and a memory. The memory stores instructions that cause the processor to perform the method according to the first aspect.
In an eighth aspect, embodiments of the present invention provide a computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to encode video data. The instructions cause the one or more processors to perform a method according to any of the possible embodiments of the first aspect.
In a ninth aspect, embodiments of the invention provide a computer program comprising program code for performing a method according to any of the possible embodiments of the first aspect when the program code is run on a computer.
It can be seen that, the embodiment of the present invention employs an improved inherited control point motion vector prediction method, which does not need to use the motion vectors of the control points of the neighboring blocks, but instead employs the motion vectors of at least two sub-blocks of the neighboring blocks to derive the motion vector of the control point of the current block, and further derives the motion vector of each sub-block of the current block according to the motion vector of the control point, thereby implementing prediction of the current block through motion compensation. The motion vector of the control point of the current block will not need to be stored subsequently, i.e. the motion vector of the control point of the current block is only used for the derivation of the motion vector of the sub-block of the current decoded block and not for the prediction of the motion vectors of the neighboring blocks. Therefore, the scheme of the invention only needs to store the motion vector of the subblock, and adopts the motion vector of the subblock to carry out motion compensation, thereby solving the problem of motion vector storage, avoiding the subblock where the control point is positioned from using the motion vector inconsistent with other subblocks to carry out motion compensation and improving the accuracy of prediction.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present invention, the drawings required to be used in the embodiments or the background art of the present invention will be described below.
FIG. 1A is a block diagram of an example of a video encoding and decoding system 10 for implementing an embodiment of this disclosure;
FIG. 1B is a block diagram of an example of a video coding system 40 for implementing an embodiment of the present disclosure;
FIG. 2 is a block diagram of an example structure of an encoder 20 for implementing an embodiment of the invention;
FIG. 3 is a block diagram of an example structure of a decoder 30 for implementing an embodiment of the invention;
FIG. 4 is a block diagram of an example of a video coding apparatus 400 for implementing an embodiment of the disclosure;
FIG. 5 is a block diagram of another example of an encoding device or a decoding device for implementing an embodiment of the present invention;
FIG. 6 is a diagram of a scenario of an example operation on a current block;
FIG. 7 is a schematic diagram of yet another example operation on a current block;
FIG. 8 is a schematic diagram of yet another example operation on a current block;
FIG. 9 is a schematic diagram of yet another example operation on a current block;
FIG. 10 is a schematic diagram of yet another example operation on a current block;
fig. 11 is a flowchart of a motion vector prediction method based on an affine motion model according to an embodiment of the present invention;
FIG. 12 is a flowchart of a further method for predicting motion vectors based on an affine motion model according to an embodiment of the present invention;
FIG. 13 is a schematic diagram of yet another example operation on a current block;
FIG. 14 is a flowchart of a further method for predicting motion vectors based on affine motion models according to an embodiment of the present invention;
fig. 15 is a block diagram of an apparatus for implementing an embodiment of the invention.
Detailed Description
The embodiments of the present invention will be described below with reference to the drawings. In the following description, reference is made to the accompanying drawings which form a part hereof and which show by way of illustration specific aspects of embodiments of the invention or which may be used in the practice of the invention. It should be understood that embodiments of the invention may be used in other respects, and may include structural or logical changes not depicted in the drawings. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims. For example, it should be understood that the disclosure in connection with the described methods may equally apply to the corresponding apparatus or system for performing the methods, and vice versa. For example, if one or more particular method steps are described, the corresponding apparatus may comprise one or more units, such as functional units, to perform the described one or more method steps (e.g., a unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, for example, if a particular apparatus is described based on one or more units, such as functional units, the corresponding method may comprise one step to perform the functionality of the one or more units (e.g., one step performs the functionality of the one or more units, or multiple steps, each of which performs the functionality of one or more of the plurality of units), even if such one or more steps are not explicitly described or illustrated in the figures. Further, it is to be understood that features of the various exemplary embodiments and/or aspects described herein may be combined with each other, unless explicitly stated otherwise.
The technical scheme provided by the embodiment of the invention can be applied to the existing video coding standards (such as H.264, HEVC and the like) and can also be applied to the future video coding standards (such as H.266 standards). The terminology used in the description of the embodiments of the invention herein is for the purpose of describing particular embodiments of the invention only and is not intended to be limiting of the invention. Some concepts that may be involved with embodiments of the present invention are briefly described below.
Video coding generally refers to processing a sequence of pictures that form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" may be used as synonyms. Video encoding as used herein means video encoding or video decoding. Video encoding is performed on the source side, typically including processing (e.g., by compressing) the original video picture to reduce the amount of data required to represent the video picture for more efficient storage and/or transmission. Video decoding is performed at the destination side, typically including inverse processing with respect to the encoder, to reconstruct the video picture. Embodiments are directed to video picture "encoding" to be understood as referring to "encoding" or "decoding" of a video sequence. The combination of the encoding part and the decoding part is also called codec (coding and decoding).
A video sequence comprises a series of images (pictures) which are further divided into slices (slices) which are further divided into blocks (blocks). Video coding performs the coding process in units of blocks, and in some new video coding standards, the concept of blocks is further extended. For example, in the h.264 standard, there is a Macroblock (MB), which may be further divided into a plurality of prediction blocks (partitions) that can be used for predictive coding. In the High Efficiency Video Coding (HEVC) standard, basic concepts such as a Coding Unit (CU), a Prediction Unit (PU), and a Transform Unit (TU) are adopted, and various block units are functionally divided, and a brand new tree-based structure is adopted for description. For example, a CU may be partitioned into smaller CUs according to a quadtree, and the smaller CUs may be further partitioned to form a quadtree structure, where the CU is a basic unit for partitioning and encoding an encoded image. There is also a similar tree structure for PU and TU, and PU may correspond to a prediction block, which is the basic unit of predictive coding. The CU is further partitioned into PUs according to a partitioning pattern. A TU may correspond to a transform block, which is a basic unit for transforming a prediction residual. However, CU, PU and TU are all concepts of blocks (or image blocks).
For example, in HEVC, a CTU is split into multiple CUs by using a quadtree structure represented as a coding tree. A decision is made at the CU level whether to encode a picture region using inter-picture (temporal) or intra-picture (spatial) prediction. Each CU may be further split into one, two, or four PUs according to the PU split type. The same prediction process is applied within one PU and the relevant information is transmitted to the decoder on a PU basis. After obtaining the residual block by applying a prediction process based on the PU split type, the CU may be partitioned into Transform Units (TUs) according to other quadtree structures similar to the coding tree used for the CU. In recent developments of video compression techniques, the coding blocks are partitioned using Quad-tree and binary tree (QTBT) partition frames. In the QTBT block structure, a CU may be square or rectangular in shape.
Herein, for convenience of description and understanding, an image block to be encoded in a currently encoded image may be referred to as a current block, e.g., in encoding, referring to a block currently being encoded; in decoding, refers to the block currently being decoded. A decoded image block of a reference image used for predicting the current block is referred to as a reference block, i.e. the reference block is a block that provides a reference signal for the current block, wherein the reference signal represents pixel values within the image block. A block in the reference picture that provides a prediction signal for the current block may be a prediction block, wherein the prediction signal represents pixel values or sample values or a sampled signal within the prediction block. For example, after traversing multiple reference blocks, a best reference block is found that will provide prediction for the current block, which is called a prediction block.
In the case of lossless video coding, the original video picture can be reconstructed, i.e., the reconstructed video picture has the same quality as the original video picture (assuming no transmission loss or other data loss during storage or transmission). In the case of lossy video coding, the amount of data needed to represent the video picture is reduced by performing further compression, e.g., by quantization, while the decoder side cannot fully reconstruct the video picture, i.e., the quality of the reconstructed video picture is lower or worse than the quality of the original video picture.
Several video coding standards of h.261 belong to the "lossy hybrid video codec" (i.e., the combination of spatial and temporal prediction in the sample domain with 2D transform coding in the transform domain for applying quantization). Each picture of a video sequence is typically partitioned into non-overlapping sets of blocks, typically encoded at the block level. In other words, the encoder side typically processes, i.e., encodes, video at the block (video block) level, e.g., generates a prediction block by spatial (intra-picture) prediction and temporal (inter-picture) prediction, subtracts the prediction block from the current block (the currently processed or to be processed block) to obtain a residual block, transforms the residual block and quantizes the residual block in the transform domain to reduce the amount of data to be transmitted (compressed), while the decoder side applies the inverse processing portion relative to the encoder to the encoded or compressed block to reconstruct the current block for representation. In addition, the encoder replicates the decoder processing loop such that the encoder and decoder generate the same prediction (e.g., intra-prediction and inter-prediction) and/or reconstruction for processing, i.e., encoding, subsequent blocks.
The following describes a system architecture to which embodiments of the present invention are applied. Referring to fig. 1A, fig. 1A schematically shows a block diagram of a video encoding and decoding system 10 to which an embodiment of the present invention is applied. As shown in fig. 1A, video encoding and decoding system 10 may include a source device 12 and a destination device 14, source device 12 generating encoded video data, and thus source device 12 may be referred to as a video encoding apparatus. Destination device 14 may decode the encoded video data generated by source device 12, and thus destination device 14 may be referred to as a video decoding apparatus. Various implementations of source apparatus 12, destination apparatus 14, or both may include one or more processors and memory coupled to the one or more processors. The memory can 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 instructions or data structures that can be accessed by a computer, as described herein. Source apparatus 12 and destination apparatus 14 may comprise a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, on-board computers, wireless communication devices, or the like.
Although fig. 1A depicts source apparatus 12 and destination apparatus 14 as separate apparatuses, an apparatus embodiment may also include the functionality of both source apparatus 12 and destination apparatus 14 or both, i.e., source apparatus 12 or corresponding functionality and destination apparatus 14 or corresponding functionality. In such embodiments, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and/or software, or using separate hardware and/or software, or any combination thereof.
A communication connection may be made between source device 12 and destination device 14 over link 13, and destination device 14 may receive encoded video data from source device 12 via link 13. Link 13 may comprise one or more media or devices capable of moving encoded video data from source apparatus 12 to destination apparatus 14. In one example, link 13 may include one or more communication media that enable source device 12 to transmit encoded video data directly to destination device 14 in real-time. In this example, source apparatus 12 may modulate the encoded video data according to a communication standard, such as a wireless communication protocol, and may transmit the modulated video data to destination apparatus 14. The one or more communication media may include wireless and/or wired communication media such as a Radio Frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the internet). The one or more communication media may include a router, switch, base station, or other apparatus that facilitates communication from source apparatus 12 to destination apparatus 14.
Source device 12 includes an encoder 20, and in the alternative, source device 12 may also include a picture source 16, a picture preprocessor 18, and a communication interface 22. In one implementation, the encoder 20, the picture source 16, the picture preprocessor 18, and the communication interface 22 may be hardware components of the source device 12 or may be software programs of the source device 12. Described below, respectively:
the picture source 16, which may include or be any type of picture capturing device, may be used, for example, to capture real-world pictures, and/or any type of picture or comment generating device (for screen content encoding, some text on the screen is also considered part of the picture or image to be encoded), such as a computer graphics processor for generating computer animated pictures, or any type of device for obtaining and/or providing real-world pictures, computer animated pictures (e.g., screen content, virtual Reality (VR) pictures), and/or any combination thereof (e.g., augmented Reality (AR) pictures). The picture source 16 may be a camera for capturing pictures or a memory for storing pictures, and the picture source 16 may also include any kind of (internal or external) interface for storing previously captured or generated pictures and/or for obtaining or receiving pictures. When picture source 16 is a camera, picture source 16 may be, for example, an integrated camera local or integrated in the source device; when the picture source 16 is a memory, the picture source 16 may be an integrated memory local or integrated, for example, in the source device. When the picture source 16 comprises an interface, the interface may for example be an external interface receiving pictures from an external video source, for example an external picture capturing device such as a camera, an external memory or an external picture generating device, for example an external computer graphics processor, a computer or a server. The interface may be any kind of interface according to any proprietary or standardized interface protocol, e.g. a wired or wireless interface, an optical interface.
The picture can be regarded as a two-dimensional array or matrix of pixel elements (picture elements). The pixels in the array may also be referred to as sampling points. The number of sample points in the array or picture in the horizontal and vertical directions (or axes) defines the size and/or resolution of the picture. To represent color, three color components are typically employed, i.e., a picture may be represented as or contain three sample arrays. For example, in RBG format or color space, a picture includes corresponding arrays of red, green, and blue samples. However, in video coding, each pixel is typically represented in a luminance/chrominance format or color space, e.g. for pictures in YUV format, comprising a luminance component (sometimes also indicated with L) indicated by Y and two chrominance components indicated by U and V. The luminance (luma) component Y represents luminance or gray level intensity (e.g., both are the same in a gray scale picture), while the two chrominance (chroma) components U and V represent chrominance or color information components. Accordingly, a picture in YUV format includes a luma sample array of luma sample values (Y), and two chroma sample arrays of chroma values (U and V). Pictures in RGB format can be converted or transformed into YUV format and vice versa, a process also known as color transformation or conversion. If the picture is black and white, the picture may include only an array of luma samples. In the embodiment of the present invention, the pictures transmitted from the picture source 16 to the picture processor may also be referred to as raw picture data 17.
Picture pre-processor 18 is configured to receive original picture data 17 and perform pre-processing on original picture data 17 to obtain pre-processed picture 19 or pre-processed picture data 19. For example, the pre-processing performed by picture pre-processor 18 may include trimming, color format conversion (e.g., from RGB format to YUV format), toning, or de-noising.
An encoder 20, or video encoder 20, receives the pre-processed picture data 19, processes the pre-processed picture data 19 with a relevant prediction mode, such as the prediction mode in various embodiments herein, providing encoded picture data 21 (structural details of encoder 20 will be described further below based on fig. 2 or fig. 4 or fig. 5). In some embodiments, the encoder 20 may be configured to perform various embodiments described hereinafter to implement the application of the chroma block prediction method described in the present invention on the encoding side.
A communication interface 22, which may be used to receive encoded picture data 21 and may transmit encoded picture data 21 over link 13 to destination device 14 or any other device (e.g., memory) for storage or direct reconstruction, which may be any device for decoding or storage. The communication interface 22 may, for example, be used to encapsulate the encoded picture data 21 into a suitable format, such as a data packet, for transmission over the link 13.
Destination device 14 includes a decoder 30, and optionally destination device 14 may also include a communication interface 28, a picture post-processor 32, and a display device 34. Described below, respectively:
communication interface 28 may be used to receive encoded picture data 21 from source device 12 or any other source, such as a storage device, such as an encoded picture data storage device. The communication interface 28 may be used to transmit or receive the encoded picture data 21 by way of a link 13 between the source device 12 and the destination device 14, or by way of any type of network, such as a direct wired or wireless connection, any type of network, such as a wired or wireless network or any combination thereof, or any type of private and public networks, or any combination thereof. Communication interface 28 may, for example, be used to decapsulate data packets transmitted by communication interface 22 to obtain encoded picture data 21.
Both communication interface 28 and communication interface 22 may be configured as a one-way communication interface or a two-way communication interface, and may be used, for example, to send and receive messages to establish a connection, acknowledge and exchange any other information related to a communication link and/or data transfer, such as an encoded picture data transfer.
A decoder 30 (otherwise referred to as decoder 30) for receiving the encoded picture data 21 and providing decoded picture data 31 or decoded pictures 31 (structural details of the decoder 30 will be described further below based on fig. 3 or fig. 4 or fig. 5). In some embodiments, the decoder 30 may be configured to perform various embodiments described hereinafter to implement the application of the chroma block prediction method described in the present invention on the decoding side.
A picture post-processor 32 for performing post-processing on the decoded picture data 31 (also referred to as reconstructed picture data) to obtain post-processed picture data 33. Post-processing performed by picture post-processor 32 may include: color format conversion (e.g., from YUV format to RGB format), toning, trimming or resampling, or any other process may also be used to transmit post-processed picture data 33 to display device 34.
A display device 34 for receiving the post-processed picture data 33 for displaying pictures to, for example, a user or viewer. Display device 34 may be or may include any type of display for presenting the reconstructed picture, such as an integrated or external display or monitor. For example, the display may include a Liquid Crystal Display (LCD), an Organic Light Emitting Diode (OLED) display, a plasma display, a projector, a micro LED display, a liquid crystal on silicon (LCoS), a Digital Light Processor (DLP), or any other display of any kind.
Although fig. 1A depicts source device 12 and destination device 14 as separate devices, device embodiments may also include the functionality of both source device 12 and destination device 14 or both, i.e., source device 12 or corresponding functionality and destination device 14 or corresponding functionality. In such embodiments, source device 12 or corresponding functionality and destination device 14 or corresponding functionality may be implemented using the same hardware and/or software, or using separate hardware and/or software, or any combination thereof.
It will be apparent to those skilled in the art from this description that the existence and (exact) division of the functionality of the different elements or source device 12 and/or destination device 14 shown in fig. 1A may vary depending on the actual device and application. Source device 12 and destination device 14 may comprise any of a variety of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smartphone, a tablet or tablet computer, a camcorder, a desktop computer, a set-top box, a television, a camera, an in-vehicle device, a display device, a digital media player, a video game console, a video streaming device (e.g., a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, etc., and may not use or use any type of operating system.
Both encoder 20 and decoder 30 may be implemented as any of a variety of suitable circuits, such as one or more microprocessors, digital Signal Processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combinations thereof. If the techniques are implemented in part in software, an apparatus may store instructions of the software in a suitable non-transitory computer-readable storage medium and may execute the instructions in hardware using one or more processors to perform the techniques of this disclosure. Any of the foregoing may be considered as one or more processors, including hardware, software, combinations of hardware and software, and the like.
In some cases, the video encoding and decoding system 10 shown in fig. 1A is merely an example, and the techniques of this application may be applied to video encoding settings (e.g., video encoding or video decoding) that do not necessarily involve any data communication between the encoding and decoding devices. In other examples, the data may be retrieved from local storage, streamed over a network, and so on. A video encoding device may encode and store data to a memory, and/or a video decoding device may retrieve and decode data from a memory. In some examples, the encoding and decoding are performed by devices that do not communicate with each other, but only encode data to and/or retrieve data from memory and decode data.
Referring to fig. 1B, fig. 1B is an illustrative diagram of an example of a video coding system 40 including the encoder 20 of fig. 2 and/or the decoder 30 of fig. 3, according to an example embodiment. Video coding system 40 may implement a combination of the various techniques of embodiments of this disclosure. In the illustrated embodiment, video coding system 40 may include an imaging device 41, an encoder 20, a decoder 30 (and/or a video codec implemented by logic 47 of a processing unit 46), an antenna 42, one or more processors 43, one or more memories 44, and/or a display device 45.
As shown in fig. 1B, the imaging device 41, the antenna 42, the processing unit 46, the logic circuit 47, the encoder 20, the decoder 30, the processor 43, the memory 44, and/or the display device 45 can communicate with each other. As discussed, although video coding system 40 is depicted with encoder 20 and decoder 30, in different examples, video coding system 40 may include only encoder 20 or only decoder 30.
In some instances, antenna 42 may be used to transmit or receive an encoded bitstream of video data. Additionally, in some instances, display device 45 may be used to present video data. In some examples, logic 47 may be implemented by processing unit 46. The processing unit 46 may comprise application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, or the like. Video decoding system 40 may also include an optional processor 43, which optional processor 43 similarly may include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, etc. In some examples, the logic 47 may be implemented in hardware, such as video encoding specific hardware, and the processor 43 may be implemented in general purpose software, an operating system, and so on. In addition, the Memory 44 may be any type of Memory, such as a volatile Memory (e.g., static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), etc.) or a nonvolatile Memory (e.g., flash Memory, etc.), and the like. In a non-limiting example, storage 44 may be implemented by an ultracache memory. In some examples, logic circuitry 47 may access memory 44 (e.g., to implement an image buffer). In other examples, logic 47 and/or processing unit 46 may include memory (e.g., cache, etc.) for implementing image buffers, etc.
In some examples, encoder 20, implemented by logic circuitry, may include an image buffer (e.g., implemented by processing unit 46 or memory 44) and a graphics processing unit (e.g., implemented by processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include an encoder 20 implemented by logic circuitry 47 to implement the various modules discussed with reference to fig. 2 and/or any other encoder system or subsystem described herein. Logic circuitry may be used to perform various operations discussed herein.
In some examples, decoder 30 may be implemented by logic circuitry 47 in a similar manner to implement the various modules discussed with reference to decoder 30 of fig. 3 and/or any other decoder system or subsystem described herein. In some examples, logic circuit implemented decoder 30 may include an image buffer (implemented by processing unit 2820 or memory 44) and a graphics processing unit (e.g., implemented by processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include a decoder 30 implemented by logic circuitry 47 to implement the various modules discussed with reference to fig. 3 and/or any other decoder system or subsystem described herein.
In some instances, antenna 42 may be used to receive an encoded bitstream of video data. As discussed, the encoded bitstream may include data, indicators, index values, mode selection data, etc., discussed herein, related to the encoded video frame, such as data related to the encoding partition (e.g., transform coefficients or quantized transform coefficients, (as discussed) optional indicators, and/or data defining the encoding partition). Video coding system 40 may also include a decoder 30 coupled to antenna 42 and used to decode the encoded bitstream. The display device 45 is used to present video frames.
It should be understood that for the example described with reference to encoder 20 in the embodiments of the present invention, decoder 30 may be used to perform the reverse process. With respect to signaling syntax elements, decoder 30 may be configured to receive and parse such syntax elements and decode the associated video data accordingly. In some examples, encoder 20 may entropy encode the syntax elements into an encoded video bitstream. In such instances, decoder 30 may parse such syntax elements and decode the relevant video data accordingly.
It should be noted that the motion vector prediction method based on the affine motion model described in the embodiment of the present invention is mainly used in the inter-frame prediction process, which exists in both the encoder 20 and the decoder 30, and the encoder 20 and the decoder 30 in the embodiment of the present invention may be a video standard protocol such as h.263, h.264, HEVV, MPEG-2, MPEG-4, VP8, VP9, or a codec corresponding to a next generation video standard protocol (e.g., h.266).
Referring to fig. 2, fig. 2 shows a schematic/conceptual block diagram of an example of an encoder 20 for implementing an embodiment of the invention. In the example of fig. 2, encoder 20 includes a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a Decoded Picture Buffer (DPB) 230, a prediction processing unit 260, and an entropy encoding unit 270. Prediction processing unit 260 may include inter prediction unit 244, intra prediction unit 254, and mode selection unit 262. Inter prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). The encoder 20 shown in fig. 2 may also be referred to as a hybrid video encoder or a video encoder according to a hybrid video codec.
For example, the residual calculation unit 204, the transform processing unit 206, the quantization unit 208, the prediction processing unit 260, and the entropy encoding unit 270 form a forward signal path of the encoder 20, and, for example, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the Decoded Picture Buffer (DPB) 230, the prediction processing unit 260 form a backward signal path of the encoder, wherein the backward signal path of the encoder corresponds to a signal path of a decoder (see the decoder 30 in fig. 3).
The encoder 20 receives, e.g., via an input 202, a picture 201 or an image block 203 of a picture 201, e.g., a picture in a sequence of pictures forming a video or a video sequence. Image block 203 may also be referred to as a current picture block or a picture block to be encoded, and picture 201 may be referred to as a current picture or a picture to be encoded (especially when the current picture is distinguished from other pictures in video encoding, such as previously encoded and/or decoded pictures in the same video sequence, i.e., a video sequence that also includes the current picture).
An embodiment of the encoder 20 may comprise a partitioning unit (not shown in fig. 2) for partitioning the picture 201 into a plurality of blocks, e.g. image blocks 203, typically into a plurality of non-overlapping blocks. The partitioning unit may be used to use the same block size for all pictures in a video sequence and a corresponding grid defining the block size, or to change the block size between pictures or subsets or groups of pictures and partition each picture into corresponding blocks.
In one example, prediction processing unit 260 of encoder 20 may be used to perform any combination of the above-described segmentation techniques.
Like picture 201, image block 203 is also or can be considered as a two-dimensional array or matrix of sample points having sample values, although its size is smaller than picture 201. In other words, the image block 203 may comprise, for example, one sample array (e.g., a luma array in the case of a black and white picture 201) or three sample arrays (e.g., a luma array and two chroma arrays in the case of a color picture) or any other number and/or class of arrays depending on the color format applied. The number of sampling points in the horizontal and vertical directions (or axes) of the image block 203 defines the size of the image block 203.
The encoder 20 as shown in fig. 2 is used to encode a picture 201 block by block, e.g. performing encoding and prediction for each image block 203.
The residual calculation unit 204 is configured to calculate a residual block 205 based on the picture image block 203 and the prediction block 265 (further details of the prediction block 265 are provided below), e.g. by subtracting sample values of the prediction block 265 from sample values of the picture image block 203 sample by sample (pixel by pixel) to obtain the residual block 205 in the sample domain.
The transform processing unit 206 is configured to apply a transform, such as a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST), on the sample values of the residual block 205 to obtain transform coefficients 207 in a transform domain. The transform coefficients 207 may also be referred to as transform residual coefficients and represent the residual block 205 in the transform domain.
The transform processing unit 206 may be configured to apply integer approximations of DCT/DST, such as the transform specified for HEVC/h.265. Such integer approximations are typically scaled by some factor compared to the orthogonal DCT transform. To maintain the norm of the residual block processed by the forward and inverse transforms, an additional scaling factor is applied as part of the transform process. The scaling factor is typically selected based on certain constraints, e.g., the scaling factor is a power of 2 for a shift operation, a trade-off between bit depth of transform coefficients, accuracy and implementation cost, etc. For example, a specific scaling factor may be specified for the inverse transform at the decoder 30 side by, for example, the inverse transform processing unit 212 (and for the corresponding inverse transform at the encoder 20 side by, for example, the inverse transform processing unit 212), and correspondingly, a corresponding scaling factor may be specified for the forward transform at the encoder 20 side by the transform processing unit 206.
Quantization unit 208 is used to quantize transform coefficients 207, e.g., by applying scalar quantization or vector quantization, to obtain quantized transform coefficients 209. Quantized transform coefficients 209 may also be referred to as quantized residual coefficients 209. The quantization process may reduce the bit depth associated with some or all of transform coefficients 207. For example, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient during quantization, where n is greater than m. The quantization level may be modified by adjusting a Quantization Parameter (QP). For example, for scalar quantization, different scales may be applied to achieve finer or coarser quantization. Smaller quantization steps correspond to finer quantization and larger quantization steps correspond to coarser quantization. An appropriate quantization step size may be indicated by a Quantization Parameter (QP). For example, the quantization parameter may be an index of a predefined set of suitable quantization step sizes. For example, a smaller quantization parameter may correspond to a fine quantization (smaller quantization step size) and a larger quantization parameter may correspond to a coarse quantization (larger quantization step size), or vice versa. The quantization may comprise a division by a quantization step size and a corresponding quantization or inverse quantization, e.g. performed by inverse quantization 210, or may comprise a multiplication by a quantization step size. Embodiments according to some standards, such as HEVC, may use a quantization parameter to determine the quantization step size. In general, the quantization step size may be calculated based on the quantization parameter using a fixed point approximation of an equation that includes division. Additional scaling factors may be introduced for quantization and dequantization to recover the norm of the residual block that may be modified due to the scale used in the fixed point approximation of the equation for the quantization step size and quantization parameter. In one example implementation, the inverse transform and inverse quantization scales may be combined. Alternatively, a custom quantization table may be used and signaled from the encoder to the decoder, e.g., in a bitstream. Quantization is a lossy operation, where the larger the quantization step size, the greater the loss.
The inverse quantization unit 210 is to apply inverse quantization of the quantization unit 208 on the quantized coefficients to obtain inverse quantized coefficients 211, e.g., to apply an inverse quantization scheme of the quantization scheme applied by the quantization unit 208 based on or using the same quantization step as the quantization unit 208. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211, corresponding to transform coefficients 207, although the loss due to quantization is typically not the same as the transform coefficients.
The inverse transform processing unit 212 is configured to apply an inverse transform of the transform applied by the transform processing unit 206, for example, an inverse Discrete Cosine Transform (DCT) or an inverse Discrete Sine Transform (DST), to obtain an inverse transform block 213 in the sample domain. The inverse transform block 213 may also be referred to as an inverse transform dequantized block 213 or an inverse transform residual block 213.
A reconstruction unit 214 (e.g., summer 214) is used to add the inverse transform block 213 (i.e., reconstructed residual block 213) to the prediction block 265 to obtain a reconstructed block 215 in the sample domain, e.g., to add sample values of the reconstructed residual block 213 to sample values of the prediction block 265.
Optionally, a buffer unit 216 (or simply "buffer" 216), such as a line buffer 216, is used to buffer or store the reconstructed block 215 and corresponding sample values for, e.g., intra prediction. In other embodiments, the encoder may be used to use the unfiltered reconstructed block and/or corresponding sample values stored in buffer unit 216 for any class of estimation and/or prediction, such as intra prediction.
For example, an embodiment of encoder 20 may be configured such that buffer unit 216 is used not only to store reconstructed blocks 215 for intra prediction 254, but also for loop filter unit 220 (not shown in fig. 2), and/or such that buffer unit 216 and decoded picture buffer unit 230 form one buffer, for example. Other embodiments may be used to use filtered block 221 and/or blocks or samples from decoded picture buffer 230 (neither shown in fig. 2) as input or basis for intra prediction 254.
The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstructed block 215 to obtain a filtered block 221, so as to facilitate pixel transition or improve video quality. Loop filter unit 220 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an Adaptive Loop Filter (ALF), or a sharpening or smoothing filter, or a collaborative filter. Although loop filter unit 220 is shown in fig. 2 as an in-loop filter, in other configurations, loop filter unit 220 may be implemented as a post-loop filter. The filtered block 221 may also be referred to as a filtered reconstructed block 221. The decoded picture buffer 230 may store the reconstructed encoded block after the loop filter unit 220 performs a filtering operation on the reconstructed encoded block.
Embodiments of encoder 20 (correspondingly, loop filter unit 220) may be configured to output loop filter parameters (e.g., sample adaptive offset information), e.g., directly or after entropy encoding by entropy encoding unit 270 or any other entropy encoding unit, e.g., such that decoder 30 may receive and apply the same loop filter parameters for decoding.
Decoded Picture Buffer (DPB) 230 may be a reference picture memory that stores reference picture data for use by encoder 20 in encoding video data. DPB 230 may be formed from any of a variety of 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 DPB 230 and the buffer 216 may be provided by the same memory device or separate memory devices. In a certain example, a Decoded Picture Buffer (DPB) 230 is used to store filtered blocks 221. Decoded picture buffer 230 may further be used to store other previously filtered blocks, such as previously reconstructed and filtered blocks 221, of the same current picture or of a different picture, such as a previously reconstructed picture, and may provide a complete previously reconstructed, i.e., decoded picture (and corresponding reference blocks and samples) and/or a partially reconstructed current picture (and corresponding reference blocks and samples), such as for inter prediction. In a certain example, if reconstructed block 215 is reconstructed without in-loop filtering, decoded Picture Buffer (DPB) 230 is used to store reconstructed block 215.
Prediction processing unit 260, also referred to as block prediction processing unit 260, is used to receive or obtain image block 203 (current image block 203 of current picture 201) and reconstructed picture data, e.g., reference samples of the same (current) picture from buffer 216 and/or reference picture data 231 of one or more previously decoded pictures from decoded picture buffer 230, and to process such data for prediction, i.e., to provide prediction block 265, which may be inter-predicted block 245 or intra-predicted block 255.
The mode selection unit 262 may be used to select a prediction mode (e.g., intra or inter prediction mode) and/or a corresponding prediction block 245 or 255 used as the prediction block 265 to calculate the residual block 205 and reconstruct the reconstructed block 215.
Embodiments of mode selection unit 262 may be used to select a prediction mode (e.g., selected from those supported by prediction processing unit 260) that provides the best match or minimum residual (minimum residual means better compression in transmission or storage), or that provides the minimum signaling overhead (minimum signaling overhead means better compression in transmission or storage), or both. The mode selection unit 262 may be configured to determine a prediction mode based on Rate Distortion Optimization (RDO), i.e., select a prediction mode that provides the minimum rate distortion optimization, or select a prediction mode in which the associated rate distortion at least meets the prediction mode selection criteria.
The prediction processing performed by the example of the encoder 20 (e.g., by the prediction processing unit 260) and the mode selection performed (e.g., by the mode selection unit 262) will be explained in detail below.
As described above, the encoder 20 is configured to determine or select the best or optimal prediction mode from a set of (predetermined) prediction modes. The set of prediction modes may include, for example, intra-prediction modes and/or inter-prediction modes.
The intra prediction mode set may include 35 different intra prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in h.265, or may include 67 different intra prediction modes, for example, non-directional modes such as DC (or mean) mode and planar mode, or directional modes as defined in h.266 under development.
In possible implementations, the set of inter Prediction modes may include, for example, an Advanced Motion Vector Prediction (AMVP) mode and a merge (merge) mode depending on available reference pictures (i.e., at least partially decoded pictures stored in the DBP 230, for example, as described above) and other inter Prediction parameters, e.g., depending on whether the entire reference picture or only a portion of the reference picture, such as a search window region of a region surrounding the current block, is used to search for a best matching reference block, and/or depending on whether pixel interpolation, such as half-pixel and/or quarter-pixel interpolation, is applied, for example. In a specific implementation, the inter prediction mode set may include an improved control point-based AMVP mode and an improved control point-based merge mode according to an embodiment of the present invention. In one example, intra-prediction unit 254 may be used to perform any combination of the inter-prediction techniques described below.
In addition to the above prediction mode, embodiments of the present invention may also apply a skip mode and/or a direct mode.
The prediction processing unit 260 may further be configured to partition the image block 203 into smaller block partitions or sub-blocks, for example, by iteratively using quad-tree (QT) partitions, binary-tree (BT) partitions, or ternary-tree (TT) partitions, or any combination thereof, and to perform prediction, for example, for each of the block partitions or sub-blocks, wherein the mode selection includes selecting a tree structure of the partitioned image block 203 and selecting a prediction mode to apply to each of the block partitions or sub-blocks.
The inter prediction unit 244 may include a Motion Estimation (ME) unit (not shown in fig. 2) and a Motion Compensation (MC) unit (not shown in fig. 2). The motion estimation unit is used to receive or obtain a picture image block 203 (current picture image block 203 of current picture 201) and a decoded picture 231, or at least one or more previously reconstructed blocks, e.g., reconstructed blocks of one or more other/different previously decoded pictures 231, for motion estimation. For example, the video sequence may comprise a current picture and a previously decoded picture 31, or in other words, the current picture and the previously decoded picture 31 may be part of, or form, a sequence of pictures forming the video sequence.
For example, the encoder 20 may be configured to select a reference block from a plurality of reference blocks of the same or different one of a plurality of other pictures and provide the reference picture and/or an offset (spatial offset) between a position (X, Y coordinates) of the reference block and a position of the current block to a motion estimation unit (not shown in fig. 2) as an inter prediction parameter. This offset is also called Motion Vector (MV).
The motion compensation unit is configured to obtain inter-prediction parameters and perform inter-prediction based on or using the inter-prediction parameters to obtain an inter-prediction block 245. The motion compensation performed by the motion compensation unit (not shown in fig. 2) may involve taking or generating a prediction block based on a motion/block vector determined by motion estimation (possibly performing interpolation to sub-pixel precision). Interpolation filtering may generate additional pixel samples from known pixel samples, potentially increasing the number of candidate prediction blocks that may be used to encode a picture block. Upon receiving the motion vector for the PU of the current picture block, motion compensation unit 246 may locate the prediction block in one reference picture list to which the motion vector points. Motion compensation unit 246 may also generate syntax elements associated with the blocks and video slices for use by decoder 30 in decoding picture blocks of a video slice.
Specifically, the inter prediction unit 244 may transmit a syntax element including an inter prediction parameter (e.g., indication information for selecting an inter prediction mode for current block prediction after traversing a plurality of inter prediction modes) to the entropy encoding unit 270. In a possible application scenario, if there is only one inter prediction mode, the inter prediction parameters may not be carried in the syntax element, and the decoding end 30 can directly use the default prediction mode for decoding. It will be appreciated that the inter prediction unit 244 may be used to perform any combination of inter prediction techniques.
The intra prediction unit 254 is used to obtain, for example, a picture block 203 (current picture block) of the same picture and one or more previously reconstructed blocks, e.g., reconstructed neighboring blocks, to be received for intra estimation. For example, the encoder 20 may be configured to select an intra-prediction mode from a plurality of (predetermined) intra-prediction modes.
Embodiments of encoder 20 may be used to select the intra prediction mode based on optimization criteria, such as based on a minimum residual (e.g., the intra prediction mode that provides the prediction block 255 most similar to the current picture block 203) or a minimum rate distortion.
The intra-prediction unit 254 is further configured to determine the intra-prediction block 255 based on the intra-prediction parameters as the selected intra-prediction mode. In any case, after selecting the intra-prediction mode for the block, intra-prediction unit 254 is also used to provide intra-prediction parameters, i.e., information indicating the selected intra-prediction mode for the block, to entropy encoding unit 270. In one example, intra-prediction unit 254 may be used to perform any combination of intra-prediction techniques.
Specifically, the above-described intra prediction unit 254 may transmit a syntax element including an intra prediction parameter (such as indication information of selecting an intra prediction mode for current block prediction after traversing a plurality of intra prediction modes) to the entropy encoding unit 270. In a possible application scenario, if there is only one intra-prediction mode, the intra-prediction parameters may not be carried in the syntax element, and the decoding end 30 may directly use the default prediction mode for decoding.
Entropy encoding unit 270 is configured to apply an entropy encoding algorithm or scheme (e.g., a Variable Length Coding (VLC) scheme, a Context Adaptive VLC (CAVLC) scheme, an arithmetic coding scheme, a Context Adaptive Binary Arithmetic Coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability Interval Partitioning Entropy (PIPE) coding, or other entropy encoding methods or techniques) to individual or all of quantized residual coefficients 209, inter-prediction parameters, intra-prediction parameters, and/or loop filter parameters (or not) to obtain encoded picture data 21 that may be output by output 272 in the form of, for example, encoded bitstream 21. The encoded bitstream may be transmitted to video decoder 30 or archived for later transmission or retrieval by video decoder 30. Entropy encoding unit 270 may also be used to entropy encode other syntax elements of the current video slice being encoded.
Other structural variations of video encoder 20 may be used to encode the video stream. For example, the non-transform based encoder 20 may quantize the residual signal directly without the transform processing unit 206 for certain blocks or frames. In another embodiment, the encoder 20 may have the quantization unit 208 and the inverse quantization unit 210 combined into a single unit.
Specifically, in the embodiment of the present invention, the encoder 20 may be used to implement an affine motion model-based motion vector prediction method described in the following embodiments.
Referring to fig. 3, fig. 3 shows a schematic/conceptual block diagram of an example of a decoder 30 for implementing an embodiment of the invention. Video decoder 30 is operative to receive encoded picture data (e.g., an encoded bitstream) 21, e.g., encoded by encoder 20, to obtain a decoded picture 231. During the decoding process, video decoder 30 receives video data, such as an encoded video bitstream representing picture blocks of an encoded video slice and associated syntax elements, from video encoder 20.
In the example of fig. 3, decoder 30 includes entropy decoding unit 304, inverse quantization unit 310, inverse transform processing unit 312, reconstruction unit 314 (e.g., summer 314), buffer 316, loop filter 320, decoded picture buffer 330, and prediction processing unit 360. The prediction processing unit 360 may include an inter prediction unit 344, an intra prediction unit 354, and a mode selection unit 362. In some examples, video decoder 30 may perform a decoding pass that is substantially reciprocal to the encoding pass described with reference to video encoder 20 of fig. 2.
Entropy decoding unit 304 is to perform entropy decoding on encoded picture data 21 to obtain, for example, quantized coefficients 309 and/or decoded encoding parameters (not shown in fig. 3), such as any or all of inter-prediction, intra-prediction parameters, loop filter parameters, and/or other syntax elements (decoded). The entropy decoding unit 304 is further for forwarding the inter-prediction parameters, the intra-prediction parameters, and/or other syntax elements to the prediction processing unit 360. Video decoder 30 may receive syntax elements at the video slice level and/or the video block level.
Inverse quantization unit 310 may be functionally identical to inverse quantization unit 110, inverse transform processing unit 312 may be functionally identical to inverse transform processing unit 212, reconstruction unit 314 may be functionally identical to reconstruction unit 214, buffer 316 may be functionally identical to buffer 216, loop filter 320 may be functionally identical to loop filter 220, and decoded picture buffer 330 may be functionally identical to decoded picture buffer 230.
Prediction processing unit 360 may include inter prediction unit 344 and intra prediction unit 354, where inter prediction unit 344 may be functionally similar to inter prediction unit 244 and intra prediction unit 354 may be functionally similar to intra prediction unit 254. The prediction processing unit 360 is typically used to perform block prediction and/or to obtain a prediction block 365 from the encoded data 21, as well as to receive or obtain (explicitly or implicitly) prediction related parameters and/or information about the selected prediction mode from, for example, the entropy decoding unit 304.
When the video slice is encoded as an intra-coded (I) slice, intra-prediction unit 354 of prediction processing unit 360 is used to generate a prediction block 365 for the picture block of the current video slice based on the signaled intra-prediction mode and data from previously decoded blocks of the current frame or picture. When a video frame is encoded as an inter-coded (i.e., B or P) slice, inter prediction unit 344 (e.g., a motion compensation unit) of prediction processing unit 360 is used to generate a prediction block 365 for the video block of the current video slice based on the motion vectors and other syntax elements received from entropy decoding unit 304. For inter prediction, a prediction block may be generated from one reference picture within one reference picture list. Video decoder 30 may construct the reference frame list using default construction techniques based on the reference pictures stored in DPB 330: list 0 and list 1.
Prediction processing unit 360 is used to determine prediction information for the video blocks of the current video slice by parsing the motion vectors and other syntax elements, and to generate a prediction block for the current video block being decoded using the prediction information. In an example of this disclosure, prediction processing unit 360 uses some of the syntax elements received to determine a prediction mode (e.g., intra or inter prediction) for encoding video blocks of a video slice, an inter prediction slice type (e.g., B-slice, P-slice, or GPB-slice), construction information for one or more of the reference picture lists for the slice, a motion vector for each inter-coded video block of the slice, an inter prediction state for each inter-coded video block of the slice, and other information to decode video blocks of the current video slice. In another example of the present disclosure, the syntax elements received by video decoder 30 from the bitstream include syntax elements received in one or more of an Adaptive Parameter Set (APS), a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), or a slice header.
Inverse quantization unit 310 may be used to inverse quantize (i.e., inverse quantize) the quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit 304. The inverse quantization process may include using quantization parameters calculated by video encoder 20 for each video block in the video slice to determine the degree of quantization that should be applied and likewise the degree of inverse quantization that should be applied.
Inverse transform processing unit 312 is used to apply an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients in order to produce a block of residuals in the pixel domain.
Reconstruction unit 314 (e.g., summer 314) is used to add inverse transform block 313 (i.e., reconstructed residual block 313) to prediction block 365 to obtain reconstructed block 315 in the sample domain, e.g., by adding sample values of reconstructed residual block 313 to sample values of prediction block 365.
Loop filter unit 320 (during or after the encoding cycle) is used to filter reconstructed block 315 to obtain filtered block 321 to facilitate pixel transitions or to improve video quality. In one example, loop filter unit 320 may be used to perform any combination of the filtering techniques described below. Loop filter unit 320 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an Adaptive Loop Filter (ALF), or a sharpening or smoothing filter, or a collaborative filter. Although loop filter unit 320 is shown in fig. 3 as an in-loop filter, in other configurations, loop filter unit 320 may be implemented as a post-loop filter.
Decoded video block 321 in a given frame or picture is then stored in decoded picture buffer 330, which stores reference pictures for subsequent motion compensation.
Decoder 30 is used to output decoded picture 31, e.g., via output 332, for presentation to or viewing by a user.
Other variations of video decoder 30 may be used to decode the compressed bitstream. For example, decoder 30 may generate an output video stream without loop filter unit 320. For example, the non-transform based decoder 30 may directly inverse quantize the residual signal without the inverse transform processing unit 312 for certain blocks or frames. In another embodiment, video decoder 30 may have inverse quantization unit 310 and inverse transform processing unit 312 combined into a single unit.
Specifically, in the embodiment of the present invention, the decoder 30 is configured to implement an affine motion model-based motion vector prediction method described in the following embodiments.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a video coding apparatus 400 (e.g., a video encoding apparatus 400 or a video decoding apparatus 400) according to an embodiment of the present invention. Video coding apparatus 400 is suitable for implementing the embodiments described herein. In one embodiment, video coding device 400 may be a video decoder (e.g., decoder 30 of fig. 1A) or a video encoder (e.g., encoder 20 of fig. 1A). In another embodiment, video coding device 400 may be one or more components of decoder 30 of fig. 1A or encoder 20 of fig. 1A described above.
Video coding apparatus 400 includes: an ingress port 410 and a reception unit (Rx) 420 for receiving data, a processor, logic unit or Central Processing Unit (CPU) 430 for processing data, a transmitter unit (Tx) 440 and an egress port 450 for transmitting data, and a memory 460 for storing data. Video coding device 400 may also include optical-to-electrical conversion components and electrical-to-optical (EO) components coupled with ingress port 410, receiver unit 420, transmitter unit 440, and egress port 450 for egress or ingress of optical or electrical signals.
The processor 430 is implemented by hardware and software. Processor 430 may be implemented as one or more CPU chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. Processor 430 is in communication with inlet port 410, receiver unit 420, transmitter unit 440, outlet port 450, and memory 460. Processor 430 includes a coding module 470 (e.g., encoding module 470 or decoding module 470). The encoding/decoding module 470 implements the embodiments disclosed herein to implement the chroma block prediction method provided by the embodiments of the present invention. For example, the encoding/decoding module 470 implements, processes, or provides various encoding operations. Accordingly, a substantial improvement is provided to the function of the video coding apparatus 400 by the encoding/decoding module 470 and affects the transition of the video coding apparatus 400 to different states. Alternatively, the encode/decode module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.
The memory 460, which may include one or more disks, tape drives, and solid state drives, may be used as an over-flow data storage device for storing programs when such programs are selectively executed, and for storing instructions and data that are read during program execution. The memory 460 may be volatile and/or nonvolatile, and may be Read Only Memory (ROM), random Access Memory (RAM), random access memory (TCAM), and/or Static Random Access Memory (SRAM).
Referring to fig. 5, fig. 5 is a simplified block diagram of an apparatus 500 that may be used as either or both of source device 12 and destination device 14 in fig. 1A according to an example embodiment. Apparatus 500 may implement the techniques of this application, and apparatus 500 for implementing chroma block prediction may take the form of a computing system including multiple computing devices, or a single computing device such as a mobile phone, tablet computer, laptop computer, notebook computer, desktop computer, or the like.
The processor 502 in the apparatus 500 may be a central processor. Alternatively, processor 502 may be any other type of device or devices now or later developed that is capable of manipulating or processing information. As shown, although the disclosed embodiments may be practiced using a single processor, such as processor 502, speed and efficiency advantages may be realized using more than one processor.
In one embodiment, the Memory 504 of the apparatus 500 may be a Read Only Memory (ROM) device or a Random Access Memory (RAM) device. Any other suitable type of storage device may be used for memory 504. The memory 504 may include code and data 506 that is accessed by the processor 502 using the bus 512. The memory 504 may further include an operating system 508 and application programs 510, the application programs 510 including at least one program that permits the processor 502 to perform the methods described herein. For example, applications 510 may include applications 1 through N, applications 1 through N further including video coding applications that perform the methods described herein. The apparatus 500 may also include additional memory in the form of a slave memory 514, the slave memory 514 may be, for example, a memory card for use with a mobile computing device. Because a video communication session may contain a large amount of information, this information may be stored in whole or in part in the slave memory 514 and loaded into the memory 504 for processing as needed.
Device 500 may also include one or more output apparatuses, such as a display 518. In one example, display 518 may be a touch-sensitive display that combines a display and a touch-sensitive element operable to sense touch inputs. A display 518 may be coupled to the processor 502 via the bus 512. Other output devices that permit a user to program apparatus 500 or otherwise use apparatus 500 may be provided in addition to display 518, or other output devices may be provided as an alternative to display 518. When the output device is or includes a display, the display may be implemented in different ways, including by a Liquid Crystal Display (LCD), a cathode-ray tube (CRT) display, a plasma display, or a Light Emitting Diode (LED) display, such as an Organic LED (OLED) display.
The apparatus 500 may also include or be in communication with an image sensing device 520, the image sensing device 520 being, for example, a camera or any other image sensing device 520 now or later developed that can sense an image, such as an image of a user running the apparatus 500. The image sensing device 520 may be placed directly facing the user running the apparatus 500. In an example, the position and optical axis of image sensing device 520 may be configured such that its field of view includes an area proximate display 518 and display 518 is visible from that area.
The apparatus 500 may also include or be in communication with a sound sensing device 522, such as a microphone or any other sound sensing device now known or later developed that can sense sound in the vicinity of the apparatus 500. The sound sensing device 522 may be positioned to face directly the user operating the apparatus 500 and may be used to receive sounds, such as speech or other utterances, emitted by the user while operating the apparatus 500.
Although the processor 502 and memory 504 of the apparatus 500 are depicted in fig. 5 as being integrated in a single unit, other configurations may also be used. The operations of processor 502 may be distributed among multiple directly couplable machines (each machine having one or more processors), or distributed in a local area or other network. Memory 504 may be distributed among multiple machines, such as a network-based memory or a memory among multiple machines running apparatus 500. Although only a single bus is depicted here, the bus 512 of the device 500 may be formed from multiple buses. Further, the secondary memory 514 may be directly coupled to other components of the apparatus 500 or may be accessible over a network and may comprise a single integrated unit, such as one memory card, or multiple units, such as multiple memory cards. Accordingly, the apparatus 500 may be implemented in a variety of configurations.
In order to better understand the technical solution of the embodiment of the present invention, the inter-frame prediction mode, the non-translational motion model, the inherited control point motion vector prediction method, and the constructed control point motion vector prediction method related to the embodiment of the present invention are further described below.
1) Inter prediction mode. In HEVC, two inter prediction modes are used, an Advanced Motion Vector Prediction (AMVP) mode and a merge (merge) mode, respectively.
For the AMVP mode, first traverse spatial or temporal neighboring coded blocks (denoted as neighboring blocks) of a current block, construct a candidate motion vector list (which may also be referred to as a motion information candidate list) according to motion information of each neighboring block, then determine an optimal motion vector from the candidate motion vector list by a rate distortion cost, and use the candidate motion information with the minimum rate distortion cost as a Motion Vector Predictor (MVP) of the current block. The positions of the adjacent blocks and the traversal order thereof are predefined. The rate distortion Cost is calculated by formula (1), wherein J represents a rate distortion Cost RD Cost, SAD is the Sum of Absolute Differences (SAD) between a predicted pixel value and an original pixel value, which are obtained by performing motion estimation using a candidate motion vector prediction value, R represents a code rate, and λ represents a lagrange multiplier. And the encoding end transmits the index value of the selected motion vector predicted value in the candidate motion vector list and the reference frame index value to the decoding end. Further, motion search is performed in a neighborhood with the MVP as the center to obtain the actual motion vector of the current block, and the encoding end transmits the difference (motion vector difference) between the MVP and the actual motion vector to the decoding end.
J=SAD+λR (1)
For the Merge mode, a candidate motion vector list is constructed through motion information of coded blocks adjacent to a current block in a space domain or a time domain, then the optimal motion information is determined from the candidate motion vector list through calculating rate distortion cost and is used as the motion information of the current block, and then an index value (marked as Merge index, the same below) of the position of the optimal motion information in the candidate motion vector list is transmitted to a decoding end. The spatial and temporal candidate motion information of the current block are shown in fig. 6, the spatial candidate motion information is from 5 spatially adjacent blocks (A0, A1, B0, B1, and B2), and if the adjacent block is not available (the adjacent block does not exist or is not encoded or the prediction mode adopted by the adjacent block is not the inter prediction mode), the motion information of the adjacent block is not added to the candidate motion vector list. The time domain candidate motion information of the current block is obtained by scaling the MV of the block at the corresponding position in the reference frame according to the Picture Order Count (POC) of the reference frame and the current frame. Firstly, judging whether a block at a T position in a reference frame is available or not, and if not, selecting a block at a C position.
Similar to AMVP mode, the positions of neighboring blocks and their traversal order in Merge mode are also predefined, and the positions of neighboring blocks and their traversal order may be different in different modes.
It can be seen that in both AMVP mode and Merge mode, a list of candidate motion vectors needs to be maintained. Before adding new motion information to the candidate list each time, it is checked whether the same motion information already exists in the list, and if so, the motion information is not added to the list. We refer to this checking process as pruning of the candidate motion vector list. List pruning is to prevent the same motion information from appearing in the list, and avoid redundant rate-distortion cost calculations.
In the inter-frame prediction of HEVC, all pixels in a coding block use the same motion information (i.e., the motion of all pixels in the coding block is consistent), and then motion compensation is performed according to the motion information to obtain the prediction value of the pixel of the coding block. However, in a coded block, not all pixels have the same motion characteristics, and using the same motion information may cause inaccuracy of motion compensated prediction, thereby increasing residual information.
That is, the existing video coding standard uses block matching motion estimation based on a translational motion model, but since in the real world, there are many objects with non-translational motion, such as rotating objects, roller coasters rotating in different directions, some special effects in fireworks and movies being launched, especially moving objects in UGC scenes, and coding them, if the block motion compensation technology based on the translational motion model in the current coding standard is adopted, the coding efficiency will be greatly affected, and therefore, a non-translational motion model, such as an affine motion model, is generated, so as to further improve the coding efficiency.
Based on this, the AMVP mode can be classified into an AMVP mode based on a translational model and an AMVP mode based on a non-translational model according to a difference of motion models; the Merge modes can be classified into a Merge mode based on a translational motion model and a Merge mode based on a non-translational motion model.
2) A non-translational motion model. The non-translational motion model prediction means that the same motion model is used at the encoding and decoding end to deduce the motion information of each sub-motion compensation unit in the current block, and motion compensation is carried out according to the motion information of the sub-motion compensation units to obtain a prediction block, so that the prediction efficiency is improved. The sub-motion compensation unit involved in the embodiment of the present invention may be a pixel or a sub-motion compensation unit divided according to a specific method and having a size of N 1 ×N 2 Of a pixel block of (A), wherein N 1 And N 2 Are all positive integers, N 1 May be equal to N 2 Or may not be equal to N 2
Common non-translational motion models include a 4-parameter affine motion model or a 6-parameter affine motion model, and in a possible application scenario, an 8-parameter bilinear model. Which will be separately described below.
For a 4-parameter affine motion model, the 4-parameter affine motion model is shown in equation (2) below:
Figure BDA0001805725400000241
the 4-parameter affine motion model can be represented by the motion vectors of two pixel points and the coordinates thereof with respect to the top left vertex pixel of the current block, and the pixel points used to represent the motion model parameters are referred to as control points. If pixel points of the upper left vertex (0, 0) and the upper right vertex (W, 0) are used as control points, motion vectors (vx 0, vy 0) and (vx 1, vy 1) of the control points of the upper left vertex and the upper right vertex of the current block are determined, and then motion information of each sub motion compensation unit in the current block is obtained according to the following formula (3), wherein (x, y) is the coordinate of the sub motion compensation unit relative to the pixel of the upper left vertex of the current block, and W is the width of the current block.
Figure BDA0001805725400000242
For a 6-parameter affine motion model, the 6-parameter affine motion model is shown in equation (4) below:
Figure BDA0001805725400000243
the 6-parameter affine motion model can be represented by the motion vectors of the three pixel points and their coordinates with respect to the top left vertex pixel of the current block. If pixel points of an upper left vertex (0, 0), an upper right vertex (W, 0) and a lower left vertex (0, H) are used as control points, motion vectors of the control points of the upper left vertex, the upper right vertex and the lower left vertex of the current block are firstly determined to be (vx 0, vy 0), (vx 1, vy 1) and (vx 2, vy 2) respectively, and then motion information of each sub motion compensation unit in the current block is obtained according to the following formula (5), wherein (x, y) is coordinates of the sub motion compensation unit relative to pixels of the upper left vertex of the current block, and W and H are width and height of the current block respectively.
Figure BDA0001805725400000251
For an 8-parameter bilinear model, the 8-parameter bilinear model is shown in equation (6) below:
Figure BDA0001805725400000252
the 8-parameter bilinear model can be represented by motion vectors of four pixel points and coordinates of the motion vectors relative to a vertex pixel at the upper left of a current coding block. If pixel points of an upper left vertex (0, 0), an upper right vertex (W, 0), a lower left vertex (0, H) and a lower right vertex (W, H) are used as control points, motion vectors (vx 0, vy 0), (vx 1, vy 1), (vx 2, vy 2) and (vx 3, vy 3) of the control points of the upper left vertex, the upper right vertex, the lower left vertex and the lower right vertex of a current coding block are determined at first, and then motion information of each sub motion compensation unit in the current coding block is obtained through derivation according to the following formula (7), wherein (x, y) is the coordinate of the sub motion compensation unit relative to the pixel of the upper left vertex of the current coding block, and W and H are the width and the height of the current coding block respectively.
Figure BDA0001805725400000253
The coding block predicted by the affine motion model can be called as an affine coding block, and as can be seen from the above, the affine motion model is directly related to the motion information of the control points of the affine coding block.
In general, the motion information of the control points of the affine coding block can be obtained by using an AMVP mode based on an affine motion model or a Merge mode based on an affine motion model. Further, for the AMVP mode based on the affine motion model or the Merge mode based on the affine motion model, the motion information of the control point of the current coding block may be obtained by an inherited control point motion vector prediction method or a constructed control point motion vector prediction method. Both methods are described further below.
3) Inherited control point motion vector prediction method. The inherited control point motion vector prediction method is to determine a candidate control point motion vector of a current block by using a motion model of an affine coding block coded adjacent to the current block.
Taking the current block shown in fig. 7 as an example, traversing neighboring position blocks around the current block according to a set sequence, for example, the sequence of A1 → B0 → A0 → B2, finding an affine coding block in which the neighboring position block of the current block is located, obtaining control point motion information of the affine coding block, and further deriving a control point motion vector (for the Merge mode) or a motion vector predictor (for the AMVP mode) of the current block through a motion model constructed by the control point motion information of the affine coding block. A1 → B1 → B0 → A0 → B2 is only an example, and other combination orders are also applicable to the embodiments of the present invention. The adjacent position blocks are not limited to A1, B0, A0, and B2. The adjacent position block may be a pixel point, or a pixel block of a preset size divided according to a specific method, for example, a 4x4 pixel block, a 4x2 pixel block, or a pixel block of other sizes, which is not limited. The affine coding block is a coding block adjacent to the current block and predicted by an affine motion model in a coding stage (also referred to as an adjacent affine coding block for short).
The following describes the determination process of the candidate control point motion vector of the current block by taking A1 as an example as shown in fig. 7, and so on:
if the coding block where the A1 is located is a 4-parameter affine coding block (that is, the affine coding block adopts a 4-parameter affine motion model for prediction), the motion vectors (vx 4, vy 4) of the top left vertex (x 4, y 4) and the motion vectors (vx 5, vy 5) of the top right vertex (x 5, y 5) of the affine coding block are obtained.
Then, the motion vector (vx 0, vy 0) of the top left vertex (x 0, y 0) of the current affine coding block is obtained by calculation using the following formula (8):
Figure BDA0001805725400000254
and calculating and obtaining the motion vector (vx 1, vy 1) of the top right vertex (x 1, y 1) of the current affine coding block by using the following formula (9):
Figure BDA0001805725400000261
the combination of the motion vector (vx 0, vy 0) of the top left vertex (x 0, y 0) of the current block, obtained based on the affine coding block in which A1 is located as described above, and the motion vector (vx 1, vy 1) of the top right vertex (x 1, y 1) is a candidate control point motion vector for the current block.
If the coding block where A1 is located is a 6-parameter affine coding block (that is, the affine coding block is predicted by using a 6-parameter affine motion model), then the motion vector (vx 4, vy 4) of the top left vertex (x 4, y 4), the motion vector (vx 5, vy 5) of the top right vertex (x 5, y 5), and the motion vector (vx 6, vy 6) of the bottom left vertex (x 6, y 6) of the affine coding block are obtained.
Then, a motion vector (vx 0, vy 0) of the top left vertex (x 0, y 0) of the current block is obtained by calculation using the following formula (10):
Figure BDA0001805725400000262
calculating and obtaining a motion vector (vx 1, vy 1) of a top right vertex (x 1, y 1) of the current block by using the following formula (11):
Figure BDA0001805725400000263
calculating and obtaining a motion vector (vx 2, vy 2) of a lower left vertex (x 2, y 2) of the current block by using the following formula (12):
Figure BDA0001805725400000264
the combination of the motion vector (vx 0, vy 0) of the top left vertex (x 0, y 0), the motion vector (vx 1, vy 1) of the top right vertex (x 1, y 1), and the motion vector (vx 2, vy 2) of the bottom left vertex (x 2, y 2) of the current block, obtained as above based on the affine coding block in which A1 is located, is the control point motion vector of the candidate of the current block.
It should be noted that other motion models, candidate positions, and search traversal orders may also be applicable to the embodiment of the present invention, and details thereof are not described in the embodiment of the present invention.
It should be noted that, methods for representing motion models of adjacent and current coding blocks by using other control points may also be applicable to the embodiments of the present invention, and details are not described here.
4) And (3) a constructed control point motion vector (vectors) prediction method. The constructed control point motion vector prediction method refers to that motion vectors of adjacent coded blocks around the control point of the current block are combined to be used as the motion vector of the control point of the current affine coding block, and whether the adjacent coded blocks around the control point are affine coding blocks or not does not need to be considered. The control point motion vector prediction methods constructed based on different prediction modes (the AMVP mode based on the affine motion model and the Merge mode based on the affine motion model) are different, and are described below respectively.
First, a control point motion vector prediction method based on the construction of the AMVP mode of the affine motion model is described.
The control point motion vector prediction method constructed as described above is described with reference to fig. 8 as an example, to determine motion vectors of top left and top right vertices of a current block using motion information of encoded blocks adjacent to the periphery of the current encoded block. It should be noted that fig. 8 is only an example.
If the current block is a 4-parameter affine coding block (namely the current block is predicted by adopting a 4-parameter affine motion model), the motion vector of the block A2, B2 or B3 of the coded block adjacent to the top left vertex can be used as a candidate motion vector of the top left vertex of the current block; and utilizing the motion vector of the adjacent coded block B1 or B0 block of the top right vertex as a candidate motion vector of the top right vertex of the current block. Combining the candidate motion vectors of the top left vertex and the top right vertex to form a plurality of binary groups, wherein the two binary groups include the motion vectors of two encoded blocks as the candidate control point motion vectors of the current block, and the plurality of binary groups can be seen in the following (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)
wherein v is A2 A motion vector, v, representing A2 B1 Representing the motion vector of B1, v B0 Representing the motion vector of B0, v B2 Representing the motion vector of B2, v B3 Representing the motion vector of B3.
If the current block is a 6-parameter affine coding block (namely the current block is predicted by adopting a 6-parameter affine motion model), the motion vector of the block A2, B2 or B3 of the coded block adjacent to the top left vertex can be used as a candidate motion vector of the top left vertex of the current block; and using the motion vector of the block B1 or B0 adjacent to the upper right vertex as a candidate motion vector of the upper right vertex of the current block, and using the motion vector of the block A0 or A1 adjacent to the sitting vertex as a candidate motion vector of the lower left vertex of the current block. Combining the motion vectors of the top-left vertex, the top-right vertex, and the bottom-left vertex to form a plurality of triples, where the motion vectors of the three encoded blocks included in the triples may be used as the motion vectors of the control points of the current block candidate, and the triples may be shown in the following equations (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)
wherein v is A2 A motion vector, v, representing A2 B1 Representing the motion vector of B1, v B0 Representing the motion vector of B0, v B2 Representing the motion vector of B2, v B3 Motion vector, v, representing B3 A0 A motion vector, v, representing A0 A1 Representing the motion vector of A1.
It should be noted that other methods for combining motion vectors of control points may also be applicable to the embodiments of the present invention, and are not described herein again.
It should be noted that, methods for representing motion models of adjacent and current coding blocks by using other control points may also be applied to the embodiments of the present invention, and details are not described herein.
The following describes a control point motion vector prediction method based on the construction of the Merge mode of the affine motion model.
The control point motion vector prediction method constructed as described above is described with reference to fig. 9 as an example, to determine motion vectors of top left and top right vertices of a current block using motion information of encoded blocks adjacent to the periphery of the current encoded block. It should be noted that fig. 9 is only an example.
As shown in fig. 9, CPk (k =1,2,3,4) represents the kth control point. A0, A1, A2, B0, B1, B2 and B3 are the spatial domain adjacent positions of the current block and are used for predicting CP1, CP2 or CP3; t is the temporal neighboring position of the current block, used for predicting CP4. Let the coordinates of CP1, CP2, CP3, and CP4 be (0, 0), (W, 0), (H, 0), and (W, H), respectively, where W and H are the width and height of the current block. Then for each control point of the current block, its motion information is obtained in the following order:
1. for CP1, the order is B2- > A2- > B3, and if B2 is available, the motion information of B2 is used. Otherwise, A2 and B3 are detected. If the motion information of the three positions is not available, the motion information of the CP1 cannot be obtained.
2. For CP2, the checking order is B0- > B1; if B0 is available, CP2 uses the motion information of B0. Otherwise, B1 is detected. If the motion information of both positions is not available, the motion information of CP2 cannot be obtained.
3. For CP3, the detection order is A0- > A1;
4. for CP4, motion information of T is employed.
Here X may mean that a block including X (X being A0, A1, A2, B0, B1, B2, B3, or T) positions has been encoded and adopts an inter prediction mode; otherwise, the X position is not available. It should be noted that other methods for obtaining motion information of the control point may also be applicable to the embodiments of the present invention, and are not described herein again.
Then, the motion information of the control points of the current block is combined to obtain the constructed motion information of the control points.
If the current block adopts the 4-parameter affine motion model, combining the motion information of the two control points of the current block to form a binary group for constructing the 4-parameter affine motion model. The combination of the two control points may be { CP1, CP4}, { CP2, CP3}, { CP1, CP2}, { CP2, CP4}, { CP1, CP3}, and { CP3, CP4}. For example, a 4-parameter Affine motion model constructed by using a binary group composed of CP1 and CP2 control points can be referred to as Affine (CP 1, CP 2).
If the current block adopts the 6-parameter affine motion model, combining the motion information of the three control points of the current block to form a triple group for constructing the 6-parameter affine motion model. The combination of the three control points may be { CP1, CP2, CP4}, { CP1, CP2, CP3}, { CP2, CP3, CP4}, { CP1, CP3, CP4}. For example, a 6-parameter Affine motion model constructed by using a triplet composed of CP1, CP2, and CP3 control points can be referred to as Affine (CP 1, CP2, CP 3).
If the current block adopts an 8-parameter bilinear model, the four-tuple formed by combining the motion information of the four control points of the current block is used for constructing the 8-parameter bilinear model. An 8-parameter Bilinear model constructed by four-tuple consisting of CP1, CP2, CP3 and CP4 control points is adopted and is marked as Bilinear (CP 1, CP2, CP3 and CP 4).
In the embodiment of the present invention, for convenience of description, the motion information combination of two control points (or two encoded blocks) is referred to as a binary group, the motion information combination of three control points (or two encoded blocks) is referred to as a ternary group, and the motion information combination of four control points (or four encoded blocks) is referred to as a quaternary group.
Traversing the models according to a preset sequence, and if the motion information of a certain control point corresponding to the combined model is unavailable, considering that the model is unavailable; otherwise, determining the reference frame index of the model, scaling the motion vectors of the control points, and if the scaled motion information of all the control points is consistent, the model is illegal. And if the motion information of the control point for controlling the model is determined to be available and the model is legal, adding the motion information of the control point for constructing the model into the motion information candidate list.
The method of controlling the motion vector scaling of a point is shown in equation (14) below:
Figure BDA0001805725400000281
wherein CurPoc represents POC number of current frame, desPoc represents POC number of reference frame of current block, srcPoc represents POC number of reference frame of control point, and MV s The scaled motion vector is indicated, and MV indicates the motion vector of the control point.
It should be noted that a combination of different control points may also be converted into a control point at the same position.
For example, a 4-parameter affine motion model obtained by combining { CP1, CP4}, { CP2, CP3}, { CP2, CP4}, { CP1, CP3}, { CP3, CP4} is converted to be expressed by { CP1, CP2} or { CP1, CP2, CP3 }. The conversion method is to substitute the motion vector and the coordinate information of the control point into the formula (2) to obtain the model parameter, and substitute the coordinate information of the { CP1, CP2} into the formula (3) to obtain the motion vector.
More directly, the conversion may be performed according to the following equations (15) - (23), where W represents the width of the current block and H represents the height of the current block, and in equations (15) - (23), (vx) 0 ,vy 0 ) Represents the motion vector of CP1, (vx) 1 ,vy 1 ) Represents the motion vector of CP2, (vx) 2 ,vy 2 ) Motion vector (vx) representing CP3 3 ,vy 3 ) Representing the motion vector of CP4.
The conversion of { CP1, CP2} into { CP1, CP2, CP3} can be achieved by the following equation (15), i.e., the motion vector of CP3 in { CP1, CP2, CP3} can be determined by equation (15):
Figure BDA0001805725400000282
{ CP1, CP3} conversion { CP1, CP2} or { CP1, CP2, CP3} may be implemented by the following equation (16):
Figure BDA0001805725400000283
the { CP2, CP3} conversion into { CP1, CP2} or { CP1, CP2, CP3} can be achieved by the following equation (17):
Figure BDA0001805725400000291
the conversion of { CP1, CP4} into { CP1, CP2} or { CP1, CP2, CP3} may be achieved by the following equation (18) or (19):
Figure BDA0001805725400000292
Figure BDA0001805725400000293
the { CP2, CP4} conversion into { CP1, CP2} can be realized by the following formula (20), and the { CP2, CP4} conversion into { CP1, CP2, CP3} can be realized by the following formulas (20) and (21):
Figure BDA0001805725400000294
Figure BDA0001805725400000295
the { CP3, CP4} conversion into { CP1, CP2} can be realized by the following formula (20), and the { CP3, CP4} conversion into { CP1, CP2, CP3} can be realized by the following formulas (22) and (23):
Figure BDA0001805725400000296
Figure BDA0001805725400000297
for example, the 6-parameter affine motion model of the combination of { CP1, CP2, CP4}, { CP2, CP3, CP4}, { CP1, CP3, CP4} is converted into the control point { CP1, CP2, CP3}, and expressed. The conversion method is to substitute the motion vector and the coordinate information of the control point into the formula (4) to obtain the model parameters, and substitute the coordinate information of the { CP1, CP2, CP3} into the formula (5) to obtain the motion vector.
More directly, the conversion may be performed according to the following equations (24) - (26), where W represents the width of the current block and H represents the height of the current block, and in equations (24) - (26), (vx) 0 ,vy 0 ) Represents the motion vector of CP1, (vx) 1 ,vy 1 ) Represents the motion vector of CP2, (vx) 2 ,vy 2 ) Motion vector (vx) representing CP3 3 ,vy 3 ) Representing the motion vector of CP4.
The conversion of { CP1, CP2, CP4} into { CP1, CP2, CP3} can be achieved by equation (22):
Figure BDA0001805725400000298
the conversion of { CP2, CP3, CP4} into { CP1, CP2, CP3} can be achieved by equation (23):
Figure BDA0001805725400000299
the conversion of { CP1, CP3, CP4} into { CP1, CP2, CP3} can be achieved by equation (24):
Figure BDA00018057254000002910
in a specific embodiment, after adding the currently constructed control point motion information into a candidate motion vector list, if the length of the candidate list is smaller than the maximum list length (for example, maxaffinenummrgnad), traversing the combinations according to a preset sequence to obtain legal combinations as candidate control point motion information, and if the candidate motion vector list is empty, adding the candidate control point motion information into the candidate motion vector list; and if not, sequentially traversing the motion information in the candidate motion vector list, and checking whether the motion information which is the same as the motion information of the candidate control point exists in the candidate motion vector list. If the motion information identical to the motion information of the candidate control point does not exist in the candidate motion vector list, the motion information of the candidate control point is added into the candidate motion vector list.
Illustratively, one preset sequence is as follows: affine (CP 1, CP2, CP 3) → Affine (CP 1, CP2, CP 4) → Affine (CP 1, CP3, CP 4) → Affine (CP 2, CP3, CP 4) → Affine (CP 1, CP 2) → Affine (CP 1, CP 3) → Affine (CP 2, CP 3) → Affine (CP 1, CP 4) → Affine (CP 2, CP 4) → Affine (CP 3, CP 4), in total of 10 combinations.
If the control point motion information corresponding to the combination is not available, the combination is considered to be unavailable. If the combination is available, determining the reference frame index of the combination (when two control points are available, the reference frame index with the minimum reference frame index is selected as the reference frame index of the combination, when the reference frame index is more than two control points, the reference frame index with the maximum occurrence frequency is selected first, and if the occurrence frequencies of a plurality of reference frame indexes are as many as possible, the reference frame index with the minimum reference frame index is selected as the reference frame index of the combination), and scaling the motion vector of the control point. If the motion information of all the control points after scaling is consistent, the combination is illegal.
Optionally, the embodiment of the present invention may also perform padding on the candidate motion vector list, for example, after the traversal process is performed, when the length of the candidate motion vector list is smaller than the maximum list length (e.g., maxaffinenummrgnard), the candidate motion vector list may be padded until the length of the list is equal to the maximum list length.
The filling may be performed by a method of supplementing a zero motion vector, or by a method of combining and weighted averaging the motion information of candidates already existing in the existing list. It should be noted that other methods for obtaining candidate motion vector list padding may also be applied to the embodiments of the present invention, and are not described herein again.
Based on the above description, the Affine motion model-based AMVP mode (Affine AMVP mode) and the Affine motion model-based Merge mode (Affine Merge mode) are further described below.
The AMVP mode based on the affine motion model is described first.
For the advanced motion vector prediction mode based on the affine motion model, a candidate motion vector list of the AMVP mode based on the affine motion model can be constructed by utilizing an inherited control point motion vector prediction method and/or a constructed control point motion vector prediction method. In the embodiment of the present invention, a candidate motion vector list of the AMVP mode based on the affine motion model may be referred to as a control point motion vector predictor candidate list (control point motion vector predictor candidate list), where a control point motion vector predictor in the list includes 2 (for example, in the case that the current block is a 4-parameter affine motion model) candidate control point motion vectors or includes 3 (for example, in the case that the current block is a 6-parameter affine motion model) candidate control point motion vectors.
In possible application scenarios, the control point motion vector predictor candidate list can be pruned and sorted according to a specific rule, and can be truncated or filled to a specific number.
Then, at the encoding end, the encoder (such as the encoder 20 described above) obtains the motion vector of each sub motion compensation unit in the current encoding block by using each control point motion vector predictor in the control point motion vector predictor candidate list through the formula (3) or (5) or (7), and further obtains the pixel value of the corresponding position in the reference frame pointed by the motion vector of each sub motion compensation unit as the predictor, and performs motion compensation using an affine motion model. And calculating the average value of the difference value between the original value and the predicted value of each pixel point in the current coding block, selecting the control point motion vector predicted value corresponding to the minimum average value as the optimal control point motion vector predicted value, and using the optimal control point motion vector predicted value as the motion vector predicted value of 2 or 3 or 4 control points of the current coding block. In addition, at the encoding end, motion search is performed within a certain search range by using the control point motion vector predictor as a search starting point to obtain Control Point Motion Vectors (CPMV), and a difference value (CPMVD) between the control point motion vectors and the control point motion vector predictor is calculated. Then, the encoder transmits the index number of the position of the control point motion vector predicted value in the control point motion vector predicted value candidate list and the CPMVD coding code stream to a decoding end.
At the decoding end, a decoder (such as the decoder 30) analyzes and obtains the index number and the control point motion vector difference value (CPMVD) in the code stream, determines a Control Point Motion Vector Predictor (CPMVP) from the control point motion vector predictor candidate list according to the index number, and adds the CPMVP and the CPMVD to obtain a control point motion vector.
The Merge mode based on the affine motion model is described next.
For the Merge mode based on the affine motion model, a control point motion vector fusion candidate list (control point motion vector candidate list) can be constructed by using an inherited control point motion vector prediction method and/or a constructed control point motion vector prediction method.
In a possible application scenario, the control point motion vector fusion candidate list may be pruned and ordered according to a specific rule, and may be truncated or filled to a specific number.
Then, at the encoding end, the encoder (such as the encoder 20 mentioned above) obtains each sub-motion compensation unit (pixel point or division size N by a specific method) in the current coding block by using each control point motion vector in the fusion candidate list through the formula (3), (5) or (7) 1 ×N 2 Pixel block of (2) to obtain the pixel value of the position in the reference frame pointed by the motion vector of each sub motion compensation unit as the predicted value thereof, and performing affine motion compensation. And calculating the average value of the difference value between the original value and the predicted value of each pixel point in the current coding block, and selecting the control point motion vector corresponding to the minimum average value of the difference values as the motion vectors of 2 or 3 or 4 control points of the current coding block. And encoding an index number representing the position of the control point motion vector in the candidate list into a code stream and sending the code stream to a decoding end.
At the decoding end, a decoder (such as the aforementioned decoder 30) parses the index number, and determines Control Point Motion Vectors (CPMV) from the CPMV candidate list according to the index number.
In the embodiments of the present invention, "at least one" means one or more, "and" a plurality "means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
In the embodiment of the present invention, the encoding end may use the syntax element to indicate the inter prediction mode of the current block, the affine motion model adopted by the current block, and other related information to the decoding end.
The currently adopted partial syntax structure for parsing the inter prediction mode adopted by the current block can be seen from table 1. It should be noted that syntax elements in the syntax structure may also be represented by other identifiers, which is not specifically limited in the embodiment of the present invention.
TABLE 1
Figure BDA0001805725400000311
Figure BDA0001805725400000321
Figure BDA0001805725400000331
In table 1, ae (v) denotes a syntax element coded using adaptive-binary arithmetic coding (cabac).
The syntax element merge _ flag [ x0] [ y0] may be used to indicate whether the merge mode is employed for the current block. For example, when the merge _ flag [ x0] [ y0] =1, it indicates that the merge mode is adopted for the current block, and when the merge _ flag [ x0] [ y0] =0, it indicates that the merge mode is not adopted for the current block. x0, y0 represents the coordinates of the current block in the video image.
The variable allowAffineMerge may be used to indicate whether the current block satisfies the condition of adopting the merge mode based on the affine motion model. Such as allowaffinererge =0, indicates that the condition for adopting the merge mode based on the affine motion model is not satisfied, allowaffinererge =1, indicates that the condition for adopting the merge mode based on the affine motion model is satisfied. The conditions for using the merge mode based on the affine motion model may be: the width and the height of the current block are both greater than or equal to 8.cbWidth denotes the width of the current block and cbHeight denotes the height of the current block, that is, allowaffinererge =0 when cbWidth <8 or cbHeight <8, and allowaffinererge =1 when cbWidth > =8 and cbHeight > = 8.
The variable allowaffineInter may be used to indicate whether the current block satisfies the condition for adopting the AMVP mode based on the affine motion model. Such as allowaffininter =0, indicating that the condition for adopting the affine motion model-based AMVP mode is not satisfied, allowaffininter =1, indicating that the condition for adopting the affine motion model-based AMVP mode is satisfied. The conditions for adopting the AMVP mode based on the affine motion model may be: the width and the height of the current block are both greater than or equal to 16. That is, allowaffineIntter =0 when cbWidth <16 or cbHeight <16, and allowaffineIntter =1 when cbWidth > =16 and cbHeight > = 16.
The syntax element affine merge flag x0 y0 may be used to indicate whether merge mode based on affine motion model is employed for the current block. The type (slice _ type) of the slice in which the current block is located is P-type or B-type. For example, affine _ merge _ flag [ x0] [ y0] =1, which indicates that the merge mode based on the affine motion model is adopted for the current block, affine _ merge _ flag [ x0] [ y0] =0, which indicates that the merge mode based on the affine motion model is not adopted for the current block, and the merge mode of the flat motion model can be adopted.
The syntax element merge idx x0 y0 may be used to indicate an index value for the merge candidate list.
The syntax element affine merge idx [ x0] [ y0] may be used to indicate an index value for the affine merge candidate list.
The syntax element affine inter flag [ x0] [ y0] may be used to indicate whether an AMVP mode based on an affine motion model is employed for the current block when the slice in which the current block is located is a P-type slice or a B-type slice. For example, affine _ inter _ flag [ x0] [ y0] =0, which indicates that the affine motion model-based AMVP mode is adopted for the current block, affine _ inter _ flag [ x0] [ y0] =1, which indicates that the affine motion model-based AMVP mode is not adopted for the current block, and the translational motion model-based AMVP mode can be adopted for the current block.
The syntax element affine _ type _ flag [ x0] [ y0] may be used to indicate: and when the stripe of the current block is a P-type stripe or a B-type stripe, performing motion compensation on the current block by adopting a 6-parameter affine motion model. affine _ type _ flag [ x0] [ y0] =0, which indicates that motion compensation is not performed by using a 6-parameter affine motion model for the current block, and motion compensation can be performed by using only a 4-parameter affine motion model; affine _ type _ flag [ x0] [ y0] =1, indicating that motion compensation is performed with a 6-parameter affine motion model for the current block.
The variables MaxNumMergeCand, maxaffinenummrgnad are used to represent the maximum list length, indicating the maximum length of the constructed list of candidate motion vectors. inter _ pred _ idc x0 y0 is used to indicate the prediction direction. PRED _ L1 is used to indicate backward prediction. num _ ref _ idx _ l0_ active _ minus1 indicates the number of reference frames of the forward reference frame list, and ref _ idx _ l0[ x0] [ y0] indicates the forward reference frame index value of the current block. mvd _ coding (x 0, y0, 0) indicates the first motion vector difference. MVP _ l0_ flag [ x0] [ y0] indicates the forward MVP candidate list index value. PRED _ L0 indicates forward prediction. num _ ref _ idx _ l1_ active _ minus1 indicates the number of reference frames in the backward reference frame list. ref _ idx _ l1[ x0] [ y0] indicates a backward reference frame index value of the current block, and MVP _ l1_ flag [ x0] [ y0] indicates a backward MVP candidate list index value.
As shown in table 2, motioncodeldc [ x0] [ y0] =1, indicating that a 4-parameter affine motion model is employed, motioncodeldc [ x0] [ y0] =2, indicating that a 6-parameter affine motion model is employed, and motioncodeldc [ x0] [ y0] =0 indicating that a translational motion model is employed.
TABLE 2
Figure BDA0001805725400000341
It should be noted that the above tables 1 and 2 are only examples. In practical applications, the above tables 1 and 2 may also include more or less contents, for example, the motionodeldc [ x0] [ y0] in table 2 may also include other values, which may be used to indicate that an 8-parameter bilinear model is used, and so on.
In the prior art, after obtaining a motion vector value of each sub-block of a current block through an inter-frame prediction mode, an encoding end or a decoding end needs to store the motion vector value for subsequent motion compensation; meanwhile, the obtained motion vector value is also used in other subsequent decoding processes, for example, as a motion vector prediction in the decoding process of the adjacent block, a filtering strength decision of deblocking filtering, and the like. The obtained motion vector of the control point of the current block also needs to be stored so as to be used when the subsequent adjacent block to be coded and decoded utilizes the inherited control point motion vector prediction method. So, at this time, for the current block, there are two categories of motion vectors: the motion vector of each sub-block, and the motion vector of the control point. In order to avoid storing two types of motion vectors in the existing scheme, the motion vector of the sub-block where the control point is located is covered by the motion vector of the control point. For example, if the affine motion model adopted by the current affine decoding block is a 4 affine motion model, the motion vectors of the upper left sub-block and the upper right sub-block are set as the motion vectors of the upper left vertex control point and the upper right vertex control point. And if the affine motion model adopted by the current affine decoding block is a 6 affine motion model, setting the motion vectors of the upper left sub-block, the upper right sub-block and the lower left sub-block as the motion vectors of the upper left vertex control point, the upper right vertex control point and the lower left vertex control point. Although the method solves the problem of motion vector storage, the sub-block where the control point is located uses the motion vector inconsistent with other sub-blocks for motion compensation, so that the prediction is inaccurate, and the coding efficiency is reduced.
In order to overcome the defects of the prior art, the problem of motion vector storage is solved, the prediction accuracy in the encoding and decoding process is improved, and the encoding efficiency is improved, the embodiment of the invention improves the inherited control point motion vector prediction method.
In the process of determining the candidate control point motion vector of the current block, the improved inherited control point motion vector prediction method provided by the embodiment of the invention does not need to utilize the motion vectors of the control points of the adjacent affine coding blocks (or the adjacent affine decoding blocks), but adopts the motion vectors of at least two sub-blocks of the adjacent affine coding blocks (or the adjacent affine decoding blocks) to derive the candidate control point motion vector of the current block. After the derivation of the motion vector of the sub-block of each adjacent affine coding block (or adjacent affine decoding block) is completed, the motion vector of the control point does not need to be stored, that is, the motion vector of the control point of the current block is only used for the derivation of the motion vector of the sub-block of the current block, and is not subsequently used for the prediction of the motion vectors of other adjacent blocks to be processed. Therefore, the scheme of the invention only needs to store the motion vector of the subblock, and adopts the motion vector of the subblock to carry out motion compensation, thereby solving the problem of motion vector storage and simultaneously improving the accuracy of prediction and the coding efficiency.
The adjacent affine coding blocks are coding blocks which are adjacent to the current block and are predicted by adopting an affine motion model in a coding stage, and the adjacent affine decoding blocks are decoding blocks which are adjacent to the current block and are predicted by adopting the affine motion model in a decoding stage. Herein, for the current block, W may be used to express the width of the current block, and H may be used to express the height of the current block. For the adjacent affine decoding blocks, the width of the adjacent affine decoding blocks can be expressed by using U, and the height of the adjacent affine decoding blocks can be expressed by using V.
Some specific embodiments of the improved inherited control point motion vector prediction method are described in further detail below. It should be noted that, the following is to describe the improved inherited control point motion vector prediction method from the perspective of the decoding end, and the improved inherited control point motion vector prediction method related to the encoding end can be implemented by referring to this description, and will not be described again for the brevity of the description.
Some examples of this improved inherited control point motion vector prediction method are described first when the neighboring affine decoding block is a 4-parameter affine decoding block.
In an example, if an adjacent affine decoding block is a 4-parameter affine decoding block, motion vectors of two sub-blocks of the adjacent affine decoding block, the horizontal coordinate distance of the center point of the sub-block is P, the vertical coordinate is the same, and coordinates of the center point of the two sub-blocks are obtained, a 4-parameter affine motion model is formed and used for deriving a motion vector of a control point of a current affine decoding block, wherein P is smaller than the width U of the adjacent affine decoding block, and P is a power of 2.
In another example, if the neighboring affine decoding block is a 4-parameter affine decoding block, the motion vectors of two sub-blocks in the neighboring affine decoding block with the same horizontal coordinate of the sub-block center point and the vertical coordinate distance Q and the coordinates of the center point thereof are obtained to form a 4-parameter affine motion model for deriving the motion vector of the control point of the current affine decoding block, wherein Q is smaller than the height V of the neighboring affine decoding block, and Q is the power of 2.
Some examples of this improved inherited control point motion vector prediction method are described next when the neighboring affine decoding block is a 6 parameter affine decoding block.
In an example, if an adjacent affine decoding block is a 6-parameter affine decoding block, motion vectors of two sub-blocks (such as a first sub-block and a second sub-block) with the same horizontal coordinate distance P and vertical coordinate from the center point of the sub-block in the adjacent affine decoding block and coordinates of the center point thereof are obtained, and then a motion vector of a sub-block with the same horizontal coordinate distance P and vertical coordinate distance Q from the center point of the sub-block in the adjacent affine decoding block and coordinates of the center point thereof are obtained to form a 6-parameter affine motion model for deriving a motion vector of a control point of a current affine decoding block, wherein P is smaller than the width U of the adjacent affine decoding block, and P is a power of 2, Q is smaller than the height V of the adjacent affine decoding block, and Q is a power of 2.
In yet another example, if an adjacent affine decoding block is a 6-parameter affine decoding block, motion vectors of two sub-blocks (such as a first sub-block and a second sub-block) with the same horizontal coordinate distance P and vertical coordinate from the center point of the sub-block and the same coordinates of the center point thereof are obtained, and then a motion vector of one sub-block with the same horizontal coordinate distance P and vertical coordinate distance Q from the center point of the sub-block and the coordinates of the center point thereof are obtained from the adjacent affine decoding block, a 6-parameter affine motion model is formed for deriving a motion vector of a control point of a current affine decoding block, wherein P is smaller than the width U of the adjacent affine decoding block, and P is a power of 2, Q is smaller than the height V of the adjacent affine decoding block, and Q is a power of 2.
In yet another example, without distinguishing the parameter types of the adjacent affine decoding block, the motion vectors and the coordinates of the center point of two sub-blocks (such as a first sub-block and a second sub-block) with the same horizontal coordinate distance P and the same vertical coordinate of the center point of the sub-block in the adjacent affine decoding block are directly obtained, and then the motion vector and the coordinates of the center point of one sub-block with the same horizontal coordinate distance Q and the same vertical coordinate distance of the center point of the sub-block in the adjacent affine decoding block are obtained to form a 6-parameter affine motion model for deriving the motion vector of the control point of the current affine decoding block, wherein P is smaller than the width U of the adjacent affine decoding block, and P is the power of 2, Q is smaller than the height V of the adjacent affine decoding block, and Q is the power of 2.
It should be noted that the distance between the center points of the two sub-blocks adopted in the embodiment of the present invention is a power of 2, which is beneficial to implementation through a shifting manner when motion vector derivation is performed, thereby reducing implementation complexity.
It should be further noted that the center point position of the sub-block is adopted in each example only for convenience of description, and in practical application, the coordinate position of the sub-block adopted by the adjacent affine decoding block (which may be simply referred to as a preset sub-block position of the adjacent affine decoding block) needs to be consistent with the position adopted when the motion vector of the sub-block is calculated in encoding and decoding (that is, the sub-block of the adjacent affine decoding block adopts the motion vector of the pixel point at the preset position in the sub-block to represent the motion vectors of all pixel points in the sub-block). Therefore, the preset subblock positions may also be various. For example, the preset sub-block position is the position of the upper left pixel point in the sub-block of the adjacent affine decoding block, that is, the upper left pixel point is used for calculation when calculating the motion vector of the sub-block in the encoding and decoding, and the above examples should also use the coordinates of the upper left pixel point of the sub-block. For another example, the preset sub-block position is a position of a pixel point closest to the geometric center position in the sub-block of the adjacent affine decoding block, and for another example, the preset sub-block position is a position of a pixel point at the upper right corner in the sub-block of the adjacent affine decoding block, and so on.
For convenience of description, the center point of each sub-block is taken as an example in the following description of various examples, and the description may be referred to for implementation manners of other sub-block positions, which will not be described again.
In a possible application scenario of the embodiment of the present invention, the use condition of the affine decoding block may be limited, so that the adjacent affine decoding block can be divided into at least 2 sub-blocks in the horizontal direction and at least 2 sub-blocks in the vertical direction. For example, if the sub-blocks have a size MxN, M is an integer of 4, 8, 16, etc., and N is an integer of 4, 8, 16, etc., the allowable sizes of the affine decoding blocks are W ≧ 2M in width and H ≧ 2N in height. When the size of the decoding unit (neighboring block) does not satisfy the usage condition of the affine decoding block, it may not be necessary to parse affine-related syntax elements, such as affine _ inter _ flag, affine _ merge _ flag, and so on, in table one.
In one embodiment of the present invention, if the neighboring affine decoding block is a 4-parameter affine decoding block, as shown in fig. 10, assuming that the coordinates of the upper left vertex of the neighboring affine decoding block of the current block are (x 4, y 4), the width is U, the height is V, and the divided sub-block size is MxN (the sub-block size of the neighboring affine decoding block shown in fig. 10 is 4x 4), the motion vector (vx 4, vy 4) at the position (x 4+ M/2, y4+ n/2) and the motion vector (vx 5, vy 5) at the position (x 4+ M/2+ p, y4+ n/2) constitute a 4-parameter affine motion model.
Then, the motion vector (vx 0, vy 0) of the upper left control point (x 0, y 0) of the current affine decoding block is obtained by calculation using the following formula (27):
Figure BDA0001805725400000361
and calculating and obtaining the motion vector (vx 1, vy 1) of the upper right control point (x 1, y 1) of the current affine decoding block by using the formula (28). Alternatively, the value of (x 1, y 1) here may be set to (x 0+ W, y 0), W being the width of the current block.
Figure BDA0001805725400000362
Optionally (if the current block is a 6-parameter affine decoding block), the motion vectors (vx 2, vy 2) of the lower left control point (x 2, y 2) of the current affine decoding block are obtained by calculation using formula (29). Alternatively, the value of (x 2, y 2) here may be set to (x 0, y0+ H), where H is the height of the current block.
Figure BDA0001805725400000363
In one embodiment of the present invention, if the neighboring affine decoding block is a 6-parameter affine decoding block, and also taking fig. 10 as an example, the coordinates of the top left vertex of the neighboring affine decoding block of the current block are (x 4, y 4), the width is U, the height is V, and the size of the divided sub-block is MxN (the size of the sub-block of the neighboring affine decoding block shown in fig. 10 is 4x 4), then obtaining the motion vector (vx 4, vy 4) at position (x 4+ M/2, y4+ n/2), the motion vector (vx 5, vy 5) at position (x 4+ M/2, y4+ p, y4+ n/2) and the motion vector (vx 6, vy 6) at position (x 4+ M/2, y4+ n/2+ q) constitute a 6-parameter affine motion model.
Then, the motion vector (vx 0, vy 0) of the upper left control point (x 0, y 0) of the current affine decoding block is obtained by calculation using the following formula (30):
Figure BDA0001805725400000371
and calculating and obtaining the motion vector (vx 1, vy 1) of the upper right control point (x 1, y 1) of the current affine decoding block by using the formula (31). Alternatively, the value of (x 1, y 1) here may be set to (x 0+ W, y 0), W being the width of the current block.
Figure BDA0001805725400000372
Optionally (if the current block is a 6-parameter affine decoding block), calculating and obtaining the motion vector (vx 2, vy 2) of the lower left control point (x 2, y 2) of the current affine decoding block by using formula (32). Alternatively, the value of (x 2, y 2) here may be set to (x 0, y0+ H), where H is the height of the current block.
Figure BDA0001805725400000373
It should be noted that the method according to the embodiment of the present invention may also be applied to all adjacent affine decoding blocks without being limited to the condition. Namely, the motion vectors of the three sub-blocks are adopted to form a 6-parameter affine motion model for derivation.
It should be noted that, in the embodiment of the present invention, since the width U and the height V of the codec block are usually powers of 2, the value of P may be U/2 at this time, and the value of q may be V/2. If U is 8, 16, 32, 64, 128, etc., P is 4, 8, 16, 32, 64, etc., respectively; if V is 8, 16, 32, 64, 128, etc., Q is 4, 8, 16, 32, 64, etc., respectively.
It should be noted that the foregoing embodiment is only an example, and other embodiments of the present invention may also use other two sub-blocks whose central points are horizontally spaced by a distance P, and two sub-blocks whose vertical distances are Q, which are not described herein again.
In addition, in practical implementation, since P and Q are both powers of 2, the division operations of the above equations (27) and (32) can be implemented by right shifting. Meanwhile, in order to reduce the precision loss of the division, both ends of the equations of the above formula (27) -formula (32) may be left-shifted and amplified, and finally right-shifted.
The specific implementation operation can be according to the following flow, where Log2 is a function taking the logarithm of 2, < < represents left shift, > > represents right shift:
log2P=Log2(P)
log2Q=Log2(Q)
mvScaleHor=vx4<<7
mvScaleVer=vy4<<7
dHorX=(vx5–vx4)<<(7–log2P)
dVerX=(vy5–vy4)<<(7–log2Q)
if the adjacent affine decoding block is a 6-parameter affine decoding block, let:
dHorY=(vx6–vx4)<<(7–log2P)
dVerY=(vy6–vy4)<<(7–log2Q)
if the adjacent affine decoding block is a 4-parameter affine decoding block, let:
dHorY=–dVerX
dVerY=dHorX
next, the motion vector of the control point of the current affine decoding block can be calculated according to the following formula:
vx0=Round(mvScaleHor+dHorX*(x0–x4–M/2)+dHorY*(y0–y4–N/2))
vy0=Round(mvScaleVer+dVerX*(x0–x4–M/2)+dVerY*(y0–y4–N/2))
vx1=Round(mvScaleHor+dHorX*(x1–x4–M/2)+dHorY*(y1–y4–N/2))
vy1=Round(mvScaleVer+dVerX*(x1–x4–M/2)+dVerY*(y1–y4–N/2))
vx2=Round(mvScaleHor+dHorX*(x2–x4–M/2)+dHorY*(y2–y4–N/2))
vy2=Round(mvScaleVer+dVerX*(x2–x4–M/2)+dVerY*(y2–y4–N/2))
the Round function operates as follows, and for any input K, the output K is obtained by the following method:
mvShift=7
offset=1<<(mvShift–1)
K=K>=0?(K+offset)>>mvShift:–((–K+offset)>>mvShift)
in another embodiment of the present invention, if the neighboring affine decoding block is located above the CTU of the current affine decoding block, in order to reduce memory reads, the motion vectors of the two sub-blocks of the neighboring affine decoding block located at the bottom of the CTU may be obtained for derivation. Assuming that the coordinates of the top left vertex of the adjacent affine decoding block are (x 4, y 4), the width is U, the height is V, and the divided sub-block size is MxN, the motion vector (vx 4, vy 4) of the acquired position (x 4+ M/2, y4+ V-N/2), and the motion vector (vx 5, vy 5) of the position (x 4+ M/2+ p, y4+ V-N/2) constitute a 4-parameter affine motion model.
Then, the motion vector (vx 0, vy 0) of the upper left control point (x 0, y 0) of the current affine decoding block is obtained by calculation using the following formula (33):
Figure BDA0001805725400000381
and calculating and obtaining the motion vector (vx 1, vy 1) of the upper right control point (x 1, y 1) of the current affine decoding block by using the following formula (34):
Figure BDA0001805725400000382
and calculating and obtaining the motion vector (vx 2, vy 2) of the lower left control point (x 2, y 2) of the current affine decoding block by using the following formula (35):
Figure BDA0001805725400000383
it should be noted that the method according to the embodiment of the present invention may also be applied to a case where the adjacent affine decoding block is a 4-parameter affine decoding block, without being limited to the above condition. That is, if the adjacent affine decoding blocks are 4-parameter affine decoding blocks, the motion vectors of the two sub-blocks with the distance P between the center points of the two sub-blocks at the bottom are used for derivation.
In another embodiment of the present invention, if the adjacent affine decoding block is located at the left CTU of the current affine decoding block, in order to reduce memory reads, motion vectors of two sub-blocks of the adjacent affine decoding block located at the rightmost CTU may be obtained for derivation. Assuming that the coordinates of the top left vertex of the adjacent affine decoding block are (x 4, y 4), the width is U, the height is V, and the divided subblock size is MxN, the motion vector (vx 4, vy 4) of the position (x 4+ U-M/2, y4+ n/2) and the motion vector (vx 5, vy 5) of the position (x 4+ U-M/2, y4+ n/2+ q) constitute a 4-parameter affine motion model.
Then, the motion vector (vx 0, vy 0) of the upper left control point (x 0, y 0) of the current affine decoding block is obtained by calculation using the following formula (36):
Figure BDA0001805725400000384
and calculating and obtaining the motion vector (vx 1, vy 1) of the upper right control point (x 1, y 1) of the current affine decoding block by using the following formula (37):
Figure BDA0001805725400000391
and calculating and obtaining the motion vector (vx 2, vy 2) of the lower left control point (x 2, y 2) of the current affine decoding block by using the following formula (38):
Figure BDA0001805725400000392
it should be noted that the method according to the embodiment of the present invention may also be applied to a case where the adjacent affine decoding block is a 4-parameter affine decoding block, without being limited to the above condition. That is, if the adjacent affine decoding blocks are 4-parameter affine decoding blocks, motion vectors of two rightmost sub-blocks with a center point distance of Q are used for derivation.
In another embodiment of the present invention, if the adjacent affine decoding block is located above the current affine decoding block by the CTU, and the adjacent affine decoding block is a 6-parameter affine decoding block, in order to reduce memory reads, motion vectors of two sub-blocks of the adjacent affine decoding block located at the bottom of the CTU and motion vectors of an upper sub-block of the adjacent affine decoding block may be obtained for derivation. Assuming that the coordinates of the upper left vertex of the adjacent affine decoding block are (x 4, y 4), the width is U, the height is V, and the divided sub-block size is MxN, the motion vector (vx 4, vy 4) of the position (x 4+ M/2, y4+ V-N/2), the motion vector (vx 5, vy 5) of the position (x 4+ M/2+ P, y4+ V-N/2), and the motion vector (vx 6, vy 6) of the position (x 4+ M/2, y4+ V-N/2-Q) constitute a 6-parameter affine motion model.
Then, the motion vector (vx 0, vy 0) of the upper left control point (x 0, y 0) of the current affine decoding block is obtained by calculation using the following formula (39),
Figure BDA0001805725400000393
and calculating and obtaining the motion vector (vx 1, vy 1) of the upper right control point (x 1, y 1) of the current affine decoding block by using the following formula (40):
Figure BDA0001805725400000394
and calculating and obtaining the motion vector (vx 2, vy 2) of the lower left control point (x 2, y 2) of the current affine decoding block by using the following formula (41):
Figure BDA0001805725400000395
it should be noted that the method according to the embodiment of the present invention may also be applied to a case where the adjacent affine decoding block is a 6-parameter affine decoding block, without any limitation. That is, if the adjacent affine decoding blocks are 6-parameter affine decoding blocks, the motion vectors of the two sub-blocks with the distance P from the center point at the bottom and the motion vector of the sub-block with the vertical distance Q from the sub-block at the bottom are used for derivation.
It should be noted that the method according to the embodiment of the present invention may also be applied to all adjacent affine decoding blocks without being limited to the condition. Namely, the motion vectors of the two sub-blocks with the distance of P from the center point at the bottom and the motion vector of the sub-block with the vertical distance of Q from the sub-block at the bottom are used for derivation.
In another embodiment of the present invention, if the adjacent affine decoding block is located at the left CTU of the current affine decoding block, and the adjacent affine decoding block is a 6-parameter affine decoding block, in order to reduce memory reads, the motion vectors of the two sub-blocks located at the right most and the motion vector of the left sub-block of the adjacent affine decoding block may be obtained for derivation. Assuming that the coordinates of the upper left vertex of the neighboring affine decoding block are (x 4, y 4), the width is U, the height is V, and the divided sub-block size is MxN, then the motion vector (vx 4, vy 4) of the position (x 4+ U-M/2, y4+ N/2) is obtained, the motion vector (vx 5, vy 5) of the position (x 4+ U-M/2, y4+ N/2+ q) is obtained, and the motion vector (vx 6, vy 6) of the position (x 4+ U-M/2-P, y4+ N/2) constitutes a 6-parameter affine motion model.
Then, the motion vector (vx 0, vy 0) of the upper left control point (x 0, y 0) of the current affine decoding block is obtained by calculation using the following formula (42):
Figure BDA0001805725400000401
and calculating and obtaining the motion vector (vx 1, vy 1) of the upper right control point (x 1, y 1) of the current affine decoding block by using the following formula (43):
Figure BDA0001805725400000402
and calculating and obtaining the motion vector (vx 2, vy 2) of the lower left control point (x 2, y 2) of the current affine decoding block by using the following formula (44):
Figure BDA0001805725400000403
it should be noted that the method according to the embodiment of the present invention may also be applied to a case where the adjacent affine decoding block is a 6-parameter affine decoding block without being limited to any condition. That is, if the adjacent affine decoding blocks are 6-parameter affine decoding blocks, the motion vectors of the rightmost two sub-blocks with the center point distance of Q and the motion vector of the sub-block with the horizontal distance of P from the rightmost sub-block are used for derivation.
It should be noted that the method according to the embodiment of the present invention may also be applied to all adjacent affine decoding blocks without being limited to the condition. That is, the motion vectors of the two right-most subblocks with the center point distance Q and the motion vector of the subblock with the horizontal distance P from the right-most subblock are used for derivation.
Based on the improved inherited control point motion vector prediction method, the following further description is made from the perspective of an encoding end or a decoding end by using the motion vector prediction method based on the affine motion model provided by the embodiment of the present invention, and referring to fig. 11, the method includes but is not limited to the following steps:
step 701: and acquiring a spatial domain reference block of the image block to be processed.
The image blocks to be processed are obtained by dividing a video image, and the spatial domain reference block is a decoded block adjacent to the spatial domain of the image blocks to be processed. At the encoding end, the image block to be processed can be called as a current affine encoding block, and the spatial domain reference block can be called as an adjacent affine encoding block; at the decoding end, the image block to be processed may also be referred to as a current affine decoding block, and the spatial reference block may also be referred to as an adjacent affine decoding block. For convenience of description, the present embodiment may collectively refer to the to-be-processed image blocks as the current block and the spatial reference blocks as the neighboring blocks.
In a specific embodiment, the availability of candidate reference blocks at one or more predetermined spatial positions of the current block may be determined according to a predetermined order, and then the first available candidate reference block in the predetermined order may be obtained as the spatial reference block. Wherein the candidate reference block of the preset spatial position comprises: and adjacent image blocks which are positioned right above, right left, right above, left lower and left upper of the image block to be processed. For example, the availability of the candidate reference blocks is sequentially checked according to the sequence of the positive left adjacent image block, the positive top adjacent image block, the right top adjacent image block, the left bottom adjacent image block and the left top adjacent image block until the first available candidate reference block is determined.
For example, taking fig. 7 as an example, the neighboring blocks around the current block can be found by traversing the neighboring position blocks in the order of A1 → B0 → A0 → B2 in fig. 7.
In particular embodiments, whether a candidate reference block is available may be determined according to the following method: determining that the candidate reference block is available when the candidate reference block and the image block to be processed are located in the same image area and the candidate reference block obtains a motion vector based on the affine motion model.
Step 702: and determining two or more preset sub-block positions in the spatial domain reference block.
Specifically, two or more subblocks in the spatial domain reference block can be determined, each subblock has a corresponding preset subblock position, the preset subblock position is consistent with a position adopted when a motion vector of the subblock is calculated in encoding and decoding, namely, the subblocks of adjacent affine decoding blocks adopt the motion vector of a pixel point at a preset position in the subblock to express motion vectors of all pixel points in the subblock, and the motion vector of the pixel point at the preset position can be used for subsequent motion compensation so as to realize prediction of the subblock where the pixel point at the preset position is located.
In a specific implementation, the preset sub-block position can be the position of a pixel point at the upper left corner in the sub-block; or the position of the geometric center of the sub-block, or the position of a pixel point closest to the geometric center in the sub-block; or the position of the top right pixel point in the sub-block, etc.
In a specific embodiment, two subblocks in the spatial domain reference block can be determined, the distance between the positions of two preset subblocks corresponding to the two subblocks is S, S is the K power of 2, and K is a non-negative integer, so that the subsequent motion vector derivation can be realized in a shifting mode, and the realization complexity is reduced.
In an example, if the affine motion model of the current block is a 4-parameter affine motion model, the plurality of preset subblock positions of the spatial domain reference block include a first preset position (x 4+ M/2, y4+ N/2) and a second preset position (x 4+ M/2+ P, y4+ N/2), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, P is a K power of 2, K is a non-negative integer, K is smaller than U, and U is a width of the spatial domain reference block.
In an example, if the affine motion model of the current block is a 4-parameter affine motion model, the plurality of predetermined subblock positions includes a first predetermined position (x 4+ M/2, y4+ N/2) and a third predetermined position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, Q is an R power of 2, R is a non-negative integer, Q is smaller than V, and V is a height of the spatial domain reference block.
In an example, if the affine motion model of the current block is a 6-parameter affine motion model, the plurality of predetermined subblock positions includes a first predetermined position (x 4+ M/2, y4+ N/2), a second predetermined position (x 4+ M/2+ P, y4+ N/2) and a third predetermined position (x 4+ M/2, y4+ N/2), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, P is a K power of 2, Q is an R power of 2, K and R are non-negative integers, P is less than U, Q is less than V, U is a width of the spatial domain reference block, and V is a height of the spatial domain reference block.
In another example, if a straight line of an upper edge of the current block coincides with a straight line of an upper edge of a Code Tree Unit (CTU) of the current block, and the spatial reference block is located directly above, above left, or above right the image block to be processed, at least two of the sub blocks corresponding to the plurality of preset sub block positions are adjacent to the upper edge of the current block.
In another example, if a straight line on which a left edge of the current block is located coincides with a straight line on which a left edge of a Code Tree Unit (CTU) on which the current block is located, and the spatial reference block is located directly to the left of, above the left of, or below the current block, at least two of the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the left edge of the current block.
Step 703: and calculating a motion vector corresponding to the position of a preset pixel point of the image block to be processed by interpolation according to the motion vector corresponding to the position of the preset sub-block.
In the embodiment of the invention, the candidate control point motion vector of the current block is determined by adopting an improved inherited control point motion vector prediction method, namely the motion vectors of at least two sub-blocks of adjacent affine coding blocks (or adjacent affine decoding blocks) are adopted, the motion vector of the preset pixel point position of the current block is obtained through interpolation calculation, the preset pixel point position is the control point of the current block, for example, if the affine motion model of the current block is a 4-parameter affine motion model, the control points of the current block can be an upper left pixel point and an upper right pixel point in the sub-blocks. If the affine motion model of the current block is a 6-parameter affine motion model, the control points of the current block may be an upper-left pixel point, an upper-right pixel point, and a lower-left pixel point in the sub-block, and so on.
The details of the improved inherited control point motion vector prediction method have been described in detail above, and this embodiment can be implemented with reference to the details, which are not described herein again for brevity of the description.
Step 704: and calculating motion vectors corresponding to the positions of a plurality of sub-blocks in the image block to be processed by interpolation according to the motion vectors corresponding to the positions of the preset pixel points.
Specifically, for each sub-block of the current block (a sub-block may also be equivalent to a motion compensation unit, and the width and height of the sub-block are smaller than those of the current block), the motion information of all pixels in the motion compensation unit may be represented by the motion information of pixels at a preset position in the motion compensation unit. Assuming that the size of the motion compensation unit is MxN, the pixels at the predetermined positions may be the motion compensation unit center point (M/2, N/2), the upper left pixel point (0, 0), the upper right pixel point (M-1, 0), or pixels at other positions. Then, according to the motion information of the control point of the current block and the currently adopted affine motion model, the motion vector value of each sub-block in the current block can be obtained, and then motion compensation can be performed according to the motion vector value of the sub-block to obtain the pixel prediction value of the sub-block.
It should be noted that, for details of the implementation process of the embodiment in fig. 11 at the decoding end and the encoding end, reference may also be made to the descriptions of the embodiment in fig. 12 and the embodiment in fig. 14, and for brevity of the description, details are not repeated here.
It can be seen that, in the embodiment of the present invention, an improved inherited control point motion vector prediction method is adopted, which does not use the motion vector of the control point of the neighboring block, but uses the motion vectors of at least two sub-blocks of the neighboring block to derive the motion vector of the control point of the current block, and further derives the motion vector of each sub-block of the current block according to the motion vector of the control point, and implements prediction of the current block through motion compensation. The motion vector of the control point of the current block will not need to be stored subsequently, i.e. the motion vector of the control point of the current block is only used for the derivation of the motion vector of the sub-block of the current decoded block and not for the prediction of the motion vectors of the neighboring blocks. Therefore, the scheme of the invention only needs to store the motion vector of the subblock, and adopts the motion vector of the subblock to carry out motion compensation, thereby solving the problem of motion vector storage, avoiding the subblock where the control point is positioned from using the motion vector inconsistent with other subblocks to carry out motion compensation and improving the accuracy of prediction.
Based on the improved inherited control point motion vector prediction method, the following motion vector prediction method based on the affine motion model provided in the embodiment of the present invention is further described from the perspective of the decoding end, and referring to fig. 12, the method includes, but is not limited to, the following steps:
step 801: and analyzing the code stream, and determining the inter-frame prediction mode of the current block.
Specifically, the code stream may be parsed based on the syntax structure shown in table 1, so as to determine the inter prediction mode of the current block.
If it is determined that the inter prediction mode of the current block is the affine motion model based AMVP mode, i.e., the syntax elements merge _ flag =0 and affine _ inter _ flag =1, indicating that the inter prediction mode of the current block is the affine motion model based AMVP mode, steps 802 a-806 a are subsequently performed.
If it is determined that the inter prediction mode of the current block is the affine motion model-based Merge mode, i.e., syntax elements Merge _ flag =1 and affine _ Merge _ flag =1, indicating that the inter prediction mode of the current block is the affine motion model-based Merge mode, steps 802 b-805 b are subsequently performed.
Step 802a: and constructing a candidate motion vector list corresponding to the AMVP mode based on the affine motion model.
In the embodiment of the present invention, the candidate control point motion vector of the current block may be obtained based on an improved inherited control point motion vector prediction method and/or a constructed control point motion vector prediction method, and added to the candidate motion vector list corresponding to the AMVP mode.
In the process of determining the candidate control point motion vector of the current block, the improved inherited control point motion vector prediction method adopts the motion vectors of at least two sub-blocks of adjacent affine decoding blocks to derive the candidate control point motion vector prediction value (candidate motion vector binary group/triple group/quadruple group) of the current block so as to add a candidate motion vector list.
If the current block employs a 4-parameter affine motion model, the list of candidate motion vectors may comprise a list of tuples, including one or more tuples for constructing the 4-parameter affine motion model.
If the current block employs a 6-parameter affine motion model, the candidate motion vector list may comprise a triple list comprising one or more triplets for constructing the 6-parameter affine motion model.
If the current block employs an 8-parameter bilinear model, the candidate motion vector list may comprise a quad list comprising one or more quad(s) used to construct the 8-parameter bilinear model
In a possible application scenario, the candidate motion vector binary/ternary/quaternary list may be pruned and sorted according to a specific rule, and may be truncated or filled to a specific number.
For the improved control point motion vector prediction method, for example, taking fig. 7 as an example, the adjacent position blocks around the current block may be traversed according to the sequence of A1 → B0 → A0 → B2 in fig. 7, an affine decoding block where the adjacent position block is located is found, an affine motion model is constructed by using the motion vectors of at least two sub-blocks of the adjacent affine decoding block, and then a candidate control point motion vector (candidate motion vector binary/ternary/quaternary) of the current block is derived and added to the candidate motion vector list. It should be noted that other search orders may also be applicable to the embodiments of the present invention, and are not described herein again.
For details of the improved inherited control point motion vector prediction method, reference may be made to the related description above, and for brevity of description, detailed description is omitted here.
In addition, the content of the control point motion vector prediction method based on the structure of the AMVP mode of the affine motion model is also described in detail in the foregoing 4), and is not described here again for the sake of brevity of the description.
Step 803a: and analyzing the code stream and determining the optimal control point motion vector predicted value.
Specifically, the index number of the candidate motion vector list is obtained by parsing the code stream, and the optimal control point motion vector prediction value is determined from the candidate motion vector list constructed in step 602a according to the index number.
For example, if the affine motion model adopted by the current decoded block is a 4-parameter affine motion model (motionodeldc is 1), the index number is obtained through parsing, and the index number is, for example, mvp _ l0_ flag or mvp _ l1_ flag, and the optimal motion vector prediction values of 2 control points are determined from the candidate motion vector list according to the index number.
For another example, if the affine motion model adopted by the current decoding block is a 6-parameter affine motion model (2 for motionodeldc), the index number is obtained through analysis, and the optimal motion vector prediction value of 3 control points is determined from the candidate motion vector list according to the index number.
For another example, if the affine motion model adopted by the current decoding block is an 8-parameter bilinear model, the index number is obtained through analysis, and the optimal motion vector prediction values of 4 control points are determined from the candidate motion vector list according to the index number.
Step 804a: and analyzing the code stream and determining the motion vector of the control point.
Specifically, the motion vector difference of the control point is obtained by analyzing the code stream, and then the motion vector of the control point is obtained according to the motion vector difference of the control point and the optimal control point motion vector prediction value determined in the step 803 a.
For example, the affine motion model adopted by the current decoding block is a 4-parameter affine motion model (motionodeld is 1), and for the forward prediction as an example, the motion vector difference values of 2 control points are mvd _ coding (x 0, y0, 0) and mvd _ coding (x 0, y0, 1), respectively. And decoding the code stream to obtain the motion vector difference values of the 2 control points of the current block, and illustratively, decoding the code stream to obtain the motion vector difference values of the upper left position control point and the upper right position control point. And then adding the motion vector difference value and the motion vector predicted value of each control point to obtain the motion vector value of the control point, namely obtaining the motion vector value of the upper left position control point and the upper right position control point of the current block.
For another example, the affine motion model of the current decoding block is a 6-parameter affine motion model (2 for motionodeld id), and for the forward prediction example, the motion vector differences of 3 control points are mvd _ coding (x 0, y0, 0) and mvd _ coding (x 0, y0, 1) and mvd _ coding (x 0, y0, 2), respectively. And decoding the code stream to obtain the motion vector difference of the 3 control points of the current block, illustratively, decoding the code stream to obtain the motion vector difference of the upper left control point, the upper right control point and the lower left control point. Then, the motion vector difference value and the motion vector prediction value of each control point are added to obtain the motion vector value of the control point, namely the motion vector values of the upper left control point, the upper right control point and the lower left control point of the current block.
It should be noted that, the embodiment of the present invention may also be other affine motion models and other control point positions, which are not described herein again.
Step 805a: and obtaining the motion vector value of each sub-block in the current block according to the motion vector of the control point and the affine motion model adopted by the current block.
For each sub-block of the current affine decoding block (a sub-block can also be equivalent to a motion compensation unit, and the width and height of the sub-block are smaller than those of the current block), the motion information of all pixel points in the motion compensation unit can be represented by adopting the motion information of the pixel points at the preset positions in the motion compensation unit. Assuming that the size of the motion compensation unit is MxN, the pixels at the predetermined positions may be the motion compensation unit center point (M/2, N/2), the upper left pixel point (0, 0), the upper right pixel point (M-1, 0), or pixels at other positions.
Taking the motion compensation unit center point as an example, referring to fig. 13, fig. 13 shows the current affine decoding block and the motion compensation units (sub-blocks), each small block in the figure representing one motion compensation unit. In fig. 13, V0 denotes a motion vector of the upper left control point of the current affine decoding block, V1 denotes a motion vector of the upper right control point of the current affine decoding block, and V2 denotes a motion vector of the lower left control point of the current affine decoding block.
The coordinates of the motion compensation unit center point with respect to the top left vertex pixel of the current affine decoding block can be calculated using the following equation (45):
Figure BDA0001805725400000441
where i is the ith motion compensation unit in the horizontal direction (left to right), j is the jth motion compensation unit in the vertical direction (top to bottom), (x) (i,j) ,y (i,j) ) And (3) coordinates of the (i, j) th motion compensation unit center point relative to the pixel of the upper left control point of the current affine decoding block.
If the affine motion model adopted by the current affine decoding block is a 6-parameter affine motion model, (x) (i,j) ,y (i,j) ) Substituting 6 parameter affine motion model formula (46) to obtain the motion vector of the central point of each motion compensation unit as the motion vector (vx) of all pixel points in the motion compensation unit (i,j) ,vy (i,j) ):
Figure BDA0001805725400000442
If the affine motion model adopted by the current affine decoding block is a 4 affine motion model, (x) (i,j) ,y (i,j) ) Substituting into a 4-parameter affine motion model formula (47), obtaining the motion vector of the center point of each motion compensation unit as the motion vector (vx) of all pixel points in the motion compensation unit (i,j) ,vy (i,j) ):
Figure BDA0001805725400000443
Step 806a: and performing motion compensation on each sub-block according to the determined motion vector value of the sub-block to obtain a pixel prediction value of the sub-block.
Step 802b: and constructing a motion information candidate list of a merge mode based on the affine motion model.
In the embodiment of the present invention, the candidate control point motion vector of the current block may be obtained based on an improved inherited control point motion vector prediction method and/or a constructed control point motion vector prediction method, and added to the candidate motion vector list corresponding to the merge mode.
In the process of determining the candidate control point motion vector of the current block, the improved inherited control point motion vector prediction method adopts the motion vectors of at least two sub-blocks of adjacent affine decoding blocks to derive the candidate control point motion vector (candidate motion vector binary group/ternary group/quaternary group) of the current block so as to add the candidate motion vector list.
In a possible application scenario, the motion information candidate list may be pruned and sorted according to a specific rule, and may be truncated or filled to a specific number.
For example, taking fig. 8 as an example, the neighboring position blocks around the current block may be traversed according to the sequence of A1 → B0 → A0 → B2, the affine coding block where the neighboring position block is located is found, the affine motion model is constructed by using the motion vectors of at least two sub-blocks of the neighboring affine decoding blocks, and then the candidate control point motion vector (candidate motion vector binary/ternary/quaternary) of the current block is derived and added to the candidate motion vector list. It should be noted that other search orders may also be applicable to the embodiments of the present invention, and are not described herein again.
Specifically, in the traversal process, if the candidate motion vector list is empty, the candidate control point motion information is added into the candidate list; otherwise, continuously traversing the motion information in the candidate motion vector list in sequence, and checking whether the motion information which is the same as the motion information of the candidate control point exists in the candidate motion vector list. If the candidate motion vector list does not have the same motion information as the candidate control point motion information, the candidate control point motion information is added to the candidate motion vector list.
Wherein, judging whether the two candidate motion information are the same requires sequentially judging whether their forward and backward reference frames and the horizontal and vertical components of each forward and backward motion vector are the same. The two motion information are considered to be different only if all of the above elements are different.
If the number of motion information in the candidate motion vector list reaches the maximum list length maxaffinenummrgcard (maxaffinenmemmcrgencard is a positive integer, such as 1,2,3,4,5, etc.), the candidate list is constructed completely, otherwise, the next adjacent position block is traversed.
For the content of the improved inherited control point motion vector prediction method, reference may be made to the foregoing detailed description, and for brevity of description, detailed description is omitted here.
In addition, the content of the control point motion vector prediction method based on the structure of the Merge mode of the affine motion model is also described in detail in the foregoing 4), and is not repeated here for the sake of brevity of the description.
Step S803b: and analyzing the code stream and determining the optimal control point motion information.
Specifically, the index number of the candidate motion vector list is obtained by parsing the code stream, and the optimal control point motion information is determined from the candidate motion vector list constructed in step 802b according to the index number.
Step 804b: and obtaining the motion vector value of each sub-block in the current block according to the optimal control point motion information and the affine motion model adopted by the current decoding block. For the detailed implementation of this step, reference may be made to the description of step 805a, and for brevity of the description, detailed description is omitted here.
Step 805b: and performing motion compensation on each sub-block according to the determined motion vector value of the sub-block to obtain a pixel predicted value of the sub-block.
It can be seen that, in the embodiment of the present invention, an improved inherited control point motion vector prediction method is adopted, and since the improved inherited control point motion vector prediction method does not need to use motion vectors to control points of neighboring blocks, but uses motion vectors of at least two sub-blocks of neighboring affine decoding blocks, after the derivation of a sub-block motion vector of each affine decoding block is completed, the motion vector of a control point does not need to be stored, that is, the motion vector of the control point of a current decoding block is only used for deriving the motion vector of the sub-block of the current decoding block, and is not used for motion vector prediction of the neighboring blocks. Therefore, the scheme of the invention only needs to store the motion vector of the subblock, and adopts the motion vector of the subblock to carry out motion compensation, thereby solving the problem of motion vector storage and improving the accuracy of prediction.
The following describes a motion vector prediction method based on an affine motion model provided in the embodiment of the present invention from the perspective of an encoding end, with reference to fig. 14, the method includes, but is not limited to, the following steps:
step 901: an inter prediction mode of the current block is determined.
In a specific implementation, for the inter prediction at the encoding end, multiple inter prediction modes may also be preset, where the multiple intra prediction modes include, for example, the above-described AMVP mode based on the affine motion model and merge mode based on the affine motion model, and the encoding end traverses the multiple inter prediction modes to determine the inter prediction mode optimal for the prediction of the current block.
In another specific implementation, for inter-frame prediction at the encoding end, only one inter-frame prediction mode may be preset, that is, in this case, the encoding end directly determines that a default inter-frame prediction mode is currently adopted, where the default inter-frame prediction mode is an AMVP mode based on an affine motion model or a merge mode based on an affine motion model.
In the embodiment of the present invention, if it is determined that the inter prediction mode of the current block is the AMVP mode based on the affine motion model, steps 902a to 904a are subsequently performed.
In the embodiment of the present invention, if it is determined that the inter prediction mode of the current block is the AMVP mode based on the affine motion model, steps 902b to 904b are subsequently performed.
Step 902a: and constructing a candidate motion vector list corresponding to the AMVP mode based on the affine motion model.
In the embodiment of the present invention, the candidate control point motion vector predictor (such as candidate motion vector binary group/triple group/quadruple group) of the current block may be obtained based on an improved inherited control point motion vector prediction method and/or a constructed control point motion vector prediction method, and is added to the candidate motion vector list corresponding to the AMVP mode.
The specific implementation of this step can refer to the description of step 802a in the foregoing embodiment, and is not described herein again.
Step 903a: and determining the optimal control point motion vector predicted value according to the rate distortion cost.
In one example, the encoding end may obtain the motion vector of each sub motion compensation unit in the current block through the formula (3) or (5) or (7) by using a control point motion vector prediction value (such as a candidate motion vector binary group/ternary group/quaternary group) in the candidate motion vector list, and further obtain a pixel value of a corresponding position in a reference frame pointed by the motion vector of each sub motion compensation unit, as the prediction value, to perform motion compensation using an affine motion model. And calculating the average value of the difference value between the original value and the predicted value of each pixel point in the current coding block, selecting the control point motion vector predicted value corresponding to the minimum average value as the optimal control point motion vector predicted value, and using the optimal control point motion vector predicted value as the motion vector predicted value of 2 or 3 or 4 control points of the current block.
Step 904a: and coding the index value, the motion vector difference value of the control point and the indication information of the inter-frame prediction mode into a code stream.
In an example, the decoding end may perform motion search in a certain search range using the optimal control point motion vector predictor as a search starting point to obtain a Control Point Motion Vector (CPMV), and calculate a difference value (CPMVD) between the control point motion vector and the control point motion vector predictor, and then the encoding end encodes an index value indicating a position of the control point motion vector predictor in the candidate motion vector list and the CPMVD into a code stream, and may further encode indication information of an inter-frame prediction mode into the code stream so as to be subsequently transmitted to the decoding end.
In a specific implementation, the syntax element coded into the code stream may refer to the descriptions in table 1 and table 2, which are not described herein again.
Step 902b: and constructing a candidate motion vector list corresponding to the Merge mode based on the affine motion model.
In the embodiment of the present invention, a candidate motion vector predictor (e.g., a candidate motion vector binary group/triple group/quadruple group) of a control point of a current block may be obtained based on an improved inherited control point motion vector prediction method and/or a constructed control point motion vector prediction method, and added to a candidate motion vector list corresponding to the Merge mode.
The specific implementation of this step can refer to the description of step 802b in the foregoing embodiment, and is not described herein again.
Step 903b: and determining the optimal control point motion information according to the rate distortion cost.
In an example, the encoding end may obtain the motion vector of each sub-motion compensation unit in the current encoding block through formula (3) or (5) or (7) by using the control point motion vector (such as candidate motion vector binary/ternary/quaternary) in the candidate motion vector list, and further obtain the pixel value of the position in the reference frame pointed by the motion vector of each sub-motion compensation unit, as the predicted value thereof, to perform affine motion compensation. Calculating the average value of the difference value between the original value and the predicted value of each pixel point in the current coding block, selecting the control point motion vector corresponding to the minimum average value of the difference values as the optimal control point motion vector, wherein the optimal control point motion vector is used as the motion vector of 2 or 3 or 4 control points of the current coding block.
Step 904b: and encoding the index value and the indication information of the inter-frame prediction mode into a code stream.
In one example, the decoding end may encode an index value indicating the position of the control point motion vector in the candidate list into a code stream, and encode the indication information of the inter-frame prediction mode into the code stream for subsequent delivery to the decoding end.
In specific implementation, the syntax element of the coded code stream may refer to the descriptions in table 1 and table 2, which are not described herein again.
It should be noted that the foregoing embodiment only describes the process of implementing encoding and code stream transmission by the encoding end, and those skilled in the art will understand that the encoding end may also implement other methods described in the embodiments of the present invention in other links according to the foregoing description. For example, in the prediction of the current block at the encoding end, the specific implementation of the reconstruction process of the current block may refer to the related method (as in the embodiment of fig. 12) described above at the decoding end, and is not described herein again.
It can be seen that, in the embodiment of the present invention, an improved inherited control point motion vector prediction method is adopted, and because the improved inherited control point motion vector prediction method does not need to use motion vectors of control points of adjacent affine coding blocks, but uses motion vectors of at least two sub-blocks of adjacent affine coding blocks, a control point candidate motion vector of a current block is derived and obtained according to the motion vectors of the at least two sub-blocks, a list is established, an optimal control point candidate motion vector is obtained, and an index value corresponding to the control point candidate motion vector in the list is sent to a decoding end, and the motion vector of a control point does not need to be stored, that is, the motion vector of the control point of the current coding block is only used for deriving the motion vector of the sub-block of the current coding block, and is not subsequently used for motion vector prediction of an adjacent block. Therefore, the scheme of the invention only needs to store the motion vector of the subblock, and adopts the motion vector of the subblock to carry out motion compensation, thereby solving the problem of motion vector storage and simultaneously improving the accuracy of prediction.
Based on the same inventive concept as the above method, an embodiment of the present invention further provides an apparatus 1000, where the apparatus 1000 includes a reference block obtaining module 1001, a sub-block determining module 1002, a first calculating module 1003, and a second calculating module 1004, where:
a reference block acquiring module 1001, configured to acquire a spatial reference block of an image block to be processed in the video data;
a subblock determining module 1002, configured to determine positions of a plurality of preset subblocks in the spatial domain reference block;
the first calculation module 1003 is configured to calculate, according to the motion vector corresponding to the preset sub-block position, a motion vector corresponding to a preset pixel position of the image block to be processed through interpolation;
the second calculating module 1004 is configured to calculate, according to the motion vector corresponding to the preset pixel point position, a motion vector corresponding to a plurality of sub-block positions in the image block to be processed through interpolation.
In a possible embodiment, the reference block obtaining module 1001 is specifically configured to: determining the availability of candidate reference blocks of one or more preset spatial domain positions of the image block to be processed according to a preset sequence; and obtaining a candidate reference block available first in the preset sequence as the spatial domain reference block.
Wherein when the candidate reference block and the image block to be processed are located in the same image area, and the candidate reference block obtains a motion vector based on the affine motion model, then determining that the candidate reference block is available.
In a possible embodiment, the candidate reference blocks of the preset spatial position include: adjacent image blocks which are positioned right above, right left, right above, left lower part and left upper part of the image block to be processed;
the reference block acquiring module 1001 is specifically configured to: and sequentially checking the availability of the candidate reference blocks according to the sequence of the positive left adjacent image block, the positive upper adjacent image block, the right upper adjacent image block, the left lower adjacent image block and the left upper adjacent image block until the first available candidate reference block is determined.
In a possible embodiment, the sub-block locations comprise: the position of the pixel point at the upper left corner in the sub-block; or the position of the geometric center of the sub-block, or the position of a pixel point in the sub-block closest to the geometric center position.
In a possible embodiment, a distance between two of the plurality of predetermined subblock positions is S, S being a K power of 2, K being a non-negative integer.
In a possible embodiment, the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2) and a second preset position (x 4+ M/2+ P, y4+ N/2), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, P is a power of K of 2, K is a non-negative integer, K is smaller than U, and U is a width of the spatial domain reference block.
In a possible embodiment, the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2) and a third preset position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, Q is an R-th power of 2, R is a non-negative integer, Q is smaller than V, and V is a height of the spatial domain reference block.
In a possible embodiment, the preset pixel point position includes a position of an upper-left pixel point in the image block to be processed, and the first calculating module 1003 is specifically configured to calculate a motion vector corresponding to the position of the preset pixel point of the image block to be processed according to the following formula:
Figure BDA0001805725400000481
Figure BDA0001805725400000482
Figure BDA0001805725400000483
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first preset position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Is the vertical component, x, of the motion vector corresponding to said second predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left corner pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the upper left corner pixel point in the image block to be processed 1 Is the horizontal coordinate, y, of the position of the pixel point at the upper right corner in the image block to be processed 1 Is the vertical coordinate, x, of the position of the upper right corner pixel point in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
In a possible embodiment, the preset pixel point position includes a position of an upper left pixel point in the image block to be processed and a position of an upper right pixel point in the image block to be processed, and the second calculating module 1004 is specifically configured to calculate motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure BDA0001805725400000491
wherein W is the width of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, and vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
In a possible embodiment, the affine motion model is a 6-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2), a second preset position (x 4+ M/2+ P, y4+ N/2), and a third preset position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of an upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, P is a K-th power of 2, Q is an R-th power of 2, K and R are non-negative integers, P is less than U, Q is less than V, U is a width of the reference spatial domain block, and V is a height of the spatial domain reference block.
In a possible embodiment, the preset pixel point position includes a position of an upper left pixel point in the image block to be processed, a position of an upper right pixel point in the image block to be processed, and a position of a lower left pixel point in the image block to be processed, and the first calculating module 1003 is specifically configured to calculate a motion vector corresponding to the position of the preset pixel point of the image block to be processed according to the following formula:
Figure BDA0001805725400000492
Figure BDA0001805725400000493
Figure BDA0001805725400000494
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first predetermined position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Is the vertical component, vx, of the motion vector corresponding to the second preset position 6 Is the horizontal component, vy, of the motion vector corresponding to the third preset position 6 Vertical component, x, of motion vector corresponding to the third predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the upper left corner pixel point in the image block to be processed 1 Is the horizontal coordinate, y, of the position of the pixel point at the upper right corner in the image block to be processed 1 Is the vertical coordinate, x, of the position of the upper right corner pixel point in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
In a possible embodiment, the second calculating module 1004 is specifically configured to calculate motion vectors corresponding to positions of a plurality of sub-blocks in the image block to be processed according to the following formula:
Figure BDA0001805725400000501
wherein W is the width of the image block to be processed, H is the height of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
In a possible embodiment, when a straight line where the upper edge of the to-be-processed image block is located coincides with a straight line where the upper edge of the coding tree unit CTU where the to-be-processed image block is located, and the spatial domain reference block is located right above, left above, or right above the to-be-processed image block, at least two of the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the upper edge of the to-be-processed image block.
In a possible embodiment, when a straight line where a left edge of the to-be-processed image block is located coincides with a straight line where a left edge of the coding tree unit CTU where the to-be-processed image block is located, and the spatial reference block is located at a right left side, an upper left side, or a lower left side of the to-be-processed image block, at least two sub-blocks among the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the left edge of the to-be-processed image block.
In the above embodiments of the present invention, the motion vectors corresponding to the positions of the sub-blocks are respectively used for prediction of the motion vectors of the sub-blocks.
It should be noted that the reference block obtaining module 1001, the sub-block determining module 1002, the first calculating module 1003, and the second calculating module 1004 may be applied to an inter prediction process at an encoding end or a decoding end. Specifically, on the encoding side, these modules may be applied to the inter prediction unit 244 in the prediction processing unit 260 of the aforementioned encoder 20; on the decoding side, these modules may be applied to the inter prediction unit 344 in the prediction processing unit 360 of the aforementioned decoder 30.
It should be further noted that, for reference to the detailed implementation process of the block obtaining module 1001, the sub-block determining module 1002, the first calculating module 1003, and the second calculating module 1004, reference may be made to the detailed description of the embodiments in fig. 11, fig. 12, and fig. 14, and for brevity of the description, details are not repeated here.
In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. Computer readable media may comprise computer readable storage media corresponding to tangible media, such as data storage media or communication media, including any medium that facilitates transfer of a computer program from one place to another, such as according to a communication protocol. In this manner, the computer-readable medium may generally correspond to a non-transitory tangible computer-readable storage medium, or a communication medium, such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementing the techniques described in this disclosure. The computer program product may include a computer-readable medium.
By way of example, and not limitation, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage 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. Also, any connection is properly termed a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that the computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but are instead directed to non-transitory tangible storage media. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

Claims (27)

1. A motion vector prediction method based on an affine motion model is characterized by comprising the following steps:
acquiring a spatial domain reference block of an image block to be processed;
determining a plurality of preset sub-block positions in the spatial domain reference block;
according to the motion vector corresponding to the position of the preset sub-block, calculating a motion vector corresponding to the position of a preset pixel point of the image block to be processed through interpolation;
according to the motion vector corresponding to the position of the preset pixel point, calculating the motion vectors corresponding to the positions of a plurality of sub-blocks in the image block to be processed through interpolation;
the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2) and a second preset position (x 4+ M/2+ P, y4+ N/2), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, P is a power of K of 2, K is a non-negative integer, K is smaller than U, and U is the width of the spatial domain reference block;
alternatively, the first and second liquid crystal display panels may be,
the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions comprise a first preset position (x 4+ M/2, y4+ N/2) and a third preset position (x 4+ M/2, y4+ N/2+ Q), wherein x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, Q is an R power of 2, R is a non-negative integer, Q is smaller than V, and V is the height of the spatial domain reference block;
alternatively, the first and second electrodes may be,
the affine motion model is a 6-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2), a second preset position (x 4+ M/2+ P, y4+ N/2) and a third preset position (x 4+ M/2, y4+ N/2+ Q), where x4 is a position abscissa of an upper left-hand pixel in the spatial domain reference block, y4 is a position ordinate of the upper left-hand pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, P is a K-th power of 2, Q is an R-th power of 2, K and R are non-negative integers, P is smaller than U, Q is smaller than V, U is the width of the spatial domain reference block, and V is the height of the spatial domain reference block.
2. The method according to claim 1, wherein said obtaining a spatial reference block of the image block to be processed comprises:
determining the availability of candidate reference blocks of one or more preset spatial domain positions of the image block to be processed according to a preset sequence;
and obtaining a candidate reference block available first in the preset sequence as the spatial domain reference block.
3. The method according to claim 2, characterized in that it is determined that the candidate reference block is available when the candidate reference block is located within the same image area as the image block to be processed and the candidate reference block obtains a motion vector based on the affine motion model.
4. The method according to claim 2 or 3, wherein the candidate reference blocks of the preset spatial position comprise: adjacent image blocks which are positioned right above, right left, right above, left lower and left upper of the image block to be processed;
correspondingly, the determining the availability of the candidate reference blocks at one or more preset spatial positions of the image block to be processed according to the preset sequence includes:
and sequentially checking the availability of the candidate reference blocks according to the sequence of the positive left adjacent image block, the positive upper adjacent image block, the right upper adjacent image block, the left lower adjacent image block and the left upper adjacent image block until the first available candidate reference block is determined.
5. The method of claim 4, wherein the sub-block locations comprise:
the position of the pixel point at the upper left corner in the sub-block; alternatively, the first and second liquid crystal display panels may be,
the position of the geometric center of the sub-block, or,
and the position of a pixel point which is closest to the geometric center position in the sub-block.
6. The method of claim 5, wherein a distance between two of the plurality of predetermined subblock positions is S, S being a power of 2 to K, and K being a non-negative integer.
7. The method according to claim 1, wherein the preset pixel point position includes at least two of an upper left pixel point position in the image block to be processed, an upper right pixel point position in the image block to be processed, and a lower left pixel point position in the image block to be processed, and the interpolating, according to the motion vector corresponding to the preset sub-block position, the motion vector corresponding to the preset pixel point position of the image block to be processed includes calculating the motion vector corresponding to the preset pixel point position of the image block to be processed according to the following formula:
Figure FDA0003873166610000021
Figure FDA0003873166610000022
Figure FDA0003873166610000023
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first preset position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 For the horizontal component, vy, of the motion vector corresponding to said second predetermined position 5 Vertical component, x, of motion vector corresponding to the second predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the pixel point at the upper left corner in the image block to be processed 1 The horizontal coordinate, y, of the position of the upper right corner pixel point in the image block to be processed 1 Is the vertical coordinate, x, of the upper right corner pixel point position in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
8. The method according to claim 7, wherein the preset pixel point position comprises a top left pixel point position in the image block to be processed and a top right pixel point position in the image block to be processed, and the interpolating the motion vectors corresponding to the plurality of sub-block positions in the image block to be processed according to the motion vectors corresponding to the preset pixel point position comprises calculating the motion vectors corresponding to the plurality of sub-block positions in the image block to be processed according to the following formula:
Figure FDA0003873166610000031
wherein W is the width of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
9. The method according to claim 1, wherein the preset pixel point position comprises an upper left pixel point position in the image block to be processed, an upper right pixel point position in the image block to be processed and a lower left pixel point position in the image block to be processed, and the interpolating, according to the motion vector corresponding to the preset sub-block position, the motion vector corresponding to the preset pixel point position of the image block to be processed includes calculating the motion vector corresponding to the preset pixel point position of the image block to be processed according to the following formula:
Figure FDA0003873166610000032
Figure FDA0003873166610000033
Figure FDA0003873166610000034
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component of the motion vector corresponding to the position of the pixel point at the upper left corner in the image block to be processed,vx 1 is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first preset position 4 Is the vertical component, vx, of the motion vector corresponding to the first predetermined position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Is the vertical component, vx, of the motion vector corresponding to the second preset position 6 Is the horizontal component, vy, of the motion vector corresponding to the third preset position 6 Vertical component, x, of motion vector corresponding to said third predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the pixel point at the upper left corner in the image block to be processed 1 The horizontal coordinate, y, of the position of the upper right corner pixel point in the image block to be processed 1 Is the vertical coordinate, x, of the position of the upper right corner pixel point in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
10. The method according to claim 9, wherein the calculating motion vectors corresponding to a plurality of sub-block positions in the image block to be processed by interpolation according to the motion vectors corresponding to the preset pixel point positions includes calculating the motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure FDA0003873166610000041
wherein W is the width of the image block to be processed, H is the height of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
11. The method according to claim 1, wherein when a straight line of an upper edge of the to-be-processed image block coincides with a straight line of an upper edge of a code tree unit CTU of the to-be-processed image block, and the spatial reference block is located right above, left above, or right above the to-be-processed image block, at least two sub-blocks of the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the upper edge of the to-be-processed image block.
12. The method according to claim 1, wherein when a straight line of a left edge of the to-be-processed image block coincides with a straight line of a left edge of a code tree unit CTU of the to-be-processed image block, and the spatial reference block is located at a position directly to the left, above the left, or below the left of the to-be-processed image block, at least two of the sub-blocks corresponding to the plurality of predetermined sub-block positions are adjacent to the left edge of the to-be-processed image block.
13. The method according to claim 1, wherein the motion vectors corresponding to the sub-block positions are used for prediction of the motion vectors of the sub-blocks, respectively.
14. An affine motion model-based motion vector prediction apparatus characterized by comprising:
the reference block acquisition module is used for acquiring a spatial domain reference block of a to-be-processed image block in the video data;
the subblock determining module is used for determining a plurality of preset subblock positions in the spatial domain reference block;
the first calculation module is used for calculating a motion vector corresponding to a preset pixel position of the image block to be processed in an interpolation mode according to the motion vector corresponding to the preset sub-block position;
the second calculation module is used for calculating motion vectors corresponding to the positions of a plurality of sub-blocks in the image block to be processed in an interpolation mode according to the motion vectors corresponding to the positions of the preset pixel points;
the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions include a first preset position (x 4+ M/2, y4+ N/2) and a second preset position (x 4+ M/2+ P, y4+ N/2), where x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, P is a power of K of 2, K is a non-negative integer, K is smaller than U, and U is the width of the spatial domain reference block;
alternatively, the first and second liquid crystal display panels may be,
the affine motion model is a 4-parameter affine motion model, and the plurality of preset sub-block positions comprise a first preset position (x 4+ M/2, y4+ N/2) and a third preset position (x 4+ M/2, y4+ N/2+ Q), wherein x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a sub-block width, N is a sub-block height, Q is an R power of 2, R is a non-negative integer, Q is smaller than V, and V is the height of the spatial domain reference block;
alternatively, the first and second electrodes may be,
the affine motion model is a 6-parameter affine motion model, and the plurality of preset subblock positions include a first preset position (x 4+ M/2, y4+ N/2), a second preset position (x 4+ M/2+ P, y4+ N/2) and a third preset position (x 4+ M/2, y4+ N/2+ Q), wherein x4 is a position abscissa of an upper left pixel in the spatial domain reference block, y4 is a position ordinate of the upper left pixel in the spatial domain reference block, M is a subblock width, N is a subblock height, P is a power K of 2, Q is a power R of 2, K and R are non-negative integers, P is smaller than U, Q is smaller than V, U is the width of the spatial domain reference block, and V is the height of the spatial domain reference block.
15. The device of claim 14, wherein the reference block acquisition module is specifically configured to:
determining the availability of candidate reference blocks at one or more preset spatial domain positions of the image block to be processed according to a preset sequence;
and obtaining a candidate reference block available first in the preset sequence as the spatial domain reference block.
16. The apparatus according to claim 15, wherein the candidate reference block is determined to be available when the candidate reference block is located within the same image area as the image block to be processed and the candidate reference block obtains a motion vector based on the affine motion model.
17. The apparatus according to claim 15 or 16, wherein the candidate reference blocks of the preset spatial position comprise: adjacent image blocks which are positioned right above, right left, right above, left lower and left upper of the image block to be processed;
the reference block acquisition module is specifically configured to: and sequentially checking the availability of the candidate reference blocks according to the sequence of the positive left adjacent image block, the positive upper adjacent image block, the right upper adjacent image block, the left lower adjacent image block and the left upper adjacent image block until determining the first available candidate reference block.
18. The apparatus of claim 17, wherein the sub-block locations comprise:
the position of the pixel point at the upper left corner in the sub-block; alternatively, the first and second electrodes may be,
the position of the geometric center of the sub-block, or,
and the position of one pixel point which is closest to the geometric center position in the sub-block.
19. The apparatus of claim 18, wherein a distance between two of the plurality of predetermined subblock positions is S, S being a power of 2 to K, K being a non-negative integer.
20. The apparatus according to claim 14, wherein the preset pixel point position comprises a position of an upper left pixel point in the image block to be processed, and the first calculating module is specifically configured to calculate the motion vector corresponding to the preset pixel point position of the image block to be processed according to the following formula:
Figure FDA0003873166610000061
Figure FDA0003873166610000062
Figure FDA0003873166610000063
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the pixel point at the lower left corner in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first preset position 4 Is the vertical component, vx, of the motion vector corresponding to the first preset position 5 For the horizontal component, vy, of the motion vector corresponding to said second predetermined position 5 Vertical component, x, of motion vector corresponding to the second predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left pixel point in the image block to be processed 0 For the position of the upper left pixel point in the image block to be processedOrdinate, x 1 The horizontal coordinate, y, of the position of the upper right corner pixel point in the image block to be processed 1 Is the vertical coordinate, x, of the upper right corner pixel point position in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
21. The apparatus according to claim 20, wherein the preset pixel point position includes a position of an upper left pixel point in the image block to be processed and a position of an upper right pixel point in the image block to be processed, and the second calculating module is specifically configured to calculate motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure FDA0003873166610000064
wherein W is the width of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
22. The apparatus according to claim 14, wherein the preset pixel point position includes a position of an upper left pixel point in the image block to be processed, a position of an upper right pixel point in the image block to be processed, and a position of a lower left pixel point in the image block to be processed, and the first calculating module is specifically configured to calculate a motion vector corresponding to the preset pixel point position of the image block to be processed according to the following formula:
Figure FDA0003873166610000071
Figure FDA0003873166610000072
Figure FDA0003873166610000073
wherein, vx 0 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper left pixel point in the image block to be processed 0 Is the vertical component, vx, of the motion vector corresponding to the position of the upper left-hand pixel point in the image block to be processed 1 Is the horizontal component, vy, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 1 Is the vertical component, vx, of the motion vector corresponding to the position of the upper right pixel point in the image block to be processed 2 Is the horizontal component, vy, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 2 Is the vertical component, vx, of the motion vector corresponding to the position of the lower left corner pixel point in the image block to be processed 4 Is the horizontal component, vy, of the motion vector corresponding to the first predetermined position 4 Is the vertical component, vx, of the motion vector corresponding to the first preset position 5 Is the horizontal component, vy, of the motion vector corresponding to the second predetermined position 5 Is the vertical component, vx, of the motion vector corresponding to the second predetermined position 6 Is the horizontal component, vy, of the motion vector corresponding to the third preset position 6 Vertical component, x, of motion vector corresponding to said third predetermined position 0 Is the horizontal coordinate, y, of the position of the upper left corner pixel point in the image block to be processed 0 Is the vertical coordinate, x, of the position of the pixel point at the upper left corner in the image block to be processed 1 Is the horizontal coordinate, y, of the position of the pixel point at the upper right corner in the image block to be processed 1 Is the vertical coordinate, x, of the position of the upper right corner pixel point in the image block to be processed 2 Is the horizontal coordinate, y, of the position of the lower left corner pixel point in the image block to be processed 2 And the vertical coordinate of the position of the pixel point at the lower left corner in the image block to be processed.
23. The apparatus according to claim 22, wherein the second calculating module is specifically configured to calculate motion vectors corresponding to a plurality of sub-block positions in the image block to be processed according to the following formula:
Figure FDA0003873166610000074
wherein W is the width of the image block to be processed, H is the height of the image block to be processed, vx is the horizontal component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions, vy is the vertical component of a corresponding motion vector located at (x, y) in the plurality of sub-block positions.
24. The apparatus according to claim 14, wherein when a straight line on which an upper edge of the to-be-processed image block is located coincides with a straight line on which an upper edge of a code tree unit CTU on which the to-be-processed image block is located, and the spatial reference block is located directly above, above left, or above right of the to-be-processed image block, at least two sub-blocks among the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the upper edge of the to-be-processed image block.
25. The apparatus according to claim 14, wherein when a straight line of a left edge of the to-be-processed image block coincides with a straight line of a left edge of a code tree unit CTU of the to-be-processed image block, and the spatial reference block is located at a position directly to the left, above the left, or below the left of the to-be-processed image block, at least two sub-blocks among the sub-blocks corresponding to the plurality of preset sub-block positions are adjacent to the left edge of the to-be-processed image block.
26. The apparatus of claim 14, wherein the motion vectors corresponding to the sub-block positions are used for prediction of the motion vectors of the sub-blocks, respectively.
27. A video encoding and decoding apparatus comprising: a non-volatile memory and a processor coupled to each other, the processor calling program code stored in the memory to perform the method as described in any of claims 1-13.
CN201811096702.9A 2018-09-10 2018-09-19 Motion vector prediction method and device based on affine motion model Active CN110891176B (en)

Priority Applications (8)

Application Number Priority Date Filing Date Title
BR112021004505-8A BR112021004505A2 (en) 2018-09-10 2019-06-14 motion vector prediction method based on affine and device motion model
PCT/CN2019/091364 WO2020052304A1 (en) 2018-09-10 2019-06-14 Motion vector prediction method and device based on affine motion model
SG11202102361WA SG11202102361WA (en) 2018-09-10 2019-06-14 Motion vector prediction method based on affine motion model and device
JP2021513246A JP7279154B2 (en) 2018-09-10 2019-06-14 Motion vector prediction method and apparatus based on affine motion model
EP19858748.7A EP3840380A4 (en) 2018-09-10 2019-06-14 Motion vector prediction method and device based on affine motion model
CA3112368A CA3112368A1 (en) 2018-09-10 2019-06-14 Motion vector prediction method based on affine motion model and device
KR1020217010006A KR102620024B1 (en) 2018-09-10 2019-06-14 Motion vector prediction method and device based on affine motion model
US17/196,642 US11539975B2 (en) 2018-09-10 2021-03-09 Motion vector prediction method based on affine motion model and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2018110516626 2018-09-10
CN201811051662 2018-09-10

Publications (2)

Publication Number Publication Date
CN110891176A CN110891176A (en) 2020-03-17
CN110891176B true CN110891176B (en) 2023-01-13

Family

ID=69745703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811096702.9A Active CN110891176B (en) 2018-09-10 2018-09-19 Motion vector prediction method and device based on affine motion model

Country Status (9)

Country Link
US (1) US11539975B2 (en)
EP (1) EP3840380A4 (en)
JP (1) JP7279154B2 (en)
KR (1) KR102620024B1 (en)
CN (1) CN110891176B (en)
BR (1) BR112021004505A2 (en)
CA (1) CA3112368A1 (en)
SG (1) SG11202102361WA (en)
WO (1) WO2020052304A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MX2021007018A (en) * 2018-12-13 2021-07-21 Beijing Dajia Internet Information Tech Co Ltd Method for deriving constructed affine merge candidates.
SG11202111760SA (en) * 2019-04-25 2021-11-29 Op Solutions Llc Signaling of global motion vector in picture header
CN113630602A (en) * 2021-06-29 2021-11-09 杭州未名信科科技有限公司 Affine motion estimation method and device for coding unit, storage medium and terminal
CN113630601B (en) * 2021-06-29 2024-04-02 杭州未名信科科技有限公司 Affine motion estimation method, affine motion estimation device, affine motion estimation equipment and storage medium
WO2023051641A1 (en) * 2021-09-28 2023-04-06 Beijing Bytedance Network Technology Co., Ltd. Method, apparatus, and medium for video processing
WO2023055149A1 (en) * 2021-09-29 2023-04-06 엘지전자 주식회사 Image encoding/decoding method and apparatus, and recording medium storing bitstream
WO2024037638A1 (en) * 2022-08-18 2024-02-22 Douyin Vision Co., Ltd. Method, apparatus, and medium for video processing
CN116117800B (en) * 2022-12-19 2023-08-01 广东建石科技有限公司 Machine vision processing method for compensating height difference, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017156705A1 (en) * 2016-03-15 2017-09-21 Mediatek Inc. Affine prediction for video coding
WO2018061563A1 (en) * 2016-09-27 2018-04-05 シャープ株式会社 Affine motion vector derivation device, prediction image generation device, moving image decoding device, and moving image coding device
CN108432250A (en) * 2016-01-07 2018-08-21 联发科技股份有限公司 The method and device of affine inter-prediction for coding and decoding video

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3715283B2 (en) * 2003-02-04 2005-11-09 株式会社半導体理工学研究センター Image compression encoding method and apparatus for moving images
JP2012023597A (en) * 2010-07-15 2012-02-02 Sony Corp Image processing device and image processing method
KR101739987B1 (en) * 2010-12-28 2017-05-26 에스케이 텔레콤주식회사 Video Encoding/Decoding Method and Apparatus Using Feature Vector of Adjacent Block
CN106303543B (en) * 2015-05-15 2018-10-30 华为技术有限公司 Encoding video pictures and decoded method, encoding device and decoding device
CN108600749B (en) * 2015-08-29 2021-12-28 华为技术有限公司 Image prediction method and device
WO2017130696A1 (en) 2016-01-29 2017-08-03 シャープ株式会社 Prediction image generation device, moving image decoding device, and moving image encoding device
RU2696551C1 (en) 2016-03-15 2019-08-02 МедиаТек Инк. Method and device for encoding video with compensation of affine motion
US10560712B2 (en) * 2016-05-16 2020-02-11 Qualcomm Incorporated Affine motion prediction for video coding
US10448010B2 (en) * 2016-10-05 2019-10-15 Qualcomm Incorporated Motion vector prediction for affine motion models in video coding
US10681370B2 (en) * 2016-12-29 2020-06-09 Qualcomm Incorporated Motion vector generation for affine motion model for video coding

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108432250A (en) * 2016-01-07 2018-08-21 联发科技股份有限公司 The method and device of affine inter-prediction for coding and decoding video
WO2017156705A1 (en) * 2016-03-15 2017-09-21 Mediatek Inc. Affine prediction for video coding
WO2018061563A1 (en) * 2016-09-27 2018-04-05 シャープ株式会社 Affine motion vector derivation device, prediction image generation device, moving image decoding device, and moving image coding device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Description of CE4:Inter prediction and motion vector coding;YANG,Haitao 等;《Joint video experts team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11 10th Meeting: San Diego US》;20180420;第2.2.8.2,2.2.9,2.2.10,3.2.11,3.2.12部分 *
Non-CE4:A study on the affine merge mode;ZHOU,Minhua 等;《Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29/WG 11 11th Meeting:Ljubljana,SI》;20180718;全文 *

Also Published As

Publication number Publication date
BR112021004505A2 (en) 2021-06-08
WO2020052304A1 (en) 2020-03-19
CN110891176A (en) 2020-03-17
EP3840380A1 (en) 2021-06-23
KR20210052536A (en) 2021-05-10
JP7279154B2 (en) 2023-05-22
US20210235105A1 (en) 2021-07-29
KR102620024B1 (en) 2023-12-29
US11539975B2 (en) 2022-12-27
CA3112368A1 (en) 2020-03-19
SG11202102361WA (en) 2021-04-29
JP2021536197A (en) 2021-12-23
EP3840380A4 (en) 2021-10-13

Similar Documents

Publication Publication Date Title
CN110891176B (en) Motion vector prediction method and device based on affine motion model
CN112005551B (en) Video image prediction method and device
CN112703735B (en) Video encoding/decoding method, related apparatus and computer-readable storage medium
WO2020114510A1 (en) Weighted prediction method and device used for multiple hypothesis coding
CN111698515B (en) Method and related device for inter-frame prediction
US11758130B2 (en) Video picture decoding and encoding method and apparatus
CN111107373B (en) Inter-frame prediction method based on affine prediction mode and related device
CN111355951A (en) Video decoding method, device and decoding equipment
AU2024201357A1 (en) Picture prediction method and apparatus, and computer-readable storage medium
AU2020261145A1 (en) Picture prediction method and apparatus, and computer-readable storage medium
CN111432219A (en) Inter-frame prediction method and device
CN111372086B (en) Video image decoding method and device
WO2020182194A1 (en) Inter-frame prediction method and related device
CN112637590A (en) Video encoder, video decoder and corresponding methods
CN111355961A (en) Method and device for inter-frame prediction
CN111479111A (en) Method and device for determining image display sequence and video coding and decoding equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant