Patent Description:
Video coding and decoding can be performed using inter-picture prediction with motion compensation. Uncompressed digital video can include a series of pictures, each picture having a spatial dimension of, for example, <NUM> × <NUM> luminance samples and associated chrominance samples. The series of pictures can have a fixed or variable picture rate (informally also known as frame rate), of, for example <NUM> pictures per second or <NUM>. Uncompressed video has significant bitrate requirements. For example, 1080p60 <NUM>:<NUM>:<NUM> video at <NUM> bit per sample (1920x1080 luminance sample resolution at <NUM> frame rate) requires close to <NUM> Gbit/s bandwidth. An hour of such video requires more than <NUM> GBytes of storage space.

In some video compression techniques, an MV applicable to a certain area of sample data can be predicted from other MVs, for example from those related to another area of sample data spatially adjacent to the area under reconstruction, and preceding that MV in decoding order. Doing so can substantially reduce the amount of data required for coding the MV, thereby removing redundancy and increasing compression. MV prediction can work effectively, for example, because when coding an input video signal derived from a camera (known as natural video) there is a statistical likelihood that areas larger than the area to which a single MV is applicable move in a similar direction and, therefore, can in some cases be predicted using a similar motion vector derived from MVs of neighboring area. That results in the MV found for a given area to be similar or the same as the MV predicted from the surrounding MVs, and that in turn can be represented, after entropy coding, in a smaller number of bits than what would be used if coding the MV directly. In some cases, MV prediction can be an example of lossless compression of a signal (namely: the MVs) derived from the original signal (namely: the sample stream). In other cases, MV prediction itself can be lossy, for example because of rounding errors when calculating a predictor from several surrounding MVs.

Various MV prediction mechanisms are described in H. <NUM>/HEVC (ITU-T Rec. <NUM>, "High Efficiency Video Coding", December <NUM>). Out of the many MV prediction mechanisms that H. <NUM> offers, described here is a technique henceforth referred to as "spatial merge".

Referring to <FIG>, a current block (<NUM>) comprises samples that have been found by the encoder during the motion search process to be predictable from a previous block of the same size that has been spatially shifted. Instead of coding that MV directly, the MV can be derived from metadata associated with one or more reference pictures, for example from the most recent (in decoding order) reference picture, using the MV associated with either one of five surrounding samples, denoted A0, A1, and B0, B1, B2 (<NUM> through <NUM>, respectively). <NUM>, the MV prediction can use predictors from the same reference picture that the neighboring block is using.

<NPL>), concerns an interweaved prediction approach for affine motion compensation.

<NPL>), concerns a technique for motion vector clipping in affine sub-block motion vector derivation.

The present invention concerns a method of video decoding at a video decoder according to claim <NUM>, and an apparatus of video decoding according to claim <NUM>. Further aspects of the present invention are defined in the dependent claims. Aspects of the disclosure provide methods and apparatuses for video encoding/decoding. In some examples, an apparatus for video decoding includes processing circuitry configured to determine an affine model for a current block coded with an interweaved affine mode. Based on the affine model, a first prediction block corresponding to a first pattern for partitioning the current block into first sub-blocks and a second prediction block corresponding to a second pattern for partitioning the current block into second sub-blocks can be generated. The first and second prediction blocks include interpolated samples having an intermediate bit-depth larger than an input bit-depth of the current block. A third prediction block can be generated based on the first and second
prediction blocks. First samples in the first prediction block and corresponding second samples in the second prediction block each with a precision corresponding to the intermediate bit-depth are combined by performing a weighted average operation to obtain averaged samples. The averaged samples are rounded to the input bit-depth to obtain corresponding third samples in the third prediction block.

In an embodiment, the weighted average operation includes adding a rounding offset to a weighted sum of the first sample and the corresponding second sample. In an embodiment, the second pattern is shifted with respect to the first pattern and includes whole sub-blocks and fractional sub-blocks, and when the first and second samples are located within a region corresponding to the whole sub-blocks of the second sub-blocks, then the second sample is given a zero weight in the weighted average operation. In an embodiment, when the first and second samples are located within a region corresponding to the second sub-blocks having the first size, then the first and second samples are given an equal weight in the weighted average operation.

In an example, the third sample is constrained to be within a range from <NUM> to a maximum possible value corresponding to the input bit-depth. In an example, deblocking is disabled for the current block. In an example, the second pattern is shifted with respect to the first pattern and includes whole sub-blocks and fractional sub-blocks, and deblocking is disabled within a region corresponding to the whole sub-blocks of the second sub-blocks, and is applied or not applied to a region corresponding to the fractional sub-blocks of the second sub-blocks.

Aspects of the disclosure also provide a method of video decoding at a video decoder. The method includes: determining an affine model for a current block coded with an interweaved affine mode; generating, based on the affine model, a first prediction block corresponding to a first pattern for partitioning the current block into first sub-blocks and a second prediction block corresponding to a second pattern for partitioning the current block into
second sub-blocks, wherein the first and second prediction blocks include interpolated samples having an intermediate bit-depth larger than an input bit-depth of the current block; and generating a third prediction block based on the first and second prediction blocks, wherein first samples in the first prediction block and corresponding second samples in the second prediction block each with a precision corresponding to the intermediate bit-depth are combined by performing a weighted average operation to obtain averaged samples, and the averaged samples are rounded to the input bit-depth to obtain corresponding third samples in the third prediction block.

Aspects of the disclosure also provide a non-transitory computer-readable medium storing instructions which when executed by a computer for video decoding cause the computer to perform the method for video decoding.

A streaming system may include a capture subsystem (<NUM>), that can include a video source (<NUM>), for example a digital camera, creating for example a stream of video pictures (<NUM>) that are uncompressed. In an example, the stream of video pictures (<NUM>) includes samples that are taken by the digital camera. The stream of video pictures (<NUM>), depicted as a bold line to emphasize a high data volume when compared to encoded video data (<NUM>) (or coded video bitstreams), can be processed by an electronic device (<NUM>) that includes a video encoder (<NUM>) coupled to the video source (<NUM>). The video encoder (<NUM>) can include hardware, software, or a combination thereof to enable or implement aspects of the disclosed subject matter as described in more detail below. The encoded video data (<NUM>) (or encoded video bitstream (<NUM>)), depicted as a thin line to emphasize the lower data volume when compared to the stream of video pictures (<NUM>), can be stored on a streaming server (<NUM>) for future use. One or more streaming client subsystems, such as client subsystems (<NUM>) and (<NUM>) in <FIG> can access the streaming server (<NUM>) to retrieve copies (<NUM>) and (<NUM>) of the encoded video data (<NUM>). A client subsystem (<NUM>) can include a video decoder (<NUM>), for example, in an electronic device (<NUM>). The video decoder (<NUM>) decodes the incoming copy (<NUM>) of the encoded video data and creates an outgoing stream of video pictures (<NUM>) that can be rendered on a display (<NUM>) (e.g., display screen) or other rendering device (not depicted). In some streaming systems, the encoded video data (<NUM>), (<NUM>), and (<NUM>) (e.g., video bitstreams) can be encoded according to certain video coding/compression standards. Examples of those standards include ITU-T Recommendation H. In an example, a video coding standard under development is informally known as Versatile Video Coding (VVC). The disclosed subject matter may be used in the context of VVC.

