Method and apparatus for simplified affine subblock processing for video coding systems

By disabling sub-block-based affine modes in the video encoder or decoder and employing phase-change affine motion compensation, the high computational complexity of existing technologies is addressed, thereby improving coding efficiency.

CN117750033BActive Publication Date: 2026-11-24HFI INNOVATION INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311648114.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-05-31
Filing Date
2020-04-10
Publication Date
2026-11-24
Estimated Expiration
2040-04-10

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies have high computational complexity when using affine mode and sub-block-based affine mode, resulting in poor encoding efficiency.

Method used

In the video encoder or decoder, it is determined whether the current block meets specific conditions. If the conditions are met, the affine mode based on sub-blocks is disabled, and the modified encoding or decoding toolset is used for encoding or decoding. The phase transition affine motion compensation method is adopted to derive the affine motion vector parameters and perform corresponding motion compensation.

Benefits of technology

It reduces the computational complexity of video encoding and decoding, improves encoding efficiency, and reduces the consumption of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117750033B_ABST
    Figure CN117750033B_ABST
Patent Text Reader

Abstract

A method and apparatus for video encoding and decoding using a sub-block-based affine pattern are disclosed. In one method, the sub-block-based affine pattern is disabled if affine backtracking or control point motion vectors are the same, to reduce computational complexity. According to another method for video encoding and decoding using encoding and decoding tools belonging to a set of encoding and decoding tools, a prediction enhancement is derived for pixels of a target sub-block of the current block. This encoding toolset includes Predictive Optical Flow Enhancement (PROF) and Bidirectional Optical Flow Enhancement (BDOF). The step of deriving the prediction enhancement includes: deriving the gradient of the pixel of the target sub-block of the current block, and right-shifting the gradient by a common shift.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-referencing

[0002] This invention is a divisional application of patent application No. 202080028241.0, entitled "Method and Apparatus for Simplified Affine Subblock Processing in Video Encoding and Decoding Systems". Technical Field

[0003] This invention relates to video encoding and decoding using motion estimation and motion compensation. In particular, this invention relates to reducing the complexity of systems that allow affine modes and sub-block-based affine modes. Background Technology

[0004] Various video codec standards have been developed over the past two decades. Newer coding standards utilize more powerful coding tools to improve coding efficiency. High-Efficiency Video Coding (HEVC) is a relatively new coding standard developed in recent years. In HEVC systems, the fixed-size macroblocks of H.264 / AVC are replaced with flexible blocks called Coding Units (CUs). Pixels within a CU share the same coding parameters to improve coding efficiency. CUs can begin with a maximum CU (LCU), which in HEVC is also called a Coding Tree Unit (CTU). In addition to the concept of Coding Units, HEVC introduces the concept of Prediction Units (PUs). Once the hierarchical tree of CUs is partitioned, each leaf CU is further divided into one or more Prediction Units (PUs) based on the prediction type and PU partitioning.

[0005] In most codec standards, self-adjusting inter-frame / intra-frame prediction is used on a block-by-block basis. In inter-frame prediction mode, one or two motion vectors are determined for each block to select a reference block (i.e., single prediction) or two reference blocks (i.e., double prediction). One or more motion vectors are determined and encoded for each individual block. In HEVC, inter-frame motion compensation is supported in two different ways: explicit signaling or implicit signaling. In explicit signaling, predictive coding methods are used to signal the motion vectors of the block (i.e., PU). The motion vector predictor corresponds to the motion vectors associated with the spatial and temporal neighbors of the current block. After the MV predictor is determined, the motion vector difference (MVD) is encoded and transmitted. This mode is also known as AMVP (Advanced Motion Vector Prediction) mode. In implicit signaling, a predictor is selected from a set of candidate predictors as the motion vector for the current block (i.e., PU). Since both the encoder and decoder derive the candidate set and select the final motion vector in the same way, there is no need to signal the MV or MVD in implicit mode. This mode is also known as merge mode. Forming a set of predicted itemsets in merge mode is also known as merging candidate list construction. An index called the merge index is signaled to indicate the predicted item selected as the MV for the current block.

[0006] Motion occurring across images along the time axis can be described by many different models. Assuming A(x, y) is the original pixel at the considered position (x, y), and A'(x', y') is the corresponding pixel of the current pixel A(x, y) at the position (x', y') in the reference image, the affine motion model is described as follows.

[0007] Affine models can describe the rotation and deformation of two-dimensional blocks to transform a square (or rectangle) into a parallelogram. This model can be described as follows:

[0008] x'=a o +a1*x+a2*y, and

[0009] y'=b0+b1*x+b2*y. (1)

[0010] A four-parameter affine prediction method, including affine merging modes, is disclosed in ITU-T13-SG16-C1016, a submission to ITU-VCEG (Lin et al., "Affine transform prediction for next-generation video coding", ITU-U, Study Group 16, Question Q6 / 16, Contribution C1016, September 2015, Geneva, CH). When an affine moving block moves, its motion vector field can be described by two control point motion vectors or the following four parameters, where (vx, vy) represents the motion vector...

[0011] quantity:

[0012] Figure 1A An example of a four-parameter affine model is shown, where, according to having two controls

[0013]

[0014] An affine model of the point motion vectors (i.e., v0 and v1) is used to locate the corresponding reference block 120 of the current block 110. The transformed block is a rectangular block. The motion vector field of each point in this moving block can be described by the following equation:

[0015] or

[0016]

