METHOD, DEVICE, AND MEDIUM FOR VIDEO PROCESSING

Embodiments of the present disclosure provide a solution for video processing. A method for video processing is proposed. The method comprises: applying, during a conversion between a target video block of a video and a bitstream of the video, at least one refinement process to the target video block based on a cost. The cost depends on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block. The method further comprises: performing the conversion between the target video block and the bitstream. Compared with the conventional solution, the proposed method can advantageously improve the coding effectiveness and coding efficiency.

FIELD

Embodiments of the present disclosure relates generally to video coding techniques, and more particularly, to refinement of coding data.

BACKGROUND

In nowadays, digital video capabilities are being applied in various aspects of peoples' lives. Multiple types of video compression technologies, such as MPEG-2, MPEG-4, ITU-TH.263, ITU-TH.264/MPEG-4 Part 10 Advanced Video Coding (AVC), ITU-TH.265 high efficiency video coding (HEVC) standard, versatile video coding (VVC) standard, have been proposed for video encoding/decoding. However, coding efficiency of conventional video coding techniques is generally expected to be further improved.

SUMMARY

Embodiments of the present disclosure provide a solution for video processing.

In a first aspect, a method for video processing is proposed. The method comprises: applying, during a conversion between a target video block of a video and a bitstream of the video, at least one refinement process to the target video block based on a cost, the cost depending on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block; and performing the conversion between the target video block and the bitstream. Compared with the conventional solution, the proposed method can advantageously improve the coding effectiveness and coding efficiency.

In a second aspect, an apparatus for processing video data is proposed. The apparatus comprises a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with the first aspect of the present disclosure.

In a third aspect, a non-transitory computer-readable storage medium is proposed. The non-transitory computer-readable storage medium stores instructions that cause a processor to perform a method in accordance with the first aspect of the present disclosure.

In a fourth aspect, a non-transitory computer-readable recording medium is proposed. The non-transitory computer-readable recording medium stores a bitstream of a video which is generated by a method performed by a video processing apparatus, wherein the method comprises: applying at least one refinement process to a target video block of the video based on a cost, the cost depending on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block; and generating the bitstream based on the applying.

In a fifth aspect, another method for video processing is proposed. The method for storing a bitstream of a video, comprising: applying at least one refinement process to a target video block of the video based on a cost, the cost depending on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block; generating the bitstream based on the applying; and storing the bitstream in a non-transitory computer-readable recording medium.

Throughout the drawings, the same or similar reference numerals usually refer to the same or similar elements.

DETAILED DESCRIPTION

Example Environment

FIG.1is a block diagram that illustrates an example video coding system100that may utilize the techniques of this disclosure. As shown, the video coding system100may include a source device110and a destination device120. The source device110can be also referred to as a video encoding device, and the destination device120can be also referred to as a video decoding device. In operation, the source device110can be configured to generate encoded video data and the destination device120can be configured to decode the encoded video data generated by the source device110. The source device110may include a video source112, a video encoder114, and an input/output (I/O) interface116.

The video source112may include a source such as a video capture device. Examples of the video capture device include, but are not limited to, an interface to receive video data from a video content provider, a computer graphics system for generating video data, and/or a combination thereof.

The video data may comprise one or more pictures. The video encoder114encodes the video data from the video source112to generate a bitstream. The bitstream may include a sequence of bits that form a coded representation of the video data. The bitstream may include coded pictures and associated data. The coded picture is a coded representation of a picture. The associated data may include sequence parameter sets, picture parameter sets, and other syntax structures. The I/O interface116may include a modulator/demodulator and/or a transmitter. The encoded video data may be transmitted directly to destination device120via the I/O interface116through the network130A. The encoded video data may also be stored onto a storage medium/server130B for access by destination device120.

The destination device120may include an I/O interface126, a video decoder124, and a display device122. The I/O interface126may include a receiver and/or a modem. The I/O interface126may acquire encoded video data from the source device110or the storage medium/server130B. The video decoder124may decode the encoded video data. The display device122may display the decoded video data to a user. The display device122may be integrated with the destination device120, or may be external to the destination device120which is configured to interface with an external display device.

The video encoder114and the video decoder124may operate according to a video compression standard, such as the High Efficiency Video Coding (HEVC) standard, Versatile Video Coding (VVC) standard and other current and/or further standards.

FIG.2is a block diagram illustrating an example of a video encoder200, which may be an example of the video encoder114in the system100illustrated inFIG.1, in accordance with some embodiments of the present disclosure.

The video encoder200may be configured to implement any or all of the techniques of this disclosure. In the example ofFIG.2, the video encoder200includes a plurality of functional components. The techniques described in this disclosure may be shared among the various components of the video encoder200. In some examples, a processor may be configured to perform any or all of the techniques described in this disclosure.

In some embodiments, the video encoder200may include a partition unit201, a predication unit202which may include a mode select unit203, a motion estimation unit204, a motion compensation unit205and an intra-prediction unit206, a residual generation unit207, a transform unit208, a quantization unit209, an inverse quantization unit210, an inverse transform unit211, a reconstruction unit212, a buffer213, and an entropy encoding unit214.

In other examples, the video encoder200may include more, fewer, or different functional components. In an example, the predication unit202may include an intra block copy (IBC) unit. The IBC unit may perform predication in an IBC mode in which at least one reference picture is a picture where the current video block is located.

Furthermore, although some components, such as the motion estimation unit204and the motion compensation unit205, may be integrated, but are represented in the example ofFIG.2separately for purposes of explanation.

The partition unit201may partition a picture into one or more video blocks. The video encoder200and the video decoder300may support various video block sizes.

The mode select unit203may select one of the coding modes, intra or inter, e.g., based on error results, and provide the resulting intra-coded or inter-coded block to a residual generation unit207to generate residual block data and to a reconstruction unit212to reconstruct the encoded block for use as a reference picture. In some examples, the mode select unit203may select a combination of intra and inter predication (CIIP) mode in which the predication is based on an inter predication signal and an intra predication signal. The mode select unit203may also select a resolution for a motion vector (e.g., a sub-pixel or integer pixel precision) for the block in the case of inter-predication.

To perform inter prediction on a current video block, the motion estimation unit204may generate motion information for the current video block by comparing one or more reference frames from buffer213to the current video block. The motion compensation unit205may determine a predicted video block for the current video block based on the motion information and decoded samples of pictures from the buffer213other than the picture associated with the current video block.

The motion estimation unit204and the motion compensation unit205may perform different operations for a current video block, for example, depending on whether the current video block is in an I-slice, a P-slice, or a B-slice. As used herein, an “I-slice” may refer to a portion of a picture composed of macroblocks, all of which are based upon macroblocks within the same picture. Further, as used herein, in some aspects, “P-slices” and “B-slices” may refer to portions of a picture composed of macroblocks that are not dependent on macroblocks in the same picture.

In some examples, the motion estimation unit204may output a full set of motion information for decoding processing of a decoder. Alternatively, in some embodiments, the motion estimation unit204may signal the motion information of the current video block with reference to the motion information of another video block. For example, the motion estimation unit204may determine that the motion information of the current video block is sufficiently similar to the motion information of a neighboring video block.

In one example, the motion estimation unit204may indicate, in a syntax structure associated with the current video block, a value that indicates to the video decoder300that the current video block has the same motion information as the another video block.

As discussed above, video encoder200may predictively signal the motion vector. Two examples of predictive signaling techniques that may be implemented by video encoder200include advanced motion vector predication (AMVP) and merge mode signaling.

The intra prediction unit206may perform intra prediction on the current video block. When the intra prediction unit206performs intra prediction on the current video block, the intra prediction unit206may generate prediction data for the current video block based on decoded samples of other video blocks in the same picture. The prediction data for the current video block may include a predicted video block and various syntax elements.

In other examples, there may be no residual data for the current video block for the current video block, for example in a skip mode, and the residual generation unit207may not perform the subtracting operation.

After the transform processing unit208generates a transform coefficient video block associated with the current video block, the quantization unit209may quantize the transform coefficient video block associated with the current video block based on one or more quantization parameter (QP) values associated with the current video block.

The inverse quantization unit210and the inverse transform unit211may apply inverse quantization and inverse transforms to the transform coefficient video block, respectively, to reconstruct a residual video block from the transform coefficient video block. The reconstruction unit212may add the reconstructed residual video block to corresponding samples from one or more predicted video blocks generated by the predication unit202to produce a reconstructed video block associated with the current video block for storage in the buffer213.

After the reconstruction unit212reconstructs the video block, loop filtering operation may be performed to reduce video blocking artifacts in the video block.

The entropy encoding unit214may receive data from other functional components of the video encoder200. When the entropy encoding unit214receives the data, the entropy encoding unit214may perform one or more entropy encoding operations to generate entropy encoded data and output a bitstream that includes the entropy encoded data.

FIG.3is a block diagram illustrating an example of a video decoder300, which may be an example of the video decoder124in the system100illustrated inFIG.1, in accordance with some embodiments of the present disclosure.

In the example ofFIG.3, the video decoder300includes an entropy decoding unit301, a motion compensation unit302, an intra prediction unit303, an inverse quantization unit304, an inverse transformation unit305, and a reconstruction unit306and a buffer307. The video decoder300may, in some examples, perform a decoding pass generally reciprocal to the encoding pass described with respect to video encoder200.

The entropy decoding unit301may retrieve an encoded bitstream. The encoded bitstream may include entropy coded video data (e.g., encoded blocks of video data). The entropy decoding unit301may decode the entropy coded video data, and from the entropy decoded video data, the motion compensation unit302may determine motion information including motion vectors, motion vector precision, reference picture list indexes, and other motion information. The motion compensation unit302may, for example, determine such information by performing the AMVP and merge mode. AMVP is used, including derivation of several most probable candidates based on data from adjacent PBs and the reference picture. Motion information typically includes the horizontal and vertical motion vector displacement values, one or two reference picture indices, and, in the case of prediction regions in B slices, an identification of which reference picture list is associated with each index. As used herein, in some aspects, a “merge mode” may refer to deriving the motion information from spatially or temporally neighboring blocks.

The motion compensation unit302may use the interpolation filters as used by the video encoder200during encoding of the video block to calculate interpolated values for sub-integer pixels of a reference block. The motion compensation unit302may determine the interpolation filters used by the video encoder200according to the received syntax information and use the interpolation filters to produce predictive blocks.

The motion compensation unit302may use at least part of the syntax information to determine sizes of blocks used to encode frame(s) and/or slice(s) of the encoded video sequence, partition information that describes how each macroblock of a picture of the encoded video sequence is partitioned, modes indicating how each partition is encoded, one or more reference frames (and reference frame lists) for each inter-encoded block, and other information to decode the encoded video sequence. As used herein, in some aspects, a “slice” may refer to a data structure that can be decoded independently from other slices of the same picture, in terms of entropy coding, signal prediction, and residual signal reconstruction. A slice can either be an entire picture or a region of a picture.

The intra prediction unit303may use intra prediction modes for example received in the bitstream to form a prediction block from spatially adjacent blocks. The inverse quantization unit304inverse quantizes, i.e., de-quantizes, the quantized video block coefficients provided in the bitstream and decoded by entropy decoding unit301. The inverse transform unit305applies an inverse transform.

The reconstruction unit306may obtain the decoded blocks, e.g., by summing the residual blocks with the corresponding prediction blocks generated by the motion compensation unit302or intra-prediction unit303. If desired, a deblocking filter may also be applied to filter the decoded blocks in order to remove blockiness artifacts. The decoded video blocks are then stored in the buffer307, which provides reference blocks for subsequent motion compensation/intra predication and also produces decoded video for presentation on a display device.

Some exemplary embodiments of the present disclosure will be described in detailed hereinafter. It should be understood that section headings are used in the present document to facilitate ease of understanding and do not limit the embodiments disclosed in a section to only that section. Furthermore, while certain embodiments are described with reference to Versatile Video Coding or other specific video codecs, the disclosed techniques are applicable to other video coding technologies also. Furthermore, while some embodiments describe video coding steps in detail, it will be understood that corresponding steps decoding that undo the coding will be implemented by a decoder. Furthermore, the term video processing encompasses video coding or compression, video decoding or decompression and video transcoding in which video pixels are represented from one compressed format into another compressed format or at a different compressed bitrate.

This disclosure is related to video coding technologies. Specifically, it is about intra/IBC/inter prediction and related techniques in video coding. It may be applied to the existing video coding standard like HEVC, VVC, etc. It may be also applicable to future video coding standards or video codec.

Video coding standards have evolved primarily through the development of the well-known ITU-T and ISO/IEC standards. The ITU-T produced H.261 and H.263, ISO/IEC produced MPEG-1 and MPEG-4 Visual, and the two organizations jointly produced the H.262/MPEG-2 Video and H.264/MPEG-4 Advanced Video Coding (AVC) and H.265/HEVC standards. Since H.262, the video coding standards are based on the hybrid video coding structure wherein temporal prediction plus transform coding are utilized. To explore the future video coding technologies beyond HEVC, the Joint Video Exploration Team (JVET) was founded by VCEG and MPEG jointly in 2015. The JVET meeting is concurrently held once every quarter, and the new video coding standard was officially named as Versatile Video Coding (VVC) in the April 2018 JVET meeting, and the first version of VVC test model (VTM) was released at that time. The VVC working draft and test model VTM are then updated after every meeting. The VVC project achieved technical completion (FDIS) at the July 2020 meeting.

2.1 Extended Merge Prediction

In VVC, the merge candidate list is constructed by including the following five types of candidates in order:1) Spatial MVP from spatial neighbour CUs2) Temporal MVP from collocated CUs3) History-based MVP from an FIFO table4) Pairwise average MVP5) Zero MVs.

The size of merge list is signalled in sequence parameter set header and the maximum allowed size of merge list is 6. For each CU code in merge mode, an index of best merge candidate is encoded using truncated unary binarization (TU). The first bin of the merge index is coded with context and bypass coding is used for other bins.

The derivation process of each category of merge candidates is provided in this session. As done in HEVC, VVC also supports parallel derivation of the merging candidate lists for all CUs within a certain size of area.

Spatial Candidates Derivation

The derivation of spatial merge candidates in VVC is same to that in HEVC except the positions of first two merge candidates are swapped.FIG.4illustrates a schematic diagram400showing positions of spatial merge candidates. A maximum of four merge candidates are selected among candidates located in the positions depicted inFIG.4. The order of derivation is B0, A0, B1, A1and B2. Position B2is considered only when one or more than one CUs of position B0, A0, B1, A1are not available (e.g. because it belongs to another slice or tile) or is intra coded. After candidate at position A1is added, the addition of the remaining candidates is subject to a redundancy check which ensures that candidates with same motion information are excluded from the list so that coding efficiency is improved. To reduce computational complexity, not all possible candidate pairs are considered in the mentioned redundancy check.FIG.5illustrates a schematic diagram500showing candidate pairs considered for redundancy check of spatial merge candidates. Instead only the pairs linked with an arrow inFIG.5are considered and a candidate is only added to the list if the corresponding candidate used for redundancy check has not the same motion information.

Temporal Candidates Derivation

In this step, only one candidate is added to the list. Particularly, in the derivation of this temporal merge candidate, a scaled motion vector is derived based on co-located CU belonging to the collocated reference picture. The reference picture list to be used for derivation of the co-located CU is explicitly signalled in the slice header.FIG.6illustrates a schematic diagram600of motion vector scaling for temporal merge candidate. The scaled motion vector for temporal merge candidate is obtained as illustrated by the dotted line inFIG.6, which is scaled from the motion vector of the co-located CU using the POC distances, tb and td, where tb is defined to be the POC difference between the reference picture of the current picture and the current picture and td is defined to be the POC difference between the reference picture of the co-located picture and the co-located picture. The reference picture index of temporal merge candidate is set equal to zero.

The position for the temporal candidate is selected between candidates C0and C1, as depicted in a schematic diagram700inFIG.7. If CU at position C0is not available, is intra coded, or is outside of the current row of CTUs, position C1is used. Otherwise, position C0is used in the derivation of the temporal merge candidate.

History-Based Merge Candidates Derivation

The history-based MVP (HMVP) merge candidates are added to merge list after the spatial MVP and TMVP. In this method, the motion information of a previously coded block is stored in a table and used as MVP for the current CU. The table with multiple HMVP candidates is maintained during the encoding/decoding process. The table is reset (emptied) when a new CTU row is encountered. Whenever there is a non-subblock inter-coded CU, the associated motion information is added to the last entry of the table as a new HMVP candidate. The HMVP table size S is set to be 6, which indicates up to 6 History-based MVP (HMVP) candidates may be added to the table. When inserting a new motion candidate to the table, a constrained first-in-first-out (FIFO) rule is utilized wherein redundancy check is firstly applied to find whether there is an identical HMVP in the table. If found, the identical HMVP is removed from the table and all the HMVP candidates afterwards are moved forward, HMVP candidates could be used in the merge candidate list construction process. The latest several HMVP candidates in the table are checked in order and inserted to the candidate list after the TMVP candidate. Redundancy check is applied on the HMVP candidates to the spatial or temporal merge candidate.

To reduce the number of redundancy check operations, the following simplifications are introduced:1. Number of HMPV candidates is used for merge list generation is set as (N<=4) ? M: (8−N), wherein N indicates number of existing candidates in the merge list and M indicates number of available HMVP candidates in the table.2. Once the total number of available merge candidates reaches the maximally allowed merge candidates minus 1, the merge candidate list construction process from HMVP is terminated.

Pair-Wise Average Merge Candidates Derivation

Pairwise average candidates are generated by averaging predefined pairs of candidates in the existing merge candidate list, and the predefined pairs are defined as {(O, 1), (0, 2), (1, 2), (0, 3), (1, 3), (2, 3)}, where the numbers denote the merge indices to the merge candidate list. The averaged motion vectors are calculated separately for each reference list. If both motion vectors are available in one list, these two motion vectors are averaged even when they point to different reference pictures; if only one motion vector is available, use the one directly; if no motion vector is available, keep this list invalid.