Video compression technologies can include in-loop filter technologies that are controlled by parameters included in the coded video sequence (also referred to as coded video bitstream) and made available to the loop filter unit (<NUM>) as symbols.

(<NUM>) from the parser (<NUM>), but can also be responsive to meta-information obtained during the decoding of previous (in decoding order) parts of the coded picture or coded video sequence, as well as responsive to previously reconstructed and loop-filtered sample values.

In various embodiments, for an inter-predicted CU, motion parameters including motion vectors, reference picture indices, reference picture list usage index, and possibly other additional information can be used for inter-predicted sample generation. The motion parameters can be signaled in an explicit or implicit manner. When a CU is coded with a skip mode, the CU is associated with one PU and has no significant residual coefficients, coded motion vector delta, or reference picture indices associated with the CU.

When a merge mode is employed, motion parameters for a current CU can be obtained from neighboring CUs, including spatial and temporal merge candidates, and optionally other merge candidates. The merge mode can be applied to an inter-predicted CU, and may be used for a skip mode. An alternative to the merge mode is an explicit transmission of motion parameters. For example, motion vectors, respective reference picture indices for each reference picture list, reference picture list usage flags, and other needed information can be signaled explicitly per each CU.

The following inter prediction coding tools are used in some embodiments:.

In some embodiments, a merge candidate list is constructed by including the following five types of candidates in order:.

In some embodiments, the size of the merge list is signaled in a slice header and the maximum allowed size of the merge list is <NUM>. For each CU coded in merge mode, an index of best merge candidate is encoded using truncated unary (TU) binarization. The first bin of the merge index is coded with context, and bypass coding is used for other bins.

Examples of generation processes of each category of merge candidates are described below.

In a process of deriving spatial merge candidates, a maximum of four merge candidates are selected among candidates located in the positions A1, B1, B0, A0 and B2 neighboring a current block (<NUM>) in <FIG>. The order of derivation is A1, B1, B0, A0 and B2. Position B2 is considered when any CU of position A1, B1, B0, A0 is not available (e.g. because it belongs to another slice or tile) or is intra coded. After the candidate at position A1 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. As a result, coding efficiency is improved. To reduce computational complexity, not all possible candidate pairs are considered in the mentioned redundancy check. Instead, the pairs linked with an arrow in <FIG> are considered. A candidate is added to the list when the corresponding candidate used for redundancy check has not the same motion information.

In an embodiment, one temporal candidate is added to the list. Particularly, in the derivation of this temporal merge candidate for a current block (<NUM>) in a current picture (<NUM>), a scaled motion vector (<NUM>) is derived based on a co-located CU (<NUM>) belonging to a collocated picture (<NUM>) as shown in <FIG>. The reference picture list to be used for derivation of the co-located CU is explicitly signaled in the slice header. The scaled motion vector (<NUM>) for the temporal merge candidate is scaled from a motion vector (<NUM>) of the co-located CU (<NUM>) using picture order count (POC) distances, Tb and Td. Tb is defined to be a POC difference between a current reference picture (<NUM>) of the current picture (<NUM>) and the current picture (<NUM>). Td is defined to be a POC difference between a co-located reference picture (<NUM>) of the co-located picture (<NUM>) and the co-located picture (<NUM>). A reference picture index of the temporal merge candidate is set equal to zero.

The position for the temporal candidate is selected between candidates C0 and C1 shown in <FIG>. If a CU at position C0 is not available, intra coded, or is outside of the current row of CTUs, the position C1 is used. Otherwise, position C0 is used in the derivation of the temporal merge candidate.

In some embodiments, history-based MVP (HMVP) merge candidates are added to a merge list after the SMVP and TMVP. In this method, the motion information of a previously coded block is stored in a table and used as MVP for the current CU. The table with multiple HMVP candidates is maintained during the encoding/decoding process. The table is reset (emptied) when a new CTU row is encountered. Whenever there is a non-subblock inter-coded CU, the associated motion information is added to the last entry of the table as a new HMVP candidate.

In an embodiment, the HMVP table size S is set to be <NUM>, which indicates up to <NUM> History-based MVP (HMVP) candidates may be added to the table. When inserting a new motion candidate to the table, a constrained FIFO rule is utilized wherein redundancy check is firstly applied to find whether there is an identical HMVP in the table. If found, the identical HMVP is removed from the table, and all the HMVP candidates afterwards are moved forward.

HMVP candidates can be used in a merge candidate list construction process. The latest several HMVP candidates in the table are checked in order and inserted to the candidate list after the TMVP candidate. A redundancy check is applied on the HMVP candidates to the spatial or temporal merge candidate.

In an example, to reduce the number of redundancy check operations, the following simplifications are introduced:.

In some embodiments, pairwise average candidates are generated by averaging predefined pairs of candidates in the existing merge candidate list. For example, the predefined pairs are defined as {(<NUM>, <NUM>), (<NUM>, <NUM>), (<NUM>, <NUM>), (<NUM>, <NUM>), (<NUM>, <NUM>), (<NUM>, <NUM>)}, where the numbers denote the merge indices to the merge candidate list. The averaged motion vectors are calculated separately for each reference list. If both motion vectors are available in one list, these two motion vectors are averaged even when they point to different reference pictures; if only one motion vector is available, use the one directly; if no motion vector is available, keep this list invalid.

In an embodiment, when the merge list is not full after pair-wise average merge candidates are added, the zero MVPs are inserted in the end until the maximum merge candidate number is encountered.

In addition to merge mode, where implicitly derived motion information is directly used for prediction samples generation of a current CU, MMVD is used in some embodiments. A MMVD flag is signaled right after sending a skip flag and merge flag to specify whether a MMVD mode is used for a CU.

In an MMVD mode, after a merge candidate is selected, the merge candidate is further refined by signaled motion vector difference (MVD) information to obtain refined motion information. The MVD information includes a merge candidate flag, a distance index to specify a motion magnitude, and an index for indication of a motion direction.