[0017] In the above formula, (V Ox ,v 0y ) is the motion vector of the control point at the top left corner of the block (i.e., v0), and (V 1x V 1y Let v1 be the motion vector of another control point located at the top right corner of the block. When decoding the MV of these two control points, the MV of each 4×4 block of the block can be determined according to the above formula. In other words, the affine motion model of the block can be specified using the two motion vectors at the two control points. Furthermore, although the top left and top right corners of the block are used as two control points, other two control points can also be used. For example... Figure 1B As shown, according to Equation (3), an example of determining the motion vector of the current block for each 4×4 sub-block can be based on the MV of two control points.

[0018] In addition, four variables can be defined as follows:

[0019] dHorX=(v 1x -v OxWhen shifting by 1 bit along the X direction, ) / w→ΔVx,

[0020] dVerX=(v 1y -v 0y When shifting by 1 bit along the X direction, ) / w→ΔVy,

[0021] dHorY=(v 2x -V ox When shifting by 1 bit along the Y direction, ) / h→ΔVx,

[0022] dVerY=(V 2y -V 0y When shifting by 1 bit along the Y direction, ) / h→ΔVy,

[0023] In the ITU-T 13-SG16-C1016 submission, for inter-frame mode coded CUs, when the CU size is equal to or greater than 16×16, an affine flag is signaled to indicate whether affine inter-frame mode is applied. If the current block (e.g., the current CU) is coded in affine inter-frame mode, a list of candidate MVP pairs is constructed using neighboring valid reconstructed blocks. Figure 2 An example is given of the neighboring block set used to derive affine candidates for angle derivation. For example... Figure 2 As shown, Corresponding to the motion vector V0 of the block at the top left corner of the current block 210, this The motion vectors are selected from adjacent blocks a0 (called the top-left block), a1 (called the top-left inner block), and a2 (called the top-left lower block), and Corresponding to the motion vector of block V1 at the upper right corner of the current block 210, this Motion vectors selected from adjacent blocks b0 (referred to as the upper block) and b1 (referred to as the upper right block).

[0024] The submission to ITU-T 13-SG16-C1016 also proposed an affine merging mode. If the current block is a merged coded PU, then the five adjacent blocks are checked ( Figure 3 The A0, A1, B0, B1, and B2 blocks in the table are used to determine whether any of these blocks are encoded in affine inter-frame mode or affine merge mode. If so, the affine_flag is signaled to indicate whether the current PU is in affine mode. When the current PU is applied in affine merge mode, it obtains the first block encoded in affine mode from the effective neighbor reconstructed blocks. The selection order of candidate blocks is from left block (A1), top block (B1), top right block (B0), bottom left block (A0) to top left block (B2). In other words, as shown in the table... Figure 3 As shown, the search order is A1 B1 B0 A0 B2. The affine parameters of the affine-coded block are used to derive v0 and v1 of the current PU. Figure 3 In the example, the neighboring blocks (A0, A1, B0, B1, and B2) of the control points MV used to construct the affine motion model are referred to as the neighboring block set in this disclosure.

[0025] In affine motion compensation (MC), the current block is divided into multiple 4×4 sub-blocks. For each sub-block, the center point (2,2) is used to derive the MV by applying equation (3) to that sub-block. For the MC of the current block, each sub-block performs a 4×4 sub-block translation MC.

[0026] In HEVC, the decoded MVs of each PU are downsampled at a ratio of 16:1 and stored in a temporal MV buffer for MVP derivation in subsequent frames. For a 16×16 block, only the top left 4×4 MVs are stored in the temporal MV buffer, and the stored MVs represent the MVs of the entire 16×16 block.

[0027] Affine optical flow

[0028] When encoding a coding unit (CU) in affine mode, the coding unit is divided into 4×4 sub-blocks, and as follows: Figure 1BAs shown, for each sub-block, a motion vector is derived based on an affine model, and motion compensation is performed to generate the corresponding prediction term. A 4×4 block is used as a sub-block instead of other smaller sizes to achieve a good trade-off between the computational complexity of motion compensation and coding efficiency. To improve encoding efficiency, JVET-N0236 (J. Luo et al., “CE2-related: Prediction refinement with optical flow for affine mode”, Joint Video Experts Team (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 14th Meeting: Geneva, CH, 19-27 March 2019, Document: JVET-N0236) and JVoT-N0261 (K. Zhang et al., “CE2-1.1: Interweaved Prediction for Affine Motion Compensation”, Joint Video Experts Team (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 14th Meeting: Geneva, CH, 19-27 March) were used. Various methods are disclosed in JVET-N0261 (Document: JVET-N0261) and JVET-N0262 (“CE9-related: Disabling DMVR for non equal weight BPWA”, H. Huang et al., Joint Video Experts Team (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 14th Meeting: Geneva, CH, 19-27 March 2019, Document: JVET-N0262).

[0029] In JVET-N0236, to achieve finer motion compensation detail, this submission proposes a method to enhance (refine) sub-block-based affine motion compensation predictions using optical flow. After performing sub-block-based affine motion compensation, the brightness prediction samples are enhanced by adding a difference derived from the optical flow equation. The proposed optical flow prediction enhancement (PROF) is described in the following four steps: Step 1), perform sub-block-based affine motion compensation to generate sub-block predictions I(i,j). Step 2), compute the spatial gradient g of the sub-block prediction at each sample location using a 3-tap filter [-1, 0, 1]. x (i, j) and g y (i, j).

[0030] g y (i,j)=I(i,j+1)-I(i,j-1).

[0031] Sub-block predictions are extended by one pixel on each side for gradient calculation. To reduce memory bandwidth and complexity, pixels on the extended boundary are copied from the nearest integer pixel position in the reference image. This avoids additional interpolation in the filled regions. Step 3) Brightness prediction enhancement is calculated using the optical flow equation.

[0032] ΔI(i,j)=g x (i, j)*Δv x (i, j) + g y (i, j)*Δv y (i, j)

[0033] Among them, such as Figure 4 As shown, Δv(i,j) is the pixel MV (denoted by v(i,j)) calculated for sample position (i,j) and the sub-block MV (denoted by v) of sub-block 420 of block 410 to which pixel (i,j) belongs. SB (412)) difference. Figure 4 In the middle, the motion vector v of sub-block 422 and sub-block 420 is... SB (412) corresponds to the reference sub-block. Reference sub-block 422 represents the reference sub-block generated by the translational motion of block 420. Reference sub-block 424 corresponds to the reference sub-block utilizing PROF. The motion vector of each pixel is enhanced by Δv(i,j). For example, based on the sub-block MV v modified by Δv(i,j)416 SB (412) derives the enhanced motion vector v(i,j)414 of the top left pixel of sub-block 420.

[0034] Since the affine model parameters and the pixel position relative to the sub-block center do not change between sub-blocks, Δ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 pixel position to the sub-block center, respectively. Δv(x,y) can be derived using the following formula:

[0035]

[0036] For a 4-parameter affine model, the parameters c and e can be derived as follows:

[0037]

[0038] For a 6-parameter affine model, the parameters c, d, e, and f can be derived as follows:

[0039]

[0040] Among them, (V) 0x v 0y ), (V 1x V 1y ), (V 2x V 2y ) 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. Step 4), finally, add the brightness prediction enhancement to the sub-block prediction I(i,j). The final prediction is generated as follows:

[0041] I′(i,j)=I(i,j)+ΔI(i,j).

[0042] In JVET-N0261, Figure 5 Another sub-block-based affine mode (interleaved prediction) is proposed. Using interleaved prediction, the coded block 510 is divided into sub-blocks with two different partitioning patterns (520 and 522). Then, two auxiliary predictions (P0 530 and P1 532) are generated through affine motion compensation with the two partitioning patterns. The final prediction 540 is calculated as a weighted sum of the two auxiliary predictions (530 and 532). To avoid motion compensation of 2×H or W×2 block sizes, such as... Figure 6 As shown, interleaving prediction is only applicable to the following regions where the sub-block size is 4×4 for both partitioning patterns.

[0043] According to the method disclosed in JVET-N0261, affine motion compensation based on 2×2 sub-blocks is applied only to single predictions of luminance samples, and the 2×2 sub-block motion field is used only for motion compensation. Storage of the motion vector field used for motion prediction, etc., remains based on 4×4 sub-blocks. If bandwidth constraints are applied, affine motion compensation based on 2×2 sub-blocks is disabled when the affine motion parameters do not meet specific criteria.

[0044] In JVET-N0273 (H. Huang et al., “CE9-related: Disabling DMVR for non equalweight BPWA”, Joint Video Experts Team (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC1 / SC 29 / WG 11, 14th Meeting: Geneva, CH, March 19-27, 2019, Document: JVET-N0262), affine motion compensation based on 2×2 sub-blocks is only applicable to single predictions of luminance samples, and the 2×2 sub-block motion field is used only for motion compensation. If bandwidth constraints are applied, affine motion compensation based on 2×2 sub-blocks is disabled when the affine motion parameters do not meet specific criteria.

[0045] Bidirectional optical flow (BIO)

[0046] Bidirectional optical flow (BIO) is a motion estimation / compensation technique disclosed in JCTVC-C204 (E. Alshina et al., Bi-directional optical flow, Joint CollaboratiVe Team on Video Coding (JCT-VC) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 3rd Meeting: Guangzhou, CN, 7-15 October, 2010, Document: JCTVC-C204) and VCEG-AZ05 (E. Alshina et al., Known tools performance investigation for next generation Video coding, ITU-T SG 16 Question 6, Video Coding Experts Group (VCEG), 52nd Meeting: 19-26 June 2015, Warsaw, Poland, Document: VCEG-AZ05). Figure 7As shown, BIO derives sample-level motion enhancement based on assumptions of optical flow and stable motion, where the current pixel 722 in B-slice (dual prediction slice) 720 is predicted using a pixel in reference image 0 (730) and a pixel in reference image 1 (710). Figure 7 As shown, the current pixel 722 is predicted using the pixel displacement vector 714 of pixel B (712) in reference image 1 (710) and the pixel displacement vector 734 of pixel A (732) in reference image 0 (730). Figure 7 In the model, vx and Vy are pixel displacement vectors along the x and y directions, derived using a bidirectional optical flow (BIO) model. This only applies to truly bidirectional prediction blocks predicted from two reference images corresponding to the previous and next images. In VCEG-AZ05, BIO utilizes a 5×5 window to derive motion enhancement for each sample. Therefore, for an N×N block, motion compensation results and corresponding gradient information for (N+4)×(N+4) blocks are needed to derive sample-based motion enhancement for the N×N block. According to VCEG-AZ05, a 6-tap gradient filter and a 6-tap interpolation filter are used to generate gradient information for BIO. Therefore, the computational complexity of BIO is significantly higher than that of traditional bidirectional prediction. To further improve the performance of BIO, the following method is proposed.

[0047] In regular double prediction in HEVC, the prediction terms are generated using the following formula, where P(0) and P(1) are the prediction terms for list0 and list1, respectively:

[0048]

[0049] In JCTVC-C204 and VECG-AZ05, the BIO prediction term is generated using the following formula:

[0050] vy [ i,j](I y (0) -I y (1) [i, j])+1)>>1

[0051] In the above formula, I x (0) and I x (1) represents the x-direction gradient in the prediction terms of list0 and list1, respectively; I y (0) and I y (1) represents the y-direction gradient in the prediction terms of list0 and list1, respectively; v x and v y These represent the offset or displacement along the x and y directions, respectively. x and v yThe derivation is shown below. First, the cost function is defined as diffCost(x, y) to find the optimal value v. x and v y To find the optimal value v that minimizes the cost function diffCost(x, y). x and v y Use a 5x5 window. x and v y The solutions can be represented by S1, S2, S3, S5 and S6.

