Method and apparatus for prediction refinement with optical flow for affine coded block

The use of prediction refinement using optical flow for affine-coded blocks improves video coding efficiency by refining sub-block-based prediction at pixel/sample level, balancing complexity and accuracy while reducing unnecessary computational overhead.

JP2025184871AActive Publication Date: 2025-12-18HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2025141524
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-04-28
Filing Date
2025-08-27
Publication Date
2025-12-18
Estimated Expiration
2040-03-20

AI Technical Summary

Technical Problem

Existing sub-block-based affine motion compensation methods in video coding lose prediction accuracy due to complexity, necessitating a better trade-off between coding complexity and prediction accuracy.

Method used

Implementing prediction refinement using optical flow (PROF) for affine-coded blocks, refining sub-block-based prediction at pixel/sample level granularity, and conditionally performing PROF only when prediction accuracy can be improved to reduce unnecessary computational complexity.

Benefits of technology

Enhances compression performance by achieving a better trade-off between coding complexity and prediction accuracy without increasing memory access bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025184871000001_ABST
    Figure 2025184871000001_ABST
Patent Text Reader

Abstract

To provide an apparatus, an encoder, a decoder and corresponding methods for prediction refinement with optical flow (PROF) for an affine coded block.SOLUTION: A method includes, when a plurality of optical flow decision conditions are fulfilled for an affine coded block, performing a PROF process for a current sub-block of the affine coded block to obtain refined prediction sample values of the current sub-block of the affine coded block. After the sub-block based affine motion compensation is performed, a prediction sample value of the current sample of the current sub-block is refined by adding a delta prediction value. Thus, it allows for a better trade-off between coding complexity and prediction accuracy.SELECTED DRAWING: Figure 11A
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This patent application claims priority to U.S. Provisional Patent Application No. 62 / 821,440, filed March 20, 2019, and to U.S. Provisional Patent Application No. 62 / 839,765, filed April 28, 2019. The disclosures of the aforementioned patent applications are incorporated herein by reference in their entireties.

[0002] FIELD Embodiments of the present disclosure relate generally to the field of picture processing, and more particularly to a method for refining sub-block-based affine motion compensated prediction using optical flow when one or more constraints are required. [Background technology]

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

[0004] The amount of video data required to render even a relatively short video can be significant, which can pose challenges when the data is to be streamed or otherwise communicated over communication networks with limited bandwidth capacity. Therefore, video data is typically compressed before being communicated over modern telecommunications networks. Because memory resources can be limited, video size can also be an issue when the video is stored on a storage device. Video compression devices often use software and / or hardware to code video data at the source before transmission or storage, thereby reducing the amount of data needed to represent a digital video image. The compressed data is then received at the destination by a video decompression device, which decodes the video data. With limited network resources and an ever-increasing demand for higher video quality, improved compression and decompression techniques are desired that improve compression ratios with little or no sacrifice in picture quality.

[0005] Recently, affine tools have been introduced into versatile video coding, and theoretically, affine motion model parameters can be used to derive a motion vector for each sample in a coding block. However, since generating a sample-based affine motion compensated prediction is very complex, a sub-block-based affine motion compensation method is used. In this method, a coding block is divided into sub-blocks, and each sub-block is assigned a motion vector (MV) derived from the affine motion model parameters. However, this method loses prediction accuracy due to sub-block-based prediction. Therefore, it is necessary to achieve a good trade-off between coding complexity and prediction accuracy. Summary of the Invention [Means for solving the problem]

[0006] Embodiments of the present application provide apparatuses and methods for encoding and decoding according to the independent claims.Embodiments of the present application provide apparatuses and methods for prediction refinement using optical flow (PROF) for affine-coded blocks, such that a good trade-off can be achieved between the complexity and accuracy of sub-block-based affine prediction.

[0007] Embodiments are defined by the features of the independent claims and by further advantageous implementations of the embodiments by the features of the dependent claims.

[0008] Particular embodiments are outlined in the accompanying independent claims, while other embodiments are outlined in the dependent claims.

[0009] These and other objects are achieved by the subject matter of the independent claims. Further implementation forms are evident from the dependent claims, the description and the drawings.

[0010] According to a first aspect, the present invention provides a method for prediction refinement with optical flow (PROF) for affine coded blocks (i.e. blocks coded or decoded using affine tools). The method is applied to sub-blocks of samples within the affine coded block. The method is performed by an encoding or decoding device. The method comprises: performing a PROF process on a current sub-block (e.g., each sub-block) of the affine coded block to obtain refined predicted sample values ​​(i.e., final predicted sample values) for the current sub-block (e.g., each sub-block) of the affine coded block, where a plurality of constraints for applying PROF are not met or satisfied for the affine coded block; The step of performing the PROF process on the current sub-block of the affine-coded block includes the steps of: performing optical flow processing on the current sub-block to obtain a delta predicted value of the current sample of the current sub-block; and obtaining a refined predicted sample value of the current sample based on the delta predicted value of the current sample and the predicted sample value of the current sample of the current sub-block (performing optical flow processing on the current sub-block to obtain a delta predicted value of the current sub-block; and obtaining a refined predicted sample value of the current sub-block based on the delta predicted value of the current sub-block and the predicted sample value of the current sub-block). It can be understood that when the refined predicted sample values ​​of each sub-block of the affine-coded block are generated, the refined predicted sample values ​​of the affine-coded block are naturally generated.

[0011] Thus, an improved method is provided that enables a better trade-off between coding complexity and prediction accuracy to be achieved. To refine sub-block-based affine motion-compensated prediction using optical flow at pixel / sample level granularity, a prediction refinement using optical flow (PROF) process is conditionally performed. These conditions ensure that PROF-related calculations occur only when prediction accuracy can be improved, thereby reducing unnecessary increases in computational complexity. Therefore, the beneficial effect achieved by the techniques disclosed herein is to increase the overall compression performance of the coding method.

[0012] It should be noted that the terms "block," "coding block," or "image block" used in this disclosure may include transform units (TUs), prediction units (PUs), coding units (CUs), etc. In VVC, transform units and coding units are generally aligned, except for a few scenarios in which gradient or sub-block transforms (SBTs) of TUs are used. The terms "block," "image block," "coding block," and "picture block" may be understood. The terms "affine block," "affine picture block," "affine-coded block," and "affine motion block" may be used interchangeably herein. The terms "sample" and "pixel" may be used interchangeably in this disclosure. The terms "predicted sample value" and "predicted pixel value" may be used interchangeably in this disclosure. The terms "sample location" and "pixel location" may be used interchangeably in this disclosure.

[0013] In a possible implementation form of the method according to the first aspect itself, before performing the PROF process on a current sub-block of the affine coded block, the method further comprises a step of determining that a number of constraints for applying PROF are not satisfied for the affine coded block.

[0014] In a possible implementation form of the method according to the first aspect itself, the constraints for applying PROF include: first indication information indicating that PROF is disabled for a picture including the affine-coded block, or first indication information indicating that PROF is disabled for a slice associated with a picture including the affine-coded block; and second indication information indicating no partitioning of the affine-coded block, i.e., the variable fallbackModeTriggered is set to 1. It can be understood that when the variable fallbackModeTriggered is set to 1, partitioning of the affine-coded block is not required, i.e., each sub-block of the affine-coded block has the same motion vector. This indicates that the affine-coded block has only translational motion. When the variable fallbackModeTriggered is set to 0, partitioning of the affine-coded block is required, i.e., each sub-block of the affine-coded block has its own motion vector. This indicates that the affine-coded block has no translational motion.

[0015] In this disclosure, it is allowed that PROF is not applied in some cases or situations for affine-coded blocks, and the cases or situations are determined according to the constraints for applying PROF, thereby achieving a better trade-off between coding complexity and prediction accuracy.

[0016] In any preceding implementation of the first aspect or a possible implementation form of the method according to the first aspect itself, the step of performing optical flow processing on the current sub-block to obtain a delta predicted value of a current sample of the current sub-block includes: obtaining a second prediction matrix (in one example, the second prediction matrix is ​​generated based on a first prediction matrix corresponding to predicted sample values ​​of a current sub-block. Here, the predicted sample values ​​of the current sub-block may be obtained by performing sub-block-based affine motion compensation on the current sub-block), and the size of the second prediction matrix is ​​larger than the size of the first prediction matrix (for example, the first prediction matrix has a size of sbWidth*sbHeight, and the second prediction matrix has a size of (sbWidth+2)*(sbHeight+2), where the variables sbWidth and sbHeight represent the width and height of the current sub-block, respectively); i.e., obtaining the second prediction matrix generates the first prediction matrix based on motion information of the current sub-block, where elements of the first prediction matrix correspond to the predicted sample values ​​of the current sub-block; obtaining the second prediction matrix further generates the second prediction matrix based on the first prediction matrix, or generates the second prediction matrix based on the motion information of the current sub-block; generating a horizontal predicted gradient matrix and a vertical predicted gradient matrix based on a second prediction matrix, the size of the second prediction matrix being equal to or greater than the size of the horizontal predicted gradient matrix and the vertical predicted gradient matrix (e.g., the horizontal predicted gradient matrix or the vertical predicted gradient matrix has a size of sbWidth*sbHeight, and the second prediction matrix has a size of (sbWidth+2)*(sbHeight+2)); and calculating a delta predicted value (ΔI(i,j)) of the current sample of the current sub-block based on the horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix, the vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and a difference (MVD) between the motion vector of the current sample of the current sub-block and the motion vector of a center sample of the sub-block. It can be understood that the MVD has a horizontal component and a vertical component. The horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix corresponds to the horizontal component of the MVD, and the vertical predicted gradient value of the current sample in the vertical predicted gradient matrix corresponds to the vertical component of the MVD.

[0017] Note that an affine block may be a coding block or a decoding block of a picture of a video signal. The current sub-block of an affine-coded block is, for example, a 4x4 block. The luma position (xCb, yCb) denotes the position of the top-left sample of the affine-coded block relative to the top-left sample of the current picture. Samples of the current sub-block may be referenced using their absolute position with respect to (or relative to) the top-left sample of the picture, e.g., (x, y), or their relative position with respect to the top-left sample of the sub-block (in combination with other coordinates), e.g., (xSb+i, ySb+j), where (xSb, ySb) are the coordinates of the top-left corner of the sub-block with respect to the top-left corner of the picture.

[0018] The first prediction matrix may be a two-dimensional array including rows and columns, and elements of the array may be referenced using (i, j), where i is the horizontal / row index and j is the vertical / column index. The range of i and j may be, for example, i = 0..sbwidth-1 and j = 0..sbHeight-1, where sbWidth indicates the width of the sub-block and sbHeight indicates the height of the sub-block. In some examples, the size of the first prediction matrix is ​​the same as the size of the current block. For example, the size of the first prediction matrix may be 4x4, and the current block has a size of 4x4.

[0019] The second prediction matrix may be a two-dimensional array including rows and columns, and elements of the array may be referenced using (i, j), where i is the horizontal / row index and j is the vertical / column index. The range of i and j may be, for example, i = -1 ..sbwidth and j = -1 ..sbHeight, where sbWidth indicates the width of the sub-block and sbHeight indicates the height of the sub-block. In some examples, the size of the second prediction matrix may be larger than the size of the first prediction matrix. That is, the size of the second prediction matrix may be larger than the size of the current block. For example, the size of the second prediction matrix may be (sbWidth + 2) * (sbHeight + 2), while the current block has a size of sbWidth * sbHeight. For example, the size of the second prediction matrix may be 6x6, while the current block has a size of 4x4.

[0020] The horizontal and vertical predicted gradient matrices may be any two-dimensional arrays including rows and columns, and elements of the array may be referenced using (i, j), where x is the horizontal / row index and y is the vertical / column index. The range of i and j may be, for example, i = 0..sbWidth - 1 and j = 0..sbHeight - 1. sbWidth indicates the width of the sub-block, and sbHeight indicates the height of the sub-block. In some examples, the size of the horizontal and vertical predicted gradient matrices is the same as the size of the current block. For example, the size of the horizontal and vertical predicted gradient matrices may be 4x4, and the current block has a size of 4x4.

[0021] An element of the horizontal predicted gradient matrix corresponds to an element of the vertical predicted gradient matrix if the position (x, y) of the element in the horizontal predicted gradient matrix is ​​the same as the position (p, q) of the element in the vertical predicted gradient matrix, i.e., (x, y) = (p, q).

[0022] Therefore, the PROF process is able to refine the sub-block-based affine motion compensated prediction using optical flow at sample-level granularity without increasing memory access bandwidth (because the second prediction matrix is ​​based on the first prediction matrix or the (original) predicted sample values ​​of the current sub-block), thereby achieving higher granularity of motion compensation.

