Method and device for encoding and decoding video data and computer readable storage medium

By introducing linear pattern prediction and multiple motion vector prediction algorithms into video encoding and decoding, the video encoding and decoding process is optimized, solving the problem of low efficiency in high-resolution video encoding and decoding, achieving more efficient encoding and decoding and lower bandwidth requirements, and improving video quality and robustness.

CN118694931AActive Publication Date: 2024-09-24DOUYIN VISION CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410747715.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-11-05
Filing Date
2019-11-05
Publication Date
2024-09-24
Estimated Expiration
2039-11-05

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies have room for improvement in encoding and decoding efficiency and bandwidth utilization when processing high-resolution video. Especially with the increasing demand for high-resolution video, existing standards are struggling to effectively optimize the encoding and decoding process to reduce bandwidth requirements and improve video quality.

Method used

By introducing a linear mode prediction method into the video encoding and decoding process, and utilizing image sequence counting parameters and gradient differences, the prediction mode selection is refined to avoid inapplicable prediction modes. Combined with various motion vector prediction algorithms such as ATMVP, STMVP, and BDOF, the motion estimation and compensation process is optimized, thereby improving encoding and decoding efficiency.

Benefits of technology

It improves the compression performance and encoding/decoding efficiency of video encoding and decoding, reduces bandwidth requirements, enhances video quality and encoding complexity, strengthens robustness to data loss and errors, simplifies the editing process, and reduces end-to-end latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004886907340000151
    Figure BDA0004886907340000151
  • Figure BDA0004886907340000152
    Figure BDA0004886907340000152
  • Figure BDA0004886907340000171
    Figure BDA0004886907340000171
Patent Text Reader

Abstract

The invention relates to a method and device for encoding and decoding video data and a computer readable storage medium. The method includes determining whether a first prediction mode can be applied based on picture order count (POC) parameters associated with pictures of a current video block of the video, in which prediction samples of the current video block are refined based at least on gradients in different directions; performing conversion between the current video block and the bitstream based on the determination; a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including a current video block, tau 0 is a difference between a picture order count of the current picture and a picture order count of the first reference picture (tau 0 = POC (current)-POC (R0)), tau 1 is a difference between a picture order count of the second reference picture and a picture order count of the current picture (tau 1 = POC (R1)-POC (current)), in response to abs (abs (tau0)-abs (tau1)) > = T0, avoiding enabling the first prediction mode, T0 being an integer and greater than 0, or in response to abs (tau0) gt; abs (tau1) * T0 or abs (tau1) gt; abs (tau0) * T0, avoiding enabling the first prediction mode, T0 being an integer and T0 = 1.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application number 201980072654.6, application date November 5, 2019, and invention name “Inter-frame prediction with refinement in video processing”.

[0002] CROSS-REFERENCE TO RELATED APPLICATIONS

[0003] This application timely claims priority and the benefit of International Patent Application No. PCT / CN2018 / 113928 filed on November 5, 2018, pursuant to applicable patent law and / or the rules applicable to the Paris Convention. The entire disclosure of the above application is incorporated by reference as part of the disclosure of this application for all purposes under U.S. law. Technical Field

[0004] This patent document relates to video coding and decoding technology, equipment and systems. Background Art

[0005] Despite advances in video compression, digital video still accounts for the largest use of bandwidth on the Internet and other digital communications networks. As the number of connected user devices capable of receiving and displaying video increases, the bandwidth required for digital video usage is expected to continue to grow. Summary of the invention

[0006] The present disclosure relates to devices, systems and methods related to digital video coding, and in particular, describes coordination of linear mode prediction for video coding. The described methods can be applied to existing video coding standards (e.g., High Efficiency Video Coding (HEVC)) and future video coding standards or video codecs.

[0007] In one representative aspect, the disclosed technology can be used to provide a method for encoding and decoding video data, comprising: determining whether a first prediction mode can be applied based on one or more picture order count (POC) parameters associated with a picture of a current video block of a video, wherein in the first prediction mode, prediction samples of the current video block are refined based on at least gradients in different directions; based on the determination, performing conversion between the current video block and a bitstream of the video; wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current video block, wherein τ0 is a ratio of the picture order count of the current picture to the POC of the current picture; The difference between the picture order counts of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is the difference between the picture order count of the second reference picture and the picture order count of the current picture (τ1=POC(R1)-POC(current)), in response to abs(abs(τ0)-abs(τ1))≥T0, avoid enabling the first prediction mode, wherein T0 is an integer and T0 is greater than 0, or in response to abs(τ0)>abs(τ1)×T0 or abs(τ1)>abs(τ0)×T0, avoid enabling the first prediction mode, wherein T0 is an integer and T0=1.

[0008] In another representative aspect, the disclosed technology may be used to provide an apparatus in a video system, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement the above method.

[0009] In another representative aspect, the disclosed technology can be used to provide a computer program product stored on a non-transitory computer-readable medium, the computer program product comprising program code for performing the above method.

[0010] In another representative aspect, the disclosed technology can be used to provide an apparatus for encoding and decoding video data, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to: determine whether a first prediction mode can be applied based on one or more picture order count (POC) parameters associated with a picture of a current video block of a video, wherein in the first prediction mode, prediction samples of the current video block are refined based on at least gradients in different directions; based on the determination, perform conversion between the current video block and a bitstream of the video; wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current video block , wherein τ0 is the difference between the picture order count of the current picture and the picture order count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is the difference between the picture order count of the second reference picture and the picture order count of the current picture (τ1=POC(R1)-POC(current)), in response to abs(abs(τ0)-abs(τ1))≥T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0 is greater than 0, or in response to abs(τ0)>abs(τ1)×T0 or abs(τ1)>abs(τ0)×T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0=1.

[0011] In another representative aspect, the disclosed technology can be used to provide a non-transitory computer-readable storage medium storing instructions, the instructions causing a processor to: determine whether a first prediction mode can be applied based on one or more picture order count (POC) parameters associated with a picture of a current video block of a video, wherein in the first prediction mode, prediction samples of the current video block are refined based on at least gradients in different directions; based on the determination, perform conversion between the current video block and a bitstream of the video; wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current video block, wherein τ0 is a picture of the current picture. The difference between the slice sequence count and the picture sequence count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is the difference between the picture sequence count of the second reference picture and the picture sequence count of the current picture (τ1=POC(R1)-POC(current)), in response to abs(abs(τ0)-abs(τ1))≥T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0 is greater than 0, or in response to abs(τ0)>abs(τ1)×T0 or abs(τ1)>abs(τ0)×T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0=1.

[0012] The above and other aspects and features of the disclosed technology are described in more detail in the drawings, the description and the claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 An example of constructing a Merge candidate list is shown.

[0014] Figure 2 Examples of positions of spatial candidates are shown.

[0015] Figure 3 An example of a candidate pair subjected to redundancy check of a spatial Merge candidate is shown.

[0016] Figure 4A and Figure 4B An example of the location of the second prediction unit (PU) based on the size and shape of the current block is shown.

[0017] Figure 5 An example of motion vector scaling for temporal merge candidates is shown.

[0018] Figure 6 An example of candidate positions of a temporal merge candidate is shown.

[0019] Figure 7 An example of generating a combined bi-predictive Merge candidate is shown.

[0020] Figure 8 An example of constructing motion vector prediction candidates is shown.

[0021] Fig. 9 An example of motion vector scaling for spatial motion vector candidates is shown.

[0022] Fig.10 An example of motion prediction using an optional temporal motion vector prediction (ATMVP) algorithm for a codec unit (CU) is shown.

[0023] Fig.11 An example of a codec unit (CU) with sub-blocks and neighboring blocks used by a spatial-temporal motion vector prediction (STMVP) algorithm is shown.

[0024] Fig. 12A and Fig. 12B Example snapshots of sub-blocks are shown when using an overlapped block motion compensation (OBMC) algorithm.

[0025] Fig.13 An example of neighboring samples used to derive parameters for a local illumination compensation (LIC) algorithm is shown.

[0026] Fig.14 An example of a simplified affine motion pattern is shown.

[0027] Fig.15 An example of an affine motion vector field (MVF) for each sub-block is shown.

[0028] Fig.16 An example of motion vector prediction (MVP) for AF_INTER affine motion mode is shown.

[0029] Fig.17A and Fig. 17B Example candidates for the AF_MERGE affine motion mode are shown.

[0030] Fig.18 An example of bilateral matching in Pattern Matching Motion Vector Derivation (PMMVD) mode is shown, which is a special Merge mode based on the Frame Rate Up-Conversion (FRUC) algorithm.

[0031] Fig.19 An example of template matching in the FRUC algorithm is shown.

[0032] Fig. 20 An example of unilateral motion estimation in the FRUC algorithm is shown.

[0033] Fig.21 An example of an optical flow trajectory used by the Bidirectional Optical Flow (BDOF) algorithm is shown.

[0034] Fig.22A and Fig. 22B An example snapshot using the Bidirectional Optical Flow (BDOF) algorithm without block expansion is shown.

[0035] Fig.23 An example of interpolation samples used in BDOF is shown.

[0036] Fig.24 An example of a decoder-side motion vector refinement (DMVR) algorithm based on bilateral template matching is shown.

[0037] Fig.25 An example of the positions of samples used to derive parameters (α and β) of the linear mode in the linear prediction mode is shown.

[0038] Fig.26 An example of a straight line between maximum and minimum brightness values ​​is shown (representing a linear pattern).

[0039] Fig. 27 Another example of interpolation samples used in BDOF is shown.

[0040] FIG. 28A to FIG. 28I A flow chart of an example method for video processing is shown.

[0041] Fig.29 is a block diagram of an example of a hardware platform for implementing the visual media decoding or visual media encoding techniques described herein.

[0042] Fig.30 is a block diagram of an example video processing system in which the disclosed techniques may be implemented. DETAILED DESCRIPTION

[0043] Due to the increasing demand for higher resolution video, video coding methods and techniques are ubiquitous in modern technology. Video codecs generally include electronic circuits or software that compress or decompress digital video, and are constantly being improved to provide higher codec efficiency. Video codecs convert uncompressed video to a compressed format and vice versa. There is a complex relationship between video quality, the amount of data used to represent the video (determined by the bitrate), the complexity of the encoding and decoding algorithms, sensitivity to data loss and errors, ease of editing, random access, and end-to-end latency (delay). The compression format typically conforms to a standard video compression specification, such as the High Efficiency Video Codec (HEVC) standard (also known as H.265 or MPEG-H Part 2), the General Video Codec standard to be completed, or other current and / or future video codec standards.

[0044] Embodiments of the disclosed technology can be applied to existing video codec standards (e.g., HEVC, H.265) and future standards to improve compression performance. Section headings are used in this document to improve the readability of the description and do not in any way limit the discussion or embodiments (and / or implementations) to only the corresponding section.

[0045] 1. Example of inter-frame prediction in HEVC / H.265

[0046] Over the years, video codec standards have improved significantly and now partially provide high codec efficiency and support for higher resolutions. The latest standards such as HEVC and H.265 are based on a hybrid video codec structure where temporal prediction plus transform coding is utilized.

[0047] 1.1. Example of prediction mode

[0048] Each inter-predicted PU (prediction unit) has motion parameters for one or two reference picture lists. In some embodiments, the motion parameters include motion vectors and reference picture indexes. In other embodiments, inter_pred_idc may also be used to signal the use of one of the two reference picture lists. In yet other embodiments, the motion vectors may be explicitly encoded and decoded as deltas relative to the predictor.

[0049] When a CU is encoded or decoded in skip mode, one PU is associated with the CU and there are no significant residual coefficients, no coded motion vector increments, or reference picture indices. The Merge mode is specified so that the motion parameters of the current PU are obtained from neighboring PUs, including spatial and temporal candidates. The Merge mode can be applied to any inter-predicted PU, not only to skip mode. An alternative to the Merge mode is the explicit transmission of motion parameters, where, for each PU, the motion vector, the corresponding reference picture index for each reference picture list, and the reference picture list used are explicitly signaled.

[0050] When signaling indicates that one of the two reference picture lists will be used, a PU is generated from a block of samples. This is called "uni-prediction". Uni-prediction can be used for both P and B slices.

[0051] When signaling indicates that two reference picture lists will be used, a PU is generated from two sample blocks. This is called "bi-prediction". Bi-prediction is only applicable to B slices.

[0052] 1.1.1.1 Example of Constructing Candidates for Merge Mode

[0053] When predicting a PU using Merge mode, the index pointing to the entry in the Merge candidate list is parsed from the bitstream and used to retrieve motion information. The construction of this list can be summarized according to the following steps in sequence:

[0054] Step 1: Original candidate derivation

[0055] ○Step 1.1: Spatial Candidate Derivation

[0056] ○Step 1.2: Redundancy check of spatial candidates

[0057] ○Step 1.3: Temporal Candidate Derivation

[0058] Step 2: Insert additional candidates

[0059] ○Step 2.1: Create bidirectional prediction candidates

[0060] ○Step 2.2: Insert zero motion candidates

[0061] Figure 1 An example of constructing a Merge candidate list based on the sequence of steps summarized above is shown. For spatial Merge candidate derivation, up to four Merge candidates are selected from candidates located at five different positions. For temporal Merge candidate derivation, up to one Merge candidate is selected from two candidates. Since a constant number of candidates is assumed at the decoder for each PU, additional candidates are generated when the number of candidates does not reach the maximum number of Merge candidates (MaxNumMergeCand) signaled in the slice header. Since the number of candidates is constant, truncated unary binarization (TU) is used to encode the index of the best Merge candidate. If the size of the CU is equal to 8, all PUs of the current CU share a single Merge candidate list, which is the same as the Merge candidate list of the 2N×2N prediction unit.

[0062] 1.1.2 Constructing spatial merge candidates

[0063] In the derivation of spatial Merge candidates, Figure 2 Up to four Merge candidates are selected from the candidates at the depicted positions. The order of derivation is A1, B1, B0, A0, and B2. Position B2 is considered only when any PU at position A1, B1, B0, A0 is unavailable (for example, because it belongs to another stripe or block) or is intra-coded. After adding the candidate at position A1, a redundancy check is performed on the addition of the remaining candidates, which ensures that candidates with the same motion information are excluded from the list, so that the coding efficiency is improved.

[0064] In order to reduce computational complexity, not all possible candidate pairs are considered in the proposed redundancy check. Instead, only Figure 3 The pairs connected by arrows in , and the candidate is added to the list only if the corresponding candidate for redundancy check has different motion information. Another source of repeated motion information is a "second PU" associated with a partition other than 2N×2N. As an example, Figure 4A and 4B The second PU is depicted for the N×2N and 2N×N cases, respectively. When the current PU is partitioned as N×2N, the candidate at position A1 is not considered for list construction. In some embodiments, adding this candidate may result in two prediction units with the same motion information, which is redundant for having only one PU in the codec unit. Similarly, when the current PU is partitioned as 2N×N, position B1 is not considered.

[0065] 1.1.1.3 Construction time Merge candidate

[0066] In this step, only one candidate is added to the list. Specifically, in the derivation of this temporal Merge candidate, the scaled motion vector is derived based on the co-located PU, which belongs to the picture with the smallest POC difference with the current picture within a given reference picture list. The reference picture list to be used for the derivation of the co-located PU is explicitly signaled in the slice header.

[0067] Figure 5 An example of the derivation of a scaled motion vector for a temporal Merge candidate (as a dashed line) is shown, which is scaled from the motion vector of the co-located PU using the POC distances tb and td, where tb is defined as the POC difference between the reference picture of the current picture and the current picture, and td is defined as the POC difference between the reference picture of the co-located picture and the co-located picture. The reference picture index of the temporal Merge candidate is set equal to zero. For B slices, two motion vectors are obtained, one for reference picture list 0 and the other for reference picture list 1, and the two motion vectors are combined to obtain a bidirectional prediction Merge candidate.

[0068] In the co-located PU(Y) belonging to the reference frame, the position of the temporal candidate is selected between candidates C0 and C1, such as Figure 6 If the PU at position C0 is not available, is intra-coded, or is outside the current CTU, position C1 is used. Otherwise, position C0 is used for the derivation of temporal Merge candidates.

[0069] 1.1.4 Additional Types for Constructing Merge Candidates

[0070] In addition to the space-time Merge candidates, there are two additional types of Merge candidates: combined bidirectional prediction Merge candidates and zero Merge candidates. Combined bidirectional prediction Merge candidates are generated by utilizing space-time Merge candidates. Combined bidirectional prediction Merge candidates are only used for B slices. Combined bidirectional prediction candidates are generated by combining the first reference picture list motion parameters of the original candidate with the second reference picture list motion parameters of another candidate. If the two tuples provide different motion hypotheses, they will form a new bidirectional prediction candidate.

[0071] Figure 7 An example of this process is shown where two candidates in the original list (710 on the left) have either mvL0 and refIdxL0 or mvL1 and refIdxL1 which are used to create a combined bi-predictive Merge candidate that is added to the final list (720 on the right).

[0072] Zero motion candidates are inserted to fill the remaining entries in the Merge candidate list to reach the MaxNumMergeCand capacity. These candidates have zero spatial displacement and a reference picture index that starts at zero and increases each time a new zero motion candidate is added to the list. The number of reference frames used by these candidates is 1 and 2, for unidirectional and bidirectional prediction, respectively. In some embodiments, no redundancy check is performed on these candidates.

[0073] 1.1.5 Example of motion estimation regions for parallel processing

[0074] To speed up the encoding process, motion estimation can be performed in parallel, thereby deriving motion vectors for all prediction units in a given region at the same time. Deriving Merge candidates from spatial neighborhoods may interfere with parallel processing because a prediction unit cannot derive motion parameters from neighboring PUs until its associated motion estimation is completed. To alleviate the trade-off between codec efficiency and processing latency, a Motion Estimation Region (MER) can be defined, and the size of the MER is signaled in the picture parameter set (PPS) using the "log2_parallel_merge_level_minus2" syntax element. When a MER is defined, Merge candidates that fall into the same region are marked as unavailable and are therefore not considered in list construction.

[0075] 1.2 Embodiment of Advanced Motion Vector Prediction (AMVP)

[0076] AMVP exploits the spatiotemporal correlation of motion vectors with neighboring PUs for explicit transmission of motion parameters. It constructs a motion vector candidate list by first checking the availability of the top and left PU positions that are temporally adjacent, removing redundant candidates and adding zero vectors to make the candidate list a constant length. The encoder can then select the best predictor from the candidate list and send a corresponding index indicating the selected candidate. Similar to Merge index signaling, the index of the best motion vector candidate is encoded using truncated unary. The maximum value to be encoded in this case is 2 (see Figure 8 ). In the following section, details about the derivation process of motion vector prediction candidates are provided.

[0077] 1.2.1 Example of constructing motion vector prediction candidates

[0078] Figure 8 The derivation process of motion vector prediction candidates is summarized and can be implemented for each reference picture list with an index as input.

[0079] In motion vector prediction, two types of motion vector candidates are considered: spatial motion vector candidates and temporal motion vector candidates. For spatial motion vector candidate derivation, the final motion vector candidate is based on the previously located Figure 2 The motion vector of each PU at the five different positions shown in derives two motion vector candidates.

[0080] For temporal motion vector candidate derivation, a motion vector candidate is selected from two candidates, which are derived based on two different co-located positions. After generating the first list of spatio-temporal candidates, duplicate motion vector candidates in the list are removed. If the number of potential candidates is greater than 2, motion vector candidates whose reference picture index within the associated reference picture list is greater than 1 are removed from the list. If the number of spatio-temporal motion vector candidates is less than 2, an additional zero motion vector candidate is added to the list.

[0081] 1.2.2 Constructing spatial motion vector candidates

[0082] In the derivation of spatial motion vector candidates, at most two candidates are considered among five potential candidates, which are located as previously in Figure 2 The derivation order of the left side of the current PU is defined as A0, A1, and scaled A0, scaled A1. The derivation order of the upper side of the current PU is defined as B0, B1, B2, scaled B0, scaled B1, scaled B2. Therefore, for each side, there are four cases that can be used as motion vector candidates, two of which do not require the use of spatial scaling, and two use spatial scaling. The four different cases are summarized as follows:

[0083] - No space zoom

[0084] -(1) Same reference picture list, and same reference picture index (same POC) -(2) Different reference picture list, but same reference picture (same POC)

[0085] - Space Zoom

[0086] -(3) Same reference picture list, but different reference pictures (different POC)

[0087] -(4) Different reference picture lists, and different reference pictures (different POC)

