Method and device for video processing and medium
By using motion vector difference to adjust the motion vector in the merge candidate scheme of video blocks, decoupling the motion vector adjustment in bidirectional prediction, and dynamically adjusting the number of merge candidates, the problem of improving encoding and codec efficiency and quality in the prior art is solved, and the problem of improving the encoding and decoding efficiency and quality is realized More efficient video encoding and decoding.
Patent Information
- Application Number
- CN202380033946.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-12
- Filing Date
- 2023-04-07
- Publication Date
- 2024-12-03
AI Technical Summary
The existing video encoding and decoding technology has room for improvement in encoding and decoding efficiency and quality, especially in the processing of motion vector difference (MVD). The flexibility and accuracy of traditional methods are limited, resulting in the failure to fully utilize the encoding and decoding efficiency and quality. Potential.
A video processing method is proposed. By using motion vector difference (MVD) to adjust the motion vector in the merge candidate scheme of video blocks, the adjustment of the two motion vectors in the bidirectional prediction is improved, and the flexibility of the merge candidates is improved. , and dynamically adjust the number of merge candidates in the codec tool, and flexibly process based on the codec information between video blocks.
Improve the efficiency and quality of video encoding and decoding, and improve the flexibility and accuracy of codec tools through more flexible motion vector difference processing and dynamic merge candidate adjustment.
Smart Images