[0023] In any preceding implementation of the first aspect or a possible implementation form of the method according to the first aspect itself, the motion vector difference between the motion vector of the current sample unit (e.g., a 2x2 sample block) including the current sample and the motion vector of the central sample of the subblock is used as the difference between the motion vector of the current sample of the current subblock and the motion vector of the central sample of the subblock. Here, the motion vector of the central sample of the subblock can be understood as the MV of the subblock to which the current sample (i, j) belongs (i.e., the subblock MV). Using a sample unit such as a 2x2 sample block to calculate the motion vector difference makes it possible to balance processing overhead and prediction accuracy. In any preceding implementation of the first aspect or a possible implementation form of the method according to the first aspect itself, the elements of the second prediction matrix are represented by I1(p,q), where p has a value range of [-1,sbW] and q has a value range of [-1,sbH]; The elements of the horizontal prediction gradient matrix are represented by X(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; The elements of the vertical prediction gradient matrix are represented by Y(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; sbW represents the width of the current sub-block in the affine coded block, and sbH represents the height of the current sub-block in the affine coded block. In another representation, the elements of the second predictor matrix are represented by I1(p,q), where p has values ​​in the range [0,subW+1] and q has values ​​in the range [0,subH+1]. The elements of the horizontal prediction gradient matrix are represented by X(i,j) and correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [1,sbW] and j has a value range of [1,sbH]; The elements of the vertical prediction gradient matrix are represented by Y(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [1,sbW] and j has a value range of [1,sbH]; sbW represents the width of the current sub-block in the affine coded block, and sbH represents the height of the current sub-block in the affine coded block. It can be seen that since p has values ​​from [0,subW+1] and q has values ​​from [0,subH+1], the top left sample (or origin of the coordinates) is located at (1,1), while since p has values ​​from [-1,subW] and q has values ​​from [-1,subH], the top left sample (or origin of the coordinates) is located at (0,0).

[0024] In any preceding implementation form of the first aspect or a possible implementation form of the method according to the first aspect itself, before performing the PROF process on the current sub-block of the affine-coded block, the method further includes a step of performing sub-block-based affine motion compensation on the current sub-block of the affine-coded block to obtain predicted sample values ​​(original or to be refined) of the current sub-block.

[0025] According to a second aspect of the present invention, there is provided a method for prediction refinement using optical flow (PROF) for affine coded blocks, the method comprising: performing a PROF process on a current sub-block of the affine-coded block to obtain refined predicted sample values ​​(i.e., final predicted sample values) of the current sub-block of the affine-coded block, wherein a plurality of optical flow decision conditions are satisfied for the affine-coded block, where satisfaction of the plurality of optical flow decision conditions means that not all constraints for applying PROF are satisfied; The step of performing a PROF process on a current sub-block of an affine-coded block includes the steps of: performing optical flow processing on the current sub-block to obtain a delta predicted value of a current sample of the current sub-block; and obtaining a refined predicted sample value of the current sample based on the delta predicted value of the current sample and the predicted sample value (original or to-be-refined) of the current sample of the current sub-block.

[0026] Thus, an improved method is provided that allows for a good trade-off between coding complexity and prediction accuracy. To refine sub-block-based affine motion-compensated prediction using optical flow at pixel / sample-level granularity, a prediction refinement using optical flow (PROF) process is conditionally performed. These conditions ensure that PROF-related calculations occur only when prediction accuracy can be improved, thereby reducing unnecessary increases in computational complexity. Therefore, the beneficial effect achieved by the techniques disclosed herein is to increase the overall compression performance of the coding method.

[0027] In a possible implementation form of the method according to the second aspect itself, before performing the PROF process on the current sub-block of the affine coded block, the method further comprises a step of determining that a number of optical flow determination conditions are satisfied for the affine coded block.

[0028] In a possible implementation form of the method according to the second aspect itself, the plurality of optical flow determination conditions include: a first indication indicating that PROF is enabled for a picture including the affine-coded block, or a first indication indicating that PROF is enabled for a slice associated with the picture including the affine-coded block, and a second indication indicating partitioning of the affine-coded block, such as a variable fallbackModeTriggered being set equal to 0. It can be understood that when the variable fallbackModeTriggered is set equal to 0, partitioning of the affine-coded block is required, i.e., each sub-block of the affine-coded block has a respective motion vector, which indicates that the affine-coded block has non-translational motion.

[0029] It is allowed that PROF may be applied when all constraints for applying PROF are not satisfied according to the design of the constraints for applying PROF, thus allowing a trade-off between coding complexity and prediction accuracy.

[0030] In any preceding implementation of the second aspect or a possible implementation form of the method according to the second aspect itself, the step of performing optical flow processing on the current sub-block to obtain a delta predicted value of a current sample of the current sub-block includes: obtaining a second prediction matrix, elements of which are based on predicted sample values ​​of a current sub-block, and in some examples, obtaining the second prediction matrix includes generating a first prediction matrix based on motion information of the current sub-block, elements of which correspond to predicted sample values ​​of the current sub-block, and generating the second prediction matrix based on the first prediction matrix, or generating the second prediction matrix based on the motion information of the current sub-block; generating a horizontal prediction gradient matrix and a vertical prediction gradient matrix based on a second prediction matrix, wherein the size of the second prediction matrix is ​​equal to or greater than the size of the horizontal prediction gradient matrix and the vertical prediction gradient matrix; and calculating a delta predicted value (ΔI(i,j)) of the current sample of the current sub-block based on the horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix, the vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and a difference between the motion vector of the current sample of the current sub-block and the motion vector of the center sample of the sub-block.

[0031] In any preceding implementation form of the second aspect or a possible implementation form of the method according to the second aspect itself, the method further includes a step of performing sub-block-based affine motion compensation on a current sub-block of the affine-coded block to obtain an (original) predicted sample value of the current sub-block of the affine-coded block.

[0032] In any preceding implementation form of the second aspect or a possible implementation form of the method according to the second aspect itself, the motion vector difference between the motion vector of the current sample unit (e.g., a 2x2 sample block) to which the current sample belongs and the motion vector of the central sample of the sub-block is used as the difference between the motion vector of the current sample of the current sub-block and the motion vector of the central sample of the sub-block.

[0033] In any preceding implementation of the second aspect or a possible implementation of the method according to the second aspect itself, The elements of the second predictor matrix are represented by I1(p,q), where p has a value range of [-1,sbW] and q has a value range of [-1,sbH]; The elements of the horizontal prediction gradient matrix are represented by X(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; The elements of the vertical prediction gradient matrix are represented by Y(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; sbW represents the width of the current sub-block in the affine coded block, and sbH represents the height of the current sub-block in the affine coded block.

[0034] According to a third aspect, the present invention provides an apparatus for prediction refinement using optical flow (PROF) for affine coded blocks (i.e. blocks encoded or decoded using affine tools), the apparatus corresponding to an encoding apparatus or a decoding apparatus. a decision unit configured to determine that a plurality of constraints for applying PROF are not satisfied for the affine coded block; a prediction processing unit configured to perform a PROF process on a current sub-block (e.g., each sub-block) of the affine coded block to obtain refined predicted sample values ​​(i.e., final predicted sample values) for the current sub-block (e.g., each sub-block) of the affine coded block, where a plurality of constraints for applying the PROF are not met or satisfied for the affine coded block; The prediction processing unit is configured to perform optical flow processing on the current sub-block to obtain a delta predicted value of the current sample of the current sub-block, and to obtain a refined predicted sample value of the current sample based on the delta predicted value of the current sample and the predicted sample value of the current sample of the current sub-block (for performing optical flow processing on the current sub-block to obtain a delta predicted value of the current sub-block, and to obtain a refined predicted sample value of the current sub-block based on the delta predicted value of the current sub-block and the predicted sample value of the current sub-block). It can be understood that when refined predicted sample values ​​of each sub-block of the affine-coded block are generated, refined predicted sample values ​​of the affine-coded block are naturally generated.

[0035] In a possible implementation form of the device according to the third aspect itself, the constraints for applying PROF include: first indication that PROF is disabled for a picture including the affine-coded block, or first indication that PROF is disabled for a slice associated with the picture including the affine-coded block; and second indication that no partitioning of the affine-coded block is required, i.e., the variable fallbackModeTriggered is set to 1. When the variable fallbackModeTriggered is set to 1, it can be understood that no partitioning of the affine-coded block is required, i.e., each sub-block of the affine-coded block has the same motion vector. This indicates that the affine-coded block has only translational motion. When the variable fallbackModeTriggered is set to 0, partitioning of the affine-coded block is required, i.e., each sub-block of the affine-coded block has its own motion vector. This indicates that the affine-coded block has no translational motion.

[0036] In any preceding implementation of the third aspect or a possible implementation form of the device according to the third aspect itself, the prediction processing unit is configured to obtain a second prediction matrix (in one example, the second prediction matrix is ​​generated based on a first prediction matrix corresponding to predicted sample values ​​of a current sub-block, where the predicted sample values ​​of the current sub-block may be obtained by performing sub-block-based affine motion compensation on the current sub-block), and the size of the second prediction matrix is ​​larger than the size of the first prediction matrix (e.g., the first prediction matrix has a size of sbWidth*sbHeight). the second prediction matrix has a size of (sbWidth+2)*(sbHeight+2), where variables sbWidth and sbHeight represent the width and height of the current sub-block, respectively), i.e., obtaining the second prediction matrix comprises generating a first prediction matrix based on motion information of the current sub-block, where elements of the first prediction matrix correspond to predicted sample values ​​of the current sub-block, and obtaining the second prediction matrix further comprises generating the second prediction matrix based on the first prediction matrix, or generating the second prediction matrix based on motion information of the current sub-block; generating a horizontal predicted gradient matrix and a vertical predicted gradient matrix based on a second prediction matrix, the size of the second prediction matrix being equal to or greater than the size of the horizontal predicted gradient matrix and the vertical predicted gradient matrix (e.g., the horizontal predicted gradient matrix or the vertical predicted gradient matrix has a size of sbWidth*sbHeight, and the second prediction matrix has a size of (sbWidth+2)*(sbHeight+2)); and calculating a delta predicted value (ΔI(i,j)) of the current sample of the current sub-block based on the horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix, the vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and a difference between the motion vector of the current sample of the current sub-block and the motion vector of the center sample of the sub-block.

[0037] In any of the preceding implementations of the third aspect or a possible implementation form of the device according to the third aspect itself, the motion vector difference between the motion vector of the current sample unit (e.g., a 2x2 sample block) including the current sample and the motion vector of the center sample of the subblock is used as the difference between the motion vector of the current sample of the current subblock and the motion vector of the center sample of the subblock. Here, the motion vector of the center sample of the subblock can be understood as the MV of the subblock to which the current sample (i, j) belongs (i.e., the subblock MV). Using a sample unit such as a 2x2 sample block to calculate the motion vector difference makes it possible to balance processing overhead and prediction accuracy. In any of the preceding implementations of the third aspect or a possible implementation form of the device according to the third aspect itself, the elements of the second prediction matrix are represented by I1(p,q), where p is in the range of [-1,sbW] and q is in the range of [-1,sbH]; The elements of the horizontal prediction gradient matrix are represented by X(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; The elements of the vertical prediction gradient matrix are represented by Y(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; sbW represents the width of the current sub-block in the affine coded block, and sbH represents the height of the current sub-block in the affine coded block.

[0038] In any preceding implementation form of the third aspect or a possible implementation form of an apparatus according to the third aspect itself, the prediction processing unit 1503 is configured to perform sub-block-based affine motion compensation on a current sub-block of an affine-coded block to obtain a predicted sample value (original or to be refined) of the current sub-block.

[0039] According to a fourth aspect of the present invention, there is provided an apparatus for prediction refinement using optical flow (PROF) for affine coded blocks, the apparatus comprising: a decision unit configured to determine that a plurality of optical flow decision conditions are satisfied for an affine-coded block, where the satisfaction of the plurality of optical flow decision conditions means that all constraints for applying PROF are not satisfied; and and a prediction processing unit configured to perform a PROF process on a current sub-block of the affine-coded block to obtain a refined predicted sample value (i.e., a final predicted sample value) of the current sub-block of the affine-coded block, wherein a plurality of optical flow decision conditions are satisfied for the affine-coded block, and the prediction processing unit is configured to perform optical flow processing on the current sub-block to obtain a delta predicted value of the current sample of the current sub-block, and to obtain a refined predicted sample value of the current sample based on the delta predicted value of the current sample and the predicted sample value (original or to-be-refined) of the current sample of the current sub-block.

[0040] In a possible implementation form of the device according to the fourth aspect itself, the plurality of optical flow determination conditions include: a first indication indicating that PROF is enabled for a picture including the affine-coded block, or a first indication indicating that PROF is enabled for a slice associated with the picture including the affine-coded block, and a second indication indicating partitioning of the affine-coded block, such as a variable fallbackModeTriggered being set equal to 0. It can be understood that when the variable fallbackModeTriggered is set equal to 0, partitioning of the affine-coded block is required, i.e., each sub-block of the affine-coded block has a respective motion vector, which indicates that the affine-coded block has non-translational motion.

[0041] In any preceding implementation of the fourth aspect or a possible implementation of the apparatus according to the fourth aspect itself, the prediction processing unit obtaining a second prediction matrix, elements of which are based on predicted sample values ​​of a current sub-block, and in some examples, obtaining the second prediction matrix includes generating a first prediction matrix based on motion information of the current sub-block, elements of which correspond to predicted sample values ​​of the current sub-block, and generating the second prediction matrix based on the first prediction matrix, or generating the second prediction matrix based on the motion information of the current sub-block; generating a horizontal prediction gradient matrix and a vertical prediction gradient matrix based on a second prediction matrix, wherein the size of the second prediction matrix is ​​equal to or greater than the size of the horizontal prediction gradient matrix and the vertical prediction gradient matrix; It is configured to calculate a delta predicted value (ΔI(i,j)) of the current sample of the current sub-block based on the horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix, the vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and the difference between the motion vector of the current sample of the current sub-block and the motion vector of the center sample of the sub-block.

[0042] In any preceding implementation form of the fourth aspect or a possible implementation form of an apparatus according to the fourth aspect itself, the prediction processing unit is configured to perform sub-block-based affine motion compensation on a current sub-block of the affine-coded block to obtain an (original) predicted sample value of the current sub-block of the affine-coded block.

[0043] In any preceding implementation form of the fourth aspect or a possible implementation form of the device according to the fourth aspect itself, the motion vector difference between the motion vector of the current sample unit (e.g., a 2x2 sample block) to which the current sample belongs and the motion vector of the central sample of the sub-block is used as the difference between the motion vector of the current sample of the current sub-block and the motion vector of the central sample of the sub-block.

[0044] In any preceding implementation of the fourth aspect or a possible implementation of the apparatus according to the fourth aspect itself, the elements of the second prediction matrix are represented by I1(p,q), where p has a value range of [-1,sbW] and q has a value range of [-1,sbH]; The elements of the horizontal prediction gradient matrix are represented by X(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; The elements of the vertical prediction gradient matrix are represented by Y(i,j), which correspond to sample (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; sbW represents the width of the current sub-block in the affine coded block, and sbH represents the height of the current sub-block in the affine coded block.

[0045] The method according to the first aspect of the invention may be performed by an apparatus according to the third aspect of the invention. Further features and implementation forms of the apparatus according to the third aspect of the invention correspond to the features and implementation forms of the method according to the first aspect of the invention.

[0046] The method according to the second aspect of the invention may be performed by an apparatus according to the fourth aspect of the invention. Further features and implementation forms of the apparatus according to the fourth aspect of the invention correspond to the features and implementation forms of the method according to the second aspect of the invention.

[0047] According to a fifth aspect, the invention relates to an encoder (20) comprising processing circuitry for performing the method according to the first or second aspect itself or an implementation thereof.

[0048] According to a sixth aspect, the invention relates to a decoder (30) comprising processing circuitry for performing the method according to the first or second aspect itself or an implementation thereof.

[0049] According to a seventh aspect, the present invention relates to a decoder, comprising: one or more processors; and a non-transitory computer-readable storage medium coupled to the processor and storing programming for execution by the processor, the programming, when executed by the processor, configuring the decoder to perform the first aspect itself or a method according to an implementation thereof.

[0050] According to an eighth aspect, the present invention relates to an encoder, comprising: one or more processors; and a non-transitory computer-readable storage medium coupled to the processor and storing programming for execution by the processor, the programming, when executed by the processor, configuring the encoder to perform the first aspect itself or a method according to an implementation thereof.

[0051] According to a ninth aspect, the present invention relates to an apparatus for encoding a video stream, comprising a processor and a memory, the memory storing instructions for causing the processor to carry out the method according to the second aspect.

[0052] According to a tenth aspect, the present invention relates to an apparatus for decoding a video stream, comprising a processor and a memory, the memory storing instructions for causing the processor to perform the method according to the first aspect.

[0053] According to an eleventh aspect, the present invention relates to a computer program comprising a program code for performing, when the computer program is run on a computer, the method according to the first aspect or the second aspect or any possible embodiment of the first aspect or the second aspect.

[0054] According to a twelfth aspect, there is proposed a computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors configured to code video data, the instructions causing the one or more processors to perform a method according to the first aspect or the second aspect or any possible embodiment of the first aspect or the second aspect.

[0055] According to a further aspect, there is provided a video picture encoding method comprising: determining indication information, the indication information being used to indicate whether a picture block to be encoded is to be encoded according to a target inter prediction method, the target inter prediction method comprising an inter prediction method according to the first aspect or the second aspect or any possible embodiment of the first aspect or the second aspect; and encoding the indication information into a bitstream.

[0056] According to a further aspect, there is provided a video picture decoding method, comprising the steps of: parsing a bitstream to obtain instruction information, the instruction information being used to indicate whether a picture block to be decoded is to be processed according to a target inter prediction method, the target inter prediction method comprising an inter prediction method according to the first aspect or the second aspect or any possible embodiment of the first aspect or the second aspect; and processing the picture block to be decoded according to the target inter prediction method when the instruction information indicates that processing is to be performed according to the target inter prediction method.

[0057] The details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will become apparent from the description, drawings, and claims.

[0058] The following embodiments of the present invention will be described in more detail with reference to the accompanying drawings and figures. [Brief explanation of the drawings]

[0059] [Figure 1A] 1 is a block diagram illustrating an example of a video coding system configured to implement embodiments of the present invention. [Figure 1B] 2 is a block diagram illustrating another example of a video coding system configured to implement embodiments of the present invention. [Figure 2] 1 is a block diagram illustrating an example of a video encoder configured to implement embodiments of the present invention; [Figure 3] 2 is a block diagram illustrating an exemplary structure of a video decoder configured to implement embodiments of the present invention. [Figure 4] FIG. 1 is a block diagram illustrating an example of an encoding device or a decoding device. [Figure 5] FIG. 10 is a block diagram showing another example of an encoding device or a decoding device. [Figure 6]FIG. 10 illustrates potential spatial and temporal motion information for a current block. [Figure 7] FIG. 10 shows the current affine-coded block and the neighboring affine-coded block in which A1 is located. [Figure 8A] FIG. 10 is a diagram illustrating an example for explaining a constructed control point motion vector prediction method. [Figure 8B] FIG. 10 is a diagram illustrating an example for explaining a constructed control point motion vector prediction method. [Figure 9A] 1 is a flowchart illustrating a process of a decoding method according to an embodiment of the present application. [Figure 9B] FIG. 10 is a diagram illustrating a constructed control point motion vector prediction method. [Figure 9C] 10A-10C show samples or pixels of the current affine-coded block and motion vectors for the top-left and top-right control points. [Figure 9D] FIG. 10 is a diagram showing a 6×6 prediction signal window for calculating and generating horizontal and vertical prediction gradient matrices and 4×4 sub-blocks. [Figure 9E] FIG. 10 is a diagram illustrating a horizontal prediction gradient matrix, a vertical prediction gradient matrix, and an 18×18 prediction signal window for calculating and generating a 16×16 block. [Figure 10] This figure shows the difference Δv(i,j) (red arrow) between the sample MV calculated for sample position (i,j) denoted by v(i,j) and the sub-block MV (VSB) of the sub-block to which sample (i,j) belongs. [Figure 11A] FIG. 1 illustrates a method for prediction refinement using optical flow (PROF) for affine-coded blocks, according to an embodiment of the present disclosure. [Figure 11B] FIG. 10 illustrates another method for prediction refinement using optical flow (PROF) for affine-coded blocks, according to another embodiment of the present disclosure. [Figure 12] FIG. 1 illustrates a PROF process according to an embodiment of the present disclosure. [Figure 13] FIG. 2 illustrates the surrounding and inner regions of an (M+2)*(N+2) predicted block according to an embodiment of the present disclosure. [Figure 14] FIG. 10 is a diagram illustrating the surrounding and inner regions of an (M+2)*(N+2) predicted block according to another embodiment of the present disclosure. [Figure 15] 1 is a block diagram illustrating an example structure of an apparatus for prediction refinement using optical flow (PROF) for affine-coded blocks of a video signal, according to some embodiments of the present disclosure. [Figure 16] 1 is a block diagram illustrating an exemplary structure of a content supply system for implementing a content distribution service. [Figure 17] FIG. 2 is a block diagram illustrating the structure of an example terminal device. DETAILED DESCRIPTION OF THE INVENTION

[0060] In the following, the same reference signs refer to identical or at least functionally equivalent features, unless expressly specified otherwise.

[0061] In the following description, reference is made to the accompanying drawings, which form a part of this disclosure and which show, by way of illustration, specific aspects of embodiments of the invention or in which embodiments of the invention may be used. It is understood that embodiments of the invention may be used in other ways and may include structural or logical changes not shown in the drawings. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims.

[0062] For example, it is understood that disclosure related to a described method may also apply to a corresponding device or system configured to perform the method, and vice versa. For example, when one or more particular method steps are described, the corresponding device may include one or more units, e.g., functional units, to perform the described one or more method steps (e.g., one unit that performs one or more steps, or multiple units that each perform one or more of the steps), even if such one or more units are not explicitly described or shown in the drawings. On the other hand, for example, when a particular apparatus is described based on one or more units, e.g., functional units, the corresponding method may include one step for performing the function of the one or more units (e.g., one step that performs the function of one or more units, or multiple steps that each perform the function of one or more of the units), even if such one or more steps are not explicitly described or shown in the drawings. Furthermore, it is understood that features of various exemplary embodiments and / or aspects described herein may be combined with each other, unless specifically stated otherwise.

[0063] Video coding typically refers to the processing of a sequence of pictures that form a video or a video sequence. Instead of the term "picture," the terms "frame" or "image" may be used synonymously in the field of video coding. Video coding (or coding in general) includes two parts: video encoding and video decoding. Video encoding is performed at the source side and typically involves processing (e.g., by compression) the original video picture to reduce the amount of data needed to represent the video picture (for more efficient storage and / or transmission). Video decoding is performed at the destination side and typically involves the reverse processing compared to the encoder to reconstruct the video picture. Embodiments referring to "coding" a video picture (or pictures in general) should be understood to relate to "encoding" or "decoding" the video picture or respective video sequence. The combination of the encoding and decoding parts is also called a CODEC (Coding and Decoding).

[0064] 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 there is no transmission loss or other data loss during storage or transmission). In the case of lossy video coding, further compression, for example by quantization, is performed to reduce the amount of data representing the video picture, which cannot be fully reconstructed at the decoder, i.e., the quality of the reconstructed video picture is lower or worse than the quality of the original video picture.

[0065] Some video coding standards belong to the group of "lossy hybrid video codecs" (i.e., they combine spatial and temporal prediction in the sample domain with 2D transform coding for applying quantization in the transform domain). Each picture of a video sequence is usually partitioned into a set of non-overlapping blocks, and coding is usually performed at the block level. In other words, in an encoder, video is usually processed, i.e., encoded, at the block (video block) level, for example, by using spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to generate a predictive block, subtracting the predictive block from a current block (the block currently being / to be processed) to obtain a residual block, transforming the residual block to reduce the amount of data to be transmitted (compression), and quantizing the residual block in the transform domain, while in a decoder, a reverse process compared to the encoder is applied to the coded or compressed block to reconstruct the current block for representation. Furthermore, the encoder replicates the decoder's processing loop so that both the encoder and the decoder generate the same prediction (e.g., intra-prediction and inter-prediction) and / or reconstruction for processing, i.e., coding, of a subsequent block.

[0066] In the following, embodiments of a video coding system 10, a video encoder 20, and a video decoder 30 are described based on FIGS.

[0067] 1A is a schematic block diagram illustrating an exemplary coding system 10, e.g., video coding system 10 (or coding system 10 for short), that may utilize the techniques of the present application. A video encoder 20 (or encoder 20 for short) and a video decoder 30 (or decoder 30 for short) of video coding system 10 represent examples of devices that may be configured to perform techniques according to various examples described in the present application.

[0068] As shown in FIG. 1A, coding system 10 includes, for example, a source device 12 configured to provide encoded picture data 21 to a destination device 14 for decoding encoded picture data 13.

[0069] The source device 12 comprises an encoder 20, and may additionally, i.e., optionally, comprise a picture source 16, a preprocessor (or preprocessing unit) 18, for example a picture preprocessor 18, and a communication interface or communication unit 22.

[0070] Picture source 16 may comprise or be any kind of picture capture device, e.g., a camera for capturing real-world pictures, and / or any kind of picture generation device, e.g., a computer graphics processor for generating computer-animated pictures, or any kind of other device for obtaining and / or providing real-world pictures, computer-generated pictures (e.g., screen content, virtual reality (VR) pictures), and / or any combination thereof (e.g., augmented reality (AR) pictures). Picture source may also be any kind of memory or storage that stores any of the foregoing pictures.

[0071] To distinguish from the preprocessor 18 and the processing performed by the preprocessing unit 18, the picture or picture data 17 may also be referred to as a raw picture or raw picture data 17.

[0072] The pre-processor 18 is configured to receive (raw) picture data 17 and perform pre-processing on the picture data 17 to obtain a pre-processed picture 19 or pre-processed picture data 19. The pre-processing performed by the pre-processor 18 may comprise, for example, cropping, color format conversion (e.g., from RGB to YCbCr), color correction, or noise removal. It may be understood that the pre-processing unit 18 may be an optional component.

[0073] Video encoder 20 is configured to receive pre-processed picture data 19 and provide encoded picture data 21 (further details are described below, eg, with reference to FIG. 2).

[0074] The communication interface 22 of the source device 12 may be configured to receive the encoded picture data 21 and transmit the encoded picture data 21 (or any further processed version thereof) via the communication channel 13 to another device, such as the destination device 14 or any other device, for storage or direct reconstruction.

[0075] The destination device 14 includes a decoder 30 (e.g., a video decoder 30), and may additionally, i.e., optionally, include a communication interface or communication unit 28, a post-processor 32 (or post-processing unit 32), and a display device 34.

[0076] The communications interface 28 of the destination device 14 is configured to receive the encoded picture data 21 (or any further processed version thereof), for example directly from the source device 12 or any other source, for example a storage device, for example an encoded picture data storage device, and to provide the encoded picture data 21 to the decoder 30.

[0077] The communication interface 22 and the communication interface 28 may be configured to transmit or receive the encoded picture data 21 or the encoded data 13 via a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, or via any type of network, such as a wired or wireless network or any combination thereof, or any type of private and public network, or any combination thereof.

[0078] The communications interface 22 may be configured, for example, to package the encoded picture data 21 into a suitable format, e.g., packets, and / or to process the encoded picture data using any type of transmission coding or processing for transmission over a communications link or network.

[0079] The communications interface 28, which is the counterpart of the communications interface 22, may be configured, for example, to receive transmitted data and process the transmitted data using any type of corresponding transmission decoding or processing and / or depackaging to obtain the encoded picture data 21.

[0080] Both communication interface 22 and communication interface 28 may be configured as unidirectional communication interfaces, as indicated by the arrow for communication channel 13 in FIG. 1A pointing from source device 12 to destination device 14, or as bidirectional communication interfaces, and may be configured, for example, to send and receive messages, e.g., to set up and acknowledge connections, and to exchange any other information related to the communication link and / or data transmission, e.g., the transmission of encoded picture data.

[0081] The decoder 30 is configured to receive the encoded picture data 21 and provide decoded picture data 31 or decoded pictures 31 (further details are described below, for example, based on Figure 3 or Figure 5).

[0082] Post-processor 32 of destination device 14 is configured to post-process decoded picture data 31 (also referred to as reconstructed picture data), e.g., decoded picture 31, to obtain post-processed picture data 33, e.g., post-processed picture 33. The post-processing performed by post-processing unit 32 may comprise, for example, color format conversion (e.g., from YCbCr to RGB), color correction, cropping, or resampling, or any other processing, e.g., to prepare decoded picture data 31, e.g., for display by display device 34.

[0083] Display device 34 of destination device 14 is configured to receive post-processed picture data 33, e.g., for displaying the picture to a user or viewer. Display device 34 may be or comprise any type of display for presenting the reconstructed picture, e.g., an integrated or external display or monitor. The display may comprise, for example, 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 type of display.

[0084] 1A shows source device 12 and destination device 14 as separate devices, device embodiments may also include both or both of these functions, i.e., source device 12 or corresponding functions and destination device 14 or corresponding functions. In such embodiments, source device 12 or corresponding functions and destination device 14 or corresponding functions may be implemented using the same hardware and / or software, or by separate hardware and / or software, or any combination thereof.

[0085] As will be apparent to those skilled in the art based on the description, the functionality of the various units or the presence and (exact) division of functions within source device 12 and / or destination device 14 as shown in FIG. 1A may vary depending on the actual device and application.

[0086] Encoder 20 (e.g., video encoder 20) or decoder 30 (e.g., video decoder 30), or both encoder 20 and decoder 30, may be implemented via processing circuitry as shown in FIG. 1B , such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic circuits, hardware, dedicated to video coding, or any combination thereof. Encoder 20 may be implemented via processing circuitry 46 for embodying various modules as discussed with respect to encoder 20 of FIG. 2 and / or any other encoder system or subsystem described herein. Decoder 30 may be implemented via processing circuitry 46 for embodying various modules as discussed with respect to decoder 30 of FIG. 3 and / or any other decoder system or subsystem described herein. The processing circuitry may be configured to perform various operations as discussed below. 5, where the techniques are implemented partially in software, a device may store instructions for the software on 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. Either video encoder 20 or video decoder 30 may be integrated as part of a combined encoder / decoder (codec) in a single device, such as that shown in FIG. 1B.

[0087] Source device 12 and destination device 14 may comprise any of a wide range of devices, including any type of handheld or stationary device, e.g., a notebook or laptop computer, a mobile phone, a smartphone, a tablet or tablet computer, a camera, a desktop computer, a set-top box, a television, a display device, a digital media player, a video game console, a video streaming device (such as a content service server or a content distribution server), a broadcast receiver device, a broadcast transmitter device, etc., and may use no operating system or any type of operating system. In some cases, source device 12 and destination device 14 may be capable of wireless communication. Thus, source device 12 and destination device 14 may be wireless communication devices.

[0088] 1A is merely an example, and the techniques of the present application may be applied to video coding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between the encoding device and the decoding device. In other examples, data is retrieved from local memory, streamed over a network, etc. A video encoding device may encode data and store it in memory, and / or a video decoding device may retrieve data from memory and decode it. In some examples, encoding and decoding are performed by devices that do not communicate with each other but simply encode data to memory and / or retrieve data from memory and decode it.

[0089] For ease of explanation, embodiments of the present invention are described herein with reference to, for example, High-Efficiency Video Coding (HEVC) or with reference to reference software for Versatile Video coding (VVC), the next-generation video coding standard being developed by the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Motion Picture Experts Group (MPEG) Joint Collaboration Team on Video Coding (JCT-VC). Those skilled in the art will understand that embodiments of the present invention are not limited to HEVC or VVC.

[0090] Encoder and encoding method FIG. 2 shows a schematic block diagram of an exemplary video encoder 20 configured to implement the techniques of the present application. In the example of FIG. 2, the video encoder 20 includes an input 201 (or input interface 201), 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 loop filter unit 220, a decoded picture buffer (DPB) 230, a mode selection unit 260, an entropy coding unit 270, and an output 272 (or output interface 272). The mode selection unit 260 may include an inter prediction unit 244, an intra prediction unit 254, and a partitioning unit 262. The inter prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). The video encoder 20 as shown in FIG. 2 may also be referred to as a hybrid video encoder or a video encoder according to a hybrid video codec.

[0091] The residual calculation unit 204, the transform processing unit 206, the quantization unit 208, and the mode selection unit 260 may be referred to as forming a forward signal path of the encoder 20, while 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 inter prediction unit 244, and the intra prediction unit 254 may be referred to as forming a backward signal path of the video encoder 20, which corresponds to the signal path of a decoder (see video decoder 30 in FIG. 3 ). The inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the loop filter 220, the decoded picture buffer (DPB) 230, the inter prediction unit 244, and the intra prediction unit 254 may also be referred to as forming a “built-in decoder” of the video encoder 20.

[0092] Pictures and Picture Segmentation (Pictures and Blocks) Encoder 20 may be configured to receive, for example, via input 201, picture 17 (or picture data 17), e.g., a picture of a sequence of pictures forming a video or a video sequence. The received picture or picture data may also be preprocessed picture 19 (or preprocessed picture data 19). For brevity, the following description refers to picture 17. Picture 17 may also be referred to as the current picture or the picture to be coded (specifically, in video coding, to distinguish the current picture from other pictures, e.g., previously coded and / or decoded pictures of the same video sequence, i.e., the video sequence that also includes the current picture).

[0093] A (digital) picture is, or can be considered as, a two-dimensional array or matrix of samples with intensity values. The samples in the array may also be called pixels (short for picture element) or pels. The number of samples in the horizontal and vertical directions (or axes) of the array or picture determines the size and / or resolution of the picture. For color representation, three color components are usually utilized, i.e., a picture may be represented by or contain three sample arrays. In an RBG format or color space, a picture contains corresponding red, green, and blue sample arrays. However, in video coding, each pixel is usually represented in a luminance and chrominance format or color space, such as YCbCr, which contains a luminance component denoted by Y (although L is sometimes used instead) and two chrominance components denoted by Cb and Cr. The luminance (or luma for short) component Y represents brightness or gray-level intensity (e.g., as in a grayscale picture), while the two chrominance (or chroma for short) components Cb and Cr represent chromaticity or color information components. Thus, a picture in YCbCr format includes a luminance sample array of luminance sample values ​​(Y) and two chrominance sample arrays of chrominance values ​​(Cb and Cr). A picture in RGB format may be converted or translated into YCbCr format, or vice versa; this process is also known as color conversion or color transformation. If a picture is monochrome, the picture may comprise only a luminance sample array. Thus, a picture may be, for example, an array of luma samples in monochrome format, or an array of luma samples and two corresponding arrays of chroma samples in 4:2:0, 4:2:2, and 4:4:4 color formats.

[0094] Embodiments of video encoder 20 may comprise a picture partition unit (not shown in FIG. 2 ) configured to partition picture 17 into multiple (usually non-overlapping) picture blocks 203. These blocks may also be called root blocks, macroblocks (H.264 / AVC), or coding tree blocks (CTBs) or coding tree units (CTUs) (H.265 / HEVC and VVC). The picture partition unit may be configured to use the same block size for all pictures of a video sequence and a corresponding grid that defines the block size, or to vary the block size between pictures or subsets or groups of pictures, and partition each picture into the corresponding blocks.

[0095] In further embodiments, the video encoder may be configured to directly receive blocks 203 of picture 17, such as one, some, or all of the blocks that form picture 17. Picture blocks 203 may also be referred to as current picture blocks or picture blocks to be coded.

[0096] Like picture 17, picture block 203 is also, or may be considered to be, a two-dimensional array or matrix of samples with intensity values ​​(sample values), but with smaller dimensions than picture 17. In other words, block 203 may comprise, for example, one sample array (e.g., a luma array for a monochrome picture 17, or a luma array or a chroma array for a color picture) or three sample arrays (e.g., a luma array and two chroma arrays for a color picture 17), or any other number and / or type of arrays depending on the applied color format. The number of samples in the horizontal and vertical directions (or axes) of block 203 determines the size of block 203. Thus, a block may be, for example, an M×N (M columns by N rows) array of samples, or an M×N array of transform coefficients.

[0097] An embodiment of video encoder 20 as shown in FIG. 2 may be configured to encode picture 17 block by block, eg, encoding and prediction is performed for each block 203.

[0098] An embodiment of the video encoder 20 as shown in FIG. 2 may further be configured to partition and / or encode a picture by using slices (also called video slices), where a picture may be partitioned into or encoded using one or more slices (typically non-overlapping), each of which may comprise one or more blocks (e.g., CTUs).

[0099] An embodiment of video encoder 20 as shown in FIG. 2 may further be configured to partition and / or encode a picture by using tile groups (also referred to as video tile groups) and / or tiles (also referred to as video tiles), where a picture may be partitioned into or encoded using one or more (typically non-overlapping) tile groups, each of which may comprise, for example, one or more blocks (e.g., CTUs) or one or more tiles, and each tile may be, for example, rectangular in shape and may comprise one or more blocks (e.g., CTUs), e.g., full blocks or partial blocks.

[0100] Residual calculation The residual calculation unit 204 may be configured to calculate the residual block 205 (also referred to as the residual 205) based on the picture block 203 and the predictive block 265, for example, by subtracting sample values ​​of the predictive block 265 (further details of the predictive block 265 will be given later) sample by sample (pixel by pixel) from the sample values ​​of the picture block 203 to obtain the residual block 205 in the sample domain.

[0101] conversion The transform processing unit 206 may be configured to apply a transform, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), to the sample values ​​of the residual block 205 to obtain transform coefficients 207 in the transform domain. The transform coefficients 207 may also be referred to as transform residual coefficients and may represent the residual block 205 in the transform domain.

[0102] The transform processing unit 206 may be configured to apply an integer approximation of a DCT / DST, such as the transform specified for H.265 / AVC. Compared to an orthogonal DCT transform, such an integer approximation is typically scaled by a factor. To preserve 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 chosen based on several constraints, such as the scaling factor being a power of two due to shift operations, the bit depth of the transform coefficients, a trade-off between accuracy and implementation cost, etc. For example, specific scaling factors may be specified for the inverse transform, e.g., by the inverse transform processing unit 212 (and the corresponding inverse transform, e.g., by the inverse transform processing unit 312 in the video decoder 30), and corresponding scaling factors for the forward transform, e.g., by the transform processing unit 206 in the encoder 20, may be specified accordingly.

[0103] An embodiment of video encoder 20 (respectively transform processing unit 206) may be configured to output transform parameters, e.g., one or more types of transform, e.g., directly or in an encoded or compressed state via entropy coding unit 270, so that, for example, video decoder 30 may receive and use the transform parameters for decoding.

[0104] quantization The quantization unit 208 may be configured to quantize the transform coefficients 207, for example by applying scalar quantization or vector quantization, to obtain quantized coefficients 209. The quantized coefficients 209 may also be referred to as quantized transform coefficients 209 or quantized residual coefficients 209.

[0105] The quantization process may reduce the bit depth associated with some or all of the transform coefficients 207. For example, an n-bit transform coefficient may be rounded to an m-bit transform coefficient during quantization, where n is greater than m. The degree of quantization may be modified by adjusting a quantization parameter (QP). For example, in scalar quantization, different scaling may be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization. The applicable quantization step size may be indicated by the quantization parameter (QP). The quantization parameter may, for example, be an index into a predetermined set of applicable quantization step sizes. For example, a small quantization parameter may correspond to finer quantization (small quantization step size) and a large quantization parameter may correspond to coarser quantization (large quantization step size), or vice versa. Quantization may involve division by a quantization step size, and corresponding and / or dequantization, e.g., by the inverse quantization unit 210, may involve multiplication by the quantization step size. Some standards, e.g., HEVC, embodiments may be configured to use a quantization parameter to determine the quantization step size. Generally, the quantization step size may be calculated based on the quantization parameter using a fixed-point approximation of a formula involving division. To restore the norm of the residual block, an additional scaling factor may be introduced for quantization and dequantization, which may be modified by the scaling used in the fixed-point approximation of the formula for the quantization step size and quantization parameter. In one exemplary implementation, the scaling of the inverse transform and dequantization may be combined. Alternatively, customized quantization tables may be used and signaled from the encoder to the decoder, e.g., in the bitstream. Quantization is a lossy operation, and the loss increases with increasing quantization step size.

[0106] An embodiment of video encoder 20 (respectively quantization unit 208) may be configured to output a quantization parameter (QP), e.g., directly or in an encoded state via entropy coding unit 270, so that video decoder 30, for example, may receive and apply the quantization parameter for decoding.

[0107] inverse quantization Inverse quantization unit 210 is configured to apply the inverse quantization of quantization unit 208 to the quantized coefficients to obtain dequantized coefficients 211, e.g., by applying the inverse of the quantization scheme applied by quantization unit 208, e.g., based on or using the same quantization step size as quantization unit 208. The dequantized coefficients 211 may also be referred to as dequantized residual coefficients 211 and may correspond to transform coefficients 207, although they are not typically identical to the transform coefficients due to quantization losses.

[0108] Inverse transformation The inverse transform processing unit 212 is configured to apply an inverse transform of the transform applied by the transform processing unit 206, e.g., an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST) or other inverse transform, to obtain a reconstructed residual block 213 (or corresponding dequantized coefficients 213) in the sample domain. The reconstructed residual block 213 may also be referred to as a transform block 213.

[0109] Rebuild The reconstruction unit 214 (e.g., an adder or summer 214) is configured to add the transform block 213 (i.e., the reconstructed residual block 213) to the prediction block 265 to obtain the reconstructed block 215 in the sample domain, for example, by adding the sample values ​​of the reconstructed residual block 213 and the sample values ​​of the prediction block 265 sample by sample.

[0110] filtering The loop filter unit 220 (or “loop filter” 220 for short) is configured to filter the reconstructed block 215 to obtain a filtered block 221, or in general, to filter reconstructed samples to obtain filtered samples. The loop filter unit is configured, for example, to smooth pixel transitions or otherwise improve video quality. The loop filter unit 220 may comprise one or more loop filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, or one or more other filters, for example, a bilateral filter, an adaptive loop filter (ALF), a sharpening filter, a smoothing filter, or a collaborative filter, or any combination thereof. Although the loop filter unit 220 is shown in FIG. 2 as being a loop filter, in other configurations, the 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.

[0111] An embodiment of video encoder 20 (respectively loop filter unit 220) may be configured to output loop filter parameters (e.g., sample adaptive offset information), e.g., directly or in an encoded state via entropy coding unit 270, so that decoder 30, for example, may receive and apply the same loop filter parameters or respective loop filters for decoding.

[0112] Decoded Picture Buffer The decoded picture buffer (DPB) 230 may be a memory that stores reference pictures, or generally reference picture data, for encoding video data by the video encoder 20. The DPB 230 may be formed by 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 decoded picture buffer (DPB) 230 may be configured to store one or more filtered blocks 221. The decoded picture buffer 230 may further be configured to store other previously filtered blocks, e.g., previously reconstructed filtered blocks 221, of the same current picture or a different picture, e.g., 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), e.g., for inter-prediction. The decoded picture buffer (DPB) 230 may also be configured to store one or more unfiltered reconstructed blocks 215, or generally unfiltered reconstructed samples, for example if the reconstructed blocks 215 have not been filtered by the loop filter unit 220, or to store any other further processed version of the reconstructed blocks or samples.

[0113] Mode Selection (Segmentation and Prediction) The mode selection unit 260 comprises a partitioning unit 262, an inter prediction unit 244, and an intra prediction unit 254, and is configured to receive or obtain original picture data, e.g., original block 203 (current block 203 of current picture 17), and reconstructed picture data, e.g., filtered and / or unfiltered reconstructed samples or blocks of the same (current) picture, and / or from one or more previously decoded pictures, e.g., from the decoded picture buffer 230 or other buffer (e.g., a line buffer, not shown). The reconstructed picture data is used as reference picture data for prediction, e.g., inter prediction or intra prediction, to obtain a prediction block 265 or predictor 265.

[0114] The mode selection unit 260 may be configured to determine or select a partitioning (including no partitioning) and a prediction mode (e.g., an intra-prediction mode or an inter-prediction mode) for the current block prediction mode and generate a corresponding prediction block 265, which is used for calculating the residual block 205 and for reconstructing the reconstructed block 215.

[0115] Embodiments of mode selection unit 260 may be configured to select a partitioning and prediction mode (e.g., from those supported by or available to mode selection unit 260) that results in the best match, or in other words, the smallest residual (smallest residual means better compression for transmission or storage), or the smallest signaling overhead (smallest signaling overhead means better compression for transmission or storage), or that considers or balances both. Mode selection unit 260 may be configured to determine the partitioning and prediction mode based on rate-distortion optimization (RDO), i.e., select the prediction mode that results in the smallest rate distortion. Terms such as “best,” “minimum,” and “optimum” in this context do not necessarily refer to an overall “best,” “minimum,” “optimum,” etc., but may also refer to the satisfaction of termination or selection criteria, such as values ​​above or below a certain threshold, or other constraints that may lead to a “non-optimal selection” but reduce complexity and processing time.

[0116] In other words, the partitioning unit 262 may be configured to partition the block 203 into smaller block partitions or sub-blocks (which still form blocks), for example using quadtree partitioning (QT), binary tree partitioning (BT), ternary tree partitioning (TT) or any combination thereof repeatedly, and to perform prediction for each of the block partitions or sub-blocks, for example, wherein the mode selection comprises selecting a tree structure of the partitioned block 203, and a prediction mode is applied to each of the block partitions or sub-blocks.

[0117] Below, the partitioning (eg, by partition unit 260) and prediction processes (by inter-prediction unit 244 and intra-prediction unit 254) performed by exemplary video encoder 20 are described in more detail.

[0118] compartmentalization The partitioning unit 262 may partition (or split) the current block 203 into smaller partitions, e.g., square or rectangular sized smaller blocks. These smaller blocks (which may also be called sub-blocks) may be further divided into smaller partitions. This is also called tree partitioning or hierarchical tree partitioning, where, for example, a root block at root tree level 0 (hierarchical level 0, depth 0) may be recursively partitioned, e.g., into two or more blocks at the next lower tree level, e.g., a node at tree level 1 (hierarchical level 1, depth 1), which may then be partitioned again into two or more blocks at the next lower level, e.g., tree level 2 (hierarchical level 2, depth 2), and so on, until the partitioning is terminated, e.g., because a termination criterion is met, e.g., a maximum tree depth or a minimum block size is reached. Blocks that are not further partitioned are also called leaf blocks or leaf nodes of the tree. A tree that uses a partitioning into two parts is called a binary tree (BT), a tree that uses a partitioning into three parts is called a ternary tree (TT), and a tree that uses a partitioning into four parts is called a quad tree (QT).

[0119] As previously mentioned, the term "block" as used herein may refer to a portion of a picture, particularly a square or rectangular portion. For example, with reference to HEVC and VVC, a block may be or correspond to a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), and a transform unit (TU), and / or a corresponding block, such as a coding tree block (CTB), a coding block (CB), a transform block (TB), or a prediction block (PB).

[0120] For example, a coding tree unit (CTU) may be or comprise a CTB of luma samples, two corresponding CTBs of chroma samples for a picture having three sample arrays, or a CTB of samples for a monochrome picture or a picture coded using three separate color planes and a syntax structure used to code the samples. Correspondingly, a coding tree block (CTB) may be an N×N block of samples for some value of N, such that the division of the components into CTBs is partitioned. A coding unit (CU) may be or comprise a coding block of luma samples, two corresponding coding blocks of chroma samples for a picture having three sample arrays, or a coding block of samples for a monochrome picture or a picture coded using three separate color planes and a syntax structure used to code the samples. Correspondingly, a coding block (CB) may be an M×N block of samples for some values ​​of M and N, such that the division of the CTB into coding blocks is partitioned.

[0121] In an embodiment, for example, according to HEVC, coding tree units (CTUs) may be divided into CUs by using a quadtree structure denoted as a coding tree. The decision of whether to code a picture area using inter-picture (temporal) prediction or intra-picture (spatial) prediction is made at the CU level. Each CU may be further divided into one, two, or four PUs according to a PU partition type. Within one PU, the same prediction process is applied, and related information is transmitted to the decoder for each PU. After obtaining residual blocks by applying a prediction process based on the PU partition type, the CU may be partitioned into transform units (TUs) according to another quadtree structure similar to the coding tree for CUs.

[0122] In an embodiment, according to the latest video coding standard currently under development, for example, called Versatile Video Coding (VVC), a combined quadtree and binary tree (QTBT) partitioning is used to partition coding blocks. In the QTBT block structure, a CU may have either a square or rectangular shape. For example, a coding tree unit (CTU) is first partitioned by a quadtree structure. The quadtree leaf node is further partitioned by a binary tree or a ternary (or triple) tree structure. The partitioned tree leaf node is called a coding unit (CU), and its segmentation is used for prediction and transform processing without further partitioning. This means that CUs, PUs, and TUs have the same block size in the QTBT coding block structure. In parallel, multiple partitions, for example, triple tree partitioning, may be used with the QTBT block structure.

[0123] In one example, mode select unit 260 of video encoder 20 may be configured to perform any combination of the partitioning techniques described herein.

[0124] As described above, video encoder 20 is configured to determine or select a best or optimal prediction mode from a (e.g., predetermined) set of prediction modes, which may comprise, for example, intra-prediction modes and / or inter-prediction modes.

[0125] Intra prediction The set of intra prediction modes may comprise 35 different intra prediction modes, e.g., non-directional modes such as DC (or average) mode and planar mode, or directional modes as defined, e.g., in HEVC, or may comprise 67 different intra prediction modes, e.g., non-directional modes such as DC (or average) mode and planar mode, or directional modes as defined, e.g., for VVC.

[0126] The intra prediction unit 254 is configured to use reconstructed samples of neighboring blocks of the same current picture to generate an intra prediction block 265 according to an intra prediction mode of a set of intra prediction modes.

[0127] The intra prediction unit 254 (or generally the mode selection unit 260) is further configured to output intra prediction parameters (or generally information indicating the selected intra prediction mode for the block) in the form of syntax element 266 to the entropy coding unit 270 for inclusion in the encoded picture data 21, so that, for example, the video decoder 30 may receive and use the prediction parameters for decoding.

[0128] Inter Prediction The set of inter prediction modes (or possible inter prediction modes) depends on the available reference pictures (i.e., previous, at least partially decoded pictures, e.g., stored in DBP230) and other inter prediction parameters, such as whether the entire reference picture is used to find the best matching reference block or only a portion of the reference picture, e.g., a search window area around the area of ​​the current block, is used, and / or whether pixel interpolation is applied, e.g., whether half-pel and / or quarter-pel interpolation is applied.

[0129] In addition to the above prediction modes, skip mode and / or direct mode may be applied.

[0130] The inter prediction unit 244 may include a motion estimation (ME) unit and a motion compensation (MC) unit (both not shown in FIG. 2). The motion estimation unit may be configured to receive or obtain the picture block 203 (current picture block 203 of current picture 17) and the 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, a video sequence may comprise the current picture and the previously decoded picture 231, or in other words, the current picture and the previously decoded picture 231 may be part of or form a sequence of pictures that form a video sequence.

[0131] The encoder 20 may be configured to, for example, select a reference block from multiple reference blocks in the same picture or different pictures of multiple other pictures, and provide the reference picture (or reference picture index) and / or an offset (spatial offset) between the position (x, y coordinates) of the reference block and the position of the current block as inter-prediction parameters to the motion estimation unit. This offset is also called a motion vector (MV).

[0132] The motion compensation unit is configured to obtain, e.g., receive, inter prediction parameters and to perform inter prediction based on or using the inter prediction parameters to obtain inter prediction block 265. The motion compensation performed by the motion compensation unit may involve fetching or generating a predictive block based on a motion / block vector determined by motion estimation, possibly performing interpolation to sub-sample precision. Interpolation filtering may generate additional samples from known samples, potentially increasing the number of predictive block candidates that can be used to code the picture block. Upon receiving a motion vector for the PU of the current picture block, the motion compensation unit may find the predictive block to which the motion vector points in one of the reference picture lists.

[0133] The motion compensation unit may also generate syntax elements associated with the blocks and video slices for use by video decoder 30 in decoding picture blocks of the video slices. In addition to, or as an alternative to, slices and their respective syntax elements, tile groups and / or tiles and their respective syntax elements may be generated or used.

[0134] Entropy Coding Entropy encoding unit 270 is configured, for example, to apply an entropy encoding algorithm or scheme (e.g., a variable length coding (VLC) scheme, a context-adaptive VLC scheme (CAVLC), an arithmetic coding scheme, binarization, context-adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioned entropy (PIPE) coding, or another entropy encoding method or technique) or bypass (no compression) to quantized coefficients 209, inter-prediction parameters, intra-prediction parameters, loop filter parameters, and / or other syntax elements to obtain coded picture data 21, which may be output, for example, via output 272 in the form of coded bitstream 21 so that, for example, video decoder 30 may receive and use the parameters for decoding. Coded bitstream 21 may be transmitted to video decoder 30 or stored in memory for later transmission or retrieval by video decoder 30.

[0135] Other structural variations of the video encoder 20 may be used to encode the video stream. For example, a non-transform-based encoder 20 may, for some blocks or frames, quantize the residual signal directly without the transform processing unit 206. In another implementation, the encoder 20 may have the quantization unit 208 and the inverse quantization unit 210 combined into a single unit.

[0136] Decoder and decoding method 3 shows an example of a video decoder 30 configured to implement the techniques of the present application. The video decoder 30 is configured to receive coded picture data 21 (e.g., coded bitstream 21), e.g., coded by encoder 20, to obtain a decoded picture 331. The coded picture data or bitstream includes information for decoding the coded picture data, e.g., data representing picture blocks and associated syntax elements of a coded video slice (and / or tile group or tile).

[0137] 3, decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., adder 314), a loop filter 320, a decoded picture buffer (DBP) 330, a mode application unit 360, an inter prediction unit 344, and an intra prediction unit 354. Inter prediction unit 344 may be or include a motion compensation unit. Video decoder 30 may, in some examples, perform a decoding path that is generally inverse to the encoding path described with respect to video encoder 100 from FIG. 2.

[0138] As described with respect to encoder 20, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, loop filter 220, decoded picture buffer (DPB) 230, inter prediction unit 344, and intra prediction unit 354 are also referred to as forming a “built-in decoder” of video encoder 20. Accordingly, 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, loop filter 320 may be functionally identical to root block 220, and decoded picture buffer 330 may be functionally identical to decoded picture buffer 230. Accordingly, descriptions given for the respective units and functions of video encoder 20 apply correspondingly to the respective units and functions of video decoder 30.

[0139] Entropy Decoding The entropy decoding unit 304 is configured to parse the bitstream 21 (or generally, the coded picture data 21) and, e.g., perform entropy decoding on the coded picture data 21 to obtain, e.g., quantized coefficients 309 and / or decoded coding parameters (not shown in FIG. 3 ), such as inter-prediction parameters (e.g., reference picture indices and motion vectors), intra-prediction parameters (e.g., intra-prediction modes or indices), transform parameters, quantization parameters, loop filter parameters, and / or other syntax elements. The entropy decoding unit 304 may be configured to apply a decoding algorithm or scheme corresponding to an encoding scheme such as described with respect to the entropy coding unit 270 of the encoder 20. The entropy decoding unit 304 may further be configured to provide the inter-prediction parameters, intra-prediction parameters, and / or other syntax elements to the mode application unit 360 and to provide other parameters to other units of the decoder 30. The video decoder 30 may receive syntax elements at a video slice level and / or a video block level. In addition to or as an alternative to slices and their respective syntax elements, tile groups and / or tiles and their respective syntax elements may be received and / or used.

[0140] inverse quantization Inverse quantization unit 310 may be configured to receive a quantization parameter (QP) (or generally, information regarding inverse quantization) and quantized coefficients from coded picture data 21 (e.g., by parsing and / or decoding, e.g., by entropy decoding unit 304), and apply inverse quantization to the decoded quantized coefficients 309 based on the quantization parameter to obtain dequantized coefficients 311, which may also be referred to as transform coefficients 311. The inverse quantization process may involve use of the quantization parameter determined by video encoder 20 for each video block in a video slice (or tile or tile group) to determine the degree of quantization to be applied, and similarly the degree of inverse quantization.

[0141] Inverse transformation The inverse transform processing unit 312 may be configured to receive the dequantized coefficients 311, also referred to as transform coefficients 311, and apply a transform to the dequantized coefficients 311 to obtain reconstructed residual blocks 213 in the sample domain. The reconstructed residual blocks 213 may also be referred to as transform blocks 313. The transform may be an inverse transform, e.g., an inverse DCT, an inverse DST, an inverse integer transform, or a conceptually similar inverse transform process. The inverse transform processing unit 312 may further be configured to receive transform parameters or corresponding information from the coded picture data 21 (e.g., by analysis and / or decoding by the entropy decoding unit 304) to determine the transform to be applied to the dequantized coefficients 311.

[0142] Rebuild The reconstruction unit 314 (e.g., an adder or summer 314) may be configured to add the reconstructed residual block 313 to the prediction block 365 to obtain the reconstructed block 315 in the sample domain, for example, by adding the sample values ​​of the reconstructed residual block 313 and the sample values ​​of the prediction block 365.

[0143] filtering Loop filter unit 320 (either in the coding loop or after the coding loop) is configured to filter reconstructed block 315, e.g., to smooth pixel transitions or otherwise improve video quality, to obtain filtered block 321. Loop filter unit 320 may comprise one or more loop filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, or one or more other filters, e.g., a bilateral filter, an adaptive loop filter (ALF), a sharpening filter, a smoothing filter, or a collaborative filter, or any combination thereof. Although loop filter unit 320 is shown in FIG. 3 as being a loop filter, in other configurations, loop filter unit 320 may be implemented as a post-loop filter.

[0144] Decoded Picture Buffer The decoded video blocks 321 of the picture are then stored in a decoded picture buffer 330, which stores the decoded picture 331 as a reference picture for subsequent motion compensation relative to other pictures and / or display on output, respectively.

[0145] The decoder 30 is arranged to output the decoded pictures 311, for example via an output 312, for presentation to or viewing by a user.

[0146] prediction The inter prediction unit 344 may be identical to the inter prediction unit 244 (specifically, the motion compensation unit), and the intra prediction unit 354 may be functionally identical to the inter prediction unit 254, and performs the partition or partition decision and prediction based on the partition and / or prediction parameters or respective information received from the coded picture data 21 (e.g., by parsing and / or decoding, e.g., by the entropy decoding unit 304). The mode application unit 360 may be configured to perform prediction (intra prediction or inter prediction) for each block based on the reconstructed picture, block, or respective samples (filtered or unfiltered) to obtain a prediction block 365.

[0147] When a video slice is coded as an intra-coded (I) slice, intra prediction unit 354 of mode application unit 360 is configured to generate predictive blocks 365 for picture blocks of the current video slice based on the signaled intra prediction mode and data from previously decoded blocks of the current picture. When a video picture is coded as an inter-coded (i.e., B or P) slice, inter prediction unit 344 (e.g., a motion compensation unit) of mode application unit 360 is configured to generate predictive blocks 365 for video blocks of the current video slice based on the motion vectors and other syntax elements received from entropy decoding unit 304. For inter prediction, the predictive blocks may be generated from one of the reference pictures in one of the reference picture lists. Video decoder 30 may construct reference frame lists, List 0 and List 1, using a default construction technique based on the reference pictures stored in DPB 330. The same or similar may apply to, or depending on the embodiment using, tile groups (e.g., video tile groups) and / or tiles (e.g., video tiles) in addition to or instead of slices (e.g., video slices), e.g., video may be coded using I, P, or B tile groups and / or tiles.

[0148] Mode application unit 360 is configured to determine prediction information for video blocks of the current video slice by analyzing motion vectors or related information and other syntax elements, and use the prediction information to generate predictive blocks for the current video block being decoded. For example, mode application unit 360 uses some of the received syntax elements to determine a prediction mode (e.g., intra prediction or inter prediction) to be used for coding the video blocks of the 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, motion vectors for each inter-coded video block of the slice, inter-prediction status for each inter-coded video block of the slice, and other information for decoding video blocks in the current video slice. The same or similar may apply to or by embodiments that use tile groups (e.g., video tile groups) and / or tiles (e.g., video tiles) in addition to or instead of slices (e.g., video slices), e.g., video may be coded using I, P, or B tile groups and / or tiles.

[0149] An embodiment of video decoder 30 such as that shown in FIG. 3 may be configured to partition and / or decode pictures by using slices (also called video slices), where a picture may be partitioned into or decoded using one or more slices (typically non-overlapping), each of which may include one or more blocks (e.g., CTUs).

[0150] An embodiment of video decoder 30 as shown in FIG. 3 may be configured to partition and / or decode a picture by using tile groups (also referred to as video tile groups) and / or tiles (also referred to as video tiles), where a picture may be partitioned into or decoded using one or more (typically non-overlapping) tile groups, each of which may comprise, for example, one or more blocks (e.g., CTUs) or one or more tiles, and each tile may be, for example, rectangular in shape and may comprise one or more blocks (e.g., CTUs), e.g., full blocks or partial blocks.

[0151] Other variations of the video decoder 30 may be used to decode the coded picture data 21. For example, the decoder 30 may generate an output video stream without the loop filtering unit 320. For example, a non-transform-based decoder 30 may, for some blocks or frames, directly inverse quantize the residual signal without the inverse transform processing unit 312. In another implementation, the video decoder 30 may have the inverse quantization unit 310 and the inverse transform processing unit 312 combined into a single unit.

[0152] It should be understood that in the encoder 20 and the decoder 30, the processing result of the current step may be further processed and then output to the next step. For example, after interpolation filtering, motion vector derivation, or loop filtering, further operations such as cropping or shifting may be performed on the processing result of the interpolation filtering, motion vector derivation, or loop filtering.

[0153] Further operations may be applied to the derived motion vector of the current block (including, but not limited to, control point motion vectors in affine mode, sub-block motion vectors in affine mode, planar mode, ATMVP mode, temporal motion vectors, etc.). For example, the value of a motion vector is constrained to a predetermined range according to the bits representing it. If the bits representing the motion vector are bitDepth, the range is -2^(bitDepth-1) to 2^(bitDepth-1)-1, where "^" means the exponent. For example, if bitDepth is set equal to 16, the range is -32768 to 32767, and if bitDepth is set equal to 18, the range is -131072 to 131071. For example, the value of a derived motion vector (e.g., MVs of four 4x4 sub-blocks in one 8x8 block) is constrained so that the maximum difference between the integer parts of the four 4x4 sub-block MVs is not greater than N samples, such as not greater than 1 sample.

[0154] 4 is a schematic diagram of a video coding device 400 according to an embodiment of the present disclosure. The video coding device 400 is suitable for implementing the disclosed embodiments as described herein. In an embodiment, the video coding device 400 may be a decoder, such as the video decoder 30 of FIG. 1A, or an encoder, such as the video encoder 20 of FIG. 1A.

[0155] Video coding device 400 comprises an ingress port 410 (or input port 410) and a receiver 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 (or output port 450) for transmitting data, and a memory 460 for storing data. Video coding device 400 may also comprise optical-to-electrical (OE) and electrical-to-optical (EO) components coupled to ingress port 410, receiver unit 420, transmitter unit 440, and egress port 450 for inputting and outputting optical or electrical signals.

[0156] The processor 430 is implemented by hardware and software. The processor 430 may be implemented as one or more CPU chips, cores (e.g., as a multi-core processor), FPGA, ASIC, and DSP. The processor 430 is in communication with the ingress port 410, the receiver unit 420, the transmitter unit 440, the egress port 450, and the memory 460. The processor 430 includes a coding module 470. The coding module 470 implements the disclosed embodiments described above. For example, the coding module 470 performs, processes, prepares, or provides various coding operations. Thus, the inclusion of the coding module 470 significantly improves the functionality of the video coding device 400 and causes the video coding device 400 to transition to a different state. Alternatively, the coding module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.

[0157] Memory 460 may comprise one or more disks, tape drives, and solid-state drives, and may be used as an overflow data storage device for storing programs when such programs are selected for execution and for storing instructions and data read during program execution. Memory 460 may be, for example, volatile and / or non-volatile, and may be read-only memory (ROM), random access memory (RAM), ternary content addressable memory (TCAM), and / or static random access memory (SRAM).

[0158] 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 from FIG. 1, according to an example embodiment.

[0159] Processor 502 in device 500 may be a central processing unit. Alternatively, processor 502 may be any other type of device or devices now existing or later developed that are capable of manipulating or processing information. While the disclosed implementations may be practiced with a single processor, e.g., processor 502, as shown, benefits in speed and efficiency may be obtained from using more than one processor.

[0160] In some implementations, 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 as the memory 504. The memory 504 may include code and data 506 that is accessed by the processor 502 using a bus 512. The memory 504 may further include an operating system 508 and application programs 510, which include at least one program that enables the processor 502 to perform the methods described herein. For example, the application programs 510 may include applications 1 through N, which further include a video coding application that performs the methods described herein.

[0161] The apparatus 500 may also include one or more output devices, such as a display 518. The display 518, in one example, may be a touch-sensitive display that combines a display with touch-sensitive elements operable to sense touch input. The display 518 may be coupled to the processor 502 via the bus 512.

[0162] Although illustrated here as a single bus, bus 512 of device 500 may be comprised of multiple buses. Additionally, secondary storage 514 may be directly coupled to other components of device 500 or may be accessed over a network, and may comprise a single integrated unit such as a memory card or multiple units such as multiple memory cards. Thus, device 500 may be implemented in a wide variety of configurations.

[0163] The following first explains the concept of this application.

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

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

[0166] In merge mode, a motion vector candidate list is first constructed based on the motion information of coded blocks spatially or temporally neighboring the current block. Then, the most suitable motion information is determined from the motion vector candidate list as the motion information of the current block based on the rate-distortion cost. The index value of the position of the most suitable motion information in the motion vector candidate list (hereinafter referred to as the merge index) is transmitted to the decoder side. Spatial and temporal motion information candidates for the current block are shown in FIG. 6. Spatial motion information candidates are from five spatially neighboring blocks (A0, A1, B0, B1, and B2). If a neighboring block is unavailable (either the neighboring block does not exist, or the neighboring block is not coded, or the prediction mode used for the neighboring block is not an inter prediction mode), the motion information of this neighboring block is not added to the motion vector candidate list. The temporal motion information candidate for the current block is obtained by scaling the motion vector of the block at the corresponding position in the reference frame based on the picture order count (POC) of the reference frame and the current frame. It is first determined whether a block at position T in the reference frame is available, and if the block is not available, a block at position C is selected.

[0167] Similar to AMVP mode, in merge mode, both the location of neighboring blocks and their traversal order are also predetermined. In addition, the location of neighboring blocks and their traversal order can be different in different modes.

[0168] It can be seen that a motion vector candidate list (also called a list of candidates, which may be called a candidate list for short) needs to be maintained in both AMVP mode and merge mode. Every time new motion information is added to the candidate list, it is first checked whether the same motion information already exists in the list. If the same motion information already exists, the motion information is not added to the list. This checking process is called pruning the motion vector candidate list. Pruning the list is to avoid including the same motion information in the list, thereby avoiding redundant rate-distortion cost calculations.

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

[0170] In existing video coding standards, block matching motion estimation based on a translational motion model is applied, and the motion of all samples within a block is assumed to be consistent. However, in the real world, various motions occur. Many objects, such as rotating objects, roller coasters rotating in various directions, fireworks, and some stunts in movies, especially moving objects in User Generated Content (UGC) scenarios, exhibit non-translational motion. If block motion compensation techniques based on the translational motion model in existing coding standards are used for coding these moving objects, the coding efficiency may be significantly affected. Therefore, a non-translational motion model, such as an affine motion model, is introduced to further improve coding efficiency.

[0171] Based on this, according to different motion models, AMVP modes may be classified into translational model-based AMVP modes and non-translational model-based AMVP modes (e.g., affine model-based AMVP modes), and merge modes may be classified into translational model-based merge modes and non-translational model-based merge modes (e.g., affine model-based merge modes).

[0172] 2. Non-translational motion model Prediction based on a non-translational motion model refers to the fact that the same motion model is used on both the encoder and decoder sides to derive the motion information of each sub-block in the current block (also called a sub-motion compensation unit or a basic motion compensation unit), and motion compensation is performed based on the motion information of the sub-block to obtain a predicted block, thereby improving prediction efficiency. Common non-translational motion models include a four-parameter affine motion model and a six-parameter affine motion model.

[0173] A sub-motion compensation unit (also referred to as a sub-block) in this embodiment of the present application may be a sample or an N1×N2 sample block obtained based on a specific partitioning method, where both N1 and N2 are positive integers, and N1 may or may not be equal to N2.

[0174] The four-parameter affine motion model is expressed as equation (2).

[0175]

number

[0176] A four-parameter affine motion model may be represented by motion vectors of two samples and their coordinates relative to the top-left sample of the current block. The samples used to represent the motion model parameters are called control points. If the samples at the top-left corner (0,0) and the top-right corner (W,0) are used as control points, the motion vectors (vx0,vy0) and (vx1,vy1) of the control points at the top-left corner and the top-right corner of the current block, respectively, are first determined. Then, the motion information of each sub-motion compensation unit of the current block is obtained according to Equation (3), where (x,y) is the coordinate of the sub-motion compensation unit relative to the top-left sample of the current block (e.g., the coordinate of the top-left sample), and W represents the width of the current block. It should be understood that other control points may be used instead. For example, samples at positions (2,2) and (W+2,2), or (-2,-2) and (W-2,-2) may be used as control points. The selection of control points is not limited by the examples listed herein.

[0177]

number

[0178] The six-parameter affine motion model is expressed as equation (4).

[0179]

number

[0180] A six-parameter affine motion model can be expressed by motion vectors of three samples and their coordinates relative to the top-left sample of the current block. If the top-left sample (0,0), top-right sample (W,0), and bottom-left sample (0,H) of the current block are used as control points, the motion vectors (vx0,vy0), (vx1,vy1), and (vx2,vy2) of the top-left corner control point, top-right corner control point, and bottom-left corner control point of the current block, respectively, are first determined. Then, the motion information of each sub-motion compensation unit of the current block is obtained according to Equation (5), where (x,y) is the coordinate of the sub-motion compensation unit relative to the top-left sample of the current block, and W and H represent the width and height of the current block, respectively. It should be understood that other control points may be used instead. For example, samples at positions (2,2), (W+2,2), and (2,H+2), or (-2,-2), (W-2,-2), and (-2,H-2) may be used as control points. These examples are not limiting.

[0181]

number

[0182] A coding block that is predicted by using an affine motion model is called an affine-coded block.

[0183] In general, the motion information of the control points of an affine-coded block can be obtained by using an affine motion model-based advanced motion vector prediction (AMVP) mode or an affine motion model-based merge mode.

[0184] The motion information of the control points of the current coding block may be obtained by using an inherited control point motion vector prediction method or a constructed control point motion vector prediction method.

[0185] 3. Inherited control point motion vector prediction method The inherited control point motion vector prediction method refers to using the motion models of neighboring coded affine-coded blocks to determine the control point motion vector candidates of the current block.

[0186] The current block shown in FIG. 7 is used as an example. To find the affine-coded block in which the block at the neighboring position of the current block is located and obtain the control point motion information of the affine-coded block, the blocks at neighboring positions around the current block are scanned in a specified order, for example, A1 → B1 → B0 → A0 → B2. Furthermore, the control point motion vector (for merge mode) or the control point motion vector predictor (for AMVP mode) of the current block is derived by using a motion model constructed based on the control point motion information of the affine-coded block. The order A1 → B1 → B0 → A0 → B2 mentioned above is used only as an example and should not be construed as limiting. Other orders may also be used. In addition, the blocks at neighboring positions are not limited to A1, B1, B0, A0, and B2, and various blocks at neighboring positions may be used.

[0187] The blocks at adjacent locations can be samples or sample blocks of a preset size obtained based on a particular partitioning method. For example, the sample blocks can be 4x4 sample blocks, 4x2 sample blocks, or sample blocks of another size. These block sizes are for illustrative purposes and should not be construed as limiting.

[0188] The following describes the decision process by using A1 as an example, and similar processes can be used for other cases.

[0189] 7, if the coding block where A1 is located is a four-parameter affine-coded block, a motion vector (vx4, vy4) for the upper left corner (x4, y4) and a motion vector (vx5, vy5) for the upper right corner (x5, y5) of the affine-coded block are obtained. The motion vector (vx0, vy0) for the upper left corner (x0, y0) of the current affine-coded block is calculated according to Equation (6), and the motion vector (vx1, vy1) for the upper right corner (x1, y1) of the current affine-coded block is calculated according to Equation (7).

[0190]

number

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

[0192] If the coding block where A1 is located is a six-parameter affine-coded block, the motion vector (vx4, vy4) of the upper left corner (x4, y4), the motion vector (vx5, vy5) of the upper right corner (x5, y5), and the motion vector (vx6, vy6) of the lower left corner (x6, y6) of the affine-coded block are obtained. The motion vector (vx0, vy0) of the upper left corner (x0, y0) of the current block is calculated according to equation (8). The motion vector (vx1, vy1) of the upper right corner (x1, y1) of the current block is calculated according to equation (9). The motion vector (vx2, vy2) of the lower left corner (x2, y2) of the current block is calculated according to equation (10).

[0193]

number

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

[0195] It should be noted that other motion models, location candidates, and search and scanning orders are also applicable to the present application, and details will not be described in this embodiment of the present application.

[0196] It should be noted that other methods in which control points are used to represent the motion models of neighboring coding blocks and the current coding block are also applicable to the present application, and will not be described in detail herein.

[0197] 4. Constructed control point motion vector prediction method 1 The constructed control point motion vector prediction method refers to combining the motion vectors of neighboring coded blocks around the control points of the current block as the control point motion vector of the current affine coded block, without considering whether those neighboring coded blocks are affine coded blocks or not.

[0198] The motion vectors of the upper left corner and the upper right corner of the current block are determined by using the motion information of the adjacent coded blocks around the current coding block. Figure 8A is used as an example to explain the constructed control point motion vector prediction method. Please note that Figure 8A is only an example and should not be interpreted as limiting.

[0199] As shown in Figure 8A, the motion vectors of the neighboring coded blocks A2, B2, and B3 at the upper left corner are used as the motion vector candidates for the motion vector of the upper left corner of the current block, and the motion vectors of the neighboring coded blocks B1 and B0 at the upper right corner are used as the motion vector candidates for the motion vector of the upper right corner of the current block. The motion vector candidates for the upper left corner and the upper right corner are combined to form multiple 2-tuples. The motion vectors of the two coded blocks included in the 2-tuples can be used as the control point motion vector candidates for the current block, as shown in the following equation (11A). {v A2 ,v B1},{v A2 ,v B0},{v B2 ,v B1},{v B2 ,v B0},{v B3 ,v B1},{v B3 ,v B0} (11A) where v A2 represents the motion vector of A2, and v B1 represents the motion vector of B1, and v B0 represents the motion vector of B0, and v B2 represents the motion vector of B2, and v B3 represents the motion vector of B3.

[0200] As shown in Figure 8A, the motion vectors of the neighboring coded blocks A2, B2, and B3 at the upper left corner are used as the motion vector candidate for the motion vector of the upper left corner of the current block, the motion vectors of the neighboring coded blocks B1 and B0 at the upper right corner are used as the motion vector candidate for the motion vector of the upper right corner of the current block, and the motion vectors of the neighboring coded blocks A0 and A1 at the lower left corner are used as the motion vector candidate for the motion vector of the lower left corner of the current block. The motion vector candidates of the upper left corner, the upper right corner, and the lower left corner are combined to form a 3-tuple. The motion vectors of the three coded blocks included in the 3-tuple can be used as the control point motion vector candidate for the current block, as shown in the following equations (11B) and (11C). {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} (11B) {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} (11C) where vA2 represents the motion vector of A2, and v B1 represents the motion vector of B1, and v B0 represents the motion vector of B0, and v B2 represents the motion vector of B2, and v B3 represents the motion vector of B3, and v A0 represents the motion vector of A0, and v A1 represents the motion vector of A1.

[0201] It should be noted that other methods for combining control point motion vectors are also applicable to this application, and will not be described in detail here.

[0202] It should be noted that other methods in which control points are used to represent the motion models of neighboring coding blocks and the current coding block are also applicable to the present application, and will not be described in detail herein.

[0203] 5. Control point motion vector prediction method 2 constructed as shown in Figure 8B: Step 501: Obtain the motion information of the control points of the current block.

[0204] For example, in FIG. 8A, CP k (k=1,2,3,4) represents the kth control point. A0, A1, A2, B0, B1, B2, and B3 are spatially adjacent positions of the current block and are used to predict CP1, CP2, or CP3, and T is a temporally adjacent position of the current block and is used to predict CP4.

[0205] The coordinates of CP1, CP2, CP3, and CP4 are assumed to be (0,0), (W,0), (H,0), and (W,H), respectively, where W and H represent the width and height of the current block.

[0206] For each control point, its motion information is obtained in the following order:

[0207] (1) For CP1, the checking order is B2 → A2 → B3. If B2 is available, the motion information of B2 is used for CP1. Otherwise, A2 and B3 are checked in order. If the motion information of all three positions is unavailable, the motion information of CP1 cannot be obtained.

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

[0209] (3) For CP3, the checking order is A0 → A1. If A0 is available, the motion information of A0 is used for CP3; otherwise, A1 is checked. If the motion information of both positions is unavailable, the motion information of CP3 cannot be obtained.

[0210] (4) For CP4, the motion information of T is used.

[0211] As used herein, X is available means that block X (e.g., A0, A1, A2, B0, B1, B2, B3, or T) has already been coded and an inter prediction mode is used. Otherwise, X is unavailable.

[0212] It should be noted that other methods for obtaining the motion information of the control points are also applicable to the present application, and the details will not be described here.

[0213] Step 502: Combine the motion information of the control points to obtain constructed control point motion information.

[0214] To construct a four-parameter affine motion model, the motion information of two control points is combined to form a 2-tuple. The combinations of motion information of two control points may be {CP1,CP4}, {CP2,CP3}, {CP1,CP2}, {CP2,CP4}, {CP1,CP3}, and {CP3,CP4}. For example, a four-parameter affine motion model constructed by using a 2-tuple containing the motion information of control points CP1 and CP2 may be denoted as Affine(CP1,CP2).

[0215] To construct a six-parameter affine motion model, the motion information of three control points is combined to form a 3-tuple. The combinations of the motion information of three control points may be {CP1, CP2, CP4}, {CP1, CP2, CP3}, {CP2, CP3, CP4}, and {CP1, CP3, CP4}. For example, a six-parameter affine motion model constructed by using a 3-tuple containing the motion information of control points CP1, CP2, and CP3 may be denoted as Affine(CP1, CP2, CP3).

[0216] To construct an eight-parameter bilinear motion model, the motion information of four control points is combined to form a four-tuple. The eight-parameter bilinear motion model constructed by using a four-tuple containing the motion information of control points CP1, CP2, CP3, and CP4 can be denoted as Bilinear(CP1,CP2,CP3,CP4).

[0217] In this embodiment of the present application, for ease of explanation, a combination of motion information for two control points (or two coded blocks) is simply referred to as a 2-tuple, a combination of motion information for three control points (or three coded blocks) is simply referred to as a 3-tuple, and a combination of motion information for four control points (or four coded blocks) is simply referred to as a 4-tuple.

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

[0219] The control point motion vector scaling method is shown in equation (12).

[0220]

number

[0221] where CurPoc represents the number of POCs in the current frame, DesPoc represents the number of POCs in the reference frame of the current block, SrcPoc represents the number of POCs in the reference frame of the control point, and MV s represents the motion vector obtained after scaling, and MV represents the motion vector of the control point.

[0222] Note that different combinations of control points can be transformed into a control point at the same location.

[0223] For example, a four-parameter affine motion model obtained through the combination {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} is converted into a representation by {CP1,CP2} or {CP1,CP2,CP3}. The conversion method includes substituting the motion vector and coordinate information of the control points {CP1,CP4}, {CP2,CP3}, {CP2,CP4}, {CP1,CP3}, or {CP3,CP4} into Equation (2) to obtain the model parameters, and substituting the coordinate information of {CP1,CP2} into Equation (3) to obtain the motion vector of the control point {CP1,CP2}.

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

[0225] {CP1, CP2} can be transformed into {CP1, CP2, CP3} by using the following equation (13): In other words, the motion vector of CP3 in {CP1, CP2, CP3} can be determined by using equation (13).

[0226]

number

[0227] {CP1,CP3} can be converted to {CP1,CP2} or {CP1,CP2,CP3} by using the following equation (14):

[0228]

number

[0229] {CP2,CP3} can be converted to {CP1,CP2} or {CP1,CP2,CP3} by using the following equation (15):

[0230]

number

[0231] {CP1,CP4} can be converted to {CP1,CP2} or {CP1,CP2,CP3} by using the following equations (16) or (17):

[0232]

number

[0233] {CP2,CP4} may be converted to {CP1,CP2} by using the following equation (18), and {CP2,CP4} may be converted to {CP1,CP2,CP3} by using the following equations (18) and (19).

[0234]

number

[0235] {CP3,CP4} may be converted to {CP1,CP2} by using the following equation (20), and {CP3,CP4} may be converted to {CP1,CP2,CP3} by using the following equations (20) and (21).

[0236]

number

[0237] For example, a six-parameter affine motion model obtained through the combination {CP1,CP2,CP4}, {CP2,CP3,CP4}, or {CP1,CP3,CP4} can be converted into a representation by {CP1,CP2,CP3}. The conversion method includes substituting the motion vectors and coordinate information of the control points {CP1,CP2,CP4}, {CP2,CP3,CP4}, or {CP1,CP3,CP4} into Equation (4) to obtain the model parameters, and substituting the coordinate information of {CP1,CP2,CP3} into Equation (5) to obtain the motion vectors of {CP1,CP2,CP3}.

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

[0239] {CP1,CP2,CP4} can be converted to {CP1,CP2,CP3} by using the following equation (22):

[0240]

number

[0241] {CP2,CP3,CP4} can be converted to {CP1,CP2,CP3} by using the following equation (23):

[0242]

number

[0243] {CP1,CP3,CP4} can be converted to {CP1,CP2,CP3} by using the following equation (24):

[0244]

number

[0245] 6. Affine motion model-based advanced motion vector prediction mode (Affine AMVP mode) (1) Building a list of motion vector candidates The motion vector candidate list for the affine motion model-based AMVP mode is constructed by using the inherited control point motion vector prediction method and / or the constructed control point motion vector prediction method described above. In this embodiment of the present application, the motion vector candidate list for the affine motion model-based AMVP mode may be referred to as a control point motion vector predictor candidate list. The motion vector predictor for each control point includes two (four-parameter affine motion model) control point motion vectors or three (six-parameter affine motion model) control point motion vectors.

[0246] Optionally, the control point motion vector predictor candidate list may be pruned and sorted according to a particular rule, and truncated or padded to include a particular amount of control point motion vector predictor candidates.

[0247] (2) Determining the optimal control point motion vector predictor candidate At the encoder side, a motion vector of each sub-motion compensation unit in the current coding block is obtained based on each control point motion vector predictor candidate (e.g., X-tuple candidate) in the control point motion vector predictor candidate list by using equation (3) or (5). The obtained motion vector may be used to obtain a sample value at a corresponding position in a reference frame pointed to by the motion vector of the sub-motion compensation unit. This sample value is used as a predictor for motion compensation using an affine motion model. The average difference between the original value and the predicted value of each sample in the current coding block is calculated. The control point motion vector predictor candidate corresponding to the smallest average difference is selected as the optimal control point motion vector predictor candidate and used as the motion vector predictor for two or three control points of the current coding block. An index number representing the position of the optimal control point motion vector predictor candidate (e.g., X-tuple candidate) in the control point motion vector predictor candidate list is coded into a bitstream and transmitted to a decoder.

[0248] At the decoder side, the index number is analyzed, and a control point motion vector predictor (CPMVP) (eg, an X-tuple candidate) is determined from the control point motion vector predictor candidate list based on the index number.

[0249] (3) Determining control point motion vectors At the encoder side, the control point motion vector predictor is used as a search starting point for motion search within a specific search range to obtain a control point motion vector (CPMV). The difference between each control point motion vector and the control point motion vector predictor (control point motion vector differential, CPMVD) is transmitted to the decoder side.

[0250] At the decoder side, the control point motion vector differentials are obtained by parsing the bitstream and added to the respective control point motion vector predictors to obtain the respective control point motion vectors.

[0251] 7. Affine Merge Mode The control point motion vector merge candidate list is constructed by using the inherited control point motion vector prediction method and / or the constructed control point motion vector prediction method described above.

[0252] Optionally, the control point motion vector merge candidate list may be pruned and sorted according to certain rules, truncated or padded to a certain amount.

[0253] At the encoder side, a motion vector for each sub-motion compensation unit (a sample or N1 × N2 sample block obtained based on a specific partitioning method) in the current coding block is obtained based on each control point motion vector candidate (e.g., an X-tuple candidate) in the merge candidate list by using equation (3) or (5). The obtained motion vector can be used to obtain a sample value at the position in the reference frame indicated by the motion vector of each sub-motion compensation unit. These sample values ​​are used as predicted sample values ​​to perform affine motion compensation. The average difference between the original value and the predicted value of each sample in the current coding block is calculated. The control point motion vector (CPMV) candidate (e.g., a 2-tuple candidate or a 3-tuple candidate) corresponding to the smallest average difference is selected as the motion vector for two or three control points of the current coding block. An index number representing the position of the control point motion vector in the candidate list is encoded into a video bitstream and transmitted to a decoder.

[0254] At the decoder side, the index number is analyzed, and a control point motion vector (CPMV) is determined from the control point motion vector merge candidate list based on the index number.

[0255] Additionally, it should be noted that in this application, "at least one" means one or more, and "multiple" means at least two. The term "and / or" describes a correlation for describing related entities and indicates that three relationships may exist. For example, A and / or B may represent the following cases: only A is present, both A and B are present, and only B is present, where A and B may be singular or plural. The character " / " generally indicates an "or" relationship between related entities. "At least one of the following" or similar phrases refers to any combination of these items, including any combination of single items or multiple items. For example, at least one of a, b, or c may represent a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c may be singular or plural.

[0256] In the present application, when an inter prediction mode is used to decode a current block, a syntax element may be used to signal the inter prediction mode.

[0257] For some currently used syntax structures of inter prediction modes used to parse the current block, see Table 1, which lists some syntax for inter prediction modes. Alternatively, syntax elements in the syntax structure may be represented by other identifiers.

[0258] [Table 1A]

[0259] [Table 1B]

[0260] In Table 1, inter_affine_flag[x0][y0] equal to 1 specifies that, for the current coding unit, affine model-based motion compensation is used to generate predicted samples for the current coding unit when decoding a P or B tile group. inter_affine_flag[x0][y0] equal to 0 specifies that the coding unit is not predicted by affine model-based motion compensation. When inter_affine_flag[x0][y0] is not present, it is inferred to be equal to 0.

[0261] inter_pred_idc[x0][y0] specifies whether list0, list1, or bi-prediction is used for the current coding unit according to Table 2. The array indexes x0, y0 specify the position (x0, y0) of the top-left luma sample of the considered coding block relative to the top-left luma sample of the picture.

[0262] When inter_pred_idc[x0][y0] is not present, it is inferred to be equal to PRED_L0.

[0263] [Table 2]

[0264] sps_affine_enabled_flag specifies whether affine model-based motion compensation can be used for inter prediction. If sps_affine_enabled_flag is equal to 0, the syntax shall be constrained such that affine model-based motion compensation is not used in CVS and inter_affine_flag and cu_affine_type_flag are not present in the coding unit syntax of CVS. Otherwise (sps_affine_enabled_flag is equal to 1), affine model-based motion compensation can be used in CVS.

[0265] The syntax element inter_affine_flag[x0][y0] (or affine_inter_flag[x0][y0]) may be used to indicate whether affine motion model-based AMVP mode is used for the current block when the slice in which the current block is located is a P-type slice or a B-type slice. When this syntax element does not appear in the bitstream, the syntax element defaults to 0. For example, inter_affine_flag[x0][y0]=1 indicates that affine motion model-based AMVP mode is used for the current block, and inter_affine_flag[x0][y0]=0 indicates that affine motion model-based AMVP mode is not used for the current block and that translational motion model-based AMVP mode may be used. That is, inter_affine_flag[x0][y0] equal to 1 specifies that, for the current coding unit, affine model-based motion compensation is used to generate predicted samples for the current coding unit when decoding a P or B tile group. inter_affine_flag[x0][y0] equal to 0 specifies that the coding unit is not predicted by affine model-based motion compensation. When inter_affine_flag[x0][y0] is not present, it is inferred to be equal to 0.

[0266] The syntax element cu_affine_type_flag[x0][y0] may be used to indicate whether a six-parameter affine motion model is used to perform motion compensation for the current block when the slice in which the current block is located is a P-type slice or a B-type slice. cu_affine_type_flag[x0][y0]=0 indicates that a six-parameter affine motion model is not used to perform motion compensation for the current block, and only a four-parameter affine motion model may be used to perform motion compensation. cu_affine_type_flag[x0][y0]=1 indicates that a six-parameter affine motion model is used to perform motion compensation for the current block. That is, cu_affine_type_flag[x0][y0] equal to 1 specifies that, for the current coding unit, six-parameter affine model-based motion compensation is used to generate predicted samples for the current coding unit when decoding a P or B tile group. cu_affine_type_flag[x0][y0] equal to 0 specifies that a four-parameter affine model-based motion compensation is used to generate the prediction samples for the current coding unit.

[0267] As shown in Table 3, MotionModelIdc[x0][y0]=1 indicates that a four-parameter affine motion model is used, MotionModelIdc[x0][y0]=2 indicates that a six-parameter affine motion model is used, and MotionModelIdc[x0][y0]=0 indicates that a translational motion model is used.

[0268] [Table 3]

[0269] The variables MaxNumMergeCand and MaxAffineNumMrgCand are used to represent the maximum list length and indicate the maximum length of the constructed motion vector candidate list. 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 in the forward reference frame list, and ref_idx_l0[x0][y0] indicates the forward reference frame index value of the current block. mvd_coding(x0, y0, 0, 0) indicates the first motion vector differential. 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 the backward reference frame index value of the current block, and mvp_l1_flag[x0][y0] indicates the backward MVP candidate list index value.

[0270] In Table 1, ae(v) represents the syntax element that is coded by using context-based adaptive binary arithmetic coding (cabac).

[0271] 9A is a flowchart illustrating a process of a decoding method according to an embodiment of the present application. The process may be performed by the inter prediction unit 344 of the video decoder 30. The process is described as a series of steps or operations. It should be understood that the process may be performed in various orders and / or simultaneously and is not limited to the order of execution shown in FIG. 9A. It is envisioned that the video decoder is utilized to decode a video data stream having multiple video frames by using a process that includes the inter prediction process shown in FIG. 9A.

[0272] Step 601: Parse the bitstream based on the syntax structure shown in Table 1 to determine the inter prediction mode of the current block.

[0273] If it is determined that the inter prediction mode of the current block is the affine motion model based AMVP mode, then perform step 602a.

[0274] For example, the syntax elements merge_flag=0 and inter_affine_flag=1 indicate that the inter prediction mode of the current block is the affine motion model-based AMVP mode.

[0275] If it is determined that the inter prediction mode of the current block is the affine motion model based merge mode, then perform step 602b.

[0276] For example, the syntax elements merge_flag=1 and inter_affine_flag=1 indicate that the inter prediction mode of the current block is the affine motion model-based merge mode.

[0277] Step 602a: Construct a motion vector candidate list corresponding to the affine motion model based AMVP mode.

[0278] One or more control point motion vector candidates (e.g., one or more X-tuple candidates) for the current block may be derived by using the inherited control point motion vector prediction method and / or the constructed control point motion vector prediction method, and these control point motion vector candidates may be added to a motion vector candidate list.

[0279] The motion vector candidate list may include a 2-tuple list (a 4-parameter affine motion model is used for the current coding block) or a 3-tuple list. A 2-tuple list contains one or more 2-tuples used to construct a 4-parameter affine motion model. A 3-tuple list contains one or more 3-tuples used to construct a 6-parameter affine motion model. It can be understood that each 2-tuple candidate contains two control point motion vector candidates for the current block.

[0280] Optionally, the 2-tuple / 3-tuple list of candidate motion vectors may be pruned and sorted according to certain rules, and truncated or padded to contain a certain amount of 2-tuples or 3-tuples.

[0281] A1: The process of building a motion vector candidate list by using the inherited control point motion vector prediction method is described.

[0282] 7 is used as an example. In this example, to find an affine-coded block including a block at a neighboring position of the current block and obtain control motion information of the affine-coded block, blocks at neighboring positions around the current block are scanned in the order of A1 → B1 → B0 → A0 → B2. The control point motion information of the affine-coded block can be used to construct a motion model and derive control point motion information candidates for the current block. Details of this process are given above in the description of the inherited control point motion vector prediction method in 3.

[0283] In one example, the affine motion model used for the current block is a four-parameter affine motion model (i.e., MotionModelIdc=1). In this example, if the four-parameter affine motion model is used for an adjacent affine-decoded block, the motion vectors of two control points of the affine-decoded block are obtained: the motion vector (vx4,vy4) of the upper-left control point (x4,y4) and the motion vector (vx5,vy5) of the upper-right control point (x5,y5). The affine-decoded block is an affine-coded block that is predicted in the encoding stage by using the affine motion model.

[0284] The motion vectors of the two control points of the current block, i.e., the top-left and top-right control points, are derived according to equations (6) and (7) of the four-parameter affine motion model, respectively, by using a four-parameter affine motion model that includes the two control points of the adjacent affine-decoded blocks.

[0285] When a six-parameter affine motion model is used for an adjacent affine decoding block, the motion vectors of three control points of the adjacent affine decoding block are obtained, for example, the motion vector (vx4,vy4) of the upper left control point (x4,y4), the motion vector (vx5,vy5) of the upper right control point (x5,y5), and the motion vector (vx6,vy6) of the lower left control point (x6,y6) in Figure 7.

[0286] The motion vectors of the two control points of the current block, i.e., the top-left and top-right control points, are derived according to equations (8) and (9) of the six-parameter affine motion model, respectively, by using a six-parameter affine motion model that includes three control points of adjacent affine-decoded blocks.

[0287] In another example, the affine motion model used for the current decoded block is a six-parameter affine motion model (ie, MotionModelIdc=2).

[0288] If the affine motion model used for the adjacent affine decoding block is a six-parameter affine motion model, the motion vectors of three control points of the adjacent affine decoding block are obtained, for example, the motion vector (vx4, vy4) of the upper left control point (x4, y4), the motion vector (vx5, vy5) of the upper right control point, and the motion vector (vx6, vy6) of the lower left control point (x6, y6) in Figure 7.

[0289] The motion vectors of the three control points of the current block, i.e., the top-left, top-right, and bottom-left control points, are derived according to equations (8), (9), and (10), respectively, which correspond to the six-parameter affine motion model, by using a six-parameter affine motion model including the three control points of the adjacent affine-decoded blocks.

[0290] If the affine motion model used for the adjacent affine-decoded blocks is a four-parameter affine motion model, the motion vectors of two control points of the adjacent affine-decoded blocks may be obtained, which may be, for example, the motion vector (vx4,vy4) of the top-left control point (x4,y4) and the motion vector (vx5,vy5) of the top-right control point (x5,y5).

[0291] Motion vectors for three control points, such as the top-left, top-right, and bottom-left control points of the current block, may be derived. For example, these motion vectors may be derived according to equations (6) and (7) of the four-parameter affine motion model by using a four-parameter affine motion model expressed based on two control points of adjacent affine-decoded blocks.

[0292] It should be noted that other motion models, position candidates, and search orders may also be utilized herein. Furthermore, methods for expressing the motion models of neighboring coding blocks and the current coding block based on other control points may also be used.

[0293] A2: The process of constructing a motion vector candidate list by using the constructed control point motion vector prediction method is described.

[0294] In one example, the affine motion model used for the current decoding block is a four-parameter affine motion model (i.e., MotionModelIdc=1). In this example, the motion vectors of the upper left corner and the upper right corner of the current coding block are determined based on the motion information of the neighboring coded blocks of the current coding block. Specifically, the motion vector candidate list may be constructed by using the constructed control point motion vector prediction method 1 described above with reference to item 4 or the constructed control point motion vector prediction method 2 described above with reference to item 5.

[0295] In another example, the affine motion model used for the current decoding block is a six-parameter affine motion model (i.e., MotionModelIdc=2). In this example, the motion vectors for the top-left corner, top-right corner, and bottom-left corner of the current coding block are determined by using motion information of neighboring coded blocks of the current coding block. Specifically, the motion vector candidate list may be constructed by using the constructed control point motion vector prediction method 1 described above with reference to item 4 or the constructed control point motion vector prediction method 2 described above with reference to item 4.

[0296] Note that other combinations of control point motion information may also be utilized.

[0297] Step 603a: Analyze the bitstream and determine the best control point motion vector predictor (ie, the best multi-tuple candidate).

[0298] B1: If the affine motion model used for the current decoded block is a four-parameter affine motion model (MotionModelIdc=1), the index numbers are parsed from the bitstream, and the best motion vector predictors for the two control points are determined from the motion vector candidate list based on the index numbers.

[0299] For example, the index number is mvp_l0_flag or mvp_l1_flag.

[0300] B2: If the affine motion model used for the current decoded block is a 6-parameter affine motion model (MotionModelIdc=2), the index numbers are parsed from the bitstream, and the best motion vector predictors for the three control points are determined from the motion vector candidate list based on the index numbers.

[0301] Step 604a: Analyze the bitstream to determine control point motion vectors.

[0302] C1: If the affine motion model used for the current decoding block is a four-parameter affine motion model (MotionModelIdc=1), the motion vector differentials of the two control points of the current block are obtained by decoding the bitstream. Then, the motion vector values ​​of the two control points are obtained based on the motion vector differentials of the control points and the corresponding motion vector predictors. Using forward prediction as an example, the motion vector differentials of the two control points are mvd_coding(x0,y0,0,0) and mvd_coding(x0,y0,0,1), respectively.

[0303] For example, the motion vector differentials for the top-left and top-right control points are obtained by decoding the bitstream and added to the respective motion vector predictors to obtain the motion vectors for the top-left and top-right control points of the current block.

[0304] C2: The affine motion model used for the current decoding block is a 6-parameter affine motion model (MotionModelIdc=2).

[0305] The motion vector differentials of three control points of the current block are obtained by decoding the bitstream. The motion vector values ​​of these control points are obtained based on the motion vector differentials of the control points and their respective motion vector predictors. Taking forward prediction (i.e., list 0) as an example, the motion vector differentials of the three control points are mvd_coding(x0,y0,0,0), mvd_coding(x0,y0,0,1), and mvd_coding(x0,y0,0,2) respectively.

[0306] For example, motion vector differentials for the top-left, top-right, and bottom-left control points are obtained by decoding the bitstream, and these motion vector differentials are added to the respective motion vector predictors to obtain motion vectors for the top-left, top-right, and bottom-left control points of the current block.

[0307] Step 605a: Obtain the motion vector of each sub-block in the current block according to the control point motion information and the affine motion model used for the current decoding block.

[0308] A sub-block in the current affine decoding block may be equivalent to one motion compensation unit, and the width and height of the sub-block are less than the width and height of the current block. The motion information of a sample at a preset position in the sub-block or motion compensation unit may be used to represent the motion information of all samples in the sub-block or motion compensation unit. Assuming that the size of the motion compensation unit is M×N, the sample at the preset position may be the center sample (M / 2, N / 2), the top-left sample (0, 0), the top-right sample (M-1, 0), or a sample at another position in the motion compensation unit. The following description uses the center sample of the motion compensation unit as an example for illustration. Referring to FIG. 9C, V0 represents the motion vector of the top-left control point, and V1 represents the motion vector of the top-right control point. Each small box represents one motion compensation unit.

[0309] The coordinates of the center sample of the motion compensation unit relative to the top-left corner sample in the current affine decoding block are calculated according to equation (25), where i denotes the ith motion compensation unit in the horizontal direction (left to right), j denotes the jth motion compensation unit in the vertical direction (top to bottom), and (x (i,j) , y (i,j) ) represents the coordinate of the center sample of the (i,j)th motion compensation unit relative to the top-left control point sample in the current affine decoding block.

[0310] If the affine motion model used for the current affine decoding block is a 6-parameter affine motion model, then each motion compensation unit (vx (i,j) ,vy (i,j) To get the motion vector of the center sample of (x (i,j) ,y (i,j) ) is substituted into the six-parameter affine motion model equation (26). As discussed above, the motion vector of the center pixel of the motion compensation unit is used as the motion vector for all samples in the motion compensation unit.

[0311] If the affine motion model used for the current affine decoding block is a 4-affine motion model, then each motion compensation unit (vx) is used as the motion vector for all samples in the motion compensation unit. (i,j) ,vy (i,j) To get the motion vector of the center sample of (x (i,j) , y (i,j) ) is substituted into the four-parameter affine motion model equation (27).

[0312]

number

[0313] Step 606a: Perform motion compensation for each sub-block based on the determined motion vector of the sub-block to obtain a predicted sample value of the sub-block.

[0314] As discussed above, if it is determined in step 601 that the inter prediction mode of the current block is the affine motion model-based merge mode, step 602b is executed.

[0315] Step 602b: Construct a motion information candidate list corresponding to the affine motion model based merge mode.

[0316] Specifically, the motion information candidate list corresponding to the affine motion model-based merge mode may be constructed by using an inherited control point motion vector prediction method and / or a constructed control point motion vector prediction method.

[0317] Optionally, the motion information candidate list may be pruned and sorted according to certain rules, and truncated or padded to contain a certain amount of motion information.

[0318] D1: The process of building a motion vector candidate list by using the inherited control point motion vector prediction method is described.

[0319] The control point motion information candidates of the current block are derived by using the inherited control point motion vector prediction method and added to the motion information candidate list.

[0320] In the example shown in Figure 8A, to find the affine-coded block where the neighboring block is located and obtain the control point motion information of the affine-coded block, the blocks in the neighboring positions around the current block are scanned in the order of A1 → B1 → B0 → A0 → B2. Furthermore, the control point motion information candidates of the current block are derived by using the motion model of the current block.

[0321] If the motion vector candidate list is empty, the control point motion information candidate obtained above is added to the candidate list. Otherwise, the motion information in the motion vector candidate list is sequentially scanned to check whether the same motion information as the control point motion information candidate exists in the motion vector candidate list. If the same motion information as the control point motion information candidate does not exist in the motion vector candidate list, the control point motion information candidate is added to the motion vector candidate list.

[0322] Determining whether two motion information candidates are the same can be performed by determining whether the forward (List 0) and backward (List 1) reference frames of the motion information candidates and the horizontal and vertical components of their respective forward and backward motion vectors are the same. Two motion information candidates are considered different only if all these elements are different.

[0323] When the amount of motion information in the motion vector candidate list reaches the maximum list length MaxAffineNumMrgCand (MaxAffineNumMrgCand is a positive integer such as 1, 2, 3, 4, or 5, where 5 is used as an example in the following description), the construction of the candidate list is completed. Otherwise, the next neighboring block is scanned.

[0324] D2: The control point motion information candidate of the current block is derived by using the constructed control point motion vector prediction method and added to the motion information candidate list. Figure 9B shows an example of a flowchart of the constructed control point motion vector prediction method.

[0325] Step 601c: Obtain the motion information of the control points of the current block. This step is the same as step 501 in "5. Constructed control point motion vector prediction method 2." The details will not be repeated here.

[0326] Step 602c: Combine the motion information of the control points to obtain constructed control point motion information. This step is similar to step 501 in Fig. 8B, and the details of this step will not be described again here.

[0327] Step 603c: Add the constructed control point motion information to a motion vector candidate list.

[0328] If the length of the candidate list is less than the maximum list length MaxAffineNumMrgCand, the combinations of motion information of control points are scanned in a preset order, and the obtained valid combinations are used as control point motion information candidates. In this case, if the motion vector candidate list is empty, the control point motion information candidate is added to the motion vector candidate list. Otherwise, the motion information in the motion vector candidate list is scanned sequentially to check whether the same motion information as the control point motion information candidate exists in the motion vector candidate list. If the same motion information as the control point motion information candidate does not exist in the motion vector candidate list, the control point motion information candidate is added to the motion vector candidate list.

[0329] For example, the pre-set order is as follows: Affine(CP1,CP2,CP3) → Affine(CP1,CP2,CP4) → Affine(CP1,CP3,CP4) → Affine(CP2,CP3,CP4) → Affine(CP1,CP2) → Affine(CP1,CP3) → Affine(CP2,CP3) → Affine(CP1,CP4) → Affine(CP2,CP4) → Affine(CP3,CP4) There are 10 combinations in total.

[0330] If the control point motion information corresponding to a combination is unavailable, the combination is considered unavailable. If the combination is available, the reference frame index of the combination is determined. For two control points, the smallest reference frame index is selected as the reference frame index of the combination. For more than two control points, the reference frame index with the largest occurrence frequency is selected as the reference frame index of the combination. If multiple reference frame indices have the same occurrence frequency, the smallest reference frame index is selected as the reference frame index. The control point motion vectors are further scaled. If the motion information of all control points after scaling is consistent, the combination is invalid.

[0331] Optionally, in this embodiment of the present application, the motion vector candidate list may be padded. For example, after the above-mentioned scanning process, if the length of the motion vector candidate list is less than the maximum list length MaxAffineNumMrgCand, the motion vector candidate list may be padded until the list length is equal to MaxAffineNumMrgCand.

[0332] The padding can be performed by using a zero motion vector padding method or by combining (e.g., weighted averaging) existing motion information candidates in the existing list. It should be noted that other methods for padding the motion vector candidate list are also applicable to this application.

[0333] Step 603b: Analyze the bitstream to determine optimal control point motion information.

[0334] The index number is analyzed, and the optimal control point motion information is determined from the motion vector candidate list based on the index number.

[0335] Step 604b: Obtain a motion vector for each sub-block in the current block based on the optimal control point motion information and the affine motion model used for the current decoded block.

[0336] This step is similar to step 605a.

[0337] Step 605b: Perform motion compensation for each sub-block based on the determined motion vector of the sub-block to obtain a predicted sample value of the sub-block.

[0338] As previously described, after the motion vectors of each sub-block are obtained in steps 605a and 604b, motion compensation for the sub-blocks is performed in steps 606a and 605b, respectively. That is, details of performing sub-block-based affine motion compensation for the current sub-block of an affine-coded block to obtain predicted sample values ​​of the current sub-block of the affine-coded block are described above. In conventional designs, the size of the sub-blocks is set to 4x4, that is, motion compensation is performed for each 4x4 unit by using respective / different motion vectors. Generally, a smaller sub-block size leads to higher motion compensation calculation complexity and better prediction effect. To consider both the complexity of motion compensation calculation and prediction accuracy, a process for prediction signal refinement (PROF) using optical flow is provided after sub-block-level motion compensation. Exemplary steps of the process are as follows:

[0339] (1) After the motion vector of each sub-block is obtained by using steps 605a and 604b, perform motion compensation for the sub-block by using steps 606a and 605b to obtain the prediction signal I(i,j) of the sub-block. It can be noted that step (1) is not included in the PROF process.

[0340] (2) The horizontal gradient value g of the predicted signal of the sub-block x (i,j) and the vertical gradient value g y (i,j) is calculated as follows. g x (i,j)=I(i+1,j)-I(i-1,j) g y (i,j)=I(i,j+1)-I(i,j-1)

[0341] It can be seen from the equation that a 6x6 prediction signal window 900 is required to obtain the gradient values ​​for a 4x4 block (4x4 gradient values), as shown in Figure 9D.

[0342] This can be done by using different methods: a) After the prediction matrix of the sub-block is obtained based on the motion information (e.g., motion vector) of the sub-block, the horizontal gradient matrix and the vertical gradient matrix of the sub-block are obtained. In other words, (M+2)*(N+2) prediction blocks are obtained through interpolation based on the motion vectors of the M×N sub-blocks. For example, a 6×6 prediction signal is obtained, and interpolation is directly performed based on the motion vectors of the sub-blocks to calculate a 4×4 gradient value (i.e., a 4×4 gradient matrix). b) Perform interpolation based on the motion vectors of the sub-blocks to obtain a 4x4 prediction signal (i.e., a first prediction matrix), and then perform edge extension on the prediction signal to obtain a 6x6 prediction signal (i.e., a second prediction matrix) and calculate a 4x4 gradient value (i.e., a 4x4 gradient matrix). c) Obtain each 4x4 prediction signal (i.e., a first prediction matrix), and perform interpolation based on the motion vector of each sub-block to obtain a w*h prediction signal through combination. Then, perform edge extension on the w*h prediction signal to obtain a (w+2)*(h+2) prediction signal, and calculate w*h gradient values ​​(i.e., a w*h gradient matrix) to obtain each 4x4 gradient value (i.e., a 4x4 gradient matrix).