[0088] First check the case without spatial scaling, then check the case where spatial scaling is allowed. When the POC is different between the reference picture of the neighboring PU and the reference picture of the current PU regardless of the reference picture list, consider spatial scaling. If all PUs of the left candidate are unavailable or intra-coded, then scaling of the above motion vectors is allowed to help parallel derivation of left and above MV candidates. Otherwise, spatial scaling of the above motion vectors is not allowed.

[0089] like Fig. 9 As shown in the example of , for the case of spatial scaling, the motion vectors of neighboring PUs are scaled in a similar way to temporal scaling. One difference is that the reference picture list and the index of the current PU are given as input; the actual scaling process is the same as the temporal scaling process.

[0090] 1.2.3 Constructing Temporal Motion Vector Candidates

[0091] Except for the reference picture index derivation, all the processes for deriving the temporal merge candidate are the same as those for deriving the spatial motion vector candidate (e.g. Figure 6 In some embodiments, the reference picture index is signaled to the decoder.

[0092] 2. Example of inter prediction method in Joint Exploration Mode (JEM)

[0093] In some embodiments, a reference software called Joint Exploration Mode (JEM) is used to explore future video codec technologies. In JEM, sub-block based prediction is employed in several codec tools, such as affine prediction, optional temporal motion vector prediction (ATMVP), spatio-temporal motion vector prediction (STMVP), bidirectional optical flow (BDOF or BIO), frame rate up-conversion (FRUC), local adaptive motion vector resolution (LAMVR), overlapped block motion compensation (OBMC), local illumination compensation (LIC), and decoder-side motion vector refinement (DMVR).

[0094] 2.1 Example of motion vector prediction based on sub-CU

[0095] In JEM with quadtree plus binary tree (QTBT), each CU can have at most one set of motion parameters for each prediction direction. In some embodiments, two sub-CU level motion vector prediction methods are considered in the encoder by dividing the large CU into sub-CUs and deriving the motion information of all sub-CUs of the large CU. The Alternative Temporal Motion Vector Prediction (ATMVP) method allows each CU to extract multiple sets of motion information from multiple blocks smaller than the current CU in the collocated reference picture. In the Spatial-Temporal Motion Vector Prediction (STMVP) method, the motion vector of the sub-CU is recursively derived by using the temporal motion vector predictor and the spatial neighboring motion vectors. In some embodiments, in order to retain a more accurate motion field for sub-CU motion prediction, motion compression of the reference frame may be disabled.

[0096] 2.1.1 Example of Alternative Temporal Motion Vector Prediction (ATMVP)

[0097] In the ATMVP method, the temporal motion vector prediction (TMVP) method is modified by extracting multiple sets of motion information (including motion vectors and reference indexes) from blocks smaller than the current CU.

[0098] Fig.10 An example of the ATMVP motion prediction process for CU 1000 is shown. The ATMVP 1000 method predicts the motion vector of a sub-CU 1001 within CU 1000 in two steps. The first step is to identify the corresponding block 1051 in the reference picture 1050 using the temporal vector. The reference picture 1050 is also called a motion source picture. The second step is to divide the current CU 1000 into sub-CUs 1001 and obtain the motion vector and the reference index of each sub-CU from the block corresponding to each sub-CU.

[0099] In the first step, the reference picture 1050 and the corresponding block are determined by the motion information of the spatial neighboring blocks of the current CU 1000. In order to avoid repeated scanning of neighboring blocks, the first Merge candidate in the Merge candidate list of the current CU 1000 is used. The first available motion vector and its associated reference index are set to the index of the temporal vector and the motion source picture. In this way, the corresponding block can be identified more accurately compared to TMVP, where the corresponding block (sometimes called a collocated block) is always located at the lower right or center position relative to the current CU.

[0100] In the second step, the corresponding block of the sub-CU 1051 is identified by the time vector in the motion source picture 1050 by adding the time vector to the coordinates of the current CU. For each sub-CU, the motion information of its corresponding block (e.g., the minimum motion grid covering the center sample point) is used to derive the motion information of the sub-CU. After the motion information of the corresponding N×N block is identified, it is converted into a reference index and motion vector of the current sub-CU in the same way as the TMVP of HEVC, where motion scaling and other processes also apply. For example, the decoder checks whether the low latency condition is met (e.g., the POC of all reference pictures of the current picture is less than the POC of the current picture) and may use the motion vector MV x (e.g., the motion vector corresponding to the reference picture list X) to predict the motion vector MV of each sub-CU y (eg, where X equals 0 or 1 and Y equals 1-X).

[0101] 2.1.2 Example of Spatio-Temporal Motion Vector Prediction (STMVP)

[0102] In the STMVP method, the motion vector of a sub-CU is recursively derived in raster scan order. Fig.11 An example of a CU with four sub-blocks and neighboring blocks is shown. Consider an 8×8 CU 1100 containing four 4×4 sub-CUs A (1101), B (1102), C (1103) and D (1104). The neighboring 4×4 blocks in the current frame are labeled a (1111), b (1112), c (1113) and d (1114).

[0103] The motion derivation of sub-CU A starts by identifying its two spatial neighbors. The first neighbor is the N×N block (block c 1103) above sub-CU A1101. If block c (1113) is not available or is intra-coded, then (starting from block c 1113, from left to right) check the other N×N blocks above sub-CU A (1101). The second neighbor is the block (block b1112) on the left side of sub-CU A1101. If block b (1112) is not available or is intra-coded, then (starting from block b 1112, from top to bottom) check the other blocks on the left side of sub-CU A1101. The motion information obtained from the adjacent blocks of each list is scaled to the first reference frame of the given list. Next, the temporal motion vector prediction (Temporal Motion Vector Predictor, TMVP) of sub-block A1101 is derived by following the same process as the TMVP derivation specified in HEVC. The motion information of the collocated block at D 1104 is extracted and scaled accordingly. Finally, after retrieving and scaling the motion information, all available motion vectors are averaged separately for each reference list. The average motion vector is assigned as the motion vector of the current sub-CU.

[0104] 2.1.3 Example of Sub-CU Motion Prediction Mode Signaling

[0105] In some embodiments, sub-CU mode is enabled as an additional Merge candidate, and no additional syntax elements are required to signal the mode. Two additional Merge candidates are added to the Merge candidate list of each CU to represent the ATMVP mode and the STMVP mode. In some embodiments, if the sequence parameter set indicates that ATMVP and STMVP are enabled, up to seven Merge candidates can be used. The encoding logic of the additional Merge candidates is the same as that of the Merge candidates in HM, which means that for each CU in a P or B slice, two additional Merge candidates may require an additional two RD checks. In some embodiments, for example, in JEM, all bins of the Merge index are context-coded by CABAC (context-based adaptive binary arithmetic coding and decoding). In other embodiments, for example, in HEVC, only the first bin is context-coded, and the remaining bins are context bypass-coded.

[0106] 2.2 Adaptive motion vector differential resolution

[0107] In some embodiments, when use_integer_mv_flag in the slice header is equal to 0, the motion vector difference (MVD) (between the PU's motion vector and the predicted motion vector) is signaled in units of quarter luma samples. In JEM, Locally Adaptive Motion Vector Resolution (LAMVR) is introduced. In JEM, MVD can be coded and decoded in units of quarter luma samples, integer luma samples, or four luma samples. The MVD resolution is controlled at the codec unit (CU) level, and the MVD resolution flag is conditionally signaled for each CU with at least one non-zero MVD component.

[0108] For a CU with at least one non-zero MVD component, a first flag is signaled to indicate whether quarter luma sample MV precision is used in the CU. When the first flag (equal to 1) indicates that quarter luma sample MV precision is not used, another flag is signaled to indicate whether integer luma sample MV precision or quad luma sample MV precision is used.

[0109] When the first MVD resolution flag of a CU is zero or is not encoded for a CU (meaning that all MVDs in the CU are zero), a quarter luma sample MV resolution is used for the CU. When a CU uses integer luma sample MV precision or four luma sample MV precision, the MVP in the CU's AMVP candidate list is rounded to the corresponding precision.

[0110] In the encoder, the CU-level RD check is used to determine which MVD resolution is used for the CU. That is, for each MVD resolution, the CU-level RD check is performed three times. In order to speed up the encoder, the following encoding scheme is applied in JEM.

[0111] - During RD check of a CU with normal quarter luma sample MVD resolution, the motion information of the current CU (integer luma sample accuracy) is stored. The stored motion information (after rounding) is used as a starting point for further small-scale motion vector refinement during RD check for the same CU with integer luma sample and 4 luma sample MVD resolution, so that the time-consuming motion estimation process is not repeated three times.

[0112] - Conditionally call RD check for CUs with 4 luma samples MVD resolution. For a CU, when the RD cost integer luma sample MVD resolution is much larger than a quarter luma sample MVD resolution, skip RD check for CU's 4 luma sample MVD resolution.

[0113] 2.3 Example of Higher Motion Vector Storage Accuracy

[0114] In HEVC, the motion vector accuracy is quarter-pixel (one-quarter luma sample and one-eighth chroma sample for 4:2:0 video). In JEM, the accuracy of internal motion vector storage and merge candidates is increased to 1 / 16 pixel. Higher motion vector accuracy (1 / 16 pixel) is used for motion compensated inter prediction of CUs encoded and decoded in skip / merge mode. For CUs encoded and decoded using normal AMVP mode, integer pixel or quarter-pixel motion is used.

[0115] The SHVC upsample interpolation filter with the same filter length and normalization factor as the HEVC motion compensation interpolation filter is used as the motion compensation interpolation filter for the additional fractional pixel positions. The chroma component motion vector accuracy in JEM is 1 / 32 samples, and the additional interpolation filter for the 1 / 32 pixel fractional position is derived by using the average of two adjacent filters at 1 / 16 pixel fractional positions.

[0116] 2.4 Example of Overlapped Block Motion Compensation OBMC

[0117] In JEM, OBMC can be turned on and off using CU-level syntax. When OBMC is used in JEM, OBMC is performed on all motion compensation (MC) block boundaries except the right and bottom boundaries of the CU. In addition, it is also applied to luminance and chrominance components. In JEM, MC blocks correspond to codec blocks. When a CU is encoded and decoded with sub-CU mode (including sub-CUmerge, affine, and FRUC modes), each sub-block of the CU is an MC block. In order to handle CU boundaries in a unified manner, OBMC is performed at the sub-block level for all MC block boundaries, where the sub-block size is set equal to 4×4, as shown in Fig. 12A and 12B shown.

[0118] Fig. 12A The sub-blocks at the CU / PU boundary are shown, and the shaded sub-blocks are where OBMC is applied. Similarly, Fig. 12B Sub-blocks in ATMVP mode are shown.

[0119] When OBMC is applied to the current sub-block, in addition to the current motion vector, the motion vectors of the four connected neighboring sub-blocks (if available and different from the current motion vector) are also used to derive the prediction block of the current sub-block. These multiple prediction blocks based on multiple motion vectors are combined to generate the final prediction signal of the current sub-block.

[0120] The prediction block based on the motion vector of the neighboring sub-block is represented as P N , where N indicates the index of the adjacent upper, lower, left and right sub-blocks, and the prediction block based on the motion vector of the current sub-block is represented as P C When P N When it is based on the motion information of the neighboring sub-block containing the same motion information as the current sub-block, it is not N Execute OBMC. Otherwise, each P N Sample points added to P C In the same point in N Add four rows / columns to P C . Use weighting factors {1 / 4, 1 / 8, 1 / 16, 1 / 32} for P N , and the weighting factors {3 / 4, 7 / 8, 15 / 16, 31 / 32} are used for PC. The exception is small MC blocks (i.e., when the height or width of the codec block is equal to 4 or the CU is coded in sub-CU mode), for which only PC is used. N Add two rows / columns to P C In this case, the weighting factors {1 / 4,1 / 8} are used for P N , and the weighting factors {3 / 4,7 / 8} are used for PC For P generated based on the motion vectors of vertically (horizontally) adjacent sub-blocks N , P N The samples in the same row (column) of are added to P with the same weighting factor. C .

[0121] In JEM, for CUs with a size less than or equal to 256 luma samples, a CU-level flag is signaled to indicate whether OBMC is applied to the current CU. For CUs with a size greater than 256 luma samples or not encoded and decoded using AMVP mode, OBMC is applied by default. At the encoder, when OBMC is applied to a CU, its impact is considered during the motion estimation stage. The prediction signal formed by OBMC using the motion information of the upper and left neighboring blocks is used to compensate for the upper and left boundaries of the original signal of the current CU, and then the normal motion estimation process is applied.

[0122] 2.5 Example of Local Illumination Compensation (LIC)

[0123] Illumination compensation LIC is based on a linear model for illumination variations, using a scaling factor a and an offset b, and is adaptively enabled or disabled for each codec unit (CU) of inter-mode coding.

[0124] When LIC is applied to a CU, a least square error method is used to derive parameters a and b by using neighboring samples of the current CU and their corresponding reference samples. Fig.13 An example of neighboring sample points used to derive parameters of the IC algorithm is shown. More specifically, Fig.13 As shown, the neighboring samples of the CU's subsamples (2:1 subsamples) and the corresponding samples in the reference picture (identified by the motion information of the current CU or subCU) are used. IC parameters are derived and applied to each prediction direction separately.

[0125] When a CU is encoded and decoded in Merge mode, the LIC flag is copied from the neighboring block in a manner similar to the motion information copying in Merge mode; otherwise, the LIC flag is signaled to the CU to indicate whether LIC is applied.

[0126] When LIC is enabled for a picture, an additional CU-level RD check is required to determine whether LIC is applied to the CU. When LIC is enabled for a CU, the mean-removed sum of absolute differences (MR-SAD) and the mean-removed sum of absolute Hadamard-transformed differences (MR-SATD) are used instead of SAD and SATD for integer pixel motion search and fractional pixel motion search, respectively.

[0127] In order to reduce the coding complexity, the following coding scheme is applied in JEM:

[0128] -When there is no significant illumination change between the current picture and its reference pictures, LIC is disabled for the entire picture. To identify this situation, the histogram of the current picture and each reference picture of the current picture is calculated at the encoder. If the histogram difference between the current picture and each reference picture of the current picture is less than a given threshold, LIC is disabled for the current picture; otherwise, LIC is enabled for the current picture.

[0129] 2.6 Example of Affine Motion Compensated Prediction

[0130] In HEVC, only the translation motion model is applied to Motion Compensation Prediction (MCP). However, the camera and the object may have various motions, such as zoom-in / out, rotation, perspective motion, and / or other irregular motions. On the other hand, in JEM, a simplified affine transformation motion compensation prediction is applied. Fig.14 An example is shown where the affine motion field of block 1400 is described by two control point motion vectors V0 and V1. The motion vector field (MVF) of block 1400 is described by the following equation:

[0131]

[0132] like Fig.14 As shown, (v 0x , v 0y ) is the motion vector of the upper left control point, (v 1x , v 1y ) is the motion vector of the upper right control point.

[0133] To further simplify motion compensation prediction, sub-block based affine transformation prediction can be applied. The sub-block size M×N is derived as follows:

[0134]

[0135] Here, MvPre is the motion vector fraction accuracy (e.g., 1 / 16 in JEM), (v 2x , v 2y ) is the motion vector of the lower left control point calculated according to Equation 1. If necessary, M and N can be adjusted downward to become divisors of w and h, respectively.

[0136] Fig.15 An example of an affine MVF for each sub-block of block 1500 is shown. To derive the motion vector for each M×N sub-block, the motion vector of the center sample of each sub-block is calculated according to Equation 1 and rounded to a motion vector fractional accuracy (e.g., 1 / 16 in JEM). Then, a motion compensated interpolation filter is applied to generate a prediction for each sub-block using the derived motion vector.

[0137] After MCP, the high-accuracy motion vector of each sub-block is rounded and saved with the same accuracy as the normal motion vector.

[0138] 2.6.1 AF_INTER mode implementation

[0139] In JEM, there are two affine motion modes: AF_INTER mode and AF_MERGE mode. For CUs with width and height greater than 8, AF_INTER mode can be applied. A CU-level affine flag is signaled in the bitstream to indicate whether AF_INTER mode is used. In AF_INTER mode, neighboring blocks are used to construct a pair of motion vectors {(v0, v1)|v0={v A , v B , v c},v1={v D , v E}}'s candidate list.

[0140] Fig.16 An example of motion vector prediction (MVP) of block 1600 in AF_INTER mode is shown. Fig.16As shown, v0 is selected from the motion vectors of sub-blocks A, B or C. The motion vector from the adjacent block can be scaled according to the reference list. The motion vector from the adjacent block can also be scaled according to the relationship between the picture order count (POC) of the reference for the adjacent block, the POC for the reference of the current CU and the POC of the current CU. The method of selecting v1 from adjacent sub-blocks D and E is similar. If the number of candidate lists is less than 2, the list can be filled with motion vector pairs composed by copying each AMVP candidate. When the candidate list is greater than 2, the candidates can be first sorted according to adjacent motion vectors (for example, based on the similarity of the two motion vectors in the candidate pair). In some embodiments, the first two candidates are retained. In some embodiments, the rate-distortion (RD) cost check is used to determine which motion vector pair candidate is selected as the control point motion vector prediction (CPMVP) of the current CU. The index indicating the position of the CPMVP in the candidate list can be signaled in the bitstream. After determining the CPMVP of the current affine CU, affine motion estimation is applied and the control point motion vector (CPMV) is found. The difference between CPMV and CPMVP is then signaled in the bitstream. 2.6.3 AF_MERGE Mode Example

[0141] When a CU is applied in AF_MERGE mode, it obtains the first block coded in affine mode from valid neighboring reconstructed blocks. Fig.17A An example of the selection order of candidate blocks of the current CU 1700 is shown. Fig.17A As shown, the selection order may be from the left ( 1701 ), top ( 1702 ), top right ( 1703 ), bottom left ( 1704 ) to top left ( 1705 ) of the current CU 1700 . Fig. 17B Another example of a candidate block of the current CU 1700 in AF_MERGE mode is shown. If the adjacent lower left block 1701 is encoded and decoded in affine mode, such as Fig. 17B As shown, motion vectors v2, v3 and v4 of the upper left corner, upper right corner and lower left corner of the CU containing block A are derived. And the motion vector v0 of the upper left corner of the current CU 1700 is calculated based on v2, v3 and v4. The motion vector v1 of the upper right corner of the current CU can be calculated accordingly.

[0142] After calculating the CPMV v0 and v1 of the current CU according to the affine motion model in equation (1), the MVF of the current CU can be generated. In order to identify whether the current CU is encoded or decoded in AF_MERGE mode, when at least one neighboring block is encoded or decoded in affine mode, an affine flag can be signaled in the bitstream.

[0143] 2.7 Example of Pattern Matched Motion Vector Derivation (PMMVD)

[0144] The PMMVD mode is a special Merge mode based on the Frame-Rate Up Conversion (FRUC) method. In this mode, the motion information of the block is derived at the decoder side instead of signaling the motion information of the block.

[0145] When the Merge flag of the CU is true, the FRUC flag may be signaled to the CU. When the FRUC flag is false, the Merge index may be signaled and the normal Merge mode may be used. When the FRUC flag is true, an additional FRUC mode flag may be signaled to indicate which method (e.g., bilateral matching or template matching) will be used to derive the motion information for the block.

[0146] On the encoder side, the decision on whether to use the FRUC Merge mode for a CU is based on the RD cost selection made for the normal Merge candidate. For example, multiple matching modes (e.g., bilateral matching and template matching) of a CU are checked by using the RD cost selection. The matching mode that causes the minimum cost is further compared with other CU modes. If the FRUC matching mode is the most effective mode, the FRUC flag is set to true for the CU and the relevant matching mode is used.

[0147] Typically, the motion derivation process in FRUC Merge mode has two steps: first, a CU-level motion search is performed, and then a sub-CU-level motion refinement is performed. At the CU level, the original motion vector of the entire CU is derived based on bilateral matching or template matching. First, a list of MV candidates is generated, and the candidate that causes the minimum matching cost is selected as the starting point for further CU-level refinement. Then, a local search based on bilateral matching or template matching is performed near the starting point. The MV result of the minimum matching cost is used as the MV of the entire CU. Subsequently, the motion information is further refined at the sub-CU level using the derived CU motion vector as the starting point.

[0148] For example, the following derivation process is performed for W×HCU motion information derivation. In the first stage, the MV of the entire W×HCU is derived. In the second stage, the CU is further divided into M×M sub-CUs. The value of M is calculated as shown in (3), and D is a predefined partition depth, which is set to 3 by default in JEM. Then the MV of each sub-CU is derived.

[0149]

[0150] Fig.18An example of bilateral matching used in a frame rate up conversion (FRUC) method is shown. Bilateral matching is used to derive motion information of the current CU by finding the closest match between two blocks along the motion trajectory of the current CU (1800) in two different reference pictures (1810, 1811). Under the assumption of a continuous motion trajectory, the motion vectors MV0 (1801) and MV1 (1802) pointing to the two reference blocks are proportional to the temporal distance (e.g., TD0 (1803) and TD1 (1804)) between the current picture and the two reference pictures. In some embodiments, when the current picture 1800 is temporally between the two reference pictures (1810, 1811) and the temporal distance from the current picture to the two reference pictures is the same, the bilateral matching becomes a mirror-based bidirectional MV.

[0151] Fig.19 An example of template matching used in a frame rate up conversion (FRUC) method is shown. Template matching is used to derive motion information of the current CU 1900 by finding the closest match between a template in the current picture 1910 (the top and / or left neighboring blocks of the current CU) and a block in a reference picture (e.g., the same size as the template). In addition to the above-mentioned FRUCMerge mode, template matching can also be applied to the AMVP mode. As done in both JEM and HEVC, AMVP has two candidates. New candidates are derived through a template matching method. If the candidate newly derived by template matching is different from the first existing AMVP candidate, it is inserted at the very beginning of the AMVP candidate list, and then the list size is set to 2 (e.g., by removing the second existing AMVP candidate). When applied to the AMVP mode, only CU-level search is applied.

[0152] The MV candidates set at the CU level may include the following: (1) the original AMVP candidates if the current CU is in AMVP mode, (2) all Merge candidates, (3) several MVs in the interpolated MV field (described later), and the top and left neighboring motion vectors.

[0153] When bilateral matching is used, each valid MV of the Merge candidate can be used as input to generate an MV pair assuming bilateral matching. For example, in reference list A, one valid MV of the Merge candidate is (MVa, ref a ). Then, find the reference image ref of its paired bilateral MV in other reference list B. b , so that ref a and ref b are located on different sides of the current image in time. If such a ref b is not available in reference list B, then ref bis identified as ref a Different reference, and its temporal distance to the current picture is the minimum value in list B. b Afterwards, based on the current image ref a and ref b MVa is scaled by the temporal distance between them to derive MVb.

[0154] In some embodiments, four MVs from the interpolated MV field can also be added to the CU-level candidate list. More specifically, the interpolated MVs at positions (0,0), (W / 2,0), (0, H / 2), and (W / 2, H / 2) of the current CU are added. When FRUC is applied to AMVP mode, the original AMVP candidate is also added to the CU-level MV candidate set. In some embodiments, at the CU level, 15 MVs are added to the candidate list for AMVPCU and 13 MVs are added to the candidate list for MergeCU.

[0155] The MV candidates set at the sub-CU level include: (1) MVs determined from CU-level searches, (2) neighboring MVs at the top, left, upper left, and upper right corners, (3) scaled versions of collocated MVs from reference pictures, (4) one or more 4 ATMVP candidates (up to 4), and (5) one or more STMVP candidates (e.g., up to 4). The scaled MVs from the reference picture are derived as follows. The reference pictures in the two lists are traversed. The MV at the collocated position of the sub-CU in the reference picture is scaled to the reference of the starting CU-level MV. ATMVP and STMVP candidates may be limited to the first four. At the sub-CU level, one or more MVs (e.g., up to 17) are added to the candidate list.

[0156] Generation of interpolated MV fields. Before encoding and decoding the frame, an interpolated motion field is generated for the entire picture based on single-sided ME. The motion field can then be used as a CU-level or sub-CU-level MV candidate later.

[0157] In some embodiments, the motion field of each reference picture in both reference lists is traversed at 4x4 block level. Fig. 20 An example of a single-sided motion estimation (ME) 2000 in the FRUC method is shown. For each 4×4 block, if the motion associated with the block passes through a 4×4 block in the current picture and the block is not assigned any interpolated motion, the motion of the reference block is scaled to the current picture according to the temporal distances TD0 and TD1 (in the same way as the MV scaling of TMVP in HEVC), and the scaled motion is assigned to the block in the current frame. If no scaled MV is assigned to the 4×4 block, the motion of the block is marked as unavailable in the interpolated motion field.

[0158] Interpolation and matching costs.When the motion vector points to a fractional sample position, motion compensated interpolation is required. To reduce complexity, bilinear interpolation can be used for bilateral matching and template matching instead of conventional 8-tap HEVC interpolation.

[0159] The calculation of the matching cost is a little different at different steps. When selecting candidates from the candidate set at the CU level, the matching cost can be the absolute sum difference (SAD) of bilateral matching or template matching. After determining the starting MV, the matching cost C of the bilateral matching of the sub-CU level search is calculated as follows:

[0160]

[0161] Here, w is a weighting factor. In some embodiments, w can be set to 4. MV and MV S Indicates the current MV and the starting MV respectively. SAD can still be used as the matching cost of template matching for sub-CU level search.

[0162] In FRUC mode, MV is derived by using luma samples only. The derived motion will be used for both luma and chroma for MC inter prediction. After determining MV, final MC is performed using 8-tap interpolation filter for luma and 4-tap interpolation filter for chroma.

[0163] MV refinement is a pattern-based MV search with bilateral matching cost or template matching cost as the criterion. In JEM, two search modes are supported - Unrestricted Center-Biased Diamond Search (UCBDS) and Adaptive Cross Search, which perform MV refinement at CU level and sub-CU level respectively. For both CU and sub-CU level MV refinement, MV is directly searched with quarter luma sample MV precision, and followed by one-eighth luma sample MV refinement. The search range for MV refinement for CU and sub-CU steps is set equal to 8 luma samples.

[0164] In bilateral matching Merge mode, bidirectional prediction is applied because the motion information of the CU is derived based on the closest match between two blocks along the motion trajectory of the current CU in two different reference pictures. In template matching Merge mode, the encoder can choose from unidirectional prediction in list 0, unidirectional prediction in list 1, or bidirectional prediction for the CU. The choice can be based on the template matching cost as follows:

[0165] If costBi <= factor * min (cost0, cost1)

[0166] Bidirectional prediction is used;

[0167] Otherwise, if cost0 <= cost1

[0168] Then use the one-way prediction in list 0;

[0169] otherwise,

[0170] Use the one-way prediction in Listing 1;

[0171] Here, cost0 is the SAD of list 0 template matching, cost1 is the SAD of list 1 template matching, and costBi is the SAD of bidirectional prediction template matching. For example, when the value of factor is equal to 1.25, it means that the selection process is biased towards bidirectional prediction. Inter prediction direction selection can be applied to the CU-level template matching process.

[0172] 2.8 Example of Generalized Bidirectional Prediction Improvement (GBi)

[0173] Generalized bidirectional prediction improvement (GBi) is adopted in VTM-3.0. GBi applies unequal weights to predictors from L0 and L1 in bidirectional prediction mode. In inter prediction mode, multiple weight pairs including equal weight pairs (1 / 2, 1 / 2) are evaluated based on rate distortion optimization (RDO), and the GBi index of the selected weight pair is signaled to the decoder. In Merge mode, the GBi index is inherited from the adjacent CU. The predictor generation formula is shown in formula (5).

[0174] P GBi =(w0×P L0 +w1×P L1 +RoundingOffset)>>shiftNum Gbi Equation (5)

[0175] Here, P GBi is the final predictor for GBi, w0 and w1 are the selected GBi weights applied to the predictors (PL0 and PL1) of list 0 (L0) and list 1 (L1), respectively. RoundingOffset GBi and shiftNum Gbi is the final predictor used in the normalized GBi. The supported w1 weight sets are {-1 / 4, 3 / 8, 1 / 2, 5 / 8, 5 / 4}, where the five weights correspond to one equal weight pair and four unequal weight pairs. The mixing gain, which is the sum of w1 and w0, is fixed to 1.0. Therefore, the corresponding w0 weight set is {5 / 4, 5 / 8, 1 / 2, 3 / 8, -1 / 4}. The weight pair selection is at the CU level.

[0176] For non-low-latency pictures, the weight set size is reduced from 5 to 3, where the w1 weight set is {3 / 8, 1 / 2, 5 / 8} and the w0 weight set is {5 / 8, 1 / 2, 3 / 8}. The weight set size reduction for non-low-latency pictures is applicable to BMS2.1 GBi and all GBi tests in this disclosure.

[0177] 2.8.1 GBi encoder bug fixes

[0178] In order to reduce GBi encoding time, in the current encoder design, the encoder will store the unidirectional prediction motion vector estimated according to the GBi weight equal to 4 / 8 and reuse it for unidirectional prediction search for other GBi weights. This fast encoding method is applied to both translational motion mode and affine motion mode. In VTM2.0, a 6-parameter affine model and a 4-parameter affine model are adopted. When the GBi weight is equal to 4 / 8, when the BMS2.1 encoder stores the unidirectional prediction affine MV, the BMS2.1 encoder does not distinguish between the 4-parameter affine model and the 6-parameter affine model. Therefore, after encoding with GBi with weight 4 / 8, the 4-parameter affine MV can be overwritten with the 6-parameter affine MV. For GBi of other weights, the stored 6-parameter affine MV can be used for the 4-parameter affine ME, or the stored 4-parameter affine MV can be used for the 6-parameter affine ME. The proposed GBi encoder error repair is to store the 4-parameter affine and 6-parameter affine MV separately. When the GBi weight is equal to 4 / 8, the encoder will store these affine MVs based on the affine mode type, and for GBi of other weights, it will reuse the corresponding affine MVs based on the affine mode type.

[0179] 2.8.2GBi encoder acceleration

[0180] In this existing implementation, five encoder acceleration methods are proposed to reduce the encoding time when GBi is enabled.

[0181] (1) Conditionally skip affine motion estimation for certain GBi weights

[0182] In BMS2.1, affine ME including 4-parameter and 6-parameter affine ME is performed on all GBi weights. For some unequal GBi weights (weights not equal to 4 / 8), we propose to skip affine ME conditionally. Specifically, affine ME is performed on other GBi weights if and only if affine mode is selected as the current best mode and it is not affine Merge mode after evaluating GBi with weight 4 / 8. If the current picture is a non-low-latency picture, the bidirectional prediction ME of the translation mode will be skipped for unequal GBi weights when affine ME is performed. If the affine mode is not selected as the current best mode, or affine Merge is selected as the current best mode, affine ME will be skipped for all other GBi weights.

[0183] (2) Reducing the weight of the RD cost check for low-latency pictures in encoding with 1-pixel and 4-pixel MVD precision

[0184] For low latency pictures, there are five weights for RD cost checking for all MVD precisions including 1 / 4 pixel, 1 pixel, and 4 pixel. The encoder will first check the RD cost for 1 / 4 pixel MVD precision. We propose to skip a portion of GBi weights for RD cost checking for 1 pixel and 4 pixel MVD precision. We order these unequal weights according to their RD cost in 1 / 4 pixel MVD precision. When encoding in 1 pixel and 4 pixel MVD precision, only the first two weights with the smallest RD cost and the GBi with weight 4 / 8 will be evaluated. Therefore, for low latency pictures, a maximum of three weights will be evaluated for 1 pixel and 4 pixel MVD precision.

[0185] (3) When the L0 and L1 reference pictures are the same, conditionally skip the bidirectional prediction search

[0186] For some pictures in RA, the same picture may appear in both reference picture lists (list-0 and list-1).For example, for the random access codec configuration in CTC, the reference picture structure of the first group of pictures (GOP) is listed below.

[0187] POC: 16, TL: 0, [L0: 0] [L1: 0]

[0188] POC: 8, TL: 1, [L0: 0 16] [L1: 16 0]

[0189] POC: 4, TL: 2, [L0: 0 8] [L1: 8 16]

[0190] POC: 2, TL: 3, [L0: 0 4] [L1: 4 8]

[0191] POC: 1, TL: 4, [L0: 0 2] [L1: 2 4]

[0192] POC: 3, TL: 4, [L0: 2 0] [L1: 4 8]

[0193] POC: 6, TL: 3, [L0: 4 0] [L1: 8 16]

[0194] POC: 5, TL: 4, [L0: 4 0] [L1: 6 8]

[0195] POC: 7, TL: 4, [L0: 6 4] [L1: 8 16]

[0196] POC: 12, TL: 2, [L0: 8 0] [L1: 16 8]

[0197] POC: 10, TL: 3, [L0: 8 0] [L1: 12 16]

[0198] POC: 9, TL: 4, [L0: 8 0] [L1: 10 12]

[0199] POC: 11, TL: 4, [L0: 10 8] [L1: 12 16]

[0200] POC: 14, TL: 3, [L0: 12 8] [L1: 12 16]

[0201] POC: 13, TL: 4, [L0: 12 8] [L1: 14 16]

[0202] POC: 15, TL: 4, [L0: 14 12] [L1: 16 14]

[0203] Note that pictures 16, 8, 4, 2, 1, 12, 14, and 15 have the same reference pictures in both lists. For bi-directional prediction of these pictures, the L0 and L1 reference pictures may be the same. We recommend that the encoder skips bi-directional prediction ME for unequal GBi weights when 1) both reference pictures in bi-directional prediction are the same and 2) the temporal layer is greater than 1 and 3) the MVD precision is 1 / 4 pixel. For affine bi-directional prediction ME, this fast skip method is only applicable to 4-parameter affine ME.

