Method and device for video processing and medium

By determining and updating motion information with constraints and using sample reordering tools, the method addresses low efficiency in conventional video encoding and decoding, resulting in enhanced coding efficiency and effectiveness.

CN119156821APending Publication Date: 2024-12-17DOUYIN VISION CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380032624.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-04-05
Filing Date
2023-04-03
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Conventional video encoding and decoding technologies suffer from low encoding and decoding efficiency, which is undesirable for digital video applications.

Method used

A method for video processing that involves determining motion information of a current video block and updating it based on a constraint, as well as using a sample reordering tool to improve coding efficiency and effectiveness.

Benefits of technology

The proposed method enhances coding efficiency and effectiveness by updating motion information and utilizing sample reordering tools, leading to improved video processing outcomes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119156821A_ABST
    Figure CN119156821A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a solution for video processing. A method for video processing is presented. The method comprises the following steps: for conversion between a current video block of a video and a bit stream of the video, determining motion information of the current video block; updating the motion information based on a constraint indicating a target value of a component of the motion information; and performing a conversion based on the updated motion information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate generally to video coding techniques, and more particularly, to motion information determination utilizing constraints. Background Art

[0002] Nowadays, digital video capabilities are being applied to all aspects of people's lives. Various types of video compression technologies, 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 have been proposed for video encoding / decoding. However, the encoding and decoding efficiency of conventional video encoding and decoding technologies is generally low, which is undesirable. Summary of the invention

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

[0004] In a first aspect, a method for video processing is proposed. The method includes: determining motion information of a current video block for a conversion between a current video block of a video and a bitstream of the video; updating the motion information based on a constraint, the constraint indicating a target value of a component of the motion information; and performing the conversion based on the updated motion information. The method according to the first aspect of the present disclosure updates the motion information based on the constraint, thereby improving the coding efficiency and coding effectiveness.

[0005] In a second aspect, another method for video processing is proposed. The method includes: for conversion between a current video block of a video and a bitstream of the video, based on a sample reordering tool for the current video block, determining information of at least one sample associated with the current video block; and performing conversion based on the information. The method according to the second aspect of the present disclosure determines the information of the sample based on the sample reordering tool, and thus can improve the coding efficiency and coding effectiveness.

[0006] 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 or second aspect of the present disclosure.

[0007] 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 or second aspect of the present disclosure.

[0008] In a fifth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: determining motion information of a current video block of the video; updating the motion information based on a constraint, the constraint indicating a target value of a component of the motion information; and generating a bitstream based on the updated motion information.

[0009] In a sixth aspect, a method for storing a bitstream of a video is provided. The method includes: determining motion information of a current video block of the video; updating the motion information based on a constraint, the constraint indicating a target value of a component of the motion information; generating a bitstream based on the updated motion information; and storing the bitstream in a non-transitory computer-readable recording medium.

[0010] 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 video processing device. The method includes determining information of at least one sample associated with a current video block based on a sample reordering tool for a current video block of the video; and generating a bitstream based on the information.

[0011] In an eighth aspect, a method for storing a bitstream of a video is provided. The method includes: determining information of at least one sample associated with a current video block based on a sample reordering tool for a current video block of the video; generating a bitstream based on the information; and storing the bitstream in a non-transitory computer-readable recording medium.

[0012] This disclosure is provided to introduce a selection of concepts in a simplified form, which are further described below in the Detailed Description. This disclosure 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

[0013] 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.

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

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

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

[0017] FIG. 4A to FIG. 4D The current CTU processing order and the available samples in the current CTU and the left CTU are shown respectively;

[0018] Figure 5 The transform skip residual encoding and decoding process is shown;

[0019] Figure 6 An example of a block encoded and decoded in palette mode is shown;

[0020] Figure 7 An example sub-block based index map scan for a palette is shown, on the left for horizontal scanning and on the right for vertical scanning;

[0021] Figure 8 An example decoding flow chart with ACT is shown;

[0022] Fig. 9 shows an example intra-frame template matching search area used;

[0023] Fig.10 A flowchart of a method for video processing according to some embodiments of the present disclosure is shown;

[0024] Fig.11 Another flow chart showing a method for video processing according to some embodiments of the present disclosure; and

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

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

[0027] The principles of the present disclosure are now described in conjunction with 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, and do not imply 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.

[0028] In the following description and claims, unless defined otherwise, 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.

[0029] 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.

[0030] 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.

[0031] 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 "including", "comprising", 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

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

[0033] 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.

[0034] 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 coded pictures and associated data. The coded pictures are coded representations of pictures. The associated data may include sequence parameter sets, picture parameter sets, 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.

[0035] 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.

[0036] 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.

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

[0038] 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.

[0039] 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 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.

[0040] 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.

[0041] 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.

[0042] 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.

[0043] The mode selection unit 203 may select one of a plurality of codec modes (intra-frame coding or inter-frame coding), for example, based on the error result, and provide the generated intra-frame codec block or inter-frame codec block to the residual generation unit 207 to generate residual block data, and to the reconstruction unit 212 to reconstruct the codec block for use as a reference picture. In some examples, the mode selection unit 203 may select a combination of intra-frame and inter-frame prediction (CIIP) modes, where the prediction is based on an inter-frame prediction signal and an intra-frame prediction signal. In the case of inter-frame 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.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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 signal motion information of a current video block with reference to motion information of another video block. For example, motion estimation unit 204 may determine that motion information of a current video block is sufficiently similar to motion information of a neighboring video block.

[0049] 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.

[0050] 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.

[0051] 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.

[0052] 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.

[0053] 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.

[0054] 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.

[0055] 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.

[0056] 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.

[0057] 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.

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

[0059] 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.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] 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 and decoded video data, and the motion compensation unit 302 can determine motion information from the entropy decoded 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 adjacent in the spatial or temporal domain.

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

[0065] The motion compensation unit 302 may calculate interpolated 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.

[0066] 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-frame coding 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, signal prediction, and residual signal reconstruction. A slice may be an entire picture, or it may be a region of a picture.

[0067] 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.

[0068] 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.