[0343] It should be noted that directly obtaining the (M+2)*(N+2) prediction block through interpolation based on the motion vectors of M×N sub-blocks includes the following implementation forms.

[0344] a1) For the surrounding area (white samples in Figure 13), the integer sample at the top left corner of the position where the motion vector points is taken. For the inner area (gray samples in Figure 13), the sample at the position where the motion vector points is taken. If the sample is a fractional sample, the sample is obtained through interpolation by using an interpolation filter.

[0345] As shown in Figure 14, A, B, C, and D are integer samples, the motion vector of the MxN subblock is 1 / 16 sample precision, dx / 16 is the horizontal distance between the fractional sample and the integer sample in the upper left corner, and dy / 16 is the vertical distance between the fractional sample and the integer sample in the upper left corner. For the surrounding area, the sample value of A is used as the predicted sample value of the sample position. For the inner area, the predicted sample value of the sample position is obtained through interpolation by using an interpolation filter.

[0346] a2) For the surrounding area (white samples in Figure 13), the integer sample closest to the position pointed by the motion vector is taken. For the inner area (gray samples in Figure 13), the sample at the position pointed by the motion vector is taken. If the sample is a fractional sample, the sample is obtained through interpolation by using an interpolation filter.

[0347] As shown in FIG. 14, the integer sample closest to the position pointed to by the motion vector relative to the surrounding area is selected based on dx and dy.