One of the first two candidates in the merge list is selected to be used as a MV basis (a starting MV(s)). The merge candidate flag is signaled to specify which one is used. As shown in <FIG>, the MV basis determines a starting point (<NUM>) or (<NUM>) at a reference picture (<NUM>) or (<NUM>) in a reference picture list, L0 or L1, respectively.

The distance index specifies motion magnitude information and indicates a pre-defined offset from the starting point (<NUM>) or (<NUM>). As shown in <FIG>, an offset is added to either a horizontal component or vertical component of a starting MV (the MV basis) pointing at a position (<NUM>) or (<NUM>). The mapping relationship of a distance index and a pre-defined offset is specified in Table <NUM>.

The direction index represents a direction of a MVD relative to the starting point (<NUM>) or (<NUM>). The direction index can represent one of the four directions as shown in Table <NUM>.

It is noted that the meaning of an MVD sign can vary according to the information of starting MV(s). When the starting MV(s) is a uni-prediction MV or bi-prediction MVs both pointing to the same side of a current picture (i.e. POCs of two references are both larger than the POC of the current picture, or are both smaller than the POC of the current picture), the sign in Table <NUM> specifies the sign of MV offset added to the starting MV. When the starting MVs are bi-prediction MVs with the two MVs pointing to different sides of the current picture (i.e. the POC of one reference is larger than the POC of the current picture, and the POC of the other reference is smaller than the POC of the current picture), the sign in Table <NUM> specifies the sign of MV offset added to the L0 MV component of the starting MV and the sign for the L1 MV has an opposite value.

Based on the basis MV, the offset, and the MVD sign, the final MV(s) can be determined for the current CU.

In some examples, a translation motion model is applied for motion compensation prediction (MCP). However, the translational motion model may not be suitable for modeling other types of motions, such as zoom in/out, rotation, perspective motions, and the other irregular motions. In some embodiments, a block-based affine transform motion compensation prediction is applied. In <FIG>, an affine motion field of a block is described by two control point motion vectors (CPMVs), CPMV0 and CPMV1, of two control points (CPs), CP0 and CP1 when a <NUM>-parameter affine model is used. In <FIG>, an affine motion field of a block is described by three CPMVs, CPMV0, CPMV1 and CPMV2, of CPs, CP0, CP1, and CP2 when a <NUM>-parameter affine model is used.

For a <NUM>-parameter affine motion model, a motion vector at a sample location (x, y) in a block is derived as: <MAT>.

For a <NUM>-parameter affine motion model, a motion vector at sample location (x, y) in a block is derived as: <MAT>.

In the expressions (<NUM>) and (<NUM>), (mv0x, mv0y) is a motion vector of the top-left corner control point, (mv1x, mv1y) is motion vector of the top-right corner control point, and (mv2x, mv2y) is motion vector of the bottom-left corner control point. In addition, the coordinate (x, y) is with respect to the top-left corner of the respective block, and W and H denotes the width and height of the respective block.

In order to simplify the motion compensation prediction, a sub-block based affine transform prediction is applied in some embodiments. For example, in <FIG>, the <NUM>-parameter affine motion model is used, and two CPMVs, <MAT> and <MAT>, are determined. To derive a motion vector of each <NUM>×<NUM> (samples) luma sub-block (<NUM>) partitioned from the current block (<NUM>), a motion vector (<NUM>) of the center sample of each sub-block (<NUM>) is calculated according to above expressions (<NUM>), and rounded to a <NUM>/<NUM> fraction accuracy. Then, motion compensation interpolation filters are applied to generate a prediction of each sub-block (<NUM>) with the derived motion vector (<NUM>). The sub-block size of chroma-components is set to be <NUM>×<NUM>. A MV of a <NUM>×<NUM> chroma sub-block is calculated as the average of the MVs of the four corresponding <NUM>×<NUM> luma sub-blocks.

Similar to translational motion inter prediction, two affine motion inter prediction modes, affine merge mode and affine AMVP mode, are employed in some embodiments.

In some embodiments, an affine merge mode can be applied for CUs with both width and height larger than or equal to <NUM>. Affine merge candidates of a current CU is generated based on motion information of spatial neighboring CUs. There can be up to five affine merge candidates and an index is signaled to indicate the one to be used for the current CU. For example, the following three types of affine merge candidates are used to form an affine merge candidate list:.

In some embodiments, there can be at most two inherited affine candidates which are derived from affine motion models of the neighboring blocks, one from left neighboring CUs and one from above neighboring CUs. The candidate blocks, for example, can be located at positions shown in <FIG>. For the left predictor, the scan order is A0->A1, and for the above predictor, the scan order is BO->B1->B2. Only the first inherited candidate from each side is selected. No pruning check is performed between two inherited candidates.

When a neighboring affine CU is identified, CPMVs of the identified neighboring affine CU are used to derive a CPMV candidate in the affine merge list of the current CU. As shown in <FIG>, a neighbor left bottom block A of a current CU (<NUM>) is coded in an affine mode. Motion vectors, <MAT> and <MAT> of the top left corner, above right corner and left bottom corner of a CU (<NUM>) which contains the block A are attained. When block A is coded with a <NUM>-parameter affine model, two CPMVs <MAT> and <MAT> of the current CU (<NUM>) are calculated according to <MAT>, and <MAT>. In case that block A is coded with <NUM>-parameter affine model, three CPMVs (not shown) of the current CU are calculated according to <MAT> and <MAT>.

Constructed affine candidates are constructed by combining neighbor translational motion information of each control point. The motion information for the control points is derived from specified spatial neighbors and temporal neighbor shown in <FIG>. CPMVk (k=<NUM>, <NUM>, <NUM>, <NUM>) represents the k-th control point. For CPMV1, the B2->B3->A2 blocks are checked in order and the MV of the first available block is used. For CPMV2, the B1->B0 blocks are checked and for CPMV3, the A1->A0 blocks are checked. A TMVP at block T is used as CPMV4 if available.

After MVs of four control points are attained, affine merge candidates are constructed based on that motion information. The following combinations of control point MVs are used to construct in order: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}.

The combination of <NUM> CPMVs constructs a <NUM>-parameter affine merge candidate and the combination of <NUM> CPMVs constructs a <NUM>-parameter affine merge candidate. To avoid a motion scaling process, if the reference indices of control points are different, the related combination of control point MVs is discarded.

After inherited affine merge candidates and constructed affine merge candidates are checked, if the list is still not full, zero MVs are inserted to the end of the merge candidate list.

In some embodiments, affine AMVP mode can be applied for CUs with both width and height larger than or equal to <NUM>. An affine flag in CU level is signaled in the bitstream to indicate whether affine AMVP mode is used and then another flag is signaled to indicate whether <NUM>-parameter affine or <NUM>-parameter affine is used. A difference of the CPMVs of current CU and their predictorss is signaled in the bitstream. An affine AVMP candidate list size is <NUM>, and can be generated by using the following four types of CPVM candidate in order:.

