### Description

## Title of Invention : REDUCING THE IN-CTU STORAGE REQUIRED BY AFFINE INHERITANCE

[0001]

Under the applicable patent law and/or rules pursuant to the Paris Convention, this application is made to timely claim the priority to and benefits of International Patent Application No. PCT/CN2018/119946, filed on December 8, 2018, No. PCT/CN2018/121118, filed on December 14, 2018, PCT/CN2019/075094, filed on February 14, 2019, and No. PCT/CN2019/075846, filed on February 22, 2019. The entire disclosures of International Patent Application No. PCT/CN2018/119946, PCT/CN2018/121118, PCT/CN2019//075094 and No. PCT/CN2019/075846 are incorporated by reference as part of the disclosure of this application.

[0002]

This patent document relates to image and video coding and decoding.

[0003]

Digital video accounts for the largest bandwidth use on the internet and other digital communication networks. As the number of connected user devices capable of receiving and displaying video increases, it is expected that the bandwidth demand for digital video usage will continue to grow.

[0005]

The disclosed techniques may be used by video decoder or encoder embodiments during video decoding or encoding using control point motion vectors and affine coding.

[0006]

In one example aspect, a method of processing video is disclosed. The method includes associating, with a current video block, a first group of motion vectors (MVs) for determining inherited motion information of other video blocks, a second group of MVs for deriving MVs of sub-blocks of the current video block and a third group of MVs that is included in a bitstream representation of the current video block, and performing a conversion between the current video block and the bitstream representation using the first group of MVs, the second group of MVs or the third group of MVs.

[0007]

In another example aspect, another method of video processing is disclosed. The method includes performing a conversion between a current block and a bitstream representation of the current block using affine inherited motion vectors (MVs) for the current block, wherein the affine inherited MVs are derived from (1) MVs stored for an adjacent neighboring basic block, denoted as Badj, or (2) an affine history list.

[0008]

In yet another example aspect, another method of video processing is disclosed. The method includes performing a conversion between a current block and a bitstream representation of the current block using affine inherited motion vectors (MVs) for the current block, wherein the affine inherited MVs are derived from a first MV stored in a first basic block adjacently neighboring the current block and a second MV stored in a second basic block that is offset from the first building block by an offset.

[0009]

In yet another example aspect, another method of video processing is disclosed. The method includes associating a first group of control point motion vectors (CPMVs) for determining inherited motion information of blocks coded after a first block, with a second group of CPMVs for deriving MVs of sub-blocks of the first block or a third group of CPMVs that is signaled for the first block, wherein the first group of CPMVs is not identical with the second group of CPMVs or the third group of CPMVs; determining inherited motion information for a second block, which is coded after the first block, based on the first group of CPMVs, and performing a conversation between the second block and a bitstream representation of the second block by using the inherited motion information.

[0010]

In yet another example aspect, another method of video processing is disclosed. The method includes deriving, for a conversion between a first block of video and a bitstream representation of the first block, affine inherited motion vectors (MVs) for the first block based on stored motion vectors (MVs) ; and performing the conversion by using the affine inherited MVs.

[0011]

In yet another example aspect, another method of video processing is disclosed. The method includes deriving, for a conversion between a current block of video and a bitstream representation of the current block, affine inherited motion vectors (MVs) for the current block based on a first stored motion vector (MV) and a second stored MV different from the first stored MV, wherein the first stored MV is stored in a first basic block neighbouring to the current block, and the second stored MV is stored in a second basic block with an offset to the first basic block; and performing the conversion by using the affine inherited MVs for the current block.

[0012]

In yet another example aspect, another method of video processing is disclosed. The method includes deriving, for a conversion between a current block and a bitstream representation of the current block, one or more parameters of a set of affine model parameters associated with affine model for the current block; shifting the one or more parameters; and storing the shifted one or more parameters.

[0013]

In yet another example aspect, a video encoder apparatus is disclosed. The video encoder apparatus includes a processor that is configured to implement a method described herein.

[0014]

In yet another example aspect, a video decoder apparatus is disclosed. The video decoder apparatus includes a processor that is configured to implement a method described herein.

[0015]

In yet another aspect, a computer readable medium having code stored thereupon is disclosed. The code, when executed by a processor, causes the processor to implement a method described in the present document.

[0016]

These, and other, aspects are described in the present document.

[0017]

LISTING OF FIGURES

[0018]

FIG. 1 shows an example of derivation process for merge candidate list construction.

[0019]

FIG. 2 shows example positions of spatial merge candidates.

[0020]

FIG. 3 shows examples of candidate pairs considered for redundancy check of spatial merge candidates.

[0021]

FIG. 4A-4B show example positions for the second PU of N×2N and 2N×N partitions.

[0022]

FIG. 5 is an illustration of motion vector scaling for temporal merge candidate.

[0023]

FIG. 6 shows candidate positions for temporal merge candidate, C0 and C1.

[0024]

FIG. 7 shows example of combined bi-predictive merge candidate.

[0025]

FIG. 8 summarizes derivation process for motion vector prediction candidate.

[0026]

FIG. 9 is an example illustration of motion vector scaling for spatial motion vector candidate.

[0027]

FIG. 10 shows an example of alternative motion vector predictor (ATMVP) motion prediction for a coding unit CU.

[0028]

FIG. 11 shows example of one CU with four sub-blocks (A-D) and its neighbouring blocks (a–d) .

[0029]

FIG. 12 shows an example flowchart of encoding with different MV precision.

[0030]

FIG. 13A-13B show respectively 4 and 6 parameter simplified affine motion models.

[0031]

FIG. 14 shows an example of Affine MVF per sub-block.

[0032]

FIG. 15A shows an example of a 4-paramenter affine model.

[0033]

FIG. 15B shows an example of a 6-parameter affine model.

[0034]

FIG. 16 shows an example of an MVP for AF_INTER for inherited affine candidates.

[0035]

FIG. 17 shows example MVP for AF_INTER for constructed affine candidates.

[0036]

FIG. 18A shows an example of candidates for AF_MERGE in a five neighboring block scenario.

[0037]

FIG. 18B shows an example flow of a CPMV predictor derivation process.

[0038]

FIG. 19 shows example Candidates position for affine merge mode.

[0039]

FIG. 20 shows an example of affine inheritance at CTU-row.

[0040]

FIG. 21 shows examples of MV stored in adjacent neighbouring basic blocks

[0041]

FIG. 22 shows positions in a 4×4 basic block.

[0042]

FIG. 23 shows examples of MVs of two adjacent neighbouring blocks.

[0043]

FIG. 24 shows an example of MVs used for affine inheritance crossing CTU rows.

[0044]

FIG. 25 is a flowchart for an example of a video processing method.

[0045]

FIG. 26 is a block diagram of an example of a video processing apparatus.

[0046]

FIG. 27 shows an exemplary flowchart to find the first basic block and the second basic block (rectangular block indicates the termination of the whole process) .

[0047]

FIG. 28 shows another exemplary flowchart to find the first basic block and the second basic block (rectangular block indicates the termination of the whole process) .

[0048]

FIG. 29 is a flowchart for an example of a video processing method.

[0049]

FIG. 30 is a flowchart for an example of a video processing method.

[0050]

FIG. 31 is a flowchart for an example of a video processing method.

[0051]

FIG. 32 is a flowchart for an example of a video processing method.

[0052]

The present document provides various techniques that can be used by a decoder of video bitstreams to improve the quality of decompressed or decoded digital video or images. Furthermore, a video encoder may also implement these techniques during the process of encoding in order to reconstruct decoded frames used for further encoding.

[0053]

Section headings are used in the present document for ease of understanding and do not limit the embodiments and techniques to the corresponding sections. As such, embodiments from one section can be combined with embodiments from other sections.

[0055]

This patent document is related to video coding technologies. Specifically, it is related to motion vector coding in video coding. It may be applied to the existing video coding standard like HEVC, or the standard (Versatile Video Coding) to be finalized. It may be also applicable to future video coding standards or video codec.

[0056]

2. Introductory remarks

[0057]

Video coding standards have evolved primarily through the development of the well-known ITU-T and ISO/IEC standards. The ITU-T produced H. 261 and H. 263, ISO/IEC produced MPEG-1 and MPEG-4 Visual, and the two organizations jointly produced the H. 262/MPEG-2 Video and H. 264/MPEG-4 Advanced Video Coding (AVC) and H. 265/HEVC standards. Since H. 262, the video coding standards are based on the hybrid video coding structure wherein temporal prediction plus transform coding are utilized. To explore the future video coding technologies beyond HEVC, Joint Video Exploration Team (JVET) was founded by VCEG and MPEG jointly in 2015. Since then, many new methods have been adopted by JVET and put into the reference software named Joint Exploration Model (JEM) . In April 2018, the Joint Video Expert Team (JVET) between VCEG (Q6/16) and ISO/IEC JTC1 SC29/WG11 (MPEG) was created to work on the VVC standard targeting at 50%bitrate reduction compared to HEVC.

[0058]

2.1 Inter prediction in HEVC/H. 265

[0059]

Each inter-predicted PU has motion parameters for one or two reference picture lists. Motion parameters include a motion vector and a reference picture index. Usage of one of the two reference picture lists may also be signalled using inter_pred_idc. Motion vectors may be explicitly coded as deltas relative to predictors.

[0060]

When a CU is coded with skip mode, one PU is associated with the CU, and there are no significant residual coefficients, no coded motion vector delta or reference picture index. A merge mode is specified whereby the motion parameters for the current PU are obtained from neighbouring PUs, including spatial and temporal candidates. The merge mode can be applied to any inter-predicted PU, not only for skip mode. The alternative to merge mode is the explicit transmission of motion parameters, where motion vector (to be more precise, motion vector differences (MVD) compared to a motion vector predictor) , corresponding reference picture index for each reference picture list and reference picture list usage are signalled explicitly per each PU. Such a mode is named Advanced motion vector prediction (AMVP) in this disclosure. When signalling indicates that one of the two reference picture lists is to be used, the PU is produced from one block of samples. This is referred to as ‘uni-prediction’ . Uni-prediction is available both for P-slices and B-slices.

[0061]

When signalling indicates that both of the reference picture lists are to be used, the PU is produced from two blocks of samples. This is referred to as ‘bi-prediction’ . Bi-prediction is available for B-slices only.

[0062]

The following text provides the details on the inter prediction modes specified in HEVC. The description will start with the merge mode.

[0063]

2.1.1 Reference picture list

[0064]

In HEVC, the term inter prediction is used to denote prediction derived from data elements (e.g., sample values or motion vectors) of reference pictures other than the current decoded picture. Like in H. 264/AVC, a picture can be predicted from multiple reference pictures. The reference pictures that are used for inter prediction are organized in one or more reference picture lists. The reference index identifies which of the reference pictures in the list should be used for creating the prediction signal.

[0065]

A single reference picture list, List 0, is used for a P slice and two reference picture lists, List 0 and List 1 are used for B slices. It should be noted reference pictures included in List 0/1 could be from past and future pictures in terms of capturing/display order.

[0067]

2.1.2.1 Derivation of candidates for merge mode

[0068]

When a PU is predicted using merge mode, an index pointing to an entry in the merge candidates list is parsed from the bitstream and used to retrieve the motion information. The construction of this list is specified in the HEVC standard and can be summarized according to the following sequence of steps:

[0069]

● Step 1: Initial candidates derivation

[0070]

○ Step 1.1: Spatial candidates derivation

[0071]

○ Step 1.2: Redundancy check for spatial candidates

[0072]

○ Step 1.3: Temporal candidates derivation

[0073]

● Step 2: Additional candidates insertion

[0074]

○ Step 2.1: Creation of bi-predictive candidates

[0075]

○ Step 2.2: Insertion of zero motion candidates

[0076]

These steps are also schematically depicted in FIG. 1. For spatial merge candidate derivation, a maximum of four merge candidates are selected among candidates that are located in five different positions. For temporal merge candidate derivation, a maximum of one merge candidate is selected among two candidates. Since constant number of candidates for each PU is assumed at decoder, additional candidates are generated when the number of candidates obtained from step 1 does not reach the maximum number of merge candidate (MaxNumMergeCand) which is signalled in slice header. Since the number of candidates is constant, index of best merge candidate is encoded using truncated unary binarization (TU) . If the size of CU is equal to 8, all the PUs of the current CU share a single merge candidate list, which is identical to the merge candidate list of the 2N×2N prediction unit.

[0077]

In the following, the operations associated with the aforementioned steps are detailed.

[0078]

2.1.2.2 Spatial candidates derivation

[0079]

In the derivation of spatial merge candidates, a maximum of four merge candidates are selected among candidates located in the positions depicted in FIG. 2. The order of derivation is A
_{1}, B
_{1}, B
_{0}, A
_{0} and B
_{2}. Position B
_{2} is considered only when any PU of position A
_{1}, B
_{1}, B
_{0}, A
_{0} is not available (e.g. because it belongs to another slice or tile) or is intra coded. After candidate at position A
_{1} is added, the addition of the remaining candidates is subject to a redundancy check which ensures that candidates with same motion information are excluded from the list so that coding efficiency is improved. To reduce computational complexity, not all possible candidate pairs are considered in the mentioned redundancy check. Instead only the pairs linked with an arrow in FIG. 3 are considered and a candidate is only added to the list if the corresponding candidate used for redundancy check has not the same motion information. Another source of duplicate motion information is the “second PU” associated with partitions different from 2Nx2N. As an example, FIG. 4A-4B depict the second PU for the case of N×2N and 2N×N, respectively. When the current PU is partitioned as N×2N, candidate at position A
_{1} is not considered for list construction. In fact, by adding this candidate will lead to two prediction units having the same motion information, which is redundant to just have one PU in a coding unit. Similarly, position B
_{1} is not considered when the current PU is partitioned as 2N×N.

[0080]

FIG. 2 shows positions of spatial merge candidates.

[0081]

FIG. 3 shows candidate pairs considered for redundancy check of spatial merge candidates.

[0082]

FIG. 4A-4B show positions for the second PU of N×2N and 2N×N partitions.

[0083]

2.1.2.3 Temporal candidates derivation

[0084]

In this step, only one candidate is added to the list. Particularly, in the derivation of this temporal merge candidate, a scaled motion vector is derived based on co-located PU belonging to the picture which has the smallest POC difference with current picture within the given reference picture list. The reference picture list to be used for derivation of the co-located PU is explicitly signalled in the slice header. The scaled motion vector for temporal merge candidate is obtained as illustrated by the dotted line in FIG. 5, which is scaled from the motion vector of the co-located PU using the POC distances, tb and td, where tb is defined to be the POC difference between the reference picture of the current picture and the current picture and td is defined to be the POC difference between the reference picture of the co-located picture and the co-located picture. The reference picture index of temporal merge candidate is set equal to zero. A practical realization of the scaling process is described in the HEVC specification. For a B-slice, two motion vectors, one is for reference picture list 0 and the other is for reference picture list 1, are obtained and combined to make the bi-predictive merge candidate.

[0085]

FIG. 5 is an example illustration of motion vector scaling for temporal merge candidate.

[0086]

In the co-located PU (Y) belonging to the reference frame, the position for the temporal candidate is selected between candidates C
_{0} and C
_{1}, as depicted in FIG. 6. If PU at position C
_{0} is not available, is intra coded, or is outside of the current coding tree unit (CTU aka. LCU, largest coding unit) row, position C1 is used. Otherwise, position C0 is used in the derivation of the temporal merge candidate.

[0087]

FIG. 6 shows an example of candidate positions for temporal merge candidate, C0 and C1.

[0088]

2.1.2.4 Additional candidates insertion

[0089]

Besides spatial and temporal merge candidates, there are two additional types of merge candidates: combined bi-predictive merge candidate and zero merge candidate. Combined bi-predictive merge candidates are generated by utilizing spatial and temporal merge candidates. Combined bi-predictive merge candidate is used for B-Slice only. The combined bi-predictive candidates are generated by combining the first reference picture list motion parameters of an initial candidate with the second reference picture list motion parameters of another. If these two tuples provide different motion hypotheses, they will form a new bi-predictive candidate. As an example, FIG. 7 depicts the case when two candidates in the original list (on the left) , which have mvL0 and refIdxL0 or mvL1 and refIdxL1, are used to create a combined bi-predictive merge candidate added to the final list (on the right) . There are numerous rules regarding the combinations which are considered to generate these additional merge candidates.

[0090]

Zero motion candidates are inserted to fill the remaining entries in the merge candidates list and therefore hit the MaxNumMergeCand capacity. These candidates have zero spatial displacement and a reference picture index which starts from zero and increases every time a new zero motion candidate is added to the list. Finally, no redundancy check is performed on these candidates.

[0092]

AMVP exploits spatio-temporal correlation of motion vector with neighbouring PUs, which is used for explicit transmission of motion parameters. For each reference picture list, a motion vector candidate list is constructed by firstly checking availability of left, above temporally neighbouring PU positions, removing redundant candidates and adding zero vector to make the candidate list to be constant length. Then, the encoder can select the best predictor from the candidate list and transmit the corresponding index indicating the chosen candidate. Similarly with merge index signalling, the index of the best motion vector candidate is encoded using truncated unary. The maximum value to be encoded in this case is 2 (see FIG. 8) . In the following sections, details about derivation process of motion vector prediction candidate are provided.

[0093]

2.1.3.1 Derivation of AMVP candidates

[0094]

FIG. 8 summarizes derivation process for motion vector prediction candidate.

[0095]

In motion vector prediction, two types of motion vector candidates are considered: spatial motion vector candidate and temporal motion vector candidate. For spatial motion vector candidate derivation, two motion vector candidates are eventually derived based on motion vectors of each PU located in five different positions as depicted in FIG. 2.

[0096]

For temporal motion vector candidate derivation, one motion vector candidate is selected from two candidates, which are derived based on two different co-located positions. After the first list of spatio-temporal candidates is made, duplicated motion vector candidates in the list are removed. If the number of potential candidates is larger than two, motion vector candidates whose reference picture index within the associated reference picture list is larger than 1 are removed from the list. If the number of spatio-temporal motion vector candidates is smaller than two, additional zero motion vector candidates is added to the list.

[0097]

2.1.3.2 Spatial motion vector candidates

[0098]

In the derivation of spatial motion vector candidates, a maximum of two candidates are considered among five potential candidates, which are derived from PUs located in positions as depicted in FIG. 2, those positions being the same as those of motion merge. The order of derivation for the left side of the current PU is defined as A
_{0}, A
_{1}, and scaled A
_{0}, scaled A
_{1}. The order of derivation for the above side of the current PU is defined as B
_{0}, B
_{1}, B
_{2}, scaled B
_{0}, scaled B
_{1}, scaled B
_{2}. For each side there are therefore four cases that can be used as motion vector candidate, with two cases not required to use spatial scaling, and two cases where spatial scaling is used. The four different cases are summarized as follows.

[0099]

● No spatial scaling

[0100]

– (1) Same reference picture list, and same reference picture index (same POC)

[0101]

– (2) Different reference picture list, but same reference picture (same POC)

[0103]

– (3) Same reference picture list, but different reference picture (different POC)

[0104]

– (4) Different reference picture list, and different reference picture (different POC)

[0105]

The no-spatial-scaling cases are checked first followed by the spatial scaling. Spatial scaling is considered when the POC is different between the reference picture of the neighbouring PU and that of the current PU regardless of reference picture list. If all PUs of left candidates are not available or are intra coded, scaling for the above motion vector is allowed to help parallel derivation of left and above MV candidates. Otherwise, spatial scaling is not allowed for the above motion vector.

[0106]

FIG. 9 is an illustration of motion vector scaling for spatial motion vector candidate. In a spatial scaling process, the motion vector of the neighbouring PU is scaled in a similar manner as for temporal scaling, as depicted in FIG. 9. The main difference is that the reference picture list and index of current PU is given as input; the actual scaling process is the same as that of temporal scaling.

[0107]

2.1.3.3 Temporal motion vector candidates

[0108]

Apart for the reference picture index derivation, all processes for the derivation of temporal merge candidates are the same as for the derivation of spatial motion vector candidates (see FIG. 6) . The reference picture index is signalled to the decoder.

[0109]

2.2 Sub-CU based motion vector prediction methods in JEM

[0110]

In the JEM with QTBT, each CU can have at most one set of motion parameters for each prediction direction. Two sub-CU level motion vector prediction methods are considered in the encoder by splitting a large CU into sub-CUs and deriving motion information for all the sub-CUs of the large CU. Alternative temporal motion vector prediction (ATMVP) method allows each CU to fetch multiple sets of motion information from multiple blocks smaller than the current CU in the collocated reference picture. In spatial-temporal motion vector prediction (STMVP) method motion vectors of the sub-CUs are derived recursively by using the temporal motion vector predictor and spatial neighbouring motion vector.

[0111]

To preserve more accurate motion field for sub-CU motion prediction, the motion compression for the reference frames is currently disabled.

[0112]

FIG. 10 shows an example of ATMVP motion prediction for a CU.

[0113]

2.2.1 Alternative temporal motion vector prediction

[0114]

In the alternative temporal motion vector prediction (ATMVP) method, the motion vectors temporal motion vector prediction (TMVP) is modified by fetching multiple sets of motion information (including motion vectors and reference indices) from blocks smaller than the current CU. The sub-CUs are square N×N blocks (N is set to 4 by default) . ATMVP predicts the motion vectors of the sub-CUs within a CU in two steps. The first step is to identify the corresponding block in a reference picture with a so-called temporal vector. The reference picture is called the motion source picture. The second step is to split the current CU into sub-CUs and obtain the motion vectors as well as the reference indices of each sub-CU from the block corresponding to each sub-CU.

[0115]

In the first step, a reference picture and the corresponding block is determined by the motion information of the spatial neighbouring blocks of the current CU. To avoid the repetitive scanning process of neighbouring blocks, the first merge candidate in the merge candidate list of the current CU is used. The first available motion vector as well as its associated reference index are set to be the temporal vector and the index to the motion source picture. This way, in ATMVP, the corresponding block may be more accurately identified, compared with TMVP, wherein the corresponding block (sometimes called collocated block) is always in a bottom-right or center position relative to the current CU.