[0069] 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 codec technologies. In addition, although some embodiments describe the video coding and decoding steps in detail, it should be understood that the corresponding decoding steps of the uncoding 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 coding technology. Specifically, the present disclosure is about prediction, signaling and reordering of samples in image / video coding. It can be applied to existing video coding standards such as HEVC, VVC, etc. It can also be applied to future video coding standards or video codecs. 2. Introduction Video codec standards have evolved primarily through the development of the well-known ITU-T and ISO / IEC standards. ITU-T developed H.261 and H.263, ISO / IEC developed MPEG-1 and MPEG-4 Visual, and the two organizations jointly developed 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 have been based on a hybrid video codec structure, in which temporal prediction plus transform codec is used. In order to explore future video codec technologies beyond HEVC, VCEG and MPEG jointly founded the Joint Video Exploration Team (JVET) in 2015. JVET meetings are held simultaneously every quarter, and the new video codec standard was officially named Versatile Video Codec (VVC) at the JVET meeting in April 2018, when the first version of the VVC Test Model (VTM) was released. The VVC working draft and the test model VTM are updated after each meeting. The VVC project achieved technical completion (FDIS) at the July 2020 meeting. 2.1 Existing screen content encoding and decoding tools 2.1.1 Intra-block copy (IBC) Intra-block copy (IBC) is a tool adopted in the HEVC extension on SCC. It is well known that it significantly improves the coding efficiency of screen content materials. Since the IBC mode is implemented as a block-level coding mode, block matching (BM) is performed at the encoder to find the best block vector (or motion vector) for each CU. Here, the block vector is used to indicate the displacement from the current block to the reference block, which has been reconstructed within the current picture. The luminance block vector of the IBC-encoded CU has integer precision. The chrominance block vector is also rounded to integer precision. When used in conjunction with AMVR, the IBC mode can switch between 1-pixel and 4-pixel motion vector precision. The IBC-encoded CU is regarded as a third prediction mode in addition to the intra or inter prediction mode. The IBC mode is applicable to CUs with a width and height that are both less than or equal to 64 luminance samples. On the encoder side, hash-based motion estimation is performed for IBC. The encoder performs RD checks on blocks with width or height no greater than 16 luma samples. For non-merge mode, a block vector search is first performed using a hash-based search. If the hash search does not return a valid candidate, a local search based on block matching is performed. In hash-based search, the hash key matching (32-bit CRC) between the current block and the reference blocks is extended to all allowed block sizes. The hash key calculation for each position in the current picture is based on 4×4 sub-blocks. For current blocks of larger size, the hash key is determined to match the hash key of the reference block when all hash keys in all 4×4 sub-blocks match the hash keys in the corresponding reference positions. If the hash keys of multiple reference blocks are found to match the hash key of the current block, the block vector cost of each matching reference is calculated and the one with the minimum cost is selected. In the block matching search, the search range is set to cover the previous CTU and the current CTU. At the CU level, the IBC mode is signaled through a flag, which can be signaled as IBC AMVP mode or IBC Skip / Merge mode as shown below: – IBC skip / merge mode: The merge candidate index is used to indicate which block vector from the list of neighboring candidate IBC codec blocks is used to predict the current block. The merge list includes spatial candidates, HMVP candidates, and pairwise candidates. – IBC AMVP mode: Block vector differences are encoded and decoded in the same way as motion vector differences. The block vector prediction method uses two candidates as predictors, one from the left neighbor and one from the top neighbor (if IBC coded). When either neighbor is not available, the default block vector is used as predictor. A flag is signaled to indicate the block vector predictor index. 2.1.1.1 IBC Reference Area To reduce memory consumption and decoder complexity, IBC in VVC only allows reconstructed portions of predefined areas, which include areas of the current CTU and some areas of the left CTU. FIG. 4A to FIG. 4D Example graphs 410 , 430 , 450 , and 470 of reference regions for the IBC mode are shown, where each block represents a 64×64 luma sample unit, respectively. FIG. 4A to FIG. 4D The current CTU processing order and its available reference samples in the current and left CTUs are shown. Depending on the location of the current codec CU position within the current CTU, the following applies: – If the current block falls into the 64×64 block to the upper left of the current CTU, in addition to the reconstructed samples in the current CTU, the CPR mode can be used to refer to the reference samples in the lower right 64x64 block of the left CTU. The current block can also use the CPR mode to refer to the reference samples in the lower left 64×64 block of the left CTU and the reference samples in the upper right 64×64 block of the left CTU. –If the current block falls into the 64×64 block to the upper right of the current CTU, in addition to the samples that have been reconstructed in the current CTU, if the luma position (0, 64) relative to the current CTU has not been reconstructed, the current block can also use the CPR mode and refer to the reference samples in the lower left 64×64 block and the lower right 64×64 block of the left CTU; otherwise, the current block can also refer to the reference samples in the lower right 64×64 block of the left CTU. – If the current block falls into the 64×64 block at the lower left of the current CTU, in addition to the samples that have been reconstructed in the current CTU, if the luma position (64, 0) relative to the current CTU has not been reconstructed, the current block can also use the CPR mode to refer to the reference samples in the upper right 64×64 block and the lower right 64×64 block of the left CTU. Otherwise, the current block can also use the CPR mode to refer to the reference samples in the lower right 64×64 block of the left CTU. – If the current block falls into the 64×64 block to the lower right of the current CTU, only the CPR mode can be used, referring to the reconstructed samples in the current CTU. This restriction allows the IBC mode to be implemented using local on-chip memory for hardware implementation. 2.1.1.2 Interaction between IBC and other codecs The interaction between IBC mode and other inter-frame codec tools in VVC, such as pairwise merge candidates, history-based motion vector predictor (HMVP), combined intra / frame prediction modes (CIIP), merge mode with motion vector difference (MMVD), and geometric partition model (GPM), is as follows: – IBC can be used with pairwise merge candidates and HMVP. A new pairwise IBC merge candidate can be generated by averaging two IBC merge candidates. For HMVP, IBC motions are inserted into the history buffer for future reference. – IBC cannot be used in conjunction with the following interframe tools: Affine Motion, CIIP, MMVD, and GPM. – When DUAL_TREE partitioning is used, IBC is not allowed for chroma codec blocks. Unlike in the HEVC screen content codec extension, the current picture is no longer included as a reference picture in reference picture list 0 for IBC prediction. The motion vector derivation process in IBC mode excludes all neighboring blocks in inter mode and vice versa. The following IBC design aspects are applied: – IBC shares the same process as regular MV merging, including pairwise merging candidates and history-based motion predictors, but TMVP and zero vectors are not allowed since they are invalid for IBC mode. – Separate HMVP buffers (5 candidates each) for regular MV and IBC. – Block vector constraints are implemented as bitstream consistency constraints, where the encoder needs to ensure that there are no invalid vectors in the bitstream and that merges should not be used if the merge candidate is invalid (out of range or 0). This bitstream consistency constraint is represented by a virtual buffer as described below. – For deblocking, IBC is handled as an inter mode. – If the current block is coded using IBC prediction mode, AMVR does not use quarter pixels; instead, AMVR is signaled to only indicate whether the MV is inter pixels or 4 integer pixels. - The number of IBC merge candidates may be signaled in the slice header separately from the number of normal, sub-block and geometric merge candidates. The concept of virtual buffer is used to describe the allowable reference area of ​​IBC prediction mode and valid block vector. The CTU size is expressed as ctbSize, and the width of the virtual buffer ibcBuf is wIbcBuf = 128 × 128 / ctbSize, and the height hIbcBuf = ctbSize. For example, for a CTU size of 128 × 128, the size of ibcBuf is also 128 × 128; for a CTU size of 64 × 64, the size of ibcBuf is 256 × 64; for a CTU size of 32 × 32, the size of ibcBuf is 512 × 32. The size of each dimension of VPDU is min(ctbSize,64), W v =min(ctbSize,64). The virtual IBC buffer ibcBuf is maintained as follows. – At the start of decoding each CTU line, flush the entire ibcBuf with invalid value -1. – When starting to decode the VPDU (xVPDU, yVPDU) relative to the upper left corner of the picture, set ibcBuf[x][y] = -1, where x = xVPDU% wIbcBuf, ..., xVPDU% wIbcBuf + Wv-1; y = yVPDU%ctbSize,…,yVPDU%ctbSize+Wv-1. –After decoding, the CU contains the (x,y) relative to the upper left corner of the picture, set ibcBuf[x%wIbcBuf][y%ctbSize]=recSample[x][y] For a block covering coordinates (x, y), if the following holds for the block vector bv = (bv[0], bv[1]), then it is valid; otherwise, it is invalid: ibcBuf[(x+bv[0])%wIbcBuf][(y+bv[1])%ctbSize] should not be equal to -1. 2.1.2 Block Differential Pulse Coded Modulation (BDPCM) VVC supports Block Differential Pulse Coded Modulation (BDPCM) for picture content coding and decoding. At the sequence level, the BDPCM enable flag is signaled in the SPS; this flag is signaled only when transform skip mode (described in the next section) is enabled in the SPS. When BDPCM is enabled, if the CU size is less than or equal to MaxTsSize×MaxTsSize in terms of luma samples and if the CU is intra-coded, a flag is sent at the CU level, where MaxTsSize is the maximum block size allowed for transform skip mode. This flag indicates whether conventional intra-coding or BDPCM is used. If BDPCM is used, the BDPCM prediction direction flag is sent to indicate whether the prediction is horizontal or vertical. The block is then predicted using a conventional horizontal or vertical intra prediction process with unfiltered reference samples. The residuals are quantized, and the difference between each quantized residual and its predicted value, i.e., the previously coded residual of a neighboring position horizontally or vertically (depending on the BDPCM prediction direction), is coded. For a block of size M (height) × N (width), let r i,j ,0≤i≤M-1,0≤j≤N-1 is the prediction residual. Let Q(r i,j ), 0≤i≤M-1,0≤j≤N-1 represents the residual r i,j BDPCM is applied to the quantized residual values, resulting in a quantized version of The modified M×N array in is predicted from its neighboring quantized residual values. For vertical BDPCM prediction mode, for 0≤j≤(N-1), the following is used to derive For the horizontal BDPCM prediction mode, for 0≤j≤(N-1), the following is used to derive On the decoder side, the above process is reversed to calculate Q( r i ,j ), 0≤i≤M-1,0≤j≤N-1, as follows: Dequantized residual Q -1 (Q(r i,j )) is added to the intra block prediction value to produce the reconstructed sample value. The predicted quantized residual value is converted to Sent to the decoder. For lossless codec, if slice_ts_residual_coding_disabled_flag is set to 1, the quantized residual values ​​are sent to the decoder using conventional transform residual codec as described in 2.2.2. For MPM modes for future intra-mode codecs, if the BDPCM prediction direction is horizontal or vertical, respectively, the horizontal or vertical prediction mode is stored for the BDPCM-coded CU, respectively. For deblocking, if the two blocks on both sides of the block boundary are coded and decoded using BDPCM, then the specific block boundary is not deblocked. 2.1.3 Residual Codec for Transform Skip Mode VVC allows transform skip mode for luma blocks of size up to MaxTsSize×MaxTsSize, where the value of MaxTsSize is signaled in the PPS and can be at most 32. When a CU is encoded and decoded in transform skip mode, its prediction residual is quantized and encoded using the transform skip residual encoding and decoding process. This process is modified from the transform coefficient encoding and decoding process described in 2.2.2. In transform skip mode, the residual of the TU is also encoded and decoded in units of non-overlapping sub-blocks of size 4×4. For better coding efficiency, some modifications are made to customize the residual coding and decoding process to the residual signal characteristics. The following summarizes the differences between transform skip residual coding and conventional transform residual coding: - A forward scan order is applied to scan sub-blocks within a transformed block and also scan positions within the sub-blocks; – no signaling of the final (x,y) position; – When all previous flags are equal to 0, coded_sub_block_flag is coded and decoded for each sub-block except the last sub-block; –sig_coeff_flag context modeling uses a simplified template, and the context model of sig_coeff_flag Depends on top and left neighboring values; – The context model of the abs_level_gt1 flag also depends on the left sig_coeff_flag value and the upper sig_coeff_flag value; – par_level_flag to use only one context model; – Additional more than 3, 5, 7, 9 flags are signaled to indicate coefficient levels, a context for A logo; – Rice parameter derivation with fixed order = 1 for binarization of the remainder values; - Determine the context model for the sign flag based on the left and above neighbor values, and parse the sign flag after sig_coeff_flag to keep all context-decoded bins together. For each subblock, if coded_subblock_flag is equal to 1 (i.e., there is at least one non-zero quantized residual in the subblock), encoding and decoding of the quantized residual level is performed in three scanning passes (see Figure 5 ): – First scan pass: Encode and decode the validity flag (sig_coeff_flag), the sign flag (coeff_sign_flag), the absolute level greater than 1 flag (abs_level_gtx_flag[0]), and the parity check (par_level_flag). For a given scan position, if sig_coeff_flag is equal to 1, then coeff_sign_flag is encoded and decoded, followed by abs_level_gtx_flag[0] (which specifies whether the absolute level is greater than 1). If abs_level_gtx_flag[0] is equal to 1, then the coeff_sign_flag is encoded and decoded, followed by abs_level_gtx_flag[0] (which specifies whether the absolute level is greater than 1). If equal to 1, par_level_flag is additionally encoded to specify the absolute level parity. – Scan pass greater than x: For each scan position where the absolute level is greater than 1, up to four abs_level_gtx_flag[i] are encoded for i=1...4 to indicate whether the absolute level at the given position is greater than 3, 5, 7 or 9, respectively. – Remainder scan pass: The remainder of the absolute level abs_remainder is encoded and decoded in bypass mode. The absolute level remainder is binarized using a fixed Rice parameter value of 1. The bins in scan passes #1 and #2 (the first scan pass and greater than x scan passes) are context-decoded until the maximum number of context-decoded bins in the TU has been exhausted. The maximum number of context-decoded bins in the residual block is limited to 1.75×block_width×block_height, or equivalently, an average of 1.75 context-decoded bins per sample position. The bins in the last scan pass (the remaining scan passes) are bypass-decoded. The variable RemCbs is first set to the maximum number of context-decoded bins of the block and is decremented by 1 each time a context-decoded bin is decoded. When RemCcbs is greater than or equal to 4, the context-decoded bins are used to encode and decode the syntax elements including sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, and par_level_flag in the first codec pass. If RemCcbs becomes less than 4 when encoding the first pass, the remaining coefficients that have not been encoded in the first pass are encoded in the remainder scanning pass (pass#3). After the first pass of encoding and decoding is completed, if RemCcbs is greater than or equal to 4, the syntax elements in the second encoding and decoding pass including abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, and abs_level_gt9_flag are encoded and decoded using the binary bits encoded by the context. If RemCcbs becomes less than 4 when encoding and decoding the second pass, the remaining coefficients that have not been encoded and decoded in the second pass are encoded and decoded in the remainder scan pass (pass#3). Figure 5 The transform skip residual coding process is shown. The stars mark the positions where the context coded bits are exhausted, at which point all remaining bits are coded using bypass coding. In addition, for blocks that are not encoded in BDPCM mode, a level mapping mechanism is applied to transform skip residual encoding until the maximum number of context encoded bins has been reached. Level mapping uses the top and left neighboring coefficient levels to predict the current coefficient level in order to reduce signaling cost. For a given residual position, denote absCoeff as the absolute coefficient level before mapping, and absCoeffMod as the coefficient level after mapping. Let X0 denote the absolute coefficient level of the left neighboring position, and let X1 denote the absolute coefficient level of the upper neighboring position. Level mapping is performed as follows: The absCoeffMod value is then encoded as described above.After all context-decoded bins have been exhausted, level mapping is disabled for all remaining scan positions in the current block. 2.1.4 Palette Mode In VVC, palette mode is used for picture content encoding and decoding in all chroma formats supported in the 4:4:4 profile (i.e., 4:4:4, 4:2:0, 4:2:2, and monochrome). When palette mode is enabled, if the CU size is less than or equal to 64×64, a flag is sent at the CU level, and the amount of samples in the CU is greater than 16 to indicate whether palette mode is used. Considering that applying palette mode on small CUs introduces insignificant codec gain and brings additional complexity on small blocks, palette mode is disabled for CUs less than or equal to 16 samples. A palette-encoded codec unit (CU) is treated as a prediction mode different from intra-prediction, inter-prediction, and intra-block copy (IBC) modes. If palette mode is used, the sample values ​​in a CU are represented by a set of representative color values. This set is called a palette. For positions with sample values ​​close to the palette colors, the palette index is signaled. Samples outside the palette can also be specified by signaling escape symbols. For samples within a CU coded with escape symbols, their component values ​​are directly signaled using (possibly) quantized component values. This is done in Figure 6 Shown in . Figure 6 An example diagram 600 of a block being encoded and decoded in palette mode is shown. The quantized escaped symbols are binarized using a fifth order exponential Golomb binarization process (EG5). For palette encoding and decoding, the palette predictor is maintained. For the non-wavefront case, the palette predictor is initialized to 0 at the beginning of each stripe. For the WPP case, the palette predictor at the beginning of each CTU row is initialized to the predictor derived from the first CTU in the previous CTU row, so that the initialization scheme between the palette predictor and the CABAC synchronization is unified. For each entry in the palette predictor, a reuse flag is signaled to indicate whether it is part of the current palette in the CU. The reuse flag is sent using a run length codec of zero. Thereafter, the number of new palette entries and the component values ​​of the new palette entries are signaled. After encoding and decoding a palette-encoded CU, the palette predictor will be updated with the current palette, and entries from the previous palette predictor that are not reused in the current palette will be added to the end of the new palette predictor until the maximum allowed size is reached. An escape flag is signaled for each CU to indicate whether there is an escape symbol in the current CU. If there is an escape symbol, the palette table is expanded by one and the last index is assigned as the escape symbol. In a manner similar to the coefficient groups (CGs) used in transform coefficient coding, a CU coded with palette mode is divided into multiple line-based coefficient groups, each consisting of m samples (i.e., m=16), where the index run of the escape mode, the palette index value, and the quantized color are encoded / parsed sequentially for each CG. As in HEVC, horizontal or vertical traversal scanning can be applied to scan samples, such as Figure 7 as shown in . Figure 7 A schematic diagram 700 of a sub-block based index map scan for a palette is shown, on the left for horizontal scanning, and on the right for vertical scanning. The encoding and decoding order for palette run-length encoding and decoding in each segment is as follows: For each sample position, a context-coded binary bit run_copy_flag=0 is signaled to indicate whether the pixel has the same mode as the previous sample position, that is, whether the previously scanned sample and the current sample are both run-length type COPY_ABOVE, or whether the previously scanned sample and the current sample are both run-length type INDEX and the same index value. Otherwise, run_copy_flag=1 is signaled. If the current sample has a different mode than the previous sample, then a context-coded binary bit copy_above_palette_indices_flag is signaled to indicate the run-length type of the current sample, that is, INDEX or COPY_ABOVE. Here, if the sample is in the first row (horizontal traversal scan) or the first column (vertical traversal scan), the decoder does not have to parse the run-length type because the INDEX mode is used by default. In the same way, if the previously parsed run type is COPY_ABOVE, the decoder does not have to parse the run type. After palette run-decoding of samples in one codec pass, index values ​​(for INDEX mode) and quantized escape colors are grouped and decoded using CABAC bypass codec in another codec pass. This separation of context-decoded bins and bypass-decoded bins can improve throughput within each line CG. For slices with dual luma / chroma trees, the palette is applied separately for luma (Y component) and chroma (Cb and Cr components), where the luma palette entries contain only Y values, and the chroma palette entries contain both Cb and Cr values. For slices with a single tree, the palette is applied jointly on the Y, Cb, Cr components, i.e., each entry in the palette contains Y, Cb, Cr values, unless when a CU is encoded using local dual-tree encoding, in which case the encoding and decoding of luma and chroma are handled separately. In this case, if the corresponding luma blocks or chroma blocks are encoded using palette mode, their palettes are applied in a manner similar to the dual-tree case (this is related to non-4:4:4 encoding and will be further explained in 2.1.4.1). For slices decoded with dual-tree codec, the maximum palette predictor size is 63, and the maximum palette table size for the codec of the current CU is 31. For slices decoded with dual-tree codec, the maximum predictor and palette table sizes are halved, i.e., for each of the luma palette and chroma palette, the maximum predictor size is 31 and the maximum table size is 15. For deblocking, palette-coded blocks on the side of a block boundary are not deblocked. 2.1.4.1 Palette Mode for Non-4:4:4 Content The palette modes in VVC are supported for all chroma formats in a similar way as the palette modes in HEVC SCC. For non-4:4:4 content, the following customizations apply: 1. When signaling an escape value for a given sample position, if that sample position has only luma components but no chroma components due to chroma subsampling, then only the luma escape value is signaled. This is the same as in HEVCSCC. 2. For local dual-tree blocks, the palette mode is applied to the block in the same way as the palette mode applied to single-tree blocks with two exceptions: a. The process of updating the palette predictor is slightly modified as follows. Since the local dual-tree block only contains brightness (or chrominance) component, so the predictor update process uses the signaled value of the luma (or chroma) component and fills in the “missing” by setting it to a default value (1<<(component bit depth - 1)). Chroma (or luminance) component. b. The maximum palette predictor size remains at 63 (since a single tree is used to encode and decode the slices), but the maximum palette table size for luma / chroma blocks remains at 15 (since separate palettes are used to encode and decode the blocks). 3. For the palette mode of monochrome format, the number of color components in the palette codec block is set to 1 instead of 3. 2.1.4.2 Encoder Algorithm for Palette Mode On the encoder side, the following steps are used to generate the palette table of the current CU. 1. First, in order to derive the initial entries in the palette table of the current CU, a simplified K-means clustering is applied. The palette table of the current CU is initialized to an empty table. For each sample position in the CU, the SAD between this sample and each palette table entry is calculated, and the minimum SAD among all palette table entries is obtained. If the minimum SAD is less than the predefined error limit errorLimit, the current sample is clustered with the palette table entry with the minimum SAD. Otherwise, a new palette table entry is created. The threshold errorLimit is QP-related and is retrieved from a lookup table containing 57 elements covering the entire QP range. After all samples of the current CU have been processed, the initial palette entries are sorted according to the number of samples clustered with each palette entry, and any entries after the 31st entry are discarded. 2. In the second step, the initial palette table colors are adjusted by considering two options: using the centroid of each cluster from step 1 or using one of the palette colors in the palette predictor. The option with the lower rate-distortion cost is selected as the final color of the palette table. If a cluster has only a single sample and the corresponding palette entry is not in the palette predictor, the corresponding sample is converted to an escape symbol in the next step. 3. The palette table thus generated contains some new entries from the centroids of the clusters in step 1, and some entries from the palette predictor. Therefore, the table is reordered again so that all new entries (i.e., centroids) are placed at the beginning of the table, followed by entries from the palette predictor. Given the palette table of the current CU, the encoder selects the palette index for each sample position in the CU. For each sample position, the encoder checks the RD cost of all index values ​​corresponding to the palette table entry, as well as the index representing the escape symbol, and selects the index with the minimum RD cost using the following equation: RD cost = distortion × (isChroma? 0.8 : 1) + lambda × bypass codedbits (2-5) After determining the index map for the current CU, each entry in the palette table is checked to see if it is used by at least one sample position in the CU. Any unused palette entry will be removed. After deciding the index map of the current CU, a grid RD optimization is applied to find the best value of run_copy_flag and run type for each sample position by comparing the RD costs of three options: same as the previously scanned position, run type COPY_ABOVE, or run type INDEX. When calculating the SAD value, the sample values ​​are scaled down to 8 bits unless the CU is encoded or decoded in lossless mode, in which case the actual input bit depth is used to calculate the SAD. In addition, in the case of lossless codecs, only the rate is used in the above rate-distortion optimization step (because lossless codecs do not cause distortion). 2.1.5 Adaptive Color Transformation In the HEVC SCC extension, Adaptive Color Transform (ACT) is applied to reduce the redundancy between the three color components in the 444 chroma format. ACT is also adopted in the VVC standard to enhance the codec efficiency of the 444 chroma format codec. As in HEVC SCC, ACT performs in-loop color space conversion in the prediction residual domain by adaptively converting the residual from the input color space to the YCgCo space. Figure 8A decoding flow chart 800 applying ACT is shown. Two color spaces are adaptively selected by signaling an ACT flag at the CU level. When the flag is equal to 1, the residual of the CU is encoded and decoded in the YCgCo space; otherwise, the residual of the CU is encoded and decoded in the original color space. In addition, similar to the HEVCACT design, for inter-frame and IBcCU, ACT is enabled only when there is at least one non-zero coefficient in the CU. ACT is only enabled when the chroma component selects the same intra-frame prediction mode of the luminance component (i.e., DM mode). 2.1.5.1ACT Mode In the HEVC SCC extension, ACT supports both lossless and lossy codecs based on the lossless flag (i.e., cu_transquant_bypass_flag). However, there is no flag in the bitstream to indicate whether lossy or lossless codec is applied. Therefore, the YCgCo-R transform is applied as ACT to support both lossy and lossless cases. The YCgCo-R reversible color transform is shown below. Since the YCgCo-R transform is not normalized. In order to compensate for the dynamic range change of the residual signal before and after the color transform, the QP adjustment of (-5, 1, 3) is applied to the transform residuals of the Y, Cg and Co components respectively. The adjusted quantization parameter only affects the quantization and inverse quantization of the residual in the CU. For other encoding and decoding processes (such as deblocking), the original QP is still applied. Additionally, because the forward and inverse color transforms require access to the residuals of all three components, ACT mode is always disabled for split tree partitioning and ISP mode, where the prediction block sizes for different color components are different. When ACT is applied, transform skip (TS) and block differential pulse coded modulation (BDPCM) extended to code chroma residuals are also enabled. 2.1.5.2 ACT Fast Encoding Algorithm To avoid brute force RD searches in both the original and converted color spaces, the following fast encoding algorithm is applied in the VTM reference software to reduce encoder complexity when ACT is enabled. – The order of RD checking for enabling / disabling ACT depends on the original color space of the input video. For RGB video, RD cost for ACT mode is checked first; for YCbCr video, RD cost for non-ACT mode is checked first. RD cost for the second color space is checked only if there is at least one non-zero coefficient in the first color space. – When a CU is obtained through different partitioning paths, the same ACT enable / disable decision is reused. Specifically, when the CU is encoded and decoded for the first time, the selected color space used to encode and decode the residual of a CU will be stored. Then, when the same CU is obtained by another partitioning path, the stored color space decision will be reused directly without checking the RD cost of the two spaces. – The RD cost of the parent CU is used to decide whether to check the RD cost of the second color space of the current CU. For example, if the RD cost of the first color space is less than the RD cost of the second color space for the parent CU, the second color space is not checked for the current CU. – To reduce the number of tested codec modes, the selected codec modes are shared between the two color spaces. Specifically, for intra mode, the pre-selected intra mode candidates according to SATD-based intra mode selection are shared between the two color spaces. For inter and IBC modes, only one block vector search or motion estimation is performed. Block vectors and motion vectors are shared by both color spaces. 2.1.6 Intra-frame template matching Intra Template Matching Prediction (Intra TMP) is a special intra prediction mode that copies the best prediction block from the reconstructed part of the current frame, whose L-shaped template matches the current template. For a predefined search range, the encoder searches for the template that is most similar to the current template in the reconstructed part of the current frame and uses the corresponding block as the prediction block. The encoder then signals the use of this mode and performs the same prediction operation on the decoder side. Fig. 9 A schematic diagram 900 illustrating the intra-frame template matching region used is shown. By comparing the L-shaped causal neighborhood of the current block with Fig. 9 The prediction signal is generated by matching another block in a predefined search area in the image to generate a prediction signal, the predefined search area including: R1: current CTU, R2: Upper left CTU, R3: Above CTU, R4: Left CTU. SAD is used as the cost function. In each region, the decoder searches for the template with the minimum SAD relative to the current region and uses its corresponding block as the prediction block. The size of all regions (Search Range_w, SearchRange_h) is proportional to the block size (BlkW, BlkH) with a fixed number of SADs per pixel. That is: SearchRange_w = a*BlkW, SearchRange_h=a*BlkH. Where 'a' is a constant that controls the gain / complexity tradeoff. In practice, 'a' is equal to 5. The intra template matching tool is enabled on width and height for CUs of size less than or equal to 64. The maximum CU size for intra template matching is configurable. When DIMD is not used for the current CU, the intra template matching prediction mode is signaled at the CU level through a dedicated flag. 2.2 Adaptive Motion Vector Resolution (AMVR) In HEVC, when use_integer_mv_flag in the slice header is equal to 0, the motion vector difference (MVD) (between the motion vector of the CU and the predicted motion vector) is signaled in units of quarter luma samples. In VVC, a CU-level adaptive motion vector resolution (AMVR) scheme is introduced. AMVR allows the MVD of a CU to be encoded and decoded with different precisions. Depending on the mode for the current CU (normal AMVP mode or affine AVMP mode), the MVD of the current CU can be adaptively selected as follows: – Normal AMVP mode: quarter-brightness-sample, half-brightness-sample, whole-brightness-sample or quad-brightness-sample. – Affine AMVP modes: quarter-luminance-sample, whole-luminance-sample, or 1 / 16-luminance-sample. The CU-level MVD resolution indication is conditionally signaled if the current CU has at least one non-zero MVD component.If all MVD components (ie, both horizontal and vertical MVD for reference list L0 and reference list L1) are zero, a quarter-luminance-sample MVD resolution is inferred. For a CU with at least one non-zero MVD component, a first flag is transmitted by a signal to indicate whether quarter-luminance-sample MVD precision is used for the CU. If the first flag is 0, no further signaling is required, and quarter-luminance-sample MVD precision is used for the current CU. Otherwise, a second flag is transmitted by a signal to indicate that half-luminance-sample or other MVD precision (whole or four-luminance samples) is used for a normal AMVP CU. In the case of half-luminance-samples, a 6-tap interpolation filter is used for half-luminance sample positions instead of the default 8-tap interpolation filter. Otherwise, a third flag is transmitted by a signal to indicate whether whole-luminance-sample MVD precision or four-luminance-sample MVD precision is used for a normal AMVP CU. In the case of an affine AMVP CU, a second flag is used to indicate whether whole-luminance-sample MVD precision or 1 / 16 luminance-sample MVD precision is used. To ensure that the reconstructed MV has the expected precision (quarter-luma-sample, half-luma-sample, whole-luma-sample, or quad-luma-sample), the motion vector predictor for the CU is rounded to the same precision as the MVD before the MVD is added. The motion vector predictor is rounded towards zero (i.e., a negative motion vector predictor is rounded towards positive infinity, and a positive motion vector predictor is rounded towards negative infinity). The encoder uses RD check to determine the motion vector resolution for the current CU. In order to avoid always performing four CU-level RD checks for each MVD resolution, in VTM11, only the RD check of MVD precision other than a quarter-brightness-sample is conditionally called. For the normal AVMP mode, the RD cost of a quarter-brightness-sample MVD precision and a whole-brightness-sample MV precision is calculated first. Then, the RD cost of the whole-brightness-sample MVD precision is compared with the RD cost of the quarter-brightness-sample MVD precision to determine whether it is necessary to further check the RD cost of the four-brightness-sample MVD precision. When the RD cost for the quarter-brightness-sample MVD precision is much less than the whole-brightness-sample MVD precision, the RD check of the four-brightness-sample MVD precision is skipped. Then, if the RD cost of the whole-brightness-sample MVD precision is significantly greater than the best RD cost of the previously tested MVD precision, the check of the half-brightness-sample MVD precision is skipped. For the affine AMVP mode, if the affine inter mode is not selected after checking the rate-distortion cost of the affine merge / skip mode, merge / skip mode, quarter-luma-sample MVD accuracy normal AMVP mode, and quarter-luma-sample MVD accuracy affine AMVP mode, the 1 / 16 luma-sample MV accuracy and 1-pixel MV accuracy affine inter modes are not checked. In addition, the affine parameters obtained in the quarter-luma-sample MV accuracy affine inter mode are used as the starting search points for the 1 / 16 luma-sample and quarter-luma-sample MV accuracy affine inter modes. In VVC, if a block is coded with IBC AMVP mode and AMVR is turned on, IBC AMVP supports two MV precisions of 1 pixel and 4 pixels. The AMVR precision index is signaled only when L0-MVDx or L0-MVDy is not equal to zero. 2.3 Related solutions 2.3.1 Reordering of Reconstructed Samples The detailed solutions below should be considered as examples to explain the general concept. These solutions should not be interpreted in a narrow way. In addition, these solutions can be combined in any way. In the following disclosure, a block may refer to a coding block (CB), a coding unit (CU), a prediction block (PB), a prediction unit (PU), a transform block (TB), a transform unit (TU), a sub-block, a sub-CU, a codec tree unit (CTU), a codec tree block (CTB), or a codec group (CG). In the following disclosure, a region may refer to any video unit, such as a picture, a slice, or a block. A region may also refer to a non-rectangular area, such as a triangle. In the following disclosure, W and H represent the width and height of the rectangular area mentioned. 1. It is proposed that samples in a region can be reordered. a. The reordering of samples can be defined as follows: Assume that the sample at position (x, y) in the region before reordering is denoted as S(x, y), and the sample at position (x, y) in the region after reordering is denoted as R(x, y). It is required that R(x, y) = S(f(x, y), g(x, y)), where (f(x, y), g(x, y)) is the position in the region, and f and g are two functions. i. For example, it is required that there is at least one position (x, y) such that (f(x, y), g(x, y)) is not equal to (x, y). b. The samples in the area to be reordered can be: i. The original sample before encoding, ii. Prediction samples, iii. Reconstruct the sample, iv. Transformed samples (transform coefficients), v. The samples before the inverse transformation (the coefficients before the inverse transformation), vi. Samples before deblocking filtering, vii. Samples after deblocking filtering, viii. Samples before SAO processing, ix. Samples after SAO processing, x. Samples before ALF processing, xi. Samples after ALF processing, xii. Samples before post-processing, xiii. Samples after post-processing. c. In one example, reordering may be applied in more than one stage. i. For example, at least two of the samples listed in item 1.b above may be reordered. 1) For example, different re-ranking methods can be applied to the two samples. 2) For example, the same re-ranking method can be applied to both samples. d. In one example, the reordering may be a horizontal flip. For example, f(x, y) = Px, g(x, y) = y. For example, P = W-1. e. In one example, the reordering may be a vertical flip. For example, f(x, y) = x, g(x, y) = Qy. For example, Q = H-1. f. In one example, the reordering can be horizontal and vertical flipping. For example, f(x, y) = Px, g(x, y) = Q- y. For example, P = W-1 and Q = H-1. g. In one example, the reordering may be a move. For example, f(x, y) = (P + x) % W, g(x, y) = (Q + y) %H, where P and Q are integers. h. In one example, the reordering may be a rotation. i. In one example, there exists at least one (x, y) such that (x, y) is equal to (f(x, y), g(x, y)). j. In one example, whether and / or how to reorder samples can be signaled from the encoder to the decoder, such as in SPS / sequence header / PPS / picture header / APS / slice header / sub-picture / tile / CTU row / CTU / CU / PU / TU. i. For example, a first flag is signaled to indicate whether reordering is applied. 1) For example, the first flag may be encoded and decoded using context encoding and decoding. ii. For example, a second syntax element (eg, a flag) is signaled to indicate which reordering method (eg, horizontal flip or vertical flip) is used. 1) For example, the second syntax element is signaled only if it is indicated that reordering is applied. 2) For example, context coding may be used to codec the second syntax element. 2. Propose whether and / or how to reorder samples may depend on encoding solution information. a. In one example, whether and / or how the reordering of samples may be derived depends on the codec information at picture level / slice level / CTU level / CU level / PU level / TU level. b. In one example, the codec information may include: i. The size of the area, ii. the codec mode of the region (e.g., inter, intra, or IBC), iii. Motion information (such as motion vectors and reference indices), iv. Intra prediction mode (e.g. angular intra prediction mode, planar or DC), v. Inter prediction modes (such as affine prediction, bi-directional prediction / uni-directional prediction, merge mode, combined inter-intra prediction (CIIP), merge with motion vector difference (MMVD), temporal motion vector prediction (TMVP), sub-TMVP), vi. quantization parameter (QP), vii. Codec tree partition information such as codec tree depth, viii. Color format and / or color components. 3. It is proposed that at least one parsing or decoding process other than the reordering process may depend on whether and / or how the samples are reordered. a. For example, a syntax element may be conditionally signaled based on whether reordering applies. b. For example, different scan orders may be used based on whether and / or how the samples are reordered. c. For example, deblocking filtering / SAO / ALF may be used based on whether and / or how samples are reordered. 4. In one example, the sample may be processed by at least one auxiliary program before or after the resampling process. Some possible auxiliary programs may include: (combinations are allowed) a. For example, at least one sample may be added by an offset. b. For example, at least one sample may be multiplied by a factor. c. For example, at least one sample may be cropped. d. For example, at least one sample may be filtered. e. For example, at least one sample X can be modified to T(X), where T is a function. 5. In one example, for a block encoded and decoded in IBC mode. a. For example, a first flag is signaled to indicate whether the reconstructed samples should be reordered. i. For example, the first flag may be encoded and decoded using context encoding and decoding. b. For example, a second flag may be signaled to indicate whether the reconstructed samples should be flipped horizontally or vertically. i. For example, the second flag is signaled only when the first flag is true. ii. For example, the second flag may be encoded using context encoding and decoding. 2.3.2 About sample reordering - application conditions and interaction with other processes The detailed solutions below should be considered as examples to explain the general concept. These solutions should not be interpreted in a narrow sense. In addition, these solutions can be combined in any way. The term “video unit” or “codec unit” may refer to a picture, a slice, a tile, a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. The term "block" may refer to a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. Note that the terms mentioned below are not limited to the specific terms defined in existing standards. Any changes in codec tools are also applicable. 1. Regarding the application conditions of sample reordering (e.g., first and related problems), the following method is proposed: a. Whether the reordering process is applied to the reconstructed / original / prediction block may depend on the coded information of the video unit. a. For example, it may depend on the prediction method. b. For example, if the video unit is encoded with one or more of the modes / techniques listed below, then the reordering process may be applied to the video unit. Otherwise, the reordering process is not allowed. i. Intra-block copy (also known as IBC), ii. Current Picture Reference (also called CPR), iii. Intra-frame template matching (also called intra-frame TM), iv. IBC template matching (or IBC mode based on template matching), v. Merge-based codec, vi. Codec based on AMVP. c. For example, it may depend on the block dimensions (such as block width and / or height). d. For example, if the size W×H of the video unit meets one or more rules listed below, then the reordering process can be applied to the video unit. Otherwise, the reordering process is not allowed. i. If W>=T1 and / or H>=T2, ii. If W <= T1 and / or H <= T2s, iii. If W>T1 and / or H>T2s, iv. If W<T1 and / or H<T2s, v. If W×H>=T, vi. If W×H>T, vii. If W×H<=T, viii.If W×H<T. 2. Regarding which kinds of samples are reordered and the interaction with other processes (e.g., second and related questions), the following methods are proposed: a. A possible sample re-arrangement method may refer to one or more of the following processes: a. The shaped domain samples of the video unit (eg, obtained based on the LMCS method) may be reordered. i. For example, the shaped domain luma samples of a video unit (eg, obtained by luma mapping based on the LMCS method) may be reordered. b. The original domain (rather than the LMCS reshaped domain) samples of the video unit can be reordered. i. For example, the original domain chroma samples of a video unit may be reordered. ii. For example, the original domain luma samples of a video unit may be reordered. c. The reconstructed samples of the video unit can be reordered. i. For example, the reconstructed samples of a video unit may be reordered immediately after adding the decoded residual to the prediction. ii. For example, the integer-domain luma reconstruction samples of a video unit may be reordered. iii. For example, the raw domain luma reconstruction samples of a video unit may be reordered. iv. For example, the original domain chroma reconstructed samples of a video unit may be reordered. d. The inverse brightness mapping of the LMCS process may be applied based on the reordered reconstructed samples. e. A loop filtering process (eg, luma / chroma bilateral filter, luma / chroma SAO, CCSAO, luma / chroma ALF, CCALF, etc.) may be applied based on the reordered reconstructed samples. i. For example, the loop filter process may be applied based on reconstructed samples reordered in the original domain (rather than the LMCS shaping domain). f. Distortion calculations (eg, SSE calculations between original samples and reconstructed samples) may be based on the reordered reconstructed samples. i. For example, the distortion calculation can be based on reconstructed samples reordered from the original domain. g. The original samples of a video unit can be reordered. i. For example, the integer-domain raw luma samples of a video unit may be reordered. ii. For example, the original domain raw luma samples of a video unit may be reordered. iii. For example, the original domain raw chroma samples of a video unit may be reordered. iv. For example, the residual can be generated by subtracting the prediction from the reordered original samples. h. The prediction samples of the video unit can be reordered. i. For example, the reordering process for prediction samples may be performed immediately after the motion compensation process. ii. For example, sign prediction may be applied based on the reordered prediction samples of the video unit. General Aspects 3. Whether and / or how to apply the method disclosed above can be transmitted by signal at sequence level / picture group level / picture level / slice level / tile group level, for example in sequence header / picture header / SPS / VPS / DPS / DCI / PPS / PPS / slice header / tile group header. 4. Whether and / or how to apply the above disclosed methods can be signaled in PB / TB / CB / PU / TU / CU / VPDU / CTU / CTU row / slice / tile / sub-picture / other kinds of regions containing more than one sample or pixel. 5. Whether and / or how to apply the above disclosed method may depend on the coded information, such as block size, color format, single / dual tree partitioning, color component, slice / picture type. 2.3.3 On Sample Reordering - Sample Reordering, Signaling and Storage The following detailed embodiments should be considered as examples to explain the general concept. These embodiments should not be interpreted in a narrow manner. In addition, these embodiments can be combined in any way. The term “video unit” or “codec unit” may refer to a picture, a slice, a tile, a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. The term "block" may refer to a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. Note that the terms mentioned below are not limited to the specific terms defined in existing standards. Any changes in codec tools are also applicable. 1. Regarding the signaling of sample reordering (eg, the first problem and related problems), the following method is proposed. a. For example, at least one new syntax element (e.g., flag, index, variable, parameter, etc.) may be transmitted by signal Use of sample reordering to specify video units. a. For example, given that a particular prediction method is used for a video unit, at least one new syntax element (eg, a flag) may be further signaled to specify the use of sample reordering. b. For example, given an intra template matching usage flag specifies that a video unit is coded by intra template matching, a first new syntax element (eg, a flag) may be further signaled to specify the use of sample reordering for the video unit coded by intra template matching. c. For example, given an IBC amvp flag specifies that a video unit is coded by IBC amvp, a first new syntax element (eg, a flag) may be further signaled to specify the use of sample reordering for the video unit coded by IBC amvp. d. For example, given an IBC merge flag that specifies that a video unit is coded by IBC merge, a first new syntax element (eg, a flag) may be further signaled that specifies the use of sample reordering for the IBC merge-coded video unit. b. In addition, for example, if the first new syntax element specifies that sample reordering is used for video units encoded and decoded by a specific prediction method, a second new syntax element (e.g., a flag) may be further signaled to specify which reordering method (e.g., horizontal flipping or vertical flipping) is used for the video unit. c. For example, a single new syntax element (e.g., parameter or variable or index) may be signaled to a video unit, rather than multiple concatenated syntax elements, specifying the type of reordering applied to the video unit (e.g., no flip, horizontal flip, or vertical flip). a. For example, given an intra template matching usage flag specifies that a video unit is encoded and decoded by intra template matching, a new syntax element (eg, index) may be further signaled to specify the type of reordering of samples of the video unit encoded and decoded by intra template matching. b. For example, given an IBC amvp flag that specifies that a video unit is coded by IBC amvp, a new syntax element (eg, index) may be further signaled to specify the type of sample reordering for the video unit coded by IBC amvp. c. For example, given an IBC merge flag that specifies that a video unit is coded by IBC merge, a new syntax element (eg, index) may be further signaled to specify the type of sample reordering for the video unit coded by IBC merge. d. Additionally, for example, a new syntax element (eg, index) equal to 0 specifies that sample reordering is not used; equal to 1 specifies that sample reordering method A is used; equal to 2 specifies that sample reordering method B is used; and so on. d. For example, one or more syntax elements related to sample reordering may be context encoded and decoded. a. For example, the context may be based on neighboring block / sample coding information (eg, availability, prediction mode, whether merge coded, whether IBC coded, whether sample reordering is applied, which sample reordering method is used, etc.). e. Alternatively, for example, whether to perform sample reordering and / or which reordering method to use for a video unit may be determined based on predefined rules (without signaling) rather than being signaled. a. For example, the predefined rules may be based on information about neighboring block / sample codecs. b. For example, given an IBC merge flag that specifies that a video unit is encoded and decoded via IBC merging, a process may be performed to determine whether and how to perform reordering based on predefined rules / processes. i. Alternatively, for example, given a first new syntax element specifies sample reordering for a video unit, however, how to reorder can be based on a predefined rule / procedure (no signaling) is determined, rather than further using a signaling reordering method. ii. Alternatively, for example, whether to perform reordering may be determined implicitly based on a predefined rule / process, but how to reorder may be signaled. c. For example, given an IBC amvp flag specifying that the video unit is coded by IBC amvp, a program may be executed to determine whether and how to perform reordering based on predefined rules / procedures. i. Alternatively, for example, given a first new syntax element specifying sample reordering for a video unit, however, how to reorder may be determined based on a predefined rule / procedure (without signaling) rather than further signaling the reordering method. ii. Alternatively, for example, whether to perform reordering may be determined implicitly based on a predefined rule / process, but how to reorder may be signaled. d. For example, given an intra template matching flag that specifies that a video unit is encoded via IBC merging, a process may be performed to determine whether and how to perform reordering based on predefined rules / processes. i. Alternatively, for example, given a first new syntax element specifying sample reordering for a video unit, however, rather than further signaling the reordering method, how to reorder may be determined based on a predefined rule / procedure (without signaling). ii. Alternatively, whether to perform reordering may be implicitly based on predefined rules, for example / process, but how to reorder can be transmitted by signal. f. For example, whether to perform reordering and / or how to reorder can be inherited from the encoded and decoded blocks. a. For example, it can be inherited from an adjacent spatial neighbor block. b. For example, it may be inherited from a non-adjacent spatially neighboring block. c. For example, it may be inherited from a history-based motion table such as some HMVP table. d. For example, it may be inherited from the temporal motion candidate. e. For example, it can be inherited based on the IBC merge candidate list. f. For example, it can be inherited based on the IBC amvp candidate list. g. For example, it can be inherited based on a generated motion candidate list / table. h. For example, in case the video unit is encoded and decoded by IBC merge mode, sample reordering inheritance may be allowed. i. For example, in case a video unit is encoded and decoded by IBC AMVP mode, sample reordering inheritance may be allowed. j. For example, in case of encoding and decoding video units via intra template matching mode, sample reordering inheritance may be allowed. 2. With regard to the storage of sample reordering states (eg, second and related issues), the following method is proposed. a. For example, information on whether and / or how to reorder video units may be stored. a. For example, the stored information can be used for encoding and decoding of future video units. b. For example, this information may be stored in a buffer. i. For example, a buffer can be a line buffer, a table, more than one line buffer, a picture buffer, a compressed picture buffer, a temporal buffer, etc. c. For example, this information may be stored in a historical motion vector table (such as a HMVP table). b. For example, coding information (e.g., whether sample reordering is applied, which sample reordering method is used, block availability, prediction mode, whether merge coded or IBC coded, etc.) may be stored for deriving the context of the sample reordering syntax element. General Aspects 3. Whether and / or how to apply the method disclosed above can be transmitted by signal at sequence level / picture group level / picture level / slice level / tile group level, for example in sequence header / picture header / SPS / VPS / DPS / DCI / PPS / PPS / slice header / tile group header. 4. Whether and / or how to apply the above disclosed methods can be signaled in PB / TB / CB / PU / TU / CU / VPDU / CTU / CTU row / slice / tile / sub-picture / other kinds of regions containing more than one sample or pixel. 5. Whether and / or how to apply the above disclosed method may depend on the encoded information, such as block size, color format, single-tree partitioning / dual-tree partitioning, color component, slice / picture type. 2.3.4 On sample reordering - motion list generation, implicit derivation and how to reorder The following detailed embodiments should be considered as examples to explain the general concept. These embodiments should not be interpreted in a narrow manner. In addition, these embodiments can be combined in any way. The term “video unit” or “codec unit” may refer to a picture, a slice, a tile, a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. The term "block" may refer to a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. Note that the terms mentioned below are not limited to the specific terms defined in existing standards. Any changes in codec tools are also applicable. 1. Regarding the motion candidate list generation for sample reordering (e.g., first and related problems), the following method is proposed: b. For example, the IBC merge motion candidate list can be used for both the regular IBC merge mode and the sample reordering based IBC merge mode. c. For example, the IBC amvp motion predictor candidate list can be used for both the regular IBC amvp mode and the sample reordering based IBC amvp mode. d. For example, a new motion (predictor) candidate list may be generated for a target video unit coded with sample reordering. a. For example, the new candidate list may only consider motion candidates that have the same reordering method as that of the target video unit. b. For example, the new candidate list may only consider motion candidates that are encoded with sample reordering (but regardless of the type of sample reordering method). c. Alternatively, a new candidate list may be generated without considering the sample reordering method for each motion candidate. d. For example, non-adjacent motion candidates may be inserted into a new candidate list. i. For example, non-adjacent candidates with sample reordering (but regardless of the type of sample reordering method) may be inserted. ii. For example, non-adjacent candidates having the same reordering method as that of the target video unit may be inserted. iii. For example, whether or not a sample re-ordering method is applied to the candidates, non-adjacent candidates may be inserted. e. For example, new motion candidates may be generated according to a certain rule and inserted into a new candidate list. i. For example, the rules can be based on an averaging process. ii. For example, rules can be based on a tailoring process. iii. For example, the rules can be based on a scaling process. e. For example, the motion (predictor) candidate list generation for the target video unit may depend on the reordering method. a. For example, the reordering method associated with each motion candidate (from the spatial or temporal domain or the history table) may be inserted into the list, regardless of whether the target video unit will be coded with sample reordering. b. For example, if the target video unit is to be encoded with sample reordering, only those motion candidates (from the spatial domain or temporal domain or the history table) that are encoded with the same reordering method as that of the target video unit are inserted into the list. c. For example, if the target video unit is to be encoded with sample reordering, only those motion candidates (from the spatial domain or temporal domain or the history table) that are to be encoded with sample reordering are inserted into the list. d. For example, if the target video unit is to be encoded for sample reordering, those motion candidates (from the spatial domain or temporal domain or the history table) encoded with the same reordering method may not be inserted into the list. e. Alternatively, motion list generation for a video unit may not depend on the reordering method associated with each motion candidate. f. For example, adaptive reordering of merge candidates (ARMC) of video units may depend on the reordering method. a. For example, if the target video unit is to be coded with sample reordering, motion candidates coded with the same reordering method as that of the target video unit may be placed before those motion candidates coded with a different reordering method. b. For example, if the target video unit is to be coded with sample reordering, motion candidates coded with sample reordering may be placed before those coded with a different reordering method (but regardless of the type of sample reordering method). c. For example, if the target video unit is to be coded without sample reordering, the motion candidates without the reordering method may be placed before those motion candidates coded with the reordering method. d. Alternatively, ARMC may be applied to video units regardless of the reordering method associated with each motion candidate. 2. Regarding the implicit determination of sample reordering (e.g., second and related problems), the following method is proposed: a. Whether to reorder the reconstructed / original / predicted samples of a video unit may be derived implicitly from the coded information at both the encoder and the decoder. a. Implicit derivation can be based on costs / errors / differences computed from the encoded and decoded information. i. For example, the cost / error / difference can be calculated based on template matching. ii. For example, template matching can be performed by comparing samples in the first template and the second template. 1. For example, a first template is constructed from a set of predefined samples adjacent to the current video unit, and a second template is constructed from a set of corresponding samples adjacent to the reference video unit. 2. For example, the cost / error may refer to the cumulative sum of the differences between the samples in the first template and the corresponding samples in the second template. a. For example, the difference may be based on luma sample values. 3. For example, a sample may refer to a reconstructed sample or a variant based on the reconstructed sample. 4. For example, a sample may refer to a predicted sample or a variant based on a predicted sample. b. For example, the first cost (denoted by Cost0) can be calculated without reordering, and the second cost (denoted by Cost1) can be calculated using reordering. Finally, {Cost0, Cost1} is identified and determines the corresponding coding method (without reordering or with reordering) as the final coding method of the video unit. c. Alternatively, the reconstructed / original / predicted samples of the reordered video units may be signaled in the bitstream. i. For example, it may be signaled via a syntax element (eg, a flag). b. Which reordering method to use to reorder the reconstructed / original / prediction samples can be implicitly derived from the coded and decoded information at both the encoder and the decoder. a. For example, whether to flip horizontally or vertically. b. Implicit derivation can be based on costs / errors / differences computed from the encoded and decoded information. i. For example, the cost / error / difference can be calculated based on template matching. ii. For example, template matching can be performed by comparing samples in the first template and the second template. 1. For example, a first template is constructed from a set of predefined samples adjacent to the current video unit, and a second template is constructed from a set of corresponding samples adjacent to the reference video unit. 2. For example, the cost / error may refer to the cumulative sum of the differences between the samples in the first template and the corresponding samples in the second template. a. For example, the difference may be based on luma sample values. 3. For example, a sample may refer to a reconstructed sample or a variant based on the reconstructed sample. 4. For example, a sample may refer to a predicted sample or a variant based on a predicted sample. iii. For example, the first Cost, the second cost can be calculated using reordering method B (represented by Cost1). Finally, the minimum cost value in {Cost0, Cost1} is identified, and the corresponding codec method (reordering method A, reordering method B) is determined as the final codec method of the video unit. c. Alternatively, the reordering method for reordering the reconstructed / original / predicted samples of a video unit may be signaled in the bitstream. i. For example, it may be signaled by a syntax element (eg, a flag or an index or a parameter or a variable). c. Whether AND which reordering method to use to reorder the reconstructed / original / prediction samples of a video unit may be implicitly derived from the encoded and decoded information at both the encoder and the decoder. a. For example, the first cost (represented by Cost0) can be calculated without reordering, the second cost can be calculated using reordering method A (represented by Cost1), and the third cost can be calculated using reordering method B (represented by Cost2). Finally, the minimum cost value among {Cost0, Cost1, Cost2} is identified, and the corresponding codec method (no reordering, reordering method A, reordering method B) is determined as the final codec method of the video unit. 3. Regarding how to reorder samples (e.g., third and related issues), the following methods are proposed: a. A possible sample reordering method can refer to one or more of the following processes: a. The reordering process can be applied based on video units. i. For example, the reordering process may be based on block / CU / PU / TU. ii. For example, the reordering process may not be tile / slice / picture based. b. Samples of a video unit may be transformed according to an M parameter model (eg, M=2 or 4 or 6 or 8). c. Samples of a video unit can be reordered. d. The sample of the video unit can be rotated. e. The samples of the video unit can be transformed according to the affine model. f. The samples of the video unit can be transformed according to the linear model. g. The samples of the video unit can be transformed according to the projection model. h. The samples of the video unit can be flipped in the horizontal direction. i. The samples of the video unit can be flipped along the vertical direction. General 4. Whether and / or how to apply the methods disclosed above may be signaled at a sequence level / group of picture level / picture level / slice level / tile group level, e.g. in a sequence header / picture header / SPS / VPS / DPS / DCI / PPS / PPS / slice header / tile group header. 5. Whether and / or how to apply the above disclosed methods to include more than one sample or pixel in a PB / TB / CB / PU / TU / CU / VPDU / CTU / CTU row / slice / tile / sub-picture / other type of area. 6. Whether and / or how to apply the methods disclosed above may depend on the encoded information, such as block size, color format, single-tree partitioning / dual-tree partitioning, color component, slice / picture type. 3. Question 1. So far, arbitrary motion vectors may be applied to codec units encoded by IBC AMVP, however, in cases where sample reordering may or may not be used for video units, specific motion constraints may be applied. 2. In case certain motion constraints are applied to the video unit, the AMVR signaling can be changed based on the motion constraints. 3. With sample reordering enabled, template matching based methods can be modified (such as intra template matching, IBC with template matching). 4. Detailed solutions The following detailed embodiments should be considered as examples to explain the general concept. These embodiments should not be interpreted in a narrow manner. In addition, these embodiments can be combined in any way. The term “video unit” or “codec unit” may refer to a picture, a slice, a tile, a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. The term "block" may refer to a codec tree block (CTB), a codec tree unit (CTU), a codec block (CB), a CU, a PU, a TU, a PB, a TB. Note that the terms mentioned below are not limited to the specific terms defined in existing standards. Any changes in codec tools are also applicable. 4.1 Regarding motion constraints for applying codec tools (e.g., the first problem and related problems), the following approach is proposed: a. The motion vectors of a video unit encoded and decoded using a specific prediction method may be constrained by a certain rule. a. A motion vector can refer to one or more of the following: i. Motion vector difference ii. Motion vector, iii. Motion vector predictor. b. Forecasting methods can refer to one or more of the following: i.IBC AMVP mode, ii. IBC merger mode, iii. IBC merge mode with template matching iv. Intra-frame template matching, v. IBC AMVP mode based on sample reordering, vi. IBC merging mode based on sample reordering vii. Sample reordering based IBC merging mode with template matching viii. Intra-frame template matching based on sample reordering. c. Rules can refer to one or more of the following: i. The horizontal component of the motion vector may be required to be equal to zero. ii. The vertical component of the motion vector may be required to be equal to zero. b. For example, given that a video unit is encoded using IBC AMVP mode, the horizontal component of the motion vector may be required to be equal to zero. a. Alternatively, given a video unit is encoded using IBC AMVP mode, the vertical component of the motion vector may be required to be equal to zero. c. For example, given a video unit is encoded and decoded using IBC AMVP mode based on sample reordering (eg, sample horizontal flipping), the vertical component of the motion vector may be processed / constrained / required to be equal to zero. a. For example, given a video unit is encoded and decoded using IBC AMVP mode based on sample reordering (eg, sample vertical flipping), the horizontal component of the motion vector may be processed / constrained / required to be equal to zero. d. For example, if a component of the motion vector (e.g., MVx or MVy) of a video unit is processed / constrained / required to be equal to zero, then a. The corresponding component of the motion vector difference (eg, MVDx or MVDy) of the video unit may be processed / constrained / required to be equal to zero. b. The corresponding component of the motion vector predictor (eg, MVPx or MVPy) of the video unit may be processed / constrained / required to be equal to zero. e. For example, if a certain component of the motion vector difference (e.g., MVDx or MVDy) of a video unit is processed / constrained / required to be equal to zero, a. The corresponding component of the motion vector difference may not be signaled but inferred to be equal to zero. f. For example, the signaling of the motion vector difference (MVD) for a certain video unit may depend on the motion constraints applied to the video unit. a. For example, given that the MVDx of a video unit is processed / constrained / required to be equal to zero, the sign of MVDx may not be signaled. b. For example, given that the MVDy of a video unit is processed / constrained / required to be equal to zero, the sign of MVDy may not be signaled. g. For example, if the first component of a motion vector is processed / constrained / required to be equal to zero, the corresponding first component of the MVD / MVP is processed / constrained / required to be equal to zero. h. "Zero" in the above items may be replaced by any other fixed or derived or signaled value. 4.2 Regarding motion constraint-based AMVR signaling (e.g., the second problem and related problems), the following method is proposed: a. For example, the signaling of the resolution of the motion vector difference for a certain video unit (eg, amvr_precision_idx for AMVR) may depend on the motion constraints applied to the video unit. a. For example, a video unit may be encoded and decoded using an AMVP mode. b. For example, the video unit may be encoded and decoded using IBC AMVP. c. For example, a video unit may be encoded and decoded using IBC AMVP based on sample reordering. d. For example, a video unit may be encoded and decoded using an AMVP mode based on sample reordering. e. For example, the signaling / presence of the resolution of the motion vector difference (e.g., amvr_precision_idx) can be decoupled from MVDx. For example, given that the MVDx of a video unit is processed / constrained / required to be equal to zero, the signaling can depend only on whether the value of MVDy is equal to zero (rather than checking both MVDx and MVDy). f. For example, the signaling / presence of the resolution of the motion vector difference (e.g., amvr_precision_idx) can be decoupled from MVDy. For example, if the MVDy of a given video unit is processed / constrained / required to be equal to zero, the signaling can only depend on whether the value of MVDx is equal to zero (rather than checking both MVDx and MVDy). g. For example, if the resolution of the motion vector difference (eg, amvr_precision_idx) is not signaled for such a video unit, it may be inferred to be equal to some value (such as 0) indicating that a default resolution is used. i. For example, in the case where a video unit is encoded and decoded based on the IBC AMVP mode, the default resolution may be 1-pixel precision. ii. For example, in the case where the video unit is encoded and decoded based on the IBC AMVP mode based on sample reordering, the default resolution may be 1-pixel precision. b. For example, the signaling of amvr_precision_idx of an IBC AMVP coded block (taking the syntax structure in the VVC specification as an example) may be changed as follows, where cu_ibc_reorder_type indicates whether and how to reorder samples in an IBC AMVP coded block. 4.3 Performing template matching (e.g., intra TM, IBC with TM) modification with sample reordering enabled (e.g., the third problem and related problems), the following method is proposed: Assuming that a first template is used for a first video unit encoded using a TM with sample reordering, and a second template is used for a second video unit encoded using a TM without sample reordering: a. For example, the location of samples comprising a template may depend on the sample reordering method used for the video unit. a. For example, the sample positions of the first template and the second template may be different. b. For example, a second template may be constructed using samples above and to the left of the video unit. c. For example, the first template may be constructed using samples above or to the left of the video unit. i. For example, if the first video unit is encoded with horizontal flipping, the first template may be constructed using samples above the video unit. ii. For example, if the first video unit is encoded with vertical flipping, the first template may be constructed using samples on the left side of the video unit. d. Alternatively, the sample positions of the first template and the second template may be the same. b. For example, the number of samples comprising a template may depend on the sample reordering method used for the video unit. a. For example, the number of rows and / or columns of the first template and the second template may be different. b. For example, the second template may be constructed using M1 row samples above the video unit and N1 column samples to the left of the video unit, while the first template may be constructed using M2 row samples above the video unit and / or N2 column samples to the left of the video unit. The following rules may be met: i.M1!=m2, ii. N1!=N2. c. Alternatively, the number of rows and / or columns of the first template and the second template may be the same. General 4.4 Whether and / or how to apply the methods disclosed above 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 / APS / In the strip header / tile group header. 4.5 Whether and / or how to apply the above disclosed methods can be signaled in PB / TB / CB / PU / TU / CU / VPDU / CTU / CTU row / slice / tile / sub-picture / other kinds of regions containing more than one sample or pixel. 4.6 Whether and / or how to apply the above disclosed method may depend on the encoded information, such as block size, color format, single tree / dual tree partitioning, color component, slice / picture type.