The checking order of inherited affine AMVP candidates is similar to the checking order of inherited affine merge candidates in an example. The difference is that, for AVMP candidate, the affine CU that has the same reference picture as in current block is considered. No pruning process is applied when inserting an inherited affine motion predictor into the candidate list.

Constructed AMVP candidate is derived from the specified spatial neighbors shown in <FIG>. A same checking order is used as done in affine merge candidate construction. In addition, a reference picture index of a neighboring block is also checked. The first block in the checking order that is inter coded and has the same reference picture as in current CUs is used. When the current CU is coded with a <NUM>-parameter affine model, and CPMV0 and CPMV1 are both available, the available CPMVs are added as one candidate in the affine AMVP list. When the current CU is coded with <NUM>-parameter affine mode, and all three CPMVs (CPMV0, CPMV1, and CPMV2) are available, the available CPMVs are added as one candidate in the affine AMVP list. Otherwise, constructed AMVP candidates are set as unavailable.

If affine AMVP list candidates is still less than <NUM> after inherited affine AMVP candidates and constructed AMVP candidate are checked, translational motion vectors neighboring the control points will be added to predict all control point MVs of the current CU, when available. Finally, zero MVs are used to fill the affine AMVP list if the affine AMVP list is still not full.

<FIG> is a schematic illustration of spatial neighboring blocks that can be used to determine predicting motion information for a current block (<NUM>) using a sub-block based temporal MV prediction (SbTMVP) method in accordance with one embodiment. <FIG> shows a current block (<NUM>) and its spatial neighboring blocks denoted A0, A1, B0, and B1 (<NUM>, <NUM>, <NUM>, and <NUM>, respectively). In some examples, spatial neighboring blocks A0, A1, B0, and B1 and the current block (<NUM>) belong to a same picture.

<FIG> is a schematic illustration of determining motion information for sub-blocks of the current block (<NUM>) using the SbTMVP method based on a selected spatial neighboring block, such as block A1 in this non-limiting example, in accordance with an embodiment. In this example, the current block (<NUM>) is in a current picture (<NUM>), and a reference block (<NUM>) is in a reference picture (<NUM>) and can be identified based on a motion shift (or displacement) between the current block (<NUM>) and the reference block (<NUM>) indicated by a motion vector (<NUM>).

In some embodiments, similar to a temporal motion vector prediction (TMVP) in HEVC, a SbTMVP uses the motion information in various reference sub-blocks in a reference picture for a current block in a current picture. In some embodiments, the same reference picture used by TMVP can be used for SbTVMP. In some embodiments, TMVP predicts motion information at a CU level but SbTMVP predicts motion at a sub-CU level. In some embodiments, TMVP uses the temporal motion vectors from collocated block in the reference picture, which has a corresponding position adjacent to a lower-right corner or a center of a current block, and SbTMVP uses the temporal motion vectors from a reference block, which can be identified by performing a motion shift based on a motion vector from one of the spatial neighboring blocks of the current block.

For example, as shown in <FIG>, neighboring blocks A1, B1, B0, and A0 can be sequentially checked in a SbTVMP process. As soon as a first spatial neighboring block that has a motion vector that uses the reference picture (<NUM>) as its reference picture is identified, such as block A1 having the motion vector (<NUM>) that points to a reference block AR1 in the reference picture (<NUM>) for example, this motion vector (<NUM>) can be used for performing the motion shift. If no such motion vector is available from the spatial neighboring blocks A1, B1, B0, and A0, the motion shift is set to (<NUM>, <NUM>).

After determining the motion shift, the reference block (<NUM>) can be identified based on a position of the current block (<NUM>) and the determined motion shift. In <FIG>, the reference block (<NUM>) can be further divided into <NUM> sub-blocks with reference motion information MRa through MRp. In some examples, the reference motion information for each sub-block in the reference block (<NUM>) can be determined based on a smallest motion grid that covers a center sample of such sub-block. The motion information can include motion vectors and corresponding reference indices. The current block (<NUM>) can be further divided into <NUM> sub-blocks, and the motion information MVa through MVp for the sub-blocks in the current block (<NUM>) can be derived from the reference motion information MRa through MRp in a manner similar to the TMVP process, with temporal scaling in some examples.

The sub-block size used in the SbTMVP process can be fixed (or otherwise predetermined) or signaled. In some examples, the sub-block size used in the SbTMVP process can be <NUM>×<NUM> samples. In some examples, the SbTMVP process is only applicable to a block with a width and height equal to or greater than the fixed or signaled size, for example <NUM> pixels.

In an example, a combined sub-block based merge list which contains a SbTVMP candidate and affine merge candidates is used for the signaling of a sub-block based merge mode. The SbTVMP mode can be enabled or disabled by a sequence parameter set (SPS) flag. In some examples, if the SbTMVP mode is enabled, the SbTMVP candidate is added as the first entry of the list of sub-block based merge candidates, and followed by the affine merge candidates. In some embodiments, the maximum allowed size of the sub-block based merge list is set to five. However, other sizes may be utilized in other embodiments.

In some embodiments, the encoding logic of the additional SbTMVP merge candidate is the same as for the other merge candidates. That is, for each block in a P or B slice, an additional rate-distortion check can be performed to determine whether to use the SbTMVP candidate.

A triangular prediction mode (TPM) can be employed for inter prediction in some embodiments. In an embodiment, the TPM is applied to CUs that are 8x8 samples or larger in size and are coded in skip or merge mode. In an embodiment, for a CU satisfying these conditions (8x8 samples or larger in size and coded in skip or merge mode), a CU-level flag is signaled to indicate whether the TPM is applied or not.

When the TPM is used, in some embodiments, a CU is split evenly into two triangle-shaped partitions, using either the diagonal split or the anti-diagonal split as shown in <FIG>. In <FIG>, a first CU (<NUM>) is split from a top-left corner to a bottom-right corner resulting in two triangular prediction units, PU1 and PU2. A second CU (<NUM>) is split from a top-right corner to a bottom-left corner resulting in two triangular prediction units, PU1 and PU2. Each triangular prediction unit PU1 or PU2 in the CU (<NUM>) or (<NUM>) is inter-predicted using its own motion information.

In some embodiments, only uni-prediction is allowed for each triangular prediction unit. Accordingly, each triangular prediction unit has one motion vector and one reference picture index. The uni-prediction motion constraint can be applied to ensure that, similar to a conventional bi-prediction method, not more than two motion compensated predictions are performed for each CU. In this way, processing complexity can be reduced. The uni-prediction motion information for each triangular prediction unit can be derived from a uni-prediction merge candidate list. In some other embodiments, bi-prediction is allowed for each triangular prediction unit. Accordingly, the bi-prediction motion information for each triangular prediction unit can be derived from a bi-prediction merge candidate list.