When the merge list is not full after pair-wise average merge candidates are added, the zero MVPs are inserted in the end until the maximum merge candidate number is encountered.

2.2 New Merge Candidates

Non-Adjacent Merge Candidates Derivation

FIG.8illustrates a schematic diagram 800 of VVC spatial neighboring blocks of the current block. In VVC, five spatially neighboring blocks shown inFIG.8as well as one temporal neighbor are used to derive merge candidates.

It is proposed to derive the additional merge candidates from the positions non-adjacent to the current block using the same pattern as that in VVC. To achieve this, for each search round i, a virtual block is generated based on the current block as follows:

First, the relative position of the virtual block to the current block is calculated by:

Offset×=−i×gridX,Offsety=−i×gridYwhere the Offsetx and Offsety denote the offset of the top-left corner of the virtual block relative to the top-left corner of the current block, gridX and gridY are the width and height of the search grid.

Second, the width and height of the virtual block are calculated by:

newWidth=i×2×gridX+currWidth newHeight=i×2×gridY+currHeight.where the currWidth and currHeight are the width and height of current block. The newWidth and newHeight are the width and height of new virtual block.gridX and gridY are currently set to currWidth and currHeight, respectively.

FIG.9illustrates a schematic diagram of a virtual block in the ith search round, which shows the relationship between the virtual block and the current block.

After generating the virtual block, the blocks Ai, Bi, Ci, Diand Eican be regarded as the VVC spatial neighboring blocks of the virtual block and their positions are obtained with the same pattern as that in VVC. Obviously, the virtual block is the current block if the search round i is 0. In this case, the blocks Ai, Bi, Ci, Diand Eiare the spatially neighboring blocks that are used in VVC merge mode.

When constructing the merge candidate list, the pruning is performed to guarantee each element in merge candidate list to be unique. The maximum search round is set to 1, which means that five non-adjacent spatial neighbor blocks are utilized.

Non-adjacent spatial merge candidates are inserted into the merge list after the temporal merge candidate in the order of B1→A1→C1→D1→E1.

It is proposed to derive an averaging candidate as STMVP candidate using three spatial merge candidates and one temporal merge candidate.

STMVP is inserted before the above-left spatial merge candidate. The STMVP candidate is pruned with all the previous merge candidates in the merge list. For the spatial candidates, the first three candidates in the current merge candidate list are used. For the temporal candidate, the same position as VTM/HEVC collocated position is used.

For the spatial candidates, the first, second, and third candidates inserted in the current merge candidate list before STMVP are denoted as F, S, and, T. The temporal candidate with the same position as VTM/HEVC collocated position used in TMVP is denoted as Col.

The motion vector of the STMVP candidate in prediction direction X (denoted as mvLX) is derived as follows:1) If the reference indices of the four merge candidates are all valid and are all equal to zero in prediction direction X (X=0 or 1),

mvLX=(mvLX_F+mvLX_S+mvLX_T+mvLX_Col)≫22) If reference indices of three of the four merge candidates are valid and are equal to zero in prediction direction X (X=0 or 1),

mvLX=(mvLX_F×3+mvLX_S×3+mvLX_Col×2)≫3⁢ormvLX=(mvLX_F×3+mvLX_T×3+mvLX_Col×2)≫3⁢ormvLX=(mvLX_S×3+mvLX_T×3+mvLX_Col×2)≫33) If reference indices of two of the four merge candidates are valid and are equal to zero in prediction direction X (X=0 or 1),

Note: If the temporal candidate is unavailable, the STMVP mode is off.

Merge List Size

If considering both non-adjacent and STMVP merge candidates, the size of merge list is signalled in sequence parameter set header and the maximum allowed size of merge list is increased (e.g. 8).

2.3 Merge Mode with MVD (MMVD)

In addition to merge mode, where the implicitly derived motion information is directly used for prediction samples generation of the current CU, the merge mode with motion vector differences (MMVD) is introduced in VVC, which is also known as ultimate motion vector expression. A MMVD flag is signaled right after sending a skip flag and merge flag to specify whether MMVD mode is used for a CU.

In MMVD, a merge candidate (which is called, base merge candidate) is selected, it is further refined by the signalled MVD information. The related syntax elements include an index to specify MVD distance (denoted by mmvd_distance_idx), and an index for indication of motion direction (denoted by mmvd_direction_idx). In MMVD mode, one for the first two candidates in the merge list is selected to be used as MV basis (or base merge candidate). The merge candidate flag is signalled to specify which one is used.

Distance index specifies motion magnitude information and indicate the pre-defined offset from the starting point.FIG.10illustrates a schematic diagram1010of MMVD Search Point for L0reference and a schematic diagram1020of MMVD Search Point for L1reference. As shown inFIG.10, an offset is added to either horizontal component or vertical component of starting MV. The relation of distance index and pre-defined offset is specified in Table 1.

Direction index represents the direction of the MVD relative to the starting point. The direction index can represent of the four directions as shown in Table 1. It's noted that the meaning of MVD sign could be variant according to the information of starting MVs. When the starting MVs is an un-prediction MV or bi-prediction MVs with both lists point to the same side of the current picture (i.e. POCs of two references are both larger than the POC of the current picture, or are both smaller than the POC of the current picture), the sign in Table 1 specifies the sign of MV offset added to the starting MV. When the starting MVs is bi-prediction MVs with the two MVs point to the different sides of the current picture (i.e. the POC of one reference is larger than the POC of the current picture, and the POC of the other reference is smaller than the POC of the current picture), the sign in Table 2 specifies the sign of MV offset added to the list0MV component of starting MV and the sign for the list1MV has opposite value.

TABLE 2Sign of MV offset specified by direction indexDirection IDX00011011x-axis+−N/AN/Ay-axisN/AN/A+−

Derivation of MVD for Each Reference Picture List

One internal MVD (denoted by MmvdOffset) is firstly derived according to the decoded indices of MVD distance (denoted by mmvd_distance_idx), and motion direction (denoted by mmvd_direction_idx).

Afterwards, if the internal MVD is determined, the final MVD to be added to the base merge candidate for each reference picture list is further derived according to POC distances of reference pictures relative to the current picture, and reference picture types (long-term or short-term). More specifically, the following steps are performed in order:If the base merge candidate is bi-prediction, the POC distance between current picture and reference picture in list0, and the POC distance between current picture and reference picture in list1is calculated, denoted by POCDiffL0, and POCDidffL1, respectively.If POCDiffL0is equal to POCDidffL1, the final MVD for two reference picture lists are both set to the internal MVD.Otherwise, if Abs(POCDiffL0) is greater than or equal to Abs(POCDiffL1), the final MVD for reference picture list0is set to the internal MVD, and the final MVD for reference picture list1is set to the scaled MVD using the internal MVD reference picture types of the two reference pictures (both are not long-term reference pictures) or the internal MVD or (zero MV minus the internal MVD) depending on the POC distances.Otherwise, if Abs(POCDiffL0) is smaller than Abs(POCDiffL1), the final MVD for reference picture list1is set to the internal MVD, and the final MVD for reference picture list0is set to the scaled MVD using the internal MVD reference picture types of the two reference pictures (both are not long-term reference pictures) or the internal MVD or (zero MV minus the internal MVD) depending on the POC distances.If the base merge candidate is uni-prediction from reference picture list X, the final MVD for reference picture list X is set to the internal MVD, and the final MVD for reference picture list Y (Y=1-X) is set to 0.

MMVD is also known as Ultimate Motion Vector Expression (UMVE).

2.4 Combined Inter and Intra Prediction (CIIP)

In VVC, when a CU is coded in merge mode, if the CU contains at least 64 luma samples (that is, CU width times CU height is equal to or larger than 64), and if both CU width and CU height are less than 128 luma samples, an additional flag is signalled to indicate if the combined inter/intra prediction (CIIP) mode is applied to the current CU. As its name indicates, the CIIP prediction combines an inter prediction signal with an intra prediction signal. The inter prediction signal in the CIIP mode Pinter is derived using the same inter prediction process applied to regular merge mode; and the intra prediction signal pintra is derived following the regular intra prediction process with the planar mode. Then, the intra and inter prediction signals are combined using weighted averaging, where the weight value is calculated depending on the coding modes of the top and left neighbouring blocks (depicted in a schematic diagram1100ofFIG.11) as follows:If the top neighbor is available and intra coded, then set isIntraTop to 1, otherwise set isIntraTop to 0;If the left neighbor is available and intra coded, then set islntraLeft to 1, otherwise set isIntraLeft to 0;If (isIntraLeft+isIntraTop) is equal to 2, then wt is set to 3;Otherwise, if (isIntraLeft+isIntraTop) is equal to 1, then wt is set to 2;Otherwise, set wt to 1.

The CIIP prediction is formed as follows:

In VVC, a geometric partitioning mode is supported for inter prediction. The geometric partitioning mode is signalled using a CU-level flag as one kind of merge mode, with other merge modes including the regular merge mode, the MMVD mode, the CIIP mode and the subblock merge mode. In total 64 partitions are supported by geometric partitioning mode for each possible CU size w×h=2m×2nwith m, n ∈ {3 . . . 6} excluding 8×64 and 64×8.

When this mode is used, a CU is split into two parts by a geometrically located straight line (as shown inFIG.12). The location of the splitting line is mathematically derived from the angle and offset parameters of a specific partition. Each part of a geometric partition in the CU is inter-predicted using its own motion; only uni-prediction is allowed for each partition, that is, each part has one motion vector and one reference index. The uni-prediction motion constraint is applied to ensure that same as the conventional bi-prediction, only two motion compensated prediction are needed for each CU. The uni-prediction motion for each partition is derived using the process described in 2.5.1.

If geometric partitioning mode is used for the current CU, then a geometric partition index indicating the partition mode of the geometric partition (angle and offset), and two merge indices (one for each partition) are further signalled. The number of maximum GPM candidate size is signalled explicitly in SPS and specifies syntax binarization for GPM merge indices. After predicting each of part of the geometric partition, the sample values along the geometric partition edge are adjusted using a blending processing with adaptive weights as in 2.5.2. This is the prediction signal for the whole CU, and transform and quantization process will be applied to the whole CU as in other prediction modes. Finally, the motion field of a CU predicted using the geometric partition modes is stored as in 2.5.3.

2.5.1 Uni-Prediction Candidate List Construction

The uni-prediction candidate list is derived directly from the merge candidate list constructed according to the extended merge prediction process in 1.FIG.13illustrates a schematic diagram of uni-prediction MV selection for geometric partitioning mode. Denote n as the index of the uni-prediction motion in the geometric uni-prediction candidate list. The LX motion vector of the n-th extended merge candidate, with X equal to the parity of n, is used as the n-th uni-prediction motion vector for geometric partitioning mode. These motion vectors are marked with “x” inFIG.13. In case a corresponding LX motion vector of the n-the extended merge candidate does not exist, the L(1−X) motion vector of the same candidate is used instead as the uni-prediction motion vector for geometric partitioning mode.

2.5.2 Blending Along the Geometric Partitioning Edge

After predicting each part of a geometric partition using its own motion, blending is applied to the two prediction signals to derive samples around geometric partition edge. The blending weight for each position of the CU are derived based on the distance between individual position and the partition edge.

The distance for a position (x, y) to the partition edge are derived as:

The weights for each part of a geometric partition are derived as following:

The partIdx depends on the angle index i.FIG.14illustrates a schematic diagram1400of exemplified generation of a bending weight w0using geometric partitioning mode. One example of weigh w0is illustrated inFIG.14.

2.5.3 Motion Field Storage for Geometric Partitioning Mode

Mv1from the first part of the geometric partition, Mv2from the second part of the geometric partition and a combined Mv of Mv1and Mv2are stored in the motion filed of a geometric partitioning mode coded CU.

The stored motion vector type for each individual position in the motion filed are determined as:

sType=abs⁡(motionIdx)<32?2:(motionIdx≤0?(1-partIdx):partIdx)(2-8)where motionIdx is equal to d(4x+2, 4y+2), which is recalculated from equation (2-1). The partIdx depends on the angle index i.

If sType is equal to 0 or 1, Mv0or Mv1are stored in the corresponding motion field, otherwise if sType is equal to 2, a combined Mv from Mv0and Mv2are stored. The combined Mv are generated using the following process:1) If Mv1and Mv2are from different reference picture lists (one from L0and the other from L1), then Mv1and Mv2are simply combined to form the bi-prediction motion vectors.2) Otherwise, if Mv1and Mv2are from the same list, only uni-prediction motion Mv2is stored.

2.6 Triangle Partition for Inter Prediction

In VVC, a triangle partition mode (TPM) is supported for inter prediction. The triangle partition mode is only applied to CUs that are 8×8 or larger. The triangle partition mode is signalled using a CU-level flag as one kind of merge mode, with other merge modes including the regular merge mode, the MMVD mode, the CIIP mode and the subblock merge mode.

When this mode is used, a CU is split evenly into two triangle-shaped partitions, using either the diagonal split (a CU1510depicted inFIG.15) or the anti-diagonal split (a CU1520depicted inFIG.15). Each triangle partition in the CU is inter-predicted using its own motion; only uni-prediction is allowed for each partition, that is, each partition has one motion vector and one reference index. The uni-prediction motion constraint is applied to ensure that same as the conventional bi-prediction, only two motion compensated prediction are needed for each CU. The uni-prediction motion for each partition is derived using the process described in 2.5.1.

If triangle partition mode is used for the current CU, then a flag indicating the direction of the triangle partition (diagonal or anti-diagonal), and two merge indices (one for each partition) are further signalled. The number of maximum TPM candidate size is signalled explicitly at slice level and specifies syntax binarization for TMP merge indices. After predicting each of the triangle partitions, the sample values along the diagonal or anti-diagonal edge are adjusted using a blending processing with adaptive weights. This is the prediction signal for the whole CU, and transform and quantization process will be applied to the whole CU as in other prediction modes. Finally, the motion field of a CU predicted using the triangle partition mode is stored as in 2.5.3.

The triangle partition mode is not used in combination with SBT, that is, when the signalled triangle mode is equal to 1, the cu_sbt_flag is inferred to be 0 without signalling.

2.6.1 Uni-Prediction Candidate List Construction

The uni-prediction candidate list is derived directly from the merge candidate list constructed according to the extended merge prediction process in 1.FIG.16illustrates a schematic diagram of uni-prediction MV selection for geometric partitioning mode. Denote n as the index of the uni-prediction motion in the triangle uni-prediction candidate list1610. The LX motion vector of the n-th extended merge candidate, with X equal to the parity of n, is used as the n-th uni-prediction motion vector for triangle partition mode. These motion vectors are marked with “x” inFIG.16. In case a corresponding LX motion vector of the n-the extended merge candidate does not exist, the L(1-X) motion vector of the same candidate is used instead as the uni-prediction motion vector for triangle partition mode.

2.6.2 Blending along the triangle partition edge After predicting each triangle partition using its own motion, blending is applied to the two prediction signals to derive samples around the diagonal or anti-diagonal edge. The following weights are used in the blending process:7/8, 6/8, 5/8, 4/8, 3/8, 2/8, 1/8} for luma and {6/8,4/8,2/8} for chroma, as shown in the weight map1710and the weight map1720ofFIG.17, respectively.
2.6.3 Motion field storage

The motion vectors of a CU coded in triangle partition mode are generated using the following process:1) If Mv1and Mv2are from different reference picture lists (one from L0and the other from L1), then Mv1and Mv2are simply combined to form the bi-prediction motion vector.2) Otherwise, if Mv1and Mv2are from the same list, only uni-prediction motion Mv2is stored.
2.7 Template matching based adaptive merge candidate reorder

To improve the coding efficiency, after the merge candidate list is constructed, the order of each merge candidate is adjusted according to the template matching cost. The merge candidates are arranged in the list in accordance with the template matching cost of ascending order. It is operated in the form of sub-group.

FIG.18illustrates a schematic diagram1800of neighboring samples used for calculating SAD (Sum of absolute differences). The template matching cost is measured by the SAD (Sum of absolute differences) between the neighbouring samples of the current CU in the current picture1810and their corresponding reference samples. If a merge candidate includes bi-predictive motion information, the corresponding reference samples are the average of the corresponding reference samples in reference list01820and the corresponding reference samples in reference list11830, as illustrated inFIG.18. If a merge candidate includes sub-CU level motion information, the corresponding reference samples for a current CU in a current picture1910consist of the neighbouring samples of the corresponding reference sub-blocks in a reference picture1920, as illustrated inFIG.19.

The sorting process is operated in the form of sub-group, as illustrated inFIG.20. The first three merge candidates are sorted together. The following three merge candidates are sorted together. As shown inFIG.20, an original merge candidate list2010is sorted to obtain an updated merge candidate list2020. The template size (width of the left template or height of the above template) is 1. The sub-group size is 3.

2.8 Local illumination compensation (LIC) Local illumination compensation (LIC) is a coding tool to address the issue of local illumination changes between current picture and its temporal reference pictures. The LIC is based on a linear model where a scaling factor and an offset are applied to the reference samples to obtain the prediction samples of a current block. Specifically, the LIC can be mathematically modeled by the following equation:

P⁡(x,y)=α·Pr(x+vx,y+vy)+βwhere P(x, y) is the prediction signal of the current block at the coordinate (x, y); Pr(x+vx, y+vy) is the reference block pointed by the motion vector (vx, vy); α and β are the corresponding scaling factor and offset that are applied to the reference block.FIG.21illustrates the LIC process2100. InFIG.21, when the LIC is applied for a block, a least mean square error (LMSE) method is employed to derive the values of the LIC parameters (i.e., a and β) by minimizing the difference between the neighboring samples of the current block (i.e., the template T inFIG.21) and their corresponding reference samples in the temporal reference pictures (i.e., either T0or TI inFIG.21). Additionally, to reduce the computational complexity, both the template samples and the reference template samples are subsampled (adaptive subsampling) to derive the LIC parameters, i.e., only the shaded samples inFIG.21are used to derive α and β.

