Method and device for video processing and medium

By updating the candidate list based on the similarity metric of the motion candidate list in video encoding and decoding technology, the problem of insufficient encoding and decoding quality in the prior art is solved, and more efficient video processing is achieved.

CN119605181APending Publication Date: 2025-03-11DOUYIN VISION CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380049221.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-06-22
Filing Date
2023-06-16
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Existing video codec technology has challenges in improving codec quality, especially while ensuring diversity in motion candidate lists.

Method used

By obtaining the motion candidate list of the current video block and determining whether to update the motion candidate list based on the similarity metric between the first motion candidate and the second motion candidate, the diversity of the motion candidate list is ensured.

Benefits of technology

This method effectively improves the encoding and decoding quality, ensures the diversity of the motion candidate list, and thus improves the performance of video processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119605181A_ABST
    Figure CN119605181A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a solution for video processing. A method for video processing is presented. The method comprises the following steps: aiming at conversion between a current video block of a video and a bit stream of the video, acquiring a motion candidate list aiming at the current video block; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; and performing a conversion based on the determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure generally relate to video coding techniques, and more particularly to diverse creation of motion candidate lists. Background Art

[0002] Nowadays, digital video capabilities are being applied to all aspects of people's lives. A variety of video compression technologies have been proposed for video encoding / decoding, such as MPEG-2, MPEG-4, ITU-TH.263, ITU-TH.264 / MPEG-4 Part 10 Advanced Video Codec (AVC), ITU-TH.265 High Efficiency Video Codec (HEVC) standard, and Versatile Video Codec (VVC) standard. However, it is generally expected to further improve the encoding and decoding quality of traditional video encoding and decoding technologies. Summary of the invention

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

[0004] In a first aspect, a method for video processing is provided. The method includes: for conversion between a current video block of a video and a bitstream of the video, obtaining a motion candidate list for the current video block; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; and performing conversion based on the determination.

[0005] According to the method of the first aspect of the present disclosure, whether to update the motion candidate list depends on the similarity measure between the motion candidates in the motion candidate list. Compared with conventional solutions, the proposed method can advantageously ensure the diversity of motion candidates in the motion candidate list, and thus can improve the encoding and decoding quality.

[0006] In a second aspect, a device for video processing is provided. The device includes a processor and a non-volatile memory having instructions thereon. The instructions, when executed by the processor, cause the processor to perform the method according to the first aspect of the present disclosure.

[0007] In a third aspect, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores instructions for causing a processor to execute the method according to the first aspect of the present disclosure.

[0008] In a fourth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: obtaining a motion candidate list for a current video block of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; and generating a bitstream based on the determination.

[0009] In a fifth aspect, a method for storing a bitstream of a video is provided. The method includes: obtaining a motion candidate list for a current video block of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; generating a bitstream based on the determination; and storing the bitstream in a non-transitory computer-readable recording medium.

[0010] This summary is provided to introduce some concepts in a simplified form, which are further described in the following detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become more apparent through the following detailed description with reference to the accompanying drawings.In the exemplary embodiments of the present disclosure, the same reference numerals generally refer to the same components.

[0012] Figure 1 A block diagram illustrating an example video encoding and decoding system according to some embodiments of the present disclosure is shown;

[0013] Figure 2 A block diagram illustrating an example video encoder is shown according to some embodiments of the present disclosure;

[0014] Figure 3 shows a block diagram illustrating an example video decoder according to some embodiments of the present disclosure;

[0015] Figure 4 A schematic diagram of the MMVD search process is shown;

[0016] Figure 5 A schematic diagram of the MMVD search point is shown;

[0017] Figure 6 A schematic diagram of a simplified affine motion model is shown;

[0018] Figure 7 A schematic diagram of the affine MVF of each sub-block is shown;

[0019] Figure 8 A schematic diagram showing distance index and distance offset mapping;

[0020] Fig. 9A An example implementation of adding diagonal angles is shown;

[0021] Fig. 9B Another example implementation of adding diagonal angles is shown;

[0022] Fig. 9C Yet another example implementation of adding a diagonal angle is shown;

[0023] Fig. 10A An example implementation of adding diagonal angles with exact similar distances around a circle is shown;

[0024] Fig. 10B Another example implementation of adding diagonal angles with exact similar distances around a circle is shown;

[0025] Fig.11 An example implementation of adding any combination of step sizes and angles asymmetrically is shown;

[0026] Fig.12 An example implementation of removing every other distance offset is shown;

[0027] Fig.13 A schematic diagram of the proposed MV-based dependent direction offset is shown;

[0028] Fig.14 A template for a block with sub-block motion and a reference sample of the template are shown;

[0029] Fig.15 The template for the full block and the reference sample of the template are shown;

[0030] Fig.16 The neighbor positions of the current block are shown;

[0031] Fig.17 A flowchart showing a method for video processing according to an embodiment of the present disclosure; and

[0032] Fig.18 A block diagram of a computing device is shown in which various embodiments of the present disclosure may be implemented.

[0033] Throughout the drawings, same or similar reference numbers generally refer to same or similar elements. DETAILED DESCRIPTION

[0034] The principle of the present disclosure will now be described with reference to some embodiments. It should be understood that these embodiments are described only for the purpose of illustrating and helping those skilled in the art to understand and implement the present disclosure, without implying any limitation on the scope of the present disclosure. In addition to the methods described below, the disclosure described herein can also be implemented in various ways.

[0035] In the following description and claims, unless otherwise defined, all scientific and technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present disclosure belongs.

[0036] References in this disclosure to "one embodiment," "an embodiment," "an example embodiment," etc. indicate that the described embodiment may include a particular feature, structure, or characteristic, but not every embodiment must include the particular feature, structure, or characteristic. Furthermore, these phrases do not necessarily refer to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in conjunction with an example embodiment, whether or not explicitly described, it is considered to be within the knowledge of those skilled in the art to affect such feature, structure, or characteristic in relation to other embodiments.

[0037] It should be understood that although the terms "first" and "second" etc. can be used to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish one element from another element. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element without departing from the scope of the exemplary embodiments. As used herein, the term "and / or" includes any and all combinations of one or more of the listed terms.

[0038] The terms used herein are only used for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments. As used herein, the singular forms "a", "an", and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms "comprises", "includes", and / or "having" when used herein indicate the presence of the features, elements, and / or components, etc., but do not exclude the presence or addition of one or more other features, elements, components, and / or combinations thereof. Example Environment

[0039] Figure 1 1 is a block diagram illustrating an example video codec system 100 that may utilize the techniques of the present disclosure. As shown, the video codec system 100 may include a source device 110 and a destination device 120. The source device 110 may also be referred to as a video encoding device, and the destination device 120 may also be referred to as a video decoding device. In operation, the source device 110 may be configured to generate encoded video data, and the destination device 120 may be configured to decode the encoded video data generated by the source device 110. The source device 110 may include a video source 112, a video encoder 114, and an input / output (I / O) interface 116.

[0040] Video source 112 may include a source such as a video capture device. Examples of a video capture device include, but are not limited to, an interface that receives video data from a video content provider, a computer graphics system for generating video data, and / or combinations thereof.

[0041] The video data may include one or more pictures. The video encoder 114 encodes the video data from the video source 112 to generate a bit stream. The bit stream may include a bit sequence that forms a coded representation of the video data. The bit stream may include a coded picture and associated data. The coded picture is a coded representation of the picture. The associated data may include a sequence parameter set, a picture parameter set, and other grammatical structures. The I / O interface 116 may include a modulator / demodulator and / or a transmitter. The coded video data may be directly transmitted to the destination device 120 via the network 130A via the I / O interface 116. The coded video data may also be stored on a storage medium / server 130B for access by the destination device 120.

[0042] The destination device 120 may include an I / O interface 126, a video decoder 124, and a display device 122. The I / O interface 126 may include a receiver and / or a modem. The I / O interface 126 may obtain encoded video data from the source device 110 or the storage medium / server 130B. The video decoder 124 may decode the encoded video data. The display device 122 may display the decoded video data to the user. The display device 122 may be integrated with the destination device 120, or may be outside the destination device 120, which is configured to be connected to an external display device interface.

[0043] The video encoder 114 and the video decoder 124 may operate according to a video compression standard, such as the High Efficiency Video Codec (HEVC) standard, the Versatile Video Codec (VVC) standard, and other existing and / or further standards.

[0044] Figure 2 is a block diagram showing an example of a video encoder 200 according to some embodiments of the present disclosure, which may be Figure 1 An example of a video encoder 114 in the system 100 is shown.

[0045] Video encoder 200 may be configured to implement any or all of the techniques of this disclosure. Figure 2 In the example of , video encoder 200 includes multiple functional components. The techniques described in this disclosure can be shared between the various components of video encoder 200. In some examples, a processor can be configured to perform any or all of the techniques described in this disclosure.

[0046] In some embodiments, the video encoder 200 may include a partitioning unit 201, a prediction unit 202, a residual generation unit 207, a transformation unit 208, a quantization unit 209, an inverse quantization unit 210, an inverse transformation unit 211, a reconstruction unit 212, a buffer 213 and an entropy coding and decoding unit 214, and the prediction unit 202 may include a mode selection unit 203, a motion estimation unit 204, a motion compensation unit 205 and an intra-frame prediction unit 206.

[0047] In other examples, the video encoder 200 may include more, fewer, or different functional components. In one example, the prediction unit 202 may include an intra-block copy (IBC) unit. The IBC unit may perform prediction in an IBC mode, where at least one reference picture is a picture where the current video block is located.

[0048] Furthermore, although some components (such as the motion estimation unit 204 and the motion compensation unit 205) may be integrated, for the purpose of explanation, these components are described in detail below. Figure 2 are shown separately in the example.

[0049] The partitioning unit 201 may partition a picture into one or more video blocks. The video encoder 200 and the video decoder 300 may support various video block sizes.

[0050] The mode selection unit 203 may select one of a plurality of coding modes (intra-coding or inter-coding), for example, based on the error result, and provide the generated intra-coding block or inter-coding block to the residual generation unit 207 to generate residual block data, and to the reconstruction unit 212 to reconstruct the coding block for use as a reference picture. In some examples, the mode selection unit 203 may select a combination of intra- and inter-prediction (CIIP) modes, where the prediction is based on an inter-prediction signal and an intra-prediction signal. In the case of inter-prediction, the mode selection unit 203 may also select a resolution for the motion vector (e.g., sub-pixel precision or integer pixel precision) for the block.

[0051] To perform inter-frame prediction on the current video block, the motion estimation unit 204 may generate motion information for the current video block by comparing the current video block with one or more reference frames from the buffer 213. The motion compensation unit 205 may determine a predicted video block for the current video block based on the motion information and decoded samples of pictures from the buffer 213 other than the picture associated with the current video block.

[0052] The motion estimation unit 204 and the motion compensation unit 205 may perform different operations on the 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 consisting of macroblocks, all of which are based on macroblocks within the same picture. Furthermore, as used herein, in some aspects, a "P slice" and a "B slice" may refer to a portion of a picture consisting of macroblocks that are independent of macroblocks in the same picture.

[0053] In some examples, the motion estimation unit 204 may perform unidirectional prediction on the current video block, and the motion estimation unit 204 may search the reference pictures of list 0 or list 1 to find the reference video block for the current video block. The motion estimation unit 204 may then generate a reference index and a motion vector, the reference index indicating the reference picture in list 0 or list 1 containing the reference video block, and the motion vector indicating the spatial displacement between the current video block and the reference video block. The motion estimation unit 204 may output the reference index, the prediction direction indicator, and the motion vector as the motion information of the current video block. The motion compensation unit 205 may generate a predicted video block for the current video block based on the reference video block indicated by the motion information of the current video block.

[0054] Alternatively, in other examples, the motion estimation unit 204 may perform bidirectional prediction on the current video block. The motion estimation unit 204 may search the reference pictures in list 0 for a reference video block for the current video block, and may also search the reference pictures in list 1 for another reference video block for the current video block. The motion estimation unit 204 may then generate a plurality of reference indexes and a plurality of motion vectors, the plurality of reference indexes indicating a plurality of reference pictures in list 0 and list 1 containing a plurality of reference video blocks, and the plurality of motion vectors indicating a plurality of spatial displacements between the plurality of reference video blocks and the current video block. The motion estimation unit 204 may output the plurality of reference indexes and the plurality of motion vectors of the current video block as motion information of the current video block. The motion compensation unit 205 may generate a predicted video block for the current video block based on the plurality of reference video blocks indicated by the motion information of the current video block.