In some embodiments, when a CU-level flag indicates that a current CU is coded using the TPM, an index, referred to as triangle partition index, is further signaled. For example, the triangle partition index can have a value in a range of [<NUM>, <NUM>]. Using this triangle partition index, the direction of the triangle partition (diagonal or anti-diagonal), as well as the motion information for each of the partitions (e.g., merge indices (or referred to as TPM indices) to the respective uni-prediction candidate list) can be obtained through a look-up table at the decoder side.

After predicting each of the triangular prediction unit based on the obtained motion information, in an embodiment, the sample values along the diagonal or anti-diagonal edge of the current CU are adjusted by performing a blending process with adaptive weights. As a result of the blending process, a prediction signal for the whole CU can be obtained. Subsequently, a transform and quantization process can be applied to the whole CU in a way similar to other prediction modes. Finally, a motion field of a CU predicted using the triangle partition mode can be created, for example, by storing motion information in a set of 4x4 units partitioned from the CU. The motion field can be used, for example, in a subsequent motion vector prediction process to construct a merge candidate list.

In some embodiments, a merge candidate list for prediction of two triangular prediction units of a coding block processed with a TPM can be constructed based on a set of spatial and temporal neighboring blocks of the coding block. Such a merge candidate list can be referred to as a TPM candidate list with TPM candidates listed herein. In one embodiment, the merge candidate list is a uni-prediction candidate list. The uni-prediction candidate list includes five uni-prediction motion vector candidates in an embodiment. For example, the five uni-prediction motion vector candidates are derived from seven neighboring blocks including five spatial neighboring blocks (labelled with numbers of <NUM> to <NUM> in <FIG>) and two temporal co-located blocks (labelled with numbers of <NUM> to <NUM> in <FIG>).

In an example, the motion vectors of the seven neighboring blocks are collected and put into the uni-prediction candidate list according to the following order: first, the motion vectors of the uni-predicted neighboring blocks; then, for the bi-predicted neighboring blocks, the L0 motion vectors (that is, the L0 motion vector part of the bi-prediction MV), the L1 motion vectors (that is, the L1 motion vector part of the bi-prediction MV), and averaged motion vectors of the L0 and L1 motion vectors of the bi-prediction MVs. In an example, if the number of candidates is less than five, zero motion vectors are added to the end of the list. In some other embodiments, the merge candidate list may include less than <NUM> or more than <NUM> uni-prediction or bi-prediction merge candidates that are selected from candidate positions that are the same or different from that shown in <FIG>.

In an embodiment, a CU is coded with a triangular partition mode with a TPM (or merge) candidate list including five TPM candidates. Accordingly, there are <NUM> possible ways to predict the CU when <NUM> merge candidates are used for each triangular PU. In other words, there can be <NUM> different combinations of split directions and merge (or TPM) indices: <NUM> (possible split directions) x (<NUM> (possible merge indices for a first triangular prediction unit) x <NUM> (possible merge indices for a second triangular prediction unit) - <NUM> (a number of possibilities when the pair of first and second prediction units shares a same merge index)). For example, when a same merge index is determined for the two triangular prediction units, the CU can be processed using a regular merge mode, instead of the triangular predication mode.

Accordingly, in an embodiment, a triangular partition index in the range of [<NUM>, <NUM>] can be used to represent which one of the <NUM> combinations is used based on a lookup table. <FIG> shows an exemplary lookup table (<NUM>) used to derive the split direction and merge indices based on a triangular partition index. As shown in the lookup table (<NUM>), a first row (<NUM>) includes the triangular partition indices ranging from <NUM> to <NUM>; a second row (<NUM>) includes possible split directions represented by <NUM> or <NUM>; a third row (<NUM>) includes possible first merge indices corresponding to a first triangular prediction unit and ranging from <NUM> to <NUM>; and, a fourth row <NUM> includes possible second merge indices corresponding to a second triangular prediction unit and ranging from <NUM> to <NUM>.

For example, when a triangular partition index having a value of <NUM> is received at a decoder, based on a column (<NUM>) of the lookup table (<NUM>), it can be determined that the split direction is a partition direction represented by the value of <NUM>, and the first and second merge indices are <NUM> and <NUM>, respectively. As the triangle partition indices are associated with a lookup table, a triangle partition index is also referred to as a table index in this disclosure.

In an embodiment, after predicting each triangular prediction unit using respective motion information, a blending process is applied to the two prediction signals of the two triangular prediction units to derive samples around the diagonal or anti-diagonal edge. The blending process adaptively chooses between two groups of weighting factors depending on the motion vector difference between the two triangular prediction units. In an embodiment, the two weighting factor groups are as follows:.

The second weighting factor group has more luma weighting factors and blends more luma samples along the partition edge.

In an embodiment, the following condition is used to select one of the two weighting factor groups. When reference pictures of the two triangle partitions are different from each other, or when a motion vector difference between the two triangle partitions is larger than a threshold (e.g., <NUM> luma samples), the 2nd weighting factor group is selected. Otherwise, the 1st weighting factor group is selected.

<FIG> shows an example of a CU applying the first weighting factor group. As shown, a first coding block (<NUM>) includes luma samples, and a second coding block (<NUM>) includes chroma samples. A set of pixels along a diagonal edge in the coding block (<NUM>) or (<NUM>) are labeled with the numbers <NUM>, <NUM>, <NUM>, <NUM>, and <NUM> corresponding to the weighting factors <NUM>/<NUM>, <NUM>/<NUM>, <NUM>/<NUM>, <NUM>/<NUM>, and <NUM>/<NUM>, respectively. For example, for a pixel labelled with the number of <NUM>, a sample value of the pixel after a blending operation can be obtained according to:<MAT> where P1 and P2 represent sample values at the respective pixel but belonging to predictions of a first triangular prediction unit and a second triangular prediction unit, respectively.

In some embodiments, when a CU is coded in merge mode, and if the CU contains at least <NUM> luma samples (that is, CU width times CU height is equal to or larger than <NUM>), an additional flag is signaled to indicate if a combined inter/intra prediction (CIIP) mode is applied to the current CU.

In order to form a CIIP prediction, an intra prediction mode is first derived from two additional syntax elements. Up to four possible intra prediction modes can be used: DC, planar, horizontal, or vertical. Then, the inter prediction and intra prediction signals are derived using regular intra and inter decoding processes. Finally, weighted averaging of the inter and intra prediction signals is performed to obtain the CIIP prediction.