[0204] (4) Based on the temporal layer and the POC distance between the reference image and the current image, skip the RD cost check for unequal GBi weights

[0205] We propose to skip those RD cost evaluations for those unequal GBi weights when the temporal layer is equal to 4 (the highest temporal layer in RA) or the POC distance between the reference picture (list 0 or list 1) and the current picture is equal to 1 and the codec QP is greater than 32.

[0206] (5) During ME, for unequal GBi weights, floating-point calculations are changed to fixed-point calculations

[0207] For the existing bidirectional prediction search, the encoder will fix the MV of one list and optimize the MV in the other list. The target is modified before ME to reduce the computational complexity. For example, if the MV of list 1 is fixed and the encoder will refine the MV of list 0, the target of list 0 MV is modified by equation (6). O is the original signal, P1 is the predicted signal of list 1. w is the GBi weight of list 1.

[0208] T=((O<<3)-w*P1)*(1 / (8-w)) (6)

[0209] Here, the term (1 / (8-w)) is stored in floating point precision, which increases the computational complexity. We propose to change Equation (6) to fixed point like Equation (7).

[0210] T=(O*a1-P1*a2+round)>>N (7)

[0211] Where a1 and a2 are scaling factors, and their calculation formulas are as follows:

[0212] γ=(1<<N) / (8-w); a1=γ<<3; a2=γ*w; round=1<<(N-1)

[0213] 2.8.3 GBi CU Size Constraints

[0214] In this approach, GBi is disabled for small CUs. In inter prediction mode, if bidirectional prediction is used and the CU area is smaller than 128 luma samples, GBi will be disabled without any signaling.

[0215] 2.9 Example of Bidirectional Optical Flow (BDOF)

[0216] In bidirectional optical flow (BDOF or BIO), motion compensation is first performed to generate a first prediction of the current block (in each prediction direction). The first prediction is used to derive the spatial gradient, temporal gradient, and optical flow of each sub-block / pixel within the block, which is then used to generate a second prediction, e.g., the final prediction of the sub-block / pixel. Details are described below.

[0217] BDOF is a sample-wise motion refinement that is performed on top of block-wise motion compensation for bi-directional prediction. In some embodiments, the sample-level motion refinement does not use signaling.

[0218] Let I (k) is the luminance value of reference k (k=0, 1) after block motion compensation, and I (k) The horizontal and vertical components of the gradient. Assuming that the optical flow is valid, the motion vector field (v x , v y ) is given by:

[0219]

[0220] Combining this optical flow equation with the Hermite interpolation of each sample point's motion trajectory, we get a unique third-order polynomial that finally matches the function value I (k) and its derivative Both. The value of this third-order polynomial at t=0 is the BDOF prediction:

[0221]

[0222] Fig.24 An example optical flow trajectory in the bidirectional optical flow (BDOF) method is shown. Here, τ0 and τ1 represent the distance to the reference frame, as Fig.21 As shown. The distances τ0 and τ1 are calculated based on the POC of Ref0 and Ref1: τ0 = POC(current) - POC(Ref0), τ1 = POC(Ref1) - POC(current). If both predictions are from the same temporal direction (both from the past or both from the future), the sign is different, i.e., τ0·τ1 < 0. In this case, BDOF is only applied when the predictions are not from the same moment (i.e., τ0≠τ1), both reference regions have non-zero motion (MVx0, MVy0, MVx1, MVy1≠0) and the block motion vector is proportional to the temporal distance (MVx0 / MVx1 = MVy0 / MVy1 = -τ0 / τ1).

[0223] The motion vector field (v) is determined by minimizing the difference Δ between the values ​​in points A and B. x , v y ). Fig. 9 An example of the intersection of the motion trajectory and the reference frame plane is shown. The model uses only the first linear term of the local Taylor expansion of Δ:

[0224]

[0225] All values ​​in the above equations depend on the sample point location, denoted as (i′, j′). Assuming that the motion is consistent in the local surrounding area, minimize Δ within a square window Ω of (2M+1)×(2M+1) centered at the current prediction point, where M is equal to 2:

[0226]

[0227] For this optimization problem, JEM uses a simplified approach, first minimizing in the vertical direction and then minimizing in the horizontal direction. This yields the following:

[0228]

[0229] in,

[0230]

[0231] In order to avoid division by zero or very small values, regularization parameters r and m can be introduced in equations (9) and (10).

[0232] r=500·4 d-8 (12)

[0233] m=700·4 d-8 (13)

[0234] Here d is the bit depth of the video samples.

[0235] In order to keep the memory access of BDOF the same as that of conventional bi-directional prediction motion compensation, all predictions and gradient values ​​I are calculated only for the positions within the current block. (k) , Fig.22A An example of an access location outside of block 2200 is shown. Fig.22A As shown in equation (9), a (2M+1)×(2M+1) square window Ω centered at the current prediction point on the boundary of the prediction block needs to access the location outside the block. In JEM, the I outside the block is (k) , The value of is set equal to the nearest available value within the block. For example, this can be implemented as filling area 2201, such as Fig. 22B shown.

[0236] With BDOF, the motion field can be refined for each sample. To reduce computational complexity, a block-based BDOF design is used in JEM. Motion refinement can be calculated based on 4×4 blocks. In block-based BDOF, s in equation (9) can be aggregated for all samples in a 4×4 block. n The value of s nThe aggregated value of is used to derive the BDOF motion vector offset of the 4×4 block. More specifically, the following formula can be used for block-based BDOF derivation:

[0237]

[0238] Here k represents the sample set of the kth 4×4 block belonging to the prediction block. Substituting s in equations (9) and (10) n Replace with ((s n,bk )>>4) to derive the associated motion vector offset.

[0239] In some scenarios, the MV cluster of BDOF may be unreliable due to noise or irregular motion. Therefore, in BDOF, the size of the MV cluster is clipped by a threshold. The threshold is determined based on whether the reference pictures of the current picture are all from one direction. For example, if all the reference pictures of the current picture are from one direction, the value of the threshold is set to 12×2 14-d ; otherwise, set it to 12×2 13-d .

[0240] The gradients of the BDOF can be simultaneously calculated using motion compensated interpolation using operations consistent with the HEVC motion compensation process (e.g., a 2D separable finite impulse response (FIR)). In some embodiments, the input to the 2D separable FIR is the same reference frame samples as the motion compensation process and the fractional positions (fracX, fracY) according to the fractional part of the block motion vector. For the horizontal gradient The signal is first interpolated vertically using BIOfilterS corresponding to fractional position fracY with descaling offset d-8. Then a gradient filter BIOfilterG is applied in the horizontal direction, which corresponds to fractional position fracX with descaling offset 18-d. For the vertical gradient A gradient filter is first applied vertically using BIOfilterG corresponding to the fractional position fracY with a descaling offset of d-8. A signal displacement is then performed in the horizontal direction using BIOfilterS corresponding to the fractional position fracX with a descaling offset of 18-d. The length of the interpolation filter BIOfilterG for gradient calculation and the interpolation filter BIOfilterS for signal displacement can be short (e.g., 6 taps) to maintain a reasonable complexity. Table 1 shows examples of filters that can be used for gradient calculation of different fractional positions of block motion vectors in BDOF. Table 2 shows examples of interpolation filters that can be used for prediction signal generation in BIO.