[0055] In some examples, motion estimation unit 204 may output a complete set of motion information for use in a decoding process by a decoder. Alternatively, in some embodiments, motion estimation unit 204 may reference motion information of another video block to signal motion information of the current video block. For example, motion estimation unit 204 may determine that the motion information of the current video block is sufficiently similar to the motion information of a neighboring video block.

[0056] In one example, motion estimation unit 204 may indicate to video decoder 300 a value in a syntax structure associated with the current video block that indicates that the current video block has the same motion information as another video block.

[0057] In another example, the motion estimation unit 204 may identify another video block and a motion vector difference (MVD) in a syntax structure associated with the current video block. The motion vector difference indicates the difference between the motion vector of the current video block and the motion vector of the indicated video block. The video decoder 300 may use the motion vector of the indicated video block and the motion vector difference to determine the motion vector of the current video block.

[0058] As discussed above, the video encoder 200 may signal motion vectors in a predictive manner.Two examples of prediction signaling techniques that may be implemented by the video encoder 200 include Advanced Motion Vector Prediction (AMVP) and merge mode signaling.

[0059] The intra prediction unit 206 may perform intra prediction on the current video block. When the intra prediction unit 206 performs intra prediction on the current video block, the intra prediction unit 206 may 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 prediction video block and various syntax elements.

[0060] The residual generation unit 207 may generate residual data for the current video block by subtracting (e.g., indicated by a minus sign) the prediction video block(s) of the current video block from the current video block. The residual data of the current video block may include residual video blocks corresponding to different sample portions of samples in the current video block.

[0061] In other examples, such as in skip mode, there may be no residual data for the current video block, and the residual generation unit 207 may not perform a subtraction operation.

[0062] Transform processing unit 208 may generate one or more transform coefficient video blocks for a current video block by applying one or more transforms to the residual video block associated with the current video block.

[0063] After transform processing unit 208 generates a transform coefficient video block associated with the current video block, quantization unit 209 may 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.

[0064] The inverse quantization unit 210 and the inverse transform unit 211 may apply inverse quantization and inverse transform to the transform coefficient video block, respectively, to reconstruct a residual video block from the transform coefficient video block. The reconstruction unit 212 may add the reconstructed residual video block to corresponding samples from one or more prediction video blocks generated by the prediction unit 202 to generate a reconstructed video block associated with the current video block for storage in the buffer 213.

[0065] After reconstruction unit 212 reconstructs the video block, a loop filtering operation may be performed to reduce video blocking artifacts in the video block.

[0066] The entropy coding unit 214 may receive data from other functional components of the video encoder 200. When the entropy coding unit 214 receives data, the entropy coding unit 214 may perform one or more entropy coding operations to generate entropy coded data and output a bitstream including the entropy coded data.

[0067] Figure 3 is a block diagram showing an example of a video decoder 300 according to some embodiments of the present disclosure, which may be Figure 1 An example of a video decoder 124 in the system 100 is shown.

[0068] Video decoder 300 may be configured to perform any or all of the techniques of this disclosure. Figure 3 In the example of , video decoder 300 includes multiple functional components. The techniques described in this disclosure can be shared between the various components of video decoder 300. In some examples, a processor can be configured to perform any or all of the techniques described in this disclosure.

[0069] exist Figure 3 In the example of , the video decoder 300 includes an entropy decoding unit 301, a motion compensation unit 302, an intra prediction unit 303, an inverse quantization unit 304, an inverse transform unit 305, and a reconstruction unit 306 and a buffer 307. In some examples, the video decoder 300 can perform a decoding process that is generally opposite to the encoding process described with respect to the video encoder 200.

[0070] The entropy decoding unit 301 can retrieve the encoded bitstream. The encoded bitstream may include entropy-encoded video data (e.g., encoded video data blocks). The entropy decoding unit 301 can decode the entropy-encoded video data, and the motion compensation unit 302 can determine motion information from the entropy-encoded video data, the motion information including motion vectors, motion vector precision, reference picture list indexes, and other motion information. The motion compensation unit 302 can determine the information, for example, by performing AMVP and merge mode. AMVP is used, including deriving several most likely candidates based on data and reference pictures of adjacent PBs. The motion information typically includes horizontal and vertical motion vector displacement values, one or two reference picture indexes, and in the case of prediction areas in B strips, also includes an identification of which reference picture list is associated with each index. As used herein, in some aspects, "merge mode" may refer to deriving motion information from blocks that are adjacent in space or time.

[0071] The motion compensation unit 302 may generate a motion compensated block, possibly performing interpolation based on an interpolation filter.Identifiers for the interpolation filters used with sub-pixel precision may be included in the syntax elements.

[0072] The motion compensation unit 302 may calculate interpolation values ​​for sub-integer pixels of a reference block using interpolation filters used by the video encoder 200 during encoding of the video block. The motion compensation unit 302 may determine the interpolation filters used by the video encoder 200 based on received syntax information, and the motion compensation unit 302 may use the interpolation filters to generate a prediction block.

[0073] The motion compensation unit 302 may use at least part of the syntax information to determine the size of blocks used to encode (multiple) frames and / or (multiple) slices of the encoded video sequence, partition information describing how each macroblock of a picture of the encoded video sequence is partitioned, a mode indicating how each partition is encoded, one or more reference frames (and reference frame lists) for each inter-coded block, and other information for decoding the encoded video sequence. As used herein, in some aspects, a "slice" may refer to a data structure that can be decoded independently of other slices of the same picture in terms of entropy coding and decoding, signal prediction, and residual signal reconstruction. A slice may be an entire picture, or it may be a region of a picture.

[0074] The intra prediction unit 303 may use, for example, an intra prediction mode received in the bitstream to form a prediction block from spatially neighboring blocks. The inverse quantization unit 304 inverse quantizes (i.e., dequantizes) the quantized video block coefficients provided in the bitstream and decoded by the entropy decoding unit 301. The inverse transform unit 305 applies an inverse transform.

[0075] The reconstruction unit 306 may obtain the decoded block, for example, by adding the residual block to the corresponding prediction block generated by the motion compensation unit 302 or the intra prediction unit 303. If necessary, a deblocking filter may also be applied to filter the decoded block in order to remove blocking artifacts. The decoded video block is then stored in a buffer 307, which provides reference blocks for subsequent motion compensation / intra prediction, and the buffer 307 also generates the decoded video for presentation on a display device.