[0116]

In the second step, a corresponding block of the sub-CU is identified by the temporal vector in the motion source picture, by adding to the coordinate of the current CU the temporal vector. For each sub-CU, the motion information of its corresponding block (the smallest motion grid that covers the center sample) is used to derive the motion information for the sub-CU. After the motion information of a corresponding N×N block is identified, it is converted to the motion vectors and reference indices of the current sub-CU, in the same way as TMVP of HEVC, wherein motion scaling and other procedures apply. For example, the decoder checks whether the low-delay condition (i.e. the POCs of all reference pictures of the current picture are smaller than the POC of the current picture) is fulfilled and possibly uses motion vector MV
_{x} (the motion vector corresponding to reference picture list X) to predict motion vector MV
_{y} (with X being equal to 0 or 1 and Y being equal to 1-X) for each sub-CU.

[0117]

2.2.2 Spatial-temporal motion vector prediction (STMVP)

[0118]

In this method, the motion vectors of the sub-CUs are derived recursively, following raster scan order. FIG. 11 illustrates this concept. Let us consider an 8×8 CU which contains four 4×4 sub-CUs A, B, C, and D. The neighbouring 4×4 blocks in the current frame are labelled as a, b, c, and d.

[0119]

The motion derivation for sub-CU A starts by identifying its two spatial neighbours. The first neighbour is the N×N block above sub-CU A (block c) . If this block c is not available or is intra coded the other N×N blocks above sub-CU A are checked (from left to right, starting at block c) . The second neighbour is a block to the left of the sub-CU A (block b) . If block b is not available or is intra coded other blocks to the left of sub-CU A are checked (from top to bottom, staring at block b) . The motion information obtained from the neighbouring blocks for each list is scaled to the first reference frame for a given list. Next, temporal motion vector predictor (TMVP) of sub-block A is derived by following the same procedure of TMVP derivation as specified in HEVC. The motion information of the collocated block at location D is fetched and scaled accordingly. Finally, after retrieving and scaling the motion information, all available motion vectors (up to 3) are averaged separately for each reference list. The averaged motion vector is assigned as the motion vector of the current sub-CU.

[0120]

FIG. 11 shows an example of one CU with four sub-blocks (A-D) and its neighbouring blocks (a–d) .

[0121]

2.2.3 Sub-CU motion prediction mode signalling

[0122]

The sub-CU modes are enabled as additional merge candidates and there is no additional syntax element required to signal the modes. Two additional merge candidates are added to merge candidates list of each CU to represent the ATMVP mode and STMVP mode. Up to seven merge candidates are used, if the sequence parameter set indicates that ATMVP and STMVP are enabled. The encoding logic of the additional merge candidates is the same as for the merge candidates in the HM, which means, for each CU in P or B slice, two more RD checks is needed for the two additional merge candidates.

[0123]

In the JEM, all bins of merge index is context coded by CABAC. While in HEVC, only the first bin is context coded and the remaining bins are context by-pass coded.

[0124]

2.3 Inter prediction methods in VVC

[0125]

There are several new coding tools for inter prediction improvement, such as Adaptive motion vector difference resolution (AMVR) for signaling MVD, affine prediction mode, Triangular prediction mode (TPM) , ATMVP, Generalized Bi-Prediction (GBI) , Bi-directional Optical flow (BIO) .

[0126]

2.3.1 Coding block structure in VVC

[0127]

In VVC, a QuadTree/BinaryTree/MulitpleTree (QT/BT/TT) structure is adopted to divide a picture into square or rectangle blocks.

[0128]

Besides QT/BT/TT, separate tree (a.k.a. Dual coding tree) is also adopted in VVC for I-frames. With separate tree, the coding block structure are signaled separately for the luma and chroma components.

[0129]

2.3.2 Adaptive motion vector difference resolution

[0130]

In HEVC, motion vector differences (MVDs) (between the motion vector and predicted motion vector of a PU) are signalled in units of quarter luma samples when use_integer_mv_flag is equal to 0 in the slice header. In the VVC, a locally adaptive motion vector resolution (LAMVR) is introduced. In the VVC, MVD can be coded in units of quarter luma samples, integer luma samples or four luma samples (i.e., 1/4 -pel, 1-pel, 4-pel) . The MVD resolution is controlled at the coding unit (CU) level, and MVD resolution flags are conditionally signalled for each CU that has at least one non-zero MVD components.

[0131]

For a CU that has at least one non-zero MVD components, a first flag is signalled to indicate whether quarter luma sample MV precision is used in the CU. When the first flag (equal to 1) indicates that quarter luma sample MV precision is not used, another flag is signalled to indicate whether integer luma sample MV precision or four luma sample MV precision is used.

[0132]

When the first MVD resolution flag of a CU is zero, or not coded for a CU (meaning all MVDs in the CU are zero) , the quarter luma sample MV resolution is used for the CU. When a CU uses integer-luma sample MV precision or four-luma-sample MV precision, the MVPs in the AMVP candidate list for the CU are rounded to the corresponding precision. In the encoder, CU-level RD checks are used to determine which MVD resolution is to be used for a CU. That is, the CU-level RD check is performed three times for each MVD resolution. To accelerate encoder speed, the following encoding schemes are applied in the JEM.

[0133]

● During RD check of a CU with normal quarter luma sample MVD resolution, the motion information of the current CU (integer luma sample accuracy) is stored. The stored motion information (after rounding) is used as the starting point for further small range motion vector refinement during the RD check for the same CU with integer luma sample and 4 luma sample MVD resolution so that the time-consuming motion estimation process is not duplicated three times.

[0134]

● RD check of a CU with 4 luma sample MVD resolution is conditionally invoked. For a CU, when RD cost integer luma sample MVD resolution is much larger than that of quarter luma sample MVD resolution, the RD check of 4 luma sample MVD resolution for the CU is skipped.

[0135]

The encoding process is shown in FIG. 12. First, 1/4 pel MV is tested and the RD cost is calculated and denoted as RDCost0, then integer MV is tested and the RD cost is denoted as RDCost1. If RDCost1 < th *RDCost0 (wherein th is a positive value) , then 4-pel MV is tested; otherwise, 4-pel MV is skipped. Basically, motion information and RD cost etc. are already known for 1/4 pel MV when checking integer or 4-pel MV, which can be reused to speed up the encoding process of integer or 4-pel MV.

[0136]

FIG. 12 is a flowchart of encoding with different MV precision.

[0137]

2.3.3 Affine motion compensation prediction

[0138]

In HEVC, only translation motion model is applied for motion compensation prediction (MCP) . While in the real world, there are many kinds of motion, e.g. zoom in/out, rotation, perspective motions and the other irregular motions. In VVC, a simplified affine transform motion compensation prediction is applied with 4-parameter affine model and 6-parameter affine model. As shown in FIGS. 13A-13B, the affine motion field of the block is described by two control point motion vectors (CPMVs) for the 4-parameter affine model and 3 CPMVs for the 6-parameter affine model.

[0139]

The motion vector field (MVF) of a block is described by the following equations with the 4-parameter affine model (wherein the 4-parameter are defined as the variables a, b, e and f) in equation (1) and 6-parameter affine model (wherein the 4-parameter are defined as the variables a, b, c, d, e and f) in equation (2) respectively:

[0142]

where (mv
^{h}
_{0}, mv
^{h}
_{0}) is motion vector of the top-left corner control point, and (mv
^{h}
_{1}, mv
^{h}
_{1}) is motion vector of the top-right corner control point and (mv
^{h}
_{2}, mv
^{h}
_{2}) is motion vector of the bottom-left corner control point, all of the three motion vectors are called control point motion vectors (CPMV) , (x, y) represents the coordinate of a representative point relative to the top-left sample within current block and (mv
^{h} (x, y) , mv
^{v} (x, y) ) is the motion vector derived for a sample located at (x, y) . The CP motion vectors may be signaled (like in the affine AMVP mode) or derived on-the-fly (like in the affine merge mode) . w and h are the width and height of the current block. In practice, the division is implemented by right-shift with a rounding operation. In VTM, the representative point is defined to be the center position of a sub-block, e.g., when the coordinate of the left-top corner of a sub-block relative to the top-left sample within current block is (xs, ys) , the coordinate of the representative point is defined to be (xs+2, ys+2) . For each sub-block (i.e., 4x4 in VTM) , the representative point is utilized to derive the motion vector for the whole sub-block.

[0143]

In order to further simplify the motion compensation prediction, sub-block based affine transform prediction is applied. To derive motion vector of each M×N (both M and N are set to 4 in current VVC) sub-block, the motion vector of the center sample of each sub-block, as shown in FIG. 14, is calculated according to Equation (1) and (2) , and rounded to 1/16 fraction accuracy. Then the motion compensation interpolation filters for 1/16-pel are applied to generate the prediction of each sub-block with derived motion vector. The interpolation filters for 1/16-pel are introduced by the affine mode.

[0144]

FIG. 14 shows example of Affine MVF per sub-block.

[0145]

After MCP, the high accuracy motion vector of each sub-block is rounded and saved as the same accuracy as the normal motion vector.

[0146]

2.3.3.1 Signaling of affine prediction

[0147]

Similar to the translational motion model, there are also two modes for signaling the side information due affine prediction. They are AFFINE_INTER and AFFINE_MERGE modes.

[0148]

2.3.3.2 AF_INTER mode

[0149]

For CUs with both width and height larger than 8, AF_INTER mode can be applied. An affine flag in CU level is signalled in the bitstream to indicate whether AF_INTER mode is used.

[0150]

In this mode, for each reference picture list (List 0 or List 1) , an affine AMVP candidate list is constructed with three types of affine motion predictors in the following order, wherein each candidate includes the estimated CPMVs of the current block. The differences of the best CPMVs found at the encoder side (such as mv
_{0} mv
_{1} mv
_{2} in FIG. 17) and the estimated CPMVs are signalled. In addition, the index of affine AMVP candidate from which the estimated CPMVs are derived is further signalled.

[0151]

1) Inherited affine motion predictors

[0152]

The checking order is similar to that of spatial MVPs in HEVC AMVP list construction. First, a left inherited affine motion predictor is derived from the first block in {A1, A0} that is affine coded and has the same reference picture as in current block. Second, an above inherited affine motion predictor is derived from the first block in {B1, B0, B2} that is affine coded and has the same reference picture as in current block. The five blocks A1, A0, B1, B0, B2 are depicted in FIG. 16.

[0153]

Once a neighboring block is found to be coded with affine mode, the CPMVs of the coding unit covering the neighboring block are used to derive predictors of CPMVs of current block. For example, if A1 is coded with non-affine mode and A0 is coded with 4-parameter affine mode, the left inherited affine MV predictor will be derived from A0. In this case, the CPMVs of a CU covering A0, as denoted by

for the top-left CPMV and

for the top-right CPMV in FIG. 18B are utilized to derive the estimated CPMVs of current block, denoted by

for the top-left (with coordinate (x0, y0) ) , top-right (with coordinate (x1, y1) ) and bottom-right positions (with coordinate (x2, y2) ) of current block.

[0154]

2) Constructed affine motion predictors

[0155]

A constructed affine motion predictor consists of control-point motion vectors (CPMVs) that are derived from neighboring inter coded blocks, as shown in FIG. 17, that have the same reference picture. If the current affine motion model is 4-paramter affine, the number of CPMVs is 2, otherwise if the current affine motion model is 6-parameter affine, the number of CPMVs is 3. The top-left CPMV

is derived by the MV at the first block in the group {A, B, C} that is inter coded and has the same reference picture as in current block. The top-right CPMV

is derived by the MV at the first block in the group {D, E} that is inter coded and has the same reference picture as in current block. The bottom-left CPMV

is derived by the MV at the first block in the group {F, G} that is inter coded and has the same reference picture as in current block.

[0156]

– If the current affine motion model is 4-parameter affine, then a constructed affine motion predictor is inserted into the candidate list only if both

and

are founded, that is,

and

are used as the estimated CPMVs for top-left (with coordinate (x0, y0) ) , top-right (with coordinate (x1, y1) ) positions of current block.

[0157]

– If the current affine motion model is 6-parameter affine, then a constructed affine motion predictor is inserted into the candidate list only if

and

are all founded, that is,

and

are used as the estimated CPMVs for top-left (with coordinate (x0, y0) ) , top-right (with coordinate (x1, y1) ) and bottom-right (with coordinate (x2, y2) ) positions of current block.

[0158]

No pruning process is applied when inserting a constructed affine motion predictor into the candidate list.

[0159]

3) Normal AMVP motion predictors

[0160]

The following applies until the number of affine motion predictors reaches the maximum.

[0161]

1) Derive an affine motion predictor by setting all CPMVs equal to

if available.

[0162]

2) Derive an affine motion predictor by setting all CPMVs equal to

if available.

[0163]

3) Derive an affine motion predictor by setting all CPMVs equal to

if available.

[0164]

4) Derive an affine motion predictor by setting all CPMVs equal to HEVC TMVP if available.

[0165]

5) Derive an affine motion predictor by setting all CPMVs to zero MV.

[0166]

Note that

is already derived in constructed affine motion predictor.

[0167]

FIG. 15A shows an example of a 4-paramenter affine model. FIG. 15B shows an example of a 6-parameter affine model.

[0168]

FIG. 16 shows an example of an MVP for AF_INTER for inherited affine candidates.

[0169]

FIG. 17 shows an example of an MVP for AF_INTER for constructed affine candidates. In AF_INTER mode, when 4/6-parameter affine mode is used, 2/3 control points are required, and therefore 2/3 MVD needs to be coded for these control points, as shown in FIGS. 15A-15B. It is proposed to derive the MV as follows, i.e., mvd
_{1} and mvd
_{2} are predicted from mvd
_{0}.

[0173]

Wherein

mvd

_{i} and mv

_{1} are the predicted motion vector, motion vector difference and motion vector of the top-left pixel (i = 0) , top-right pixel (i = 1) or left-bottom pixel (i = 2) respectively, as shown in FIG. 15B. Please note that the addition of two motion vectors (e.g., mvA (xA, yA) and mvB (xB, yB) ) is equal to summation of two components separately, that is, newMV = mvA + mvB and the two components of newMV is set to (xA + xB) and (yA + yB) , respectively.

[0174]

2.3.3.3 AF_MERGE mode

[0175]

When a CU is applied in AF_MERGE mode, it gets the first block coded with affine mode from the valid neighbour reconstructed blocks. And the selection order for the candidate block is from left, above, above right, left bottom to above left as shown in FIG. 18A (denoted by A, B, C, D, E in order) . For example, if the neighbour left bottom block is coded in affine mode as denoted by A0 in FIG. 18B, the Control Point (CP) motion vectors mv
_{0}
^{N}, mv
_{1}
^{N} and mv
_{2}
^{N} of the top left corner, above right corner and left bottom corner of the neighbouring CU/PU which contains the block A are fetched. And the motion vector mv
_{0}
^{C}, mv
_{1}
^{C} and mv
_{2}
^{C} (which is only used for the 6-parameter affine model) of the top left corner/top right/bottom left on the current CU/PU is calculated based on mv
_{0}
^{N}, mv
_{1}
^{N} and mv
_{2}
^{N}. It should be noted that sub-block (e.g. 4×4 block in VTM) located at the top-left corner stores mv0, the sub-block located at the top-right corner may store mv1 if the current block is affine coded. If the current block is coded with the 6-parameter affine model, the sub-block located at the bottom-left corner stores mv2; otherwise (with the 4-parameter affine model) , LB stores mv2’. Other sub-blocks stores the MVs used for MC.

[0176]

After the CPMV of the current CU mv
_{0}
^{C}, mv
_{1}
^{C} and mv
_{2}
^{C} are derived, according to the simplified affine motion model Equation (1) and (2) , the MVF of the current CU is generated. In order to identify whether the current CU is coded with AF_MERGE mode, an affine flag is signalled in the bitstream when there is at least one neighbour block is coded in affine mode.

[0177]

FIG. 18A shows example candidates for AF_MERGE in a 5 neighboring blocks case.

[0178]

FIG. 18B shows an example of CPMV predictor derivation process.

[0179]

It is proposed that an affine merge candidate list is constructed with following steps:

[0180]

1) Insert inherited affine candidates

[0181]

Inherited affine candidate means that the candidate is derived from the affine motion model of its valid neighbor affine coded block. The maximum two inherited affine candidates are derived from affine motion model of the neighboring blocks and inserted into the candidate list. For the left predictor, the scan order is {A0, A1} ; for the above predictor, the scan order is {B0, B1, B2} .

[0182]

2) Insert constructed affine candidates

[0183]

If the number of candidates in affine merge candidate list is less than MaxNumAffineCand (e.g., 5) , constructed affine candidates are inserted into the candidate list. Constructed affine candidate means the candidate is constructed by combining the neighbor motion information of each control point.

[0184]

A) The motion information for the control points is derived firstly from the specified spatial neighbors and temporal neighbor shown in FIG. 19. CPk (k=1, 2, 3, 4) represents the k-th control point. A0, A1, A2, B0, B1, B2 and B3 are spatial positions for predicting CPk (k=1, 2, 3) ; T is temporal position for predicting CP4.

[0185]

The coordinates of CP1, CP2, CP3 and CP4 is (0, 0) , (W, 0) , (H, 0) and (W, H) , respectively, where W and H are the width and height of current block.

[0186]

FIG. 19 shows examples of candidate positions for affine merge mode.

[0187]

The motion information of each control point is obtained according to the following priority order:

[0188]

– For CP1, the checking priority is B2->B3->A2. B2 is used if it is available. Otherwise, if B2 is available, B3 is used. If both B2 and B3 are unavailable, A2 is used. If all the three candidates are unavailable, the motion information of CP1 cannot be obtained.

[0189]

– For CP2, the checking priority is B1->B0.

[0190]

– For CP3, the checking priority is A1->A0.

[0191]

– For CP4, T is used.

[0192]

B) Secondly, the combinations of controls points are used to construct an affine merge candidate.

[0193]

I. Motion information of three control points are needed 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} ) . Combinations {CP1, CP2, CP3} , {CP2, CP3, CP4} , {CP1, CP3, CP4} will be converted to a 6-parameter motion model represented by top-left, top-right and bottom-left control points.

[0194]

II. Motion information of two control points are needed to construct a 4-parameter affine candidate. The two control points can be selected from one of the two combinations ( {CP1, CP2} , {CP1, CP3} ) . The two combinations will be converted to a 4-parameter motion model represented by top-left and top-right control points.

[0195]

III. The combinations of constructed affine candidates are inserted into to candidate list as following order:

[0196]

{CP1, CP2, CP3} , {CP1, CP2, CP4} , {CP1, CP3, CP4} , {CP2, CP3, CP4} , {CP1, CP2} , {CP1, CP3}

[0197]

i. For each combination, the reference indices of list X for each CP are checked, if they are all the same, then this combination has valid CPMVs for list X. If the combination does not have valid CPMVs for both list 0 and list 1, then this combination is marked as invalid. Otherwise, it is valid, and the CPMVs are put into the sub-block merge list.

[0198]

3) Padding with zero motion vectors

[0199]

If the number of candidates in affine merge candidate list is less than 5, zero motion vectors with zero reference indices are insert into the candidate list, until the list is full.

[0200]

More specifically, for the sub-block merge candidate list, a 4-parameter merge candidate with MVs set to (0, 0) and prediction direction set to uni-prediction from list 0 (for P slice) and bi-prediction (for B slice) .

[0201]

2.3.3.4 Storage required by affine model inheritance

[0202]

__Memory required inside a CTU__

[0203]

To conduct affine model inheritance as shown in FIG. 18B, additional information is stored in each 8×8 block inside a CTU.

[0204]

1) Three CPMVs for the two reference lists, requiring 2 (2 reference lists) × 2 (x and y components) × 16 (16 bits for one component) × 3 (3 CPMVs) = 192 bits (or 24 bytes in a software design) .

[0205]

2) The coordinate of the top-left corner of the CU, requiring 2 × 13 = 26 bits (or 4 bytes in a software design) .

[0206]

3) The width and height of the CU, requiring 2 × 7 = 14 bits (or 2 bytes in a software design) .

[0207]

So totally 232 bits (or 30 bytes) side information is required to be stored for each 8×8 block. We should notice that in HEVC, the total amount of motion information required to be stored in each 8×8 block is 2 (2 reference lists) × 2 (x and y components) × 16 (16 bits for one component) × 4 (4 MVs for 4 4×4blocks) = 256 bits (or 32 bytes in a software design) .

[0208]

Therefore, the memory inside a CTU required by motion information is increased by 232/256 = 90%or 30/32 = 94%in a software design. This increases the cache memory requirement dramatically.

[0209]

__Memory required for line-buffer__

[0210]

For blocks at CTU-row boundary, it is proposed to reduce the line-buffer memory required by affine inheritance. FIG. 20 shows an example when the current CU is at the CTU row boundary. Suppose the 4×4 block covering (x
_{LE1}, y
_{LE1}) is selected to be inherited the affine model from, then the neighbouring CU covering (x
_{LE1}, y
_{LE1}) is found. The MVs of the bottom-left 4×4 block and bottom right block of the neighbouring CU are found (noted as vLE0 and vLE1 in the figure) . Then the CPMVs of the current block are calculated as

[0211]

The control point vectors

and

of the current CU are derived by using the 4-parameter model, and by

[0214]

And if the current CU uses the 6-parameter affine motion model, the control point vectors

is derived by

[0217]

Since CPMVs of neighbouring blocks out of the current CTU row are not required, CPMVs are not required to be stored in line-buffer. Moreover, the height and y-component of the coordinate of the top-left corner are not required to be stored in line-buffer. However, the width and the x-component of the coordinate of the top-left corner are still required to be stored in line-buffer.

