Method and device for video processing and medium
By introducing affine model inheritance and historical motion vector prediction in video encoding and decoding technology, the problem of insufficient utilization of video block motion information in the prior art is solved, and a more efficient video encoding and decoding process is achieved.
Patent Information
- Application Number
- CN202380031579.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-28
- Filing Date
- 2023-03-28
- Publication Date
- 2024-12-03
AI Technical Summary
The existing video encoding and decoding technology has shortcomings in improving the encoding and decoding efficiency, especially when dealing with complex motion modes, the traditional method is less efficient and it is difficult to effectively utilize the motion information between video blocks.
A method of inheritance of affine model based on video blocks is proposed. By derive the motion candidates of video units and selecting the position of blocks according to specific rules to improve the encoding and decoding efficiency and performance, and technologies such as affine merging mode and historical motion vector prediction are adopted. , optimize the processing flow of video data.
Through affine model inheritance and historical motion vector prediction technologies, the efficiency and performance of video encoding and decoding are significantly improved, complex motion patterns can be handled more effectively, and bitstream generation and decoding efficiency can be improved.
Smart Images

Figure CN119072924A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate generally to video processing techniques, and more particularly, to history-based affine model inheritance. Background Art
[0002] Nowadays, digital video capabilities are being applied to all aspects of people's lives. For video encoding / decoding, various types of video compression technologies have been proposed, such as MPEG-2, MPEG-4, ITU-T H.263, ITU-TH.264 / MPEG-4 Part 10 Advanced Video Codec (AVC), ITU-T H.265 High Efficiency Video Codec (HEVC) standard, and Versatile Video Codec (VVC) standard. However, it is generally expected that the encoding and decoding efficiency of video encoding and decoding technologies can be further improved. 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: during conversion between a video unit of a video and a bitstream of the video unit, deriving a first motion candidate for the video unit based on a first position of a first block of the video and a second position of a second block, and wherein the first position and the second position satisfy a position condition; and performing conversion based on the first motion candidate and the second motion candidate. The method according to the first aspect of the present disclosure selects the position of the block based on a specific rule instead of checking each block, thereby improving encoding and decoding efficiency and performance.
[0005] In a second aspect, an apparatus for processing video data is provided. The apparatus 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 the method according to the first aspect of the present disclosure.
[0006] In a third aspect, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores instructions for causing a processor to execute the method according to the first aspect of the present disclosure.
[0007] In a fourth aspect, another non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by an apparatus for video processing. The method includes: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video and a second position of a second block of the video, wherein the first position and the second position satisfy a position condition; and generating a bitstream based on the first motion candidate and the second motion candidate.
[0008] In a fifth aspect, a method for storing a bitstream of a video is provided. The method includes: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video and a second position of a second block of the video, wherein the first position and the second position satisfy a position condition; generating a bitstream based on the first motion candidate and the second motion candidate; and storing the bitstream in a non-transitory computer-readable recording medium.
[0009] 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 present disclosure, nor is it intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] 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.
[0011] Figure 1 A block diagram showing an example video encoding and decoding system according to some embodiments of the present disclosure is shown;
[0012] Figure 2 A block diagram of a first example video encoder according to some embodiments of the present disclosure is shown;
[0013] Figure 3 A block diagram of an example video decoder according to some embodiments of the present disclosure is shown;
[0014] Figure 4 Sub-block based prediction is shown;
[0015] Figure 5a-Figure 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;
[0016] Figure 6 The affine MVF of each sub-block is shown;
[0017] Figure 7a-7b The candidates for AF_MERGE are shown;
[0018] Figure 8 Candidate positions of the affine merge pattern are shown;
[0019] Fig. 9 Candidate positions of the affine merge pattern are shown;
[0020] Figure 10a-10b A diagram showing the partitioning of a CU into two triangular prediction units (two partitioning modes) is shown, where Fig.10a A 135 degree division type is shown, Fig.10b A 45 degree division pattern is shown;
[0021] Fig.11 It indicates the position of the neighboring blocks;
[0022] Fig.12 An example of a CU to which a first set of weighting factors is applied is shown;
[0023] Fig.13 An example of motion vector storage is shown.
[0024] Fig.14 shows a decoding flow chart using the proposed HMVP method;
[0025] Fig.15 An example of updating a table in the proposed HMVP method is shown;
[0026] Fig.16 The UMVE search process is shown;
[0027] Fig.17 UMVE search points are shown;
[0028] Fig.18 A distance index and distance offset map are shown;
[0029] Fig.19 An example of deriving a CPMV from the MVs of neighboring blocks and a set of parameters stored in a buffer is shown;
[0030] Fig. 20 A diagram showing examples of possible locations of co-location blocks;
[0031] Fig.21 is a graph representing the positions in a 4×4 basic block;
[0032] Fig. 22 It is shown that the sub-blocks at the right and bottom borders are shaded;
[0033] Figures 23a-23d Possible locations for deriving MVs stored in sub-blocks at the right and bottom borders are shown;
[0034] Fig.24 Possible locations for deriving MV predictions are shown;
[0035] Fig.25a shows the spatial proximity of the affine merge candidates used to derive inheritance, and Fig.25b The spatial proximity used to derive the constructed affine merge candidates is shown;
[0036] Fig.26A schematic diagram showing the process from non-adjacent neighbors to the constructed affine merge candidates;
[0037] Fig.27a and Figure 27b shows an example of the location of blocks according to an example embodiment of the present disclosure;
[0038] Fig.28 shows an example of the location of blocks according to an example embodiment of the present disclosure;
[0039] Fig.29 An example of a HPAC according to an example embodiment of the present disclosure is shown;
[0040] Fig.30 A flowchart showing a method for video processing according to an embodiment of the present disclosure; and
[0041] Fig.31 A block diagram of a computing device is shown in which various embodiments of the present disclosure may be implemented.
[0042] Throughout the drawings, the same or similar reference numbers generally refer to the same or similar elements. DETAILED DESCRIPTION
[0043] The principle of the present disclosure will now be described with reference to some embodiments. It should be understood that these embodiments are described only for the purpose of illustrating and helping those skilled in the art to understand and implement the present disclosure, without implying any limitation on the scope of the present disclosure. In addition to the methods described below, the disclosure described herein can also be implemented in various ways.
[0044] In the following description and claims, unless defined otherwise, all scientific and technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present disclosure belongs.
[0045] References in this disclosure to "one embodiment," "an embodiment," "an example embodiment," etc. indicate that the described embodiment may include a particular feature, structure, or characteristic, but not every embodiment must include the particular feature, structure, or characteristic. Furthermore, these phrases do not necessarily refer to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in conjunction with an example embodiment, whether or not explicitly described, it is considered to be within the knowledge of those skilled in the art to affect such feature, structure, or characteristic in relation to other embodiments.
[0046] It should be understood that although the terms "first" and "second" etc. can be used to describe various elements, these elements should not be limited to these terms. These terms are only used to distinguish one element from another element. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element without departing from the scope of the exemplary embodiments. As used herein, the term "and / or" includes any and all combinations of one or more of the listed terms.
[0047] The terms used herein are only used for the purpose of describing specific embodiments and are not intended to limit the exemplary embodiments. As used herein, the singular forms "a", "an", and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "including", "comprising", and / or "having" when used herein indicate the presence of the features, elements, and / or components, etc., but do not exclude the presence or addition of one or more other features, elements, components, and / or combinations thereof. Example Environment
[0048] Figure 1 1 is a block diagram illustrating an example video codec system 100 that may utilize the techniques of the present disclosure. As shown, the video codec system 100 may include a source device 110 and a destination device 120. The source device 110 may also be referred to as a video encoding device, and the destination device 120 may also be referred to as a video decoding device. In operation, the source device 110 may be configured to generate encoded video data, and the destination device 120 may be configured to decode the encoded video data generated by the source device 110. The source device 110 may include a video source 112, a video encoder 114, and an input / output (I / O) interface 116.
[0049] Video source 112 may include a source such as a video capture device. Examples of a video capture device include, but are not limited to, an interface that receives video data from a video content provider, a computer graphics system for generating video data, and / or combinations thereof.
[0050] The video data may include one or more pictures. The video encoder 114 encodes the video data from the video source 112 to generate a bit stream. The bit stream may include a bit sequence that forms a coded representation of the video data. The bit stream may include a coded picture and associated data. The coded picture is a coded representation of the picture. The associated data may include a sequence parameter set, a picture parameter set, and other grammatical structures. The I / O interface 116 may include a modulator / demodulator and / or a transmitter. The coded video data may be directly transmitted to the destination device 120 via the network 130A via the I / O interface 116. The coded video data may also be stored on a storage medium / server 130B for access by the destination device 120.
[0051] The destination device 120 may include an I / O interface 126, a video decoder 124, and a display device 122. The I / O interface 126 may include a receiver and / or a modem. The I / O interface 126 may obtain encoded video data from the source device 110 or the storage medium / server 130B. The video decoder 124 may decode the encoded video data. The display device 122 may display the decoded video data to the user. The display device 122 may be integrated with the destination device 120, or may be outside the destination device 120, which is configured to be connected to an external display device interface.
[0052] 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.
[0053] Figure 2 is a block diagram showing an example of a video encoder 200 according to some embodiments of the present disclosure, which may be Figure 1 An example of a video encoder 114 in the system 100 is shown.
[0054] Video encoder 200 may be configured to implement any or all of the techniques of this disclosure. Figure 2 In the example of , video encoder 200 includes multiple functional components. The techniques described in this disclosure can be shared between the various components of video encoder 200. In some examples, a processor can be configured to perform any or all of the techniques described in this disclosure.
[0055] 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.
[0056] In other examples, the video encoder 200 may include more, fewer, or different functional components. In one example, the prediction unit 202 may include an intra-block copy (IBC) unit. The IBC unit may perform prediction in an IBC mode, where at least one reference picture is a picture where the current video block is located.
[0057] Furthermore, although some components (such as the motion estimation unit 204 and the motion compensation unit 205) may be integrated, for the purpose of explanation, these components are described in detail below. Figure 2are shown separately in the example.
[0058] 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.
[0059] The mode selection unit 203 may select one of a plurality of codec modes (intra-frame coding or inter-frame coding), for example, based on the error result, and provide the generated intra-frame codec block or inter-frame codec block to the residual generation unit 207 to generate residual block data, and to the reconstruction unit 212 to reconstruct the codec block for use as a reference picture. In some examples, the mode selection unit 203 may select a combination of intra-frame and inter-frame prediction (CIIP) modes, where the prediction is based on an inter-frame prediction signal and an intra-frame prediction signal. In the case of inter-frame prediction, the mode selection unit 203 may also select a resolution for the motion vector (e.g., sub-pixel precision or integer pixel precision) for the block.
[0060] To perform inter-frame prediction on the current video block, the motion estimation unit 204 may generate motion information for the current video block by comparing the current video block with one or more reference frames from the buffer 213. The motion compensation unit 205 may determine a predicted video block for the current video block based on the motion information and decoded samples of pictures from the buffer 213 other than the picture associated with the current video block.
[0061] The motion estimation unit 204 and the motion compensation unit 205 may perform different operations on the current video block, for example, depending on whether the current video block is in an I slice, a P slice, or a B slice. As used herein, an "I slice" may refer to a portion of a picture consisting of macroblocks, all of which are based on macroblocks within the same picture. Furthermore, as used herein, in some aspects, a "P slice" and a "B slice" may refer to a portion of a picture consisting of macroblocks that are independent of macroblocks in the same picture.
[0062] In some examples, the motion estimation unit 204 may perform unidirectional prediction on the current video block, and the motion estimation unit 204 may search the reference pictures of list 0 or list 1 to find the reference video block for the current video block. The motion estimation unit 204 may then generate a reference index and a motion vector, the reference index indicating the reference picture in list 0 or list 1 containing the reference video block, and the motion vector indicating the spatial displacement between the current video block and the reference video block. The motion estimation unit 204 may output the reference index, the prediction direction indicator, and the motion vector as the motion information of the current video block. The motion compensation unit 205 may generate a predicted video block for the current video block based on the reference video block indicated by the motion information of the current video block.
[0063] Alternatively, in other examples, the motion estimation unit 204 may perform bidirectional prediction on the current video block. The motion estimation unit 204 may search the reference pictures in list 0 for a reference video block for the current video block, and may also search the reference pictures in list 1 for another reference video block for the current video block. The motion estimation unit 204 may then generate a plurality of reference indexes and a plurality of motion vectors, the plurality of reference indexes indicating a plurality of reference pictures in list 0 and list 1 containing a plurality of reference video blocks, and the plurality of motion vectors indicating a plurality of spatial displacements between the plurality of reference video blocks and the current video block. The motion estimation unit 204 may output the plurality of reference indexes and the plurality of motion vectors of the current video block as motion information of the current video block. The motion compensation unit 205 may generate a predicted video block for the current video block based on the plurality of reference video blocks indicated by the motion information of the current video block.
[0064] In some examples, motion estimation unit 204 may output a complete set of motion information for use in a decoding process by a decoder. Alternatively, in some embodiments, motion estimation unit 204 may signal motion information of a current video block with reference to motion information of another video block. For example, motion estimation unit 204 may determine that motion information of a current video block is sufficiently similar to motion information of a neighboring video block.
[0065] In one example, motion estimation unit 204 may indicate to video decoder 300 a value in a syntax structure associated with the current video block that indicates that the current video block has the same motion information as another video block.
[0066] 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.
[0067] 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.
[0068] The intra prediction unit 206 may perform intra prediction on the current video block. When the intra prediction unit 206 performs intra prediction on the current video block, the intra prediction unit 206 may generate prediction data for the current video block based on decoded samples of other video blocks in the same picture. The prediction data for the current video block may include a prediction video block and various syntax elements.
[0069] The residual generation unit 207 may generate residual data for the current video block by subtracting (e.g., indicated by a minus sign) the prediction video block(s) of the current video block from the current video block. The residual data of the current video block may include residual video blocks corresponding to different sample portions of samples in the current video block.
[0070] In other examples, such as in skip mode, there may be no residual data for the current video block for the current video block, and the residual generation unit 207 may not perform a subtraction operation.
[0071] 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.
[0072] 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.
[0073] The inverse quantization unit 210 and the inverse transform unit 211 may apply inverse quantization and inverse transform to the transform coefficient video block, respectively, to reconstruct a residual video block from the transform coefficient video block. The reconstruction unit 212 may add the reconstructed residual video block to corresponding samples from one or more prediction video blocks generated by the prediction unit 202 to generate a reconstructed video block associated with the current video block for storage in the buffer 213.
[0074] After reconstruction unit 212 reconstructs the video block, a loop filtering operation may be performed to reduce video blocking artifacts in the video block.
[0075] 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.
[0076] Figure 3 is a block diagram showing an example of a video decoder 300 according to some embodiments of the present disclosure, which may be Figure 1 An example of a video decoder 124 in the system 100 is shown.
[0077] Video decoder 300 may be configured to perform any or all of the techniques of this disclosure. Figure 3In the example of , video decoder 300 includes multiple functional components. The techniques described in this disclosure can be shared between the various components of video decoder 300. In some examples, a processor can be configured to perform any or all of the techniques described in this disclosure.
[0078] exist Figure 3 In the example of , the video decoder 300 includes an entropy decoding unit 301, a motion compensation unit 302, an intra prediction unit 303, an inverse quantization unit 304, an inverse transform unit 305, and a reconstruction unit 306 and a buffer 307. In some examples, the video decoder 300 can perform a decoding process that is generally opposite to the encoding process described with respect to the video encoder 200.
[0079] 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, the motion information including motion vectors, motion vector precision, reference picture list indexes, and other motion information. The motion compensation unit 302 can determine the information, for example, by performing AMVP and merge mode. AMVP is used, including deriving several most likely candidates based on data and reference pictures of adjacent PBs. The motion information typically includes horizontal and vertical motion vector displacement values, one or two reference picture indexes, and in the case of prediction areas in B strips, also includes an identification of which reference picture list is associated with each index. As used herein, in some aspects, "merge mode" may refer to deriving motion information from blocks that are adjacent in space or time.
[0080] 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.
[0081] 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.
[0082] The motion compensation unit 302 may use at least part of the syntax information to determine the size of blocks used to encode (multiple) frames and / or (multiple) slices of the encoded video sequence, partition information describing how each macroblock of a picture of the encoded video sequence is partitioned, a mode indicating how each partition is encoded, one or more reference frames (and reference frame lists) for each inter-frame coding block, and other information for decoding the encoded video sequence. As used herein, in some aspects, a "slice" may refer to a data structure that can be decoded independently of other slices of the same picture in terms of entropy coding, signal prediction, and residual signal reconstruction. A slice may be an entire picture, or it may be a region of a picture.
[0083] The intra prediction unit 303 may use, for example, an intra prediction mode received in the bitstream to form a prediction block from spatially neighboring blocks. The inverse quantization unit 304 inverse quantizes (i.e., dequantizes) the quantized video block coefficients provided in the bitstream and decoded by the entropy decoding unit 301. The inverse transform unit 305 applies an inverse transform.
[0084] The reconstruction unit 306 may obtain the decoded block, for example, by adding the residual block to the corresponding prediction block generated by the motion compensation unit 302 or the intra prediction unit 303. If necessary, a deblocking filter may also be applied to filter the decoded block to remove blocking artifacts. The decoded video block is then stored in a buffer 307, which provides reference blocks for subsequent motion compensation / intra prediction, and the buffer 307 also generates the decoded video for presentation on a display device.
[0085] Some example embodiments of the present disclosure will be described in detail below. It should be noted that the section titles used in this document are for ease of understanding, rather than limiting the embodiments disclosed in the 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 coding and decoding technologies. In addition, although some embodiments describe the video encoding steps in detail, it should be understood that the corresponding decoding steps of canceling the encoding will be implemented by the decoder. In addition, the term video processing includes video coding or compression, video decoding or decompression, and video transcoding, in which video pixels are represented from one compression format to another compression format or with different compression bit rates. 1. Overview The present disclosure relates to video / image coding technology. Specifically, it relates to affine prediction in video / image coding. It can be applied to existing video coding standards, such as HEVC and VVC. It can also be applied to future video / image coding standards or video / image codecs. 2. Introduction Video codec standards have been developed mainly through the development of the well-known ITU-T and ISO / IEC standards. ITU-T produced H.261 and H.263, ISO / IEC produced MPEG-1 and MPEG-4 Visual (Visual), and the two organizations jointly produced H.264 / MPEG-2 Video and H.264 / MMPEG-4 Advanced Video Codec (AVC) and H.265 / HEVC (H.265 / HEVC, https: / / www.itu.int / rec / T-REC-H.265) standards. Since H.262, video codec standards are based on a hybrid video codec structure that utilizes temporal prediction plus transform coding. In order 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 of the new methods and put them into a 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 JTC1 SC29 / WG11 (MPEG) was created to work on the VVC standard with the goal of a 50% bitrate reduction compared to HEVC. The latest version of the VVC draft, the 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 Sub-block based prediction was first introduced to the video coding standard by HEVC Annex I (3D-HEVC) (H.265 / HEVC, https: / / www.itu.int / rec / T-REC-H.265). For sub-block based prediction, a block such as a coding unit (CU) or a prediction unit (PU) is divided into several non-overlapping sub-blocks. Different sub-blocks can be assigned different motion information, such as reference indexes or motion vectors (MVs), and motion compensation (MC) is performed separately for each sub-block. Figure 4 The concept of sub-block based prediction is demonstrated. In order 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 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). Affine prediction is also used in VVC. 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): Where (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 (CPMV). (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 on the left, top, top right, bottom left, and top left, as shown in Figure 7(a). For example, if the neighboring bottom left block A in Figure 7(a) is encoded and decoded in affine mode, as shown in A0 in Figure 7(b), 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. And the motion vectors mv0C, mv1C, and mv2C of the top left / top right / bottom left corners on the current CU / PU are calculated based on mv0N, mv1N, and mv2N (only for 6-parameter affine models). 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 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 the CU is encoded and decoded in affine merge mode, that is, in AF MERGE mode, it obtains the first block encoded and decoded in affine mode from the valid adjacent reconstructed blocks. The order of selecting candidate blocks 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 for 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 Unlike 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 mean that the candidates are derived from valid neighboring reconstructed blocks encoded in affine mode. like Figure 8 As shown, the scanning order of 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, two / three control points of the current block are derived using the three angular motion vectors of the CU covering the block. b) The sub-block motion of each sub-block within the current block is derived 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 candidates are constructed by combining the neighboring motion information of each control point. The motion information of the control point is first obtained from Figure 8 CPk (k = 1, 2, 3, 4) represents the kth control point. A0, A1, A2, B0, B1, B2 and B3 are the spatial positions used to predict CPk (k = 1, 2, 3); T is the temporal position 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 of checking 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 none of the three candidates are available, the motion information of 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 the 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, the 4-parameter affine motion model is constructed using the CP1 and CP2 control points, 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 the affine merge mode of VTM-2.0.1, only the first available affine neighbor can be used to derive the motion information of the affine merge mode. In JVET-L0366, a candidate list of affine merge modes is constructed by searching for valid affine neighbors and combining the neighbor motion information of each control point. The steps to construct the affine merge candidate list are as follows: 1) Insert inherited affine candidates Inherited affine candidates mean that the candidate is derived from the affine motion model of its valid affine-encoded neighboring blocks. Fig. 9 As shown, the scanning order of candidate positions is: A1, B1, B0, A0 and B2. After deriving the candidates, a complete pruning process is performed to check if the same candidate has been inserted into the list. If there is an identical candidate, 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 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 Fig. 9 CPk (k = 1, 2, 3, 4) represents the kth control point. A0, A1, A2, B0, B1, B2, B3 are the spatial positions (k = 1, 2, 3) used to predict CPk; T is the temporal position 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 of checking 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, the motion information of 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 a 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 the candidates, a complete pruning process is performed to check if the same candidate has been inserted into the list. If there is an identical candidate, 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 is simplified by comparing codec units covering neighboring positions instead of comparing affine candidates derived in VTM-2.0.1. At most 2 inherited affine candidates are inserted into the affine merge list. The pruning process for constructed affine candidates is completely removed. 2) The MV scaling operation in the constructed affine candidate is removed. 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: OffsetSet = {(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 the same as VTM2.0.1, with 5. 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 Fig. 9 The removed 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 The 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 the 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.1GBi applies unequal weights to prediction factors 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.1GBi, the prediction factor generation in bidirectional prediction mode is shown in formula (1). P GBi =(w0*P L0 +w1*P L1 +RoundingOffset GBi )>>shiftNum GB , Where 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 shifiNum 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 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 selection of weight pairs is 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 BMS2.1GBi 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.1GBi encoder bug fix To reduce GBi encoding time, in the current encoder design, the encoder will store the unidirectional prediction motion vectors estimated from GBi weights equal to 4 / 8 and reuse them for unidirectional prediction searches for other GBi weights. This fast encoding method is applicable to both translational motion models and affine motion models. A 6-parameter affine model and a 4-parameter affine model are adopted in VTM2.0. The BMS2.1 encoder does not distinguish between a 4-parameter affine model and a 6-parameter affine model when storing unidirectional prediction affine MVs when GBi weights equal to 4 / 8. Therefore, after encoding with GBi weights 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 4-parameter affine MEs of other GBi weights, or the stored 4-parameter affine MV can be used for 6-parameter affine MEs. The proposed GBi encoder error fix is to store 4-parameter and 6-parameter affine MVs separately. When GBi weights equal 4 / 8, the encoder stores affine MVs based on affine model types and reuses the corresponding affine MVs based on affine model types for other GBi weights. CU size limit of 2.5.2GBi 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 prediction 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 in this block. 2.6 Triangle Prediction Model The concept of triangular prediction mode (TPM) is to introduce a new triangulation for motion compensation prediction. Figure 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 predicting the triangular prediction unit, the diagonal edges are adaptively weighted. Then, the transformation and quantization process is 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). Fig.11 As shown. The motion vectors of the seven neighboring blocks are collected and placed in the 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, a 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 Fig.11 Blocks in 1-7) 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 "original unidirectional prediction candidate". Use full trimming. 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 (ie, modified to unidirectional prediction in List 0), and numCurrMergeCand is increased by 1. This added candidate motion is called a "truncated list 0 prediction candidate". Use full trimming. 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, the motion information in List 1 is added to the merge list (ie, modified to unidirectional prediction in List 1), and numCurrMergeCand is increased by 1. This added candidate motion is called "a candidate for truncated list 1 prediction". Use full trimming. 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, then first scale the motion information of list 1 to the list 0 reference picture, and add the average of the two MVs (one from the original list 0 and the other one which is the scaled MV from list 1) to the merge list, i.e. the average of the unidirectional predictions from the list 0 motion candidates, and numCurrMergeCand increases by 1. Otherwise, first scale the motion information of list 0 to the reference picture of list 1 and convert the two MVs (one from the original list 1, the other is the scaled MV from list 0) is added to the merged list, which is the average unidirectional prediction of the list 1 candidate motions, and numCurrMergeCand increases by 1. Use full trimming. 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 two triangular prediction units to derive the final prediction for the entire CU. Two weight factor groups are defined as follows: The 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 of their motion vectors is greater than 16 pixels, the second weighting factor set is used. Otherwise, the first weighting factor set is used. Fig.12 An example of a CU to which the first weighting factor group is applied is shown. 2.6.1.2 Motion Vector Storage The motion vector of the triangular prediction unit ( Fig.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. Fig.13As 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 both Mv1 and Mv2 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, then 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, then Mv1 is scaled to that picture. The scaled Mv1 and Mv2 are combined to form a bidirectional prediction motion vector. - Otherwise, just store Mv1 as the weighted region. 2.7 History-based Motion Vector Prediction A history-based MVP (HMVP) method is proposed, where 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 coded and decoded by inter-frame, 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 Fig.14 shown. Fig.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, which indicates that at most 6 HMVP candidates can be added to the table. When a new motion candidate is inserted into the table, a constrained FIFO rule is utilized, 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 few 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 (ie, 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) In addition, once the total number of available merge candidates reaches the signaled maximum allowed merge candidates minus 1, the process of constructing the merge candidate list from the HMVP list is terminated. 3) In addition, the number of pairs derived for the combined bi-directional prediction merge candidate 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 candidate. 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, i.e., 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 way as in VVC. Among the merge candidates, candidates can be selected and further extended by the proposed motion vector representation method. UMVE provides a new motion vector expression with simplified signaling. The expression method includes starting point, motion amplitude, and motion direction. Fig.16 An example of a UMVE search process is shown. Fig.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 The 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 represents the predefined distance from the starting point information. The predefined distance is 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 Directions to 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 flag and Merge flag are sent. If the Skip and Merge flags are true, the UMVE flag is parsed. If the UMVE flag is equal to 1, the UMVE syntax is parsed. However, if it is not 1, the AFFINE flag is parsed. If the AFFlNE flag is equal to 1, it is AFFINE mode, however, if it is not 1, the Skip / Merge index is parsed for the Skip / Merge mode of the VTM. No additional line buffering is required due to UMVE candidates. Because software's skip / merge candidates are used directly as base candidates. Using the input UMVE index, the complement of the MV is decided just before motion compensation. No need to keep a long queue buffer for this. 2.9 Inter-Intra Mode With inter-intra mode, multi-hypothesis prediction combines one intra prediction and one 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 4 intra prediction modes including DC, planar, horizontal and vertical modes, 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. Weighted averaging is used to combine one intra prediction mode selected by the intra mode index and one merge index prediction selected by the merge index. For chroma components, DM is always applied without additional signaling. The weights of the combined prediction are described as follows. When DC or planar mode is selected or the CB width or height is less than 4, equal weights are applied. For those CBs with CB width and height greater than or equal to 4, when horizontal / vertical mode is selected, one CB is first split vertically / horizontally into four equal-area 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 area. (w_intra1, w_inter1) is used for the area closest to the reference sample, and (w_intra4, w_inter4) is used for the area farthest from the reference sample. The combined prediction can then be calculated by adding the two weighted predictions and shifting right by 3 bits. In addition, the intra-prediction mode of the intra-hypothesis for the prediction factor can also be saved for reference by subsequent neighboring CUs. 2.10 Affine Merge Mode with Prediction Offset The proposed method selects the first available affine merge candidate as the base predictor. Then, it applies the motion vector offset to the motion vector value of each control point from the base predictor. If there is no available affine merge candidate, this proposed method is not used. The inter prediction directions of the selected base predictors are kept constant for each direction. In the current implementation, assuming that the affine model of the current block is a 4-parameter model, only 2 control points need to be derived. Therefore, only the first 2 control points of the base predictor will be used as control point predictors. For each control point, the zero_MVD flag is used to indicate whether the control point of the current block has the same MV value as the corresponding control point predictor. If the Zero_MVD flag is true, no 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 a distance index signal to indicate which distance offset to use. The mapping of distance index and distance offset value is as follows Fig.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 the 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 ,vpy ). 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(v x , v y )=MVP(v px , v py )+MV(x-direction factor*distance offset, y-direction factor*distance offset); If the inter prediction is bi-directional, 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 in the opposite direction for the L1 motion vector of the control point predictor. The result will be the MV value for each control point in each inter prediction direction. For example, when the basic predictor 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 (v1 px , 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 )=MVP L0 (v 0px , v 0py )+MV(x-direction factor*distance offset, y-direction factor*distance offset); MV L1 (v 0x , v 0y )=MVP L1 (v 0px , v 0py )+MV(-x direction factor*distance offset,-direction factor*distance offset). A simplified method is proposed to reduce the signaling overhead by signaling the distance offset index and the offset direction index for each block. The same offset will be applied to all available control points in the same way. In this method, the number of control points is determined by the affine type of the basic predictor, 3 control points for the 6-parameter type and 2 control points for the 4-parameter type. The distance offset table and the 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: includes ATMVP and affine merge candidates. Affine mode and ATMVP mode share a merge list construction process. Here, ATMVP and affine merge candidates can be added in sequence. The sub-block merge list size is signaled in the stripe 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 indexes, a merge list construction process is shared between the two partitions. When building the merge list, the spatial neighboring blocks and two temporal blocks of the block are checked. The motion information derived from the spatial neighboring 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 to 5. 3) Regular merge list: For the remaining coded blocks, a merge list construction process is shared. Here, spatial / temporal / HMVP, paired combined bidirectional prediction merge candidates and zero motion candidates can be inserted in order. The regular merge list size is signaled in the slice header and the maximum value is 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. This makes all merge candidates in the new list (i.e., the sub-block based merge candidate list) based on the sub-block codec tool. The steps for constructing the affine merge candidate list are as follows: Insert inheritance affine candidates An inherited affine candidate means that the candidate is derived from the affine motion model of its effectively affine-encoded neighboring block. Up to two inherited affine candidates are derived from the affine motion models of the neighboring blocks and inserted into the candidate list. The scan order is {A0, A1} for the left predictor and {B0, B1, B2} for the above predictors. 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 Fig. 9 CPk (k = 1, 2, 3, 4) represents the kth control point. A0, A1, A2, B0, B1, B2, B3 are the spatial positions (k = 1, 2, 3) used to predict CPk; T is the temporal position of the predicted 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 of checking 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, the motion information of CP1 cannot be obtained. For CP2, the inspection 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 the 4-parameter affine candidate points. 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 coded 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 Prediction History-based affine parameter inheritance 1. The parameters a, b, c, d, e and f defined in equation (2) for the 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 performed using a 4-parameter affine mode, a, b, e and f defined in equation (1) can be stored in a buffer. d. If the 4-parameter affine mode is used for encoding and decoding, 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 4-parameter affine mode is used for encoding and decoding, the parameters a, b, c and d defined in equation (2) are always stored in the buffer, but are subject to the restrictions of c=-b, d=a. f. For 4-parameter and 6-parameter affine models, the same number of parameters may 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 related to 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 bidirectional), and the reference index of list 0 and / or list 1. In this disclosure, when talking about a set of affine parameters stored in a buffer, the associated side information may also be included. i. If the affine-coded block is bidirectionally 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 prediction 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 necessary, 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 may be stored in a buffer together with the CPMV. ii. The height of the affine-encoded block may be stored in a buffer along with the CPMV. iii. The upper left coordinate of the affine-encoded block may 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 base MV are also stored along with the parameters a and 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, they should refer to the same reference pictures. n. A buffer for storing 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 and 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, which are 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 pruned 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, a=Clip(-128, 127, a), then a is stored as an 8-bit signed integer. The affine model parameters may be pruned (eg, to derive the MV of a sub-block) before being used to encode / decode an affine-coded 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 the VPS / SPS / PPS / picture header / slice header / tile group header. e. In one example, the clipping boundaries may depend on the grade and / or level of the standard. 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 merge), 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 a 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. The buffer used to store affine parameters can have a maximum capacity. a. The buffer can store at most 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 line / CTU. iii. M may be different for different standard grades / levels / tiers. When the buffer for storing affine parameters is not full (i.e., the number of groups of stored affine parameters S 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 the new parameters, and S=S+1. When the buffer is full (i.e., the number of groups of stored affine parameters S is equal to the maximum capacity M), when 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 (eg, H[T]) stored in the buffer is removed from the buffer for which T>=0 and T <M。 iv. If H[T] is deleted, the new set of affine parameters is stored as H[T]. v. If H[T] is deleted, all entries after H[T] will be moved forward. For example, for X, in ascending order from T to M-1, H[X] = H[X+1]. Then put the new set of affine parameters into the last entry in the buffer, for example H[M-1]. vi. If H[T] is deleted, all entries before H[T] will be moved backwards. For example, for X, in descending order from T to 1, H[X] = H[X-1]. Then the new set of affine parameters is placed in the first entry in the buffer, such as 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 affine parameter sets already in the buffer. If it is judged to be the same or similar to at least one set of affine parameters already in the buffer, it should not be stored in the buffer. This process is called "pruning". a. For one reference picture list (one prediction direction), 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 to be the same or similar if: 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, |aa′|<delta0. x. In one example, |bb′|<delta0. xi. In one example, |cc′|<delta0. xii. In one example, |db′|<delta0. xiii. In one example, |aa′|<delta0 and |bb′|<delta1. xiv. In one example, |cc′|<delta0 and |dd′|<delta1. xv. In one example, |aa′|<delta0 and |bb′|<delta1 and |cc′|<delta2. xvi. In one example, |aa′|<delta0 and |b-b′|<delta1 and |c-c′|<delta2 and |dd′|<delta3. xvii. The variable (e.g. delta0, delta1, delta2, delta3) can be a predefined number or it can depend on codec information like block width / height. It may be different for different standard profiles / levels / tiers. It can be signaled from encoder to decoder in VPS / SPS / PPS / slice header / tile group header / tile / CTU line / CTU. b. Two sets of affine parameters are considered to be different or similar 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 the one prediction direction in use, they are associated with different reference indices of list 0. iii. When List 1 is a prediction direction in use, they are associated with different reference indices of List 1. iv. They have different numbers of affine parameters or use different affine models. c. If both sets of affine parameters are associated with bidirectional prediction, they are judged to be the same (or similar) 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). d. The 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 compared only with some of the sets of affine parameters already in the buffer. For example, it is compared with the first W entries, such as H[0]...H[W-1]. In another example, it is compared with the last W entries, such as H[MW], H[M-1]. In another example, it is compared with one entry in every W entries, such as H[0], H[W], H[2*W]. 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 needs to be stored in the buffer, then iH[T] is deleted and the new set of affine parameters is stored as H[T]. ii. H[T] is deleted, and then all entries after H[T] are moved forward. For example, for X, in ascending order from T to M-1, H[X] = H[X+1]. Then the new set of affine parameters is placed in the last entry in the buffer, such as H[M-1]. iii. H[T] is deleted, and then all entries before H[T] are moved backwards. For example, for X, in descending order from T to 1, H[X] = H[X-1]. Then the new set of affine parameters is placed in the first entry in the buffer, such as 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 may 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 may 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. Fig.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′), and 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 vectors and parameters stored in the buffer, and these CPMVs are used as MVPs for 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 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 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 are inherited by the generated affine merge candidate. b. Affine merge candidates derived from a set of affine parameters stored in a 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 without using temporal motion prediction ( Fig. 9 block T in ), before using the constructed affine merge candidate of temporal motion prediction ( Fig. 9 block T in the . 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 for generating affine AMVP candidates should refer to the affine The target reference picture of the block decoded by AMVP is the same as the reference picture. i. In one example, the reference picture list associated with the stored parameters should be the same as the target reference picture list. The film list is the same. 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 can be inserted into the affine In the AMVP candidate list, after the affine AMVP candidates inherited from the neighboring blocks, after the constructed affine Before AMVP candidate. c. Affine AMVP candidates derived from a set of affine parameters stored in a buffer can be inserted into the affine In the AMVP candidate list, after the constructed affine AMVP candidate, the HEVC-based affine Before AMVP candidate. 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 ( Fig. 9 block T in), before the affine AMVP candidate constructed using temporal motion prediction ( Fig. 9 block T in the . f. 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. 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 predefine how many sets of affine model parameters in the buffer are added to the candidate list (denoted by N). aN may be signaled from the encoder to the decoder in VPS / SPS / PPS / slice header / tile group header / tile. bN may depend on the block size, the encoded mode information (eg, AMVP / Merge), etc. 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 groups of affine model parameters in the buffer (eg, N as in item 15) to insert into the candidate list may 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. A set of affine parameters stored in the buffer and their associated basic MVs and the locations of the basic 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 sub-block 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 of (x, y)) are expressed as (x, y). Assuming 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, 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, u) can be the center of the sub-block. iii. Assume that (xm, ym) is the coordinate of the location (basic location) where the basic MV is stored. 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 for the signaled CPMV of the current block. c. In one example, the CPMV of the current block is derived from the associated base MV 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 unit 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 a 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′), and 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) may be the center of the sub-block. iii. Assuming (x00, y00) is the upper left corner of the sub-block and the sub-block size is M×N, the following can be used: Export base position (xm, ym) (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 spatial neighboring unit blocks and parameters stored in the 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 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 spatial neighboring unit blocks and the parameters stored in the neighboring blocks. e. In one example, the motion vectors of the spatial 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 neighboring M×N unit block and the stored affine parameters refer to different reference pictures, the MV of the spatially neighboring M×N unit block is scaled to refer to 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 the affine parameters stored in the buffer. For example, they can be used to derive the MV or CPMV of the sub-block used in motion compensation. Fig. 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., 4×4 block in 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. Fig. 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 cell 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′), and 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) may 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, 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. 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 for 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 the temporal 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 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. 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 co-located 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 merge candidate is inherited from a spatial neighboring unit block, the spatial neighboring unit block is not used to derive the affine merge candidate through the parameters stored in the buffer. g. In one example, a spatial neighboring unit block can be used to derive an affine merge candidate using only one set of parameters stored in a buffer. In other words, if a spatial neighboring unit block and the set of parameters stored in the buffer have derived an affine merge candidate, it cannot be used to derive another affine merge candidate together with another set of parameters stored in the buffer. h. In one example, at most N affine merge candidates derived from the parameters stored in the buffer and the spatial neighboring unit blocks can be put into the affine merge candidate list. N is an integer, such as 3. i. In one example, if an affine merge candidate derived from the parameters stored in the buffer and the spatial neighboring unit blocks is selected, the GBI index of the current block is inherited from the GBI index of the spatial 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 the example, some parameter groups stored in the buffer are skipped in the first cycle. For example, the first N groups or the last N groups in the table are skipped. In fact, if k%S==0, H[k]s is skipped. In fact, if k%S!=0, 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 neighboring block is accessed sequentially. For example, Fig. 9 Blocks A1, B1, B0, A0, B2 are shown. In pseudocode implementation, the nested loops can be described as: a. In one example, the second loop may include only one spatial neighboring 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 merge candidate is generated and placed in the affine merge candidate list. i. Spatial neighboring blocks are available; ii. The spatial neighboring blocks are inter-frame coded; iii. The spatially neighboring blocks are not outside the current CTU row. iv. The inter-frame prediction of this set of parameters (1ist0, list1 or bi) is the same as the prediction of the spatial neighboring blocks; v. The reference index of list 0 for the set of parameters is the same as the reference index of the spatial neighboring block; vi. The reference index of list 1 for the set of parameters is the same as the reference index of the spatial 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 spatial 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. N is an integer, such as 3. h. In one example, if an affine merge candidate derived from the parameters stored in the buffer and the temporal neighboring unit blocks is selected, the GBI index of the current block is inherited from the GBI index of the temporal neighboring blocks. 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 the example, some parameter groups stored in the buffer are skipped in the first cycle. For example, the first N groups or the last N groups in the table are skipped. In fact, if k%S==0, H[k]s is skipped. In fact, if k%S!=0, 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, Fig. 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 temporal 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 in the affine merge candidate list. i. Neighboring blocks are available; ii. The neighboring blocks are inter-coded; iii. The neighboring blocks are not outside the current CTU row. iv. The inter-frame prediction of this set of parameters (1ist0, list1 or bi) is the same as the prediction of the neighboring block; v. The reference index of list 0 for 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 translational 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 spatial neighboring unit block, the spatial 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 a spatially neighboring unit block and the set of parameters stored in the buffer have derived an affine AMVP candidate, 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 spatial neighboring unit blocks can be put into the affine AMVP candidate list. 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 spatial 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 spatial 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 the example, some parameter groups stored in the buffer are skipped in the first cycle. For example, the first N groups or the last N groups in the table are skipped. In fact, if k%S==0, H[k]s is skipped. In fact, if k%S!=0, 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 neighboring block is accessed sequentially. For example, Fig. 9 Blocks A1, B1, B0, A0, B2 are shown. In pseudocode implementation, the nested loops can be described as: a. In one example, the second loop may include only one spatial neighboring 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. Spatial neighboring blocks are available; ii. The spatial neighboring blocks are inter-frame 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 spatial neighboring block; v. The reference index of list 1 for the set of parameters is the same as the reference index of the spatial neighboring block; vi. The reference index of List 0 of the set of parameters is equal to the reference index of List 0 signaled by AMVP. 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 blocks 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 blocks. 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 cycle 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 translational 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 spatial 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. 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 the example, some parameter groups stored in the buffer are skipped in the first cycle. For example, the first N groups or the last N groups in the table are skipped. In fact, if k%S==0, H[k]s is skipped. In fact, if k%S!=0, 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, Fig. 9 Blocks A1, B1, B0, A0, B2 are shown. In pseudocode 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 temporal 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. The temporal neighboring blocks are inter-coded; iii. The temporal 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 temporal 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 reference index of List 0 signaled by AMVP. 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 blocks 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 AMVP of list 0 is the same as the POC of one of the reference pictures of the temporally neighboring block. xiii The POε of the signaled reference picture of the AMVP of list 0 is the same as the POε 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 cycle 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 the 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 a CTU row 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 placed 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, the affine AMVP candidates derived from the affine HMVP buffer are placed into the affine AMVP list , after the 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, the i-th candidate is denoted as Candi, and the parameters are (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 jointly to generate a virtual affine model with a function such as an average. 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 the affine merging candidate inherited from the spatially neighboring block is put into the sub-block based merging 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 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 spatial neighboring block is not in the same CTU or CTU row as the current block, the affine merge candidate inherited from the spatial 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 spatial 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 the affine AMVP candidate inherited from the 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 spatial neighboring block is not 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. 33. More than one affine HMVP buffer is used to store different categories of affine parameters or CPMV. 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 the 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 MV of the spatially adjacent / non-adjacent unit blocks referring to a reference list X is combined with the affine parameters stored in the buffer referring to the reference list X. X=0 or 1. iv. In one example, if the 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 the 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 the 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 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 the 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 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. v. In one example, if the 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 the affine model of the current block, the spatially adjacent / non-adjacent MVs with reference to a reference K in a list X are combined with the affine parameters stored in the buffer with reference to a reference L in the list X. X=0 or 1. L can be 1, 2, 3, etc. vi. In one example, if the motion information of temporally 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 the affine model of the current block, the MVs of temporally adjacent unit blocks with reference to a reference K (where K>=L) in a list X are combined with the affine parameters stored in the buffer with reference to a reference L in the list X. X=0 or 1. L can be 1, 2, 3, etc. 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 codec mode and / or other codec information of the current CU. a. For example, if a CU is encoded and decoded using 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 and decoded in affine merge mode and the block uses a shared merge list, the update 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 affine HMVP buffer may correspond to one of the above-mentioned sub-buffers HB i . b. In one example, an operation on one sub-buffer (eg, update processing 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 compared with the affine parameters of reference picture list Y. Stored in an interleaved manner. 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 HEj, where j is an even number. e. In one example, M can be signaled from the encoder to the decoder, 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). 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 There can be at most N K The number of entries allowed. For different K, N K May be different. i. When a set of affine parameters is used to update the HMVP buffer, a sub-buffer with a sub-buffer index SI can be selected, and then the set of affine parameters can be used to update the corresponding sub-buffer HB SI . i. In one example, the selection of the sub-buffer may be based on the encoded information of the block to which the set of affine parameters is applied. (a) In one example, the decoded 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 the reference index of the set of affine parameters are represented as X (eg, 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, Max R1 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 a set of affine parameters is used to update the subbuffer 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 keep a counter to keep track of 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 affine merge candidates or affine AMVP candidate. ii. For example, when a set of affine When the parameters in Parameters are all zero, the entry is marked as "invalid" or "unusable". 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 subbuffer are zero, the affine HMVP buffer or an affine HMVP subbuffer is marked as "invalid" or "unavailable", and / or the counter of the buffer or subbuffer is set to zero. 38. When using spatially or temporally adjacent or non-adjacent adjacent blocks (also referred to as "adjacent blocks" for simplicity) to generate affine merge candidates by combining affine parameters stored in an affine HMVP buffer, only affine parameters stored in one or more relevant sub-buffers may be accessed. a. For example, the relevant sub-buffer may be determined by the coding information of the neighboring block. For example, the coding 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 may 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 references 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 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 may 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 referring to a reference picture with a reference index RIDX in a reference list LX, 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, an affine merge candidate can be generated based on the neighboring block in combination with a set of affine parameters stored in the relevant affine HMVP sub-buffer. 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 by referring to a reference picture with a reference index RIDX0 in reference list 0 and a reference index RIDX1 in reference list 1, an affine merge candidate can 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 pictures with reference index RID0 in reference list 0 and with reference index RID1 in reference list 1. (a) A bidirectional predictive affine merge candidate can 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 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 no 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 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 affine parameters stored in one or more relevant sub-buffers may be accessed. a. For example, the relevant sub-buffer may be determined by the coding information of the neighboring block. For example, the coding 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 may be used to generate affine AMVP candidates in combination with neighboring blocks. 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 is an integer, 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 may 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 a neighboring block is inter-coded and there is no MV referring to a 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, 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 encoded and decoded via intra block copy (IBC) mode, the neighboring block cannot be used in conjunction with the affine parameters stored in the affine HMVP buffer or affine HMVP sub-buffer to generate an affine merge / AMVP candidate. 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 neighboring / non-neighboring blocks can be divided into K groups (e.g., K=2), and how to combine parameters in the affine HMVP buffer / sub-buffer with motion information of spatially and / or temporally neighboring / non-neighboring blocks for encoding the current block can 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 affine parameters stored in the affine HMVP buffer / sub-buffer with spatially adjacent blocks in different groups may be placed in different positions in the affine AMVP candidate list; c. In one example, spatially neighboring blocks may be divided into groups based on their coded information. i. For example, neighboring blocks may be placed into a specific group based on whether they are affine-coded or not. ii. For example, neighboring blocks may be placed into a specific group based on whether they are affine coded and in AMVP mode. iii. For example, neighboring blocks may be put into a specific group 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 neighboring blocks in order, such as block A0 and block A1. 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 Figure 8 shown. (b) In one example, if the first encountered inter-coded and affine-coded upper neighboring block is used to generate the inherited merge / AMVP candidate, it is not put into group X. iii. Inter-coded neighboring blocks of other frames 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 can be placed in the affine merge candidate list before the Kth constructed affine merge candidate. For example, K can be 1 or 2. h. In one example, the affine merge 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 merge candidate list after the Kth constructed affine merge candidate. For example, K can 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 Kth 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 Kth constructed affine merge candidate. For example, K can be 1 or 2. k. In one example, the affine AMVP candidates generated based on the affine parameters stored in the affine HMVP buffer / sub-buffer combined with the spatially neighboring blocks in group Y may be placed into the affine AMVP candidate list before the zero candidate. 43. The basic position (xm, ym) in item 20 can be any position within a basic neighboring block (e.g., a 4×4 basic block), such as Fig.21 As shown, it shows the position in a 4×4 basic block. a. For example, (xm, ym) can be Fig.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 the affine-encoded block after motion compensation, and the updated motion information is stored and used for motion prediction of the 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, a filtering process (eg, a deblocking filter) is dependent on the updated motion information. c. The update process may be called 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. Fig. 22 An example is shown in which sub-blocks located at the right border and the lower border are shaded. a. In one example, MVs stored in sub-blocks located at the right boundary and / or the bottom boundary may 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 PU / CU 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 through equation (1) or the 6-parameter affine model through 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 at 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, xp = x'+M / 2, yp = y'+N+N / 2; iii. In one example, if the sub-block is located at the lower right corner, 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 at 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 lower 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 encoded and decoded in inter-frame mode, 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 neighboring affine-encoded block adopts 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 neighboring affine-encoded block adopts a 6-parameter affine model, the MV prediction is calculated according to equation (2): (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. Fig.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 FIG. 7( b ) belongs to an affine-encoded block), the following method may be applied to obtain motion prediction candidates: a. In one example, when a basic unit block S is accessed by 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, the basic unit block S is accessed twice by the MVP list construction process and / or the merge candidate list construction process. In one access, the MV stored in S is retrieved. In another access, the MV prediction derived from the affine coded block T for the current block 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, 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 coded 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 the derived candidate is the same as 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 candidates are 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 dimension of the current block (assuming the current block size is width×height). a. For example, if W>=T and H>=T, then not applied, where T is an integer, such as 8; b. For example, if W>=T or H>=T, then not applied, 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 not applied, where T is an integer, such as 8; General applications related to affine motion 11. Relative to the top left sample of a sub-block of size equal to M×N, the selection of the representative point can be changed, rather than always being 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 3The 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 of 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, the motion candidate taken from the affine-coded block can be put into 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 the affine merge candidate list size for an affine coded block may be adaptive. a. In one example, the affine MVP candidate list size or the affine merge candidate list size of the affine-coded block may be adaptive based on the size of the current block. i. For example, if the affine-coded 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 may 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 regular merge mode, this contribution proposes affine merge using non-adjacent spatial neighbors (NSAM). The mode of obtaining non-adjacent spatial neighbors is as follows: Figure 4 As shown in FIG. 1 , 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 4The 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 the CPMV is inherited from the 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. Fig.25a As shown by arrow 2510 in FIG. 2 , the order of checking the neighbors on the left and above is from bottom to top and from right to left, respectively. Fig.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 Fig.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 by 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 methods to control the bandwidth required for affine prediction in a more flexible way. It also suggests coordinating 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. The combination between this disclosure and other disclosures is also applicable. In the following discussion, it is assumed that the coordinates of the upper left / upper right / lower left / lower right corners of the neighboring blocks 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 / upper right / lower left / lower right corners 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 represented 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+offset)>>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" may be renamed (e.g., "sub-block merge candidate list") when other kinds of sub-block merge candidates such as ATMVP candidates are also put into the list or other kinds of merge lists including 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. 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, further, 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. a. In one example, if it is determined that the first affine merge candidate is "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 put it into the affine merge candidate list or the sub-block based merge candidate list. "Duplicate" may mean "same" or "similar". This process may be called "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 may be of an affine model type, such as a 4-parameter affine model or a 6-parameter affine model. ii. For example, the codec feature may 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 may be signaled from an encoder to a 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 both 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 value, 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. a. In one example, if it is determined that the first affine AMVP candidate is "duplicate" with at least one candidate already in the list, it can be determined that the first affine AMVP candidate is not put into the affine AMVP candidate list. "Duplicate" can mean "same" or "similar". This process can be called "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 the 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 may be signaled from an encoder to a 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 both 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 value, 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 put 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 merging 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 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, the 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 merging candidates in the second group can be derived by the base MV and base position obtained from the 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 a 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 put into the affine merge candidate list before the zero affine merge candidate. i. In one example, the history-based affine merging candidates in the third group can be derived by the base MV and base position obtained from the temporally neighboring blocks. ii. In one example, the history-based affine merging candidates in the first group may be derived by base MVs and base positions obtained from spatially neighboring blocks encoded 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 index of the base MV in the history-based affine parameter table. 7. In one example, history-based affine AMVP candidates may be placed into 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, the 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 the base MV and base position obtained from the 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 affine AMVP candidates derived from the non-affine AMVP. i. In one example, the history-based affine AMVP candidates in the third group may be derived by the base MV and base position obtained from the temporally neighboring blocks. ii. In one example, the history-based affine AMVP candidates in the first group may be derived by obtaining base MVs and base positions from spatially neighboring blocks decoded 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 a non-latest entry corresponding to a reference index of a base MV in a 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 the base MV and base position obtained from the temporally neighboring blocks. ii. In one example, the history-based affine AMVP candidates in the first group may be derived by obtaining base MVs and base positions from spatially neighboring blocks decoded with non-affine inter mode. iii. In one example, the history-based affine AMVP candidates in the first group may 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 motion information of the affine AMVP candidate and the second 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 for non-adjacent construction 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 may be the current CTU and at least one adjacent CTU on the left side of the current CTU. iv. The area may 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 neighboring CTU on the left side of the current CTU, and at least one neighboring 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 the list after non-adjacent affine inheritance candidates. f. In one example, history-based affine candidates may be put into 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. 12. In one example, at least one affine merge candidate (referred to as 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 derived from parameters stored in a buffer and one or more adjacent unit blocks. d. The positions 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 were 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 may be restricted to regions. (a) The region can 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 region may be the current CTU and at least one neighboring CTU above the current CTU. (e) The area may be the current CTU, at least one neighboring CTU on the left side of the current CTU, and at least one neighboring CTU above the current CTU. e. Non-adjacent affine candidates can be non-adjacent affine inheritance candidates or non-adjacent affine construction candidates. 13. The motion information of adjacent or non-adjacent spatial or temporal neighboring M×N unit blocks (e.g., 4×4 blocks in VTM) 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), mw (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 a 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 block encoded or decoded in 6-parameter affine mode. v. In one example, Regardless of whether the parameters in the buffer come from a block encoded or decoded in 4-parameter affine mode or in 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 follow 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. 14. The motion information of adjacent or non-adjacent spatial or temporal neighboring 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, mv2 represent the CPMV 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, mv1 represent the MVs of two adjacent blocks. 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 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 the N neighboring unit blocks may 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 for generating affine parameters may be checked sequentially. i. For example, neighboring blocks may be checked from closer to the current block to farther 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 of (x, y) are expressed as (x, y). Assume that the coordinates of the upper left corner of the current block are (x0', u0'), and 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 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 a block 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 follow 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. 15. 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 of the affine parameters sets (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 may be derived from affine parameters, basic motion information, and basic positions. a. In one example, If the parameters in the buffer come from a block encoded or decoded in 4-parameter affine mode. 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 arrive in the buffer. d. In the above example, (x, y) may be the position of a corner (eg, upper left / upper right / lower left) 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-class affine HMVP table. (a) In one example, the inter-frame direction information may include whether the entry corresponds to a double directional prediction candidates or unidirectional prediction candidates. (b) In one example, the inter-frame direction information may include whether the entry corresponds to L0 prediction candidate or 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 illumination compensation (IC) codec. (b) Additional motion information may include whether it is CU-level weighted bidirectional prediction (BCW) for encoding and decoding. v. In one example, the first type affine HMVP table may be updated after encoding / decoding the affine codec block. (a) In one example, the affine from the encoding / decoding of CPMV The encoding block generates affine parameters. (b) In one example, the basis can be generated from the encoded / decoded affine coded blocks This MV and the corresponding basic position act as a CPMV and the corresponding corner position (Such as top-left CPMV and top-left position). (c) In one example, the affine parameters, the basic MV and the decoder can be The entries corresponding to the basic positions generated by the affine codec block of the code / decoder are placed in the first category Affine HMVP table. a. In one example, a similarity or identity check may be applied before inserting a new entry. i. For example, if two entries have the same inter-direction, the same reference picture, and If the same affine parameters are used for the same reference picture, then the two entries are considered the same. ii. In one example, if the new entry is similar or identical to an existing entry, the new entry The item 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 kth entry in the first affine HMVP table may be checked after the kth entry in the second affine HMVP table. iii. For example, the kth entry in the second affine HMVP table may be checked after the kth 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. 16. 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 an order for 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 to the upper left of the current CTU may be used. iii. For example, a table stored in the CTU to the upper 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 neighboring 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 in sequence 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, a table that is first (or second) stored in a CTU to the upper 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. 17. 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 may 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 incremented 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 may be generated from a pair of two existing candidates. i. In one example, CPMVk new =SignShifi(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-frame 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, a new candidate remains L0 inter-predicted only if two existing candidates have the same reference picture (reference index) in the L0 reference list. 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-predicted only if an 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. 18. 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 the 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. 19. 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 a sbTMVP candidate, the sub-block merge candidates may not be reordered. 20. 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 present 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, then 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 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 the base MVs of two candidates (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 x|>=Thx, then the two basic MVs are not similar. Thx is a threshold value such as 1. (b) For example, if |MV1 y-MV 2 y|>=Thx, then the two basic MVs are not similar. Thy is a threshold value such as 1. iii. In one example, if the affine models of two candidates (expressed as {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 3 |>=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 3 |>=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 (eg, Thx or Tha) may depend on codec information, such as block size, QP, coding mode of the current block or neighboring blocks. v. Instead of checking every block, specific rules may be followed to select the locations of blocks used to derive non-adjacent affine inheritance candidates or non-adjacent affine construction candidates. 21. The positions of blocks used to derive non-adjacent affine inheritance candidates or non-adjacent affine construction candidates can be selected following the following specific rules instead of checking each block. a. In one example, Fig.27a and Figure 27b As shown, assuming that the upper left (or center or any other) position of the first block used to derive the non-adjacent affine construction candidate is (x0, y0), the corresponding upper left (or center or any other) position of the second block used to derive the non-adjacent affine construction candidate is (x1, y1), if x0<=x1 and y0<=y1, then (x0, y0) and (x1, y1) must satisfy at least one of the following two conditions: i.y1=y0 and x1-x0=2 k , where K is an integer greater than or equal to 0. ii. x1 = x0 and y1 - y0 = 2 k , where K is an integer greater than or equal to 0. b. In one example, assuming that the upper left (or center or any other) position of the first block used to derive the non-adjacent affine construction candidate is (x0, y0), and the corresponding upper left (or center or any other) position of the second block used to derive the non-adjacent affine construction candidate is (x1, y1), if x0<=x1 and y0<=y1, then (x0, y0) and (x1, y1) must satisfy at least one of the following two conditions: i.y1=y0 and x1-x0=W*2 k , where K is an integer greater than or equal to 0 and W is the width of the current block. ii. x1 = x0 and y1 - y0 = H*2 k , where K is an integer greater than or equal to 0 and H is the height of the current block. c. In one example, assuming that the upper left (or center or any other) position of the first block used to derive the non-adjacent affine construction candidate is (x0, y0), the corresponding upper left (or center or any other) position of the second block used to derive the non-adjacent affine construction candidate is (x1, y1), and the corresponding upper left (or center or any other) position of the third block used to derive the non-adjacent affine construction candidate is (x2, y2), if x0<=x1, x2 and y0<=y1, y2, then (x0, y0) and (x1, y1) must satisfy the following two conditions: i.y1=y0 and x1-x0=2 k , where K is an integer greater than or equal to 0. ii. x2 = x0 and y2 - y0 = 2 m , where m is an integer greater than or equal to 0. d. In one example, assuming that the upper left (or center or any other) position of the first block used to derive the non-adjacent affine construction candidate is (x0, y0), the corresponding upper left (or center or any other) position of the second block used to derive the non-adjacent affine construction candidate is (x1, y1), and the corresponding upper left (or center or any other) position of the third block used to derive the non-adjacent affine construction candidate is (x2, y2), if x0<=x1, x2 and y0<=y1, y2, then (x0, y0) and (x1, y1) must satisfy the following two conditions: i.y1=y0 and x1-x0=W*2 k , where K is an integer greater than or equal to 0. e.x2=x0 and y2-y0=H*2 m , where m is an integer greater than or equal to 0. f. In one example, assuming that the upper left position of the current block is (x, y), the lower left position (xLB, yLB) of the lower left block used to derive the non-adjacent affine construction candidate is derived as i.yLB=y+H-1. xLB=x+WW*2 k , k = 1, 2, ... (a) In one example, k = 1 and 2, such as Fig.28 As shown in , it is represented by solid LB1 and solid LB2, where xLB1 =xW and xLB2 =x-3*W. g. In one example, assuming that the upper left position of the current block is (x, y), the upper right position (xRT, yRT) of the upper right block used to derive the non-adjacent affine construction candidate is derived as i.xLB=x+W-1. yLB=y+HH*2 k , k = 1, 2, ... (a) In one example, k = 1 and 2, such as Fig.28 As shown in , represented by solid RT1 and solid RT2, where yRT1 = yH and yRT2 = y-3*H. h. In one example, the lower left block and / or upper right block used to derive non-adjacent affine construction candidates may be shifted to adjacent blocks, e.g. Fig.28 The dotted lines LB1 / LB2 / RT1 / RT2 in FIG. i. In one example, the upper left block used to derive non-adjacent affine construction candidates can be positioned by the lower left block and / or upper right block used to derive non-adjacent affine construction candidates, for example Fig.28 The solid or dashed lines in LTs. 5. Examples A history parameter table (HPT) is created. An entry in the HPT stores a set of affine parameters: a, b, c, and d, each represented by a 16-bit signed integer. Entries in the HPT are classified by reference list and reference index. Each reference list supported by the HPT supports up to 5 reference indexes. 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 Fig.29 The MV of the neighboring 4×4 block is used as the base MV. In a formal way, the MV of the current block at position (x, y) is calculated as follows: Where (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 upper left corner, upper right corner and lower left corner of the current block to obtain the corner position MV (CPMV) of the current block. Fig.29 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 category 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.
[0086] As used herein, the terms "video unit" or "codec unit" or "block" used herein may refer to one or more of the following: a color component, a sub-picture, a slice, a tile, a codec tree unit (CTU), a CTU row, a CTU group, a codec unit (CU), a prediction unit (PU), a transform unit (TU), a codec tree block (CTB), a codec block (CB), a prediction block (PB), a transform block (TB), a block, a sub-block of a block, a sub-region within a block, or a region including more than one sample or pixel.
[0087] 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.).
[0088] It should be noted that the following terms are not limited to the specific terms defined in existing standards, and any variants of the codec tool are also applicable.
[0089] Fig.30 A flow chart of a method 3000 for video processing according to an embodiment of the present disclosure is shown. The method 3000 is implemented during conversion between a video unit of a video and a bit stream of a video.
[0090] At block 3010, during conversion between a video unit of a video and a bitstream of the video unit, a first motion candidate for the video unit is derived based on a first position of a first block of the video and a second position of a second block. In some embodiments, the first motion candidate is one of: a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate. In some embodiments, the first position is one of: an upper left position or a center position of the first block of the video. Alternatively, the first position can be any other position.
[0091] The first position and the second position satisfy the position condition. In some embodiments, the second motion candidate is one of the following: a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate. In some embodiments, the second position is one of the following: the upper left or center position of the second block of the video. Alternatively, the second position can be any other position.
[0092] At block 3030, conversion is performed based on the first motion candidate and the second motion candidate. In some embodiments, the conversion may include encoding the video unit into a bitstream. Alternatively or additionally, the conversion may include decoding the video unit from the bitstream.
[0093] The method 3000 enables the location of the block for deriving the motion candidate to be selected based on a specific rule, rather than checking each block. In this case, the coding efficiency and performance can be improved.
[0094] In some embodiments, the first position is represented as (x0, y0) and the second position is represented as (x1, y1). Fig.27a and Figure 27b As shown, the first position 110 of the first block 1110 is represented as (x0, y0), and the second position 120 of the second block 1120 is represented as (x1, y1).
[0095] In some embodiments, Fig.27a As shown, the position conditions include: y1 = y0 and x1-x0 = 2 k Alternatively, or additionally, as shown in FIG. 27 , the position condition may include: x1=x0 and y1-y0=2 k In this case, k is an integer not less than 0, x0 is not greater than x1, and y0 is not greater than u1.
[0096] In some other embodiments, the position condition may include: y1=y0 and x1-x0=W*2 k Alternatively, or additionally, the position condition may include x1=x0 and y1-y0=H*2 kIn this case, k is an integer not less than 0, M represents the width of the current block for the video unit, H represents the height of the current block, x0 is not greater than x1, and y0 is not greater than y1.
[0097] In some embodiments, a first motion candidate for the video unit is derived based on a third position of a third block of the video. In this case, in some embodiments, the first position is represented as (x0, y0), the second position is represented as (x1, y1) and the third position is represented as (x2, y2).
[0098] In some embodiments, the position condition includes y1=y0 and x1-x0=2 k Alternatively, or additionally, the position condition may include x2=x0 and y2-y0=2 m In this case, k is an integer not less than 0, m is an integer not less than 0, x0 is not greater than x1 or x2, and y0 is not greater than y1 or y2.
[0099] In some other embodiments, the position condition may include y1=y0 and x1-x0=W*2 k Alternatively, or additionally, the position condition may include x2=x0 and y2-y0=H*2m. In this case, k is an integer not less than 0, m is an integer not less than 0, M represents the width of the current block for the video unit, H represents the height of the current block, x0 is not greater than x1 or x2, and y0 is not greater than y1 or y2.
[0100] In some embodiments, the first block is the current block for the video unit and the second block is the lower left block of the current block. The first position may be the upper left position of the current block and is represented as (x, y). The second position may be the lower left position of the lower left block and is represented as (xLB, yLB).
[0101] In some embodiments, the second position is derived as: yLB = y + H - 1, and xLB = x + WW * 2 k In this case, k is an integer, H represents the height of the current block and W represents the width of the current block. Fig.28 As shown, if k is equal to 1, xLB is equal to (xW), and if k is equal to 2, xLB is equal to (x-3*W).
[0102] In some embodiments, the first block is the current block for the video unit and the second block is the upper right block of the current block. The first position can be the upper left position of the current block and is represented as (x, y), and the second position can be the upper right position of the lower left block and is represented as (xRT, yRT).
[0103] In some embodiments, the second position may be derived as: xRT=x+W-1, and yRT=y+HH*2 k In this case, k is an integer, H represents the height of the current block and W represents the width of the current block. Fig.28 As shown, if k is equal to 1, yRT is equal to (yH), and if k is equal to 2, yRT is equal to (y-3*H).
[0104] In some embodiments, the second block is a lower left block or an upper right block. In this case, the second block is shifted to an adjacent block. In one example, the lower left block and / or the upper right block used to derive the non-adjacent affine construction candidate can be shifted to an adjacent block, such as Fig.28 LB1 / LB2 / RT1 / RT2 shown.
[0105] In some embodiments, the upper left block used to derive the motion candidate is located by at least one of the following: the lower left block or the upper right block. In one example, the upper left block used to derive the non-adjacent affine construction candidate can be located by the lower left block and / or the upper right block used to derive the non-adjacent affine construction candidate, for example Fig.29 The dotted line LT shown in FIG.
[0106] According to some other embodiments of the present disclosure, a non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by a device for video processing. The method includes: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video; deriving a second motion candidate for the video unit based on a second position of a second block of the video, and wherein the first position and the second position satisfy a position condition; and generating a bitstream based on the first motion candidate and the second motion candidate.
[0107] According to some other embodiments of the present disclosure, a method for storing a bitstream of a video is provided. The method includes: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video; deriving a second motion candidate for the video unit based on a second position of a second block of the video, and wherein the first position and the second position satisfy a position condition; generating a bitstream based on the first motion candidate and the second motion candidate; and storing the bitstream in a non-transitory computer-readable recording medium.
[0108] 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.
[0109] Item 1. A video processing method, comprising: during conversion between a video unit of a video and a bitstream of the video unit, deriving a first motion candidate for the video unit based on a first position of a first block of the video and a second position of a second block, and wherein the first position and the second position satisfy a position condition; and performing the conversion based on the first motion candidate and the second motion candidate.
[0110] Clause 2. The method of clause 1, wherein the first motion candidate is one of: a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate.
[0111] Clause 3. The method of clause 1, wherein the first position is represented as (x0, y0) and the second position is represented as (x1, y1), and the position condition includes at least one of the following: y1=y0 and x1-x0=2 k , or x1=x0 and y1-y0=2 k , and wherein k is an integer not less than 0, x0 is not greater than x1, and y0 is not greater than y1.
[0112] Clause 4. The method of clause 1, wherein the first position is represented as (x0, y0) and the second position is represented as (x1, y1), and the position condition includes at least one of the following: y1=y0 and x1-x0=W*2 k , or x1=x0 and y1-y0=H*2 k , wherein k is an integer not less than 0, M represents the width of the current block for the video unit, H represents the height of the current block, x0 is not greater than x1, and y0 is not greater than y1. ,
[0113] Clause 5. The method of clause 1, further comprising: deriving the first motion candidate for the video unit based on a third position of a third block of the video.
[0114] Clause 6. The method of clause 5, wherein the first position is represented as (x0, y0), the second position is represented as (x1, y1) and the third position is represented as (x2, y2), and the position condition includes at least one of the following: y1=y0 and x1-x0=2 k , or x2=x0 and y2-y0=2 m , and wherein k is an integer not less than 0, m is an integer not less than 0, x0 is not greater than x1 or x2, and y0 is not greater than y1 or y2.
[0115] Clause 7. The method of clause 5, wherein the first position is represented as (x0, y0), the second position is represented as (x1, y1) and the third position is represented as (x2, y2), and the position condition includes at least one of the following: y1=y0 and x1-x0=W*2 k , or x2=x0 and y2-y0=H*2m, and wherein k is an integer not less than 0, m is an integer not less than 0, M represents the width of the current block for the video unit, H represents the height of the current block, x0 is not greater than x1 or x2, and y0 is not greater than y1 or y2.
[0116] Clause 8. A method according to any one of clauses 1 to 7, wherein the first position is one of: the upper left position or the center position of the first block of the video, or wherein the second position is one of: the upper left position or the center position of the second block of the video.
[0117] Clause 9. A method according to clause 1, wherein the first block is a current block for the video unit and the second block is a lower-left block of the current block, and wherein the first position is an upper-left position of the current block and is represented as (x, y), and the second position is a lower-left position of the lower-left block and is represented as (xLB, yLB).
[0118] Clause 10. The method of clause 9, wherein the second position is derived as: yLB = y + H - 1, and xLB = x + WW * 2 k , and wherein k is an integer, H represents the height of the current block and W represents the width of the current block.
[0119] Clause 11. The method of clause 10, wherein if k is equal to 1, xLB is equal to (xW), and if k is equal to 2, xLB is equal to (x-3*W).
[0120] Clause 12. A method according to clause 1, wherein the first block is a current block for the video unit and the second block is an upper-right block of the current block, and wherein the first position is an upper-left position of the current block and is represented as (x, y), and the second position is an upper-right position of the lower-left block and is represented as (xRT, yRT).
[0121] Clause 13. The method of clause 12, wherein the second position is derived as: xRT=x+W-1, and yRT=y+HH*2 k , and wherein k is an integer, H represents the height of the current block and W represents the width of the current block.
[0122] Clause 14. The method of clause 13, wherein if k is equal to 1, yRT is equal to (yH), and if k is equal to 2, yRT is equal to (y-3*H).
[0123] Clause 15. The method of clause 1, wherein the second block is a lower left block or an upper right block, and wherein the second block is shifted to a neighboring block.
[0124] Clause 16. The method of clause 1, wherein an upper left block used to derive the motion candidate is located by at least one of: a lower left block or an upper right block.
[0125] Clause 17. The method of any one of clauses 1 to 16, wherein the converting comprises encoding the video unit into the bitstream.
[0126] Clause 18. The method of any one of clauses 1 to 16, wherein the converting comprises decoding the video unit from the bitstream.
[0127] Clause 19. An apparatus for video processing, the apparatus comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to perform the method of any one of clauses 1 to 18.
[0128] Clause 20. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform the method of any one of clauses 1 to 18.
[0129] Item 21. A non-transitory computer-readable recording medium storing a bitstream of a video generated by a method performed by a device for video processing, wherein the method comprises: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video and a second position of a second block of the video, and wherein the first position and the second position satisfy a position condition; and generating the bitstream based on the first motion candidate and the second motion candidate.
[0130] Clause 22. A method for storing a bitstream of a video, comprising: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video and a second position of a second block of the video, and wherein the first position and the second position satisfy a position condition; generating the bitstream based on the first motion candidate and the second motion candidate; and storing the bitstream in a non-transitory computer-readable recording medium. Device Examples
[0131] Fig.31A block diagram of a computing device 3100 in which various embodiments of the present disclosure may be implemented is shown. The computing device 3100 may be implemented as a source device 110 (or video encoder 114 or 200) or a destination device 120 (or video decoder 124 or 300), or may be included in a source device 110 (or video encoder 114 or 200) or a destination device 120 (or video decoder 124 or 300).
[0132] It should be understood that Fig.31 The computing device 3100 shown in the figure is for illustrative purposes only and is not intended to in any way imply any limitation on the functionality and scope of the embodiments of the present disclosure.
[0133] like Fig.31 As shown, computing device 3100 includes a general computing device 3100. Computing device 3100 may include at least one or more processors or processing units 3110, memory 3120, storage unit 3130, one or more communication units 3140, one or more input devices 3150, and one or more output devices 3160.
[0134] In some embodiments, the computing device 3100 can be implemented as any user terminal or server terminal with computing power. The server terminal can be a server provided by a service provider, a large computing device, etc. The user terminal can be, for example, any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a station, a unit, a device, a multimedia computer, a multimedia tablet computer, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a gaming device, or any combination thereof, and includes accessories and peripherals of these devices, or any combination thereof. It is conceivable that the computing device 3100 can support any type of interface to the user (such as a "wearable" circuit device, etc.).
[0135] The processing unit 3110 may be a physical processor or a virtual processor and may implement various processes based on a program stored in the memory 3120. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the computing device 3100. The processing unit 3110 may also be referred to as a central processing unit (CPU), a microprocessor, a controller, or a microcontroller.
[0136] The computing device 3100 typically includes various computer storage media. Such media can be any media accessible by the computing device 3100, including but not limited to volatile media and non-volatile media, or removable media and non-removable media. The memory 3120 can be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (such as a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM) or flash memory) or any combination thereof. The storage unit 3130 can be any removable or non-removable medium, and can include machine-readable media, such as a memory, a flash drive, a disk or other media that can be used to store information and / or data and can be accessed in the computing device 3100.
[0137] The computing device 3100 may also include additional removable / non-removable storage media, volatile / non-volatile storage media. Fig.31 Although not shown in the figure, a magnetic disk drive for reading from and / or writing to a removable nonvolatile magnetic disk and an optical disk drive for reading from and / or writing to a removable nonvolatile optical disk may be provided. In this case, each drive may be connected to the bus (not shown) via one or more data medium interfaces.
[0138] The communication unit 3140 communicates with another computing device via a communication medium. In addition, the functions of the components in the computing device 3100 can be implemented by a single computing cluster or multiple computing machines that can communicate via a communication connection. Therefore, the computing device 3100 can operate in a networked environment using logical connections to one or more other servers, networked personal computers (PCs), or other general network nodes.
[0139] The input device 3150 may be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, etc. The output device 3160 may be one or more of various output devices, such as a display, a speaker, a printer, etc. With the aid of the communication unit 3140, the computing device 3100 may also communicate with one or more external devices (not shown), such as storage devices and display devices, and the computing device 3100 may also communicate with one or more devices that enable a user to interact with the computing device 3100, or any device that enables the computing device 3100 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.), if necessary. Such communication may be performed via an input / output (I / O) interface (not shown).
[0140] In some embodiments, some or all components of the computing device 3100 may also be arranged in a cloud computing architecture rather than being integrated in a single device. In a cloud computing architecture, components may be provided remotely and work together to implement the functions described in the present disclosure. In some embodiments, cloud computing provides computing, software, data access and storage services, which will not require the end user to know the physical location or configuration of the system or hardware that provides these services. In various embodiments, cloud computing provides services via a wide area network (such as the Internet) using a suitable protocol. For example, a cloud computing provider provides applications via a wide area network, which can be accessed through a web browser or any other computing component. The software or components of the cloud computing architecture and the corresponding data may be stored on a remote server. The computing resources in a cloud computing environment may be merged or distributed at the location of a remote data center. Cloud computing infrastructures may provide services through a shared data center, although they appear as a single access point for users. Therefore, cloud computing architectures may be used to provide components and functions described herein from a service provider at a remote location. Alternatively, they may be provided by a conventional server, or installed directly or otherwise on a client device.
[0141] In an embodiment of the present disclosure, the computing device 3100 may be used to implement video encoding / decoding. The memory 3120 may include one or more video encoding / decoding modules 3125 having one or more program instructions. These modules can be accessed and executed by the processing unit 3110 to perform the functions of the various embodiments described herein.
[0142] In an example embodiment performing video encoding, input device 3150 may receive video data as input 3170 to be encoded. The video data may be processed by, for example, video codec module 3125 to generate an encoded bitstream. The encoded bitstream may be provided as output 3180 via output device 3160.
[0143] In an example embodiment performing video decoding, input device 3150 may receive an encoded bitstream as input 3170. The encoded bitstream may be processed by, for example, video codec module 3125 to generate decoded video data. The decoded video data may be provided as output 3180 via output device 3160.
[0144] Although the present disclosure has been specifically shown and described with reference to the preferred embodiments of the present disclosure, it will be understood by those skilled in the art that various changes can be made in form and detail without departing from the spirit and scope of the present application as defined by the appended claims. These changes are intended to be encompassed by the scope of the present application. Therefore, the foregoing description of the embodiments of the present application is not intended to be limiting.
Claims
1. A video processing method, comprising: during conversion between a video unit of a video and a bitstream of the video unit, deriving a first motion candidate for the video unit based on a first position of a first block of the video and a second position of a second block, and wherein the first position and the second position satisfy a position condition; as well as The converting is performed based on the first motion candidate and the second motion candidate. 2 . The method of claim 1 , wherein the first motion candidate is one of: a non-adjacent affine inheritance candidate or a non-adjacent affine construction candidate.
3. The method of claim 1, wherein the first position is represented as (x0, y0) and the second position is represented as (x1, y1), and the position condition comprises at least one of the following: y1=y0 and x1-x0=2 k ,or x1=x0 and y1-y0=2 k ,and Wherein k is an integer not less than 0, x0 is not greater than x1, and y0 is not greater than y1.
4. The method of claim 1, wherein the first position is represented as (x0, y0) and the second position is represented as (x1, y1), and the position condition comprises at least one of the following: y1=y0 and x1-x0=W*2 k ,or x1 = x0 and y1 - y0 = H * 2 k , and Wherein k is an integer not less than 0, M represents the width of the current block for the video unit, H represents the height of the current block, x0 is not greater than x1, and y0 is not greater than y1.
5. The method according to claim 1, further comprising: The first motion candidate for the video unit is derived based on a third position of a third block of the video.
6. The method of claim 5, wherein the first position is represented as (x0, y0), the second position is represented as (x1, y1) and the third position is represented as (x2, y2), and the position condition comprises at least one of the following: y1=y0 and x1-x0=2 k ,or x2=x0 and y2-y0=2 m ,as well as wherein k is an integer not less than 0, m is an integer not less than 0, x0 is not greater than x1 or x2, and y0 is not greater than y1 or y2.
7. The method of claim 5, wherein the first position is represented as (x0, y0), the second position is represented as (x1, y1), and the third position is represented as (x2, y2), and the position condition includes at least one of the following: y1 = y0 and x1 - x0 = W * 2 k , or x2=x0 and y2-y0=H*2 m ,as well as Wherein k is an integer not less than 0, m is an integer not less than 0, M represents the width of the current block for the video unit, H represents the height of the current block, x0 is not greater than x1 or x2, and y0 is not greater than y1 or y2.
8. The method according to any one of claims 1 to 7, wherein the first position is one of the following: an upper left position or a center position of the first block of the video, or The second position is one of the following: the upper left position or the center position of the second block of the video.
9. The method of claim 1, wherein the first block is a current block for the video unit and the second block is a lower left block of the current block, and The first position is the upper left position of the current block and is represented as (x, y), and the second position is the lower left position of the lower left block and is represented as (xLB, yLB).
10. The method of claim 9, wherein the second position is derived as: yLB=y+H-1, and xLB=x+WW*2 k , and wherein k is an integer, H represents the height of the current block and W represents the width of the current block.
11. The method of claim 10, wherein if k equals 1, xLB equals (xW), and If k is equal to 2, xLB is equal to (x-3*W).
12. The method of claim 1, wherein the first block is a current block for the video unit and the second block is an upper right block of the current block, and The first position is the upper left position of the current block and is represented by (x, y), and the second position is the upper right position of the lower left block and is represented by (xRT, yRT).
13. The method of claim 12, wherein the second position is derived as: xRT = x + W - 1, and yRT=y+HH*2 k , and wherein k is an integer, H represents the height of the current block and W represents the width of the current block.
14. The method of claim 13, wherein if k equals 1, yRT equals (yH), and If k is equal to 2, yRT is equal to (y-3*H).
15. The method according to claim 1, wherein the second block is a lower left block or an upper right block, and Wherein the second block is shifted to an adjacent block.
16. The method of claim 1, wherein an upper left block used to derive a motion candidate is located by at least one of: a lower left block or an upper right block.
17. The method of any one of claims 1 to 16, wherein the converting comprises encoding the video unit into the bitstream.
18. The method of any one of claims 1 to 16, wherein the converting comprises decoding the video unit from the bitstream.
19. An apparatus for video processing, the apparatus comprising a processor and a non-transitory memory having instructions thereon, wherein the instructions, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 18.
20. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform the method according to any one of claims 1 to 18.
21. A non-transitory computer-readable recording medium storing a bit stream of a video generated by a method performed by an apparatus for video processing, wherein the method comprises: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video and a second position of a second block, and wherein the first position and the second position satisfy a position condition; as well as The bitstream is generated based on the first motion candidate and the second motion candidate.
22. A method for storing a bitstream of a video, comprising: deriving a first motion candidate for a video unit of the video based on a first position of a first block of the video and a second position of a second block, and wherein the first position and the second position satisfy a position condition; generating the bitstream based on the first motion candidate and the second motion candidate; as well as The bit stream is stored in a non-transitory computer-readable recording medium.