[0076] Some example embodiments of the present disclosure will be described in detail below. It should be noted that the section titles used in this document are for ease of understanding, and the embodiments disclosed in the section are not limited to that section. In addition, although some embodiments are described with reference to general video codecs or other specific video codecs, the disclosed technology is also applicable to other video coding and decoding technologies. In addition, although some embodiments describe the video encoding steps in detail, it should be understood that the corresponding decoding steps of canceling the encoding will be implemented by the decoder. In addition, the term "video processing" includes video coding or compression, video decoding or decompression, and video transcoding, in which video pixels are represented from one compression format to another compression format or at different compression bit rates. 1. Brief Overview The present disclosure relates to video / image coding technology. Specifically, it is related to MMVD. It can be applied to existing video coding standards, such as HEVC, VVC, or next-generation video coding standards, such as super VVC exploration (such as ECM). It may also be applicable to future video coding standards or video codecs. 2. Introduction Video codec standards have evolved mainly through the development of the well-known ITU-T and ISO / IEC standards. ITU-T produced H.261 and H.263, ISO / IEC produced MPEG-1 and MPEG-4 Visual, and the two organizations jointly produced H.262 / MPEG-2 Video and H.264 / MPEG-4 Advanced Video Codec (AVC) and H.265 / HEVC standards. Since H.262, video codec standards are based on a hybrid video codec structure, where temporal prediction plus transform codec is utilized. In order to explore future video codec technologies beyond HEVC, VCEG and MPEG jointly established the Joint Video Exploration Team (JVET) in 2015. As of July 2020, the Versatile Video Codec (VVC) standard has also been finalized, aiming to reduce the bitrate by another 50% and provide a range of additional features. After VVC was finalized, activities beyond VVC began. The description of additional tools on top of VVC has been summarized, and its reference SW is named ECM. For each inter-predicted CU, motion parameters are composed of motion vectors, reference picture indices, and reference picture list usage indices, and additional information required by the new codec features of VVC will be used for inter-prediction sample generation. Motion parameters can be signaled explicitly or implicitly. When a CU is encoded and decoded in skip mode, the CU is associated with one PU and has no significant residual coefficients, no coded motion vector deltas or reference picture indices. A merge mode is specified, whereby the motion parameters of the current CU are obtained from neighboring CUs, including spatial and temporal candidates and additional scheduling introduced in VVC. The merge mode can be applied to any inter-predicted CU, not just for skip mode. An alternative to the merge mode is explicit transmission of motion parameters, where motion vectors, corresponding reference picture indices for each reference picture list, and reference picture list usage flags and other required information are explicitly signaled per CU. The MV prediction, called MVP, is subtracted from the MV to obtain the MV difference (MVD). The MVD has horizontal (MVx) and vertical (MVy) components, which are coded and decoded separately. For each MVx and MVy, the symbol is encoded and decoded independently in bypass mode. |MVx| and |MVy| are also encoded and decoded independently. 2.1 Merging with Motion Vector Difference (MMVD) MMVD is used for skip or merge mode by the proposed motion vector representation method. MMVD reuses the same merge candidates as those included in the regular merge candidate list in VVC. Among the merge candidates, a basic candidate can be selected and further extended by the proposed motion vector expression method, such as Figure 4 shown. MMVD provides a new method for representing motion vector difference (MVD), in which the starting point, motion amplitude and motion direction are used to represent MVD, such as Figure 5 This MVD is called a refinement or offset. The size of this refinement in each x or y direction is called the step size or distance offset, or simply the step size. The proposed technique uses the merge candidate list as is. However, only candidates of the default merge type (MRG_TYPE_DEFAULT_N) are considered for MMVD extension. The base candidate index defines the starting point. The base candidate index indicates the best candidate among the candidates in the list, as shown below. Table 1 Basic candidate indexes If the number of base candidates is equal to 1, the base candidate index is not signaled. The distance index is the motion amplitude information. The distance index indicates the predefined distance from the start point information. The predefined distance is as follows: Table 2a. Distance index The distance index is binned into binary values ​​(bin) using truncated unary coding during entropy encoding and decoding, as shown in the following table: Table 2b. Distance index binarization In arithmetic coding, the first binary value is coded with a probability context and the following binary values ​​are coded with an equal probability model, also known as bypass coding. The direction index indicates the direction of the MVD relative to the starting point. The direction index can represent four directions as shown below. Table 3 Direction Index Direction Index 00 01 10 11 x-axis + – N / A N / A y-axis N / A N / A + – Note that the meaning of the MVD symbol may change depending on the information of the starting MV. When the starting MV is a unidirectional prediction MV or a bidirectional prediction MV where both lists point to the same side of the current picture (i.e., the POCs of both references are greater than the POC of the current picture, or the POCs of both references are less than the POC of the current picture), the symbol specifies the sign of the MV offset added to the starting MV. When the starting MV is a bidirectional prediction MV where the two MVs point to different sides of the current picture (i.e., the POC of one reference is greater than the POC of the current picture, and the POC of the other reference is less than the POC of the current picture), and the difference in POC in list 0 is greater than the difference in list 1, the symbol specifies the sign of the MV offset added to the MV component of list 0 of the starting MV, and the sign for list 1 MV has the opposite value. Otherwise, if the difference in POC in list 1 is greater than list 0, the symbol specifies the sign of the MV offset added to the list 1 MV component of the starting MV, and the sign for list 0 MV has the opposite value. The MVD is scaled according to the POC difference in each direction. If the difference of the POC in both lists is the same, no scaling is required. Otherwise, if the POC difference in list 0 is greater than that in list 1, the MVD of list 1 is scaled by defining the POC difference of L0 as td and the POC difference of L1 as tb. If the POC difference of L1 is greater than that of L0, the MVD of list 0 is scaled in the same way. If the starting MV is unidirectionally predicted, the MVD is added to the available MVs. The MMVD flag is signaled immediately after the Skip Flag or Merge Flag is sent. If the Skip or Merge Flag is true, then the MMVD flag is parsed. If the MMVD flag is equal to 1, then the MMVD syntax is parsed. However, if it is not 1, then the Affine flag is parsed. If the Affine flag is equal to 1, then it is in Affine mode, however, if it is not 1, then the Skip / Merge Index is parsed for the Skip / Merge mode of the VTM. No need to generate extra line buffers due to MMVD candidates. Because software's skip / merge candidates are used directly as base candidates. Using the input MMVD index, the complement of the MV is decided before motion compensation. No need to keep long line buffers for this. Under current common test conditions, the first or second merge candidate in the merge candidate list may be selected as the basic candidate. 2.2 Affine Motion Compensated Prediction In HEVC, only the translation motion model is applied for motion compensation prediction (MCP). In the real world, there are many kinds of motions, such as zooming in / out, rotation, perspective motion, and other irregular motions. In JEM, a simplified affine transformation motion compensation prediction is applied. Figure 6 As shown, the affine motion field of a block is described by two control point motion vectors. The motion vector field (MVF) of a block is described by the following equation: Where (v 0x ,v 0y ) is the motion vector of the upper left control point, (v 1x ,v 1y ) is the motion vector of the upper right control point. To further simplify motion compensated prediction, sub-block based affine transformation prediction is applied. The sub-block size M×N is derived as shown in Equation 2, where MvPre is the motion vector fractional precision (1 / 16 in JEM), (v 2x ,v 2y ) is the motion vector of the lower left control point, calculated according to Equation 1. After being derived from Equation 2, M and N should be adjusted downward, if necessary, to become divisors of w and h, respectively. In order to derive the motion vector of each M×N sub-block, Figure 7 As shown, the motion vector of the center sample of each sub-block is calculated according to Equation 1 and rounded to 1 / 16 fractional accuracy. After MCP, the high-precision motion vector of each sub-block is rounded and saved to the same precision as the normal motion vector. 2.3 Affine Merge Mode with Prediction Offset MMVD is extended to an affine merge mode, henceforth referred to as affine MMVD mode. The proposed method selects the first available affine merge candidate as the base predictor. It then applies a motion vector offset to the motion vector value of each control point from the base predictor. If no affine merge candidate is available, this proposed method is not used. The inter prediction direction of the selected base predictor, the reference index for each direction remains unchanged. In the current implementation, assuming that the affine model of the current block is a 4-parameter model, only 2 control points need to be derived. Therefore, only the first 2 control points of the base predictor will be used as control point predictors. For each control point, the zero_MVD flag is used to indicate whether the control point of the current block has the same MV value as the corresponding control point predictor. If the Zero_MVD flag is true, no additional signaling is required for the control point. Otherwise, the distance index and offset direction index for the control point are signaled. A distance offset table of size 5 is used as shown in the following table. The distance index is signaled to indicate which distance offset to use. The mapping of distance index and distance offset value is as follows Figure 8 shown. Table 4 - Distance offset table Distance Index 0 1 2 3 4 Distance Offset 1 / 2 pixel 1 pixel 2 pixels 4 pixels 8 pixels The direction index can represent four directions as shown in the following table, where only the x or y direction can have MV differences, but not both directions. Table 5 - Direction index for four directions Offset direction index 00 01 10 11 x-direction factor +1 –1 0 0 Y-direction factor 0 0 +1 –1 If inter prediction is unidirectional, the signaled distance offset is applied to the offset direction of each control point predictor. The result will be the MV value for each control point. For example, when the basic predictor is unidirectional and the motion vector value of the control point is MVP (v px ,v py ). When the distance offset and direction index are signaled, the motion vector of the corresponding control point of the current block will be calculated as follows: MV(v x ,v y )=MVP(v px ,v py )+MV(x-direction factor*distance offset, y-direction factor*distance offset). If inter prediction is bidirectional, the signaled distance offset is applied to the signaled offset direction of the L0 motion vector of the control point predictor; and the same distance offset with the opposite direction is applied to the L1 motion vector of the control point predictor. The result will be the MV value for each control point in each inter prediction direction. For example, when the base predictor is unidirectional and the motion vector value of the control point on L0 is MVPL0(v0 px ,v0 py ), and the motion vector of the control point on L1 is MVP L1 (v1 px ,v1 py ). When the distance offset and direction index are signaled, the motion vector of the corresponding control point of the current block shall be calculated as follows. MV L0 (v 0x ,v 0y )=MVP L0 (v 0px ,v 0py )+MV(x-direction factor*distance offset, y-direction factor*distance offset) ; MV L1 (v 0x ,v 0y )=MVP L1 (v 0px ,v 0py )+MV(-x direction factor*distance offset,-y direction factor*distance offset). 2.4 GPM with MMVD In order to further improve the encoding and decoding efficiency of the GPM mode in VVC, a geometric partitioning mode (GPM) with MMVD (called GPM_MMVD) is proposed. Specifically, in these schemes, an additional MV difference (MVD) is further applied on the existing GPM merge candidates to improve the accuracy of the MVs used by the two GPM partitions. In addition, in order to reduce the signaling overhead, the MVD is signaled in the same way as the merge mode with MVD (MMVD) in VVC. Specifically, two flags are signaled to indicate whether an additional MVD is applied to each GPM partition, respectively. When the flag of a GPM partition is true, its corresponding MVD is signaled in the same way as MMVD, i.e., one distance index plus one direction index. In order to achieve more MV combinations, the merge index of two GPM partitions is allowed to be the same when the MVDs applied to the two partitions are different. In addition, when GPM with MMVD is applied, an MV pruning process is introduced to construct a GPM merge candidate list. In addition, two different sets of MVDs are supported for GPM, which are selected according to an indication flag in the picture header. When the flag is equal to 0, the existing MVD set used by MMVD includes 8 distances {1 / 4 pixel, 1 / 2 pixel, 1 pixel, 2 pixels, 4 pixels, 8 pixels, 16 pixels, 32 pixels} and 4 horizontal / vertical directions, which are supported for the GPM CU of the current picture; otherwise, another MVD set is applied, including 9 distances {1 / 4 pixel, 1 / 2 pixel, 1 pixel, 2 pixels, 3 pixels, 4 pixels, 6 pixels, 8 pixels, 16 pixels} and 8 directions (4 horizontal / vertical directions plus 4 diagonal directions). 2.5 Local Illumination Compensation (LIC) LIC is an inter-frame prediction technique that models the local illumination variation between the current block and its prediction block as a function between the current block template and the reference block template. The parameters of this function can be expressed in terms of scale α and offset β, which form a linear equation, i.e., α*p[x]+β, to compensate for illumination variation, where p[x] is the reference sample pointed to by the MV at position x on the reference picture. Since α and β can be derived based on the current block template and the reference block template, they do not require signaling overhead except for signaling the LIC flag for AMVP mode to indicate the use of LIC. The local illumination compensation proposed in JVET-O0066 is used for unidirectionally predicted inter CU with the following modifications. Intra-frame neighbor samples can be used for LIC parameter derivation. Disable LIC for blocks with less than 32 luma samples. For non-subblock and affine modes, LIC parameter derivation is based on the template block samples corresponding to the current CU, rather than the partial template block samples corresponding to the first 16×16 unit in the upper left corner. The samples of the reference block template are generated by using the MC and the block MV without rounding them to integer pixel precision. 2.6 Bidirectional Prediction with CU-Level Weights (BCW) In HEVC, a bidirectional 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 bidirectional prediction mode is extended beyond simple averaging to allow weighted averaging of the two prediction signals. P bi-pred =((8-w)*P0+w*P1+4)>>3 Five weights are allowed in weighted average bidirectional prediction, w∈{-2,3,4,5,10}. For each bidirectionally predicted CU, the weight w is determined in one of two ways: 1) For non-merged CUs, the weight index is signaled after the motion vector difference; 2) For merged CUs, the weight index is inferred from neighboring blocks based on the merge candidate index. BCW is only applicable to CUs with 256 or more luma samples (i.e., CU width multiplied by CU height is greater than or equal to 256). For low-latency pictures, all 5 weights are used. For non-low-latency pictures, only 3 weights (w∈{3,4,5}) are used. – At the encoder, a fast search algorithm is applied to find the weight index without significantly increasing the encoder complexity. These algorithms are summarized below. The reader is referred to the VTM software and document JVET-L0646 for more details. When combined with AMVR, unequal weights are only conditionally checked for 1-pixel and 4-pixel motion vector accuracy if the current picture is a low-latency picture. – When combined with affine, affine ME is performed for unequal weights if and only if the affine mode is selected as the current best mode. – When the two reference pictures in bidirectional prediction are the same, unequal weights are only checked conditionally. – Unequal weights are not searched when certain conditions are met, which depend on the POC distance between the current picture and its reference picture, the codec QP, and the temporal level. The BCW weight index is encoded using a context encoded binary value followed by a bypass encoded binary value. The first context encoded binary value indicates whether equal weights are used; if unequal weights are used, an additional binary value is signaled using bypass encoding to indicate which unequal weights are used. Weighted prediction (WP) is a codec tool supported by the H.264 / AVC and HEVC standards to efficiently encode and decode video content with fading. Support for WP has also been added to the VVC standard. WP allows weighting parameters (weights and offsets) to be signaled for each reference picture in each reference picture list L0 and L1. Then, during motion compensation, the weights and offsets of the corresponding reference pictures are applied. WP and BCW are designed for different types of video content. In order to avoid interaction between WP and BCW (which will complicate the VVC decoder design), if the CU uses WP, the BCW weight index is not signaled, and w is inferred to be 4 (i.e., equal weights are applied). For the merged CU, the weight index is inferred from the neighboring blocks based on the merge candidate index. This can be applied to the normal merge mode and the inherited affine merge mode. For the constructed affine merge mode, the affine motion information is constructed based on the motion information of up to 3 blocks. The BCW index for the 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 applied jointly to a CU. When a CU is encoded and decoded using CIIP mode, the BCW index of the current CU is set to 2, i.e., equal weight. 3. Question There are several problems with current MMVD designs. - The number of directions is limited. It is limited to 4 directions and does not cover other directions. - The distance setting is fixed and does not depend on the block size or motion vector magnitude or direction. - If there is a strong correlation between the encoding and decoding direction and the distance, they may be suboptimal respectively. - Neighboring block template information is not used to decide refinement values ​​(eg which direction(s) and / or distance(s) and / or base candidates will be checked in the end). 4. Detailed solution The detailed solutions below should be considered as examples to explain the general concept. These solutions should not be interpreted narrowly. Furthermore, these solutions can be combined in any way. The methods disclosed below can be applied to MMVD and extensions of MMVD (e.g., affine MMVD or GPM MMVD (GMVD), MMVD for IBC mode, MMVD for affine IBC mode). In the following description, the term "MMVD" may be used to refer to a codec in which part of the motion information (e.g., reference picture index, prediction direction from list 0 / 1, and basic motion vector) is inherited from the candidate, while some additional refined indications of the refined motion information (e.g., refined mv difference) are further signaled in the bitstream. Extensions on the directions used in MMVD design 1. Oblique / asymmetric direction or diagonal direction can be used for MMVD coded blocks. a. The diagonal direction can be defined as M*pi / N, where M and N are both non-zero integers, M<N. i. Fig. 9A In one example shown with square points, at least one of the four diagonal positions may be added to the original four horizontal and vertical positions. 9A to 9C Some example implementations of adding diagonal angles are shown in Fig. 9A In the figure, the square points represent the new diagonal angle of pi / 4. Fig. 9B In the example, the square and triangle points represent new pi / 8 angles of roughly similar magnitude. Fig. 9C In the figure, the square and triangle points represent new pi / 8 angles with different sizes. ii. In Fig. 9B In one example shown with square points and triangle points, at least one of the additional 8 directions may be added to the previous 8 directions at an angle k*pi / 8. iii. In Fig. 9C In one example shown with square points and triangle points, at least one of the additional 8 directions can be added to the previous 8 directions with an asymmetric distance offset at an angle k*pi / 8. iv. In one example, at least one of the additional 16 directions may be added to the previous 16 directions at an angle k*pi / 16. v. in such as Fig. 10A and Fig. 10B In one example shown with square points and triangle points, at least one of the additional 4 or 8 directions can be added to the previous 4 or 8 directions at an angle k*pi / 8 with an exactly similar distance offset around the circle. Fig. 10A and 10B Some example implementations of adding diagonal angles with exact similar distances around a circle are shown, in Fig. 10A In the figure, the square points represent the new diagonal angle of pi / 4. Fig. 10B In the figure, the square and triangle points represent the new pi / 8 angles. b. Asymmetric angles and / or asymmetric distances can be utilized in MMVD design. i. An example such as Fig.11 As shown, square and triangle points represent additional directions. c. The above directions may be added as additional directions to those in the prior art. i. Alternatively, it can be used to replace at least one existing direction defined in the prior art. d. In one example, additional asymmetries for MMVD and / or its extensions (e.g., affine MMVD) / slash offsets or additional diagonal directions can be indicated by indices that are to be jointly or separately encoded and decoded for direction and distance offsets. i. In one example, the index can be encoded and decoded using a truncated binary code / binary code. ii. In one example, the index can be entirely encoded and decoded using a truncated unary code. iii. In one example, the index can be entirely encoded and decoded using a Rice code or a k - order exponential Golomb code, where k can be 0, 1, or any number. (i) In one example, a Rice code with parameters 1, 2, 4, 8, or any other number can be used. iv. In one example, the prefix and suffix of the code can be encoded using any combination of bypassed and context - decoded binary values. v. In one example, the index can be encoded in bypass mode. vi. In one example, the index can be encoded in context mode. vii. In one example, at least one binary value of the index (e.g., only the first binary value) can be context - decoded. viii. In one example, the first N binary values can be context - decoded. The decoded contexts can share the same context or have independent contexts. 2. Whether and / or how many directions should be utilized can be signaled or derived on - the - fly (e.g., based on decoded information). a. In one example, additional directions can be added only for some specific block sizes. i. In one example, additional directions can be added to blocks where width * height > C1. (i) Examples of C1 can be 64 or 256. ii. In one example, additional directions can be added to blocks where width * height < C1. (i) Examples of C1 can be 64 or 256. iii. In one example, additional directions can be added to blocks where width > C1 and / or height > C2. (i) Examples of C1 and C2 can be 16 and 32 respectively. iv. In one example, additional directions can be added to blocks where width < C1 and / or height < C2. (i) Examples of C1 and C2 may be 16 and 32 respectively. v. The above thresholds C1 / C2 may be predefined or signaled in the bitstream. b. In one example, whether to apply additional directions and / or which additional directions to use may be based on picture resolution and / or reference picture list and / or low delay check flag. c. In one example, whether additional directions apply and / or which additional directions to use may be signaled from the encoder to the decoder, e.g., in SPS / PPS / VPS / APS / slice header / picture header / CTU / CU / PU, etc. i. For example, pictures at lower temporal layers may use more directions, and / or pictures at higher temporal layers may use fewer directions. ii. Extensions on distance offset used in MMVD design 3. It is proposed that at least one additional distance may be added to the original distance set (or candidate list) for the MMVD mode and / or the extension of the MMVD mode or at least one existing distance may be removed therefrom. a. It is proposed that at least one additional distance offset may be added to the original 8 distance offsets for MMVD and / or GMVD and the 5 original distance offsets for affine MMVD refinement candidates. b. Alternatively, at least one distance offset may be removed from the original 8 distance offsets for MMVD and the 5 original distance offsets for the affine MMVD refinement candidates. c. In one example, at least one additional range offset may be added between and / or beyond the original 8 MMVD range offsets. The number of additional range offsets may be 4 or 8 or any other number. d. In one example, at least one additional distance offset may be added between and / or beyond the original 5 affine MMVD distance offsets. The number of additional distance offsets may be 4, 5 or 8 or any other number. e. In one example, at least one additional distance offset may be added only between two distance offsets that are both smaller than a threshold. f. In one example, at least one additional distance offset may be added only between two distance offsets that are both greater than a threshold. g. In one example, some distance offsets may be removed, and the number of distance offsets may be reduced to N (eg, 3 or 4 or 5). h. In one example, it can be obtained from Fig.12 Starting with the 2nd distance offset depicted in , every other distance offset is removed. i. In one example, every other distance offset can be removed starting from a first distance offset. j. In one example, the first half of the distance offsets can be removed (e.g., for indices 0, 1, 2, 3 of the MMVD). k. In one example, the second half of the distance offsets can be removed (e.g., for indices 4, 5, 6, 7 of the MMVD). l. In one example, the final offset can be indicated as a combined index of all offsets or be split into 2 indices for the direction and the distance offset, which can be encoded and decoded using a truncated unary code or a truncated binary code or a Rice code with parameter R or a k - order exponential Golomb code, or be encoded and decoded using any combination of binary values bypassed and context - decoded. 4. The initial distance offset candidate list can be predefined or signaled or derived on - the - fly. a. In one example, the initial distance offset candidate list can be selected according to the block size. i. As an example, for blocks with width * height > C, a set of distance offsets is selected, and for the rest, a different set is selected. 5. For the MMVD and / or an extension of the MMVD (e.g., affine MMVD and / or GMVD), whether to apply (multiple) additional directions and / or (multiple) additional offsets, and / or which (which ones) additional directions and / or additional offsets to apply can depend on the original basic motion vector direction and / or its magnitude. a. In one example, the initial offset can be determined by the basic MV magnitude. i. The MV magnitude can be derived from MVx and MVy. For example, the MV magnitude is calculated as |MVx|+|MVy|. ii. The MV magnitude can be derived from MVx and MVy. For example, the MV magnitude is calculated as (MVx)^2+(MVy)^2. iii. If both Ref0 and Ref1 are available, the magnitude can be a weighted average of the MV lengths of each reference list MV. iv. For the affine MMVD, the upper - left control point MV magnitude of the basic affine MV can be used to determine the initial offset using the methods specified in i, ii, iii. b. In one example, the initial distance offset with MV magnitude > C1 can be greater than the initial distance offset with MV magnitude < C1. i. In one example, the initial distance offset with MV magnitude > C1 can be N times the initial distance offset with MV magnitude < C1, where C1 can be, for example, 50 pixels and N can be, for example, 2. c. In one example, at least one directional offset can be derived from a base MV. For an affine MMVD, the top left control point MV of the base affine MV can be used to derive an additional directional offset. i. In one example, the directional offset can be precise, such as parallel or perpendicular to the directional offset of the original base MV, such as Fig.13 shown. ii. In one example, additional directional offsets may be approximated, for example if the base MV direction is between pi / 8 and 3pi / 8, then a diagonal offset may be used, otherwise a vertical / horizontal offset may be used. iii. Directional offset can replace the offset in the original design of MMVD / GMVD / affine MMVD. I. Alternatively, a directional offset may be added for use with the original design of MMVD / GMVD / affine MMVD. MMVD reordering 6. Propose an MMVD mode and / or an extension of MMVD (e.g., affine MMVD or GPM MMVD) (GMVD), MMVD for IBC mode, MMVD for affine IBC mode) mode, the base motion candidates and / or the refined motion candidates (e.g., by adding MVD) can be reordered. a. In one example, the reordering process should be performed before interpreting the MMVD refinement method from at least one syntax element. b. In one example, N1 refinement steps and N2 directions and N3 basic candidates that construct N1*N2*N3 possibilities can be reordered together. i.N1 can be 4, 5, 8, 16 or any other number. N2 can be 2, 4, 6, 8, 16, 32 or any other number. N3 can be 1, 2, 3, 4 or any other number. c. In one example, N possible refinement positions (which may be asymmetric with respect to direction or step size, or have no explicit direction or step size) that construct N*N3 possibilities and N3 base candidates may be reordered together. d. In one example, the re-ranking process may be performed on each base candidate separately. i. For example, for each base candidate, N1 refinement steps and N2 directions that construct N1*N2 possibilities can be reordered together. ii. For example, if for each base candidate there are a total of N possible refinement positions (which may be asymmetric with respect to direction or step size, or have no explicit direction or step size) that can be re-ordered together. iii. In one example, the basic candidates may be re-ranked in advance. Afterwards, refinement of the first basic candidate is further applied. (i) For example, for the first basic candidate, N1 refinement steps and N2 directions that construct N1*N2 possibilities can be reordered together. (ii) For example, for the first basic candidate, if there are a total of N possible refinement positions (perhaps asymmetric with respect to direction or step size, or no clear direction or step size), then they can be reordered together. e. In one example, the reordering process may be performed on the candidates with the same basic candidate and the same direction respectively. For example, for the candidates with the same basic candidate and the same direction independently, N1 refinement steps may be reordered together. f. In one example, the reordering process may be performed on the candidates with the specified basic candidates and the specified direction respectively. For example, for the candidates with the specified basic candidates and the specified direction independently, N1 refinement steps may be reordered together. g. In one example, the reordering process may be performed on the candidates with the same basic candidate and the same refinement step size respectively. For example, for the candidates with the same basic candidate and the same refinement step size independently, N2 directions may be reordered together. h. In one example, the reordering process may be performed on the candidates with the specified basic candidates and the specified refinement step size, respectively. For example, for the candidates with the specified basic candidates and the specified refinement step size independently, N2 directions may be reordered together. i. In one example, any subgroup of possible options can be reordered within that subgroup. i. In one example, subgroups are divided from all candidates for MMVD according to direction. ii. In one example, subgroups are divided from all candidates for MMVD according to distance. iii. In one example, subgroups are divided from all candidates for MMVD according to basic candidates. iv. In one example, any combination of direction, distance, and basic candidates is selected from the All candidates of MMVD are divided into subgroups. j. In one example, the reordering process may be applied sequentially based on the characteristics. i. As an example, a first reordering process may be performed for base candidates. A next reordering process may be performed for directions using a fixed distance offset. A final reordering process may be performed for distance offsets. ii. Alternatively, a first re-ranking process may be performed for the base candidates. A next re-ranking process may be performed for each direction and distance combination having the same base candidate. iii. Alternatively, a first re-ranking process may be performed for the base candidates. The next re-ranking process may be performed for each direction and distance combination having a designated (eg, first) base candidate. k. In one example, the reordered MMVD and / or its extension (eg, affine MMVD) may be indicated by an index to be signaled, i. In one example, the indexes can all be encoded and decoded using truncated unary codes. ii. In one example, the indexes can all be encoded and decoded using truncated binary / binary codes. iii. In one example, the indexes can all be encoded and decoded using Rice codes or k-order exponential Golomb codes, where k can be 0, 1, or any number. (i) In one example, Rice codes with parameters 1, 2, 4, 8 or any other number may be used. iv. In one example, the prefix and suffix of the code can be encoded in any combination of bypass and context encoded binary values. v. In one example, the index can be encoded and decoded in bypass mode. vi. In one example, the index may be encoded or decoded in a context mode. vii. In one example, at least one binary value (eg, only the first binary value) of the index may be context-decoded. (i) In one example, the first N binary values ​​may be context encoded and decoded. The encoded and decoded contexts may share the same context or have independent contexts. 1. In one example, the base candidate index may be encoded in a context or bypass encoded binary value, for example, as truncated unary or truncated binary. The remaining direction and distance may be encoded as described above. m. In one example, after reordering the MMVD candidates, only the top N with the lowest cost are retained. N can be any integer. Only the new limited options are encoded or decoded. i. In one example, after re-ranking the MMVD candidates, only the top half with the lowest cost is retained. Only the new limited options are encoded or decoded. ii. In one example, after re-ranking the MMVD candidates, only the top 1 / 4 with the lowest cost are retained. Only the new limited options are encoded or decoded. iii. In one example, after re-ranking the MMVD candidates, only the top 1 / 8 with the lowest cost are retained. Only the new limited options will be encoded or decoded. iv. In one example, after re-ranking the MMVD candidates, only the top 1 / 16 with the lowest cost are retained. Only the new limited options are encoded or decoded. n. In one example, only candidates with a cost less than F*bestCost can be selected. F can be any number, such as 1.2, 2, 2.5, ..., and bestCost is the best (eg, minimum) template matching cost of the candidate. o. In one example, a fixed ratio from the best template matching cost may be used to select candidates, or top N may be selected, or any combination of restrictions based on block size and / or base MV amplitude and / or base MV direction may be used. p. In one example, the reordering process can be limited to a specific block size. For example, reordering can be applied to blocks with width*height>C, and reordering is not applied to the remaining blocks. q. In one example, after the re-ranking process, only the best MMVD candidates may be selected and no additional index signaling may be required. 7. Re-ranking can be based on template matching method. a. In one example, a candidate reordering criterion may be the template matching cost between the template surrounding the current block and a reference of the template. i. In one example, the cost can be the sum of the absolute differences between the template sample and its reference (SAD). ii. In one example, the cost may be the sum of absolute transformed differences (SATD) between the template sample and its reference or any other cost measure. iii. In one example, the cost may be the mean-removed sum of absolute differences (MR-SAD) between the template sample and its reference. iv. In one example, the cost can be the SAD / MR between the template sample and its reference - Weighted average of SAD and SATD. v. In one example, the cost function between the current template and the reference template can be: (i) Sum of absolute differences (SAD) / mean removed SAD (MR-SAD); (ii) Sum of Absolute Transformed Difference (SATD) / Mean Removed SATD (MR-SATD); (iii) sum of squared differences (SSD) / mean removed SSD (MR-SSD); (iv) SSE / MR-SSE; (v) Weighted SAD / weighted MR-SAD; (vi) Weighted SATD / weighted MR-SATD; (vii) weighted SSD / weighted MR-SSD; (viii) weighted SSE / weighted MR-SSE; (ix) Gradient information. b. In addition to the SAD calculated in (f), the cost can also consider the continuity between the reference template and the reconstructed samples adjacent or non-adjacent to the current template (Boundary_SAD). For example, consider the reconstructed samples adjacent or non-adjacent to the left and / or above the current template. 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 predefined or signaled or derived from decoded information. c. In one example, K1 rows at the top and / or K2 columns on the left and / or K1*K2 samples at the corners / Pixels can be used as templates. i. K1 and K2 can be any numbers; for example, K1 and K2 can be 1, 2, 3, width / 2, height / 2, width, height. ii. Alternatively, use only the top K1 row as a template. iii. Alternatively, use only the left K2 column as a template. iv. Alternatively, use the top K1 row, left K2 column as the template. d. The template matching process can include a component, such as brightness. i. Alternatively, the template matching process may include multiple components, such as luminance and chrominance. (i) In one example, the total template matching cost may be calculated as a weighted sum of the template matching costs of different color components. e. In one example, the template for bidirectional prediction (RT bi-pred ) is obtained by weighted averaging the reference samples of the template (RT0) in reference list 0 and the reference samples of the template (RT1) in reference list 1. An example is as follows: RT=((2 N -w)*RT0+w*RT1+2 N-1 )>>N, for example, N=3. f. In one example, the weight of the reference template in reference list 0, such as (8-w), and the weight of the reference template in reference list 1, such as (w), may be determined by the BCW index of the merge candidate. i. In one example, the BCW index is equal to 0 and w is set equal to -2. ii. In one example, the BCW index is equal to 1 and w is set equal to 3. iii. In one example, the BCW index is equal to 2 and w is set equal to 4. iv. In one example, the BCW index is equal to 3 and w is set equal to 5. v. In one example, the BCW index is equal to 4 and w is set equal to 10. g. In one example, if the local illumination compensation (LIC) flag of the merge candidate is true, the reference sample of the template is derived using the LIC method. i. Alternatively, a reference sample of the template is derived without LIC. h. In one example, when deriving reference samples for a template, the motion vector of the merge candidate is rounded to integer pixel precision, where the integer motion vector may be its closest integer motion vector. i. In one example, when deriving the reference samples of the template, an N-tap interpolation filter is used to obtain the reference samples of the template at the sub-pixel position. For example, N may be 2, 4, 6, 8, or 12. 8. Early termination of the reordering process may be applied. a. In one example, only candidates associated with a specific direction may be further checked if a specific condition is met. b. In one example, only candidates associated with a specific distance offset but with a different direction may be further examined if a specific condition is met. About MVD symbol prediction 9. Proposed for Advanced Motion Vector Prediction (AMVP) mode and / or its extensions (e.g., affine AMVP), The MMVD mode and / or an extension of the MMVD (eg, affine MMVD or GPM MMVD (GMVD), MMVD for IBC mode, MMVD for affine IBC mode) may predict (or reorder) the sign of the MVD. a. In one example, the sign of the MVD horizontal component (MVx) can be predicted. b. In one example, the symbols of MVx may be predicted (reordered) and a flag may be encoded or decoded to determine whether the prediction was correct. c. In one example, the sign of the MVD vertical component (MVy) may be predicted. d. In one example, the symbols of MVy may be predicted (reordered) and a flag may be encoded or decoded to determine whether the prediction was correct. e. In one example, the signs of MVx and MVy can be jointly predicted. More precisely, there are 4 possible combinations for the signs of MVx and MVy: (+, +), (+, -), (-, +), (-, -). f. In one example, the possible combinations may depend on whether MVx and / or MVy is equal to zero. g. In one example, the symbols of MVx and MVy can be predicted (reordered), and a flag can be coded to determine whether to select the first option or the second option. The flag can be context coded or bypass coded. h. In one example, the symbols of MVx and MVy can be predicted (reordered), and the first N (e.g., N=2, 3, ..) options can be signaled with an index for encoding and decoding with a non-fixed length code (e.g., unary or truncated unary code, or binary code). The index can be context encoded or bypassed. i. In one example, if the first option is located before the second option after reordering, the code length of the first option should not be longer than the code length of the second option. i. In one example, the symbols of MVx and / or MVy may be encoded and decoded using context encoding, where the context may be determined by prediction of MVx and / or MVy. j. In one example, the signs of MVx and / or MVy may be coded with context coding, where the context may depend on the amplitude of the MVD component. k. In one example, information indicating whether the prediction for MVx and / or MVy is correct may be conditionally signaled. i. In one example, if MVx and / or MVy is equal to 0, this information may not be signaled. 1. In one example, the sign of MVx and / or MVy may not be explicitly signaled, but may be implicitly set equal to the predicted value. 10. The symbol prediction (or reordering) of MVD can be based on the template matching method or the bilateral matching method. a. In one example, the re-ranking criterion for the candidates may be the template matching cost between the template surrounding the current block and a reference of the template. i. In one example, the cost may be the sum of absolute differences (SAD) between the template sample and its reference. ii. In one example, the cost may be the sum of absolute transformed differences (SATD) between the template sample and its reference prior or any other cost measure. iii. In one example, the cost may be the mean removed sum of absolute differences (MR-SAD) between the template sample and its reference. iv. In one example, the cost may be a weighted average of the SAD / MR-SAD and SATD between the template sample and its reference. v. In one example, the cost function between the current template and the reference template can be: (i) Sum of absolute differences (SAD) / mean removed SAD (MR-SAD); (ii) Sum of Absolute Transformed Difference (SATD) / Mean Removed SATD (MR-SATD); (iii) sum of squared differences (SSD) / mean removed SSD (MR-SSD); (iv) SSE / MR-SSE; (v) Weighted SAD / weighted MR-SAD; (vi) Weighted SATD / weighted MR-SATD; (vii) weighted SSD / weighted MR-SSD; (viii) weighted SSE / weighted MR-SSE; (ix) Gradient information. b. In one example, MV candidates are constructed by creating combinations between possible symbols and absolute MVD values ​​and added to the MV predictor. Based on the template matching cost or the bilateral matching cost, an MVD symbol prediction cost is derived for each derived MV candidate, and the MVD symbols are sorted in ascending order according to the cost value. i. In one example, the actual MVD symbol finally used may be the MVD symbol with the minimum MVD symbol prediction cost. ii. In one example, the real MVD symbol finally used may be selected from the first N (eg, N=2, 3, ..) MVD symbols in the sorted MVD symbol list. (i) In one example, a flag or an index may be used to signal the selected MVD symbol (ie, the actual MVD symbol finally used), and the flag or index may be context coded or bypass coded. Combination of MVD sign prediction and MMVD reordering 11. It is proposed that any MVD symbol prediction for AMVP mode and / or its extensions (e.g., affine AMVP), MMVD mode and / or its extensions can be combined with any MMVD reordering for MMVD mode and / or extensions of MMVD (e.g., affine MMVD or GPM MMVD (GMVD), MMVD for IBC mode, MMVD for affine IBC mode). a. In one example, any MVD symbol prediction for AMVP can be combined with any MMVD reordering for MMVD. b. In one example, any MVD sign prediction for affine AMVP can be combined with any MMVD reordering for affine MMVD. c. In one example, any MVD sign prediction for AMVP and affine AMVP can be combined with any MMVD reordering for MMVD and affine MMVD. d. In one example, any MVD sign prediction for AMVP and affine AMVP and affine MMVD can be combined with any MMVD reordering for MMVD. e. In one example, any MVD sign prediction for AMVP and affine AMVP and MMVD can be combined with any MMVD reordering for affine MMVD or other extensions thereof. f. In one example, both symbol prediction and MMVD reordering can be applied to MV simultaneously. For example, symbol prediction will be applied to MMVD symbols, and MMVD reordering can be applied to MMVD amplitude or its basis. g. In one example, symbol prediction can be applied to MVD coding and decoding methods that do not include MMVD (e.g. AMVP), but MMVD reordering can be applied in MMVD mode. About MMVD (and / or Affine MMVD) for Bi-predictive Base Candidates The MVD candidate list of list X (eg, X=0) is represented as {MvdLX i}, where i is in the range of [0, M-1] and M is the total number of allowed MVD candidates for list X. The MVD candidate list for list Y (eg, Y=1-x) is {MvdLY j}, where j is in the range [0, N-1] and N is the total number of allowed MVD candidates for list Y. 12. Instead of always signaling the MVD information for list 0, it is proposed to signal the MVD information for list 1. a. Alternatively, whether to signal list 0 or list 1 may be further indicated in the bitstream or determined on the fly (eg, based on the reference picture information of the base candidate). 13. Suggest that N and M may not be equal. a. In one example, N and / or M may be predefined or determined or signaled on the fly. 14. It is proposed to modify the MMVD for bidirectional prediction to: a. In one example, List 0 and List 1 have their own independent MVDs, where MvdLY j Instead of using existing technology MvdLX j Exported. b. In one example, only list 0 has MVD, list 1 has no MVD (0). c. In one example, only list 1 has MVD, list 0 has no MVD (0). d. In one example, only the reference picture closest to the current picture may have MMVD, and the other reference pictures have no MVD (0). e. In one example, only the reference picture that is farther away from the current picture may have MMVD, and the other reference picture has no MVD (0). f. In one example, only the reference directions (list 0 or list 1) whose MV has a larger cost can have an MVD. i. In one example, only the reference directions (list 0 or list 1) whose MV has a smaller cost may have an MVD. ii. In one example, the cost may be the template matching cost corresponding to the MV of one reference list (list 0 or list 1). iii. In one example, the cost may be the bilateral matching cost corresponding to the MV of one reference list (list 0 or list 1). g. In one example, only references before the current picture can have MVD. h. In one example, only references after the current picture can have MVD. i. In one example, depending on the MV size or angle of the reference block, only one may have MVD. j. In one example, a bi-directional prediction candidate may be converted to a uni-candidate and MVD may be applied thereon. k. In one example, among both list 0 and list 1 having MVD, only list 0 having MVD, and only list 1 having MVD, which one is finally used can be determined by RD decision and signaled to the decoder. 15. It is proposed that the final MVD of list 0 and list 1 can be ( MvdLX i ,MvdLY j )Yes, where i is not equal to j. a. In one example, for all ( MvdLX i , MvdLY j ) pairs, the template cost can be calculated, and the pair that gives the minimum template cost can be selected as the final MVD of list 0 and list 1. i. Alternatively, furthermore, early termination may be applied to reduce the number of pairs to be checked. 16. Propose to determine the final MVD of list 0 and list 1 respectively. a. In one example, not based on (MvdLX j , MvdLYj) pairs to calculate the template cost, but the template cost can be calculated independently for each candidate in list 0 and list 1. i. Alternatively, in addition, the template with the smallest cost MvdLX can be used j as the final MVD of list X. 17. It is proposed to add zero MVD to the MVD candidate list in MMVD design. 18. It is proposed to add unilateral bidirectional prediction MMVD (and / or affine MMVD) only to list 0, to add unilateral bidirectional prediction MMVD only to list 1, and to add bilateral bidirectional prediction to both lists at the same time. a. In one example, a similar number of candidates can be used for each of the three categories. This number can be any integer, such as 8, 16, ... b. In another example, each category may have its own number of candidates, which may be different from other categories. About template reference samples 19. It is proposed that the first interpolation filter used to generate template reference samples for MMVD reordering and / or MVD symbol prediction may be different from the second interpolation filter used to generate reference samples for inter-frame prediction. a. For example, the first interpolation filter may have fewer taps than the second interpolation filter. b. For example, the first interpolation filter may be a bilinear filter or a 4-tap filter. c. In one example, a 12-tap interpolation filter may be used. 20. It is proposed that the first interpolation filter used to generate template reference samples for MMVD reordering and / or MVD symbol prediction can be different from the second interpolation filter used to generate r template reference samples for another codec tool (e.g., TM-based merge candidate list). 21. It is proposed that the modified MV (eg, the estimate of the MV amplitude) can be used for MVD symbol prediction or MMVD reordering. a. In one example, the nearest integer estimate can be used for prediction / re-ranking. b. In one example, the nearest half-pixel estimate can be used for prediction / re-ordering. c. In one example, the nearest 4 pixel estimates can be used for prediction / re-ranking. Extension of the basic number of candidates used in MMVD 22. It is proposed that at least one additional base candidate may be added to the original base candidates of the MMVD and / or its extension (eg affine MMVD). a. Alternatively, at least one existing base candidate may be removed from the original base candidates for MMVD and / or its extension (eg, affine MMVD). b. In one example, depending on the block size, additional base candidates may be added. c. In one example, additional basic candidates may be added depending on the image resolution. d. In one example, additional candidates may be added based on similarities / differences between the original base candidates. e. Alternatively, at least one existing base candidate may be removed from the original base candidates according to the block size and / or temporal level and / or picture resolution and / or similarity / difference between the original base candidates. f. The base candidate index can be encoded and decoded with a truncated unary code, or a truncated binary code, or a Rice code with parameter R or a k-order exponential Golomb code, as well as any combination of bypass and context encoded binary values. i. Alternatively, it can be combined with the offset index and encoded and decoded together. About early termination of cost calculation 23. It is proposed that the cost calculation for the first candidate or candidate position may be terminated early. a. In one example, if the cost of the left stencil sample is higher than the maximum allowable cost, the cost calculation for the upper stencil sample may be skipped. b. In one example, if the cost of the upper stencil sample is higher than the maximum allowable cost, the cost calculation for the left stencil sample may be skipped. c. In one example, depending on the width and height of the block, the longer template side cost may be calculated first, and if that cost is higher than the maximum allowable cost, the cost calculation for the shorter template side may be skipped. d. In one example, the above maximum allowable cost may be a fixed number. e. In another example, the maximum allowable cost mentioned above may be a variable and may be a function of block size, width, height, fixed threshold, last cost, best cost, etc. f. In one example, if N candidates (eg, with the lowest cost) are selected from M candidates, the maximum allowable cost may be the Nth lowest cost. g. In another example, the maximum allowable cost mentioned above may be the cost of the second candidate or candidate positions. i. In one example, when calculating the cost of a first candidate or candidate location, a second candidate or candidate location may have the kth lowest cost. About Affine MMVD 24. It is proposed that there may be some simplifications for affine MMVD reference template derivation. For a sub-block based merge candidate with sub-block size equal to Wsub*Hsub, the upper template includes several sub-templates of size Wsub×L, and the left template includes several sub-templates of size L×Hsub. Fig.14 As shown, the motion information of the sub-blocks in the first row and the first column of the current block is used to derive the reference samples of each sub-template. a. In one example, the prediction may be calculated for each 4x4 sub-block. b. In one example, the prediction may be calculated for each 8x8 sub-block. c. In one example, the prediction may be calculated for each min(4, width)×min(4, height) sub-block. d. In one example, the prediction may be calculated for each (width / 2)×(height / 2) sub-block. e. In one example, a prediction may be calculated for each (width)×(height) sub-block (e.g. Fig.15 shown). f. In one example, there may be no LIC application for affine MMVD. g. In one example, when calculating the cost for the affine MMVD, there may be no LIC application. 25. It is proposed that whether to check the affine MMVD option at the encoder side may depend on the affine merging cost. a. In one example, if the best affine merge cost is on the top N merge costs or non-merge costs, then the affine MMVD options can be checked in the encoder. Otherwise, they can be skipped. N can be any number, such as 1, 3, 5, 10, 20, etc. b. In one example, if the best affine cost is not among the top N costs, the affine MMVD options can be checked in the encoder. Otherwise, they can be skipped. N can be any number, such as 1, 3, 5, 10, 20, etc. c. In another example, if the best affine cost is less than alpha*cost_t, then the affine MMVD options can be checked in the encoder. Otherwise, they can be skipped. alpha can be any positive real number, such as 0.7, 1, 1.25, 1.73, etc., and cost_t can be the best non-affine cost or the Nth best cost, where N can be any integer, such as 5, 10. d. In another example, if the best affine cost is greater than alpha*cost_t, then the affine MMVD options can be checked in the encoder. Otherwise, they can be skipped. alpha can be any positive real number, such as 0.7, 1, 1.25, 1.73, etc., and cost_t can be the best non-affine cost or the Nth best cost, where N can be any integer, such as 5, 10. About the step size and additional direction of MMVD 26. It is proposed that the initial step size can depend on the video resolution. a. In one example, the initial step size of a video with width*height>C can be N times the initial step size of a video with width*height<=C, where C can be any integer, such as 10^5 or any other number, and N can be any number, such as 2, 4, etc. b. In one example, there may be several thresholds for deciding the initial step size of the MMVD. For example, for a video with width*height>C1, the initial step size will be L1. Otherwise, for a video with width*height>C2, the initial step size will be L2. Otherwise, for a video with width*height>C3, the initial step size will be L3, and so on, where C1>C2>… and L1>L2>…, which can be any integer. c. In one example, the initial step size may be signaled by or derived from at least one syntax element, such as in SPS / PPS / picture header / slice header / tile / CTU / etc. 27. It is proposed that the initial step size may depend on the POC difference. a. In one example, the initial step size for blocks with a POC delta>C may be <=N times the initial step size of the block of C. i. In one example, C can be 2 or 4 or any other integer. ii. In one example, N may be 2, 3, or any other integer. b. The POC delta can be calculated as the absolute difference between the POCs of the current picture and the reference picture. 28. It is proposed that the number of directions can depend on the step size. a. In one example, the smallest step size can have N1 directions, and the remaining step sizes can have N2 directions, where N1 and N2 can be any integers. An example is N1=8 and N2=16. b. In one example, for the first 2 smallest step sizes, there can be N1 directions, and the remaining step sizes can have N2 directions, where N1 and N2 can be any integers. An example is N1=8 and N2=16. c. In one example, for the first M (eg, M≥1) smallest steps, there may be N1 directions, and the remaining steps may have N2 directions, where N1 and N2 may be any integers. An example is N1=8 and N2=16. About MMVD logo codec 29. It is proposed that the MMVD flag or the affine MMVD flag can be encoded using at least one context (the context index can be denoted as "ctx"). a. In one example, ctx may depend on information parsed before parsing the current MMVD flag or the affine MMVD flag (eg, codec mode / block size, etc.). b. In one example, ctx may depend on the MMVD flag of at least one neighboring block. i. In one example, if at least one of the blocks above or to the left of the current block uses MMVD, ctx will be 1, otherwise ctx will be 0. ii. In one example, if both the block above and the block to the left of the current block use MMVD, ctx will be 2. If only one of the block above or the block to the left of the current block uses MMVD, ctx will be 1, otherwise ctx will be 0. c. In one example, ctx may depend on the skip flag of the current block. i. In one example, if the current block is skipped, ctx will be 0 or 1, otherwise ctx will be 1 or 0. d. In one example, ctx may depend on the prediction direction of the current block. i. In one example, if the current block is uni-directionally predicted, ctx will be 0, otherwise if the current block is bi-directionally predicted, ctx will be 1. e. In one example, any combination of the above scenarios may apply, and several possible ctx are available. f. Alternatively, the MMVD flag or affine MMVD flag may be bypassed for encoding and decoding. About MMVD initial basic position update 30. It is proposed that the initial position of MMVD (and / or affine MMVD and / or GPM with MVD and / or IBC MMVD) can be updated using template matching (TM). a. In one example, diamond-shaped positions with a distance of N pixels around the initial basis can be searched to find a position with a lower TM cost. N can be any rational number, such as 64, 16, 1, 1 / 2, 1 / 8, etc. i. In one example, only one iteration is applied. ii. In one example, more than one iteration may be applied. iii. In another example, iterations may continue until there is no change in the centroid. b. In one example, the search may start at N1 pixel distances, and the search may continue to smaller pixel distances. i. In one example, the first round starts with N1 pixel distance. After 1 or K1 (or until it stabilizes) iterations with N1 distance, the second round with N2 pixel distance from the new center will start. It can continue for 1, K2, and ... iterations. N1 and N2 can be any rational numbers, and K1, K2 can be any integers. ii. In one example, similar to part i, J rounds of K1, ..., KJ iterations with pixel sizes N1, ..., NJ may be applied. c. In one example, if the new centroid has a TM cost less than C*BestCost, the new centroid may be updated. d. In one example, the search process may be terminated based on a rule. i. For example, if the cost of the considered TM is lower than or not greater than a threshold, the search process may be terminated. ii. For example, if the number of points that have been searched is greater than or not less than a threshold, the search process may be terminated. Extended MMVD for bidirectional prediction export 31. The proposed MMVD (and affine MMVD) bi-prediction candidate derivation may or may not apply one or more specific operations to derive the MV of at least one reference list, such as scaling, mirroring, etc. a. In one example, if the POC difference of List 0 and List 1 is different, there may be a scaling of the MVD value being added to the list with the smaller POC difference. i. Alternatively, no scaling may be involved regardless of the POC difference of each list. b. In one example, if the reference pictures of each list are on the opposite side of the current picture, a negative sign may be added to the MVD of the second list. ii. Alternatively, regardless of the location of the reference picture, no mirroring may be involved. About Extending Bidirectional Forecast Cost Calculation and Buffer Usage 32. It is proposed that the cost calculations and predictions for some of the MMVD (and affine MMVD) candidates can be stored and reused for future candidates. a. In one example, predictions for one-sided bi-prediction MMVD (or affine MMVD) can be stored and later used for two-sided bi-prediction. b. In another example, the prediction for two-sided bi-prediction MMVD (or affine MMVD) can be stored and later used for one-sided bi-prediction. About MMVD (or affine MMVD or IBC MMVD) basic candidates 33. It is proposed that the number of basic candidates for MMVD (or affine MMVD or IBC MMVD) can be increased according to the codec information received before decoding the current block. a. In one example, the number of base candidates may depend on the affine flag of the parent CU. b. In one example, the number of base candidates may depend on the best parent CU affine (or MMVD or affine MMVD) flag. c. In one example, the number of base candidates may depend on the neighboring block affine (or MMVD or affine MMVD) flag. i. In one example, the number of base candidates for MMVD (or affine MMVD) may depend on the MMVD (or affine MMVD) flags of neighboring blocks. (i) In one example, the neighboring blocks may be T0 and / or T1 and / or T2 and / or T3 and / or L0 and / or L1 and / or L2 (e.g. Fig.16 shown). ii. In one example, the number of basic candidates may depend on neighboring blocks T2 and L2 (e.g., Fig.16 )Affine (or MMVD or Affine MMVD) sign. iii. In one example, the number of base candidates may depend on the neighboring block T3 affine (or MMVD or affine MMVD) flag. iv. In one example, the number of base candidates may depend on neighboring blocks T2, T3 and L2 affine (or MMVD or affine MMVD) flags. v. In one example, the number of base candidates may depend on the neighboring blocks T1 and L1 affine (or MMVD or affine MMVD) flags. vi. In one example, the number of base candidates may depend on neighboring blocks T1, T3 and L1 affine (or MMVD or affine MMVD) flags. vii. In one example, the number of base candidates may depend on neighboring blocks T0 and L0 affine (or MMVD or affine MMVD) flags. viii. In one example, the number of base candidates may depend on neighboring blocks T0, T3 and L0 affine (or MMVD or affine MMVD) flags. ix. In one example, the number of base candidates may depend on the affine (or MMVD or affine MMVD) flags of neighboring blocks T0, T1, T2, T3, L0, L1 and L2 (or any subset thereof). d. In one example, the MMVD (or affine MMVD or IBC MMVD) base index codec may depend on surrounding blocks. i. In one example, the MMVD (or affine MMVD) base index codec may depend on the MMVD (or affine MMVD) flags of neighboring blocks. (i) In one example, the neighboring blocks may be T0 and / or T1 and / or T2 and / or T3 and / or L0 and / or L1 and / or L2 (e.g. Fig.16 shown). ii. In one example, the MMVD (or affine MMVD) base index codec may depend on neighboring blocks T2 and L2 (e.g. Fig.16 As shown) affine (or MMVD or affine MMVD) sign. iii. In one example, the MMVD (or Affine MMVD) base index codec may depend on the neighboring block T3 Affine (or MMVD or Affine MMVD) flag. iv. In one example, the MMVD (or Affine MMVD) base index codec may depend on neighboring blocks T2, T3 and L2 affine (or MMVD or Affine MMVD) flags. v. In one example, the MMVD (or Affine MMVD) base index codec may depend on the neighboring blocks T1 and L1 affine (or MMVD or Affine MMVD) flags. vi. In one example, the MMVD (or Affine MMVD) base index codec may depend on neighboring blocks T1, T3 and L1 affine (or MMVD or Affine MMVD) flags. vii. In one example, the MMVD (or Affine MMVD) base index codec may depend on the neighboring blocks T0 and L0 affine (or MMVD or Affine MMVD) flags. viii. In one example, the MMVD (or Affine MMVD) base index codec may depend on neighboring blocks T0, T3 and L0 affine (or MMVD or Affine MMVD) flags. ix. In one example, the MMVD (or affine MMVD) base index codec may depend on the neighboring blocks T0, T1, T2, T3, L0, L1 and L2 (or any subset thereof) affine (or MMVD or affine MMVD) flags. x. In one example, the binary bits may be encoded or decoded as truncated unary, binary, truncated binary, Rice code, Golomb code, exponential Golomb code, or any other code. xi. In one example, this binary bit may be coded as context coded binary bit or bypass coded binary bit or any combination thereof. ctx may depend on neighboring blocks T0, T1, T2, T3, L0, L1 and L2 (or any subset thereof). 34. It is suggested that there may be changes in the construction of the MMVD (or affine MMVD or IBC MMVD) merge list. a. In one example, only inherited affines may be allowed to be added to the affine MMVD merge list. b. In one example, at most K inherited affines can be allowed to be added to the affine MMVD merge list, and the remaining part can be filled with constructed affine candidates. K can be any integer. c. In one example, only constructed affines may be allowed to be added to the affine MMVD merge list. d. In one example, the unidirectional prediction candidates may be first placed in a list of MMVD merge lists. e. In one example, at most N unidirectional prediction candidates may be placed at the front of the list in the MMVD merge list. N may be any integer including 0, 1, 4, etc. f. In one example, candidates with different reference pictures may be placed first at the front of the merge list for MMVD (and / or affine MMVD). g. In one example, affine candidates with similar CPMVs can be skipped. 35. In one example, the shape of the template used for re-ordering / refining / updating / deriving MMVD candidates may be the same as the template used for another codec tool (eg, TM merging), or may be different from the template used for another codec tool. 36. It is proposed that the number of MMVD (or affine MMVD) basis candidates can be variable. a. In one example, the number of MMVD base candidates may depend on neighboring blocks for inter or intra prediction. i. In one example, the number of base candidates may depend on the number of intra-coded neighbors. ii. In one example, the number of base candidates in the cases where: there are no inter-frame neighboring blocks, only one neighboring block is an inter-frame neighboring block, or only two neighboring blocks are inter-frame neighboring blocks, ..., can be N0, N1, N2, ..., where N0, N1, N2, ... can be any integers such as 0, 1, 2, 3, ... b. In one example, the number of base candidates may depend on the temporal layer. i. In one example, time layer i, may have Ni basis candidates. Ni may be any integer such as 0, 1, 2, ... c. In one example, the number of base candidates may depend on the block size. i. In one example, a block with width=W and height=H may have N(W,H) basis. N(W,H) may be any integer, such as 0, 1, 2, ... Diversity creation of merging, affine merging, AMVP, MMVD, and affine MMVD candidates 37. Propose that the diversity criteria for selecting candidates can depend on the TM cost a. In one example, after re-ranking the candidates, a cost-dependent pruning process may be applied. b. In one example, if cost_j / cost_i is less than or equal to a threshold value C, candidate j may be removed from the final candidate list. C may be any real number, such as 1.02, 2, 0.9, ... c. In one example, if abs(cost_j-cost_i) is less than or equal to a threshold value C, candidate j can be removed from the final candidate list. C can be any real number (including integers), such as 0, 0.5, 1.6, 10, 1000, 10000, ... d. In one example, the predefined threshold may be a constant. e. In one example, the threshold may be different, depending on the block size, qp value, time layer, base cost, ... f. In one example, the threshold value may be signaled to the decoder. g. In one example, information about the derived threshold may be signaled to the decoder. 38. It is proposed that the diversity criteria used to select candidates may depend on the MV information. a. In one example, depending on the difference between MVx_i, MVy_i and MVx_j, MVy_j being less than (or greater than) a threshold, the second item can be removed from the final candidate list. The distance metric can be any cost function l0, l1, l2 norm, or any other cost metric. The threshold can be any real scalar or real tuple. b. In one example, the predefined threshold may be a constant. c. In one example, the threshold may be different, depending on the block size, qp value, time layer, base cost, ... d. In one example, the threshold value may be signaled to the decoder. e. In one example, information about the derived threshold may be signaled to the decoder. General 39. Whether and / or how to apply the above method may depend on the encoded information. a. In one example, the coded information may include block size and / or temporal layer, and / or slice / picture type, color component, etc. 40. Whether and / or how the above method is applied can be indicated in the bitstream. b. Enabling / disabling or an indication of which method to apply may be signaled at sequence level / picture group level / picture level / slice level / tile group level, e.g. in sequence header / picture header / SPS / VPS / DPS / DCI / PPS / PPS / slice header / tile group header. c. When a PB / TB / CB / PU / TU / CU / VPDU / CTU / CTU row / slice / tile / sub-picture / other kind of area contains more than one sample or pixel, the enable / disable or indication of which method to apply can be signaled.