[0218]

FIG. 20 shows an example of affine inheritance at CTU-row.

[0219]

For affine inheritance, it is proposed that the affine parameters a, b, c and d are stored for affine inheritance instead of storing CPMVs. For history motion vector prediction (HMVP) , it is proposed that the affine parameters a, b, c and d can be stored to generate a history motion vector prediction (HMVP) for affine merge or affine inter coding. The buffer/table/list to store the history-based affine models is known as affine HMVP buffer/table/list.

[0220]

3. Examples of problems solved by the embodiments and techniques described herein

[0221]

In the current design, the extra storage required by affine inheritance is still a big issue.

[0222]

Besides, there is a misalignment in terms of the MV utilized as being associated with one position but assumed to be associated with another position in the current design of affine inheritance crossing CTU rows.

[0223]

As shown in FIG. 20, the control point vectors

and

of the current CU are derived by using the 4-parameter model, and by

[0226]

And if the current CU uses the 6-parameter affine motion model, the control point vectors

is derived by

[0229]

In the above equations, (x
_{LE1}, y
_{LE}) and (x
_{LE0}, y
_{LE0}) are used as a representative position of the bottom-right and bottom-left sample coordinate of a coding unit with affine mode, respectively.

[0230]

It is assumed that v
_{LE0} is assigned to the left-bottom position of the neighbouring CU denoted as (x
_{E0}, y
_{0}) . However, v
_{LE} is assigned to the center position of the left-bottom sub-block of the neighbouring CU.

[0231]

Additionally, it is required to know the coordinate of the affine coded CU as well as the width of the CU since the two representative sub-blocks covering the bottom-left and bottom-right samples of the CU need to be identified. In above examples, the sub-block covering (x
_{LE0}, y
_{LE0}) is named as the first representative sub-block and the sub-block covering (x
_{LE1}, y
_{LE}) is named as the second representative sub-block. Therefore, additional line buffer is required to store the CU width, coordinate, etc.

[0232]

4. Examples of embodiments and techniques

[0233]

The detailed listing of items below should be considered as examples to explain general concepts. These embodiments should not be interpreted in a narrow way. Furthermore, these inventions can be combined in any manner.

[0234]

In the following discussion, SatShift (x, n) is defined as

[0236]

Shift (x, n) is defined as Shift (x, n) = (x+ offset0) >>n.

[0237]

In one example, offset0 and/or offset1 are set to (1<<n) >>1 or (1<< (n-1) ) . In another example, offset0 and/or offset1 are set to 0.

[0238]

Clip3 (min, max, x) is defined as

[0240]

__Reducing the in-CTU storage required by affine inheritance.__

[0241]

1. A first group of CPMVs (denoted as MV
^{F}0, MV
^{F}1 and MV
^{F}2, at represented points (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) , respectively) of a block used to conduct affine inheritance for following blocks may be different from a second group of CPMVs (denoted as MV
^{S}0, MV
^{S}1 and MV
^{S}2, at represented points (x
^{S}0, y
^{S}0) , (x
^{S}1, y
^{S}1) and (x
^{S}2, y
^{S}2) , respectively) of a block used to derive the MVs for each sub-block, or a third group of CPMVs (denoted as MV
^{T}0, MV
^{T}1 and MV
^{T}2, at represented points (x
^{T}0, y
^{T}0) , (x
^{T}1, y
^{T}1) and (x
^{T}2, y
^{T}2) , respectively) signaled from the encoder to the decoder.

[0242]

a) In one example, the second group CPMVs are the same to the third group of CPMVs.

[0243]

b) In one example, the first group of CPMVs are derived from the second or the third group of CPMVs.

[0244]

c) In one example, the first group of CPMVs are stored after coding/decoder a block.

[0245]

d) In one example, the represented points’ coordinator (such as (x
^{F}i, y
^{F}i) , (x
^{S}i, y
^{S}i) , (x
^{T}i, y
^{T}i) ) are defined as coordinators relative to one sub-block which is used in the affine motion compensation process.

[0246]

2. The relative offset between the representative points of two CPMVs in the first group may not depend on the width or height of the block.

[0247]

a) In one example, CPMVs of a block B denoted as MV
^{F}0, MV
^{F}1 and MV
^{F}2 at representative points (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) , respectively, are stored. In another example, CPMVs of a block B denoted as MV
^{F}0 and MV
^{F}1 at positions (x
^{F}0, y
^{F}0) and (x
^{F}1, y
^{F}1) are stored. (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) may be inside block B, or they be outside of it.

[0248]

b) In one example, y
^{F}1 = y
^{F}0, x
^{F}1 = x
^{F}0 + PW.

[0249]

c) In one example, x
^{F}1 = x
^{F}0, y
^{F}1 = y
^{F}0 + PH.

[0250]

d) In one example, y
^{F}2 = y
^{F}0, x
^{F}2 = x
^{F}0 + PW.

[0251]

e) In one example, x
^{F}2 = x
^{F}0, y
^{F}2 = y
^{F}0 + PH.

[0252]

f) In one example, y
^{F}2 = y
^{F}1, x
^{F}2 = x
^{F}1 + PW.

[0253]

g) In one example, x
^{F}2 = x
^{F}1, y
^{F}2 = y
^{F}1 + PH.

[0254]

h) PW and PH are integers.

[0255]

i. In one example, PW = 2
^{M}. For example, PW may be equal to 4, 8 16, 32, 64 or 128.

[0256]

ii. In one example, PW = -2
^{M}. For example, PW may be equal to -4, -8 -16, -32, -64 or -128.

[0257]

iii. In one example, PH = 2
^{M}. For example, PH may be equal to 4, 8 16, 32, 64 or 128.

[0258]

iv. In one example, PH = -2
^{M}. For example, PH may be equal to -4, -8 -16, -32, -64 or -128.

[0259]

v. PW and PH are not stored.

[0260]

1. In one example, they are fixed.

[0261]

2. In another example, they are signaled in VPS/SPS/PPS/Slice header/tile group header/tile/CTU.

[0262]

3. In another example, they may be different in different standard profiles/levels/tiers.

[0263]

4. In another example, they may depend on the maximum CU size or/and minimum CU size of the slice/picture.

[0264]

i) In one example, MV
^{F}0 = MV
^{S}0, (x
^{F}0, y
^{F}0) = (x
^{S}0, y
^{S}0) , or MV
^{F}0 = MV
^{T}0, (x
^{F}0, y
^{F}0) = (x
^{T}0, y
^{T}0) ;

[0265]

j) In one example, MV
^{F}0 = MV
^{S}1, (x
^{F}0, y
^{F}0) = (x
^{S}1, y
^{S}1) , or MV
^{F}0 = MV
^{T}1, (x
^{F}0, y
^{F}0) = (x
^{T}1, y
^{T}1) ;

[0266]

k) In one example, MV
^{F}0 = MV
^{S}2, (x
^{F}0, y
^{F}0) = (x
^{S}2, y
^{S}2) , or MV
^{F}0 = MV
^{T}2, (x
^{F}0, y
^{F}0) = (x
^{T}2, y
^{T}2) ;

[0267]

l) In one example, MV
^{F}0, MV
^{F}1 and MV
^{F}2 are derived from MV
^{S}0 and MV
^{S}1 by Eq. (1) with (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates.

[0268]

m) In one example, MV
^{F}0, MV
^{F}1 and MV
^{F}2 are derived from MV
^{S}0, MV
^{S}1 and MV
^{S}2 by Eq. (2) with (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates.

[0269]

n) In one example, MV
^{F}0, MV
^{F}1 and MV
^{F}2 are derived from MV
^{T}0 and MV
^{T}1 by Eq. (1) with (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates.

[0270]

o) In one example, MV
^{F}0, MV
^{F}1 and MV
^{F}2 are derived from MV
^{T}0, MV
^{T}1 and MV
^{T}2 by Eq. (2) with (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates.

[0271]

p) In one example, MV
^{F}2 is only calculated if the current block is coded with the 6-parameter affine model.

[0272]

i. Alternatively, MV
^{F}2 is calculated no matter the current block is coded with the 6-parameter affine model or the 6-parameter affine model.

[0273]

3. The difference between CPMVs are stored, instead of storing the CPMVs themselves.

[0274]

a) In one example, D1 = MV
^{F}1-MV
^{F}0 is stored;

[0275]

b) In one example, D2 = MV
^{F}2-MV
^{F}0 is stored;

[0276]

c) In one example, both D1 and D2 are stored;

[0277]

i. In one example, D2 is stored only if the current block is coded with the 6-parameter affine model.

[0278]

ii. Alternatively, D2 is stored no matter the current block is coded with the 6-parameter affine model or the 6-parameter affine model.

[0279]

d) In one example, the CPMVs and the differences between CPMVs may be stored together. For example, MV
^{F}0, D1 and D2 are stored.

[0280]

4. The stored CPMVs or differences between CPMVs may be shifted before being stored. Suppose MV is a CPMV or the difference between CPMVs to be stored, then

[0281]

a) For example, MV’x = SatShift (MVx, n) and MV’y = SatShift (MVy, n) . MV’= (MV’x, MV’y) is stored instead of MV.

[0282]

b) For example, MV’x = Shift (MVx, n) and MV’y = Shift (MVy, n) . MV’= (MV’x, MV’y) is stored instead of MV.

[0283]

c) For example, n is an integer such as 2 or 4;

[0284]

i. In one example, n depends on the motion precision.

[0285]

ii. n may be different when CPMV is stored or the difference between CPMVs is stored.

[0286]

d) In one example, the stored MV’ is left shift first before it is used in the affine inheritance.

[0287]

5. The CPMVs or differences between CPMVs to be stored may be clipped before being stored. Suppose MV is a CPMV or the difference between CPMVs to be stored, then

[0288]

a) MV’x = Clip3 (MinV, MaxV, MVx) and MV’y = Clip3 (MinV, MaxV, MVy) . MV’= (MV’x, MV’y) is stored instead of MV.

[0289]

b) In one example, MV is stored with K bits, then MinV = -2
^{K-1}, MaxV= 2
^{K-1}-1. For example, MinV = -128, MaxV= 127 when K = 8.

[0290]

i. K may be different depending on whether MV is a CPMV or a difference between CPMVs.

[0291]

c) In one example, the stored MV’ is first shifted, then clipped before it is used in the affine inheritance.

[0292]

6. The MV stored in an adjacent neighbouring basic block denoted as Badj is used to derive the affine inherited MVs of the current block.

[0293]

a) FIG. 21 shows examples of MV stored in adjacent neighbouring basic blocks: L, A, LB, AR and AL. In VTM, a basic block is a 4×4 block.

[0294]

b) The MV stored in an adjacent neighbouring basic block Badj, is denoted as MVa = (mv
^{h}
_{a}, mv
^{v}
_{a}) , then an affine inherited MV of the current block at position (x, y) denoted as (mv
^{h} (x, y) , mv
^{v} (x, y) ) is derived as

[0298]

where (x
_{0}, y
_{0}) is the representative point of MVa.

[0299]

i. (x
_{0}, y
_{0}) may be any position inside the basic block Badj. FIG. 22 shows an example. (x
_{0}, y
_{0}) may be any one of Pij with i=0…Wb-1, j = 0…Hb-1, where Wb and Hb are the width and height of the basic block. In the example, Wb=Hb=4. In an example, suppose coordinate of the top-left corner sample in Badj is (xTL, yTL) , then (x
_{0}, y
_{0}) may be any one of (xTL+i, yTL+j) with i=0…Wb-1, j = 0…Hb-1.

[0300]

1. For example, (x
_{0}, y
_{0}) may be P22 in FIG. 22.

[0301]

2. Suppose the coordinate of top-left sample of the current block is (xPos00, yPos00) , the coordinate of top-right sample of the current block is (xPos10, yPos00) , the coordinate of top-right sample of the current block is (xPos00, yPos01) , then in FIG. 21:

[0302]

a. (x
_{0}, y
_{0}) for adjacent neighbouring basic block L is (xPos00-2, yPos01-1) ;

[0303]

b. (x
_{0}, y
_{0}) for adjacent neighbouring basic block LB is (xPos00-2, yPos01+3) ;

[0304]

c. (x
_{0}, y
_{0}) for adjacent neighbouring basic block A is (xPos10-1, yPos00-2) ;

[0305]

d. (x
_{0}, y
_{0}) for adjacent neighbouring basic block AR is (xPos10+3, yPos00-2) ;

[0306]

e. (x
_{0}, y
_{0}) for adjacent neighbouring basic block AL is (xPos00-2, yPos00-2) .

[0307]

ii. (x
_{0}, y
_{0}) may be any position outside or at the boundary of the basic block Badj.

[0308]

1. For example, suppose coordinate of the top-left corner sample in Badj is (xTL, yTL) , then (x
_{0}, y
_{0}) may be any one of (xTL+i, yTL+j) with i may be -1, 0, Wb-1 or Wb; j may be -1, 0, Hb-1 or Hb.

[0309]

iii. Suppose coordinate of the top-left corner sample in Badj is (xTL, yTL) and (x
_{0}, y
_{0}) = (xTL+i, yTL+j) .

[0310]

1. i and j may depend on the position of Badj. For example, i = 0, j =Hb-1 if Badj is block L in FIG. 21, but i = Wb-1, j = 0 if Badj is block A in FIG. 21.

[0311]

2. i and j may depend on the width and height of the current block.

[0312]

3. i and j may be signaled in VPS/SPS/PPS/Slice header/tile group header/tile/CTU/CU.

[0313]

4. In another example, i and j may be different in different standard profiles/levels/tiers.

[0314]

iv. The position (x, y) may be in a sub-block of the current block, then the MV of a sub-block is inherited depending on MVa.

[0315]

v. The position (x, y) may be a corner of the current block, then a CPMV of the current block is inherited depending on MVa.

[0316]

1. In one example, the inherited CPMVs can be used to predict the signaled CPMVs of the affine inter-coded current block.

[0317]

2. In one example, the inherited CPMVs can be directly used as CPMVs of the affine merge-coded current block.

[0318]

vi. In one example, Eq. (3) is applied if the current block uses the 4-paramter affine model. Eq. (4) is applied if the current block uses the 6-paramter affine model.

[0319]

vii. Alternatively, Eq. (4) is applied no matter the current block uses the 4-paramter affine model or the 6-paramter affine model.

[0320]

c) a, b, c and d in Eq. (3) and Eq. (4) are calculated as

[0322]

i. In one example, a, b, c and d are derived from stored CPMVs in the second or third group, as declared in bullet 1, of the CU covering the adjacent neighbouring basic block Badj. Suppose the CU covering the adjacent neighbouring basic block Badj is block Z Then mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) , mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) mv
_{t2}= (mv
^{h}
_{t2}, mv
^{v}
_{t2}) are the CPMVs in the second or third group of block Z. w
_{t} and h
_{t} are the width and height of block Z.

[0323]

ii. In one example, a, b, c and d are derived from stored CPMVs in the first group, as declared in bullet 1, of the CU covering the adjacent neighbouring basic block Badj. Suppose the CU covering the adjacent neighbouring basic block Badj is block Z Then mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) , mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) mv
_{t2}= (mv
^{h}
_{t2}, mv
^{v}
_{t2}) are the CPMVs in the first group of block Z. w
_{t} and h
_{t} are PW and PH declared in bullet 2.

[0324]

iii. In one example, mv
^{h}
_{t1}-mv
^{h}
_{t0}, mv
^{v}
_{t1}-mv
^{v}
_{t0}, mv
^{h}
_{t2}-mv
^{h}
_{t0}, mv
^{v}
_{t2}-mv
^{v}
_{t0}, are fetched from the storage directly as claimed in bullet 3.

[0325]

FIG. 21 shows examples of MV stored in adjacent neighbouring basic blocks.

[0326]

FIG. 22 shows positions in a 4×4 basic block.

[0327]

__Reducing the line-buffer storage required by affine inheritance.__

[0328]

7. A first MV stored in a first basic block adjacently neighbouring to the current block, and a second MV stored in a second basic block with a known offset to the first basic block, are used to derive the CPMVs of the current block.

[0329]

a) In one example, the MV stored in the first adjacent neighbouring basic block is denoted as MVa = (mv
^{h}
_{a}, mv
^{v}
_{a}) , then an affine inherited MV of the current block at position (x, y) denoted as (mv
^{h} (x, y) , mv
^{v} (x, y) ) is derived by Eq. (3) , and a, b are derived by Eq. (5) .

[0330]

i. In one example, mv
_{t0} and mv
_{t1} in Eq. (5) are set equal to the MV stored in the first basic block and the MV stored in the second basic block, respectively. w
_{t} is set to be the horizontal offset between the two basic blocks.

[0331]

b) Alternatively, a, b are derived as

[0333]

where h
_{t} is set to be the horizontal offset between the two basic blocks.

[0334]

c) For example, w
_{t} and h
_{t} must be in a form of 2
^{N}, such as 4, 8, 16..

[0335]

d) Suppose (xLT0, yLT0) and (xLT1, yLT1) represent the coordinates of the top-left sample of the first basic block and the second basic block, respectively, then

[0336]

i. The horizontal offset between the first basic block and the second basic block is defined as xLT1 -xLT0;

[0337]

ii. The vertical offset between the first basic block and the second basic block is defined as yLT1 -yLT0;

[0338]

e) In one example, yLT1 -yLT0 must be equal to 0 when the first basic block is above the current block (such as block A, AL and AR in FIG. 23) .

[0339]

f) In one example, xLT1 -xLT0 must be equal to 0. when the first basic block is left to the current block (such as block L, LB and AL in FIG. 23) .

[0340]

g) How to choose the second basic block may depend on the position of the first block.

[0341]

i. For example, yLT1 = yLT0 and xLT1 = xLT0 –offset, where offset is a positive number such as 4, 8 or 16, if xLT0%M is not equal to 0, e.g., M =8 and offset = 4.

[0342]

ii. For example, yLT1 = yLT0 and yLT1 = yLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0%M is equal to 0, e.g., M = 8 and offset = 4.

[0343]

iii. For example, yLT1 = yLT0 and xLT1 = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0%M is equal to 0, e.g., M = 8 and offset = 4.

[0344]

iv. For example, xLT1 = xLT0 and yLT1 = yLT0 –offset, where offset is a positive number such as 4, 8 or 16, if xLT0%M is not equal to 0, e.g., M =8 and offset = 4.

[0345]

v. For example, xLT1 = xLT0 and yLT1 = yLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0%M is equal to 0, e.g., M = 8 and offset = 4.

[0346]

vi. FIG. 23 shows examples of pairs of the first and second basic blocks: AL and AL’, A and A’, AR and AR’, L and L’, LB and LB’.

[0347]

vii. For example, yLT1 = yLT0 and xLT1 = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-left to the current block (such as block AL in FIG. 23) .

[0348]

viii. For example, yLT1 = yLT0 and xLT1 = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-right to the current block (such as block AR in FIG. 23) .

[0349]

ix. For example, yLT1 = yLT0 and xLT1 = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-left to the current block (such as block AL in FIG. 23) and left boundary of the current block is also the left boundary of a CTU.

[0350]

x. For example, yLT1 = yLT0 and xLT1 = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-right to the current block (such as block AR in FIG. 23) and the right boundary of the current block is also the right boundary of a CTU.

[0351]

xi. For example, yLT1 = yLT0 and xLT1 = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block (such as block AL in FIG. 23) .

[0352]

xii. For example, yLT1 = yLT0 and xLT1 = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block (such as block AR in FIG. 23) .

[0353]

xiii. For example, yLT1 = yLT0 and xLT1 = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block (such as block AL in FIG. 23) and left boundary of the current block is also the left boundary of a CTU.

[0354]

xiv. For example, yLT1 = yLT0 and xLT1 = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block (such as block AR in FIG. 23) and the right boundary of the current block is also the right boundary of a CTU.

[0355]

h) The second basic block may be selected from several candidate basic blocks.

[0356]

i. For example, the top-left positions of the M candidate basic block are denoted as (xC
_{0}, yC
_{0}) , (xC
_{1} yC
_{1}) , … (xC
_{M-1}, yC
_{M-1}) . The M candidate basic block are checked in order, to find the one that is inter-coded, and has a MV referring to the same reference picture as the MV of the first basic block referring to. The found candidate is selected as the second basic block.

[0357]

1. In one example, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} =yLT0, xC
_{1} = xLT0 –offset, where offset is a positive number such as 4, 8 or 16.

[0358]

2. In one example, M = 2. xC
_{0} = xLT0, yC
_{0} = yLT0 –offset, xC
_{1} =xLT0, yC
_{1} = yLT0 –offset, where offset is a positive number such as 4, 8 or 16.

[0359]

3. 3) In one example, M = 2. yC0 = yLT0, xC0 = xLT0 –offset, yC1 = yLT0, xC1 = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0360]

4. 4) In one example, M = 2. xC0 = xLT0, yC0 = yLT0 –offset, xC1 = xLT0, yC1 = yLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0361]

ii. Whether to and/or how to select the second basic block from candidate basic blocks may depend on the position of the first basic block and/or the position of the current block.

[0362]

1. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-left to the current block (such as block AL in FIG. 23) .

[0363]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0364]

2. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-right to the current block (such as block AR in FIG. 23) .

[0365]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0366]

3. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-left to the current block (such as block AL in FIG. 23) and left boundary of the current block is also the left boundary of a CTU.

[0367]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0368]

4. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if the first block is above-right to the current block (such as block AR in FIG. 23) and the right boundary of the current block is also the right boundary of a CTU.

[0369]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0370]

5. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block (such as block AL in FIG. 23) .

[0371]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0372]

6. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block (such as block AR in FIG. 23) .

[0373]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0374]

7. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block (such as block AL in FIG. 23) and left boundary of the current block is also the left boundary of a CTU.

[0375]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0376]

8. For example, M = 1. yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, where offset is a positive number such as 4, 8 or 16, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block (such as block AR in FIG. 23) and the right boundary of the current block is also the right boundary of a CTU.