Figure CN119072923A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate generally to video coding techniques, and more particularly to merge with motion vector difference (MMVD) coding. 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 efficiency 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, selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for the current video block; and performing conversion based on the target scheme, wherein the plurality of candidate schemes include at least one of a first group of candidate schemes and a second group of candidate schemes, in each of the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted, in each of the second group of candidate schemes, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
[0005] According to the method of the first aspect of the present disclosure, one of the first MV and the second MV for bidirectional prediction of the current video block can be adjusted, while the other MV remains unadjusted. In other words, the adjustment of the two MVs for bidirectional prediction of the current video block is decoupled. Compared with the conventional solution in which the adjustment of the two MVs for bidirectional prediction is coupled to each other, the proposed method can advantageously make the adjustment of the merge candidate more flexible, and thus improve the coding efficiency and coding quality.
[0006] In a second aspect, another 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 number of one or more merge candidates adjusted by using at least one MVD for the current video block, the number of the one or more merge candidates depending on codec information of one or more other video blocks of the video different from the current video block; and performing conversion based on the number of the one or more merge candidates.
[0007] According to the method of the second aspect of the present disclosure, the number of one or more merge candidates of the current video block adjusted by at least one MVD is variable rather than fixed. Compared with the traditional scheme with a fixed number, the proposed method can advantageously make the MMVD-based coding tool more flexible, thereby improving coding efficiency and coding quality.
[0008] In a third 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 and the second aspect of the present disclosure.
[0009] In a fourth 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 and the second aspect of the present disclosure.
[0010] In a fifth aspect, another non-transitory computer-readable recording medium is proposed. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a device for video processing. The method includes: selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for a current video block of a video; and generating a bitstream based on the target scheme, wherein the plurality of candidate schemes include at least one of a first group of candidate schemes and a second group of candidate schemes, in each candidate scheme in the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted, in each candidate scheme in the second group of candidate schemes, a second MV is adjusted using a second MVD, and the first MV remains unadjusted.
[0011] In a sixth aspect, a method for storing a bitstream of a video is provided. The method includes: selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for a current video block of the video; generating a bitstream based on the target scheme; and storing the bitstream in a non-transitory computer-readable recording medium, wherein the plurality of candidate schemes include at least one of a first group of candidate schemes and a second group of candidate schemes, in each of the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted; in each of the second group of candidate schemes, a second MV is adjusted using a second MVD, and the first MV remains unadjusted.
[0012] In a seventh 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 device for video processing. The method includes: obtaining the number of one or more merge candidates adjusted by at least one MVD for a current video block of the video, the number of the one or more merge candidates depending on the codec information of one or more other video blocks of the video different from the current video block; and generating a bitstream based on the number of the one or more merge candidates.
[0013] In an eighth aspect, a method for storing a bitstream of a video is provided. The method includes: obtaining a number of one or more merge candidates adjusted by using at least one MVD for a current video block of the video, the number of the one or more merge candidates depending on codec information of one or more other video blocks of the video different from the current video block; generating a bitstream based on the number of the one or more merge candidates; and storing the bitstream in a non-transitory computer-readable recording medium.
[0014] 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
[0015] 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.
[0016] Figure 1 A block diagram showing an example video encoding and decoding system according to some embodiments of the present disclosure is shown;
[0017] Figure 2 A block diagram of an example video encoder according to some embodiments of the present disclosure is shown;
[0018] Figure 3 A block diagram of an example video decoder according to some embodiments of the present disclosure is shown;
[0019] Figure 4 A schematic diagram of the MMVD search process is shown;
[0020] Figure 5 A schematic diagram of the MMVD search point is shown;
[0021] Figure 6 A schematic diagram of a simplified affine motion model is shown;
[0022] Figure 7A schematic diagram of the affine MVF of each sub-block is shown;
[0023] Figure 8 A schematic diagram showing distance index and distance offset mapping;
[0024] Fig. 9A An example implementation of adding diagonal angles is shown;
[0025] Fig. 9B Another example implementation of adding diagonal angles is shown;
[0026] Fig. 9C Yet another example implementation of adding a diagonal angle is shown;
[0027] Fig. 10A An example implementation of adding diagonal angles with exact similar distances around a circle is shown;
[0028] Fig. 10B Another example implementation of adding diagonal angles with exact similar distances around a circle is shown;
[0029] Fig.11 Some example implementations of adding any combination of step sizes and angles asymmetrically are shown;
[0030] Fig.12 Some example implementations of removing every other distance offset are shown;
[0031] Fig.13 A schematic diagram of the proposed MV-based dependent direction offset is shown;
[0032] Fig.14 A template for a block with sub-block motion and a reference sample of the template are shown;
[0033] Fig.15 The template for the full block and the reference sample of the template are shown;
[0034] Fig.16 The neighbor positions of the current block are shown;
[0035] Fig.17 A flowchart of a method for video processing according to some embodiments of the present disclosure is shown;
[0036] Fig.18 A flowchart showing another method for video processing according to some embodiments of the present disclosure; and
[0037] Fig.19 A block diagram of a computing device is shown in which various embodiments of the present disclosure may be implemented.
[0038] Throughout the drawings, same or similar reference numbers generally refer to same or similar elements. DETAILED DESCRIPTION
[0039] 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.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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
[0044] Figure 11 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] Figure 2is 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.
[0050] 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.
[0051] 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.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] After reconstruction unit 212 reconstructs the video block, a loop filtering operation may be performed to reduce video blocking artifacts in the video block.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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, the square points and triangle points represent additional directions. c. The above directions can be added as additional directions in addition to the directions 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 asymmetry / slant offset or additional diagonal directions for MMVD and / or its extensions (e.g., affine MMVD) can be indicated by an index to be jointly or separately encoded and decoded for direction and distance offset. 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-th 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 and decoded with any combination of bypassed and context-decoded binary values. v. In one example, the index can be encoded and decoded in bypass mode. vi. In one example, the index can be encoded and decoded 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 the 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 can 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 (For example, 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 may be removed starting from the 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 divided into 2 indices for the direction and distance offsets, 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-th order exponential Golomb code, or using any combination of binary values encoded with bypass and context decoding. 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) additional directions and / or additional offsets 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, an additional direction offset can be approximated, for example, if the base MV direction is between pi / 8 and 3pi / 8, a diagonal direction offset can be used, otherwise a vertical / Horizontal offset. 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 of the index (e.g., only the first binary value) Can be context encoded and 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 re-ranking the MMVD candidates, only the top N with the lowest cost are retained. N can be any integer. Only new limited options will be 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, For example, 1.2, 2, 2.5, ..., bestCost is the best (e.g., minimum) template matching cost of the candidate. o. In one example, a fixed ratio from the best template matching cost can be used to select the candidate, or the top N can be selected, or any combination of restrictions based on block size and / or base MV amplitude and / or base MV direction can 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, then use Reference samples for LIC method export templates. 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. It is proposed that for an advanced motion vector prediction (AMVP) mode and / or its extensions (e.g., affine AMVP), 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), the sign of MVD can be predicted (or reordered). 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 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 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 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 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 an affine AMVP can be compared to the prediction for an affine Any MMVD reordering combination of 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 can be selected from the MMVD and / or its extensions (e.g., affine MMVD) is removed from the original base candidates. 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, 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. c. In another example, if the best affine cost is less than alpha*cost_t, 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, 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 a video with width*height< =N times the initial step size of the video of 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, then ctx will be 1, otherwise ctx will be 0. ii. In one example, if both the upper block and the left block of the current block use MMVD, then ctx will be 2. If only one of the blocks above or to the left of the current block uses MMVD, then 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 the 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 locations with a distance of N pixels around the initial basis can be searched to find a location 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 MMVD (or affine MMVD or IBC MMVD) increases the number of basic candidates. 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 (such as 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) Logo. 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 encoded as a context-encoded binary bit or a bypass-encoded 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 first be placed in the (and / or affine MMVD) of the merged list. 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. General 36. 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. 37. Whether and / or how the above method is applied can be indicated in the bitstream. b. The indication of enabling / disabling or which method to apply may be signaled at the sequence level / picture group level / picture level / slice level / tile group level, e.g. in the 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.
[0082] More details of embodiments of the present disclosure related to MMVD encoding and decoding 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.
[0083] 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.
[0084] 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 begins at 1702, where a target scheme is selected from a plurality of candidate schemes for adjusting a merge candidate of a current video block.
[0085] Multiple candidate schemes include a first group of candidate schemes and / or a second group of candidate schemes. In each candidate scheme in the first group of candidate schemes, the first motion vector (MV) of the merged candidate is adjusted using a first motion vector difference (MVD), and the second MV of the merged candidate remains unadjusted. In each candidate scheme in the second group of candidate schemes, the second MV is adjusted using a second MVD, and the first MV remains unadjusted. Both the first group of candidate schemes and the second group of candidate schemes can be referred to as unilateral bidirectional prediction candidate schemes. As an example and not limitation, a codec tool based on MMVD (e.g., MMVD, affine MMVD, etc.) can be used to encode and decode the current video block.
[0086] In some embodiments, the plurality of candidate solutions may further include a third group of candidate solutions. In each candidate solution in the third group of candidate solutions, the first MV may be adjusted using the third MVD, and the second MV may be adjusted using the fourth MVD. The third group of candidate solutions may be referred to as a bilateral bidirectional prediction candidate solution.
[0087] In some embodiments, the first MVD may be added to a first MVD list corresponding to the first MV, and the second MVD may be added to a second MVD list corresponding to the second MV. In addition, the third MVD may be added to the first MVD list, and the fourth MVD may be added to the second MVD list.
[0088] In some embodiments, a template matching (TM) cost can be determined for each candidate solution in a plurality of candidate solutions. In one example, a candidate solution with the lowest TM cost can be selected as a target solution. In another example, a candidate solution with a TM cost less than a threshold can be selected as a target solution. It should be understood that the target solution can be selected in any other suitable manner. The scope of the present disclosure is not limited in this respect.
[0089] At 1704, a conversion may be performed based on the target scheme. As an example and not limitation, a merge candidate may be adjusted based on the target scheme, and the adjusted merge candidate may be used to obtain a prediction of the current video block. In one example, the conversion may include encoding the current video block into a bitstream. Alternatively or in addition, the conversion may include decoding the current video block from the bitstream. It should be understood that the above examples are described for illustrative purposes only. The scope of the present disclosure is not limited in this regard.
[0090] In view of the above situation, one of the first MV and the second MV for bidirectional prediction of the current video block can be adjusted, while the other MV is kept unadjusted. In other words, the adjustment of the two MVs for bidirectional prediction of the current video block is decoupled. Compared with the conventional solution in which the adjustment of the two MVs for bidirectional prediction is coupled to each other, the proposed method can advantageously make the adjustment of the merge candidate more flexible, and thus improve the coding efficiency and coding quality.
[0091] In some embodiments, the number of candidate solutions in the first group of candidate solutions, the number of candidate solutions in the second group of candidate solutions, and the number of candidate solutions in the third group of candidate solutions may be the same. As an example and not limitation, the number of candidate solutions in the first group of candidate solutions may be equal to a predetermined value, such as 8 or 16. Alternatively, at least two of the following may be different from each other: the number of candidate solutions in the first group of candidate solutions, the number of candidate solutions in the second group of candidate solutions, or the number of candidate solutions in the third group of candidate solutions.
[0092] In some embodiments, the first MV may be associated with reference picture list 0 and the second MV may be associated with reference picture list 1. Alternatively, the first MV may be associated with reference picture list 1 and the second MV may be associated with reference picture list 0.
[0093] In some embodiments, a prediction associated with the second MV for the current video block may be determined for a first candidate in the first set of candidates. The prediction may be stored and reused for a second candidate in the first set of candidates.
[0094] Additionally or alternatively, the plurality of candidate schemes may include a third candidate scheme and a fourth candidate scheme. At least one of the following is stored and reused for the first motion vector prediction (MVP) determined for the fourth candidate scheme: a template matching (TM) cost associated with a second MVP determined for the third candidate scheme, or a prediction of the current video block associated with the second MVP. The second MVP is the same as the first MVP. In one example, the third candidate scheme may be included in the first group of candidate schemes. The fourth candidate scheme may be included in the third group of candidate schemes. That is, in the fourth candidate scheme, the first MV may be adjusted using the third MVD, and the second MV may be adjusted using the fourth MVD. In another example, the third candidate scheme may be included in the third group of candidate schemes, and the fourth candidate scheme may be included in the first group of candidate schemes.
[0095] By storing and reusing previously determined costs and predictions, repeated computations can be avoided and thus encoding and decoding efficiency can be further improved.
[0096] In some embodiments, the current video block is included in a current picture of the video. If a picture order count (POC) difference between the current picture and a first reference picture associated with the first MV is less than a POC difference between the current picture and a second reference picture associated with the second MV, an MVD for adjusting the first MV may be determined based on a first value obtained by scaling a predetermined MVD distance. If the POC difference between the current picture and the first reference picture is greater than the POC difference between the current picture and the second reference picture, an MVD for adjusting the second MV may be determined based on the first value. For example, if the POC differences of list 0 and list 1 are different, a scaling operation may be performed on the MVD to be added to the list with the smaller POC difference.
[0097] In some alternative embodiments, if the POC difference between the current picture and the first reference picture associated with the first MV is less than the POC difference between the current picture and the second reference picture associated with the second MV, the MVD for adjusting the first MV may be determined based on a predetermined MVD distance. If the POC difference between the current picture and the first reference picture is greater than the POC difference between the current picture and the second reference picture, the MVD for adjusting the second MV may be determined based on a predetermined MVD distance. That is, no scaling operation will be performed on the MVD to be added to the list regardless of the POC difference.
[0098] In some additional or alternative embodiments, if a first reference picture associated with a first MV is before a current picture and a second reference picture associated with a second MV is after the current picture, the MVD for adjusting the second MV may be determined based on a second value obtained by adding a negative sign to a predetermined MVD distance. If the first reference picture is after the current picture and the second reference picture is before the current picture, the MVD for adjusting the first MV may be determined based on the second value. For example, if the reference pictures of each list are on opposite sides of the current picture, a negative sign may be added to the MVD to be added to list 1, that is, a mirroring operation may be performed on the MVD.
[0099] In some embodiments, if a first reference picture associated with a first MV is before a current picture and a second reference picture associated with a second MV is after the current picture, an MVD for adjusting the second MV may be determined based on a predetermined MVD distance. If the first reference picture is after the current picture and the second reference picture is before the current picture, an MVD for adjusting the first MV may be determined based on a predetermined MVD distance. In other words, a mirroring operation will not be performed on the MVD to be added to the list, regardless of the position of the reference pictures.
[0100] 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. According to the method, a target scheme is selected from a plurality of candidate schemes for adjusting a merge candidate for a current video block of a video. The plurality of candidate schemes include at least one group of candidate schemes in a first group of candidate schemes and a second group of candidate schemes. In each candidate scheme in the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted. In each candidate scheme in the second group of candidate schemes, a second MV is adjusted using a second MVD, and the first MV remains unadjusted. In addition, a bitstream is generated based on the target scheme.
[0101] According to some other embodiments of the present disclosure, a method for storing a bitstream of a video is provided. In the method, a target scheme is selected from a plurality of candidate schemes for adjusting a merge candidate for a current video block of a video. The plurality of candidate schemes include at least one of a first group of candidate schemes and a second group of candidate schemes. In each of the first group of candidate schemes, the first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and the second MV of the merge candidate remains unadjusted. In each of the second group of candidate schemes, the second MV is adjusted using a second MVD, and the first MV remains unadjusted. In addition, a bitstream is generated based on the target scheme, and the bitstream is stored in a non-transitory computer-readable recording medium.
[0102] Fig.18 1 is a flow chart showing another method 1800 for video processing according to some embodiments of the present disclosure. The method 1800 may be implemented during a conversion between a current video block of a video and a bitstream of the video. Fig.18 As shown, method 1800 starts at 1802, where the number of one or more merge candidates for a current video block adjusted using at least one MVD can be obtained. As used herein, the merge candidates adjusted using the MVD can be referred to as basic candidates. The number of one or more basic candidates depends on codec information of one or more other video blocks of the video. The one or more additional video blocks are different from the current video block.
[0103] In some embodiments, the number of one or more merge candidates may be determined at the encoder. At the decoder, the number of one or more merge candidates may be obtained from the bitstream. As an example and not limitation, the number itself or an indication of the number may be signaled in the bitstream. In some alternative embodiments, at the encoder and decoder, the number of one or more merge candidates may be determined based on codec information of one or more additional video blocks.
[0104] In some embodiments, the codec information may include: a first indication indicating whether to use an affine mode, a second indication indicating whether to use MMVD, a third indication indicating whether to use affine MMVD, a block size, a quantization parameter, etc. As an example and not a limitation, the first indication may be an affine flag. The second indication may be an MMVD flag. The third indication may be an affine MMVD flag.
[0105] At 1804, a conversion is performed based on the number of one or more merge candidates. In one example, the conversion may include encoding the current video block into a bitstream. Alternatively or in addition, the conversion may include decoding the current video block from the bitstream. It should be understood that the above examples are described for illustrative purposes only. The scope of the present disclosure is not limited in this regard.
[0106] In view of the above, the number of basic candidates for the current video block is variable rather than fixed. Compared with the traditional solution with a fixed number, the proposed method can advantageously make the MMVD-based coding tool more flexible, thereby improving coding efficiency and coding quality.
[0107] In some embodiments, one or more additional video blocks may include a parent video block of the current video block. The current video block is included in the parent video block. For example, in the codec tree, the node corresponding to the parent video block may be the parent node of the node corresponding to the current video block. In other words, the current video block is obtained by partitioning the parent video block.
[0108] In some alternative embodiments, one or more additional video blocks may include a target ancestor video block among multiple ancestor video blocks of the current video block. The current video block is included in each of the multiple ancestor video blocks. The rate-distortion (RD) cost of the target ancestor video block may be the smallest among the multiple ancestor video blocks. For example, in a codec tree, a node corresponding to each of the multiple ancestor video blocks may be an ancestor node of a node corresponding to the current video block. In other words, the current video block is obtained by dividing each of the multiple ancestor video blocks.
[0109] In some additional or alternative embodiments, the one or more additional video blocks may include at least one neighboring video block of the current video block. By way of example and not limitation, the at least one neighboring video block may include at least one of the following blocks: (1) an upper left neighboring video block of the current video block, (2) an upper right neighboring video block of the current video block, (3) a lower left neighboring video block of the current video block, (4) a first left neighboring video block of the current video block, the first left neighboring video block being above the lower left neighboring video block and below the upper left neighboring video block, (5) a second left neighboring video block of the current video block, the second left neighboring video block being above the first left neighboring video block and below the upper left neighboring video block, (6) a first upper neighboring video block of the current video block, the first upper neighboring video block being to the left of the upper right neighboring video block and to the right of the upper left neighboring video block, or (7) a second upper neighboring video block of the current video block, the second upper neighboring video block being to the left of the first upper neighboring video block and to the right of the upper left neighboring video block.
[0110] refer to Fig.16 , block 1610 shows the current video block. Block T3 may be an example embodiment of an upper left neighboring video block. Block T0 may be an example embodiment of an upper right neighboring video block. Block L0 may be an example embodiment of a lower left neighboring video block. Block L1 may be an example embodiment of a first left neighboring video block. Block L2 may be an example embodiment of a second left neighboring video block. Block T1 may be an example embodiment of a first upper neighboring video block. Block T2 may be an example embodiment of a second upper neighboring video block. It should be understood that the above illustrations and / or examples are described for descriptive purposes only. The scope of the present disclosure is not limited in this regard.
[0111] It should be understood that the one or more additional video blocks may include any other suitable blocks.The scope of the present disclosure is not limited in this regard.
[0112] In some embodiments, the index of the first merge candidate in the one or more merge candidates may be encoded based on the encoding and decoding information of at least one neighboring video block of the current video block. In one example, the index may be encoded as a truncated unary code, a binary code, a truncated binary code, a Rice code, a Golomb code, an exponential Golomb code, etc. Additionally or alternatively, the binary representation of the index (hereinafter also referred to as a "binary bit") may be encoded as a binary bit encoded by context, a binary bit encoded by bypass, etc. In some embodiments, the context for encoding the index may depend on at least one neighboring video block.
[0113] In some embodiments, a candidate list including one or more merge candidates may be determined. In one example, only inherited affine merge candidates of the current video block may be allowed to be added to the candidate list. Affine merge candidates may be extrapolated from control point motion vectors (CPMVs) of neighboring video blocks. Additionally or alternatively, a maximum number of inherited affine merge candidates of the current video block that are allowed to be added to the candidate list may be predetermined. As an example and not limitation, the maximum number may be an integer. In another example, only constructed affine merge candidates of the current video block may be allowed to be added to the candidate list. The constructed affine merge candidates may be derived by using the translation MVs of neighboring video blocks.
[0114] In some additional or alternative embodiments, the unidirectional prediction candidate for the current video block may be added to the first position of the candidate list. Additionally or alternatively, up to N unidirectional prediction candidates for the current video block may be added to the first N positions of the candidate list. For example, N may be an integer, such as 0, 1, 4, etc. M is equal to the number of merge candidates.
[0115] In some embodiments, the candidate list may include the first affine merge candidate. If the control point motion vector (CPMV) of the second affine merge candidate is the same as the first affine merge candidate, the second affine merge candidate may not be added to the candidate list. Additionally or alternatively, if a similarity measure between the CPMV of the second affine merge candidate and the CPMV of the first affine merge candidate is greater than a threshold, the second affine merge candidate may not be added to the candidate list.
[0116] In some embodiments, the current video block may be encoded by an MMVD-based encoding and decoding tool. As an example and not limitation, the MMVD-based encoding and decoding tool may be MMVD, affine MMVD, intra-block copy (IBC) MMVD, geometric partitioning mode (GPM) with MVD, etc.
[0117] In some embodiments, the shape of the template used for a codec tool other than the above-mentioned MMVD-based codec tool is the same as at least one of the following: the shape of the template used to reorder the MMVD candidates for the current video block, the shape of the template used to refine the MMVD candidates for the current video block, the shape of the template used to update the MMVD candidates for the current video block, and the shape of the template used to determine the MMVD candidates for the current video block.
[0118] In some alternative embodiments, the shape of the template used for a codec tool other than the above-mentioned MMVD-based codec tool is different from at least one of the following: the shape of the template used to reorder the MMVD candidates for the current video block, the shape of the template used to refine the MMVD candidates for the current video block, the shape of the template used to update the MMVD candidates for the current video block, and the shape of the template used to determine the MMVD candidates for the current video block.
[0119] In some embodiments, at 1704, a first position of a first merging candidate among the one or more merging candidates may be updated based on template matching (TM). In addition, a conversion may be performed based on the updated first position.
[0120] In some embodiments, the first position may be set as a reference position. The following operations may be performed iteratively: determining a TM cost for the reference position and a set of candidate positions associated with the reference position; and if a candidate position with a lowest TM cost in the set of candidate positions is not the same as the reference position, updating the reference position with the candidate position. If the candidate position with the lowest TM cost is the same as the reference position, indicating that the search result is stable, the iterative process may be terminated and the first position may be updated with the reference position.
[0121] In some alternative embodiments, the first position may be set as a reference position. The following operations may be performed iteratively: determining a TM cost for the reference position and a set of candidate positions associated with the reference position; and if the TM cost of a candidate position in the set of candidate positions is below a threshold, updating the reference position with the candidate position. If the TM costs of all candidate positions in the set of candidate positions are not below the threshold, indicating that the search results are stable, the iterative process may be terminated and the first position may be updated with the reference position.
[0122] For example, the threshold value may depend on the TM cost of the reference location. As an example and not limitation, the threshold value may be determined as the product of the scaling parameter and the TM cost of the reference location. In one example, the scaling parameter may be less than 1. More specifically, the scaling parameter may be 0.95. It should be understood that the above examples are described for illustrative purposes only. The scope of the present disclosure is not limited in this regard.
[0123] In some embodiments, the distance between the reference position and each reference position in a set of candidate positions may be equal to a predetermined value. As an example and not limitation, the predetermined value may be 64 pixels, 16 pixels, 1 pixel, 1 / 2 pixel, 1 / 8 pixel, etc.
[0124] In some further alternative embodiments, J rounds of search processes may be performed, where J is an integer, such as 2, 3, 5, etc. For each of the J rounds, the following items are iteratively performed at least once: determining a TM cost for a reference position and a set of candidate positions associated with the reference position; and if the candidate position with the lowest TM cost in the set of candidate positions is not the same as the reference position, updating the reference position with the candidate position. For each of the J rounds, the distance between the reference position and each reference position in the set of candidate positions may be equal to a predetermined value corresponding to the corresponding round. If the candidate position with the lowest TM cost is the same as the reference position, indicating that the search results for the round are stable, the search round may be terminated and the next search round may be started. After all J rounds are performed, the first position may be updated with the reference position.
[0125] In some embodiments, in a first round of J rounds, the distance may be equal to a first predetermined value, and in a second round of J rounds, the distance may be equal to a second predetermined value. The second round is performed after the first round, and the second predetermined value may be less than the first predetermined value. In other words, the search round may start with a larger distance, and it may continue to a smaller distance.
[0126] In some embodiments, a set of candidate positions may include at least one of the following: a position above the reference position, a position below the reference position, a position to the left of the reference position, or a position to the right of the reference position. When a set of candidate positions includes all of the above positions, it may also be referred to as a diamond position.
[0127] In some embodiments, the execution of the iteration can be terminated based on a termination rule. In one example, the execution of the iteration can be terminated after a predetermined number of executions. As an example and not a limitation, the execution of the iteration can be terminated after one iteration or three iterations. In another example, if the number of candidate positions searched is greater than or not less than a threshold, the execution of the iteration can be terminated. It should be understood that the execution of the iteration can be terminated based on any other suitable termination rule. The scope of the present disclosure is not limited in this regard.
[0128] 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. According to the method, the number of one or more merge candidates of a current video block of a video adjusted with at least one MVD is obtained. The number of one or more merge candidates depends on the codec information of one or more other video blocks of the video that are different from the current video block. In addition, a bitstream is generated based on the number of one or more merge candidates.
[0129] According to some other embodiments of the present disclosure, a method for storing a bitstream of a video is provided. In the method, the number of one or more merge candidates of a current video block of a video adjusted by at least one MVD is obtained. The number of one or more merge candidates depends on the codec information of one or more other video blocks of the video that are different from the current video block. In addition, a bitstream is generated based on the number of one or more merge candidates, and the bitstream is stored in a non-transitory computer-readable recording medium.
[0130] Embodiments of the present disclosure may be described according to the following clauses, features of which may be combined in any reasonable way.
[0131] Clause 1. A method for video processing, comprising: for conversion between a current video block of a video and a bitstream of the video, selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for the current video block; and performing the conversion based on the target scheme, wherein the plurality of candidate schemes include at least one group of candidate schemes from a first group of candidate schemes and a second group of candidate schemes, in each candidate scheme in the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted, and in each candidate scheme in the second group of candidate schemes, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
[0132] Clause 2. The method of clause 1, wherein the current video block is encoded using merge mode with motion vector difference (MMVD) or affine MMVD.
[0133] Clause 3. The method of any of clauses 1-2, wherein the first MVD is added to a first MVD list corresponding to the first MV, and the second MVD is added to a second MVD list corresponding to the second MV.
[0134] Clause 4. A method according to any one of clauses 1-3, wherein the plurality of candidate solutions further comprises a third group of candidate solutions, in each candidate solution of the third group of candidate solutions, the first MV is adjusted using a third MVD, and the second MV is adjusted using a fourth MVD.
[0135] Clause 5. The method of clause 4, wherein the third MVD is added to a first MVD list corresponding to the first MV, and the fourth MVD is added to a second MVD list corresponding to the second MV.
[0136] Clause 6. A method according to any one of clauses 4-5, wherein the number of candidate solutions in the first group of candidate solutions, the number of candidate solutions in the second group of candidate solutions, and the number of candidate solutions in the third group of candidate solutions are the same.
[0137] Clause 7. The method according to any one of clauses 1-6, wherein the number of candidate solutions in the first set of candidate solutions is equal to a predetermined value.
[0138] Clause 8. A method according to any one of clauses 4-5, wherein at least two of the following are different from each other: the number of candidate solutions in the first group of candidate solutions, the number of candidate solutions in the second group of candidate solutions, or the number of candidate solutions in the third group of candidate solutions.
[0139] Clause 9. A method according to any one of clauses 1-8, wherein the first MV is associated with reference picture list 0 and the second MV is associated with reference picture list 1, or the first MV is associated with reference picture list 1 and the second MV is associated with reference picture list 0.
[0140] Clause 10. A method according to any one of clauses 1-9, wherein the prediction associated with the second MV of the current video block is determined for a first candidate in the first set of candidate solutions, and the prediction is stored and reused for a second candidate in the first set of candidate solutions.
[0141] Clause 11. A method according to any one of clauses 1-10, wherein the multiple candidate schemes include a third candidate scheme and a fourth candidate scheme, and at least one of the following is stored and reused for a first motion vector prediction (MVP) determined for the fourth candidate scheme: a template matching (TM) cost associated with a second MVP determined for the third candidate scheme, or a prediction of the current video block associated with the second MVP, wherein the second MVP is the same as the first MVP.
[0142] Clause 12. A method according to clause 11, wherein the third candidate scheme is included in the first group of candidate schemes, and in the fourth candidate scheme, the first MV is adjusted using a third MVD and the second MV is adjusted using a fourth MVD, or the third candidate scheme is included in the third group of candidate schemes, and the fourth candidate scheme is included in the first group of candidate schemes.
[0143] Clause 13. A method according to any one of clauses 1-12, wherein the current video block is included in a current picture of the video, and if a picture order count (POC) difference between the current picture and a first reference picture associated with the first MV is less than a POC difference between the current picture and a second reference picture associated with the second MV, an MVD for adjusting the first MV is determined based on a first value, the first value being obtained by scaling a predetermined MVD distance, or if the POC difference between the current picture and the first reference picture is greater than the POC difference between the current picture and the second reference picture, an MVD for adjusting the second MV is determined based on the first value.
[0144] Clause 14. A method according to any one of clauses 1-12, wherein the current video block is included in a current picture of the video, and if a POC difference between the current picture and a first reference picture associated with the first MV is smaller than a POC difference between the current picture and a second reference picture associated with the second MV, an MVD for adjusting the first MV is determined based on a predetermined MVD distance, or if the POC difference between the current picture and the first reference picture is greater than the POC difference between the current picture and the second reference picture, an MVD for adjusting the second MV is determined based on the predetermined MVD distance.
[0145] Clause 15. A method according to any one of clauses 1-14, wherein the current video block is included in a current picture of the video, and if a first reference picture associated with the first MV is before the current picture and a second reference picture associated with the second MV is after the current picture, the MVD for adjusting the second MV is determined based on a second value, the second value being obtained by adding a negative sign to a predetermined MVD distance, or if the first reference picture is after the current picture and the second reference picture is before the current picture, the MVD for adjusting the first MV is determined based on the second value.
[0146] Clause 16. A method according to any one of clauses 1-14, wherein the current video block is included in a current picture of the video, and if a first reference picture associated with the first MV is before the current picture and a second reference picture associated with the second MV is after the current picture, an MVD for adjusting the second MV is determined based on a predetermined MVD distance, or if the first reference picture is after the current picture and the second reference picture is before the current picture, an MVD for adjusting the first MV is determined based on the predetermined MVD distance.
[0147] Clause 17. A method for video processing, comprising: for conversion between a current video block of a video and a bitstream of the video, obtaining the number of one or more merge candidates adjusted using at least one MVD for the current video block, the number of the one or more merge candidates depending on codec information of one or more additional video blocks of the video that are different from the current video block; and performing the conversion based on the number of the one or more merge candidates.
[0148] Clause 18. The method of Clause 17, wherein the one or more additional video blocks comprises a parent video block of the current video block, the current video block being included in the parent video block.
[0149] Clause 19. A method according to clause 17, wherein the one or more additional video blocks include a target ancestor video block among multiple ancestor video blocks of the current video block, the current video block is included in each of the multiple ancestor video blocks, and the rate-distortion cost of the target ancestor video block is the smallest among the multiple ancestor video blocks.
[0150] Clause 20. The method of any of clauses 17-19, wherein the one or more additional video blocks comprises at least one neighboring video block of the current video block.
[0151] Clause 21. The method of any of clauses 17-20, wherein an index of a first merge candidate of the one or more merge candidates is encoded based on encoding information of at least one neighboring video block of the current video block.
[0152] Clause 22. A method according to any one of clauses 17-21, wherein the encoding and decoding information includes at least one of the following: a first indication indicating whether to use an affine mode, a second indication indicating whether to use MMVD, a third indication indicating whether to use affine MMVD; a block size, or a quantization parameter.
[0153] Clause 23. The method of clause 22, wherein the first indication is an affine flag, the second indication is an MMVD flag, or the third indication is an affine MMVD flag.
[0154] Clause 24. A method according to any one of clauses 20-23, wherein the at least one neighboring video block includes at least one of the following: an upper left neighboring video block of the current video block, an upper right neighboring video block of the current video block, a lower left neighboring video block of the current video block, a first left neighboring video block of the current video block, the first left neighboring video block is above the lower left neighboring video block and below the upper left neighboring video block, a second left neighboring video block of the current video block, the second left neighboring video block is above the first left neighboring video block and below the upper left neighboring video block, a first upper neighboring video block of the current video block, the first upper neighboring video block is to the left of the upper right neighboring video block and to the right of the upper left neighboring video block, or a second upper neighboring video block of the current video block, the second upper neighboring video block is to the left of the first upper neighboring video block and to the right of the upper left neighboring video block.
[0155] Clause 25. The method of any of clauses 21-24, wherein the index is encoded or decoded as one of: a truncated unary code, a binary code, a truncated binary code, a Rice code, a Golomb code, or an exponential Golomb code.
[0156] Clause 26. The method of any of clauses 21-25, wherein the binary representation of the index is encoded as context-encoded binary bits or bypass-encoded binary bits.
[0157] Clause 27. The method of any of clauses 21-26, wherein a context for encoding the index depends on the at least one neighboring video block.
[0158] Clause 28. A method according to any one of clauses 17-27, wherein the number of the one or more merge candidates is determined at an encoder, and wherein obtaining the number of the one or more merge candidates comprises: obtaining the number of the one or more merge candidates from the bitstream.
[0159] Clause 29. The method of any one of clauses 17 and 20-21, wherein obtaining the number of the one or more merge candidates comprises: determining the number of the one or more merge candidates based on codec information of the one or more additional video blocks.
[0160] Clause 30. The method according to any one of clauses 17-29, further comprising: determining a candidate list including the one or more merge candidates.
[0161] Clause 31. The method of clause 30, wherein inherited affine merge candidates for the current video block are allowed to be added to the candidate list.
[0162] Clause 32. The method of any of clauses 30-31, wherein a maximum number of inheritance affine merge candidates for the current video block that are allowed to be added to the candidate list is predetermined.
[0163] Clause 33. The method of clause 32, wherein the maximum number is an integer.
[0164] Clause 34. The method of clause 30, wherein a constructed affine merge candidate for the current video block is added to the candidate list.
[0165] Clause 35. The method of clause 30, wherein a uni-directional prediction candidate for the current video block is added to the first position of the candidate list.
[0166] Clause 36. The method of clause 30, wherein at most N uni-directional prediction candidates for the current video block are added to the first N positions of the candidate list, and N is an integer.
[0167] Clause 37. The method of clause 30, wherein merge candidates with different reference pictures are added to the first M positions of the candidate list, and M is equal to the number of merge candidates.
[0168] Clause 38. A method according to Clause 30, wherein the candidate list includes a first affine merge candidate, and if a control point motion vector (CPMV) of the second affine merge candidate is the same as that of the first affine merge candidate, the second affine merge candidate is not added to the candidate list.
[0169] Clause 39. A method according to Clause 30, wherein the candidate list includes a first affine merge candidate, and if a similarity measure between the CPMV of a second affine merge candidate and the CPMV of the first affine merge candidate is greater than a threshold, the second affine merge candidate is not added to the candidate list.
[0170] Clause 40. The method of any of clauses 17-39, wherein the current video block is encoded using an MMVD-based encoding tool.
[0171] Clause 41. The method of clause 44, wherein the MMVD-based codec tool comprises at least one of: MMVD, affine MMVD, intra-block copy (IBC) MMVD, or geometric partitioning mode (GPM) with MVD.
[0172] Clause 42. A method according to any one of clauses 40-41, wherein the shape of the template used for a codec tool other than the MMVD-based codec tool is the same as at least one of the following: the shape of the template used to reorder the MMVD candidates for the current video block, the shape of the template used to refine the MMVD candidates for the current video block, the shape of the template used to update the MMVD candidates for the current video block, and the shape of the template used to determine the MMVD candidates for the current video block.
[0173] Clause 43. A method according to any one of clauses 40-41, wherein the shape of the template used for a codec tool other than the MMVD-based codec tool is different from at least one of the following: the shape of the template used to reorder the MMVD candidates for the current video block, the shape of the template used to refine the MMVD candidates for the current video block, the shape of the template used to update the MMVD candidates for the current video block, and the shape of the template used to determine the MMVD candidates for the current video block.
[0174] Clause 44. The method according to any one of clauses 17-43, wherein performing the conversion comprises: updating a first position of a first merge candidate among the one or more merge candidates based on template matching (TM); and performing the conversion based on the updated first position.
[0175] Clause 45. A method according to clause 44, wherein updating the first position comprises: setting the first position as a reference position; iteratively performing the following items at least once: determining a TM cost for the reference position and a set of candidate positions associated with the reference position; and if a candidate position with a lowest TM cost in the set of candidate positions is not the same as the reference position, updating the reference position using the candidate position; and updating the first position using the reference position.
[0176] Clause 46. A method according to clause 44, wherein updating the first position comprises: setting the first position as a reference position; iteratively performing the following items at least once: determining a TM cost for the reference position and a set of candidate positions associated with the reference position; and if the TM cost of a candidate position in the set of candidate positions is lower than a threshold, updating the reference position using the candidate position; and updating the first position using the reference position.
[0177] Clause 47. The method of clause 46, wherein the threshold value depends on the TM cost of the reference location.
[0178] Clause 48. The method of any one of clauses 45-47, wherein a distance between the reference position and each candidate position in the set of candidate positions is equal to a predetermined value.
[0179] Clause 49. A method according to clause 44, wherein updating the first position comprises: setting the first position as a reference position; for each round in J rounds, iteratively performing the following items at least once: determining a TM cost for the reference position and a set of candidate positions associated with the reference position, the distance between the reference position and each candidate position in the set of candidate positions being equal to a predetermined value corresponding to the corresponding round; and if the candidate position with the lowest TM cost in the set of candidate positions is not the same as the reference position, updating the reference position using the candidate position; and updating the first position using the reference position, wherein J is an integer.
[0180] Clause 50. A method according to Clause 49, wherein in a first round of the J rounds the distance is equal to a first predetermined value, in a second round of the J rounds the distance is equal to a second predetermined value, the second round is performed after the first round, and the second predetermined value is less than the first predetermined value.
[0181] Clause 51. A method according to any one of clauses 45-50, wherein the set of candidate positions includes at least one of: a position above the reference position, a position below the reference position, a position to the left of the reference position, or a position to the right of the reference position.
[0182] Clause 52. The method of any of clauses 45-51, wherein execution of the iteration is terminated after a predetermined number of executions.
[0183] Clause 53. The method according to any one of clauses 45-52, wherein if the number of candidate positions searched is greater than or not less than a threshold, the execution of the iteration is terminated.
[0184] Clause 54. The method of any of clauses 1-53, wherein the converting comprises encoding the current video block into the bitstream.
[0185] Clause 55. The method of any of clauses 1-53, wherein the converting comprises decoding the current video block from the bitstream.
[0186] Clause 56. 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-55.
[0187] Clause 57. A non-transitory computer-readable storage medium storing instructions for causing a processor to perform the method of any of clauses 1-55.
[0188] Item 58. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method executed by a device for video processing, wherein the method comprises: selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for a current video block of the video; and generating the bitstream based on the target scheme, wherein the plurality of candidate schemes comprises at least one group of candidate schemes from a first group of candidate schemes and a second group of candidate schemes, wherein in each candidate scheme in the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted, and in each candidate scheme in the second group of candidate schemes, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
[0189] Clause 59. A method for storing a bitstream of a video, comprising: selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for a current video block of the video; generating the bitstream based on the target scheme; and storing the bitstream in a non-transitory computer-readable recording medium, wherein the plurality of candidate schemes include at least one of a first group of candidate schemes and a second group of candidate schemes, in each of the first group of candidate schemes, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted; in each of the second group of candidate schemes, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
[0190] Item 60. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method executed by a device for video processing, wherein the method comprises: obtaining a number of one or more merge candidates adjusted using at least one MVD for a current video block of the video, the number of the one or more merge candidates depending on codec information of one or more additional video blocks of the video that are different from the current video block; and generating the bitstream based on the number of the one or more merge candidates.
[0191] Clause 61. A method for storing a bitstream of a video, comprising: obtaining the number of one or more merge candidates adjusted using at least one MVD for a current video block of the video, the number of the one or more merge candidates depending on codec information of one or more additional video blocks of the video that are different from the current video block; generating the bitstream based on the number of the one or more merge candidates; and storing the bitstream in a non-transitory computer-readable recording medium. Example Device
[0192] Fig.19 A block diagram of a computing device 1900 in which various embodiments of the present disclosure may be implemented is shown. The computing device 1900 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).
[0193] It should be understood that Fig.19 The computing device 1900 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.
[0194] like Fig.19 As shown, computing device 1900 includes a general computing device 1900. Computing device 1900 may include at least one or more processors or processing units 1910, memory 1920, storage unit 1930, one or more communication units 1940, one or more input devices 1950, and one or more output devices 1960.
[0195] In some embodiments, the computing device 1900 can be implemented as any user terminal or server terminal with computing capabilities. The server terminal can be a server provided by a service provider, a large computing device, etc. The 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 the computing device 1900 can support any type of interface to the user (such as a "wearable" circuit device, etc.).
[0196] The processing unit 1910 may be a physical processor or a virtual processor and may implement various processes based on a program stored in the memory 1920. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the computing device 1900. The processing unit 1910 may also be referred to as a central processing unit (CPU), a microprocessor, a controller, or a microcontroller.
[0197] The computing device 1900 typically includes various computer storage media. Such media can be any media accessible by the computing device 1900, including but not limited to volatile media and non-volatile media, or removable media and non-removable media. The memory 1920 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 1930 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 1900.
[0198] The computing device 1900 may also include additional removable / non-removable storage media, volatile / non-volatile storage media. Fig.19 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.
[0199] The communication unit 1940 communicates with another computing device via a communication medium. In addition, the functions of the components in the computing device 1900 can be implemented by a single computing cluster or multiple computing machines that can communicate via a communication connection. Therefore, the computing device 1900 can operate in a networked environment using logical connections to one or more other servers, networked personal computers (PCs), or other general network nodes.
[0200] The input device 1950 may be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, etc. The output device 1960 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 1940, the computing device 1900 may also communicate with one or more external devices (not shown), such as storage devices and display devices, and the computing device 1900 may also communicate with one or more devices that enable a user to interact with the computing device 1900, or any device that enables the computing device 1900 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).
[0201] In some embodiments, some or all components of the computing device 1900 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.
[0202] In an embodiment of the present disclosure, the computing device 1900 may be used to implement video encoding / decoding. The memory 1920 may include one or more video encoding / decoding modules 1925 having one or more program instructions. These modules can be accessed and executed by the processing unit 1910 to perform the functions of the various embodiments described herein.
[0203] In an example embodiment performing video encoding, input device 1950 may receive video data as input 1970 to be encoded. The video data may be processed by, for example, video codec module 1925 to generate an encoded bitstream. The encoded bitstream may be provided as output 1980 via output device 1960.
[0204] In an example embodiment performing video decoding, input device 1950 may receive an encoded bitstream as input 1970. The encoded bitstream may be processed by, for example, video codec module 1925 to generate decoded video data. The decoded video data may be provided as output 1980 via output device 1960.
[0205] 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 covered 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, include: For conversion between a current video block of a video and a bitstream of the video, selecting a target scheme from a plurality of candidate schemes for adjusting a merge candidate for the current video block; as well as performing the conversion based on the target solution, wherein the plurality of candidate solutions include at least one of a first group of candidate solutions and a second group of candidate solutions, In each candidate solution of the first set of candidate solutions, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted, In each candidate solution in the second set of candidate solutions, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
2. The method of claim 1, wherein the current video block is encoded using merge mode with motion vector difference (MMVD) or affine MMVD.
3. The method according to any one of claims 1-2, wherein the first MVD is added to a first MVD list corresponding to the first MV, and the second MVD is added to a second MVD list corresponding to the second MV.
4. The method according to any one of claims 1-3, wherein the plurality of candidate solutions further comprises a third group of candidate solutions, in each candidate solution of the third group of candidate solutions, the first MV is adjusted using a third MVD, and the second MV is adjusted using a fourth MVD. 5 . The method of claim 4 , wherein the third MVD is added to a first MVD list corresponding to the first MV, and the fourth MVD is added to a second MVD list corresponding to the second MV.
6. The method according to any one of claims 4-5, wherein the number of candidate solutions in the first group of candidate solutions, the number of candidate solutions in the second group of candidate solutions, and the number of candidate solutions in the third group of candidate solutions are the same.
7. The method according to any one of claims 1-6, wherein the number of candidate solutions in the first group of candidate solutions is equal to a predetermined value.
8. The method according to any one of claims 4-5, wherein at least two of the following are different from each other: the number of candidate solutions in the first set of candidate solutions, the number of candidate solutions in the second set of candidate solutions, or The number of candidate solutions in the third group of candidate solutions.
9. The method according to any one of claims 1 to 8, wherein the first MV is associated with reference picture list 0 and the second MV is associated with reference picture list 1, or The first MV is associated with reference picture list 1 and the second MV is associated with reference picture list 0.
10. The method of any one of claims 1-9, wherein a prediction associated with the second MV for the current video block is determined for a first candidate in the first set of candidates, and the prediction is stored and reused for a second candidate in the first set of candidates.
11. The method according to any one of claims 1 to 10, wherein the plurality of candidates include a third candidate and a fourth candidate, and at least one of the following is stored and reused for the first motion vector prediction (MVP) determined for the fourth candidate: a template matching (TM) cost associated with a second MVP determined for the third candidate, or a prediction of the current video block associated with the second MVP, The second MVP is the same as the first MVP.
12. The method of claim 11, wherein the third candidate solution is included in the first set of candidate solutions, and in the fourth candidate solution, the first MV is adjusted using a third MVD, and the second MV is adjusted using a fourth MVD, or The third candidate solution is included in the third group of candidate solutions, and the fourth candidate solution is included in the first group of candidate solutions.
13. The method according to any one of claims 1 to 12, wherein the current video block is included in a current picture of the video, If a picture order count (POC) difference between the current picture and a first reference picture associated with the first MV is less than a POC difference between the current picture and a second reference picture associated with the second MV, an MVD for adjusting the first MV is determined based on a first value obtained by scaling a predetermined MVD distance, or If the POC difference between the current picture and the first reference picture is greater than the POC difference between the current picture and the second reference picture, an MVD for adjusting the second MV is determined based on the first value.
14. The method according to any one of claims 1 to 12, wherein the current video block is included in a current picture of the video, If a POC difference between the current picture and a first reference picture associated with the first MV is less than a POC difference between the current picture and a second reference picture associated with the second MV, an MVD for adjusting the first MV is determined based on a predetermined MVD distance, or If the POC difference between the current picture and the first reference picture is greater than the POC difference between the current picture and the second reference picture, an MVD for adjusting the second MV is determined based on the predetermined MVD distance.
15. The method according to any one of claims 1 to 14, wherein the current video block is included in a current picture of the video, If a first reference picture associated with the first MV is before the current picture and a second reference picture associated with the second MV is after the current picture, an MVD for adjusting the second MV is determined based on a second value obtained by adding a negative sign to a predetermined MVD distance, or If the first reference picture is after the current picture and the second reference picture is before the current picture, an MVD for adjusting the first MV is determined based on the second value.
16. The method according to any one of claims 1 to 14, wherein the current video block is included in a current picture of the video, If a first reference picture associated with the first MV is before the current picture and a second reference picture associated with the second MV is after the current picture, an MVD for adjusting the second MV is determined based on a predetermined MVD distance, or If the first reference picture is after the current picture and the second reference picture is before the current picture, an MVD for adjusting the first MV is determined based on the predetermined MVD distance.
17. A method for video processing, include: For conversion between a current video block of a video and a bitstream of the video, obtain, for the current video block, a number of one or more merge candidates adjusted by using at least one MVD, the number of the one or more merge candidates depending on codec information of one or more additional video blocks of the video different from the current video block; as well as The converting is performed based on the number of the one or more merge candidates.
18. The method of claim 17, wherein the one or more additional video blocks comprises a parent video block of the current video block, the current video block being included in the parent video block.
19. The method of claim 17, wherein the one or more additional video blocks include a target ancestor video block among a plurality of ancestor video blocks of the current video block, the current video block being included in each of the plurality of ancestor video blocks, and a rate-distortion cost of the target ancestor video block being the smallest among the plurality of ancestor video blocks.
20. The method of any of claims 17-19, wherein the one or more additional video blocks comprise at least one neighboring video block of the current video block.
21. The method according to any one of claims 17-20, wherein an index of a first merge candidate among the one or more merge candidates is coded based on coding information of at least one neighboring video block of the current video block.
22. The method according to any one of claims 17 to 21, wherein the codec information comprises at least one of the following: The first indication whether to use affine mode, A second indication indicating whether to use MMVD, a third indication indicating whether to use affine MMVD; block size, or Quantization parameter.
23. The method of claim 22, wherein the first indication is an affine flag, the second indication is an MMVD flag, or the third indication is an affine MMVD flag.
24. The method of any one of claims 20-23, wherein the at least one neighboring video block comprises at least one of: The upper left neighboring video block of the current video block, The upper right neighboring video block of the current video block, The lower left neighboring video block of the current video block, a first left-neighboring video block of the current video block, the first left-neighboring video block being above the lower-left neighboring video block and below the upper-left neighboring video block, a second left-neighboring video block of the current video block, the second left-neighboring video block being above the first left-neighboring video block and below the upper left-neighboring video block, a first upper neighboring video block of the current video block, the first upper neighboring video block being to the left of the upper right neighboring video block and to the right of the upper left neighboring video block, or A second above-neighboring video block of the current video block is to the left of the first above-neighboring video block and to the right of the above-left neighboring video block.
25. The method according to any one of claims 21-24, wherein the index is encoded as one of: Truncated unary code, Binary code, Truncated binary code, Rice Code, Columbus code, or Exponential Columbus code.
26. The method of any one of claims 21-25, wherein the binary representation of the index is encoded as context-encoded binary bits or bypass-encoded binary bits.
27. The method of any of claims 21-26, wherein a context for encoding the index depends on the at least one neighboring video block.
28. The method according to any one of claims 17 to 27, wherein the number of the one or more merge candidates is determined at an encoder, and wherein obtaining the number of the one or more merge candidates include: The number of the one or more merge candidates is obtained from the bitstream.
29. The method according to any one of claims 17 and 20-21, wherein the number of the one or more merge candidates is obtained. include: Based on codec information of the one or more additional video blocks, a number of the one or more merge candidates is determined.
30. The method according to any one of claims 17 to 29, further comprising: include: A candidate list including the one or more merge candidates is determined.
31. The method of claim 30, wherein inherited affine merge candidates for the current video block are allowed to be added to the candidate list.
32. The method of any one of claims 30-31, wherein a maximum number of inherited affine merge candidates for the current video block that are allowed to be added to the candidate list is predetermined.
33. The method of claim 32, wherein the maximum number is an integer.
34. The method of claim 30, wherein a constructed affine merge candidate for the current video block is added to the candidate list.
35. The method of claim 30, wherein a uni-directional prediction candidate for the current video block is added first to the candidate list.
36. The method of claim 30, wherein at most N uni-directional prediction candidates for the current video block are added to first N positions of the candidate list, and N is an integer.
37. The method of claim 30, wherein merge candidates with different reference pictures are added to first M positions of the candidate list, and M is equal to the number of the merge candidates.
38. The method of claim 30, wherein the candidate list includes a first affine merge candidate, and if a control point motion vector (CPMV) of a second affine merge candidate is the same as that of the first affine merge candidate, the second affine merge candidate is not added to the candidate list.
39. The method of claim 30, wherein the candidate list includes a first affine merge candidate, and if a similarity measure between the CPMV of a second affine merge candidate and the CPMV of the first affine merge candidate is greater than a threshold, the second affine merge candidate is not added to the candidate list.
40. The method of any one of claims 17-39, wherein the current video block is encoded using an MMVD-based codec tool.
41. The method of claim 44, wherein the MMVD-based codec tool comprises at least one of the following: MMVD, Affine MMVD, Intra-block copy (IBC) MMVD, or Geometric Partitioning Mode (GPM) with MVD.
42. The method of any one of claims 40-41, wherein the shape of the template for a codec other than the MMVD-based codec is the same as at least one of: a shape of a template for reordering the MMVD candidates for the current video block, the shape of a template used to refine the MMVD candidates for the current video block, a shape of a template for updating the MMVD candidates for the current video block, A shape of a template for determining MMVD candidates for the current video block.
43. The method of any one of claims 40-41, wherein a shape of a template for a codec other than the MMVD-based codec is different from at least one of: a shape of a template for reordering the MMVD candidates for the current video block, the shape of a template for refining the MMVD candidates for the current video block, a shape of a template for updating the MMVD candidates for the current video block, A shape of a template for determining MMVD candidates for the current video block.
44. The method according to any one of claims 17 to 43, wherein performing the conversion include: Based on template matching (TM), updating a first position of a first merging candidate among the one or more merging candidates; as well as The converting is performed based on the updated first position.
45. The method of claim 44, wherein updating the first position include: setting the first position as a reference position; Iteratively perform the following at least once: determining a TM cost for the reference location and a set of candidate locations associated with the reference location; as well as If the candidate position with the lowest TM cost among the set of candidate positions is not the same as the reference position, updating the reference position using the candidate position; as well as The first position is updated using the reference position.
46. The method of claim 44, wherein updating the first position include: setting the first position as a reference position; Iteratively perform the following at least once: determining a TM cost for the reference location and a set of candidate locations associated with the reference location; as well as If the TM cost of a candidate position in the set of candidate positions is lower than a threshold, updating the reference position using the candidate position; as well as The first position is updated using the reference position.
47. The method of claim 46, wherein the threshold value depends on the TM cost of the reference location.
48. The method of any one of claims 45-47, wherein a distance between the reference position and each candidate position in the set of candidate positions is equal to a predetermined value.
49. The method of claim 44, wherein updating the first position include: setting the first position as a reference position; For each of the J rounds, iteratively perform the following at least once: determining a TM cost for the reference position and a set of candidate positions associated with the reference position, wherein a distance between the reference position and each candidate position in the set of candidate positions is equal to a predetermined value corresponding to a corresponding round; as well as If the candidate position with the lowest TM cost in the set of candidate positions is not the same as the reference position, updating the reference position with the candidate position; and updating the first position using the reference position, Where J is an integer.
50. The method of claim 49, wherein the distance is equal to a first predetermined value in a first round of the J rounds, the distance is equal to a second predetermined value in a second round of the J rounds, the second round is performed after the first round, and the second predetermined value is less than the first predetermined value.
51. The method of any one of claims 45-50, wherein the set of candidate locations comprises at least one of: The position above the reference position, The position below the reference position, a position to the left of the reference position, or A position to the right of the reference position.
52. The method of any one of claims 45-51, wherein execution of the iteration is terminated after a predetermined number of executions.
53. The method according to any one of claims 45-52, wherein if the number of candidate positions searched is greater than or not less than a threshold, the execution of the iteration is terminated.
54. The method of any one of claims 1-53, wherein the converting comprises encoding the current video block into the bitstream.
55. The method of any one of claims 1-53, wherein the converting comprises decoding the current video block from the bitstream.
56. An apparatus for video processing, comprising a processor and a non-volatile 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-55.
57. A non-transitory computer-readable storage medium storing instructions for causing a processor to execute the method according to any one of claims 1-55.
58. A non-transitory computer-readable recording medium storing a bit stream of a video generated by a method performed by an apparatus for video processing, wherein the method include: selecting a target solution from a plurality of candidate solutions for adjusting a merge candidate for a current video block of the video; as well as generating the bitstream based on the target scheme, wherein the plurality of candidate solutions include at least one of a first group of candidate solutions and a second group of candidate solutions, In each candidate solution of the first set of candidate solutions, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted, In each candidate solution in the second set of candidate solutions, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
59. A method for storing a bit stream of a video, include: selecting a target solution from a plurality of candidate solutions for adjusting a merge candidate for a current video block of the video; generating the bitstream based on the target scheme; as well as storing the bitstream in a non-transitory computer-readable recording medium, wherein the plurality of candidate solutions include at least one of a first group of candidate solutions and a second group of candidate solutions, In each candidate solution of the first set of candidate solutions, a first motion vector (MV) of the merge candidate is adjusted using a first motion vector difference (MVD), and a second MV of the merge candidate remains unadjusted; In each candidate solution in the second set of candidate solutions, the second MV is adjusted using a second MVD, and the first MV remains unadjusted.
60. A non-transitory computer-readable recording medium storing a bit stream of a video generated by a method performed by an apparatus for video processing, wherein the method include: Obtaining, for a current video block of the video, a number of one or more merge candidates adjusted using at least one MVD, the number of the one or more merge candidates depending on codec information of one or more additional video blocks of the video different from the current video block; as well as The bitstream is generated based on the number of the one or more merge candidates.
61. A method for storing a bit stream of a video, include: Obtaining, for a current video block of the video, a number of one or more merge candidates adjusted using at least one MVD, the number of the one or more merge candidates depending on codec information of one or more additional video blocks of the video different from the current video block; generating the bitstream based on the number of the one or more merge candidates; as well as The bit stream is stored in a non-transitory computer-readable recording medium.