[0077] More details of embodiments of the present disclosure related to the creation of a diversity of motion candidate lists will be described below. The embodiments of the present disclosure should be considered as examples to explain general concepts and should not be interpreted in a narrow sense. In addition, these embodiments can be applied individually or in combination in any way.

[0078] As used herein, the term "MMVD" may refer to a codec tool in which partial motion information (e.g., reference picture index, prediction direction from list 0 or list 1, and basic motion vector) is inherited from a candidate, while some additional refined indications of the refined motion information (e.g., refined mv difference) are further signaled in the bitstream. MMVD may also include extensions of MMVD, such as affine MMVD or GPM MMVD (GMVD), MMVD for IBC mode, MMVD for affine IBC mode. The term "block" may refer to a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a codec unit (CU), a prediction unit (PU), a transform unit (TU), a prediction block (PB), a transform block (TB), a video processing unit including multiple samples / pixels, etc. A block may be rectangular or non-rectangular.

[0079] Fig.171700 is a flowchart of a method 1700 for video processing according to some embodiments of the present disclosure. The method 1700 may be implemented during a conversion between a current video block of a video and a bitstream of the video. Fig.17 As shown, method 1700 starts at 1702, where a motion candidate list for a current video block is obtained. In some embodiments, the motion candidates in the motion candidate list are sorted according to the TM cost of the motion candidates. By way of example and not limitation, the motion candidate list can be a merge candidate list, an affine merge subsequent list, an advanced motion vector prediction (AMVP) candidate list, a merge mode with motion vector difference (MMVD) candidate list, an affine MMVD candidate list, etc.