[0348] a3) For both the surrounding area and the inner area, samples are obtained at the positions indicated by the motion vectors. If the samples are fractional samples, the samples are obtained through interpolation by using an interpolation filter.

[0349] It should be understood that a), b), and c) are three different implementations.

[0350] (3) Calculate the delta forecast value, and the calculation method is as follows: ΔI(i,j)=g x (i,j)*Δv x (i,j)+g y (i,j)*Δv y (i,j)

[0351] (i,j) represents the current sample of the sub-block, Δv(i,j) is the difference between the motion vector of the current sample of the current sub-block and the motion vector of the center sample of the sub-block (as shown in FIG. 10), which may be calculated according to the above formula, and Δv x (i,j) and Δv y(i,j) are the horizontal and vertical offset values ​​of the difference between the motion vector of the current sample of the current sub-block and the motion vector of the center sample of the sub-block. Alternatively, in a simplified method, the motion vector difference between the motion vector of each 2x2 sample block to which the current sample belongs and the motion vector of the center sample of the sub-block can be calculated. In comparison, Δv(i,j): the motion vector difference needs to be calculated for each pixel or sample (e.g., for a 4x4 sub-block, the calculation needs to be performed 16 times). However, in the simplified method, the motion vector difference is calculated for each 2x2 sub-block (e.g., for a 4x4 sub-block, the calculation needs to be performed 4 times). Note that the sub-block here can be a 4x4 sub-block or an MxN sub-block. For example, m here is 4 or more, or n here is 4 or more.