[0241] Table 1: Exemplary filters for gradient calculation in BDOF (or BIO)

[0242] Fractional pixel position Gradient interpolation filter (BIOfilterG) 0 {8,-39,-3,46,-17,5} 1 / 16 {8,-32,-13,50,-18,5} 1 / 8 {7,-27,-20,54,-19,5} 3 / 16 {6,-21,-29,57,-18,5} 1 / 4 {4,-17,-36,60,-15,4} 5 / 16 {3,-9,-44,61,-15,4} 3 / 8 {1,-4,-48,61,-13,3} 7 / 16 {0,1,-54,60,-9,2} 1 / 2 {-1,4,-57,57,-4,1}

[0243] Table 2: Exemplary interpolation filters for prediction signal generation in BDOF (or BIO)

[0244] Fractional pixel position Interpolation filter for prediction signal (BIOfilterS) 0 {0,0,64,0,0,0} 1 / 16 {1,-3,64,4,-2,0} 1 / 8 {1,-6,62,9,-3,1} 3 / 16 {2,-8,60,14,-5,1} 1 / 4 {2,-9,57,19,-7,2} 5 / 16 {3,-10,53,24,-8,2} 3 / 8 {3,-11,50,29,-9,2} 7 / 16 {3,-11,44,35,-10,3} 1 / 2 {3,-10,35,44,-11,3}

[0245] In JEM, BDOF can be applied to all bi-predicted blocks when the two predictions come from different reference pictures. BDOF can be disabled when Local Illumination Compensation (LIC) is enabled for a CU.

[0246] In some embodiments, OBMC is applied to a block after a normal MC process. In order to reduce computational complexity, BDOF may not be applied during the OBMC process. This means that BDOF is applied to the MC process of a block only when its own MV is used, and is not applied to the MC process when the MV of a neighboring block is used during the OBMC process.

[0247] 2.9.1 BDOF Example in VTM-3.0

[0248] Step 1 : Determine whether BIO is applicable (W / H is the width / height of the current block)

[0249] A BIO does not apply if:

[0250] The current video block is affine codec or ATMVP codec

[0251] ·(iPOC-iPOC0)×(iPOC-iPOC1)≥0

[0252] H==4 or (W==4 and H==8)

[0253] With weighted prediction

[0254] GBi weight is not (1,1)

[0255] If the total SAD between two reference blocks (denoted as R0 and R1) is less than a threshold, BDOF is not used, where

[0256]

[0257] Step 2 : Data preparation

[0258] For a W×H block, (W+2)×(H+2) samples will be interpolated.

[0259] As with normal motion compensation, the internal W×H samples are interpolated through an 8-tap interpolation filter.

[0260] The four side outer lines of the sample point ( Fig.23 The black circles in the figure are interpolated with a bilinear filter.

[0261] For each position, the gradient is calculated over two reference patches (R0 and R1).

[0262] Gx0(x,y)=(R0(x+1,y)-R0(x-1,y))>>4

[0263] Gy0(x,y)=(R0(x,y+1)-R0(x,y-1))>>4

[0264] Gx1(x,y)=(R1(x+1,y)-R1(x-1,y))>>4

[0265] Gy1(x,y)=(R1(x,y+1)-R1(x,y-1))>>4

[0266] For each position, the internal value is calculated as follows:

[0267] T1=(R0(x,y)>>6)-(R1(x,y)>>6), T2=(Gx0(x,y)+Gx1(x,y))>>3,

[0268] T3=(Gy0(x,y)+Gy1(x,y))>>3; and

[0269] B1(x,y)=T2*T2, B2(x,y)=T2*T3, B3(x,y)=-T1*T2, B5(x,y)=T3*T3,

[0270] B6(x,y)=-T1*T3

[0271] Step 3 : Calculate the prediction for each block

[0272] If the SAD between two 4x4 reference blocks is less than a threshold, BDOF is skipped for the 4x4 block.

[0273] Calculate Vx and Vy.

[0274] Compute the final prediction for each position in the 4×4 block:

[0275] b(x,y)=(Vx(Gx 0 (x,y)-Gx 1 (x,y))+Vy(Gy 0 (x,y)-Gy 1(x,y))+1)>>1

[0276] P(x,y)=(R 0 (x,y)+R 1 (x,y)+b(x,y)+offset)>>shift

[0277] Here, b(x, y) is called a correction term.

[0278] 2.9.2 Alternative examples of BDOF (or BIO) in VTM-3.0

[0279] 8.3.4 Inter-block decoding process

[0280] --If predFlagL0 and predFlagL1 are equal to 1, DiffPicOrderCnt(currPic,refPicList0[refIdx0])*DiffPicOrderCnt(currPic,refPicList1[refIdx1])<0, MotionModelIdc[xCb][yCb] is equal to 0, and MergeModeList[merge_idx[xCb][yCb]] is not equal to SbCol, set the value of bioAvailableFlag to true (TRUE).

[0281] --Otherwise, set the value of bioAvailableFlag to FALSE.

[0282] If bioAvailableFlag equals TRUE, the following applies:

[0283] --Set the variable shift equal to Max(2,14-bitDepth).

[0284] --The variables cuLevelAbsDiffThres and subCuLevelAbsDiffThres are set equal to (1<<(bitDepth–8+shift))*cbWidth*cbHeight and 1<<(bitDepth–3+shift). The variable cuLevelSumAbsoluteDiff is set to 0.

[0285] --For xSbIdx=0..(cbWidth>>2)-1 and ySbIdx=0..(cbHeight>>2)-1, the variable subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx] and the bidirectional optical flow utilization flag bioUtilizationFlag[xSbIdx][ySbIdx] of the current sub-block are derived as follows:

[0286] subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx]=∑ i ∑ j Abs(predSamplesL0L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]-predSamplesL1L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j])with i,j=0..3

[0287] bioUtilizationFlag[xSbIdx][ySbIdx]=subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx]>=subCuLevelAbsDiffThres

[0288] cuLevelSumAbsoluteDiff+=subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx]

[0289] --If cuLevelSumAbsoluteDiff is less than cuLevelAbsDiffThres, set bioAvailableFlag to FALSE.

[0290] --If bioAvailableFlag is equal to TRUE, the prediction samples within the current luma codec subblock are derived by calling the bidirectional optical flow sample prediction process specified in Section 8.3.4.5 using the luma codec subblock width sbWidth, the luma codec subblock height sbHeight, and the sample arrays predSamplesL0L and predSamplesL1L, and the variables predFlagL0, predFlagL1, refIdxL0, refIdxL1, with xL = 0..sbWidth–1 and yL = 0..sbHeight–1, predSamplesL[xL+xSb][yL+ySb].

[0291] 8.3.4.3 Fractional Sample Interpolation Process

[0292] 8.3.4.3.1 Overview

[0293] The inputs to this process are:

[0294] – Luma position (xSb, ySb), used to specify the top left sample of the current codec subblock relative to the top left luma sample of the current picture,

[0295] – The variable sbWidth is used to specify the width of the current codec sub-block in the luminance sample point.

[0296] – The variable sbHeight is used to specify the height of the current codec sub-block in the luminance sample point.

[0297] – the luma motion vector mvLX given in units of 1 / 16 luma samples,

[0298] – the chroma motion vector mvCLX given in 1 / 32 chroma sample units,

[0299] – The selected reference picture sample arrays refPicLXL, refPicLXCb and refPicLXCr.

[0300] – Bidirectional optical flow, enable flag bioAvailableFlag.

[0301] The output of this process is:

[0302] – When bioAvailableFlag is FALSE, it is a (sbWidth) x (sbHeight) array of predicted luma sample values, predSamplesLXL, or when bioAvailableFlag is TRUE, it is a (sbWidth+2) x (sbHeight+2) array of predicted luma sample values, predSamplesLXL.

[0303] – Two (sbWidth / 2)×(sbHeight / 2) arrays of predicted chroma sample values, predSamplesLXCb and predSamplesLXCr.

[0304] Let (xIntL, yIntL) be the luma position given in full sample units, and (xFracL, yFracL) be the offset given in 1 / 16 sample units. These variables are used only in this clause to specify fractional sample positions within the reference sample arrays refPicLXL, refPicLXCb, and refPicLXCr.

[0305] When bioAvailableFlag is equal to TRUE, for each luma sample position (xL = -1..sbWidth, yL = -1..sbHeight) in the predicted luma sample array predSamplesLXL, the corresponding predicted luma sample value predSamplesLXL[xL][yL] is derived as follows:

[0306] – The variables xIntL, yIntL, xFracL and yFracL are derived as follows:

[0307] xIntL=xSb-1+(mvLX[0]>>4)+xL

[0308] yIntL=ySb-1+(mvLX[1]>>4)+yL

[0309] xFracL=mvLX[0]&15

[0310] yFracL=mvLX[1]&15

[0311] The value of –bilinearFiltEnabledFlag is derived as follows:

[0312] – If xL equals -1 or sbWidth, or yL equals -1 or sbHeight, set the value of bilinearFiltEnabledFlag to TRUE.

[0313] – Otherwise, set the value of bilinearFiltEnabledFlag to FALSE

[0314] – The predicted luma sample values ​​predSamplesLXL[xL][yL] are derived by calling the process specified in clause 8.3.4.3.2 with (xIntL, yIntL), (xFracL, yFracL), refPicLXL and bilinearFiltEnabledFlag as input.

[0315] When bioAvailableFlag is equal to FALSE, for each luma sample position (xL=0..sbWidth-1, yL=0..sbHeight-1) in the predicted luma sample array predSamplesLXL, the corresponding predicted luma sample value predSamplesLXL[xL][yL] is derived as follows:

[0316] – The variables xIntL, yIntL, xFracL and yFracL are derived as follows:

[0317] xIntL=xSb+(mvLX[0]>>4)+xL

[0318] yIntL=ySb+(mvLX[1]>>4)+yL

[0319] xFracL=mvLX[0]&15

[0320] yFracL=mvLX[1]&15

[0321] – The variable bilinearFiltEnabledFlag is set to FALSE.

[0322] – The predicted luma sample values ​​predSamplesLXL[xL][yL] are derived by calling the process specified in clause 8.3.4.3.2 with (xIntL, yIntL), (xFracL, yFracL), and refPicLXL and bilinearFiltEnabledFlag as input.

[0323] 8.3.4.5 Bidirectional Optical Flow (BDOF or BIO) Prediction Process

[0324] The inputs to this process are:

[0325] – Two variables nCbW and nCbH are used to specify the width and height of the current codec block,

[0326] – Two (nCbW+2)×(nCbH+2) brightness prediction sample arrays predSamplesL0 and predSamplesL1,

[0327] – Prediction list utilization flags, predFlagL0 and predFlagL1,

[0328] – reference indices refIdxL0 and refIdxL1,

[0329] –Bidirectional optical flow utilization flag bioUtilizationFlag[xSbIdx][ySbIdx], where xSbIdx=0..(nCbW>>2)-1, ySbIdx=0..(nCbH>>2)-1

[0330] The output of this process is a (nCbW)x(nCbH) array pbSamples of luma prediction sample values.

[0331] The variable bitDepth is set equal to BitDepthY.

[0332] The variable shift2 is set equal to Max(3,15-bitDepth) and the variable offset2 is set equal to 1<<(shift2-1).

[0333] The variable mvRefineThres is set equal to 1<<(13-bitDepth).

[0334] For xSbIdx=0..(nCbW>>2)-1 and ySbIdx=0..(nCbH>>2)-1,

[0335] – If bioUtilizationFlag[xSbIdx][ySbIdx] is FALSE, then for x = xSb..xSb+3, y = ySb..ySb+3, the predicted sample value of the current prediction unit is derived as follows:

[0336] pbSamples[x][y]=Clip3(0,(1< <bitDepth)-1,

[0337] (predSamplesL0[x][y]+predSamplesL1[x][y]+offset2)>>shift2)

[0338] – Otherwise, the predicted sample value of the current prediction unit is derived as follows:

[0339] –Relative to the upper left sample of the prediction sample arrays predSamplesL0 and predSampleL1, the position (xSb, ySb) used to specify the upper left sample of the current sub-block is derived as follows:

[0340] xSb=(xSbIdx<<2)+1

[0341] ySb=(ySbIdx<<2)+1

[0342] – For x = xSb–1..xSb+4, y = ySb-1..ySb+4, the following applies:

[0343] – Predict the position (hx, vy) of each corresponding sample point (x, y) in the sample array as follows

[0344] It is deduced that:

[0345] hx=Clip3(1,nCbW,x)

[0346] vy=Clip3(1,nCbH,y)

[0347] – The derivation of variables gradientHL0[x][y], gradientVL0[x][y], gradientHL1[x][y], and gradientVL1[x][y] is as follows:

[0348] gradientHL0[x][y] = (predSamplesL0[hx + 1][vy] – predSampleL0[hx - 1][vy]) >> 4

[0349] gradientVL0[x][y] = (predSampleL0[hx][vy + 1] - predSampleL0[hx][vy - 1]) >> 4

[0350] gradientHL1[x][y] = (predSamplesL1[hx + 1][vy] – predSampleL1[hx - 1][vy]) >> 4

[0351] gradientVL1[x][y] = (predSampleL1[hx][vy + 1] – predSampleL1[hx][vy - 1]) >> 4

[0352] – The derivation of variables temp, tempX, and tempY is as follows:

[0353] temp[x][y] = (predSamplesL0[hx][vy] >> 6) – (predSamplesL1[hx][vy] >> 6)

[0354] tempX[x][y] = (gradientHL0[x][y] + gradientHL1[x][y]) >> 3

[0355] empY[x][y] = (gradientVL0[x][y] + gradientVL1[x][y]) >> 3

[0356] – The derivation of variables sGx2, sGy2, sGxGy, sGxdI, and sGydI is as follows:

[0357] sGx2 = ∑ x ∑ y (tempX[xSb + x][ySb + y] * tempX[xSb + x][ySb + y]), where x, y = -1..4

[0358] sGy2 = ∑ x ∑ y(tempY[xSb+x][ySb+y]*tempY[xSb+x][ySb+y]), where x,y=-1..4

[0359] sGxGy=∑ x ∑ y (tempX[xSb+x][ySb+y]*tempY[xSb+x][ySb+y]), where x,y=-1..4

[0360] sGxdI=∑ x ∑ y (-tempX[xSb+x][ySb+y]*temp[xSb+x][ySb+y]), where x,y=-1..4

[0361] sGydI=∑ x ∑ y (-tempY[xSb+x][ySb+y]*temp[xSb+x][ySb+y])withx,y=-1..4

[0362] – The derivation of horizontal and vertical motion refinement of the current sub-block is as follows:

[0363] vx=sGx2>0? Clip3(-mvRefineThres,mvRefineThres,-(sGxdI<<3)>>Floor(Log2(sGx2))):0

[0364] vy=sGy2>0? Clip3(-mvRefineThres,mvRefineThres,((sGydI<<3)-((vx*sGxGym)<<12+vx*sGxGys)>>1)>>Floor(Log2(sGy2))):0

[0365] sGxGym=sGxGy>>12;

[0366] sGxGys=sGxGy&((1<<12)-1)

[0367] For x = xSb-1..xSb+2, y = ySb-1..ySb+2, the following conditions apply:

[0368] sampleEnh=Round((vx*(gradientHL1[x+1][y+1]-gradientHL0[x+1][y+1]))>>1)+Round((vy*(gradientVL1[x+1][y+1]-gradientVL0[x+1][y+1]))>>1)

[0369] pbSamples[x][y]=Clip3(0,(1<<bitDepth)-1,(predSamplesL0[x+1][y+1]+predSamplesL1[x+1][y+1]+sampleEnh+offset2)> >shift2)

[0370] 2.10 Example of Decoder-side Motion Vector Refinement (DMVR)

[0371] In the bidirectional prediction operation, for the prediction of a block area, two prediction blocks formed by using the motion vector (MV) of list0 and the MV of list1 respectively are combined to form a single prediction signal. In the decoder-side motion vector refinement (DMVR) method, the two motion vectors of the bidirectional prediction are further refined by the bilateral template matching process. Bilateral template matching is applied in the decoder to perform a distortion-based search between the bilateral template and the reconstructed samples in the reference picture in order to obtain the refined MV without transmitting additional motion information.

[0372] In DMVR, the bilateral template is generated as a weighted combination (i.e., average) of two prediction blocks from the original MV0 of list 0 and MV1 of list 1, respectively, as Fig.24 As shown. The template matching operation includes calculating the cost metric between the generated template and the sample area (around the original prediction block) in the reference picture. For each of the two reference pictures, the MV that produces the minimum template cost is considered as the updated MV of the list to replace the original MV. In JEM, nine MV candidates are searched for each list. The nine MV candidates include the original MV and 8 surrounding MVs that have a luma sample offset in the horizontal or vertical direction or in both directions from the original MV. Finally, the two new MVs, i.e. Fig.24 MV0′ and MV1′ shown in are used to generate the final bidirectional prediction result. The sum of absolute differences (SAD) is used as the cost metric. Note that when calculating the cost of a prediction block generated by a surrounding MV, the rounded MV (to integer pixels) is actually used to obtain the prediction block instead of the actual MV.

[0373] DMVR is applied to the Merge mode of bi-directional prediction, where one MV comes from the past reference picture and the other MV comes from the future reference picture, without transmitting additional syntax elements. In JEM, DMVR is not applied when LIC, affine motion, FRUC or sub-CU Merge candidate is enabled for the CU.

[0374] 3. Example embodiments related to the disclosed technology

[0375] 3.1 Example of Cross-Component Linear Model (CCLM) Prediction

[0376] To reduce cross-component redundancy, the CCLM prediction mode (also called LM) is used in JEM, for which the chrominance samples are predicted based on the reconstructed luma samples of the same CU using the following linear model:

[0377] pred C (i, j) = α·rec L ′(i, j)+β

[0378] In this paper, pred C (i, j) represents the predicted chrominance sample in CU, rec L ′(i, j) represents the reconstructed luminance sample of the same CU for the down-sampling of the color format 4:2:0 or 4:2:2, and rec L ′(i, j) represents the reconstructed luma sample of the same CU in color format 4:4:4. CCLM parameters α and β are obtained by minimizing the regression error between the adjacent reconstructed luma and chroma samples around the current block, as shown below:

[0379]

[0380] Here, L(n) represents the downsampled (for color format 4:2:0 or 4:2:2) or original (for color format 4:4:4) top and left adjacent reconstructed luma samples, C(n) represents the top and left adjacent reconstructed chroma samples, and the value of N is equal to twice the minimum of the width and height of the current chroma codec block. For square codec blocks, the above two formulas are directly applied. For non-square codec blocks, the adjacent samples of the longer boundary are first subsampled to have the same number of samples as the shorter boundary. Fig.25 The positions of the left and upper reconstructed samples are shown, as well as the samples of the current block involved in CCLM mode.

[0381] This regression error minimization calculation is performed as part of the decoding process, rather than just an encoder search operation, so no syntax is used to communicate the α and β values. The CCLM prediction mode also includes prediction between the two chrominance components, i.e., predicting the Cr component from the Cb component. The CCLM Cb to Cr prediction is applied in the residual domain, rather than using a reconstructed sample signal. This is achieved by adding the weighted reconstructed Cb residual to the original Cr intra prediction to form the final Cr prediction:

[0382]

[0383] Here, resi Cb '(i, j) represents the reconstructed Cb residual sample at position (i, j).

[0384] The scaling factor α is derived in a similar way to CCLM luma-to-chroma prediction. The only difference is that a regression cost relative to the default α value is added to the error function, so that the derived scaling factor is biased towards the default value of -0.5, as shown below:

[0385]

[0386] Here, Cb(n) represents adjacent reconstructed Cb samples, Cr(n) represents adjacent reconstructed Cr samples, and λ is equal to Σ(Cb(n)·Cb(n))>>9.

[0387] CCLM luma-to-chroma prediction mode is added as an additional chroma intra prediction mode. On the encoder side, another RD cost check for chroma components is added for selecting chroma intra prediction mode. When an intra prediction mode other than CCLM luma-to-chroma prediction mode is used for chroma components of a CU, CCLM Cb-to-Cr prediction will be used for Cr component prediction.

[0388] 3.2 Simplified CCLM Example