[0080] At 1704, whether to update the motion candidate list is determined based on a similarity metric between the first motion candidate and the second motion candidate in the motion candidate list. In some embodiments, the similarity metric depends on a template matching (TM) cost. Alternatively, the similarity metric depends on motion vector information. This will be described in detail below.

[0081] At 1706, conversion can be performed based on the determination at 1704. By way of example and not limitation, if it is determined to update the motion candidate list, the motion candidate list can be updated by removing the first motion candidate or the second motion candidate from the motion candidate list. Alternatively, the motion candidate can be updated by placing the first motion candidate or the second motion candidate at the end of the motion candidate list. Therefore, it can be ensured that the candidates at the top of the motion candidate list are diverse. And, conversion can be performed based on the updated motion candidate list.

[0082] In some embodiments, the conversion may include encoding the current video block into a bitstream. Alternatively or additionally, the conversion may include decoding the current video block from the bitstream. It should be understood that the above examples are for illustrative purposes only. The scope of the present disclosure is not limited in this regard.

[0083] In view of the above situation, whether to update the motion candidate list depends on the similarity measure between the motion candidates in the motion candidate list. Compared with conventional solutions, the proposed method can advantageously ensure the diversity of motion candidates in the motion candidate list, and thus the encoding and decoding quality can be improved.