[0352]

number

[0353] For a four-parameter affine model:

[0354]

number

[0355] For a 6-parameter affine model:

[0356]

number

[0357] where (v0x,v0y), (v1x,v1y), and (v2x,v2y) are the motion vectors of the top-left, top-right, and bottom-left control points, and w and h are the width and height of the affine-coded block (CU).

[0358] (4) Perform prediction refinement: I'(i,j)=I(i,j)+ΔI(i,j) where I(i,j) is the predicted value of sample (i,j) of the subblock (i.e., the predicted sample value at position (i,j) in the subblock), ΔI(i,j) is the delta predicted value of sample (i,j) of the subblock, and I'(ij) is the refined predicted sample value of sample (i,j) of the subblock. According to an embodiment of the present disclosure, a prediction refinement using optical flow (PROF) process is conditionally performed to refine sub-block-based affine motion compensated prediction using optical flow, which is described as follows:

[0359] Embodiment 1 The method for obtaining a delta predicted value of a sub-block using optical flow (specifically, the delta predicted value of each sample of the sub-block) may be applied to a unidirectional affine-coded block or a bidirectional affine-coded block. When the method is applied to a bidirectional affine-predicted block, the above-described steps (1) to (4) need to be performed twice, which results in relatively high computational complexity. To reduce the complexity of the method, the present invention provides a constraint for applying PROF. Specifically, the predicted sample value is refined by using this method only when the affine-coded block is a unidirectional affine-coded block.