[0389] In some existing implementations, the LMS algorithm uses a straight line equation instead of the linear model parameters α and β. These two points (luminance and chrominance pairs) (A, B) are the minimum and maximum values ​​in a set of adjacent luminance samples, such as Fig.26 Here, the linear model parameters α and β are obtained according to the following formula:

[0390] And β=y A -αx A .

[0391] The division can be avoided by multiplying and shifting instead.

[0392] For the current VTM implementation, to derive the chrominance predictor, the multiplication is replaced by integer operations as follows:

[0393]

[0394] However, since the shift S always has the same value, this implementation is also simpler than the current VTM implementation. In terms of complexity, the proposed algorithm reduces the number of operations as shown in the following table:

[0395]

[0396] Although the number of operations is reduced, the proposed method requires several comparisons to obtain the minimum and maximum brightness values ​​of adjacent samples.

[0397] 4. Disadvantages of existing implementation methods

[0398] Some existing implementations have the following disadvantages:

[0399] (1) Both BIO and CCLM require linear regression, but they simplify it in different ways.

[0400] (2) The BIO implementation in VTM does not take POC distance into consideration.

[0401] (3) Express the velocity at Ref 0 as and Express the velocity on Ref 1 as

[0402] and In the current BIO design, it is assumed that the speed users on the two reference images are mirror images, so that and (or and However, this assumption may not be correct.

[0403] (4) Speed ​​v in BIO x and v y The derivation is oversimplified.

[0404] (5) Bio x and v y The derivation of can be combined with DMVR or decoder side motion derivation.

[0405] (6) Know v x and v y After that, the prediction / gradient on Ref 0 / Ref 1 can be further refined.

[0406] (7) An additional interpolation filter (bilinear filter) is introduced to interpolate pixels and boundaries.

[0407] (8) Some rounding and clipping operations are missing in the BIO process.

[0408] (9) The precision of internal operations can be further reduced.

[0409] (10) The SAD used for BIO calculation can be simplified.

[0410] (11) When GBi was applied, the weighting values ​​were not properly considered in the BIO derivation process.

[0411] 5. Example Method for Inter Prediction with Refinement

[0412] Embodiments of the currently disclosed technology overcome the shortcomings of existing implementations, coordinate the linear regression processes in BIO and CCLM, and propose BIO modifications to provide video codecs with higher codec efficiency. Based on the disclosed technology, the coordination of linear mode prediction can enhance existing and future video codec standards, as illustrated in the examples described below for various implementations. The examples of the disclosed technology provided below explain the general concepts and are not meant to be interpreted as limiting. In the examples, the various features described in these examples can be combined unless explicitly indicated to the contrary.

[0413] Let the reference pictures of the current pictures from list 0 and list 1 be denoted as Ref0 and Ref1, respectively, denote τ0=POC(current)-POC(Ref0), τ1=POC(Ref1)-POC(current), and denote the reference blocks of the current block from Ref0 and Ref1 as refblk0 and refblk1, respectively. For the sub-block in the current block, the original MV of its corresponding sub-block pointed to by refblk1 in refblk0 is expressed as (v x ,v y The MVs of the sub-blocks in Ref0 and Ref1 are respectively (mvL0 x ,mvL0 y ) and (mvL1 x ,mvL1 y )express.

[0414] Define Shift(x,s) as Shift(x,s)=(x+off)>>s

[0415] SignShift(x,s) is defined as:

[0416]

[0417] Here, off represents an integer offset, such as 0 or 2 s-1 .

[0418] Clip3(x,min,max) is defined as:

[0419]

[0420] Example 1. It is suggested that the linear optimization module used in BIO can be used by other codec tools in the video codec system.

[0421] (a) The linear optimization module involves a set of sample points u k ,v k ,wk ), with k (from 0 to N-1) as input and two parameters a and b as output, such that can be minimized or approximately minimized. From equations (9) and (10), we can get that in BIO:

[0422] u k =I (0) (x,y)-I (1) (x,y)

[0423]

[0424] a=v x

[0425] b=v y

[0426] Here, G x (x,y) and G y (x,y) represents the horizontal and vertical gradients respectively.

[0427] (b) In one example, the linear optimization module used in BIO is used to derive the parameters of CCLM. From equation (18) and equation (19), the notation can be written as:

[0428] u k =-C(n)

[0429] v k =L(n)

[0430] w k =1

[0431] a=α

[0432] b=β

[0433] (c) Alternatively, the linear optimization module used in another codec tool (such as CCLM) can be used to derive v in BIO x and v y .

[0434] Example 2. It is recommended whether and how to apply the BIO process depending on the POC distance.

[0435] (a) If abs(τ0) ≥ T0 or abs(τ1) ≥ T1, the BIO process is not applied. T0 and T1 are integers, for example, T0 = T1 = 4. T0 and T1 can be fixed numbers or sent from the encoder to the decoder in VPS / SPS / PPS / slice header / slice group header / slice / CTU / CU.

[0436] (b) If abs(τ0) ≥ T0 and abs(τ1) ≥ T1, the BIO process is not applied. T0 and T1 are integers, for example, T0 = T1 = 4. T0 and T1 can be fixed numbers or sent from the encoder to the decoder in VPS / SPS / PPS / slice header / slice group header / slice / CTU / CU.

[0437] (c) If abs(τ0)+abs(τ1)≥T, the BIO process is not applied. T is an integer, for example, T=8. T can be a fixed number or a signal from the encoder to the decoder in VPS / SPS / PPS / slice header / slice group header / slice / CTU / CU.

[0438] (d) If abs(abs(τ0)-abs(τ1))≥T, the BIO process is not applied. T is an integer, for example, T=8. T can be a fixed number or signaled to the decoder by the encoder in VPS / SPS / PPS / slice header / slice group header / slice / CTU / CU.

[0439] (e) If abs(τ0)≥T*abs(τ1) or abs(τ1)≥T*abs(τ0), the BIO process is not applied. T is an integer, for example, T=4. T can be a fixed number or a signaled number from the encoder to the decoder in the VPS / SPS / PPS / slice header / slice group header / slice / CTU / CU.

[0440] Example 3. The velocity vector used to refine the predictions during the BIO process is suggested to depend on the POC distance. The prediction after the BIO process is calculated as

[0441]

[0442] Among them G (0) x and G (0) y represents the horizontal and vertical gradients of Ref0, and G (0) x and G (0) y Represents the horizontal and vertical gradients of Ref0.

[0443] (i) In the BIO design of VTM-3.0, and where v x and v y is derived. Then equation (22) is the same as equation (9).

[0444] (ii) In one example:

[0445]

[0446] Herein, in HEVC, division can be implemented as multiplication and shift as a MV scaling operation.

[0447] Example 4. Instead always first assume v y Equal to 0 to derive v x , it is recommended to export v first y And based on v y To derive v x Alternatively, one can first derive v y Still v x It may depend on codec information, such as the values ​​of the horizontal and vertical components of the motion vector, the block size, etc.

[0448] Example 5. It is recommended to derive v iteratively x and v y .

[0449] a. In one example, v derived in step i x Used to derive v in step i y , and v derived in step i y Used to derive v in the i+1th step x The derivation is performed iteratively.

[0450] b. Alternatively, the v derived in step i y Used to derive v in step i x , and v derived in step i x Used to derive v in the i+1th step y The derivation is performed iteratively.

[0451] c. In the same step, v is used x To derive v y Or use v y To derive v x It may depend on codec information, such as the values ​​of the horizontal and vertical components of the motion vector, block size, etc.

[0452] d. In one example, Where s2, s5, s6 are as defined in (13). ε is an integer or a decimal, such as 1 / 2 or 1 / 4.

[0453] i. For example, the division operation can be simplified by replacing it with the MSB shift in JEM-3.0.

[0454] ii. The shear operation can be performed after the division operation.

[0455] e. In one example, where s1, s2, s3 are as defined in (13). ε is an integer or a decimal, such as 1 / 2 or 1 / 4.

[0456] i. For example, the division operation can be simplified by replacing it with the MSB shift in JEM-3.0.

[0457] ii. The shear operation can be performed after the division operation.

[0458] f. The derivation is performed iteratively until i reaches a prefix number (such as 2).

[0459] g. Alternatively, the derivation is performed iteratively until v before and after a round of derivation x and / or v y The absolute difference between them is less than the threshold.

[0460] Example 6 . You can use the v in BIO x and v y The derivation of is combined with DMVR, bilateral matching or other decoder-side motion derivation methods.

[0461] a. v derived in BIO for a block or sub-block (such as a 4×4 block) x and v y It can be used to derive the search starting point of DMVR, bilateral matching or other decoder-side motion derivation methods. Assuming the original MVs of Ref0 and Ref1 are MV0 and MV1, then marked as MV0' and MV1' as the starting point of DMVR, bilateral matching or other decoder-side motion derivation methods can be calculated as:

[0462] i. In one example, MV0'=MV0+(v x ,v y ),MV1'=MV1-(v x ,v y );

[0463] ii. In one example, MV0'=MV0-(v x ,v y ),MV1'=MV1+(v x ,v y );

[0464] iii. In one example, MV0′=MV0+Scale(v x ,v y ),MV1'=MV1-Scale(v x ,v y );

[0465] iv. In one example, MV0' = MV0-Scale (v x ,v y ),MV1'=MV1+Scale(v x ,v y );

[0466] v. In one example, MV0'=Clip(MV0+Scale(v x ,v y )),MV1'=Clip(MV1-Scale(v x ,v y ));

[0467] vi. In one example, MV0'=Clip(MV0-Scale(v x ,v y )),MV1'=Clip(MV1+Scale(v x ,v y ));

[0468] b. Alternatively, the output MV of DMVR, bilateral matching or other decoder-side motion derivation methods for blocks or sub-blocks (such as 4×4 blocks) can be used to derive v used in BIO x and v y Assuming that the original MVs of Ref0 and Ref1 are MV0 and MV1, and the output MVs are MV0' and MV1', then v x and v y Calculated as

[0469] i. In one example, (v x ,v y ) = Scale(MV0'-MV0);

[0470] ii. In one example, (v x ,v y ) = Scale(MV0-MV0');

[0471] iii. In one example, (v x ,v y )=Scale(MV1′–MV1);

[0472] iv. In one example, (v x ,v y )=Scale(MV1–MV1′);

[0473] v. In one example, (v x ,v y)=(Scale(MV0'-MV0)+Scale(MV1'-MV1)) / 2;

[0474] vi. In one example, (v x ,v y )=(Scale(MV0-MV0')+Scale(MV1–MV1')) / 2;

[0475] Example 7 . Suggested derivation of v x and v y It can be used to refine the predictions and gradients on Ref0 and Ref1. Then, the refined predictions and gradients are used to derive the new v x and v y .

[0476] a. The derivation and refinement process can be completed iteratively until v before and after a round of derivation x or v y The absolute difference between is less than a threshold value. Alternatively, the derivation and refinement process may be iteratively completed until a predetermined number of iterations is reached. For example, the number is 2.

[0477] b. Assuming that the original MVs of Ref0 and Ref1 are MV0 and MV1, the MVs represented as MV0' and MV1' can get refined predictions and gradients, which can be calculated as

[0478] i. In one example, MV0'=MV0+(v x ,v y ),MV1'=MV1-(v x ,v y );

[0479] ii. In one example, MV0'=MV0-(v x ,v y ),MV1'=MV1+(v x ,v y );

[0480] iii. In one example, MV0′=MV0+Scale(v x ,v y ),MV1'=MV1-Scale(v x ,v y );

[0481] iv. In one example, MV0' = MV0-Scale (v x ,v y ),MV1'=MV1+Scale(v x ,v y );

[0482] v. In one example, MV0'=Clip(MV0+Scale(v x ,v y )),MV1'=Clip(MV1-Scale(v x ,v y ));

[0483] vi. In one example, MV0'=Clip(MV0-Scale(v x ,v y )),MV1'=Clip(MV1+Scale(v x ,v y ));

[0484] Example 8. It is suggested that BIO can be applied to some samples in a block or a sub-block. In one example, BIO is not applied to samples located in the first / last row / first / last column.

[0485] Example 9. It is recommended to use only one interpolation filter for one color component when applying BIO.

[0486] a. In one example, when BIO is applied, only an 8-tap interpolation filter is used on the luma component.

[0487] b. Alternatively, furthermore, in order to reduce the memory bandwidth, it is suggested to limit the size / range of the samples to be extracted to be smaller than the size / range required by the interpolation filter.

[0488] c. Alternatively, furthermore, padding may be applied if some of the samples are located outside a given size / range.

[0489] d. Assuming the current block is M×N, the required size of the subsample is (M+G)×(N+G), and the required size of the L-tap interpolation filter should be (M+G+L-1)×(N+G+L-1). It is recommended that the allowed size of the integer luma samples extracted using the BIO process is (M+L-1+k)×(N+L-1+k). For example, k is 0 or 1, and k is less than G. If the interpolation process requires integer luma samples, but the extraction of integer luma samples is not allowed, the integer luma samples will be filled with adjacent luma samples.

[0490] i. Fig. 27An example of interpolation filtering in a BIO process is shown. In the example, the current block size is M×N, with M=N=8. Due to the gradient calculation, the required size of the sub-samples is (M+2)×(N+2). Therefore, the integer samples required to pass the interpolation filter are (M+2+7)×(N+2+7), which is equal to 17×17 in this example. However, only (M+7)×(N+7), which is equal to 15×15 in this example, need to be extracted integer samples. The other samples required by the interpolation filter (black circles in the filter) will be filled with adjacent extracted samples.

[0491] e. In one example, the gradient of the position (x, y) where x=-1 or y=-1 or x=W or y=H is not calculated, and BIO is not applied to these positions. Assume that the upper left corner of the current block is (0, 0) and the width / height of the current block is W / H.

[0492] f. In one example, the gradient of a position (x, y) where x=-1 or y=-1 or x=W or Y=H is calculated in a different way. For example,

[0493] ○ gradientHL0[x][y]=

[0494] (predSamplesL0[hx+1][vy]–predSampleL0[hx][vy])>>4, if hx==1, (predSamplesL0[hx][vy]–predSam pleL0[hx-1][vy])>>4, if hx==nCbW, (predSamplesL0[hx+1][vy]–predSampleL0[hx-1][vy])>>4, in other cases. ○gradientVL0[x][y]=

[0495] (predSampleL0[hx][vy+1]-predSampleL0[hx][vy])>>4, if vy==1,

[0496] (predSampleL0[hx][vy]-predSampleL0[hx][vy-1])>>4, if vy==nCbH,

[0497] (predSampleL0[hx][vy+1]-predSampleL0[hx][vy-1])>>4, in other cases. ○ gradientHL1[x][y]=

[0498] (predSamplesL1[hx+1][vy]–predSampleL1[hx][vy])>>4, if hx==1,(predSamplesL1[hx][vy]–predSampleL1[hx-1][vy])>>4, if hx==nCbW,

[0499] (predSamplesL0[hx+1][vy]–predSampleL1[hx-1][vy])>>4,other situations。○gradientVL1[x][y]=

[0500] (predSampleL1[hx][vy+1]–predSampleL1[hx][vy])>>4, if vy==1,

[0501] (predSampleL1[hx][vy]–predSampleL1[hx][vy-1])>>4, if vy==nCbH,

[0502] (predSampleL1[hx][vy+1]–predSampleL1[hx][vy-1])>>4,other circumstances。

[0503] In other examples,

[0504] ○gradientHL0[x][y]=

[0505] (predSamplesL0[hx+1][vy]–predSampleL0[hx][vy])>>3, if hx==1,(predSamplesL0[hx][vy]–predSampleL0[hx-1][vy])>>3, if hx==nCbW,(predSamplesL0[hx+1][vy]–predSampleL0[hx-1][vy])>>4, otherwise. ○gradientVL0[x][y]=

[0506] (predSampleL0[hx][vy+1]-predSampleL0[hx][vy])>>3, if vy==1,

[0507] (predSampleL0[hx][vy]-predSampleL0[hx][vy-1])>>3, if vy==nCbH,

[0508] (predSampleL0[hx][vy+1]-predSampleL0[hx][vy-1])>>4, in other cases. ○ gradientHL1[x][y]=

[0509] (predSamplesL1[hx+1][vy]–predSampleL1[hx][vy])>>3, if hx==1, (predSamplesL1[hx][vy]–predSampleL1[hx-1][vy])>>3, if hx==nCbW,

[0510] (predSamplesL0[hx+1][vy]–predSampleL1[hx-1][vy])>>4, in other cases. ○ gradientVL1[x][y]=

[0511] (predSampleL1[hx][vy+1]–predSampleL1[hx][vy])>>3, if vy==1, (predSampleL1[hx][vy]–predSampleL1[hx][vy-1])>>3, if vy==nCbH,

[0512] (predSampleL1[hx][vy+1]–predSampleL1[hx][vy-1])>>4, in other cases.

[0513] g. In one example, before calculating the gradient, the external sample point ( Fig.23 The black circles in the figure are not interpolated by filling.

[0514] i. For example, for all valid hx and vy:

[0515] predSampleL0[0][vy]=predSampleL0[1][vy],

[0516] predSampleL0[nCbW+1][vy]=predSampleL0[nCbW][vy],

[0517] predSampleL0[hx][0]=predSampleL0[hx][1],

[0518] predSampleL0[hx][nCbH+1]=predSampleL0[hx][nCbH]and

[0519] predSampleL1[0][vy]=predSampleL1[1][vy],

[0520] predSampleL1[nCbW+1][vy]=predSampleL1[nCbW][vy],

[0521] predSampleL1[hx][0]=predSampleL1[hx][1],

[0522] predSampleL1[hx][nCbH+1]=predSampleL1[hx][nCbH].

[0523] h. In one example, the gradient calculation method in the BIO and the gradient calculation method in the adaptive loop filter (ALF) are the same method.

[0524] i. In one example, the gradient calculation method of BIO in VTM-3 is also used to calculate the gradient of ALF.

[0525] ii. In one example, the gradient calculation method of ALF in VTM-3 is also used to calculate the gradient of BIO.

[0526] Example 10: The following changes are proposed to the bidirectional optical flow prediction process.

[0527] a. The gradient values ​​can be shifted by a different value other than 4. In one example, the variables gradientHL0[X][Y], gradientVL0[X][Y], gradientHL1[X][Y], and gradientVL1[X][Y] are derived as follows:

[0528] gradientHL0[x][y]=SignShift(predSamplesL0[hx+1][vy]–predSampleL0[hx-1][vy],S)

[0529] gradientVL0[x][y]=SignShift(predSampleL0[hx][vy+1]-predSampleL0[hx][vy-1],S)

[0530] gradientHL1[x][y]=SignShift(predSamplesL1[hx+1][vy]–predSampleL1[hx-1][vy],S)

[0531] gradientVL1[x][y]=SignShift(predSampleL1[hx][vy+1]–predSampleL1[hx][vy-1],S)

[0532] i. In one example, S is a fixed number such as 4 or 5.

[0533] ii. In one example, S depends on the sample bit depth. For example, S is equal to BP, where B is the sample bit depth such as 8, 10 or 12, and P is an integer such as 6.

[0534] b. The gradient value should be within a certain range. In one example, it must be ensured that the variables gradientHL0[x][y], gradientVL0[x][y], gradientHL1[x][y], and gradientVL1[x][y] are represented by K-bit integers, such as K=8 or 16.

[0535] i. For example, after derivation, the gradient is clipped to

[0536] gradientHL0[x][y]=Clip3(-2 K-1 ,2 K-1 -1, gradientHL0[x][y])

[0537] gradientVL0[x][y]=Clip3(-2 K-1 ,2 K-1 -1, gradientVL0[x][y])

[0538] gradientHL1[x][y]=Clip3(-2 K-1 ,2 K-1 -1, gradientHL1[x][y])

[0539] gradientVL1[x][y]=Clip3(-2 K-1 ,2 K-1 -1, gradientVL1[x][y])

[0540] c. The internal variables temp, tempX and tempY are derived as follows:

[0541] temp[x][y]=SignShift(predSamplesL0[hx][vy]–predSamplesL1[hx][vy],S1)

[0542] tempX[x][y]=SignShift(gradientHL0[x][y]+gradientHL1[x][y],S2)

[0543] tempY[x][y]=SignShift(gradientVL0[x][y]+gradientVL1[x][y],S3)

[0544] i. In one example, S1, S2, and S3 are fixed numbers, such as S1=6, S2=S3

[0545] =3.

[0546] ii. In one example, S1, S2, and S3 depend on the sample bit depth. For example, S1

[0547] =B-P1, S2=B-P2 and S3=B-P3, where B is the sample bit depth such as 8, 10 or 12, and P1, P2 and P3 are integers, for example, P1=4, P2=P3=7.

[0548] d. It is necessary to ensure that the internal variables temp, tempX and tempY are represented by K1-bit integers, K2-bit integers and K3-bit integers, for example, K1=8 or 16, K2=8 or 16, K3=8 or 16.

[0549] i. For example, the internal variables are trimmed after derivation to

[0550] temp[x][y]=Clip3(-2 K1-1 ,2 K1-1 -1, gradientHL0[x][y])

[0551] tempX[x][y]=Clip3(-2 K2-1 ,2 K2-1 -1, gradientVL0[x][y])

[0552] tempY[x][y]=Clip3(-2 K3-1 ,2 K3-1 -1, gradientHL1[x][y])

[0553] e. The internal variables sGx2, sGy2, sGxGy, sGxdI and sGydI should be within a certain range. In one example, it must be ensured that these variables are represented by K1-bit integers, K2-bit integers, K3-bit integers, K4-bit integers and K5-bit integers, such as K1=8 or 16, K2=8 or 16, K3=8 or 16.

[0554] i. For example, shift the internal variable right after derivation as follows

[0555] sGx2=Shift(sGx2,S1)

[0556] sGy2=Shift(sGy2,S2)

[0557] sGxGy=SignShift(sGxGy,S3)

[0558] sGxdI=SignShift(sGxdI,S4)

[0559] sGydI=SignShift(sGydI,S5)

[0560] In one example, S1, S2, S3, S4, and S5 are fixed numbers such as 4 or 5.

[0561] Alternatively, S1, S2, S3, S4 and S5 depend on the sample bit depth. For example, S1 = B-P1, S2 = B-P2, S3 = B-P3, S4 = B-P4 and S5 = B-P5, where B is the sample bit depth such as 8, 10 or 12, and P1, P2, P3, P4 and P5 are integers.

[0562] ii. For example, the internal variables are trimmed after derivation to

[0563] sGx2=Clip3(0,2 K1-1 ,sGx2)

[0564] sGy2=Clip3(0,2 K2-1 ,sGy2)

[0565] sGxGy=Clip3(-2 K3-1 ,2 K3-1 -1,sGxGy)

[0566] sGxdI=Clip3(-2 K4-1 ,2 K4-1 -1,sGxdI)

[0567] sGydI=Clip3(-2 K5-1 ,2 K5-1 -1,sGydI)

[0568] f. Derive the variables gradientHL0[x][y], gradientVL0[x][y], gradientHL1[x][y], and gradientVL1[x][y] for selected locations only.

[0569] i. In one example, they are calculated only for samples at positions (x, y) where x%Q==0. For example, Q=2

[0570] ii. In one example, they are calculated only for samples at positions (x, y) where x%Q==1. For example, Q=2

[0571] iii. In one example, they are calculated only for samples at position (x,y) where y%Q==0. For example, Q=2

[0572] iv. In one example, they are calculated only for samples at position (x,y) where y%Q==1. For example, Q=2

[0573] v. In one example, they are calculated only for samples at positions (x, y) where y%Q==0 or y%Q==3. For example, Q=4;

[0574] g. Derivation of internal variables temp[x[y], tempX[x][y], and tempY[x][y] for selected positions only:

[0575] i. In one example, they are calculated only for samples at positions (x, y) where x%Q==0. For example, Q=2;

[0576] ii. In one example, they are calculated only for samples at positions (x, y) where x%Q==1. For example, Q=2;

[0577] iii. In one example, only the sample point at position (x, y) where y%Q==0 is calculated

[0578] They. For example, Q = 2;

[0579] iv. In one example, only the sample point at position (x, y) where y%Q==1 is calculated

[0580] They. For example, Q = 2;

[0581] v. In one example, they are calculated only for samples at positions (x, y) where y%Q==0 or y%Q==3. For example, Q=4;

[0582] vi. In one example, temp[x[y], tempX[x][y] and tempY[x][y], gradientHL0[x][y], gradientVL0[x][y], gradientHL1[x][y], gradientVL1[x][y] are calculated for samples at the same position (e.g., the positions in examples gi to gv).

[0583] h. Only the internal variables sGx2, sGy2, sGxGy, sGxdI and sGydI are calculated for the cumulative sample points at the selected position. The formula is:

[0584] sGx2=∑ x ∑ y (tempX[xSb+x][ySb+y]*tempX[xSb+x][ySb+y]), and x,y∈S

[0585] sGy2=∑ x ∑ y (tempY[xSb+x][ySb+y]*tempY[xSb+x][ySb+y]), and x,y∈S

[0586] sGxGy=∑ x ∑ y (tempX[xSb+x][ySb+y]*tempY[xSb+x][ySb+y]), and x,y∈S

[0587] sGxdI=∑ x ∑ y (-tempX[xSb+x][ySb+y]*temp[xSb+x][ySb+y]), and x,y∈S

[0588] sGydI=∑ x ∑ y (-tempY[xSb+x][ySb+y]*temp[xSb+x][ySb+y]), and x,y∈S

[0589] where S is the set of selected locations.

[0590] i. In one example, the selected positions are x=0, 1, 2, 3 and y=0, 1, 2, 3;

[0591] ii. In one example, the selected positions are x=0, 2 and y=0, 1, 2, 3;

[0592] iii. In one example, the selected positions are x=1, 2 and y=0, 1, 2, 3;

[0593] iv. In one example, the selected positions are x=1,3 and y=0,1,2,3;

[0594] v. In one example, the selected positions are x=2,3 and y=0,1,2,3;

[0595] vi. In one example, the selected positions are x=0, 3 and y=0, 1, 2, 3;

[0596] vii. In one example, the selected positions are y=0, 2 and x=0, 1, 2, 3;

[0597] viii. In one example, the selected positions are y=1, 2 and x=0, 1, 2, 3;

[0598] ix. In one example, the selected positions are y=1,3 and x=0,1,2,3;

[0599] x. In one example, the selected position is y=2,3 and x=0,1,2,3;

[0600] xi. In one example, the selected position is y=0,3 and x=0,1,2,3;

[0601] xii. In one example, the selected positions are x=-1, 4 and y=-1, 0, 1, 2, 3, 4;

[0602] xiii. In one example, the selected positions are x=0, 3 and y=-1, 0, 1, 2, 3, 4;

[0603] xiv. In one example, the selected positions are x=1, 2 and y=-1, 0, 1, 2, 3, 4;

[0604] xv. In one example, the selected positions are x=-1, 1, 3 and y=-1, 0, 1, 2, 3, 4;

[0605] xvi. In one example, the selected positions are x=0, 2, 4 and y=-1, 0, 1, 2, 3, 4;

[0606] xvii. In one example, the selected positions are x=-1, 1, 2, 4 and y=-1, 0, 1, 2, 3, 4;

[0607] xviii. In one example, the selected positions are x=0, 1, 2, 3 and y=-1, 0, 1, 2, 3, 4;

[0608] xix. In one example, the selected positions are y=-1, 4 and x=-1, 0, 1, 2, 3, 4;

[0609] xx. In one example, the selected positions are y=0,3 and x=-1,0,1,2,3,4;

[0610] xxi. In one example, the selected positions are y=1, 2 and x=-1, 0, 1, 2, 3, 4;

[0611] xxii. In one example, the selected positions are y=-1, 1, 3 and x=-1, 0, 1, 2, 3, 4;

[0612] xxiii. In one example, the selected positions are y=0, 2, 4, and x=-1, 0, 1, 2, 3, 4;

[0613] xxiv. In one example, the selected positions are y=-1, 1, 2, 4 and x=-1, 0, 1, 2, 3, 4;

[0614] xxv. In one example, the selected positions are y=0, 1, 2, 3 and x=-1, 0, 1, 2, 3, 4;

[0615] i. Used to derive v x and v y The division operation is replaced by a more complex one.

[0616] i. In one example, vx=sGx2>0? Clip3(-mvRefineThres, mvRefineThres, -(sGxdI<<3)>>M): 0. Depending on the value of sGx2, M can be

[0617] Floor(Log2(sGx2)) or Ceiling(Log2(sGx2)). For example, if 3*sGx2 is greater than 2 Floor(Log2 (sGx2))+2 , then M is Ceiling(Log2(sGx2)), otherwise, M is

[0618] Floor(Log2(sGx2)). In another example, if sGx2 is greater than T, then M is

[0619] Ceiling(Log2(sGx2)), otherwise, M is Floor(Log2(sGx2)). For example,

[0620] T = (Floor (Log2 (sGx2)) + Ceiling (Log2 (sGx2))) / 2. In another example,

[0621] If sGx2*sGx2 is greater than 2 2*Floor(Log2(sGx2))+1 , then M is Ceiling(Log2(sGx2)),

[0622] Otherwise, M is Floor(Log2(sGx2)).

[0623] 1. Alternatively, vx=sGx2>0? Clip3(-mvRefineThres, mvRefineThres,-((sGxdI<<3)+Offset)>>M): 0. Offset is an integer, such as 1<<(M-1).

[0624] a.Offset can depend on sGx2.

[0625] ii. In one example, vy=sGy2>0? Clip3(-mvRefineThres,mvRefineThres,((sGydI<<3)-((vx*sGxGym)<<12+vx*sGxGys)>>1)>>M:0. Depending on the value of sGy2, M can be Floor(Log2(sGy2)) or Ceiling(Log2(sGy2)). For example, if 3*sGy2 is greater than 2 Floor(Log2(sGy2))+2 , then M is Ceiling(Log2(sGy2)), otherwise, M is Floor(Log2(sGy2)). In another example, if sGy2 is greater than T, then M is Ceiling(Log2(sGy2)), otherwise, M is Floor(Log2(sGy2)). For example, T = (Floor(Log2(sGy2)) + Ceiling(Log2(sGy2))) / 2. In another example, if sGy2*sGy2 is greater than 2 2*Floor(Log2(sGy2))+1 , then M is Ceiling(Log2(sGy2)), otherwise, M is Floor(Log2(sGy2)).

[0626] 1. Alternatively, vy=sGy2>0? Clip3(-mvRefineThres, mvRefineThres, (((sGydI<<3)-((vx*sGxGym)<<12+vx*sGxGys)>>1)+Offset)>>M: 0. Offset is an integer, such as 1<<(M-1).

[0627] a.Offset can depend on sGy2.

[0628] iii. sGxGym and sGxGys are calculated based on the sign of sGxGy. Assume that if x>=0, then sign(x)=1, and if x<0, then sign(x)=-1, then sGxGym=sign(sGxGy)*|sGxGy|>>W; sGxGys=sign(sGxGy)*(|sGxGy|&((1< <W)-1))。

[0629] 1. W can be a fixed number such as 12. Or it can depend on the sample bit depth.

[0630] iv. The division operation in the BIO process is calculated by looking up the table.

[0631] (i) The same lookup table is also used in CCLM to replace the division operation.

[0632] Example 11. The BIO on / off decision based on the whole block and sub-block SAD calculation can be simplified by calculating only the sub-block SAD calculation. Alternatively, the SAD calculation can be replaced by other rules such as MR-SAD.

[0633] Example 12. The SAD calculation in BIO is only performed on the sample points at the selected positions.

[0634] a.subCuLevelSumAbsoluteDiff[xSbIdx][SbIdx]=∑ i ∑ j Abs(predSamplesL0L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]-predSamplesL1L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]), and i, j∈S

[0635] where S is the set of selected locations.

[0636] i. In one example, the selected positions are i=0,2 and j=0,1,2,3;

[0637] ii. In one example, the selected positions are i=1, 2 and j=0, 1, 2, 3;

[0638] iii. In one example, the selected positions are i=1,3 and j=0,1,2,3;

[0639] iv. In one example, the selected positions are i=2,3 and j=0,1,2,3;

[0640] v. In one example, the selected positions are i=0,3 and j=0,1,2,3;

[0641] vi. In one example, the selected positions are j=0,2 and i=0,1,2,3;

[0642] vii. In one example, the selected positions are j=1,2 and i=0,1,2,3;

[0643] viii. In one example, the selected positions are j=1,3 and i=0,1,2,3;

[0644] ix. In one example, the selected positions are j=2,3 and i=0,1,2,3;

[0645] x. In one example, the selected positions are j=0,3 and i=0,1,2,3;

[0646] xi. In one example, the selected position is i=0,3 and j=0,3;

[0647] xii. In one example, the selected positions are i=1, 2 and j=1, 2;

[0648] b. Alternatively, subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx]=max i,j Abs(predSamplesL0L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]-predSamplesL1L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]), and i, j∈S

[0649] where S is the set of selected locations.

[0650] c. Alternatively, subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx]=min i,j Abs(predSamplesL0L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]-predSamplesL1L[(xSbIdx<<2)+1+i][(ySbIdx<<2)+1+j]) with i, j∈S

[0651] where S is the set of selected locations.

[0652] d. The threshold subCuLevelAbsDiffThres can be adaptive.

[0653] i. It can depend on codec information such as QP and POC distance.

[0654] ii. It can be sent from encoder to decoder in VPS / SPS / PPS / Slice header / Slice group header / Slice / CTU CU.

[0655] Example 13. The SAD calculation in BIO is only performed on the samples in the selected sub-block.

[0656] a. In addition, alternatively, the SAD calculation of each sub-block may only involve some samples in one sub-block.

[0657] b.cuLevelSumAbsoluteDiff=∑ xSbIdx ∑ ySbIdx subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx]with xSbIdx,ySbIdx∈S