To improve the coding performance, no subsampling for the short side is performed as shown in the diagram2200ofFIG.22.

In HEVC, the bi-prediction signal is generated by averaging two prediction signals obtained from two different reference pictures and/or using two different motion vectors. In VVC, the bi-prediction mode is extended beyond simple averaging to allow weighted averaging of the two prediction signals.

Five weights are allowed in the weighted averaging bi-prediction, w ∈ {−2, 3, 4, 5, 10}. For each bi-predicted CU, the weight w is determined in one of two ways: 1) for a non-merge CU, the weight index is signalled after the motion vector difference; 2) for a merge CU, the weight index is inferred from neighbouring blocks based on the merge candidate index. BCW is only applied to CUs with 256 or more luma samples (i.e., CU width times CU height is greater than or equal to 256). For low-delay pictures, all 5 weights are used. For non-low-delay pictures, only 3 weights (w ∈ {3,4,5}) are used.At the encoder, fast search algorithms are applied to find the weight index without significantly increasing the encoder complexity. These algorithms are summarized as follows. For further details readers are referred to the VTM software and document. When combined with AMVR, unequal weights are only conditionally checked for 1-pel and 4-pel motion vector precisions if the current picture is a low-delay picture.When combined with affine, affine ME will be performed for unequal weights if and only if the affine mode is selected as the current best mode.When the two reference pictures in bi-prediction are the same, unequal weights are only conditionally checked.Unequal weights are not searched when certain conditions are met, depending on the POC distance between current picture and its reference pictures, the coding QP, and the temporal level.

The BCW weight index is coded using one context coded bin followed by bypass coded bins. The first context coded bin indicates if equal weight is used; and if unequal weight is used, additional bins are signalled using bypass coding to indicate which unequal weight is used. Weighted prediction (WP) is a coding tool supported by the H.264/AVC and HEVC standards to efficiently code video content with fading. Support for WP was also added into the VVC standard. WP allows weighting parameters (weight and offset) to be signalled for each reference picture in each of the reference picture lists L0and L1. Then, during motion compensation, the weight(s) and offset(s) of the corresponding reference picture(s) are applied. WP and BCW are designed for different types of video content. In order to avoid interactions between WP and BCW, which will complicate VVC decoder design, if a CU uses WP, then the BCW weight index is not signalled, and w is inferred to be 4 (i.e. equal weight is applied).For a merge CU, the weight index is inferred from neighbouring blocks based on the merge candidate index. This can be applied to both normal merge mode and inherited affine merge mode. For constructed affine merge mode, the affine motion information is constructed based on the motion information of up to 3 blocks. The BCW index for a CU using the constructed affine merge mode is simply set equal to the BCW index of the first control point MV.

In VVC, CIIP and BCW cannot be jointly applied for a CU. When a CU is coded with CIIP mode, the BCW index of the current CU is set to 2, e.g. equal weight.

2.10 Subblock-based temporal motion vector prediction (SbTMVP) VVC supports the subblock-based temporal motion vector prediction (SbTMVP) method. Similar to the temporal motion vector prediction (TMVP) in HEVC, SbTMVP uses the motion field in the collocated picture to improve motion vector prediction and merge mode for CUs in the current picture. The same collocated picture used by TMVP is used for SbTMVP. SbTMVP differs from TMVP in the following two main aspects:TMVP predicts motion at CU level but SbTMVP predicts motion at sub-CU level;Whereas TMVP fetches the temporal motion vectors from the collocated block in the collocated picture (the collocated block is the bottom-right or center block relative to the current CU), SbTMVP applies a motion shift before fetching the temporal motion information from the collocated picture, where the motion shift is obtained from the motion vector from one of the spatial neighboring blocks of the current CU. The SbTMVP process is illustrated inFIG.23AandFIG.23B.FIG.23Aillustrates a schematic diagram2310of spatial neighboring blocks used by SbTMVP. SbTMVP predicts the motion vectors of the sub-CUs within the current CU in two steps. In the first step, the spatial neighbor A1inFIG.23Ais examined. If A1has a motion vector that uses the collocated picture as its reference picture, this motion vector is selected to be the motion shift to be applied. If no such motion is identified, then the motion shift is set to (0, 0).