[0360] At the decoder side, a syntax element obtained by parsing the bitstream indicates uni-prediction or bi-prediction, which can be used to determine whether an affine-coded block is a unidirectional affine-coded block.

[0361] On the encoder side, the structure of B-frame and P-frame is determined by different use cases, and whether uni-prediction or bi-prediction is used in B-frame is determined by RDO.In other words, for B-frame, the encoder side can determine whether uni-prediction or bi-prediction is used for the current affine picture block based on RDO cost.For example, the encoder side tries to select the mechanism that minimizes RDO from forward prediction, backward prediction, and bi-prediction.

[0362] Embodiment 2 To reduce the complexity of the prediction signal refinement using optical flow, the method for obtaining prediction offset values ​​of sub-blocks using optical flow may be used only when the size of the sub-blocks is relatively large. For example, the sub-block size of a unidirectional affine-coded block may be set to 4×4, and the sub-block size of a bidirectional affine-coded block may be set to 8×8, 8×4, or 4×8. In this example, this method is used only when the sub-block size is larger than 4×4. In another example, the sub-block size may be adaptively selected based on information such as the motion vectors of the control points of the affine-coded block, the width and height of the affine-coded block, etc. This method is used only when the sub-block size is larger than 4×4.

[0363] Additionally, in step (2), both methods a) and b) can ensure that the predictions of each 4x4 sub-block of the affine-coded block are independent and can be performed simultaneously. However, method a) increases the complexity of the interpolation calculation. Method b) does not increase the complexity, but the boundary gradient values ​​are obtained through calculations using extended samples, and the accuracy is not high. Method c) can improve the accuracy of the gradient calculation, but there is a dependency between each 4x4 sub-block, that is, the optical flow-based refinement can only be performed when the interpolation of the entire CU is completed.

[0364] As shown in FIG. 9E, to consider both the concurrency and accuracy of gradient calculation, the present disclosure proposes gradient value calculation based on a granularity of 16x16. Assuming that size_w=min(w,16) and size_h=min(h,16), for each size_w*size_h in the affine-coded block, a predictor (predicted sample value) of each 4x4 sub-block in the affine-coded block is calculated, and a size_w*size_h predicted signal is obtained through combination. Then, edge extension is performed on the size_w*size_h predicted signal (e.g., by padding, it is extended outward by two samples) to obtain a (size_w+2)*(size_h+2) predicted signal. To obtain each 4x4 gradient value, a size_w*size_h gradient value is calculated. It should be understood that the amount of samples extended outward in this application is not limited to two samples and is related to the gradient calculation. If the gradient resolution is 3 taps, it is extended outward by two samples. In other words, this concerns the filter for gradient calculation: assuming the amount of taps in the filter is T, the area added or supported around is T / 2 (divisible) * 2.

[0365] 11A illustrates a method for prediction refinement using optical flow (PROF) for affine-coded blocks according to one embodiment, which may be performed by a coding device (such as a decoding device or decoder). The method includes the following steps:

[0366] S1101. Determine that a plurality of optical flow determination conditions are satisfied.

[0367] Here, the optical flow determination conditions may also be referred to as conditions for allowing the application of PROF. If all of the optical flow determination conditions are satisfied, PROF is applied for the current sub-block of the affine-coded block. Examples of optical flow determination conditions are described below. In some examples, the optical flow determination conditions may be replaced with or rephrased as constraints for applying PROF. If the constraints for applying PROF are satisfied, PROF is not applied to the current sub-block of the affine-coded block. In those examples, step S1101 is modified to determine that none of the multiple constraints for applying PROF are satisfied.

[0368] S1102. Perform a PROF process on the current sub-block of the affine-coded block to obtain a refined predicted sample value of the current sub-block of the affine-coded block, and multiple optical flow determination conditions are all satisfied for the affine-coded block. Here, the refined predicted sample value of the current sub-block can be understood as the final predicted sample value of the current sub-block after prediction refinement is applied.

[0369] In step S1102, an optical flow (prediction refinement using optical flow, PROF) process is performed on one or more sub-blocks (e.g., the current sub-block or each sub-block) in the current affine picture block to obtain a delta prediction value (e.g., ΔI(i,j)) for one or more sub-blocks (e.g., the current sub-block or each sub-block) in the current affine picture block.

[0370] Step S1102 involves obtaining a refined predicted sample value of the sub-block (e.g., predicted signal I′(i,j)) based on the delta predicted value of the sub-block (e.g., ΔI(i,j)) and the predicted sample value of the sub-block (e.g., predicted signal ΔI(i,j)).