[0377]

a. For example, in other cases, M = 2. yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, where offset is a positive number such as 4, 8 or 16.

[0378]

i) If a second basic block, which is inter-coded and has a MV referring to the same reference picture as the MV of the first basic block referring to, cannot be found, then affine inheritance cannot be conducted from the first basic block.

[0379]

j) In one example, whether and how to apply the methods in this bullet may depend on the position of the current block.

[0380]

i. For example, the methods in this bullet are applied only when the affine model is inherited from an above neighbouring block and it is not in the current CTU or CTU row.

[0381]

ii. For example, the methods in this bullet are applied only when the affine model is inherited from an above or left neighbouring block and it is not in the current CTU.

[0382]

k) It is proposed to identify the first representative sub-block by the sub-block where the affine model inheritance is derived from. In this case, the motion vector associated with one block where the affine model inheritance is derived from is utilized as (mv
^{h}
_{a}, mv
^{v}
_{a}) in Eq. (3) .

[0383]

l) An embodiment is proposed as shown in FIG. 24.

[0384]

i. If the current block inherits affine model from a basic block BB (BB may be A, AR or AL, the top-left position of BB is (xBB, yBB) , BB must be affine coded) , then BB is treated as the first adjacent neighboring basic block. And the following process applies to find the second adjacent neighboring basic block.

[0385]

If xBB%8 == 0, then the basic block BBR right to BB is first checked (If BB is A, BBR is AR; If BB is AR, BBR is AR’; If BB is AL, BBR is AL”) ; Otherwise (xBB%8! =0) , the basic block BBL left to BB (If BB is A, BBL is A’; If BB is AR, BBL is A; If BB is AL, BBL is AL’) is first checked.

[0386]

ii. When BBR is first checked, if BBR is affine coded, and it has the same reference index as BB for a given reference list, then BBR is treated as the second adjacent neighboring basic block. Otherwise, BBL is treated as the second adjacent neighboring basic block.

[0387]

iii. When BBL is first checked, if BBL is affine coded, and it has the same reference index as BB for a given reference list, then BBL is treated as the second adjacent neighboring basic block. Otherwise, BBR is treated as the second adjacent neighboring basic block.

[0388]

m) For example, whether to find the second block from multiple candidates or from a predefined offset may depend on the position of the first block and/or the position of the current block.

[0389]

i. An embodiment is proposed as shown in FIG. 24.

[0390]

1. If the current block inherits affine model from a basic block BB (BB may be A, AR or AL, the top-left position of BB is (xBB, yBB) , BB must be affine coded) , then BB is treated as the first adjacent neighbouring basic block. And the following process applies to find the second adjacent neighbouring basic block.

[0391]

a. If BB is AL and the left boundary of the current block is the left boundary of a CTU, then only the basic block BBR right to BB (AL”) is checked. if BBR is affine coded, and it has the same reference index as BB for a given reference list, then BBR is treated as the second adjacent neighbouring basic block. Otherwise, the affine model inherited from BB is unavailable.

[0392]

b. Otherwise, if xBB%S== 0, then the basic block BBR right to BB is first checked (If BB is A, BBR is AR; If BB is AR, BBR is AR’; If BB is AL, BBR is AL”) ; Otherwise (xBB%S! =0) , the basic block BBL left to BB (If BB is A, BBL is A’; If BB is AR, BBL is A; If BB is AL, BBL is AL’) is first checked. For example, S is equal to 8.

[0393]

i. When BBR is first checked, if BBR is affine coded, and it has the same reference index as BB for a given reference list, then BBR is treated as the second adjacent neighbouring basic block. Otherwise, BBL is treated as the second adjacent neighbouring basic block.

[0394]

ii. When BBL is first checked, if BBL is affine coded, and it has the same reference index as BB for a given reference list, then BBL is treated as the second adjacent neighbouring basic block. Otherwise, BBR is treated as the second adjacent neighbouring basic block.

[0395]

n) The offset between the first and second basic unit disclosed in this document is a positive integer.

[0396]

i. In one example, offset must be in a form of 2
^{K}.

[0397]

ii. In one example, offset may depend on the minimum allowed CU width.

[0398]

iii. In one example, offset may depend on the minimum allowed CU height.

[0399]

iv. In one example, offset may depend on the basic block width.

[0400]

v. In one example, offset may depend on the basic block height.

[0401]

vi. In one example, offset may depend on the minimum allowed width of a CU that affine coding is applicable.

[0402]

vii. In one example, offset may depend on the minimum allowed height of a CU that affine coding is applicable.

[0403]

viii. In one example, offset may be signaled from the encoder to the decoder.

[0404]

o) If a basic block P is chosen as the second block when a basic block Q is the first block, then Q is not allowed to be chosen as the second block when P is the first block.

[0405]

i. In one example, P is not allowed to be the first block.

[0406]

ii. In one example, when P is the first block, the second block can only be chosen from a basic unit left to P if Q is right to P.

[0407]

iii. In one example, when P is the first block, the second block can only be chosen from a basic unit right to P if Q is left to P.

[0408]

iv. In one example, when P is the first block, the second block can only be chosen from a basic unit above to P if Q is below to P.

[0409]

v. In one example, when P is the first block, the second block can only be chosen from a basic unit below to P if Q is above to P.

[0410]

p) In one example, an adjacent neighbouring basic block may be on a row or column adjacent to the current block. For example, in FIG. 23, AL’ AR’, LB’ may also be regarded as adjacent neighbouring blocks.

[0411]

q) In one example, a first basic block is considered as “valid” if it satisfies one, several or all of the following conditions:

[0412]

i. It is inter-coded;

[0413]

ii. It is not intra-block-copy coded;

[0414]

iii. It is affine-coded;

[0415]

iv. It is affine-merge coded;

[0416]

v. It is affine-inter coded;

[0417]

r) In one example, whether a second basic block is considered as “valid” or not may depend on the information of the first basic block.

[0418]

s) In one example, a second basic block is considered as “valid” if it satisfies one, several or all of the following conditions:

[0419]

i. It is inter-coded;

[0420]

ii. It is not intra-block-copy coded;

[0421]

iii. It is affine-coded;

[0422]

iv. It is affine-merge coded;

[0423]

v. It is affine-inter coded;

[0424]

vi. It has the same inter-prediction direction as the first basic block;

[0425]

vii. It has the same reference index for reference list 0 as the first basic block;

[0426]

viii. It has the same reference index for reference list 1 as the first basic block;

[0427]

ix. It has the same inter-prediction direction and same reference indices as the first basic block;

[0428]

x. It has the same picture-order-count (POC) value of the reference picture in reference list X (X being 0 and/or 1) as that for the first basic block;

[0429]

t) In one example, each candidate above neighbouring basic block such as AR, A and AL1 in FIG. 24, is checked in order to determine whether it is a valid first basic block. For example, the order may be AR, A, AL1 or A, AR AL1.

[0430]

i. In one example, if one basic block BB is checked (BB may be AR, A or AL1) and BB is a valid first basic block, then the basic block left to it and/or the basic block right to it are checked in order to find the corresponding second basic block.

[0431]

1. In one example, the basic block BBR right to BB is checked first. An example of the detailed steps for the determination of first and second basic blocks are given as follows:

[0432]

– If BBR is a valid second basic block, then BB and BBR are output as the first basic block and second basic block;

[0433]

– Otherwise (BBR is not valid) , the basic block BBL left to BB is checked;

[0434]

i. If BBL is a valid second basic block, then BB and BBL are output as the first basic block and second basic block;

[0435]

ii. Otherwise (BBL is not valid) , then next basic block in order is checked to be the first basic block. In an alternative example, no valid first basic block and second basic block can be output.

[0436]

2. Alternatively, the basic block BBL left to BB is checked first. An example of the detailed steps for the determination of first and second basic blocks are given as follows:

[0437]

– If BBL is a valid second basic block, then BB and BBL are output as the first basic block and second basic block;

[0438]

– Otherwise (BBL is not valid) , the basic block BBR right to BB is checked;

[0439]

i. If BBR is a valid second basic block, then BB and BBR are output as the first basic block and second basic block;

[0440]

ii. Otherwise (BBR is not valid) , then next basic block in order is checked determine whether it is a valid first basic block.

[0441]

1. Alternative, no valid first basic block and second basic block can be output from above neighbouring basic blocks.

[0442]

ii. In one example, if one basic block BB is checked (BB may be AR, A or AL1) and BB is a valid first basic block, then only the basic block BBL left to it is checked to find the corresponding second basic block. An example of the detailed steps for the determination of first and second basic blocks are given as follows:

[0443]

– If BBL is a valid second basic block, then BB and BBL are output as the first basic block and second basic block;

[0444]

– Otherwise (BBL is not valid) , then BB and the basic block BBR right to BB are output as the first basic block and second basic block;

[0445]

a. Alternatively, BB is not used as the first basic block and the next basic block in order is checked to determine whether it is a valid first basic block.

[0446]

b. Alternative, no valid first basic block and second basic block can be output from above neighbouring basic blocks.

[0447]

iii. Alternatively, if basic block BB is checked (BB may be AR, A or AL1) and BB is a valid first basic block, then only the basic block BBR right to it is checked to find the corresponding second basic block. An example of the detailed steps for the determination of first and second basic blocks are given as follows:

[0448]

– If BBR is a valid second basic block, then BB and BBR are output as the first basic block and second basic block;

[0449]

– Otherwise (BBR is not valid) , then BB and the basic block BBL left to BB are output as the first basic block and second basic block;

[0450]

a. Alternatively, BB is not used as the first basic block and the next basic block in order is checked to determine whether it is a valid first basic block.

[0451]

b. Alternative, no valid first basic block and second basic block can be output from above neighbouring basic blocks.

[0452]

FIG. 27 and FIG. 28 show two exemplary flowcharts of how to choose the first basic block and the second basic block.

[0453]

iv. In one example, which above neighbouring basic blocks may be checked for the determination of first basic blocks may depend on the position of the current block and/or sub-block sizes of affine motion compensation.

[0454]

1. For example, if the current block is at the left boundary of a CTU, the candidate basic blocks are AR, A and AL” in FIG. 24. For example, if xPos00%CTU_W == 0 (xPos00 is the top-left coordinate of the current block and CTU_W is the width of a CTU) the current block is at the left boundary of a CTU.

[0455]

a. For example, if the current block is at the left boundary of a CTU, the candidate basic blocks are AR, A and AL”; Otherwise, the candidates are AR, A and AL1.

[0456]

v. Whether a basic block can be used as the first basic block may depend on the position of the current block.

[0457]

1. For example, if the current block is at the left boundary of a CTU, the basic block AL1 in FIG. 24 cannot be used as the first basic block.

[0458]

2. For example, if the current block is at the left boundary of a CTU, the basic block AL’ in FIG. 24 cannot be used as the first basic block.

[0459]

3. For example, if the current block is at the right boundary of a CTU, the basic block AR in FIG. 24 cannot be used as the first basic block. For example, if (xPos00+W) %CTU_W == 0 (xPos00 is the top-left coordinate of the current block, W is the width of the current block and CTU_W is the width of a CTU) , the current block is at the right boundary of a CTU.

[0460]

4. For example, if the current block is at the right boundary of a CTU, the basic block AR’ in FIG. 24 cannot be used as the first basic block.

[0461]

vi. Whether a basic block can be used as the second basic block may depend on the position of the current block.

[0462]

1. For example, if the current block is at the left boundary of a CTU, the basic block AL1 in FIG. 24 cannot be used as the second basic block.

[0463]

2. For example, if the current block is at the left boundary of a CTU, the basic block AL’ in FIG. 24 cannot be used as the second basic block.

[0464]

3. For example, if the current block is at the right boundary of a CTU, the basic block AR in FIG. 24 cannot be used as the second basic block.

[0465]

4. For example, if the current block is at the right boundary of a CTU, the basic block AR’ in FIG. 24 cannot be used as the second basic block.

[0466]

u) In one example, the first basic block and the second basic block may be exchanged.

[0467]

i. In one example, the output first and second basic blocks are firstly exchanged and then utilized for decoding one block.

[0468]

ii. Alternatively, the determination process of first and second basic blocks mentioned above may be exchanged.

[0469]

FIG. 23 shows examples of MVs of two adjacent neighbouring blocks.

[0470]

__Extension on stored affine parameters__

[0471]

8. The stored affine parameters may be shifted before being stored. Suppose m (m may be a, b, c or d) is to be stored, then

[0472]

a) For example, m’ = SatShift (m, n) . m’ is stored instead of m.

[0473]

b) For example, m’ = Shift (m, n) . m’ is stored instead of m.

[0474]

c) For example, n is an integer such as 2 or 4;

[0475]

i. In one example, n depends on the motion precision.

[0476]

ii. In one example, n may be different for different affine parameters.

[0477]

i. In one example, n may be signaled in VPS/SPS/PPS/Slice header/tile group header/tile/CTU/CU.

[0478]

ii. In another example, n may be different in different standard profiles/levels/tiers.

[0479]

d) In one example, the stored affine parameter is left shift first before it is used in the affine inheritance.

[0480]

e) In one example, the stored m’ is first shifted, then clipped before it is used in the affine inheritance.

[0481]

__Extension on affine HMVP__

[0482]

9. In one example, the CPMVs in the first group as disclosed in bullet 1 and bullet 2 may be stored into the affine HMVP buffer/table/list to represent one history-based candidate affine model.

[0483]

10. In one example, the differences between CPMVs as disclosed in bullet 3 may be stored into the affine HMVP buffer/table/list to represent one history-based candidate affine model.

[0484]

11. All methods proposed in this document such as bullet 4 and bullet 5 can be applied to the CPMVs or differences between CPMVs stored in the affine HMVP buffer/table/list.

[0485]

12. All the methods disclosed in bullet 6 can be applied when CPMVs or differences between CPMVs do not come from a neighbouring block but from the affine history buffer/table/list.

[0486]

__More Accurate MV Position__

[0487]

13. It is proposed that the position of a MV used to conduct affine inheritance from one block should be aligned to the position that used to derive the MV for the block.

[0488]

a) In one example as shown in FIG. 20, the control point vectors

and

of the current CU are derived by using the 4-parameter model, and by

[0491]

And if the current CU uses the 6-parameter affine motion model, the control point vectors

is derived by

[0494]

i. For example, offx=1 and offy=-1;

[0495]

ii. For example, offx=2 and offy=-2;

[0496]

iii. For example, offx=1 and offy=-2;

[0497]

iv. For example, offx=2 and offy=-1;

[0498]

v. For example, offx=1 and offy=-3;

[0499]

vi. For example, offx=2 and offy=-3;

[0500]

b) In one example as shown in FIG. 20, the control point vectors

and

of the current CU are derived by using the 4-parameter model, and by

[0503]

And if the current CU uses the 6-parameter affine motion model, the control point vectors

is derived by

[0506]

i. For example, offx=-1 and offy=-1;

[0507]

ii. For example, offx=-2 and offy=-2;

[0508]

iii. For example, offx=-1 and offy=-2;

[0509]

iv. For example, offx=-2 and offy=-1;

[0510]

v. For example, offx=-1 and offy=-3;

[0511]

vi. For example, offx=-2 and offy=-3;

[0513]

In one embodiment, bullet 6 is applied to conduct affine inheritance not at the CTU row boundary. An exemplary decoding process is specified as (the section numbers here refer to the current release of the VVC standard) :

[0514]

8.3.3.2 Derivation process for motion vectors and reference indices in subblock merge mode

[0516]

2. When sps_affine_enabled_flag is equal to 1, the sample locations (xNbA
_{0}, yNbA
_{0}) , (xNbA
_{1}, yNbA
_{1}) , (xNbA
_{2}, yNbA
_{2}) , (xNbB
_{0}, yNbB
_{0}) , (xNbB
_{1}, yNbB
_{1}) , (xNbB
_{2}, yNbB
_{2}) , (xNbB
_{3}, yNbB
_{3}) , and the variables numSbX and numSbY are derived as follows:

[0517]

(xA
_{0}, yA
_{0}) = (xCb -2, yCb + cbHeight + 2) (8-309)

[0518]

(xA
_{1}, yA
_{1}) = (xCb -2, yCb + cbHeight -2) (8-310)

[0519]

(xA
_{2}, yA
_{2}) = (xCb -1, yCb) (8-311)

[0520]

(xB
_{0}, yB
_{0}) = (xCb + cbWidth + 2 , yCb -2) (8-312)

[0521]

(xB
_{1}, yB
_{1}) = (xCb + cbWidth -2, yCb -2) (8-313)

[0522]

(xB
_{2}, yB
_{2}) = (xCb -2, yCb -2) (8-314)

[0523]

(xB
_{3}, yB
_{3}) = (xCb, yCb -1) (8-315)

[0524]

numSbX = cbWidth >> 2 (8-316)

[0525]

numSbY = cbHeight >> 2 (8-317)

[0526]

3. When sps_affine_enabled_flag is equal to 1, the variable availableFlagA is set equal to FALSE and the following applies for (xNbA
_{k}, yNbA
_{k}) from (xNbA
_{0}, yNbA
_{0}) to (xNbA
_{1}, yNbA
_{1}) :

[0527]

– The availability derivation process for a block as specified in clause 6.4. X is invoked with the current luma location (xCurr, yCurr) set equal to (xCb, yCb) and the neighbouring luma location (xNbA
_{k}, yNbA
_{k}) as inputs, and the output is assigned to the block availability flag availableA
_{k}.

[0528]

– When availableA
_{k} is equal to TRUE and MotionModelIdc [xNbA
_{k}] [yNbA
_{k}] is larger than 0 and availableFlagA is equal to FALSE, the following applies:

[0529]

– The variable availableFlagA is set equal to TRUE, motionModelIdcA is set equal to MotionModelIdc [xNbA
_{k}] [yNbA
_{k}] , (xNb, yNb) is set equal to (CbPosX [xNbA
_{k}] [yNbA
_{k}] , CbPosY [xNbA
_{k}] [yNbA
_{k}] ) , nbW is set equal to CbWidth [xNbA
_{k}] [yNbA
_{k}] , nbH is set equal to CbHeight [xNbA
_{k}] [yNbA
_{k}] , and numCpMv is set equal to MotionModelIdc [xNbA
_{k}] [yNbA
_{k}] + 1.

[0530]

– For X being replaced by either 0 or 1, the following applies:

[0531]

– When PredFlagLX [xNbA
_{k}] [yNbA
_{k}] is equal to 1, the derivation process for luma affine control point motion vectors from a neighbouring block as specified in clause 8.3.3.5 is invoked with the luma coding block location (xCb, yCb) , the luma coding block width and height (cbWidth, cbHeight) , the neighbouring luma coding block location (xNb, yNb) , the neighbouring sub-block center location (xNbA
_{k}, yNbA
_{k}) , the neighbouring luma coding block width and height (nbW, nbH) , and the number of control point motion vectors numCpMv as input, the control point motion vector predictor candidates cpMvLXA [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0532]

– The following assignments are made:

[0533]

predFlagLXA = PredFlagLX [xNbA
_{k}] [yNbA
_{k}] (8-318)

[0534]

refIdxLXA = RefIdxLX [xNbAk] [yNbAk] (8-319)

[0535]

4. When sps_affine_enabled_flag is equal to 1, the variable availableFlagB is set equal to FALSE and the following applies for (xNbB
_{k}, yNbB
_{k}) from (xNbB
_{0}, yNbB
_{0}) to (xNbB
_{2}, yNbB
_{2}) :

[0536]

– The availability derivation process for a block as specified in clause 6.4. X is invoked with the current luma location (xCurr, yCurr) set equal to (xCb, yCb) and the neighbouring luma location (xNbB
_{k}, yNbB
_{k}) as inputs, and the output is assigned to the block availability flag availableB
_{k}.

[0537]

– When availableB
_{k} is equal to TRUE and MotionModelIdc [xNbB
_{k}] [yNbB
_{k}] is larger than 0 and availableFlagB is equal to FALSE, the following applies:

[0538]

– The variable availableFlagB is set equal to TRUE, motionModelIdcB is set equal to MotionModelIdc [xNbB
_{k}] [yNbB
_{k}] , (xNb, yNb) is set equal to (CbPosX [xNbAB] [yNbB
_{k}] , CbPosY [xNbB
_{k}] [yNbB
_{k}] ) , nbW is set equal to CbWidth [xNbB
_{k}] [yNbB
_{k}] , nbH is set equal to CbHeight [xNbB
_{k}] [yNbB
_{k}] , and numCpMv is set equal to MotionModelIdc [xNbB
_{k}] [yNbB
_{k}] + 1.

[0539]

– For X being replaced by either 0 or 1, the following applies:

[0540]

– When PredFlagLX [xNbB
_{k}] [yNbB
_{k}] is equal to TRUE, the derivation process for luma affine control point motion vectors from a neighbouring block as specified in clause 8.3.3.5 is invoked with the luma coding block location (xCb, yCb) , the luma coding block width and height (cbWidth, cbHeight) , the neighbouring luma coding block location (xNb, yNb) , the neighbouring sub-block center location (xNbB
_{k}, yNbB
_{k}) , the neighbouring luma coding block width and height (nbW, nbH) , and the number of control point motion vectors numCpMv as input, the control point motion vector predictor candidates cpMvLXB [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0541]

– The following assignments are made:

[0542]

8.3.3.5 Derivation process for luma affine control point motion vectors from a neighbouring block

[0543]

Inputs to this process are:

[0544]

– a luma location (xCb, yCb) specifying the top-left sample of the current luma coding block relative to the top-left luma sample of the current picture,

[0545]

– two variables cbWidth and cbHeight specifying the width and the height of the current luma coding block,

[0546]

– a luma location (xNb, yNb) specifying the top-left sample of the neighbouring luma coding block relative to the top-left luma sample of the current picture,

[0547]

– a luma location (xNbC, yNbC) specifying the center sample of the neighbouring luma coding sub-block relative to the top-left luma sample of the current picture,