[0052]

[0053] The minimum cost function mindiffCost(x, y) can be derived from the following formula:

[0054]

[0055] By solving equations (3) and (4), v can be solved according to the following formula. x and v y :

[0056]

[0057] in,

[0058]

[0059]

[0060]

[0061]

[0062] In the above formula, the gradient in the x-direction corresponds to the pixel at (x, y) in the list 0 image.

[0063] Corresponding to the x-direction gradient of the pixel at (x, y) in the image in list 1,

[0064] Corresponding to the y-direction gradient of the pixel at (x, y) in the image of list 0,

[0065] This corresponds to the y-direction gradient of the pixel at (x, y) in the image in list 1.

[0066] In some related technologies, S2 can be ignored, and v can be solved according to the following formula. x and v y :

[0067]

[0068] in,

[0069]

[0070]

[0071]

[0072] We can observe that BIO processing requires a significant bit depth, especially for calculating S1, S2, S3, S5, and S6. For example, if the bit depth of pixel values ​​in a video sequence is 10 bits, and the bit depth of gradients is increased using fractional interpolation filters or gradient filters, then 16 bits are needed to represent a gradient in the x-direction or y-direction. These 16 bits can be further reduced by a gradient shift of 4, thus requiring 12 bits to represent a gradient value. Even if the gradient size can be reduced to 12 bits through gradient shifting, the bit depth required for BIO operations remains substantial. A 13-bit multiplier is needed to calculate S1, S2, and S5. To obtain S3 and S6, another 13-bit multiplier is required. When the window size is large, more than 32 bits are needed to represent S1, S2, S3, S5, and S6. Summary of the Invention

[0073] A method and apparatus for video encoding and decoding performed by a video encoder or video decoder are disclosed, the video encoder or video decoder utilizing an encoding and decoding toolset including affine modes and sub-block-based affine modes. According to the method, input data associated with a current block is received at the video encoder side, or a video bitstream corresponding to compressed data including the current block is received at the video decoder side, wherein the affine modes and sub-block-based affine modes are enabled for the current block. For the current block, it is determined whether one or more conditions are met. If the one or more conditions are met for the current block, the sub-block-based affine modes are disabled for the current block, and the current block is encoded or decoded using a modified encoding and decoding toolset that does not have the sub-block-based affine modes.

[0074] In one implementation, the condition includes a target condition corresponding to the affine backtracking mode selected for the current block. In another implementation, when the current block uses a 4-parameter affine model, the condition includes a target condition corresponding to the first control point motion vector at the top-left position of the current block being equal to the second control point motion vector at the top-right position of the current block. In yet another implementation, when the current block uses a 6-parameter affine model, the condition includes a target condition corresponding to the first control point motion vector at the top-left position of the current block being equal to the second control point motion vector at the top-right position of the current block, and the first control point motion vector at the top-left position of the current block being equal to the third control point motion vector at the bottom-left position of the current block. Attached Figure Description

[0075] Figure 1A An example of a four-parameter affine model is shown, where the transformation block is still a rectangular block.

[0076] Figure 1B An example is shown where the motion vectors for each 4×4 sub-block are determined by the MV of the current block based on two control points.

[0077] Figure 2 An example of a neighboring block set used to derive affine candidates for angle derivation is shown.

[0078] Figure 3 An example is given of the neighboring block set used to derive the inherited affine candidate.

[0079] Figure 4 An example of sub-block-based affine motion compensation is illustrated, where the motion vector of a single pixel in a sub-block is derived from motion vector augmentation.

[0080] Figure 5 An example of interleaved prediction is illustrated, in which a coded block is divided into sub-blocks using two different partitioning modes, and then two auxiliary predictions are generated through affine motion compensation with the two partitioning modes.

[0081] Figure 6 An example is given for avoiding motion compensation of 2×H or W×2 block size for interleaving prediction, where interleaving prediction is only applied to regions where the sub-block size of the two partitioning patterns is 4×4.

[0082] Figure 7 An example of motion enhancement based on bidirectional optical flow is shown.

[0083] Figure 8An exemplary flowchart illustrating a video coding system according to an embodiment of the present invention utilizes a coding toolset including affine modes and sub-block-based affine modes, wherein the sub-block-based affine mode is disabled when one or more conditions are met for the current block.

[0084] Figure 9 An exemplary flowchart is shown for a video coding system utilizing coding tools belonging to a group of coding tools that include Predictive Optical Flow Enhancement (PROF) and Bidirectional Optical Flow (BDOF), where PROF and BDOF share the same gradient shift. Detailed Implementation

[0085] The following description represents the preferred mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be considered limiting. The scope of the invention is best determined by referring to the appended claims.

[0086] This invention discloses various methods for simplifying sub-block-based affine motion compensation.

[0087] Phase transition affine MC

[0088] During affine MC processing, the current block is divided into multiple N×N (e.g., 4×4) sub-blocks. Block-based translation MC is performed for each sub-block, meaning that the affine model is not used under a 4×4 block. In this invention, an alternative sub-block-based affine mode (phase transition affine MC) is proposed to use the affine model for the MC of sub-blocks instead of using translation MC.

[0089] Before performing MC on an affine subblock, first derive the block MV. Derive one or more affine MV derivation parameters. For example, derive the values ​​of DMvHorX, DMvHorY, DMvVerX, and DMvVerY, where DMvHorX and DMvHorY correspond to the corresponding x and y components of the difference between the two control points MV along the horizontal direction, and DMvVerX and DMvVerY correspond to the corresponding x and y components of the difference between the two control points MV along the vertical direction. Similar to equation (3), DMvHorX can be set to equal (top_right_CPMVx - top_left_CPMVx) << (K - log2BlockWidth) or (top_right_CPMVx - top_left_CPMVx) / width, and DMvHorY can be set to equal (top_right_CPMVy - top_left_CPMVy) << (K - log2BlockWidth) or (top_right_CPMVy - top_left_CPMVy) / width. Many variables in the above and subsequent descriptions do not need to be explained. For example, top_right_CPMVx corresponds to the x-component of the top-left control point MV. When using a 4-parameter affine model, DMvVerX can be set to DmvHorY, and DMvVerY can be set to DMvHorX. When using a 6-parameter affine model, DMvVerX can be set to (bottom_left_CPMVx - top_left_CPMVx) << (K - log2BlockHeight) or (bottom_left_CPMVx - top_left_CPMVx) / height, and DMvVerY can be set to (bottom_left_CPMVy - top_left_CPMVy) << (K - log2BlockHeight) or (bottom_left_CPMVy - top_left_CPMVy) / height. K can be 7 or an integer greater than or equal to the maximum value of log2BlockWidth and log2BlockHeight. To derive the MV of a point (x, y) within the block (where x and y are the point positions associated with the top-left control point MV(top_left_CPMV)), the derived MVx can be equal to Round((top_left_CPMVx << L) + DMvHorX*x + DMvVerX*y + offset X, M); the derived MVy can be equal to Round((top_left_CPMVy << L) + DMvHorY*x + DMvVerY*y + offset Y, M). L can be an integer (e.g., 7) or equal to K, and M can be an integer (e.g., 7) or equal to K.In the above description, "Round()" corresponds to the rounding operation.

[0090] In conventional affine mode MC, when deriving sub-block MV, a translation MC based on an N×N (e.g., 4×4) block is performed. In this invention, the pixel MVs in the N×N sub-block can be different. For example, it is proposed to use different MVx for different rows in the N×N block, and / or to use different MVy for different columns in the N×N block. In one implementation, the MVx of each row is derived using a sample from that row (e.g., the center sample or center point of that row). The MVy of each column is derived using a sample from that column (e.g., the center sample or center point of that column). In another example, during the interpolation process, in the leveling stage, it is proposed to use different MVx for different rows in the N×N block. For each row, different MVx can be used for different samples. In the vertical filtering stage, different MVy is used for different columns in the N×N block. For each column, different MVy can be used for different samples.

[0091] In another implementation, MVx and MVy for each row can be derived by adding one or more offsets to the originally derived subblock MV. In one example, the MVx for each row can be Round(subblock_MVx*Q+A*DMvVerX+offset,M), where A can be associated with the row index. The MVy for each row can be Round(subblock_MVy+B*DMvHorY+offset,M), where B can be associated with the column index. Q can be 128. In the horizontal filtering and vertical filtering stages, the filtering phase for each row and each column / sample is derived from the MVx and MVy for each row / column / sample.