In an embodiment, up to <NUM> intra prediction modes, including dc, planar, horizontal, and vertical modes, can be used to predict the luma component in the CIIP mode. If the CU shape is very wide (that is, width is more than two times of height), then the horizontal mode is not allowed. If the CU shape is very narrow (that is, height is more than two times of width), then the vertical mode is not allowed. In these cases, only <NUM> intra prediction modes are allowed.

The CIIP mode uses <NUM> most probable modes (MPM) for intra prediction. The CIIP MPM candidate list is formed as follows:.

If the CU shape is very wide or very narrow as defined above, the MPM flag is inferred to be <NUM> without signaling. Otherwise, an MPM flag is signaled to indicate if the CIIP intra prediction mode is one of the CIIP MPM candidate modes.

If the MPM flag is <NUM>, an MPM index is further signaled to indicate which one of the MPM candidate modes is used in CIIP intra prediction. Otherwise, if the MPM flag is <NUM>, the intra prediction mode is set to the "missing" mode in the MPM candidate list. For example, if the planar mode is not in the MPM candidate list, then planar is the missing mode, and the intra prediction mode is set to planar. Since <NUM> possible intra prediction modes are allowed in CIIP, and the MPM candidate list contains only <NUM> intra prediction modes, one of the <NUM> possible modes can be the missing mode.

For the chroma components, the DM mode is applied without additional signaling. For example, chroma uses the same prediction mode as luma.

The intra prediction mode of a CIIP-coded CU will be saved and used in the intra mode coding of the future neighboring CUs.

In an embodiment, the inter prediction signal in the CIIP mode P_inter is derived using the same inter prediction process applied to regular merge mode, and the intra prediction signal P_intra is derived using the CIIP intra prediction mode following the regular intra prediction process. Then, the intra and inter prediction signals are combined using weighted averaging, where the weight value depends on the intra prediction mode and where the sample is located in the coding block, in the following way.

If the intra prediction mode is the DC or planar mode, or if the block width or height is smaller than <NUM>, then equal weights are applied to the intra prediction and the inter prediction signals.

Otherwise, the weights are determined based on the intra prediction mode (either horizontal mode or vertical mode in this case) and the sample location in the block. Take the horizontal prediction mode as an example (the weights for the vertical mode are derived similarly but in the orthogonal direction). Let W denote the width of the block and H denote the height of the block. The coding block is first split into four equal-area parts, each of the dimension (W/<NUM>)xH. Starting from the part closest to the intra prediction reference samples and ending at the part farthest away from the intra prediction reference samples, the weight wt for each of the <NUM> regions is set to <NUM>, <NUM>, <NUM>, and <NUM>, respectively. The final CIIP prediction signal is derived using the following: <MAT>.

In some embodiments, interweaved affine prediction is used. For example, as shown in <FIG>, a current block (<NUM>) with a size of 16x16 samples is divided into sub-blocks with two different dividing patterns, Pattern <NUM> (<NUM>) and Pattern <NUM>(<NUM>). With Pattern <NUM> (<NUM>), the current block (<NUM>) is divided into the sub-blocks (<NUM>) with an equal size of 4x4. In contrast, Pattern <NUM> (<NUM>) is shifted by a 2x2 offset with respect to Pattern <NUM> (<NUM>) towards the lower-right corner of the current block (<NUM>). With Pattern <NUM> (<NUM>), the current block (<NUM>) is partitioned into the whole sub-blocks (<NUM>) each with a size of 4x4, and the fractional sub-blocks (<NUM>) each having a size smaller than the size of 4x4. In <FIG>, the fractional sub-blocks (<NUM>) form a shaded area surrounding a non-shaded area formed by the whole sub-blocks (<NUM>).

Subsequently, two auxiliary predictions, P0 (<NUM>) and P1 (<NUM>), corresponding to the two dividing patterns (<NUM>) and (<NUM>) are generated by affine motion compensation (AMC). For example, an affine model can be determined from an affine merge candidate on a sub-block based merge candidate list. A MV for each sub-block partitioned from Pattern <NUM>.

(<NUM>) and (<NUM>) can be derived based on the affine model. For example, the MVs can each start from a center position of the respective sub-block.

Thereafter, a final prediction (<NUM>) is calculated by combining the two predictions P0 (<NUM>) and P1 (<NUM>). For example, a weighted average operation (<NUM>) can be performed to calculate a weighted average of two corresponding samples (denoted by P<NUM> and P<NUM>) in the two predictions P0 (<NUM>) and P1 (<NUM>) pixel by pixel according to: <MAT> where ω<NUM> and ω<NUM> are the weights corresponding to the pair of co-located samples in the two predictions P0 (<NUM>) and P1 (<NUM>), respectively.

In an embodiment, the weight of each sample in the weighted average operation (<NUM>) can be determined according to a pattern (<NUM>) shown in <FIG>. The pattern (<NUM>) includes <NUM> samples included in a sub-block <NUM> (e.g., a whole sub-block (<NUM>) or (<NUM>)). An prediction sample located at the center of the sub-block (<NUM>) is associated with a weighting value of <NUM>, while a prediction sample located at the boundary of the sub-block (<NUM>) is associated with a weighting value <NUM>. Depending on a position of a sample within a sub-block (<NUM>) or (<NUM>), a weight corresponding to the sample can be determined based on the patter (<NUM>).

In an embodiment, to avoid tiny block motion compensation, the interweaved prediction is only applied on regions where the size of sub-blocks is <NUM>×<NUM> for both the two dividing patterns as shown in <FIG>. For example, in the shaded area of Pattern <NUM> (<NUM>), no interweaved prediction is applied, and in the non-shaded area of Pattern <NUM> (<NUM>), the interweaved prediction is applied.

In an embodiment, an interweaved prediction is applied on chroma components as well as the luma component. In addition, according to the disclosure, a memory access bandwidth is not increased by interweaved prediction since an area of a reference picture used for the AMC for all sub-blocks is fetched together as a whole. No additional reading operation is needed.

Further, for flexibility, a flag is signaled in slice header to indicate whether interweaved prediction is used or not. In an example, the flag is always signaled to be <NUM>. In various embodiments, interweaved affine prediction can be applied on uni-predicted affine blocks, or on both uni-predicted and bi-predicted affine blocks.

In some embodiments, a weighted sample prediction process for bi-predicted block and uni-predicted block is employed.

In an embodiment, inputs to the weighted sample prediction process are:.

Output of the weighted sample prediction process is a (nCbW)x(nCbH) array pbSamples of prediction sample values.

Variables shift1, shift2, offset1, offset2, and offset3 are derived as follows:.

Depending on the values of predFlagLO and predFlagL1, the prediction samples pbSamples[ x ][ y ] with x = <NUM>. (nCbW - <NUM>) and y = <NUM>. (nCbH - <NUM>) are derived as follows:.