FIG.23Billustrates a schematic diagram of driving sub-CU motion field by applying a motion shift from spatial neighbor and scaling the motion information from the corresponding collocated sub-CUs. In the second step, the motion shift identified in Step1is applied (i.e. added to the current block's coordinates of the current block in the current picture2320) to obtain sub-CU-level motion information (motion vectors and reference indices) from the collocated picture2322as shown inFIG.23B. The example inFIG.23Bassumes the motion shift is set to block A1's motion. Then, for each sub-CU, the motion information of its corresponding block (the smallest motion grid that covers the center sample) in the collocated picture2322is used to derive the motion information for the sub-CU. After the motion information of the collocated sub-CU is identified, it is converted to the motion vectors and reference indices of the current sub-CU in a similar way as the TMVP process of HEVC, where temporal motion scaling is applied to align the reference pictures of the temporal motion vectors to those of the current CU.

TMVP candidate and affine merge candidates is used for the signalling of subblock based merge mode. The SbTMVP mode is enabled/disabled by a sequence parameter set (SPS) flag. If the SbTMVP mode is enabled, the SbTMVP predictor is added as the first entry of the list of subblock based merge candidates, and followed by the affine merge candidates. The size of subblock based merge list is signalled in SPS and the maximum allowed size of the subblock based merge list is 5 in VVC.

The sub-CU size used in SbTMVP is fixed to be 8×8, and as done for affine merge mode, SbTMVP mode is only applicable to the CU with both width and height are larger than or equal to 8.

The encoding logic of the additional SbTMVP merge candidate is the same as for the other merge candidates, that is, for each CU in P or B slice, an additional RD check is performed to decide whether to use the SbTMVP candidate.

2.11 Affine Motion Compensated Prediction

In HEVC, only translation motion model is applied for motion compensation prediction (MCP). While in the real world, there are many kinds of motion, e.g. zoom in/out, rotation, perspective motions and the other irregular motions. In VVC, a block-based affine transform motion compensation prediction is applied.FIG.24illustrates a schematic diagram of control point based affine motion model. As shownFIG.24, the affine motion field of the block is described by motion information of two control point (4-parameter) or three control point motion vectors (6-parameter).

For the 4-parameter affine motion model2410inFIG.24, motion vector at sample location (x, y) in a block is derived as:

For the 6-parameter affine motion model2410inFIG.24, motion vector at sample location (x, y) in a block is derived as:

Where (mv0x, mv0y) is motion vector of the top-left corner control point, (mv1x, mv1y) is motion vector of the top-right corner control point, and (mv2x, mv2y) is motion vector of the bottom-left corner control point.

In order to simplify the motion compensation prediction, block based affine transform prediction is applied.FIG.25illustrates a schematic diagram2500of affine MVF per subblock. To derive motion vector of each 4×4 luma subblock, the motion vector of the center sample of each subblock, as shown inFIG.25, is calculated according to above equations, and rounded to 1/16 fraction accuracy. Then the motion compensation interpolation filters are applied to generate the prediction of each subblock with derived motion vector. The subblock size of chroma-components is also set to be 4×4. The MV of a 4×4 chroma subblock is calculated as the average of the MVs of the top-left and bottom-right luma subblocks in the collocated 8×8 luma region.

As done for translational motion inter prediction, there are also two affine motion inter prediction modes: affine merge mode and affine AMVP mode.

Affine Merge Prediction

AF_MERGE mode can be applied for CUs with both width and height larger than or equal to 8. In this mode the CPMVs of the current CU is generated based on the motion information of the spatial neighboring CUs. There can be up to five CPMVP candidates and an index is signalled to indicate the one to be used for the current CU. The following three types of CPVM candidate are used to form the affine merge candidate list:Inherited affine merge candidates that extrapolated from the CPMVs of the neighbour CUsConstructed affine merge candidates CPMVPs that are derived using the translational MVs of the neighbour CUsZero MVs

In VVC, there are maximum two inherited affine candidates, which are derived from affine motion model of the neighboring blocks, one from left neighboring CUs and one from above neighboring CUs.FIG.26illustrates a schematic diagram2600of locations of inherited affine motion predictors. The candidate blocks are shown inFIG.26. The candidate blocks are shown inFIG.26. For the left predictor, the scan order is A0→A1, and for the above predictor, the scan order is B0→B1→B2. Only the first inherited candidate from each side is selected. No pruning check is performed between two inherited candidates. When a neighboring affine CU is identified, its control point motion vectors are used to derived the CPMVP candidate in the affine merge list of the current CU.FIG.27illustrates a schematic diagram of control point motion vector inheritance. As shown inFIG.27, if the neighbour left bottom block A2710is coded in affine mode, the motion vectors v2, v3and v4of the top left corner, above right corner and left bottom corner of the CU2720which contains the block A2710are attained. When block A2710is coded with 4-parameter affine model, the two CPMVs of the current CU are calculated according to v2, and v3. In case that block A is coded with 6-parameter affine model, the three CPMVs of the current CU are calculated according to v2, v3and v4.

Constructed affine candidate means the candidate is constructed by combining the neighbor translational motion information of each control point. The motion information for the control points is derived from the specified spatial neighbors and temporal neighbor shown inFIG.28which illustrates a schematic diagram2800of locations of candidates position for constructed affine merge mode. CPMVk (k=1, 2, 3, 4) represents the k-th control point. For CPMV1, the B2→B3→A2blocks are checked and the MV of the first available block is used. For CPMV2, the B1→B0blocks are checked and for CPMV3, the A1→A0blocks are checked. For TMVP is used as CPMV4if it's available.

After MVs of four control points are attained, affine merge candidates are constructed based on those motion information. The following combinations of control point MVs are used to construct in order:{CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}

The combination of3CPMVs constructs a 6-parameter affine merge candidate and the combination of2CPMVs constructs a 4-parameter affine merge candidate. To avoid motion scaling process, if the reference indices of control points are different, the related combination of control point MVs is discarded.

After inherited affine merge candidates and constructed affine merge candidate are checked, if the list is still not full, zero MVs are inserted to the end of the list.

Affine AMVP mode can be applied for CUs with both width and height larger than or equal to 16. An affine flag in CU level is signalled in the bitstream to indicate whether affine AMVP mode is used and then another flag is signalled to indicate whether 4-parameter affine or 6-parameter affine. In this mode, the difference of the CPMVs of current CU and their predictors CPMVPs is signalled in the bitstream. The affine AVMP candidate list size is 2 and it is generated by using the following four types of CPVM candidate in order:Inherited affine AMVP candidates that extrapolated from the CPMVs of the neighbour CUsConstructed affine AMVP candidates CPMVPs that are derived using the translational MVs of the neighbour CUsTranslational MVs from neighboring CUsZero MVs

The checking order of inherited affine AMVP candidates is same to the checking order of inherited affine merge candidates. The only difference is that, for AVMP candidate, only the affine CU that has the same reference picture as in current block is considered. No pruning process is applied when inserting an inherited affine motion predictor into the candidate list.

Constructed AMVP candidate is derived from the specified spatial neighbors shown inFIG.28. The same checking order is used as done in affine merge candidate construction. In addition, reference picture index of the neighboring block is also checked. The first block in the checking order that is inter coded and has the same reference picture as in current CUs is used. There is only one When the current CU is coded with 4-parameter affine mode, and mv0and myiare both availlalbe, they are added as one candidate in the affine AMVP list. When the current CU is coded with 6-parameter affine mode, and all three CPMVs are available, they are added as one candidate in the affine AMVP list. Otherwise, constructed AMVP candidate is set as unavailable.

If affine AMVP list candidates is still less than 2 after valid inherited affine AMVP candidates and constructed AMVP candidate are inserted, mv0, myiand mV2will be added, in order, as the translational MVs to predict all control point MVs of the current CU, when available. Finally, zero MVs are used to fill the affine AMVP list if it is still not full.

Template matching (TM) is a decoder-side MV derivation method to refine the motion information of the current CU by finding the closest match between a template (i.e., top and/or left neighbouring blocks of the current CU) in the current picture and a block (i.e., same size to the template) in a reference picture.FIG.29illustrates a schematic diagram2900of template matching performed on a search area around initial MV. As illustrated inFIG.29, a better MV is to be searched around the initial motion of the current CU within a [−8, +8]-pel search range. The template matching is adopted in this contribution with two modifications: search step size is determined based on AMVR mode and TM can be cascaded with bilateral matching process in merge modes.

In AMVP mode, an MVP candidate is determined based on template matching cost to pick up the one which reaches the minimum difference between current block template and reference block template, and then TM performs only for this particular MVP candidate for MV refinement. TM refines this MVP candidate, starting from full-pel MVD precision (or 4-pel for 4-pel AMVR mode) within a [−8, +8]-pel search range by using iterative diamond search. The AMVP candidate may be further refined by using cross search with full-pel MVD precision (or 4-pel for 4-pel AMVR mode), followed sequentially by half-pel and quarter-pel ones depending on AMVR mode as specified in Table 3. This search process ensures that the MVP candidate still keeps the same MV precision as indicated by AMVR mode after TM process.

In merge mode, similar search method is applied to the merge candidate indicated by the merge index. As Table 3 shows, TM may perform all the way down to 1/8-pel MVD precision or skipping those beyond half-pel MVD precision, depending on whether the alternative interpolation filter (that is used when AMVR is of half-pel mode) is used according to merged motion information. Besides, when TM mode is enabled, template matching may work as an independent process or an extra MV refinement process between block-based and subblock-based bilateral matching (BM) methods, depending on whether BM can be enabled or not according to its enabling condition check.

At encoder side, TM merge mode will do MV refinement for each merge candidate.

2.13 Multi-hypothesis prediction (MHP) The multi-hypothesis prediction is adopted in this contribution. Up to two additional predictors are signalled on top of inter AMVP mode, regular merge mode, and MMVD mode. The resulting overall prediction signal is accumulated iteratively with each additional prediction signal.

The weighting factor α is specified according to the following table:

For inter AMVP mode, MHP is only applied if non-equal weight in BCW is selected in bi-prediction mode.

In the multi-hypothesis inter prediction mode, one or more additional prediction signals are signaled, in addition to the conventional uni/bi prediction signal. The resulting overall prediction signal is obtained by sample-wise weighted superposition. With the uni/bi prediction signal puni/biand the first additional inter prediction signal/hypothesis h3, the resulting prediction signal p3is obtained as follows:

The weighting factor α is specified by the new syntax element add_hyp_weight_idx, according to the following mapping:

Note that for the additional prediction signals, in the tests CE10.1.2.a, CE10.1.2.b, and CE10.1.2.d, the concept of prediction list0/list1is abolished, and instead one combined list is used. This combined list is generated by alternatingly inserting reference frames from list0and list1with increasing reference index, omitting reference frames which have already been inserted, such that double entries are avoided. In test CE10.1.2.c, only 2 different reference pictures can be used within each PU, and therefore it is indicated by one flag which reference frame is used.

Analogously to above, more than one additional prediction signal can be used. The resulting overall prediction signal is accumulated iteratively with each additional prediction signal.

The resulting overall prediction signal is obtained as the last pn(i.e., the pnhaving the largest index n). Within this CE, up to two additional prediction signals can be used (i.e., n is limited to 2). Note that due to the iterative accumulation approach, the number of required PU sample buffers for storing intermediate prediction signals is not increased relative to bi-prediction (i.e., two buffers are sufficient).

First, the inter modes with no explicitly signaled additional inter prediction parameters are tested. For the best two of these modes (i.e., having lowest Hadamard RD cost), additional inter prediction hypotheses are searched. For that purpose, for all combinations of the following parameters, a motion estimation with a restricted search range of 16 is performed:Weighting factor αReference frame for the additional prediction hypothesis

For determining the best combination of these two parameters, a simplified RD cost using Hadamard distortion measure and approximated bit rate is used. The chosen parameter combination is then used to compute a more accurate RD cost, using forward transform and quantization, which is compared against the so-far best found coding mode for the current block.

2.14.2 Interaction with Other Coding Tools

Additional prediction signals can be explicitly signaled, but not in SKIP modeAdditional prediction signals can also be inherited from spatially neighboring blocks as part of the merging candidate, but this is limited toneighboring blocks within the current CTU, orneighboring blocks from the left CTUAdditional prediction signals cannot be inherited from the top CTU or from a temporally co-located block.All explicitly signaled additional prediction signals use the same AMVP candidate list which is generated for the first explicitly signaled additional prediction signal, so there has to be doneone merging candidate list construction processone AMVP candidate list construction processThe total of explicitly signaled and inherited (merged) additional prediction signals is limited to be less than or equal to 2.

Additional prediction signals can be explicitly signaled, but not in MMVD SKIP modeThere is no inheritance/merging of additional prediction signals from merging candidatesAll explicitly signaled additional prediction signals use the same AMVP candidate list which is generated for the first explicitly signaled additional prediction signal, so there has to be doneone MMVD list construction processone AMVP candidate list construction process

Sub-Block Merge Mode

Additional prediction signals can be explicitly signaled, but not in SKIP modeThere is no inheritance/merging of additional prediction signals from merging candidatesAll explicitly signaled additional prediction signals use the same AMVP candidate list which is generated for the first explicitly signaled additional prediction signal, so there has to be doneone sub-block merging candidate list construction processone AMVP candidate list construction process

Additional prediction signals can be explicitly signaled in case of bi-predictionOnly two AMVP candidate lists have to be constructed (for the first two, i.e. non-additional prediction signals)For the additional prediction signals, one of the two AMVP candidate lists is used:If the POC of the reference picture of the additional prediction signal equals the POC of the used list1reference picture, the list1AMVP candidate list is used.Otherwise the list0AMVP candidate list is used.

Affine AMVP ModeAdditional (translational) prediction signals can be explicitly signaled in case of bi-predictionTwo affine AMVP candidate lists have to be constructed (for the first two, i.e. non-additional prediction signals)For the additional prediction signals, one of the two AMVP candidate lists is used:If the POC of the reference picture of the additional prediction signal equals the POC of the used list1reference picture, the list1AMVP candidate list is used.Otherwise the list0AMVP candidate list is used.The affine LT my predictor is used as the my predictor for the additional prediction signal

Multi-hypothesis inter prediction cannot be used together with BIO within one PU:If there are additional prediction signals, BIO is disabled for the current PU

Multi-hypothesis inter prediction cannot be used together with combined intra/inter within one PU:If combined intra/inter is selected with a merging candidate that has additional prediction signals, those additional prediction signals are not inherited/merged.Additional prediction signals cannot be explicitly signaled in combined intra/inter mode.

Triangular Mode

Multi-hypothesis inter prediction cannot be used together with triangular mode within one PU:If triangular mode is selected with a merging candidate that has additional prediction signals, those additional prediction signals are not inherited/merged.Additional prediction signals cannot be explicitly signaled in triangular mode.

2.15 Overlapped Block Motion Compensation

Overlapped Block Motion Compensation (OBMC) has previously been used in H.263. In the JEM, unlike in H.263, OBMC can be switched on and off using syntax at the CU level. When OBMC is used in the JEM, the OBMC is performed for all motion compensation (MC) block boundaries except the right and bottom boundaries of a CU. Moreover, it is applied for both the luma and chroma components. In the JEM, a MC block is corresponding to a coding block. When a CU is coded with sub-CU mode (includes sub-CU merge, affine and FRUC mode), each sub-block of the CU is a MC block.FIG.30illustrates a schematic diagram3000of sub-blocks where OBMC applies. To process CU boundaries in a uniform fashion, OBMC is performed at sub-block level for all MC block boundaries, where sub-block size is set equal to 4×4, as illustrated inFIG.30.

When OBMC applies to the current sub-block, besides current motion vectors, motion vectors of four connected neighbouring sub-blocks, if available and are not identical to the current motion vector, are also used to derive prediction block for 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.

Prediction block based on motion vectors of a neighbouring sub-block is denoted as PN, with N indicating an index for the neighbouring above, below, left and right sub-blocks and prediction block based on motion vectors of the current sub-block is denoted as PC. When PNis based on the motion information of a neighbouring sub-block that contains the same motion information to the current sub-block, the OBMC is not performed from PN. Otherwise, every sample of PNis added to the same sample in Pc, i.e., four rows/columns of PNare added to PC. The weighting factors {1/4, 1/8, 1/16, 1/32} are used for PNand the weighting factors {3/4, 7/8, 15/16, 31/32} are used for PC. The exception are small MC blocks, (i.e., when height or width of the coding block is equal to 4 or a CU is coded with sub-CU mode), for which only two rows/columns of PNare added to PC. In this case weighting factors {1/4, 1/8} are used for PNand weighting factors {3/4, 7/8} are used for PC. For PNgenerated based on motion vectors of vertically (horizontally) neighbouring sub-block, samples in the same row (column) of PNare added to PCwith a same weighting factor.

In the JEM, for a CU with size less than or equal to 256 luma samples, a CU level flag is signalled to indicate whether OBMC is applied or not for the current CU. For the CUs with size larger than 256 luma samples or not coded with AMVP mode, OBMC is applied by default. At the encoder, when OBMC is applied for a CU, its impact is taken into account during the motion estimation stage. The prediction signal formed by OBMC using motion information of the top neighbouring block and the left neighbouring block is used to compensate the top and left boundaries of the original signal of the current CU, and then the normal motion estimation process is applied.

2.16 Adaptive Merge Candidate List

It is to assume the number of the merge candidates is 8. It takes the first 5 merge candidates as a first subgroup and takes the following 3 merge candidates as a second subgroup (i.e. the last subgroup).

FIG.31illustrates a flowchart of a reorder process3100in an encoder. For the encoder, after the merge candidate list is constructed at block3102, some merge candidates are adaptively reordered in an ascending order of costs of merge candidates as shown inFIG.31.

More specifically, at block3104, the template matching costs for the merge candidates in all subgroups except the last subgroup are computed; then at block3106, the merge candidates in their own subgroups are reordered except the last subgroup; finally, at block3108, the final merge candidate list will be got.

For the decoder, after the merge candidate list is constructed, some/no merge candidates are adaptively reordered in ascending order of costs of merge candidates as shown inFIG.32which illustrates a flowchart of a reorder process3200in a decoder. InFIG.32, the subgroup the selected (signaled) merge candidate located in is called the selected subgroup.

More specifically, at block3202, it is determined if the selected merge candidate is located in the last subgroup. If the selected merge candidate is located in the last subgroup, at block3204, the merge candidate list construction process is terminated after the selected merge candidate is derived, and at block3206, no reorder is performed and the merge candidate list is not changed; otherwise, the execution process is as follows:

At block3208, the merge candidate list construction process is terminated after all the merge candidates in the selected subgroup are derived; at block3210, the template matching costs for the merge candidates in the selected subgroup are computed; at block3212, the merge candidates in the selected subgroup are reordered; finally, at block3214, a new merge candidate list will be got.

For both encoder and decoder, the followings apply:

A template matching cost is derived as a function of T and RT, wherein T is a set of samples in the template and RT is a set of reference samples for the template.

When deriving the reference samples of the template for a merge candidate, the motion vectors of the merge candidate are rounded to the integer pixel accuracy.

The reference samples of the template (RT) for bi-directional prediction are derived by weighted averaging of the reference samples of the template in reference list0(RT0) and the reference samples of the template in reference list1(RT1) as follows.

where the weight of the reference template in reference list0(8-w) and the weight of the reference template in reference list1(w) are decided by the BCW index of the merge candidate. BCW index equal to {0, 1, 2, 3, 4} corresponds to w equal to {-2,3,4,5, 10}, respectively.

If the Local Illumination Compensation (LIC) flag of the merge candidate is true, the reference samples of the template are derived with LIC method.

The template matching cost is calculated based on the sum of absolute differences (SAD) of T and RT.

The template size is 1. That means the width of the left template and/or the height of the above template is 1.

If the coding mode is MMVD, the merge candidates to derive the base merge candidates are not reordered.

If the coding mode is GPM, the merge candidates to derive the uni-prediction candidate list are not reordered.

In Geometric prediction mode with Motion Vector Difference (GMVD), each geometric partition in GPM can decide to use GMVD or not. If GMVD is chosen for a geometric region, the MV of the region is calculated as a sum of the MV of a merge candidate and an MVD. All other processing is kept the same as in GPM.

With GMVD, an MVD is signaled as a pair of direction and distance. There are nine candidate distances (1/4-pel, 1/2-pel, 1-pel, 2-pel, 3-pel, 4-pel, 6-pel, 8-pel, 16-pel), and eight candidate directions (four horizontal/vertical directions and four diagonal directions) involved In addition, when pic_fpel_mmvd_enabled_flag is equal to 1, the MVD in GMVD is also left shifted by 2 as in MMVD.

In affine MMVD, an affine merge candidate (which is called, base affine merge candidate) is selected, the MVs of the control points are further refined by the signalled MVD information.

The MVD information for the MVs of all the control points are the same in one prediction direction.

When the starting MVs is bi-prediction MVs with the two MVs point to the different sides of the current picture (i.e. the POC of one reference is larger than the POC of the current picture, and the POC of the other reference is smaller than the POC of the current picture), the MV offset added to the list0MV component of starting MV and the MV offset for the list1MV has opposite value; otherwise, when the starting MVs is bi-prediction MVs with both lists point to the same side of the current picture (i.e. POCs of two references are both larger than the POC of the current picture, or are both smaller than the POC of the current picture), the MV offset added to the list0MV component of starting MV and the MV offset for the list1MV are the same.

2.19 Decoder Side Motion Vector Refinement (DMVR)

In order to increase the accuracy of the MVs of the merge mode, a bilateral-matching (BM) based decoder side motion vector refinement is applied in VVC. In bi-prediction operation, a refined MV is searched around the initial MVs in the reference picture list L0and reference picture list L1. The BM method calculates the distortion between the two candidate blocks in the reference picture list L0and list L1. As illustrated inFIG.33, the SAD between the blocks3310and3312based on each MV candidate around the initial MV is calculated, where the block3310is in a reference picture3301in the list L0and the block3312is in a reference picture3303in the List L1for the current picture3302. The MV candidate with the lowest SAD becomes the refined MV and used to generate the bi-predicted signal.

In VVC, the application of DMVR is restricted and is only applied for the CUs which are coded with following modes and features:CU level merge mode with bi-prediction MVOne reference picture is in the past and another reference picture is in the future with respect to the current pictureThe distances (i.e. POC difference) from two reference pictures to the current picture are sameBoth reference pictures are short-term reference picturesCU has more than 64 luma samplesBoth CU height and CU width are larger than or equal to 8 luma samplesBCW weight index indicates equal weightWP is not enabled for the current blockCIIP mode is not used for the current block

The refined MV derived by DMVR process is used to generate the inter prediction samples and also used in temporal motion vector prediction for future pictures coding. While the original MV is used in deblocking process and also used in spatial motion vector prediction for future CU coding.

The additional features of DMVR are mentioned in the following sub-clauses.

Searching Scheme

In DVMR, the search points are surrounding the initial MV and the MV offset obey the MV difference mirroring rule. In other words, any points that are checked by DMVR, denoted by candidate MV pair (MV0, MV1) obey the following two equations:

Where MV_offset represents the refinement offset between the initial MV and the refined MV in one of the reference pictures. The refinement search range is two integer luma samples from the initial MV. The searching includes the integer sample offset search stage and fractional sample refinement stage.

25 points full search is applied for integer sample offset searching. The SAD of the initial MV pair is first calculated. If the SAD of the initial MV pair is smaller than a threshold, the integer sample stage of DMVR is terminated. Otherwise SADs of the remaining 24 points are calculated and checked in raster scanning order. The point with the smallest SAD is selected as the output of integer sample offset searching stage. To reduce the penalty of the uncertainty of DMVR refinement, it is proposed to favor the original MV during the DMVR process. The SAD between the reference blocks referred by the initial MV candidates is decreased by 1/4 of the SAD value.

The integer sample search is followed by fractional sample refinement. To save the calculational complexity, the fractional sample refinement is derived by using parametric error surface equation, instead of additional search with SAD comparison. The fractional sample refinement is conditionally invoked based on the output of the integer sample search stage. When the integer sample search stage is terminated with center having the smallest SAD in either the first iteration or the second iteration search, the fractional sample refinement is further applied.

In parametric error surface based sub-pixel offsets estimation, the center position cost and the costs at four neighboring positions from the center are used to fit a 2-D parabolic error surface equation of the following form

E⁡(x,y)=A⁡(x-xmin)2+B⁡(y-ymin)2+Cwhere (xmin, ymin) corresponds to the fractional position with the least cost and C corresponds to the minimum cost value. By solving the above equations by using the cost value of the five search points, the (xmin, ymin) is computed as:

The value of xminand Yminare automatically constrained to be between −8 and 8 since all cost values are positive and the smallest value is E(0,0). This corresponds to half peal offset with 1/16th-pel MV accuracy in VVC. The computed fractional (xmin, ymin) are added to the integer distance refinement MV to get the sub-pixel accurate refinement delta MV.

Bilinear-Interpolation and Sample Padding

In VVC, the resolution of the MVs is 1/16 luma samples. The samples at the fractional position are interpolated using a 8-tap interpolation filter. In DMVR, the search points are surrounding the initial fractional-pel MV with integer sample offset, therefore the samples of those fractional position need to be interpolated for DMVR search process. To reduce the calculation complexity, the bi-linear interpolation filter is used to generate the fractional samples for the searching process in DMVR. Another important effect is that by using bi-linear filter is that with 2-sample search range, the DVMR does not access more reference samples compared to the normal motion compensation process. After the refined MV is attained with DMVR search process, the normal 8-tap interpolation filter is applied to generate the final prediction. In order to not access more reference samples to normal MC process, the samples, which is not needed for the interpolation process based on the original MV but is needed for the interpolation process based on the refined MV, will be padded from those available samples.

Maximum DMVR Processing Unit

When the width and/or height of a CU are larger than 16 luma samples, it will be further split into subblocks with width and/or height equal to 16 luma samples. The maximum unit size for DMVR searching process is limit to 16×16.

2.20 Combination of GPM and Template Matching

It is proposed to apply template matching to GPM. When a CU is coded in GPM, two motion for two geometric partitions are selected from a merge candidate list which is derived in the same way as that in VVC standard. Each motion for the geometric partition can decide whether to be refined using TM. When TM is chosen, a template is constructed using left and above neighboring samples. Then, the motion is refined by finding the minimum difference between the current template and a reference area using the same search pattern of merge mode with half-pel interpolation filter disabled. The refined motion is used to perform motion compensation for the geometric partition and is stored in the motion field.

For the syntax design, when a CU coded in GPM, two additional flags are signaled to indicate whether motion is refined for the two geometric partitions, respectively. Then, the geometric partition mode and two merge indices are further signaled.

2.21 Extension of Template Matching to Affine, CIIP, GPM Merge Modes, and Boundary

CIIP merge mode with template matching refinement Template matching refinement is applied to the underlying inter-prediction part of CIIP merge mode. When CIIP is enabled for a coding unit (CU), it is signaled to indicate whether template matching refinement is enabled for this CU. When both CIIP and template matching refinement are enabled, the MVs of a merge candidate used in CIIP merge mode is refined by using the same template matching refinement process as in the template matching of EE2 before motion compensation and inter-intra combination.

GPM Merge Mode with Template Matching Refinement

Template matching refinement is applied to geometric partitioning merge (GPM) mode. When GPM mode is enabled for a CU, a flag (tm_merge_flag) is signaled to control whether template matching refinement is applied for this CU. If the refinement is utilized, the selected uni-directional MV for each GPM partition is refined by using the same template matching refinement process as in the template matching of EE2 before motion compensation.

Boundary Sub-Blocks with Template Matching Refinement

Template matching refinement is applied to boundary 4×4 sub-blocks of a CU, when it is coded using regular merge mode, tm_merge_flag is enabled, and the merge candidate motion is uni-directional. This extension is an additional refinement step applied after the CU-level template matching refinement (EE2, Test-3.3), where the block motion is further refined only for the 4×4 sub-blocks at the top or left boundary in the CU. In this process, since the CU is uni-directional (and so are its sub-blocks), the MV of each aforementioned boundary sub-block is converted to bi-prediction MVs utilizing uni-to-bi conversion similar to the one used in the template matching of EE2 followed by the template matching refinement applied to every boundary sub-block.

Affine Merge Mode with Template Matching Refinement

Template matching refinement is applied to the affine merge mode (Affine TM), and the tm_merge_flag is signaled to differentiate whether template matching is applied. In this mode, the template matching search is done around the initially given CPMVs of an affine merge candidate indicated by a merge index.FIG.34Aillustrates a schematic diagram of current block templates3410.FIG.34Billustrates a schematic diagram of reference sub-block based templates3420. The current block template is the same as in the regular TM applied to translational motion model, but the reference block template comprises multiple 4×4 sub-blocks pointed respectively to by the CPMV-derived MVs of the neighboring sub-blocks (i.e., A0, A1, . . . , and L0, L1, . . . as shown onFIG.34A) at the CU boundary. The search process of Affine TM starts from the CPMV0, while keeping the other CPMV(s) constant, and the search is performed toward horizontal and vertical directions, followed by diagonal ones only if zero vector is not the best difference vector found from the horizontal/vertical search. Then, Affine TM repeats the same search process for CPMV1, and CPMV2, if 6-parameter model is used. Based on the refined CPMVs, the whole search process restarts from CPMV0, if zero vector is not the best difference vector from the previous iteration and the search process has iterated less than 3 times.

2.22 Adaptive Merge Candidate List

Hereinafter, template is a set of reconstructed samples adjacently or non-adjacently neighboring to the current block. Reference samples of the template are derived according to the same motion information of the current block. For example, reference samples of the template are mapping of the template depend on a motion information. In this case, reference samples of the template are located by a motion vector of the motion information in a reference picture indicated by the reference index of the motion information.FIG.35shows a schematic diagram3500of an example of a template and reference samples of the template, wherein RT in a reference picture3520represents the reference samples of the template T in a current picture3510.

When a merge candidate utilizes bi-directional prediction, the reference samples of the template of the merge candidate are denoted by RT and RT may be generated from RT0which are derived from a reference picture in reference picture list0and RT1derived from a reference picture in reference picture list1. In one example, RT0includes a set of reference samples on the reference picture of the current block indicated by the reference index of the merge candidate referring to a reference picture in reference list0with the MV of the merge candidate referring to reference list0), In one example, RT1includes a set of reference samples on the reference picture of the current block indicated by the reference index of the merge candidate referring to a reference picture in reference list1with the MV of the merge candidate referring to reference list1). An example is shown inFIG.36which illustrates a schematic diagram3600of a template in a current picture3610and reference samples of the template in a reference picture3620in reference list0and in a reference picture3630in reference list1. In one example, the reference samples of the template (RT) for bi-directional prediction are derived by equal weighted averaging of the reference samples of the template in reference list0(RT0) and the reference samples of the template in reference list1(RT1). One example is as follows:

In one example, the reference samples of the template (RTbi-pred) for bi-directional prediction are derived by weighted averaging of the reference samples of the template in reference list0(RT0) and the reference samples of the template in reference list1(RT1). One example is as follows:

In one example, the weight of the reference template in reference list0such as (8−w) and the weight of the reference template in reference list1such as (w) maybe decided by the BCW index of the merge candidate.

The merge candidates can be divided to several groups according to some criterions. Each group is called a subgroup. For example, adjacent spatial and temporal merge candidates can be taken as a first subgroup and the remaining merge candidates can be taken as a second subgroup; In another example, it can also take the first N (N≥2) merge candidates as a first subgroup, take the following M (M≥2) merge candidates as a second subgroup, and take the remaining merge candidates as a third subgroup. Note that the proposed methods may be applied to merge candidate list construction process for inter coded blocks (e.g., translational motion), affine coded blocks; or other motion candidate list construction process (e.g., AMVP list; IBC AMVP list; IBC merge list).