[0070] Embodiments of the present disclosure relate to motion information determination. As used herein, 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), or a video processing unit including multiple samples or pixels. A block may be rectangular or non-rectangular.

[0071] As used herein, the term "motion information" may refer to a motion vector (MV), a motion vector difference (MVD), or a motion vector predictor.

[0072] Fig.10 A flow chart of a method 1000 for video processing according to an embodiment of the present disclosure is shown. The method 1000 is implemented for conversion between a current video block of a video and a bitstream of the video. In some embodiments, the conversion between the current video block and the bitstream may include encoding the current video block into the bitstream. Alternatively or additionally, the conversion may include decoding the current video block from the bitstream.

[0073] At block 1010, motion information for a current video block is determined. At block 1020, the motion information is updated based on constraints. The constraints indicate target values ​​for components of the motion information. At block 1030, a conversion is performed based on the updated motion information.

[0074] The method 1000 enables updating of motion information based on constraints. In this way, codec effectiveness and codec efficiency can be improved.

[0075] In some embodiments, the motion information comprises at least one of: a motion vector, a motion vector difference or a motion vector predictor.

[0076] In some embodiments, the current video block is encoded and decoded using at least one of: intra block copy (IBC) advanced motion vector prediction (AMVP) mode, IBC merge mode, IBC merge mode with template matching, intra template matching, IBC AMVP mode based on sample reordering, IBC merge mode based on sample reordering, IBC merge mode based on sample reordering with template matching, or intra template matching based on sample reordering.

