Method and device for video processing and medium

By adopting a history-based affine model inheritance method in video encoding and decoding, using motion information between video blocks, the problem of inefficient encoding and decoding in the prior art is solved, and more efficient video encoding and decoding performance is achieved.

CN118923112APending Publication Date: 2024-11-08DOUYIN VISION CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280087989.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-01-05
Filing Date
2022-12-28
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing video encoding and decoding technology has room for improvement in encoding and decoding efficiency and performance, especially in the process of motion information prediction and encoding, it is difficult for traditional methods to effectively utilize the motion information between video blocks, resulting in inefficiency.

Method used

A history-based affine model inheritance method is proposed. By determining the motion information of the target block during the conversion process between video blocks, the motion candidate set is derived and coded based on it, including the use of multiple types of affine. Construction and reordering of motion vector prediction tables, motion vector predictions and candidate lists based on history to improve encoding and decoding efficiency and performance.

Benefits of technology

By optimizing the processing and prediction of motion information, the efficiency and performance of video encoding and decoding are significantly improved, and the generation and decoding speed of bitstreams are improved, which is suitable for existing and future video encoding and decoding standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118923112A_ABST
    Figure CN118923112A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a solution for video processing. A method for video processing is presented. The method comprises the following steps: during conversion between a target block of a video and a bit stream of the target block, determining motion information of adjacent blocks of the target block; deriving a motion candidate set for the target block based on the motion information and the affine parameter set for the target block; and performing a conversion based on the set of motion candidates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate generally to video coding techniques, and more particularly, to history-based affine model inheritance. Background Art

[0002] Digital video capabilities are now being used in every aspect of our lives. For video encoding and decoding, various video compression technologies have been proposed, including MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Codec (AVC), ITU-T H.265 High Efficiency Video Codec (HEVC), and Versatile Video Codec (VVC). However, further improvements in the encoding and decoding efficiency of conventional video encoding and decoding technologies are often desired. Summary of the Invention

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

[0004] In a first aspect, a method for video processing is proposed. The method includes: determining motion information of neighboring blocks of a target block during conversion between a target block in a video and a bitstream of the target block; deriving a set of motion candidates for the target block based on the motion information and a set of affine parameters for the target block; and performing conversion based on the set of motion candidates. Compared to traditional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0005] In a second aspect, another method for video processing is proposed. The method includes: determining multiple types of affine history-based motion vector prediction (HMVP) tables during conversion between a target block of a video and a bitstream of the target block; deriving at least one candidate from a candidate list based on the multiple types of affine HMVP tables; and performing conversion based on the at least one candidate. Compared to traditional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0006] In a third aspect, another method for video processing is proposed. The method includes: determining a history-based motion vector prediction (HMVP) table for a target block of a video during conversion between a target block and a bitstream of the target block; storing the HMVP table after encoding / decoding a region; and performing conversion based on the stored HMVP table. Compared to traditional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0007] In a fourth aspect, another method for video processing is proposed. The method includes: generating a set of affine candidate pairs for a target block during conversion between a target block in a video and a bitstream of the target block; and performing the conversion based on the affine candidate list including the set of candidate pairs. Compared to conventional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0008] In a fifth aspect, another method for video processing is proposed. The method includes: constructing a merge list including a candidate set during conversion between a target block of a video and a bitstream of the target block; reordering the candidate set after constructing the merge list; and performing conversion based on the reordered candidate set. Compared to traditional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0009] In a sixth aspect, another method for video processing is proposed. The method includes: during conversion between a target block of a video and a bitstream of the target block, determining whether to reorder a candidate list and / or reordering the candidate list based on codec information of the target block, wherein the candidate list includes at least one of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; and performing conversion based on the determination. Compared to conventional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0010] In a seventh aspect, another method for video processing is proposed. The method includes: generating a candidate for a target block during conversion between a target block in a video and a bitstream of the target block; comparing the candidate with at least one candidate in a candidate list before adding the candidate to the candidate list; and performing conversion based on the comparison. Compared to traditional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0011] In an eighth aspect, another method for video processing is provided. The method includes: during conversion between a target block of a video and a bitstream of the target block, determining a motion candidate list comprising at least one non-adjacent affine construction candidate and at least one history-based affine candidate; and performing conversion based on the motion candidate list. Compared to conventional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0012] In a ninth aspect, another method for video processing is proposed. The method includes: during conversion between a target block of a video and a bitstream of the target block, deriving non-adjacent affine candidates based on a parameter set and at least one non-adjacent unit block, wherein the non-adjacent affine candidates are non-adjacent affine inheritance candidates or non-adjacent affine construction candidates; and performing the conversion based on an affine candidate list including the non-adjacent affine candidates. Compared to conventional solutions, the proposed method can advantageously improve codec efficiency and performance.

[0013] In a tenth aspect, a device for processing video data is provided. The device for processing video data comprises a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to perform a method according to any one of the first, second, third, fourth, fifth, sixth, seventh, eighth, or ninth methods.

[0014] In an eleventh aspect, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores instructions for causing a processor to execute any one of the first, second, third, fourth, fifth, sixth, seventh, eighth, or ninth methods.

[0015] In a twelfth aspect, a non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a video bitstream generated by a method performed by a video processing device. The method includes: determining motion information of neighboring blocks of a target block in the video; deriving a set of motion candidates for the target block based on the motion information and a set of affine parameters for the target block; and generating a bitstream for the target block based on the set of motion candidates.

[0016] In a thirteenth aspect, a method for storing a bitstream of a video comprises: determining motion information of neighboring blocks of a target block of the video; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; generating a bitstream of the target block based on the motion candidate set; and storing the bitstream in a non-transitory computer-readable recording medium.

[0017] In a fourteenth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: determining multiple types of affine history-based motion vector prediction (HMVP) tables for a target block of the video; deriving at least one candidate in a candidate list based on the multiple types of affine HMVP tables; and generating a bitstream for the target block based on the at least one candidate.

[0018] In a fifteenth aspect, a method for storing a bitstream of a video comprises: determining multiple types of affine history-based motion vector prediction (HMVP) tables for a target block of the video; deriving at least one candidate in a candidate list based on the multiple types of affine HMVP tables; generating a bitstream of the target block based on the at least one candidate; and storing the bitstream in a non-transitory computer-readable recording medium.

[0019] In a sixteenth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing apparatus. The method includes: determining a history-based motion vector prediction (HMVP) table for a target block of the video; storing the HMVP table after encoding / decoding a region; and generating a bitstream for the target block based on the stored HMVP table.

[0020] In a seventeenth aspect, a method for storing a bitstream of a video comprises: determining a history-based motion vector prediction (HMVP) table for a target block of the video; storing the HMVP table after encoding / decoding a region; generating a bitstream of the target block based on the stored HMVP table; and storing the bitstream in a non-transitory computer-readable recording medium.

[0021] In an eighteenth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing apparatus. The method includes: generating a set of affine candidate pairs for a target block of the video; and generating a bitstream for the target block based on the affine candidate list including the set of candidate pairs.

[0022] In a nineteenth aspect, a method for storing a bitstream of a video comprises: generating a set of affine candidate pairs for a target block of the video; generating a bitstream of the target block based on an affine candidate list including the set of candidate pairs; and storing the bitstream in a non-transitory computer-readable recording medium.

[0023] In a twelfth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing apparatus. The method includes: constructing a merge list including a candidate set of target blocks for the video; reordering the candidate set after constructing the merge list; and generating a bitstream based on the reordered candidate set.

[0024] In a thirteenth aspect, a method for storing a bitstream of a video comprises: constructing a merge list including a candidate set of target blocks for the video; reordering the candidate set after construction of the merge list; generating a bitstream based on the reordered candidate set; and storing the bitstream in a non-transitory computer-readable recording medium.

[0025] In a fourteenth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a video bitstream generated by a method performed by a video processing apparatus. The method includes: determining whether to reorder a candidate list and / or reordering the candidate list based on codec information of a target block of the video, wherein the candidate list includes at least one of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; and generating a bitstream based on the determination.

[0026] In a fifteenth aspect, a method for storing a bitstream of a video includes: determining whether to reorder a candidate list and / or a process of reordering the candidate list based on codec information of a target block of the video, wherein the candidate list includes at least one of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; generating a bitstream based on the determination; and storing the bitstream in a non-transitory computer-readable recording medium.

[0027] In a sixteenth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing apparatus. The method includes: generating a candidate for a target block of the video; comparing the candidate with at least one candidate in the candidate list before adding the candidate to the candidate list; and generating a bitstream based on the comparison.

[0028] In a seventeenth aspect, a method for storing a bitstream of a video comprises: generating a candidate for a target block of the video; comparing the candidate with at least one candidate in a candidate list before adding the candidate to the candidate list; generating a bitstream based on the comparison; and storing the bitstream in a non-transitory computer-readable recording medium.

[0029] In an eighteenth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing apparatus. The method includes: determining a motion candidate list, the motion candidate list including at least one non-adjacent affine construction candidate and at least one history-based affine candidate; and generating a bitstream based on the motion candidate list.

[0030] In a nineteenth aspect, a method for storing a bitstream of a video comprises: determining a motion candidate list, the motion candidate list comprising at least one non-adjacent affine construction candidate and at least one history-based affine candidate; generating a bitstream based on the motion candidate list; and storing the bitstream in a non-transitory computer-readable recording medium.

[0031] In a twentieth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing apparatus. The method includes: deriving, for a target block of the video, non-adjacent affine candidates based on a parameter set and at least one non-adjacent unit block, wherein the non-adjacent affine candidates are non-adjacent affine inheritance candidates or non-adjacent affine construction candidates; and generating a bitstream based on an affine candidate list including the non-adjacent affine candidates.

[0032] In a twenty-first aspect, a method for storing a bitstream of a video comprises: for a target block of the video, deriving non-adjacent affine candidates based on a parameter set and at least one non-adjacent unit block, and wherein the non-adjacent affine candidates are non-adjacent affine inheritance candidates or non-adjacent affine construction candidates; generating a bitstream based on an affine candidate list including the non-adjacent affine candidates; and storing the bitstream in a non-transitory computer-readable recording medium.

[0033] This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0036] Figure 2 shows a block diagram of a first example video encoder according to some embodiments of the present disclosure;

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

[0038] Figure 4 Sub-block based prediction is shown;

[0039] Figure 5a-5b shows a simplified affine motion model where Figure 5a shows a 4-parameter affine model, Figure 5b A 6-parameter affine model is shown;

[0040] Figure 6 The affine MVF of each sub-block is shown;

[0041] Figures 7a-7b Shows candidates for AF_MERGE;

[0042] Figure 8 Candidate positions for the affine merge pattern are shown;

[0043] Figure 9 Candidate positions for the affine merge pattern are shown;

[0044] Figures 10a-10b A diagram showing the partitioning of a CU into two triangular prediction units (two partitioning modes) is shown, where Figure 10a Shown is a 135 degree division type, Figure 10b A 45-degree division pattern is shown;

[0045] Figure 11 It represents the position of the adjacent block;

[0046] Figure 12 An example of a CU to which a first set of weighting factors is applied is shown;

[0047] Figure 13 An example of motion vector storage is shown.

[0048] Figure 14 shows a decoding flow chart using the proposed HMVP method;

[0049] Figure 15 An example of updating a table in the proposed HMVP method is shown;

[0050] Figure 16 shows the UMVE search process;

[0051] Figure 17 UMVE search points are shown;

[0052] Figure 18 Shown are distance index and distance offset mapping;

[0053] Figure 19 An example of deriving a CPMV from the MVs of neighboring blocks and a set of parameters stored in a buffer is shown;

[0054] Figure 20 A diagram showing examples of possible locations of co-location blocks;

[0055] Figure 21 is a graph representing the position in a 4×4 basic block;

[0056] Figure 22 The sub-blocks at the right and bottom boundaries are shown to be shaded;

[0057] Figures 23a-23d Possible locations for deriving MVs stored in sub-blocks at the right and bottom boundaries are shown;

[0058] Figure 24 Possible locations for deriving MV predictions are shown;

[0059] Figure 25a shows the spatial proximity of the affine merge candidates used to derive inheritance, and Figure 25b The spatial proximity used to derive the constructed affine merge candidates is shown;

[0060] Figure 26 A schematic diagram showing the process from non-adjacent neighbors to the constructed affine merge candidates;

[0061] Figure 27 An example of HPAC is shown.

[0062] Figure 28 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0063] Figure 29 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0064] Figure 30 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0065] Figure 31 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0066] Figure 32 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0067] Figure 33 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0068] Figure 34 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0069] Figure 35 A flowchart showing a method according to an example embodiment of the present disclosure is shown;

[0070] Figure 36 A flowchart illustrating a method according to an example embodiment of the present disclosure; and

[0071] Figure 37 A block diagram is shown of a computing device in which various embodiments of the present disclosure may be implemented.

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

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

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

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

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

[0077] 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 intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the terms "comprises," "includes," and / or "having," when used herein, indicate the presence of the stated features, elements, and / or components, but do not preclude the presence or addition of one or more other features, elements, components, and / or combinations thereof. Sample Environment

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

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

[0080] 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 form a coded representation of the video data. The bitstream may include a coded picture and associated data. A coded picture is a coded representation of a picture. The associated data may include a sequence parameter set, a picture parameter set, and other grammatical structures. The I / O interface 116 may include a modulator / demodulator and / or a transmitter. The coded video data may be directly transmitted to the destination device 120 via the network 130A via the I / O interface 116. The coded video data may also be stored on a storage medium / server 130B for access by the destination device 120.

[0081] Destination device 120 may include an I / O interface 126, a video decoder 124, and a display device 122. The I / O interface 126 may include a receiver and / or a modem. The I / O interface 126 may obtain encoded video data from source device 110 or 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 a user. The display device 122 may be integrated with the destination device 120, or may be external to the destination device 120, the destination device 120 being configured to interface with an external display device.

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

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

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

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

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

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

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

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

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

[0091] The motion estimation unit 204 and the motion compensation unit 205 may perform different operations on the current video block, for example, depending on whether the current video block is in an I slice, a P slice, or a B slice. As used herein, an "I slice" may refer to a portion of a picture consisting of macroblocks, all of which are based on macroblocks within the same picture. Furthermore, as used herein, in some aspects, "P slices" and "B slices" may refer to portions of a picture consisting of macroblocks that are independent of macroblocks in the same picture.

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

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

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

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

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

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

[0098] The intra-frame prediction unit 206 can perform intra-frame prediction on the current video block. When the intra-frame prediction unit 206 performs intra-frame prediction on the current video block, the intra-frame prediction unit 206 can generate prediction data for the current video block based on decoded samples of other video blocks in the same picture. The prediction data for the current video block can include a predicted video block and various syntax elements.

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

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

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

[0102] After transform unit 208 generates a transform coefficient video block associated with the current video block, quantization unit 209 may quantize the transform coefficient video block associated with the current video block based on one or more quantization parameter (QP) values ​​associated with the current video block.

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

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

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

[0106] 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 is shown.

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

[0108] exist Figure 3 In the example of FIG, 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, a reconstruction unit 306, and a buffer 307. In some examples, the video decoder 300 can perform a decoding process that is generally opposite to the encoding process described with respect to the video encoder 200.

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

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

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

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

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

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