W and H are the width and height of current block (e.g., luma block). Taking merge candidate list construction process as an example in the following descriptions:1. The merge candidates can be adaptively rearranged in the final merge candidate list according to one or some criterions.a) In one example, partial or full process of current merge candidate list construction process is firstly invoked, followed by the reordering of candidates in the list.i. Alternatively, candidates in a first subgroup may be reordered and they should be added before those candidates in a second subgroup wherein the first subgroup is added before the second subgroup.(i) In one example, multiple merge candidates for a first category may be firstly derived and then reordered within the first category; then merge candidates from a second category may be determined according to the reordered candidates in the first category (e.g., how to apply pruning).ii. Alternatively, a first merge candidate in a first category may be compared to a second merge candidate in a second category, to decide the order of the first or second merge candidate in the final merge candidate list.b) In one example, the merge candidates may be adaptively rearranged before retrieving the merge candidates.i. In one example, the procedure of arranging merge candidates adaptively may be processed before the obtaining the merge candidate to be used in the motion compensation process.c) In one example, if the width of current block is larger than the height of current block, the above candidate is added before the left candidate.d) In one example, if the width of current block is smaller than the height of current block, the above candidate is added after the left candidate.e) Whether merge candidates are rearranged adaptively may depend on the selected merging candidate or the selected merging candidate index.i. In one example, if the selected merging candidate is in the last sub-group, the merge candidates are not rearranged adaptively.f) In one example, a merge candidate is assigned with a cost, the merge candidates are adaptively reordered in an ascending order of costs of merge candidates.i. In one example, the cost of a merge candidate may be a template matching cost.ii. In one example, template is a set of reconstructed samples adjacently or non-adjacently neighboring to the current block.iii. A template matching cost is derived as a function of T and RT, wherein T is a set of samples in the template and RT is a set of reference samples for the template.(i) How to obtain the reference samples of the template for a merge candidate may depend on the motion information of the merge candidatea) In one example, when deriving the reference samples of the template, the motion vectors of the merge candidate are rounded to the integer pixel accuracy, where the integer motion vector may be its nearest integer motion vector.b) In one example, when deriving the reference samples of the template, N-tap interpolation filtering is used to get the reference samples of the template at sub-pixel positions. For example, N may be 2, 4, 6, or 8.c) In one example, when deriving the reference samples of the template, the motion vectors of the merge candidates may be scaled to a given reference picture (e.g., for each reference picture list if available).d) For example, the reference samples of the template of a merge candidate are obtained on the reference picture of the current block indicated by the reference index of the merge candidate with the MVs or modified MVs (e.g., according to bullets a)-b)) of the merge candidate as shown inFIG.35.e) For example, when a merge candidate utilizes bi-directional prediction, the reference samples of the template of the merge candidate are denoted by RT and RT may be generated from RT0which are derived from a reference picture in reference picture list0and RT1derived from a reference picture in reference picture list1.[1] In one example, RT0includes a set of reference samples on the reference picture of the current block indicated by the reference index of the merge candidate referring to a reference picture in reference list0with the MV of the merge candidate referring to reference list0),[2] In one example, RT1includes a set of reference samples on the reference picture of the current block indicated by the reference index of the merge candidate referring to a reference picture in reference list1with the MV of the merge candidate referring to reference list1).[3] An example is shown inFIG.36.f) In one example, the reference samples of the template (RT) for bi-directional prediction are derived by equal weighted averaging of the reference samples of the template in reference list0(RT0) and the reference samples of the template in reference list1(RT1). One example is as follows:

R⁢T=(R⁢T0+R⁢T1+1)≫1g) In one example, the reference samples of the template (RTbi-pred) for bi-directional prediction are derived by weighted averaging of the reference samples of the template in reference list0(RT0) and the reference samples of the template in reference list1(RT1). One example is a follows:

2.23 Adaptive Motion Candidate List

1. The motion candidates in a motion candidate list of a block can be adaptively rearranged to derive the reordered motion candidate list according to one or some criterions, and the block is encoded/decoded according to the reordered motion candidate list.a. The motion candidates in a motion candidate list of a block which is not a regular merge candidate list can be adaptively rearranged to derive the reordered motion candidate list according to one or some criterions.b. In one example, whether to and/or how to reorder the motion candidates may depend on the coding mode (e.g. affine merge, affine AMVP, regular merge, regular AMVP, GPM,TPM, MMVD,TM merge, CIIP, GMVD, affine MMVD).c. In one example, whether to and/or how to reorder the motion candidates may depend on the category (e.g., spatial, temporal, STMVP, HMVP, pair-wise, SbTMVP, constructed affine, inherited affine) of the motion candidates.d. In one example, the motion candidate list may be the AMVP candidate list.e. In one example, the motion candidate list may be the merge candidate list.f. In one example, the motion candidate list may be the affine merge candidate list.g. In one example, the motion candidate list may be the sub-block-based merge candidate list.h. In one example, the motion candidate list may be the GPM merge candidate list.i. In one example, the motion candidate list may be the TPM merge candidate list.j. In one example, the motion candidate list may be the TM merge candidate list.k. In one example, the motion candidate list may be the candidate list for MMVD coded blocks.l. In one example, the motion candidate list may be the candidate list for DMVR coded blocks.2. How to adaptively rearrange motion candidates in a motion candidate list may depend on the decoded information, e.g., the category of a motion candidate, a category of a motion candidate list, a coding tool.a. In one example, for different motion candidate lists, different criteria may be used to rearrange the motion candidate list.i. In one example, the criteria may include how to select the template.ii. In one example, the criteria may include how to calculate the template cost.iii. In one example, the criteria may include how many candidates and/or how many sub-groups in a candidate list need to be reordered.b. In one example, the motion candidates in a motion candidate list are firstly adaptively rearranged to construct a fully rearranged candidate list or partially rearranged candidate list, and at least one motion candidate indicated by at least one index is then retrieved from the rearranged candidate list to derive the final motion information to be used by the current block.c. In one example, the motion candidates before refinement (e.g., using TM for TM coded blocks; adding MVD for MMVD coded blocks) are firstly adaptively rearranged to construct a fully rearranged candidate list or partially rearranged candidate list. Then at least one motion candidate indicated by at least one index is retrieved from the rearranged candidate list, and refinement (e.g., using TM for TM coded blocks; adding MVD for MMVD coded blocks) is applied to the retrieved one to derive the final motion information for the current block.d. In one example, refinement (e.g., using TM for TM coded blocks; adding MVD for MMVD coded blocks) is applied to at least one of the motion candidates in a motion candidate list, then they are adaptively rearranged to construct a fully rearranged candidate list or partially rearranged candidate list, and at least one motion candidate indicated by at least one index is then retrieved from the rearranged candidate list to derive final the motion information without any further refinement for the current block.3. In one example, new MERGE/AMVP motion candidates may be generated based on the candidates reordering.i. For example, L0motion and L1motion of the candidates may be reordered separately.ii. For example, new bi-prediction merge candidates may be constructed by combining one from the reordered L0motion and the other from the reordered L1motion.iii. For example, new uni-prediction merge candidates may be generated by the reordered L0or L1motion.

2.24 Adaptive Motion Candidate List

For subblock motion prediction, if the subblock size is Wsub*Hsub, the height of the above template is Ht, the width of the left template is Wt, the above template can be treated as a constitution of several sub-templates with the size of Wsub*Ht, the left template can be treated as a constitution of several sub-templates with the size of Wt*Hsub. After deriving the reference samples of each sub-template in the above similar way, the reference samples of the template are derived. Two examples are shown inFIG.37andFIG.38.FIG.37illustrates a schematic diagram3700of a template and reference samples of the template for block with sub-block motion using the motion information of the subblocks of current block.FIG.38illustrates a schematic diagram3800of a template and reference samples of the template for block with sub-block motion using the motion information of each sub-template. It is noted that the terminologies mentioned below are not limited to the specific ones defined in existing standards. Any variance of the coding tool is also applicable. For example, the term “GPM” is used to represent any coding tool that derive two sets of motion information and use the derived information and the splitting pattern to get the final prediction, e.g., TPM is also treated as GPM.

Note that the proposed methods may be applied to merge candidate list construction process for inter coded blocks (e.g., translational motion), affine coded blocks, or IBC coded blocks; or other motion candidate list construction process (e.g., normal AMVP list; affine AMVP list; IBC AMVP list).

W and H are the width and height of current block (e.g., luma block).1. In one example, if the coding mode is TM merge, partial or full TM merge candidates may be reordered.a. In one example, if the coding mode is TM merge, the partial or full original TM merge candidates may be reordered, before the TM refinement process.b. Alternatively, if the coding mode is TM merge, the partial or full refined TM merge candidates may be reordered, after the TM refinement process.c. Alternatively, if the coding mode is TM merge, the TM merge candidates may not be reordered.d. Alternatively, the reordering method may be different for the TM merge mode and other merge modes.2. In one example, if the coding mode is a subblock based merge mode, partial or full subblock based merge candidates may be reordered.a. Alternatively, the reordering method may be different for the subblock based merge mode and other merge modesb. In one example, a template may be divided into sub-templates. Each sub-template may possess an individual piece of motion information.i. In one example, the cost used to reorder the candidates may be derived based on the cost of each sub-template. For example, the cost used to reorder the candidates may be calculated as the sum of the costs of all sub-templates. For example, the cost for a sub-template may be calculated as SAD, SATD, SSD or any other distortion measurement between the sub-template and its corresponding reference sub-template.c. In one example, to derive the reference samples of a sub-template, the motion information of the subblocks in the first row and the first column of current block may be used.i. In one example, the motion information of a sub-template may be derived (e.g. copied) from its adjacent sub-block in the current block. An example is shown inFIG.37.d. In one example, to derive the reference samples of a sub-template, the motion information of the sub-template may be derived without referring to motion information of a sub-block in the current block. An example is shown inFIG.38.i. In one example, the motion information of each sub-template is calculated according to the affine model of current block.(i) In one example, the motion vector of the center sample of each subblock containing a sub-template calculated according to the affine model of current block is treated as the motion vector of the sub-template.(ii) In one example, the motion vector of the center sample of each sub-template calculated according to the affine model of current block is treated as the motion vector of the sub-template.(iii) For 4-parameter affine motion model, motion vector at sample location (x, y) in a block is derived as:

