Method and device for video processing and medium
By refining the affine motion compensation information of the video block and refining the control point motion vector using the previously coded sample points, the problem of insufficient refining affine motion compensation information in the prior art is solved, and the efficiency and effectiveness of video encoding and decoding are improved.
Patent Information
- Application Number
- CN202380079941.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-11-18
- Filing Date
- 2023-11-17
- Publication Date
- 2025-06-27
AI Technical Summary
In the existing video encoding and decoding technology, the affine motion compensation information is insufficient, resulting in low encoding and decoding efficiency and effectiveness.
By refining the affine motion compensation information for the video block in video processing, the previously coded sample points are used to refine the control point motion vectors to improve the accuracy of affine motion compensation.
Improve the efficiency and effectiveness of video encoding and decoding, and reduce errors and redundancy in the encoding and decoding process through more precise affine motion compensation information.
Smart Images

Figure CN120226350A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to video processing technologies, and in particular, to affine motion compensation refinement. Background Art
[0002] Nowadays, digital video capabilities are being applied to all aspects of people's lives. For video encoding / decoding, various types of video compression technologies have been proposed, such as MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), ITU-T H.265 High Efficiency Video Coding (HEVC) standard, Versatile Video Coding (VVC) standard. However, there is an overall expectation to further improve the encoding / decoding efficiency of video encoding / decoding technologies. Summary of the Invention
[0003] Embodiments of the present disclosure provide a solution for video processing.
[0004] In a first aspect, a method for video processing is proposed. The method includes: determining affine motion compensation information for a current video block of a video in connection with a conversion between the current video block of the video and a bitstream of the video; performing a refinement process on the affine motion compensation information based on at least one previously encoded / decoded sample point to obtain refined affine motion compensation information; and performing the conversion based on the refined affine motion compensation information. The method according to the first aspect of the present disclosure refines the affine motion compensation information. For example, the control point motion vector (CPMV) used in affine motion compensation can be refined. In this way, the encoding / decoding efficiency and encoding / decoding effectiveness can be improved.
[0005] In a second aspect, a device for video processing is proposed. The device includes a processor and a non-transitory memory having instructions thereon. The instructions, when executed by the processor, cause the processor to execute the method according to the first aspect of the present disclosure.
[0006] In a third aspect, a non-transitory computer-readable storage medium is proposed. The non-transitory computer-readable storage medium stores instructions that cause a processor to execute the method according to the first aspect of the present disclosure.
[0007] In a fourth aspect, another non-transitory computer-readable recording medium is proposed. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method executed by a device for video processing. The method includes: determining affine motion compensation information for a current video block of the video; performing a refinement process on the affine motion compensation information based on at least one previously encoded / decoded sample point to obtain refined affine motion compensation information; and generating the bitstream based on the refined affine motion compensation information.
[0008] In a fifth aspect, a method for storing a bitstream of a video is proposed. The method includes: determining affine motion compensation information of a current video block of the video; performing a refinement process on the affine motion compensation information based on at least one previously decoded sample to obtain refined affine motion compensation information; generating the bitstream based on the refined affine motion compensation information; and storing the bitstream in a non-transitory computer-readable recording medium.
[0009] The present invention content is provided to introduce a selection of concepts further described below in the detailed implementation in a simplified form. The present invention content is not intended to identify the 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
[0010] Through the following detailed description with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present disclosure will become more apparent. In the exemplary embodiments of the present disclosure, the same reference numerals generally refer to the same components.
[0011] Figure 1 A block diagram showing an example video codec system according to some embodiments of the present disclosure is shown;
[0012] Figure 2 A block diagram showing a first example video encoder according to some embodiments of the present disclosure is shown;
[0013] Figure 3 A block diagram showing an example video decoder according to some embodiments of the present disclosure is shown;
[0014] Figure 4 The positions of spatial and temporal neighboring blocks used in AMVP / Merge candidate list construction are shown;
[0015] Figure 5 The positions of non-adjacent candidates in ECM are shown;
[0016] Figure 6A An affine motion model based on four-parameter control points is shown;
[0017] Figure 6B An affine motion model based on six-parameter control points is shown;
[0018] Figure 7 The affine MVF of each sub-block is shown;
[0019] Figure 8 The position of the inherited affine motion prediction value is shown;
[0020] Figure 9Shows the inheritance of control point motion vectors;
[0021] Figure 10 Shows the positions for constructing candidate positions of the affine Merge mode;
[0022] Figure 11 Shows the spatial neighbors for deriving affine Merge candidates, where Figure 11 (a) in is for deriving inherited affine Merge candidates, and in Figure 11 (B) is for deriving constructed affine Merge candidates;
[0023] Figure 12 Shows the graph from non - adjacent neighbors to constructed affine Merge candidates;
[0024] Figure 13 Shows an example of generating HAPC;
[0025] Figure 14 Shows an illustration of regression - based affine Merge candidate derivation;
[0026] Figure 15 Shows template matching performed on a search area around the initial MV;
[0027] Figure 16 Shows the template and the corresponding reference template;
[0028] Figure 17 Shows the template and the reference template of a block with sub - block motion using the motion information of sub - blocks of the current block;
[0029] Figure 18 Shows the graph for deriving the sub - CU motion field obtained by applying motion displacement based on neighboring motion information;
[0030] Figure 19 Shows a flowchart of a method for video processing according to an embodiment of the present disclosure;
[0031] Figure 20 Shows a block diagram of a computing device in which various embodiments of the present disclosure can be implemented.
[0032] Throughout all the figures, the same or similar reference numerals generally refer to the same or similar elements. Detailed Description of the Embodiments
[0033] The principles of the present disclosure will now be described with reference to some embodiments. It should be understood that the description of these embodiments is only for illustration and to assist those skilled in the art in understanding and implementing the present disclosure, and does not imply any limitation on the scope of the present disclosure. The disclosure described herein can be implemented in various ways other than those described below.
[0034] In the following description and claims, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.
[0035] References in this disclosure to "one embodiment", "an embodiment", "example embodiment", etc., indicate that the described embodiment may include a particular feature, structure, or characteristic, but not every embodiment necessarily includes that particular feature, structure, or characteristic. Moreover, these phrases do not necessarily refer to the same embodiment. Further, when a particular feature, structure, or characteristic is described in connection with an example embodiment, it is submitted that such feature, structure, or characteristic, whether or not explicitly described, is within the knowledge of one of ordinary skill in the art in relation to other embodiments.
[0036] It should be understood that although terms such as "first" and "second" may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element may be termed a second element, and similarly, a second element may be termed a first element, without departing from the scope of the example embodiments. As used herein, the term "and / or" includes any and all combinations of one or more of the listed terms.
[0037] The terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the example embodiments. As used herein, the singular forms "a", "an", and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "comprises", "comprising", "has", "having", "includes", and / or "including", when used herein, specify the presence of the stated features, elements, and / or components, etc., but do not preclude the presence or addition of one or more other features, elements, components, and / or combinations thereof. Example Environment
[0038] Figure 1 is a block diagram illustrating an example video codec system 100 that may utilize the techniques of this 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.
[0039] Video source 112 may include sources such as video capture devices. Examples of video capture devices include, but are not limited to, an interface for receiving video data from a video content provider, a computer graphics system for generating video data, and / or a combination thereof.
[0040] 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 bitstream. The bitstream may include a sequence of bits that forms an encoded representation of the video data. The bitstream may include encoded pictures and associated data. The encoded picture is an encoded representation of a picture. The associated data may include a sequence parameter set, a picture parameter set, and other syntax structures. The I / O interface 116 may include a modulator / demodulator and / or a transmitter. The encoded video data may be directly transmitted to the destination device 120 via the I / O interface 116 through the network 130A. The encoded video data may also be stored on the storage medium / server 130B for access by the destination device 120.
[0041] 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 modulator. The I / O interface 126 may obtain the 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 external to the destination device 120, which is configured to interface with an external display device.
[0042] The video encoder 114 and the video decoder 124 may operate according to video compression standards such as the High Efficiency Video Coding (HEVC) standard, the Versatile Video Coding (VVC) standard, and other existing and / or future standards.
[0043] Figure 2 is a block diagram showing an example of a video encoder 200 according to some embodiments of the present disclosure. The video encoder 200 may be Figure 1 an example of the video encoder 114 in the system 100 shown.
[0044] The video encoder 200 may be configured to implement any or all of the techniques of the present disclosure. In Figure 2 the example of, the video encoder 200 includes a plurality of functional components. The techniques described in the present disclosure may be shared among the various components of the video encoder 200. In some examples, the processor may be configured to execute any or all of the techniques described in the present disclosure.
[0045] In some embodiments, the video encoder 200 may include a segmentation 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. The prediction unit 202 may include a mode selection unit 203, a motion estimation unit 204, a motion compensation unit 205, and an intra prediction unit 206.
[0046] 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 in which at least one reference picture is the picture in which the current video block is located.
[0047] Furthermore, although some components (such as the motion estimation unit 204 and the motion compensation unit 205) may be integrated, for explanatory purposes, these components are shown separately in the Figure 2 examples.
[0048] The segmentation unit 201 may segment a picture into one or more video blocks. The video encoder 200 and the video decoder 300 may support various video block sizes.
[0049] The mode selection unit 203 may select, for example, one coding mode among multiple coding modes (intra coding or inter coding) based on an error result, and provide the resulting intra-coded block or inter-coded block to the residual generation unit 207 to generate residual block data, and provide it to the reconstruction unit 212 to reconstruct the coded block for use as a reference picture. In some examples, the mode selection unit 203 may select a Combined Intra and Inter Prediction (CIIP) mode in which the prediction is based on an inter prediction signal and an intra prediction signal. In the case of inter prediction, the mode selection unit 203 may also select a resolution for the motion vector for the block (e.g., sub-pixel accuracy or integer pixel accuracy).
[0050] To perform inter prediction on the current video block, the motion estimation unit 204 may generate motion information for the current video block by comparing one or more reference frames from the buffer 213 with the current video block. The motion compensation unit 205 may determine a predicted video block for the current video block based on the motion information and the decoded samples of a picture from the buffer 213 other than the picture associated with the current video block.
[0051] The motion estimation unit 204 and the motion compensation unit 205 can perform different operations on a current video block. For example, depending on whether the current video block is in an I-slice, a P-slice, or a B-slice. As used herein, an "I-slice" may refer to a portion of a picture composed of macroblocks, all of which are based on macroblocks within the same picture. Additionally, as used herein, in some aspects, a "P-slice" and a "B-slice" may refer to portions of a picture composed of macroblocks that are independent of the macroblocks in the same picture.
[0052] In some examples, the motion estimation unit 204 can perform uni-directional prediction on the current video block, and the motion estimation unit 204 can search the reference pictures in list 0 or list 1 to find a reference video block for the current video block. The motion estimation unit 204 can then generate a reference index and a motion vector, the reference index indicating the reference picture in list 0 or list 1 that contains 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 can 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 can 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.
[0053] Alternatively, in other examples, the motion estimation unit 204 can perform bi-directional prediction on the current video block. The motion estimation unit 204 can search the reference pictures in list 0 to find one reference video block for the current video block, and can also search the reference pictures in list 1 to find another reference video block for the current video block. The motion estimation unit 204 can then generate a plurality of reference indices and a plurality of motion vectors, the plurality of reference indices indicating the plurality of reference pictures in list 0 and list 1 that contain the plurality of reference video blocks, and the plurality of motion vectors indicating the plurality of spatial displacements between the plurality of reference video blocks and the current video block. The motion estimation unit 204 can output the plurality of reference indices and the plurality of motion vectors of the current video block as the motion information of the current video block. The motion compensation unit 205 can 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.
[0054] In some examples, the motion estimation unit 204 can output a complete set of motion information for use in the decoding process of the decoder. Alternatively, in some embodiments, the motion estimation unit 204 can signal the motion information of the current video block by referring to the motion information of another video block. For example, the motion estimation unit 204 can determine that the motion information of the current video block is sufficiently similar to the motion information of a neighboring video block.
[0055] In one example, the motion estimation unit 204 may indicate a value in a syntax structure associated with the current video block, and this value indicates to the video decoder 300 that the current video block has the same motion information as another video block.
[0056] 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.
[0057] As discussed above, the video encoder 200 may signal motion vectors in a predictive manner. Two examples of predictive signaling techniques that may be implemented by the video encoder 200 include advanced motion vector prediction (AMVP) and Merge mode signaling.
[0058] 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 the decoded samples of other video blocks in the same picture. The prediction data for the current video block may include a predicted video block and various syntax elements.
[0059] The residual generation unit 207 may generate residual data for the current video block by subtracting (e.g., indicated by a minus sign) the (multiple) predicted video blocks 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 components of the samples in the current video block.
[0060] In other examples, such as in the skip mode, there may be no residual data for the current video block, and the residual generation unit 207 may not perform the subtraction operation.
[0061] The transform processing unit 208 may generate one or more transform coefficient video blocks for the current video block by applying one or more transforms to the residual video block associated with the current video block.
[0062] After the transform processing unit 208 generates the transform coefficient video block associated with the current video block, the 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.
[0063] The inverse quantization unit 210 and the inverse transform unit 211 may respectively apply inverse quantization and inverse transform to the transformed coefficient video block to reconstruct the residual video block from the transformed coefficient video block. The reconstruction unit 212 may add the reconstructed residual video block to corresponding samples of one or more predicted 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.
[0064] After the reconstruction unit 212 reconstructs the video block, a loop filtering operation may be performed to reduce block effect artifacts in the video block.
[0065] The entropy coding unit 214 may receive data from other functional components of the video encoder 200. When the entropy coding unit 214 receives the 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.
[0066] Figure 3 is a block diagram illustrating an example of a video decoder 300 according to some embodiments of the present disclosure. The video decoder 300 may be Figure 1 an example of the video decoder 124 in the system 100 shown.
[0067] The video decoder 300 may be configured to perform any or all of the techniques of the present disclosure. In Figure 3 the example, the video decoder 300 includes a plurality of functional components. The techniques described in the present disclosure may be shared among the various components of the video decoder 300. In some examples, a processor may be configured to perform any or all of the techniques described in the present disclosure.
[0068] In Figure 3 the example, 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 may perform a decoding process generally opposite to the encoding process described with respect to the video encoder 200.
[0069] The entropy decoding unit 301 can retrieve the encoded bitstream. The encoded bitstream can include entropy-encoded video data (e.g., encoded blocks of video data). The entropy decoding unit 301 can decode the entropy-encoded video data, and the motion compensation unit 302 can determine motion information from the entropy-decoded video data, which includes motion vectors, motion vector precision, reference picture list indices, and other motion information. The motion compensation unit 302 can determine such information, for example, by performing AMVP and Merge mode. AMVP is used, including deriving several most likely candidates based on data from adjacent PBs and reference pictures. Motion information generally includes horizontal motion vector displacement values and vertical motion vector displacement values, one or two reference picture indices, and, in the case of the prediction region in a B slice, also an indication of which reference picture list is associated with each index. As used herein, in some aspects, "Merge mode" can refer to deriving motion information from spatially adjacent blocks or temporally adjacent blocks.
[0070] The motion compensation unit 302 can generate a motion-compensated block, possibly performing interpolation based on an interpolation filter. An identifier for the interpolation filter used at sub-pixel precision can be included in the syntax element.
[0071] The motion compensation unit 302 can use the interpolation filter used by the video encoder 200 during the encoding of the video block to calculate the interpolated values for sub-integer pixels of the reference block. The motion compensation unit 302 can determine the interpolation filter used by the video encoder 200 according to the received syntax information, and the motion compensation unit 302 can use the interpolation filter to generate a prediction block.
[0072] The motion compensation unit 302 can use at least part of the syntax information to determine the size of the blocks for encoding the (multiple) frames and / or (multiple) slices of the encoded video sequence, the partitioning information describing how each macroblock of the pictures describing the encoded video sequence is partitioned, the mode indicating how each partition is encoded, one or more reference frames (and reference frame lists) for each inter-frame encoded block, and other information for decoding the encoded video sequence. As used herein, in some aspects, a "slice" can refer to a data structure that can be decoded independently of other slices of the same picture in terms of entropy encoding / decoding, signal prediction, and residual signal reconstruction. A slice can be the entire picture or can also be a region of the picture.
[0073] The intra prediction unit 303 can use, for example, the intra prediction mode received in the bitstream to form a prediction block from spatially adjacent 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.
[0074] The reconstruction unit 306 can obtain the decoded block, for example, by adding a 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 can also be applied to filter the decoded block to remove block effect artifacts. The decoded video block is then stored in the buffer 307, and the buffer 307 provides a reference block for subsequent motion compensation / intra prediction, and the buffer 307 also generates the decoded video for presentation on a display device.
[0075] Some exemplary embodiments of the present disclosure will be described in detail below. It should be noted that the use of section headings in this document is for ease of understanding and does not limit the embodiments disclosed in the section to that section. In addition, although some embodiments are described with reference to multi-functional video coding or other specific video codecs, the disclosed techniques are also applicable to other video coding techniques. In addition, although some embodiments describe the video coding steps in detail, it should be understood that the corresponding decoding steps of decoding 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 bitrates. 1. Brief Overview The present disclosure relates to video coding and decoding techniques. Specifically, it is about an affine motion prediction method in video coding and decoding. This concept can be applied alone or in various combinations to any video coding standard or non-standard video codec. 2. Introduction The exponential growth of multimedia data has brought severe challenges to video coding and decoding. To meet the growing demand for more efficient compression techniques, ITU-T and ISO / IEC have developed a series of video coding and decoding standards in the past few decades. Specifically, ITU-T has developed H.261 and H.263, ISO / IEC has developed MPEG-1 and MPEG-4 video, and the two organizations have jointly developed H.262 / MPEG-2 video, H.264 / MPEG-4 Advanced Video Coding (AVC), H.265 / HEVC, and the latest VVC standard. Since H.262 / MPEG-2, a hybrid video coding and decoding framework has been adopted, in which intra / inter prediction plus transform coding and decoding are used. 2.1. MVP in Video Coding and Decoding Inter-frame prediction aims to remove the temporal redundancy between adjacent frames, which is an essential part of the hybrid video coding framework. Specifically, inter-frame prediction uses the content specified by the motion vector (MV) as the predicted version of the current block to be coded and decoded, so that only the residual signal and motion information are transmitted in the bitstream. To reduce the cost for MV signaling, motion vector prediction (MVP) emerges as an effective mechanism for transmitting motion information. Early strategies simply used the MV of the specified neighboring block or the median MV of the neighboring blocks as the MVP. In H.265 / HEVC, a competition mechanism is involved, where the rate-distortion optimization (RDO) selects the optimal MVP from multiple candidates. In particular, the advanced MVP (AMVP) mode and the Merge mode are designed with different motion information signaling strategies. In the AMVP mode, the MVP candidates are signaled by transmitting the reference index, the reference AMVP candidate list, and the motion vector difference (MVD). As for the Merge mode, only the Merge index of the reference Merge candidate list is signaled, and all the motion information associated with the Merge candidate is inherited. Both the AMVP mode and the Merge mode need to construct the MVP candidate list, and the details of the construction processes of these two modes are described as follows. AMVP mode: AMVP utilizes the spatio-temporal correlation of the motion vector with neighboring blocks for explicit transmission of motion parameters. For each reference picture list, the motion vector candidate list is constructed by first checking the availability of the left and upper temporal neighboring positions, removing redundant candidates, and adding zero vectors to make the candidate list length constant. Figure 4 Figure 400 shows the positions of the spatial and temporal neighboring blocks used in the AMVP / Merge candidate list construction. For the spatial motion vector candidate derivation, as Figure 4 shown, finally two motion vector candidates are derived based on the motion vectors of the blocks located at five different positions. The five neighboring blocks located at B0, B1, B2 and A0, A1 are divided into two groups, where group A includes the upper three spatial neighboring blocks and group B includes the left two spatial neighboring blocks. In the predefined order, these two motion vector candidates are derived from the first available candidates in group A and group B respectively. For the derivation of the temporal motion vector candidate, as Figure 4 shown, one motion vector candidate is derived based on two different co-located positions (lower right (C0) and center (C1)) checked in sequence. To avoid MV candidate redundancy, the repeated motion vector candidates in the list are discarded. If the number of potential candidates is less than two, additional zero motion vector candidates are added to the list. Merge Mode: Similar to the AMVP mode, the MVP candidate list for the Merge mode also includes spatial candidates and temporal candidates. For spatial motion vector candidate derivation, after performing availability and redundancy checks, up to four candidates are selected in the order of A1, B1, B0, A0, and B2. For temporal Merge candidate (TMVP) derivation, up to one candidate is selected from two temporally adjacent blocks (C0 and C1). When there are not enough Merge candidates using spatial and temporal candidates, combined bi-prediction Merge candidates and zero MV candidates are added to the MVP candidate list. Once the number of available Merge candidates reaches the maximum allowed number for signaling, the Merge candidate list construction process is terminated. In VVC, the construction process for the Merge mode is further improved by introducing history-based MVP (HMVP), which combines the motion information of previously encoded / decoded blocks that may be far from the current block. In VVC, HMVP Merge candidates are appended to the Merge list, after the spatial MVP and TMVP. In this method, the motion information of previously encoded / decoded blocks is stored in a table and used as the MVP for the current CU. During the encoding / decoding process, a first-in-first-out strategy is used to maintain the table with multiple HMVP candidates. Whenever there is a non-sub-block inter-frame encoded / decoded CU, the associated motion information is added to the last entry of the table as a new HMVP candidate. During the VVC standardization process, non-adjacent MVP was proposed to facilitate better motion information derivation by adopting non-adjacent regions. In the ECM software, non-adjacent MVP is inserted between TMVP and HMVP, where the distance between the non-adjacent spatial candidates and the current encoded / decoded block is based on the width and height of the current encoded / decoded block, as Figure 5 shown in FIG. 500 which shows the positions of non-adjacent candidates in ECM.. 2.2. Affine Motion Compensation Prediction In HEVC, only the translational motion model is applied to motion compensation prediction (MCP). In the real world, there are various motions, such as zooming in / out, rotation, perspective motion, and other irregular motions. In VVC, block-based affine transform motion compensation prediction is applied. Figure 6A FIG. 610 shows an affine motion model based on 4-parameter control points. Figure 6B FIG. 620 shows an affine motion model based on 6-parameter control points. As Figure 11 shown, the affine motion field of a block is described by the motion information of two control points (4 parameters) or three control point motion vectors (6 parameters). For the 4-parameter affine motion model, the motion vector at the sample position (x, y) in a block is derived as: For the 6-parameter affine motion model, the motion vector at the sample position (x, y) in the block is derived as follows: where (mv 0x , mv 0y ) is the motion vector of the upper-left control point, (mv 1x , mv 1y ) is the motion vector of the upper-right control point, and (mv 2x , mv 2y ) is the motion vector of the lower-left control point. Figure 7 Fig. 1200 shows an example of the affine MVF for each sub-block. To simplify motion compensation prediction, block-based affine transform prediction is applied. To derive the motion vector of the center sample of each 4×4 luminance sub-block, the motion vector of the center sample of each sub-block is calculated according to the above equation, as Figure 12 shown, and rounded to 1 / 16 fractional precision. Then a motion compensation interpolation filter is applied to generate the prediction of each sub-block with the derived motion vector. The sub-block size of the chrominance component is also set to 4×4. The MV of the 4×4 chrominance sub-block is calculated as the average of the MVs of the upper-left and lower-right luminance sub-blocks in the co-located 8×8 luminance region. For translational motion inter prediction, there are also two affine motion inter prediction modes: the affine Merge mode and the affine AMVP mode. 2.2.1. Affine Merge Prediction The affine Merge mode can be applied to CUs with both width and height greater than or equal to 8. In this mode, the CPMV of the current CU is generated based on the motion information of spatially neighboring CUs. There can be up to five CPMV candidates, and an index is signaled to indicate the CPMV candidate to be used for the current CU. In VVC, the following three types of CPMV candidates are used to form the affine Merge candidate list: – Inherited affine Merge candidates, which are extrapolated from the CPMVs of neighboring CUs. – Constructed affine Merge candidate CPMV derived using the translational MVs of neighboring CUs – Zero MV. In VVC, there are at most two inherited affine candidates derived from the affine motion models of neighboring blocks, one from the left neighboring CU and one from the upper neighboring CU. Figure 8 Fig. 800 shows an example of the positions of the inherited affine motion prediction values. The candidate blocks are in Figure 8Shown in. For the left prediction value, the scan order is A0->A1, and for the above prediction value, the scan order is B0->B1->B2. Only the first inherited candidate is selected from each side. No deduplication check is performed between the two inherited candidates. When the neighboring affine CU is identified, its control point motion vector is used to derive the CPMV candidates in the affine Merge list of the current CU. Figure 9 Figure 900 showing an example of inheritance of control point motion vectors. As Figure 9 shown, if the neighboring lower left block A 910 is coded in affine mode, the motion vectors v2, v3, and v4 of the upper left, upper right, and lower left corners of the CU containing block A are obtained. When block A is coded using a 4-parameter affine model, two CPMVs of the current CU are calculated according to and. In the case where block A is coded using a 6-parameter affine model, three CPMVs of the current CU are calculated according to v2, v3, and v4. Constructing an affine candidate means constructing a candidate by combining the neighboring translational motion information of each control point. Figure 10 Figure 1000 showing the positions for constructing the candidate positions of the affine Merge mode. The motion information of the control points is derived from the specified spatial neighbors and temporal neighbors shown in Figure 10 . The CPMV k (k = 1, 2, 3, 4) represents the kth control point. For CPMV1, check the B2->B3->A2 block and use the MV of the first available block. For CPMV2, check the B1>B0 block, and for CPMV3, check the A1>A0 block. For TMVP, if available, use TMVP as CPMV4. After obtaining the MVs of the four control points, affine Merge candidates are constructed based on those motion information. The following combinations of control point MVs are used for sequential construction: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}. Combinations of 3 CPMVs construct 6-parameter affine Merge candidates, and combinations of 2 CPMVs construct 4-parameter affine Merge candidates. To avoid the motion scaling process, if the reference indices of the control points are different, the relevant combinations of control point MVs are discarded. After checking the inherited affine Merge candidates and the constructed affine Merge candidates, if the list is still not complete, zero MVs are inserted at the end of the list. 2.2.2. Affine AMVP Prediction The affine AMVP mode can be applied to CUs with a width and height greater than or equal to 16. In the bitstream, an affine flag at the CU level is signaled to indicate whether the affine AMVP mode is used, and then another flag is signaled to indicate whether it is 4-parameter affine or 6-parameter affine. In this mode, the difference between the CPMV of the current CU and its predicted value CPMVP is signaled in the bitstream. The affine AVMP candidate list size is 2, and is generated sequentially by the following four types of CPMV candidates: – Inherited affine AMVP candidate, which is extrapolated from the CPMV of neighboring CUs. – Constructed affine AMVP candidate CPMVP, which is derived using the translational MV of neighboring CUs. – Translational MV from neighboring CUs. – Zero MV. The checking order of the inherited affine AMVP candidates is the same as that of the inherited affine Merge candidates. The only difference is that for AVMP candidates, only affine CUs with the same reference picture in the current block are considered. When inserting the inherited affine motion prediction value into the candidate list, the deduplication process is not applied. The constructed AMVP candidate is derived from the specified spatial neighbors shown in Figure 10 The same checking order is used in the construction of affine Merge candidates. In addition, the reference picture index of neighboring blocks is also checked. The first block in the checking order that uses inter-frame coding and has the same reference picture as the current CU is used. They are added as a candidate in the affine AMVP list only when the current CU is coded in 4-parameter affine mode and both mv0 and mv1 are available. When the current CU is coded in 6-parameter affine mode and all three CPMVs are available, it is added as a candidate in the affine AMVP list. Otherwise, the constructed AMVP candidate is set to unavailable. If the affine AMVP list candidates are still less than 2 after inserting valid inherited affine AMVP candidates and constructed AMVP candidates, mv0, mv1, and mv2 are added as translational MVs to predict all control point MVs of the current CU when available. Finally, if the affine AMVP list is still not full, zero MVs are used to fill the affine AMVP list. 2.2.3. New affine candidate derivation method in ECM-6.0 In ECM-6.0, 3 additional affine Merge and AMVP candidate derivation methods are integrated, which are based on non-adjacent spatial candidates, history parameter-based candidates, and regression-based affine candidates. 2.2.3.1. Non-adjacent spatial candidates In ECM-6.0, non-adjacent spatial neighbors are studied to provide candidates for both affine Merge and affine AMVP. Figure 11 The spatial neighbors used to derive affine Merge candidates are shown. The pattern for obtaining non-adjacent spatial candidates is shown in Figure 11 . Similar to non-adjacent regular Merge candidates, the distance between the non-adjacent spatial candidates and the current coding block is also defined based on the width and height of the current CU. The motion information of the non-adjacent spatial neighbors in Figure 11 is used to generate additional inherited and constructed affine Merge candidates. Specifically, to generate inherited candidates, the non-adjacent spatial neighbors are examined based on their distance from the current block (i.e., from near to far). At a specific distance, only the first available neighbors decoded from each side (e.g., left and above) of the current block using the affine mode are included. As shown in (a) of Figure 11 , the examination of the left and above neighbors is performed from bottom to top and from right to left, respectively. For constructed candidates, as shown in (b) of Figure 11 , the positions of a left and an above non-adjacent spatial neighbor are first determined independently; afterwards, the position of the upper-left neighbor can be determined accordingly to form a rectangular virtual block together with the left and above non-adjacent neighbors. Figure 12 Fig. 1200 showing the construction of affine Merge candidates from non-adjacent neighbors is shown. The motion information of three non-adjacent neighbors is used to form CPMVs at the upper-left (A), upper-right (B), and lower-left (C) of the virtual block, which are projected onto the current CU to generate the corresponding constructed candidates, as shown in Figure 12 . 2.2.3.2. Affine Candidates Based on Historical Parameters Affine Model Inheritance based on Historical Parameters (HAMI) allows an affine model to be inherited from a previously affine-coded block that may not be adjacent to the current block. A Historical Parameter Table (HPT) is established. One entry of the HPT stores a set of affine parameters: a, b, c, and d, each represented by a 16-bit signed integer. The entries in the HPT are classified by reference list and reference index. Each reference list in the HPT supports 5 reference indices. In a formulaic way, the category of the HPT (denoted as HPTCat) is calculated as HPTCat(RefList,RefIdx) = 5×RefList + min(RefIdx,4),(3) Where RefList and RefIdx represent the reference picture list (0 or 1) and the reference index, respectively. For each category, up to seven entries can be stored, resulting in a total of 70 entries in the HPT. The number of entries for each category is initialized to zero at the beginning of each CTU row. After decoding the affine codec CU with the reference list RefListCur and RefIdxcur, the affine parameters are used to update the entries in the category HPTCat (Ref Listcur, RefIdxcur) in a manner similar to the HMVP table update. Figure 13 An example diagram 1300 of generating HAPC is shown. The candidate (HAPC) based on the historical affine parameters is obtained from Figure 13 The MV of the neighboring 4x4 block is used as the base MV. In a formal way, the MV of the current block at position (x, y) is calculated as: Where (mvhbase, mvvbase) represents the MV of the adjacent 4×4 block, (x base ,y base ) represents the center position of the neighboring 4x4 block. (x, y) can be the top left, top right, and bottom left corners of the current block to obtain the angular position MV (CPMV) of the current block, or it can be the center of the current block to obtain the normal MV of the current block. Figure 13 It is shown how the HAPC is derived from block A0. The affine parameters {a0, b0, c0, d0} are directly extracted from an entry of the category HPTIdx (Ref List A0, refIdx0A0) in the HPT. The affine parameters from the HPT (with the center position of A0 as the base position and the MV of block A0 as the base MV) are used together to derive the CPMV of the Affine Merge HAPC or Affine AMVP HAPC. They can also be used to derive the MV located at the center of the current block as a regular merge candidate. The HAPC can be put into a sub-block based merge candidate list, an affine AMVP candidate list, or a regular merge candidate list. In response to the introduction of the new HAPC, the size of the sub-block based merge candidate list is increased from 5 to 10 and 12 for random access and low latency B configurations, respectively. In addition, for the random access configuration, the size of the regular merge candidate list is increased from ten to eleven to accommodate the newly added regular merge candidates. 2.2.3.3. Regression-based affine candidates In ECM-6.0, regression-based affine merge candidates are derived and added to the affine merge list. The sub-block motion fields from previously encoded affine CUs and the motion information from adjacent sub-blocks of the current CU are used as inputs to the regression process to derive the proposed affine candidates. Previously encoded affine CUs can be identified by scanning non-adjacent positions and the affine HMVP table. Figure 14 Diagram 1400 illustrating the derivation of regression-based affine merge candidates. As Figure 14 depicted, adjacent sub-block information of the current CU is extracted from the 4x4 sub-blocks represented by the gray areas. For each sub-block, given a reference list, the corresponding motion vector and center coordinates of the sub-block can be used. For each affine CU, up to 2 affine candidates can be derived. One with adjacent sub-block information and one without. All candidates generated by linear regression are de-duplicated and collected into a candidate subgroup, and the TM cost-based ARMC process is applied when ARMC is enabled. After that, when N affine CUs are found, up to N candidates generated by linear regression are added to the affine merge list. 2.3. Template Matching Merge / AMVP Mode in ECM The template matching (TM) merge / AMVP mode is a decoder-side MV derivation method that refines the motion information of the current CU by finding the closest match between a template in the current picture (i.e., the upper and / or left adjacent blocks of the current CU) and a block in the reference picture (i.e., the same size as the template). Figure 15 Example diagram 1500 showing template matching performed on the search area around the initial MV. As Figure 15 shown, a better MV is searched for around the initial motion of the current CU within the [-8, +8] pixel search range. In the AMVP mode, the MVP candidates are determined based on the template matching error to select the MVP candidate with the minimum difference between the current block and the reference block template, and then TM only performs MV refinement for this specific MVP candidate. TM refines this MVP candidate starting from the full-pixel MVD accuracy (or 4-pixel AMVR mode) within the [-8, +8] pixel search range using iterative diamond search. By using cross-search with full-pixel MVD accuracy (or 4-pixel AMVR mode), and then successively using half-pixel and quarter-pixel searches according to the AMVR mode, the AMVP candidate can be further refined. This search process ensures that the MVP candidate remains at the same MV accuracy indicated by the adaptive motion vector resolution (AMVR) mode after TM processing. In the Merge mode, a similar search method is applied to the Merge candidates indicated by the Merge index. TMMerge can be executed until 1 / 8 pixel MVD accuracy, or skip accuracies beyond half-pixel MVD accuracy, depending on whether an alternative interpolation filter (used when AMVR is in half-pixel mode) is used to merge motion information. Additionally, when the TM mode is enabled, template matching can be an independent process or an additional MV refinement process between the block-based and sub-block-based bilateral matching (BM) methods, depending on whether BM can be enabled according to the enabled conditions check. When both BM and TM are enabled on a CU, the search process of TM will stop at half-pixel MVD accuracy, and the resulting MV is further refined by using the same model-based MVD derivation method as in DMVR. 2.4. Adaptive Reordering of Merge Candidates (ARMC) Inspired by the spatial correlation between reconstructed neighboring pixels and the current codec block, Adaptive Reordering of Merge Candidates (ARMC) is proposed to refine the candidate order in a given candidate list. The basic assumption is that candidates with lower template matching costs have a higher probability of being selected through the RDO process, and thus should be placed in the front position in the list to reduce signaling costs. This reordering method is applied to the regular Merge mode, the Template Matching (TM) Merge mode, and the affine Merge mode (excluding SbTMVP candidates). For the TM Merge mode, the Merge candidates are reordered before the refinement process. After constructing the Merge candidate list, the Merge candidates are divided into several subgroups. The subgroup size is set to 5. The Merge candidates in each subgroup are reordered in ascending order according to the template matching-based cost values. For simplicity, the Merge candidates in the last subgroup but not in the first subgroup are not reordered. The template matching cost is measured by the sum of absolute differences (SAD) between the samples of the template of the current block and its corresponding reference template. Figure 16 Figure 1600 shows the template and the corresponding reference template. The template includes a set of reconstructed samples adjacent to the current block, while the reference template is located by the same motion information of the current block, as Figure 7 shown. When a Merge candidate utilizes bidirectional prediction, the reference samples of the template of the Merge candidate are also generated by bidirectional prediction. For sub-block-based Merge candidates with a sub-block size equal to Wsub*Hsub, the above template includes several sub-templates of size Wsub×K, and the left template includes several sub-templates of size K×Hsub. Figure 17FIG. 1700 showing a template of a block with sub-block motion and a reference template using motion information of sub-blocks of a current block. As Figure 17 shown, motion information of the sub-block at the first row and first column of the current block is used to derive reference samples for each sub-template. 2.5. Sub-block based Temporal Motion Vector Prediction (SbTMVP) VVC supports the Sub-block based Temporal Motion Vector Prediction (SbTMVP) method. Similar to TMVP, SbTMVP utilizes the motion field in the collocated picture to facilitate more accurate MVP derivation. The same collocated picture used by TMVP is used for SbTVMP. SbTMVP mainly differs from TMVP in two aspects. First, SbTMVP enables sub-CU level motion prediction, while TMVP predicts motion at the CU level; second, compared with TMVP which extracts the temporal MV from the collocated block in the collocated picture (the collocated block is the bottom-right or center block relative to the current CU), SbTMVP applies a motion displacement before extracting the temporal motion information from the collocated picture, where the motion displacement is obtained by using the MV from one of the spatial neighboring blocks of the current CU. Figure 18 FIG. 1800 showing the derivation process of the sub-block level motion field of SbTMVP. Specifically, first, the motion information of the lower-left sub-block A1 is extracted. If any of the MVs in reference list 0 and list 1 points to the collocated frame, the corresponding MV is identified as the motion displacement. Otherwise, a zero mv is used as the motion displacement. Once the motion displacement is determined, a specified region in the collocated frame is used to derive the sub-block level motion field. Assume that the A1’ motion is used as the motion displacement, as Figure 18 depicted. Then, for each sub-CU, the motion information of its corresponding block (the smallest motion grid covering the central sample) in the collocated picture is extracted to provide the motion information, where first an MV scaling operation is performed to align the reference frame of the temporal motion vector with the reference frame of the current CU. Figure 18 FIG. showing the derivation of the sub-CU motion field obtained by applying a motion displacement based on neighboring motion information. In VVC and ECM, in addition to the CU level MVP candidate list, a sub-CU level MVP candidate list is also constructed to provide more accurate motion prediction for the current CU, which includes the motion fields generated by both SbTMVP and the affine method. Specifically, only one SbTMVP candidate is included and is always placed in the first entry of the constructed sub-CU level MVP candidate list, while after performing template matching based reordering, multiple affine candidates are included in the list, and those affine candidates with smaller costs are placed in the front positions. 3. Problems CPMV is crucial for affine motion compensation as it provides basic motion information for all sub - blocks within a block. However, in existing CPMV derivation methods, the CPMV of the current block is estimated as the MV of the blocks that have already been encoded and decoded, which may not guarantee consistency with the true motion. Therefore, a CPMV refinement method is highly desired to reduce the deviation between the estimated CPMV and the true motion. 4. Detailed solutions In this disclosure, a method is proposed to refine the affine CPMV using template matching. For a given affine candidate in the affine candidate list, the CPMV can be further refined using template matching, and then the refined affine candidate can be used to derive affine motion information at the sub - block or pixel level for the current block. The following detailed embodiments should be considered as examples for explaining the general concept. These embodiments should not be interpreted in a narrow way. Additionally, these embodiments can be combined in any way. The term "video unit" or "coding unit" or "block" can represent a coding tree block (CTB), a coding tree unit (CTU), a coding block (CB), a CU, a PU, a TU, a PB, a TB. The term "affine block" can represent a block encoded using affine Merge, affine AMVP, or any other affine variant mode (i.e., affine MMVD, etc.), which can be described by the motion information of two control points (4 - parameter) or three - control - point motion vectors (6 - parameter). The term "CPMV" can represent the motion information of the affine block at the upper - left corner, upper - right corner, and / or lower - left corner. The term "template" can represent a reconstructed region that can be used to refine the CPMV, which can represent a "separate template" or a "unified template". Here, a "separate template" can represent a reconstructed region that can be used to refine an individual CPMV (i.e., a specific one or more of the upper - left corner, upper - right corner, and / or lower - left corner), while a "unified template" can represent a reconstructed region that can be used to refine all or any (multiple) CPMVs of a block. The term "template matching cost" or "TM cost" can represent the matching cost of a separate template or a unified template. In the present disclosure, regarding "blocks encoded / decoded using mode N", where "mode N" can be a prediction mode (e.g., MODE_INTRA, MODE_INTER, MODE_PLT, MODE_IBC, etc.), or an encoding / decoding technique (e.g., DIMD, TIMD, PDPC, CCLM, CCCM, GLM, TMP, AMVP, SMVD, Merge, BDOF, PROF, DMVR, AMVR, TM, affine, CIIP, GPM, spatial GPM, SGPM, GPM inter, GPM intra-intra, GPM intra-intra, MHP, GEO, TPM, MMVD, BCW, HMVP, SbTMVP, LIC, OBMC, ALF, deblocking, SAO, bilateral filter, LMCS, and corresponding variants, etc.). Note that the terms mentioned below are not limited to the specific terms defined in the existing standards. Any changes to the encoding / decoding tools are also applicable. 1. In one example, affine motion compensation can be refined by using previously decoded samples. a) In one example, at least one CPMV can be refined. b) In one example, at least one MV of a sub-block of affine motion compensation can be refined. c) In one example, at least one affine parameter (such as a, b, c, d, e, f) can be refined. d) In one example, the previously decoded samples can be the template of the current block. e) In one example, the previously decoded samples can be the template of the reference block. f) In one example, the template representation can be used to refine the reconstruction region of the CPMV. g) In one example, for blocks encoded / decoded by affine, different individual templates can be used for different control points. i. In one example, for a control point, the corresponding individual template can include samples from adjacent and / or non-adjacent positions in the already reconstructed region. 1) In one example, the individual templates for all control points are collected from adjacent reconstructed regions. 2) In one example, the individual template samples for some control points are collected from the adjacent reconstructed region of the current block, while for the remaining control points, the template samples are collected from non-adjacent reconstructed regions. a) In one example, specifically, the template samples for the upper left corner are collected from non-adjacent regions, while for the upper right corner and / or lower left corner, the template samples are collected from adjacent regions. 3) In one example, both adjacent and non-adjacent samples are used for some control points. ii. In one example, for different control points, the shape of the individual template can be different. 1) In one example, for some control points, an L-shaped (e.g., including both upper and left neighboring samples) individual template is used. 2) In one example, for some control points, an I-shaped or "-" shaped template (e.g., including left or upper (but not both) neighboring samples) can be used. iii. In one example, which shape of the template is used for CPMV refinement can be based on the position / orientation of the control point. 1) In one example, the CPMV at the upper left corner of the current video unit can use an L-shaped template (e.g., including both upper and left neighboring samples). 2) In one example, the CPMV at the upper right corner of the current video unit can use a '-' shaped template (e.g., including only upper neighboring samples). 3) In one example, the CPMV at the upper left corner of the current video unit can use an I-shaped template (e.g., including only left neighboring samples). 4) In one example, for a certain CPMV, the shapes of the templates in the current picture and the reference picture are the same. a) For example, as Figure 16 depicted, the template of the CPMV can refer to a first set of neighboring samples in the current picture (e.g., the template in the current picture) and a second set of neighboring samples in the reference picture (e.g., the template in the reference picture). iv. In one example, for different control points, the number of samples used in the template can be different. 1) Alternatively, the number of samples used for different control points is the same for the affine block. 2) For different control points, the arrangement (row or column) of the samples used in the template can be different. h) In one example, a unified template is used during CPMV refinement. i. In one example, the TM cost associated with the unified template is used to determine the MV displacement value. ii. In one example, the TM cost associated with the unified template is used to determine the CPMV combination. iii. In one example, the unified template can include all or part of the neighboring samples of the entire block, i.e., as Figure 16 shown. i) The template can include samples from only one component (e.g., luminance) or from multiple components (e.g., luminance and chrominance). j) In one example, for any template, the reference template region with the same shape can utilize MV positioning, as shown. k) In one example, the template may not necessarily include all pixels in a specific region and may include some pixels in the specified region. 2. When constructing the affine candidate list, CPMV refinement can be first performed on potential affine candidates, and then the refined candidates can be inserted into the affine candidate list. a) In one example, alternatively, CPMV refinement is performed after constructing the affine candidate list. i. In one example, only the affine candidates with specific index(es) need to perform CPMV refinement. 3. In one example, a first affine candidate list is constructed first, followed by a second affine candidate list construction process. a) For example, the input for generating the second affine candidate list can be based on the output generated by the first affine candidate list. b) For example, the first affine candidate list can be constructed without CPMV refinement. c) For example, the second affine candidate list can be generated by applying CPMV refinement to the CPMV candidates in the first affine candidate list. i. For example, at least one CPMV candidate in the first affine candidate list can be refined. ii. Alternatively, more than one CPMV candidate in the affine candidate list can be refined. iii. For example, CPMV refinement can be based on TM. d) For example, a candidate reordering process can be utilized to construct the first affine candidate list. i. For example, the reordering process can be based on TM. e) For example, the second affine candidate list can be constructed without any candidate reordering process. f) For example, different deduplication rules can be used in the first deduplication and the second deduplication. i. For example, the generation of the first affine candidate list can be associated with the first deduplication method. ii. For example, the generation of the second affine candidate list can be associated with the second deduplication method. iii. For example, the thresholds for motion similarity checking in the first deduplication method and the second deduplication method can be different. iv. For example, a threshold based on block dimensions (e.g., block width and / or height) can be used in the second deduplication method. v. For example, alternatively, the second deduplication method can adopt a fixed threshold. 4. For a given affine candidate, some or all of the CPMVs in the CPMV may be refined based on the TM, and then the refined CPMVs are used to derive affine motion information for the current block and / or sub-block. a) In one example, both integer precision and fractional precision can be used to refine the control points. i. In one example, only integer precision is used to refine the control points, and the fractional precision search is skipped. 1) In one example, whether a fractional precision search is needed depends on the result of the integer precision search. ii. In one example, it is proposed to use a specific interpolation filter to generate a reference template for the motion vector pointing to a fractional position. 1) In one example, a simplified interpolation filter can be applied. 2) In one example, the simplified interpolation filter can be a 2-tap bilinear, alternatively, it can also be a 4-tap, 6-tap or 8-tap filter belonging to DCT, DST, Lanczos or any other interpolation type. 3) In one example, a more complex interpolation filter (e.g., with longer filter taps) can be applied. iii. In one example, whether to use the above methods (e.g., integer precision, different interpolation filters) and / or how to use the above methods can be signaled in the bitstream (e.g., in the SPS, PPS, picture header, slice header, CTU, CU, etc.) or determined on the fly according to the decoded information. 1) In one example, the method to be applied can depend on the codec tool. 2) In one example, the method to be applied can depend on the block dimension. b) In one example, different control points are refined separately, which means that for different control points, the MV displacement values (i.e., the difference between the initial CPMV and the corresponding refined CPMV) can be different. i. In one example, all or some of the control points can first be refined separately by the TM, and then a combination of control points is determined by traversing all or some combinations of the CPMVs before and after refinement (i.e., M combinations (such as M = 4) for a 4-parameter model, N combinations (such as N = 8) for a 6-parameter model), and a set of CPMVs that minimize the TM cost of the current block is derived. 1) In one example, in the above case, all or some of the control points can first be refined by the corresponding individual templates. 2) In one example, for each combination of CPMVs, sub-block level motion information is calculated for the boundary sub-blocks, and then according to Zhang Jie 2.4 andFigure 17 Calculate the unified TM cost using the method described in a) In one example, only some of the boundary sub-blocks need to calculate the TM cost. 3) In one example, alternatively, there is no need to loop over all combinations, and the combinations where all control points are refined by TM are directly used as the refined affine candidates. 4) In one example, when deriving the refined affine candidates, a second pass through control point refinement can be performed to further refine each control point. a) In one example, each CPMV is further iteratively refined to minimize the TM cost of the current block. In each iteration, one CPMV is refined while the other CPMVs are fixed. c) In one example, alternatively, multiple control points are refined simultaneously, where the same MV displacement value is shared for all or multiple control points. i. In one example, all or some of the MV displacement values in a given MV displacement set are traversed one by one. The traversed MV displacement values are assigned to all or multiple CPMVs, then the motion information of the boundary sub-blocks associated with the refined CPMVs is calculated, and the TM cost is formulated accordingly. During this process, the value that produces the minimum TM cost is determined as the optimal motion displacement value, which can ultimately be used to refine the CPMV. 5. CPMV refinement can be used together with the regression-based affine candidate derivation method. a) In one example, after refining all or some CPMVs using TM (producing Affine_model_TM), the motion information of the boundary sub-blocks associated with Affine_model_TM is derived and then fed into a regression model to output a new affine model (referred to as Affine_model_R). Then the TM costs of the boundary sub-blocks using Affine_model_TM and Affine_model_R are calculated and compared separately. And the one with the lower TM cost is determined as the final refined affine candidate. i. In one example, all or some of the CPMV can first perform integer-precision TM refinement (resulting in Affine_model_TM_I), and then perform fractional-precision TM refinement (resulting in Affine_model_TM_F). And the motion information of the boundary sub-blocks associated with Affine_model_TM_I is derived and then fed into a regression model to output a new affine model (Affine_model_R). Finally, the TM costs of the boundary sub-blocks using Affine_model_TM_F and Affine_model_R are calculated and compared, and the sub-block with the lower TM cost is determined as the final refined affine candidate. ii. In one example, only some sub-blocks may need to calculate the TM cost to generate Affine_model_TM, Affine_model_TM_I, and / or Affine_model_TM_F. 6. In one example, TM-based refinement can be applied to affine Merge or affine AMVP (affine inter-frame). a) In one example, the (multiple) MVPs of affine AMVP can be refined based on TM. i. Alternatively, the (multiple) MVPs of affine AMVP can be refined based on DMVR. 7. In one example, TM-based refinement can be applied to affine-coded blocks together with DMRS-based refinement. a) In one example, TM-based refinement can be applied before DMVR. b) In one example, TM-based refinement can be applied after DMVR. c) Alternatively, TM-based refinement can be applied to affine-coded blocks mutually exclusively with DMRS-based refinement. 8. In one example, the derivation of TM cost can depend on whether the block is bi-predicted or uni-predicted. a) If the block is bi-predicted, the TM cost can be derived based on bi-prediction on TM. i. In one example, make TM ref0 and TM ref1 be the reference TMs associated with List0 and List1 respectively, then the final reference TM (TM bi ) can be derived as: TM bi = a * TM ref0 + (1 - a) * TM ref1 . 1) In one example, a is equal to 0.5.. 2) In one example, a is determined based on the BCW index. 3) In one example, TM is generated based on the CPMV in List 0 ref0 , and / or TM is generated based on the CPMV in List 1 ref1 . b) Alternatively, if the block is bi - directionally predicted, the TM cost can be calculated separately for List0 and List1. 9. In one example, the refinement of the CPMV can be done iteratively. a) For example, in one refinement step, one CPMV is refined while the other CPMVs are fixed. b) In one example, when subsequent CPMVs are to be refined, the already refined CPMV(s) can be used. i. In one example, alternatively, when subsequent CPMVs are to be refined, the CPMV before refinement is used. c) In one example, the refinement of the CPMV can be done iteratively for bi - directionally predicted blocks. i. In one example, the CPMV associated with list K (K = 0 or 1) can be refined first, and then the CPMV associated with list (1 - K) can be refined. 1) Whether and / or how to refine the CPMV in the later list (1 - K) can be determined based on the refined CPMV of the previous list K. ii. In one example, the CPMVs associated with List 0 and List 1 can be refined separately. 1) In one example, specifically, when the CPMV in list K (K = 0 or 1) is refined, for each search step, a unidirectional reference TM in list K is generated based on the corresponding CPMV, and the TM cost is calculated therefrom to determine the best MV displacement value. iii. In one example, alternatively, the CPMVs associated with List 0 and List 1 can be refined jointly. 1) In one example, specifically, when the CPMV in list K (K = 0 or 1) is refined, for each search step, a bi - directional reference TM (as described in Figure 8 ) is generated based on the CPMV information of the two lists. The one that produces the minimum TM cost is determined as the best MV displacement value. 10. Multiple rounds of refinement can be performed on the CPMV. a) In one example, all or part of the CPMVs can be refined in each round of refinement. b) In one example, all or part of the CPMVs may have been refined in the previous round of refinement, and then a later round is carried out to further refine the CPMV. 11. Whether and / or how to refine the TM-based CPMV can be determined based on the prediction direction of the current block. a) In one example, refinement by TM may be required only when the current block is unidirectionally predicted. CPMV. b) In one example, refinement by TM may be required only when the current block is bidirectionally predicted. CPMV. c) In one example, refinement of CPMV by TM may always be required regardless of whether the current block is bidirectionally predicted. 12. If affine prediction is used as a hypothesis, the disclosed method may be applied to MHP (multiple hypothesis prediction) encoded / decoded blocks. 13. Whether and / or how to apply the method disclosed above can be determined based on syntax elements. a) For example, at least one syntax element is signaled in the bitstream. b) For example, whether and / or how to apply the disclosed method may be signaled at the sequence level / group of pictures level / picture level / strip level / slice group level, e.g., signaled in the sequence header / picture header / SPS / VPS / DPS / DCI / PPS / PPS / strip header / slice group header. c) For example, whether and / or how to apply the disclosed method may be in PB / TB / CB / PU / TU / CU / VPDU / CTU / CTU row / strip / slice / sub-picture / other kinds of regions containing more than one sample or pixel. d) For example, whether and / or how to apply the method disclosed above may depend on the encoded / decoded information, such as block size, color format, single / double tree segmentation, color component, strip / picture type. e) For example, whether to signal the syntax element (i.e., indicating whether TM refinement is applied to CPMV) may be determined based on another syntax element.
[0076] Figure 19 FIG. 1900 shows a flowchart of a method 1900 for video processing according to an embodiment of the present disclosure. Method 1900 may be implemented during the conversion between the current video block of a video and the bitstream of the video.
[0077] Step 1910, determine the affine motion compensation information of the current video block. At block 1920, perform a refinement process on the affine motion compensation information based on at least one previously decoded sample to obtain the refined affine motion compensation information. For example, the affine motion compensation can be refined by using the previously decoded samples. At block 1930, perform a transformation based on the refined affine motion compensation information.
[0078] Method 1900 enables the refinement of affine motion compensation information. For example, the control point motion vector (CPMV) used in affine motion compensation can be refined. This can improve the coding and decoding efficiency and effectiveness.
[0079] In some embodiments, the affine motion compensation information includes at least one of the following: the control point motion vector of the current video block, the motion vector (MV) of a sub-block of the current video block, or the affine parameters for the affine coding mode. For example, at least one CPMV can be refined. At least one MV of the sub-blocks of the affine motion compensation can be refined. At least one affine parameter (such as a, b, c, d, e, f) can be refined.
[0080] In some embodiments, the at least one sample includes at least one of the following: the samples in the first template of the current video block, or the samples in the second template of the reference block of the current video block.
[0081] In some embodiments, at least one of the first template or the second template includes a reconstructed region, and the samples in the reconstructed region are used to refine the control point motion vector of the current video block.
[0082] In some embodiments, the current video block is affine coded and decoded, multiple control points are associated with the current video block, and multiple templates are used to refine the multiple control points.
[0083] In some embodiments, for the first control point among the multiple control points, the corresponding template among the multiple templates includes samples from at least one of the following: adjacent positions in the reconstructed region associated with the current video block, or non-adjacent positions in the reconstructed region.
[0084] In some embodiments, the multiple templates include samples in the reconstructed region adjacent to the current video block.
[0085] In some embodiments, the first template of the first control point among the multiple control points includes samples in the first reconstructed region adjacent to the current video block, and the second template of the second control point among the multiple control points includes samples in the second reconstructed region not adjacent to the current video block.
[0086] In some embodiments, the first control point is located at at least one of the following: the upper right corner of the current video block, or the lower left corner of the current video block, and the second control point is located at the upper left corner of the current video block.
[0087] In some embodiments, the first template of the first control point among the multiple control points includes sample points in a first reconstructed region adjacent to the current video block and sample points in a second reconstructed region not adjacent to the current video block.
[0088] In some embodiments, the first shape of the first template of the first control point among the multiple control points is different from the second shape of the second template of the second control point among the multiple control points.
[0089] In some embodiments, the first shape includes an L shape, and the first template includes sample points adjacent above and to the left of the current video block, and / or the second shape includes an I shape or a horizontal line shape, such as a “—” shape, and the second template includes one of the following: sample points adjacent to the left of the current video block or sample points adjacent above the current video block.
[0090] In some embodiments, the shape of the template among the multiple templates is determined based on the position of the corresponding control point.
[0091] In some embodiments, for the first control point at the upper left corner of the current video block, the shape of the corresponding template of the first control point is an L shape, and the corresponding template includes sample points adjacent above and to the left of the current video block.
[0092] In some embodiments, for the second control point at the upper right corner of the current video block, the shape of the corresponding template of the second control point is a horizontal line shape, such as a “—” shape, and the corresponding template includes sample points adjacent above the current video block.
[0093] In some embodiments, for the first control point at the upper left corner of the current video block, the shape of the corresponding template of the first control point is an I shape, and the corresponding template includes sample points adjacent to the left of the current video block.
[0094] In some embodiments, for the control point of the current video block, the shape of the first template in the current picture is the same as the shape of the second template in the reference picture, and the first template and the second template are associated with the control point.
[0095] In some embodiments, the template of the control point includes sample points in the first template and sample points in the second template.
[0096] In some embodiments, the second template is positioned based on the motion vector of the current video block.
[0097] In some embodiments, the first template of the first control point includes a first number of sample points, and the second template of the second control point includes a second number of sample points, where the first number is different from the second number.
[0098] In some embodiments, the first row of sample points in the first template is different from the second row of sample points in the second template, where a row of sample points includes a row or a column of sample points. A row of sample points can be a row or a column of sample points.
[0099] In some embodiments, the first template of the first control point includes a first number of sample points, and the second template of the second control point includes a second number of sample points, where the first number is the same as the second number.
[0100] In some embodiments, performing the refinement process includes: determining a unified template associated with the current video block; determining a template matching cost of the unified template; and performing the refinement process based on the template matching cost.
[0101] In some embodiments, a motion vector displacement value is determined based on the template matching cost.
[0102] In some embodiments, a control point motion vector combination is determined based on the template matching cost.
[0103] In some embodiments, the unified template includes at least some adjacent sample points of the current video block.
[0104] In some embodiments, the template of the current video block includes sample points of at least one of a luminance component or a chrominance component.
[0105] In some embodiments, the template of the current video block includes at least some pixels in a region.
[0106] In some embodiments, performing the refinement process includes: performing a control point motion vector refinement process on at least one affine candidate of the current video block; and determining an affine candidate list by adding the refined at least one affine candidate to the affine candidate list of the current video block.
[0107] In some embodiments, performing the refinement process includes: performing a control point motion vector refinement process on at least one affine candidate in the affine candidate list.
[0108] In some embodiments, the control point motion vector refinement process is performed on an affine candidate having an index.
[0109] In some embodiments, method 1900 further includes: determining a first affine candidate list of the current video block; and determining a second affine candidate list of the current video block.
[0110] In some embodiments, the first affine candidate list is determined without using the refinement process.
[0111] In some embodiments, a second affine candidate list is determined based on a first affine candidate list.
[0112] In some embodiments, determining the second affine candidate list includes: determining candidates in the second affine candidate list by performing a control point motion vector refinement process on at least one control point motion vector in the first affine candidate list.
[0113] In some embodiments, the control point motion vector refinement process is based on template matching.
[0114] In some embodiments, the first affine candidate list is determined based on a candidate reordering process.
[0115] In some embodiments, the candidate reordering process is based on template matching.
[0116] In some embodiments, the second affine candidate list is determined without using the candidate reordering process.
[0117] In some embodiments, a first duplicate removal process is used to determine the first affine candidate list, and a second duplicate removal process is used to determine the second affine candidate list, and a first duplicate removal rule of the first duplicate removal process is different from a second duplicate removal rule of the second duplicate removal process.
[0118] In some embodiments, a first threshold for motion similarity checking in the first duplicate removal process is different from a second threshold for motion similarity checking in the second duplicate removal process.
[0119] In some embodiments, the second threshold is based on a block dimension of a current video block.
[0120] In some embodiments, the second threshold is a fixed value.
[0121] In some embodiments, performing the refinement process includes: performing a refinement process on at least one control point motion vector of an affine candidate of a current video block based on template matching; and wherein performing the transformation includes: determining affine motion information of at least one of a current video block or a sub-block of the current video block based on at least one refined control point motion vector.
[0122] In some embodiments, at least one of integer precision or fractional precision is used in the refinement process.
[0123] In some embodiments, integer precision is used in the refinement process, and fractional precision search is skipped.
[0124] In some embodiments, performing a fractional precision search on an affine candidate is based on a result of an integer precision search.
[0125] In some embodiments, fractional precision is used during the refinement process, and an interpolation filter is used to determine at least one reference template for at least one motion vector pointing to at least one fractional position.
[0126] In some embodiments, the interpolation filter includes a simplified interpolation filter.
[0127] In some embodiments, the interpolation filter includes at least one of the following: a 2-tap bilinear filter, a 4-tap, 6-tap, or 8-tap discrete cosine transform filter, a 4-tap, 6-tap, or 8-tap discrete sine transform filter, or a 4-tap, 6-tap, or 8-tap Lanczos filter.
[0128] In some embodiments, the interpolation filter includes an interpolation filter having filter taps longer than a threshold length.
[0129] In some embodiments, it is determined whether and / or how to use the method based on the bitstream or the coding / decoding information of the current video block.
[0130] In some embodiments, whether and / or how to use the method is included in at least one of the following: a sequence parameter set (SPS), a picture parameter set (PPS), a picture header, a slice header, a coding tree unit (CTU), or a coding unit (CU).
[0131] In some embodiments, the coding / decoding information includes at least one of the following: a coding / decoding tool applied to the current video block, or the block dimensions of the current video block.
[0132] In some embodiments, performing the refinement process includes: performing a refinement process on the motion information of a plurality of control points based on a target motion vector displacement value, which is the difference between the control point motion vector and the corresponding refined control point motion vector.
[0133] In some embodiments, traversing a given motion vector displacement value among a plurality of motion vector displacement values includes: determining a refined control point motion vector based on the given motion vector displacement value and at least one control point motion vector; determining the motion information of at least one boundary sub-block associated with the refined at least one control point motion vector; and determining a template matching cost corresponding to the given motion vector displacement value based on the motion information; and determining the target motion vector displacement value based on the plurality of template matching costs corresponding to the plurality of motion vector displacement values. For example, the template matching cost can be determined by using the method described in Section 2.4 or the method described with respect to Figure 17 the described method.
[0134] In some embodiments, a first motion vector displacement value associated with a first control point of a current video block is different from a second motion vector displacement value associated with a second control point of the current video block, and the motion vector displacement value is a difference between a control point motion vector and a corresponding refined control point motion vector.
[0135] In some embodiments, method 1900 further includes: determining a plurality of candidate control point motion vectors for a plurality of control points associated with a current video block; determining a plurality of refined control point motion vectors based on the plurality of candidate control point motion vectors; and determining a target control point motion vector combination based at least on the plurality of refined control point motion vectors, the target control point motion vector being used during the refinement process.
[0136] In some embodiments, the target control point motion vector combination includes the plurality of refined control point motion vectors.
[0137] In some embodiments, determining the target control point motion vector combination includes: determining a plurality of control point motion vector combinations, each control point motion vector combination including corresponding control point motion vectors of the plurality of control points, the corresponding control point motion vectors including candidate control point motion vectors or refined control point motion vectors; determining a plurality of template matching costs based on the plurality of control point motion vector combinations; and determining the target control point motion vector combination based on the plurality of template matching costs, the target control point motion vector being used during the refinement process.
[0138] In some embodiments, at least some of the plurality of control points are refined based on corresponding templates among the plurality of control points.
[0139] In some embodiments, determining the plurality of template matching costs includes: determining sub-block level motion information of at least one boundary sub-block of the current video block for a control point motion vector combination among the plurality of control point motion vector combinations; and determining a corresponding template matching cost based on the sub-block level motion information.
[0140] In some embodiments, the at least one boundary sub-block includes partial boundary sub-blocks of the current video block.
[0141] In some embodiments, the target control point motion vector combination is associated with a minimum template matching cost, and the target control point motion vector combination is determined as a refined affine candidate for the current video block.
[0142] In some embodiments, a second pass of a control point refinement process is performed on the refined affine candidate to further refine each control point.
[0143] In some embodiments, each control point motion vector of the refined affine candidate is further iteratively refined to minimize the template matching cost of the current video block.
[0144] In some embodiments, in a given iteration, the control point motion vectors are refined and other control point motion vectors are fixed.
[0145] In some embodiments, the refinement process is used in conjunction with regression-based affine candidate derivation.
[0146] In some embodiments, performing the refinement process includes: based on template matching, performing a refinement process on at least some of the control point motion vectors of the current video block to obtain a first refined affine candidate, and wherein the method further includes: determining motion information of at least one boundary sub-block associated with the first refined affine candidate; determining a second affine candidate based on the motion information and a regression model; and determining a target affine candidate by comparing a first template matching cost of at least one boundary sub-block using the first refined affine candidate with a second template matching cost of at least one boundary sub-block using the second affine candidate.
[0147] In some embodiments, after refining all or some of the CPMVs using TM (resulting in Affine_model_TM), the motion information of the boundary sub-blocks associated with Affine_model_TM is derived and then fed into a regression model to output a new affine model (referred to as Affine_model_R). Then the TM costs of the boundary sub-blocks using Affine_model_TM and Affine_model_R are calculated and compared respectively. The one with the lower TM cost is determined as the final refined affine candidate.
[0148] In some embodiments, performing the refinement process includes: based on template matching, performing an integer precision refinement process on at least some of the motion vectors of the control points of the current video block to obtain a first refined affine candidate, and performing a fractional precision refinement process on the first refined affine candidate to obtain a second refined affine candidate; and wherein the method further includes: determining motion information of at least one boundary sub-block associated with the first refined affine candidate; determining a third affine candidate based on the motion information and a regression model; and determining a target affine candidate by comparing a first template matching cost of at least one boundary sub-block using the second refined affine candidate with a second template matching cost of at least one boundary sub-block using the third affine candidate.
[0149] In some embodiments, all or part of the CPMV may first perform integer-precision TM refinement (generating Affine_model_TM_I), and then perform fractional-precision TM refinement (generating Affine_model_TM_F). And the motion information of the boundary sub-blocks associated with Affine_model_TM_I is derived and then fed into a regression model to output a new affine model (Affine_model_R). Finally, the TM costs of the boundary sub-blocks using Affine_model_TM_F and Affine_model_R are calculated and compared, and the sub-block with the lower TM cost is determined as the final refined affine candidate.
[0150] In some embodiments, at least one sub-block includes a partial boundary sub-block of the current video block. For example, only some sub-blocks may be needed to calculate the TM cost to generate Affine_model_TM, Affine_model_TM_I, and / or Affine_model_TM_F.
[0151] In some embodiments, the refinement process is based on template matching, and the refinement process is applied to at least one of the following: an affine Merge candidate, or an affine advanced motion vector prediction (AMVP), or an affine inter prediction.
[0152] In some embodiments, the motion vector prediction (MVP) of the affine AMVP is refined based on at least one of template matching or decoder-side motion vector refinement (DMVR).
[0153] In some embodiments, the current video block is affine coded / decoded, and the refinement process based on template matching and the refinement process based on decoder-side motion vector refinement (DMVR) are applied to the current video block together.
[0154] In some embodiments, the refinement process based on template matching is applied before or after the refinement process based on DMVR.
[0155] In some embodiments, the current video block is affine coded / decoded without applying the refinement process based on decoder-side motion vector refinement (DMVR), and the refinement process based on template matching is applied to the current video block.
[0156] In some embodiments, method 1900 further includes: determining the template matching cost of the current video block based on whether the current video block is bi-predicted or uni-predicted.
[0157] In some embodiments, the current video block is bi-predicted, and the template matching cost is determined based on bi-prediction on template matching.
[0158] In some embodiments, the template matching cost is determined based on a weighted sum of a first reference template matching cost associated with a first reference list and a second reference template matching cost associated with a second reference list. For example, let TM ref0 and TM ref1 be the reference TMs associated with List0 and List1 respectively, then the final reference TM (TM bi ) can be derived as: TM bi = a * TM ref0 + (1 - a) * TM ref1 , and a represents the first weight of the first reference TM cost.
[0159] In some embodiments, the sum of the first weight of the first reference template matching cost and the second weight of the second reference template matching cost is one.
[0160] In some embodiments, the first weight is 0.5.
[0161] In some embodiments, the first weight is determined based on an index of bidirectional prediction (BCW) with coding / decoding unit level weights.
[0162] In some embodiments, the first reference template matching cost is determined based on at least one control point motion vector in the first reference list, and the second reference template matching cost is determined based on at least one control point motion vector in the second reference list.
[0163] In some embodiments, the current video block is bidirectionally predicted, and a first template matching cost is determined for the first reference list, and a second template matching cost is determined for the second reference list.
[0164] In some embodiments, the refinement process of at least one control point motion vector of the current video block is performed iteratively.
[0165] In some embodiments, in the steps of the refinement process, the first control point motion vector is refined and the other control point motion vectors are fixed.
[0166] In some embodiments, the first refined control point motion vector is used in subsequent refinement for the second control point motion vector.
[0167] In some embodiments, the unrefined first control point motion vector is used in subsequent refinement for the second control point motion vector.
[0168] In some embodiments, the current video block is bidirectionally predicted.
[0169] In some embodiments, the first control point motion vector associated with the first reference list is refined before refining the second control point motion vector associated with the second reference list.
[0170] In some embodiments, based on the refined first control point motion vector, it is determined whether and / or how to refine the second control point motion vector in the second reference list.
[0171] In some embodiments, the first control point motion vector associated with the first reference list and the second control point motion vector associated with the second reference list are refined separately.
[0172] In some embodiments, during the refinement of the first control point motion vector, for the search step, a unidirectional reference template match in the first reference list is determined based on the first control point motion vector, and a template match cost is determined based on the unidirectional reference template match to obtain a motion vector displacement value.
[0173] In some embodiments, the first control point motion vector associated with the first reference list and the second control point motion vector associated with the second reference list are refined jointly.
[0174] In some embodiments, during the refinement of the first control point motion vector, for the search step, a bidirectional reference template match is determined based on the first control point motion vector and the second control point motion vector, and a template match cost is determined based on the bidirectional reference template match to obtain a motion vector displacement value.
[0175] In some embodiments, performing the refinement process includes: performing multiple rounds of refinement processes on the control point motion vectors of the current video block.
[0176] In some embodiments, at least part of the control point motion vectors of the multiple control point motion vectors are refined in one round of the multiple rounds of refinement processes.
[0177] In some embodiments, at least part of the control point motion vectors of the multiple control point motion vectors are refined in the first round of the multiple rounds of refinement processes, and a second round of refinement process is further performed on at least part of the control point motion vectors of the refined multiple control point motion vectors.
[0178] In some embodiments, based on the prediction direction of the current video block, it is determined whether and / or how to refine at least one control point motion vector of the current video block based on template matching.
[0179] In some embodiments, the current video block is unidirectionally predicted, and at least one control point motion vector is to be refined based on template matching.
[0180] In some embodiments, the current video block is bi - directionally predicted, and at least one control - point motion vector is to be refined based on template matching.
[0181] In some embodiments, the current video block is bi - directionally predicted or uni - directionally predicted, and at least one control - point motion vector is to be refined based on template matching.
[0182] In some embodiments, affine prediction is used as a hypothesis for a current video block encoded and decoded using multiple - hypothesis prediction (MHP).
[0183] In some embodiments, whether and / or how to apply the method is based on a syntax element in the bitstream.
[0184] In some embodiments, the syntax element is in at least one of the following: sequence level, group - of - pictures level, picture level, slice level, or slice - group level.
[0185] In some embodiments, the syntax element is included in at least one of the following: sequence header, picture header, sequence parameter set (SPS), video parameter set (VPS), decoding parameter set (DPS), decoding - capability information (DCI), picture parameter set (PPS), adaptive parameter set (APS), slice header, or slice - group header.
[0186] In some embodiments, the syntax element is indicated in a region containing more than one sample or pixel.
[0187] In some embodiments, the region includes one of the following: prediction block (PB), transform block (TB), coded block (CB), prediction unit (PU), transform unit (TU), coded unit (CU), virtual - pipeline data unit (VPDU), coding - tree unit (CTU), CTU row, slice, picture, or sub - picture.
[0188] In some embodiments, whether and / or how to apply the method is determined based on the coding and decoding information of the current video block.
[0189] In some embodiments, the coding and decoding information includes at least one of the following: the block size of the current video block, the color format of the current video block, the single - tree or double - tree segmentation of the current video block, the color component of the current video block, the slice type of the current video block, or the picture type of the current video block.
[0190] In some embodiments, whether a first syntax element is determined based on a second syntax element, where the first syntax element indicates whether a refinement process based on template matching is applied to the control - point motion vector of the current video block.
[0191] In some embodiments, the transformation includes encoding the current video block into the bitstream.
[0192] In some embodiments, the conversion includes decoding a current video block from a bitstream.
[0193] According to further embodiments of the present disclosure, there is provided a non-transitory computer-readable recording medium. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method executed by a device for video processing. In the method, affine motion compensation information of a current video block of the video is determined. A refinement process is performed on the affine motion compensation information based on at least one previously transcoded sample to obtain refined affine motion compensation information. A bitstream is generated based on the refined affine motion compensation information.
[0194] According to still further embodiments of the present disclosure, there is provided a method for storing a bitstream of a video. In the method, affine motion compensation information of a current video block of the video is determined. A refinement process is performed on the affine motion compensation information based on at least one previously transcoded sample to obtain refined affine motion compensation information. A bitstream is generated based on the refined affine motion compensation information. The bitstream is stored in a non-transitory computer-readable recording medium.
[0195] Embodiments of the present disclosure may be described according to the following clauses, and the features may be combined in any reasonable manner.
[0196] Item 1. A method for video processing, comprising: determining affine motion compensation information of a current video block for conversion between the current video block of a video and a bitstream of the video; performing a refinement process on the affine motion compensation information based on at least one previously transcoded sample to obtain refined affine motion compensation information; and performing the conversion based on the refined affine motion compensation information.
[0197] Item 2. The method according to Item 1, wherein the affine motion compensation information includes at least one of the following: a control point motion vector of the current video block, a motion vector of a sub-block of the current video block, or affine parameters for an affine coding / decoding mode.
[0198] Item 3. The method according to Item 1 or 2, wherein the at least one sample includes at least one of the following: a sample in a first template of the current video block, or a sample in a second template of a reference block of the current video block.
[0199] Item 4. The method according to Item 3, wherein at least one of the first template or the second template includes a reconstruction region, and the samples in the reconstruction region are used to refine the control point motion vector of the current video block.
[0200] Item 5. The method according to Item 3 or 4, wherein the current video block is affine coded and decoded, a plurality of control points are associated with the current video block, and a plurality of templates are used to refine the plurality of control points.
[0201] Item 6. The method according to Item 5, wherein for a first control point among the plurality of control points, the corresponding template among the plurality of templates includes sample points from at least one of the following: an adjacent position in a reconstruction region associated with the current video block, or a non-adjacent position in the reconstruction region.
[0202] Item 7. The method according to Item 5, wherein the plurality of templates include sample points in a reconstruction region adjacent to the current video block.
[0203] Item 8. The method according to Item 5, wherein a first template of a first control point among the plurality of control points includes sample points in a first reconstruction region adjacent to the current video block, and a second template of a second control point among the plurality of control points includes sample points in a second reconstruction region not adjacent to the current video block.
[0204] Item 9. The method according to Item 8, wherein the first control point is located at at least one of the following: the upper right corner of the current video block, or the lower left corner of the current video block, and the second control point is located at the upper left corner of the current video block.
[0205] Item 10. The method according to Item 5, wherein a first template of a first control point among the plurality of control points includes sample points in a first reconstruction region adjacent to the current video block and sample points in a second reconstruction region not adjacent to the current video block.
[0206] Item 11. The method according to Item 5, wherein a first shape of a first template of a first control point among the plurality of control points is different from a second shape of a second template of a second control point among the plurality of control points.
[0207] Item 12. The method according to Item 11, wherein the first shape includes an L shape, and the first template includes upper adjacent sample points and left adjacent sample points of the current video block, and / or the second shape includes an I shape or a horizontal line shape, and the second template includes one of the following: left adjacent sample points of the current video block, or upper adjacent sample points of the current video block.
[0208] Item 13. The method according to Item 5, wherein the shape of a template among the plurality of templates is determined based on the position of the corresponding control point.
[0209] Item 14. The method according to Item 13, wherein for the first control point at the upper left corner of the current video block, the shape of the corresponding template of the first control point is an L shape, and the corresponding template includes the neighboring samples above and to the left of the current video block.
[0210] Item 15. The method according to Item 13, wherein for the second control point at the upper right corner of the current video block, the shape of the corresponding template of the second control point is a horizontal line shape, and the corresponding template includes the neighboring samples above the current video block.
[0211] Item 16. The method according to Item 13, wherein for the first control point at the upper left corner of the current video block, the shape of the corresponding template of the first control point is an I shape, and the corresponding template includes the neighboring samples to the left of the current video block.
[0212] Item 17. The method according to any one of Items 13 to 16, wherein for the control point of the current video block, the shape of the first template in the current picture is the same as the shape of the second template in the reference picture, and the first template and the second template are associated with the control point.
[0213] Item 18. The method according to Item 17, wherein the template of the control point includes the neighboring samples in the first template and the neighboring samples in the second template.
[0214] Item 19. The method according to Item 17 or Item 18, wherein the second template is positioned based on the motion vector of the current video block.
[0215] Item 20. The method according to any one of Items 5 to 19, wherein the first template of the first control point includes a first number of samples, and the second template of the second control point includes a second number of samples, and the first number is different from the second number.
[0216] Item 21. The method according to Item 20, wherein the first row of samples in the first template is different from the second row of samples in the second template, and a row of samples includes a row of samples or a column of samples.
[0217] Item 22. The method according to any one of Items 5 to 19, wherein the first template of the first control point includes a first number of samples, and the second template of the second control point includes a second number of samples, and the first number is the same as the second number.
[0218] Item 23. The method according to any one of Items 1 to 22, wherein performing the refinement process includes: determining a unified template associated with the current video block; determining a template matching cost of the unified template; and performing the refinement process based on the template matching cost.
[0219] Item 24. The method according to Item 23, wherein a motion vector displacement value is determined based on the template matching cost.
[0220] Item 25. The method according to Item 23, wherein a control point motion vector combination is determined based on the template matching cost.
[0221] Item 26. The method according to any one of Items 23 to 25, wherein the unified template includes at least some neighboring samples of the current video block.
[0222] Item 27. The method according to any one of Items 1 to 26, wherein the template of the current video block includes samples of at least one of the following: a luminance component, or a chrominance component.
[0223] Item 28. The method according to any one of Items 1 to 27, wherein the template of the current video block includes at least some pixels in a region.
[0224] Item 29. The method according to any one of Items 1 to 28, wherein performing the refinement process includes: performing a control point motion vector refinement process on at least one affine candidate of the current video block; and determining the affine candidate list by adding the refined at least one affine candidate to the affine candidate list of the current video block.
[0225] Item 30. The method according to any one of Items 1 to 28, further comprising: determining an affine candidate list of the current video block; and wherein performing the refinement process includes: performing a control point motion vector refinement process on at least one affine candidate in the affine candidate list.
[0226] Item 31. The method according to Item 30, wherein the control point motion vector refinement process is performed on an affine candidate having an index.
[0227] Item 32. The method according to any one of Items 1 to 31, further comprising: determining a first affine candidate list of the current video block; and determining a second affine candidate list of the current video block.
[0228] Item 33. The method according to Item 32 or Item 33, wherein the first affine candidate list is determined without using the refinement process.
[0229] Item 34. The method according to Item 32 or Item 33, wherein the second affine candidate list is determined based on the first affine candidate list.
[0230] Item 35. The method according to Item 34, wherein determining the second affine candidate list includes: determining candidates in the second affine candidate list by performing a control point motion vector refinement process on at least one control point motion vector in the first affine candidate list.
[0231] Item 36. The method according to Item 34, wherein the control point motion vector refinement process is based on template matching.
[0232] Item 37. The method according to any one of Items 32 to 36, wherein the first affine candidate list is determined based on a candidate reordering process.
[0233] Item 38. The method according to Item 37, wherein the candidate reordering process is based on template matching.
[0234] Item 39. The method according to any one of Items 32 to 38, wherein the second affine candidate list is determined without using a candidate reordering process.
[0235] Item 40. The method according to any one of Items 32 to 39, wherein the first affine candidate list is determined using a first duplicate removal process, and the second affine candidate list is determined using a second duplicate removal process, and a first duplicate removal rule of the first duplicate removal process is different from a second duplicate removal rule of the second duplicate removal process.
[0236] Item 41. The method according to Item 49, wherein a first threshold for motion similarity checking in the first duplicate removal process is different from a second threshold for motion similarity checking in the second duplicate removal process.
[0237] Item 42. The method according to Item 41, wherein the second threshold is based on a block dimension of the current video block.
[0238] Item 43. The method according to Item 41, wherein the second threshold is a fixed value.
[0239] Item 44. The method according to any one of Items 1 to 43, wherein performing the refinement process includes: performing the refinement process on at least one control point motion vector of an affine candidate of the current video block based on template matching; and wherein performing the conversion includes: determining affine motion information for at least one of the current video block or a sub-block of the current video block based on the refined at least one control point motion vector.
[0240] Item 45. The method according to Item 44, wherein at least one of integer precision or fractional precision is used in the refinement process.
[0241] Item 46. The method according to Item 44, wherein integer precision is used in the refinement process and fractional precision search is skipped.
[0242] Item 47. The method according to Item 44, wherein performing fractional precision search on the affine candidate is based on the result of integer precision search.
[0243] Item 48. The method according to Item 44, wherein the fractional precision is used in the refinement process and an interpolation filter is used to determine at least one reference template for at least one motion vector pointing to at least one fractional position.
[0244] Item 49. The method according to Item 48, wherein the interpolation filter includes a simplified interpolation filter.
[0245] Item 50. The method according to Item 48 or Item 49, wherein the interpolation filter includes at least one of the following: a 2-tap bilinear filter, a 4-tap, 6-tap, or 8-tap discrete cosine transform filter, a 4-tap, 6-tap, or 8-tap discrete sine transform filter, or a 4-tap, 6-tap, or 8-tap Lanczos filter.
[0246] Item 51. The method according to Item 48, wherein the interpolation filter includes an interpolation filter having filter taps longer than a threshold length.
[0247] Item 52. The method according to any one of Items 44 to 51, wherein whether to use the method and / or how to use the method is determined based on the bitstream or the codec information of the current video block.
[0248] Item 53. The method according to Item 52, wherein whether to use the method and / or how to use the method is included in at least one of the following: a sequence parameter set (SPS), a picture parameter set (PPS), a picture header, a slice header, a codec tree unit (CTU), or a codec unit (CU).
[0249] Item 54. The method according to Item 52, wherein the codec information includes at least one of the following: the codec tool applied to the current video block or the block dimension of the current video block.
[0250] Item 55. The method according to any one of Items 1 to 54, wherein performing the refinement process includes: performing the refinement process on the motion information of a plurality of control points based on a target motion vector displacement value, the target motion vector displacement value being the difference between a control point motion vector and a corresponding refined control point motion vector.
[0251] Item 56. The method according to Item 55, further including: traversing a plurality of motion vector displacement values in a motion vector displacement set, the plurality of motion vector displacement values being assigned to at least one control point motion vector of the current video block, wherein traversing a given motion vector displacement value among the plurality of motion vector displacement values includes: determining a refined control point motion vector based on the given motion vector displacement value and the at least one control point motion vector; determining motion information of at least one boundary sub-block associated with the refined at least one control point motion vector; and determining a template matching cost corresponding to the given motion vector displacement value based on the motion information; and determining the target motion vector displacement value based on a plurality of template matching costs corresponding to the plurality of motion vector displacement values.
[0252] Item 57. The method according to any one of Items 1 to 54, wherein a first motion vector displacement value associated with a first control point of the current video block is different from a second motion vector displacement value associated with a second control point of the current video block, the motion vector displacement value being the difference between a control point motion vector and a corresponding refined control point motion vector.
[0253] Item 58. The method according to any one of Items 1 to 57, further including: determining a plurality of candidate control point motion vectors of a plurality of control points associated with the current video block; determining a plurality of refined control point motion vectors based on the plurality of candidate control point motion vectors; and determining a target control point motion vector combination based at least on the plurality of refined control point motion vectors, the target control point motion vector being used in the refinement process.
[0254] Item 59. The method according to Item 58, wherein the target control point motion vector combination includes the plurality of refined control point motion vectors.
[0255] Item 60. The method according to Item 58, wherein determining the target control point motion vector combination includes: determining a plurality of control point motion vector combinations, each control point motion vector combination including corresponding control point motion vectors of the plurality of control points, the corresponding control point motion vectors including candidate control point motion vectors or refined control point motion vectors; determining a plurality of template matching costs based on the plurality of control point motion vector combinations; and determining a target control point motion vector combination based on the plurality of template matching costs, the target control point motion vector being used in the refinement process.
[0256] Item 61. The method according to Item 60, wherein at least some of the plurality of control points are refined based on corresponding templates of the plurality of control points.
[0257] Item 62. The method according to Item 60 or Item 61, wherein determining the plurality of template matching costs includes: determining sub-block level motion information of at least one boundary sub-block of the current video block for a control point motion vector combination among the plurality of control point motion vector combinations; and determining a corresponding template matching cost based on the sub-block level motion information.
[0258] Item 63. The method according to Item 62, wherein the at least one boundary sub-block includes partial boundary sub-blocks of the current video block.
[0259] Item 64. The method according to any one of Items 58 to 63, wherein the target control point motion vector combination is associated with the minimum template matching cost, and the target control point motion vector combination is determined as a refined affine candidate of the current video block.
[0260] Item 65. The method according to Item 64, wherein a second pass of the control point refinement process is performed for the refined affine candidate to further refine each control point.
[0261] Item 66. The method according to Item 65, wherein each control point motion vector of the refined affine candidate is further iteratively refined to minimize the template matching cost of the current video block.
[0262] Item 67. The method according to Item 66, wherein in a given iteration, one control point motion vector is refined and other control point motion vectors are fixed.
[0263] Item 68. The method according to any one of Items 1 to 67, wherein the refinement process is used in conjunction with regression-based affine candidate derivation.
[0264] Item 69. The method according to Item 68, wherein performing the refinement process includes: based on template matching, performing the refinement process on at least part of the control point motion vectors of the current video block to obtain a first refined affine candidate; and wherein the method further includes: determining motion information of at least one boundary sub-block associated with the first refined affine candidate; determining a second affine candidate based on the motion information and a regression model; and determining a target affine candidate by comparing a first template matching cost of at least one boundary sub-block using the first refined affine candidate with a second template matching cost of at least one boundary sub-block using the second affine candidate.
[0265] Item 70. The method according to Item 68, wherein performing the refinement process includes: based on template matching, performing an integer precision refinement process on at least part of the control point motion vectors of the current video block to obtain a first refined affine candidate; and performing a fractional precision refinement process on the first refined affine candidate to obtain a second refined affine candidate; and wherein the method further includes: determining motion information of the at least one boundary sub-block associated with the first refined affine candidate; determining a third affine candidate based on the motion information and a regression model; and determining a target affine candidate by comparing a first template matching cost of the at least one boundary sub-block using the second refined affine candidate with a second template matching cost of the at least one boundary sub-block using the third affine candidate.
[0266] Item 71. The method according to Item 69 or Item 70, wherein the at least one sub-block includes partial boundary sub-blocks of the current video block.
[0267] Item 72. The method according to any one of Items 1 to 71, wherein the refinement process is based on template matching, and the refinement process is applied to at least one of the following: an affine Merge candidate, or an affine advanced motion vector prediction (AMVP), or an affine inter-frame prediction.
[0268] Item 73. The method according to Item 72, wherein the motion vector prediction (MVP) of the affine AMVP is refined based on at least one of template matching or decoder-side motion vector refinement (DMVR).
[0269] Item 74. The method according to any one of Items 1 to 73, wherein the current video block is affine encoded and decoded, and the refinement process based on template matching and the refinement process based on decoder-side motion vector refinement (DMVR) are applied to the current video block together.
[0270] Item 75. The method according to Item 74, wherein the template matching based refinement process is applied before or after the DMVR based refinement process.
[0271] Item 76. The method according to any one of Items 1 to 73, wherein the current video block is affine coded and decoded without applying a refinement process based on decoder side motion vector refinement (DMVR), and a refinement process based on template matching is applied to the current video block.
[0272] Item 77. The method according to any one of Items 1 to 76, further comprising: determining a template matching cost of the current video block based on whether the current video block is bi - directionally predicted or uni - directionally predicted.
[0273] Item 78. The method according to Item 77, wherein the current video block is bi - directionally predicted, and the template matching cost is determined based on bi - directional prediction on template matching.
[0274] Item 79. The method according to Item 78, wherein the template matching cost is determined based on a weighted sum of a first reference template matching cost associated with a first reference list and a second reference template matching cost associated with a second reference list.
[0275] Item 80. The method according to Item 79, wherein the sum of a first weight of the first reference template matching cost and a second weight of the second reference template matching cost is one.
[0276] Item 81. The method according to Item 80, wherein the first weight is 0.5.
[0277] Item 82. The method according to Item 80, wherein the first weight is determined based on an index of bi - directional prediction with coding unit level weights (BCW).
[0278] Item 83. The method according to any one of Items 79 to 83, wherein the first reference template matching cost is determined based on at least one control point motion vector in the first reference list, and the second reference template matching cost is determined based on at least one control point motion vector in the second reference list.
[0279] Item 84. The method according to Item 77, wherein the current video block is bi - directionally predicted, and a first template matching cost is determined for a first reference list, and a second template matching cost is determined for a second reference list.
[0280] Item 85. The method according to any one of Items 1 to 84, wherein the refinement process of at least one control point motion vector of the current video block is iteratively performed.
[0281] Item 86. The method according to Item 85, wherein in the steps of the refinement process, the first control point motion vector is refined and the other control point motion vectors are fixed.
[0282] Item 87. The method according to Item 85, wherein the first refined control point motion vector is used for subsequent refinement of the second control point motion vector.
[0283] Item 88. The method according to Item 85, wherein the unrefined first control point motion vector is used in subsequent refinement of the second control point motion vector.
[0284] Item 89. The method according to any one of Items 85 to 88, wherein the current video block is bi-directionally predicted.
[0285] Item 90. The method according to Item 89, wherein the first control point motion vector associated with the first reference list is refined before the second control point motion vector associated with the second reference list is refined.
[0286] Item 91. The method according to Item 90, wherein whether and / or how to refine the second control point motion vector in the second reference list is determined based on the refined first control point motion vector.
[0287] Item 92. The method according to Item 89, wherein the first control point motion vector associated with the first reference list and the second control point motion vector associated with the second reference list are refined separately.
[0288] Item 93. The method according to Item 92, wherein during the refinement of the first control point motion vector, for the search step, the uni-directional reference template matching in the first reference list is determined based on the first control point motion vector, and the template matching cost is determined based on the uni-directional reference template matching to obtain the motion vector displacement value.
[0289] Item 94. The method according to Item 89, wherein the first control point motion vector associated with the first reference list and the second control point motion vector associated with the second reference list are refined jointly.
[0290] Item 95. The method according to Item 94, wherein during the refinement of the first control point motion vector, for the search step, the bidirectional reference template matching is determined based on the first control point motion vector and the second control point motion vector, and the template matching cost is determined based on the bidirectional reference template matching to obtain the motion vector displacement value.
[0291] Item 96. The method according to any one of Items 1 to 95, wherein performing the refinement process includes: performing multiple rounds of the refinement process on the multiple control point motion vectors of the current video block.
[0292] Item 97. The method according to Item 96, wherein at least some of the multiple control point motion vectors are refined in one round of the multiple rounds of the refinement process.
[0293] Item 98. The method according to Item 96, wherein at least some of the multiple control point motion vectors are refined in the first round of the multiple rounds of the refinement process, and the second round of the refinement process is further performed on at least some of the refined multiple control point motion vectors.
[0294] Item 99. The method according to any one of Items 1 to 98, wherein whether and / or how to refine at least one control point motion vector of the current video block based on template matching is determined based on the prediction direction of the current video block.
[0295] Item 100. The method according to Item 99, wherein the current video block is unidirectionally predicted, and the at least one control point motion vector is to be refined based on template matching.
[0296] Item 101. The method according to Item 99, wherein the current video block is bidirectionally predicted, and the at least one control point motion vector is to be refined based on template matching.
[0297] Item 102. The method according to Item 99, wherein the current video block is bidirectionally predicted or unidirectionally predicted, and the at least one control point motion vector is to be refined based on template matching.
[0298] Item 103. The method according to any one of Items 1 to 102, wherein affine prediction is used as an assumption for the current video block encoded and decoded using multiple hypothesis prediction (MHP).
[0299] Item 104. The method according to any one of Items 1 to 103, wherein whether and / or how to apply the method is based on the syntax elements in the bitstream.
[0300] Item 105. The method according to Item 104, wherein the syntax element is at least one of the following: sequence level, group of pictures level, picture level, slice level, or slice group level.
[0301] Item 106. The method according to Item 104 or Item 105, wherein the syntax element is included in at least one of the following: sequence header, picture header, sequence parameter set (SPS), video parameter set (VPS), decoding parameter set (DPS), decoding capability information (DCI), picture parameter set (PPS), adaptive parameter set (APS), slice header, or temporal group header.
[0302] Item 107. The method according to any one of Items 104 to 106, wherein the syntax element is indicated in a region containing more than one sample or pixel.
[0303] Item 108. The method according to Item 107, wherein 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, picture, or sub-picture.
[0304] Item 109. The method according to any one of Items 1 to 103, wherein whether and / or how to apply the method is determined based on the codec information of the current video block.
[0305] Item 110. The method according to Item 109, wherein the codec information includes at least one of the following: the block size of the current video block, the color format of the current video block, the single-tree segmentation or double-tree segmentation of the current video block, the color component of the current video block, the slice type of the current video block, or the picture type of the current video block.
[0306] Item 111. The method according to any one of Items 1 to 110, wherein whether a first syntax element is determined based on a second syntax element, the first syntax element indicating whether a refinement process based on template matching is applied to the control point motion vector of the current video block.
[0307] Item 112. The method according to any one of Items 1 to 111, wherein the conversion includes encoding the current video block into the bitstream.
[0308] Item 113. The method according to any one of Items 1 to 111, wherein the conversion includes decoding the current video block from the bitstream.
[0309] Item 114. An apparatus for video processing, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to execute the method according to any one of Items 1 to 113.
[0310] Item 115. A non-transitory computer-readable storage medium storing instructions that cause a processor to execute the method according to any one of Items 1 to 113.
[0311] Item 116. A non-transitory computer-readable recording medium storing a bitstream generated by a method executed by an apparatus for video processing, wherein the method comprises: determining affine motion compensation information of a current video block of the video; performing a refinement process on the affine motion compensation information based on at least one previously decoded sample to obtain refined affine motion compensation information; and generating the bitstream based on the refined affine motion compensation information.
[0312] Item 117. A method for storing a bitstream of a video, comprising: determining affine motion compensation information of a current video block of the video; performing a refinement process on the affine motion compensation information based on at least one previously decoded sample to obtain refined affine motion compensation information; generating the bitstream based on the refined affine motion compensation information; and storing the bitstream in a non-transitory computer-readable recording medium. Example device
[0313] Figure 20 A block diagram of a computing device 2000 in which various embodiments of the present disclosure may be implemented is shown. The computing device 2000 may be implemented as the source device 110 (or the video encoder 114 or 200) or the destination device 120 (or the video decoder 124 or 300), or may be included in the source device 110 (or the video encoder 114 or 200) or the destination device 120 (or the video decoder 124 or 300).
[0314] It should be understood that Figure 20 the computing device 2000 shown is for illustrative purposes only and does not imply any limitation to the functionality and scope of the embodiments of the present disclosure in any way.
[0315] As Figure 20 shown, the computing device 2000 includes a general-purpose computing device 2000. The computing device 2000 may include at least one or more processors or processing units 2010, a memory 2020, a storage unit 2030, one or more communication units 2040, one or more input devices 2050, and one or more output devices 2060.
[0316] In some embodiments, the computing device 2000 may be implemented as any user terminal or server terminal with computing capabilities. The server terminal may be a server provided by a service provider, a large computing device, etc. The user terminal may be, for example, any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, stations, units, devices, multimedia computers, multimedia tablet computers, Internet nodes, communicators, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / video cameras, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. It is conceivable that the computing device 2000 may support any type of interface to the user (such as "wearable" circuitry, etc.).
[0317] The processing unit 2010 may be a physical processor or a virtual processor, and may implement various processes based on programs stored in the memory 2020. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing ability of the computing device 2000. The processing unit 2010 may also be referred to as a central processing unit (CPU), microprocessor, controller, or microcontroller.
[0318] The computing device 2000 generally includes various computer storage media. Such media may be any media accessible by the computing device 2000, including but not limited to volatile media and non-volatile media, or removable media and non-removable media. The memory 2020 may be volatile memory (e.g., registers, caches, random access memory (RAM)), non-volatile memory (such as read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), or flash memory), or any combination thereof. The storage unit 2030 may be any removable or non-removable media, and may include machine-readable media, such as memory, flash drive, disk, or other media that can be used to store information and / or data and can be accessed in the computing device 2000.
[0319] The computing device 2000 may also include additional removable / non-removable storage media, volatile / non-volatile storage media. Although not shown in Figure 20 it, a disk drive for reading and / or writing to a removable non-volatile disk and an optical disk drive for reading and / or writing to a removable non-volatile optical disk may be provided. In this case, each drive may be connected to a bus (not shown) via one or more data media interfaces.
[0320] The communication unit 2040 communicates with another computing device via a communication medium. Additionally, the functions of the components in the computing device 2000 can be implemented by a single computing cluster or multiple computing machines, which can communicate via a communication connection. Thus, the computing device 2000 can operate in a networked environment using a logical connection to one or more other servers, networked personal computers (PCs), or other general network nodes.
[0321] The input device 2050 can be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, and so on. The output device 2060 can be one or more of various output devices, such as a display, speaker, printer, and so on. With the aid of the communication unit 2040, the computing device 2000 can also communicate with one or more external devices (not shown), such as storage devices and display devices, the computing device 2000 can also communicate with one or more devices that enable a user to interact with the computing device 2000, or if needed, the computing device 2000 can also communicate with any device (such as a network card, modem, etc.) that enables the computing device 2000 to communicate with one or more other computing devices. Such communication can be carried out via an input / output (I / O) interface (not shown).
[0322] In some embodiments, some or all of the components of the computing device 2000 can also be arranged in a cloud computing architecture rather than being integrated in a single device. In a cloud computing architecture, the components can be provided remotely and work together to implement the functions described in this disclosure. In some embodiments, cloud computing provides computing, software, data access, and storage services, which do not require the end user to be aware of the physical location or configuration of the system or hardware providing these services. In various embodiments, cloud computing uses appropriate protocols to provide services via a wide area network, such as the Internet. For example, a cloud computing provider provides an application via a wide area network, and the application can be accessed via a web browser or any other computing component. The software or components of the cloud computing architecture and the corresponding data can be stored on a server at a remote location. The computing resources in a cloud computing environment can be consolidated or distributed at the locations of remote data centers. The cloud computing infrastructure can provide services through a shared data center, although to the user, they appear as a single access point. Thus, a cloud computing architecture can be used to provide the components and functions described herein from a service provider at a remote location. Alternatively, the components and functions described herein can be provided by a conventional server or installed directly or otherwise on a client device.
[0323] In an embodiment of the present disclosure, the computing device 2000 can be used to implement video encoding / decoding. The memory 2020 may include one or more video codec modules 2025 having one or more program instructions. These modules are accessible and executable by the processing unit 2010 to perform the functions of the various embodiments described herein.
[0324] In an example embodiment of performing video encoding, the input device 2050 may receive video data as an input 2070 to be encoded. The video data may be processed, for example, by the video codec module 2025 to generate an encoded bitstream. The encoded bitstream may be provided as an output 2080 via the output device 2060.
[0325] In an example embodiment of performing video decoding, the input device 2050 may receive the encoded bitstream as an input 2070. The encoded bitstream may be processed, for example, by the video codec module 2025 to generate decoded video data. The decoded video data may be provided as an output 2080 via the output device 2060.
[0326] Although the present disclosure has been specifically shown and described with reference to preferred embodiments thereof, those skilled in the art will understand 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 variations 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 affine motion compensation information for a current video block of a video with respect to a conversion between the current video block and a bitstream of the video; Performing a refinement process on the affine motion compensation information based on at least one previously decoded sample to obtain refined affine motion compensation information; And Performing the conversion based on the refined affine motion compensation information.
2. The method according to claim 1, wherein the affine motion compensation information comprises at least one of the following: A control point motion vector of the current video block, A motion vector of a sub-block of the current video block, or Affine parameters for an affine coding / decoding mode.
3. The method according to claim 1 or 2, wherein the at least one sample comprises at least one of the following: A sample in a first template of the current video block, or A sample in a second template of a reference block of the current video block.
4. The method according to claim 3, wherein at least one of the first template or the second template comprises a reconstructed region, and samples in the reconstructed region are used to refine the control point motion vector of the current video block.
5. The method according to claim 3 or 4, wherein the current video block is affine coded / decoded, a plurality of control points are associated with the current video block, and a plurality of templates are used to refine the plurality of control points.
6. The method according to claim 5, wherein for a first control point among the plurality of control points, the corresponding template among the plurality of templates comprises samples from at least one of the following: an adjacent position in a reconstructed region associated with the current video block, or a non-adjacent position in the reconstructed region.
7. The method according to claim 5, wherein the plurality of templates comprise samples in a reconstructed region adjacent to the current video block.
8. The method according to claim 5, wherein a first template of a first control point among the plurality of control points comprises samples in a first reconstructed region adjacent to the current video block, and A second template of a second control point among the plurality of control points comprises samples in a second reconstructed region not adjacent to the current video block.
9. The method according to claim 8, wherein the first control point is located at at least one of the following: the upper right corner of the current video block, or the lower left corner of the current video block, and The second control point is located at the upper left corner of the current video block.
10. The method according to claim 5, wherein a first template of a first control point among the plurality of control points comprises samples in a first reconstructed region adjacent to the current video block and samples in a second reconstructed region not adjacent to the current video block.
11. The method according to claim 5, wherein a first shape of a first template of a first control point among the plurality of control points is different from a second shape of a second template of a second control point among the plurality of control points.
12. The method according to claim 11, wherein the first shape comprises an L shape, and the first template comprises adjacent samples above and to the left of the current video block, and / or The second shape includes an I shape or a horizontal line shape, and the second template includes one of the following: the left neighboring samples of the current video block, or the upper neighboring samples of the current video block.
13. The method according to claim 5, wherein the shape of the template in the plurality of templates is determined based on the position of the corresponding control point.
14. The method according to claim 13, wherein for the first control point at the upper left corner of the current video block, the shape of the corresponding template of the first control point is an L shape, and the corresponding template includes the upper neighboring samples and the left neighboring samples of the current video block.
15. The method according to claim 13, wherein for the second control point at the upper right corner of the current video block, the shape of the corresponding template of the second control point is a horizontal line shape, and the corresponding template includes the upper neighboring samples of the current video block.
16. The method according to claim 13, wherein for the first control point at the upper left corner of the current video block, the shape of the corresponding template of the first control point is an I shape, and the corresponding template includes the left neighboring samples of the current video block.
17. The method according to any one of claims 13 to 16, wherein for the control point of the current video block, the shape of the first template in the current picture is the same as the shape of the second template in the reference picture, and the first template and the second template are associated with the control point.
18. The method according to claim 17, wherein the template of the control point includes the neighboring samples in the first template and the neighboring samples in the second template.
19. The method according to claim 17 or claim 18, wherein the second template is positioned based on the motion vector of the current video block.
20. The method according to any one of claims 5 to 19, wherein the first template of the first control point includes a first number of samples, and the second template of the second control point includes a second number of samples, and the first number is different from the second number.
21. The method according to claim 20, wherein the first row of samples in the first template is different from the second row of samples in the second template, and a row of samples includes a row of samples or a column of samples.
22. The method according to any one of claims 5 to 19, wherein the first template of the first control point includes a first number of samples, and the second template of the second control point includes a second number of samples, and the first number is the same as the second number.
23. The method according to any one of claims 1 to 22, wherein performing the refinement process includes: determining a unified template associated with the current video block; determining the template matching cost of the unified template; and performing the refinement process based on the template matching cost.
24. The method according to claim 23, wherein the motion vector displacement value is determined based on the template matching cost.
25. The method according to claim 23, wherein the control point motion vector combination is determined based on the template matching cost.
26. The method according to any one of claims 23 to 25, wherein the unified template includes at least some neighboring samples of the current video block.
27. The method according to any one of claims 1 to 26, wherein the template of the current video block includes samples of at least one of the following: a luminance component, or a chrominance component.
28. The method according to any one of claims 1 to 27, wherein the template of the current video block includes at least some pixels in a region.
29. The method according to any one of claims 1 to 28, wherein performing the refinement process includes: performing a control point motion vector refinement process on at least one affine candidate of the current video block; and determining the affine candidate list by adding the refined at least one affine candidate to the affine candidate list of the current video block.
30. The method according to any one of claims 1 to 28, further comprising: determining an affine candidate list of the current video block; and wherein performing the refinement process includes: performing a control point motion vector refinement process on at least one affine candidate in the affine candidate list.
31. The method according to claim 30, wherein the control point motion vector refinement process is performed on an affine candidate having an index.
32. The method according to any one of claims 1 to 31, further comprising: determining a first affine candidate list of the current video block; and determining a second affine candidate list of the current video block.
33. The method according to claim 32 or claim 33, wherein the first affine candidate list is determined without using the refinement process.
34. The method according to claim 32 or claim 33, wherein the second affine candidate list is determined based on the first affine candidate list.
35. The method according to claim 34, wherein determining the second affine candidate list includes: determining candidates in the second affine candidate list by performing a control point motion vector refinement process on at least one control point motion vector in the first affine candidate list.
36. The method according to claim 34, wherein the control point motion vector refinement process is based on template matching.
37. The method according to any one of claims 32 to 36, wherein the first affine candidate list is determined based on a candidate reordering process.
38. The method according to claim 37, wherein the candidate reordering process is based on template matching.
39. The method according to any one of claims 32 to 38, wherein the second affine candidate list is determined without using the candidate reordering process.
40. The method according to any one of claims 32 to 39, wherein the first affine candidate list is determined using a first duplicate removal process, and the second affine candidate list is determined using a second duplicate removal process, and a first duplicate removal rule of the first duplicate removal process is different from a second duplicate removal rule of the second duplicate removal process.
41. The method according to claim 49, wherein a first threshold for motion similarity checking in the first deduplication process is different from a second threshold for motion similarity checking in the second deduplication process.
42. The method according to claim 41, wherein the second threshold is based on the block dimension of the current video block.
43. The method according to claim 41, wherein the second threshold is a fixed value.
44. The method according to any one of claims 1 to 43, wherein performing the refinement process includes: performing the refinement process on at least one control point motion vector of the affine candidate of the current video block based on template matching; and wherein performing the transformation includes: determining affine motion information for at least one of the current video block or a sub-block of the current video block based on the refined at least one control point motion vector.
45. The method according to claim 44, wherein at least one of integer precision or fractional precision is used in the refinement process.
46. The method according to claim 44, wherein integer precision is used in the refinement process and fractional precision search is skipped.
47. The method according to claim 44, wherein performing fractional precision search on the affine candidate is based on the result of integer precision search.
48. The method according to claim 44, wherein the fractional precision is used in the refinement process and an interpolation filter is used to determine at least one reference template for at least one motion vector pointing to at least one fractional position.
49. The method according to claim 48, wherein the interpolation filter includes a simplified interpolation filter.
50. The method according to claim 48 or claim 49, wherein the interpolation filter includes at least one of the following: a 2-tap bilinear filter, a 4-tap, 6-tap or 8-tap discrete cosine transform filter, a 4-tap, 6-tap or 8-tap discrete sine transform filter, or a 4-tap, 6-tap or 8-tap Lanczos filter.
51. The method according to claim 48, wherein the interpolation filter includes an interpolation filter having filter taps longer than a threshold length.
52. The method according to any one of claims 44 to 51, wherein whether to use the method and / or how to use the method is determined based on the bitstream or the coding and decoding information of the current video block.
53. The method according to claim 52, wherein whether to use the method and / or how to use the method is included in at least one of the following: sequence parameter set (SPS), picture parameter set (PPS), picture header, slice header, coding tree unit (CTU), or coding unit (CU).
54. The method according to claim 52, wherein the coding and decoding information includes at least one of the following: coding tools applied to the current video block or the block dimension of the current video block.
55. The method according to any one of claims 1 to 54, wherein performing the refinement process includes: Performing the refinement process on the motion information of a plurality of control points based on a target motion vector displacement value, where the target motion vector displacement value is the difference between a control point motion vector and a corresponding refined control point motion vector.
56. The method according to claim 55, further comprising: Traversing a plurality of motion vector displacement values in a motion vector displacement set, where the plurality of motion vector displacement values are assigned to at least one control point motion vector of the current video block, where traversing a given motion vector displacement value among the plurality of motion vector displacement values includes: Determining a refined control point motion vector based on the given motion vector displacement value and the at least one control point motion vector; Determining motion information of at least one boundary sub-block associated with the refined at least one control point motion vector; and Determining a template matching cost corresponding to the given motion vector displacement value based on the motion information; and Determining the target motion vector displacement value based on a plurality of template matching costs corresponding to the plurality of motion vector displacement values.
57. The method according to any one of claims 1 to 54, wherein a first motion vector displacement value associated with a first control point of the current video block is different from a second motion vector displacement value associated with a second control point of the current video block, and the motion vector displacement value is the difference between a control point motion vector and a corresponding refined control point motion vector.
58. The method according to any one of claims 1 to 57, further comprising: Determining a plurality of candidate control point motion vectors of a plurality of control points associated with the current video block; Determining a plurality of refined control point motion vectors based on the plurality of candidate control point motion vectors; and Determining a target control point motion vector combination at least based on the plurality of refined control point motion vectors, where the target control point motion vector is used in the refinement process.
59. The method according to claim 58, wherein the target control point motion vector combination includes the plurality of refined control point motion vectors.
60. The method according to claim 58, wherein determining the target control point motion vector combination includes: Determining a plurality of control point motion vector combinations, each control point motion vector combination including a corresponding control point motion vector of the plurality of control points, and the corresponding control point motion vector includes a candidate control point motion vector or a refined control point motion vector; Determining a plurality of template matching costs based on the plurality of control point motion vector combinations; and Determining a target control point motion vector combination based on the plurality of template matching costs, where the target control point motion vector is used in the refinement process.
61. The method according to claim 60, wherein at least some of the plurality of control points are refined based on corresponding templates of the plurality of control points.
62. The method according to claim 60 or claim 61, wherein determining the plurality of template matching costs includes: For a control point motion vector combination among the plurality of control point motion vector combinations, determining sub-block level motion information of at least one boundary sub-block of the current video block; and Determine a corresponding template matching cost based on the sub-block level motion information.
63. The method according to claim 62, wherein the at least one boundary sub-block includes partial boundary sub-blocks of the current video block.
64. The method according to any one of claims 58 to 63, wherein the target control point motion vector combination is associated with the minimum template matching cost, and the target control point motion vector combination is determined as the refined affine candidate for the current video block.
65. The method according to claim 64, wherein a second pass of control point refinement process is performed on the refined affine candidate to further refine each control point.
66. The method according to claim 65, wherein each control point motion vector of the refined affine candidate is further iteratively refined to minimize the template matching cost of the current video block.
67. The method according to claim 66, wherein in a given iteration, one control point motion vector is refined and other control point motion vectors are fixed.
68. The method according to any one of claims 1 to 67, wherein the refinement process is used in conjunction with regression-based affine candidate derivation.
69. The method according to claim 68, wherein performing the refinement process includes: Performing the refinement process on at least partial control point motion vectors of the current video block based on template matching to obtain a first refined affine candidate; And wherein the method further includes: Determining the motion information of at least one boundary sub-block associated with the first refined affine candidate; Determining a second affine candidate based on the motion information and a regression model; and Determining a target affine candidate by comparing a first template matching cost of the at least one boundary sub-block using the first refined affine candidate with a second template matching cost of the at least one boundary sub-block using the second affine candidate.
70. The method according to claim 68, wherein performing the refinement process includes: Performing an integer precision refinement process on at least partial control point motion vectors of the current video block based on template matching to obtain a first refined affine candidate; And Performing a fractional precision refinement process on the first refined affine candidate to obtain a second refined affine candidate; And wherein the method further includes: Determining the motion information of the at least one boundary sub-block associated with the first refined affine candidate; Determining a third affine candidate based on the motion information and a regression model; and Determining a target affine candidate by comparing a first template matching cost of the at least one boundary sub-block using the second refined affine candidate with a second template matching cost of the at least one boundary sub-block using the third affine candidate.
71. The method according to claim 69 or claim 70, wherein the at least one sub-block includes partial boundary sub-blocks of the current video block.
72. The method according to any one of claims 1 to 71, wherein the refinement process is based on template matching, and the refinement process is applied to at least one of the following: an affine Merge candidate, or an affine advanced motion vector prediction (AMVP), or an affine inter prediction.
73. The method according to claim 72, wherein the motion vector prediction (MVP) of the affine AMVP is refined based on at least one of template matching or decoder-side motion vector refinement (DMVR).
74. The method according to any one of claims 1 to 73, wherein the current video block is affine coded / decoded, and the refinement process based on template matching and the refinement process based on decoder-side motion vector refinement (DMVR) are applied to the current video block together.
75. The method according to claim 74, wherein the refinement process based on template matching is applied before or after the refinement process based on DMVR.
76. The method according to any one of claims 1 to 73, wherein the current video block is affine coded / decoded without applying the refinement process based on decoder-side motion vector refinement (DMVR), and the refinement process based on template matching is applied to the current video block.
77. The method according to any one of claims 1 to 76, further comprising: Determining a template matching cost of the current video block based on whether the current video block is bi-predicted or uni-predicted.
78. The method according to claim 77, wherein the current video block is bi-predicted, and the template matching cost is determined based on bi-prediction on template matching.
79. The method according to claim 78, wherein the template matching cost is determined based on a weighted sum of a first reference template matching cost associated with a first reference list and a second reference template matching cost associated with a second reference list.
80. The method according to claim 79, wherein the sum of a first weight of the first reference template matching cost and a second weight of the second reference template matching cost is one.
81. The method according to claim 80, wherein the first weight is 0.
5.
82. The method according to claim 80, wherein the first weight is determined based on an index of bi-prediction with coding unit level weights (BCW).
83. The method according to any one of claims 79 to 83, wherein the first reference template matching cost is determined based on at least one control point motion vector in the first reference list, and the second reference template matching cost is determined based on at least one control point motion vector in the second reference list.
84. The method according to claim 77, wherein the current video block is bi-predicted, and a first template matching cost is determined for the first reference list, and a second template matching cost is determined for the second reference list.
85. The method according to any one of claims 1 to 84, wherein the refinement process of at least one control point motion vector of the current video block is iteratively performed.
86. The method according to claim 85, wherein in the steps of the refinement process, a first control point motion vector is refined and other control point motion vectors are fixed.
87. The method according to claim 85, wherein a first refined control point motion vector is used for subsequent refinement of a second control point motion vector.
88. The method according to claim 85, wherein an unrefined first control point motion vector is used in subsequent refinement of a second control point motion vector.
89. The method according to any one of claims 85 to 88, wherein the current video block is bi - directionally predicted.
90. The method according to claim 89, wherein before refining a second control point motion vector associated with a second reference list, a first control point motion vector associated with a first reference list is refined.
91. The method according to claim 90, wherein whether and / or how to refine the second control point motion vector in the second reference list is determined based on the refined first control point motion vector.
92. The method according to claim 89, wherein a first control point motion vector associated with a first reference list and a second control point motion vector associated with a second reference list are refined separately.
93. The method according to claim 92, wherein during the refinement of the first control point motion vector, for a search step, unidirectional reference template matching in the first reference list is determined based on the first control point motion vector, and a template matching cost is determined based on the unidirectional reference template matching to obtain a motion vector displacement value.
94. The method according to claim 89, wherein a first control point motion vector associated with a first reference list and a second control point motion vector associated with a second reference list are refined jointly.
95. The method according to claim 94, wherein during the refinement of the first control point motion vector, for a search step, bidirectional reference template matching is determined based on the first control point motion vector and the second control point motion vector, and a template matching cost is determined based on the bidirectional reference template matching to obtain a motion vector displacement value.
96. The method according to any one of claims 1 to 95, wherein performing the refinement process includes: Performing multiple rounds of the refinement process on multiple control point motion vectors of the current video block.
97. The method according to claim 96, wherein at least some of the multiple control point motion vectors are refined in one round of the multiple rounds of the refinement process.
98. The method according to claim 96, wherein at least some of the plurality of control point motion vectors are refined in a first round of the refinement process among the plurality of rounds, and the refinement process of the second round is further performed for at least some of the plurality of control point motion vectors among the refined plurality of control point motion vectors.
99. The method according to any one of claims 1 to 98, wherein whether and / or how to refine at least one control point motion vector of the current video block based on template matching is determined based on the prediction direction of the current video block.
100. The method according to claim 99, wherein the current video block is unidirectionally predicted, and the at least one control point motion vector is to be refined based on template matching.
101. The method according to claim 99, wherein the current video block is bidirectionally predicted, and the at least one control point motion vector is to be refined based on template matching.
102. The method according to claim 99, wherein the current video block is bidirectionally predicted or unidirectionally predicted, and the at least one control point motion vector is to be refined based on template matching.
103. The method according to any one of claims 1 to 102, wherein affine prediction is used as a hypothesis for the current video block encoded and decoded using multi-hypothesis prediction (MHP).
104. The method according to any one of claims 1 to 103, wherein whether and / or how to apply the method is based on a syntax element in the bitstream.
105. The method according to claim 104, wherein the syntax element is at least one of the following: sequence level, group of pictures level, picture level, slice level, or slice group level.
106. The method according to claim 104 or claim 105, wherein the syntax element is included in at least one of the following: sequence header, picture header, sequence parameter set (SPS), video parameter set (VPS), decoding parameter set (DPS), decoding capability information (DCI), picture parameter set (PPS), adaptive parameter set (APS), slice header, or group of pictures header.
107. The method according to any one of claims 104 to 106, wherein the syntax element is indicated in a region containing more than one sample or pixel.
108. The method according to claim 107, wherein 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, picture, or sub-picture.
109. The method according to any one of claims 1 to 103, wherein whether and / or how to apply the method is determined based on the codec information of the current video block.
110. The method according to claim 109, wherein the encoding / decoding information includes at least one of the following: the block size of the current video block, the color format of the current video block, the single-tree segmentation or double-tree segmentation of the current video block, the color component of the current video block, the slice type of the current video block, or the picture type of the current video block.
111. The method according to any one of claims 1 to 110, wherein whether a first syntax element is determined based on a second syntax element, and the first syntax element indicates whether a refinement process based on template matching is applied to the control point motion vector of the current video block.
112. The method according to any one of claims 1 to 111, wherein the transformation includes encoding the current video block into the bitstream.
113. The method according to any one of claims 1 to 111, wherein the transformation includes decoding the current video block from the bitstream.
114. An apparatus for video processing, comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to execute the method according to any one of claims 1 to 113.
115. A non-transitory computer-readable storage medium storing instructions that cause a processor to execute the method according to any one of claims 1 to 113.
116. A non-transitory computer-readable recording medium storing a bitstream generated by a method executed by an apparatus for video processing for a video, wherein the method includes: determining affine motion compensation information of a current video block of the video; performing a refinement process on the affine motion compensation information based on at least one previously encoded / decoded sample point to obtain refined affine motion compensation information; and generating the bitstream based on the refined affine motion compensation information.
117. A method for storing a bitstream of a video, including: determining affine motion compensation information of a current video block of the video; performing a refinement process on the affine motion compensation information based on at least one previously encoded / decoded sample point to obtain refined affine motion compensation information; generating the bitstream based on the refined affine motion compensation information; and storing the bitstream in a non-transitory computer-readable recording medium.