[0658] Where S is the set of selected sub-blocks.

[0659] i. In one example, the selected position is xSbIdx%2==0;

[0660] ii. In one example, the selected position is xSbIdx%2==1;

[0661] iii. In one example, the selected position is xSbIdx%4==0;

[0662] iv. In one example, the selected position is xSbIdx==0 or xSbIdx==(cbWidth>>2)-1;

[0663] v. In one example, the selected position is xSbIdy%2==0;

[0664] vi. In one example, the selected position is xSbIdy%2==1;

[0665] vii. In one example, the selected position is xSbIdy%4==0;

[0666] viii. In one example, the selected position is xSbIdy==0 or xSbIdy==(cbHeight>>2)-1;

[0667] ix. In one example, the selected position is (xSbIdy==0 or xSbIdy==(cbHeight>>2)-1), and (xSbIdy==0 or xSbIdy==(cbHeight>>2)-1);

[0668] c.cuLevelSumAbsoluteDiff=Max xSbIdx,ySbIdx subCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx], and xSbIdx, ySbIdx∈S

[0669] d.cuLevelSumAbsoluteDiff=Min xSbIdx,ySbIdxsubCuLevelSumAbsoluteDiff[xSbIdx][ySbIdx], and xSbIdx, ySbIdx∈S

[0670] e. The threshold cuLevelAbsDiffThres can be adaptive.

[0671] i. It can depend on codec information such as QP and POC distance

[0672] ii. It may depend on the codec mode, such as AMVP mode, Merge mode or MMVD (Merge with MV Difference) mode.

[0673] iii. It can be sent from encoder to decoder in VPS / SPS / PPS / Slice header / Slice group header / Slice / CTU CU.

[0674] Example 14 For Examples 12 and 13, when other rules are used instead of SAD, the proposed method can also be applied to other situations. That is, only a part of the samples in a sub-block and / or a part of the sub-block can be considered to decide the use of BIO.

[0675] Example 15. How to derive variables in the BIO process may differ when GBi is applied or not.

[0676] a. Furthermore, alternatively, the derivation may be different for GBi with different weighting values.

[0677] b. Assuming that the weighted values ​​of Ref0 and Ref1 in the GBi process are W0 and W1, the prediction block is first weighted before deriving the variables used in the BIO process (such as SAD calculation, gradient calculation).

[0678] i. Use predSamplesL0[x][y] and predSamplesL1[x][y] to represent the two prediction blocks. W0*predSamplesL0[x][y] and predSamplesL1[x][y] and W1*predSamplesL1[x][y] are used as the input of BIO.

[0679] c. Alternatively, before deriving variables for the BIO process, pre-compute predSamplesL0[x][y] as Shift(W0*predSamplesL0[x][y],S0) and predSamplesL1[x][y] as Shift(W1*predSamplesL1[x][y],S1).

[0680] i. S0 and S1 may depend on the sample bit depth.

[0681] ii. S0 and S1 may depend on W0 and W1.

[0682] iii. S0 and S1 can be fixed numbers such as 2.

[0683] d. Alternatively, the values ​​of the correction terms may also be weighted when generating the final prediction block for a block.

[0684] i. When deriving parameters for the BIO process, in the prior art, two unweighted prediction blocks are used as input to the BIO. However, the final prediction block is generated by the weighted values ​​of the prediction blocks and the weighted values ​​of the correction terms.

[0685] ii. The weights applied to the correction terms may be the same as those used for the prediction block. Alternatively, different weights may be applied to the correction terms.

[0686] Example 16. It is recommended that the calibration item value should be within a specific range.

[0687] (a) For example, the correction term is clipped to [minCorrection, maxCorrection].

[0688] i.minCorrection and maxCorrection can be fixed, such as -32 and 32;

[0689] ii. minCorrection and maxCorrection may depend on the sample bit depth. For example, minCorrection = -(32 << (BitDepth - 8)), maxCorrection = 32 << (BitDepth - 8).

[0690] iii. minCorrection and maxCorrection may depend on the width and / or height of the block.

[0691] iv. minCorrection and maxCorrection may be signaled from the encoder to the decoder in VPS / SPS / PPS / slice header / slice group header / slice / CTU row / CTU / CU.

[0692] (b) For example, if the correction term is out of range, it is divided by a factor or right shifted.

[0693] Example 17. It is recommended that the final prediction output in BIO should be within a specific range.

[0694] (a) For example, the final prediction output in BIO is clipped to [minPred, maxPred].

[0695] i.minPred and maxPred can be fixed numbers, such as -32 and 32;

[0696] ii. minPred and maxPred may depend on the sample bit depth. For example, minPred = -

[0697] (32<<(BitDepth-8)), maxCorrection=32<<(BitDepth-8).

[0698] iii. minPred and maxPred may depend on the width and / or height of the block.

[0699] iv. minPred and maxPred may be signaled from the encoder to the decoder in VPS / SPS / PPS / slice header / slice group header / slice / CTU row / CTU / CU.

[0700] The above examples may be incorporated into the context of the methods described below, such as methods 2810 , 2820 , 2830 , 2840 , 2850 , and 2860 , which may be implemented at a video decoder or a video encoder.

[0701] Fig.28A A flow chart of an exemplary method for video processing is shown. The method 2810 includes, at step 2812, determining to use a first linear optimization model for conversion between a current block of video and a bitstream representation of the video for conversion using a first codec mode, the first linear optimization model being derived from a second linear optimization model, the second linear optimization model being used for conversion using a second codec mode.

[0702] The method 2810 includes, at step 2814, performing a conversion based on the determination.

[0703] Fig.28B A flowchart of an exemplary method for video processing is shown. The method 2820 includes, at step 2822, enabling a first prediction mode or a second prediction mode different from the first prediction mode based on one or more picture order count (POC) parameters associated with a picture of a current block of the video, the first prediction mode being a codec mode using optical flow.

[0704] The method 2820 includes, at step 2824, performing a conversion between the current block and a bitstream representation of the video based on the first mode or the second mode.

[0705] Fig.28C 2830 includes, at step 2832, continuously deriving one or more velocity vectors (v) associated with a reference picture of a current block of a video based on codec information associated with the current block of the video. x ,v y ).

[0706] Method 2830 includes, at step 2834, performing conversion between the current block and a bitstream representation of the video based on one or more velocity vectors, the codec information including the value of the horizontal component of the motion vector of the current block, the value of the vertical component of the motion vector of the current block, or the size of the current block.

[0707] Fig.28D A flowchart of an exemplary method for video processing is shown. Method 2840 includes, at step 2842, when it is determined that a codec mode using optical flow has been enabled for a current block of a video, performing a filtering operation using a single type of interpolation filter on each color component of the current block.

[0708] The method 2840 includes, at step 2844, performing a conversion between the current block and a bitstream representation of the video based on the filtering operation.

[0709] Fig.28E A flow chart of an exemplary method for video processing is shown. Method 2850 includes, at step 2852, determining a gradient value calculation algorithm using an optical flow tool for a conversion between a current block of a video and a bitstream representation of the video.