The variable w1 is set equal to gbiWLut[ gbiIdx ] with gbiWLut[ k] = { <NUM>, <NUM>, <NUM>, <NUM>, -<NUM> }. The variable w0 is set equal to ( <NUM> - w1 ). The prediction sample values are derived as follows: <MAT>.

In the <FIG> example, in order to generate the two predictions (<NUM>) and (<NUM>) corresponding to the two partitioning patterns (<NUM>) and (<NUM>), the affine motion compensation (AMP) process is performed. For example, based on an affine model, MVs corresponding to the <NUM> sub-blocks (<NUM>) and <NUM> sub-blocks (<NUM>) are determined. Those MVs can be of a sub-pixel precision (e.g., half-pixel, quarter-pixel, one-eighth pixel, or one-sixteenth pixel). Accordingly, corresponding to the sub-pixel precision of the MVs, an interpolation process is performed to generate interpolated samples in a reference picture. Sub-block predictions of the sub-blocks (<NUM>) and (<NUM>) can be searched for over the interpolated reference picture with interpolated samples.

During the above interpolation process, an intermediate bit-depth (e.g., <NUM> bits) higher than an input bit-depth (e.g., <NUM> bits) of the interpolated reference picture or the current block (<NUM>) can be employed. Thus, the sub-block predictions (or predictors) may include samples of a high precision (or accuracy) corresponding the intermediate bit-depth compared with the low precision corresponding to the input bit-depth.

In the <FIG> example, high precision sample values of the sub-block predictions (or predictors) are converted to low precision sample values before stored in the prediction blocks (<NUM>) and (<NUM>). For example, by a right shifting operation, the intermediate bit-depth (<NUM> bits) is rounded to the input bit-depth (e.g., <NUM> bits). Thereafter, the weighted average operation (<NUM>) is performed pixel by pixel with the low precision (e.g., the input-bit depth) to obtain the final prediction (<NUM>).

The above precision conversion operation and weighted average operation (<NUM>) in the <FIG> example can be jointly represented by the following expressions: <MAT> where Pred denotes a value of a sample in the final prediction (<NUM>), Interp(P0) and Inter(P1) each denote a value of an interpolated sample with a high precision corresponding to the pattern (<NUM>) or (<NUM>), respectively, w0 and w1 denotes weights associated with the respective interpolated samples, and offset1 denotes a rounding offset.

As indicated by the expression (<NUM>), Interp(P0) and Interp(P1) are converted from the high precision to the low precision before the weighted average operation is performed.

<FIG> shows an interweaved affine prediction process <NUM> according to an embodiment of the disclosure. The process <NUM> is similar to the process in the <FIG> example, however, can generate a final prediction (<NUM>) with a higher accuracy.

As shown, two predictions (<NUM>) and (<NUM>) corresponding to the partitioning patterns (<NUM>) and (<NUM>) can be generated as a result of an AMC process. Particularly, interpolated samples with an intermediate bit-depth (e.g., <NUM> bits) larger than an input bit-depth (e.g., <NUM> bits) can be stored in the predictions (<NUM>) and (<NUM>). In addition, the predictions.

(<NUM>) and (<NUM>) may include original samples, but those original samples may be represented with the intermediate bit-depth (e.g., converted from the input bit-depth to the intermediate bit-depth). Thus, high precision sample values (e. g, a bit-depth of <NUM> bits) are contained in the prediction blocks (<NUM>) and (<NUM>). In contrast, the predictions (<NUM>) and (<NUM>) contain low precision sample values (e.g., a bit-depth of <NUM> bits) in the <FIG> example.

Thereafter, a weighted average operation (<NUM>) similar to that of the <FIG> example can be performed pixel by pixel, however, with pairs of the collocated sample vales having the high precision as input. An averaged sample value resulting from the weighted average operation (<NUM>) can still have the high precision.

Following the weighted average operation (<NUM>), pixel by pixel, a precision conversion operation (<NUM>) can be performed to convert averaged sample values resulting from the weighted average operation (<NUM>) to generate final sample values of the final prediction (<NUM>). For example, the averaged sample values are converted from the intermediate bit-depth of <NUM> bits to the input bit-depth of <NUM> bits.

The process <NUM> can be represented by the following expression: <MAT>.

In the expression (<NUM>), a sample value resulting from the weighted average operation is right shifted to be converted from the intermediate bit-depth to the input bit-depth. In contrast, in the expression (<NUM>), the average operation (<NUM>/(w0+w1)) and the right shift operation (>> shift ) are combined together to divide a weighted sum. The offset2 and offset3 are rounding offsets. Adding a rounding offset to a value that is to be averaged or right shifted can generally improve a calculation precision.

Compared with the <FIG> example, in the process <NUM>, the high precision is maintained until after the weighted average operation instead of using input low precision sample values to the weighted average operation. As a result, the sample values of the final prediction (<NUM>) can have a higher accuracy, and performance of the interweaved affine prediction process <NUM> can be improved.

In an embodiment, a range constraint operation is further applied to the averaged values from the precision conversion operation (<NUM>). As a result, the final sample values in the final prediction (<NUM>) are confined to be within a wage from <NUM> to a maximum possible sample value (e.g., (<NUM><<input bitDepth)-<NUM>). For example, the constraint operation can be represented by: <MAT> where clip ( ) denotes a clipping operation.

In an embodiment, as shown in <FIG> where the partitioning pattern (<NUM>) is reproduced, the fractional sub-blocks (<NUM>) (the shaded area) in the partitioning pattern (<NUM>) are not predicted (or in other words, no interweaved affine prediction is applied). For example, no interpolation is performed in the shaded area. The original samples in the shaded area may be stored into the prediction (<NUM>). For the samples of the shaded area in the prediction (<NUM>), a zero weight (w1 = <NUM>) can be applied, and the expression (<NUM>) or (<NUM>) can be used similarly as for the other samples in the prediction (<NUM>). In this way, a unified weighted average calculation process (e.g., the weighted average operation (<NUM>)) can be used for all pixels in the predictions (<NUM>) and (<NUM>).

In another embodiment, equal weighting (w0 = w1) is employed to samples in the non-shaded area (corresponding to the whole sub-blocks <NUM>) in <FIG> for the weighted average operation (<NUM>). In this way, the weighting pattern <NUM> needs not to be stored, and the weighted average operation (<NUM>) can be simplified.

In an embodiment, deblocking is disabled for a block coded with interweaved affine prediction. For example, no deblocking is performed for samples within the block. Generally, a deblocking operation can be performed to an affine coded block to reduce discontinuities at edges of sub-blocks. However, interweaved affine prediction has a smoothing effect due to the weighted average operation. Thus, deblocking can be disabled to save the processing cost.