[0077] In some embodiments, the component of the motion information comprises at least one of: a horizontal component of the motion information, or a vertical component of the motion information.

[0078] In some embodiments, the current video block is encoded using an intra-block copy (IBC) advanced motion vector prediction (AMVP) mode based on sample reordering. The vertical component of the motion information may be updated to a target value. In some embodiments, the samples of the current video block are horizontally flipped. For example, given a video unit is encoded using an IBC AMVP mode based on sample reordering (e.g., samples are horizontally flipped), the vertical component of the motion vector may be processed / constrained / required to be equal to zero.

[0079] In some embodiments, the current video block is encoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode based on sample reordering. The horizontal component of the motion information may be updated to a target value. In some embodiments, the samples of the current video block are vertically flipped. For example, given a video unit is encoded using an IBC AMVP mode based on sample reordering (e.g., samples are vertically flipped), then the horizontal component of the motion vector may be processed / constrained / required to be equal to zero.

[0080] In some embodiments, if a component of the motion vector of the current video block is updated to a target value, a corresponding component of at least one of the motion vector difference of the current video block or the motion vector prediction value of the current video block is updated to the target value.

[0081] In some embodiments, the components of the motion vector include at least one of the following: a horizontal component of the motion vector, or a vertical component of the motion vector. For example, if a component of the motion vector (e.g., MVx or MVy) of a video unit is processed / constrained / required to be equal to zero, then a corresponding component of the motion vector difference (e.g., MVDx or MVDy) of the video unit may be processed / constrained / required to be equal to zero, and / or a corresponding component of the motion vector predictor (e.g., MVPx or MVPy) of the video unit may be processed / constrained / required to be equal to zero.