[0548]

– two variables nNbW and nNbH specifying the width and the height of the neighbouring luma coding block,

[0549]

– the number of control point motion vectors numCpMv.

[0550]

Output of this process are the luma affine control point vectors cpMvLX [cpIdx] with cpIdx = 0 .. numCpMv -1 and X being 0 or 1.

[0551]

The variable isCTUboundary is derived as follows:

[0552]

– If all the following conditions are true, isCTUboundary is set equal to TRUE:

[0553]

– ( (yNb + nNbH) %CtbSizeY) is equal to 0

[0554]

– yNb + nNbH is equal to yCb

[0555]

– Otherwise, isCTUboundary is set equal to FALSE.

[0556]

The variables log2NbW and log2NbH are derived as follows:

[0557]

log2NbW = Log2 (nNbW) (8-369)

[0558]

log2NbH = Log2 (nNbH) (8-370)

[0559]

The variables mvScaleHor, mvScaleVer, dHorX and dVerX are derived as follows:

[0560]

– If isCTUboundary is equal to TRUE, the following applies:

[0561]

mvScaleHor = MvLX [xNb] [yNb + nNbH -1] [0] << 7 (8-371)

[0562]

mvScaleVer = MvLX [xNb] [yNb + nNbH -1] [1] << 7 (8-372)

[0563]

dHorX = (MvLX [xNb + nNbW -1] [yNb + nNbH -1] [0] -MvLX [xNb] [yNb + n NbH -1] [0] ) << (7 -log2NbW) (8-373)

[0564]

dVerX = (MvLX [xNb + nNbW -1] [yNb + nNbH -1] [1] -MvLX [xNb] [yNb + n NbH -1] [1] ) << (7 -log2NbW) (8-374)

[0565]

– Otherwise (isCTUboundary is equal to FALSE) , the following applies:

[0566]

mvScaleHor = MvLX [xNbC] [yNbC] [0] [0] << 7 (8-375)

[0567]

mvScaleVer = MvLX [xNbC] [yNbC] [0] [1] << 7 (8-376)

[0568]

dHorX = (CpMvLX [xNb + nNbW -1] [yNb] [1] [0] -CpMvLX [xNb] [yNb] [0] [0] ) << (7 -log2NbW) (8-377)

[0569]

dVerX = (CpMvLX [xNb + nNbW -1] [yNb] [1] [1] -CpMvLX [xNb] [yNb] [0] [1] ) << (7 -log2NbW) (8-378)

[0570]

The variables dHorY and dVerY are derived as follows:

[0571]

– If isCTUboundary is equal to FALSE and MotionModelIdc [xNb] [yNb] is equal to 2, the following applies:

[0572]

dHorY = (CpMvLX [xNb] [yNb + nNbH -1] [2] [0] -CpMvLX [xNb] [yNb] [2] [0] ) << (7 -log2NbH) (8-379)

[0573]

dVerY = (CpMvLX [xNb] [yNb + nNbH -1] [2] [1] -CpMvLX [xNb] [yNb] [2] [1] ) << (7 -log2NbH) (8-380)

[0574]

– Otherwise (isCTUboundary is equal to TRUE or MotionModelIdc [xNb] [yNb] is equal to 1) , the following applies,

[0575]

dHorY = -dVerX (8-381)

[0576]

dVerY = dHorX (8-382)

[0577]

The luma affine control point motion vectors cpMvLX [cpIdx] with cpIdx = 0 .. numCpMv -1 and X being 0 or 1 are derived as follows:

[0578]

– When isCTUboundary is equal to TRUE, yNb is set equal to yCb. Then xNbC is set equal to xNb, yNbC is set equal to yNb.

[0579]

– The first two control point motion vectors cpMvLX [0] and cpMvLX [1] are derived as follows:

[0580]

cpMvLX [0] [0] = (mvScaleHor + dHorX * (xCb -xNbC) + dHorY * (yCb -yNbC) ) (8-383)

[0581]

cpMvLX [0] [1] = (mvScaleVer + dVerX * (xCb -xNbC) + dVerY * (yCb -yNbC) ) (8-384)

[0582]

cpMvLX [1] [0] = (mvScaleHor + dHorX * (xCb + cbWidth -xNbC) + dHorY *(yCb -yNbC) ) (8-385)

[0583]

cpMvLX [1] [1] = (mvScaleVer + dVerX * (xCb + cbWidth -xNbC) + dVerY * (y Cb -yNbC) ) (8-386)

[0584]

– If numCpMv is equal to 3, the third control point vector cpMvLX [2] is derived as follows:

[0585]

cpMvLX [2] [0] = (mvScaleHor + dHorX * (xCb -xNbC) + dHorY * (yCb + cbHei ght -yNbC) ) (8-387)

[0586]

cpMvLX [2] [1] = (mvScaleVer + dVerX * (xCb -xNbC) + dVerY * (yCb + cbHei ght -yNbC) ) (8-388)

[0587]

– The rounding process for motion vectors as specified in clause 8.3.2.12 is invoked the with mvX set equal to cpMvLX [cpIdx] , rightShift set equal to 7, and leftShift set equal to 0 as inputs and the rounded cpMvLX [cpIdx] as output, with X being 0 or 1 and cpIdx = 0 .. numCpMv -1.

[0589]

8.3.3.7 Derivation process for luma affine control point motion vector predictors

[0590]

Inputs to this process are:

[0592]

1. The number of control point motion vector predictor candidates in the list numCpMvpCandLX is set equal to 0.

[0593]

2. The variables availableFlagA and availableFlagB are both set equal to FALSE.

[0594]

3. The sample locations (xNbA
_{0}, yNbA
_{0}) , (xNbA
_{1}, yNbA
_{1}) , (xNbA
_{2}, yNbA
_{2}) , (xNbB
_{0}, yNbB
_{0}) , (xNbB
_{1}, yNbB
_{1}) , and (xNbB
_{2}, yNbB
_{2}) are derived as follows:

[0595]

(xA
_{0}, yA
_{0}) = (xCb -2, yCb + cbHeight + 2) (8-440)

[0596]

(xA
_{1}, yA
_{1}) = (xCb -2, yCb + cbHeight -2) (8-441)

[0597]

(xB
_{0}, yB
_{0}) = (xCb + cbWidth + 2, yCb -2) (8-442)

[0598]

(xB
_{1}, yB
_{1}) = (xCb + cbWidth -2, yCb -2) (8-443)

[0599]

(xB
_{2}, yB
_{2}) = (xCb -2, yCb -2) (8-444)

[0600]

4. The following applies for (xNbA
_{k}, yNbA
_{k}) from (xNbA
_{0}, yNbA
_{0}) to (xNbA
_{1}, yNbA
_{1}) :

[0601]

– The availability derivation process for a block as specified in clause 6.4. X [Ed. (BB) : Neighbouring blocks availability checking process tbd] is invoked with the current luma location (xCurr, yCurr) set equal to (xCb, yCb) and the neighbouring luma location (xNbA
_{k}, yNbA
_{k}) as inputs, and the output is assigned to the block availability flag availableA
_{k}.

[0602]

– When availableA
_{k} is equal to TRUE and MotionModelIdc [xNbA
_{k}] [yNbA
_{k}] is larger than 0 and availableFlagA is equal to FALSE, the following applies:

[0603]

– The variable (xNb, yNb) is set equal to (CbPosX [xNbA
_{k}] [yNbA
_{k}] , CbPosY [xNbA
_{k}] [yNbA
_{k}] ) , nbW is set equal to CbWidth [xNbA
_{k}] [yNbA
_{k}] , and nbH is set equal to CbHeight [xNbA
_{k}] [yNbA
_{k}] .

[0604]

– If PredFlagLX [xNbA
_{k}] [yNbA
_{k}] is equal to 1 and DiffPicOrderCnt (RefPicListX [RefIdxLX [xNbA
_{k}] [yNbA
_{k}] ] , RefPicListX [refI dxLX] ) is equal to 0, the following applies:

[0605]

– The variable availableFlagA is set equal to TRUE

[0606]

– The derivation process for luma affine control point motion vectors from a neighbouring block as specified in clause 8.3.3.5 is invoked with the luma coding block location (xCb, yCb) , the luma coding block width and height (cbWidth, cbHeight) , the neighbouring luma coding block location (xNb, yNb) , the neighbouring luma coding block width and height (nbW, nbH) , and the number of control point motion vectors numCpMv as input, the control point motion vector predictor candidates cpMvpLX [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0607]

– The rounding process for motion vectors as specified in clause 8.3.2.12 is invoked with mvX set equal to cpMvpLX [cpIdx] , rightShift set equal to 2, and leftShift set equal to 2 as inputs and the rounded cpMvpLX [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0608]

– The following assignments are made:

[0609]

cpMvpListLX [numCpMvpCandLX] [0] = cpMvpLX [0] (8-445)

[0610]

cpMvpListLX [numCpMvpCandLX] [1] = cpMvpLX [1] (8-446)

[0611]

cpMvpListLX [numCpMvpCandLX] [2] = cpMvpLX [2] (8-447)

[0612]

numCpMvpCandLX = numCpMvpCandLX + 1 (8-448)

[0613]

– Otherwise if PredFlagLY [xNbA
_{k}] [yNbA
_{k}] (with Y = ! X) is equal to 1 and DiffPicOrderCnt (RefPicListY [RefIdxLY [xNbA
_{k}] [yNbA
_{k}] ] , RefPicListX [refI dxLX] ) is equal to 0, the following applies:

[0614]

– The variable availableFlagA is set equal to TRUE

[0615]

– The derivation process for luma affine control point motion vectors from a neighbouring block as specified in clause 8.3.3.5 is invoked with the luma coding block location (xCb, yCb) , the luma coding block width and height (cbWidth, cbHeight) , the neighbouring luma coding block location (xNb, yNb) , the neighbouring sub-block center location (xNbA
_{k}, yNbA
_{k}) , the neighbouring luma coding block width and height (nbW, nbH) , and the number of control point motion vectors numCpMv as input, the control point motion vector predictor candidates cpMvpLY [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0616]

– The rounding process for motion vectors as specified in clause 8.3.2.12 is invoked with mvX set equal to cpMvpLY [cpIdx] , rightShift set equal to 2, and leftShift set equal to 2 as inputs and the rounded cpMvpLY [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0617]

– The following assignments are made:

[0618]

cpMvpListLX [numCpMvpCandLX] [0] = cpMvpLY [0] (8-449)

[0619]

cpMvpListLX [numCpMvpCandLX] [1] = cpMvpLY [1] (8-450)

[0620]

cpMvpListLX [numCpMvpCandLX] [2] = cpMvpLY [2] (8-451)

[0621]

numCpMvpCandLX = numCpMvpCandLX + 1 (8-452)

[0622]

5. The following applies for (xNbB
_{k}, yNbB
_{k}) from (xNbB
_{0}, yNbB
_{0}) to (xNbB
_{2}, yNbB
_{2}) :

[0623]

– The availability derivation process for a block as specified in clause 6.4. X [Ed. (BB) : Neighbouring blocks availability checking process tbd] is invoked with the current luma location (xCurr, yCurr) set equal to (xCb, yCb) and the neighbouring luma location (xNbB
_{k}, yNbB
_{k}) as inputs, and the output is assigned to the block availability flag availableB
_{k}.

[0624]

– When availableB
_{k} is equal to TRUE and MotionModelIdc [xNbB
_{k}] [yNbB
_{k}] is larger than 0 and availableFlagB is equal to FALSE, the following applies:

[0625]

– The variable (xNb, yNb) is set equal to (CbPosX [xNbB
_{k}] [yNbB
_{k}] , CbPosY [xNbB
_{k}] [yNbB
_{k}] ) , nbW is set equal to CbWidth [xNbB
_{k}] [yNbB
_{k}] , and nbH is set equal to CbHeight [xNbB
_{k}] [yNbB
_{k}] .

[0626]

– If PredFlagLX [xNbB
_{k}] [yNbB
_{k}] is equal to 1 and DiffPicOrderCnt (RefPicListX [RefIdxLX [xNbB
_{k}] [yNbB
_{k}] ] , RefPicListX [refI dxLX] ) is equal to 0, the following applies:

[0627]

– The variable availableFlagB is set equal to TRUE

[0628]

– The derivation process for luma affine control point motion vectors from a neighbouring block as specified in clause 8.3.3.5 is invoked with the luma coding block location (xCb, yCb) , the luma coding block width and height (cbWidth, cbHeight) , the neighbouring luma coding block location (xNb, yNb) , the neighbouring sub-block center location (xNbB
_{k}, yNbB
_{k}) , the neighbouring luma coding block width and height (nbW, nbH) , and the number of control point motion vectors numCpMv as input, the control point motion vector predictor candidates cpMvpLX [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0629]

– The rounding process for motion vectors as specified in clause 8.3.2.12 is invoked with mvX set equal to cpMvpLX [cpIdx] , rightShift set equal to 2, and leftShift set equal to 2 as inputs and the rounded cpMvpLX [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0630]

– The following assignments are made:

[0631]

cpMvpListLX [numCpMvpCandLX] [0] = cpMvpLX [0] (8-453)

[0632]

cpMvpListLX [numCpMvpCandLX] [1] = cpMvpLX [1] (8-454)

[0633]

cpMvpListLX [numCpMvpCandLX] [2] = cpMvpLX [2] (8-455)

[0634]

numCpMvpCandLX = numCpMvpCandLX + 1 (8-456)

[0635]

– Otherwise if PredFlagLY [xNbB
_{k}] [yNbB
_{k}] (with Y = ! X) is equal to 1 and DiffPicOrderCnt (RefPicListY [RefIdxLY [xNbB
_{k}] [yNbB
_{k}] ] , RefPicListX [refI dxLX] ) is equal to 0, the following applies:

[0636]

– The variable availableFlagB is set equal to TRUE

[0637]

– The derivation process for luma affine control point motion vectors from a neighbouring block as specified in clause 8.3.3.5 is invoked with the luma coding block location (xCb, yCb) , the luma coding block width and height (cbWidth, cbHeight) , the neighbouring luma coding block location (xNb, yNb) , the neighbouring luma coding block width and height (nbW, nbH) , and the number of control point motion vectors numCpMv as input, the control point motion vector predictor candidates cpMvpLY [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0638]

– The rounding process for motion vectors as specified in clause 8.3.2.12 is invoked with mvX set equal to cpMvpLY [cpIdx] , rightShift set equal to 2, and leftShift set equal to 2 as inputs and the rounded cpMvpLY [cpIdx] with cpIdx = 0 .. numCpMv -1 as output.

[0639]

– The following assignments are made:

[0640]

cpMvpListLX [numCpMvpCandLX] [0] = cpMvpLY [0] (8-457)

[0641]

cpMvpListLX [numCpMvpCandLX] [1] = cpMvpLY [1] (8-458)

[0642]

cpMvpListLX [numCpMvpCandLX] [2] = cpMvpLY [2] (8-459)

[0643]

numCpMvpCandLX = numCpMvpCandLX + 1 (8-460)

[0644]

FIG. 24 is a block diagram of a video processing apparatus 2600. The apparatus 2600 may be used to implement one or more of the methods described herein. The apparatus 2600 may be embodied in a smartphone, tablet, computer, Internet of Things (IoT) receiver, and so on. The apparatus 2600 may include one or more processors 2602, one or more memories 2604 and video processing hardware 2606. The processor (s) 2602 may be configured to implement one or more methods described in the present document. The memory (memories) 2604 may be used for storing data and code used for implementing the methods and techniques described herein. The video processing hardware 2606 may be used to implement, in hardware circuitry, some techniques described in the present document.

[0645]

FIG. 25 is a flowchart for an example method 2500 of video processing. The method 2500 includes associating (2502) , with a current video block, a first group of motion vectors (MVs) for determining inherited motion information of other video blocks, a second group of MVs for deriving MVs of sub-blocks of the current video block and a third group of MVs that is included in a bitstream representation of the current video block; and performing (2504) a conversion between the current video block and the bitstream representation using the first group of MVs, the second group of MVs or the third group of MVs.

[0646]

It will be appreciated that several techniques have been disclosed that will benefit video encoder and decoder embodiments incorporated within video processing devices such as smartphones, laptops, desktops, and similar devices by allowing a reduction in the amount of memory used for storing CPMVs during affine coding based video coding and decoding. Various embodiments and techniques may be described using the following clause-based description.

[0647]

1. A method of video processing, comprising:

[0648]

associating, with a current video block, a first group of motion vectors (MVs) for determining inherited motion information of other video blocks, a second group of MVs for deriving MVs of sub-blocks of the current video block and a third group of MVs that is included in a bitstream representation of the current video block; and

[0649]

performing a conversion between the current video block and the bitstream representation using the first group of MVs, the second group of MVs or the third group of MVs.

[0650]

2. The method of clause 1, wherein the first group of MVs comprises control point MVs (CPMVs) , MVF0, MVF1 and MVF2, at represented points (xF0, yF0) , (xF1, yF1) and (xF2, yF2) , respectively.

[0651]

3. The method of any of clauses 1-2, wherein the second group of MVs comprises control point MVs (CPMVs) , denoted MVS0, MVS1 and MVS2, at represented points (xS0, yS0) , (xS1, yS1) and (xS2, yS2) , respectively.

[0652]

4. The method of any of clauses 1-3, wherein the third group of MVs comprises control point MVs (CPMVs) CPMVs, denoted as MVT0, MVT1 and MVT2, at represented points (xT0, yT0) , (xT1, yT1) and (xT2, yT2) , respectively.

[0653]

5. The method of any of clauses 1-4, wherein the second group of MVs are same as the third group of MVs.

[0654]

6. The method of any of clauses 1-5, wherein the first group of MVs are derived from the second group of MVs or the third group of MVs.

[0655]

7. The method of any of clauses 1-2, wherein a relative offset between representative points of two control point MVs in the first group is independent of a width or a height of the current video block.

[0656]

8. The method of clause 2, wherein:

[0657]

yF1 = yF0, xF1 = xF0 + PW, or

[0658]

xF1 = xF0, yF1 = yF0 + PH, or

[0659]

yF2 = yF0, xF2 = xF0 + PW, or

[0660]

xF2 = xF0, yF2 = yF0 + PH, or

[0661]

yF2 = yF1, xF2 = xF1 + PW, or

[0662]

xF2 = xF1, yF2 = yF1 + PH, or

[0663]

Where PW and PH are integers.

[0664]

8. The method of any of clauses 4-7, wherein

[0665]

MVF0 = MVS0, (xF0, yF0) = (xS0, yS0) , or MVF0 = MVT0, (xF0, yF0) = (xT0, yT0) ; or

[0666]

MVF0 = MVS1, (xF0, yF0) = (xS1, yS1) , or MVF0 = MVT1, (xF0, yF0) = (xT1, yT1) ; or

[0667]

MVF0 = MVS2, (xF0, yF0) = (xS2, yS2) , or MVF0 = MVT2, (xF0, yF0) = (xT2, yT2) .

[0668]

9. The method of any of clauses 2-8, further including storing a difference value D1 =MVF1-MVF0.

[0669]

10. The method of any of clauses 2-9, further including storing a difference value D2 =MVF2-MVF0.

[0670]

11. The method of any of clauses 9-10, wherein the storing includes storing a bit shifted version of motion vector values.

[0671]

12. The method of clause 11, wherein the storing further includes clipping motion vector values prior to storing.

[0672]

Additional examples and embodiments of clauses 1-12 are described in Section 4, e.g., Items 1-3.

[0673]

13. A method of video processing, comprising: performing a conversion between a current block and a bitstream representation of the current block using affine inherited motion vectors (MVs) for the current block, wherein the affine inherited MVs are derived from (1) MVs stored for an adjacent neighboring basic block, denoted as Badj, or (2) an affine history list.

[0674]

14. The method of clause 13, wherein the MVs stored for Badj include: L (left) , A (above) , LB (left below) , AR (above right) and AL (above left) , and wherein Badj is a 4x4 size block.

[0675]

15. The method of any of clauses 13-14, wherein a MV at a position (x, y) in the current block is computed using a motion vector MVa of Badj at a position (x0, y0) , wherein (x0, y0) is one of: (a) a position inside Badj, or (b) a position on outside or on boundary of Badj.

[0676]

16. The method of clause 15, wherein the position (x, y) is (1) in a sub-block of the current block, or (2) a corner of the current block.

[0677]

17. The method of any of clauses 13-16, wherein the current block uses a 4-parameter affine model.

[0678]

18. The method of any of clauses 13-16, wherein the current block uses a 6-parameter affine model.

[0679]

Additional examples and embodiments of clauses 13-18 are described in Section 4, e.g., Items 3-6.

[0680]

19. A method of video processing, comprising: performing a conversion between a current block and a bitstream representation of the current block using affine inherited motion vectors (MVs) for the current block, wherein the affine inherited MVs are derived from a first MV stored in a first basic block adjacently neighboring the current block and a second MV stored in a second basic block that is offset from the first building block by an offset.

[0681]

20. The method of clause 19, wherein the affine inherited MVs are derived using a linear weighting of x-and y-differences between motion vectors weighted using coefficients a and b, wherein a and b are derived from the offset.

[0682]

21. The method of any of clauses 19-20 wherein a value of the offset is a function of a position of the first basic block.

[0683]

22. The method of any of clauses 19-21, wherein the second basic block is selected from M candidate basic blocks, where M is an integer, by checking the M candidate basic blocks in an order.

[0684]

23. The method of any of clauses 19-22, wherein the first building block and the second basic building block are inter-coded and refer to a same reference picture.

[0685]

24. The method of any of clauses 1-23, wherein affine parameters for the current block are bit-shifted prior to storing.

[0686]

25. The method of clause 24, wherein an amount bit-shifting (1) changes with motion precision used during the conversion, or (2) is different for different affine parameters.

[0687]

26. The method of clause 24, wherein the affine parameters are clipped prior to the storing.