[0710] Method 2850 includes, in step 2854, performing a conversion based on the determination.

[0711] Fig.28F A flow chart of an exemplary method for video processing is shown. Method 2860 includes, at step 2862, making a decision regarding selective enabling of a codec mode using optical flow for a current block of video based on one or more sum of absolute difference (SAD) calculations of sub-blocks of the current block of video.

[0712] The method 2860 includes, at step 2864, performing a conversion between the current block and a bitstream representation of the current block based on the decision.

[0713] Figure 28G A flow chart of an exemplary method for video processing is shown. Method 2870 includes, at step 2872, deriving one or more parameters of a codec mode using optical flow for a current block of video based on selective enabling of a generalized bidirectional prediction improvement (GBi) process for the current block of video.

[0714] The method 2870 includes, at step 2874, performing conversion between the current block and a bitstream representation of the video based on one or more parameters of the encoding and decoding mode using optical flow.

[0715] Fig.28H A flowchart of an exemplary method for video processing is shown. The method 2880 includes, at step 2882, for a current block of a video encoded in a codec mode using optical flow, performing a cropping operation on a correction item of a final prediction output of the codec mode using optical flow.

[0716] The method 2880 includes, at step 2884, performing a conversion between the current block and a bitstream representation of the video based on the final prediction output.

[0717] Fig.28I A flowchart of an exemplary method for video processing is shown. The method 2890 includes, at step 2892, when it is determined that a codec mode using optical flow has been enabled for a current block of the video, performing a filtering operation using a single type of interpolation filter on each color component of the current block.

[0718] The method 2890 includes, at step 2894, performing a padding operation when it is determined that at least one sample point of the current block is outside a predetermined range.

[0719] The method 2890 includes, at step 2896, converting between the current block and a bitstream representation of the video based on the filtering operation and the padding operation.

[0720] In some embodiments, the following technical solutions may be implemented:

[0721] A1. A video processing method, comprising: determining to use a first linear optimization model for conversion between a current block of a video and a bitstream representation of the video for conversion using a first codec mode, wherein the first linear optimization model is derived from a second linear optimization model, and the second linear optimization model is used for conversion using a second codec mode; and performing the conversion based on the determination.

[0722] A2. The method according to scheme A1, wherein the second encoding and decoding mode is a bidirectional optical flow (BDOF) prediction mode.

[0723] A3. A method according to scheme A2, wherein the second linear optimization model includes as input N groups of sample points (u k ,v k ,w k ) and two output parameters a and b, and wherein the second linear optimization model minimizes or approximately minimizes

[0724]

[0725] A4. A method according to scheme A3, wherein u k =(I (0) (x,y)-I (1) (x,y)), a=v x , and b = v y , where I (i) (x, y) represents the brightness sample at pixel position (x, y) in reference frame i, and and Represent the horizontal and vertical gradients of the brightness sample points respectively.

[0726] A5. A method according to scheme A3, wherein u k = -C(n),v k =L(n),w k =1, a=α and b=β, where C(n) represents the top and left neighboring reconstructed chrominance samples, where L(n) represents the top and left neighboring reconstructed luma samples, and where α and β represent parameters of the second linear optimization model.

[0727] A6. A method according to scheme A1, wherein the second encoding and decoding mode is a cross-component linear model prediction mode.

[0728] A7. A method for video processing, comprising: enabling a first prediction mode or a second prediction mode different from the first prediction mode based on one or more picture order count (POC) parameters associated with a picture of a current block of a video, wherein the first prediction mode is a codec mode using optical flow; and performing conversion between a bitstream representation of the current block and the video based on the first mode or the second mode.

[0729] A8. The method according to scheme A7 also includes: avoiding enabling a codec mode using optical flow, wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including a current block, wherein τ0 is a difference between a picture sequence count of the current picture and a picture sequence count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is a difference between a picture sequence count of the second reference picture and a picture sequence count of the current picture (τ1=POC(R1)-POC(current)).

[0730] A9. A method according to scheme A8, wherein abs(τ0)≥T0 or abs(τ1)≥T1, wherein T0 and T1 are integers.

[0731] A10. A method according to scheme A8, wherein abs(τ0)≥T0 and abs(τ1)≥T1, wherein T0 and T1 are integers.

[0732] A11. The method according to scheme A9 or A10, wherein T0=T1=4.

[0733] A12. A method according to scheme A8, wherein abs(τ0)+abs(τ1)≥T0, wherein T0 is an integer.

[0734] A13. The method according to scheme A12, wherein T0=8.

[0735] A14. A method according to scheme A8, wherein abs(abs(τ0)-abs(τ1))≥T0, wherein T0 is an integer.

[0736] A15. The method according to scheme A14, wherein T0=0.

[0737] A16. A method according to scheme A8, wherein abs(τ0)≥abs(τ1)×T0 and abs(τ1)≥abs(τ0)×T0, wherein T0 is an integer.

[0738] A17. The method according to scheme A16, wherein T0=8.

[0739] A18. A method according to any one of schemes A9 to A17, wherein T0 is signaled in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a slice group header, a slice, a codec unit (CU) or a codec tree unit (CTU).

[0740] A19. A method according to scheme A7, wherein a codec mode using optical flow is enabled, wherein one or more velocity vectors (v x ,v y ) is based on one or more POC distances, and wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture.

[0741] A20. A method according to scheme A19, wherein τ0 is the difference between the picture sequence count of the current picture and the picture sequence count of the first reference picture (τ0=POC(current)-POC(R0)), wherein τ1 is the difference between the picture sequence count of the second reference picture and the picture sequence count of the current picture (τ1=POC(R1)-POC(current)), wherein

[0742]

[0743] in is the velocity vector of the first reference picture, and is the velocity vector of the second reference picture.

[0744] A21. A method according to scheme A19, wherein one or more velocity vectors are derived in an iterative manner.

[0745] A22. The method of claim A19, wherein the one or more velocity vectors are based on a third prediction mode, and wherein the third prediction mode is DMVR or bilateral matching.

[0746] A23. The method of scheme A22, wherein MV0 and MV1 are motion vectors for the first reference picture and the second reference picture, respectively, and wherein MV0' and MV1' are initial motion vectors for the third prediction mode.

[0747] A24. A method according to scheme A23, wherein MV0'=MV0+(v x ,v y ) and MV1' = MV1-(v x ,v y ).

[0748] A25. A method according to scheme A23, wherein MV0'=MV0-(v x ,v y ) and MV1'=

[0749] MV1+(v x ,v y ).

[0750] A26. The method of scheme A7, wherein a codec mode using optical flow is enabled and applied to a subset of samples of the current block, wherein the subset of samples does not include all samples of the current block.

[0751] A27. A method according to scheme A26, wherein the subset of samples does not include samples in the first row, last row, first column or last column of the current block.

[0752] A28. The method of claim A7, wherein a codec mode using optical flow is enabled and applied to a subset of samples of a subblock of the current block, wherein the subset of samples is not identical to all samples of the subblock of the current block.

[0753] A29. A method according to scheme A28, wherein the subset of samples does not include samples in the first row, last row, first column or last column of the sub-block of the current block.

[0754] A30. A method according to any one of schemes A1-A29, wherein the encoding and decoding mode using optical flow is a bidirectional optical flow (BDOF) prediction mode.

[0755] A31. A method of video processing, comprising:

[0756] Based on the codec information associated with the current block of the video, one or more speed vectors (v x ,v y );as well as

[0757] Based on the one or more velocity vectors, performing a conversion between the current block and a bitstream representation of the video,

[0758] The coding information includes the value of the horizontal component of the motion vector of the current block, the value of the vertical component of the motion vector of the current block, or the size of the current block.

[0759] A32. A method according to scheme A31, wherein v is first derived y , and based on v y The value of v x .

[0760] A33. The method according to scheme A31, further comprising:

[0761] Refining at least one prediction or at least one gradient of a reference picture based on the one or more velocity vectors; and

[0762] After refinement, one or more velocity vectors are derived based on the reference picture.

[0763] A34. A method according to scheme A33, wherein the refinement and derivation are performed multiple times until the difference between consecutive values ​​of one of the one or more velocity vectors is less than a predetermined threshold.

[0764] A35. A method according to any one of schemes A1 to A34, wherein the conversion generates the current block from a bitstream representation.

[0765] A36. A method according to any one of schemes A1 to A34, wherein the conversion generates a bitstream representation from the current block.

[0766] A37. An apparatus in a video system, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement a method according to one or more of schemes A1 to A36.

[0767] A38. A computer program product stored on a non-transitory computer-readable medium, the computer program product comprising a program code for performing one or more methods according to schemes A1 to A36.

[0768] In some embodiments, the following technical solutions may be implemented:

[0769] B1. A method for video processing, comprising: when it is determined that a codec mode using optical flow has been enabled for a current block of a video, performing a filtering operation on each color component of the current block using a single type of interpolation filter; and based on the filtering operation, performing conversion between the current block and a bitstream representation of the video.

[0770] B2. The method according to scheme B1, wherein the color component includes a luminance component, and the single type of interpolation filter includes an 8-tap interpolation filter.

[0771] B3. The method according to scheme B1, wherein a first number of samples of the current block used for the filtering operation is less than a second number of samples required for a single type of interpolation filter, thereby reducing the memory bandwidth of the filtering operation.

[0772] B4. The method according to scheme B3, wherein, when the coding mode using optical flow is not applied, the second number of samples is equal to the number of samples of the current block used for the filtering operation.

[0773] B5. The method according to scheme B1, wherein a plurality of samples of the current block are used for a filtering operation, and wherein the method further comprises: performing a padding operation when it is determined that a coding mode using optical flow is applied.

[0774] B6. A method according to scheme B1, wherein the size of the current block is M×N, wherein the first number of samples required for gradient calculation is (M+G)×(N+G), wherein a single type of interpolation filter includes L taps, wherein the second number of samples required for the filtering operation is (M+G+L-1)×(N+G+L-1), wherein the third number of samples used for the filtering operation is (M+L-1+k)×(N+L-1+k), wherein M, N, G and L are positive integers, wherein k is an integer less than G, and wherein a fourth number of samples including the difference between the second number of samples and the third number of samples is filled.

[0775] B7. A method according to scheme B6, wherein M=N=8, L=8 and G=2.

[0776] B8. The method according to scheme B6 or B7, wherein k=0 or k=1.

[0777] B9. The method according to scheme B1, wherein the coordinates of the upper left pixel of the current block are (0,0), and wherein the method further comprises:

[0778] Avoid calculating gradient values ​​and apply the codec mode using optical flow to pixels at predetermined locations.

[0779] B10. A method according to scheme B9, wherein the x coordinate of the predetermined position is -1 or W, wherein W is the width of the current block, and wherein W is a positive integer.

[0780] B11. A method according to scheme B9, wherein the y coordinate of the predetermined position is -1 or H, wherein H is the height of the current block, and wherein H is a positive integer.

[0781] B12. A method according to scheme B1, wherein the coordinates of the upper left pixel of the current block are (0,0), and wherein the method further comprises: modifying the calculation of the gradient value for the pixel in the predetermined position.

[0782] B13. A method according to scheme B12, wherein the x coordinate of the predetermined position is -1 or W, wherein W is the width of the current block, and wherein W is a positive integer.

[0783] B14. A method according to scheme B12, wherein the y coordinate of the predetermined position is -1 or H, wherein H is the height of the current block, and wherein H is a positive integer.

[0784] B15. The method according to scheme B13 or B14, wherein the calculation of the gradient value comprises:

[0785]

[0786] where W is the width of the current block, where predSampleL0 is an array comprising luma prediction samples of the current block in reference list L0, where gradientHL0 is the horizontal component of the gradient value derived from reference list L0, and where hx and vy are integer coordinate indices.

[0787] B16. A method according to scheme B13 or B14, wherein the calculation of the gradient value comprises:

[0788]

[0789] where W is the width of the current block, where predSampleL0 is an array comprising luma prediction samples from the current block, where gradientVL0 is the vertical component of the gradient value derived from reference list L0, and where hx and vy are integer coordinate indices.

[0790] B17. The method according to scheme B1 further includes: before calculating the gradient value, filling one or more external sample points of the current block instead of interpolating the one or more external sample points.

[0791] B18. The method of scheme B1, wherein the one or more gradient calculations used in the codec mode using optical flow are the same as those used in the adaptive loop filter (ALF).

[0792] B19. A method for video processing, comprising: when it is determined that a codec mode using optical flow has been enabled for a current block of a video, performing a filtering operation on each color component of the current block using a single type of interpolation filter; when it is determined that at least one sample point of the current block is outside a predetermined range, performing a filling operation; and based on the filtering operation and the filling operation, converting between bitstream representations of the current block and the video.

[0793] B20. A method according to scheme B19, wherein a filling operation is performed before performing the gradient calculation.

[0794] B21. A method according to scheme B19, wherein the predetermined range is based on the height or width of the current block.

[0795] B22. A method according to any one of schemes B1 to B21, wherein the encoding and decoding mode using optical flow includes a bidirectional optical flow (BDOF) prediction mode.

[0796] B23. A method according to any one of schemes B1 to B22, wherein the conversion generates the current block from a bitstream representation.

[0797] B24. A method according to any one of schemes B1 to B22, wherein the conversion generates a bitstream representation from the current block.

[0798] B25. An apparatus in a video system, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement one or more methods of schemes B1 to B24.

[0799] B26. A computer program product stored on a non-transitory computer-readable medium, the computer program product comprising a program code for executing one or more methods of schemes B1 to B24.

[0800] In some embodiments, the following technical solutions may be implemented:

[0801] C1. A video processing method, comprising: determining a gradient value calculation algorithm using an optical flow tool for a conversion between a current block of a video and a bitstream representation of the video; and performing the conversion based on the determination, wherein the gradient value calculation algorithm is different from a conventional gradient value calculation algorithm, comprising:

[0802] gradientHL0[x][y]=(predSampleL0[hx+1][vy]–predSampleL0[hx-1][vy])>>4,

[0803] gradientVL0[x][y]=(predSampleL0[hx][vy+1]–predSampleL0[hx][vy–1])>>4,

[0804] gradientHL1[x][y]=(predSampleL1[hx+1][vy]–predSampleL1[hx–1][vy])>>4, and

[0805] gradientVL1[x][y]=(predSampleL1[hx][vy+1]–predSampleL1[hx][vy-1])>>4,

[0806] wherein gradientHL0 is the horizontal component of the gradient value derived from reference list L0, wherein gradientVL0 is the vertical component of the gradient value derived from reference list L0, wherein gradientHL1 is the horizontal component of the gradient value derived from reference list L1, wherein gradientVL1 is the vertical component of the gradient value derived from reference list L1, wherein predSampleL0 is an array including luma prediction samples for the current block in reference list L0, wherein predSampleL1 is an array including luma prediction samples for the current block in reference list L1, and wherein hx and vy are integer coordinate indices.

[0807] C2. A method according to scheme C1, wherein modifying the gradient value calculation includes: shifting the gradient value by a predetermined positive integer (S), and wherein S≠4.

[0808] C3. A method according to scheme C2, wherein S=6.

[0809] C4. A method according to scheme C2, wherein S=BP, wherein B is the bit depth of the samples of the current block, and wherein P is a positive integer.

[0810] C5. The method according to scheme C4, wherein P=6, and wherein B=8 or 12.

[0811] C6. A method according to scheme C1, wherein modifying the gradient value calculation includes: clipping the gradient value so that the gradient value can be represented as a K-bit integer, and wherein K is a positive integer.

[0812] C7. A method according to scheme C6, wherein K=8 or 16.

[0813] C8. A method according to scheme C1, wherein the gradient value calculation algorithm of the optical flow tool includes calculation of a first internal variable (temp), a second internal variable (tempX) and a third internal variable (tempY), and wherein the calculation is defined as:

[0814] temp[x][y]=SignShift(predSampleL0[hx][vy]–predSampleL1[hx][vy],S1),

[0815] tempX[x][y]=SignShift(gradientHL0[x][y]+gradientHL1[x][y],S2), and

[0816] tempY[x][y]=SignShift(gradientVL0[x][y]+gradientVL1[x][y],S3),

[0817] where S1, S2, and S3 are integers, and where SignShift(x,s) is defined as:

[0818]

[0819] where off is an integer.

[0820] C9. A method according to scheme C8, wherein S1=6 and S2=S3=3.

[0821] C10. The method according to scheme C8, wherein S1, S2 and S3 are based on the sample bit depth of the current block (B).

[0822] C11. A method according to scheme C10, wherein S1=B-P1, S2=B-P2 and S3=B-P3, wherein P1, P2 and P3 are integers.

[0823] C12. The method according to scheme C11, wherein B=8, 10 or 12, and wherein P1=4 and P2=P3=7.

[0824] C13. A method according to scheme C1, wherein the gradient value calculation algorithm of the optical flow tool includes: calculating a first internal variable (temp), a second internal variable (tempX) and a third internal variable (tempY) represented by a K1-bit integer, a K2-bit integer and a K3-bit integer, respectively, and wherein K1, K2 and K3 are positive integers.

[0825] C14. The method according to scheme C13, wherein K1=8 or 16, K2=8 or 16 and K3=8 or 16.

[0826] C15. A method according to scheme C13 or C14, wherein a clipping operation defined as follows is performed after calculating temp, tempX and tempY:

[0827] temp[x][y]=Clip3(-2 K1-1 ,2 K1-1 -1, gradientHL0[x][y]),

[0828] tempX[x][y]=Clip3(-2 K2-1 ,2 K2-1 -1, gradientVL0[x][y]), and

[0829] tempY[x][y]=Clip3(-2 K3-1 ,2 K3-1 -1, gradientHL1[x][y]),

[0830] Where Clip3(x,min,max) is defined as:

[0831]

[0832] C16. A method according to scheme 1, wherein the gradient value calculation algorithm of the optical flow tool includes: calculation of multiple internal variables, the multiple internal variables include sGx2, sGy2, sGxGy, sGxdI and sGydI represented by K1-bit integers, K2-bit integers, K3-bit integers, K4-bit integers and K5-bit integers respectively, and wherein K1, K2, K3, K4 and K5 are positive integers.

[0833] C17. A method according to scheme C16, wherein K1=8 or 16, K2=8 or 16, K3=8 or 16, K4=8 or 16 and K5=8 or 16.

[0834] C18. A method according to schemes C16 and C17, wherein the calculation of sGx2, sGy2, sGxGy, sGxdI and sGydI is followed by a shift operation defined as follows:

[0835] sGx2=Shift(sGx2,S1),

[0836] sGy2=Shift(sGy2,S2),

[0837] sGxGy=SignShift(sGxGy,S3),

[0838] sGxdI=SignShift(sGxdI,S4), and

[0839] sGydI=SignShift(sGydI,S5),

[0840] Where S1, S2, S3, S4 and S5 are positive integers,

[0841] Where Shift(x,s)=(x+off)>>s, and where SignShift(x,s) is defined as:

[0842]

[0843] where off is an integer.

[0844] C19. The method according to scheme C18, wherein S1, S2, S3, S4 and S5 are equal to 4 or 5.

[0845] C20. A method according to scheme C18, wherein S1, S2, S3, S4 and S5 are based on the sample point bit depth of the current block (B).

[0846] C21. A method according to scheme C8, wherein S1=B-P1, S2=B-P2, S3=B-P3, S4=B-P4 and S5=B-P5, wherein P1, P2, P3, P4 and P5 are integers.

[0847] C22. The method according to scheme C21, wherein B=8, 10 or 12.

[0848] C23. A method according to schemes C16 and C17, wherein the calculation of sGx2, sGy2, sGxGy, sGxdI and sGydI is followed by a clipping operation defined as follows:

[0849] sGx2=Clip3(0,2 K1 -1,sGx2),

[0850] sGy2=Clip3(0,2 K2 -1,sGy2),

[0851] sGxGy=Clip3(-2 K3-1 ,2K3-1 -1,sGxGy),

[0852] sGxdI=Clip3(-2 K4-1 ,2 K4-1 -1,sGxdI), and

[0853] sGydI=Clip3(-2 K5-1 ,2 K5-1 -1,sGydI),

[0854] Where Clip3(x,min,max) is defined as:

[0855]

[0856] C24. A method according to any one of schemes C1 to C23, wherein the optical flow tool includes a bidirectional optical flow (BDOF) tool.