[0082] In some embodiments, if a component of the motion vector of the current video block is updated to a target value, the component of the motion vector is not included in the bitstream. In some embodiments, the component of the motion vector is inferred to be zero. For example, if a certain component of the motion vector difference (e.g., MVDx or MVDy) of a video unit is processed / constrained / required to be equal to zero, the corresponding component of the motion vector difference may not be signaled but inferred to be equal to zero.

[0083] In some embodiments, based on the constraints, a representation of motion information including a motion vector difference for the current video block is not included in the bitstream. For example, signaling of a motion vector difference (MVD) for a certain video unit may depend on the motion constraints applied to the video unit.

[0084] In some embodiments, the horizontal component of the motion vector difference is updated to a target value, and the representation of the motion information includes the sign of the horizontal component. For example, given a video unit's MVDx is processed / constrained / required to be equal to zero, the sign of MVDx may not be signaled.

[0085] In some embodiments, the vertical component of the motion vector difference is updated to a target value, and the representation of the motion information includes the sign of the vertical component. For example, given a video unit's MVDy is processed / constrained / required to be equal to zero, the sign of MVDy may not be signaled.

[0086] In some embodiments, the target value is zero.

[0087] In some embodiments, the target value is included in the bitstream.

[0088] In some embodiments, the target value is derived during the conversion.