[0084] In some embodiments, if the similarity metric is less than or equal to a threshold, the motion candidate list may be updated. In some alternative embodiments, if the similarity metric is greater than a threshold, the motion candidate list may be updated.

[0085] In some embodiments, the similarity metric can be determined based on the result of dividing the TM cost of the second motion candidate by the TM cost of the first motion candidate. In this case, the threshold value can be any real number, such as 1.02, 2, 0.9, etc. Alternatively, the similarity metric can be determined based on the absolute value of the difference between the TM cost of the second motion candidate and the TM cost of the first motion candidate. In this case, the threshold value can be any real number, such as 0, 0.5, 1.6, 10, 1000, 10000, etc. It should be understood that the above examples are for illustrative purposes only. The scope of the present disclosure is not limited in this regard.

[0086] In some alternative embodiments, the similarity metric can be determined based on a difference metric between the motion vector (MV) of the second motion candidate and the motion vector of the first motion candidate. For example, the similarity metric can be determined based on a difference metric between (MVx_i, MVy_i) and (MVx_j, MVy_j), where MVx_i, MVy_i represent the horizontal component and the vertical component of the vector for motion candidate i, respectively. By way of example and not limitation, the difference metric can be determined based on the L0 norm, the L1 norm, the L2 norm, etc. In this case, the threshold value can be a real scalar or a real element array. It should be understood that the above examples are for illustrative purposes only. The scope of the present disclosure is not limited in this regard.