[0092] In one implementation, not every horizontal row or every vertical column needs to have its phase derived. Only a subset of rows or columns need to have their phase derived. For other rows or columns, the filter phase can be the same as one of the derived phases. For example, for rows with indices less than a first threshold, MVx is not derived. The row can use the MVx of adjacent rows. For example, the row can use the MVx of rows with indices equal to the first threshold. In another example, or if the row index is greater than a second threshold, MVx is not derived. The row can use the MVx of adjacent rows. For example, the MVx of rows with indices equal to the second threshold can be used. A similar approach can be applied to column MVy derivation.

[0093] In another implementation, the M×N subblock MC can be divided into two parts. The first part uses a level filter to generate an M×O block, where M can be the subblock width and O can be (subblock height + interpolation filter length - 1). The second part uses a vertical filter to filter this M×O block to generate an M×N block of affine prediction terms. For the first part, an O-row level filter is performed. Each row generates M filtered samples. For each row, MVy is the same, or the integer part of MVy is the same. The MVy of each row can be set to be equal to the MVy of the subblock. The MVx of each row can be Round(subblock_MVx*Q+A*DMvVerX+offset, M), where A can be related to the row index.

[0094] The filter phase for each row can be derived from the MVx of that row, for example, by selecting the filter through the fractional part of MVx. In one example, the MVx of each row can be clipped within, for example, the range of subblock_MVx ± 1 - pel, or the range of [the integer part of subblock_MVx, the integer part of subblock_MVx + 1 - pel], or the range of [the integer part of subblock_MVx, (the integer part of subblock_MVx + 1 - pel - 1 * K)], where K is 1 / 4 - pel, 1 / 8 - pel, 1 / 16 - pel, or 1 / 32 - pel; K can be different for different color components. A vertical filter can be applied when the M×O level-filtered samples are ready. MVy can be different for each column. The MVy of each row can be Round(subblock_MVy * Q + B * DMvHorY + offset, M), where B can be related to the column index. The filter phase for each column can be derived from the MVy of that column, for example, by selecting the filter through the fractional part of the MVy. In one example, the MVy of each column can be restricted / truncated to, for example, the range of subblock_MVy ± 1 - pel, or the range of [the integer part of subblock_MVy, (the integer part of subblock_MVy + 1 - pel)], or the range of [the integer part of subblock_MVy, (the integer part of subblock_MVy + 1 - pel - 1 * K)], where K is 1 / 4 - pel, 1 / 8 - pel, 1 / 16 - pel, or 1 / 32 - pel; K can be different for different color components. In another example, for vertical filter columns, the input filtered samples should be located in the same column of the filtered M×O block. In another example, MV truncation is not applied. Instead, sample padding is applied to fill the reference samples beyond (subblock height + interpolation filter length - 1) filtered samples. In yet another example, the MVy of each row can be the same as subblock_MVy.

[0095] Rounding can be rounded to zero (e.g., rounding offset equal to (1 << (M-1))-1) or rounded away from zero (e.g., rounding offset equal to (1 << (M-1))). In another example, rounding can be a direct right shift without adding a rounding offset. In the proposed method, the number of interpolation filters used is the same as for block-based translation MC. In one implementation, not every horizontal row or every vertical column needs to have its phase derived. Only some rows or some columns need to have their phase derived. For other rows or columns, the filter phase can be the same as one of the derived phases. For example, for rows with an index less than a first threshold, MVx is not derived. The row can use the MVx of adjacent rows. For example, the row can use the MVx of the row with an index equal to the first threshold. In another example, if the row index is greater than a second threshold, MVx is not derived. The row can use the MVx of adjacent rows. For example, the row can use the MVx of the row with an index equal to the second threshold. A similar approach can be applied to column MVy derivation.

[0096] In another implementation, the M×N subblock MC can be divided into two parts. The first part uses a leveling filter to generate an M×O block, where M can be the subblock width and O can be (subblock height + interpolation filter length - 1). The second part uses a vertical filter to filter this M×O block to generate an M×N block of affine prediction terms. For the first part, an O-row leveling filter is performed. Each row generates M filtered samples. For each row, MVy is the same, or the integer part of MVy is the same. The MVy of each row can be set to be equal to the MVy of the subblock. The MVx of each sample can be Round(subblock_MVx*Q+A*DMvVerX+C*DMvHorX+offset,M), where A can be associated with the row index and C can be associated with the column index in the N×N subblock. The filter phase of each sample can be derived from the MVx of each sample, for example, by selecting the filter through the fractional part of MVx. In one example, the MVx of each sample can be restricted / truncated to, for example, the range of row_base_MVx ± 1 - pel, or the range of [the integer part of row_base_MVx, (the integer part of row_base_MVx + 1 - pel)], or the range of [the integer part of row_base_MVx, (the integer part of row_base_MVx + 1 - pel - 1 * K)], where K is 1 / 4 - pel, 1 / 8 - pel, 1 / 16 - pel, or 1 / 32 - pel; K can be different for different color components.

[0097] `row_base_MVx` can be derived using `Round(subblock_MVx*Q+A*DMvVerX+offset, M)` or by using `Mvx` derived via an affine model from a position within the row (e.g., the center of the row). For the desired samples in a filter row, a maximum of `(subblock width + interpolation filter length - 1)` reference samples are required. In one implementation, the first reference sample for each filter in each sample is a contiguous sample (e.g., the subblock width of the contiguous sample). For a leveling filter row, `(subblock width + interpolation filter length - 1)` reference samples are used to generate the subblock width of the filter sample. In another example, for a leveling filter row, the reference samples should be in the same row as the reference image. In one example, the MVx of each row can be restricted / truncated to, for example, the range of subblock_MVx ± 1 - pel, or the range of [the integer part of subblock_MVx, (the integer part of subblock_MVx + 1 - pel)], or the range of [the integer part of subblock_MVx, (the integer part of subblock_MVx + 1 - pel - 1 * K)], where K is 1 / 4 - pel, 1 / 8 - pel, 1 / 16 - pel, or 1 / 32 - pel; K can be different for different color components. In another example, MV truncation is not applied. Instead, sample padding is applied to fill the reference samples beyond (subblock width + interpolation filter length - 1). A vertical filter can be applied when the M×O level-filtered samples are ready.

[0098] The MVy can be different for each sample / column. The MVy for each sample can be Round(subblock_MVy*Q+B*DMvHorY+D*DMvVerY+offset, M), where B can be related to the column index and D can be related to the row index in the N×N subblock. The filter phase for each sample can be derived from the MVy of each sample, for example, by selecting the filter through the fractional part of the MVy. In one example, the MVy for each sample can be restricted / truncated to, for example, the range of subblock_MVy ± 1 - pel, or the range of [the integer part of subblock_MVy, (the integer part of subblock_MVy + 1 - pel)], or the range of [the integer part of subblock_MVy, (the integer part of subblock_MVy + 1 - pel - 1*K)], where K is 1 / 4 - pel, 1 / 8 - pel, 1 / 16 - pel, or 1 / 32 - pel; K can be different for different color components. In another example, the MVy of each sample can be restricted / truncated to, for example, the range of row_base_MVy ± 1 - pel, or the range of [the integer part of row_base_MVy, (the integer part of row_base_MVy + 1 - pel)], or the range of [the integer part of row_base_MVy, (the integer part of row_base_MVy + 1 - pel - 1 * K)], where K is 1 / 4 - pel, 1 / 8 - pel, 1 / 16 - pel, or 1 / 32 - pel; K can be different for different color components. row_base_MVy can be derived by Round(subblock_MVy * Q + B * DMvHorY + offset, M), Round(subblock_MVy * Q + D * DMvVerY + offset, M), or by using the Mvy derived from an affine model using a position in the column (e.g., the center of the column).

[0099] For the desired samples in a filter column, a maximum of (sub-block height + interpolation filter length - 1) filtered samples (from the leveling filter stage) are required. In one implementation, the first reference sample for each filter for each sample is a continuous sample (e.g., the sub-block height of a continuous sample). For a vertical filter column, (sub-block height + interpolation filter length - 1) filtered samples are used to generate the sub-block height of the filter sample. In another example, for a vertical filter column, the input filtered samples should be in the same column of the filtered M×O block.

[0100] In another example, MV truncation is not applied. Instead, sample padding is applied to fill the reference samples beyond the subblock height + interpolation filter length - 1 filtered samples. In another example, the MVy of each row can be the same as subblock_MVy. Rounding can be rounded to zero (e.g., rounding offset equal to (1 << (M-1)) - 1) or rounded away from zero (e.g., rounding offset equal to (1 << (M-1))). In another example, rounding can be a direct right shift without adding a rounding offset.