{m⁢vx=m⁢v1⁢x-m⁢v0⁢xW⁢x+m⁢v0⁢y-m⁢v1⁢yW⁢y+m⁢v0⁢xm⁢vy=m⁢v1⁢y-m⁢v0⁢yW⁢x+m⁢v1⁢x-m⁢v0⁢xW⁢y+m⁢v0⁢y(iv) For 6-parameter affine motion model, motion vector at sample location (x, y) in a block is derived as:

2.25 Adaptive Motion Candidate List

It is noted that the terminologies mentioned below are not limited to the specific ones defined in existing standards. Any variance of the coding tool is also applicable. For example, the term “GPM” is used to represent any coding tool that derive two sets of motion information and use the derived information and the splitting pattern to get the final prediction, e.g., TPM is also treated as GPM.

Note that the proposed methods may be applied to merge candidate list construction process for inter coded blocks (e.g., translational motion), affine coded blocks, or IBC coded blocks; or other motion candidate list construction process (e.g., normal AMVP list; affine AMVP list; IBC AMVP list).

W and H are the width and height of current block (e.g., luma block).1. The reference samples of a template or sub-template (RT) for bi-directional prediction are derived by equal weighted averaging of the reference samples of the template or sub-template in reference list0(RT0) and the reference samples of the template or sub-template in reference list1(RT1). One example is as follows:

R⁢T⁡(x,y)=((2N-w)*R⁢T0(x,y)+w*R⁢T1(x,y)+2N-1)≫N,for⁢example,N=3.b. The weights may be determined by the BCW index or derived on-the-fly or pre-defined or by the weights used in weighted prediction.c. In one example, the weight of the reference template in reference list0such as (8−w) and the weight of the reference template in reference list1such as (w) maybe decided by the BCW index of the merge candidate.i. In one example, BCW index is equal to 0, w is set equal to −2.ii. In one example, BCW index is equal to 1, w is set equal to 3.iii. In one example, BCW index is equal to 2, w is set equal to 4.iv. In one example, BCW index is equal to 3, w is set equal to 5.v. In one example, BCW index is equal to 4, w is set equal to 10.3. It is proposed that the reference samples of the template may be derived with LIC method.a. In one example, the LIC parameters for both left and above templates are the same as the LIC parameters of current block.b. In one example, the LIC parameters for left template are derived as the LIC parameters of current block which uses its original motion vector plus a motion vector offset of (−Wt,0) as the motion vector of current block.c. In one example, the LIC parameters for above template are derived as the LIC parameters of current block which uses its original motion vector plus a motion vector offset of (0, −Ht) as the motion vector of current block.d. Alternatively, furthermore, the above bullets may be applied if the Local Illumination Compensation (LIC) flag of a merge candidate is true4. It is proposed that the reference samples of the template or sub-template may be derived with OBMC method. In the following discussion, a “template” may refer to a template or a sub-template.a. In one example, to derive the reference samples of the above template, the motion information of the subblocks in the first row of current block and their above adjacent neighboring subblocks are used. And the reference samples of all the sub-templates constitute the reference samples of the above template.FIG.39illustrates a schematic diagram3900of templates and reference samples of the template for block with OBMC.b. In one example, to derive the reference samples of the left template, the motion information of the subblocks in the first column of current block and their left adjacent neighboring subblocks are used. And the reference samples of all the sub-templates constitute the reference samples of the left template. An example is shown inFIG.39.c. In one example, the subblock size is 4×4.d. The reference samples of a sub-template based on motion vectors of a neighbouring subblock is denoted as PN, with N indicating an index for the neighbouring above and left subblocks and the reference samples of a sub-template based on motion vectors of a subblock of current block is denoted as Pc. For PNgenerated based on motion vectors of vertically (horizontally) neighbouring sub-block, samples in the same row (column) of PNare added to PCwith a same weighting factor.i. The reference samples of a sub-template (P) may be derived as P=WN*PN+WC*PCii. In one example, the weighting factors {1/4, 1/8, 1/16, 1/32} are used for the {first, second, third, fourth} row (column) of PNand the weighting factors {3/4, 7/8, 15/16, 31/32} are used for the {first, second, third, fourth} row (column) of PCif the height of the above template or the width of the left template is larger than or equal to 4.iii. In one example, the weighting factors {1/4, 1/8} are used for the {first, second} row (column) of PNand the weighting factors {3/4, 7/8} are used for the {first, second} row (column) of PCif the height of the above template or the width of the left template is larger than or equal to 2.iv. In one example, the weighting factor {1/4} is used for the first row (column) of PNand the weighting factor {3/4} is used for the first row (column) of PCif the height of the above template or the width of the left template is larger than or equal to 1.e. The above bullets may be applied if a merge candidate is assigned with OBMC enabled.5. In one example, if a merge candidate uses multi-hypothesis prediction, the reference samples of the template may be derived with multi-hypothesis prediction method.6. The template may comprise samples of specific color component(s).a. In one example, the template only comprises samples of the luma component.b. Alternatively, the template only comprises samples of any component such as Cb/Cr/R/G/B.7. Whether to and/or how to reorder the motion candidates may depend on the category of the motion candidates.a. In one example, only adjacent spatial and temporal motion candidates can be reordered.b. In one example, only adjacent spatial, STMVP, and temporal motion candidates can be reordered.c. In one example, only adjacent spatial, STMVP, temporal and non-adjacent spatial motion candidates can be reordered.d. In one example, only adjacent spatial, STMVP, temporal, non-adjacent spatial and HMVP motion candidates can be reordered.e. In one example, only adjacent spatial, STMVP, temporal, non-adjacent spatial, HMVP and pair-wise average motion candidates can be reordered.f. In one example, only adjacent spatial, temporal, HMVP and pair-wise average motion candidates can be reordered.g. In one example, only adjacent spatial, temporal, and HMVP motion candidates can be reordered.h. In one example, only adjacent spatial motion candidates can be reordered.i. In one example, the uni-prediction subblock based motion candidates are not reordered.j. In one example, the SbTMVP candidate is not reordered.k. In one example, the inherited affine motion candidates are not reordered.l. In one example, the constructed affine motion candidates are not reordered.m. In one example, the zero padding affine motion candidates are not reordered.n. In one example, only the first N motion candidates can be reordered.i. In one example, N is set equal to 5.8. In one example, the motion candidates may be divided into subgroups. Whether to and/or how to reorder the motion candidates may depend on the subgroup of the motion candidates.a. In one example, only the first subgroup can be reordered.b. In one example, the last subgroup can not be reordered.c. In one example, the last subgroup can not be reordered. But if the last subgroup also is the first subgroup, it can be reordered.d. Different subgroups may be reordered separately.e. Two candidates in different subgroups cannot be compared and/or reordered.f. A first candidate in a first subgroup must be put ahead of a second candidate in a second subgroup after reordering if the first subgroup is ahead of a second subgroup.9. In one example, the motion candidates which are not included in the reordering process may be treated in specified way.a. In one example, for the candidates not to be reordered, they will be arranged in the merge candidate list according to the initial order.b. In one example, candidates not to be reordered may be put behind the candidates to be reordered.c. In one example, candidates not to be reordered may be put before the candidates to be reordered.10. Whether to apply the adaptive merge candidate list reordering may depend on a message signaled in VPS/SPS/PPS/sequence header/picture header/slice header/CTU/CU/TU/PU. It may also be a region based on signaling. For example, the picture is partitioned into groups of CTU/CUs evenly or unevenly, and one flag is coded for each group to indicate whether merge candidate list reordering is applied or not.

2.26 Sign Prediction

This contribution proposes a method of prediction for the signs of luma residual coefficients. A number of signs per TU can be predicted, limited by a configuration parameter and the number of coefficients present. When predicting n signs in a TU, the encoder and decoder perform n+1 partial inverse transformations and 2nborder reconstructions corresponding to the 2nsign combination hypotheses, with a border-cost measure for each. These costs are examined to determine sign prediction values, and the encoder transmits a sign residual for each predicted sign indicating whether the prediction for that sign is correct or not using two additional CABAC contexts. The decoder reads these sign residuals and later uses them during reconstruction to determine the correct signs to apply after making its own predictions

Encoder

Prior to encoding coefficients in a TU, the encoder now determines which signs to predict, and predicts them. Hypothesis processing as described below is performed during RDO decision making. The prediction results (correct or incorrect, per sign being predicted) are stored in the CU for use in later encoding.

During the final encoding stage, this stored data is used to reproduce the final bitstream containing sign residues.

Hypothesis Generation

The encoder initially dequantizes the TU and then chooses n coefficients for which signs will be predicted. The coefficients are scanned in raster-scan order, and dequantized values over a defined threshold are preferred over values lower than that threshold when collecting the n coefficients to treat.

With these n values, 2nsimplified border reconstructions are performed as described below, one reconstruction per unique combination of signs for the n coefficients. For a particular reconstruction, only the leftmost and topmost pixels of the block are recreated from the inverse transformation added to the block prediction. Although the first (vertical) inverse transform is complete, the second (horizontal) inverse transform only has to create the leftmost and topmost pixel outputs and is thus faster. An additional flag, “topLeft”, has been added to inverse transform functions to allow this.

In addition, the number of inverse transform operations performed is reduced by using a system of ‘templates’. In this way, when predicting n signs in a block, only n+1 inverse transform operations are performed:1. A single inverse transform operating on the dequantized coefficients, where the values of all signs being predicted are set positive. Once added to the prediction of the current block, this corresponds to the border reconstruction for the first hypothesis.2. For each of the n coefficients having their signs predicted, an inverse transform operation is performed on an otherwise empty block containing the corresponding dequantized (and positive) coefficient as its only non-null element. The leftmost and topmost border values are saved in what is termed a ‘template’ for use during later reconstructions.

Border reconstruction for a later hypothesis starts by taking an appropriate saved reconstruction of a previous hypothesis which only needs a single predicted sign to be changed from positive to negative in order to construct the desired current hypothesis. This change of sign is then approximated by the doubling and subtraction from the hypothesis border of the template corresponding to the sign being predicted. The border reconstruction, after costing, is then saved if it is known to be reused for constructing later hypotheses.

Table showing save/restore and template application for 3 sign 8 entry case

Note that these approximations are used only during the process of sign prediction, not during final reconstruction.

Hypothesis Costing

There is a cost associated with each hypothesis that corresponds to the concept of image continuity at the block border. It is by minimizing this cost that sign prediction values are found.FIG.40illustrates a schematic diagram4000of costing a hypothesis recon-structed border. As shown inFIG.40, for each reconstructed pixel p0,yat the LHS of the reconstructed block, a simple linear prediction using the two pixels to the left is performed to get its prediction pred0,y=(2p−1,y−p−2,y). The absolute difference between this prediction and the reconstructed pixel p0,yis added to the cost of the hypothesis.

Similar processing occurs for pixels in the top row of the reconstructed block, summing the absolute differences of each prediction predx,0=(2px,−1−px,−2) and reconstructed pixel px,o.

Prediction of Multiple Signs

For each sign to be predicted, the encoder searches for the hypothesis having the lowest cost that agrees with the true values of the signs already transmitted. (Initially, with no sign residues transmitted, this simply corresponds to the lowest cost hypothesis.) The predicted value of the current sign is taken from this hypothesis.

If the prediction corresponds to the true value of the sign, a “0” is sent as the sign residue, otherwise a “1” is sent.

Final Signaling

One of two CABAC contexts are used when signaling a particular sign prediction residue. The CABAC context to use is determined by whether or not the associated dequantized coefficient is lower or higher than a threshold. Prediction residues for higher-valued coefficients are sent through a CABAC context initialized to expect a higher probability of a correct prediction (ie, a higher probability of expecting a zero residue). The current context initializations are around 58% (lower than threshold) and 74% (equal to or higher than threshold).

Other Bitstream Changes

It should be noted that as part of the software modifications applied to JEM3, the signaling of signs of all coefficients (luma, chroma, predicted and non-predicted) has been moved to the end of the TU block. i.e., signs are no longer signaled per CG. This is necessary for luma as will be seen below: the decoder needs access to all coefficient values in the TU in order to determine the signs that are predicted and that, accordingly, have only their prediction residues in the bitstream.

Although not strictly necessary for chroma as signs are never predicted for chroma, moving chroma signs to the end of the TU avoids the necessity of two different logic paths.

Decoder

Parsing

The decoder, as part of its parsing process, parses coefficients, signs and sign residues. The signs and sign residues are parsed at the end of the TU, and at that time the decoder knows the absolute values of all coefficients. Thus it can determine what signs are predicted and, for each predicted sign, it can determine the context to use to parse the sign prediction residue based on the dequantized coefficient value.

The knowledge of a “correct” or “incorrect” prediction is simply stored as part of the CU data of the block being parsed. The real sign of the coefficient is not known at this point.

Reconstruction

Later, during reconstruction, the decoder performs operations similar to the encoder (as described above for the encoder during its RDO). For n signs being predicted in the TU, the decoder performs n+1 inverse transform operations, and 2nborder reconstructions to determine hypothesis costs.

The real sign to apply to a coefficient that has had its sign predicted is determined by an exclusive-or operation on:1. The predicted value of the sign.2. The “correct” or “incorrect” data stored in the CU during bitstream parsing.
Interaction with Sign Data Hiding

In each TU where the sign of a coefficient is “hidden” using the existing Sign Data Hiding mechanism, sign prediction simply treats such coefficient as “not available” for its own prediction technique and it will predict only using others.

Three angular modes are selected from a Histogram of Gradient (HoG) computed from the neighboring pixels of current block. Once the three modes are selected, their predictors are computed normally and then their weighted average is used as the final predictor of the block. To determine the weights, corresponding amplitudes in the HoG are used for each of the three modes. The DIMD mode is used as an alternative prediction mode and is always checked in the FullRD mode.

Current version of DIMD has modified some aspects in the signaling, HoG computation and the prediction fusion. The purpose of this modification is to improve the coding performance as well as addressing the complexity concerns raised during the last meeting (i.e. throughput of 4×4 blocks). The following sections describe the modifications for each aspect.

Signalling

FIG.41illustrates a schematic diagram of proposed intra block decoding process4100.FIG.41shows the order of parsing flags/indices in VTM5, integrated with the proposed DIMD. As can be seen, the DIMD flag of the block is parsed first using a single CABAC context, which is initialized to the default value of 154.

If flag==0, then the parsing continues normally.

Else (if flag==1), only the ISP index is parsed and the following flags/indices are inferred to be zero: BDPCM flag, MIP flag, MRL index. In this case, the entire IPM parsing is also skipped. During the parsing phase, when a regular non-DIMD block inquires the IPM of its DIMD neighbor, the mode PLANAR_IDX is used as the virtual IPM of the DIMD block.

Texture Analysis

The texture analysis of DIMD includes a Histogram of Gradient (HoG) computation (FIG.42). The HoG computation is carried out by applying horizontal and vertical Sobel filters on pixels in a template of width 3 around the block. Except, if above template pixels fall into a different CTU, then they will not be used in the texture analysis.

Once computed, the IPMs corresponding to two tallest histogram bars are selected for the block. In previous versions, all pixels in the middle line of the template were involved in the HoG computation. However, the current version improves the throughput of this process by applying the Sobel filter more sparsely on 4×4 blocks. To this aim, only one pixel from left and one pixel from above are used.FIG.42illustrates a schematic diagram4200of HoG computation from a template of width 3 pixels.

In addition to reduction in the number of operations for gradient computation, this property also simplifies the selection of best2modes from the HoG, as the resulting HoG cannot have more than two non-zero amplitudes.

Prediction Fusion

Like the previous version, the current version of the method also uses a fusion of three predictors for each block. However, the choice of prediction modes is different and makes use of the combined hypothesis intra-prediction method, where the Planar mode is considered to be used in combination with other modes when computing an intra-predicted candidate. In the current version, the two IPMs corresponding to two tallest HoG bars are combined with the Planar mode.

The prediction fusion is applied as a weighted average of the above three predictors. To this aim, the weight of planar is fixed to 21/64 (˜1/3). The remaining weight of 43/64 (˜2/3) is then shared between the two HoG IPMs, proportionally to the amplitude of their HoG bars.FIG.43illustrates a schematic diagram4300of prediction fusion by weighted averaging of two HoG modes and planar.FIG.43visualises this process.

When DIMD is applied, two intra modes are derived from the reconstructed neighbor samples, and those two predictors are combined with the planar mode predictor with the weights derived from the gradients.

Derived intra modes are included into the primary list of intra most probable modes (MPM), so the DIMD process is performed before the MPM list is constructed. The primary derived intra mode of a DIMD block is stored with a block and is used for MPM list construction of the neighboring blocks.

This contribution proposes a template-based intra mode derivation (TIMD) method using MPMs, in which a TIMD mode is derived from MPMs using the neighbouring template. The TIMD mode is used as an additional intra prediction method for a CU.

For each intra prediction mode in MPMs, The SATD between the prediction and reconstruction samples of the template is calculated. The intra prediction mode with the minimum SATD is selected as the TIMD mode and used for intra prediction of current CU. Position dependent intra prediction combination (PDPC) is included in the derivation of the TIMD mode.

A flag is signalled in sequence parameter set (SPS) to enable/disable the proposed method. When the flag is true, a CU level flag is signalled to indicate whether the proposed TIMD method is used. The TIMD flag is signalled right after the MIP flag. If the TIMD flag is equal to true, the remaining syntax elements related to luma intra prediction mode, including MRL, ISP, and normal parsing stage for luma intra prediction modes, are all skipped.

Interaction with New Coding Tools

A DIMD method with prediction fusion using Planar was integrated in EE2. When EE2 DIMD flag is equal to true, the proposed TIMD flag is not signalled and set equal to false.

Similar to PDPC, Gradient PDPC is also included in the derivation of the TIMD mode. When secondary MPM is enabled, both the primary MPMs and the secondary MPMs are used to derive the TIMD mode.

6-tap interpolation filter is not used in the derivation of the TIMD mode.

Modification of MPM List Construction in the Derivation of TIMD Mode

During the construction of MPM list, intra prediction mode of a neighbouring block is derived as Planar when it is inter-coded. To improve the accuracy of MPM list, when a neighbouring block is inter-coded, a propagated intra prediction mode is derived using the motion vector and reference picture and used in the construction of MPM list. This modification is only applied to the derivation of the TIMD mode.

2.30 Intra Template Matching

Template matching prediction is a coding tool that is mostly adapted for screen content coding. The prediction signal is generated at the decoder side by matching the L-shaped causal neighbor of the current block with another block in a predefined search area.FIG.44illustrates a schematic diagram4400of intra template matching search area used. Specifically, the search range is divided into 3 regions:R1: within the current CTUR2: top-left outside the current CTUR3: above the current CTUR4: left to the current CTU

Within each region, the decoder searches for the template the has least SAD with respect to the current one and uses its corresponding block as a prediction block.

The dimensions of all regions (SearchRange_w, SearchRange_h) are set proportional to the block dimension (BlkW, BlkH) in order to have a fixed number of SAD comparisons per pixel.

That is:

Where ‘a’ is a constant that controls the gain/complexity trade-off.

2.31 Coding Data Refinement in Image/Video Coding

The term ‘block’ may represent a coding tree block (CTB), a coding tree unit (CTU), a coding block (CB), a CU, a PU, a TU, a PB, a TB or a video processing unit comprising multiple samples/pixels. A block may be rectangular or non-rectangular.

In the disclosure, the phrase “motion candidate” may represent a merge motion candidate in a regular/extended merge list indicated by a merge candidate index, or an AMVP motion candidate in regular/extended AMVP list indicated by an AMVP candidate index, or one AMVP motion candidate, or one merge motion candidate.

In the disclosure, a motion candidate is called to be “refined” if the motion information of the candidate is modified according to information signaled from the encoder or derived at the decoder. For example, a motion vector may be refined by DMVR, FRUC, TM merge, TM AMVP, TM GPM, TM CIIP, TM affine, MMVD, GMVD, affine MMVD, BDOF and so on. In the disclosure, the phrase “coding data refinement” may represent a refinement process in order to derive or refine the signalled/decoded/derived prediction modes, prediction directions, or signalled/decoded/derived motion information, prediction and/or reconstruction samples for a block. In one example, the refinement process may include motion candidate reordering. In the following discussion, a “template-based-coded” block may refer to a block using a template matching based method in the coding/decoding process to derive or refine coded information, such as template-matching based motion derivation, template-matching based motion list reconstruction, LIC, sign prediction, template-matching based block vector (e.g., used in IBC mode) derivation, DIMD, template-matching based non-inter (e.g., intra) prediction, etc. The template-based-coded method may be combined with any other coding tools, such as MMVD, CIIP, GPM, FRUC, Affine, BDOF, DMVR, OBMC, etc. In yet another example, the “template-based-coded” block may also refer to a block which derives or refines its decoded information based on certain rules using neighboring reconstructed samples (adjacent or non-adjacent), e.g., the DIMD method in 0 and the TIMD method 2.29). In the following discussion, a “bilateral-based-coded” block may refer to a block using a bilateral matching based method in the coding/decoding process to derive or refine coded information, such as bilateral-matching based motion derivation, bilateral-matching based motion list reconstruction, and etc. The bilateral-based-coded method may be combined with any other coding tools, such as MMVD, CIIP, GPM, FRUC, Affine, DMVR, and etc. W and H are the width and height of current block (e.g., luma block). W*H is the size of current block (e.g., luma block)

In the following discussion, Shift(x, s) is defined as

Shift(x,s)=(x+offset)»s, wherein offset is an integer such as offset=0 or offset=1<<(s−1) or offset=(1«(s−1))−1.