[0688]

27. The method of any of clauses 1-12, wherein the MVs in the first groups of MVs are stored and used in a history-based motion vector predictor table for a history-based candidate affine model of the current block.

[0689]

28. The method of clauses 9-10 wherein D1 and D2 are stored and used in a history-based motion vector predictor table for a history-based candidate affine model of the current block.

[0690]

29. The method of clause 19, wherein the first basic block adjacently neighboring the current block is one of A (above) , AR (above right) or AL (above left) , and wherein a top-left sample of the first basic block is denoted xBB.

[0691]

30. The method of clause 29, wherein (xBB %8 = 0) , wherein a block right of the first basic block is affine coded and has a reference index identical to a reference index of the first basic block for a given reference list, and wherein the second basic block is the block right of the first basic block.

[0692]

31. The method of clause 29, wherein (xBB %8 = 0) , wherein a block right of the first basic block is not affine coded or has a reference index that is different from a reference index of the first basic block for a given reference list, and wherein the second basic block is a block left of the first basic block.

[0693]

32. The method of clause 29, wherein (xBB %8 ≠ 0) , wherein a block left of the first basic block is affine coded and has a reference index identical to a reference index of the first basic block for a given reference list, and wherein the second basic block is the block left of the first basic block.

[0694]

33. The method of clause 29, wherein (xBB %8 ≠ 0) , wherein a block left of the first basic block is not affine coded or has a reference index different from a reference index of the first basic block for a given reference list, and wherein the second basic block is a block right of the first basic block.

[0695]

34. The method of clause 19, wherein the first basic block adjacently neighboring the current block is located in a row or a column adjacent to the current block.

[0696]

35. The method of clause 19, wherein at least one of the affine inherited MVs is aligned to the first MV or the second MV.

[0697]

36. The method of clause 19, wherein the second basic block is selected depending on a position of the first basic block, wherein the position of the first basic block is above left, or above right, or at left boundary, or at right boundary of the current block and depending on the position, a corresponding offset is selected based on the position.

[0698]

37. The method of clause 19, wherein the second basic block is selected from multiple candidate blocks using a technique that depends on a position of the first basic block or a position of the current block.

[0699]

38. The method of any of clauses 19-37, wherein a decision to find the second block from multiple candidates or from a predefined offset is made based on a position of the first block or a position of the current block.

[0700]

39. The method of clause 38, wherein, in case that the current block inherits an affine model from a basic block, then considering the basic block as a first neighboring basic block and determining a second adjacent basic block based on a rule based on a position of the basic block.

[0701]

40. The method of any of clauses 19-39, wherein in case that a basic block P is selected as the second block and a basic block Q is selected as first block, then the method excludes using the basic block P as the first block and the basic block Q as the second block during the conversion for another video block.

[0702]

41. The method of clause 41, wherein the another video block is in a same coding tree unit row or a same slice as the current video block.

[0703]

Additional features and examples of the techniques described in Clauses 36-41 are provide in Section 4, items 7 (g) , 7 (h) , 7 (m) , 7 (n) , and 7 (o) .

[0704]

42. The method of any of clauses 1-41, wherein the conversion includes generation of the bitstream representation from pixel values of the current block.

[0705]

43. The method of any of clauses 1-41, wherein the conversion includes generation of pixel values of the current block from the bitstream representation.

[0706]

44. A video encoder apparatus comprising a processor configured to implement a method recited in any one or more of clauses 1-43.

[0707]

45. A video decoder apparatus comprising a processor configured to implement a method recited in any one or more of clauses 1-43.

[0708]

46. A computer program product stored on a non-transitory computer readable media, the computer program product including program code for carrying out the method in any of clauses 1 to 43.

[0709]

FIG. 29 is a flowchart for a method 2900 of processing video. The method 2900 includes, associating (2902) a first group of control point motion vectors (CPMVs) for determining inherited motion information of blocks coded after a first block, with a second group of CPMVs for deriving MVs of sub-blocks of the first block or a third group of CPMVs that is signaled for the first block, wherein the first group of CPMVs is not identical with the second group of CPMVs or the third group of CPMVs; determining (2904) inherited motion information for a second block, which is coded after the first block, based on the first group of CPMVs, and performing (2906) a conversation between the second block and a bitstream representation of the second block by using the inherited motion information.

[0710]

In some examples, the first group of CPMVs are derived from the second group of CPMVs or the third group of CPMVs.

[0711]

In some examples, the method further comprises: storing the first group of CPMVs after the conversion of the first block.

[0712]

In some examples, the second group of CPMVs are same as the third group of CPMVs.

[0713]

In some examples, multiple representative points’ coordinates of the first group of CPMVs, multiple representative points’ coordinates of the second group of CPMVs and/or multiple representative points’ coordinates of the third group of CPMVs are defined as coordinates relative to one block or sub-block which is used in an affine motion compensation process.

[0714]

In some examples, a relative offset between representative points of two CPMVs in the first group of CPMVs is independent of a width or a height of the first block.

[0715]

In some examples, representative points of the first group of CPMVs are inside of the first block or outside of the first block.

[0716]

In some examples, yF1 = yF0, xF1 = xF0 + PW, or xF1 = xF0, yF1 = yF0 + PH, or yF2 = yF0, xF2 = xF0 + PW, or xF2 = xF0, yF2 = yF0 + PH, or yF2 = yF1, xF2 = xF1 + PW, or xF2 = xF1, yF2 = yF1 + PH, where (xF0, yF0) , (xF1, yF1) , (xF2, yF2) are coordinates of multiple representative points of the first group of CPMVs, and PW and PH are integers.

[0717]

In some examples, PW = 2M, or PW = -2M, or PH = 2M, or PH = -2M, M is an integer in a range of 2 to 7.

[0718]

In some examples, PW and PH are not stored.

[0719]

In some examples, PW and PH are fixed.

[0720]

In some examples, PW and PH are signaled in at least one of Sequence Parameter Set (SPS) , Video Parameter Set (VPS) , Picture Parameter Set (PPS) , slice header, tile group header, tile, or CTU.

[0721]

In some examples, PW and PH are different in different standard profiles or levels or tiers.

[0722]

In some examples, PW and PH depend on maximum coding unit (CU) size or/and minimum CU size of slice or picture.

[0723]

In some examples, in the first group of CPMVs, MVF0 = MVS0, (xF0, yF0) = (xS0, yS0) , or MVF0 = MVT0, (xF0, yF0) = (xT0, yT0) ; or MVF0 = MVS1, (xF0, yF0) = (xS1, yS1) , or MVF0 = MVT1, (xF0, yF0) = (xT1, yT1) ; or MVF0 = MVS2, (xF0, yF0) = (xS2, yS2) , or MVF0 = MVT2, (xF0, yF0) = (xT2, yT2) ; wherein motion vectors MVF0, MVF1, MVF2 are multiple CPMVs at multiple representative points’ coordinates (xF0, yF0) , (xF1, yF1) , (xF2, yF2) of the first group of CPMVs, motion vectors MVS0, MVS1, MVS2 are multiple CPMVs at multiple representative points’ coordinates (xS0, yS0) , (xS1, yS1) , (xS2, yS2) of the second group of CPMVs, and motion vectors MVT0, MVT1, MVT2 are multiple CPMVs at multiple representative points’ coordinates (xT0, yT0) , (xT1, yT1) , (xT2, yT2) of the third group of CPMVs.

[0724]

In some examples, motion vectors MVF0, MVF1 and MVF2 in the first group of CPMVs are derived from motion vectors MVS0 and MVS1 in the second group of CPMVs by using a 4-parameter affine model with coordinates (xF0, yF0) , (xF1, yF1) and (xF2, yF2) as the input coordinates of the affine model.

[0725]

In some examples, motion vectors MVF0, MVF1 and MVF2 in the first group of CPMVs are derived from motion vectors MVS0, MVS1 and MVS2 in the second group of CPMVs by using a 6-parameter affine model with (xF0, yF0) , (xF1, yF1) and (xF2, yF2) as the input coordinates of the affine model.

[0726]

In some examples, motion vectors MVF0, MVF1 and MVF2 in the first group of CPMVs are derived from motion vectors MVT0 and MVT1 in the third group of CPMVs by using a 4-parameter affine model with (xF0, yF0) , (xF1, yF1) and (xF2, yF2) as the input coordinates of the affine model.

[0727]

In some examples, motion vectors MVF0, MVF1 and MVF2 in the first group of CPMVs are derived from motion vectors MVT0, MVT1 and MVT2 in the third group of CPMVs by using a 6-parameter affine model with (xF0, yF0) , (xF1, yF1) and (xF2, yF2) as the input coordinates of the affine model.

[0728]

In some examples, motion vectors MVF2 in the first group of CPMVs comprising motion vectors MVF0, MVF1 and MVF2 is only calculated if the first block is coded with a 6-parameter affine model, or motion vectors MVF2 in the first group of CPMVs comprising motion vectors MVF0, MVF1 and MVF2 is calculated no matter the first block is coded with a 4-parameter affine model or a 6-parameter affine model.

[0729]

In some examples, the method further comprises: storing one or more differences (D1, D2) between the CPMVs in the first group of CPMVs.

[0730]

In some examples, the first group of CPMVs comprises motion vectors MVF0, MVF1 and MVF2, D1 = MVF1-MVF0 is stored, or D2 = MVF2-MVF0 is stored, or both D1 and D2 are stored.

[0731]

In some examples, D2 is stored only when the first block is coded with a 6-parameter affine model.

[0732]

In some examples, D2 is stored when the first block is coded with the 6-parameter affine model or the 6-parameter affine model.

[0733]

In some examples, the method further comprises: storing the first group of CPMVs and one or more differences (D1, D2) between the CPMVs in the first group of CPMVs together.

[0734]

In some examples, the multiple CPMVs in the first group of CPMVs and/or one or more differences between the CPMVs in the first group of CPMVs are shifted with a shift function, and the shifted CPMVs and/or differences are stored.

[0735]

In some examples, the shift function SatShift (x, n) is defined as: wherein n is an integer, and offset0 and/or offset1 are set to (1<<n) >>1 or (1<< (n-1) ) , or ( (1<<n) >>1) -1, or offset0 and/or offset1 are set to 0.

[0736]

In some examples, the shift function SatShift (x, n) is defined as: Shift (x, n) = (x+offset0) >>n, wherein n is an integer, and offset0 is set to (1<<n) >>1 or (1<< (n-1) ) , or ( (1<<n) >>1) -1, or offset0 is set to 0.

[0737]

In some examples, n is 2 or 4, or n depends on the motion precision.

[0738]

In some examples, n in case that the CPMV in the first group of CPMVs is different from n in case that the difference between CPMVs in the first group of CPMVs is stored.

[0739]

In some examples, stored CPMV is left shift first before it is used in the affine inheritance of the blocks coded after the first block.

[0740]

In some examples, the multiple CPMVs in the first group of CPMVs and/or one or more differences between the CPMVs in the first group of CPMVs are clipped with a clip function, and the clipped CPMVs and/or the differences are stored.

[0741]

In some examples, the clip function Clip3 (min, max, x) is defined as:

[0743]

wherein Min is a lower threshold of the clip function, Max is a higher threshold of the clip function.

[0744]

In some examples, when the CPMV or the difference is stored with K bits, Min= -2K-1 and Max= 2K-1-1, K is an integer.

[0745]

In some examples, K is different depending on whether the CPMV or the difference is to be stored.

[0746]

In some examples, the multiple CPMVs in the first group of CPMVs and/or one or more differences between the CPMVs in the first group of CPMVs are processed with the shift function and the clip function sequentially, and the processed CPMVs and/or the differences are stored.

[0747]

In some examples, the multiple CPMVs in the first group of CPMVs are stored into an affine (History Motion Vector Prediction) HMVP buffer or table or list to represent one history-based candidate affine model.

[0748]

In some examples, the one or more differences between the CPMVs in the first group of CPMVs are stored into an affine (History Motion Vector Prediction) HMVP buffer or table or list to represent one history-based candidate affine model.

[0749]

In some examples, one or more CPMVs or one or more differences stored in the HMVP buffer or table or list are shifted with the shift function and/or clipped with the clip function.

[0750]

FIG. 30 is a flowchart for a method 3000 of processing video. The method 3000 includes, deriving (3002) , for a conversion between a current block of video and a bitstream representation of the current block, affine inherited motion vectors (MVs) for the first block based on stored motion vectors (MVs) ; performing (3004) the conversion by using the affine inherited MVs.

[0751]

In some examples, the MVs are stored in an adjacent neighbouring basic block.

[0752]

In some examples, the MVs are stored in affine (History Motion Vector Prediction) HMVP buffer or table or list.

[0753]

In some examples, the MVs stored in the adjacent neighbouring basic block at least include: MV stored in a left adjacent neighbouring basic block (L) , MV stored in an above adjacent neighbouring basic block (A) , MV stored in a left-bottom adjacent neighbouring basic block (LB) , MV stored in an above-right adjacent neighbouring basic block (AR) and MV stored in an above left adjacent neighbouring basic block (AL) .

[0754]

In some examples, the adjacent neighbouring basic block is a 4x4 block

[0755]

In some examples, the affine inherited MV at a position (x, y) in the first block is derived by using a first MV of the adjacent neighbouring basic block (MVa = (mv
^{h}
_{a}, mv
^{v}
_{a}) ) at a representative point (x
_{0}, y
_{0}) based on an affine model with (x-x
_{0}, y-y
_{0}) as the input coordinates of the affine model.

[0756]

In some examples, the representative point (x
_{0}, y
_{0}) is any position inside the basic block.

[0757]

In some examples, the representative point (x
_{0}, y
_{0}) is any position outside or at the boundary of the basic block.

[0758]

In some examples, the coordinate of the representative point (x
_{0}, y
_{0}) is determined based on the coordinate (xTL, yTL) of a top-left corner sample in the adjacent neighbouring basic block and additional information including two variables (i, j) .

[0759]

In some examples, a first variable (i) of the two variables depends on width of the basic block, and a second variable (j) of the two variables depends on height of the basic block.

[0760]

In some examples, the variables (i, j) depends on the position of the neighbouring basic block.

[0761]

In some examples, the coordinate of the representative point (x
_{0}, y
_{0}) is determined based on the coordinate of top-left sample of the first block (xPos00, yPos00) , the coordinate of top-right sample of the first block (xPos10, yPos00) , and the coordinate of top-right sample of the first block (xPos00, yPos01) .

[0762]

In some examples, the coordinate of the representative point (x
_{0}, y
_{0}) for the left adjacent neighbouring basic block L is (xPos00-2, yPos01-1) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the left-bottom adjacent neighbouring basic block (LB) is (xPos00-2, yPos01+3) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the above adjacent neighbouring basic block (A) is (xPos10-1, yPos00-2) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the above-right adjacent neighbouring basic block (AR) is (xPos10+3, yPos00-2) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the above left adjacent neighbouring basic block (AL) is (xPos00-2, yPos00-2) .

[0763]

In some examples, the additional information depends on the position of the adjacent neighbouring basic block or the adjacent neighbouring basic block, or the additional information is signaled in at least one of Sequence Parameter Set (SPS) , Video Parameter Set (VPS) , Picture Parameter Set (PPS) , slice header, tile group header, tile, coding tree unit (CTU) , CU.

[0764]

In some examples, the additional information is different in different standard profiles or levels or tiers.

[0765]

In some examples, the affine inherited MV at a position (x, y) in a sub-block of the first block is derived by using a first MV of the adjacent neighbouring basic block (MVa) at a representative point (x
_{0}, y
_{0}) based on an affine model with (x-x
_{0}, y-y
_{0}) as the input coordinates of the affine model.

[0766]

In some examples, the affine inherited MV at a position (x, y) in a sub-block is used to perform motion compensation for the sub-block.

[0767]

In some examples, the affine inherited MV at a position (x, y) , which is a corner of the first block, is derived as an inherited control point motion vector (CPMV) of the first block by using a first MV of the adjacent neighbouring basic block (MVa) at a representative point (x
_{0}, y
_{0}) based on an affine model with (x-x
_{0}, y-y
_{0}) as the input coordinates of the affine model.

[0768]

In some examples, the inherited CPMVs are used to predict signaled CPMVs of the first block which is affine inter-coded.

[0769]

In some examples, the inherited CPMVs are directly used as CPMVs of the first block which is affine merge-coded.

[0770]

In some examples, when the first block uses a 4-paramter affine model, the affine model for deriving the affine inherited MV at a position (x, y) in the first block is:

[0772]

wherein a and b are variables of the affine model.

[0773]

In some examples, when the first block uses a 6-paramter affine model, the affine model for deriving the affine inherited MV at a position (x, y) in the first block is:

[0775]

wherein a, b, c and d are variables of the affine model.

[0776]

In some examples, the variable a, b, or variable a, b, c, d are calculated as:

[0778]

wherein mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) , mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) , mv
_{t2}= (mv
^{h}
_{t2}, mv
^{v}
_{t2}) are CPMVs at three representative points, respectively, in a first group CPMVs for a second block covering the adjacent neighbouring basic block, and w
_{t} and h
_{t} depends on relative offsets between the representative points of the second block, wherein the first group CPMVs is used for determining inherited motion information of blocks coded after the second block.

[0779]

In some examples, the variable a, b, or variable a, b, c, d are calculated as:

[0781]

wherein mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) , mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) , mv
_{t2}= (mv
^{h}
_{t2}, mv
^{v}
_{t2}) are CPMVs at three representative points, respectively, in a second group CPMVs or a third group of CPMVs for a second block covering the adjacent neighbouring basic block, and w
_{t} and h
_{t} are the width and height of the second block, wherein the second group CPMVs are used to derive MVs for each sub-block of the second block, and the third group CPMVs are signaled from encoder to decoder.

[0782]

In some examples, the variable a, b, or variable a, b, c, d are calculated as:

[0784]

wherein mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) , mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) , mv
_{t2}= (mv
^{h}
_{t2}, mv
^{v}
_{t2}) are CPMVs at three representative points, respectively, of a second block covering the adjacent neighbouring basic block, and w
_{t} and h
_{t} are the width and height of the second block, wherein mv
^{h}
_{t1}-mv
^{h}
_{t0}, mv
^{v}
_{t1}-mv
^{v}
_{t0}, mv
^{h}
_{t2}-mv
^{h}
_{t0}, mv
^{v}
_{t2}-mv
^{v}
_{t0} are fetched from a storage for storing difference between CPMVs of the blocks directly.

[0785]

In some examples, the conversion generates the first/second block of video from the bitstream representation.

[0786]

In some examples, the conversion generates the bitstream representation from the first/second block of video.

[0787]

FIG. 31 is a flowchart for a method 3100 of processing video. The method 3100 includes, deriving (3102) , for a conversion between a current block of video and a bitstream representation of the current block, affine inherited motion vectors (MVs) for the current block based on a first stored motion vector (MV) and a second stored MV different from the first stored MV, wherein the first stored MV is stored in a first basic block neighbouring to the current block, and the second stored MV is stored in a second basic block with an offset to the first basic block; and; performing (3104) the conversion by using the affine inherited MVs for the current block.

[0788]

In some examples, the first basic block neighbouring to the current block includes at least one of: a left neighbouring basic block (L) , an above neighbouring basic block (A) , a left-bottom neighbouring basic block (LB) , an above-right neighbouring basic block (AR, AR’) and an above left neighbouring basic block (AL, AL’, AL1, AL”) .

[0789]

In some examples, the affine inherited MV at a position (x, y) in the current block ( (mv
^{h} (x, y) , mv
^{v} (x, y) ) is derived by using the first stored MV (MVa = (mv
^{h}
_{a}, mv
^{v}
_{a}) ) stored in the first basic block at a point (x
_{0}, y
_{0}) or the first stored MV (MVa = (mv
^{h}
_{a}, mv
^{v}
_{a}) ) associated with a sub-block of the first basic block at a point (x
_{0}, y
_{0}) based on an affine model with parameters a and b, the motion vector (mv
^{h} (x, y) , mv
^{v} (x, y) ) is derived by:

[0791]

In some examples, the parameters a and b are calculated as:

[0793]

wherein mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) and mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) are set equal to the MV stored in the first basic block and the MV stored in the second basic block, respectively, and w
_{t} is horizontal offset between the first basic block and the second basic block.

[0794]

In some examples, the parameters a and b are calculated as:

[0796]

wherein mv
_{t0}= (mv
^{h}
_{t0}, mv
^{v}
_{t0}) and mv
_{t1}= (mv
^{h}
_{t1}, mv
^{v}
_{t1}) are set equal to the MV stored in the first basic block and the MV stored in the second basic block, respectively, and h
_{t} is vertical offset between the first basic block and the second basic block.

[0797]

In some examples, w
_{t} =2
^{N}, and h
_{t} =2
^{M}, wherein N and M are integers.

[0798]

In some examples, when coordinates of the top-left sample of the first basic block and the second basic block are (xLT0, yLT0) and (xLT1, yLT1) , respectively, the horizontal offset between the first basic block and the second basic block is defined as xLT1 -xLT0, and/or the vertical offset between the first basic block and the second basic block is defined as yLT1 -yLT0.

[0799]

In some examples, when the first basic block is above the current block, the vertical offset is 0.

[0800]

In some examples, when the first basic block is left to the current block, the horizontal offset is 0.

[0801]

In some examples, the second basic block is selected depending on the position of the first basic block.

[0802]

In some examples, coordinates of top-left sample of the first basic block and the second basic block are (xLT0, yLT0) and (xLT1, yLT1) , respectively, and

[0803]

wherein when xLT0%M is not equal to 0, M is an integer, yLT1 = yLT0 and xLT1 =xLT0 –offset, or xLT1 = xLT0 and yLT1 = yLT0 –offset, where offset is a positive number.

[0804]

In some examples, coordinates of top-left sample of the first basic block and the second basic block are (xLT0, yLT0) and (xLT1, yLT1) , respectively, and

[0805]