[0115] Some example embodiments of the present disclosure are described in detail below. It should be noted that the section headings used in this document are for ease of understanding and are not intended to limit the embodiments disclosed in a section to that section. In addition, although some embodiments are described with reference to general video codecs or other specific video codecs, the disclosed technology is also applicable to other video codec technologies. In addition, although some embodiments describe the video encoding steps in detail, it should be understood that the corresponding decoding steps of de-encoding will be implemented by the decoder. In addition, the term video processing includes video encoding or compression, video decoding or decompression, and video transcoding, in which video pixels are represented from one compression format to another compression format or at different compression bit rates. 1. Overview The present disclosure relates to video / image coding and decoding technology. Specifically, it relates to affine prediction in video / image coding and decoding. The disclosure can be applied to existing video coding and decoding standards, such as HEVC and VVC. It can also be applied to future video / image coding and decoding standards or video / image codecs. 2. Background Video codec standards have primarily evolved through the development of the well-known ITU-T and ISO / IEC standards. ITU-T produced H.261 and H.263, while ISO / IEC produced MPEG-1 and MPEG-4 Visual. These two organizations jointly produced H.264 / MPEG-2 Video, H.264 / MPEG-4 Advanced Video Codec (AVC), and H.265 / HEVC (H.265 / HEVC, https: / / www.itu.int / rec / T-REC-H.265). Since H.262, video codec standards have been based on a hybrid video codec architecture that utilizes temporal prediction and transform coding. To explore future video codec technologies beyond HEVC, VCEG and MPEG jointly established the Joint Video Exploration Team (JVET) in 2015. Since then, JVET has adopted many new methods and put them into reference software called Joint Exploration Model (JEM) (JEM-7.0: https: / / jvet.hhi.fraunhofer.de / svn / svn_HMJEMSoftware / tags / HM-16.6-JEM-7.0) (VTM-2.0.1: https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM / tags / VTM-2.0.1.) In April 2018, the Joint Video Experts Team (JVET) between VCEG (Q6 / 16) and ISO / IEC JTC1SC29 / WG11 (MPEG) was created to work on the VVC standard, with the goal of reducing bitrate by 50% compared to HEVC. The latest version of the VVC draft, Universal Video Codec (Draft 2), can be found at: http: / / phenix.it-sudparis.eu / jvet / doc_end_user / documents / 11_Ljubljana / wg11 / JVET-K1001-v7.zip. The latest reference software for VVC, called VTM, can be found at: https: / / vcgit.hhi.fraunhofer.de / jvet / VVCSoftware_VTM / tags / VTM-2.1 Subblock-based prediction was first introduced to the video codec standard by HEVC Annex I (3D-HEVC) (H.265 / HEVC, https: / / www.itu.int / rec / T-REC-H.265). For subblock-based prediction, a block such as a coding unit (CU) or prediction unit (PU) is divided into several non-overlapping subblocks. Different subblocks can be assigned different motion information, such as reference indices or motion vectors (MVs), and motion compensation (MC) is performed separately for each subblock. Figure 4 Demonstrates the concept of sub-block based prediction. To explore future video codec technologies beyond HEVC, VCEG and MPEG jointly established the Joint Video Exploration Team (JVET) in 2015. Since then, JVET has adopted many new methods (J. Chen, E. Alshina, G.J. Sullivan, J.-R. Ohm, J. Boyce, "Algorithmic Description of the Joint Exploration Test Model 7 (JEM7)", JVET-G1001, August 2017) and put them into a new framework called the Joint Exploration Model (JEM) (JEM-7.0: https: / / jvet.hhi.fraunhofer.de / svn / svn_HMJE-MSoftware / tags / HM-16.6-JEM-7.0). In JEM, sub-block-based prediction is adopted by various codec tools, such as affine prediction, alternative temporal motion vector prediction (ATMVP), spatiotemporal motion vector prediction (STMVP), bidirectional optical flow (BIO), and frame rate up-conversion (FRUC). VVC also uses affine prediction. 2.1 Affine Prediction In HEVC, only the translation motion model is applied for motion compensation prediction (MCP). In the real world, there are many kinds of motion, such as zooming in / out, rotation, perspective motion, and other irregular motions. In VVC, a simplified affine transformation motion compensation prediction is applied. Figure 5a-5b As shown, the affine motion field of a block is described by two (in the 4-parameter affine model) or three (in the 6-parameter affine model) control point motion vectors. The motion vector field (MVF) of a block is described by the following equations: the 4-parameter affine model (where the 4 parameters are defined as variables a, b, e, f) is described in equation (1) and the 6-parameter affine model (where the 4 parameters are defined as variables a, b, c, d, e, and f) is described in equation (2): Among them (mv h 0,mv h 0) is the motion vector of the upper left control point, (mvh 1,mv h 1) is the motion vector of the upper right control point, (mv h 2,mv h 2) is the motion vector of the lower left control point. All three motion vectors are called control point motion vectors (CPMVs). (x, y) represents the coordinates of the representative point relative to the upper left sample in the current block. The CP motion vector can be sent by signal (such as in affine AMVP mode) or dynamically derived (such as in affine merge mode). w and h are the width and height of the current block. In practice, division is achieved by right shift and rounding operations. In VTM, the representative point is defined as the center position of the sub-block. For example, when the coordinates of the upper left corner of the sub-block relative to the upper left sample in the current block are (xs, ys), the coordinates of the representative point are defined as (xs+2, ys+2). In the pointless design, (1) and (2) are implemented as For the 4-parameter affine model shown in (1): For the 6-parameter affine model shown in (2): at last, Off=1<<(S-1) (7) Where S represents the calculation precision, for example, in VVC, S = 7. In VVC, the MV of the sub-block at (xs, ys) with the upper left sample in MC is calculated by (6), where x = xs + 2 and y = ys + 2. To derive the motion vector of each 4×4 sub-block, the motion vector of the center sample of each sub-block is calculated according to equation (1) or (2), as Figure 6 As shown, and rounded to 1 / 16 fractional precision. A motion compensated interpolation filter is then applied to generate a prediction for each sub-block with a derived motion vector. The affine model can be inherited from spatially adjacent affine-encoded blocks, such as the neighboring blocks to the left, above, above right, below left, and above left, as shown in Figure 7(a). For example, if the neighboring below left block A in Figure 7(a) is affine-encoded, as shown in Figure 7(b) as A0, the control point (CP) motion vectors mv0N, mv1N, and mv2N of the neighboring CU / PU containing the top left, top right, and bottom left corners of block A are obtained. The motion vectors mv0C, mv1C, and mv2C of the top left / top right / bottom left corners of the current CU / PU are calculated based on mv0N, mv1N, and mv2N (only for the 6-parameter affine model). It should be noted that in VTM-2.0, if the current block is affine-encoded, the sub-block (e.g., a 4×4 block in VTM) LT stores mv0 and the RT stores mv1. If the current block is encoded and decoded using a 6-parameter affine model, LB stores mv2; otherwise (using a 4-parameter affine model), LB stores mv2'. Other sub-blocks store the MV for MC. It should be noted that when a CU is encoded or decoded in affine merge mode, that is, in AF_MERGE mode, it obtains the first block encoded or decoded in affine mode from the valid adjacent reconstructed blocks. The order of candidate blocks selection is from left, top, top right, bottom left to top left, as shown in Figure 7(a). The derived CP MVs (mv0C, mv1C, and mv2C) of the current block can be used as CP MVs in affine merge mode. Or they can be used as MVPs in affine inter mode in VVC. It should be noted that for merge mode, if the current block is encoded and decoded in affine mode, after deriving the CP MV of the current block, the current block can be further divided into multiple sub-blocks, and each block will derive its motion information based on the derived CP MV of the current block. 2.2 Separate List of Affine Candidates for AF_MERGE Mode Different from VTM where only one affine spatial neighboring block can be used to derive the affine motion of a block, in JVET-K0186, it is proposed to build a separate list of affine candidates for AF_MERGE mode. 1) Insert the inherited affine candidate into the candidate list Inherited affine candidates means that the candidates are derived from valid neighboring reconstructed blocks coded and decoded in affine mode. like Figure 8 As shown, the order of scanning candidate blocks is A1, B1, B0, A0 and B2. When a block is selected (for example, A1), a two-step process is applied: a) First, the three angular motion vectors of the CU covering the block are used to derive two / three control points of the current block. b) Deriving the sub-block motion of each sub-block within the current block based on the control points of the current block. 2) Insert the constructed affine candidate If the number of candidates in the affine merge candidate list is less than MaxNumAffineCand, the constructed affine candidate is inserted into the candidate list. The constructed affine candidate is constructed by combining the neighboring motion information of each control point. The motion information of the control point is first obtained from Figure 8 The coordinates of CP1, CP2, CP3, and CP4 are (0, 0), (W, 0), (H, 0), and (W, H), respectively, where W and H are the width and height of the current block. The motion information of each control point is obtained in the following order of priority: - For CP1, the priority is B2->B3->A2. If B2 is available, use B2. Otherwise, if B2 is available, use B3. If neither B2 nor B3 is available, use A2. If all three candidates are unavailable, motion information for CP1 cannot be obtained. -For CP2, check priority is B1->B0; -For CP3, check priority is A1->A0; -For CP4, use T. Secondly, the motion model is constructed using the combination of control points. The motion vectors of three control points are required to calculate the transformation parameters in the six-parameter affine model. The three control points can be selected from one of the following four combinations: {CP1, CP2, CP4}, {CP1, CP2, CP3}, {CP2, CP3, CP4}, {CP1, CP3, CP4}. For example, the 6-parameter affine motion model is constructed using the CP1, CP2, and CP3 control points, denoted as Affine(CP1, CP2, CP3). The motion vectors of two control points are required to calculate the transformation parameters in a four-parameter affine model. The two control points can be selected from one of the following six combinations: {CP1, CP4}, {CP2, CP3}, {CP1, CP2}, {CP2, CP4}, {CP1, CP3}, {CP3, CP4}. For example, using control points CP1 and CP2 to construct a four-parameter affine motion model is denoted as Affine(CP1, CP2). The combinations of constructed affine candidates are inserted into the candidate list in the following order: {CP1,CP2,CP3},{CP1,CP2,CP4},{CP1,CP3,CP4},{CP2,CP3,CP4},{CP1,CP2},{CP1,CP3},{CP2,CP3},{CP1,CP4},{CP2,CP4},{CP3,CP4}. 3) Insert zero motion vector If the number of candidates in the affine merge candidate list is less than MaxNumAffineCand, zero motion vectors are inserted into the candidate list until the list is full. 2.3 Affine Merge Candidate List 2.3.1 Affine Merge Mode In VTM-2.0.1's affine merge mode, only the first available affine neighbor can be used to derive motion information for the affine merge mode. In JVET-L0366, a candidate list for the affine merge mode is constructed by searching for valid affine neighbors and combining the neighbor motion information for each control point. The steps to construct the affine merge candidate list are as follows: 1) Insert inherited affine candidates Inheriting affine candidates means that the candidate is derived from the affine motion model of its valid affine-encoded neighboring blocks. Figure 9 As shown, the scanning order of candidate positions is: A1, B1, B0, A0 and B2. After deriving a candidate, a complete pruning process is performed to check whether the same candidate has been inserted into the list. If the same candidate exists, the derived candidate is discarded. 2) Insert the constructed affine candidate If the number of candidates in the affine merge candidate list is less than MaxNumAffineCand (set to 5 in this contribution), the constructed affine candidate is inserted into the candidate list. The constructed affine candidate is constructed by combining the neighboring motion information of each control point. The motion information of the control point is first obtained from Figure 9 The kth control point is derived from the specified spatial and temporal proximity shown. A0, A1, A2, B0, B1, B2, and B3 are the spatial locations (k = 1, 2, 3) used to predict CPk; T is the temporal location used to predict CP4. The coordinates of CP1, CP2, CP3, and CP4 are (0,0), (W,0), (H,0), and (W,H), respectively, where W and H are the width and height of the current block. The motion information of each control point is obtained in the following order of priority: For CP1, the priority is B2->B3->A2. If B2 is available, B2 is used. Otherwise, if B2 is available, B3 is used. If neither B2 nor B3 is available, A2 is used. If all three candidates are unavailable, motion information for CP1 cannot be obtained. For CP2, the checking priority is B1->B0. For CP3, the checking priority is A1->A0. For CP4, use T. Second, combinations of control points are used to construct affine merge candidates. The motion information of three control points is required to construct a 6-parameter affine candidate. The three control points can be selected from one of the following four combinations ({CP1, CP2, CP4}, {CP1, CP2, CP3}, {CP2, CP3, CP4}, {CP1, CP3, CP4}). The combination {CP1, CP2, CP3}, {CP2, CP3, CP4}, {CP1, CP3, CP4} will be converted into a 6-parameter motion model represented by the top left, top right, and bottom left control points. The motion information of two control points is required to construct a 4-parameter affine candidate. The two control points can be selected from one of the following six combinations ({CP1, CP4}, {CP2, CP3}, {CP1, CP2}, {CP2, CP4}, {CP1, CP3}, {CP3, CP4}). The combination {CP1, CP4}, {CP2, CP3}, {CP2, CP4}, {CP1, CP3}, {CP3, CP4} will be converted into a 4-parameter motion model represented by the top left and top right control points. The combinations of constructed affine candidates are inserted into the candidate list in the following order: {CP1,CP2,CP3},{CP1,CP2,CP4},{CP1,CP3,CP4},{CP2,CP3,CP4},{CP1,CP2},{CP1,CP3},{CP2,CP3},{CP1,CP4},{CP2,CP4},{CP3,CP4}. For the combined reference list X (X is 0 or 1), the reference index with the highest usage rate among the control points is selected as the reference index of list X, and the motion vector points of the difference reference picture are scaled. After deriving a candidate, a complete pruning process is performed to check whether the same candidate has been inserted into the list. If the same candidate exists, the derived candidate is discarded. 3) Fill with zero motion vectors If the number of candidates in the affine merge candidate list is less than 5, zero motion vectors with zero reference index are inserted into the candidate list until the list is full. 2.3.2 Affine Merge Mode The following simplifications are proposed for the affine merge mode in JVET-L0366: 1) The pruning process for inherited affine candidates has been simplified by comparing codec units covering adjacent positions instead of comparing affine candidates derived in VTM-2.0.1. A maximum of 2 inherited affine candidates are inserted into the affine merge list. The pruning process for constructed affine candidates has been completely removed. 2) Removed the MV scaling operation in the constructed affine candidate. If the reference index of the control point is different, the constructed motion model is discarded. 3) The number of constructed affine candidates is reduced from 10 to 6. 4) It is also proposed to put other merge candidates with sub-block prediction such as ATMVP into the affine merge candidate list. In this case, the affine merge candidate list can be renamed to some other names, such as sub-block merge candidate list. 2.4 Control point MV offset in affine merge mode Generate new affine merge candidates based on the CPMV offset of the first affine merge candidate. If the first affine merge candidate has the 4-parameter affine model enabled, the 2 CPMVs of each new affine merge candidate are derived by offsetting the 2 CPMVs of the first affine merge candidate; otherwise (the 6-parameter affine model is enabled), the 3 CPMVs of each new affine merge candidate are derived by offsetting the 3 CPMVs of the first affine merge candidate. In unidirectional prediction, the CPMV offset is applied to the CPMV of the first candidate. In bidirectional prediction where list 0 and list 1 are in the same direction, the CPMV offset is applied to the first candidate as follows: MV new(L0),i =MV old(L0) +MV offset(i) MV new(L1),i =MV old(L1) +MV offset(i) In bidirectional prediction where list 0 and list 1 are in opposite directions, the CPMV offset is applied to the first candidate as follows: MV new(L0),i =MV old(L0) +MV offset(i) MV new(L1),i =MV old(L1) -MV offset(i) In this contribution, different offset directions with different offset magnitudes are used to generate new affine merge candidates. Two implementations are tested: (1) Generate 16 new affine merge candidates with 8 different offset directions and 2 different offset magnitudes, as shown in the following offset set: Offset set = {(4,0),(0,4),(-4,0),(0,-4),(-4,-4),(4,-4),(4,4),(-4,4),(8,0),(0,8),(-8,0),(0,-8),(-8,-8),(8,-8),(8,8),(-8,8)}. For this design, the affine merge list increases to 20. The number of potential reflective merge candidates is 31 in total. (2) Generate 4 new affine merge candidates with 4 different offset directions and 1 offset magnitude, as shown in the following offset set: Offset set = {(4,0), (0,4), (-4,0), (0,-4)}. The affine merge list remains at 5 as in VTM2.0.1. The four temporal constructed affine merge candidates are deleted to keep the number of potential affine merge candidates unchanged, i.e., 15 in total. Assume that the coordinates of CPMV1, CPMV2, CPMV3, and CPMV4 are (0,0), (W,0), (H,0), and (W,H). Note that CPMV4 is derived from the temporal MV, as Figure 9 The deleted candidates are the following four temporally related constructed affine merge candidates: {CP2, CP3, CP4}, {CP1, CP4}, {CP2, CP4}, {CP3, CP4}. 2.5 Generalized Bidirectional Prediction Improvements Generalized Bidirectional Prediction Improvement (GBi) proposed in JVET-L0646 was adopted by VTM-3.0. GBi was proposed in JVET-C0047. JVET-K0248 (J. Chen, E. Alshina, G.J. Sullivan, J.-R. Ohm, J. Boyce, "Algorithmic Description of Joint Exploration Test Model 7 (JEM7)", JVET-G1001, August 2017) improved the gain-complexity trade-off of GBi and was adopted by BMS2.1. BMS2.1 GBi applies unequal weights to predictors from L0 and L1 in bidirectional prediction mode. In inter prediction mode, multiple weight pairs including equal-weight pairs (1 / 2, 1 / 2) are evaluated based on rate-distortion optimization (RDO), and the GBi index of the selected weight pair is signaled to the decoder. In merge mode, the GBi index is inherited from the neighboring CU. In BMS2.1 GBi, the prediction factor generation in the bidirectional prediction mode is shown in formula (1). P GBi =(w0*P L0 +w1*PL1 +RoundingOffset GBi )>>shiftNum GB , Among them, P GBi is the final predictor of GBi. w0 and w1 are the selected GBi weight pairs and are applied to the predictors of list 0 (L0) and list 1 (L1) respectively. RoundingOffset GBi and shiftNum GBi Used to normalize the final predictor in GBi. The supported w1 weight sets are {-1 / 4, 3 / 8, 1 / 2, 5 / 8, 5 / 4}, where the 5 weights correspond to 1 equal-weighted pair and 4 unequal-weighted pairs. The mixing gain (i.e., the sum of w1 and w0) is fixed to 1.0. Therefore, the corresponding w0 weight set is {5 / 4, 5 / 8, 1 / 2, 3 / 8, -1 / 4}. The weight pair selection is done at the CU level. For non-low-latency images, the weight set size is reduced from 5 to 3, where the w1 weight set is {3 / 8, 1 / 2, 5 / 8} and the w0 weight set is {5 / 8, 1 / 2, 3 / 8}. The weight set size reduction for non-low-latency images is applied to the BMS2.1 GBi and all GBi tests in this contribution. In JVET-L0646, a combined solution based on JVET-L0197 and JVET-L0296 is proposed to further improve GBi performance. Specifically, the following modifications are applied on top of the existing GBi design in BMS2.1. 2.5.1 GBi encoder bug fixes To reduce GBi encoding time, the current encoder design stores unidirectional prediction motion vectors estimated from GBi weights equal to 4 / 8 and reuses them for unidirectional prediction searches for other GBi weights. This fast encoding method works for both translational and affine motion models. VTM2.0 uses both 6-parameter and 4-parameter affine models. The BMS2.1 encoder does not distinguish between 4-parameter and 6-parameter affine models when storing unidirectional prediction affine MVs for GBi weights equal to 4 / 8. Therefore, after encoding using GBi weights equal to 4 / 8, a 4-parameter affine MV may be overwritten by a 6-parameter affine MV. The stored 6-parameter affine MV can be used for a 4-parameter affine ME for other GBi weights, or vice versa. The proposed GBi encoder error fix is ​​to store 4-parameter and 6-parameter affine MVs separately. When GBi weights equal to 4 / 8, the encoder stores affine MVs based on the affine model type and reuses the corresponding affine MVs based on the affine model type for other GBi weights. 2.5.2 GBi CU Size Limit In this method, GBi is disabled for small CUs. In inter prediction mode, if bi-prediction is used and the CU area is smaller than 128 samples, GBi is disabled without any signaling. 2.5.3 Merge Mode with GBi In merge mode, the GBi index is not signaled. Instead, it is inherited from the neighboring block it is merged into. When a TMVP candidate is selected, GBi is turned off in that block. 2.5.4 Affine Prediction with GBi GBi can be used when the current block is affine-predictive coded. For affine inter mode, the GBi index is signaled. For affine merge mode, the GBi index is inherited from the neighboring block it is merged into. If the constructed affine model is selected, GBi is turned off for this block. 2.6 Triangle Prediction Mode The concept of triangular prediction mode (TPM) is to introduce a new triangulation for motion compensation prediction. Figures 10a-10b As shown, it splits the CU into two triangular prediction units along the diagonal or anti-diagonal direction. Each triangular prediction unit in the CU uses its own unidirectional prediction motion vector and reference frame index derived from the unidirectional prediction candidate list for inter-frame prediction. After the triangular prediction unit is predicted, the diagonal edges are adaptively weighted. Then, the transformation and quantization process are applied to the entire CU. It should be noted that this mode is only applicable to skip and merge modes. 2.6.1 One-way prediction candidate list for TPM The unidirectional prediction candidate list consists of five unidirectional prediction motion vector candidates. It is derived from seven neighboring blocks, including five spatial neighboring blocks (1 to 5) and two temporal co-located blocks (6 to 7). Figure 11 As shown. The motion vectors of seven neighboring blocks are collected and placed into a unidirectional candidate list in the order of unidirectional prediction motion vector, L0 motion vector of bidirectional prediction motion vector, L1 motion vector of bidirectional prediction motion vector, and average motion vector of L0 and L1 motion vector of bidirectional prediction motion vector. If the number of candidates is less than 5, zero motion vector is added to the list. The motion candidates added to this list are called TPM motion candidates. More specifically, the following steps are involved: 1) Obtain motion candidates from A1, B1, B0, A0, B2, Col, and Col2 (corresponding to Figure 11 1-7 in ) without any pruning operation. 2) Set the variable numCurrMergeCand=0. 3) For each motion candidate derived from A1, B1, B0, A0, B2, Col and Col2 and numCurrMergeCand is less than 5, if the motion candidate is unidirectional prediction (from list 0 or list 1), it is added to the merge list and numCurrMergeCand is increased by 1. This added candidate motion is called the "original unidirectional prediction candidate". Use full pruning. 4) For each motion candidate derived from A1, B1, B0, A0, B2, Col, and Col2 and numCurrMergeCand is less than 5, if the motion candidate is bidirectionally predicted, the motion information in List 0 is added to the merge list (i.e., modified to unidirectional prediction in List 0), and numCurrMergeCand is incremented by 1. This added motion candidate is called a "truncated List 0 prediction candidate." Use full pruning. 5) For each motion candidate derived from A1, B1, B0, A0, B2, Col and Col2 and numCurrMergeCand is less than 5, if the motion candidate is bidirectionally predicted, add the motion information in List 1 to the merge list (i.e. modify List 1 to unidirectional prediction in ), and numCurrMergeCand is incremented by 1. This added candidate motion is called a "candidate for truncated list 1 prediction". Use full pruning. 6) For each motion candidate derived from A1, B1, B0, A0, B2, Col, and Col2 and numCurrMergeCand is less than 5, if the motion candidate is bidirectionally predicted, If the slice QP of the list 0 reference picture is less than the slice QP of the list 1 reference picture, the motion information of list 1 is first scaled to the list 0 reference picture, and the average of the two MVs (one from the original list 0 and the other is the scaled MV from list 1) is added to the merge list, that is, the average of the unidirectional predictions from the list 0 motion candidates, and numCurrMergeCand is increased by 1. Otherwise, first scale the list 0 motion information to the list 1 reference picture, and add the average of the two MVs (one from the original list 1 and the other one from the scaled list 0) to the merge list, which is the average unidirectional prediction of the list 1 candidate motion, and increase numCurrMergeCand by 1. Use full pruning. 7) If numCurrMergeCand is less than 5, add a zero motion vector candidate. 2.6.1.1 Adaptive Weighted Processing After predicting each triangular prediction unit, an adaptive weighting process is applied to the diagonal edges between the two triangular prediction units to derive the final prediction for the entire CU. Two weight factor groups are defined as follows: First weighting factor group: {7 / 8, 6 / 8, 4 / 8, 2 / 8, 1 / 8} and {7 / 8, 4 / 8, 1 / 8} for luma and chroma samples respectively; • Second set of weighting factors: {7 / 8, 6 / 8, 5 / 8, 4 / 8, 3 / 8, 2 / 8, 1 / 8} and {6 / 8, 4 / 8, 2 / 8} for luma and chroma samples respectively. The weighting factor set is selected based on the comparison of the motion vectors of the two triangular prediction units. When the reference pictures of the two triangular prediction units are different from each other or the difference in their motion vectors is greater than 16 pixels, the second weighting factor set is used. Otherwise, the first weighting factor set is used. Figure 12 An example of a CU to which the first weighting factor group is applied is shown. 2.6.1.2 Motion Vector Storage Motion vector of triangular prediction unit ( Figure 13 Mv1 and Mv2 in CU are stored in 4×4 grids. For each 4×4 grid, a unidirectional prediction or bidirectional prediction motion vector is stored according to the position of the 4×4 grid in the CU. Figure 13 As shown, for a 4×4 grid located in a non-weighted area (i.e., not located at a diagonal edge), a unidirectional prediction motion vector Mv1 or Mv2 is stored. On the other hand, a bidirectional prediction motion vector is stored for a 4×4 grid located in a weighted area. The bidirectional prediction motion vector is derived from Mv1 and Mv2 according to the following rules: 1) In the case where Mv1 and Mv2 have motion vectors from different directions (L0 or L1), Mv1 and Mv2 are simply combined to form a bidirectional prediction motion vector. 2) When Mv1 and Mv2 both come from the same L0 (or L1) direction, If the reference picture of Mv2 is the same as the picture in the L1 (or L0) reference picture list, Mv2 is scaled to that picture. Mv1 and the scaled Mv2 are combined to form a bidirectional prediction motion vector. If the reference picture of Mv1 is the same as the picture in the L1 (or L0) reference picture list, Mv1 is scaled to that picture. The scaled Mv1 and Mv2 are combined to form a bidirectional prediction motion vector. Otherwise, only Mv1 is stored as the weighted region. 2.7 History-based Motion Vector Prediction A history-based MVP (HMVP) method is proposed, in which the HMVP candidate is defined as the motion information of the previously coded block. A table with multiple HMVP candidates is maintained during the encoding / decoding process. When a new slice is encountered, the table is cleared. Whenever there is a non-affine block that has been inter-coded, the associated motion information is added to the last entry of the table as a new HMVP candidate. The entire encoding and decoding process is as follows Figure 14 shown. Figure 15 An example of updating a table in the proposed HMVP method is shown. In this contribution, the table size S is set to 6, indicating that a maximum of 6 HMVP candidates can be added to the table. When a new motion candidate is inserted into the table, a constrained FIFO rule is used, where a redundancy check is first applied to find if the same HMVP exists in the table. If found, the same HMVP is deleted from the table, and then all HMVP candidates are moved forward, i.e., the index is reduced by 1. HMVP candidates can be used in the merge candidate list construction process. The latest HMVP candidates in the table are checked in order and inserted into the candidate list after the TMVP candidate. Pruning is applied to the HMVP candidates to exclude spatial or temporal merge candidates of sub-block motion candidates (i.e., ATMVP). To reduce the number of pruning operations, three simplifications are introduced: 1) The number of HMPV candidates to be checked, represented by L, is set as follows: L=(N<=4)?M:(8-N) (1) Where N indicates the number of non-sub-block merging candidates available in the table, and M indicates the number of HMVP candidates available in the table. 2) Additionally, once the total number of available merge candidates reaches the signaled maximum allowed merge candidate minus 1, the process of constructing the merge candidate list from the HMVP list is terminated. 3) In addition, the number of pairs used for combined bi-predictive merging candidate derivation is reduced from 12 to 6. Similarly, HMVP candidates can also be used in the AMVP candidate list construction process. The motion vectors of the last K HMVP candidates in the table are inserted after the TMVP candidates. Only HMVP candidates with the same reference picture as the AMVP target reference picture are used to construct the AMVP candidate list. Pruning is applied to HMVP candidates. In this contribution, K is set to 4, while the AMVP list size remains unchanged, that is, equal to 2. 2.8 Final Motion Vector Expression (UMVE) In this contribution, the Ultimate Motion Vector Expression (UMVE) is presented. UMVE is also known as Merge with MVD (MMVD) in VVC. UMVE is used for skip or merge mode by the proposed motion vector expression method. UMVE reuses merge candidates in the same manner as in VVC. Within the merge candidates, candidates can be selected and further extended with the proposed motion vector representation. UMVE provides a new motion vector representation with simplified signaling. The representation includes starting point, motion magnitude, and motion direction. Figure 16 An example of a UMVE search process is shown. Figure 17 An example of a UMVE search point is shown. The proposed technique uses the merge candidate list as is, but for the UMVE extension, only candidates of the default merge type (MRG_TYPE_DEFAULT_N) are considered. The base candidate index defines the starting point. The base candidate index indicates the best candidate among the candidates in the list, as shown below. Table 1 Basic candidate IDX Basic Candidate IDX 0 1 2 3 Nth MVP First MVP Second MVP Third MVP Fourth MVP If the number of basic candidates is equal to 1, the basic candidate IDX is not signaled. The distance index is the motion amplitude information. The distance index indicates the predefined distance from the starting point information. The predefined distances are as follows. Table 2 Distance IDX The direction index indicates the direction of the MVD relative to the starting point. The direction index can represent four directions as shown below. Table 3 Direction IDX Direction IDX 00 01 10 11 x-axis + – N / A N / A y-axis N / A N / A + – The UMVE flag is signaled immediately after the Skip and Merge flags are sent. If the Skip and Merge flags are true, the UMVE flag is parsed. If the UMVE flag is 1, the UMVE syntax is parsed. However, if it is not 1, the AFFINE flag is parsed. If the AFFINE flag is 1, AFFINE mode is used. However, if it is not 1, the Skip / Merge index is parsed for the VTM's Skip / Merge mode. No additional line buffering is required for UMVE candidates, as software skip / merge candidates are directly used as base candidates. Using the input UMVE index, the MV complement is determined just before motion compensation. There's no need to maintain a long queue buffer for this. 2.9 Inter-Intra Mode With inter-intra mode, multi-hypothesis prediction combines an intra prediction and a merge index prediction. In the merged CU, a flag for merge mode is signaled to select the intra mode from the intra candidate list when the flag is true. For the luma component, the intra candidate list is derived from four intra prediction modes: DC, planar, horizontal, and vertical, and the size of the intra candidate list can be 3 or 4, depending on the block shape. When the CU width is greater than twice the CU height, the horizontal mode is not included in the intra mode list; when the CU height is greater than twice the CU width, the vertical mode is removed from the intra mode list. A weighted average is used to combine an intra prediction mode selected by the intra mode index and a merge index prediction selected by the merge index. For chroma components, DM is always applied without additional signaling. The weights for the combined prediction are described below. Equal weights are applied when DC or planar mode is selected or when the CB width or height is less than 4. For those CBs with a CB width and height greater than or equal to 4, when horizontal / vertical mode is selected, the CB is first split vertically / horizontally into four equal-sized regions. Each weight set (denoted as (w_intra i ,w_inter i ), where i ranges from 1 to 4, and (w_intra1, w_inter1) = (6, 2), (w_intra2, w_inter2) = (5, 3), (w_intra3, w_inter3) = (3, 5) and (w_intra4, w_inter4) = (2, 6)) will be applied to the corresponding regions. (w_intra1, w_inter1) is used for the region closest to the reference sample, and (w_intra4, w_inter4) is used for the region farthest from the reference sample. The combined prediction can then be calculated by adding the two weighted predictions and shifting them right by 3 bits. In addition, the intra prediction mode of the intra hypothesis for the predictor can be saved for subsequent reference by neighboring CUs. 2.10 Affine Merge Mode with Prediction Offset The proposed method selects the first available affine merge candidate as the base predictor. It then applies a motion vector offset to the motion vector value of each control point from the base predictor. If no affine merge candidate is available, the proposed method is not used. The inter prediction direction of the selected base predictor and the reference index for each direction remain unchanged. In the current implementation, it is assumed that the affine model of the current block is a 4-parameter model and only 2 control points need to be derived. Therefore, only the first 2 control points of the base predictor will be used as control point predictors. For each control point, a zero_MVD flag is used to indicate whether the control point of the current block has the same MV value as the corresponding control point predictor. If the zero_MVD flag is true, no further signaling is required for the control point. Otherwise, the distance index and offset direction index of the control point are signaled. Use a distance offset table of size 5 as shown in the following table. Send out the distance index signal to indicate which distance offset to use. The mapping between distance index and distance offset value is as follows Figure 18 shown. Table 4 Distance offset table Distance Index 0 1 2 3 4 Distance Offset 1 / 2 pixel 1 pixel 2 pixels 4 pixels 8 pixels The direction index can represent four directions as shown below, where only the x or y direction can have MV differences, but not both directions. Table 5 Offset direction IDX 00 01 10 11 x-direction factor +1 -1 0 0 y-direction factor 0 0 +1 -1 If inter prediction is unidirectional, the signaled distance offset is applied to the offset direction of each control point predictor. The result will be the MV value for each control point. For example, when the basic predictor is unidirectional prediction, the motion vector value of the control point is MVP (v px ,v py ). When the distance offset and direction index are signaled, the motion vector of the corresponding control point of the current block will be calculated as follows. MV(v x ,v y )=MVP(v px ,v py )+MV(x-direction factor*distance offset,y-direction factor*distance offset); If inter prediction is bidirectional, the signaled distance offset is applied to the L0 motion vector of the control point predictor in the signaled offset direction; the same distance offset is applied to the L1 motion vector of the control point predictor in the opposite direction. The result will be the MV value of each control point in each inter prediction direction. For example, when the basic prediction factor is bidirectional prediction, the motion vector value of the control point on L0 is MVP L0 (v 0px 、v 0py ), and the motion vector of the control point on L1 is MVP L1 ( v1px ,v 1py ). When the distance offset and direction index are signaled, the motion vector of the corresponding control point of the current block is calculated as follows: MV L0 (v 0x ,v 0y )=MVPL0 (v 0px ,v 0py )+MV(x-direction factor*distance offset,y-direction factor*distance offset); MV L1 (v 0x ,v 0y )=MVP L1 (v 0px ,v 0py )+MV(-x direction factor*distance offset,-direction factor*distance offset). A simplified method is proposed to reduce signaling overhead by signaling the distance offset index and offset direction index for each block. The same offset is applied to all available control points in the same manner. In this method, the number of control points is determined by the affine type of the base predictor: 3 control points for a 6-parameter type and 2 control points for a 4-parameter type. The distance offset table and offset direction table are the same as in 2.1. Since all control points of a block are signaled at once, the Zero_MVD flag is not used in this method. 2.11 Representation of Affine Motion Data It is proposed to store affine parameters instead of CPMV to predict the affine model of subsequent coded blocks. 2.12 Merge List Design VVC supports three different merge list construction processes: 1) Sub-block merge candidate list: This includes ATMVP and affine merge candidates. Affine and ATMVP modes share a common merge list construction process. ATMVP and affine merge candidates can be added sequentially. The sub-block merge list size is signaled in the slice header, with a maximum value of 5. 2) Unidirectional Prediction TPM Merge List: For triangular prediction mode, even though the two partitions can choose their own merge candidate indices, the merge list construction process is shared between the two partitions. When building the merge list, the spatial neighbors and two temporal blocks of the block are checked. The motion information derived from the spatial neighbors and temporal blocks is called regular motion candidates in our IDF. These regular motion candidates are further used to derive multiple TPM candidates. Note that the transform is performed at the whole block level, and even two partitions can use different motion vectors to generate their own prediction blocks. The size of the one-way prediction TPM merge list is fixed at 5. 3) Regular merge list: A common merge list construction process is used for the remaining coded blocks. Here, spatial / temporal / HMVP, pairwise combined bi-predictive merge candidates, and zero motion candidates can be inserted in sequence. The regular merge list size is signaled in the slice header and has a maximum value of 6. 2.12.1 Sub-block Merging Candidate List It is proposed to put all sub-block related motion candidates into a separate merge list in addition to the regular merge list for non-sub-block merge candidates. Motion candidates associated with sub-blocks are put into a separate merge list, called "sub-block merge candidate list". In one example, the sub-block merge candidate list includes affine merge candidates, ATMVP candidates and / or sub-block based STMVP candidates. 2.12.2 Affine Merge Candidate List In this contribution, the ATMVP merge candidate in the normal merge list is moved to the first position of the affine merge list, so that all merge candidates in the new list (i.e., the sub-block based merge candidate list) are based on sub-block codec tools. The steps to construct the affine merge candidate list are as follows: Inserting affine candidates for inheritance An inherited affine candidate means that the candidate is derived from the affine motion model of its effectively affine-encoded neighboring blocks. Up to two inherited affine candidates are derived from the affine motion models of the neighboring blocks and inserted into the candidate list. For the left predictor, the scan order is {A0, A1}; for the above predictors, the scan order is {B0, B1, B2}. Insert the constructed affine candidate If the number of candidates in the affine merge candidate list is less than MaxNumAffineCand (set to 5), the constructed affine candidate is inserted into the candidate list. The constructed affine candidate refers to a candidate constructed by combining the neighboring motion information of each control point. The motion information of the control point is first obtained from Figure 9 The coordinates of CP1, CP2, CP3, and CP4 are (0, 0), (W, 0), (H, 0), and (W, H), respectively, where W and H are the width and height of the current block. The motion information of each control point is obtained in the following order of priority: For CP1, the priority is B2->B3->A2. If B2 is available, B2 is used. Otherwise, if B2 is available, B3 is used. If neither B2 nor B3 is available, A2 is used. If all three candidates are unavailable, motion information for CP1 cannot be obtained. For CP2, the checking priority is B1->B0. For CP3, the checking priority is A1->A0. For CP4, use T. Second, combinations of control points are used to construct affine merge candidates. The motion information of three control points is required to construct a 6-parameter affine candidate. The three control points can be selected from one of the following four combinations ({CP1, CP2, CP4}, {CP1, CP2, CP3}, {CP2, CP3, CP4}, {CP1, CP3, CP4}). The combination {CP1, CP2, CP3}, {CP2, CP3, CP4}, {CP1, CP3, CP4} will be converted into a 6-parameter motion model represented by the top left, top right, and bottom left control points. The motion information of two control points is required to construct a 4-parameter affine candidate point. The two control points can be selected from one of two combinations ({CP1, CP2}, {CP1, CP3}). These two combinations will be converted into a 4-parameter motion model represented by the top left and top right control points. The combinations of constructed affine candidates are inserted into the candidate list in the following order: {CP1, CP2, CP3}, {CP1, CP2, CP4}, {CP1, CP3, CP4}, {CP2, CP3, CP4}, {CP1, CP2}, {CP1, CP3}. Only when the CPs have the same reference index, available combinations of motion information of the CPs are added to the affine merge list. 4) Fill with zero motion vectors If the number of candidates in the affine merge candidate list is less than 5, zero motion vectors with zero reference index are inserted into the candidate list until the list is full. 2.12.3 Shared Merge List It is proposed that all leaf CUs of an ancestor node in the CU partition tree share the same merge candidate list to enable parallel processing of small skipped / merged CUs. The ancestor node is called a merge shared node. The shared merge candidate list is generated at the merge shared node, assuming that the merge shared node is a leaf CU. 2.13 Historical Affine Forecast History-based affine parameter inheritance 1. The parameters a, b, c, d, e, and f defined in equation (2) for an affine-encoded block can be stored in a buffer (a buffer can be a table, a lookup table, a first-in-first-out (FIFO) table, or a stack, or a queue, or a list, or a link, or an array, or any other storage with any data structure) or a constrained FIFO table, where each affine model is unique. In the following discussion, an entry in the buffer is denoted as H[i], where i is an index referencing the entry. a. Alternatively, a, b, c, and d defined in equation (2) may be stored in a buffer; in this case, e and f are no longer stored. b. Alternatively, if the codec is a 4-parameter affine mode, a and b defined in equation (1) can be stored in a buffer. c. Alternatively, if the codec is a 4-parameter affine mode, a, b, e and f defined in equation (1) can be stored in a buffer. d. If the encoding and decoding is performed using the 4-parameter affine mode, the parameters a, b, c, d, e and f defined in equation (2) are always stored in the buffer, but are restricted to c = -b and d = a. e. If the encoding and decoding is performed using the 4-parameter affine mode, the parameters a, b, c, and d defined in equation (2) are always stored in the buffer, but are subject to the constraints c = -b, d = a. f. For 4-parameter and 6-parameter affine models, the same number of parameters can be stored, for example, a, b, c, d, e, and f. In another example, a, b, c, and d are stored. g. Alternatively, different numbers of parameters may be stored for 4-parameter and 6-parameter affine models, and the affine model type (ie, 4-parameter or 6-parameter) may also be stored. h. Which parameters are stored in the buffer may depend on affine mode, inter or merge mode, block size, picture type, etc. i. Side information associated with the affine parameters may also be stored in the buffer together with the affine parameters, such as the inter prediction direction (list 0 or list 1, or both), and the reference index of list 0 and / or list 1. In this disclosure, when discussing a set of affine parameters stored in a buffer, the associated side information may also be included. i. If the affine-coded block is bi-directionally predicted, the set of affine parameters to be stored includes the parameters for list 0 and the parameters for list 1. (a) The parameters of two reference lists (List0 and List1) are stored. (b) In one example, the parameters of the two reference lists are stored independently (in two different buffers). (c) Alternatively, the parameters of the two reference lists may be stored by projection from one to the other. j. As an alternative storage method, the CPMV {MV0, MV1} or {MV0, MV1, MV2} of the affine coded block is stored in the buffer instead of the parameters. When needed, the parameters for coding a new block can be calculated based on {MV0, MV1} or {MV0, MV1, MV2}. i. The width of the affine-encoded block can be stored in a buffer together with the CPMV. ii. The height of the affine-encoded block can be stored in a buffer together with the CPMV. iii. The upper left coordinate of the affine-encoded block can be stored in a buffer together with the CPMV. k. In one example, the basic Stored with parameters a and b. i. In one example, the coordinates of the location of the basic MV are also consistent with the parameter a Stored together with b. 1. In one example, the basic Stored with parameters a, b, c, and d. i. In one example, the coordinates of the location of the basic MV and the parameters a, b, c, and d are also stored. m. In one example, if a set of stored parameters and its base MV refer to the same reference picture list, then they should refer to the same reference picture. n. The buffer used to store encoded / decoded affine related information (such as CPMV, affine parameters, base point position coordinates, block width and height) is also referred to as "affine HMVP buffer" in this document. 2. In one example, the parameters stored in the buffer can be calculated as follows: a. b. c. d. e. For 4-parameter affine prediction, c = -b; f. For 4-parameter affine prediction, d = a; g. h. i. (e, f) = (mvx, mvy), where (mvx, mvy) can be any MV used to encode or decode a block. 3. Propose to calculate the affine model parameters without division operation. Assume that the width and height of the current block are w and h equal to 2 WB and 2 HB P is an integer that defines the calculation precision, for example, P is set to 7. a. b. c. d. 4. The affine model parameters can be further clipped before being stored in the buffer. a. In one example, assuming that the parameter x (eg, x=a or b or c or d) is stored in K bits, then x=Clip3(-2 K-1 ,2 K-1 -1,x). b. For example, if a=Clip(-128, 127, a), a is stored as an 8-bit signed integer. 5. Affine model parameters can be pruned before being used to encode / decode an affine-coded block (eg, to derive the MV of a sub-block). a. In an example, a = Clip3(Min_a, Max_a, a), b = Clip3(Min_b, Max_b, b), c = Clip3(Min_c, Max_c, c), d = Clip3(Min_d, Max_d, d), where Min_a / b / c / d and Max_a / b / c / d are called clipping boundaries. b. In one example, the clipping boundary may depend on the precision (eg, bit depth) of the affine parameters. c. In one example, the clipping boundary may depend on the width and height of the block. d. In one example, the cropping boundary may be signaled, for example, in a VPS / SPS / PPS / picture header / slice header / tile group header. e. In one example, the clipping boundary may depend on the profile and / or level of the standard. 6. The affine model parameters of each affine-encoded block may be stored in a buffer after decoding or encoding the block. a. Whether to store the affine model parameters of the affine coded blocks may depend on the affine mode coded (eg, affine AMVP or affine merging), the number of affine coded blocks, the location of the affine coded blocks, the block size, etc. b. In one example, after decoding or encoding each Kth affine-encoded block, each is stored in a buffer. That is, the affine model parameters of each first, second, ... (K-1)th affine-encoded block are not stored in the buffer. iK is a number, such as 2 or 4. ii. K can be signaled from the encoder to the decoder in VPS / SPS / PPS / slice header / tile group header / tile. 7. The buffer used to store affine parameters can have a maximum capacity. a. The buffer can store up to M sets of affine parameters, that is, for H[i], i>=0 and i <M。 iM is an integer, such as 8 or 16. ii.M can be signaled from the encoder to the decoder in VPS / SPS / PPS / slice header / tile group header / tile / CTU row / CTU. iii. M may be different for different standard grades / levels / tiers. 8. When the buffer for affine parameter storage is not full (ie, the number of stored affine parameter S groups is less than the maximum capacity M) and a new set of affine parameters needs to be stored in the buffer, H[S -1] is used to store new parameters, and S=S+1. 9. When the buffer is full (i.e., the number of stored affine parameter S sets is equal to the maximum capacity M), and a new set of affine parameters needs to be stored in the buffer, one or more of the following strategies can be adopted: a. The new set of affine parameters cannot be stored in the buffer; b. An existing entry in the buffer is deleted and a new set of affine parameters is stored in the buffer. i. In one example, the oldest entry stored in the buffer (eg, H[0]) is removed from the buffer. ii. In one example, the last entry stored in the buffer (eg, H[M-1]) is removed from the buffer. iii. In one example, any entry stored in the buffer (eg, H[T]) is removed from the buffer for which T>=0 and T <M。 iv. If H[T] is deleted, store the new set of affine parameters as H[T]. v. If H[T] is deleted, all entries after H[T] will be moved forward. For example, for X, from T to M-1 in ascending order, H[X] = H[X+1]. Then the new set of affine parameters is placed at the last entry in the buffer, such as H[M-1]. vi. If H[T] is deleted, all the entries before H[T] will be shifted backward. For example, for X, sorted in descending order from T to 1, H[X] = H[X - 1]. Then place the new set of affine parameters into the first entry in the buffer, e.g., H[0]. 10. When a new set of affine parameters needs to be stored in the buffer, it can be compared with all or some of the existing sets of affine parameters in the buffer. If it is determined that it is the same as or similar to at least one existing set of affine parameters in the buffer, it should not be stored in the buffer. This process is called "pruning". a. For a reference picture list (a prediction direction), in the following cases, the affine parameters {a, b, c, d} or {a, b, c, d, e, f} and the affine parameters {a', b', c', d'} or {a', b', c', d', e', f'} are considered the same or similar: i. In one example, a == a'. ii. In one example, b == b'. iii. In one example, c == c'. iv. In one example, d == d’. v. In one example, a == a' and b == b'. vi. In one example, c == c' and d == d'. vii. In one example, a == a' and b == b' and c == c'. viii. In one example, a == a' and b == b' and c == c' and d == d'. ix. In one example, |a - a'| < delta0. x. In one example, |b - b'| < delta0. xi. In one example, |c - c'| < delta0. xii. In one example, |d - d'| < delta0. xiii. In one example, |a - a'| < delta0 and |b - b'| < delta1. xiv. In one example, |c - c'| < delta0 and |d - d'| < delta1. xv. In one example, |a - a'| < delta0 and |b - b'| < delta1 and |c - c'| < delta2. xvi. In one example, |a - a'| < delta0 and |b - b'| < delta1 and |c - c'| < delta2 and |d - d'| < delta3. xvii. The variables (e.g., delta0, delta1, delta2, delta3) can be predefined numbers, or it can depend on coding information such as block width / height. It may vary for different standard profiles / levels / layers. It can be signaled from the encoder to the decoder in the VPS / SPS / PPS / slice header / tile group header / tile / CTU row / CTU. b. Two sets of affine parameters are considered different or dissimilar if the following conditions are met: i. They are associated with different inter - prediction directions (List 0 or List 1, or Bi). ii. When List 0 is one of the prediction directions in use, they are associated with different reference indices in List 0. iii. When List 1 is one of the prediction directions in use, they are associated with different reference indices in List 1. iv. They have a different number of affine parameters or use different affine models. c. If both sets of affine parameters are associated with bi - directional prediction, and if the parameters of List 0 are judged to be the same (or similar) and the parameters of List 1 are also judged to be the same (or similar), then they are judged to be the same (or similar). d. A new set of affine parameters can be compared with each set of affine parameters already in the buffer. i. Alternatively, the new set of affine parameters is only compared with some sets of affine parameters already in the buffer. For example, it is compared with the first W entries, e.g., H[0]…H[W - 1]. In another example, it is compared with the last W entries, e.g., H[M - W], H[M - 1]. In another example, it is compared with one entry out of every W entries, e.g., H[0], H[W], H[2*W]. ii. For example, for X, sorted in ascending order from T to M - 1, H[X] = H[X + 1]. e. If an entry in the buffer (denoted as H[T]) is found to be the same or similar to the new set of affine parameters and it needs to be stored in the buffer, then i. H[T] is deleted, and then the new set of affine parameters is stored as H[T]. ii. H[T] is deleted, and then all the entries after H[T] are moved forward. Then the new set of affine parameters is placed in the last entry of the buffer, e.g., H[M - 1]. iii. H[T] is deleted, and then all entries before H[T] are shifted backward. For example, for X, in descending order from T to 1, H[X] = H[X-1]. The new set of affine parameters is then placed in the first entry of the buffer, for example, H[0]. 11. The buffer used to store affine parameters can be refreshed. a. The buffer will be cleared when refreshing. b. The buffer will be cleared when refreshing, and then one or more default affine parameters will be placed in the buffer when refreshing again. i. For different sequences, the default affine parameters can be different; ii. For different images, the default affine parameters can be different; iii. For different strips, the default affine parameters can be different; iv. For different tiles, the default affine parameters can be different; v. For different CTU (also called LCU) rows, the default affine parameters can be different; vi. For different CTUs, the default affine parameters can be different; vii. Default affine parameters may be signaled from the encoder to the decoder in VPS / SPS / PPS / slice header / tile group header / tile / CTU row / CTU. c. Refresh the buffer at the following times i. Start encoding / decoding the first block of the picture; ii. Start encoding / decoding the first block of the strip; iii. Start encoding / decoding the first block of the tile; iv. Start encoding / decoding the first block of a CTU (also called LCU) row; v. Start encoding / decoding the first block of CTU; 12. The affine model parameters stored in the buffer can be used to derive the affine prediction of the current block. a. In one example, the parameters stored in the buffer can be used for motion vector prediction or motion vector encoding and decoding of the current block. b. In one example, the parameters stored in the buffer can be used to derive the control point MV (CPMV) of the current affine-coded block. c. In one example, the parameters stored in the buffer can be used to derive the MV used in motion compensation of the sub-blocks of the current affine-coded block. d. In one example, the parameters stored in the buffer can be used to derive a prediction of the CPMV of the current affine-encoded block. When the CPMV needs to be encoded and decoded, the CPMV prediction can be used to predict the CPMV of the current block. i. In one example, if the current block is encoded and decoded using a 4-parameter affine model, a higher priority is assigned to the 4-parameter affine model, and a lower priority is assigned to the 6-parameter affine model. ii. In one example, if the current block is encoded and decoded using a 6-parameter affine model, a higher priority is assigned to the 6-parameter affine model, and a lower priority is assigned to the 4-parameter affine model. 13. The motion information of the adjacent M×N unit blocks (e.g., 4×4 blocks in VTM) and a set of affine parameters stored in the buffer can be used together to derive the affine model of the current block. For example, they can be used to derive the CPMV or MV of the sub-block used in motion compensation. Figure 19 An example of deriving the CPMV from the MVs of neighboring blocks and a set of parameters stored in a buffer is shown. a. Assume that the MV stored in the unit block is (mv h 0,mv v 0), export MV (mv h (x,y),mv v The coordinates of the position (x, y) are expressed as (x, y). Assuming that the coordinates of the upper left corner of the current block are (x0', y0'), the width and height of the current block are w and h, then i. To derive CPMV, (x,y) can be (x0',y0'), or (x0'+w,y0'), or (x0',y0'+h), or (x0'+w,y0'+h). ii. To derive the MV of the sub-block of the current block, (x, y) can be the center of the sub-block. Assuming (x00, y00) is the top left corner of the sub-block and the sub-block size is M×N, then (a).xm=x00+M / 2, ym=y00+N / 2; (b).xm=x00+M / 2-1, ym=y00+N / 2-1; (c).xm=x00+M / 2-1, ym=y00+N / 2; (d).xm=x00+M / 2, ym=y00+N / 2-1. iii. In one example, If the parameters in the buffer come from a block encoded using the 4-parameter affine mode. iv. In one example, If the parameters in the buffer come from a block encoded using the 6-parameter affine mode. v.In one example, Regardless of whether the parameters in the buffer come from blocks encoded or decoded using the 4-parameter affine mode or the 6-parameter affine mode. b. In one example, the CPMV of the current block is derived from the motion vector and parameters stored in the buffer, and these CPMVs are used as MVPs of the signaled CPMV of the current block. c. In one example, the CPMV of the current block is derived from the motion vector and parameters stored in the buffer, and these CPMVs are used to derive the MV of each sub-block used for motion compensation. d. In one example, if the current block is affine merge-coded, the MV of each sub-block used for motion compensation is derived from the motion vector and parameters stored in neighboring blocks. e. In one example, the motion vectors of the neighboring unit blocks and the parameter sets used to derive the CPMV or the MV of the sub-block used in motion compensation of the current block should follow some or all of the following constraints: i. They are associated with the same inter prediction direction (list 0 or list 1, or bidirectional). ii. When list 0 is the one prediction direction in use, they are associated with the same reference index of list 0. iii. When List 1 is the one prediction direction in use, they are associated with the same reference index of List 1. 14. The affine model of the current block derived from a set of affine parameters stored in the buffer can be used to generate affine merge candidates. a. In one example, side information such as inter prediction direction and reference index of list0 / list1 associated with the stored parameters is inherited by the generated affine merge candidate. b. Affine merge candidates derived from a set of affine parameters stored in the buffer may be inserted into the affine merge candidate list, after the affine merge candidates inherited from neighboring blocks and before the constructed affine merge candidates. c. Affine merge candidates derived from a set of affine parameters stored in the buffer may be inserted into the affine merge candidate list, after the constructed affine merge candidates and before the padding candidates. d. Affine merge candidates derived from a set of affine parameters stored in the buffer can be inserted into the affine merge list after the constructed affine merge candidates that do not use temporal motion prediction ( Figure 9 block T in ), before using the constructed affine merge candidate of temporal motion prediction ( Figure 9 Block T in ). e. Affine merge candidates derived from a set of affine parameters stored in the buffer may be inserted into the affine merge candidate list, and they may be interleaved with the constructed affine merge candidates and / or padding candidates. 15. The affine parameters stored in the buffer can be used to generate affine AMVP candidates. a. In one example, the stored parameters used to generate the affine AMVP candidate should reference the same reference picture as the target reference picture of the affine AMVP-encoded block. i. In one example, the reference picture list associated with the stored parameters should be the same as the target reference picture list. ii. In one example, the reference index associated with the stored parameters should be the same as the target reference index. b. Affine AMVP candidates derived from a set of affine parameters stored in a buffer may be inserted into the affine AMVP candidate list, after the affine AMVP candidates inherited from neighboring blocks and before the constructed affine AMVP candidates. c. Affine AMVP candidates derived from a set of affine parameters stored in a buffer may be inserted into the affine AMVP candidate list, after the constructed affine AMVP candidates and before the HEVC-based affine AMVP candidates. d. Affine AMVP candidates derived from a set of affine parameters stored in a buffer may be inserted into the affine AMVP candidate list, after the HEVC-based affine AMVP candidates and before the padding affine AMVP candidates. e. Affine AMVP candidates derived from a set of affine parameters stored in a buffer can be inserted into the affine AMVP list after the affine AMVP candidates constructed without using temporal motion prediction ( Figure 9 Block T in ), before the affine AMVP candidate constructed using temporal motion prediction ( Figure 9 Block T in ). f. In one example, if the current block is encoded or decoded using a 4-parameter affine model, a higher priority is assigned to the 4-parameter affine model, and a lower priority is assigned to the 6-parameter affine model. g. In one example, if the current block is encoded and decoded using a 6-parameter affine model, a higher priority is assigned to the 6-parameter affine model, and a lower priority is assigned to the 4-parameter affine model. 16. It is possible to pre-define how many sets of affine model parameters in the buffer are added to the candidate list (represented by N). The aN may be signaled from the encoder to the decoder in the VPS / SPS / PPS / slice header / tile group header / tile. bN may depend on the block size, coded mode information (eg, AMVP / Merge), and the like. cN may depend on grade / level / tier. dN may depend on the candidates available in the list. iN may depend on a certain type of available candidates (eg, inherited affine motion candidates). 17. How to select a portion of all sets of affine model parameters in the buffer (eg, N as in item 15) to insert into the candidate list can be pre-defined. a. In one example, the latest few groups in the buffer (eg, the last N entries). b. It may depend on the index of the affine model parameter group in the buffer. 18. When you need to insert multiple sets of affine model parameters into the candidate list, you can add them in ascending order of index. a. Alternatively, you can add in descending order of index. b. Alternatively, the rule that determines the insertion order depends on the number of available candidates in the candidate list before adding the sets of affine model parameters to the buffer. 19. The set of affine parameters stored in the buffer, along with their associated base MVs and the locations of the base MVs, can be used together to derive an affine model for the current block. For example, they can be used to derive the CPMV or MV of a subblock used in motion compensation. a. Assume that the associated basic MV is (mv h 0,mv v 0) and export MV (mv h (x,y),mv v The coordinates of the position (x,y)) are expressed as (x,y). Assuming that the coordinates of the upper left corner of the current block are (x0',y0'), the width and height of the current block are w and h, then i. To derive CPMV, (x,y) can be (x0',y0'), or (x0'+w,y0'), or (x0',y0'+h), or (x0'+w,y0'+h). ii. To derive the MV of a sub-block of the current block, (x, y) can be the center of the sub-block. iii. Assume that (xm, ym) is the coordinate of the location (basic location) of the stored basic MV. iv. In one example, If the parameters in the buffer come from a block encoded using the 4-parameter affine mode. v.In one example, If the parameters in the buffer come from a block encoded using the 6-parameter affine mode. vi. In one example, Regardless of whether the parameters in the buffer come from blocks encoded or decoded using the 4-parameter affine mode or the 6-parameter affine mode. b. In one example, the CPMV of the current block is derived from the motion vectors and parameters stored in the buffer, and these CPMVs are used as MVPs of the signaled CPMV of the current block. c. In one example, the CPMV of the current block is derived from the associated base MVs and parameters stored in a buffer, and these CPMVs are used to derive the MV of each sub-block used for motion compensation. d. In one example, if the current block is affine merge-coded, the MV of each sub-block used for motion compensation is derived from the associated base MV and parameters stored in neighboring blocks. 20. The motion information of spatially adjacent / discontinuous M×N blocks (e.g., 4×4 blocks in VTM) and a set of affine parameters stored in a buffer can be used together to derive an affine model for the current block. For example, they can be used to derive the CPMV or MV of the sub-block used in motion compensation. a. Assume that the MV stored in the unit block is (mv h 0,mv v 0), export MV (mv h (x,y),mv v The coordinates of the position (x,y) are expressed as (x,y). Assuming that the coordinates of the upper left corner of the current block are (x0',y0'), the width and height of the current block are w and h, then i. To derive CPMV, (x,y) can be (x0',y0'), or (x0'+w,y0'), or (x0',y0'+h), or (x0'+w,y0'+h). ii. To derive the MV of a sub-block of the current block, (x, y) can be the center of the sub-block. iii. Assuming (x00, y00) is the top left corner of the sub-block and the sub-block size is M×N, the basic position (xm, ym) can be derived as follows: (a)xm=x00+M / 2, ym=y00+N / 2; (b)xm=x00+M / 2-1, ym=y00+N / 2-1; (c)xm=x00+M / 2-1, ym=y00+N / 2; (d)xm=x00+M / 2, ym=y00+N / 2-1; iv. In one example, If the parameters in the buffer come from a block encoded using the 4-parameter affine mode. v.In one example, If the parameters in the buffer come from a block encoded using the 6-parameter affine mode. vi. In one example, Regardless of whether the parameters in the buffer come from blocks encoded or decoded using the 4-parameter affine mode or the 6-parameter affine mode. b. In one example, the CPMV of the current block is derived from the motion vectors of spatially neighboring unit blocks and parameters stored in a buffer, and these CPMVs are used as the MVP of the signaled CPMV of the current block. c. In one example, the CPMV of the current block is derived from the motion vectors of spatially neighboring unit blocks and parameters stored in a buffer, and these CPMVs are used to derive the MV of each sub-block used for motion compensation. d. In one example, if the current block is affine merge-coded, the MV of each sub-block used for motion compensation is derived from the motion vectors of spatially neighboring unit blocks and the parameters stored in the neighboring blocks. e. In one example, the motion vectors of spatially neighboring unit blocks and the parameter sets used to derive the CPMV or the MV of the sub-block used in motion compensation of the current block should follow some or all of the following constraints: i. They are associated with the same inter prediction direction (list 0 or list 1, or bidirectional). ii. When list 0 is the one prediction direction in use, they are associated with the same reference index of list 0. iii. When List 1 is the one prediction direction in use, they are associated with the same reference index of List 1. f. In one example, if the MV of a spatially adjacent M×N unit block and the stored affine parameters reference a different reference picture, the MV of the spatially adjacent M×N unit block is scaled to reference the same reference picture as the stored affine parameters, thereby deriving an affine model of the current block. 21. It is proposed that temporal motion vector prediction (TMVP) can be used with affine parameters stored in a buffer. For example, they can be used to derive the MV or CPMV of a subblock used in motion compensation. Figure 20 Examples of possible locations of co-location blocks are shown. a. The motion information of the co-located M×N unit block (e.g., a 4×4 block in a VTM) in the co-located picture and a set of affine parameters stored in the buffer can be used together to derive the affine model of the current block. For example, they can be used to derive the MV or CPMV of the sub-block used in motion compensation. i. Figure 22 Examples of possible locations of co-location blocks are shown (A1-A4, B1-B4, ... F1-F4, J1-J4, K1-K4, and L1-L4). b. Assume that the MV stored in the unit block is (mv h 0,mv v 0), export MV for it (mv h (x,y),mv v The coordinates of the position (x,y) are expressed as (x,y). Assuming that the coordinates of the upper left corner of the current block are (x0',y0'), the width and height of the current block are w and h, then i. To derive CPMV, (x,y) can be (x0',y0'), or (x0'+w,y0'), or (x0',y0'+h), or (x0'+w,y0'+h). ii. To derive the MV of a sub-block of the current block, (x, y) can be the center of the sub-block. iii. Assuming (x00, y00) is the upper left position of the spatially adjacent M×N unit block, the basic position (xm, ym) can be derived as: (a)xm=x00+M / 2, ym=y00+N / 2; (b)xm=x00+M / 2-1, ym=y00+N / 2-1; (c)xm=x00+M / 2-1, ym=y00+N / 2; (d)xm=x00+M / 2, ym=y00+N / 2-1; iv. In one example, If the parameters in the buffer come from a block encoded using the 4-parameter affine mode. v.In one example, If the parameters in the buffer come from a decoded block using the 6-parameter affine mode. vi. In one example, Whether the parameters in the buffer come from a 4-parameter affine model or It is a block of 6-parameter affine mode codec. c. In one example, the CPMV of the current block is derived from the motion vectors of temporally neighboring blocks and parameters stored in the buffer, and these CPMVs are used as MVPs of the signaled CPMV of the current block. d. In one example, the CPMV of the current block is derived from the motion vectors of temporally neighboring blocks and parameters stored in a buffer, and these CPMVs are used to derive the MV of each sub-block used for motion compensation. e. In one example, if the current block is affine merge-coded, the MV of each sub-block used for motion compensation is derived from the motion vectors of temporally neighboring blocks and the parameters stored in the neighboring blocks. f. In one example, the motion vectors of temporally neighboring unit blocks and a set of parameters used to derive the CPMV or MV of the sub-blocks used in motion compensation of the current block should comply with some or all of the following constraints: i. They are associated with the same inter prediction direction (list 0 or list 1, or bidirectional). ii. When list 0 is the one prediction direction in use, they are associated with the same reference index of list 0. iii. When List 1 is the one prediction direction in use, they are associated with the same reference index of List 1. g. In one example, if the MV of a temporally neighboring M×N unit block and the stored affine parameters refer to different reference pictures, the MV of the spatial-temporal M×N unit block is scaled to refer to the same reference picture as the stored affine parameters in order to derive the affine model of the current block. i. For example, if the POC of the same-position picture is POCx; the POC of the reference picture referenced by the MV of the temporally adjacent M×N unit block is POCy; the POC of the current picture is POCz; and the POC of the reference picture referenced by the stored affine parameters is POCw, then (mv h 0,mv v 0) Scale to mv h 0=mv h 0×(POCw-POCz) / (POCy-POCx) and mv v 0=mv v 0×(POCw-POCz) / (POCy-POCx) 22. Affine merge candidates derived from the parameters stored in the buffer and one or more spatially adjacent / non-adjacent unit blocks may be placed into an affine merge candidate list. a. In one example, these candidates are placed immediately after the inherited affine merge candidates. b. In one example, these candidates are placed immediately after the first constructed affine merge candidate. c. In one example, these candidates are placed immediately after the first affine merged candidate constructed from spatially neighboring blocks. d. In one example, these candidates are placed immediately after all constructed affine merge candidates. e. In one example, these candidates are placed immediately before all zero affine merge candidates. f. In one example, if another affine merging candidate is inherited from a spatially neighboring unit block, the spatially neighboring unit block is not used to derive the affine merging candidate through the parameters stored in the buffer. g. In one example, a spatially neighboring unit block may be used to derive an affine merge candidate using only one set of parameters stored in a buffer. In other words, if an affine merge candidate has been derived using a spatially neighboring unit block and the set of parameters stored in the buffer, it cannot be used together with another set of parameters stored in the buffer to derive another affine merge candidate. h. In one example, at most N affine merge candidates derived from the parameters stored in the buffer and the spatially neighboring unit blocks can be put into the affine merge candidate list, where N is an integer, such as 3. i. In one example, if an affine merge candidate derived from parameters stored in a buffer and spatially neighboring unit blocks is selected, the GBI index of the current block is inherited from the GBI index of the spatially neighboring blocks. j. In one example, affine merge candidates derived from the parameters stored in the buffer and spatially neighboring blocks are sequentially placed into an affine merge candidate list. i. For example, a two-level nested loop method is used to search for available affine merging candidates derived from the parameter blocks and spatially neighboring blocks stored in the buffer, and put them into an affine merging candidate list. (a) In the first level loop, each set of parameters stored in the buffer is accessed sequentially. They can be accessed from the beginning to the end of the table, or from the end to the beginning of the table, or in any other predefined or adaptive order. a. In this example, some parameter groups stored in the buffer are skipped in the first loop. For example, the first N groups or the last N groups in the table are skipped. In practice, if k%S == 0, then H[k] is skipped. In practice, if k%S! = 0, then H[k]s is skipped. (b) For each set of parameters stored in the buffer, a second level loop is applied. In the second level loop, each spatially adjacent block is accessed sequentially. For example, Figure 9 The blocks A1, B1, B0, A0, B2 are shown. In pseudo-code implementation, the nested loops can be described as: a. In one example, the second loop may include only one spatially adjacent block, for example, only A1. b. Using a set of parameters given in the first-level loop and spatially neighboring blocks given in the second-level loop, if all or part of the following conditions are met, an affine merge candidate is generated and placed into the affine merge candidate list. i. Spatially adjacent blocks are available; ii. Spatially adjacent blocks are inter-coded; iii. The spatially neighboring blocks are not outside the current CTU row. iv. Inter-frame prediction of this set of parameters (list 0, list1 or bi) and The predictions of spatially adjacent blocks are the same; v. The reference index of list 0 for this set of parameters and the spatial neighbors The reference index of near blocks is the same; vi. The reference index of list 1 for the set of parameters is the same as the reference index of the spatially neighboring block; vii. The POC of the reference picture of list 0 for this set of parameters is the same as the POC of one of the reference pictures of the spatially neighboring block. viii. The POC of the reference picture of List 1 for this set of parameters is the same as the POC of one of the reference pictures of the spatially neighboring block. c. In one example, if a neighboring block has been used to derive an inherited affine merge candidate, it is skipped in the second loop and not used for affine merge candidates derived with the stored affine parameters. d. In one example, if a neighboring block has been used to derive affine merge candidates with one set of stored affine parameters, it is skipped in the second loop and not used to derive affine merge candidates with another set of stored affine parameters. e. In one example, if a neighboring block is used to derive an affine merge candidate, all other neighboring blocks after the neighboring block are skipped, and the second loop is interrupted and returns to the first loop. The next set of parameters is accessed in the first loop. 23. Affine merge candidates derived from the parameters stored in the buffer and one or more time unit blocks may be placed into an affine merge candidate list. a. In one example, these candidates are placed immediately after the inherited affine merge candidates. b. In one example, these candidates are placed immediately after the first constructed affine merge candidate. c. In one example, these candidates are placed immediately after the first affine merged candidate constructed from spatially neighboring blocks. d. In one example, these candidates are placed immediately after all constructed affine merge candidates. e. In one example, these candidates are placed after all affine merge candidates derived from the parameters and spatially neighboring blocks stored in the buffer. f. In one example, these candidates are placed immediately before all zero affine merge candidates. g. In one example, at most N affine merge candidates derived from the parameters stored in the buffer and the temporal neighboring unit blocks can be put into the affine merge candidate list, where N is an integer, such as 3. h. In one example, if an affine merge candidate derived from parameters stored in a buffer and a temporally neighboring unit block is selected, the GBI index of the current block is inherited from the GBI index of the temporally neighboring block. i. In one example, affine merge candidates derived from the parameters stored in the buffer and the temporal neighboring blocks are sequentially placed into an affine merge candidate list. i. For example, a two-level nested loop method is used to search for available affine merging candidates derived from the parameter blocks and temporal neighboring blocks stored in the buffer, and put them into an affine merging candidate list. (a) In the first level loop, each set of parameters stored in the buffer is accessed sequentially. They can be accessed from the beginning to the end of the table, or from the end to the beginning of the table, or in any other predefined or adaptive order. a. In this example, some parameter groups stored in the buffer are skipped in the first loop. For example, the first N groups or the last N groups in the table are skipped. In practice, if k%S == 0, then H[k] is skipped. In practice, if k%S! = 0, then H[k]s is skipped. (b) For each set of parameters stored in the buffer, a second level loop is applied. In the second level loop, each temporally adjacent block is accessed sequentially. For example, Figure 20 Blocks L4 and E4 are shown. In pseudo-code implementation, the nested loops can be described as: a. In one example, the second loop may include only one temporally adjacent block, for example, only L4. b. Using a set of parameters given in the first-level loop and the temporally neighboring blocks given in the second-level loop, if all or part of the following conditions are met, an affine merge candidate is generated and placed into the affine merge candidate list. i. Neighboring blocks are available; ii. The adjacent blocks are inter-coded; iii. The neighboring block is not outside the current CTU row. iv. The inter-frame prediction of this set of parameters (list 0, list1 or bi) is the same as the prediction of the neighboring block; v. The reference index for list 0 of the set of parameters is the same as the reference index of the neighboring block; vi. The reference index of list 1 for the set of parameters is the same as the reference index of the neighboring block; vii. The POC of the reference picture of list 0 for this set of parameters is the same as the POC of one of the reference pictures of the neighboring block. viii. The POC of the reference picture of List 1 for this set of parameters is the same as the POC of one of the reference pictures of the neighboring block. c. In one example, if a neighboring block has been used to derive an inherited affine merge candidate, it is skipped in the second loop and not used for affine merge candidates derived with the stored affine parameters. d. In one example, if a neighboring block has been used to derive affine merge candidates with one set of stored affine parameters, it is skipped in the second loop and not used to derive affine merge candidates with another set of stored affine parameters. e. In one example, if a neighboring block is used to derive an affine merge candidate, all other neighboring blocks after the neighboring block are skipped, and the second loop is interrupted and returns to the first loop. The next set of parameters is accessed in the first loop. 24. Affine AMVP candidates derived from the parameters stored in the buffer and one or more spatially adjacent / non-adjacent unit blocks may be placed into an affine AMVP candidate list. a. In one example, these candidates are placed immediately after the inherited affine AMVP candidates. b. In one example, these candidates are placed immediately after the first constructed AMVP merge candidate. c. In one example, these candidates are placed immediately after the first affine AMVP candidate constructed from spatially neighboring blocks. d. In one example, these candidates are placed immediately after all constructed affine AMVP candidates. e. In one example, these candidates are placed immediately after the first translation-affine AMVP candidate. f. In one example, these candidates are placed immediately after all translational affine AMVP candidates. g. In one example, these candidates are placed immediately before all zero-affine AMVP candidates. h. In one example, if another affine AMVP candidate is inherited from a spatially neighboring unit block, the spatially neighboring unit block is not used to derive the affine AMVP candidate through the parameters stored in the buffer. i. In one example, a spatially neighboring unit block can be used to derive an affine AMVP candidate using only one set of parameters stored in a buffer. In other words, if an affine AMVP candidate has been derived using the spatially neighboring unit block and the set of parameters stored in the buffer, it cannot be used to derive another affine AMVP candidate together with another set of parameters stored in the buffer. j. In one example, at most N affine AMVP candidates derived from the parameters stored in the buffer and the spatially neighboring unit blocks can be put into the affine AMVP candidate list, where N is an integer, such as 1. k. In one example, the affine AMVP candidates derived from the parameters stored in the buffer and the spatially neighboring blocks are sequentially placed into an affine AMVP candidate list. i. For example, a two-level nested loop method is used to search for available affine AMVP candidates derived from the parameter blocks and spatially neighboring blocks stored in the buffer, and put them into the affine AMVP candidate list. (a) In the first level loop, each set of parameters stored in the buffer is accessed sequentially. They can be accessed from the beginning to the end of the table, or from the end to the beginning of the table, or in any other predefined or adaptive order. a. In this example, some parameter groups stored in the buffer are skipped in the first loop. For example, the first N groups or the last N groups in the table are skipped. In practice, if k%S == 0, then H[k] is skipped. In practice, if k%S! = 0, then H[k]s is skipped. (b) For each set of parameters stored in the buffer, a second level loop is applied. In the second level loop, each spatially adjacent block is accessed sequentially. For example, Figure 9 The blocks A1, B1, B0, A0, B2 are shown. In pseudo-code implementation, the nested loops can be described as: a. In one example, the second loop may include only one spatially adjacent block, for example, only A1. b. Using a set of parameters given in the first-level loop and the spatially neighboring blocks given in the second-level loop, if all or part of the following conditions are met, an affine AMVP candidate is generated and placed in the affine AMVP candidate list. i. Spatially adjacent blocks are available; ii. Spatially adjacent blocks are inter-coded; iii. The spatially neighboring blocks are not outside the current CTU row. iv. The reference index of list 0 for the set of parameters is the same as the reference index of the spatially neighboring block; v. The reference index of list 1 for the set of parameters is the same as the reference index of the spatially neighboring block; vi. The reference index of List 0 of the set of parameters is equal to the AMVP signaled reference index of List 0. vii. The reference index of List 1 of the set of parameters is equal to the reference index of List 1 signaled by AMVP. viii. The reference index of List 0 of the spatial neighboring block is equal to the signaled reference index of the AMVP of List 0. ix. The reference index of List 1 of the spatial neighboring blocks is equal to the signaled reference index of the AMVP of List 0. x. The POC of the reference picture of list 0 for this set of parameters is the same as the POC of one of the reference pictures of the spatially neighboring block. xi. The POC of the reference picture of list 1 for this set of parameters is the same as the POC of one of the reference pictures of the spatially neighboring block. xii. The POC of the signaled reference picture of the AMVP of List 0 is the same as the POC of one of the reference pictures of the spatially neighboring block. xiii The POC of the signaled reference picture of the AMVP of list 0 is the same as the POC of one of the reference pictures of the set of parameters. c. In one example, if a neighboring block has been used to derive an inherited affine AMVP candidate, it is skipped in the second loop and not used for the affine AMVP candidate derived with the stored affine parameters. d. In one example, if a neighboring block has been used to derive an affine AMVP candidate with one set of stored affine parameters, it is skipped in the second loop and not used to derive an affine AMVP candidate with another set of stored affine parameters. e. In one example, if a neighboring block is used to derive an affine AMVP candidate, all other neighboring blocks after the neighboring block are skipped, and the second loop is interrupted and returns to the first loop. The next set of parameters is accessed in the first loop. 25. Affine AMVP candidates derived from the parameters stored in the buffer and one or more time unit blocks may be placed into an affine AMVP candidate list. a. In one example, these candidates are placed immediately after the inherited affine AMVP candidates. b. In one example, these candidates are placed immediately after the first constructed AMVP merge candidate. c. In one example, these candidates are placed immediately after the first affine AMVP candidate constructed from spatially neighboring blocks. d. In one example, these candidates are placed immediately after all constructed affine AMVP candidates. e. In one example, these candidates are placed immediately after the first translation-affine AMVP candidate. f. In one example, these candidates are placed immediately after all translational affine AMVP candidates. g. In one example, these candidates are placed immediately before all zero-affine AMVP candidates. h. In one example, these candidates are placed immediately after all affine AMVP candidates derived from the parameters and spatially neighboring blocks stored in the buffer. i. In one example, at most N affine AMVP candidates derived from the parameters stored in the buffer and the temporal neighboring unit blocks can be put into the affine merge candidate list, where N is an integer, such as 1. j. In one example, the affine AMVP candidates derived from the parameters stored in the buffer and the temporal neighboring blocks are sequentially placed into the affine AMVP candidate list. i. For example, a two-level nested loop method is used to search for available affine AMVP candidates derived from the parameter blocks and temporal neighboring blocks stored in the buffer, and put them into the affine AMVP candidate list. (a) In the first level loop, each set of parameters stored in the buffer is accessed sequentially. They can be accessed from the beginning to the end of the table, or from the end to the beginning of the table, or in any other predefined or adaptive order. a. In this example, some parameter groups stored in the buffer are skipped in the first loop. For example, the first N groups or the last N groups in the table are skipped. In practice, if k%S == 0, then H[k] is skipped. In practice, if k%S! = 0, then H[k]s is skipped. (b) For each set of parameters stored in the buffer, a second level loop is applied. In the second level loop, each temporally adjacent block is accessed sequentially. For example, Figure 9 The blocks A1, B1, B0, A0, B2 are shown. In pseudo-code implementation, the nested loops can be described as: a. In one example, the second loop may include only one temporally adjacent block, for example, only A1. b. Using a set of parameters given in the first-level loop and the temporally neighboring blocks given in the second-level loop, if all or part of the following conditions are met, an affine AMVP candidate is generated and placed in the affine AMVP candidate list. i. Temporally adjacent blocks are available; ii. Temporally adjacent blocks are inter-coded; iii. The temporally neighboring blocks are not outside the current CTU row. iv. The reference index of list 0 for the set of parameters is the same as the reference index of the temporally neighboring block; v. The reference index of list 1 for the set of parameters is the same as the reference index of the temporally neighboring block; vi. The reference index of List 0 of the set of parameters is equal to the AMVP signaled reference index of List 0. vii. The reference index of List 1 of the set of parameters is equal to the reference index of List 1 signaled by AMVP. viii. The reference index of List 0 of the temporally neighboring block is equal to the signaled reference index of the AMVP of List 0. ix. The reference index of List 1 of the temporally neighboring blocks is equal to the signaled reference index of the AMVP of List 0. x. The POC of the reference picture of list 0 for this set of parameters is the same as the POC of one of the reference pictures of the temporally neighboring block. xi. The POC of the reference picture of List 1 for this set of parameters is the same as the POC of one of the reference pictures of the temporally neighboring block. xii. The POC of the signaled reference picture of the AMVP of List 0 is the same as the POC of one of the reference pictures of the temporally neighboring block. xiii The POC of the signaled reference picture of the AMVP of list 0 is the same as the POC of one of the reference pictures of the set of parameters. c. In one example, if a neighboring block has been used to derive an inherited affine AMVP candidate, it is skipped in the second loop and not used for the affine AMVP candidate derived with the stored affine parameters. d. In one example, if a neighboring block has been used to derive an affine AMVP candidate with one set of stored affine parameters, it is skipped in the second loop and not used to derive an affine AMVP candidate with another set of stored affine parameters. e. In one example, if a neighboring block is used to derive an affine AMVP candidate, all other neighboring blocks after the neighboring block are skipped, and the second loop is interrupted and returns to the first loop. The next set of parameters is accessed in the first loop. 26. It is proposed to use affine merge candidates derived from the affine HMVP buffer, put them into the affine merge list / sub-block merge list, and the inherited affine merge candidates can be deleted from the list. a. In one example, affine merge candidates derived from the affine HMVP buffer are put into an affine merge list / sub-block merge list, and inherited affine merge candidates are removed from the list. b. In an alternative example, affine merge candidates derived from the affine HMVP buffer are put into an affine merge list / sub-block merge list, and affine merge candidates inherited from blocks in the current CTU row are removed from the list. i. For example, affine merge candidates derived from the affine HMVP buffer are put into the affine merge list / sub-block merge list, after affine merge candidates inherited from blocks in CTU rows different from the current CTU row. c. Alternatively, whether to add the inherited affine merge candidate may depend on the affine HMVP buffer. i. In one example, an affine merge candidate derived from an affine HMVP buffer may be inserted before the inherited affine merge candidate in the candidate list. ii. In one example, when the affine HMVP buffer is empty, the inherited affine merge candidate may be added; otherwise (if the affine HMVP buffer is not empty), the inherited affine merge candidate may be excluded. d. Alternatively, whether to apply the proposed method may depend on the block size. 27. It is proposed to use the affine AMVP candidates derived from the affine HMVP buffer, put them into the affine AMVP list, and the inherited affine AMVP candidates can be deleted from the list. a. In one example, affine AMVP candidates derived from the affine HMVP buffer are put into an affine AMVP list, and inherited affine AMVP candidates are removed from the list. b. In an alternative example, affine AMVP candidates derived from the parameters stored in the affine HMVP buffer are put into an affine AMVP list, and affine AMVP candidates inherited from blocks in the current CTU row are removed from the list. i. For example, affine AMVP candidates derived from the affine HMVP buffer are put into the affine AMVP list, after affine AMVP candidates inherited from blocks in a CTU row different from the current CTU row. c. Alternatively, whether to add the inherited affine AMVP candidate may depend on the affine HMVP buffer. d. Alternatively, whether to apply the proposed method may depend on the block size. 28. In one example, if an affine merge candidate derived from the parameters stored in the buffer can be put into the list, the size of the affine merge candidate list is increased by N (eg, N=1). 29. In one example, if an affine AMVP candidate derived from the parameters stored in the buffer can be put into the list, the size of the affine AMVP candidate list is increased by N (eg, N=1). 30. A virtual affine model can be derived from multiple existing affine models stored in a buffer. Assume that the buffer contains multiple affine models, and the i-th candidate is denoted as Candi with parameters (ai, bi, ci, di, ei, fi). a. In one example, parameters Candi and Candj can be combined to form a virtual affine model by taking some parameters from Candi and the remaining parameters from Candj. An example of a virtual affine model is (ai, bi, cj, dj, ei, fi). b. In one example, the parameters Candi and Candj can be used together to generate a virtual affine model with a function such as averaging. An example of a virtual affine model is ((ai+aj) / 2,(bi+bj) / 2,(ci+cj) / 2,(di+dj) / 2,(ei+ej) / 2,(fi+fj) / 2). c. The virtual affine model can be used in a similar way to the stored affine model, for example using the terms mentioned above. 31. It is proposed not to put the affine merge candidates inherited from spatially neighboring blocks into the sub-block based merge candidate list, but to put the disclosed history-based affine merge candidates into the sub-block based merge candidate list. a. In one example, the disclosed history-based affine merge candidate is placed in the sub-block based merge candidate list, immediately after the ATMVP candidate. b. In one example, the disclosed history-based affine merge candidate is put into the sub-block based merge candidate list before the constructed affine merge candidate. c. It is proposed that whether an affine merge candidate inherited from a spatially neighboring block is put into a sub-block based merge candidate list may depend on the position of the spatially neighboring block. i. In one example, if a spatial neighboring block is in the same CTU or CTU row as the current block, the affine merge candidate inherited from the spatial neighboring block is placed in the sub-block based merge candidate list; otherwise, it is not placed. ii. Alternatively, if the spatially neighboring block is not in the same CTU or CTU row as the current block, the affine merge candidate inherited from the spatially neighboring block is put into the sub-block based merge candidate list; otherwise, it is not put into the list. 32. It is proposed not to put the affine AMVP candidates inherited from spatially neighboring blocks into the affine MVP candidate list, and to put the disclosed history-based affine MVP candidates into the affine MVP candidate list. a. In one example, the disclosed history-based affine MVP candidates are first put into an affine MVP candidate list. b. It is proposed that whether an affine AMVP candidate inherited from a spatially neighboring block is put into the affine MVP candidate list may depend on the position of the spatially neighboring block. i. In one example, if the spatial neighboring block is in the same CTU or CTU row as the current block, the affine AMVP candidate inherited from the spatial neighboring block is put into the affine MVP candidate list; otherwise, it is not put. Alternatively, if the spatially neighboring block is not in the same CTU or CTU row as the current block, the affine AMVP candidate inherited from the spatially neighboring block is put into the affine MVP candidate list; otherwise, it is not put. 33. More than one affine HMVP buffer is used to store different categories of affine parameters or CPMVs. a. For example, use two buffers to store the affine parameters in reference list 0 and reference list 1 respectively. i. In one example, after decoding an affine-coded CU, the CPMV or parameters of reference list 0 are used to update the HMVP buffer of reference list 0. ii. In one example, after decoding the affine-coded CU, the CPMV or parameters of reference list 1 are used to update the HMVP buffer of reference list 1. iii. In one example, if motion information of spatially adjacent / non-adjacent M×N unit blocks (e.g., 4×4 blocks in VTM) and a set of affine parameters stored in a buffer are used together to derive an affine model of the current block: the MVs of the spatially adjacent / non-adjacent unit blocks referring to a reference list X are combined with the affine parameters stored in the buffer referring to the reference list X. X=0 or 1. iv. In one example, if motion information of a temporally neighboring M×N unit block (e.g., a 4×4 block in a VTM) and a set of affine parameters stored in a buffer are used together to derive an affine model of the current block, the MV of the temporally neighboring unit block referring to the reference list X is combined with the affine parameters stored in the buffer referring to the reference list X. X=0 or 1. b. For example, N (eg, N=6) buffers are used to store affine parameters referring to different reference indices in different reference lists. In the following discussion, "reference K" means that the reference index of the reference picture is K. i. In one example, after decoding an affine-coded CU, the CPMV or parameters of reference K in list X are used to update the HMVP buffer of reference K in list X. X=0 or 1. K can be 0, 1, 2, etc. ii. In one example, after decoding an affine-coded CU, the CPMV or parameters of a reference K (where K>=L) in a list X are used to update the HMVP buffer of a reference L in list X. X=0 or 1. M can be 1, 2, 3, etc. iii. In one example, if motion information of spatially adjacent / non-adjacent M×N unit blocks (e.g., 4×4 blocks in VTM) and a set of affine parameters stored in a buffer are used together to derive an affine model for the current block, the MV of the spatially adjacent / non-adjacent unit blocks referring to a reference K in a list X is combined with the affine parameters stored in the buffer referring to the reference K in the list X. X=0 or 1. K can be 0, 1, 2, etc. iv. In one example, if motion information of a temporally neighboring M×N unit block (e.g., a 4×4 block in a VTM) and a set of affine parameters stored in a buffer are used together to derive an affine model for the current block, the MV of the temporally neighboring unit block that refers to a reference K in a list X is combined with the affine parameters stored in the buffer that refer to the reference K in the list X. X = 0 or 1. K can be 0, 1, 2, etc. v. In one example, if motion information of spatially adjacent / non-adjacent M×N unit blocks (e.g., 4×4 blocks in VTM) and a set of affine parameters stored in a buffer are used together to derive an affine model for the current block, then spatially adjacent / non-adjacent MVs referring to a reference K in a list X are combined with affine parameters stored in the buffer referring to a reference L in the list X. X = 0 or 1. L can be 1, 2, 3, etc. vi. In one example, if motion information of a temporally neighboring M×N unit block (e.g., a 4×4 block in a VTM) and a set of affine parameters stored in a buffer are used together to derive an affine model for the current block, the MV of the temporally neighboring unit block that refers to a reference K (where K>=L) in a list X is combined with the affine parameters stored in the buffer that refer to a reference L in the list X. X=0 or 1. L can be 1, 2, 3, etc. c. The size of each affine HMVP buffer of a class may be different. i. In one example, the size may depend on the reference picture index. For example, the size of the affine HMVP buffer of reference 0 is 3, the size of the affine HMVP buffer of reference 1 is 2, and the size of the affine HMVP buffer of reference 2 is 1. 34. Whether and / or how to update the affine HMVP buffer may depend on the current CU's codec mode and / or other codec information. a. For example, if a CU is coded in affine merge mode and the merge candidate is derived from the affine HMVP buffer, the HMVP buffer will not be updated after decoding the CU. i. Alternatively, the affine HMVP buffer is updated by deleting the affine parameters associated with the last entry of the affine HMVP buffer. b. In one example, the affine HMVP buffer may be updated each time a block is encoded or decoded in affine mode. c. In one example, when a block is encoded in affine merge mode and the block uses a shared merge list, updating of the affine HMVP buffer is skipped. 35. In one example, the affine HMVP buffer can be divided into M (M>1) sub-buffers: HB 0 , HB 1 ,...HB M-1 . a. Alternatively, multiple affine HMVP buffers (ie, multiple affine HMVP tables) may be allocated, each of which may correspond to one of the above-mentioned sub-buffers HB. i . b. In one example, an operation on one sub-buffer (eg, updating of a sub-buffer, use of a sub-buffer) may not affect other sub-buffers. c. In one example, M is predefined, such as 10. d. In one example, the first M0 buffers are associated with the storage of affine parameters of reference picture list X, and the remaining (M-M0) buffers are associated with the storage of affine parameters of reference picture list Y, where Y=1-X and X is 0 or 1. i. Alternatively, the affine parameters of reference picture list X can be stored in an interleaved manner with the affine parameters of reference picture list Y. ii. In one example, the affine parameters of the reference picture list X can be stored in HB i Where i is an odd number and the affine parameters of the reference picture list X can be stored in HB j Where j is an even number. e. In one example, M can be signaled from the encoder to the decoder, for example, at the video level (e.g., VPS), sequence level (e.g., SPS), picture level (e.g., PPS or picture header), slice level (e.g., slice header), or tile group level (e.g., tile group header). f. In one example, M may depend on the number of reference pictures. i. In one example, i. For example, M may depend on the number of reference pictures in reference list 0; ii. For example, M may depend on the number of reference pictures in reference list 1. g. In one example, each sub-buffer may have the same maximum number of allowed entries, denoted as N. For example, N=1 or N=2. h. In one example, each sub-buffer may have a different maximum number of allowed entries. For example, sub-buffer HB K Can have at most N K The number of entries allowed. For different K, N KMay be different. i. When using a set of affine parameters to update the HMVP buffer, you can select a sub-buffer with a sub-buffer index SI, and then use the set of affine parameters to update the corresponding sub-buffer HB SI . i. In one example, the selection of the sub-buffer may be based on the coded information of the block to which the set of affine parameters is applied. (a) In one example, the encoded information may include a reference list index (or prediction direction) and / or a reference index associated with the set of affine parameters. (b) For example, assuming that the reference list index and reference index of the set of affine parameters are represented as X (e.g., X is 0 or 1) and RIDX, the selected sub-buffer index SI can be calculated as SI=f(X,RIDX), where f is a function. a. In one example, SI=X*MaxR0+min(RIDX,MaxRX-1), where MaxR0 and MaxR1 are integers, for example, MaxR0=MaxR1=5. b. Alternatively, SI=2*min(RIDX,MaxRX-1)+X. c. In one example, X can only be 0 or 1, and RIDX must be greater than or equal to 0. d. In one example, MaxR0 and MaxR1 may be different. e. In one example, MaxR0 / MaxR1 may depend on the temporal layer index, slice / tile group / picture type, low latency check flag, etc. f. In one example, MaxR0 may depend on the total number of reference pictures in reference list 0. g. In one example, MaxR1 may depend on the total number of reference pictures in reference list 1. h. In one example, MaxR0 and / or MaxR1 can be signaled, for example, at a video level (e.g., VPS), a sequence level (e.g., SPS), a picture level (e.g., PPS or picture header), a slice level (e.g., slice header), or a tile group level (e.g., tile group header). j. When using a set of affine parameters to update the sub-buffer HB SI When , it can be regarded as updating the regular affine HMVP buffer, and the method for updating the affine HMVP buffer disclosed in this article can be applied to update the sub-buffer. k. Spatially or temporally adjacent or non-adjacent neighboring blocks (also referred to as “neighboring blocks” for simplicity) may be used in combination with one or more sets of affine parameters stored in one or more HMVP affine sub-buffers. 36. In one example, the maximum allowed size of an affine HMVP buffer and / or an affine HMVP sub-buffer may be equal to 1. a. In one example, there is no need to record a counter to record the number of affine parameter groups stored in the affine HMVP buffer or the affine HMVP sub-buffer. 37. Whether and / or how to operate on an affine HMVP buffer or an affine HMVP sub-buffer may depend on whether the affine parameters in a group are all zero. a. In one example, when an affine HMVP buffer or an affine HMVP sub-buffer is flushed, all affine parameters stored in the buffer or sub-buffer are set to zero. i. The affine HMVP buffer or the affine HMVP sub-buffer may be flushed before encoding / decoding each picture and / or slice and / or tile group and / or CTU row and / or CTU and / or CU. b. In one example, when a set of affine parameters is used to update an affine HMVP buffer or an affine HMVP sub-buffer, if all affine parameters in the set are equal to 0, the buffer or sub-buffer is not updated. c. In one example, when all parameters in a set of affine parameters stored in the affine HMVP buffer or the affine HMVP sub-buffer are zero, the set of affine parameters cannot be used to generate an affine merge candidate or an affine AMVP candidate. i. For example, an affine parameter set cannot be used to combine with neighboring blocks to generate an affine merge candidate or an affine AMVP candidate. ii. For example, when all parameters in a set of affine parameters stored in an entry of an affine HMVP buffer or an affine HMVP sub-buffer are zero, the entry is marked as “invalid” or “unavailable”. iii. For example, when all parameters in a set of affine parameters stored in all entries of an affine HMVP buffer or an affine HMVP sub-buffer are zero, the affine HMVP buffer or an affine HMVP sub-buffer is marked as "invalid" or "unavailable", and / or the counter of the buffer or sub-buffer is set to zero. 38. When using spatially or temporally adjacent or non-adjacent neighboring blocks (also referred to as "neighboring blocks" for simplicity) to generate affine merge candidates by combining affine parameters stored in an affine HMVP buffer, only the affine parameters stored in one or more relevant sub-buffers can be accessed. a. For example, the relevant sub-buffer can be determined by the codec information of the neighboring block. For example, the codec information may include a reference list and / or a reference index of the neighboring block. b. For example, one or more sets of affine parameters stored in the relevant sub-buffer can be used to combine with neighboring blocks to generate affine merge candidates. i. For example, a set of affine parameters stored as the first entry in the relevant sub-buffer may be used. ii. For example, a set of affine parameters stored as the last entry in the relevant sub-buffer may be used. c. For example, determine a related sub-buffer HB for the MV of the neighboring block that refers to reference list 0 S0 . d. For example, determine a related sub-buffer HB for the MV of the neighboring block of reference list 1 S1 . i.HB S0 and HB S1 It can be different. e. For the MV of a neighboring block that refers to a reference picture with a reference index RIDX in the reference list LX, the associated sub-buffer index SI is calculated as SI=g(LX, RIDX), where g is a function. i. For example, function g is the same as function f in item 35.d. ii. In one example, SI=LX*MaxR0+min(RIDX,MaxRX-1), where MaxR0 and MaxR1 are integers, for example, MaxR0=MaxR1=5. (a) In one example, LX can only be 0 or 1, and RIDX must be greater than or equal to 0. (b) MaxR0 and MaxR1 can be different. (c) MaxR0 may depend on the total number of reference pictures in reference list 0. (d) MaxR1 may depend on the total number of reference pictures in reference list 1. (e) MaxR0 and / or MaxR1 may be signaled from the encoder to the decoder, for example, at the video level (e.g., VPS), sequence level (e.g., SPS), picture level (e.g., PPS or picture header), slice level (e.g., slice header), or tile group level (e.g., tile group header). f. In one example, when a neighboring block is inter-coded under unidirectional prediction by referencing a reference picture with a reference index RIDX in a reference list LX, an affine merge candidate may be generated based on the neighboring block in combination with a set of affine parameters stored in a related affine HMVP sub-buffer if there is at least one available entry in the sub-buffer and / or the counter of the sub-buffer is not equal to 0. i. The generated affine merge candidate should also be unidirectionally predicted by referencing the reference picture with reference index RIDX in the reference list LX. g. In one example, when a neighboring block is inter-coded under bidirectional prediction with reference to a reference picture having a reference index RIDX0 in reference list 0 and a reference index RIDX1 in reference list 1, an affine merge candidate may be generated based on the neighboring block in combination with one or more sets of affine parameters stored in one or more related affine HMVP sub-buffers. i. In one example, the generated affine merge candidate should also be bi-directionally predicted, referring to the reference picture with reference index RID0 in reference list 0 and with reference index RID1 in reference list 1. (a) A bi-predictive affine merge candidate may be generated only if at least one entry associated with reference index RID0 in reference list 0 is available in the sub-buffer (and / or the counter of the sub-buffer is not equal to 0), and at least one entry associated with reference index RID1 in reference list 1 is available in the sub-buffer (and / or the counter of the sub-buffer is not equal to 0). (b) In one example, if the following conditions are not satisfied, an affine merge candidate cannot be generated from a combination of neighboring blocks in conjunction with affine parameters stored in the affine HMVP buffer and / or sub-buffer. a. When at least one entry associated with reference index RID0 in reference list 0 is available in the sub-buffer (and / or the counter of the sub-buffer is not equal to 0), and at least one entry associated with reference index RID1 in reference list 1 is available in the sub-buffer (and / or the counter of the sub-buffer is not equal to 0). ii. In an alternative example, the generated affine merge candidate may also be unidirectionally predicted, referring to a reference picture with reference index RID0 in reference list 0 or a reference picture with reference index RID1 in reference list 1. (a) If there is at least one entry available in the sub-buffer associated with reference index RID0 in reference list 0 (and / or the sub-buffer's counter is not equal to 0), and there is no entry in the sub-buffer associated with reference index RID0 in reference list 1 If the entry associated with RID1 is available (and / or the counter of the sub-buffer is equal to 0), the generated reflective merging candidate is unidirectionally predicted by referring to the reference picture with reference index RID0 in reference list 0. (b) If at least one entry associated with reference index RID1 in reference list 1 is available in the sub-buffer (and / or the counter of the sub-buffer is not equal to 0), and no entry associated with reference index RID0 in reference list 0 is available in the sub-buffer (and / or the counter of the sub-buffer is equal to 0), then unidirectional prediction is performed on the generated reflection merge candidate by referring to the reference picture with reference index RID1 in reference list 1. h. In one example, all methods disclosed in this document can be used to generate affine merge candidates by combining affine parameters stored in one or more related sub-buffers. 39. When using spatially or temporally adjacent or non-adjacent neighboring blocks (also referred to as "neighboring blocks" for simplicity) to generate affine AMVP candidates by combining affine parameters stored in an affine HMVP buffer, only the affine parameters stored in one or more relevant sub-buffers can be accessed. a. For example, the relevant sub-buffer can be determined by the codec information of the neighboring block. For example, the codec information may include a reference list and / or a reference index of the neighboring block. b. For example, one or more sets of affine parameters stored in the relevant sub-buffer can be used to combine with neighboring blocks to generate affine AMVP candidates. i. For example, a set of affine parameters stored as the first entry in the relevant sub-buffer may be used. ii. For example, a set of affine parameters stored as the last entry in the relevant sub-buffer may be used. c. For a target reference picture with a target reference index RIDX in the target reference list LX, the associated sub-buffer index SI is calculated as SI = h(LX, RIDX), where g is a function. i. For example, function g is the same as function f in item 35.d. ii. For example, function g is the same as function g in item 38. iii. In one example, SI=LX*MaxR0+min(RIDX,MaxRX-1), where MaxR0 and MaxR1 are integers, for example, MaxR0=MaxR1=5. (a) In one example, LX can only be 0 or 1, and RIDX must be greater than or equal to 0. (b) MaxR0 and MaxR1 can be different. (c) MaxR0 may depend on the total number of reference pictures in reference list 0. (d) MaxR1 may depend on the total number of reference pictures in reference list 1. (e) MaxR0 and / or MaxR1 may be signaled from the encoder to the decoder, for example, at the video level (e.g., VPS), sequence level (e.g., SPS), picture level (e.g., PPS or picture header), slice level (e.g., slice header), or tile group level (e.g., tile group header). d. In one example, if no entry associated with the target reference index RIDX in the target reference list LX is available in the sub-buffer (and / or the counter of the sub-buffer is equal to 0), an affine AMVP candidate cannot be generated from the affine parameters stored in the affine HMVP buffer / sub-buffer. e. In one example, when the neighboring block is inter-coded and has an MV that refers to a target reference index RIDX in a target reference list LX, the MV is used to generate an affine AMVP candidate in combination with affine parameters stored in a related sub-buffer. f. In one example, when the neighboring block is inter-coded and does not have an MV that refers to the target reference index RIDX in the target reference list LX, then an affine AMVP candidate cannot be generated from the neighboring block. i. Alternatively, when the neighboring block is inter-coded and there is no MV referring to the target reference index RIDX in the target reference list LX, the neighboring block is checked to determine whether it has a second MV referring to a second reference picture in the reference list 1-LX, and the second reference picture has the same POC as the target reference picture. (a) If there is a second MV that refers to a second reference picture in the reference list 1-LX, and the second reference has the same POC as the target reference picture, then the second MV is used in combination with the affine parameters stored in the relevant sub-buffer to generate an affine AMVP candidate. Otherwise, an affine AMVP candidate cannot be generated from the neighboring blocks. g. In one example, all methods disclosed in this document can be applied to generate affine merge / AMVP candidates by combining affine parameters stored in one or more related sub-buffers. 40. If the neighboring block is coded in intra block copy (IBC) mode, the neighboring block cannot be used in combination with the affine parameters stored in the affine HMVP buffer or affine HMVP sub-buffer to generate affine merge / AMVP candidates. 41. If the spatially neighboring blocks can be used to generate inherited merge / AMVP candidates, the spatially neighboring blocks cannot be combined with the affine parameters stored in the affine HMVP buffer / sub-buffer to generate affine merge / AMVP candidates. 42. Spatially and / or temporally adjacent / non-adjacent blocks may be divided into K groups (e.g., K=2), and how the parameters in the affine HMVP buffer / sub-buffer are combined with the motion information of spatially and / or temporally adjacent / non-adjacent blocks for encoding the current block may be group-based. a. Affine merge candidates generated by combining affine parameters stored in the affine HMVP buffer / sub-buffer with spatially adjacent blocks in different groups can be placed in different positions in the affine merge candidate list; b. Affine AMVP candidates generated by combining the affine parameters stored in the affine HMVP buffer / sub-buffer with spatially neighboring blocks in different groups can be placed in different positions in the affine AMVP candidate list; c. In one example, spatially neighboring blocks can be divided into groups based on their coded information. i. For example, neighboring blocks may be placed into specific groups based on whether they are affine coded or not. ii. For example, neighboring blocks may be placed into specific groups based on whether they are affine coded and in AMVP mode. iii. For example, neighboring blocks may be placed into specific groups based on whether they are affine coded and in merge mode. d. In one example, spatially neighboring blocks can be divided into groups based on their locations. e. In one example, not all neighboring blocks are put into K groups. f. In one example, spatially neighboring blocks are divided into two groups as follows: i. The first encountered affine-encoded left neighboring block can be put into group X. (a) Check the left adjacent blocks in order, such as block A0 and block A1, as shown in Figure 8 shown. (b) In one example, if the first encountered affine-coded left neighboring block is used to generate a succession merge / AMVP candidate, it is not put into group X. ii. Put the first encountered affine-encoded upper neighboring block into group X. (a) Check the upper adjacent blocks in order. For example, block B0, block B1 and block B2, as shown in Figure 8 shown. (b) In one example, if the first encountered inter-coded and affine-coded above neighboring block is used to generate a succession merge / AMVP candidate, it is not put into group X. iii. Neighboring blocks of other frames that have been inter-coded can be put into group Y, where Y is not equal to X. g. In one example, an affine merge candidate generated by combining the affine parameters stored in the affine HMVP buffer / sub-buffer with the spatially adjacent blocks in group X may be placed in the affine merge candidate list before the Kth constructed affine merge candidate. For example, K may be 1 or 2. h. In one example, an affine merge candidate generated by combining the affine parameters stored in the affine HMVP buffer / sub-buffer with spatially adjacent blocks in group Y may be placed in the affine merge candidate list after the Kth constructed affine merge candidate. For example, K may be 1 or 2. i. In one example, the affine AMVP candidate generated by combining the affine parameters stored in the affine HMVP buffer / sub-buffer with the spatially adjacent blocks in group Y can be placed in the affine AMVP candidate list before the K-th constructed affine merge candidate. For example, K can be 1 or 2. j. In one example, the affine AMVP candidate generated by combining the affine parameters stored in the affine HMVP buffer / sub-buffer with the spatially adjacent blocks in group Y can be placed in the affine AMVP candidate list after the K-th constructed affine merge candidate. For example, K can be 1 or 2. k. In one example, the affine AMVP candidate generated based on the affine parameters stored in the affine HMVP buffer / sub-buffer combined with the spatially neighboring blocks in group Y can be put into the affine AMVP candidate list before the zero candidate. 43. The basic position (xm, ym) in item 20 can be any position within the basic neighboring block (e.g., a 4×4 basic block), such as Figure 21 As shown, it shows the position in the 4×4 basic block. a. For example, (xm, ym) can be Figure 21 P22 in. b. Assume that the coordinates of the upper left sample of the current block are (xPos00, yPos00), the coordinates of the upper right sample of the current block are (xPos10, yPos00), and the coordinates of the upper right sample of the current block are (xPos00, yPos01), then Figure 8 middle: i. For the adjacent basic block A1, (xm, ym) is (xPos00-2, yPos01-1); ii. For the adjacent basic block A0, (xm, ym) is (xPos00-2, yPos01+3); iii. For the adjacent basic block B1, (xm, ym) is (xPos10-1, yPos00-2); iv. For the adjacent basic block B0, (xm, ym) is (xPos10+3, yPos00-2); v. (xm, ym) for the adjacent basic block B2 is (xPos00-2, yPos00-2). 2.14 Derivation of non-affine motion based on affine motion 1. It is proposed to update the motion information of an affine-encoded block after motion compensation, and the updated motion information is stored and used for motion prediction of subsequent encoded / decoded blocks. a. In one example, the updated motion information is used for motion prediction of subsequently encoded / decoded blocks in different pictures. b. In one example, the filtering process (eg, deblocking filter) depends on the updated motion information. c. The update process may be invoked under other conditions, for example, only for the right and / or bottom affine sub-blocks of a CTU. In this case, the filtering process may depend on the unupdated motion information, and the updated motion information may be used for subsequent coded / decoded blocks in other pictures or the current slice / tile. 2. In one example, the MV stored in a sub-block located at the right boundary and / or the lower boundary may be different from the MV used in the MC of the sub-block. Figure 22 An example is shown in which sub-blocks located at the right and lower boundaries are shaded. a. In one example, MVs stored in sub-blocks located at the right boundary and / or the bottom boundary can be used as MV predictions or candidates for subsequent encoded / decoded blocks in the current frame or a different frame. b. In one example, the MV stored in the sub-block located at the right boundary and / or the lower boundary may be derived through an affine model having representative points outside the sub-block. c. In one example, two groups of MVs are stored for the right boundary and / or the bottom boundary, one group of MVs is used for deblocking and temporal motion prediction, and the other group is used for motion prediction of subsequent PUs / CUs in the current picture. 3. Assume that the coordinates of the upper left corner of the current block are (x0, y0), the coordinates of the upper left corner of the sub-block are (x', y'), the size of the sub-block is M×N, and the MV stored in the sub-block is recorded as (MVx, MVy). (MVx, MVy) is calculated by the 4-parameter affine model using equation (1) or the 6-parameter affine model using equation (2). The representative point (x, y) is set to (xp-x0, yp-y0) and (xp, yp) can be defined as follows: a. If the sub-block is located at the right boundary, then xp = x' + M + M / 2, yp = y' + N / 2; Figure 23(a) depicts such an example. b. If the sub-block is located at the lower boundary, then xp = x' + M / 2, yp = y' + N + N / 2. FIG. 23( a ) depicts such an example. c. For the lower right corner, the representative point (x, y) can be defined as: i. In one example, if the sub-block is located in the lower right corner, then xp = x'+M+M / 2, yp = y'+N / 2; ii. In one example, if the sub-block is located at the lower right corner, then xp = x'+M / 2, yp = y'+N+N / 2; iii. In one example, if the sub-block is located at the lower right corner, then xp = x'+M+M / 2, yp = y'+N+N / 2; d. If the sub-block is located at the right boundary, then xp = x' + M, yp = y' + N / 2; Figure 23(b) depicts such an example; e. If the sub-block is located at the bottom boundary, then xp = x' + M / 2, yp = y' + N; Figure 23 (b) depicts such an example; f. If the sub-block is located in the lower right corner, then xp = x' + M, yp = y' + N. Figure 23(b) depicts such an example; g. If the sub-block is located at the lower right boundary, then xp = x' + M, yp = y' + N. Such an example is depicted in Figure 23(c); h. If the sub-block is located at the bottom boundary, then xp = x', yp = y' + N. Figure 23(d) depicts such an example; i. If the sub-block is located at the right boundary, then xp = x' + M, yp = y'; Figure 23 (d) depicts such an example; j. If the sub-block is located at the lower right corner, then xp = x' + M, yp = y' + N. Figure 23(d) depicts such an example. 4. In one example, when deriving its stored MV, some sub-blocks at the bottom boundary or the right boundary are abnormal. a. For the upper right corner (such as Figure 6 The block RT shown in Figure 1 always stores the MV in the upper right corner (e.g. Figure 6 mv1 shown). b. For the lower left corner (such as Figure 6 LB block shown), which always stores the MV in the lower left corner (such as Figure 6 mv2 shown). i. Alternatively, for the bottom left corner, store the MV only if mv2 is the signaled MV. c. For the lower right corner (such as Figure 6 The block RB shown in the figure always stores the MV in the lower right corner (e.g. Figure 6 mv3 shown). 5. In one example, the MV prediction of the current non-affine coded block may be derived from neighboring coded blocks based on affine prediction (may include one MV or two MVs for two inter prediction directions). a. For example, when the current block is coded in inter mode, the MV prediction can be used as the MVP candidate in the MVP candidate list. b. For example, when the current block is encoded and decoded in merge mode, the MV prediction can be used as a merge candidate in the MVP candidate list. c. Assuming that the coordinates of the upper left corner of the adjacent affine-encoded block are (x0, y0), the CP MV of the adjacent affine-encoded block is (for the upper left corner), (for the upper right corner), (For the lower right corner). The width and height of the adjacent affine-encoded block are w and h. The coordinates of the upper left corner of the current block are (x', y'), and the coordinates of any point in the current block are (x", y"). The width and height of the current block are M and N. i. In one example, if the adjacent affine-encoded blocks adopt a 4-parameter affine model, the MV prediction is calculated according to equation (1) as (mv h (x,y),mv v (x, y)), where x = x'-x0, y = y'-y0; ii. In one example, if the adjacent affine-encoded blocks adopt a 6-parameter affine model, the MV prediction is calculated according to equation (2) as (mv h (x,y),mv v (x, y)), where x = x'-x0, y = y'-y0; iii. Some possible positions of (x”, y”) are: (e.g. Figure 24 shown) (a)(x',y'), (b)(x'+M / 2,y'), (c)(x'+M / 2+1,y'), (d)(x'+M-1,y'), (e)(x'+M,y'), (f)(x',y'+N / 2), (g)(x'+M / 2,y'+N / 2), (h)(x'+M / 2+1, y'+N / 2), (i)(x'+M-1,y'+N / 2), (j)(x'+M, y'+N / 2), (k)(x',y'+N / 2+1), (l)(x'+M / 2,y'+N / 2+1), (m)(x'+M / 2+1,y'+N / 2+1), (n)(x'+M-1,y'+N / 2+1), (o)(x'+M,y'+N / 2+1), (p)(x',y'+N-1), (q)(x'+M / 2,y'+N-1), (r)(x'+M / 2+1,y'+N-1), (s)(x'+M-1,y'+N-1), (t)(x'+M,y'+N-1), (u)(x',y'+N), (v)(x'+M / 2, y'+N), (w)(x'+M / 2+1,y'+N), (x)(x'+M-1,y'+N), (y)(x'+M,y'+N). 6. If the neighboring basic unit block S (e.g., a 4×4 block in VVC) belongs to an affine-encoded block T (e.g., the basic unit block A0 in FIG7( b ) belongs to an affine-encoded block), the following method can be applied to obtain motion prediction candidates: In one example, when a basic unit block S is accessed through the MVP list construction process and / or the merge candidate list construction process, the MV stored in S is not retrieved. Instead, the MV prediction derived from the affine-encoded block T is obtained for the current block. b. In one example, a basic unit block S is accessed twice through the MVP list construction process and / or the merge candidate list construction process. In one access, the MV stored in S is retrieved. In the other access, the MV prediction for the current block derived from the affine-encoded block T is obtained as an additional MVP candidate or merge candidate. 7. If the neighboring basic unit block S (e.g., a 4×4 block in VVC) belongs to an affine-coded block T, then an additional MVP candidate or merge candidate derived from the affine-coded block T for the current block may be added to the position of the MVP candidate list or the merge candidate list: a. In one example, after taking a candidate from block S; b. In one example, before taking a candidate from block S; c. In one example, after all normal spatial candidates but before the temporal candidate; d. In one example, after the time candidate; e. In one example, the position can be adaptively changed from one block to another. 8. In one example, the total number of additional candidates derived from the affine-encoded blocks cannot exceed a fixed number, such as 1 or 2. a. Alternatively, the fixed number may further depend on coded information, such as the size of the candidate list, the total number of available motion candidates before adding these additional candidates, block size, block type, coding mode (AMVP or merge), slice type, etc. 9. In one example, additional candidates derived from the affine coded block can be pruned along with the other candidates. If a derived candidate is identical to another candidate already in the list, it will not be added to the list. a. In one example, if a neighboring basic unit block S (a 4×4 block in VVC) belongs to an affine-coded block T, the additional candidates derived from the affine-coded block T are compared with the MV obtained from S. b. In one example, the derived candidate is compared to other derived candidates. 10. In one example, whether and how to apply the MV prediction derived from the neighboring affine-coded blocks for the current non-affine-coded block may depend on the dimensions of the current block (assuming the current block size is width×height). a. For example, if W>=T and H>=T, then do not apply, where T is an integer, such as 8; b. For example, if W>=T or H>=T, then do not apply, where T is an integer, such as 8; c. For example, if W <= T and H <= T, then not apply, where T is an integer, such as 8; d. For example, if W <= T or H <= T, then do not apply, where T is an integer, such as 8; General applications related to affine motion 11. With respect to the upper left sample of a sub-block of size equal to M×N, the selection of the representative point can be changed, and is not always equal to (M / 2, N / 2). a. In one example, the representative point may be set to ((M>>1)-0.5, (N>>1)-0.5). b. In one example, the representative point may be set to ((M>>1)-0.5, (N>>1)). c. In one example, the representative point may be set to ((M>>1), (N>>1)-0.5). d. In one example, the representative point may be set to ((M>>1)+0.5, (N>>1)). e. In one example, the representative point may be set to ((M>>1), (N>>1)+0.5). f. In one example, the representative point may be set to ((M>>1)+0.5, (N>>1)+0.5). g. In one example, when the coordinates of the upper left corner of the sub-block relative to the upper left sample of the current block are (xs, ys), the coordinates of the representative point are defined as (xs+1.5, ys+1.5). i. In one embodiment, rewrite equation (6) to derive the MV of the new representative point: ii. Similarly, additional offsets (0.5, 0.5) or (-0.5, -0.5) or (0, 0.5), or (0.5, 0), or (-0.5, 0), or (0, -0.5) may be added to these representative points. 12. It is proposed to align the stored motion information with the motion information used in motion compensation. a. In one example, Figure 3 The currently stored mvi in ​​is replaced by mvi', where i is (0, and / or 1, and / or 2, and / or 3). 13. It is proposed that motion candidates obtained from affine-coded blocks (eg, MVP candidates for AMVP mode, or merge candidates) should be used differently from motion candidates obtained from non-affine-coded blocks. a. For example, the motion candidate taken from the affine-encoded block may not be placed in the motion candidate list or the merge candidate list; b. For example, a motion candidate taken from an affine-coded block may be placed in a motion candidate list or a merge candidate list with a lower priority, for example, it should be placed at a later position. c. The order of merging candidates can be adaptively changed based on whether the motion candidate is obtained from an affine-coded block. 14. The affine MVP candidate list size or affine merge candidate list size for an affine coded block can be adaptive. a. In one example, the affine MVP candidate list size or the affine merge candidate list size of an affine-coded block may be adaptive based on the size of the current block. i. For example, if the affine-encoded block is larger, the size of the affine MVP candidate list or the size of the affine merge candidate list may be larger. b. In one example, the affine MVP candidate list size or affine merge candidate list size of an affine-coded block can be adapted based on the coding mode of spatially or temporally neighboring blocks. For example, if more spatially neighboring blocks are affine-coded, the affine MVP candidate list size or the affine merge candidate list size of the affine-coded block may be larger. 2.15 Non-adjacent affine candidates Similar to the enhanced conventional merging mode, this contribution proposes affine merging using non-adjacent spatial neighbors (NSAM). The mode of obtaining non-adjacent spatial neighbors is as follows: Figure 4As shown in Figure 2, similar to the existing non-adjacent conventional merge candidates, the distance between the non-adjacent spatial neighbors and the current codec block in NSAM is also defined based on the width and height of the current CU. Figure 4 The motion information of non-adjacent spatial neighbors in is used to generate additional inherited and constructed affine merge candidates. Specifically, for the inherited candidates, the same derivation process of inherited affine merge candidates in VVC remains unchanged, except that CPMV is inherited from non-adjacent spatial neighbors. Non-adjacent spatial neighbors are checked based on their distance to the current block (i.e., from near to far). At a certain distance, only the first available neighbor (i.e., the decoded neighbor using affine mode) from each side of the current block (e.g., left and above) is included for inherited candidate derivation. Figure 25a As shown by the arrow 2510 in FIG, the order of checking the neighbors on the left and above is from bottom to top and from right to left respectively. Figure 25b As shown, first determine the position of a non-adjacent spatial neighbor in the upper left independently; then, the position of the upper left neighbor can be determined accordingly, which can be enclosed together with the upper left non-adjacent neighbor to form a rectangular virtual block. Then, as Figure 26 As shown, motion information of three non-adjacent neighbors is used to form CPMVs located at the upper left (A), upper right (B), and lower left (C) of the virtual block, which are finally projected to the current CU to generate corresponding constructed candidates. Non-adjacent spatial merge candidates are inserted into the affine merge candidate list in the following order: 1.SbTMVP candidates (if any) 2. Inheritance from neighboring 3. Inheritance from non-adjacent neighbors, 4. Constructed by adjacent neighbors, 5. Constructed from non-adjacent neighbors, 6. Zero MV. 3. Question How to use the stored affine parameters to derive affine / non-affine merge / AMVP candidates is still unclear in details. 4. Embodiments of the present disclosure In this paper, it proposes a method to control the bandwidth required for affine prediction in a more flexible way. It also proposes to coordinate affine prediction with other codec tools. The following detailed embodiments should be considered as examples for explaining the general concept. These embodiments should not be interpreted narrowly. In addition, these embodiments can be combined in any way. Combinations between this disclosure and other disclosures are also applicable. In the following discussion, it is assumed that the coordinates of the upper left corner / upper right corner / lower left corner / lower right corner of the neighboring block of the current block (e.g., the upper or left neighboring CU) are (LTNx, LTNy) / (RTNx, RTNy) / (LBNx, LBNy) / (RBNx, RBNy) respectively; the coordinates of the upper left corner / upper right corner / lower left corner / lower right corner of the current CU are (LTCx, LTCy) / (RTCx, RTCy) / (LBCx, LBCy) / (RBCx, RBCy) respectively; the width and height of the upper or left neighboring CU after affine coding are w' and h' respectively; the width and height of the current CU after affine coding are w and h respectively. The CPMVs of the upper left corner, upper right corner, and lower left corner are expressed as MV0 = (MV0x, MV0y), MV1 = (MV1x, MV1y), and MV2 = (MV2x, MV2y), respectively. In the following discussion, SignShift(x,n) is defined as In one example, offset0 and offset1 are set to (1<<(n-1)). In another example, they are set to 0. Shift can be defined as Shift(x,n)=(x+offsset)>>n. In one example, offset is set to (1<<(n-1)). In another example, it is set to 0. Clip3(min,max,x) can be defined as It should also be noted that the term "affine merge candidate list" can be renamed (e.g., "sub-block merge candidate list") when other types of sub-block merge candidates such as ATMVP candidates are also put into the list or other types of merge lists include at least one affine merge candidate. The proposed method can also be applied to other kinds of motion candidate lists, such as affine AMVP candidate lists. As described in Section 2.14, the MV predictor derived using the affine model from neighboring blocks can be named as a neighboring affine derived (NAD) candidate. 1. It is recommended to check the similarity or identity of two affine candidates to determine whether the second candidate can be added to the affine candidate list. a. In one example, if the motion information of all control points associated with the second candidate is the same as the motion information of the control points associated with the first candidate, the second candidate is not added to the affine candidate list. b. In one example, if the motion information of some but not all control points associated with the second candidate is the same as the motion information of the control points associated with the first candidate, the second candidate is not added to the affine candidate list. c. In one example, if the motion information of all control points associated with the second candidate is similar to the motion information of the control points associated with the first candidate (eg, the absolute difference is less than some threshold), the second candidate is not added to the affine candidate list. d. In one example, if the motion information of some but not all control points associated with the second candidate is similar to the motion information of the control points associated with the first candidate (eg, the absolute difference is less than some threshold), the second candidate is not added to the affine candidate list. e. The above-mentioned motion information may include all or part of the following information: i. Motion vector, ii. Affine model parameters (e.g. 4 or 6 models), iii.LIC logo, iv.BCW Index, v. interpolation filter type (e.g., 6-tap interpolation or half-pixel interpolation), vi. Motion vector accuracy. 2. It is proposed to check the similarity or identity of two affine candidates to determine whether the second candidate can be utilized during the decoding process, for example, as a starting search point for a template-based affine motion prediction process. a. Alternatively, in addition, how to define similarity or identity may be the same as mentioned in item 1. 3. It is proposed that the first affine merge candidate to be inserted into the affine merge candidate list or the sub-block based merge candidate list may be compared with existing candidates in the affine merge candidate list or the sub-block based merge candidate list. In one example, if a first affine merge candidate is determined to be "duplicate" with at least one candidate already in the affine merge candidate list or the sub-block-based merge candidate list, it may be determined not to be placed in the affine merge candidate list or the sub-block-based merge candidate list. "Duplicate" can mean "identical" or "similar." This process may be referred to as "pruning." b. The first affine merge candidate can be derived from the affine HMVP table. c. In one example, if two candidates belong to different categories, they may not be considered "duplicates." For example, if one of the two candidates is a sub-block based TMVP merge candidate and the other is an affine merge candidate, the two candidates may not be considered "duplicates." d. In one example, two candidates may not be considered “duplicates” if at least one codec feature in the two candidates is different. i. For example, the codec feature can be an affine model type, such as a 4-parameter affine model or a 6-parameter affine model. ii. For example, the codec feature can be an index of bidirectional prediction with CU-level weight (BCW). iii. For example, the codec feature may be Local Illumination Compensation (LIC). iv. For example, the codec feature may be the inter prediction direction, such as bidirectional prediction, unidirectional prediction from L0, or unidirectional prediction from L1. v. For example, the codec feature may be a reference picture index. (a) For example, a reference picture index is associated with a specified reference list. e. In one example, two candidates may not be considered "duplicates" if at least one CPMV (denoted as MV) of a first candidate is different from the corresponding CPMV (denoted as MV*) of a second candidate. i. In one example, if ||MVx-MVx*||>Tx&&||MVy-MVy*||>Ty, then two candidates may not be considered "duplicates". ii. In one example, if ||MVx-MVx*||>Tx||, ||MVy-MVy*||>Ty, then the two candidates may not be considered "duplicates". iii. Tx and Ty are threshold values, for example (Tx=0 and Ty=0) or (Tx=1 and Ty=)1 or (Tx=2 and Ty=2). (a) In one example, Tx and / or Ty can be signaled from the encoder to the decoder. (b) In one example, Tx and / or Ty may depend on codec information such as block size. iv. Alternatively, if the CPMV of the first candidate and the CPMV corresponding to the second candidate are different, the two candidates may not be considered "duplicates". f. In one example, two candidates may not be considered “duplicates” if at least one affine parameter of a first candidate (denoted as a) and a corresponding affine parameter of a second candidate (denoted as a*) are different. i. In one example, if ||aa*||>Ta, then the two candidates may not be considered "duplicates". ii. Ta is a threshold, for example, Ta=0, Ta=1, Ta=2. (a) In one example, Ta can be signaled from the encoder to the decoder. (b) In one example, Ta may depend on codec information such as block size. iii. Alternatively, if the affine parameters of the first candidate and the corresponding affine parameters of the second candidate are all different, then the two candidates may not be considered "duplicates". 4. It is proposed that the first affine AMVP candidate to be inserted into the affine AMVP candidate list can be compared with the existing candidates in the affine AMVP candidate list. In one example, if the first affine AMVP candidate is determined to be "duplicate" with at least one candidate already in the list, the first affine AMVP candidate may be excluded from the affine AMVP candidate list. "Duplicate" can mean "identical" or "similar." This process is referred to as "pruning." b. The first affine AMVP candidate can be derived from the affine HMVP table. c. In one example, two candidates may not be considered "duplicates" if at least one CPMV (denoted as MV) of a first candidate is different from the corresponding CPMV (denoted as MV*) of a second candidate. i. In one example, if ||MVx-MVx*||>Tx&&||MVy-MVy*||>Ty, then two candidates may not be considered "duplicates". ii. In one example, if ||MVx-MVx*||>Tx||, ||MVy-MVy*||>Ty, then the two candidates may not be considered "duplicates". iii. Tx and Ty are threshold values, for example (Tx=0 and Ty=0) or (Tx=1 and Ty=)1 or (Tx=2 and Ty=2). (a) In one example, Tx and / or Ty can be signaled from the encoder to the decoder. (b) In one example, Tx and / or Ty may depend on Codec information such as block size. iv. Alternatively, if the CPMV of the first candidate and the CPMV corresponding to the second candidate are different, the two candidates may not be considered "duplicates". d. In one example, two candidates may not be considered “duplicates” if at least one affine parameter of a first candidate (denoted as a) and a corresponding affine parameter of a second candidate (denoted as a*) are different. i. In one example, if ||aa*||>Ta, then the two candidates may not be considered "duplicates". ii. Ta is a threshold, for example, Ta=0, Ta=1, Ta=2. (a) In one example, Ta can be signaled from the encoder to the decoder. (b) In one example, Ta may depend on codec information such as block size. iii. Alternatively, if the affine parameters of the first candidate and the corresponding affine parameters of the second candidate are all different, then the two candidates may not be considered "duplicates". 5. It is proposed that the first codec feature can be inherited from the first neighboring block for an affine merge candidate derived from an affine HMVP table or sub-table. a. In one example, a base MV for deriving history-based affine merge candidates may be obtained from the first neighboring block. 6. In one example, history-based affine merge candidates may be placed into multiple positions in an affine merge candidate list (also referred to as a sub-block-based merge candidate list). a. In one example, a first set of one or more history-based affine merge candidates may be placed in the affine merge candidate list before the k-th constructed affine merge candidate (eg, k=0, 1, .. or k corresponds to the last constructed affine merge candidate). i. In one example, the history-based affine merge candidates in the first group are derived by obtaining base MVs and base positions from spatially neighboring blocks that are coded using non-affine inter mode. ii. In one example, the history-based affine merge candidates in the first set are derived by a set of affine parameters stored in the latest entry corresponding to the reference index of the base MV in the history-based affine parameter table. b. In one example, a second set of one or more history-based affine merge candidates may be placed in the affine merge candidate list after the k-th constructed affine merge candidate (eg, k=0, 1, .. or k corresponds to the last constructed affine merge candidate). i. In one example, the history-based affine merge candidates in the second group can be derived by base MVs and base positions obtained from temporally neighboring blocks. ii. In one example, the history-based affine merge candidates in the second set are derived by a set of affine parameters stored in a nearest entry corresponding to the reference index of the base MV in the history-based affine parameter table. c. In one example, a third set of one or more history-based affine merge candidates may be placed in the affine merge candidate list before the zero affine merge candidate. i. In one example, the history-based affine merge candidates in the third group can be derived by base MVs and base positions obtained from temporally neighboring blocks. ii. In one example, the history-based affine merge candidates in the first group can be derived by base MVs and base positions obtained from spatially neighboring blocks coded in non-affine inter mode. iii. In one example, the history-based affine merge candidates in the third group are derived by a set of affine parameters stored in the non-latest entries corresponding to the reference indices of the base MVs in the history-based affine parameter table. 7. In one example, history-based affine AMVP candidates can be placed in multiple positions in the affine AMVP candidate list. a. In one example, a first set of one or more history-based affine AMVP candidates may be placed in the affine AMVP candidate list before the k-th constructed affine AMVP candidate (eg, k = 0, 1, .. or k corresponds to the last constructed affine AMVP candidate). i. In one example, the history-based affine AMVP candidates in the first group are derived by obtaining base MVs and base positions from spatially neighboring blocks decoded with non-affine inter mode. ii. In one example, the history-based affine AMVP candidates in the first group are derived by a set of affine parameters stored in the latest entry corresponding to the reference index of the base MV in the history-based affine parameter table. b. In one example, a second set of one or more history-based affine AMVP candidates may be placed into the affine AMVP candidate list after the k-th constructed affine AMVP candidate (eg, k=0, 1, .. or k corresponds to the last constructed affine AMVP candidate). i. In one example, the history-based affine AMVP candidates in the second group can be derived by base MVs and base positions obtained from temporally neighboring blocks. ii. In one example, the history-based affine AMVP candidates in the second set are derived by a set of affine parameters stored in the latest entry corresponding to the reference index of the base MV in the history-based affine parameter table. c. In one example, one or more history-based affine AMVP candidates in the third group may be placed in the affine AMVP candidate list before the non-affine AMVP-derived affine AMVP candidates. i. In one example, the history-based affine AMVP candidates in the third group can be derived by basic MVs and basic positions obtained from temporally neighboring blocks. ii. In one example, the history-based affine AMVP candidates in the first group can be derived by obtaining base MVs and base positions from spatially neighboring blocks encoded with non-affine inter mode. iii. In one example, the history-based affine AMVP candidates in the third group are derived by a set of affine parameters stored in the non-latest entries corresponding to the reference indices of the base MVs in the history-based affine parameter table. d. In one example, one or more history-based affine AMVP candidates in the fourth group may be placed in the affine AMVP candidate list before the zero affine AMVP candidate. i. In one example, the history-based affine AMVP candidates in the third group can be derived by basic MVs and basic positions obtained from temporally neighboring blocks. ii. In one example, the history-based affine AMVP candidates in the first group can be derived by obtaining base MVs and base positions from spatially neighboring blocks encoded with non-affine inter mode. iii. In one example, the history-based affine AMVP candidates in the first group can be derived by obtaining base MVs and base positions from spatially neighboring blocks decoded with affine inter mode. iv. In one example, the history-based affine AMVP candidates in the third group are derived by a set of affine parameters stored in a non-latest entry corresponding to a reference index of a base MV in a history-based affine parameter table. 8. In one example, a constructed / hypothesized / virtual affine candidate may be generated by combining the first piece of motion information of the affine AMVP candidate and the second piece of motion information of the affine merge candidate. a. For example, the first piece of motion information may be the L0 (or L1) motion of the affine AMVP candidate. b. For example, the second piece of motion information may be the L1 (or L0) motion of the affine merge candidate. c. For example, only the motion data (such as reference index, motion vector difference and / or MVP index) of the first direction (unidirectional such as L0 or L1) of the constructed / assumed / virtual affine candidate may be signaled in the bitstream. d. For example, motion data for a second direction (in addition to the identified / signaled first direction) may be inherited (or implicitly derived from a decoder-side method) but not signaled. 9. The number of non-adjacent affine candidates is only allowed to be no greater than the maximum number. a. The number of non-adjacent inheritance affine candidates is only allowed to be no greater than the maximum number. b. The number of affine candidates constructed in non-adjacent manner is only allowed to be no greater than the maximum number. 10. In one example, the positions of non-adjacent blocks used to derive non-adjacent affine candidates may be predefined. a. The positions of the non-adjacent blocks used to derive the non-adjacent affine candidates may be the same as the positions of the non-adjacent blocks used to derive the non-adjacent non-affine candidates. b. The positions of non-neighboring blocks used to derive non-neighboring affine candidates may depend on the size of the current block. c. The locations of non-adjacent blocks used to derive non-adjacent affine candidates can be restricted to regions. i. This area can be the current CTU. ii. This area can be the current CTU row. iii. The area can be the current CTU and at least one adjacent CTU on the left side of the current CTU. iv. The area can be the current CTU and at least one adjacent CTU above the current CTU. v. The area can be the current CTU, at least one adjacent CTU to the left of the current CTU, and at least one adjacent CTU above the current CTU. 11. In one example, at least one history-based affine candidate may be used together with at least one non-adjacent affine candidate. a. The candidate can be an affine merge (or sub-block) candidate or an affine AMVP candidate. b. Non-adjacent affine candidates can be non-adjacent affine inheritance candidates or non-adjacent affine constructed candidates. c. In one example, history-based affine candidates may be placed in the list before non-adjacent affine inheritance candidates. d. In one example, history-based affine candidates may be placed in the list before non-adjacent affine-constructed candidates. e. In one example, history-based affine candidates may be placed in a list after non-adjacent affine inheritance candidates. f. In one example, history-based affine candidates may be put in a list after non-adjacent affine constructed candidates. g. In one example, at least one history-based affine candidate may be used together with at least one non-adjacent affine construction candidate. 44. In one example, at least one affine merge candidate (called a non-adjacent affine HMVP candidate) derived from the parameters stored in the buffer and one or more non-adjacent unit blocks may be put into an affine candidate list. a. The number of non-adjacent affine HMVP candidates is only allowed to be no greater than the maximum number. b. In one example, non-neighboring unit blocks can be used to derive affine HMVP candidates in a similar manner to deriving neighboring unit blocks. i. In one example, the basic MV is obtained from a non-adjacent unit block, and the position of the basic MV is a position (eg, center) in the non-adjacent unit block. c. In one example, non-adjacent affine HMVP candidates may be placed before adjacent affine HMVP candidates that are derived from parameters stored in a buffer and one or more adjacent unit blocks. d. The locations of non-adjacent blocks for non-adjacent affine HMVP candidates may be predefined. ii. The positions of the non-adjacent blocks for the non-adjacent affine HMVP candidates may be the same as the positions of the non-adjacent blocks from which the non-adjacent non-affine candidates were derived. iii. The positions of the non-adjacent blocks for the non-adjacent affine HMVP candidates may be the same as the positions of the non-adjacent blocks from which the non-adjacent affine candidates are derived. iv. The positions of non-neighboring blocks for non-neighboring affine HMVP candidates may depend on the size of the current block. v. The locations of non-adjacent blocks for non-adjacent affine HMVP candidates can be restricted to regions. (a) The region may be the current CTU. (b) The area may be the current CTU row. (c) The region may be the current CTU and at least one adjacent CTU on the left side of the current CTU. (d) The area may be the current CTU and at least one adjacent CTU above the current CTU. (e) The area may be the current CTU, at least one adjacent CTU to the left of the current CTU, and at least one adjacent CTU above the current CTU. e. Non-adjacent affine candidates can be non-adjacent affine inheritance candidates or non-adjacent affine construction candidates. 45. Adjacent or non-adjacent spatial or temporal adjacent M×N blocks (e.g., in VTM) The motion information of the 4×4 block and the affine parameter set stored in the buffer can be used together to derive the affine model of the current block. For example, they can be used to derive the CPMV or MV of the sub-block for motion compensation. a. Assume that the MV stored in the unit block is (mvh0, mvv0), and the coordinates of the position where the MV (mvh(x, y), mvv(x, y)) is derived are represented as (x, y). Assume that the coordinates of the upper left corner of the current block are (x0', y0'), and the width and height of the current block are w and h. i. To derive CPMV, (x,y) can be (x0',y0') or (x0'+w,y0') or (x0',y0'+h) or (x0'+w,y0'+h). ii. To derive the MV of the sub-block for the current block, (x,y) can be the center of the sub-block. Assuming (x00,y00) is the top left position of the sub-block and the sub-block size is M×N, then (a)xm=x00+M / 2, ym=y00+N / 2; (b)xm=x00+M / 2-1, ym=y00+N / 2-1; (c)xm=x00+M / 2-1, ym=y00+N / 2; (d)xm=x00+M / 2, ym=y00+N / 2-1; iii. In one example, If the parameters in the buffer come from a block encoded or decoded in 4-parameter affine mode. iv. In one example, If the parameters in the buffer come from a 6-parameter affine encoding Block of code. v. In one example, Regardless of whether the parameters in the buffer come from blocks encoded or decoded in 4-parameter affine mode or 6-parameter affine mode. b. In one example, the CPMVs of the current block are derived from the motion vectors and the parameters stored in the buffer, and these CPMVs are used as MVPs of the signaled CPMVs of the current block. c. In one example, the CPMVs of the current block are derived from the motion vectors and parameters stored in a buffer, and these CPMVs are used to derive the MVs of each sub-block used for motion compensation. d. In one example, if the current block is affine merge coded, the MV of each sub-block used for motion compensation is derived from the motion vector and parameters stored in neighboring blocks. e. In one example, the motion vector of the neighboring unit block and the parameter set used to derive the CPMV or the MV of the sub-block used in motion compensation of the current block may comply with some or all of the following constraints: i. They have the same inter prediction direction (list 0 or list 1 or Bi) associated. ii. When list 0 is the one prediction direction in use, they are associated with the same reference index for list 0. iii. When List 1 is the one prediction direction in use, they are associated with the same reference index for List 1. 46. ​​The motion information of adjacent or non-adjacent spatially or temporally adjacent M×N unit blocks (e.g., 4×4 blocks in VTM) known as basic blocks can be used together with the affine parameter set NOT stored in the cache to derive the affine model of the current block. For example, they can be used to derive the CPMV or MV of the sub-block for motion compensation. a. In one example, a set of affine parameters may be derived from affine-encoded adjacent or non-adjacent neighboring blocks. i. For the affine codec block, the parameters can be derived: (a) (b) (c) (d) (e) c = -b, for 4-parameter affine prediction. (f) d = a, for 4-parameter affine prediction. Where mv0, mv1, and mv2 represent the CPMVs of adjacent or non-adjacent neighboring blocks. w and h represent the width and height of the neighboring block. b. In one example, the set of affine parameters may be derived from N (eg, two or three) adjacent or non-adjacent neighboring blocks that are inter-coded. i. For the affine codec block, the parameters can be derived: (a) (b) (c)c=-b (d)d=a Where mv0 and mv1 represent the MVs of two adjacent blocks, and w represents the horizontal distance between two adjacent blocks. In one example, w must be 2 K The form is , where k is an integer. ii. For the affine codec block, the parameters can be derived: (a) (b) (c)c=-b (d)d=a Where mv0, mv1, and mv2 represent the MVs of the three neighboring blocks. w represents the horizontal distance between the neighboring blocks associated with mv0 and mv1. h represents the vertical distance between the neighboring blocks associated with mv0 and mv2. In one example, w must be 2 K The form is , where k is an integer. In one example, h must be 2 K The form is , where k is an integer. iii. The positions of the N blocks may satisfy one or more constraints. (a) At least one position (such as the upper left position) of the neighboring blocks associated with mv0 and mv1 must have the same coordinates in the vertical direction. (b) At least one position (such as the upper left position) of the neighboring blocks associated with mv0 and mv2 must have the same coordinates in the horizontal direction. iv. In one example, the motion vectors of N neighboring unit blocks can follow Some or all of the following constraints: (a) They are associated with the same inter prediction direction (list 0 or list 1 or Bi). (b) When list 0 is the one prediction direction in use, they are associated with the same reference index for list 0. (c) When list 1 is the one prediction direction in use, they are associated with the same reference index for list 1. v. For example, the basic block may be one of the N neighboring blocks. c. In one example, neighboring blocks used to generate affine parameters may be checked sequentially. i. For example, neighboring blocks may be checked from closer to the current block to farther away from the current block. d. Assume that the MV stored in the cell block is (mv h 0,mv v 0), and export MV(mv h (x,y),mv v The coordinates of the position (x,y)) are expressed as (x,y). Assuming that the coordinates of the upper left corner of the current block are (x0',y0'), the width and height of the current block are w and h, then i. To derive CPMV, (x,y) can be (x0',y0') or (x0'+w,y0') or (x0',y0'+h) or (x0'+w,y0'+h). ii. To derive the MV of the sub-block for the current block, (x,y) can be the center of the sub-block. Assuming (x00,y00) is the top left position of the sub-block and the sub-block size is M×N, then (a)xm=x00+M / 2, ym=y00+N / 2; (b)xm=x00+M / 2-1, ym=y00+N / 2-1; (c)xm=x00+M / 2-1, ym=y00+N / 2; (d)xm=x00+M / 2, ym=y00+N / 2-1; iii. In one example, If parameters correspond to a 4-parameter affine model. iv. In one example, If parameters correspond to a 6-parameter affine model. v. In one example, Regardless of whether the parameters in the buffer come from blocks encoded or decoded in 04-parameter affine mode or in 6-parameter affine mode. e. In one example, the CPMVs of the current block are derived from the motion vectors and the parameters stored in the buffer, and these CPMVs are used as MVPs of the signaled CPMVs of the current block. f. In one example, the CPMVs of the current block are derived from the motion vectors and parameters stored in a buffer, and these CPMVs are used to derive the MVs of each sub-block used for motion compensation. g. In one example, if the current block is affine merge coded, the MV of each sub-block used for motion compensation is derived from the motion vector and parameters stored in neighboring blocks. h. In one example, the motion vector of the neighboring unit block and the parameter set used to derive the CPMV or the MV of the sub-block used in motion compensation of the current block may comply with some or all of the following constraints: i. They are associated with the same inter prediction direction (list 0 or list 1 or Bi). ii. When list 0 is the one prediction direction in use, they are associated with the same reference index for list 0. iii. When List 1 is the one prediction direction in use, they are associated with the same reference index for List 1. 47. In one example, more than one type of affine HMVP table may be used to derive at least one candidate in an affine (or sub-block) candidate list, such as an affine merge list or an affine AMVP list. a. In one example, an entry in the first type affine HMVP table may store at least one set of affine parameters (such as a, b, c, and d), such as (mv h 0,mv v 0) and basic positions such as (xm, ym). i. In one example, candidates may be derived from entries in the first type HMVP table. (a) In one example, candidate CPMVs or sub-block MVs can be derived from affine parameters, basic motion information, and basic positions. a. In one example, If the parameters in the buffer come from a 4-parameter affine encoding Block of code. b. In one example, If the parameters in the buffer come from a block encoded in 6-parameter affine mode. c. In one example, Whatever parameters are in the buffer arrives. d. In the above examples, (x, y) can be the position of a corner (eg, upper left / upper right / lower left corner) to derive the corresponding CPMV. e. In the above example, (x, y) may be the location (eg, center) of the sub-block to derive the MV for the sub-block. ii. In one example, reference picture information (eg, reference index and / or reference list) may be stored together with the corresponding base MV. iii. In one example, the inter-frame direction information may be stored in an entry of a first-type affine HMVP table. (a) In one example, the inter direction information may include whether the entry corresponds to a bidirectional prediction candidate or a unidirectional prediction candidate. (b) In one example, the inter direction information may include whether the entry corresponds to an L0 prediction candidate or an L1 prediction candidate. iv. In one example, the additional motion information may be stored in entries of a first-class affine HMVP table. (a) Additional motion information may include whether it is illumination compensation (IC) codec. (b) Additional motion information may include whether it is coded or decoded for CU-level bidirectional prediction (BCW). v. In one example, the first type of affine HMVP table may be updated after encoding / decoding the affine codec block. (a) In one example, affine parameters may be generated from affine coded blocks from CPMV encoding / decoding. (b) In one example, a base MV and a corresponding base position may be generated from the encoded / decoded affine coded block as a CPMV and a corresponding corner position (such as an upper left CPMV and an upper left position). (c) In one example, an entry with affine parameters, base MVs, and corresponding base positions generated from the encoded / decoded affine codec blocks may be put into a first type affine HMVP table. a. In one example, a similarity or identity check may be applied before inserting a new entry. i. For example, two entries are considered identical if they have the same inter direction, the same reference picture, and the same affine parameters for the same reference picture. ii. In one example, if a new entry is similar or identical to an existing entry, the new entry is not put into the list. 1. Existing entries can be placed in the latest position in the table. b. In one example, an entry in the second type affine HMVP table may store at least one set of affine parameters. i. In one example, the stored parameters may be used with at least one base MV and a base position, which may be derived from at least one adjacent or non-adjacent block. c. In one example, the first type affine HMVP table and the second type affine HMVP table may be refreshed in a similar or identical manner. d. In one example, entries in an affine HMVP table (eg, the first table or the second table) may be examined in order (such as from latest to oldest) to generate new candidates. e. In one example, entries in both affine HMVP tables may be examined in sequence to generate new candidates. i. In one example, entries in the first affine HMVP table may be checked before all entries in the second affine HMVP table. ii. For example, the k-th entry in the first affine HMVP table may be checked after the k-th entry in the second affine HMVP table. iii. For example, the k-th entry in the second affine HMVP table may be checked after the k-th entry in the first affine HMVP table. iv. For example, the kth entry in the first affine HMVP table may be checked after all mth entries in the second affine HMVP table, m = 0...S, where S is an integer. v. For example, the kth entry in the second affine HMVP table may be checked after all mth entries in the first affine HMVP table, m = 0...S, where S is an integer. vi. For example, the kth entry in the first affine HMVP table may be checked after all mth entries in the second affine HMVP table, m=m=S...maxT, where S is an integer and maxT is the last entry. vii. For example, the kth entry in the second affine HMVP table may be checked after all mth entries in the first affine HMVP table, m = S . . . maxT, where S is an integer and maxT is the last entry. 48. In one example, the HMVP table or affine HMVP table that can be stored after the encoding / decoding area (such as CU / CTU / CTU row) is called a stored table. a. Affine HMVP tables can be of the first or second kind or both. b. The HMVP table or affine HMVP table maintained for the current block (called the online table) can be used together with the stored table. c. For example, a stored non-affine HMVP table may be used as a non-affine HMVP table to generate non-affine candidates (such as for merge or AMVP mode). d. For example, a stored affine HMVP table may be used as an affine HMVP table to generate affine candidates (such as for affine merge or affine AMVP mode). e. In one example, the entries in the storage table and the online table may be checked in sequence to generate a sequence of new candidates. i. In one example, entries in the online table may be checked before all entries in the stored table. ii. In one example, entries in the storage table may be checked before all entries in the online table. iii. For example, the kth entry in the stored table may be checked after the kth entry in the online table. iv. For example, the kth entry in the online table may be checked after the kth entry in the stored table. v. For example, the kth entry in the online table may be checked after all mth entries in the storage table, m = 0...S, where S is an integer. vi. For example, the kth entry in the storage table may be checked after all mth entries in the online table, m = 0...S, where S is an integer. vii. For example, the kth entry in the online table may be checked after all mth entries in the storage table, m = S...maxT, where S is an integer and maxT is the last entry. viii. For example, the kth entry in the storage table may be checked after all mth entries in the online table, m = S . . . maxT, where S is an integer and maxT is the last entry. f. In one example, which stored table is used may depend on the size and / or position of the current block. i. For example, a table stored in a CTU above the current CTU may be used. ii. For example, a table stored in the CTU above and to the left of the current CTU may be used. iii. For example, a table stored in the CTU above and to the right of the current CTU may be used. g. In one example, whether and / or how to use a stored table may depend on the size and / or position of the current block. i. In one example, whether to use a stored table and / or how to use the stored table may depend on whether the current CU is at the top boundary of a CTU and whether an upper adjacent CTU is available. (a) For example, whenever the current CU is at the top boundary of a CTU and an upper adjacent CTU is available, the stored table may be used. (b) For example, if the current CU is at the top boundary of a CTU and an upper adjacent CTU is available, at least one entry in the stored table may be placed at a front position. h. In one example, entries in two stored tables may be checked sequentially to generate new candidates. i. For example, a first (or second) stored table may be used that may be stored in a CTU above the current CTU. ii. For example, the first (or second) stored table that may be stored in the CTU above and to the left of the current CTU may be used. iii. For example, the first (or second) stored table may be used which may be stored in the CTU to the upper right of the current CTU. 49. In one example, the paired affine candidates may be placed into an affine candidate list (eg, merged or AMVP). a. In one example, the affine candidate pairs already in the list can be checked sequentially. i. For example, the indices of the candidate pairs to be checked may be {{0,1},{0,2},{1,2},{0,3},{1,3},{2,3},{0,4},{1,4},{2,4}}. (a) In one example, if the sbTMVP candidate is in the sub-block merge candidate list, the index may be increased by one. (b) In one example, the order of a pair can be swapped, for example both (0,1) and (1,0) can be checked. b. In one example, a new candidate can be generated from a pair of two existing candidates. i. In one example, CPMV k new =SignShift(CPMV k p1 +CPMV k p2,1) or SignShift(CPMV k p1 +CPMV k p2 , 1), where CPMV k new Is a new candidate for CPMV and CPMV k p1 , CPMV k p2 is the corresponding CPMV for two pairing candidates. For example, k=0, 1, 2. ii. In one example, CPMV 0 new =CPMV0 p 1 and / or CPMV 1 new =CPMV 0 p1 +CPMV 1 p2 -CPMV 0 p2 and / or CPMV 2 new =CPMV 0 p1 +CPMV 2 p2 -CPMV 0 p2 . c. In one example, how to generate a new candidate may depend on the inter-direction (such as L0uni, L1uni, or bi) and / or the reference list / index of the two existing candidates. i. In one example, a new candidate remains L0 inter prediction only if both existing candidates remain L0 inter prediction (L0uni or bi). (a) In one example, only when two existing candidates have the same reference picture (reference index) in the L0 reference list, The new candidate remains L0 inter prediction. ii. In one example, the new candidate remains L1 inter prediction only if both existing candidates remain L1 inter prediction (L1 uni or bi). (a) In one example, a new candidate remains L1 inter-prediction only if the existing candidate has the same reference picture (reference index) in the L1 reference list. iii. In one example, a new candidate is bi-predicted only if both existing candidates are bi-predicted. (a) In one example, a new candidate is bidirectionally predicted only when two existing candidates have the same reference picture (reference index) in the L0 reference list and they have the same reference picture (reference index) in the L1 reference list. 50. In one example, the candidates in the affine merge list (or sub-block merge list), which may include the new affines disclosed in this document, may be reordered after construction. a. In one example, candidates may be reordered based on at least one cost. i. For example, the cost may include the sum of the differences between samples of the template for the current block and at least one reference template. ii. For example, the cost may include the sum of differences between samples of the sub-template of at least one sub-block of the current block and at least one reference sub-template. 51. In one example, whether and / or how to reorder the affine (sub-block) or non-affine candidate list may depend on codec information, such as derived or parsed candidate indices and whether sub-block based TMVP (sbTMVP) is enabled. a. In one example, if the derived or parsed candidate index indicates that the selected candidate is an sbTMVP candidate, the sub-block merging candidates may not be reordered. 52. In one example, when a new affine or non-affine candidate disclosed in this document is placed into an affine or non-affine candidate list, it is compared with at least one candidate already in the candidate list. a. In one example, it is compared to every candidate already in the candidate list. b. In one example, if a new candidate is determined to be the same as or "similar" to at least one candidate already in the candidate list, the new candidate may not be placed into the list. c. In one example, two candidates may be determined to be similar or dissimilar based on comparing their underlying MVs and / or affine models, either individually or jointly. i. In one example, the base MV may be set to a CPMV, such as the CPMV at the upper left corner. ii. In one example, if two candidate basic MVs (denoted as MV1 and MV2) are not similar, then the two candidates are determined to be dissimilar. (a) For example, if |MV 1 x-MV 2 If x|>=Thx, then the two basic MVs are not similar. Thx is a threshold value such as 1. (b) For example, if |MV 1 y-MV 2y|>=Thx, then the two basic MVs are not similar. Thy is a threshold value such as 1. iii. In one example, if two candidate affine models (denoted as If {a1, b1, c1, d1} and {a2, b2, c2, d2} are not similar, then the two candidates are determined to be dissimilar. (a) For example, if |a 1 -a 2 |>=Tha, then the two affine models are not similar. Tha is a threshold value such as 1. (b) For example, if |b 1 -b 2 |>=Thb, then the two affine models are not similar. Thb is a threshold value such as 1. (c) For example, if |c 1 -c 2 |>=Thc, then the two affine models are not similar. Thc is a threshold value such as 1. (d) For example, if |d 1 -d 2 |>=Thd, then the two affine models are not similar. Thd is a threshold value such as 1. (e) In one example, consider that the affine model can be derived from CPMV as The similarity of affine models can also be reinterpreted as the similarity of CPMVs. Suppose two candidate CPMVs are {MV0 1 , MV1 1 , MV2 1} and {MV0 2 , MV1 2 , MV2 2}, and the width and height of the current block are w and h. (f) For example, if |(MV1x 1 -MV0x 1 )-(MV1x 2 - MV0x 2 )|>=Tha*w, then the two affine models are not similar. (g) For example, if |(MV1y 1 -MV0y 1 )-(MV1y 2 - MV0Y 2 )|>=Thb*w, then the two affine models are not similar. (h) For example, if |(MV2x 1 -MV0x 1 )-(MV2x 2 - MV0x 2 )|>=Thc*w, then the two affine models are not similar. (i) For example, if |(MV2y 1 -MV0y 1 )-(MV2y 2 - MV0Y 2 )|>=Thd*w, then the two affine models are not similar. iv. The threshold (e.g., Thx or Tha) may depend on the codec information, For example, the block size, QP, and encoding / decoding mode of the current block or neighboring blocks. 5. Examples Create a history parameter table (HPT). An entry in 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 supported by the HPT supports up to 5 reference indices. Using the formula, the category of the HPT (denoted as HPTCat) is calculated as HPTCat(RefList,RefIdx)=5×RefList+min(RefIdx,4), Where RefList and RefIdx represent the reference picture list (0 or 1) and the corresponding reference index respectively. For each category, up to two entries can be stored. So there are a total of 20 entries in the HPT. At the beginning of each CTU row, the number of entries for each category is initialized to zero. cur and RefIdx cur After decoding the affine-encoded CU, the affine parameters are used to update the category HPTCat (RefList cur RefIdx cur ) in the . The history parameter based affine candidate (HPAC) is obtained from Figure 27 The MV of the neighboring 4×4 blocks denoted as A0, A1, B0, B1 or B2 in the image and a set of affine parameters stored in the corresponding entries of the HPT are derived. The MV of the neighboring 4×4 blocks is used as the base MV. In a formal way, the MV of the current block at position (x, y) is calculated as follows: Among them (mv h base ,mv vbase ) represents the MV of the adjacent 4×4 block, (x base ,y base ) represents the center position of the neighboring 4×4 block. (x, y) can be the top left corner, top right corner, and bottom left corner of the current block to obtain the corner position MV (CPMV) of the current block. Figure 27 An example of how to derive HPAC from block A0 is shown. The affine parameters {a0, b0, c0, d0} are copied directly from an entry of class HPTIdx(RefListA0, refIdx0A0) in the HPT. The affine parameters from the HPT are used together with the center position of A0 as the base position and the MV of block A0 as the base MV to derive the CPMV of the merged HPAC or AMVP HPAC. The HPAC can be put into the sub-block based merge candidate list, the affine AMVP candidate list. In response to the new HPAC, the size of the sub-block based merge candidate list is increased from 5 to 9.

[0116] As used herein, the terms "video unit" or "codec unit" or "block" used herein may refer to one or more of the following: color component, sub-picture, slice, tile, codec tree unit (CTU), CTU row, CTU group, codec unit (CU), prediction unit (PU), transform unit (TU), codec tree block (CTB), codec block (CB), prediction block (PB), transform block (TB), block, sub-block of a block, sub-region within a block, or region including more than one sample or pixel.

[0117] In the present disclosure, with respect to a “block encoded and decoded in mode N”, the term “mode N” may be a prediction mode (e.g., MODE_INTRA, MODE_INTER, MODE_PLT, MODE_IBC, etc.) or a coding technology (e.g., AMVP, Merge, SMVD, BDOF, PROF, DMVR, AMVR, TM, Affine, CIIP, GPM, MMVD, BCW, HMVP, SbTMVP, etc.).

[0118] It should be noted that the following terms are not limited to the specific terms defined in existing standards, and any variants of codecs are also applicable.

[0119] Figure 28 A flow chart of a method 2800 for video processing according to some embodiments of the present disclosure is shown. The method 2800 may be implemented during conversion between blocks and bitstreams of blocks.

[0120] At block 2810, during conversion between a target block of video and a bitstream of the target block, motion information of neighboring blocks of the target block is determined. In some embodiments, the neighboring blocks include one or more of the following: adjacent neighboring blocks, non-adjacent neighboring blocks, spatial neighboring blocks, or temporal neighboring blocks.

[0121] At block 2820, a motion candidate set for the target block is derived based on the motion information and the set of affine parameters for the target block. In some embodiments, a set of control point motion vectors (CPMVs) may be determined based on the motion information and the set of affine parameters. Alternatively or additionally, a set of motion vectors for the sub-block used for motion compensation may be determined based on the motion information and the set of affine parameters.

[0122] In some embodiments, the set of affine parameters may be stored in a buffer associated with the target block. For example, the motion information of adjacent or non-adjacent spatially or temporally adjacent M×N unit blocks (e.g., 4×4 blocks in VTM) and the set of affine parameters stored in the buffer may be used together to derive an affine model for the current block. For example, they may be used to derive the CPMV or MV of a sub-block for motion compensation.

[0123] At block 2830, a conversion is performed based on the motion candidate set. In some embodiments, the conversion may include encoding the target block into bits. Alternatively, the conversion may include decoding the target block from a bitstream. Compared to conventional solutions, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0124] In some embodiments, the motion vector (MV) in the neighboring block is represented as (mv h 0,mv v 0), derive motion vector (mv h (x,y),mv v The coordinates of the position of the target block (x, y) are represented as (x, y), the coordinates of the upper left corner of the target block are represented as (x0', y0'), the width of the target block is represented as w, and the height of the target block is represented as h. In this case, in order to derive the CPMV, the coordinates (x, y) may be one of the following: (x0', y0'), (x0'+w, y0'), (x0', y0'+h), or (x0'+w, y0'+h).

[0125] In some embodiments, to derive the MV of a sub-block for a target block, the coordinates (x, y) may be the center of the sub-block. In some embodiments, the upper left position of the sub-block may be represented as (x0, y00), and the size of the sub-block may be M×N. In this case, the coordinates (xm, ym) of the center of the sub-block may be one of the following: xm=x00+M / 2, ym=y00+N / 2, xm=x00+M / 2-1, ym=y00+N / 2-1, xm=x00+M / 2-1, ym=y00+N / 2, or xm=x00+M / 2, ym=y00+N / 2-1. In some embodiments, M and N are integers.

[0126] In some embodiments, if the set of affine parameters is from a block encoded in 4-parameter affine mode, then In this case, a and b may be affine parameters. In some embodiments, if the set of affine parameters is from a block encoded in 6-parameter affine mode, then In this case, a, b, c, and d may be affine parameters.

[0127] Alternatively, whether the affine parameter set comes from a block encoded in 4-parameter affine mode or 6-parameter affine mode, In this case, a, b, c, and d may be affine parameters.

[0128] In some embodiments, a set of CPMVs for a target block may be derived from the motion information and the set of affine parameters. The set of CPMVs may be used as a motion vector prediction (MVP) for the indicated CPMV of the target block.

[0129] In some embodiments, a set of CPMVs for a target block may be derived from the motion information and the set of affine parameters. The set of CPMVs may be used to derive the MVs of each sub-block used for motion compensation.

[0130] In some embodiments, if the target block is encoded using affine merge mode, the MV of each sub-block used for motion compensation can be derived from the motion information and the affine parameter sets in the neighboring blocks. In some embodiments, the motion vectors of the neighboring blocks and the affine parameter sets used to derive the motion candidate set follow one or more constraints. The constraints may include one or more of the following: the motion vector and the affine parameter set are associated with the same inter-frame prediction direction, if list 0 is the prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 0, or if list 1 is the prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 1.

[0131] In some embodiments, the affine parameter set is not stored in a buffer associated with the target block. In this case, in some embodiments, the affine parameter set can be derived from an adjacent neighboring block that has been affine-coded. In some embodiments, the affine parameter set can be derived from a non-adjacent neighboring block that has been affine-coded.

[0132] In some embodiments, for a target block that is an affine-encoded block, the affine parameter set may be derived as: In this case, mv0, mv1, and mv2 may represent the CPMV of the neighboring block, w may represent the width of the neighboring block, h may represent the height of the target block, and a, b, c, and d may represent affine parameters. In some embodiments, for a-parameter affine prediction, c=-b and d=a.

[0133] In some embodiments, the affine parameter set may be derived from a set of neighboring blocks that have been inter-coded. In this case, in some embodiments, for a target block that is an affine-coded block, the affine parameter set is derived as: c=-b,d=a,in this case, mv0 and mv1 represent the MVs of two adjacent blocks, a, b, c and d represent affine parameters, and w represents the horizontal distance between the two adjacent blocks. In some embodiments, w is equal to 2k, where k is an integer.

[0134] In some embodiments, for a target block that is an affine-encoded block, the affine parameter set may be derived as: In this case, mv0, mv1, and mv2 may represent MVs of three neighboring blocks, w may represent the horizontal distance between the neighboring blocks associated with mv0 and mv1, h may represent the vertical distance between the neighboring blocks associated with mv0 and mv2, and a, b, c, and d may represent affine parameters. In this case, in some embodiments, w may be equal to 2 k , where k is an integer. Alternatively, h can be equal to 2 k , where k is an integer.

[0135] In some embodiments, the positions of the neighboring block sets may be one or more constraints. The constraints may include one or more of the following: at least one position (e.g., top left) of the neighboring blocks in the sets associated with mv0 and mv1 have the same coordinates in the vertical direction, or at least one position (e.g., top left) of the neighboring blocks in the sets associated with mv0 and mv2 have the same coordinates in the horizontal direction. In this case, mv0, mv1, and mv2 represent motion vectors of the neighboring block sets.

[0136] In some embodiments, the motion vectors of the set of neighboring blocks may satisfy one or more constraints. The constraints may include at least one of the following: the motion vectors of the set of neighboring blocks are associated with the same inter-frame prediction direction (e.g., list 0 or list 1 or Bi), the motion vectors of the set of neighboring blocks are associated with the same reference index for list 0 when list 0 is one of the prediction directions in use, or the motion vectors of the set of neighboring blocks are associated with the same reference index for list 1 when list 1 is one of the prediction directions in use. In some embodiments, the basic block is one of the neighboring blocks in the set of neighboring blocks.

[0137] In some embodiments, the neighboring blocks used to generate the affine parameter set may be checked in a predetermined order. For example, the neighboring blocks may be checked based on their distance to the target block. For example, the neighboring blocks may be checked from closer to the target block to farther away from the target block.

[0138] In some embodiments, the motion vector (MV) in the neighboring block can be represented as (mv h 0,mv v 0), the motion vector (mv h (x,y),mv v In some embodiments, the coordinates of the position of the target block (x, y) are expressed as (x, y), and the coordinates of the upper left corner of the target block can be expressed as (x0', y0'). In this case, the width of the target block can be expressed as w, and the height of the target block can be expressed as h. In some other embodiments, in order to derive the CPMV, the coordinates (x, y) can be one of the following: (x0', y0'), (x0'+w, y0'), (x0', y0'+h) or (x0'+w, y0'+h). In some other embodiments, in order to derive the MV for the sub-block of the target block, the coordinates (x, y) can be the center of the sub-block.

[0139] In some embodiments, the upper left position of the sub-block may be represented as (x00, y00), and the size of the sub-block may be M × N. In this case, the coordinates (xm, ym) of the center of the sub-block may be one of the following: xm=x00+M / 2, ym=y00+N / 2, xm=x00+M / 2-1, ym=y00+N / 2-1, xm=x00+M / 2-1, ym=y00+N / 2, or xm=x00+M / 2, ym=y00+N / 2-1, where M and N are integers.

[0140] In some embodiments, if the set of affine parameters is from a block encoded in 4-parameter affine mode, then In this case, a and b may be affine parameters. In some embodiments, if the set of affine parameters is from a block encoded in 6-parameter affine mode, then In this case, a, b, c and d are affine parameters. Alternatively, whether the set of affine parameters comes from a block coded in 4-parameter affine mode or from a block coded in 6-parameter affine mode, In this case, a, b, c, and d are affine parameters.

[0141] In some embodiments, the CPMV set of the target block can be derived from the motion information and the affine parameter set. In this case, the CPMV set can be used as a motion vector prediction (MVP) for the indicated CPMV of the target block.

[0142] In some embodiments, a set of CPMVs for the target block can be derived from the motion information and the set of affine parameters. In this case, the set of CPMVs can be used to derive the MVs for each sub-block used for motion compensation. In some embodiments, if the target block is encoded or decoded using affine merge mode, the MVs for each sub-block used for motion compensation can be derived from the motion information and the set of affine parameters in the neighboring blocks.

[0143] In some embodiments, the motion vectors of the neighboring blocks and the affine parameter sets used to derive the motion candidate set may be subject to one or more constraints. The constraints may include one or more of the following: the motion vector and the affine parameter set are associated with the same inter-frame prediction direction (e.g., list 0 or list 1 or Bi), if list 0 is the one prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 0, or if list 1 is the one prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 1.

[0144] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: determining motion information of neighboring blocks of a target block of the video; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; and generating a bitstream for the target block based on the motion candidate set.

[0145] In some embodiments, a method for storing a bitstream of a video includes: determining motion information of neighboring blocks of a target block of the video; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; generating a bitstream for the target block based on the motion candidate set; and storing the bitstream in a non-transitory computer-readable recording medium.

[0146] Figure 29 Flowchart of a method 2900 for video processing according to some embodiments of the present disclosure is shown. The method 2900 may be implemented during conversion between block-to-block bitstreams.

[0147] like Figure 29 As shown, at block 2910, multiple types of affine history-based motion vector prediction (HMVP) tables are determined during conversion between a target block of a video and a bitstream of the target block. At block 2920, at least one candidate in a candidate list is derived based on the multiple types of affine HMVP tables. In some embodiments, the candidate list may include one or more of the following: an affine candidate list or a sub-block candidate list. In some embodiments, the affine candidate list may include an affine merge list. Alternatively or additionally, the affine candidate list may include an affine advanced motion vector prediction (AMVP) list.

[0148] At block 2930, conversion is performed based on at least one candidate. In some embodiments, conversion may include encoding the target block into a bitstream. Alternatively, conversion may include decoding the target block from the bitstream. Compared to conventional solutions, embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0149] In some embodiments, the entries in the first type affine HMVP table may store an affine parameter set, basic motion information, and a basic position. In this case, candidates may be derived from the entries in the first type affine HMVP table.

[0150] In some embodiments, a candidate motion vector (MV) may be derived from a set of affine parameters, basic motion information, and a basic position. In this case, the MV may be one of: a control point motion vector (CPMV) or a sub-block MV.

[0151] In some embodiments, if the set of affine parameters is from a block encoded in 4-parameter affine mode, then In this case, (mv h (x,y),mv v (x,y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents a motion vector, (xm, ym) represents the coordinates of the center of a block encoded and decoded in a 4-parameter affine mode, and a and b are affine parameters.

[0152] In some embodiments, if the set of affine parameters is from a block encoded in 6-parameter affine mode, then In this case, (mv h (x,y),mv v (x,y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) denotes a motion vector, (xm, ym) denotes the coordinates of the center of a block encoded in a 4-parameter affine mode, and a, b, c, and d are affine parameters.

[0153] In some embodiments, regardless of whether the affine parameter set comes from a block coded in 4-parameter affine mode or a block coded in 6-parameter affine mode, In this case, (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v (0) represents a motion vector, (xm, ym) represents the coordinates of the center of a block encoded in 4-parameter affine mode, and a, b, c, and d are affine parameters. In some embodiments, (x, y) represents the position of a corner (such as the top left corner / top right corner / bottom left corner) to derive the corresponding CPMV. In some embodiments, (xy) represents the position of a sub-block to derive the MV for the sub-block.

[0154] In some embodiments, reference picture information (eg, reference index and / or reference list) may be stored together with the corresponding base MV. In some embodiments, inter-frame direction information may be stored in an entry of a first-class affine HMVP table.

[0155] In some embodiments, the inter direction information may include whether the entry corresponds to a bidirectional prediction candidate or a unidirectional prediction candidate. In some embodiments, the inter direction information may include whether the entry corresponds to an L0 prediction candidate or an L1 prediction candidate.

[0156] In some embodiments, the additional motion information may be stored in an entry in the first-class affine HMVP table. For example, the additional motion information may include whether the target block is coded with light compensation (IC). In some embodiments, the additional motion information may include whether the target block is coded with codec unit (CU)-level weighted bidirectional prediction (BCW).

[0157] In some embodiments, the first type affine HMVP table can be updated after encoding / decoding the affine codec block. In some embodiments, the affine parameter set can be generated from the encoded / decoded affine codec block from the CPMV. In some embodiments, the base MV and corresponding base position are generated from the encoded / decoded affine codec block as a CPMV and corresponding corner position (such as the upper left CPMV and the upper left position).

[0158] In some embodiments, an entry with an affine parameter set, a basic MV, and a corresponding basic position generated from an encoded / decoded affine codec block can be placed in a first-class affine HMVP table. In some embodiments, a similarity or identical check can be applied before a new entry is inserted into the first-class affine HMVP table. For example, if two entries have at least one of the same inter-frame direction, the same reference picture, or the same affine parameters for the same reference picture, the two entries are considered identical. In some embodiments, if a new entry is identical to an existing entry, the new entry may not be placed in the first-class affine HMVP table. The existing entry can be placed in the latest position in the first-class affine HMVP table.

[0159] In some embodiments, an entry in the second type affine HMVP table may store at least one set of affine parameters. In some embodiments, the at least one set of affine parameters may be used with at least one base MV and a base position derived from at least one neighboring block.

[0160] In some embodiments, the first and second affine HMVP tables can be refreshed in a similar or identical manner. In some embodiments, entries in the affine HMVP tables are sequentially checked to generate new candidates. In one example, entries in the affine HMVP tables (e.g., the first or second table) can be checked sequentially (such as from latest to oldest) to generate new candidates.

[0161] In some embodiments, the entries in the two affine HMVP tables can be checked in a predetermined order to generate new candidates. For example, the entries in the first affine HMVP table can be checked before all the entries in the second affine HMVP table. In some embodiments, the k-th entry in the first affine HMVP table can be checked after the k-th entry in the second affine HMVP table, where k is an integer. In some embodiments, the k-th entry in the second affine HMVP table can be checked after the k-th entry in the first affine HMVP table, where k is an integer. In some embodiments, the k-th entry in the first affine HMVP table can be checked after all m-th entries in the second affine HMVP table, where m is in the range from 0 to S, and k and S are integers. In some embodiments, the k-th entry in the second affine HMVP table can be checked after all m-th entries in the first affine HMVP table, where m is in the range from 0 to S, and k and S are integers. In some embodiments, the kth entry in the first affine HMVP table may be checked after all mth entries in the second affine HMVP table, where m is in the range from S to maxT, k and S are integers, and maxT represents the last entry in the second affine HMVP table. In some embodiments, the kth entry in the second affine HMVP table is checked after all mth entries in the first affine HMVP table, where m is in the range from S to maxT, k and S are integers, and maxT represents the last entry in the second affine HMVP table.

[0162] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: determining multiple types of affine history-based motion vector prediction (HMVP) tables for a target block of the video; deriving at least one candidate in a candidate list based on the multiple types of affine HMVP tables; and generating a bitstream of the target block based on the at least one candidate.

[0163] In some embodiments, a method for storing a bitstream of a video includes: determining multiple types of affine history-based motion vector prediction (HMVP) tables for a target block of the video; deriving at least one candidate in a candidate list based on the multiple types of affine HMVP tables; generating a bitstream of the target block based on the at least one candidate; and storing the bitstream in a non-transitory computer-readable recording medium.

[0164] Figure 30 FIG30 is a flow chart of a method 3000 for video processing according to some embodiments of the present disclosure. The method 3000 may be implemented during conversion between bitstreams of blocks.

[0165] like Figure 30As shown, at block 3010, a history-based motion vector prediction (HMVP) table for a target block is determined during conversion between a target block of a video and a bitstream of the target block. At block 3020, the HMVP table is stored after encoding / decoding the region. In one example, the HMVP table or affine HMVP table stored after encoding / decoding the region (such as a CU / CTU / CTU row) is referred to as a stored table.

[0166] At block 3030, conversion is performed based on the stored HMVP table. In some embodiments, the conversion may include encoding the target block into a bitstream. Alternatively, the conversion may include decoding the target block from the bitstream. Compared to conventional solutions, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0167] In some embodiments, the HMVP table may include an affine HMVP table. In some embodiments, the HMVP table may include at least one of the following: a first type affine HMVP table or a second type affine HMVP table.

[0168] In some embodiments, the HMVP table maintained for the target block can be used together with the stored HMVP table. In some embodiments, the stored non-affine HMVP table can be used as the non-affine HMVP table to generate non-affine candidates. In some embodiments, the stored affine HMVP table can be used as the affine HMVP table to generate affine candidates.

[0169] In some embodiments, entries in the stored table and entries in the online table may be checked in a predetermined order to generate new candidates. In some embodiments, entries in the online table may be checked before all entries in the stored table. In some embodiments, entries in the stored table may be checked before all entries in the online table. In some embodiments, the kth entry in the stored table may be checked after the kth entry in the online table, where k is an integer. In some embodiments, the kth entry in the online table may be checked after the kth entry in the stored table, where k is an integer. In some embodiments, the kth entry in the online table may be checked after all mth entries in the stored table, where m is in the range from 0 to S, and k and S are integers. In some embodiments, the kth entry in the stored table may be checked after all mth entries in the online table, where m is in the range from 0 to S, and k and S are integers. In some embodiments, the kth entry in the online table may be checked after all mth entries in the stored table, where m is in the range from S to maxT, where S and k are integers, and maxT is the last entry in the stored table. In some embodiments, the kth entry in the stored table is checked after all mth entries in the online table, where m is in the range from S to maxT, S and k are integers, and maxT is the last entry in the stored table.

[0170] In some embodiments, the stored table to be used may depend on at least one of the following: the size or position of the target block. For example, a table stored in a coding tree unit (CTU) above the current CTU may be used. In some embodiments, a table stored in a CTU above and to the left of the current CTU may be used. In some embodiments, a table stored in a CTU above and to the right of the current CTU may be used.

[0171] In some embodiments, whether to use the stored table and / or the process of using the stored table may depend on at least one of the following: the size or position of the target block. In one example, whether to use the stored table and / or how to use the stored table may depend on the size and / or position of the current block.

[0172] In some embodiments, whether to use the stored table and / or the process of using the stored table depends on whether the current CU is at the top boundary of the CTU and whether the upper adjacent CTU is available. In one example, whether to use the stored table and / or how to use the stored table may depend on whether the current CU is at the top boundary of the CTU and whether the upper adjacent CTU is available.

[0173] In some embodiments, if the current CU is at the top boundary of a CTU and an upper adjacent CTU is available, the stored table may be used. In some embodiments, if the current CU is at the top boundary of a CTU and an upper adjacent CTU is available, at least one entry in the stored table may be placed at a more forward position.

[0174] In some embodiments, the entries in the two stored tables may be checked in a predetermined order to generate new candidates. In some embodiments, the first stored table or the second stored table stored in the CTU above the current CTU may be used. In some embodiments, the first stored table or the second stored table stored in the CTU above the left of the current CTU may be used. In some embodiments, the first stored table or the second stored table stored in the CTU above the right of the current CTU may be used.

[0175] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: determining a history-based motion vector prediction (HMVP) table for a target block of the video; storing the HMVP table after encoding / decoding a region; and generating a bitstream for the target block based on the stored HMVP table.

[0176] In some embodiments, a method for storing a bitstream of a video includes: determining a history-based motion vector prediction (HMVP) table for a target block of the video; storing the HMVP table after encoding / decoding a region; generating a bitstream for the target block based on the stored HMVP table; and storing the bitstream in a non-transitory computer-readable recording medium.

[0177] Figure 31 31 is a flowchart of a method for video processing according to some embodiments of the present disclosure. The method 3100 may be implemented during conversion between bitstreams of blocks.

[0178] like Figure 31 As shown in FIG, at block 3110, during conversion between a target block of a video and a bitstream of the target block, a set of affine candidate pairs for the target block is generated. In one example, the paired affine candidates can be placed into an affine candidate list (e.g., a merge or AMVP).

[0179] At block 3120, a conversion is performed based on the affine candidate list comprising the set of candidate pairs. In some embodiments, the conversion may include encoding the target block into a bitstream. Alternatively, the conversion may include decoding the target block from the bitstream. Compared to conventional solutions, some embodiments of the present disclosure may advantageously improve codec efficiency, codec performance, and flexibility.

[0180] In some embodiments, before adding the set of candidate pairs to the affine candidate list, the affine candidate pairs already in the affine candidate list may be checked in a predetermined order. In some embodiments, the index of the affine candidate pairs to be checked may be {{0,1}, {0,2}, {1,2}, {0,3}, {1,3}, {2,3}, {0,4}, {1,4}, {2,4}}. In this case, in some embodiments, if the sub-block based temporal motion vector prediction (sbTMVP) candidate is in the sub-block merge candidate list, the index of the affine candidate pair may be increased by one. In some embodiments, the order of the affine candidate pairs is swapped. In one example, the order of a pair may be swapped, for example, both (0,1) and (1,0) may be checked.

[0181] In some embodiments, a new candidate can be generated from a pair of two existing candidates. For example, CPMMKnew = SignShift(CPMMVkp1 + CPMMVkp2, 1) or SignShift(CPMMVkp1 + CPMMVkp2, 1), where CPMMVknew is the CPMV of the new candidate and CPMMVkp1, CPMMVkp2 are the corresponding CPMVs for the two paired candidates. In some embodiments, CPMVOnew = CPMV0pl. In some embodiments, CPMMV1new = CPMV0p1 + CPMMV1p2 - CPMV0p2. In some embodiments, CPMV2new = CPMV0p1 + CPMV2p2 - CPMV0p2. In this case, CPMMVknew is the CPMV of the new candidate, and CPMMV0p1, CPMMV1p1, CPMV0p2, and CPMV1p2 are the corresponding CPMVs for the two paired candidates.

[0182] In some embodiments, a new candidate may be generated based on at least one of the following: the inter direction of two existing candidates (such as L0uni, L1uni, or bi), or the reference lists or indices of two existing candidates. For example, the new candidate may include an L0 inter prediction only if both existing candidates include an L0 inter prediction (L0uni or bi). In some embodiments, the new candidate may include an L0 inter prediction only if the two existing candidates have the same reference picture or reference index in the L0 reference list. In some embodiments, the new candidate may include an L1 inter prediction only if both existing candidates include an L1 inter prediction. In some embodiments, the new candidate may include an L1 inter prediction only if the two existing candidates have the same reference picture or reference index in the L1 reference list.

[0183] In some embodiments, a new candidate may be bidirectionally predicted only if both existing candidates are bidirectionally predicted. In this case, a new candidate may be bidirectionally predicted only if both existing candidates have the same reference picture or reference index in the L0 reference list and both existing candidates have the same reference picture or reference index in the L1 reference list.

[0184] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device, the method comprising: generating a set of affine candidate pairs for a target block of the video; and generating a bitstream for the target block based on an affine candidate list including the set of candidate pairs.

[0185] In some embodiments, a method for storing a bitstream of a video includes: generating a set of affine candidate pairs for a target block of the video; generating a bitstream of the target block based on an affine candidate list including the set of candidate pairs; and storing the bitstream in a non-transitory computer-readable recording medium.

[0186] Figure 32 Flowchart of a method 3200 for video processing according to some embodiments of the present disclosure is shown. The method 3200 may be implemented during conversion between block-to-block bitstreams.

[0187] like Figure 32 As shown, at block 3210, during the conversion between the target block of the video and the bitstream of the target block, a merge list including a candidate set is constructed. In some embodiments, at least one candidate in the candidate set can be generated based on the motion information and affine parameter set of the neighboring blocks of the target block. That is, the candidate set can be generated based on the reference block. Figure 28-31 One or more methods are described to generate at least one candidate.

[0188] At block 3220, the set of candidates is reordered after construction of the merge list. In one example, the candidates in the affine merge list (or sub-block merge list), which may include the new affines disclosed in this document, may be reordered after construction.

[0189] At block 3230, conversion is performed based on the reordered candidate set. In some embodiments, conversion may include encoding the target block into a bitstream. Alternatively, conversion may include decoding the target block from the bitstream. Compared to conventional solutions, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0190] In some embodiments, at least one candidate in the candidate set may be generated based on motion information of neighboring blocks of the target block and a set of affine parameters. In some embodiments, the candidate set is reordered based on at least one cost. For example, the at least one cost may include one or more of the following: a sum of differences between samples of a template for the target block and at least one reference template, or a sum of differences between samples of a sub-template for at least one sub-block of the target block and at least one reference sub-template.

[0191] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: constructing a merge list including a candidate set of target blocks for the video; reordering the candidate set after constructing the merge list; and generating a bitstream based on the reordered candidate set.

[0192] In some embodiments, a method for storing a bitstream of a video includes: constructing a merge list including a candidate set of target blocks for the video; reordering the candidate set after construction of the merge list; generating a bitstream based on the reordered candidate set; and storing the bitstream in a non-transitory computer-readable recording medium.

[0193] Figure 33 Flowchart of a method 3300 for video processing according to some embodiments of the present disclosure is shown. The method 3300 may be implemented during conversion between bitstreams of blocks.

[0194] like Figure 33 As shown, at block 3310, during conversion between a target block of a video and a bitstream of the target block, a determination is made as to whether to reorder a candidate list and / or a process for reordering the candidate list based on codec information of the target block. The candidate list includes one or more of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list. In one example, whether to reorder an affine (sub-block) or non-affine candidate list and / or how to reorder an affine (sub-block) or non-affine candidate list may depend on codec information, such as derived or parsed candidate indexes and whether sub-block-based TMVP (sbTMVP) is enabled.

[0195] At block 3320, conversion is performed based on the determination. In some embodiments, conversion may include encoding the target block into a bitstream. Alternatively, conversion may include decoding the target block from the bitstream. Compared to conventional solutions, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0196] In some embodiments, the encoding information includes at least one of: a derived candidate list, a parsed candidate index, or whether sub-block based temporal motion vector prediction (sbTMVP) is enabled.

[0197] In some embodiments, if the derived candidate index or the parsed candidate index indicates that the selected candidate is a sbTMVP candidate, the sub-block merge candidates may not be reordered.

[0198] In some embodiments, a non-transitory computer-readable recording medium stores a video bitstream generated by a method performed by a video processing device. The method includes: determining whether to reorder a candidate list and / or reordering the candidate list based on codec information of a target block of the video, wherein the candidate list includes at least one of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; and generating a bitstream based on the determination.

[0199] In some embodiments, a method for storing a bitstream of a video includes: determining whether to reorder a candidate list and / or a process of reordering the candidate list based on codec information of a target block of the video, wherein the candidate list includes at least one of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; generating a bitstream based on the determination; and storing the bitstream in a non-transitory computer-readable recording medium.

[0200] Figure 34 A flow chart of a method 3400 for video processing according to some embodiments of the present invention is shown. The method 3400 may be implemented during conversion between bitstreams from block to block.

[0201] like Figure 34 As shown in FIG, at block 3410, during the conversion between the target block of the video and the bitstream of the target block, a candidate for the target block is generated. In some embodiments, the candidate is generated based on the motion information of the neighboring blocks of the target block and the set of affine parameters. In some embodiments, the candidate can be one of the following: an affine candidate or a non-affine candidate. In some embodiments, the candidate list can be an affine candidate list or a non-affine candidate list. That is, the candidate list can be based on the reference Figure 28-31 Describe one or more methods to generate candidates.

[0202] At block 3420, the candidate is compared to at least one candidate in the candidate list before adding the candidate to the candidate list. In some embodiments, the candidate can be compared to each candidate already in the candidate list.

[0203] At block 3430, a conversion is performed based on the comparison. In some embodiments, the conversion may include encoding the target block into a bitstream. Alternatively, the conversion may include decoding the target block from the bitstream. Compared to conventional solutions, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0204] In some embodiments, if the candidate is determined to be identical to at least one candidate in the candidate list based on the comparison, the candidate may not be added to the candidate list. In some embodiments, determining that two candidates are similar or identical may be based on at least one of the following: a comparison of the base motion vectors (MVs) of the two candidates, or a comparison of the affine models of the two candidates. In some embodiments, the base MV may be a control point motion vector (CPMV).

[0205] In some embodiments, if the base MVs of two candidates are different, then the two candidates are determined to be different. 1 x-MV 2 x|>=Thx, then the basic MVs are not similar, where MV 1 x and MV 2 x represents a base MV, and Thx represents a threshold value. In some embodiments, if |MV 1 y-MV 2 y|>=Thx, then the basic MV is not similar, where MV 1 y and MV 2 y denotes a base MV, and Thy denotes a threshold. In some embodiments, two candidates are dissimilar if their affine models are dissimilar.

[0206] In some embodiments, the affine model of one of the two candidates is represented as {a1, b1, c1, d1}, and the affine model of the other of the two candidates is represented as {a2, b2, c2, d2}. In this case, the two affine models may be different or similar if at least one of the following is satisfied: 1 -a 2 |>=Tha, where Tha represents the threshold, |b 1 -b 2 |>=Thb, where Thb represents the threshold value, |c 1 -c 2 |>=Thc, where Thc represents the threshold value, or |d 1 -d 2 |>=Thd, where Thd represents a threshold value.

[0207] In some embodiments, the affine model can be derived from the CPMV as In this case, the similarity of the affine model can be reinterpreted as the similarity of the CPMV. In some embodiments, two candidate CPMVs are represented as {MV01, MV11, MV21} and {MV02, MV12, MV22}, the width of the target block is represented as w, and the height of the target block is represented as h. In some embodiments, the two affine models are different if at least one of the following is satisfied: |(MV1x1-MV0x1)-(MV1x2-MV0x2)|>=Tha*w, where Tha is a threshold, |(MV1y1-MV0y1)-(MV1y2-MV0y2)|>=Thb*w, where Thb is a threshold, |(MV2x1-MV0x1)-(MV2x2-MV0x2)|>=Thc*w, where Thc is a threshold, or |(MV2y1-MV0y1)-(MV2y2-MV0y2)|>=Thd*w, where Thd is a threshold.

[0208] In some embodiments, the threshold value depends on codec information of the target block. In this case, the codec information includes at least one of the following: block size, quantization parameter (QP), codec mode of the target block, or codec mode of a neighboring block.

[0209] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device, the method comprising: generating a candidate for a target block of the video; comparing the candidate with at least one candidate in a candidate list before adding the candidate to the candidate list; and generating a bitstream based on the comparison.

[0210] In some embodiments, a method for storing a bitstream of a video includes: generating a candidate for a target block of the video; comparing the candidate with at least one candidate in a candidate list before adding the candidate to the candidate list; generating a bitstream based on the comparison; and storing the bitstream in a non-transitory computer-readable recording medium.

[0211] Figure 35 Flowchart of a method 3500 for video processing according to some embodiments of the present disclosure is shown. The method 3500 may be implemented during conversion between block-to-block bitstreams.

[0212] like Figure 35 As shown, at block 3510, during conversion between a target block of a video and a bitstream of the target block, a motion candidate list is determined. The motion candidate list includes at least one non-adjacent affine construction candidate and at least one history-based affine candidate.

[0213] At block 3520, conversion is performed based on the motion candidate list. In some embodiments, conversion may include encoding the target block into a bitstream. Alternatively, conversion may include decoding the target block from the bitstream. Compared to conventional solutions, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0214] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: determining a motion candidate list, the motion candidate list including at least one non-adjacent affine construction candidate and at least one history-based affine candidate; and generating a bitstream based on the motion candidate list.

[0215] In some embodiments, a method for storing a bitstream of a video includes: determining a motion candidate list, the motion candidate list including at least one non-adjacent affine construction candidate and at least one history-based affine candidate; generating a bitstream based on the motion candidate list; and storing the bitstream in a non-transitory computer-readable recording medium.

[0216] Figure 36 Flowchart of a method 3600 for video processing according to some embodiments of the present disclosure is shown. The method 3600 may be implemented during conversion between bitstreams of blocks.

[0217] like Figure 36 As shown in FIG, at block 3610, during conversion between a target block of a video and a bitstream of the target block, a non-adjacent affine candidate is derived based on a parameter set and at least one non-adjacent unit block. The non-adjacent affine candidate is a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate.

[0218] At block 3620, a conversion is performed based on the affine candidate list. The affine candidate list includes non-adjacent affine candidates. In some embodiments, the conversion may include encoding the target block into a bitstream. Alternatively, the conversion may include decoding the target block from the bitstream. Compared to conventional schemes, some embodiments of the present disclosure can advantageously improve codec efficiency, codec performance, and flexibility.

[0219] In some embodiments, a non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a video processing device. The method includes: deriving, for a target block of the video, non-adjacent affine candidates based on a parameter set and at least one non-adjacent unit block, wherein the non-adjacent affine candidates are non-adjacent affine inheritance candidates or non-adjacent affine construction candidates; and generating a bitstream based on an affine candidate list including the non-adjacent affine candidates.

[0220] In some embodiments, a method for storing a bitstream of a video includes: deriving, for a target block of the video, non-adjacent affine candidates based on a parameter set and at least one non-adjacent unit block. The non-adjacent affine candidates are non-adjacent affine inheritance candidates or non-adjacent affine construction candidates. The method also includes generating a bitstream based on the affine candidate list including the non-adjacent affine candidates, and storing the bitstream in a non-transitory computer-readable recording medium.

[0221] Embodiments of the present disclosure may be described in terms of the following clauses, and features of these clauses may be combined in any reasonable way.

[0222] Clause 1. A video processing method, comprising: determining motion information of neighboring blocks of a target block during conversion between a target block of a video and a bitstream of the target block; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; and performing the conversion based on the motion candidate set.

[0223] Clause 2. The method of clause 1, wherein the neighboring blocks comprise at least one of: adjacent neighboring blocks, non-adjacent neighboring blocks, spatial neighboring blocks, or temporal neighboring blocks.

[0224] Clause 3. A method according to Clause 1, wherein deriving the motion candidate set for the target block based on the motion information and the affine parameter set includes: determining a control point motion vector (CPMV) set based on the motion information and the affine parameter set; or determining a motion vector set of a sub-block for motion compensation.

[0225] Clause 4. The method of any of clauses 1-3, wherein the set of affine parameters is stored in a buffer associated with the target block.

[0226] Clause 5. The method of clause 4, wherein the motion vector (MV) in the neighboring block is represented as (mv h 0,mv v 0), derive the motion vector (mv h (x,y),mv v (x, y)), the coordinates of the position of the target block are represented as (x, y), the coordinates of the upper left corner of the target block are represented as (x0', y0'), the width of the target block is represented as w, and the height of the target block is represented as h.

[0227] Clause 6. The method of clause 5, wherein for deriving CPMV, the coordinates (x, y) are one of: (x0', y0'), (x0'+w, y0'), (x0', y0'+h), or (x0'+w, y0'+h).

[0228] Clause 7. The method of clause 5, wherein to derive the MV for a sub-block of the target block, the coordinate (x, y) is the center of the sub-block.

[0229] Clause 8. A method according to Clause 5, wherein the upper left position of the sub-block is represented as (x00, y00), the size of the sub-block is M×N, and the coordinates (xm, ym) of the center of the sub-block are one of the following: xm=x00+M / 2, ym=y00+N / 2, xm=x00+M / 2-1, ym=y00+N / 2-1, xm=x00+M / 2-1, ym=y00+N / 2 or xm=x00+M / 2, ym=y00+N / 2-1, where M and N are integers.

[0230] Clause 9. The method of clause 8, wherein if the set of affine parameters is from a block encoded in a 4-parameter affine mode, then and where a and b are affine parameters.

[0231] Clause 10. The method of clause 8, wherein if the set of affine parameters is from a block encoded in a 6-parameter affine mode, then and where a, b, c, and d are affine parameters.

[0232] Clause 11. The method of clause 8, wherein regardless of whether the set of affine parameters is from a block coded in a 4-parameter affine mode or a block coded in a 6-parameter affine mode, and where a, b, c, and d are affine parameters.

[0233] Clause 12. The method of clause 4, wherein the set of CPMVs for the target block is derived from the motion information and the set of affine parameters, and the set of CPMVs is used as a motion vector prediction (MVP) for the indicated CPMV of the target block.

[0234] Clause 13. The method of clause 4, wherein the set of CPMVs for the target block is derived from the motion information and the set of affine parameters, and the set of CPMVs is used to derive the MV of each sub-block for motion compensation.

[0235] Clause 14. The method of clause 4, wherein if the target block is encoded in affine merge mode, the MV of each sub-block used for motion compensation is derived from the motion information in the neighboring blocks and the set of affine parameters.

[0236] Clause 15. A method according to clause 4, wherein the motion vector of the neighboring block and the affine parameter set used to derive the motion candidate set comply with at least one of the following constraints: the motion vector and the affine parameter set are associated with the same inter-frame prediction direction, if list 0 is the prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 0, or if list 1 is the prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 1.

[0237] Clause 16. The method of any of clauses 1-3, wherein the set of affine parameters is not stored in a buffer associated with the target block.

[0238] Clause 17. The method of clause 16, wherein the set of affine parameters is derived from an affine-coded adjacent neighboring block, or wherein the set of affine parameters is derived from an affine-coded non-adjacent neighboring block. Clause 18. The method of clause 16, wherein for the target block being an affine-encoded block, the set of affine parameters is derived as: And wherein mv0, mv1, mv2 represent the CPMV of the neighboring blocks, w represents the width of the neighboring blocks, h represents the height of the target block, and a, b, c and d represent affine parameters.

[0239] Clause 19. The method of clause 18, wherein for a-parameter affine prediction, c=-b and d=a.

[0240] Clause 20. The method of clause 16, wherein the set of affine parameters is derived from a set of inter-coded neighboring blocks.

[0241] Clause 21. The method of clause 20, wherein for the target block being an affine-encoded block, the set of affine parameters is derived as: c=-b, d=a, and wherein mv0, mv1 represent MVs of two neighboring blocks, a, b, c and d represent affine parameters, and w represents the horizontal distance between the two neighboring blocks.

[0242] Clause 22. The method of clause 21, wherein w is equal to 2 k , where k is an integer.

[0243] Clause 23. The method of clause 20, wherein for the target block being an affine-encoded block, the set of affine parameters is derived as: And wherein mv0, mv1, mv2 represent the MVs of three neighboring blocks, w represents the horizontal distance between the neighboring blocks associated with mv0 and mv1, h represents the vertical distance between the neighboring blocks associated with mv0 and mv2, and a, b, c and d are affine parameters.

[0244] Clause 24. The method of clause 23, wherein w is equal to 2 k , where k is an integer.

[0245] Clause 25. The method of clause 23, wherein h is equal to 2 k , where k is an integer.

[0246] Clause 26. A method according to Clause 20, wherein the positions of the neighboring block sets satisfy at least one of the following constraints: at least one position of the neighboring blocks in the sets associated with mv0 and mv1 have the same coordinates in the vertical direction, or at least one position of the neighboring blocks in the sets associated with mv0 and mv2 have the same coordinates in the horizontal direction, and wherein mv0, mv1, mv2 represent motion vectors of the neighboring block sets.

[0247] Clause 27. A method according to clause 20, wherein the motion vectors of the set of neighboring blocks satisfy at least one of the following constraints: the motion vectors of the set of neighboring blocks are associated with the same inter-frame prediction direction, when list 0 is the one prediction direction in use, the motion vectors of the set of neighboring blocks are associated with the same reference index for list 0, or when list 1 is the one prediction direction in use, the motion vectors of the set of neighboring blocks are associated with the same reference index for list 1.

[0248] Clause 28. The method of clause 20, wherein the basic block is a neighboring block in the set of neighboring blocks.

[0249] Clause 29. The method of clause 16, wherein neighboring blocks used to generate the set of affine parameters are examined in a predetermined order.

[0250] Clause 30. The method of clause 29, wherein the neighboring blocks are checked based on distance to the target block.

[0251] Clause 31. The method of clause 16, wherein the motion vector (MV) in the neighboring block is represented by (mv h 0,mv v 0), derive the motion vector (mv h (x,y),mv v(x, y)), the coordinates of the position of the target block are represented as (x, y), the coordinates of the upper left corner of the target block are represented as (x0', y0'), the width of the target block is represented as w, and the height of the target block is represented as h.

[0252] Clause 32. The method of clause 31, wherein for deriving CPMV, the coordinates (x, y) are one of: (x0', y0'), (x0'+w, y0'), (x0', y0'+h), or (x0'+w, y0'+h).

[0253] Clause 33. The method of clause 31, wherein to derive the MV for a sub-block of the target block, the coordinate (x, y) is the center of the sub-block.

[0254] Clause 34. A method according to clause 31, wherein the upper left position of the sub-block is represented as (x00, y00), the size of the sub-block is M×N, and the coordinates (xm, ym) of the center of the sub-block are one of the following: xm=x00+M / 2, ym=y00+N / 2, xm=x00+M / 2-1, ym=y00+N / 2-1, xm=x00+M / 2-1, ym=y00+N / 2, or xm=x00+M / 2, ym=y00+N / 2-1, and wherein M and N are integers.

[0255] Clause 35. The method of clause 34, wherein if the set of affine parameters is from a block encoded in a 4-parameter affine mode, then And where a and b are affine parameters.

[0256] Clause 36. The method of clause 34, wherein if the set of affine parameters is from a block encoded in a 6-parameter affine mode, then and where a, b, c, and d are affine parameters.

[0257] Clause 37. The method of clause 34, wherein regardless of whether the set of affine parameters is from a block coded in a 4-parameter affine mode or a block coded in a 6-parameter affine mode, and where a, b, c, and d are affine parameters.

[0258] Clause 38. The method of clause 16, wherein the set of CPMVs for the target block is derived from the motion information and the set of affine parameters, and the set of CPMVs is used as a motion vector prediction (MVP) for the indicated CPMV of the target block.

[0259] Clause 39. The method of clause 16, wherein the set of CPMVs for the target block is derived from the motion information and the set of affine parameters, and the set of CPMVs is used to derive the MV of each sub-block for motion compensation.

[0260] Clause 40. The method of clause 16, wherein if the target block is encoded in affine merge mode, the MV of each sub-block used for motion compensation is derived from the motion information in the neighboring blocks and the set of affine parameters.

[0261] Clause 41. A method according to clause 16, wherein the motion vector of the neighboring block and the affine parameter set used to derive the motion candidate set comply with at least one of the following constraints: the motion vector and the affine parameter set are associated with the same inter-frame prediction direction, if list 0 is a prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 0, or if list 1 is a prediction direction in use, the motion vector and the affine parameter set are associated with the same reference index for list 1.

[0262] Item 42. A method of video processing, comprising: determining multiple types of affine history-based motion vector prediction (HMVP) tables during conversion between a target block of a video and a bitstream of the target block; deriving at least one candidate in a candidate list based on the multiple types of affine HMVP tables; and performing the conversion based on the at least one candidate.

[0263] Clause 43. The method of clause 42, wherein the candidate list comprises at least one of: an affine candidate list or a sub-block candidate list.

[0264] Clause 44. The method of clause 43, wherein the affine candidate list comprises at least one of: an affine merge list or an affine advanced motion vector prediction (AMVP) list.

[0265] Clause 45. The method of clause 42, wherein an entry in the first type affine HMVP table stores a set of affine parameters, basic motion information, and basic positions.

[0266] Clause 46. The method of clause 45, wherein candidates are derived from the entries in the first class affine HMVP table.

[0267] Clause 47. The method of clause 46, wherein the candidate motion vector (MV) is derived from the set of affine parameters, the base motion information, and the base position.

[0268] Clause 48. The method of clause 47, wherein the MV is one of: a control point motion vector (CPMV) or a sub-block MV.

[0269] Clause 49. The method of clause 47, wherein if the set of affine parameters is from a block encoded in a 4-parameter affine mode, then Among them, (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents the motion vector, (xm, ym) represents the coordinates of the center of the block encoded in 4-parameter affine mode, and a and b are affine parameters.

[0270] Clause 50. The method of clause 47, wherein if the set of affine parameters is from a block encoded in a 6-parameter affine mode, then Among them (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents the motion vector, (xm, ym) represents the coordinates of the center of the block encoded in 4-parameter affine mode, and a, b, c, and d are affine parameters.

[0271] Clause 51. The method of clause 47, wherein regardless of whether the set of affine parameters is from a block coded in a 4-parameter affine mode or a block coded in a 6-parameter affine mode, Among them (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents the motion vector, (xm, ym) represents the coordinates of the center of the block encoded in 4-parameter affine mode, and a, b, c, and d are affine parameters.

[0272] Clause 52. The method of any one of clauses 49 to 51, wherein (x, y) represents the position of a corner to derive the corresponding CPMV.

[0273] Clause 53. The method of any one of clauses 49 to 51, wherein (x, y) represents a position of a sub-block to derive the MV for the sub-block.

[0274] Clause 54. The method of clause 45, wherein the reference picture information is stored together with the corresponding base MV.

[0275] Clause 55. The method of clause 45, wherein inter-frame direction information is stored in an entry of the first type affine HMVP table.

[0276] Clause 56. The method of clause 55, wherein the inter direction information comprises whether the entry corresponds to a bi-directional prediction candidate or a uni-directional prediction candidate.

[0277] Clause 57. The method of clause 55, wherein the inter direction information comprises whether the entry corresponds to an L0 prediction candidate or an L1 prediction candidate.

[0278] Clause 58. The method of clause 45, wherein additional motion information is stored in the entry in the first type affine HMVP table.

[0279] Clause 59. The method of clause 58, wherein the additional motion information comprises whether the target block is illumination-compensated IC codec.

[0280] Clause 60. The method of clause 58, wherein the additional motion information comprises whether the target block is coded using codec unit (CU) level bi-directional prediction (BCW).

[0281] Clause 61. The method of clause 45, wherein the first type affine HMVP table is updated after encoding / decoding the affine coded block.

[0282] Clause 62. The method of clause 61, wherein the set of affine parameters is generated from the encoded / decoded affine codec block from CPMV.

[0283] Clause 63. The method of clause 61, wherein a base MV and a corresponding base position are generated from the encoded / decoded affine-encoded block as one CPMV and the corresponding corner position.

[0284] Clause 64. The method of clause 63, wherein an entry with the set of affine parameters generated from the encoded / decoded affine codec block, the base MV, and the corresponding base position is placed into the first type of affine HMVP table.

[0285] Clause 65. The method of clause 45, wherein a similarity or identity check is applied before inserting a new entry into the first type affine HMVP table.

[0286] Clause 66. The method of clause 65, wherein two entries are considered identical if they have at least one of: same inter direction, same reference picture, same affine parameters for the same reference picture.

[0287] Clause 67. The method of clause 65, wherein if the new entry is identical to an existing entry, the new entry is not placed into the first type affine HMVP table.

[0288] Clause 68. The method of clause 67, wherein the...

Claims

1. A video processing method, comprising: During conversion between a target block of a video and a bitstream of the target block, determining motion information of neighboring blocks of the target block; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; as well as The converting is performed based on the motion candidate set.

2. The method according to claim 1, wherein the neighboring blocks include at least one of the following: Adjacent neighboring blocks, Non-adjacent neighboring blocks, Spatially adjacent blocks, or Temporal neighbor blocks.

3. The method according to claim 1, wherein deriving the motion candidate set for the target block based on the motion information and the affine parameter set comprises: determining a set of control point motion vectors (CPMVs) based on the motion information and the set of affine parameters; or A set of motion vectors for the sub-block used for motion compensation is determined.

4. The method according to any one of claims 1-3, wherein the set of affine parameters is stored in a buffer associated with the target block.

5. The method according to claim 4, wherein the motion vector (MV) in the neighboring block is represented as (mv h 0,mv v 0), derive the motion vector (mv h (x,y),mv v The coordinates of the position of the target block are represented as (x, y), the coordinates of the upper left corner of the target block are represented as (x0', y0'), the width of the target block is represented as w, and the height of the target block is represented as h.

6. The method of claim 5, wherein to derive CPMV, the coordinates (x, y) are one of: (x0',y0'), (x0'+w,y0'), (x0',y0'+h), or (x0'+w,y0'+h). 7 . The method of claim 5 , wherein to derive the MV for a sub-block of the target block, the coordinate (x, y) is the center of the sub-block.

8. The method according to claim 5, wherein the upper left position of the sub-block is represented as (x00, y00), the size of the sub-block is M×N, and the coordinates (xm, ym) of the center of the sub-block are one of the following: xm=x00+M / 2,ym=y00+N / 2, xm=x00+M / 2-1, ym=y00+N / 2-1, xm=x00+M / 2-1,ym=y00+N / 2, or xm=x00+M / 2,ym=y00+N / 2-1, Where M and N are integers.

9. The method of claim 8, wherein if the set of affine parameters is from a block encoded in a 4-parameter affine mode, then and where a and b are affine parameters.

10. The method of claim 8, wherein if the set of affine parameters is from a block encoded in a 6-parameter affine mode, then and where a, b, c, and d are affine parameters.

11. The method according to claim 8, wherein no matter the set of affine parameters is from a block encoded in a 4-parameter affine mode or from a block encoded in a 6-parameter affine mode, and where a, b, c, and d are affine parameters.

12. The method according to claim 4, wherein the CPMV set of the target block is derived from the motion information and the affine parameter set, and The CPMV set is used as a motion vector prediction (MVP) for the indicated CPMV of the target block.

13. The method according to claim 4, wherein the CPMV set of the target block is derived from the motion information and the affine parameter set, and The CPMV set is used to derive the MV of each sub-block for motion compensation.

14. The method of claim 4, wherein if the target block is encoded in affine merge mode, the MV of each sub-block used for motion compensation is derived from the motion information in the neighboring blocks and the affine parameter set.

15. The method of claim 4, wherein the motion vectors of the neighboring blocks and the set of affine parameters used to derive the motion candidate set comply with at least one of the following constraints: The motion vector and the set of affine parameters are associated with the same inter-prediction direction, If list 0 is the one prediction direction in use, then the motion vector and the set of affine parameters are associated with the same reference index for list 0, or If list 1 is the one prediction direction in use, then the motion vector and the set of affine parameters are associated with the same reference index for list 1.

16. The method of any one of claims 1-3, wherein the set of affine parameters is not stored in a buffer associated with the target block.

17. The method of claim 16, wherein the set of affine parameters is derived from adjacent neighboring blocks that are affine-coded, or The affine parameter set is derived from non-adjacent neighboring blocks that have been affine-decoded.

18. The method according to claim 16, wherein for the target block being an affine-encoded block, the affine parameter set is derived as: and Wherein mv0, mv1, mv2 represent the CPMV of the neighboring blocks, w represents the width of the neighboring blocks, h represents the height of the target block, and a, b, c and d represent affine parameters.

19. The method of claim 18, wherein for a-parameter affine prediction, c=-b and d=a.

20. The method of claim 16, wherein the set of affine parameters is derived from a set of inter-coded neighboring blocks.

21. The method of claim 20, wherein for the target block being an affine-encoded block, the affine parameter set is derived as: c=-b, d = a, and Wherein mv0, mv1 represent the MVs of two neighboring blocks, a, b, c and d represent affine parameters, and w represents the horizontal distance between the two neighboring blocks.

22. The method of claim 21, wherein w is equal to 2 k , where k is an integer.

23. The method of claim 20, wherein for the target block being an affine-encoded block, the set of affine parameters is derived as: and Wherein mv0, mv1, mv2 represent the MVs of three neighboring blocks, w represents the horizontal distance between the neighboring blocks associated with mv0 and mv1, h represents the vertical distance between the neighboring blocks associated with mv0 and mv2, and a, b, c and d are affine parameters.

24. The method of claim 23, wherein w is equal to 2 k , where k is an integer.

25. The method of claim 23, wherein h is equal to 2 k , where k is an integer.

26. The method of claim 20, wherein the positions of the set of neighboring blocks satisfy at least one of the following constraints: At least one position of the neighboring blocks in the sets associated with mv0 and mv1 has the same coordinate in the vertical direction, or At least one position of the neighboring blocks in the sets associated with mv0 and mv2 has the same coordinate in the horizontal direction, and Wherein mv0, mv1, mv2 represent the motion vectors of the neighboring block set.

27. The method of claim 20, wherein the motion vectors of the set of neighboring blocks satisfy at least one of the following constraints: The motion vectors of the set of neighboring blocks are associated with the same inter-prediction direction, When list 0 is the one prediction direction in use, the motion vectors of the set of neighboring blocks are associated with the same reference index for list 0, or When List 1 is the one prediction direction in use, the motion vectors of the set of neighboring blocks are associated with the same reference index for List 1.

28. The method of claim 20, wherein a basic block is a neighboring block in the set of neighboring blocks.

29. The method of claim 16, wherein neighboring blocks used to generate the set of affine parameters are examined in a predetermined order.

30. The method of claim 29, wherein the neighboring blocks are checked based on a distance to the target block.

31. The method according to claim 16, wherein the motion vector (MV) in the neighboring block is represented by (mv h 0,mv v 0), derive the motion vector (mv h (x,y),mv v The coordinates of the position of the target block are represented as (x, y), the coordinates of the upper left corner of the target block are represented as (x0', y0'), the width of the target block is represented as w, and the height of the target block is represented as h.

32. The method of claim 31, wherein to derive CPMV, the coordinates (x, y) are one of: (x0',y0'), (x0'+w,y0'), (x0',y0'+h), or (x0'+w,y0'+h).

33. The method of claim 31, wherein to derive the MV for a sub-block of the target block, the coordinate (x, y) is the center of the sub-block.

34. The method of claim 31, wherein the upper left position of the sub-block is represented as (x00, y00), the size of the sub-block is M×N, and the coordinates (xm, ym) of the center of the sub-block are one of the following: xm=x00+M / 2,ym=y00+N / 2, xm=x00+M / 2-1,ym=y00+N / 2-1, xm=x00+M / 2-1,ym=y00+N / 2, or xm=x00+M / 2,ym=y00+N / 2-1, Where M and N are integers.

35. The method of claim 34, wherein if the set of affine parameters is from a block encoded in a 4-parameter affine mode, then and where a and b are affine parameters.

36. The method of claim 34, wherein if the set of affine parameters is from a block encoded in a 6-parameter affine mode, then and where a, b, c, and d are affine parameters.

37. The method of claim 34, wherein regardless of whether the set of affine parameters is from a block encoded in a 4-parameter affine mode or from a block encoded in a 6-parameter affine mode, and where a, b, c, and d are affine parameters.

38. The method of claim 16, wherein the CPMV set of the target block is derived from the motion information and the affine parameter set, and The CPMV set is used as a motion vector prediction (MVP) for the indicated CPMV of the target block.

39. The method of claim 16, wherein the CPMV set of the target block is derived from the motion information and the affine parameter set, and The CPMV set is used to derive the MV of each sub-block for motion compensation.

40. The method of claim 16, wherein if the target block is encoded with an affine merge mode, the MV of each sub-block for motion compensation is derived from the motion information in the neighboring blocks and the set of affine parameters.

41. The method of claim 16, wherein the motion vectors of the neighboring blocks and the set of affine parameters used to derive the motion candidate set comply with at least one of the following constraints: The motion vector and the set of affine parameters are associated with the same inter-prediction direction, If list 0 is the one prediction direction in use, then the motion vector and the set of affine parameters are associated with the same reference index for list 0, or If list 1 is the one prediction direction in use, then the motion vector and the set of affine parameters are associated with the same reference index for list 1.

42. A video processing method, comprising: During conversion between a target block of video and a bitstream of the target block, determining a plurality of types of affine history-based motion vector prediction (HMVP) tables; Based on the multiple types of affine HMVP tables, deriving at least one candidate in the candidate list; as well as The converting is performed based on the at least one candidate.

43. The method of claim 42, wherein the candidate list comprises at least one of: an affine candidate list, or Sub-block candidate list.

44. The method of claim 43, wherein the affine candidate list comprises at least one of: Affine merge lists, or Affine Advanced Motion Vector Prediction (AMVP) list.

45. The method of claim 42, wherein an entry in the first type affine HMVP table stores a set of affine parameters, basic motion information, and basic positions.

46. ​​The method of claim 45, wherein candidates are derived from the entries in the first class affine HMVP table.

47. The method of claim 46, wherein the candidate motion vector (MV) is derived from the set of affine parameters, the base motion information and the base position.

48. The method of claim 47, wherein the MV is one of: Control Point Motion Vector (CPMV), or Sub-block MV.

49. The method of claim 47, wherein if the set of affine parameters is from a block encoded in a 4-parameter affine mode, then in, (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents the motion vector, (xm, ym) represents the coordinates of the center of the block encoded in 4-parameter affine mode, and a and b are affine parameters.

50. The method of claim 47, wherein if the set of affine parameters is from a block encoded in a 6-parameter affine mode, then Where (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents the motion vector, (xm, ym) represents the coordinates of the center of the block encoded in 4-parameter affine mode, and a, b, c and d are affine parameters.

51. The method of claim 47, wherein regardless of whether the set of affine parameters is from a block encoded in a 4-parameter affine mode or from a block encoded in a 6-parameter affine mode, Where (mv h (x,y),mv v (x, y)) represents the coordinates of the position where the motion vector is derived, (mv h 0,mv v 0) represents the motion vector, (xm, ym) represents the coordinates of the center of the block encoded in 4-parameter affine mode, and a, b, c and d are affine parameters.

52. A method according to any one of claims 49 to 51, wherein (x, y) represents the position of a corner to derive the corresponding CPMV.

53. The method according to any one of claims 49 to 51, wherein (x, y) represents the position of the sub-block to derive the MV for the sub-block.

54. The method of claim 45, wherein reference picture information is stored together with the corresponding base MV.

55. The method of claim 45, wherein inter-frame direction information is stored in entries of the first type affine HMVP table.

56. The method of claim 55, wherein the inter-frame direction information includes whether the entry corresponds to a bi-directional prediction candidate or a uni-directional prediction candidate.

57. The method of claim 55, wherein the inter-frame direction information includes whether the entry corresponds to an L0 prediction candidate or an L1 prediction candidate.

58. The method of claim 45, wherein additional motion information is stored in the entry in the first type affine HMVP table.

59. The method of claim 58, wherein the additional motion information includes whether the target block is illumination compensated IC codec.

60. The method of claim 58, wherein the additional motion information comprises whether the target block is coded by codec unit (CU) level weighted bi-directional prediction (BCW).

61. The method of claim 45, wherein the first type affine HMVP table is updated after encoding / decoding an affine coded block.

62. The method of claim 61, wherein the set of affine parameters is generated from the encoded / decoded affine codec block from CPMV.

63. The method of claim 61, wherein a base MV and a corresponding base position are generated from the encoded / decoded affine-encoded block as a CPMV and the corresponding corner position.

64. The method of claim 63, wherein an entry with the set of affine parameters generated from the encoded / decoded affine codec block, the base MV and the corresponding base position is placed into the first type affine HMVP table.

65. The method of claim 45, wherein a similarity or identity check is applied before inserting a new entry into the first type affine HMVP table.

66. The method of claim 65, wherein two entries are considered identical if they have at least one of: same inter-direction, same reference picture, same affine parameters for the same reference picture.

67. The method of claim 65, wherein if the new entry is identical to an existing entry, then the new entry is not placed into the first type affine HMVP table.

68. The method of claim 67, wherein the existing entry is placed into a newest position in the first type affine HMVP table.

69. The method of claim 42, wherein entries in the second type affine HMVP table store at least one set of affine parameters.

70. The method of claim 69, wherein the at least one set of affine parameters is used together with at least one base MV and a base position derived from at least one neighboring block.

71. The method of claim 42, wherein the first type affine HMVP table and the second type affine HMVP table are refreshed in the same manner.

72. The method of claim 42, wherein entries in an affine HMVP table are examined in sequence to generate new candidates.

73. The method of claim 42, wherein entries in two affine HMVP tables are examined in sequence to generate new candidates.

74. The method of claim 73, wherein entries in the first affine HMVP table are checked before all entries in the second affine HMVP table.

75. The method of claim 73, wherein the kth entry in the first affine HMVP table is checked after the kth entry in the second affine HMVP table, wherein, k is an integer.

76. The method of claim 73, wherein: The kth entry in the second affine HMVP table is checked after the kth entry in the first affine HMVP table, where k is an integer.

77. The method of claim 73, wherein the kth entry in the first affine HMVP table is checked after all mth entries in the second affine HMVP table, where m is in the range from 0 to S, and k and S are integers.

78. The method of claim 73, wherein the kth entry in the second affine HMVP table is checked after all mth entries in the first affine HMVP table, where m is in the range from 0 to S, and k and S are integers.

79. The method of claim 73, wherein the kth entry in the first affine HMVP table is checked after all mth entries in the second affine HMVP table, where m is in the range from S to maxT, k and S are integers, and maxT represents the last entry in the second affine HMVP table.

80. The method of claim 73, wherein the kth entry in a second affine HMVP table is checked after all mth entries in a first affine HMVP table, where m is in the range from S to maxT, k and S are integers, and maxT represents the last entry in the second affine HMVP table.

81. A video processing method, comprising: During conversion between a target block of video and a bitstream of the target block, determining a history-based motion vector prediction (HMVP) table for the target block; After encoding / decoding the region, storing the HMVP table; The conversion is performed based on the stored HMVP table.

82. The method of claim 81, wherein the HMVP table comprises an affine HMVP table.

83. The method of claim 81, wherein the HMVP table comprises at least one of: An affine HMVP table of the first kind, or Affine HMVP table of the second kind.

84. The method of claim 81, wherein the HMVP table maintained for the target block is used with a stored HMVP table.

85. The method of claim 81, wherein a stored non-affine HMVP table is used as a non-affine HMVP table to generate non-affine candidates.

86. The method of claim 81, wherein a stored affine HMVP table is used as the affine HMVP table to generate affine candidates.

87. The method of claim 81, wherein entries in the stored table and entries in the online table are examined in a predetermined order to generate new candidates.

88. The method of claim 87, wherein entries in the online table are checked prior to all entries in the stored table.

89. The method of claim 87, wherein entries in the stored table are checked prior to all entries in the online table.

90. The method of claim 87, wherein after the kth entry in the online table, the kth entry in the stored table is checked, where k is an integer.

91. The method of claim 87, wherein after the kth entry in the stored table, the kth entry in the online table is checked, where k is an integer.

92. The method of claim 87, wherein after all m-th entries in the stored table, the k-th entry in the online table is checked, where m is in the range from 0 to S, and k and S are integers.

93. The method of claim 87, wherein after all m-th entries in the online table, the k-th entry in the stored table is checked, where m is in the range from 0 to S, and k and S are integers.

94. The method of claim 87, wherein the kth entry in the online table is checked after all mth entries in the stored table, where m is in the range from S to maxT, S and k are integers, and maxT is the last entry in the stored table.

95. The method of claim 87, wherein after all m-th entries in the online table, the k-th entry in the stored table is checked, where m is in the range from S to maxT, S and k are integers, and maxT is the last entry in the stored table.

96. The method of claim 87, wherein the stored table to be used depends on at least one of: a size or a position of the target block.

97. The method of claim 96, wherein the table stored in an edit code tree unit (CTU) above the CTU is used.

98. The method of claim 96, wherein the table stored in the CUT to the upper left of the current CUT is used.

99. The method of claim 96, wherein the table stored in the CUT above and to the right of the current CUT is used.

100. The method of claim 81, wherein whether to use a stored table and / or a process of using a stored table depends on at least one of: a size or a position of the target block.

101. The method of claim 100, wherein whether to use the stored table and / or the process of using the stored table depends on whether the current CU is at a top boundary of a CTU and whether an upper adjacent CTU is available.

102. The method of claim 101, wherein if the current CU is at the top boundary of a CTU and the above neighboring CTU is available, the stored table is used.

103. The method of claim 101, wherein if the current CU is at the top boundary of a CTU and the upper neighboring CTU is available, at least one entry in the stored table is placed to a front position.

104. The method of claim 81 wherein entries in two stored tables are examined in a predetermined order to generate new candidates.

105. The method of claim 104, wherein the first stored table or the second stored table is stored in a CTU above a current CTU in use.

106. The method of claim 104, wherein the first stored table or the second stored table is stored in a CTU to the upper left of a current CTU in use.

107. The method of claim 104, wherein the first stored table or the second stored table is stored in a CTU to the upper right of a current CTU in use. 108.A video processing method: During conversion between a target block of video and a bitstream of the target block, generating a set of affine candidate pairs for the target block; and The transforming is performed based on an affine candidate list including the set of candidate pairs.

109. The method of claim 108, wherein before adding the set of candidate pairs to the affine candidate list, the affine candidate pairs already in the affine candidate list are checked in a predetermined order.

110. The method of claim 109, wherein the indices of the affine candidate pairs to be checked are {{0,1}, {0,2}, {1,2}, {0,3}, {1,3}, {2,3}, {0,4}, {1,4}, {2,4}}.

111. The method of claim 110, wherein if a sub-block based temporal motion vector prediction (sbTMVP) candidate is in the sub-block merge candidate list, the index of the affine candidate pair is incremented by 1.

112. The method of claim 110, wherein the order of the affine candidate pairs is swapped.

113. The method of claim 108, wherein a new candidate is generated from a pair of two existing candidates.

114. The method of claim 113, wherein CPMMVknew=SignShift(CPMMVkp1+CPMMVkp2,1) or SignShift(CPMMVkp1+CPMMVkp2,1), wherein CPMVPknew is the CPMV of the new candidate and CPMMVkp1, CPMMVkp2 are corresponding CPMVs for two paired candidates.

115. The method according to claim 113, wherein CPMV0new=CPMV0p1 and / or Where CPMV1new=CPMV0p1+CPMV1p2-CPMV0p2, and / or Among them, CPMV2new = CPMV0p1 + CPMV2p2 - CPMV0p2, and Wherein CPMMVknew is the CPMV of the new candidate, and CPMMV0p1, CPMMV1p1, CPMV0p2 and CPMV1p2 are the corresponding CPMVs for the two paired candidates.

116. The method of claim 108, wherein the new candidate is generated based on at least one of: The inter direction of two existing candidates, or A reference list or index of the two existing candidates.

117. The method of claim 116, wherein the new candidate includes the L0 inter prediction only when both existing candidates include the L0 inter prediction.

118. The method of claim 117, wherein the new candidate includes the L0 inter prediction only when two existing candidates have the same reference picture or reference index in the L0 reference list.

119. The method of claim 116, wherein the new candidate includes an L1 inter prediction only when both existing candidates include the L1 inter prediction.

120. The method of claim 119, wherein the new candidate includes the L1 inter prediction only when two existing candidates have the same reference picture or reference index in the L1 reference list.

121. The method of claim 116, wherein the new candidate is bi-directionally predicted only when both existing candidates are bi-directionally predicted.

122. The method of claim 121, wherein the new candidate is bi-directionally predicted only if two existing candidates have the same reference picture or reference index in the L0 reference list and two existing candidates have the same reference picture or reference index in the L1 reference list.

123. A video processing method, comprising: During conversion between a target block of video and a bitstream of the target block, constructing a merge list comprising a candidate set; after said construction of said merged list, reordering said candidate set; as well as The converting is performed based on the reordered candidate set.

124. The method of claim 123, wherein at least one candidate in the candidate set is generated based on motion information of a neighboring block of the target block and an affine parameter set.

125. The method of claim 123, wherein the candidate set is reordered based on at least one cost.

126. The method of claim 125, wherein the at least one cost comprises at least one of: The sum of the differences between the template of the target block and the samples of at least one reference template, or The sum of difference values ​​between samples of the sub-template of at least one sub-block of the target block and at least one reference sub-template.

127. A video processing method, comprising: During conversion between a target block of a video and a bitstream of the target block, determining whether to reorder a candidate list and / or a process of reordering the candidate list based on codec information of the target block, wherein the candidate list comprises at least one of the following: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; The converting is performed based on the determination.

128. The method of claim 127, wherein the codec information comprises at least one of: Export candidate list, The resolved candidate index, or Whether sub-block based temporal motion vector prediction (sb TMVP) is enabled.

129. The method of claim 127, wherein if the derived candidate index or the parsed candidate index indicates that the selected candidate is a sbTMVP candidate, sub-block merge candidates are not reordered. 130.A video processing method: During conversion between a target block of a video and a bitstream of the target block, generating a candidate for the target block; Before adding the candidate to the candidate list, comparing the candidate with at least one candidate in the candidate list; as well as The converting is performed based on the comparison.

131. The method of claim 130, wherein the candidate is generated based on motion information and an affine parameter set of neighboring blocks of the target block.

132. The method of claim 130, wherein the candidate is one of: an affine candidate or a non-affine candidate, or The candidate list is an affine candidate list or a non-affine candidate list.

133. The method of claim 130, wherein the candidate is compared to every candidate already in the candidate list.

134. The method of claim 130, wherein if the candidate is determined to be the same as the at least one candidate in the candidate list based on the comparison, the candidate is not added to the candidate list.

135. The method of claim 130, wherein determining that two candidates are the same is based on at least one of: a comparison of base motion vectors (MVs) of the two candidates or a comparison of affine models of the two candidates.

136. The method of claim 135, wherein the base MV is a control point motion vector (CPMV).

137. The method of claim 135, wherein if the basic MVs of the two candidates are not the same, the two candidates are determined to be different.

138. The method of claim 137, wherein if |MV 1 x-MV 2 x|>=Thx, then the basic MVs are different, where MV 1 x and MV 2 x represents a basic MV, and Thx represents a threshold value.

139. The method of claim 137, wherein if |MV 1 y-MV 2 y|>=Thx, then the basic MVs are different, where MV 1 y and MV 2 y represents a basic MV, and Thy represents a threshold value.

140. The method of claim 137, wherein the two candidates are different if the affine models of the two candidates are different.

141. The method according to claim 140, wherein the affine model of one of the two candidates is represented by {a 1 ,b 1 ,c 1 ,d 1 }, and the affine model of the other candidate of the two candidates is represented by and {a 2 ,b 2 ,c 2 ,d 2 },and Two affine models are not identical if at least one of the following is true: |a 1 -a 2 |>=Tha, where Tha represents the threshold value, |b 1 -b 2 |>=Thb, where Thb represents the threshold value, |c 1 -c 2 |>=Thc, where Thc represents a threshold value, or |d 1 -d 2 |>=Thd, where Thd represents a threshold value.

142. The method of claim 140, wherein the affine model is derived from CPMV: and where the similarity of affine models is reinterpreted as the similarity of CPMV, and in, The two candidate CPMVs are denoted as {MV01, MV11, MV21} and {MV02, MV12, MV22}, the width of the target block is denoted as w, and the height of the target block is denoted as h.

143. The method of claim 142, wherein: The two affine models are not identical if at least one of the following is true: |(MV1x1-MV0x1)-(MV1x2-MV0x2)|>=Tha*w, where Tha is the threshold, |(MV1y1-MV0y1)-(MV1y2-MV0y2)|>=Thb*w, where Thb is the threshold value, |(MV2x1-MV0x1)-(MV2x2-MV0x2)|>=Thc*w, where Thc is the threshold, or |(MV2y1-MV0y1)-(MV2y2-MV0y2)|>=Thd*w, where Thd is the threshold.

144. The method of claim 141 or 143, wherein the threshold value depends on codec information of the target block.

145. The method of claim 144, wherein the codec information comprises at least one of: Block size, Quantization Parameter (QP), the encoding and decoding method of the target block; or, The encoding and decoding mode of the adjacent blocks.

146. A video processing method, comprising: During conversion between a target block of a video and a bitstream of the target block, determining a motion candidate list including at least one non-adjacent affine construction candidate and at least one history-based affine candidate; The converting is performed based on the motion candidate list.

147. A video processing method, comprising: During conversion between a target block of a video and a bitstream of the target block, deriving a non-adjacent affine candidate based on a parameter set and at least one non-adjacent unit block, and wherein the non-adjacent affine candidate is a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate; as well as The transforming is performed based on an affine candidate list including the non-adjacent affine candidates.

148. The method of any one of claims 1-147, wherein the converting comprises encoding the target block into the bitstream.

149. The method of any one of claims 1-147, wherein the converting comprises decoding the target block from the bitstream.

150. A device for processing video data, the device comprising a processor and a non-volatile memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to perform a method according to any one of claims 1-149.

151. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform the method of any one of claims 1-149.

152. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: Determine motion information of neighboring blocks of the target block of the video; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; and A bitstream of the target block is generated based on the motion candidate set.

153. A bitstream method for storing video, comprising: Determine motion information of neighboring blocks of the target block of the video; deriving a motion candidate set for the target block based on the motion information and an affine parameter set for the target block; Generate a bitstream of the target block based on the motion candidate set; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

154. A non-transitory computer-readable recording medium storing a bit stream of a video generated by a method performed by a video processing device, wherein: The method comprises: determining a plurality of types of affine history-based motion vector prediction (HMVP) tables for a target block of the video; deriving at least one candidate in a candidate list based on the multiple types of affine HMVP tables; and A bitstream of the target block is generated based on the at least one candidate.

155. A method for storing a bitstream of a video, comprising: determining a plurality of types of affine history-based motion vector prediction (HMVP) tables for a target block of the video; Based on the multiple types of affine HMVP tables, deriving at least one candidate in the candidate list; generating a bitstream of the target block based on the at least one candidate; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

156. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: determining a history-based motion vector prediction (HMVP) table for a target block of the video; After encoding / decoding the region, storing the HMVP table; as well as A bitstream of the target block is generated based on the stored HMVP table.

157. A method for storing a bitstream of a video, comprising: determining a history-based motion vector prediction (HMVP) table for a target block of the video; After encoding / decoding the region, storing the HMVP table; Generate a bitstream of the target block based on the stored HMVP table; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

158. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: generating a set of affine candidate pairs for a target block of the video; as well as A bitstream of the target block is generated based on an affine candidate list including the set of candidate pairs.

159. A method for storing a bitstream of a video, comprising: generating a set of affine candidate pairs for a target block of the video; generating a bitstream of the target block based on an affine candidate list including the set of candidate pairs; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

160. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: constructing a merge list including a candidate set of target blocks for the video; After said construction of said merged list, reordering said candidate set; as well as The bitstream is generated based on the reordered candidate set.

161. A method for storing a bitstream of a video, comprising: constructing a merge list including a candidate set of target blocks for the video; after said construction of said merged list, reordering the candidate set; generating the bitstream based on the reordered candidate set; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

162. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: Determining whether to reorder a candidate list and / or a process of reordering a candidate list based on codec information of a target block of the video, wherein the candidate list comprises at least one of: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; as well as The bitstream is generated based on the determination.

163. A method for storing a bitstream of a video, comprising: Determining whether to reorder a candidate list and / or a process of reordering a candidate list based on codec information of a target block of the video, wherein the candidate list comprises at least one of: an affine candidate list, a sub-block candidate list, or a non-affine candidate list; generating the bitstream based on the determination; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

164. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: generating a candidate for a target block of the video; Before adding the candidate to the candidate list, comparing the candidate with at least one candidate in the candidate list; as well as The bitstream is generated based on the comparison.

165. A method for storing a bitstream of a video, comprising: generating a candidate for a target block of the video; Before adding the candidate to the candidate list, comparing the candidate with at least one candidate in the candidate list; generating the bitstream based on the comparing; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

166. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: determining a motion candidate list including at least one non-adjacent affine construction candidate and at least one history-based affine candidate; as well as The bitstream is generated based on the motion candidate list.

167. A method for storing a bitstream of a video, comprising: determining a motion candidate list including at least one non-adjacent affine construction candidate and at least one history-based affine candidate; generating the bitstream based on the motion candidate list; as well as The bit stream is stored in a non-transitory computer-readable recording medium.

168. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a video processing device, wherein the method comprises: For a target block of the video, deriving a non-adjacent affine candidate based on a parameter set and at least one non-adjacent unit block, wherein the non-adjacent affine candidate is a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate; as well as The bitstream is generated based on an affine candidate list including the non-adjacent affine candidates.

169. A method for storing a bitstream of a video, comprising: For a target block of the video, deriving a non-adjacent affine candidate based on a parameter set and at least one non-adjacent unit block, wherein the non-adjacent affine candidate is a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate; generating the bitstream based on an affine candidate list including the non-adjacent affine candidates; as well as The bit stream is stored in a non-transitory computer-readable recording medium.