[0857] C25. A video processing method, comprising: making a decision about selectively enabling a bidirectional optical flow (BDOF) prediction mode for a current block of a video based on one or more sum of absolute differences (SAD) calculations of sub-blocks of a current block of the video; and based on the decision, performing a conversion between a current block and a bitstream representation of the current block.

[0858] C26. A method according to scheme C25, wherein the SAD calculation includes a mean-removed sum of absolute differences (MR-SAD) calculation.

[0859] C27. A method according to scheme C25 or C26, wherein the SAD calculation is performed on samples in predetermined positions in the current block.

[0860] C28. A method according to scheme C25 or C26, wherein the SAD calculation is performed on samples in predetermined positions in a sub-block of the current block.

[0861] C29. A video processing method, comprising: selectively enabling a general bidirectional prediction improvement (GBi) process for a current block of a video, deriving one or more parameters of a codec mode using optical flow for the current block; and performing conversion between a bitstream representation of the current block and the video based on one or more parameters of the codec mode using optical flow.

[0862] C30. A video processing method, comprising: for a current block of a video encoded and decoded in a codec mode using optical flow, performing a cropping operation on a correction item of a final prediction output of the codec mode using optical flow; and based on the final prediction output, performing conversion between the current block and a bitstream representation of the video.

[0863] C31. A method according to scheme C30, wherein the correction term is clipped to the range [minCorrection, maxCorrection], where minCorrection and maxCorrection are integers.

[0864] C32. A method according to scheme C31, wherein minCorrection=-32 and maxCorrection=32.

[0865] C33. A method according to scheme C31, wherein minCorrection and maxCorrection are based on the sample bit depth.

[0866] C34. A method according to scheme C31, wherein minCorrection and maxCorrection are based on the height or width of the current block of the video.

[0867] C35. A method according to scheme C31, wherein minCorrection and maxCorrection are signaled in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a slice group header, a slice, a codec unit (CU) or a codec tree unit (CTU).

[0868] C36. A method according to scheme C30, wherein the final prediction output is clipped to the range [minPred, maxPred], where minPred and maxPred are integers.

[0869] C37. A method according to scheme C36, wherein minPred=-32 and maxPred=32.

[0870] C38. A method according to scheme C36, wherein midPred and maxPred are based on the sample bit depth.

[0871] C39. A method according to scheme C36, wherein midPred and maxPred are based on the height or width of the current block of the video.

[0872] C40. A method according to scheme C36, wherein midPred and maxPred are signaled in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a slice group header, a slice, a codec unit (CU) or a codec tree unit (CTU).

[0873] C41. A method according to any one of schemes C30 to C40, wherein the correction term includes a prediction offset derived based on samples of a coding mode using optical flow.

[0874] C42. A method according to any one of schemes C25 to C41, wherein the encoding and decoding mode using optical flow includes a bidirectional optical flow (BDOF) prediction mode.

[0875] C43. A method according to any one of schemes C1 to C42, wherein the conversion generates the current block from a bitstream representation.

[0876] C44. A method according to any one of schemes C1 to C42, wherein the conversion generates a bitstream representation from the current block.

[0877] C45. An apparatus in a video system, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to implement a method according to one or more of schemes C1 to C44.

[0878] C46. A computer program product stored on a non-transitory computer-readable medium, the computer program product comprising a program code for performing a method according to one or more of schemes C1 to C44.

[0879] 6. Example Implementations of the Disclosed Technology

[0880] Fig.29 is a block diagram of a video processing device 2900. Device 2900 may be used to implement one or more methods described herein. Device 2900 may be embodied in a smartphone, a tablet computer, a computer, an Internet of Things (IoT) receiver, etc. Device 2900 may include one or more processors 2902, one or more memories 3704, and video processing hardware 2906. Processor 2902 may be configured to implement one or more methods described herein (including but not limited to method 2800). Although some embodiments may operate without memory, (one or more) memories 2904 may be used to store data and code for implementing the methods and techniques described herein. Video processing hardware 2906 may be used to implement some of the techniques described in this document in hardware circuits.

[0881] In some embodiments, the video encoding and decoding method can use Fig.29 The described apparatus is implemented on a hardware platform.

[0882] Some embodiments of the disclosed technology include making a decision or determining to enable a video processing tool or mode. In an example, when a video processing tool or mode is enabled, the encoder will use or implement the tool or mode in the processing of a video block, but will not necessarily modify the resulting bitstream based on the use of the tool or mode. In other words, the conversion from a video block to a bitstream representation of a video will use the video processing tool or mode when enabling the video processing tool or mode based on a decision or determination. In another example, when a video processing tool or mode is enabled, the decoder will process the bitstream based on the video processing tool or mode when it is known that the bitstream has been modified. In other words, the video processing tool or mode enabled based on a decision or determination will be used to perform the conversion from the bitstream representation of a video to a video block.

[0883] Some embodiments of the disclosed technology include making a decision or determination to disable a video processing tool or mode. In an example, when a video processing tool or mode is disabled, the encoder will not use the tool or mode in the conversion of video blocks to a bitstream representation of the video. In another example, when a video processing tool or mode is disabled, the decoder will process the bitstream knowing that the bitstream has not been modified using the video processing tool or mode enabled based on the decision or determination.

[0884] Fig.30 3000 is a block diagram illustrating an example video processing system 3000 in which various techniques disclosed herein may be implemented. Various implementations may include some or all of the components of system 3000. System 3000 may include an input 3002 for receiving video content. The video content may be received in a raw or uncompressed format (e.g., 8 or 10-bit multi-component pixel values), or may be received in a compressed or encoded format. Input 3002 may represent a network interface, a peripheral bus interface, or a storage interface. Examples of network interfaces include wired interfaces (such as Ethernet, passive optical networks (PONs), etc.) and wireless interfaces (such as Wi-Fi or cellular interfaces).

[0885] System 3000 may include a codec component 3004 that can implement various codecs or encoding methods described herein. Codec component 3004 can reduce the average bit rate of the video from the input 3002 of codec component 3004 to the output to generate the codec representation of the video. Therefore, codec technology is sometimes referred to as video compression or video transcoding technology. As represented by component 3006, the output of codec component 3004 can be stored or sent via the connected communication. The storage or transmitted bitstream (or codec) representation of the video received at input 3002 can be used by component 3008 to generate pixel values ​​or displayable video sent to display interface 3010. The process of generating user-visible video from bitstream representation is sometimes referred to as video decompression. In addition, although some video processing operations are referred to as "codec" operations or tools, it should be understood that codec tools or operations are used at the encoder, and the corresponding decoding tools or operations of the reverse codec results will be performed by the decoder.

[0886] Examples of peripheral bus interfaces or display interfaces may include Universal Serial Bus (USB) or High Definition Multimedia Interface (HDMI) or Displayport, etc. Examples of storage interfaces include SATA (Serial Advanced Technology Attachment), PCI, IDE interfaces, etc. The technology described herein may be embodied in various electronic devices, such as mobile phones, laptop computers, smart phones, or other devices capable of performing digital data processing and / or video display.

[0887] From the foregoing, it can be understood that specific embodiments of the presently disclosed technology have been described herein for illustrative purposes, but various modifications may be made without departing from the scope of the invention. Accordingly, the presently disclosed technology is not to be limited, except as set forth in the appended claims.

[0888] The implementation and functional operation of the subject matter described in this patent document can be implemented in various systems, digital electronic circuits, or in computer software, firmware or hardware, including the structures disclosed in this specification and their structural equivalents, or in one or more combinations thereof. The visual aspects of the subject matter described in this specification can be implemented as one or more computer program products, that is, one or more temporary and non-temporary computer program instruction modules encoded on a computer-readable medium, for being run by a data processing device or controlling the operation of a data processing device. The computer-readable medium can be a machine-readable storage device, a machine-readable storage substrate, a memory device, a composition of matter that affects a machine-readable propagation signal, or a combination of one or more of them. The terms "data processing unit" and "data processing device" include all devices, equipment and machines for processing data, including, for example, a programmable processor, a computer or multiple processors or computers. In addition to hardware, the device may include code that creates an operating environment for the computer program in question, for example, code that constitutes processor firmware, a protocol stack, a database management system, an operating system, and one or more combinations thereof.

[0889] A computer program (also referred to as a program, software, software application, script, or code) may be written in any form of programming language (including compiled or interpreted languages) and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program does not necessarily correspond to a file in a file system. A program may be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or portions of code). A computer program may be deployed for execution on one or more computers located at one site or distributed across multiple sites and interconnected by a communications network.

[0890] The processes and logic flows described in this specification may be performed by one or more programmable processors running one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows may also be performed by, and the apparatus may be implemented as, special purpose logic circuitry, such as an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit).

[0891] For example, processors suitable for running computer programs include general and special microprocessors, and any one or more processors of any type of digital computer. Typically, the processor will receive instructions and data from a read-only memory or a random access memory or both. The basic elements of a computer are a processor that executes instructions and one or more storage devices that store instructions and data. Typically, a computer will also include one or more large-capacity storage devices for storing data, such as a magnetic disk, a magneto-optical disk, or an optical disk, or be operably coupled to one or more large-capacity storage devices to receive data from it or to transmit data to it, or both. However, a computer does not necessarily need to have such a device. Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, including, for example, semiconductor memory devices, such as EPROM, EEPROM, and flash memory devices. The processor and memory can be supplemented by a dedicated logic circuit, or incorporated into a dedicated logic circuit.

[0892] Intended to combine the instructions and the Figure 1 The foregoing descriptions are to be considered exemplary only, where exemplary means example. As used herein, the use of "or" is intended to include "and / or" unless the context clearly indicates otherwise.

[0893] Although this patent document contains many details, they should not be interpreted as limitations on any invention or the scope of what is claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features described in this patent document in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various functions described in the context of a single embodiment may also be implemented separately in multiple embodiments, or in any suitable subcombination. In addition, although features may be described as working in certain combinations and even initially claimed as such, in some cases one or more features in the combination may be deleted from the claimed combination, and the claimed combination may be directed to a subcombination or a variation of a subcombination.

[0894] Likewise, although operations are described in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order or sequential order shown, or that all of the operations shown be performed, in order to achieve the desired results. In addition, the separation of various system components in the embodiments described in this patent document should not be understood as requiring such separation in all embodiments.

[0895] Only some implementations and examples are described, and other implementations, enhancements, and variations can be made based on what is described and illustrated in this patent document.

Claims

1. A method for encoding and decoding video data, comprising: determining, based on one or more picture order count (POC) parameters associated with a picture of a current video block of a video, whether a first prediction mode can be applied, wherein in the first prediction mode, prediction samples of the current video block are refined based on at least gradients in different directions; Based on the determination, performing conversion between the current video block and a bitstream of the video; wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current video block, wherein τ0 is a difference between a picture order count of the current picture and a picture order count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is a difference between a picture order count of the second reference picture and a picture order count of the current picture (τ1=POC(R1)-POC(current)), In response to abs(abs(τ0)-abs(τ1))≥T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0 is greater than 0, or In response to abs(τ0)>abs(τ1)×T0 or abs(τ1)>abs(τ0)×T0, the first prediction mode is avoided from being enabled, wherein T0 is an integer and T0=1.

2. The method according to claim 1, wherein: T0 is signaled in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a slice group header, a slice, a codec unit (CU), or a codec tree unit (CTU).

3. The method according to claim 1, wherein: The first prediction mode is a bidirectional optical flow (BDOF) prediction mode.

4. The method according to claim 1, wherein: The converting includes decoding the current video block from the bitstream.

5. The method according to claim 1, wherein: The converting includes encoding the current video block into the bitstream.

6. The method according to claim 1, comprising: Determining to use a first linear optimization model for conversion between a current block of a video and a bitstream of the video for conversion using a first codec mode, wherein the first linear optimization model is derived from a second linear optimization model, and the second linear optimization model is used for conversion using a second codec mode; and Based on the determination, the converting is performed.

7. The method according to claim 6, wherein: The second encoding and decoding mode is a bidirectional optical flow (BDOF) prediction mode.

8. The method according to claim 7, wherein: The second linear optimization model includes as input N groups of sample points (u k ,v k ,w k ) and two output parameters a and b, and wherein the second linear optimization model minimizes or approximately minimizes 9. The method according to claim 8, wherein u k =(I (0) (x,y)-I (1) (x,y)), a=v x , and b = v y , where I (i) (x, y) represents the brightness sample at pixel position (x, y) in reference frame i, and and Respectively represent the horizontal gradient and vertical gradient of the brightness sample.

10. The method according to claim 8, wherein: u k = -C(n),v k =L(n),w k =1, a=α and b=β, where C(n) represents the top and left adjacent reconstructed chrominance samples, where L(n) represents the top and left adjacent reconstructed luminance samples, and where α and β represent parameters of the second linear optimization model.

11. The method according to claim 6, wherein: The second coding mode is a cross-component linear model prediction mode.

12. The method according to claim 1, comprising: Based on one or more picture order count (POC) parameters associated with a picture of a current block of a video, enable a first prediction mode or a second prediction mode different from the first prediction mode, wherein the first prediction mode is a codec mode using optical flow; and Based on the first prediction mode or the second prediction mode, conversion between the current block and a bitstream of the video is performed.

13. The method according to claim 12, further comprising: Avoid enabling the codec modes that use optical flow. Wherein, a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current block, wherein τ0 is the difference between the picture sequence count of the current picture and the picture sequence count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is the difference between the picture sequence count of the second reference picture and the picture sequence count of the current picture (τ1=POC(R1)-POC(current)).

14. The method according to claim 13, wherein: abs(τ0)≥T0 or abs(τ1)≥T1, where T0 and T1 are integers.

15. The method according to claim 13, wherein: abs(τ0)≥T0 and abs(τ1)≥T1, where T0 and T1 are integers.

16. The method according to claim 14 or 15, wherein: T0=T1=4.

17. The method according to claim 13, wherein: abs(τ0)+abs(τ1)≥T0, where T0 is an integer.

18. The method according to claim 17, wherein: T0=8。 19. The method according to claim 13, wherein: abs(abs(τ0)-abs(τ1))≥T0, where T0 is an integer.

20. The method according to claim 19, wherein: T0=0。 21. The method according to claim 13, wherein: abs(τ0)≥abs(τ1)×T0 and abs(τ1)≥abs(τ0)×T0, where T0 is an integer.

22. The method according to claim 21, wherein: T0=8。 23. The method according to any one of claims 14-15 and 17 to 22, wherein: T0 is signaled in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a slice group header, a slice, a codec unit (CU), or a codec tree unit (CTU).

24. The method according to claim 12, wherein: The encoding and decoding mode using optical flow is enabled, wherein one or more velocity vectors (v x ,v y ) is based on the one or more POC distances, and wherein a first reference picture (R0) and a second reference picture (R1) are associated with the current picture.

25. The method according to claim 24, wherein: τ0 is the difference between the picture order count of the current picture and the picture order count of the first reference picture (τ0=POC(current)-POC(R0)), where τ1 is the difference between the picture order count of the second reference picture and the picture order count of the current picture (τ1=POC(R1)-POC(current)), where in is the velocity vector of the first reference picture, is the velocity vector of the second reference picture.

26. The method according to claim 24, wherein: The one or more velocity vectors are derived in an iterative manner.

27. The method according to claim 24, wherein: The one or more velocity vectors are based on a third prediction mode, and wherein the third prediction mode is DMVR or bilateral matching.

28. The method according to claim 27, wherein: MV0 and MV1 are motion vectors for the first reference picture and the second reference picture, respectively, and wherein MV0' and MV1' are initial motion vectors for the third prediction mode.

29. The method according to claim 28, wherein: MV0'=MV0+(v x ,v y ) and MV1'=MV1-(v x ,v y ).

30. The method of claim 28, wherein: MV0'=MV0-(v x ,v y ) and MV1'=MV1+(v x ,v y ).

31. The method of claim 12, wherein: The codec mode using optical flow is enabled and applied to a subset of samples of the current block, wherein the subset of samples does not include all samples of the current block.

32. The method according to claim 31, wherein: The subset of samples does not include samples in the first row, the last row, the first column or the last column of the current block.

33. The method of claim 12, wherein: The codec mode using optical flow is enabled and applied to a subset of samples of a subblock of the current block, wherein the subset of samples is not identical to all samples of the subblock of the current block.

34. The method of claim 33, wherein: The subset of samples does not include samples in the first row, the last row, the first column or the last column of the sub-block of the current block.

35. The method according to any one of claims 12-15, 17-22 and 24-34, wherein The encoding and decoding mode using optical flow is a bidirectional optical flow (BDOF) prediction mode.

36. The method of claim 1, comprising: Based on the codec information associated with a current block of the video, one or more speed vectors (v) associated with a reference picture of the current block are continuously derived. x ,v y );as well as performing a conversion between the current block and a bitstream of the video based on the one or more velocity vectors, The coding information includes a value of a horizontal component of a motion vector of the current block, a value of a vertical component of the motion vector of the current block, or a size of the current block.

37. The method of claim 36, wherein v is first derived y , and based on v y The value of v x .

38. The method of claim 37, further comprising: refining at least one prediction or at least one gradient of the reference picture based on the one or more velocity vectors; as well as After refinement, one or more velocity vectors are derived based on the reference picture.

39. The method of claim 38, wherein: The refining and deriving are performed multiple times until a difference between consecutive values ​​of one of the one or more velocity vectors is less than a predetermined threshold.

40. The method according to any one of claims 6-15, 17-22, 24-34, 36-39, wherein: The converting includes decoding a current block from the bitstream.

41. The method according to any one of claims 6-15, 17-22, 24-34, 36-39, wherein: The converting includes encoding the current block into the bitstream.

42. An apparatus in a video system, comprising a processor and a non-transitory memory having instructions thereon, wherein: The instructions, when executed by the processor, cause the processor to implement the method according to any one of claims 6-41.

43. A computer program product stored on a non-transitory computer readable medium, the computer program product comprising program code for performing the method according to any one of claims 6-41.

44. An apparatus for encoding and decoding video data, comprising a processor and a non-transitory memory having instructions thereon, wherein: The instructions, when executed by the processor, cause the processor to: determining, based on one or more picture order count (POC) parameters associated with a picture of a current video block of a video, whether a first prediction mode can be applied, wherein in the first prediction mode, prediction samples of the current video block are refined based on at least gradients in different directions; Based on the determination, performing conversion between the current video block and a bitstream of the video; wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current video block, wherein τ0 is a difference between a picture order count of the current picture and a picture order count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is a difference between a picture order count of the second reference picture and a picture order count of the current picture (τ1=POC(R1)-POC(current)), In response to abs(abs(τ0)-abs(τ1))≥T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0 is greater than 0, or In response to abs(τ0)>abs(τ1)×T0 or abs(τ1)>abs(τ0)×T0, the first prediction mode is avoided from being enabled, wherein T0 is an integer and T0=1.

45. The device according to claim 44, wherein T0 is signaled in a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, a slice group header, a slice, a codec unit (CU), or a codec tree unit (CTU).

46. ​​The device according to claim 44, wherein The first prediction mode is a bidirectional optical flow (BDOF) prediction mode.

47. The apparatus of claim 44, wherein: The converting includes decoding the current video block from the bitstream.

48. The apparatus of claim 44, wherein: The converting includes encoding the current video block into the bitstream.

49. A non-transitory computer-readable storage medium storing instructions that cause a processor to: Based on one or more picture order count (POC) parameters associated with a picture of a current video block of the video, determining whether a first prediction mode is applicable, wherein In the first prediction mode, refining the prediction samples of the current video block based on at least gradients in different directions; Based on the determination, performing conversion between the current video block and a bitstream of the video; wherein a first reference picture (R0) and a second reference picture (R1) are associated with a current picture including the current video block, wherein τ0 is a difference between a picture order count of the current picture and a picture order count of the first reference picture (τ0=POC(current)-POC(R0)), and wherein τ1 is a difference between a picture order count of the second reference picture and a picture order count of the current picture (τ1=POC(R1)-POC(current)), In response to abs(abs(τ0)-abs(τ1))≥T0, avoiding enabling the first prediction mode, wherein T0 is an integer and T0 is greater than 0, or In response to abs(τ0)>abs(τ1)×T0 or abs(τ1)>abs(τ0)×T0, the first prediction mode is avoided from being enabled, wherein T0 is an integer and T0=1.

Citation Information

Patent Citations

  • Video encoding and decoding

    CN106416250A

  • Bi-directional optical flow for video coding

    CN108028929A

  • Motion vector reconstructions for bi-directional optical flow (BIO)

    TW201830966A

  • Decoder-side motion vector derivation

    WO2018175756A1