wherein when xLT0%M is equal to 0, M is an integer, yLT1 = yLT0 and xLT1 = xLT0 +offset, or xLT1 = xLT0 and yLT1 = yLT0 + offset, where offset is a positive number.

[0806]

In some examples, coordinates of top-left sample of the first basic block and the second basic block are (xLT0, yLT0) and (xLT1, yLT1) , respectively, and when the first block is above-left to the current block, or when the first block is above-left to the current block and left boundary of the current block is also the left boundary of a CTU, or when xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of a neighbouring basic block above-left to the current block, or when xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of a neighbouring basic block above-left to the current block and left boundary of the current block is also the left boundary of a CTU,

[0807]

yLT1 = yLT0 and xLT1 = xLT0 + offset, where offset is a positive number.

[0808]

In some examples, coordinates of top-left sample of the first basic block and the second basic block are (xLT0, yLT0) and (xLT1, yLT1) , respectively, and when the first block is above-right to the current block, or when the first block is above-right to the current block and right boundary of the current block is also the right boundary of a CTU, or when xLT0 + offset >xRT_AR, where xLT_AR is the top-right coordinate of a neighbouring basic block above-right to the current block, or when xLT0 + offset > xRT_AR, where xLT_AR is the top-right coordinate of a neighbouring basic block above-right to the current block and right boundary of the current block is also the right boundary of a CTU, yLT1 = yLT0 and xLT1 = xLT0 -offset, where offset is a positive number.

[0809]

In some examples, the second basic block is selected from M candidate basic blocks, M is an integer.

[0810]

In some examples, the second basic block is selected by checking the M candidate basic blocks in order so as to determine one of the M candidate basic blocks, which is inter-coded and has a MV referring to the same reference picture as the MV of the first basic block referring to, as the second basic block.

[0811]

In some examples, coordinates of top-left sample of the first basic block is (xLT0, yLT0) and coordinates of top-left positions of the M candidate basic block are (xC
_{0}, yC
_{0}) , (xC
_{1} yC
_{1}) , …, (xC
_{M-1}, yC
_{M-1}) , respectively, and when M is 2, yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, and yC
_{1} = yLT0, xC
_{1} = xLT0 +offset or, xC
_{0} = xLT0, yC
_{0} = yLT0 –offset, and xC
_{1} = xLT0, yC
_{1} = yLT0 + offset, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, or xC
_{0} = xLT0, yC
_{0} = yLT0 –offset, xC
_{1} = xLT0, yC
_{1} = yLT0 + offset, where offset is a positive number.

[0812]

In some examples, whether to and/or how to select the second basic block from the M candidate basic blocks depend on the position of the first basic block and/or the position of the current block.

[0813]

In some examples, coordinates of top-left sample of the first basic block is (xLT0, yLT0) and coordinates of top-left positions of the M candidate basic block are (xC
_{0}, yC
_{0}) , (xC
_{1} yC
_{1}) , …, (xC
_{M-1}, yC
_{M-1}) , respectively, and when M is 1, yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, if the first basic block is above-left to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, if the first block is above-right to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, if the first block is above-left to the current block and left boundary of the current block is also the left boundary of a CTU, or yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, if the first block is above-right to the current block and the right boundary of the current block is also the right boundary of a CTU, or yC
_{0} = yLT0, xC
_{0} =xLT0 + offset, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 + offset, if xLT0 –offset <xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block and left boundary of the current block is also the left boundary of a CTU, or yC
_{0} = yLT0, xC
_{0} = xLT0 -offset, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block and the right boundary of the current block is also the right boundary of a CTU, where offset is a positive number.

[0814]

In some examples, coordinates of top-left sample of the first basic block is (xLT0, yLT0) and coordinates of top-left positions of the M candidate basic block are (xC
_{0}, yC
_{0}) , (xC
_{1} yC
_{1}) , …, (xC
_{M-1}, yC
_{M-1}) , respectively, and when M is 2, yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if the first basic block is above-left to the current block, or yC
_{0} = yLT0, xC
_{0} =xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if the first basic block is above-right to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if the first basic block is above-left to the current block and left boundary of the current block is also the left boundary of a CTU, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if the first basic block is above-right to the current block and the right boundary of the current block is also the right boundary of a CTU, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if xLT0 –offset < xLT_AL, where xLT_AL is the top-left coordinate of the neighbouring basic block above-left to the current block and left boundary of the current block is also the left boundary of a CTU, or yC
_{0} = yLT0, xC
_{0} = xLT0 –offset, yC
_{1} = yLT0, xC
_{1} = xLT0 + offset, if xLT0 + offset > xRT_AR, where xRT_AR is the top-right coordinate of the neighbouring basic block above-right to the current block and the right boundary of the current block is also the right boundary of a CTU, where offset is a positive number.

[0815]

In some examples, when the second basic block, which is inter-coded and has a MV referring to the same reference picture as the MV of the first basic block referring to, cannot be found, the affine inherited motion vectors (MVs) for the current block cannot be derived from the first basic block.

[0816]

In some examples, whether to and/or how to derive the affine inherited motion vectors (MVs) for the current block depends on the position of the current block.

[0817]

In some examples, an affine model for the current block is inherited from an above neighbouring block of the current block in different ways depending on whether the neighbouring block is in a Coding Tree Unit (CTU) or CTU row where in the current block is located or not.

[0818]

In some examples, when the affine model for the current block is inherited from an above or left neighbouring block of the current block, which is not in a CTU or CTU row where in the current block is located, the affine inherited motion vectors (MVs) for the current block is derived based on the first stored motion vector (MV) and the second stored MV.

[0819]

In some examples, whether to and/or how to select the second basic block from multiple candidates or from a predefined offset depends on a position of the first block and/or a position of the current block, and wherein the second basic block is a second neighboring basic block.

[0820]

In some examples, an affine model for the current block is inherited from the first basic block neighboring the current block, which is affine coded and includes at least one of: an above neighbouring basic block (A) , an above-right neighbouring basic block (AR) and an above left neighbouring basic block (AL) , and wherein a top-left position of the first basic block is (xBB, yBB) .

[0821]

In some examples, when xBB%8 = 0, the second neighboring basic block is selected by:

[0822]

checking whether a basic block on the right of the first basic block is affine coded and has a reference index same as that of the first basic block for a given reference list; and if yes, selecting the basic block on the right of the first basic block as the second neighboring basic block, or otherwise, selecting a basic block on the left of the first basic block as the second neighboring basic block.

[0823]

In some examples, when xBB%8! =0, the second neighboring basic block is selected by:

[0824]

checking whether a basic block on the left of the first basic block is affine coded and has a reference index same as that of the first basic block for a given reference list; and if yes, selecting the block on the left of the first basic block as the second neighboring basic block, or otherwise, selecting that a block on the right of the first basic block is the second neighboring basic block.

[0825]

In some examples, when the first basic block is AL and the left boundary of the current block is the left boundary of a CTU, the second neighboring basic block is selected by: only checking whether a basic block on the right of the first basic block is affine coded and has a reference index same as that of the first basic block for a given reference list; and if yes, selecting the basic block on the right of the first basic block as the second neighboring basic block, or otherwise, the affine model for the current block cannot be inherited from the first basic block.

[0826]

In some examples, when xBB%S= 0, the second neighboring basic block is selected by: checking whether a basic block on the right of the first basic block is affine coded and has a reference index same as that of the first basic block for a given reference list; and if yes, selecting the basic block on the right of the first basic block as the second neighboring basic block, or otherwise, selecting a basic block on the left of the first basic block as the second neighboring basic block.

[0827]

In some examples, when xBB%S! = 0, the second neighboring basic block is selected by: checking whether a basic block on the left of the first basic block is affine coded and has a reference index same as that of the first basic block for a given reference list; and if yes, selecting the block on the left of the first basic block as the second neighboring basic block, or otherwise, selecting that a block on the right of the first basic block is the second neighboring basic block.

[0828]

In some examples, S is equal to 8

[0829]

In some examples, the offset between the first basic block and the second basic block is a positive integer.

[0830]

In some examples, the offset is in a form of 2
^{K}, K is an integer, or depends on the minimum allowed CU width and/or height, or depend on width and/or height of the basic block, or depends on the minimum allowed width and/or height of a CU that affine coding is applicable, or is signaled from an encoder to a decoder.

[0831]

In some examples, when a basic block P is chosen as the second basic block and when a basic block Q is the first basic block in a first affine inheritance process, the basic block Q is not allowed to be chosen as the second basic block when the basic block P is the first basic block in a second affine inheritance process.

[0832]

In some examples, when a basic block P is chosen as the second basic block and when a basic block Q is the first basic block in a first affine inheritance process, the basic block P is not allowed to be the first basic block in the second affine inheritance process.

[0833]

In some examples, when the basic block P is the first block in the second affine inheritance process, the second basic block in the second affine inheritance process can only be chosen from a basic block on the left of the basic block P if the basic block Q is on the right of the basic block P, or the second basic block can only be chosen from a basic block on the right of the basic block P if the basic block Q is on the left of the basic block P, or the second basic block can only be chosen from a basic block on the above of the basic block P if the basic block Q is on the below of the basic block P, or the second basic block can only be chosen from a basic block on the below of the basic block P if the basic block Q is on the above of the basic block P.

[0834]

In some examples, he neighbouring basic block is on a row or column adjacent to the current block.

[0835]

In some examples, the first basic block is determined as valid if it satisfies at least one of the following conditions: i. it is inter-coded; ii. it is not intra-block-copy coded; iii. it is affine-coded; iv. it is affine-merge coded; v. it is affine-inter coded.

[0836]

In some examples, whether the second basic block is determined as valid depends on information of the first basic block.

[0837]

In some examples, the second basic block is determined as valid if it satisfies at least one of the following conditions: i. it is inter-coded; ii. it is not intra-block-copy coded; iii. it is affine-coded; iv. it is affine-merge coded; v. it is affine-inter coded; vi. it has the same inter-prediction direction as the first basic block; vii. it has the same reference index for reference list 0 as the first basic block; viii. it has the same reference index for reference list 1 as the first basic block; ix. it has the same inter-prediction direction and same reference indices as the first basic block; x. it has the same picture-order-count (POC) value of the reference picture in reference list X as that for the first basic block, where X is 0 and/or 1.

[0838]

In some examples, each basic block of above neighbouring basic blocks of the current block is checked in a predetermined order to determine whether it is a valid first basic block.

[0839]

In some examples, the above neighbouring basic blocks of the current block are checked in the order from left to right or from right to left.

[0840]

In some examples, the above neighbouring basic blocks include at least one of: an above neighbouring basic block (A) , an above-right neighbouring basic block (AR) and a first above left neighbouring basic block (AL1) .

[0841]

In some examples, when one basic block (BB) of the above neighbouring basic blocks is a valid first basic block, a basic block on the left and/or right of the valid first basic block (BB) is checked to determine a corresponding second basic block.

[0842]

In some examples, the basic block (BBR) on the right of the valid first basic block (BB) is check first to determine whether it is a valid second basic block, and when the basic block (BBR) is the valid second basic block, the valid first basic block (BB) and the valid second basic block (BBR) are output as the first basic block and the second basic block.

[0843]

In some examples, when the basic block (BBR) is not valid, the basic block (BBL) on the left of the valid first basic block (BB) is check to determine whether it is the valid second basic block, and when the basic block (BBL) is the valid second basic block, the valid first basic block (BB) and the valid second basic block (BBL) are output as the first basic block and the second basic block.

[0844]

In some examples, when the basic block (BBL) is not valid, a next basic block left to the one basic block (BB) in order is checked to determine whether it is a valid first basic block.

[0845]

In some examples, when the basic block (BBL) is not valid, no valid first basic block and valid second basic block are output from the above neighbouring basic blocks.

[0846]

In some examples, the basic block (BBL) on the left of the valid first basic block (BB) is check first to determine whether it is a valid second basic block, and when the basic block (BBL) is the valid second basic block, the valid first basic block (BB) and the valid second basic block (BBL) are output as the first basic block and the second basic block.

[0847]

In some examples, when the basic block (BBL) is not valid, the basic block (BBR) on the right of the valid first basic block (BB) is check to determine whether it is the valid second basic block, and when the basic block (BBR) is the valid second basic block, the valid first basic block (BB) and the valid second basic block (BBR) are output as the first basic block and the second basic block.

[0848]

In some examples, when the basic block (BBR) is not valid, a next basic block right to the one basic block (BB) in order is checked to determine whether it is a valid first basic block.

[0849]

In some examples, when the basic block (BBR) is not valid, no valid first basic block and valid second basic block are output from the above neighbouring basic blocks.

[0850]

In some examples, only the basic block (BBR) on the right of the valid first basic block (BB) is check to determine whether it is a valid second basic block, and when the basic block (BBR) is the valid second basic block, the valid first basic block (BB) and the valid second basic block (BBR) are output as the first basic block and the second basic block.

[0851]

In some examples, when the basic block (BBR) is not valid, the valid first basic block (BB) and the basic block (BBL) on the left of the valid first basic block are output as the first basic block and the second basic block.

[0852]

In some examples, when the basic block (BBR) is not valid, a next basic block right to the one basic block (BB) in order is checked to determine whether it is a valid first basic block.

[0853]

In some examples, when the basic block (BBL) is not valid, no valid first basic block and valid second basic block are output from the above neighbouring basic blocks.

[0854]

In some examples, only the basic block (BBL) on the left of the valid first basic block (BB) is check to determine whether it is a valid second basic block, and when the basic block (BBL) is the valid second basic block, the valid first basic block (BB) and the valid second basic block (BBL) are output as the first basic block and the second basic block.

[0855]

In some examples, when the basic block (BBL) is not valid, the valid first basic block (BB) and the basic block (BBR) on the right of the valid first basic block are output as the first basic block and the second basic block.

[0856]

In some examples, when the basic block (BBL) is not valid, a next basic block left to the one basic block (BB) in order is checked to determine whether it is a valid first basic block.

[0857]

In some examples, when the basic block (BBL) is not valid, no valid first basic block and valid second basic block are output from the above neighbouring basic blocks.

[0858]

In some examples, selection of candidate basic blocks from the above neighbouring basic blocks to be checked for the determination of the first basic blocks depends on the position of the current block and/or sub-block sizes of affine motion compensation.

[0859]

In some examples, when the current block is at the left boundary of a CTU, the candidate basic blocks includes at least one of: an above neighbouring basic block (A) , an above-right neighbouring basic block (AR) and a first above left neighbouring basic block (AL1) , and when the current block is not at the left boundary of a CTU, the candidate basic blocks includes at least one of: an above neighbouring basic block (A) , an above-right neighbouring basic block (AR) and a second above left adjacent neighbouring basic block (AL”) .

[0860]

In some examples, whether a candidate basic blocks from the above neighbouring basic blocks can be used as the first basic blocks depends on the position of the current block.

[0861]

In some examples, when the current block is at the left boundary of a CTU, an above left neighbouring basic block (AL1, AL”) cannot be used as the first basic block.

[0862]

In some examples, when the current block is at the right boundary of a CTU, an above-right neighbouring basic block (AR, AR’) cannot be used as the first basic block.

[0863]

In some examples, whether a candidate basic blocks from the above neighbouring basic blocks can be used as the second basic blocks depends on the position of the current block.

[0864]

In some examples, when the current block is at the left boundary of a CTU, an above left neighbouring basic block (AL1, AL’) cannot be used as the first basic block.

[0865]

In some examples, when the current block is at the right boundary of a CTU, an above-right neighbouring basic block (AR, AR’) cannot be used as the first basic block.

[0866]

In some examples, the first basic block and the second basic block are exchangeable.

[0867]

In some examples, the first basic block and second basic block are firstly exchanged, and the conversion of the current block is performed by using the exchanged first basic block and second basic block.

[0868]

In some examples, the determination process of the first basic block and the second basic block are exchangeable.

[0869]

In some examples, the conversion generates the current block of video from the bitstream representation.

[0870]

In some examples, the conversion generates the bitstream representation from the current block of video.

[0871]

FIG. 32 is a flowchart for a method 3200 of processing video. The method 3200 includes, deriving (3202) , for a conversion between a current block of video and a bitstream representation of the current block, one or more parameters of a set of affine model parameters associated with affine model for the current block; shifting (3204) the one or more parameters; and storing (3206) the shifted one or more parameters.

[0872]

In some examples, the shifting the one or more parameters further comprises shifting the one or more parameters with a first shift function SatShift (x, n) , which is defined as:

[0874]

wherein x is one of the one or more parameters, n is an integer, and offset0 and/or offset1 are set to (1<<n) >>1 or (1<< (n-1) ) , or ( (1<<n) >>1) -1, or offset0 and/or offset1 are set to 0.

[0875]

In some examples, the shifting the one or more parameters further comprises shifting the one or more parameters with a second shift function Shift (x, n) , which is defined as:

[0876]

Shift (x, n) = (x+ offset0) >>n,

[0877]

wherein x is one of the one or more parameters, n is an integer, and offset0 is set to (1<<n) >>1 or (1<< (n-1) ) , or ( (1<<n) >>1) -1, or offset0 is set to 0.

[0878]

In some examples, n is 2 or 4.

[0879]

In some examples, n depends on motion precision, or n is different for different parameters in the set of affine model parameters.

[0880]

In some examples, n is signaled in at least one of Sequence Parameter Set (SPS) , Video Parameter Set (VPS) , Picture Parameter Set (PPS) , slice header, tile group header, tile, coding tree unit (CTU) , coding unit (CU) .

[0881]

In some examples, n is different in different standard profiles or levels or tiers.

[0882]

In some examples, the stored parameter is left shift first before it is used in affine inheritance of blocks coded after the current block.

[0883]

In some examples, the stored parameter is shift with a shift function and clipped with a clip function sequentially before it is used in affine inheritance of blocks coded after the current block.

[0884]

In some examples, a parameter a of the set of affine model parameters is calculated by

where mv

^{h}
_{0} is a horizontal motion vector component of a top-left corner control point of the current block, mv

^{h}
_{1} is a horizontal motion vector component of a top-right corner control point of the current block, and w is a width of the current block.

[0885]

In some examples, a parameter b of the set of affine model parameters is calculated by

where mv

^{v}
_{0} is a vertical motion vector component of a top-left corner control point of the current block, mv

^{v}
_{1} is a vertical motion vector component of a top-right corner control point of the current block, and w is a width of the current block.

[0886]

In some examples, a parameter c of the set of affine model parameters is calculated by

where mv

^{h}
_{0} is a horizontal motion vector component of a top-left corner control point of the current block, mv

^{h}
_{2} is a horizontal motion vector component of a bottom-left corner control point of the current block, and h is a height of the current block.

[0887]

In some examples, a parameter d of the set of affine model parameters is calculated by

where mv

^{v}
_{0} is a vertical motion vector component of a top-left corner control point of the current block, mv

^{v}
_{2} is a vertical motion vector component of a bottom-left corner control point of the current block, and h is a height of the current block.

[0888]

In some examples, a parameter e of the set of affine model parameters is calculated by

where mv

^{h}
_{0} is a horizontal motion vector component of a top-left corner control point of the current block.

[0889]

In some examples, a parameter f of the set of affine model parameters is calculated by

where mv

^{v}
_{0} is a vertical motion vector component of a top-left corner control point of the current block.

[0890]

In some examples, parameters e and f of the set of affine model parameters are calculated by (e, f) = (mv
_{xi}, mv
_{yi}) , where (mv
_{xi}, mv
_{yi}) is a motion vector of any point.

[0891]

In some examples, the width and height of the current block are noted as w and h are equal to 2
^{WB} and 2
^{HB}, where WB and HB are integers greater than one.

[0892]

In some examples, a parameter a of the set of affine model parameters is calculated by

where P is an integer and represents a calculation precision, mv

^{h}
_{0} is a horizontal motion vector component of a top-left corner control point of the current block, and mv

^{h}
_{1} is a horizontal motion vector component of a top-right corner control point of the current block.

[0893]

In some examples, wherein a parameter b of the set of affine model parameters is calculated by

where P is an integer and represents a calculation precision, mv

^{v}
_{0} is a vertical motion vector component of a top-left corner control point of the current block, and mv

^{v}
_{1} is a vertical motion vector component of a top-right corner control point of the current block.

[0894]

In some examples, a parameter c of the set of affine model parameters is calculated by

where P is an integer and represents a calculation precision, mv

^{h}
_{0} is a horizontal motion vector component of a top-left corner control point of the current block, and mv

^{h}
_{2} is a horizontal motion vector component of a bottom-left corner control point of the current block.

[0895]

In some examples, a parameter d of the set of affine model parameters is calculated by

where P is an integer and represents a calculation precision, mv

^{v}
_{0} is a vertical motion vector component of a top-left corner control point of the current block, and mv

^{v}
_{2} is a vertical motion vector component of a bottom-left corner control point of the current block.

[0896]

In some examples, P is set to 7.

[0897]

In some examples, the method further comprises: clipping the one or more parameters, prior to the storing the one or more parameters.

[0898]

In some examples, if one of the one or more parameters, X, is stored with K bits, then X=Clip3 (-2
^{K-1}, 2
^{K-1}-1, X) , where X=a or b or c or d, and K is an integer that is greater than one.

[0899]

In some examples, X is a, b, c, d, e, or f.

[0900]

In some examples, K is equal to 8.

[0901]

In some examples, the set of affine model parameters comprises six variables (a, b, c, d, e, f) corresponding to a six-parameter affine model given by

[0903]

where mv
^{h} (x, y) is a horizontal component of a motion vector of the current block, mv
^{v} (x, y) is a vertical component of a motion vector of the current block, and (x, y) represents the coordinate of a representative point relative to a top-left sample within the current block; (mv
^{h}
_{0}, mv
^{v}
_{0}) is a motion vector of a top-left corner control point (CP) , and (mv
^{h}
_{1}, mv
^{v}
_{1}) is a motion vector of a top-right corner control point and (mv
^{h}
_{2}, mv
^{v}
_{2}) is a motion vector of a bottom-left corner control point for the current block.