[0087] In some embodiments, the threshold value may be constant. Alternatively, the threshold value may depend on the current video block size, the quantization parameter used to encode the current video block, the temporal layer of the current video block, the lowest cost of the motion candidates in the motion candidate list, and / or the like. In some embodiments, the threshold value may be indicated in the bitstream. Alternatively, information related to determining the threshold value may be indicated in the bitstream.

[0088] In some embodiments, the number of base candidates for the MMVD-based mode for encoding the current video block may vary. For example, it may depend on the prediction mode of at least one neighboring block of the current video block. By way of example and not limitation, the MMVD-based mode may be an MMVD mode, an affine MMVD mode, etc. The base candidate may be a candidate that will be adjusted using MVD.

[0089] In some embodiments, the number of basic candidates may depend on the number of neighboring blocks of the current video block that are encoded based on the intra-frame prediction mode. Alternatively, the number of basic candidates may depend on the number of neighboring blocks of the current video block that are encoded based on the inter-frame prediction mode. By way of example and not limitation, for the first case where no neighboring blocks are inter-coded, the number of basic candidates may be N0; for the second case where only one of the neighboring blocks is inter-coded, the number of basic candidates may be N1; for the third case where two of the neighboring blocks are inter-coded, the number of basic candidates may be N2, and so on. Each of N0, N1, and N2 may be any integer, such as 0, 1, 2, or 3. It should be understood that the above examples are for illustrative purposes only. The scope of the present disclosure is not limited in this regard.

[0090] In some embodiments, the number of base candidates for the MMVD-based mode for encoding the current video block may depend on the temporal layer of the current video block, the size of the current video block, the height of the current video block, the width of the current video block, and / or the like. For example, the number of base candidates may be an integer.

[0091] According to another embodiment of the present disclosure, a non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a device for video processing. In the method, a motion candidate list for a current video block of the video is obtained. Whether to update the motion candidate list is determined based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list. In addition, the bitstream is generated based on the determination.

[0092] According to some other embodiments of the present disclosure, a method for storing a bitstream of a video is provided. In the method, a motion candidate list for a current video block of the video is obtained. Whether to update the motion candidate list is determined based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list. In addition, a bitstream is generated based on the determination and the bitstream is stored in a non-transitory computer-readable recording medium.

[0093] Embodiments of the present disclosure may be described according to the following clauses, features of which may be combined in any reasonable way.

[0094] Clause 1. A method for video processing, comprising: obtaining a motion candidate list for a conversion between a current video block of a video and a bitstream of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; and performing the conversion based on the determination.

[0095] Clause 2. The method of clause 1, wherein the similarity metric depends on a template matching (TM) cost or motion vector information.

[0096] Clause 3. A method according to any of clauses 1-2, wherein the motion candidates in the motion candidate list are ordered according to their TM costs.

[0097] Clause 4. A method according to any one of clauses 1-3, wherein performing the conversion comprises: if it is determined to update the motion candidate list, updating the motion candidate list by removing the first motion candidate or the second motion candidate from the motion candidate list; and performing the conversion based on the updated motion candidate list.

[0098] Clause 5. The method of any of clauses 1-4, wherein the motion candidate list is updated if the similarity measure is less than or equal to a threshold.

[0099] Clause 6. The method of any of clauses 1-4, wherein if the similarity measure is greater than a threshold, the motion candidate list is updated.