[0371] Specifically, step S1102 involves obtaining a refined predictor of the current sample in the sub-block (e.g., predicted signal I'(i,j)) based on a delta predicted value of the current sample in the sub-block (e.g., ΔI(i,j)) and a predictor of the current sample in the sub-block (e.g., predicted signal I(i,j)).

[0372] In one possible design, the plurality of optical flow determination conditions include one or more of the following:

[0373] (a) Indication information (e.g., sps_prof_enabled_flag or sps_bdof_enabled_flag) obtained through analysis or derivation indicates that PROF is enabled for the current sequence, picture, slice, or tile group. For example, sps_prof_enabled_flag or sps_bdof_enabled_flag=1. It can be understood that if a constraint for applying PROF is used in S1101 instead of the optical flow determination condition, this condition can be converted into a constraint for applying PROF as follows: (a) Indication information indicates that PROF is disabled for the current sequence, picture, slice, or tile group. For example, sps_prof_disabled_flag or sps_bdof_disabled_flag=1.

[0374] The indication information obtained by parsing a parameter set such as an SPS, a PPS, a slice header, or a tile group header indicates whether PROF is valid for the current sequence, picture, slice, or tile group.

[0375] Specifically, sps_prof_enabled_flag may be used for control, and the syntax and semantics of sps_prof_enabled_flag are as follows:

[0376] [Table 4]

[0377] sps_prof_enabled_flag equal to 0 specifies that prediction refinement optical flow for affine-based motion compensation is disabled. sps_prof_enabled_flag equal to 1 specifies that prediction refinement optical flow for affine-based motion compensation is enabled.

[0378] Alternatively, the sps_bdof_enabled_flag is reused for control.

[0379] It should be understood that in this embodiment, on the premise that the aforementioned condition is satisfied (e.g., the main switch determines to enable PROF), another condition is further derived. In other words, if PROF is valid for the current sequence, picture, slice, or tile group, it is further determined whether the current affine picture block satisfies another optical flow determination condition described below. If PROF is not valid for the current sequence, picture, slice, or tile group, it is not necessary to determine whether the current affine picture block satisfies another optical flow determination condition provided below.

[0380] (b) The derived indication information (e.g., variable fallbackModeTriggered) indicates that the current affine-coded block should be partitioned. For example, fallbackModeTriggered=0. If a constraint for applying PROF is used in S1101 instead of an optical flow determination condition, it can be understood that condition (b) can be converted into a constraint for applying PROF as follows: (b) The derived indication information indicates that the current affine-coded block is not partitioned. For example, fallbackModeTriggered=1.

[0381] The variable fallbackModeTriggered is derived based on the affine parameters, and whether to use PROF depends on fallbackModeTriggered. When fallbackModeTriggered is 1, it indicates that the current affine-coded block should not be partitioned. When fallbackModeTriggered is 0, it indicates that the affine-coded block should be partitioned (e.g., the affine-coded block is partitioned into sub-blocks, e.g., 4x4 sub-blocks). When the current affine-coded block should be partitioned, PROF will be used.

[0382] Specifically, the variable fallbackModeTriggered may be derived by using the following process:

[0383] The variable fallbackModeTriggered is initially set to 1 and is further derived as follows: - Variables bxWX4, bxHX4, bxWX h , bxHX h , bxWX v and bxHX v is derived as follows: maxW4=Max(0,Max(4*(2048+dHorX),Max(4*dHorY,4*(2048+dHorX)+4*dHorY))) (8-775) minW4=Min(0,Min(4*(2048+dHorX),Min(4*dHorY,4*(2048+dHorX)+4*dHorY))) (8-775) maxH4=Max(0,Max(4*dVerX,Max(4*(2048+dVerY),4*dVerX+4*(2048+dVerY)))) (8-775) minH4=Min(0,Min(4*dVerX,Min(4*(2048+dVerY),4*dVerX+4*(2048+dVerY)))) (8-775) bxWX4=((maxW4-minW4)>>11)+9 (8-775) bxHX4=((maxH4-minH4)>>11)+9 (8-775) bxWX h =((Max(0,4*(2048+dHorX))-Min(0,4*(2048+dHorX)))>>11)+9 (8-775) bxHX h =((Max(0,4*dVerX)-Min(0,4*dVerX))>>11)+9 (8-775) bxWX v =((Max(0,4*dVerY)-Min(0,4*dVerY))>>11)+9 (8-775) bxHX v =((Max(0,4*(2048+dHorY))-Min(0,4*(2048+dHorY)))>>11)+9 (8-775) - if inter_pred_idc[xCb][yCb] is equal to PRED_BI and bxWX4*bxHX4 is less than or equal to 225, then fallbackModeTriggered is set equal to 0. - No, bxWX h *bxHX h is 165 or less, and bxWX v *bxHX vIf is less than or equal to 165, then fallbackModeTriggered is set equal to 0.

[0384] (c) The current affine picture block is a uni-predictive affine picture block.

[0385] (d) The size of the sub-blocks in the affine picture block is greater than N×N, where N=4.

[0386] (e) The current affine picture block is a uni-predictive affine picture block, and the size of the sub-blocks in the affine picture block is equal to N×N, where N=4.

[0387] (f) The current affine picture block is a bi-predictive affine picture block, and the size of the sub-blocks in the affine picture block is greater than N×N, where N=4.

[0388] The current affine picture block is the current affine-coded block, and whether the current affine picture block is a uni-predictive affine picture block is determined by using the following method. At the encoder side, based on the rate-distortion criterion RDO, it is decided that uni-prediction is to be used for the current affine picture block.

[0389] The current affine picture block is the current affine decoded block, and whether the current affine picture block is a uni-predictive affine picture block is determined by using the following method. At the decoder side, in AMVP mode, the prediction direction indicator information is used to indicate a single prediction direction (e.g., forward prediction only or backward prediction only), and the prediction direction indicator information is obtained by analyzing the bitstream or through derivation, or On the decoder side, in merge mode, the motion information candidate corresponding to the candidate index in the candidate list includes first motion information corresponding to the first reference frame list, or the motion information candidate corresponding to the candidate index in the candidate list includes second motion information corresponding to the second reference frame list.

[0390] In one possible design, the prediction direction information includes a syntax element inter_pred_idc[x0][y0], inter_pred_idc[x0][y0]=PRED_L0, which is used to indicate forward prediction, inter_pred_idc[x0][y0]=PRED_L1, which is used to indicate backward prediction, or The prediction direction indication information includes predFlagL0 and / or predFlagL1, predFlagL0=1, predFlagL1=0, which is used to indicate forward prediction, predFlagL1=1, predFlagL0=0, which is used to indicate backward prediction.

[0391] It should be noted that the optical flow determination conditions (or constraints for applying PROF) are not limited to the above examples, and additional or different optical flow determination conditions (or constraints for applying PROF) may be set based on different application scenarios. For example, the above conditions (c) to (f) may be replaced with other conditions, such as optical flow determination conditions. PROF may be applied to an affine-coded block if all control point MVs of the affine-coded block are different from each other or different from the constraints for applying PROF. PROF is not applied to an affine-coded block if all control point MVs of the affine-coded block are the same. Optical flow determination conditions, etc.: PROF may be applied to an affine-coded block if the resolution of the current picture and the resolution of the reference picture of the affine-coded block are the same, for example, if RprConstraintsActive[X][refIdxLX] is equal to 0 or the constraints for applying PROF. PROF is not applied to an affine-coded block when the resolution of the current picture and the resolution of the reference picture of the affine-coded block are different from each other, for example, when RprConstraintsActive[X][refIdxLX] is equal to 1.

[0392] In one possible design, in step S1102, performing optical flow (prediction refinement using optical flow, PROF) processing on one or more sub-blocks (e.g., each sub-block or the current sub-block) in the current affine picture block to obtain a delta prediction value (e.g., ΔI(i,j)) for one or more sub-blocks (e.g., each sub-block or the current sub-block) in the current affine picture block may include the following steps:

[0393] Step 1. Obtain a second prediction matrix based on the motion information (eg, motion vector) of a current sub-block in a current affine picture block.

[0394] For example, through interpolation based on the motion vectors of M×N sub-blocks, an (M+2)*(N+2) prediction block (ie, a second prediction matrix) is obtained. Various implementations are given above.

[0395] Step 2. Calculate a horizontal prediction gradient matrix and a vertical prediction gradient matrix based on the second prediction matrix, where the size of the second prediction matrix is ​​equal to or greater than the size of the horizontal prediction gradient matrix and the vertical prediction gradient matrix.

[0396] Step 3. Calculate a delta predicted value (ΔI(i,j)) of the current sample in the sub-block based on the horizontal predicted gradient value of the current sample in the sub-block in the horizontal predicted gradient matrix, the vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and the difference between the motion vector of the current sample in the current sub-block and the motion vector of the center sample of the sub-block.

[0397] Correspondingly, in step S1102, obtaining a refined predicted sample value (e.g., predicted signal I′(i,j)) of a sub-block based on the delta predicted value (e.g., ΔI(i,j)) of the sub-block and the predicted sample value (e.g., predicted signal I(i,j)) of the sub-block includes: The method may include obtaining a refined predicted sample value of the current sample (e.g., predicted signal I'(i,j)) based on the delta predicted value of the current sample in the sub-block (e.g., ΔI(i,j)) and the predicted sample value of the current sample (e.g., predicted signal I(i,j)).

[0398] It should be understood that the predicted sample values ​​of a sub-block (eg, predicted signal I(i,j)) may be an M×N prediction block among (M+2)*(N+2) prediction blocks.

[0399] Regarding step 3, in one implementation, the motion vector difference between the motion vectors of different samples in the current sub-block and the motion vector of the center sample of the sub-block is different. In another implementation, the motion vector difference between the motion vector of the current sample unit (e.g., a 2×2 sample block) including the current sample and the motion vector of the center sample of the sub-block is used as the motion vector difference between the motion vector of the current sample of the current sub-block and the motion vector of the center sample of the sub-block. In other words, to balance processing overhead and prediction accuracy, assuming that both samples A and B are included in the current sample unit, the motion vector difference between the motion vector of the current sample unit (e.g., a 2×2 sample block) and the motion vector of the center sample of the sub-block may be used as the motion vector difference between the motion vector of sample A in the sub-block and the motion vector of the center sample of the sub-block. Also, the motion vector difference between the motion vector of the current sample unit and the motion vector of the center sample of the sub-block may be used as the motion vector difference between the motion vector of sample B in the sub-block and the motion vector of the center sample of the sub-block.

[0400] In one implementation, the second prediction matrix in step 1 above is represented by I1(p,q), where p has a value range of [-1,sbW] and q has a value range of [-1,sbH]; The horizontal prediction gradient matrix is ​​represented by X(i,j), where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]. The vertical prediction gradient matrix is ​​represented by Y(i,j), where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]. sbW represents the width of the current sub-block within the current affine picture block, sbH represents the height of the current sub-block within the current affine picture block, and (x, y) represents the position coordinates of each sample (also called sample) within the current sub-block within the current affine picture block, and the element located at (x, y) may correspond to the element located at (i, j).

[0401] In another possible design, in step 1101, performing optical flow (prediction refinement using optical flow, PROF) processing on one or more sub-blocks (e.g., each sub-block) in the current affine picture block to obtain a delta prediction value (also referred to as a predictor offset value, e.g., ΔI(i,j)) for one or more sub-blocks (e.g., each sub-block) in the current affine picture block includes, as shown in FIG. 12 : S1202. Obtain or generate a second prediction matrix based on the first prediction matrix, where the first prediction matrix (e.g., the first prediction signal I(i,j) or 4x4 prediction) of a sub-block (e.g., each sub-block) corresponds to the predicted sample value of the current sub-block. As shown in Figure 9A, sub-block-based affine motion compensation for the current sub-block of the affine-coded block is performed to obtain the predicted sample value of the current sub-block of the affine-coded block. S1203. Calculate a horizontal prediction gradient matrix and a vertical prediction gradient matrix based on a second prediction matrix, where the size of the second prediction matrix is ​​equal to or greater than the size of the first prediction matrix, the size of the second prediction matrix is ​​greater than the size of the first prediction matrix, and the size of the second prediction matrix is ​​equal to or greater than the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix.

[0402] S1204. Calculate a delta predicted value matrix (e.g., ΔI(i,j) of the predicted signal) of the sub-block based on the horizontal predicted gradient matrix, the vertical predicted gradient matrix, and the motion vector difference between the motion vector of the current sample unit (e.g., the current sample or the current sample block, such as a 2×2 sample block) of the sub-block and the motion vector of the center sample of the sub-block. The step of obtaining a refined predicted sample value (e.g., predicted signal I'(i,j)) of the sub-block based on the delta predicted value (e.g., ΔI(i,j)) of the sub-block and the predicted sample value (e.g., predicted signal I(i,j)) of the sub-block includes: S1205. Obtain a refined third prediction matrix (e.g., prediction signal I'(i,j)) of the sub-block based on the delta prediction value matrix (e.g., ΔI(i,j)) and the first prediction matrix (e.g., prediction signal I(i,j)).

[0403] It should be understood that in this specification, I(i,j) represents the predicted sample value of the current sample in the current sub-block (e.g., the original prediction obtained through motion compensation), ΔI(i,j) represents the delta predicted value of the current sample in the current sub-block, and I'(i,j) represents the refined predicted sample value of the current sample in the current sub-block. For example, original predicted sample value + delta predicted value = refined predicted sample value. It should be understood that obtaining refined predicted sample values ​​of multiple samples (e.g., all samples) in the current sub-block is equivalent to obtaining refined predicted sample values ​​of the current sub-block.

[0404] In different possible implementations, the gradient value may be calculated for each sample, and the delta predicted value may be calculated for each sample. Alternatively, a gradient value matrix may be obtained, and then the delta predicted value may be calculated. This is not limited in this application. In one alternative implementation, the first prediction matrix and the second prediction matrix represent the same prediction matrix.

[0405] When the size of the second prediction matrix is ​​equal to the size of the first prediction matrix and the size of the second prediction matrix is ​​equal to the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix, in one possible implementation, a (w-2)*(h-2) gradient matrix is ​​calculated by using a w*h prediction matrix, and the gradient matrix is ​​padded to obtain a size of w*h, where w*h represents the size of the current sub-block. For example, both the first prediction matrix and the second prediction matrix are prediction matrices whose size is w*h, or the first prediction matrix and the second prediction matrix represent the same prediction matrix.

[0406] As shown in FIG. 11B, another embodiment of the present application provides another method for prediction refinement using optical flow (PROF) for affine-coded blocks, which includes the following steps.

[0407] S1110: It is determined whether a plurality of optical flow determination conditions are met or satisfied, where the optical flow determination conditions refer to conditions for allowing the application of PROF.

[0408] S1111. If multiple optical flow determination conditions are satisfied, a first indicator (e.g., applyProfFlag) is set equal to true, and a prediction refinement using optical flow (PROF) process is performed on the current sub-block of the affine-coded block to obtain refined prediction sample values ​​for the current sub-block of the affine-coded block. In step S1111, an optical flow (prediction refinement using optical flow, PROF) process is performed on one or more sub-blocks (e.g., each sub-block) in the current affine picture block to obtain delta prediction values ​​(also referred to as predictor offset values, e.g., ΔI(i,j)) for the one or more sub-blocks (e.g., each sub-block) in the current affine picture block.

[0409] In step S1111, a refined predicted sample value of the sub-block (e.g., predicted signal I'(i,j)) is obtained based on the delta predicted value of the sub-block (e.g., ΔI(i,j)) and the predicted sample value of the sub-block (e.g., predicted signal I(i,j)).

[0410] It should be understood that in this specification, I(i,j) represents the predicted sample value of the current sample in the current sub-block (e.g., the original predicted sample value obtained through motion compensation), ΔI(i,j) represents the delta predicted value of the current sample in the current sub-block, and I'(i,j) represents the refined predicted sample value of the current sample in the current sub-block. For example, original predicted sample value + delta predicted value = refined predicted sample value. It should be understood that obtaining refined predicted sample values ​​of multiple samples (e.g., all samples) in the current sub-block is equivalent to obtaining refined predicted sample values ​​of the current sub-block.

[0411] It can be understood that when the refined predicted sample values ​​of each sub-block of the affine coded block are generated, the refined predicted sample values ​​of the affine coded block are generated naturally. S1113, when at least one of the plurality of optical flow determination conditions is not met or is not satisfied, a first indicator (e.g., applyProfFlag) is set equal to false, and the PROF process is skipped.

[0412] It may be understood that if constraints for applying PROF are used to determine whether to apply PROF, step S1110 is modified to determine whether any of the constraints for applying PROF are not met. In this case, step S1111 is modified to indicate that if any of the constraints for applying PROF are not met or are not satisfied, a first indicator (e.g., applyProfFlag) is set equal to true, and a prediction refinement using optical flow (PROF) process is performed on the current sub-block of the affine-coded block to obtain refined predicted sample values ​​for the current sub-block of the affine-coded block. Accordingly, step S1113 is modified to indicate that if at least one of the constraints for applying PROF is met, a first indicator (e.g., applyProfFlag) is set equal to false, and the PROF process is skipped.

[0413] In one implementation, if a first indicator (e.g., applyProfFlag) is a first value (e.g., 1), perform optical flow (e.g., PROF) processing on one or more sub-blocks (e.g., each sub-block) in the current affine picture block; or Otherwise, if the first indicator (e.g., applyProfFlag) is a second value (e.g., 0), skip performing optical flow (e.g., PROF) processing on one or more sub-blocks (e.g., each sub-block) in the current affine picture block.

[0414] In some implementations, the value of the first indicator depends on whether optical flow determination conditions are met, where the optical flow determination conditions include one or more of the following: The first indication information (e.g., sps_prof_enabled_flag or sps_bdof_enabled_flag) is used to indicate that PROF is enabled for the current picture unit. Note that in this specification, the current picture unit may be, for example, the current sequence, the current picture, the current slice, or the current tile group. These examples of the current picture unit are not limiting. A second indication (eg, fallbackModeTriggered) is used to indicate partitioning of the current affine picture block. The current affine picture block is a uni-predictive affine picture block. The size of the sub-blocks in the affine picture block is greater than N×N, where N=4. The current affine picture block is a uni-predictive affine picture block, and the size of the sub-blocks in the affine picture block is equal to N×N, where N=4; or The current affine picture block is a bi-predictive affine picture block, and the size of the sub-blocks in the affine picture block is greater than N×N, where N=4.

[0415] It should be noted that the present application includes, but is not limited to, the aforementioned optical flow determination conditions, and additional or different optical flow determination conditions may be set based on different application scenarios.

[0416] In this embodiment of the present application, for example, applyProfFlag is set to 1 when all of the following conditions are met: - sps_prof_enabled_flag==1 - fallbackModeTriggered==0 - inter_pred_idc[x0][y0]=PRED_L0 or PRED_L1 (or predFlagL0=1, predFlagL1=0; or predFlagL1=1, predFlagL0=0) - Other conditions

[0417] In another embodiment, for example, applyProfFlag is set to 1 when all of the following conditions are met: - sps_prof_enabled_flag==1 - fallbackModeTriggered==0 - Other conditions

[0418] It can be understood that if constraints for applying PROF are used in S1110 instead of optical flow determination conditions, applyProfFlag is set to 1 when none of the following constraints are met: - sps_prof_disabled_flag==1 - fallbackModeTriggered==1 - Other conditions

[0419] It should be understood that for details of the execution entities of the steps in the prediction method provided in this embodiment of the present application, as well as the extensions and variations of these steps, please refer to the above description of the corresponding method, and for the sake of brevity, the details will not be described again in this specification.

[0420] Another embodiment of the present application further comprises: Obtaining a first prediction matrix for an M*N block based on motion information (e.g., motion vectors) of multiple sub-blocks in a current affine picture block, where the M*N block is, for example, 16*16 as shown in FIG. 9E, and a 16*16 block (or a 16*16 window) includes, for example, sixteen 4*4 sub-blocks; calculating a horizontal prediction gradient matrix and a vertical prediction gradient matrix based on a second prediction matrix, wherein the size of the second prediction matrix is ​​equal to or greater than the size of the first prediction matrix, and the size of the second prediction matrix is ​​equal to or greater than the sizes of the horizontal prediction gradient matrix and the vertical prediction gradient matrix; Calculating a delta predicted value matrix (e.g., ΔI(i,j) of the predicted signal) of the M*N block based on a horizontal predicted gradient matrix, a vertical predicted gradient matrix, and a motion vector difference between the motion vector of a current pixel unit (e.g., a current pixel or a current pixel block, such as a 2×2 pixel block) in the M*N block and the motion vector of a pixel at the center of the M*N block; and obtaining a refined third prediction matrix (e.g., predicted signal I'(i,j)) for M*N blocks based on the delta prediction value matrix (e.g., ΔI(i,j)) and the first prediction matrix (e.g., predicted signal I(i,j)).

[0421] In another possible design, the first prediction matrix is ​​denoted by I1(i,j), where i has values ​​in the range [0,size_w-1] and j has values ​​in the range [0,size_h-1]; The second prediction matrix is ​​denoted by I2(i,j), where i has a value range of [-1,size_w] and j has a value range of [-1,size_h], where size_w = min(W,m), size_h = min(H,m), and m = 16; The horizontal prediction gradient matrix is ​​represented by X(i,j), where i has a value range of [0,size_w-1] and j has a value range of [0,size_h-1]. The vertical prediction gradient matrix is ​​represented by Y(i,j), where i has a value range of [0,size_w-1] and j has a value range of [0,size_h-1]. W represents the width of the current affine picture block, H represents the height of the current affine picture block, and (x, y) represent the position coordinates of each sample in the current affine picture block.

[0422] It should be understood that, in some examples, as shown in Figure 9E, an affine picture block is implicitly partitioned into 16x16 blocks, and a gradient matrix is ​​calculated for each 16x16 block. Correspondingly, the second prediction matrix is ​​represented by I2(i,j), where i has a value range of [-1, size_w], j has a value range of [-1, size_h], size_w = min(w,m), size_h = min(h,m), and m = 16. The horizontal prediction gradient matrix is ​​represented by X(i,j), where i has a value range of [0, size_w-1], and j has a value range of [0, size_h-1]. The vertical prediction gradient matrix is ​​represented by Y(i,j), where i has a value range of [0, size_w-1], and j has a value range of [0, size_h-1].

[0423] In another possible design, calculating the horizontal and vertical prediction gradient matrices (e.g., size_w*size_h gradient values) based on the second prediction matrix (e.g., (size_w+2)*(size_h+2) prediction signal) may include: calculating a horizontal prediction gradient matrix and a vertical prediction gradient matrix based on a second prediction matrix, the horizontal prediction gradient matrix and the vertical prediction gradient matrix respectively comprising a horizontal prediction gradient matrix and a vertical prediction gradient matrix of the sub-block; The second prediction matrix is ​​denoted by I2(i,j), where i has a value range of [-1,size_w] and j has a value range of [-1,size_h], where size_w = min(W,m), size_h = min(H,m), and m = 16; The horizontal prediction gradient matrix is ​​represented by X(i,j), where i has a value range of [0,size_w-1] and j has a value range of [0,size_h-1]. The vertical prediction gradient matrix is ​​represented by Y(i,j), where i has a value range of [0,size_w-1] and j has a value range of [0,size_h-1]. W represents the width of the current affine picture block, H represents the height of the current affine picture block, and (i, j) represents the position coordinates of each sample in the current affine picture block.

[0424] It can be seen from the above description that the current affine picture block is implicitly partitioned into 16x16 blocks, and a gradient matrix is ​​calculated for each 16x16 block. It should be understood that m=16 is used herein only as an example and should not be construed as limiting. Various other values ​​of m may be used, such as m=32.

[0425] In one possible design, the method is used for uni-prediction, and the motion information includes first motion information corresponding to a first reference frame list or second motion information corresponding to a second reference frame list; the first prediction matrix includes a first initial prediction matrix or a second initial prediction matrix, the first initial prediction matrix is ​​obtained based on the first motion information, and the second initial prediction matrix is ​​obtained based on the second motion information; The horizontal prediction gradient matrix includes a first horizontal prediction gradient matrix or a second horizontal prediction gradient matrix, where the first horizontal prediction gradient matrix is ​​obtained through calculation based on an extended first initial prediction matrix, and the second horizontal prediction gradient matrix is ​​obtained through calculation based on an extended second initial prediction matrix; The vertical prediction gradient matrix includes a first vertical prediction gradient matrix or a second vertical prediction gradient matrix, where the first vertical prediction gradient matrix is ​​obtained through calculation based on the extended first initial prediction matrix, and the second vertical prediction gradient matrix is ​​obtained through calculation based on the extended second initial prediction matrix; The delta prediction matrix includes a first delta prediction matrix corresponding to the first reference frame list or a second delta prediction matrix corresponding to the second reference frame list, where the first delta prediction matrix is ​​obtained through calculation based on a first horizontal prediction gradient matrix, a first vertical prediction gradient matrix, and a first motion vector differential (e.g., forward motion vector differential) of each sample unit in the sub-block relative to a center sample of the sub-block, and the second delta prediction matrix is ​​obtained through calculation based on a second horizontal prediction gradient matrix, a second vertical prediction gradient matrix, and a second motion vector differential (e.g., backward motion vector differential) of each sample unit in the sub-block relative to a center sample of the sub-block.

[0426] In one possible design, the method is used for bi-prediction, and the motion information includes first motion information corresponding to a first reference frame list and second motion information corresponding to a second reference frame list; and the first prediction matrix includes a first initial prediction matrix and a second initial prediction matrix, the first initial prediction matrix is ​​obtained based on the first motion information, and the second initial prediction matrix is ​​obtained based on the second motion information; the horizontal prediction gradient matrix includes a first horizontal prediction gradient matrix and a second horizontal prediction gradient matrix, the first horizontal prediction gradient matrix is ​​obtained through calculation based on an extended first initial prediction matrix, and the second horizontal prediction gradient matrix is ​​obtained through calculation based on an extended second initial prediction matrix; The vertical prediction gradient matrix includes a first vertical prediction gradient matrix and a second vertical prediction gradient matrix, the first vertical prediction gradient matrix being obtained through calculation based on the extended first initial prediction matrix, and the second vertical prediction gradient matrix being obtained through calculation based on the extended second initial prediction matrix; The delta prediction value matrix includes a first delta prediction value matrix corresponding to the first reference frame list and a second delta prediction value matrix corresponding to the second reference frame list, the first delta prediction value matrix being obtained through calculations based on a first horizontal prediction gradient matrix, a first vertical prediction gradient matrix, and a first motion vector differential (e.g., forward motion vector differential) of each sample unit in the sub-block relative to a center sample of the sub-block, and the second delta prediction value matrix being obtained through calculations based on a second horizontal prediction gradient matrix, a second vertical prediction gradient matrix, and a second motion vector differential (e.g., backward motion vector differential) of each sample unit in the sub-block relative to a center sample of the sub-block.

[0427] In one possible design, the method is used for uni-prediction. the motion information includes first motion information corresponding to the first reference frame list or second motion information corresponding to the second reference frame list; The first prediction matrix includes a first initial prediction matrix or a second initial prediction matrix, where the first initial prediction matrix is ​​obtained based on the first motion information, and the second initial prediction matrix is ​​obtained based on the second motion information.

[0428] In one possible design, the method is used for bi-prediction. the motion information includes first motion information corresponding to the first reference frame list and second motion information corresponding to the second reference frame list; the first prediction matrix includes a first initial prediction matrix and a second initial prediction matrix, the first initial prediction matrix is ​​obtained based on the first motion information, and the second initial prediction matrix is ​​obtained based on the second motion information; The step of obtaining a prediction matrix for the sub-block based on the motion information of the sub-block includes: The method includes performing weighted addition on sample values ​​at the same position in the first initial prediction matrix and the second initial prediction matrix to obtain a prediction matrix for the sub-block. It should be understood that before the weighted addition is performed here, the sample values ​​in the first initial prediction matrix and the second initial prediction matrix may be refined separately.

[0429] In another possible design, the PROF process can be described as four steps:

[0430] Step 1) Subblock-based affine motion compensation is performed to generate subblock prediction I(i,j). For example, i has a value from [0,subW+1] or [-1,subW], and j has a value from [0,subH+1] or [-1,subH]. It can be understood that since i has a value from [0,subW+1] and j has a value from [0,subH+1], the top-left sample (or the origin of the coordinate system) is located at (1,1), while since i has a value from [-1,subW] and j has a value from [-1,subH], the top-left sample is located at (0,0).

[0431] Step 2) Spatial gradients of sub-block predictions g x (i,j) and g y (i,j) is calculated at each sample position using a 3-tap filter [-1,0,1]. g x (i,j)=I(i+1,j)-I(i-1,j) g y (i,j)=I(i,j+1)-I(i,j-1)