[0101] In the proposed method, the number of interpolation filters used is the same as that used in block-based translation MC. In one implementation, not every horizontal row or every vertical column needs to have its phase derived. Only a subset of rows or columns need to have their phase derived. For other rows or columns, the filter phase can be the same as one of the derived phases. For example, for rows with indices less than a first threshold, MV is not derived. x The filter phase of each sample can be obtained using the MV of the filter phases of adjacent rows. x For example, using the MV of rows whose index equals the first threshold. x In another example, if the row index is greater than the second threshold, the MV is not derived. x This row can use the MV of each sample in the adjacent rows. x For example, the row can use the MV of the row whose index is equal to the second threshold. x A similar approach can be applied to column MV. y Derivation.

[0102] Simulated RF width constraint

[0103] To reduce complexity, according to one embodiment of the invention, if DMvHorX, DMvHorY, DMvVerX, and / or DMvVerY are too small, the affine sub-block MC can fall back to use a block-based translation MC. In one embodiment, if DMvVerX is too small (e.g., abs(DMvVerX) is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024), a block-based leveling filter (e.g., MVx (the same as sub-block MVx)) is applied. In another embodiment, if DMvHorY is too small (e.g., abs(DMvHorY) is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024), a block-based vertical filter (e.g., MVy (the same as sub-block MVy)) is applied. In another example, if G*DMvVerX+H*DMvHorX is too small (e.g., abs(G*DMvVerX+H*DMvHorX) is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024), then a block-based leveling filter (e.g., MVx (the same as sub-block MVx)) is applied. In another example, if I*DMvHorY+J*DMvVerY is too small (e.g., abs(I*DMvHorY+J*DMvVerY) is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024), then a block-based vertical filter (e.g., MVy (the same as sub-block MVy)) is applied.

[0104] In one implementation, DMvVerX can be normalized by a single bit. This bit can be related to DMvVerY. For example, DMvVerX = (DMvVerX) / (1+DMvVerY) or DMvVerX = (DMvVerX << K) / ((1 << K)+DMvVerY)). DMVHorY can also be normalized by a single bit. This bit can be related to DMvHorX. For example, DMvHorY = (DMvHorY) / (1+DMvHorX) or DMvHorY = (DMvHorY << K) / ((1 << K)+DMvHorX)).

[0105] When the MV values ​​of sub-blocks within a CU are very different, the overlap area of ​​the required reference blocks for each sub-block is small, and a large memory bandwidth is required. Therefore, affine model constraints can be applied according to embodiments of the present invention. For example, a backoff mode can be applied to the affine model when one or more conditions are met or not met. When the backoff mode is applied, the MV values ​​of all sub-blocks are set to the same value. Therefore, the affine-coded CU can be viewed as a translational CU. The entire CU MC can be applied, and the bandwidth can be reduced. The variables bxWX4, bxHX4, and bxWX are derived as follows.h , bxHX h , bxWX v and bxHX v :

[0106] maxW4=Max(0,Max(4*(2048+dHorX),Max(4*dHorY,4*(2048+dHorX)+4*dHorY)))

[0107] minW4=Min(0,Min(4*(2048+dHorX),Min(4*dHorY,4*(2048+dHorX)+4*dHorY)))

[0108] maxH4=Max(0,Max(4*dVerx,Max(4*(2048+dVerY),4*dVerX+4*(2048+dVerY))))

[0109] minH4=Min(0,Min(4*dVerX,Min(4*(2048+dVerY),4*dVerX+4*(2048+dVerY))))

[0110] bxWX4=((maxW4-minw4)>>11)+9

[0111] bxHX4=((maxH4-minH4)>>11)+9

[0112] bxWX h =((Max(0,4*(2048+dHorX))-Min(0,4*(2048+dHorX)))>>11)+9

[0113] bxHX h =((Max(0,4*dVerX)-Min(0,4*dVerX))>>11)+9

[0114] bxWX v =((Max(0,4*dVerY)-Min(0 , 4*dVerY))>>11)+9

[0115] bxHX v =((Max(0,4*(2048+dHorY))-Min(0,4*(2048+dHorY)))>>11)+9

[0116] In the above equation, the variables dHorX, dHorY, dVerX, and dVerY are previously defined. For each reference list, the fallbackMode is derived as follows:

[0117] If double prediction is used for the current CU / PU (inter_pred_idc equals PRED_BI):

[0118] If bxWX4*bxHx4 is less than or equal to 225, then fallbackModeTriggered is set to 0.

[0119] Otherwise, fallbackModeTriggered is set to 1.

[0120] If a single prediction is used for the current CU / PU (inter_pred_idc is not equal to PRED_BI):

[0121] If bxWX h *bxHX h Less than or equal to 165 and bxWX v *bxHX v If the value is less than or equal to 165, then fallbackModeTriggered is set to 0.

[0122] Otherwise, fallbackModeTriggered is set to 1.

[0123] As described above, affine-based motion enhancement methods (or can be viewed as sub-block-based affine modes) (e.g., affine optical flow, interleaved affine MC, and / or phase-change affine MC) can enhance predictions; however, the required computational complexity is enormous. The aforementioned affine-based motion enhancement methods can achieve better performance, especially when the motion vectors of sub-blocks with the same affine model within a CU are not very similar. When the motion vectors of the sub-blocks are very similar, the performance of the above methods deteriorates, but the required computational complexity remains enormous. On the other hand, when the MVs of sub-blocks within a CU are very different, the overlap region of the required reference blocks for each sub-block is small, requiring a large amount of memory bandwidth. Therefore, affine model constraints can be applied. For example, a backoff mode can be applied when one or more conditions are met or not met.

[0124] To reduce computational complexity or the bandwidth required for affine modes, an early termination algorithm is proposed. The concept is to implicitly disable the aforementioned affine-based MV enhancement method when it is permissible and the motion vectors of sub-blocks with the same affine model in a CU are very close or very different. In this case, block-based translation MC or 4×4 / 8×8 / 4×8 / 8×4 block MC is applied.

[0125] The conditions for disabling the above affine-based MV enhancement method may depend on one or a combination of the following: CU width (cuWidth), CU height (cuHeight), the location of the control point MV and / or affine model (topLeftMVx, topLeftMVy, topRightMVx, topRightMVy, botLeftMVx, botLeftMVy, botRightMVx, botRightMVy), prediction mode (single prediction, bi-prediction, merge mode, AMVP mode, skip mode, inherited affine candidate, constructed affine candidate), residual (cbf, non-zero residual), dHorX, dHorY, dVerX, dVerY or any combination of the above, or one or more derived variables derived from one or more of the above values. For example, when abs(topLeftMVx-topRightMVx)<cuWidth*ratio, abs(topLeftMVy-topRightMVy)<cuWidth*ratio, abs(topLeftMVx-botLeftMVx)<cuHeight*ratio, abs(topLeftMVy-botLeftMVy)<cuHeight*ratio, |dHorX|<threshold1, |dHorY|<threshold2, |dVerX|<threshold3, and / or |dVerY|<threshold4 or any combination of the above, the above affine-based MV enhancement method is disabled. Note that the above formula also covers cases where two or more control point motion vectors are the same. For example, if the top-left control point motion vector is the same as the top-right control point motion vector (i.e., topLeftMVx=topRightMVx and topLeftMVy=topRightMVy), then both abs(topLeftMVx-topRightMVx)<(cuWidth*ratio) and abs(topLeftMVy-topRightMVy)<(cuWidth*ratio) are satisfied. Similarly, if the top-left control point motion vector is the same as the bottom-left control point motion vector (i.e., topLeftMVx=botLeftMVx and topLeftMVy=botLeftMVy), then both abs(topLeftMVx-botLeftMVx)<(cuHeight*ratio) and abs(topLeftMVy-botLeftMVy)<(cuHeight*ratio) are satisfied.

[0126] The above mentioned ratio may be signaled explicitly at sequence level, picture level, tile group level, tile level, CTU level, or block level. Alternatively, it is determined implicitly based on video resolution, cuWidth, cuHeight, cuWidth×cuHeight, or prediction direction, affine MV resolution. In another example, the above affine-based MV enhancement method is disabled if abs(botLeftMVx-topRightMVx)<(cuWidth*ratio) and abs(botLeftMVy-topRightMVy)<(cuHeight*ratio). In another example, the above affine-based MV enhancement method is disabled if abs(topLeftMVx-topRightMVx)<(cuWidth*ratio) and abs(topLeftMVy-topRightMVy)<(cuHeight*ratio). In another example, the above method is disabled if abs(topLeftMVx-topRightMVx)+abs(topLeftMVy-topRightMVy)<((cuWidth+cuHeight)*ratio). In another example, the above affine-based MV enhancement method is disabled if abs(botLeftMVx-topRightMVx)+abs(botLeftMVy-topRightMVy)<((cuWidth+cuHeight)*ratio). In another example, the above affine-based MV enhancement method is disabled if abs(topLeftMVx-topRightMVx)<tha, abs(topLeftMVy-topRightMVy)<thb, abs(topLeftMVx-botLeftMVx)<thc, and abs(topLeftMVy-botLeftMVy)<thd. The values of tha, thb, thc, thd, threshold 1, threshold 2, threshold 3, threshold 4 may be signaled explicitly at sequence level, picture level, tile group level, tile level, CTU level, or block level. Alternatively, the values of tha, thb, thc, thd, threshold 1, threshold 2, threshold 3, threshold 4 are determined implicitly based on video resolution, cuWidth, cuHeight, cuWidth×cuHeight, or prediction direction, affine MV resolution.