[0089] In some embodiments, the current video block is encoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode.At least one of the vertical component of the motion information or the horizontal component of the motion information may be updated to a target value.

[0090] In some embodiments, method 1000 further comprises: including resolution information of the motion information in the bitstream based on the constraint determination. The motion information comprises a motion vector difference of the current video block.

[0091] In some embodiments, the resolution information includes a precision index of an adaptive motion vector resolution (AMVR).For example, the signaling of the resolution of the motion vector difference (eg, amvr_precision_idx of AMVR) for a certain video unit may depend on the motion constraints applied to the video unit.

[0092] In some embodiments, the current video block is encoded using at least one of: intra block copy (IBC) advanced motion vector prediction (AMVP) mode, AMVP mode, IBC AMVP mode based on sample reordering, or AMVP mode based on sample reordering.

[0093] In some embodiments, the constraint indicates a target value for a first component of the motion vector difference, and including the resolution information in the bitstream is decoupled from the first component. In some embodiments, determining to include the resolution information in the bitstream comprises: determining to include the resolution information in the bitstream based on a value of a second component of the motion vector difference. For example, the signaling / presence of the resolution of the motion vector difference (e.g., amvr_precision_idx) can be decoupled from MVDx. For example, given that the MVDx of a video unit is processed / constrained / required to be equal to zero, the signaling can depend only on whether the value of MVDy is equal to zero (rather than checking both MVDx and MVDy).

[0094] In some embodiments, the first component includes one of a horizontal component and a vertical component of the motion vector difference, and the second component includes the other of the horizontal component and the vertical component.

[0095] In some embodiments, the resolution information is not included in the bitstream and the resolution information is inferred to be a predefined value indicating a predefined resolution.

[0096] In some embodiments, the current video block is encoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode or a sample-based IBC AMVP mode, and the predefined resolution is 1 pixel precision.

[0097] In some embodiments, the current video block is encoded and decoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode. Resolution information of the motion vector difference is included in the bitstream if at least one of the following conditions is met: a first condition: at least one of a horizontal component of the motion vector difference or a vertical component of the motion vector difference is not zero, and a reordering type of the current video block indicates a non-flip reordering, a second condition: the horizontal component of the motion vector difference is not zero, and the reordering type indicates a horizontal flip type, or a third condition: the vertical component of the motion vector difference is not zero, and the reordering type indicates a vertical flip type.

[0098] For example, the resolution information amvr_precision_idx may be signaled in the bitstream as follows, where cu_ibc_reorder_type indicates whether and how to reorder samples in an IBC AMVP coded block.

[0099] 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 video processing device. In the method, motion information of a current video block of the video is determined. The motion information is updated based on a constraint. The constraint indicates a target value of a component of the motion information. The bitstream is generated based on the updated motion information.

[0100] According to some other embodiments of the present disclosure, a method for storing a bitstream of a video is provided. In the method, motion information of a current video block of the video is determined. The motion information is updated based on a constraint. The constraint indicates a target value of a component of the motion information. A bitstream is generated based on the updated motion information. The bitstream is stored in a non-temporary computer-readable recording medium.

[0101] Fig.11 A flow chart of a method 1100 for video processing according to an embodiment of the present disclosure is shown. The method 1100 is implemented for conversion between a current video block of a video and a bitstream of the video. In some embodiments, the conversion between the current video block and the bitstream may include encoding the current video block into the bitstream. Alternatively or additionally, the conversion may include decoding the current video block from the bitstream.

[0102] At block 1110, information of at least one sample associated with the current video block is determined based on a sample reordering tool for the current video block. At block 1120, a conversion is performed based on the information.

[0103] Method 1200 enables the determination of samples of the current video block based on a sample reordering tool. For example, a template matching-based method can be modified with sample reordering enabled. In this way, codec effectiveness and codec efficiency can be improved.

[0104] In some embodiments, the current video block comprises a first video block encoded using template matching with sample reordering or a second video block encoded using template matching without sample reordering.