[0904]

In some examples, the one or more parameters comprise a, b, c, and d.

[0905]

In some examples, the set of affine model parameters comprises four variables (a, b, e, f) corresponding to a four-parameter affine model given by

[0907]

where mv
^{h} (x, y) is a horizontal component of a motion vector of the current block, mv
^{v} (x, y) is a vertical component of a motion vector of the current block, and (x, y) represents the coordinate of a representative point relative to a top-left sample within the current block; (mv
^{h}
_{0}, m
^{hv}
_{0}) is a motion vector of a top-left corner control point (CP) , and (mv
^{h}
_{1}, mv
^{v}
_{1}) is a motion vector of a top-right corner control point for the current block.

[0908]

In some examples, the one or more parameters comprise a and b.

[0909]

In some examples, the one or more parameters comprise a, b, e and f.

[0910]

In some examples, the one or more parameters comprise a, b, c, d, e and f, and wherein it is restricted that c=-b and d=a, when the conversion between the current block and the bitstream representation of the current block is performed with a four-parameter affine model.

[0911]

In some examples, the one or more parameters comprise a, b, c and d, and wherein it is restricted that c=-b and d=a, when the conversion between the current block and the bitstream representation of the current block is performed with a four-parameter affine mode.

[0912]

In some examples, the parameter c=-b, when the conversion between the current block and the bitstream representation of the current block is performed with a four-parameter affine mode.

[0913]

In some examples, the parameter d=a, when the conversion between the current block and the bitstream representation of the current block is performed with a four-parameter affine mode.

[0914]

In some examples, the method further comprises: performing a conversion between a block coded after the current block and a bitstream representation of the block coded after the current block, based on the stored shifted one or more parameters.

[0915]

In some examples, the method further comprises: performing, based stored on the one or more parameters, the conversion between the current block and the bitstream representation of the current block.

[0916]

In some examples, the conversion generates the block coded after the current block from the bitstream representation.

[0917]

In some examples, the conversion generates the bitstream representation from the block coded after the current block.

[0918]

It will be appreciated by one of skill in the art that techniques for using motion candidate lists under various video coding scenarios are disclosed. Video blocks may be encoded into bitstream representations that include non-contiguous bits that are placed in various headers or in network adaption layer, and so on.

[0919]

The disclosed and other solutions, examples, embodiments, modules and the functional operations described in this document can be implemented in digital electronic circuitry, or in computer software, firmware, or hardware, including the structures disclosed in this document and their structural equivalents, or in combinations of one or more of them. The disclosed and other embodiments can be implemented as one or more computer program products, i.e., one or more modules of computer program instructions encoded on a computer readable medium for execution by, or to control the operation of, data processing apparatus. The computer readable medium can be a machine-readable storage device, a machine-readable storage substrate, a memory device, a composition of matter effecting a machine-readable propagated signal, or a combination of one or more them. The term “data processing apparatus” encompasses all apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can include, in addition to hardware, code that creates an execution environment for the computer program in question, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them. A propagated signal is an artificially generated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus.

[0920]

A computer program (also known as a program, software, software application, script, or code) can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program does not necessarily correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document) , in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub programs, or portions of code) . A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a communication network.

[0921]

The processes and logic flows described in this document can be performed by one or more programmable processors executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit) .

[0922]

Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read only memory or a random-access memory or both. The essential elements of a computer are a processor for performing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto optical disks, or optical disks. However, a computer need not have such devices. Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto optical disks; and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.

[0923]

While this patent document contains many specifics, these should not be construed as limitations on the scope of any subject matter or of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular techniques. Certain features that are described in this patent document in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.

[0924]

Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Moreover, the separation of various system components in the embodiments described in this patent document should not be understood as requiring such separation in all embodiments.

[0925]

Only a few implementations and examples are described and other implementations, enhancements and variations can be made based on what is described and illustrated in this patent document.

### Claims

[Claim 1]

A method of video processing, comprising: associating a first group of control point motion vectors (CPMVs) for determining inherited motion information of blocks coded after a first block, with a second group of CPMVs for deriving MVs of sub-blocks of the first block or a third group of CPMVs that is signaled for the first block, wherein the first group of CPMVs are not identical with the second group of CPMVs or the third group of CPMVs; determining inherited motion information for a second block, which is coded after the first block, based on the first group of CPMVs; and performing a conversation between the second block and a bitstream representation of the second block by using the inherited motion information.

[Claim 2]

The method of claim 1, wherein the first group of CPMVs are derived from the second group of CPMVs or the third group of CPMVs.

[Claim 3]

The method of any of claims 1-2, further comprising: storing the first group of CPMVs after the conversion of the first block.

[Claim 4]

The method of any of claims 1-3, wherein the second group of CPMVs are same as the third group of CPMVs.

[Claim 5]

The method of any of claims 1-4, wherein multiple representative points’ coordinates of the first group of CPMVs, multiple representative points’ coordinates of the second group of CPMVs and/or multiple representative points’ coordinates of the third group of CPMVs are defined as coordinates relative to one block or sub-block which is used in an affine motion compensation process.

[Claim 6]

The method of any of claims 1-5, wherein a relative offset between representative points of two CPMVs in the first group of CPMVs is independent of a width or a height of the first block.

[Claim 7]

The method of any of claims 1-6, wherein representative points of the first group of CPMVs are inside of the first block or outside of the first block.

[Claim 8]

The method of any of claims 1-7, wherein: a) y
^{F}1 = y
^{F}0, x
^{F}1 = x
^{F}0 + PW, or b) x
^{F}1 = x
^{F}0, y
^{F}1 = y
^{F}0 + PH, or c) y
^{F}2 = y
^{F}0, x
^{F}2 = x
^{F}0 + PW, or d) x
^{F}2 = x
^{F}0, y
^{F}2 = y
^{F}0 + PH, or e) y
^{F}2 = y
^{F}1, x
^{F}2 = x
^{F}1 + PW, or f) x
^{F}2 = x
^{F}1, y
^{F}2 = y
^{F}1 + PH, where (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) , (x
^{F}2, y
^{F}2) are multiple representative points’ coordinates of the first group of CPMVs, and PW and PH are integers.

[Claim 9]

The method of claim 8, wherein PW = 2
^{M}, or PW = -2
^{M}, or PH = 2
^{M}, or PH = -2
^{M}, M is an integer in a range of 2 to 7.

[Claim 10]

The method of claim 8 or 9, wherein PW and PH are not stored.

[Claim 11]

The method of claim 10, wherein PW and PH are fixed.

[Claim 12]

The method of claim 10, wherein PW and PH are signaled in at least one of Sequence Parameter Set (SPS) , Video Parameter Set (VPS) , Picture Parameter Set (PPS) , slice header, tile group header, tile, or CTU.

[Claim 13]

The method of claim 10, wherein PW and PH are different in different standard profiles or levels or tiers.

[Claim 14]

The method of claim 10, wherein PW and PH depend on maximum coding unit (CU) size or/and minimum CU size of slice or picture.

[Claim 15]

The method of any of claims 1-7, wherein in the first group of CPMVs, a) MV
^{F}0 = MV
^{S}0, (x
^{F}0, y
^{F}0) = (x
^{S}0, y
^{S}0) , or MV
^{F}0 = MV
^{T}0, (x
^{F}0, y
^{F}0) = (x
^{T}0, y
^{T}0) ; or b) MV
^{F}0 = MV
^{S}1, (x
^{F}0, y
^{F}0) = (x
^{S}1, y
^{S}1) , or MV
^{F}0 = MV
^{T}1, (x
^{F}0, y
^{F}0) = (x
^{T}1, y
^{T}1) ; or c) MV
^{F}0 = MV
^{S}2, (x
^{F}0, y
^{F}0) = (x
^{S}2, y
^{S}2) , or MV
^{F}0 = MV
^{T}2, (x
^{F}0, y
^{F}0) = (x
^{T}2, y
^{T}2) ; wherein motion vectors MV
^{F}0, MV
^{F}1, MV
^{F}2 are multiple CPMVs at multiple representative points’ coordinates (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) , (x
^{F}2, y
^{F}2) of the first group of CPMVs respectively, motion vectors MV
^{S}0, MV
^{S}1, MV
^{S}2 are multiple CPMVs at multiple representative points’ coordinates (x
^{S}0, y
^{S}0) , (x
^{S}1, y
^{S}1) , (x
^{S}2, y
^{S}2) of the second group of CPMVs respectively, and motion vectors MV
^{T}0, MV
^{T}1, MV
^{T}2 are multiple CPMVs at multiple representative points’ coordinates (x
^{T}0, y
^{T}0) , (x
^{T}1, y
^{T}1) , (x
^{T}2, y
^{T}2) of the third group of CPMVs respectively.

[Claim 16]

The method of any of claims 1-7, wherein motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2 in the first group of CPMVs are derived from motion vectors MV
^{S}0 and MV
^{S}1 in the second group of CPMVs by using a 4-parameter affine model with coordinates (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates of the affine model.

[Claim 17]

The method of any of claims 1-7, wherein motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2 in the first group of CPMVs are derived from motion vectors MV
^{S}0, MV
^{S}1 and MV
^{S}2 in the second group of CPMVs by using a 6-parameter affine model with coordinates (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates of the affine model.

[Claim 18]

The method of any of claims 1-7, wherein motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2 in the first group of CPMVs are derived from motion vectors MV
^{T}0 and MV
^{T}1 in the third group of CPMVs by using a 4-parameter affine model with coordinates (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates of the affine model.

[Claim 19]

The method of any of claims 1-7, wherein motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2 in the first group of CPMVs are derived from motion vectors MV
^{T}0, MV
^{T}1 and MV
^{T}2 in the third group of CPMVs by using a 6-parameter affine model with coordinates (x
^{F}0, y
^{F}0) , (x
^{F}1, y
^{F}1) and (x
^{F}2, y
^{F}2) as the input coordinates of the affine model.

[Claim 20]

The method of any of claims 1-7, wherein motion vectors MV
^{F}2 in the first group of CPMVs comprising motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2 is only calculated if the first block is coded with a 6-parameter affine model, or motion vectors MV
^{F}2 in the first group of CPMVs comprising motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2 is calculated no matter the first block is coded with a 4-parameter affine model or a 6-parameter affine model.

[Claim 21]

The method of any of claims 1-2, further comprising: storing one or more differences (D1, D2) between the CPMVs in the first group of CPMVs.

[Claim 22]

The method of claim 21, wherein the first group of CPMVs comprises motion vectors MV
^{F}0, MV
^{F}1 and MV
^{F}2, and D1 = MV
^{F}1-MV
^{F}0 is stored, or D2 = MV
^{F}2-MV
^{F}0 is stored, or both D1 and D2 are stored.

[Claim 23]

The method of claim 22, wherein D2 is stored only when the first block is coded with a 6-parameter affine model.

[Claim 24]

The method of claim 22, wherein D2 is stored when the first block is coded with the 6-parameter affine model or the 6-parameter affine model.

[Claim 25]

The method of any of claims 1-2, further comprising: storing the first group of CPMVs and one or more differences (D1, D2) between the CPMVs in the first group of CPMVs together.

[Claim 26]

The method of any of claims 3, 21 or 25, wherein the multiple CPMVs in the first group of CPMVs and/or one or more differences between the CPMVs in the first group of CPMVs are shifted with a shift function, and the shifted CPMVs and/or differences are stored.

[Claim 27]

The method of claim 26, wherein the shift function SatShift (x, n) is defined as:

wherein n is an integer, and offset0 and/or offset1 are set to (1<<n) >>1 or (1<< (n-1) ) , or ( (1<<n) >>1) -1, or offset0 and/or offset1 are set to 0.

[Claim 28]

The method of claim 26, wherein the shift function Shift (x, n) is defined as: Shift (x, n) = (x+ offset0) >>n, wherein n is an integer, and offset0 is set to (1<<n) >>1 or (1<< (n-1) ) , or ( (1<<n) >>1) -1, or offset0 is set to 0.

[Claim 29]

The method of claim 27 or 28, wherein n is 2 or 4, or n depends on the motion precision.

[Claim 30]

The method of claim 27 or 28, wherein n in case that the CPMV in the first group of CPMVs is different from n in case that the difference between CPMVs in the first group of CPMVs is stored.

[Claim 31]

The method of claim 27 or 28, wherein stored CPMV is left shift first before it is used in the affine inheritance of the blocks coded after the first block.

[Claim 32]

The method of any of claims 3, 21 or 25, wherein the multiple CPMVs in the first group of CPMVs and/or one or more differences between the CPMVs in the first group of CPMVs are clipped with a clip function, and the clipped CPMVs and/or the differences are stored.

[Claim 33]

The method of claim 32, wherein the clip function Clip3 (min, max, x) is defined as:

wherein Min is a lower threshold of the clip function, Max is a higher threshold of the clip function.

[Claim 34]

The method of claim 33, wherein when the CPMV or the difference is stored with K bits, Min= -2
^{K-1} and Max= 2
^{K-1}-1, K is an integer.

[Claim 35]

The method of claim 34, wherein K is different depending on whether the CPMV or the difference is to be stored.

[Claim 36]

The method of any of claims 26-35, wherein the multiple CPMVs in the first group of CPMVs and/or one or more differences between the CPMVs in the first group of CPMVs are processed with the shift function and the clip function sequentially, and the processed CPMVs and/or the differences are stored.

[Claim 37]

The method of any of claims 1-20, wherein the multiple CPMVs in the first group of CPMVs are stored into an affine History Motion Vector Prediction (HMVP) buffer or table or list to represent one history-based candidate affine model.

[Claim 38]

The method of any of claims 21-24, wherein the one or more differences between the CPMVs in the first group of CPMVs are stored into an affine History Motion Vector Prediction (HMVP) buffer or table or list to represent one history-based candidate affine model.

[Claim 39]

The method of claim 37 or 38, wherein one or more CPMVs or one or more differences stored in the HMVP buffer or table or list are shifted with the shift function and/or clipped with the clip function.

[Claim 40]

A method of video processing, comprising: deriving, for a conversion between a first block of video and a bitstream representation of the first block, affine inherited motion vectors (MVs) for the first block based on stored motion vectors (MVs) ; and performing the conversion by using the affine inherited MVs.

[Claim 41]

The method of claim 40, wherein the MVs are stored in an adjacent neighbouring basic block.

[Claim 42]

The method of claim 40, wherein the MVs are stored in affine History Motion Vector Prediction (HMVP) buffer or table or list.

[Claim 43]

The method of claim 41, wherein the MVs stored in the adjacent neighbouring basic block at least include: MV stored in a left adjacent neighbouring basic block (L) , MV stored in an above adjacent neighbouring basic block (A) , MV stored in a left-bottom adjacent neighbouring basic block (LB) , MV stored in an above-right adjacent neighbouring basic block (AR) and MV stored in an above left adjacent neighbouring basic block (AL) .

[Claim 44]

The method of claim 41 or 43, wherein the adjacent neighbouring basic block is a 4x4 block.

[Claim 45]

The method of any of claims 40 -44, wherein the affine inherited MV at a position (x, y) in the first block is derived by using a first MV of the adjacent neighbouring basic block (MVa =(mv
^{h}
_{a}, mv
^{v}
_{a}) ) at a representative point (x
_{0}, y
_{0}) based on an affine model with (x-x
_{0}, y-y
_{0}) as the input coordinates of the affine model.

[Claim 46]

The method of claim 45, wherein the representative point (x
_{0}, y
_{0}) is any position inside the basic block.

[Claim 47]

The method of claim 45, wherein the representative point (x
_{0}, y
_{0}) is any position outside or at the boundary of the basic block.

[Claim 48]

The method of claim 46 or 47, wherein the coordinate of the representative point (x
_{0}, y
_{0}) is determined based on the coordinate (xTL, yTL) of a top-left corner sample in the adjacent neighbouring basic block and additional information including two variables (i, j) .

[Claim 49]

The method of claim 48, wherein a first variable (i) of the two variables depends on width of the basic block, and a second variable (j) of the two variables depends on height of the basic block.

[Claim 50]

The method of claim 48, wherein the variables (i, j) depends on the position of the neighbouring basic block.

[Claim 51]

The method of claim 46, wherein the coordinate of the representative point (x
_{0}, y
_{0}) is determined based on the coordinate of top-left sample of the first block (xPos00, yPos00) , the coordinate of top-right sample of the first block (xPos10, yPos00) , and the coordinate of top-right sample of the first block (xPos00, yPos01) .

[Claim 52]

The method of claim 50 or 51, wherein the coordinate of the representative point (x
_{0}, y
_{0}) for the left adjacent neighbouring basic block L is (xPos00-2, yPos01-1) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the left-bottom adjacent neighbouring basic block (LB) is (xPos00-2, yPos01+3) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the above adjacent neighbouring basic block (A) is (xPos10-1, yPos00-2) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the above-right adjacent neighbouring basic block (AR) is (xPos10+3, yPos00-2) ; the coordinate of the representative point (x
_{0}, y
_{0}) for the above left adjacent neighbouring basic block (AL) is (xPos00-2, yPos00-2) .

[Claim 53]

The method of claim 48, wherein the additional information depends on the position of the adjacent neighbouring basic block or the adjacent neighbouring basic block, or the additional information is signaled in at least one of Sequence Parameter Set (SPS) , Video Parameter Set (VPS) , Picture Parameter Set (PPS) , slice header, tile group header, tile, coding tree unit (CTU) , CU.

[Claim 54]

The method of claim 48, wherein the additional information is different in different standard profiles or levels or tiers.

[Claim 55]

The method of any of claims 40 -44, wherein the affine inherited MV at a position (x, y) in a sub-block of the first block is derived by using a first MV of the adjacent neighbouring basic block (MVa) at a representative point (x
_{0}, y
_{0}) based on an affine model with (x-x
_{0}, y-y
_{0}) as the input coordinates of the affine model.

[Claim 56]

The method of claim 55, wherein the affine inherited MV at a position (x, y) in a sub-block is used to perform motion compensation for the sub-block.

[Claim 57]

The method of any of claims 40 -44, wherein the affine inherited MV at a position (x, y) , which is a corner of the first block, is derived as an inherited control point motion vector (CPMV) of the first block by using a first MV of the adjacent neighbouring basic block (MVa) at a representative point (x
_{0}, y
_{0}) based on an affine model with (x-x
_{0}, y-y
_{0}) as the input coordinates of the affine model.

[Claim 58]

The method of claim 57, wherein the inherited CPMVs are used to predict signaled CPMVs of the first block which is affine inter-coded.

[Claim 59]

The method of claim 57, wherein the inherited CPMVs are directly used as CPMVs of the first block which is affine merge-coded.

[Claim 60]

The method of any of claims 40-59, wherein when the first block uses a 4-paramter affine model, the affine model for deriving the affine inherited MV at a position (x, y) in the first block is:

wherein a and b are variables of the affine model.

[Claim 61]

The method of any of claim 40-59, wherein when the first block uses a 6-paramter affine model, the affine model for deriving the affine inherited MV at a position (x, y) in the first block is:

wherein a, b, c and d are variables of the affine model.

[Claim 62]

The method of claim 60 or 61, wherein the variable a, b, or variable a, b, c, d are calculated as:

wherein mv

_{t0}= (mv

^{h}
_{t0}, mv

^{v}
_{t0}) , mv

_{t1}= (mv

^{h}
_{t1}, mv

^{v}
_{t1}) , mv

_{t2}= (mv

^{h}
_{t2}, mv

^{v}
_{t2}) are CPMVs at three representative points, respectively, in a first group CPMVs for a second block covering the adjacent neighbouring basic block, and w

_{t} and h

_{t} depends on relative offsets between the representative points of the second block, wherein the first group CPMVs is used for determining inherited motion information of blocks coded after the second block.

[Claim 63]

The method of claim 60 or 61, wherein the variable a, b, or variable a, b, c, d are calculated as:

wherein mv

_{t0}= (mv

^{h}
_{t0}, mv

^{v}
_{t0}) , mv

_{t1}= (mv

^{h}
_{t1}, mv

^{v}
_{t1}) , mv

_{t2}= (mv

^{h}
_{t2}, mv

^{v}
_{t2}) are CPMVs at three representative points, respectively, in a second group CPMVs or a third group of CPMVs for a second block covering the adjacent neighbouring basic block, and w

_{t} and h

_{t} are the width and height of the second block, wherein the second group CPMVs are used to derive MVs for each sub-block of the second block, and the third group CPMVs are signaled from encoder to decoder.

[Claim 64]

The method of claim 60 or 61, wherein the variable a, b, or variable a, b, c, d are calculated as:

wherein mv

_{t0}= (mv

^{h}
_{t0}, mv

^{v}
_{t0}) , mv

_{t1}= (mv

^{h}
_{t1}, mv

^{v}
_{t1}) , mv

_{t2}= (mv

^{h}
_{t2}, mv

^{v}
_{t2}) are CPMVs at three representative points, respectively, of a second block covering the adjacent neighbouring basic block, and w

_{t} and h

_{t} are the width and height of the second block, wherein mv

^{h}
_{t1}-mv

^{h}
_{t0}, mv

^{v}
_{t1}-mv

^{v}
_{t0}, mv

^{h}
_{t2}-mv

^{h}
_{t0}, mv

^{v}
_{t2}-mv

^{v}
_{t0} are fetched from a storage for storing difference between CPMVs of the blocks directly.

[Claim 65]

The method of any of claims 1 to 64, wherein the conversion generates the first/second block of video from the bitstream representation.

[Claim 66]

The method of any of claims 1 to 64, wherein the conversion generates the bitstream representation from the first/second block of video.

[Claim 67]

An apparatus in a video system comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to implement the method in any of claims 1 to 66.

[Claim 68]

A computer program product stored on a non-transitory computer readable media, the computer program product including program code for carrying out the method in any of claims 1 to 66.

### Drawings