[0127] In another example, the above affine-based MV enhancement method is disabled when abs(botLeftMVx-topRightMVx) < tha and abs(botLeftMVy-topRightMVy) < thb. In another example, the above affine-based MV enhancement method is disabled when abs(topLeftMVx-topRightMVx) < thc and abs(topLeftMVy-topRightMVy) < thd. In another example, the above affine-based MV enhancement method is disabled when abs(topLeftMVx-topRightMVx) + abs(topLeftMVy-topRightMVy) < tha. In another example, the above method is disabled when abs(botLeftMVx-topRightMVx) + abs(botLeftMVy-topRightMVy) < thb. The values of tha and thb may be signaled explicitly at a sequence level, a picture level, a tile group level, a tile level, a CTU level, or a block level. Alternatively, the values of tha and thb are implicitly determined according to a video resolution, cuWidth, cuHeight, cuWidth×cuHeight, or a prediction direction, an affine MV resolution. Alternatively, only the value of tha is signaled, and the value of thb is derived based on tha and cuWidth or cuHeight. In all the above cases, the “smaller” condition or “<” may be replaced with “greater” or “>”.

[0128] In another embodiment, if the absolute value of the maximum MVD (i.e., (LMVDx, LMVDy)) within a sub-block is smaller than a threshold, the above affine-based MV enhancement method is disabled. In this case, MVDs (i.e., MV differences between pixel MVs and sub-block MVs) at multiple positions of a sub-block (i.e., top-left, top-right, bottom-left, and bottom-right positions of the sub-block) may be calculated. Or only the top-left position and the bottom-right position are calculated. Or only the top-right position and the bottom-left position are calculated. For example, if |LMVDx|+|LMVDy|<th1, the above method is disabled. For example, if |LMVDx+LMVDy|<th1, the above affine-based MV enhancement method is disabled. For example, if (LMVDx^2+LMVDy^2)<th1, the above method is disabled. In another embodiment, if the absolute value of the MVD at the top-left position of the affine model is smaller than a threshold, the above affine-based MV enhancement method is disabled. For example, if |topLeftMVDx|+|topLeftMVDy|<th2, the above method is disabled. For example, if |topLeftMVDx+topLeftMVDy|<th2, the above affine-based MV enhancement method is disabled. For example, if (topLeftMVDx^2+topLeftMVDy^2)<th2, the above affine-based MV enhancement method is disabled. Values of th1 and th2 may be signaled explicitly at a sequence level, a picture level, a tile group level, a tile level, a CTU level, or a block level. Or a value of th is implicitly determined according to a video resolution, cuWidth, cuHeight, cuWidth×cuHeight, or a prediction direction, and an affine MV resolution. In another embodiment, the absolute value of an MVD at a top-right / bottom-left / bottom-right position or any predetermined position in an affine model may also be used to disable the above method. In all the above cases, the "smaller" condition or "<" may be replaced with "larger" or ">".

[0129] Before performing MC on an affine subblock, the block MV is first derived. One or more affine MV derivation parameters are derived. For example, the values ​​of DMvHorX, DMvHorY, DMvVerX, and DMvVerY are derived. Similar to Equation (3), DMvHorX can be set to equal (top_right_CPMVx - top_left_CPMVx) << (K - log2BlockWidth) or (top_right_CPMVx - top_left_CPMVx) / width, and DMvHorY can be set to equal (top_right_CPMVy - top_left_CPMVy) << (K - log2BlockWidth) or (top_right_CPMVy - top_left_CPMVy) / width. When using a 4-parameter affine model, DMvVerX can be set to -DMvHorY, and DMvVerY can be set to DMvHorX. When using a 6-parameter affine model, DMvVerX can be set to (bottom_left_CPMVx - top_left_CPMVx) << (K - log2BlockHeight) or (bottom_left_CPMVx - top_left_CPMVx) / height, and DMvVerY can be set to (bottom_left_CPMVy - top_left_CPMVy) << (K - log2BlockHeight) or (bottom_left_CPMVy - top_left_CPMVy) / height. K can be 7 or an integer greater than or equal to the maximum value of log2BlockWidth and log2BlockHeight. Early termination can also depend on intermediate parameters (i.e., DMvHorX, DMvHorY, DMvVerX, and / or DMvVerY). If DMvHorX, DMvHorY, DMvVerX, and / or DMvVerY are too small, the above methods will be disabled. In one implementation, if DMvHorX / DMvHorY / DMvVerX / DMvVerY is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024. In another implementation, if (DMvHorX - DMvVerX) and / or (DMvHorY - DMvVerY) is too small (e.g., abs(DMvHorX - DMvVerX) is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024), the above method will be disabled.In another example, if (G*DMvVerX+H*DMvHorX) and / or (I*DMvVerY+J*DMvHorY) are too small (e.g., abs(G*DMvVerX+H*DMvHorX) is less than (or less than or equal to) 32, 64, 128, 256, 512, or 1024), the above affine-based MV enhancement method will be disabled. The values ​​of G, H, I, and J can be explicitly signaled at the sequence level, picture level, tile group level, tile level, CTU level, or block level. Alternatively, the values ​​of G, H, I, and J can be implicitly determined based on the video resolution, cuWidth, cuHeight, cuWidth×cuHeight, or prediction direction, affine MV resolution. In all the above cases, the "smaller" condition or "<" can be replaced with "larger" or ">".

[0130] In one implementation, affine flow, interlaced affine MC, and / or phase-change affine MC are disabled when |dHorY| < threshold 2 and |dVerX| < threshold 3. In one implementation, affine flow, interlaced affine MC, and / or phase-change affine MC are disabled when |dHorX| < threshold 1, |dHorY| < threshold 2, |dVerX| < threshold 3, and |dVerY| < threshold 4. In another implementation, affine flow, interlaced affine MC, and / or phase-change affine MC are disabled when |dHorX| < threshold 1. In another implementation, the horizontal filtering portion of affine flow, interlaced affine MC, and phase-change affine MC, and / or phase-change affine MC are disabled when |dHorY| < threshold 2. In yet another implementation, the vertical filtering portion of affine flow, interlaced affine MC, and phase-change affine MC, and / or phase-change affine MC are disabled when |dVerX| < threshold 3. In another implementation, when |dVerY| < threshold 4, affine flow, interleaved affine MC and / or phase transition affine MC are disabled.

[0131] In one implementation, affine flow, interleaved affine MC, and / or phase-change affine MC are disabled when |dHorY| > threshold 2 or |dVerX| > threshold 3. In another implementation, affine flow, interleaved affine MC, and / or phase-change affine MC are disabled when |dHorX| > threshold 1, |dHorY| > threshold 2, |dVerX| > threshold 3, or |dVerY| > threshold 4. In yet another implementation, affine flow, interleaved affine MC, and / or phase-change affine MC are disabled when |dHorX| > threshold 1. In yet another implementation, the horizontal filtering portion of affine flow, interleaved affine MC, and phase-change affine MC, and / or phase-change affine MC are disabled when |dHorY| > threshold 2. In yet another implementation, the vertical filtering portion of affine flow, interleaved affine MC, and phase-change affine MC, and / or phase-change affine MC are disabled when |dVerX| > threshold 3. In another implementation, when |dVerY| > threshold 4, affine flow, interleaved affine MC and / or phase transition affine MC are disabled.

[0132] In all the above cases, the "smaller" condition or "<" can be replaced by "larger" or ">".

[0133] In one implementation, when using fallback mode, affine flow, interlaced affine MC, and / or phase-change affine MC are disabled. Without enhancing affine flow, interlaced affine MC, and / or phase-change affine MC, translation block-based MC is applied.