[0100] Clause 7. The method of any of clauses 1-6, wherein the similarity measure is determined based on a result of dividing a TM cost of the second motion candidate by a TM cost of the first motion candidate.

[0101] Clause 8. The method of any of clauses 1-6, wherein the similarity measure is determined based on an absolute value of a difference between a TM cost of the second motion candidate and a TM cost of the first motion candidate.

[0102] Clause 9. The method of any one of clauses 7-8, wherein the threshold is a real number.

[0103] Clause 10. The method of any of clauses 1-6, wherein the similarity measure is determined based on a difference measure between the motion vector of the second motion candidate and the motion vector of the first motion candidate.

[0104] Clause 11. The method of clause 10, wherein the difference metric is determined based on at least one of: an L0 norm, an L1 norm, or an L2 norm.

[0105] Clause 12. The method of clause 11, wherein the threshold is a real scalar or a tuple of real numbers.

[0106] Clause 13. The method of any one of clauses 5-12, wherein the threshold is constant.

[0107] Clause 14. A method according to any one of clauses 5-12, wherein the threshold depends on at least one of: the size of the current video block, a quantization parameter used to encode and decode the current video block, the temporal layer of the current video block, or the lowest cost of the motion candidates in the motion candidate list.

[0108] Clause 15. The method of any of clauses 5-14, wherein the threshold is indicated in the bitstream.

[0109] Clause 16. The method of any of clauses 5-14, wherein information related to determining the threshold is indicated in the bitstream.

[0110] Clause 17. A method according to any one of clauses 1-16, wherein the motion candidate list comprises one of: a merge candidate list, an affine merge candidate list, an advanced motion vector prediction (AMVP) candidate list, a merge mode with motion vector difference (MMVD) candidate list, or an affine MMVD candidate list.

[0111] Clause 18. The method of any of clauses 1-17, wherein a number of base candidates for the MMVD-based mode for encoding the current video block depends on a prediction mode of at least one neighboring block of the current video block.

[0112] Clause 19. The method of clause 18, wherein the number of the base candidates depends on the number of neighboring blocks of the current video block that are encoded based on an intra-prediction mode.

[0113] Clause 20. The method of clause 18, wherein the number of the base candidates depends on the number of neighboring blocks of the current video block that are encoded based on an inter-prediction mode.

[0114] Clause 21. A method according to any one of clauses 1-17, wherein the number of base candidates for the MMVD-based mode for encoding and decoding the current video block depends on at least one of: the temporal layer of the current video block, the size of the current video block, the height of the current video block, or the width of the current video block.

[0115] Clause 22. The method of any one of clauses 18-21, wherein the number of base candidates is an integer.

[0116] Clause 23. The method of any of clauses 18-22, wherein the MMVD-based pattern comprises an MMVD pattern or an affine MMVD pattern.

[0117] Clause 24. The method of any of clauses 1-23, wherein the converting comprises encoding the current video block into the bitstream.

[0118] Clause 25. The method of any of clauses 1-23, wherein the converting comprises decoding the current video block from the bitstream.

[0119] Clause 26. An apparatus for video processing, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to perform the method of any of clauses 1-25.

[0120] Clause 27. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform the method of any of clauses 1-25.

[0121] Clause 28. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: obtaining a motion candidate list for a current video block of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; and generating the bitstream based on the determination.

[0122] Clause 29. A method for storing a bitstream of a video, comprising: obtaining a motion candidate list for a current video block of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; generating the bitstream based on the determination; and storing the bitstream in a non-transitory computer-readable recording medium. Example Device

[0123] Fig.18 A block diagram of a computing device 1800 in which various embodiments of the present disclosure may be implemented is shown. The computing device 1800 may be implemented as a source device 110 (or video encoder 114 or 200) or a destination device 120 (or video decoder 124 or 300), or may be included in a source device 110 (or video encoder 114 or 200) or a destination device 120 (or video decoder 124 or 300).

[0124] It should be understood that Fig.18 The computing device 1800 shown in FIG. 1 is for illustrative purposes only and is not intended to in any way imply any limitation on the functionality and scope of the embodiments of the present disclosure.

[0125] like Fig.18As shown, computing device 1800 includes a general computing device 1800. Computing device 1800 may include at least one or more processors or processing units 1810, memory 1820, storage unit 1830, one or more communication units 1840, one or more input devices 1850, and one or more output devices 1860.

[0126] In some embodiments, computing device 1800 can be implemented as any user terminal or server terminal with computing capability. A server terminal can be a server provided by a service provider, a large computing device, etc. A user terminal can be, for example, any type of mobile terminal, fixed terminal, or portable terminal, including a mobile phone, a station, a unit, a device, a multimedia computer, a multimedia tablet computer, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a gaming device, or any combination thereof, and includes accessories and peripherals of these devices, or any combination thereof. It is conceivable that computing device 1800 can support any type of interface to a user (such as a "wearable" circuit device, etc.).

[0127] The processing unit 1810 may be a physical processor or a virtual processor and may implement various processes based on a program stored in the memory 1820. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of the computing device 1800. The processing unit 1810 may also be referred to as a central processing unit (CPU), a microprocessor, a controller, or a microcontroller.

[0128] The computing device 1800 typically includes various computer storage media. Such media can be any media accessible by the computing device 1800, including but not limited to volatile media and non-volatile media, or removable media and non-removable media. The memory 1820 can be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (such as a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM) or flash memory) or any combination thereof. The storage unit 1830 can be any removable or non-removable medium, and can include machine-readable media, such as a memory, a flash drive, a disk, or other media that can be used to store information and / or data and can be accessed in the computing device 1800.

[0129] The computing device 1800 may also include additional removable / non-removable storage media, volatile / non-volatile storage media. Fig.18 Although not shown in the figure, a magnetic disk drive for reading from and / or writing to a removable nonvolatile magnetic disk and an optical disk drive for reading from and / or writing to a removable nonvolatile optical disk may be provided. In this case, each drive may be connected to the bus (not shown) via one or more data medium interfaces.

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

[0131] The input device 1850 may be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, etc. The output device 1860 may be one or more of various output devices, such as a display, a speaker, a printer, etc. With the help of the communication unit 1840, the computing device 1800 may also communicate with one or more external devices (not shown), such as storage devices and display devices, and the computing device 1800 may also communicate with one or more devices that enable a user to interact with the computing device 1800, or any device that enables the computing device 1800 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.), if necessary. Such communication may be performed via an input / output (I / O) interface (not shown).

[0132] In some embodiments, some or all components of computing device 1800 may also be arranged in a cloud computing architecture rather than being integrated in a single device. In a cloud computing architecture, components may be provided remotely and work together to implement the functions described in the present disclosure. In some embodiments, cloud computing provides computing, software, data access and storage services, which will not require the end user to know the physical location or configuration of the system or hardware that provides these services. In various embodiments, cloud computing provides services via a wide area network (e.g., the Internet) using a suitable protocol. For example, a cloud computing provider provides applications via a wide area network, which can be accessed through a web browser or any other computing component. The software or components of the cloud computing architecture and the corresponding data may be stored on a remote server. The computing resources in a cloud computing environment may be merged or distributed at the location of a remote data center. Cloud computing infrastructure may provide services through a shared data center, although they appear as a single access point for users. Therefore, the cloud computing architecture may be used to provide the components and functions described herein from a service provider at a remote location. Alternatively, they may be provided by a conventional server, or installed directly or otherwise on a client device.

[0133] In an embodiment of the present disclosure, the computing device 1800 may be used to implement video encoding / decoding. The memory 1820 may include one or more video encoding / decoding modules 1825 having one or more program instructions. These modules can be accessed and executed by the processing unit 1810 to perform the functions of the various embodiments described herein.

[0134] In an example embodiment performing video encoding, input device 1850 may receive video data as input 1870 to be encoded. The video data may be processed by, for example, video codec module 1825 to generate an encoded bitstream. The encoded bitstream may be provided as output 1880 via output device 1860.

[0135] In an example embodiment performing video decoding, input device 1850 may receive an encoded bitstream as input 1870. The encoded bitstream may be processed by, for example, video codec module 1825 to generate decoded video data. The decoded video data may be provided as output 1880 via output device 1860.

[0136] Although the present disclosure has been specifically shown and described with reference to the preferred embodiments of the present disclosure, it will be understood by those skilled in the art that various changes can be made in form and detail without departing from the spirit and scope of the present application as defined by the appended claims. These changes are intended to be encompassed by the scope of the present application. Therefore, the foregoing description of the embodiments of the present application is not intended to be limiting.

Claims

1. A method for video processing, comprising: For conversion between a current video block of a video and a bitstream of the video, obtaining a motion candidate list for the current video block; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; as well as The converting is performed based on the determination.

2. The method of claim 1, wherein the similarity metric depends on a template matching (TM) cost or motion vector information. 3 . The method according to claim 1 , wherein the motion candidates in the motion candidate list are sorted according to the TM costs of the motion candidates.

4. The method according to any one of claims 1 to 3, wherein performing the conversion comprises: If it is determined to update the motion candidate list, updating the motion candidate list by removing the first motion candidate or the second motion candidate from the motion candidate list; as well as The converting is performed based on the updated motion candidate list.

5. The method according to any one of claims 1-4, wherein if the similarity measure is less than or equal to a threshold, the motion candidate list is updated.

6. The method according to any one of claims 1-4, wherein if the similarity measure is greater than a threshold, the motion candidate list is updated. 7 . The method according to claim 1 , wherein the similarity metric is determined based on a result of dividing the TM cost of the second motion candidate by the TM cost of the first motion candidate.

8. The method according to any one of claims 1-6, wherein the similarity measure is determined based on an absolute value of a difference between a TM cost of the second motion candidate and a TM cost of the first motion candidate.

9. The method according to any one of claims 7-8, wherein the threshold value is a real number.

10. The method according to any one of claims 1-6, wherein the similarity measure is determined based on a difference measure between the motion vector of the second motion candidate and the motion vector of the first motion candidate.

11. The method of claim 10, wherein the difference metric is determined based on at least one of: L0 norm, L1 norm, or L2 norm. The method of claim 11 , wherein the threshold is a real scalar or a tuple of real numbers.

13. The method according to any one of claims 5-12, wherein the threshold value is constant.

14. The method according to any one of claims 5 to 12, wherein the threshold value depends on at least one of the following: The size of the current video block, a quantization parameter for encoding and decoding the current video block, the temporal layer of the current video block, or The lowest cost among the costs of the motion candidates in the motion candidate list.

15. The method according to any one of claims 5-14, wherein the threshold is indicated in the bitstream.

16. The method according to any one of claims 5-14, wherein information related to determining the threshold is indicated in the bitstream.

17. The method according to any one of claims 1 to 16, wherein the motion candidate list comprises one of the following: Merge candidate lists, Affine merge candidate list, Advanced Motion Vector Prediction (AMVP) candidate list, Merge Mode with Motion Vector Difference (MMVD) candidate list, or Affine MMVD candidate list.

18. The method of any one of claims 1-17, wherein a number of base candidates for the MMVD-based mode for encoding the current video block depends on a prediction mode of at least one neighboring block of the current video block.

19. The method of claim 18, wherein the number of the base candidates depends on the number of neighboring blocks of the current video block that are encoded based on an intra-prediction mode.

20. The method of claim 18, wherein the number of the base candidates depends on the number of neighboring blocks of the current video block that are encoded based on an inter-prediction mode.

21. The method of any one of claims 1-17, wherein the number of base candidates for the MMVD-based mode for encoding and decoding the current video block depends on at least one of: the temporal layer of the current video block, The size of the current video block, the height of the current video block, or The width of the current video block.

22. The method according to any one of claims 18-21, wherein the number of base candidates is an integer.

23. The method of any one of claims 18-22, wherein the MMVD-based pattern comprises an MMVD pattern or an affine MMVD pattern.

24. The method of any one of claims 1-23, wherein the converting comprises encoding the current video block into the bitstream.

25. The method of any one of claims 1-23, wherein the converting comprises decoding the current video block from the bitstream.

26. An apparatus for video processing, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to perform the method of any one of claims 1-25.

27. A non-transitory computer-readable storage medium storing instructions, the instructions causing a processor to execute the method according to any one of claims 1-25.

28. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: Obtaining a motion candidate list for a current video block of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; as well as The bitstream is generated based on the determination.

29. A method for storing a bitstream of a video, comprising: Obtaining a motion candidate list for a current video block of the video; determining whether to update the motion candidate list based on a similarity measure between a first motion candidate and a second motion candidate in the motion candidate list; generating the bitstream based on the determination; as well as The bit stream is stored in a non-transitory computer-readable recording medium.