In another embodiment, deblocking is disabled for the non-shaded area, while still performed in the shaded area (as shown in <FIG>). For example, in some embodiments, interweaved affine prediction is only applied in the non-shaded area, not in the shaded area. Thus, the shaded and non-shaded areas can be treated differently.

<FIG> shows a flow chart outlining a process (<NUM>) according to an embodiment of the disclosure. The process (<NUM>) can be used in the reconstruction of a block coded in an interweaved affine prediction mode, so to generate a prediction block for the block under reconstruction. In various embodiments, the process (<NUM>) are executed by processing circuitry, such as the processing circuitry in the terminal devices (<NUM>), (<NUM>), (<NUM>) and (<NUM>), the processing circuitry that performs functions of the video encoder (<NUM>), the processing circuitry that performs functions of the video decoder (<NUM>), the processing circuitry that performs functions of the video decoder (<NUM>), the processing circuitry that performs functions of the video encoder (<NUM>), and the like. In some embodiments, the process (<NUM>) is implemented in software instructions, thus when the processing circuitry executes the software instructions, the processing circuitry performs the process (<NUM>). The process starts at (S2601) and proceeds to (S2610).

At (S2610), an affine model can be determined for a current block that is coded with an interweaved affine prediction mode. For example, based on a merge index received in a bitstream, an affine merge candidate (e.g., a reconstructed or inherited affine candidate) may be selected from a sub-block based merge candidate list. The selected merge candidate may represent the affine model with three or two CPMVs, or affine model parameters.

At (S2620), a first and second prediction blocks corresponding to a first and second partitioning pattern can be generated. For example, the current block can be partitioned into sub-blocks using the first and second partitioning pattern separately. MVs corresponding to the sub-blocks can be determined based on the affine model. Based on the sub-block MVs, an AMC process may be performed to determine the first and second prediction blocks. During the AMC process, interpolated samples with an intermediate bit-depth (e.g., <NUM> bits) larger than an input depth (e.g., <NUM> bits) of the current block can be generated. The resulting first and second prediction blocks can include the interpolated samples which have a higher precision than that of the original samples in the current block.

At (S2630), a third (final) prediction block can be generated based on the first and second prediction blocks. For example, first samples in the first prediction block and corresponding second samples in the second prediction block each with the high precision corresponding to the intermediate bit-depth are combined by performing a weighted average operation to obtain averaged samples. The averaged samples are subsequently rounded to the input bit-depth to obtain corresponding third samples in the third prediction block. The process (<NUM>) can proceed to (S2699), and terminates at (S2699).

Computer system (<NUM>) can also include an interface to one or more communication networks. Networks can for example be wireless, wireline, optical. Networks can further be local, wide-area, metropolitan, vehicular and industrial, real-time, delay-tolerant, and so on. Examples of networks include local area networks such as Ethernet, wireless LANs, cellular networks to include GSM, <NUM>, <NUM>, <NUM>, LTE and the like, TV wireline or wireless wide area digital networks to include cable TV, satellite TV, and terrestrial broadcast TV, vehicular and industrial to include CANBus, and so forth. Certain networks commonly require external network interface adapters that attached to certain general purpose data ports or peripheral buses (<NUM>) (such as, for example USB ports of the computer system (<NUM>)); others are commonly integrated into the core of the computer system (<NUM>) by attachment to a system bus as described below (for example Ethernet interface into a PC computer system or cellular network interface into a smartphone computer system). Using any of these networks, computer system (<NUM>) can communicate with other entities. Such communication can be uni-directional, receive only (for example, broadcast TV), uni-directional send-only (for example CANbus to certain CANbus devices), or bi-directional, for example to other computer systems using local or wide area digital networks. Certain protocols and protocol stacks can be used on each of those networks and network interfaces as described above.

As an example and not by way of limitation, the computer system having architecture (<NUM>), and specifically the core (<NUM>) can provide functionality as a result of processor(s) (including CPUs, GPUs, FPGA, accelerators, and the like) executing software embodied in one or more tangible, computer-readable media. Such computer-readable media can be media associated with user-accessible mass storage as introduced above, as well as certain storage of the core (<NUM>) that are of non-transitory nature, such as core-internal mass storage.

(<NUM>) or ROM (<NUM>). The software implementing various embodiments of the present disclosure can be stored in such devices and executed by core (<NUM>). A computer-readable medium can include one or more memory devices or chips, according to particular needs. The software can cause the core (<NUM>) and specifically the processors therein (including CPU, GPU, FPGA, and the like) to execute particular processes or particular parts of particular processes described herein, including defining data structures stored in RAM (<NUM>) and modifying such data structures according to the processes defined by the software. In addition or as an alternative, the computer system can provide functionality as a result of logic hardwired or otherwise embodied in a circuit (for example: accelerator (<NUM>)), which can operate in place of or together with software to execute particular processes or particular parts of particular processes described herein. Reference to software can encompass logic, and vice versa, where appropriate. Reference to a computer-readable media can encompass a circuit (such as an integrated circuit (IC)) storing software for execution, a circuit embodying logic for execution, or both, where appropriate. The present disclosure encompasses any suitable combination of hardware and software.

Claim 1:
A method of video decoding at a video decoder, comprising:
determining (S2610) an affine model for a current block coded with an interweaved affine prediction mode, which includes selecting, based on a merge index received in a bitstream, an affine merge candidate from a sub-block based merge candidate list, wherein the selected merge candidate represents the affine model with three or two control point motion vectors, or affine model parameters;
generating (S2620), based on the affine model, a first prediction block corresponding to a first pattern for partitioning the current block into first sub-blocks and a second prediction block corresponding to a second pattern for partitioning the current block into second sub-blocks, wherein the first and second prediction blocks include interpolated samples; and
generating (S2630) a third prediction block based on the first and second prediction blocks, wherein first samples in the first prediction block and corresponding second samples in the second prediction block are combined by performing a weighted average operation to obtain averaged samples, and the averaged samples are rounded to obtain corresponding third samples in the third prediction block,
characterized in that
the interpolated samples have an intermediate bit-depth larger than an input bit-depth of the current block,
the first samples in the first prediction block and the corresponding second samples in the second prediction block each with a precision corresponding to the intermediate bit-depth are combined by performing the weighted average operation to obtain the averaged samples, and the averaged samples are rounded to the input bit-depth to obtain the corresponding third samples in the third prediction block, wherein
following the weighted average operation, a precision conversion operation (<NUM>) is performed, pixel by pixel, to convert the averaged samples from the intermediate bit-depth of <NUM> bits to the input bit-depth of <NUM> bits.