[0134] In another implementation, the affine-based MV enhancement method described above can be applied depending on the affine MV resolution. For example, the condition can depend on the IMV index, where IMV represents the resolution of the motion vector (e.g., integer, 1 / 2-pel, 1 / 4-pel, etc.). The affine-based MV enhancement method described above can be applied only when the IMV index is equal to zero or not equal to zero. Or, the method can be applied only when the IMV index is not equal to 2 or equal to 2.

[0135] In another example, the above method can also be used to determine the size of the sub-blocks. For example, if the horizontal displacement is too small, an M×N sub-block can be used (where M is greater than or equal to N, for example, 8×4 or 4×2). If the vertical displacement is too small, an N×M sub-block can be used (where M is greater than or equal to N, for example, 4×8 or 2×4).

[0136] In another example, when the motion vectors of the sub-blocks are dissimilar, too much memory bandwidth may be needed to load the reference sample of the affine MC, and the above method is (implicitly) disabled. The above determination method can be changed from ">" to "<" or from "<" to ">".

[0137] In another implementation, when using fallback mode, an N-tap filter is used for interpolation. When not using fallback mode, an M-tap filter is used for interpolation. In one example, for the luminance component, N can be 8 and M can be 6. For the chrominance component, M and N can be 4.

[0138] As described above, PROF is proposed to enhance sub-block-based affine motion compensation predictions using optical flow. After performing sub-block-based affine motion compensation, the brightness prediction samples (or prediction terms) are enhanced by adding a difference derived from the optical flow equation. BIO utilizes the assumptions of optical flow and stable motion to achieve sample-level motion enhancement. This only applies to true bidirectional prediction blocks, which are predicted from two reference frames, one being the previous frame and the other the next. Both methods described above have very similar prediction term enhancement processes for generating enhanced sub-block prediction terms. First, the spatial gradient g of the sub-block prediction is calculated at each sample location using a 3-tap filter [-1, 0, 1]. x (i, j) and g y (i, j). Based on the optical flow equation, the equations derived from v are given respectively. x and v y This represents the offsets in the x and y directions. Finally, the brightness prediction enhancement is calculated using the following optical flow equation:

[0139] ΔI(i,j)=g x (i, j)*Δv x (i, j) + g y (i, j)*Δv y (i, j).

[0140] For hardware-friendly implementation, if the bit depth control between PROF and BDOF is similar, the luminance prediction term enhancement calculation circuits in PROF and BDOF can be unified.

[0141] For gradient calculations, PROF, as proposed in JVET-N0236, uses 1 / 16-intensity precision (e.g., 14 bits if the intensity bit depth is set to 10 bits), while BDOF uses 4-intensity precision (e.g., 8 bits). After VTM-5.0 adopted JVET-N0325, the derivation offset v of BDOF... x and v y The bit depth will be truncated to 6 bits. However, according to JVET-N0236, the derived offset in PROF is designed to be truncated to 16 bits with a precision of 1 / 32 pixel. In PROF, the final luminance prediction enhancement will be truncated to 14 bits.

[0142] Below are some proposed methods for modifying PROF bit depth control to simplify computational complexity.

[0143] Method 1. Limit the gradient range in PROF

[0144] In one implementation, the gradient range is limited to a predetermined bit depth. If the gradient is greater than the allowed maximum value or less than the allowed minimum value, the gradient is truncated to the allowed value. For example, the gradient range could be limited to 10 bits. In another implementation, the gradient range could be limited to 8 bits. Depending on the input bit depth, this range can be an implicit predefined value or explicitly signaled to the decoder at the sequence, image, or slice level. In another implementation, the predefined value matches the BDOF or is based on the BDOF to add an offset. In another implementation, PROF processing is skipped when the gradient is greater than the allowed maximum value or less than the allowed minimum value. In yet another implementation, data with gradients greater than the allowed maximum value or less than the allowed minimum value are not used in the PROF processing to derive the offset v. x and v y And those pixels are not enhanced by PROF.

[0145] In another implementation, after the intensity gradient is calculated, the PROF gradient is shifted right by 6. This right shift value can match the BDOF gradient calculation, be derived by adding an offset to the right shift value of the BDOF gradient calculation, or depend on the input bit depth. In another implementation, the gradient can be shifted right first and then truncated to a predefined range. For example, if the predefined range is 9 bits, the gradient can be shifted right by 3 and then truncated to 9 bits. In yet another implementation, the gradient can be limited to a range based on the MSB (most significant bit) to avoid significant gradient information loss. For example, the gradient can be limited to 8 bits. In this case, only the 8 bits after the first MSB will be retained.

[0146] Method 2. Limit the offset v in PROF x and v y Range of (displacement)

[0147] We propose limiting the PROF shift range to a predefined bit depth. In one implementation, if the shift is greater than the maximum allowed value or less than the minimum allowed value, the shift is truncated to the allowed value. For example, we can limit the shift range to 6 bits. Alternatively, we can limit the shift range to 8 bits. Depending on the input bit depth, this range can be an implicit predefined value or explicitly signaled to the decoder at the sequence, picture, or slice level. Alternatively, the predefined bit depth can be designed in the same manner as the BDOF shift calculation, or it can be derived by adding an offset to the bit depth calculated by the BDOF shift. In another implementation, the shift can be first right-shifted and then truncated to a predetermined range. For example, if the predefined range is 6 bits, the shift can be right-shifted by 3 bits and then truncated to 6 bits. In yet another implementation, the shift can be limited to a range based on the MSB to avoid losing significant shift information. For example, the shift derived from PROF can be limited to 6 bits. In this case, only the first 6 bits after the first MSB will be retained. In another implementation, the displacement can be shifted to the right first, and then truncated to a predefined range. After the final brightness enhancement is derived using the following formula, the enhancement value will be shifted to the left:

[0148] ΔI(i,j)=g x (i, j)*Δv x (i, j) + g y (i, j)*Δv y (i, j).

[0149] For example, the derived displacement is first shifted right by 1 bit to a lower precision value, and then truncated to 6 bits. This displacement is then multiplied by the intensity gradient to derive the luminance enhancement, and shifted left by 1 bit. Depending on the input bit depth, the number of bits shifted right before truncation can be a predefined value or explicitly signaled to the decoder at the sequence, picture, or slice level. The number of bits shifted right before truncation can depend on the bit depth of the BDOF displacement calculation, or it can be derived by adding an offset to the bit depth of the BDOF displacement calculation.

[0150] Method 3. Eliminate the limitation of final brightness enhancement in PROF

[0151] To reuse the BDOF circuitry in the PROF, the final brightness enhancement derived from the PROF can be removed. In one implementation, some bit depth constraints can be added to the PROF during gradient calculation or displacement derivation.

[0152] Method 4. Conditionally enable PROF

[0153] To avoid additional circuitry for PROF, PROF can be conditionally enabled. In one implementation, PROF can only be enabled when both BDOF and affine circuitry are enabled.

[0154] Any of the methods proposed above can be implemented in the encoder and / or decoder. For example, any of the methods proposed above can be implemented in the affine inter-frame prediction module of the encoder and / or decoder. Alternatively, any of the methods proposed above can be implemented as circuitry coupled to the affine inter-frame prediction module of the encoder and / or decoder.

[0155] Figure 8 An exemplary flowchart illustrating a video coding system according to an embodiment of the present invention utilizes a coding toolset including affine modes and sub-block-based affine modes, wherein the sub-block-based affine modes are disabled when one or more conditions are met for the current block. The steps shown in the flowchart can be implemented as code executable on one or more processors (e.g., one or more CPUs) on the encoder side. The steps shown in the flowchart can also be implemented based on hardware (such as one or more electronic devices or processors arranged to perform the steps in the flowchart). According to the method, in step 810, input data associated with the current block is received on the video encoder side, or a video bitstream corresponding to compressed data including the current block is received on the video decoder side, wherein affine modes and sub-block-based affine modes are enabled for the current block. In step 820, it is determined whether one or more conditions are met for the current block. If the one or more conditions are met for the current block (i.e., from the "yes" path of step 820), steps 830 and 840 are executed. Otherwise (i.e., from the "No" path of step 820), skip steps 830 and 840. In step 830, sub-block-based affine mode is disabled for the current block. In step 840, the current block is encoded or decoded using a modified encoding / decoding toolset that does not have sub-block-based affine mode.