[0105] In some embodiments, the information of the at least one sample includes at least one position of the at least one sample. The at least one sample includes a template for the current video block. For example, the position of the sample including the template may depend on the sample reordering method used for the video unit.

[0106] In some embodiments, a first position of a first template for a first video block is different than a second position of a second template for a second video block.

[0107] In some embodiments, the second template is constructed using at least one sample above or to the left of the second video block.

[0108] In some embodiments, the first template is constructed using at least one sample above or to the left of the first video block.

[0109] In some embodiments, the first video block is encoded with horizontal flipping, and the first template is constructed using at least one sample above the first video block.

[0110] In some embodiments, the first video block is encoded with vertical flipping, and the first template is constructed using at least one sample on the left side of the first video block.

[0111] In some embodiments, the first position of the first template for the first video block and the second position of the second template for the second video block are the same.

[0112] In some embodiments, the information of the at least one sample comprises the number of samples comprising the template for the current video block. For example, the number of samples comprising the template may depend on the sample reordering method used for the video unit.

[0113] In some embodiments, a first number of rows of the first template for the first video block is different from a second number of rows of the second template for the second video block. Alternatively or additionally, in some embodiments, a third number of columns of the first template for the first video block is different from a fourth number of columns of the second template for the second video block.

[0114] In some embodiments, the second template is constructed using a second number of sample rows above the second video block and a fourth number of columns to the left of the second video block.

[0115] In some embodiments, the first template is constructed using at least one of: a first number of rows of samples above the first video block, or a third number of columns of samples to the left of the first video block.

[0116] In some embodiments, the first number of rows of the first template for the first video block is the same as the second number of rows of the second template for the second video block. Alternatively or additionally, in some embodiments, the third number of columns of the first template for the first video block is the same as the fourth number of columns of the second template for the second video block.

[0117] For example, the second template may be constructed using M1 row samples above the video unit and N1 column samples to the left of the video unit, while the first template may be constructed using M2 row samples above the video unit and / or N2 column samples to the left of the video unit. The following rules may be met: M1 is not equal to M2, or N1 is not equal to N2.

[0118] In some embodiments, the current video block is encoded using at least one of: an intra template matching mode, or an intra block copy (IBC) mode with template matching.

[0119] 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 video processing device. In the method, based on a sample reordering tool for a current video block of the video, information of at least one sample associated with the current video block is determined; and a bitstream is generated based on the information.

[0120] According to some other embodiments of the present disclosure, a method for storing a bitstream of a video is provided. In the method, based on a sample reordering tool for a current video block of the video, information of at least one sample associated with the current video block is determined; a bitstream is generated based on the information; and the bitstream is stored in a non-transitory computer-readable recording medium.

[0121] In some embodiments, method 1000 or method 1100 further includes: indicating in the bitstream another information about whether and / or how to apply the method.

[0122] In some embodiments, the further information is indicated at one of: sequence level, group of picture level, picture level, slice level or tile group level.

[0123] In some embodiments, the further information is indicated in a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, or a tile group header.

[0124] In some embodiments, further information is indicated in a region containing more than one sample or pixel.

[0125] In some embodiments, the region includes one of the following: prediction block (PB), transform block (TB), codec block (CB), prediction unit (PU), transform unit (TU), codec unit (CU), virtual pipeline data unit (VPDU), codec tree unit (CTU), CTU row, slice, tile, sub-picture.

[0126] In some embodiments, the further information depends on the codec information.

[0127] In some embodiments, the encoded information includes at least one of: a codec mode, a block size, a color format, a single tree partition or a dual tree partition, a color component, a slice type, or a picture type.

[0128] It should be understood that the above method 1000 and / or method 1100 can be used in combination or alone. Any suitable combination of these methods can be applied. The scope of the present disclosure is not limited in this regard.

[0129] By using these methods 1000 and 1100 individually or in combination, motion information can be improved, which can improve coding effectiveness and coding efficiency.