In another example, offset depends on x. For example, offset=(x<0 ? (1«(s−1)): ((1<<(s−1)−1).1. In addition to the error measurement, it is proposed to add a regulation item in the cost calculation process.a) In one example, the cost is defined as: E+W*RI wherein the E represents the output of an error function, W is the weight applied to the regulation item denoted by RI.i. In one example, for processing the template-based-coded block/bilateral-based-coded block, the cost function is set to: E+W*RI wherein E may be SAD/MRSAD/SATD or others, RI is the estimated bits for motion vectors/motion vector differences, W is a weight, e.g., which may rely on QP/temporal layer etc. al.ii. Alternatively, the cost is defined as: w0*E+W1*RI wherein the E represents the output of an error function, W1is the weight applied to the regulation item denoted by RI, w0is the weight applied to the output of the error function.(i) Alternatively, furthermore, W1may be set to 0.b) In one example, the regulation item is multiplied by a weighted rate.i. In one example, the weight is derived on-the-fly.ii. In one example, the weight is set to lambda used in the full RDO processiii. In one example, the weight is set to a square root of the lambda used in the full RDO process.c) In one example, the cost is calculated as E+Shift(W*RI, s), wherein s and W are integers.i. Alternatively, the cost is calculated as Shift((E<<s)+W*RI, s), wherein s and W are integers.2. It is proposed to use an error function different from SAD/MR-SAD (mean removal sum of absolute difference) for processing a template-based-coded block/bilateral-based-coded block.a) In one example, the error function may bei. SATDii. MR-SATDiii. Gradient informationiv. SSE/SSDv. MR-SSE/MR-SSDvi. Weighted SAD/weighted MR-SADvii. Weighted SATD/weighted MR-SATDviii. Weighted SSD/weighted MR-SSDix. Weighted SSE/weighted MR-SSEb) Alternatively, furthermore, it is proposed to adaptively select the error function among different cost functions such as the above mentioned error functions and SAD/MR-SAD.i. The selection may be determined on-the-fly.3. When using the MR-X (e.g., X being SATD, SAD, SSE) based error function (e.g., MR-SAD/MR-SATD etc. al), the following may further apply:a) In one example, the mean may be calculated with all samples in a block to be compared taken into consideration.b) In one example, the mean may be calculated with partial samples in a block to be compared taken into consideration.c) In one example, the mean and the X function may depend on same samples in a block.i. In one example, the mean and X function may be calculated with all samples in the block.ii. In one example, the mean and X function may be calculated with partial samples in the block.d) In one example, the mean and the X function may depend on at least one different samples in a block.i. In one example, the mean may be calculated with all samples while the X function may depend on partial samples in the block.ii. In one example, the mean may be calculated with partial samples while the X function may depend on all samples in the block.4. The template/bilateral matching cost may be calculated by applying a cost factor to the error cost function.a) In one example, it is proposed to favor the motion candidates ahead during the template/bilateral matching based reordering process.i. In one example, the motion candidate in the ith position is assigned with a smaller cost factor than the cost factor of the motion candidate in the (i+1)th position.ii. In one example, the motion candidates in the ith group (e.g. involve M motion candidates) are assigned with a smaller cost factor than the cost factor of the motion candidates in the (i+1)th group (e.g. involve N motion candidates).(i) In one example, M may be equal to N. For example, M=N=2.(ii) In one example, M may be not equal to N. For example, M=2, N=3.b) In one example, it is proposed to favor the searching MVs closer to original MV during the template/bilateral matching based refinement processi. In one example, each search region is assigned with a cost factor, which may be determined by the distance (e.g. delta MV in integer pixel precision) between each searching MV in the search region and the starting MV.ii. In one example, each search region is assigned with a cost factor, which may be determined by the distance (e.g. delta MV in integer pixel precision) between the center searching MV in the search region and the starting MV.iii. In one example, each searching MV is assigned with a cost factor, which may be determined by the distance (e.g. delta MV in integer pixel precision) between each searching MV and the starting MV.5. The above methods may be applied to any coding data refinement process, e.g., for a template-based-coded block, for a bilateral-based-coded block (e.g., DMVR in VVC).6. The template matching cost measurement may be different for different template matching refinement methods.a) In one example, the template matching refinement method may be template matching based motion candidate reordering.b) In one example, the template matching refinement method may be template matching based motion derivation.i. In one example, the refinement method may be TM AMVP, TM merge, and/or FRUC.c) In one example, the template matching refinement method may be template matching based motion refinement.ii. In one example, the refinement method may be TM GPM, TM CIIP, and/or TM affine.d) In one example, the template matching refinement method may be template matching based block vector derivation.e) In one example, the template matching refinement method may be template matching based intra mode derivation.iii. In one example, the refinement method may be DIMD and/or TIMD.f) In one example, the template matching cost measure may be calculated based on the sum of absolute differences (SAD) between the current and reference templates.g) In one example, the template matching cost measure may be calculated based on the mean-removal SAD between the current and reference templates.h) In one example, SAD and mean-removal SAD (MR-SAD) might be selectively utilized according to the size of the current block.i. In one example, mean-removal SAD is used for the block with size larger than M and SAD is used for the block with size smaller than or equal to M.(i) In one example, M is 64.i) In one example, SAD and mean-removal SAD (MR-SAD) might be selectively utilized according to the LIC flag of the current block.i. In one example, the template matching cost measure may be SAD if the LIC flag of the current block is false.ii. In one example, the template matching cost measure may be MR-SAD if the LIC flag of the current block is true.j) In one example, the template matching cost measure may be calculated based on the sum of absolute transformed differences (SATD) between the current and reference templates.k) In one example, the template matching cost measure may be calculated based on the mean-removal SATD between the current and reference templates.l) In one example, SATD and mean-removal SATD (MR-SATD) might be selectively utilized according to the size of the current block.i. In one example, mean-removal SATD is used for the block with size larger than M and SATD is used for the block with size smaller than or equal to M.(i) In one example, M is 64.m) In one example, SATD and mean-removal SATD (MR-SATD) might be selectively utilized according to the LIC flag of the current block.i. In one example, the template matching cost measure may be SATD if the LIC flag of the current block is false.ii. In one example, the template matching cost measure may be MR-SATD if the LIC flag of the current block is true.n) In one example, the template matching cost measure may be calculated based on the sum of squared differences (SSD) between the current and reference templates.o) In one example, the template matching cost measure may be calculated based on the mean-removal SSD between the current and reference templates.p) In one example, SSD and mean-removal SSD (MR-SSD) might be selectively utilized according to the size of the current block.i. In one example, mean-removal SSD is used for the block with size larger than M and SSD is used for the block with size smaller than or equal to M.(i) In one example, M is 64.q) In one example, the template matching cost measure may be the weighted SAD/weighted MR-SAD/selectively weighted MR-SAD and SAD/weighted SATD/weighted MR-SATD/selectively weighted MR-SATD and SATD/weighted SSD/weighted MR-SSD/selectively weighted MR-SSD and SSD between the current and reference templates.i. In one example, the weighted means applying different weights to each sample based on its row and column indices in template block when calculating the distortion between the current and reference templates.ii. In one example, the weighted means applying different weights to each sample based on its positions in template block when calculating the distortion between the current and reference templates.iii. In one example, the weighted means applying different weights to each sample based on its distances to current block when calculating the distortion between the current and reference templates.r) In one example, the template matching cost may be calculated as a form of tplCost=w1*mvDistanceCost+w2*distortionCost.i. In one example, distortionCost may be weighted SAD/weighted MR-SAD/weighted SATD/weighted MR-SATD/weighted SSD/weighted MR-SSD/SAD/MR-SAD/SATD/MR-SATD/SSD/MR-SSD between the current and reference templates.ii. In one example, mvDistanceCost may be the sum of absolute my differences of searching point and starting point in horizontal and vertical directions.iii. In one example, w1and w2may be pre-defined, or signaled or derived according to decoded information.(i) In one example, w1is a weighting factor set to 4, w2is a weighting factor set to 1s) The cost may consider the continuity (Boundary_SAD) between reference template and reconstructed samples adjacently or non-adjacently neighboring to current template in addition to the SAD calculated in (f). For example, reconstructed samples left and/or above adjacently or non-adjacently neighboring to current template are considered.i. In one example, the cost may be calculated based on SAD and Boundary_SAD(i) In one example, the cost may be calculated as (SAD+w*Boundary_SAD). w may be pre-defined, or signaled or derived according to decoded information.7. The bilateral matching cost measurement may be different for different bilateral matching refinement methods.a) In one example, the bilateral matching refinement method may be bilateral matching based motion candidate reordering.b) In one example, the bilateral matching refinement method may be bilateral matching based motion derivation.i. In one example, the refinement method maybe BM merge and/or FRUC.c) In one example, the bilateral matching refinement method may be bilateral matching based motion refinement.i. In one example, the refinement method may be BM GPM, BM CIIP, and/or BM affine.d) In one example, the bilateral matching refinement method may be bilateral matching based block vector derivation.e) In one example, the bilateral matching refinement method may be bilateral matching based intra mode derivation.f) In one example, the bilateral matching cost measure may be calculated based on the sum of absolute differences (SAD) between the two reference blocks/subblocks.g) In one example, the bilateral matching cost measure may be calculated based on the mean-removal SAD between the two reference blocks/subblocks.h) In one example, SAD and mean-removal SAD (MR-SAD) might be selectively utilized according to the size of the current block/subblock.i. In one example, mean-removal SAD is used for the block/subblock with size larger than M and SAD is used for the block/subblock with size smaller than or equal to M.(i) In one example, M is 64.i) In one example, SAD and mean-removal SAD (MR-SAD) might be selectively utilized according to the LIC flag of the current block.i. In one example, the bilateral matching cost measure may be SAD if the LIC flag of the current block is false.ii. In one example, the bilateral matching cost measure may be MR-SAD if the LIC flag of the current block is true.j) In one example, the bilateral matching cost measure may be calculated based on the sum of absolute transformed differences (SATD) between the two reference blocks/subblocks.k) In one example, the bilateral matching cost measure may be calculated based on the mean-removal SATD between the two reference blocks/subblocks.l) In one example, SATD and mean-removal SATD (MR-SATD) might be selectively utilized according to the size of the current block/subblock.i. In one example, mean-removal SATD is used for the block/subblock with size larger than M and SATD is used for the block/subblock with size smaller than or equal to M.(i) In one example, M is 64.m) In one example, SATD and mean-removal SATD (MR-SATD) might be selectively utilized according to the LIC flag of the current block.i. In one example, the bilateral matching cost measure may be SATD if the LIC flag of the current block is false.ii. In one example, the bilateral matching cost measure may be MR-SATD if the LIC flag of the current block is true.n) In one example, the bilateral matching cost measure may be calculated based on the sum of squared differences (SSD) between the two reference blocks/subblocks.o) In one example, the bilateral matching cost measure may be calculated based on the mean-removal SSD between the two reference blocks/subblocks.p) In one example, SSD and mean-removal SSD (MR-SSD) might be selectively utilized according to the size of the current block/subblock.i. In one example, mean-removal SSD is used for the block/subblock with size larger than M and SSD is used for the block/subblock with size smaller than or equal to M.(i) In one example, M is 64.q) In one example, SSD and mean-removal SSD (MR-SSD) might be selectively utilized according to the LIC flag of the current block.i. In one example, the bilateral matching cost measure may be SSD if the LIC flag of the current block is false.ii. In one example, the bilateral matching cost measure may be MR-SSD if the LIC flag of the current block is true.r) In one example, the bilateral matching cost measure may be the weighted SAD/weighted MR-SAD/selectively weighted MR-SAD and SAD/weighted SATD/weighted MR-SATD/selectively weighted MR-SATD and SATD/weighted SSD/weighted MR-SSD/selectively weighted MR-SSD and SSD between the two reference blocks/subblocks.i. In one example, the weighted means applying different weights to each sample based on its row and column indices in reference block/subblock when calculating the distortion between the two reference blocks/subblocks.ii. In one example, the weighted means applying different weights to each sample based on its positions in reference block/subblock when calculating the distortion between the two reference blocks/subblocks.iii. In one example, the weighted means applying different weights to each sample based on its distances to center position of reference block/subblock when calculating the distortion between the two reference blocks/subblocks.s) In one example, if MR-SAD/MR-SATD/MR-SSD is used for the bilateral matching cost measure, LIC may be not used when deriving the reference blocks/subblocks.t) In one example, the bilateral matching cost may be calculated as a form of bilCost=w1*mvDistanceCost+w2*distortionCost.i. In one example, distortionCost may be weighted SAD/weighted MR-SAD/weighted SATD/weighted MR-SATD/weighted SSD/weighted MR-SSD/SAD/MR-SAD/SATD/MR-SATD/SSD/MR-SSD between the two reference blocks/subblocks.ii. In one example, mvDistanceCost may be the sum of absolute my differences of searching point and starting point in horizontal and vertical directions.iii. In one example, w1and w2may be pre-defined, or signaled or derived according to decoded information.(i) In one example, w1is a weighting factor set to 4, w2is a weighting factor set to 1.8. The bilateral or template matching cost may be calculated based on prediction/reference samples which are modified by a function.a) In one example, the prediction/reference samples may be filtered before being used to calculate the bilateral or template matching cost.b) In one example, a prediction/reference sample S may be modified to be a*S+b before being used to calculate the bilateral or template matching cost.c) In one example, the modification may depend on the coding mode of the block, such as whether the block is LIC-coded or BCW-coded.

2.32 Error Function of Coding Data Refinement in Image/Video Coding

1. The cost definition may rely on outputs of multiple errors functions (e.g., distortion measurement methods) regarding the error/difference of two samples/blocks to be evaluated in one coding data refinement process of a current block.a) In one example, the error function may be:i. SADii. SATDiii. MR-SADiv. MR-SATDv. Gradient informationvi. SSE/SSDvii. MR-SSE/MR-SSDviii. Weighted SAD/weighted MR-SADix. Weighted SATD/weighted MR-SATDx. Weighted SSD/weighted MR-SSDxi. Weighted SSE/weighted MR-SSEb) In one example, the error function may be performed in block level or sub-block level.i. Alternatively, furthermore, for two sub-blocks, the error function may be different.ii. Alternatively, furthermore, the final output of the evaluated error of a block may be based on the outputs of sub-blocks, e.g., sum of outputs of error functions applied to each sub-block.2. When the cost definition relies on outputs of multiple functions, the following may further apply:a) In one example, the cost function may rely on a linear weighted sum of multiple error functions.b) In one example, the cost function may rely on a non-linear weighted sum of multiple error functions.c) In one example, the cost function may further rely on estimated bits for side information.d) In one example, the cost function may be defined as:

C=R+∑i=0N-1Wi*Eiwherein R denotes the estimated bits for side information, Wiand Eirepresent the weight applied to the i-th error function and output of the i-th error function, respectively.3. Multiple refinement processes may be applied to one block with at least more than two different cost functions applied to at least two refinement processes.a) In one example, a first refinement process may be invoked with a first cost function. Based on the output of the first refinement process, a second cost function is further applied to the second refinement process.b) The above methods may be applied to the template-based-coded blocks.4. How to select one or multiple error function and/or how to define the cost function and/or which samples to be involved in the error function may depend on the decoded information of a current block.a) In one example, how to select one or multiple error function and/or how to define the cost function may depend on the coding tool applied to current blcok.i. In one example, the coding tool is the LIC.(i) In one example, SSD and mean-removal SSD (MR-SSD) might be selectively utilized according to the LIC flag of the current block.a) In one example, the template matching cost measure may be SSD if the LIC flag of the current block is false.b) In one example, the template matching cost measure may be MR-SSD if the LIC flag of the current block is true.(ii) In one example, if MR-SAD/MR-SATD/MR-SSD is used for the template matching cost measure, the linear function used in LIC process may be not used when deriving the reference template.(iii) In one example, if MR-SAD/MR-SATD/MR-SSD is used for the bilateral matching cost measure, the linear function used in LIC process may be not used when deriving the reference block.b) In one example, it may depend on block dimension (e.g., W, H), temporal layer, low delay check flag, etc. al.c) In one example, it may depend on reference picture list and/or reference picture information.i. In one example, for list X, a first error function (e.g., SAD/SSE) may be used, and for list Y (Y=1-X), a second error function (e.g., MR-SAD/MR-SSE) may be used.ii. Alternatively, furthermore, the final cost may be based on the costs of each reference picture list.5. The above methods may be applied to any coding data refinement process, e.g., for a template-based-coded block, for a bilateral-based-coded block (e.g., DMVR in VVC).

The current design of coding data refinement can be further improved.1. For current design, either bilateral matching (with reference blocks corresponding to current block) or template matching (with reference blocks corresponding to a template containing neighbouring samples of the current block) is utilized. The continuity between current block and its neighbouring blocks is not taken into consideration.2. It would be more efficient if the matching error measure is adaptively selected according to coding data refinement method (e.g., bilateral matching or template matching and etc.) and/or the prediction type of coded blocks (such as template matching/bilateral matching GPM, template matching/bilateral matching CIIP, template matching/bilateral matching SbTMVP, template matching/bilateral matching Affine, template matching (TM)/bilateral matching (BM)-based MMVD, DMVR, FRUC, TM merge, TM AMVP and etc.).

4 DETAILED DESCRIPTIONS

The detailed disclosures below should be considered as examples to explain general concepts. These disclosures should not be interpreted in a narrow way. Furthermore, these disclosures can be combined in any manner.

The term ‘block’ may represent a coding tree block (CTB), a coding tree unit (CTU), a coding block (CB), a CU, a PU, a TU, a PB, a TB or a video processing unit comprising multiple samples/pixels. A block may be rectangular or non-rectangular.

In the disclosure, the phrase “motion candidate” may represent a merge motion candidate in a regular/extended merge list indicated by a merge candidate index, or an AMVP motion candidate in regular/extended AMVP list indicated by an AMVP candidate index, or one AMVP motion candidate, or one merge motion candidate.

In the disclosure, a motion candidate is called to be “refined” if the motion information of the candidate is modified according to information signaled from the encoder or derived at the decoder. For example, a motion vector may be refined by DMVR, FRUC, TM merge, TM AMVP, TM GPM, TM CIIP, TM affine, MMVD, GMVD, affine MMVD, BDOF and so on. In the disclosure, the phrase “coding data refinement” may represent a refinement process in order to derive or refine the signalled/decoded/derived prediction modes, prediction directions, or signalled/decoded/derived motion information, prediction and/or reconstruction samples for a block. In one example, the refinement process may include motion candidate reordering. In the following discussion, a “template-based-coded” block may refer to a block using a template matching based method in the coding/decoding process to derive or refine coded information, such as template-matching based motion derivation, template-matching based motion list reconstruction, LIC, sign prediction, template-matching based block vector (e.g., used in IBC mode) derivation, DIMD, template-matching based non-inter (e.g., intra) prediction, etc. The template-based-coded method may be combined with any other coding tools, such as MMVD, CIIP, GPM, FRUC, Affine, BDOF, DMVR, OBMC, etc. In yet another example, the “template-based-coded” block may also refer to a block which derives or refines its decoded information based on certain rules using neighboring reconstructed samples (adjacent or non-adjacent), e.g., the DIMD method in 0 and the TIMD method 2.29). In the following discussion, a “bilateral-based-coded” block may refer to a block using a bilateral matching based method in the coding/decoding process to derive or refine coded information, such as bilateral-matching based motion derivation, bilateral-matching based motion list reconstruction, and etc. The bilateral-based-coded method may be combined with any other coding tools, such as MMVD, CIIP, GPM, FRUC, Affine, DMVR, and etc. W and H are the width and height of current block (e.g., luma block). W*H is the size of current block (e.g., luma block)1. The error/cost evaluation in the coding data refinement process may depend on both reference samples corresponding to current block (e.g., the reference blocks used in bilateral matching) and reference samples corresponding to a template of current block.a) Alternatively, it may depend on both reference samples corresponding to current block and samples in a template of current block.b) In one example, the template may be neighboring samples (adjacent or non-adjacent) of current block.2. Multiple refinement processes may be applied to one block with different templates applied to at least two refinement processes.a) In one example, a first refinement process may be invoked with a first template. Based on the output of the first refinement process, a second template is further utilized in the second refinement process.b) In one example, the first template may contain more samples compared to the second template.c) In one example, the first and second template may contain at least one different sample.d) In one example, the first and second refinement process may use different cost/error functions.3. Whether to use multiple refinement process, and/or how to select one or multiple error function and/or how to define the cost function and/or which samples to be involved in the error function may depend on the decoded information of a current block and/or neighboring (adjacent or non-adjacent) blocks.a) In one example, how to select one or multiple error function and/or how to define the cost function may depend on the coding tool applied to current block and/or neighboring blocks.i. In one example, the coding tool is the LIC.(i) In one example, SSD/SAD/SATD and mean-removal SSD (MR-SSD)/MR-SAD/MR-SATD might be selectively utilized according to the LIC flag of the current block.a) In one example, the template matching cost measure may be SSD if the LIC flag of the current block is false.b) In one example, the template matching cost measure may be MR-SSD if the LIC flag of the current block is true.(ii) In one example, if MR-SAD/MR-SATD/MR-SSD is used for the template matching cost measure, the linear function used in LIC process may be not used when deriving the reference template.(iii) In one example, if MR-SAD/MR-SATD/MR-SSD is used for the bilateral matching cost measure, the linear function used in LIC process may be not used when deriving the reference block.b) In one example, it may depend on block dimension (e.g., W, H), temporal layer, low delay check flag, etc. al.c) In one example, it may depend on whether the motion information of current and neighboring block is similar/identical.d) In one example, it may depend on reference picture list and/or reference picture information.i. In one example, for list X, a first error function (e.g., SAD/SSE) may be used, and for list Y (Y=1-X), a second error function (e.g., MR-SAD/MR-SSE) may be used.ii. Alternatively, furthermore, the final cost may be based on the costs of each reference picture list.4. In one example, LIC may be enabled for reference list X and disabled for reference list Y.a) In one example, the final prediction of current block may be weighted average of LIC prediction from reference List X and regular prediction from reference List Y.5. The above methods may be applied to any coding data refinement process, e.g., for a template-based-coded block, for a bilateral-based-coded block (e.g., DMVR in VVC).