[0156] Figure 9An exemplary flowchart illustrates a video coding system utilizing codec tools belonging to a group of codec tools including Predictive Optical Flow Enhancement (PROF) and Bidirectional Optical Flow (BDOF), where PROF and BDOF share the same gradient shift. According to the method, in step 910, input data associated with the current block in the current image is received, wherein the input data corresponds to the transform block of the current block on the video encoder side and to the decoded and quantized transform block of the current block on the video decoder side. In step 920, the current codec tool for the current block is determined. In step 930, it is determined whether the current codec tool corresponds to either PROF or BDOF. If the current codec tool corresponds to either PROF or BDOF (i.e., from the "yes" path of step 930), then in step 940, it is further tested whether the current codec tool corresponds to both PROF and BDOF. If the current codec tool corresponds to PROF, the process proceeds to step 950. If the current encoding tool corresponds to BDOF, the process proceeds to step 960. If the current encoding tool does not correspond to either PROF or BDOF (i.e., from the "No" path of step 930), the process proceeds to "End". In step 950, based on PROF, a first prediction enhancement is derived for the pixels of the target sub-block of the current block, the derivation of the first prediction enhancement including: deriving a first gradient of the pixels of the target sub-block of the current block, and right-shifting the first gradient by a common shift. In step 952, an enhanced sub-block prediction is generated based on the first prediction enhancement and the sub-block prediction generated by the sub-block motion vector. In step 954, the target sub-block is encoded or decoded based on the enhanced sub-block prediction. In step 960, based on BDOF, a second prediction enhancement is derived for the pixels of the target sub-block of the current block, wherein the derivation of the second prediction enhancement includes: deriving a second gradient of the pixels of the target sub-block of the current block, and right-shifting the second gradient by a common shift. In step 962, an enhanced sub-block prediction term is generated based on the second prediction term enhancement and the sub-block prediction term generated by the sub-block motion vector. In step 964, the target sub-block is encoded or decoded based on the enhanced sub-block prediction term.

[0157] The flowchart shown is intended to illustrate an example of a video according to the invention. Those skilled in the art can modify, rearrange, divide, or combine the steps to practice the invention without departing from its spirit. In this disclosure, specific syntax and semantics have been used to illustrate examples of implementing embodiments of the invention. Those skilled in the art can practice the invention by utilizing equivalent syntax and semantics to replace the syntax and semantics without departing from its spirit.

[0158] The above description is presented to enable those skilled in the art to practice the invention as provided in the context of a particular application and its requirements. Various modifications to the described embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments. Therefore, the invention is not intended to be limited to the specific embodiments shown and described, but is given the broadest scope consistent with the principles and novel features disclosed herein. Various specific details have been illustrated in the above detailed description to provide a thorough understanding of the invention. However, those skilled in the art will understand that the invention is practicable.

[0159] The embodiments of the present invention described above can be implemented in various hardware, software code, or combinations thereof. For example, embodiments of the present invention may be circuitry integrated into a video compression chip or program code integrated into video compression software to perform the processes described herein. Embodiments of the present invention may also be program code to be executed on a digital signal processor (DSP) to perform the processes described herein. The present invention may also relate to numerous functions performed by a computer processor, digital signal processor, microprocessor, or field-programmable gate array (FPGA). These processors may be configured to perform specific tasks according to the present invention by executing machine-readable software code or firmware code that defines the specific methods embodied in the present invention. The software code or firmware code may be developed in different programming languages ​​and in different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, software code styles and languages, and other means of configuring the code to perform the tasks according to the present invention will not depart from the spirit and scope of the present invention.

[0160] The invention may be practiced in other specific forms without departing from the spirit or essential characteristics thereof. The described examples should be considered illustrative rather than restrictive in all respects. Therefore, the scope of the invention is indicated by the appended claims rather than the foregoing description. All modifications falling within the equivalent meaning and scope of the claims should be included within their scope.

Claims

1. A method for prediction of video encoding / decoding performed by a video encoder or video decoder, the video encoder or video decoder utilizing an encoding / decoding toolset including affine modes and sub-block-based affine modes, the method comprising: The input data associated with the current block is received on the video encoder side, or a video bitstream corresponding to compressed data including the current block is received on the video decoder side, wherein the affine mode and the sub-block-based affine mode are allowed for the current block. For the current block, determine whether one or more conditions are met; If one or more of the conditions are satisfied for the current block, then: For the current block, disable the sub-block-based affine mode; and The current block is encoded or decoded using a modified encoding / decoding toolset that does not have the aforementioned sub-block-based affine mode; The one or more conditions mentioned therein include two or more control points of the current block having the same motion vector; The one or more conditions include a target condition corresponding to the motion vector of the first control point at the upper left position of the current block being equal to the motion vector of the second control point at the upper right position of the current block.

2. The prediction method for video encoding and decoding according to claim 1, characterized in that, The one or more conditions include target conditions corresponding to the first control point motion vector at the upper left position of the current block being equal to the second control point motion vector at the upper right position of the current block and the first control point motion vector at the upper left position of the current block being equal to the third control point motion vector at the lower left position of the current block.

3. The prediction method for video encoding and decoding according to claim 1, characterized in that, The one or more conditions include topLeftMVx = topRightMVx, topLeftMVy = topRightMVy, topLeftMVx = bottomLeftMVx, and topLeftMVy = bottomLeftMVy, where topLeftMVx represents the x-component of the motion vector at the top left position of the current block, topRightMVx represents the x-component of the motion vector at the top right position of the current block, topLeftMVy represents the y-component of the motion vector at the top left position of the current block, topRightMVy represents the y-component of the motion vector at the top right position of the current block, bottomLeftMVx represents the x-component of the motion vector at the bottom left position of the current block, and bottomLeftMVy represents the y-component of the motion vector at the bottom left position of the current block.

4. The prediction method for video encoding and decoding according to claim 1, characterized in that, The one or more conditions include topLeftMVx = topRightMVx and topLeftMVy = topRightMVy, where topLeftMVx represents the x-component of the motion vector at the top left position of the current block, topRightMVx represents the x-component of the motion vector at the top right position of the current block, topLeftMVy represents the y-component of the motion vector at the top left position of the current block, and topRightMVy represents the y-component of the motion vector at the top right position of the current block.

5. The prediction method for video encoding and decoding according to claim 1, characterized in that, The sub-block-based affine mode corresponds to the optical flow prediction enhancement (PROF) mode.

6. The prediction method for video encoding and decoding according to claim 1, characterized in that, If one or more of the conditions are met for the current block, then the current block is encoded or decoded using the affine pattern.

7. An apparatus for prediction of video encoding / decoding performed by a video encoder or video decoder, the video encoder or video decoder utilizing an encoding / decoding toolset including affine modes and sub-block-based affine modes, the apparatus comprising one or more electronic circuits or processors arranged to: The system receives input data related to the current block on the video encoder side, or receives a video bitstream corresponding to compressed data including the current block on the video decoder side, wherein... For the current block, both the affine mode and the sub-block-based affine mode are allowed; For the current block, determine whether one or more conditions are met; If one or more of the conditions are satisfied for the current block, then: For the current block, disable the sub-block-based affine mode; and The current block is encoded or decoded using a modified encoding / decoding toolset that does not have the aforementioned sub-block-based affine mode; The one or more conditions mentioned therein include two or more control points of the current block having the same motion vector; The one or more conditions include a target condition corresponding to the motion vector of the first control point at the upper left position of the current block being equal to the motion vector of the second control point at the upper right position of the current block.

8. The device for predicting video encoding and decoding according to claim 7, characterized in that, The one or more conditions include target conditions corresponding to the first control point motion vector at the upper left position of the current block being equal to the second control point motion vector at the upper right position of the current block and the first control point motion vector at the upper left position of the current block being equal to the third control point motion vector at the lower left position of the current block.

9. The device for predicting video encoding and decoding according to claim 7, characterized in that, The one or more conditions include topLeftMVx = topRightMVx, topLeftMVy = topRightMVy, topLeftMVx = bottomLeftMVx, and topLeftMVy = bottomLeftMVy, where topLeftMVx represents the x-component of the motion vector at the top left position of the current block, topRightMVx represents the x-component of the motion vector at the top right position of the current block, topLeftMVy represents the y-component of the motion vector at the top left position of the current block, topRightMVy represents the y-component of the motion vector at the top right position of the current block, bottomLeftMVx represents the x-component of the motion vector at the bottom left position of the current block, and bottomLeftMVy represents the y-component of the motion vector at the bottom left position of the current block.

10. The device for predicting video encoding and decoding according to claim 7, characterized in that, The one or more conditions include topLeftMVx = topRightMVx and topLeftMVy = topRightMVy, where topLeftMVx represents the x-component of the motion vector at the top left position of the current block, topRightMVx represents the x-component of the motion vector at the top right position of the current block, topLeftMVy represents the y-component of the motion vector at the top left position of the current block, and topRightMVy represents the y-component of the motion vector at the top right position of the current block.