[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: determining motion information of a current video block of a video and a bitstream of the video for conversion between the current video block; updating the motion information based on a constraint, wherein the constraint indicates a target value of a component of the motion information; and performing the conversion based on the updated motion information.

[0132] Clause 2. The method of clause 1, wherein the motion information comprises at least one of: a motion vector, a motion vector difference, or a motion vector predictor.

[0133] Clause 3. A method according to clause 1 or clause 2, wherein the current video block is encoded and decoded using at least one of: intra block copy (IBC) advanced motion vector prediction (AMVP) mode, IBC merge mode, IBC merge mode with template matching, intra template matching, IBC AMVP mode based on sample reordering, IBC merge mode based on sample reordering, IBC merge mode based on sample reordering with template matching, or intra template matching based on sample reordering.

[0134] Clause 4. A method according to any one of clauses 1-3, wherein the component of the motion information comprises at least one of: a horizontal component of the motion information, or a vertical component of the motion information.

[0135] Clause 5. A method according to any one of clauses 1-4, wherein the current video block is encoded and decoded using a sample reordering based intra block copy (IBC) advanced motion vector prediction (AMVP) mode, and wherein updating the motion information based on a constraint includes: updating the vertical component of the motion information to the target value.

[0136] Clause 6. The method of clause 5, wherein samples of the current video block are flipped horizontally.

[0137] Clause 7. A method according to any one of clauses 1-4, wherein the current video block is encoded and decoded using a sample reordering based intra block copy (IBC) advanced motion vector prediction (AMVP) mode, and wherein updating the motion information based on constraints includes: updating the horizontal component of the motion information to the target value.

[0138] Clause 8. The method of clause 7, wherein samples of the current video block are flipped vertically.

[0139] Clause 9. A method according to any one of clauses 1-8, wherein if a component of the motion vector of the current video block is updated to the target value, a corresponding component of at least one of the motion vector difference of the current video block or the motion vector predictor of the current video block is updated to the target value.

[0140] Clause 10. The method of clause 9, wherein the component of the motion vector comprises at least one of: a horizontal component of the motion vector, or a vertical component of the motion vector.

[0141] Clause 11. The method of any of clauses 1-10, wherein if a component of a motion vector of the current video block is updated to the target value, then the component of the motion vector is not included in the bitstream.

[0142] Clause 12. The method of clause 11, wherein the component of the motion vector is inferred to be zero.

[0143] Clause 13. The method of any of clauses 1-12, wherein based on the constraint, a representation of the motion information is not included in the bitstream, the motion information comprising a motion vector difference for the current video block.

[0144] Clause 14. The method of clause 13, wherein a horizontal component of the motion vector difference is updated to the target value, and the representation of the motion information comprises a sign of the horizontal component.

[0145] Clause 15. The method of clause 13, wherein a vertical component of the motion vector difference is updated to the target value, and the representation of the motion information comprises a sign of the vertical component.

[0146] Clause 16. The method of any one of clauses 1-15, wherein the target value is zero.

[0147] Clause 17. The method of any of clauses 1-16, wherein the target value is included in the bitstream.

[0148] Clause 18. The method of any one of clauses 1-17, wherein the target value is derived during the conversion.

[0149] Clause 19. A method according to any one of clauses 1-18, wherein the current video block is encoded and decoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode, and wherein updating the motion information includes: updating at least one of the vertical component of the motion information or the horizontal component of the motion information to the target value.

[0150] Clause 20. The method of any one of clauses 1-19, further comprising: determining to include resolution information of the motion information in the bitstream based on the constraint, the motion information comprising a motion vector difference for the current video block.

[0151] Clause 21. The method of clause 20, wherein the resolution information comprises a precision index of an adaptive motion vector resolution (AMVR).

[0152] Clause 22. A method according to clause 20 or clause 21, wherein the current video block is encoded and decoded using at least one of the following: intra block copy (IBC) advanced motion vector prediction (AMVP) mode, AMVP mode, IBC AMVP mode based on sample reordering, or AMVP mode based on sample reordering.

[0153] Clause 23. A method according to any of clauses 20-22, wherein the constraint indicates the target value of a first component of the motion vector difference, and the inclusion of the resolution information in the bitstream is decoupled from the first component.

[0154] Clause 24. The method of clause 23, wherein determining to include resolution information in the bitstream comprises determining to include the resolution information in the bitstream based on a value of a second component of the motion vector difference.

[0155] Clause 25. The method of clause 24, wherein the first component comprises one of a horizontal component and a vertical component of the motion vector difference, and the second component comprises the other of the horizontal component and the vertical component.

[0156] Clause 26. A method according to any of clauses 20-25, wherein the resolution information is not included in the bitstream and the resolution information is inferred to be a predefined value indicating a predefined resolution.

[0157] Clause 27. The method of clause 26, wherein the current video block is encoded using intra block copy (IBC) advanced motion vector prediction (AMVP) mode or sample-based IBC AMVP mode, and the predefined resolution is 1-pixel precision.

[0158] Clause 28. A method according to any one of clauses 20-27, wherein the current video block is encoded and decoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode, and the resolution information of the motion vector difference is included in the bitstream if at least one of the following conditions is met: a first condition: at least one of the horizontal component of the motion vector difference or the vertical component of the motion vector difference is not zero, and the reordering type of the current video block indicates a non-flip reordering; a second condition: the horizontal component of the motion vector difference is not zero, and the reordering type indicates a horizontal flip type; or, a third condition: the vertical component of the motion vector difference is not zero, and the reordering type indicates a vertical flip type.

[0159] Clause 29. A method for video processing, comprising: for conversion between a current video block of a video and a bitstream of the video, determining information of at least one sample associated with the current video block based on a sample reordering tool for the current video block; and performing the conversion based on the information.

[0160] Clause 30. The method of Clause 29, wherein the current video block comprises a first video block encoded using template matching with sample reordering or a second video block encoded using template matching without sample reordering.

[0161] Clause 31. The method of clause 29 or clause 30, wherein the information of the at least one sample comprises at least one position of the at least one sample, the at least one sample comprising a template for the current video block.

[0162] Clause 32. The method of clause 31, wherein a first position of a first template for the first video block is different than a second position of a second template for the second video block.

[0163] Clause 33. The method of clause 32, wherein the second template is constructed using at least one sample above or to the left of the second video block.

[0164] Clause 34. The method of clause 32 or clause 33, wherein the first template is constructed using at least one sample above or to the left of the first video block.

[0165] Clause 35. The method of any of clauses 32-34, wherein the first video block is encoded with horizontal flipping, and the first template is constructed with at least one sample above the first video block.

[0166] Clause 36. The method of any of clauses 32-35, wherein the first video block is encoded with vertical flipping, and the first template is constructed with at least one sample on the left side of the first video block.

[0167] Clause 37. The method of clause 31, wherein a first position of a first template for the first video block and a second position of a second template for the second video block are the same.

[0168] Clause 38. The method of clause 29 or clause 30, wherein the information of the at least one sample comprises a number of samples comprising the template for the current video block.

[0169] Clause 39. A method according to clause 38, wherein a first number of rows of the first template used for the first video block is different from a second number of rows of the second template used for the second video block, and / or wherein a third number of columns of the first template used for the first video block is different from a fourth number of columns of the second template used for the second video block.

[0170] Clause 40. The method of Clause 39, wherein the second template is constructed using the second number of rows of samples above the second video block and the fourth number of columns to the left of the second video block.

[0171] Clause 41. The method of clause 39 or clause 40, wherein the first template is constructed using at least one of: a first number of rows of samples above the first video block, or a third number of columns of samples to the left of the first video block.

[0172] Clause 42. A method according to clause 38, wherein a first number of rows of the first template for the first video block is the same as a second number of rows of the second template for the second video block, and / or wherein a third number of columns of the first template for the first video block is the same as a fourth number of columns of the second template for the second video block.

[0173] Clause 43. The method of any of clauses 29-42, wherein the current video block is encoded using at least one of: an intra template matching mode, or an intra block copy (IBC) mode with template matching.

[0174] Clause 44. The method according to any of clauses 1-43, further comprising: indicating in the bitstream further information about whether and / or how to apply the method.

[0175] Clause 45. The method of clause 44, wherein the further information is indicated at one of: a sequence level, a group of pictures level, a picture level, a slice level, or a tile group level.

[0176] Clause 46. A method according to clause 44 or clause 45, wherein the other information is indicated in a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header or a tile group header.

[0177] Clause 47. A method according to any one of clauses 44 to 46, wherein the further information is indicated in an area comprising more than one sample or pixel.

[0178] Clause 48. A method according to clause 47, wherein the area includes one of the following: a prediction block (PB), a transform block (TB), a codec block (CB), a prediction unit (PU), a transform unit (TU), a codec unit (CU), a virtual pipeline data unit (VPDU), a codec tree unit (CTU), a CTU row, a slice, a tile, and a sub-picture.

[0179] Clause 49. A method according to any one of clauses 44 to 48, wherein the further information depends on codec information.

[0180] Clause 50. The method according to clause 49, wherein the codec information comprises at least one of the following: codec mode, block size, color format, single tree partitioning or dual tree partitioning, color component, slice type or picture type.

[0181] Clause 51. The method of any of clauses 1-50, wherein the converting comprises encoding the current video block into the bitstream.

[0182] Clause 52. The method of any of clauses 1-50, wherein the converting comprises decoding the current video block from the bitstream.

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

[0184] Clause 54. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform the method of any one of clauses 1 to 52.

[0185] Clause 55. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: determining motion information of a current video block of the video; updating the motion information based on a constraint, wherein the constraint indicates a target value of a component of the motion information; and generating the bitstream based on the updated motion information.

[0186] Clause 56. A method for storing a bitstream of a video, comprising: determining motion information of a current video block of the video; updating the motion information based on a constraint, the constraint indicating a target value of a component of the motion information; generating the bitstream based on the updated motion information; and storing the bitstream in a non-transitory computer-readable recording medium.

[0187] Clause 57. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: determining information of at least one sample associated with a current video block based on a sample reordering tool for the current video block of the video; and generating the bitstream based on the information.

[0188] Clause 58. A method for storing a bitstream of a video, comprising: determining information of at least one sample associated with a current video block of the video based on a sample reordering tool for the current video block of the video; generating the bitstream based on the information; and storing the bitstream in a non-transitory computer-readable recording medium. Example Device

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

[0190] It should be understood that Fig.12 The computing device 1200 shown is for illustration 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.

[0191] like Fig.12 As shown, computing device 1200 includes a general computing device 1200. Computing device 1200 may include at least one or more processors or processing units 1210, memory 1220, storage unit 1230, one or more communication units 1240, one or more input devices 1250, and one or more output devices 1260.

[0192] In some embodiments, the computing device 1200 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 tablet 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 e-book device, a gaming device, or any combination thereof, including accessories and peripherals of these devices, or any combination thereof. It can be expected that the computing device 1200 can support any type of interface with the user (such as a "wearable" circuit, etc.).

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

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

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

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

[0197] Input device 1250 may be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, etc. Output device 1260 may be one or more of various output devices, such as a display, speaker, printer, etc. Through communication unit 1240, computing device 1200 may also communicate with one or more external devices (not shown) such as storage devices and display devices, one or more of which enable a user to interact with computing device 1200, or any device (e.g., a network card, a modem, etc.) that enables computing device 1200 to communicate with one or more other computing devices if necessary. Such communication may be performed via an input / output (I / O) interface (not shown).

[0198] In some embodiments, some or all components of the computing device 1200 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 do not require end users to understand the physical location or configuration of the system or hardware that provides these services. In various embodiments, cloud computing uses a suitable protocol to provide services over a wide area network (e.g., the Internet). For example, a cloud computing provider provides applications over 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 server at a remote location. 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 act as a single access point for users. Therefore, cloud computing architecture may be used to provide components and functions described herein from a service provider at a remote location. Alternatively, they may be provided from a conventional server or directly installed or otherwise installed on a client device.

[0199] The computing device 1200 may be used to implement video encoding / decoding in embodiments of the present invention. The memory 1220 may include one or more video encoding / decoding modules 1225 having one or more program instructions. These modules may be accessed and executed by the processing unit 1210 to perform the functions of various embodiments described herein.

[0200] In an example embodiment performing video encoding and decoding, input device 1250 may receive video data as input to be encoded 1270. For example, the video data may be processed by video encoding and decoding module 1225 to generate an encoded bitstream. The encoded bitstream may be provided as output 1280 via output device 1260.

[0201] In an example embodiment performing video decoding, input device 1250 may receive an encoded bitstream as input 1270. The encoded bitstream may be processed, for example, by video codec module 1225 to generate decoded video data. The decoded video data may be provided as output 1280 via output device 1260.

[0202] Although the present disclosure has been specifically shown and described with reference to its preferred embodiments, it will be appreciated by those skilled in the art that various changes in form and detail may be made therein 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, comprising: Determining motion information of a current video block of a video for a conversion between the current video block and a bitstream of the video; updating the motion information based on constraints, the constraints indicating target values ​​for components of the motion information; as well as The converting is performed based on the updated motion information.

2. The method according to claim 1, wherein the motion information comprises at least one of the following: Motion vector, Motion vector difference, or Motion vector predictor.

3. The method of claim 1 or claim 2, wherein the current video block is encoded and decoded using at least one of the following: Intra Block Copy (IBC) Advanced Motion Vector Prediction (AMVP) mode, IBC merger mode, IBC merge mode with template matching, Intra-frame template matching, IBC AMVP mode based on sample reordering, IBC merging mode based on sample reordering, Sample reordering-based IBC merge mode with template matching, or Intra-frame template matching based on sample reordering.

4. The method according to any one of claims 1 to 3, wherein the components of the motion information include at least one of the following: the horizontal component of the motion information, or The vertical component of the motion information.

5. The method according to any one of claims 1 to 4, wherein the current video block is encoded and decoded using an Intra Block Copy (IBC) Advanced Motion Vector Prediction (AMVP) mode based on sample reordering, and Wherein updating the motion information based on the constraint comprises: The vertical component of the motion information is updated to the target value. The method of claim 5 , wherein samples of the current video block are flipped horizontally.

7. The method according to any one of claims 1 to 4, wherein the current video block is encoded and decoded using an Intra Block Copy (IBC) Advanced Motion Vector Prediction (AMVP) mode based on sample reordering, and Wherein updating the motion information based on the constraint condition comprises: The horizontal component of the motion information is updated to the target value. The method of claim 7 , wherein samples of the current video block are flipped vertically.

9. The method according to any one of claims 1 to 8, wherein if a component of the motion vector of the current video block is updated to the target value, a corresponding component of at least one of the motion vector difference of the current video block or the motion vector predictor of the current video block is updated to the target value.

10. The method of claim 9, wherein the components of the motion vector include at least one of: the horizontal component of the motion vector, or The vertical component of the motion vector.

11. The method of any one of claims 1-10, wherein if a component of the motion vector of the current video block is updated to the target value, the component of the motion vector is not included in the bitstream. The method of claim 11 , wherein the component of the motion vector is inferred to be zero.

13. The method of any one of claims 1-12, wherein based on the constraint, a representation of the motion information is not included in the bitstream, the motion information comprising a motion vector difference for the current video block.

14. The method of claim 13, wherein a horizontal component of the motion vector difference is updated to the target value, and the representation of the motion information includes a sign of the horizontal component.

15. The method of claim 13, wherein a vertical component of the motion vector difference is updated to the target value, and the representation of the motion information includes a sign of the vertical component.

16. The method according to any one of claims 1-15, wherein the target value is zero.

17. The method according to any one of claims 1-16, wherein the target value is included in the bitstream.

18. The method according to any one of claims 1-17, wherein the target value is derived during the conversion.

19. The method of any one of claims 1-18, wherein the current video block is encoded and decoded using intra block copy (IBC) advanced motion vector prediction (AMVP) mode, and Wherein updating the motion information comprises: At least one of the vertical component of the motion information or the horizontal component of the motion information is updated to the target value.

20. The method according to any one of claims 1 to 19, further comprising: Determining to include resolution information of the motion information in the bitstream based on the constraint, the motion information comprising a motion vector difference for the current video block.

21. The method of claim 20, wherein the resolution information comprises a precision index of an adaptive motion vector resolution (AMVR).

22. The method of claim 20 or claim 21, wherein the current video block is encoded using at least one of: Intra Block Copy (IBC) Advanced Motion Vector Prediction (AMVP) mode, AMVP mode, IBC AMVP mode based on sample reordering, or AMVP mode based on sample reordering.

23. The method of any of claims 20-22, wherein the constraint indicates the target value of a first component of the motion vector difference, and the including of the resolution information in the bitstream is decoupled from the first component.

24. The method of claim 23, wherein determining to include resolution information in the bitstream comprises: Based on the value of the second component of the motion vector difference, it is determined to include the resolution information in the bitstream.

25. The method of claim 24, wherein the first component comprises one of a horizontal component and a vertical component of the motion vector difference, and the second component comprises the other of the horizontal component and the vertical component.

26. The method according to any one of claims 20-25, wherein the resolution information is not included in the bitstream and the resolution information is inferred to be a predefined value indicating a predefined resolution.

27. The method of claim 26, wherein the current video block is encoded using an intra block copy (IBC) advanced motion vector prediction (AMVP) mode or a sample-based IBC AMVP mode, and the predefined resolution is 1-pixel precision.

28. The method of any one of claims 20-27, wherein the current video block is encoded and decoded using intra block copy (IBC) advanced motion vector prediction (AMVP) mode, and The resolution information of the motion vector difference is included in the bitstream if at least one of the following conditions is met: First condition: at least one of the horizontal component of the motion vector difference or the vertical component of the motion vector difference is not zero, and the reordering type of the current video block indicates no flip reordering; Second condition: the horizontal component of the motion vector difference is not zero, and the reordering type indicates a horizontal flip type; or, Third condition: the vertical component of the motion vector difference is not zero, and the reordering type indicates a vertical flip type.

29. A method for video processing, comprising: For conversion between a current video block of a video and a bitstream of the video, determining information of at least one sample associated with the current video block based on a sample reordering tool for the current video block; as well as The converting is performed based on the information.

30. The method of claim 29, wherein the current video block comprises a first video block encoded using template matching with sample reordering or a second video block encoded using template matching without sample reordering.

31. The method of claim 29 or claim 30, wherein the information of the at least one sample comprises at least one position of the at least one sample, the at least one sample comprising a template for the current video block.

32. The method of claim 31, wherein a first position of a first template for the first video block is different than a second position of a second template for the second video block.

33. The method of claim 32, wherein the second template is constructed using at least one sample above or to the left of the second video block.

34. The method of claim 32 or claim 33, wherein the first template is constructed using at least one sample above or to the left of the first video block.

35. The method of any one of claims 32-34, wherein the first video block is encoded with horizontal flipping, and the first template is constructed with at least one sample above the first video block.

36. The method of any one of claims 32-35, wherein the first video block is encoded with vertical flipping, and the first template is constructed with at least one sample on the left side of the first video block.

37. The method of claim 31, wherein a first position of a first template for the first video block and a second position of a second template for the second video block are the same.

38. The method of claim 29 or claim 30, wherein the information of the at least one sample comprises the number of samples, the samples comprising the template for the current video block.

39. The method of claim 38, wherein a first number of rows of a first template for the first video block is different from a second number of rows of a second template for the second video block, and / or Wherein a third number of columns of the first template for the first video block is different from a fourth number of columns of the second template for the second video block.

40. The method of claim 39, wherein the second template is constructed utilizing the second number of sample rows above the second video block and the fourth number of columns to the left of the second video block.

41. The method of claim 39 or claim 40, wherein the first template is constructed using at least one of: a first number of sample rows above the first video block, or A third number of sample rows on the left side of the first video block.

42. The method of claim 38, wherein a first number of rows of a first template for the first video block and a second number of rows of a second template for the second video block are the same, and / or Wherein a third number of columns of the first template for the first video block and a fourth number of columns of the second template for the second video block are the same.

43. The method of any one of claims 29-42, wherein the current video block is encoded using at least one of: Intra-frame template matching mode, or Intra Block Copy (IBC) mode with template matching.

44. The method according to any one of claims 1 to 43, further comprising: Further information as to whether and / or how the method is applied is indicated in the bitstream.

45. The method of claim 44, wherein the further information is indicated at one of: a sequence level, a group of pictures level, a picture level, a slice level, or a tile group level.

46. ​​A method according to claim 44 or claim 45, wherein the other information is indicated in a sequence header, a picture header, a sequence parameter set (SPS), a video parameter set (VPS), a decoding parameter set (DPS), decoding capability information (DCI), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header or a tile group header.

47. A method according to any one of claims 44 to 46, wherein the further information is indicated in an area comprising more than one sample or pixel.

48. The method of claim 47, wherein the region comprises one of: a prediction block (PB), a transform block (TB), a codec block (CB), a prediction unit (PU), a transform unit (TU), a codec unit (CU), a virtual pipeline data unit (VPDU), a codec tree unit (CTU), a CTU row, a slice, a tile, a sub-picture.

49. A method according to any one of claims 44 to 48, wherein the further information depends on codec information.

50. The method according to claim 49, wherein the codec information comprises at least one of the following: codec mode, block size, color format, single tree partition or double tree partition, color component, slice type or picture type.

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

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

53. An apparatus for processing video data, 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 to 52.

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

55. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: Determining motion information of a current video block of the video; updating the motion information based on constraints, the constraints indicating target values ​​for components of the motion information; as well as The bitstream is generated based on the updated motion information.

56. A method for storing a bitstream of a video, comprising: Determining motion information of a current video block of the video; updating the motion information based on constraints, the constraints indicating target values ​​for components of the motion information; generating the bitstream based on the updated motion information; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

57. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: determining, based on a sample reordering tool for a current video block of the video, information of at least one sample associated with the current video block; as well as The bitstream is generated based on the information.

58. A method for storing a bitstream of a video, comprising: determining, based on a sample reordering tool for a current video block of the video, information of at least one sample associated with the current video block; generating the bitstream based on the information; as well as The bit stream is stored in a non-transitory computer-readable recording medium.