The embodiments of the present disclosure are related to coding data refinement. In the disclosure, the phrase “coding data refinement” may represent a refinement process in order to derive or refine the signalled/decoded/derived prediction modes, prediction directions, or signalled/decoded/derived motion information, prediction and/or reconstruction samples for a block. In one example, the refinement process may include motion candidate reordering.

FIG.45illustrates a flowchart of a method4500for video processing in accordance with some embodiments of the present disclosure. The method4500may be implemented during a conversion between a target block of a video and a bitstream of the video. As shown inFIG.45, the method4500starts at4502, where at least one refinement process is applied to the target video block based on a cost. The cost depends on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block. At block4504, the conversion is performed between the target video block and the bitstream.

According to embodiments of the present disclosure, the reference samples corresponding to the target video block may comprise a prediction sample of the target video block. The prediction sample may be a uni-predicted sample or a bi-predicted sample. The further samples corresponding to the template of the target video block may comprise a reference or prediction sample corresponding to the template of the target video block in the bilateral matching. The template of the target video block comprises an adjacent neighboring sample of the target video block and/or a non-adjacent neighboring sample of the target video block. In such cases, the target video block comprises a bilateral-based-coded block. The at least one refinement process comprises a decoded motion vector refinement (DMVR) process as described in the above section 2.19. In this way, the continuity between the current block and its neighboring block (for example, a reference sample corresponding to the neighboring block of the target video block) will be taken into consideration in the refinement process.

Alternatively, the further samples corresponding to the template of the target video block may comprise a reconstructed sample in the template of the target video block in a template matching as described in the above section 2.12. In such cases, the target video block comprises a template-based-coded block. The template of the target video block comprises an adjacent neighboring sample of the target video block and/or a non-adjacent neighboring sample of the target video block. In this way, the continuity between the current block and its neighboring block (for example, a sample in the neighboring block of the target video block) will be taken into consideration in the refinement process.

According to embodiments of the present disclosure, at block4502, a first refinement process may be applied to the target video block based on a first template to obtain first refined information, and a second refinement process based on the first refined information may be applied to the first refined information based on a second template to obtain second refined information. The second template may be different from the first template.

In some embodiments, the number of samples contained in the first template is greater than the number of samples contained in the second template. In other words, the first template may contain more samples compared to the second template. Alternatively, or in addition, the first template contains at least one sample different from samples contained in the second template. In other words, the first template and the second template may contain at least one different sample. Alternatively, or in addition, in some embodiments, a first cost metric or a first error metric is used in the first refinement process, a second cost metric or a second error metric is used in the second refinement process. The second cost metric is different from the first cost metric, and the second error metric is different from the first error metric.

In some embodiments, the following information is determined at least based on decoded information of the target video block and/or decoded information of one or more neighboring blocks of the target video block: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost metric, or samples involved in an error metric. For example, the selection of the one or more error metrics or the definition of the cost metric depends on at least one of: a coding tool applied to the target video block, or a coding tool applied to the neighboring block. For example, the neighboring block of the target video block comprises at least one of: an adjacent neighboring block or non-adjacent neighboring block.

In some embodiments, how to select one or more multiple error metrics and/or how to define the cost metric may depend on the coding tool applied to current block and/or neighboring block. For example, the coding tool applied to the target video block or the coding tool applied to the neighboring block comprises a Local Illumination Compensation (LIC). In such cases, the selection of the one or more error metrics is based on a LIC flag of the target video block. For example, if the LIC flag is false, the error metric used in a template matching cost measurement or a bilateral matching cost measurement is determined as one of the followings: a sum of absolute differences (SAD), a sum of absolute transformed differences (SATD), or a sum of squared differences (SSD). Otherwise, if the LIC flag is true, the error metric used in a template matching cost measurement or a bilateral matching cost measurement is determined as one of the followings: a mean-removed sum of absolute differences (MR-SAD), a mean-removed sum of absolute transformed differences (MR-SATD), or a mean-removed sum of squared differences (MR-SSD).

In some embodiments, the method4500further comprises: in response to a mean-removed sum of absolute differences (MR-SAD), a mean-removed sum of absolute transformed differences (MR-SATD), or a mean-removed sum of squared differences (MR-SSD) being used in a template matching cost measurement, determining a reference template for the template matching without using a LIC process. In other words, if MR-SAD or MR-SATD or MR-SSD is used for the template matching cost measurement, the linear function used in the LIC process may be not used when deriving the reference block.

Alternatively, or in addition, the method4500further comprises: in response to a MR-SAD, a MR-SATD or a MR-SSD being used in a bilateral matching cost measurement, determining a reference block for the bilateral matching without using a LIC process. In other words, if MR-SAD or MR-SATD or MR-SSD is used for the bilateral matching cost measurement, the linear function used in the LIC process may be not used when deriving the reference block.

In some embodiments, the following information is determined at least based on at least one of: a block dimension (for example, W and/or H), a temporal layer, or a low delay check flag: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost function, or samples involved in an error metric.

Alternatively, or in addition, in some embodiments, the following information is determined at least based on a similarity between motion information of the target video block and motion information of a neighboring block of the target video block: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost metric, or samples involved in an error metric. In other words, it may depend on whether the motion information of current and neighboring block is similar or identical.

Alternatively, or in addition, in some embodiments, the following information is determined at least based on a reference picture list or reference picture information for the target video block: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost metric, or samples involved in an error metric.

In some embodiments, the method4500further comprises: determining a first cost for the first reference picture list (for example, list X) based on a first error metric; determining a second cost for the second reference picture list (for example, the list Y, Y=1-X) based on a second error metric; and determining the cost based on the first cost and the second cost. For example, during the selection of the one or more error metrics, the first error metric for a first reference picture list is determined to be a sum of absolute differences (SAD) or a sum of squared error (SSE). In addition, the second error metric for a second reference picture list is determined to be a mean-removed sum of absolute differences (MR-SAD) or a mean-removed sum of squared error (MR-SSE).

In some embodiments, the method4500further comprises: enabling a Local Illumination Compensation (LIC) for a first reference picture list for the target video block; and disabling the LIC for a second reference picture list for the target video block. In such cases, the method4500may further comprises: determining a LIC prediction from the first reference picture list; determining a regular prediction from the second reference picture list; and calculating a weighted average of the LIC prediction and the regular prediction to obtain a final prediction for the target video block.

In some embodiments, the conversion includes encoding the target video block into the bitstream.

In some embodiments, the conversion includes decoding the target video block from the bitstream.

Implementations of the present disclosure can be described in view of the following clauses, the features of which can be combined in any reasonable manner.

In some embodiments, a bitstream of a video may be stored in a non-transitory computer-readable recording medium. The bitstream of the video can be generated by a method per-formed by a video processing apparatus. According to the method, at least one hypothesis of a target video block of the video may be generated based on a prediction method of the target video block or a coding method of the target video block. The target video block may be a multiple hypothesis prediction block. A bitstream of the target video block may be generated based on the at least one hypothesis.

In some embodiments, at least one hypothesis of a target video block of the video is generated based on a prediction method of the target video block or a coding method of the target video block. The target video block may be a multiple hypothesis prediction block. A bitstream of the target video block may be generated based on the at least one hypothesis. The bitstream may be stored in a non-transitory computer-readable recording medium.

Clause 1. A method for video processing, comprising: applying, during a conversion between a target video block of a video and a bitstream of the video, at least one refinement process to the target video block based on a cost, the cost depending on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block; and performing the conversion between the target video block and the bitstream.

Clause 2. The method of clause 1, wherein applying the at least one refinement process comprises: applying a first refinement process to the target video block based on a first template to obtain first refined information; and applying a second refinement process based on the first refined information to the target video block based on a second template to obtain second refined information, the second template being different from the first template.

Clause 3. The method of clause 2, wherein the number of samples contained in the first template is greater than the number of samples contained in the second template.

Clause 4. The method of clause 2, wherein the first template contains at least one sample different from samples contained in the second template.

Clause 5. The method of clause 2, wherein a first cost metric or a first error metric is used in the first refinement process, a second cost metric or a second error metric is used in the second refinement process, the second cost metric being different from the first cost metric, and the second error metric being different from the first error metric.

Clause 6. The method of any of clauses 1-5, wherein the following information is determined at least based on decoded information of the target video block and/or decoded information of one or more neighboring blocks of the target video block: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost metric, or samples involved in an error metric.

Clause 7. The method of clause 6, wherein the selection of the one or more error metrics or the definition of the cost metric depends on at least one of: a coding tool applied to the target video block, or a coding tool applied to the neighboring block.

Clause 8. The method of clause 7, wherein the coding tool applied to the target video block or the coding tool applied to the neighboring block comprises a Local Illumination Compensation (LIC).

Clause 9. The method of clause 8, wherein the selection of the one or more error metrics is based on a LIC flag of the target video block.

Clause 10. The method of clause 9, wherein if the LIC flag is false, the error metric used in a template matching cost measurement or a bilateral matching cost measurement is determined as one of the followings: a sum of absolute differences (SAD), a sum of absolute transformed differences (SATD), or a sum of squared differences (SSD); and if the LIC flag is true, the error metric used in a template matching cost measurement or a bilateral matching cost measurement is determined as one of the followings: a mean-removed sum of absolute differences (MR-SAD), a mean-removed sum of absolute transformed differences (MR-SATD), or a mean-removed sum of squared differences (MR-SSD).

Clause 11. The method of clause 8, further comprising: in response to a mean-removed sum of absolute differences (MR-SAD), a mean-removed sum of absolute transformed differences (MR-SATD), or a mean-removed sum of squared differences (MR-SSD) being used in a template matching cost measurement, determining a reference template for the template matching without using a LIC process; and in response to a MR-SAD, a MR-SATD or a MR-SSD being used in a bilateral matching cost measurement, determining a reference block for the bilateral matching without using a LIC process.

Clause 12. The method of any of clauses 1-5, wherein the following information is determined at least based on at least one of a block dimension, a temporal layer, or a low delay check flag: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost function, or samples involved in an error metric.

Clause 13. The method of any of clauses 1-5, wherein the following information is determined at least based on a similarity between motion information of the target video block and motion information of a neighboring block of the target video block: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost metric, or samples involved in an error metric.

Clause 14. The method of any of clauses 1-5, wherein the following information is determined at least based on a reference picture list or reference picture information for the target video block: whether to use multiple refinement processes, a selection of one or more error metrics, a definition of a cost metric, or samples involved in an error metric.

Clause 15. The method of clause 14, further comprising: determining a first cost for the first reference picture list based on a first error metric; determining a second cost for the second reference picture list based on a second error metric; and determining the cost based on the first cost and the second cost.

Clause 16. The method of clause 15, wherein during the selection of the one or more error metrics, the first error metric for a first reference picture list is determined to be a sum of absolute differences (SAD) or a sum of squared error (SSE), and the second error metric for a second reference picture list is determined to be a mean-removed sum of absolute differences (MR-SAD) or a mean-removed sum of squared error (MR-SSE).

Clause 17. The method of any of clause 6 and clauses 12-14, wherein the neighboring block of the target video block comprises at least one of: an adjacent neighboring block or non-adjacent neighboring block.

Clause 18. The method of any of clauses 1-17, further comprising: enabling a Local Illumination Compensation (LIC) for a first reference picture list for the target video block; and disabling the LIC for a second reference picture list for the target video block.

Clause 19. The method of clause 18, further comprising: determining a LIC prediction from the first reference picture list; determining a regular prediction from the second reference picture list; and calculating a weighted average of the LIC prediction and the regular prediction to obtain a final prediction for the target video block.

Clause 20. The method of any of clauses 1-19, wherein the reference samples corresponding to the target video block comprise a prediction sample of the target video block. The prediction sample may comprise a uni-predicted sample or a bi-predicted sample.

Clause 21. The method of any of clauses 1-20, wherein the further samples corresponding to the template of the target video block comprise at least one of: a reference or prediction sample corresponding to the template of the target video block, or a reconstructed sample in the template of the target video block.

Clause 22. The method of any of clauses 1-21, wherein the template of the target video block comprises at least one of: an adjacent neighboring sample of the target video block, or a non-adjacent neighboring sample of the target video block.

Clause 23. The method of any of clauses 1-22, wherein the target video block comprises one of: a template-based-coded block, or a bilateral-based-coded block.

Clause 24. The method of clause 23, wherein the target video block comprises a bilateral-based-coded block, and the at least one refinement process comprises a decoded motion vector refinement (DMVR) process.

Clause 25. The method of any of clauses 1-24, wherein the conversion includes encoding the target video block into the bitstream.

Clause 26. The method of any of clauses 1-24, wherein the conversion includes decoding the target video block from the bitstream.

Clause 27. An apparatus for processing video data comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with any of clauses 1-26.

Clause 28. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of clauses 1-26.

Clause 29. A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by a video processing apparatus, wherein the method comprises: applying at least one refinement process to a target video block of the video based on a cost, the cost depending on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block; and generating the bitstream based on the applying.

Clause 30. A method for storing a bitstream of a video, comprising: applying at least one refinement process to a target video block of the video based on a cost, the cost depending on a plurality of reference samples corresponding to the target video block and a plurality of further samples corresponding to a template of the target video block; generating the bitstream based on the applying; and storing the bitstream in a non-transitory computer-readable recording medium.

Example Device

FIG.46illustrates a block diagram of a computing device4600in which various embodiments of the present disclosure can be implemented. The computing device4600may be implemented as or included in the source device110(or the video encoder114or200) or the destination device120(or the video decoder124or300).

It would be appreciated that the computing device4600shown inFIG.46is merely for purpose of illustration, without suggesting any limitation to the functions and scopes of the embodiments of the present disclosure in any manner.

As shown inFIG.46, the computing device4600includes a general-purpose computing device4600. The computing device4600may at least comprise one or more processors or processing units4610, a memory4620, a storage unit4630, one or more communication units4640, one or more input devices4650, and one or more output devices4660.

In some embodiments, the computing device4600may be implemented as any user terminal or server terminal having the computing capability. The server terminal may be a server, a large-scale computing device or the like that is provided by a service provider. The user terminal may for example be any type of mobile terminal, fixed terminal, or portable terminal, including a mobile phone, station, unit, device, multimedia computer, multimedia tablet, Internet node, communicator, desktop computer, laptop computer, notebook computer, netbook computer, tablet computer, personal communication system (PCS) device, personal navigation device, personal digital assistant (PDA), audio/video player, digital camera/video camera, positioning device, television receiver, radio broadcast receiver, E-book device, gaming device, or any combination thereof, including the accessories and peripherals of these devices, or any combination thereof. It would be contemplated that the computing device4600can support any type of interface to a user (such as “wearable” circuitry and the like).

The processing unit4610may be a physical or virtual processor and can implement various processes based on programs stored in the memory4620. In a multi-processor system, multiple processing units execute computer executable instructions in parallel so as to improve the parallel processing capability of the computing device4600. The processing unit4610may also be referred to as a central processing unit (CPU), a microprocessor, a controller or a microcontroller.

The computing device4600typically includes various computer storage medium. Such medium can be any medium accessible by the computing device4600, including, but not limited to, volatile and non-volatile medium, or detachable and non-detachable medium. The memory4620can be a volatile memory (for example, a register, cache, Random Access Memory (RAM)), a non-volatile memory (such as a Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), or a flash memory), or any combination thereof. The storage unit4630may be any detachable or non-detachable medium and may include a machine-readable medium such as a memory, flash memory drive, magnetic disk or another other media, which can be used for storing information and/or data and can be accessed in the computing device4600.

The computing device4600may further include additional detachable/non-detachable, volatile/non-volatile memory medium. Although not shown inFIG.46, it is possible to provide a magnetic disk drive for reading from and/or writing into a detachable and non-volatile magnetic disk and an optical disk drive for reading from and/or writing into a detachable non-volatile optical disk. In such cases, each drive may be connected to a bus (not shown) via one or more data medium interfaces.

The communication unit4640communicates with a further computing device via the communication medium. In addition, the functions of the components in the computing device4600can be implemented by a single computing cluster or multiple computing machines that can communicate via communication connections. Therefore, the computing device4600can operate in a networked environment using a logical connection with one or more other servers, networked personal computers (PCs) or further general network nodes.

The input device4650may be one or more of a variety of input devices, such as a mouse, keyboard, tracking ball, voice-input device, and the like. The output device4660may be one or more of a variety of output devices, such as a display, loudspeaker, printer, and the like. By means of the communication unit4640, the computing device4600can further communicate with one or more external devices (not shown) such as the storage devices and display device, with one or more devices enabling the user to interact with the computing device4600, or any devices (such as a network card, a modem and the like) enabling the computing device4600to communicate with one or more other computing devices, if required. Such communication can be performed via input/output (I/O) interfaces (not shown).

The computing device4600may be used to implement video encoding/decoding in embodiments of the present disclosure. The memory4620may include one or more video coding modules4625having one or more program instructions. These modules are accessible and executable by the processing unit4610to perform the functionalities of the various embodiments described herein.

In the example embodiments of performing video encoding, the input device4650may receive video data as an input4670to be encoded. The video data may be processed, for example, by the video coding module4625, to generate an encoded bitstream. The encoded bitstream may be provided via the output device4660as an output4680.

In the example embodiments of performing video decoding, the input device4650may receive an encoded bitstream as the input4670. The encoded bitstream may be processed, for example, by the video coding module4625, to generate decoded video data. The decoded video data may be provided via the output device4660as the output4680.