[0432] Subblock predictions are extended by one sample on each side for gradient computation. To reduce memory bandwidth and complexity, samples on the extended boundaries are copied from the nearest integer sample position in the reference picture. Thus, additional interpolation for the padding area is avoided.

[0433] Step 3) The luma prediction refinement is calculated by the optical flow formula. ΔI(i,j)=g x (i,j)*Δv x (i,j)+g y (i,j)*Δv y (i,j) Here, as shown in Figure 10, Δv(i,j) is the difference between the sample MV calculated for sample position (i,j) denoted by v(i,j) and the sub-block MV of the sub-block to which sample (i,j) belongs.

[0434] In other words, the MV of the central sample of each 4x4 is calculated, and then the MV of each sample of the sub-block is calculated. The difference Δv(i,j) between the MV of each sample and the MV of the central sample can be obtained.

[0435] Because the affine model parameters and the sample position relative to the sub-block center do not change for each sub-block, Δv(i,j) can be calculated for the first sub-block and reused for other sub-blocks in the same CU. Let x and y be the horizontal and vertical offsets from the sample position relative to the sub-block center, and Δv(x,y) can be derived by the following equation:

[0436]

number

[0437] For a four-parameter affine model,

[0438]

number

[0439] For a six-parameter affine model,

[0440]

number

[0441] where (v0x,v0y), (v1x,v1y), (v2x,v2y) are the motion vectors of the top-left, top-right, and bottom-left control points, and w and h are the width and height of the CU.

[0442] Step 4) Finally, the luma prediction refinement is added to the sub-block prediction I(i,j). The final prediction I' is generated as shown in the following equation: I'(i,j)=I(i,j)+ΔI(i,j)

[0443] 15 illustrates an apparatus 1500 for prediction refinement using optical flow (PROF) for affine-coded blocks according to another aspect of the present disclosure. a determining unit 1501 configured to determine that none of a plurality of constraints for applying PROF is satisfied; and a prediction processing unit 1503 configured to perform prediction refinement using optical flow, a PROF process, on the current sub-block of the affine coded block to obtain refined predicted sample values ​​of the current sub-block of the affine coded block. It can be understood that when refined predicted sample values ​​of each sub-block of the affine coded block are generated, refined predicted sample values ​​of the affine coded block are generated naturally.

[0444] In another example, the device 1500 a determining unit 1501 configured to determine that a plurality of optical flow determination conditions are satisfied, where the plurality of optical flow determination conditions refer to conditions that allow the application of PROF; and a prediction processing unit 1503 configured to perform a PROF process on the current sub-block of the affine coded block to obtain refined predicted sample values ​​of the current sub-block of the affine coded block. It can be understood that when refined predicted sample values ​​of each sub-block of the affine coded block are generated, refined predicted sample values ​​of the affine coded block are generated naturally.

[0445] Correspondingly, in one example, the exemplary structure of the apparatus 1500 may correspond to the encoder 20 of Figure 2. In another example, the exemplary structure of the apparatus 1500 may correspond to the decoder 30 of Figure 3.

[0446] In another example, the exemplary structure of the apparatus 1500 may correspond to the inter prediction unit 244 of Figure 2. In another example, the exemplary structure of the apparatus 1500 may correspond to the inter prediction unit 344 of Figure 3.

[0447] It can be understood that the decision unit and prediction processing unit (corresponding to the inter-prediction module) in the encoder 20 or decoder 30 provided in this embodiment of the present application are functional entities for implementing various execution steps included in the corresponding method described above, that is, they have functional entities for completely implementing the steps of the method of the present application and the extensions and variations of these steps. For details, please refer to the above description of the corresponding method. For the sake of brevity, the details will not be described again in this specification.

[0448] The following is a description of the application of the encoding and decoding methods as shown in the above-mentioned embodiments and systems that use them.

[0449] 16 is a block diagram showing a content supply system 3100 for realizing a content distribution service. The content supply system 3100 includes a capture device 3102, a terminal device 3106, and optionally a display 3126. The capture device 3102 communicates with the terminal device 3106 via a communication link 3104. The communication link may include the communication channel 13 described above. The communication link 3104 includes, but is not limited to, WIFI, Ethernet, cable, wireless (3G / 4G / 5G), USB, or any type of combination thereof.

[0450] The capture device 3102 may generate data and encode the data using the encoding method described in the above embodiment. Alternatively, the capture device 3102 may deliver the data to a streaming server (not shown), which then encodes the data and transmits the encoded data to the terminal device 3106. The capture device 3102 may include, but is not limited to, a camera, a smartphone or pad, a computer or laptop, a video conferencing system, a PDA, an in-vehicle device, or any combination thereof. For example, the capture device 3102 may include the source device 12 described above. When the data includes video, the video encoder 20 included in the capture device 3102 may actually perform the video encoding process. When the data includes audio (i.e., voice), the audio encoder included in the capture device 3102 may actually perform the audio encoding process. In some practical scenarios, the capture device 3102 delivers the encoded video data and audio data by multiplexing them together. In other practical scenarios, for example, in a video conferencing system, the encoded audio data and the encoded video data are not multiplexed. The capture device 3102 delivers the encoded audio data and the encoded video data separately to the terminal device 3106 .

[0451] In the content delivery system 3100, a terminal device 3106 receives and plays the encoded data. The terminal device 3106 may be a device capable of receiving and restoring data, such as a smartphone or pad 3108, a computer or laptop 3110, a network video recorder (NVR) / digital video recorder (DVR) 3112, a TV 3114, a set-top box (STB) 3116, a video conferencing system 3118, a video surveillance system 3120, a personal digital assistant (PDA) 3122, an in-vehicle device 3124, or any combination thereof capable of decoding the encoded data mentioned above. For example, the terminal device 3106 may include the destination device 14 described above. When the encoded data includes video, the video decoder 30 included in the terminal device performs video decoding preferentially. When the encoded data includes audio, the audio decoder included in the terminal device performs audio decoding preferentially.

[0452] In a terminal device with a display, for example, a smartphone or pad 3108, a computer or laptop 3110, a network video recorder (NVR) / digital video recorder (DVR) 3112, a TV 3114, a personal digital assistant (PDA) 3122, or an in-vehicle device 3124, the terminal device can provide the decoded data to its display. In a terminal device without a display, for example, an STB 3116, a video conferencing system 3118, or a video surveillance system 3120, an external display 3126 is connected to receive and show the decoded data.

[0453] When each device in this system performs encoding or decoding, a picture encoding device or a picture decoding device as shown in the above-mentioned embodiments may be used.

[0454] 17 is a diagram illustrating an example structure of the terminal device 3106. After the terminal device 3106 receives a stream from the capture device 3102, a protocol progression unit 3202 analyzes the transmission protocol of the stream. The protocol includes, but is not limited to, Real Time Streaming Protocol (RTSP), HyperText Transfer Protocol (HTTP), HTTP Live Streaming Protocol (HLS), MPEG-DASH, Real Time Transport Protocol (RTP), Real Time Messaging Protocol (RTMP), or any kind of combination thereof.

[0455] After the protocol progression unit 3202 processes the stream, a stream file is generated. This file is output to the demultiplexing unit 3204. The demultiplexing unit 3204 can separate the multiplexed data into encoded audio data and encoded video data. As described above, in some practical scenarios, for example, in a video conferencing system, the encoded audio data and encoded video data are not multiplexed. In this situation, the encoded data is sent to the video decoder 3206 and the audio decoder 3208 without going through the demultiplexing unit 3204.

[0456] Through the demultiplexing process, a video elementary stream (ES), an audio ES, and optionally subtitles are generated. A video decoder 3206, which includes the video decoder 30 as described in the above-mentioned embodiment, decodes the video ES by the decoding method as shown in the above-mentioned embodiment to generate video frames, and supplies this data to a synchronization unit 3212. An audio decoder 3208 decodes the audio ES to generate audio frames, and supplies this data to the synchronization unit 3212. Alternatively, the video frames may be stored in a buffer (not shown in Figure Y) before being supplied to the synchronization unit 3212. Similarly, the audio frames may be stored in a buffer (not shown in Figure Y) before being supplied to the synchronization unit 3212.

[0457] The synchronization unit 3212 synchronizes the video and audio frames and provides the video / audio to the video / audio display 3214. For example, the synchronization unit 3212 synchronizes the presentation of video and audio information. The information may be coded in a syntax using timestamps for the presentation of the coded audio and visual data and timestamps for the delivery of the data stream itself.

[0458] If subtitles are included in the stream, the subtitle decoder 3210 decodes the subtitles, synchronizes them with the video and audio frames, and provides the video / audio / subtitles to the video / audio / subtitle display 3216.

[0459] The present invention is not limited to the above-mentioned system, and either the picture encoding device or the picture decoding device in the above-mentioned embodiments may be incorporated into other systems, for example, a car system.

[0460] The mathematical operators used in this application are similar to those used in the C programming language. However, the results of integer division and arithmetic shift operations are more precisely defined, and additional operations, such as exponentiation and division of real values, are defined.

[0461] For the description of the relevant contents, implementation forms of the relevant steps, beneficial effects, etc. in this embodiment, please refer to the corresponding parts above, or simple modifications may be made based on the corresponding parts above, and the details will not be described again here.

[0462] It should be noted that, where no contradiction occurs, some features in any two or more of the above-described embodiments may be combined to form a new embodiment. In addition, some features in any one of the above-described embodiments may be used independently as an embodiment.

[0463] The above mainly describes the solutions provided in the embodiments of the present application from the perspective of methods. To implement the aforementioned functions, corresponding hardware structures and / or software modules for performing the functions are included. In combination with the examples described in the embodiments disclosed herein, those skilled in the art will readily recognize that the units and algorithm steps in the present application can be implemented by hardware or a combination of hardware and computer software. Whether the functions are performed by hardware or by hardware driven by computer software depends on the specific application and design constraints of the technical solutions. For each specific application, those skilled in the art may implement the described functions using different methods, but such implementations should not be considered outside the scope of the present application.

[0464] In the embodiments of the present application, the division of the encoder / decoder into functional modules may be performed based on the above-mentioned method examples. For example, each functional module may be obtained through a division corresponding to each function, or at least two functions may be integrated into one processing module. The integrated module may be implemented in the form of hardware or in the form of a software functional module. It should be noted that in the embodiments of the present application, the division into modules is an example and is merely a logical division of functions. In actual implementation, other division methods may be used.

[0465] While embodiments of the present invention have been described primarily in terms of video coding, it should be noted that coding system 10, encoder 20, and decoder 30 (and correspondingly system 10), as well as other embodiments described herein, may also be configured for processing or coding of still pictures, i.e., processing or coding of individual pictures independent of previous or successive pictures, as in video coding. In general, when picture processing coding is limited to a single picture 17, only inter prediction units 244 (encoder) and 344 (decoder) may not be available. All other functions (also called tools or techniques) of the video encoder 20 and the video decoder 30 may be equally used for still picture processing, e.g., residual calculation 204 / 304, transform 206, quantization 208, inverse quantization 210 / 310, (inverse) transform 212 / 312, partitioning 262 / 362, intra prediction 254 / 354, and / or loop filtering 220, 320, as well as entropy coding 270 and entropy decoding 304.

[0466] Embodiments of, for example, the encoder 20 and the decoder 30, and functions described herein with reference to, for example, the encoder 20 and the decoder 30, may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on a computer-readable medium or transmitted over a communication medium as one or more instructions or code and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which correspond to tangible media such as data storage media, or communication media, which include any medium that facilitates transfer of a computer program from one place to another, for example, according to a communication protocol. In this manner, computer-readable media may generally correspond to (1) tangible computer-readable storage media that are non-transitory, or (2) a communication medium, such as a signal wave or carrier wave. Data storage media 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 implementation of the techniques described in this disclosure. A computer program product may include a computer-readable medium.

[0467] By way of example, and not limitation, such computer-readable storage media may include 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 coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included within the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead cover non-transitory tangible storage media. As used herein, disk and disc include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically and discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

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

[0469] The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). To highlight functional aspects of devices configured to perform the disclosed techniques, various components, modules, or units are described in this disclosure, but they do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or may be provided by a collection of interoperable hardware units including one or more processors as described above in conjunction with appropriate software and / or firmware. [Explanation of symbols]

[0470] 10. Video Coding System 12 Source Devices 13 Communication Channels 14 Destination Device 16 Picture Source 17 Picture Data 18 Preprocessors 19 Preprocessed Picture Data 20 Encoder 21 Encoded Picture Data 22 Communication Interface 28 Communication Interface 30 Decoder 31 Decoded Picture Data 32 Post Processors 33 Post-processed picture data 34 Display Devices 40 Video Coding System 41 Imaging Devices 42 Antenna 43 processors 44 Memory Store 45 Display Devices 46 Processing Circuit 201 Input 203 Picture Block 204 Residual Calculation Unit 205 Residual Blocks 206 Conversion Processing Unit 207 Conversion Factor 208 quantization units 209 Quantized Coefficients 210 Inverse Quantization Unit 211 Dequantized Coefficients 212 Inverse Transformation Processing Unit 213 Reconstructed Residual Blocks 214 Reconstruction Unit 215 reconstructed blocks 220 Loop Filter Unit 221 Filtered Blocks 230 Decoded Picture Buffer 231 decoded pictures 244 Inter Prediction Units 254 intra prediction units 260 Mode Selection Unit 262 division units 265 predicted blocks 266 Syntax Elements 270 Entropy Coding Unit 272 output 304 Entropy Decoding Unit 309 Quantized Coefficients 310 Inverse Quantization Unit 311 Dequantized Coefficients 312 Inverse Transformation Processing Unit 313 Reconstructed Residual Blocks 314 Reconstruction Unit 315 reconstructed blocks 320 Loop Filter 321 Filtered Blocks 330 Decoded Picture Buffer 331 decoded pictures 332 output 344 Inter Prediction Unit 354 Intra Prediction Units 360 mode application unit 365 predicted blocks 366 Syntax Elements 400 Video Coding Device 410 input port 420 Receiver Unit 430 processor 440 Transmitter Unit 450 output ports 460 memory 470 Coding Module 500 devices 502 processor 504 memory 506 Data 508 Operating Systems 510 Application Program 512 Bus 518 Display 900 Predicted Signal Window 1500 equipment 1501 Decision Unit 1503 Prediction Processing Unit 3100 Contents Supply System 3102 Capture Device 3104 Communication Links 3106 Terminal Device 3108 Smartphone / Pad 3110 Computer / Laptop 3112 Network Video Recorder (NVR) / Digital Video Recorder (DVR) 3114 TV 3116 Set-top box (STB) 3118 Video Conference System 3120 Video Surveillance System 3122 Personal Digital Assistant (PDA) 3124 In-Vehicle Devices 3126 Display 3202 Protocol Progression Unit 3204 Demultiplexing Unit 3206 Video Decoder 3208 Audio Decoder 3210 Subtitle Decoder 3212 Synchronous Unit 3214 Video / Audio Display 3216 Video / Audio / Subtitle Display

Claims

1. 1. A method for prediction refinement using optical flow (PROF) for affine coded blocks, comprising: performing a PROF process on a current sub-block of the affine coded block to obtain refined predicted sample values ​​for the current sub-block of the affine coded block, wherein a plurality of constraints for applying PROF are not satisfied for the affine coded block; The step of performing a PROF process on a current sub-block of the affine coded block comprises: performing optical flow processing on the current sub-block to obtain a delta prediction value of a current sample of the current sub-block; obtaining a refined predicted sample value of the current sample based on the delta predicted value of the current sample and a predicted sample value of the current sample of the current sub-block; A method comprising:

2. before the step of performing a PROF process on a current sub-block of the affine coded block, The method of claim 1 , further comprising determining that the plurality of constraints for applying PROF are not satisfied for the affine-coded block.

3. The plurality of constraints for applying PROF are: First indication information indicates that PROF is invalid for a picture including the affine coded block, or first indication information indicates that PROF is invalid for a slice associated with a picture including the affine coded block; and The method of claim 1 or 2, further comprising: a second indication indicating no partitioning of the affine-coded block.

4. The method of claim 1 or 2, wherein one of the constraints for applying PROF is that a variable fallbackModeTriggered is set to 1.

5. performing optical flow processing on the current sub-block to obtain a delta prediction value of a current sample of the current sub-block, obtaining a second prediction matrix, wherein the second prediction matrix is ​​generated based on motion information of the current sub-block; generating a horizontal predicted gradient matrix and a vertical predicted gradient matrix based on the second predicted matrix, wherein the horizontal predicted gradient matrix and the vertical predicted gradient matrix have the same size, and the size of the second predicted matrix is ​​greater than or equal to the size of the horizontal predicted gradient matrix and the vertical predicted gradient matrix; and calculating a delta predicted value of the current sample of the current sub-block based on a horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix, a vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and a difference between a motion vector of the current sample of the current sub-block and a motion vector of a center sample of the sub-block.

6. The step of obtaining a second prediction matrix comprises: generating a first prediction matrix based on motion information of the current sub-block, wherein elements of the first prediction matrix correspond to predicted sample values ​​of the current sub-block; and generating the second prediction matrix based on the first prediction matrix; or The method of claim 5 , comprising generating the second prediction matrix based on the motion information of the current sub-block.

7. The elements of the second prediction matrix are I 1 It is represented by (p,q), where p is in the range [-1,sbW] and q is in the range [-1,sbH]. the elements of the horizontal prediction gradient matrix are represented by X(i,j) and correspond to samples (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; the elements of the vertical prediction gradient matrix are represented by Y(i,j) and correspond to samples (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; 7. The method of claim 5, wherein sbW represents the width of the current sub-block within the affine coded block, and sbH represents the height of the current sub-block within the affine coded block.

8. before the step of performing a PROF process on a current sub-block of the affine coded block, 8. The method of claim 1, further comprising performing sub-block-based affine motion compensation on the current sub-block of the affine-coded block to obtain predicted sample values ​​of the current sub-block.

9. 1. A method for prediction refinement using optical flow (PROF) for affine coded blocks, comprising: performing a PROF process on the current sub-block of the affine coded block to obtain refined predicted sample values ​​for the current sub-block of the affine coded block, wherein a plurality of optical flow determination conditions are satisfied for the affine coded block; The step of performing a PROF process on a current sub-block of the affine coded block comprises: performing optical flow processing on the current sub-block to obtain a delta prediction value of a current sample of the current sub-block; obtaining a refined predicted sample value of the current sample based on the delta predicted value of the current sample and a predicted sample value of the current sample of the current sub-block; A method comprising:

10. before the step of performing a PROF process on a current sub-block of the affine coded block, The method of claim 9 , further comprising determining that the plurality of optical flow decision conditions are satisfied for the affine-coded block.

11. The plurality of optical flow determination conditions include: a first indication indicating that PROF is valid for a picture including the affine-coded block, or a first indication indicating that PROF is valid for a slice associated with a picture including the affine-coded block; and 11. The method of claim 9, further comprising: a second indication indicating that partitioning is applied to the affine-coded block.

12. The method of claim 9 or 10, wherein one of the plurality of optical flow determination conditions is that a variable fallbackModeTriggered is set to 0.

13. performing optical flow processing on the current sub-block to obtain a delta prediction value of a current sample of the current sub-block, obtaining a second prediction matrix, wherein the second prediction matrix is ​​generated based on motion information of the current sub-block; generating a horizontal predicted gradient matrix and a vertical predicted gradient matrix based on the second predicted matrix, wherein the horizontal predicted gradient matrix and the vertical predicted gradient matrix have the same size, and the size of the second predicted matrix is ​​greater than or equal to the size of the horizontal predicted gradient matrix and the vertical predicted gradient matrix; and calculating a delta predicted value of the current sample of the current sub-block based on a horizontal predicted gradient value of the current sample in the horizontal predicted gradient matrix, a vertical predicted gradient value of the current sample in the vertical predicted gradient matrix, and a difference between a motion vector of the current sample of the current sub-block and a motion vector of a center sample of the sub-block.

14. The step of obtaining a second prediction matrix comprises: generating a first prediction matrix based on motion information of the current sub-block, wherein elements of the first prediction matrix correspond to predicted sample values ​​of the current sub-block; and generating the second prediction matrix based on the first prediction matrix; or The method of claim 13 , comprising generating the second prediction matrix based on the motion information of the current sub-block.

15. The elements of the second prediction matrix are I 1 It is represented by (p,q), where p is in the range [-1,sbW] and q is in the range [-1,sbH]. the elements of the horizontal prediction gradient matrix are represented by X(i,j) and correspond to samples (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; the elements of the vertical prediction gradient matrix are represented by Y(i,j) and correspond to samples (i,j) of the current sub-block in the affine-coded block, where i has a value range of [0,sbW-1] and j has a value range of [0,sbH-1]; 15. The method of claim 13 or 14, wherein sbW represents the width of the current sub-block within the affine coded block, and sbH represents the height of the current sub-block within the affine coded block.

16. before the step of performing a PROF process on a current sub-block of the affine coded block, 16. The method of claim 9, further comprising performing sub-block-based affine motion compensation on the current sub-block of the affine-coded block to obtain predicted sample values ​​of the current sub-block.

17. An encoder (20) comprising processing circuitry for performing the method of any one of claims 1 to 16.

18. A decoder (30) comprising processing circuitry for performing the method of any one of claims 1 to 16.

19. 17. A computer program product comprising program code for performing the method of any one of claims 1 to 16.

20. A decoder comprising: one or more processors; and a non-transitory computer-readable storage medium coupled to the processor and storing programming for execution by the processor, the programming, when executed by the processor, configuring the decoder to perform the method of any one of claims 1 to 16.

21. 1. An encoder comprising: one or more processors; and a non-transitory computer-readable storage medium coupled to the processor and storing programming for execution by the processor, the programming, when executed by the processor, configuring the encoder to perform the method of any one of claims 1 to 16.

22. A non-transitory computer readable medium carrying program code that, when executed by a computing device, causes the computing device to perform the method of any one of claims 1 to 16.

Citation Information

Patent Citations

  • Systems, apparatus and methods for inter prediction refinement with optical flow

    WO2020163319A1

  • Calculation of prediction refinement based on optical flow

    WO2020187199A1

  • Method and apparatus for video coding

    WO2020191125A1