Methods and apparatus of intra matrix prediction for video coding

WO2024213100A1PCT designated stage expired Publication Date: 2024-10-17MEDIATEK INC

Patent Information

Application Number
PCT/CN2024/087432
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-14
Filing Date
2024-04-12
Publication Date
2024-10-17

Smart Images

  • Figure CN2024087432_17102024_PF_FP_ABST
    Figure CN2024087432_17102024_PF_FP_ABST
Patent Text Reader

Abstract

A method and apparatus for video coding using Matrix-based Intra Prediction (MIP) mode with various settings. According to the method, a target MIP mode is determined using an MIP mode setting. The MIP mode setting incorporates extended MIP setting, down-sampling or up-sampling setting, block-splitting setting, side-oriented setting, or a combination thereof. The MIP mode setting with the extended MIP setting includes an MRL based MIP mode, an IBC or IntraTMP based MIP mode, or an inter based MIP mode, wherein the MIP mode setting with the down-sampling or up-sampling setting includes a down-sampled or up-sampled MIP candidate with a target block size category different from a regular MIP mode. The MIP mode setting with the block-splitting setting includes a block-splitting MIP candidate generated by splitting the current block into subblocks.
Need to check novelty before this filing date? Find Prior Art

Description

METHODS AND APPARATUS OF INTRA MATRIX PREDICTION FOR VIDEO CODING

[0001] CROSS REFERENCE TO RELATED APPLICATIONS

[0002] The present invention is a non-Provisional Application of and claims priority to U.S. Provisional Patent Application No. 63 / 496, 041, filed on April 14, 2023 and U.S. Provisional Patent Application No. 63 / 496, 043, filed on April 14, 2023. The U.S. Provisional Patent Applications are hereby incorporated by reference in their entireties.FIELD OF THE INVENTION

[0003] The present invention relates to video coding system. In particular, the present invention relates to Matrix-based Intra Prediction (MIP) mode with various settings to improve the coding performance.BACKGROUND

[0004] Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) . The standard has been published as an ISO standard: ISO / IEC 23090-3: 2021, Information technology -Coded representation of immersive media -Part 3: Versatile video coding, published Feb. 2021. VVC is developed based on its predecessor HEVC (High Efficiency Video Coding) by adding more coding tools to improve coding efficiency and also to handle various types of video sources including 3-dimensional (3D) video signals.

[0005] Fig. 1A illustrates an exemplary adaptive Inter / Intra video encoding system incorporating loop processing. For Intra Prediction 110, the prediction data is derived based on previously coded video data in the current picture. For Inter Prediction 112, Motion Estimation (ME) is performed at the encoder side and Motion Compensation (MC) is performed based on the  result of ME to provide prediction data derived from other picture (s) and motion data. Switch 114 selects Intra Prediction 110 or Inter Prediction 112 and the selected prediction data is supplied to Adder 116 to form prediction errors, also called residues. The prediction error is then processed by Transform (T) 118 followed by Quantization (Q) 120. The transformed and quantized residues are then coded by Entropy Encoder 122 to be included in a video bitstream corresponding to the compressed video data. The bitstream associated with the transform coefficients is then packed with side information such as motion and coding modes associated with Intra prediction and Inter prediction, and other information such as parameters associated with loop filters applied to underlying image area. The side information associated with Intra Prediction 110, Inter prediction 112 and in-loop filter 130, is provided to Entropy Encoder 122 as shown in Fig. 1A. When an Inter-prediction mode is used, a reference picture or pictures have to be reconstructed at the encoder end as well. Consequently, the transformed and quantized residues are processed by Inverse Quantization (IQ) 124 and Inverse Transformation (IT) 126 to recover the residues. The residues are then added back to prediction data 136 at Reconstruction (REC) 128 to reconstruct video data. The reconstructed video data may be stored in Reference Picture Buffer 134 and used for prediction of other frames.

[0006] As shown in Fig. 1A, incoming video data undergoes a series of processing in the encoding system. The reconstructed video data from REC 128 may be subject to various impairments due to a series of processing. Accordingly, in-loop filter 130 is often applied to the reconstructed video data before the reconstructed video data are stored in the Reference Picture Buffer 134 in order to improve video quality. For example, deblocking filter (DF) , Sample Adaptive Offset (SAO) and Adaptive Loop Filter (ALF) may be used. The loop filter information may need to be incorporated in the bitstream so that a decoder can properly recover the required information. Therefore, loop filter information is also provided to Entropy Encoder 122 for incorporation into the bitstream. In Fig. 1A, Loop filter 130 is applied to the reconstructed video before the reconstructed samples are stored in the reference picture buffer 134. The system in Fig. 1A is intended to illustrate an exemplary structure of a typical video encoder. It may correspond to the High Efficiency Video Coding (HEVC) system, VP8, VP9, H. 264 or VVC.

[0007] The decoder, as shown in Fig. 1B, can use similar or portion of the same functional blocks as the encoder except for Transform 118 and Quantization 120 since the decoder only needs  Inverse Quantization 124 and Inverse Transform 126. Instead of Entropy Encoder 122, the decoder uses an Entropy Decoder 140 to decode the video bitstream into quantized transform coefficients and needed coding information (e.g., ILPF information, Intra prediction information and Inter prediction information) . The Intra prediction 150 at the decoder side does not need to perform the mode search. Instead, the decoder only needs to generate Intra prediction according to Intra prediction information received from the Entropy Decoder 140. Furthermore, for Inter prediction, the decoder only needs to perform motion compensation (MC 152) according to Inter prediction information received from the Entropy Decoder 140 without the need for motion estimation.

[0008] Partitioning of the CTUs Using a Tree Structure

[0009] In VVC, the coding tree scheme supports the ability for the luma and chroma to have a separate block tree structure. For P and B slices, the luma and chroma CTBs in one CTU have to share the same coding tree structure. However, for I slices, the luma and chroma can have separate block tree structures. When separate block tree mode is applied, luma CTB is partitioned into CUs by one coding tree structure, and the chroma CTBs are partitioned into chroma CUs by another coding tree structure. This means that a CU in an I slice may consist of a coding block of the luma component or coding blocks of two chroma components, and a CU in a P or B slice always consists of coding blocks of all three colour components unless the video is monochrome.

[0010] Intra Mode Coding with 67 Intra Prediction Modes

[0011] To capture the arbitrary edge directions presented in natural video, the number of directional intra modes in VVC is extended from 33, as used in HEVC, to 65 and the planar and DC modes remain the same. These denser directional intra prediction modes apply for all block sizes and for both luma and chroma intra predictions.

[0012] In VVC, several conventional angular intra prediction modes are adaptively replaced with wide-angle intra prediction modes for the non-square blocks.

[0013] Intra Mode Coding

[0014] To keep the complexity of the most probable mode (MPM) list generation low, an intra mode coding method with 6 MPMs (or called primary MPMs) is used by considering two available  neighbouring intra modes. The following three aspects are considered to construct the MPM list:

[0015] – Default intra modes

[0016] – Neighbouring intra modes

[0017] – Derived intra modes

[0018] Decoder side Intra Mode Derivation (DIMD)

[0019] When DIMD is applied, two intra modes are derived from the reconstructed neighbouring samples (template) , and those two predictors are combined with the planar mode predictor with the weights derived from the gradients.

[0020] To implicitly derive the intra prediction modes of a block, a texture gradient analysis is performed at both encoder and decoder sides. This process starts with an empty Histogram of Gradient (HoG) with 65 entries, corresponding to the 65 angular modes. Amplitudes of these entries are determined during the texture gradient analysis.

[0021] In the first step, DIMD picks a template of T=3 columns and lines from respectively left and above to the current block. This area is used as the reference for the gradient based intra prediction modes derivation.

[0022] In the second step, the horizontal and vertical Sobel filters are applied on all 3×3 window positions, centred on the pixels of the middle line of the template. On each window position, Sobel filters calculate the intensity of pure horizontal and vertical directions as Gx and Gy, respectively. Then, the texture angle of the window is calculated as: angle=arctan (Gx / Gy) ,

[0023] which can be converted into one of 65 angular intra prediction modes. Once the intra prediction modes index of current window is derived as idx, the amplitude of its entry in the HoG [idx] is updated by addition of: ampl = |Gx|+|Gy|

[0024] Figs. 2A-C show an example of HoG, calculated after applying the above operations on all pixel positions in the template. Fig. 2A illustrates an example of selected template 220 for a  current block 210. Template 220 comprises T lines above the current block and T columns to the left of the current block. For intra prediction of the current block, the area 230 at the above and left of the current block corresponds to a reconstructed area and the area 240 below and at the right of the block corresponds to an unavailable area. Fig. 2B illustrates an example for T=3 and the HoGs are calculated for pixels 260 in the middle line and pixels 262 in the middle column. For example, for pixel 252, a 3x3 window 250 is used. Fig. 2C illustrates an example of the amplitudes (ampl) calculated based on the equation above.

[0025] Once HoG is computed, the indices with two tallest histogram bars are selected as the two implicitly derived intra prediction modes for the block and are further combined with the Planar mode as the prediction of DIMD mode. The prediction fusion is applied as a weighted average of the above three predictors. To this aim, the weight of planar is fixed to 21 / 64 (~1 / 3) . The remaining weight of 43 / 64 (~2 / 3) is then shared between the two HoG IPMs, proportionally to the amplitude of their HoG bars.

[0026] Template-based Intra Mode Derivation (TIMD)

[0027] Template-based intra mode derivation (TIMD) mode implicitly derives the intra prediction mode of a CU using a neighbouring template at both the encoder and decoder, instead of signalling the intra prediction mode to the decoder. As shown in Fig. 3, the prediction samples of the template (312 and 314) for the current block 310 are generated using the reference samples (320 and 322) of the template for each candidate mode. A cost is calculated as the SATD (Sum of Absolute Transformed Differences) between the prediction samples and the reconstruction samples of the template. The intra prediction mode with the minimum cost is selected as the TIMD mode (as the mode derivation of DIMD mode) and used for intra prediction of the CU. The candidate modes may be 67 intra prediction modes as in VVC or extended to 131 intra prediction modes. In general, MPMs can provide a clue to indicate the directional information of a CU. Thus, to reduce the intra mode search space and utilize the characteristics of a CU, the intra prediction mode can be implicitly derived from the MPM list.

[0028] For each intra prediction mode in MPMs, the SATD (TIMD cost) between the  prediction and reconstruction samples of the template is calculated. First two intra prediction modes with the minimum SATD are selected as the TIMD modes. These two TIMD modes are fused with weights after applying PDPC process, and such weighted intra prediction is used to code the current CU. Position dependent intra prediction combination (PDPC) is included in the derivation of the TIMD modes.

[0029] The costs of the two selected modes are compared with a threshold, in the test, the cost factor of 2 is applied as follows: costMode2 < 2*costMode1.

[0030] If this condition is true, the fusion is applied, otherwise only mode1 is used (i.e., single mode case) . Weights of the modes are computed from their SATD costs as follows: weight1 = costMode2 /  (costMode1+ costMode2) weight2 = 1 -weight1.

[0031] Intra Sub-Partitions (ISP)

[0032] The intra sub-partitions (ISP) divides luma intra-predicted blocks vertically or horizontally into 2 or 4 sub-partitions depending on the block size. For each sub-partition, reconstructed samples are obtained by adding the residual signal to the prediction signal. Here, a residual signal is generated by the processes such as entropy decoding, inverse quantization and inverse transform. Therefore, the reconstructed sample values of each sub-partition are available to generate the prediction of the next sub-partition, and each sub-partition is processed repeatedly. In addition, the first sub-partition to be processed is the one containing the top-left sample of the CU and then continuing downwards (horizontal split) or rightwards (vertical split) . As a result, reference samples used to generate the sub-partitions prediction signals are only located at the left and above sides of the lines. All sub-partitions share the same intra mode.

[0033] Template Matching Prediction (TMP)

[0034] Template matching prediction (TMP) is a special intra prediction mode that copies the best prediction block from the reconstructed part of the current frame, whose L-shaped template matches the current template. For a predefined search range, the encoder searches for the most  similar template to the current template in the reconstructed part of the current frame, and uses the corresponding block as a prediction block (as a reference block) . The encoder then signals the usage of this mode, and the inverse operation is made at the decoder side.

[0035] CCLM Overview

[0036] The main idea behind CCLM mode (sometimes abbreviated as LM mode) is as follows: chroma components of a block can be predicted from the collocated reconstructed luma samples by linear models whose parameters are derived from already reconstructed luma and chroma samples that are adjacent to the block.

[0037] MMLM Overview

[0038] As indicated by the name, the original CCLM mode employs one linear model for predicting the chroma samples from the luma samples for the whole CU, while in MMLM, there can be two models. In MMLM, neighbouring luma samples and neighbouring chroma samples of the current block are classified into two groups, each group is used as a training set to derive a linear model (i.e., particular α and β are derived for a particular group) . Furthermore, the samples of the current luma block are also classified based on the same rule for the classification of neighbouring luma samples.

[0039] Convolutional Cross-Component Model (CCCM)

[0040] In CCCM, a convolutional model is applied to improve the chroma prediction performance. The convolutional model has 7-tap filter consist of a 5-tap plus sign shape spatial component, a nonlinear term and a bias term. The input to the spatial 5-tap component of the filter consists of a centre luma sample which is collocated with the chroma sample to be predicted and its above / north, below / south, left / west and right / east neighbours.

[0041] The MSE minimization is performed by calculating autocorrelation matrix for the luma input and a cross-correlation vector between the luma input and chroma output. Autocorrelation matrix is LDL decomposed and the final filter coefficients are calculated using back-substitution. The process follows roughly the calculation of the ALF filter coefficients in ECM, however LDL decomposition was chosen instead of Cholesky decomposition to avoid using square root  operations.

[0042] Gradient Linear Model (GLM)

[0043] Compared with the CCLM, instead of down-sampled luma values, the GLM utilizes luma sample gradients to derive the linear model. Specifically, when the GLM is applied, the input to the CCLM process, i.e., the down-sampled luma samples L, are replaced by luma sample gradients G. C=α·G+β

[0044] Matrix weighted Intra Prediction (MIP)

[0045] Matrix weighted intra prediction (MIP) method is a newly added intra prediction technique in VVC. For predicting the samples of a rectangular block of width W and height H, matrix weighted intra prediction (MIP) takes one line of H reconstructed neighbouring boundary samples left of the block and one line of W reconstructed neighbouring boundary samples above the block as input. If the reconstructed samples are unavailable, they are generated as it is done in the conventional intra prediction. The generation of the prediction signal is based on the following three steps, i.e., averaging, matrix vector multiplication and linear interpolation as shown in Fig. 4. One line of H reconstructed neighbouring boundary samples 412 left of the block and one line of W reconstructed neighbouring boundary samples 410 above the block are shown as dot-filled small squares. After the averaging process, the boundary samples are down-sampled to top boundary line 414 and left boundary line 44. The down-sampled samples are provided to the matric-vector multiplication unit 420 to generate the down-sampled prediction block 430. An interpolation process is then applied to generate the prediction block 440. The generation of the prediction signal is based on the following three steps, which are averaging, matrix vector multiplication and linear interpolation as shown in following.

[0046] 1. Averaging neighbouring samples

[0047] Among the boundary samples, four samples or eight samples are selected by averaging based on block size and shape. Specifically, the input boundaries bdrytop and bdryleft are reduced to smaller boundaries  and  by averaging neighbouring boundary  samples according to predefined rule depends on block size. Then, the two reduced boundaries  and  are concatenated to a reduced boundary vector bdryred which is thus of size four for blocks of shape 4×4 and of size eight for blocks of all other shapes.

[0048] 2. Matrix multiplication

[0049] A matrix vector multiplication, followed by addition of an offset, is carried out with the averaged samples as an input. The result is a reduced prediction signal on a subsampled set of samples in the original block. Out of the reduced input vector bdryred a reduced prediction signal predred, which is a signal on the downsampled block of width Wred and height Hred is generated.

[0050] The reduced prediction signal predred is computed by calculating a matrix vector product and adding an offset: predred=A·bdryred+b.

[0051] Here, A is a matrix that has Wred·Hred rows and 4 columns if W=H=4 and 8 columns in all other cases. b is a vector of size Wred·Hred.

[0052] 3. Interpolation

[0053] The prediction signal at the remaining positions is generated from the prediction signal on the subsampled set by linear interpolation which is a single step linear interpolation in each direction.

[0054] Chroma DM Mode

[0055] For Chroma DM mode, the intra prediction mode of the corresponding (i.e., collocated) luma block covering the centre position of the current chroma block is directly inherited.

[0056] Intra Block Copy

[0057] Intra block copy (IBC) is a tool adopted in HEVC extensions on SCC. It is well known that it significantly improves the coding efficiency of screen content materials. Since IBC mode is implemented as a block level coding mode, block matching (BM) is performed at the encoder to find the optimal block vector (or motion vector) for each CU. Here, a block vector is used to  indicate the displacement from the current block to a reference block, which is already reconstructed inside the current picture.

[0058] Inter Prediction Overview

[0059] According to JVET-T2002 Section 3.4. (Jianle Chen, et. al., “Algorithm description for Versatile Video Coding and Test Model 11 (VTM 11) ” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29, 20th Meeting, by teleconference, 7 –16 October 2020, Document: JVET-T2002) ) , for each inter-predicted CU, motion parameters consist of motion vectors, reference picture indices and reference picture list usage index, and additional information needed for the new coding feature of VVC to be used for inter-predicted sample generation. The motion parameter can be signalled in an explicit or implicit manner. When a CU is coded with skip mode, the CU is associated with one PU and has 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 CU, which are obtained from neighbouring CUs, including spatial and temporal candidates, and additional schedules introduced in VVC. The merge mode can be applied to any inter-predicted CU, not only for skip mode. The alternative to the merge mode is the explicit transmission of motion parameters, where motion vector, corresponding reference picture index for each reference picture list and reference picture list usage flag and other needed information are signalled explicitly per each CU. The following text provides the details on those inter prediction methods specified in VVC.

[0060] Extended Merge Prediction

[0061] In VVC, the merge candidate list is constructed by including the following five types of candidates in order:

[0062] 1) Spatial MVP from spatial neighbour CUs

[0063] 2) Temporal MVP from collocated CUs

[0064] 3) History-based MVP from an FIFO table

[0065] 4) Pairwise average MVP

[0066] 5) Zero MVs.

[0067] Spatial Candidates Derivation

[0068] The derivation of spatial merge candidates in VVC is same to that in HEVC except the positions of first two merge candidates are swapped. A maximum of four merge candidates for current CU 510 are selected among candidates located in the positions depicted in Fig. 5. The order of derivation is B0, A0, B1, A1 and B2. Position B2 is considered only when one or more than one CUs of position B0, A0, B1, A1 are not available (e.g., because it belongs to another slice or tile) or is intra coded. After 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 so that coding efficiency is improved.

[0069] 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. 6 are considered and a candidate is only added to the list if the corresponding candidate used for redundancy check does not have the same motion information.

[0070] Temporal Candidates Derivation

[0071] In this step, only one candidate is added to the list. Particularly, in the derivation of this temporal merge candidate for a current CU 710, a scaled motion vector is derived based on the co-located CU 720 belonging to the collocated reference picture as shown in Fig. 7. The reference picture list and the reference index to be used for the derivation of the co-located CU is explicitly signalled in the slice header. The scaled motion vector 730 for the temporal merge candidate is obtained as illustrated by the dashed line in Fig. 7, which is scaled from the motion vector 740 of the co-located CU using the POC (Picture Order Count) 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.

[0072] The position for the temporal candidate is selected between candidates C0 and C1, as depicted in Fig. 8. If CU at position C0 is not available, is intra coded, or is outside of the current row of CTUs, position C1 is used. Otherwise, position C0 is used in the derivation of the temporal  merge candidate.

[0073] History-based Merge Candidate Derivation

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

[0075] The HMVP table size S is set to be 6, which indicates up to 5 History-based MVP (HMVP) candidates may be added to the table. When inserting a new motion candidate to the table, a constrained first-in-first-out (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, and the identical HMVP is inserted to the last entry of the table.

[0076] HMVP candidates could be used in the 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. Redundancy check is applied on the HMVP candidates to the spatial or temporal merge candidate.

[0077] Non-adjacent Spatial Candidate

[0078] The pattern of spatial merge candidates is shown in Fig. 9. The distances between non-adjacent spatial candidates and current coding block are based on the width and height of current coding block. The line buffer restriction is not applied.

[0079] In the present invention, methods and apparatus of Matrix-based Intra Prediction (MIP) mode with various settings are disclosed to improve the performance.

[0080] BRIEF SUMMARY OF THE INVENTION

[0081] A method and apparatus for video coding using Matrix-based Intra Prediction (MIP)  mode with various settings are disclosed. According to the method, input data associated with a current block are received, wherein the input data comprise pixel data to be encoded at an encoder side or data associated with the current block to be decoded at a decoder side. A target Matrix-based Intra Prediction (MIP) mode is determined using an MIP mode setting, wherein the MIP mode setting incorporates extended MIP setting, down-sampling or up-sampling setting, block-splitting setting, side-oriented setting, or a combination thereof, wherein the MIP mode setting with the extended MIP setting includes an MRL (Multiple Reference Line) based MIP mode, an IBC (Intra Block Copy) or IntraTMP (Intra Template Matching Prediction) based MIP mode, or an inter based MIP mode, wherein the MIP mode setting with the down-sampling or up-sampling setting includes a down-sampled or up-sampled MIP candidate with a target block size category different from a regular MIP mode, wherein the MIP mode setting with the block-splitting setting includes a block-splitting MIP candidate generated by splitting the current block into subblocks, or wherein the MIP mode setting with the side-oriented setting includes a side-oriented MIP candidate with reference samples only from a top side or left side of the current block. The current block is encoded or decoded using the target MIP mode.

[0082] In one embodiment, the target MIP mode is used as an additional mode or a replacement mode.

[0083] In one embodiment, the MRL based MIP mode uses reference samples comprising spatial neighbouring reconstructed samples non-adjacent to the current block. In one embodiment, the IBC or IntraTMP based MIP mode uses reference samples comprising reconstructed samples indicated by one or more block vectors of the current block. In one embodiment, the inter based MIP mode uses reference samples comprising reconstructed samples indicated by one or more motion vectors of the current block or reconstructed samples in one or more previous pictures.

[0084] In one embodiment, when a target block size associated with the target block size category is smaller than a regular block size associated with a regular block size category for the regular MIP mode, reference samples from the top side, left side, or both, of the current block are down-sampled more than the regular MIP mode.

[0085] In one embodiment, the block-splitting MIP candidate is associated with candidate splitting and the candidate splitting comprises a splitting direction, a splitting number, or both. In  one embodiment, the splitting direction refers to one of horizontal direction, vertical direction, diagonal direction, any straightforward line represented by an angle and / or a distance from a block centre, any GPM (Geometric Partitioning Mode) partition, any ISP (Intra Sub-Partitions) splitting, or a combination thereof. In one embodiment, selection of the candidate splitting is explicitly signalled, implicitly derived, or inherited. In one embodiment, the side-oriented MIP candidate uses one neighbouring reference line adjacent to a boundary on the top side or left side of the current block, and one or more additional reference lines adjacent to or non-adjacent to said one neighbouring reference line.BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Fig. 1A illustrates an exemplary adaptive Inter / Intra video encoding system incorporating loop processing.

[0087] Fig. 1B illustrates a corresponding decoder for the encoder in Fig. 1A.

[0088] Fig. 2A illustrates an example of selected template for a current block, where the template comprises T lines above the current block and T columns to the left of the current block.

[0089] Fig. 2B illustrates an example for T=3 and the HoGs (Histogram of Gradient) are calculated for pixels in the middle line and pixels in the middle column.

[0090] Fig. 2C illustrates an example of the amplitudes (ampl) for the angular intra prediction modes.

[0091] Fig. 3 illustrates an example of template-based intra mode derivation.

[0092] Fig. 4 illustrates an example of processing flow for Matrix weighted intra prediction (MIP) .

[0093] Fig. 5 illustrates the neighbouring blocks used for deriving spatial merge candidates for VVC.

[0094] Fig. 6 illustrates the possible candidate pairs considered for redundancy check in VVC.

[0095] Fig. 7 illustrates an example of temporal candidate derivation, where a scaled motion vector is derived according to POC (Picture Order Count) distances.

[0096] Fig. 8 illustrates the position for the temporal candidate selected between candidates C0 and C1.

[0097] Fig. 9 illustrates an exemplary pattern of the non-adjacent spatial merge candidates.

[0098] Fig. 10A illustrates an example of the initial reference samples for regular MIP.

[0099] Fig. 10B illustrates an example of the initial reference samples including the top N samples non-adjacent to the current block and / or the left M samples non-adjacent to the current block.

[0100] Fig. 11A illustrates an example of the initial reference samples for IBC- / intraTMP- / inter-MIP.

[0101] Fig. 11B illustrates an example of the initial reference samples referring to the current reconstructed samples of the collocated region for the current block.

[0102] Figs. 12A-C illustrate examples of using input reference samples from the left side and above side to form a vector used as the input reference samples for the matrix for categories S0, S1 and S2 respectively.

[0103] Fig. 13 illustrates an example of PDPC further used to adjust the predictors for the current block.

[0104] Fig. 14 illustrates an example of splitting an MIP coded block into multiple subblocks.

[0105] Fig. 15 illustrates an example of boundary cost evaluation between the current prediction within the current block and the neighbouring reconstruction within one or more neighbouring blocks.

[0106] Fig. 16 illustrates a flowchart of an exemplary video coding system where the MIP mode uses one or more settings according to an embodiment of the present invention.DETAILED DESCRIPTION OF THE INVENTION

[0107] It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the systems and methods of the present invention, as represented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. References throughout this specification to “one embodiment, ” “an embodiment, ” or similar language mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment.

[0108] Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, or operations are not shown or described in detail to avoid obscuring aspects of the invention. The illustrated embodiments of the invention will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain selected embodiments of apparatus and methods that are consistent with the invention as claimed herein.

[0109] In order to improve the coding performance of Matrix-based Intra Prediction, various settings are disclosed.

[0110] In this invention, when a target mode is used for the current block, a down-sampling mechanism, an up-sampling mechanism, a transposing mechanism, an inheriting mechanism, a side-oriented mechanism, a blending mechanism, and / or a block-splitting mechanism is proposed to provide the candidates for this target mode. The proposed mechanism may slightly or totally not increase the number of circuits / tables / storage / matrixes, which were originally supported in the functionality of this target mode, and can derive more candidates for the target mode. The target  mode in this invention refers to a matrix-based (or matrix weighted) prediction mode as an example. However, the proposed methods are not limited to only applying to the matrix-based prediction mode and may be used for any prediction mode with intra / inter / athird mode type (e.g., IBC) . For the target mode being the matrix-based prediction mode, multiple matrixes (or tables) are pre-defined and when one matrix is indicated to be selected for the current block, the selected matrix and one or more reference samples are used to generate the prediction of the current block. An example is shown in the following expression. Pred =Matrix ·ReferenceSample+offset+Bias        (1)

[0111] The reference samples include:

[0112] - reconstructed or predicted samples or any pre-defined information in spatial neighbouring blocks adjacent or non-adjacent to the current block, for example, the left side and / or above side of the current block

[0113] - reconstructed or predicted samples or any pre-defined information in temporal collocated blocks or in any pre-defined region for the current block or in one or more previous pictures

[0114] - or any subset or both of the above-mentioned reference samples.

[0115] For example, when the reference samples refer to the spatial neighbouring reconstructed samples adjacent to the current block and the current block is coded by intra, the target mode refers to regular “Matrix Weighted Intra Prediction” (MIP) mode. For another example, when the reference samples refer to the spatial neighbouring reconstructed samples adjacent to the current block and the current block is coded by inter, the target mode refers to inter regular MIP mode. For another example, when the reference samples refer to the spatial neighbouring reconstructed samples non-adjacent to the current block and the current block is coded by intra, the target mode refers to “Multiple Reference Line with Regular MIP” (MRL-MIP) mode. That is, MRL based MIP mode uses reference samples comprising spatial neighbouring reconstructed samples non-adjacent to the current block. For another example, when the reference samples refer to the spatial-neighbouring reconstructed or predicted samples and / or current reconstructed or predicted samples of the collocated region for the current block, the target mode refers to:

[0116] - IBC-MIP if the collocated region is found by block vectors of the current block (like what IBC does)

[0117] - IntraTMP-MIP if the collocated region is found by template matching / searching in a pre-defined range (like what intraTMP does)

[0118] - Inter-MIP if the collocated region is found by motion information of the current block (like what inter does)

[0119] In the above-mentioned MIP variations, IBC or IntraTMP based MIP mode uses reference samples comprising reconstructed samples indicated by one or more block vectors of the current block, the inter based MIP mode uses reference samples comprising reconstructed samples indicated by one or more motion vectors of the current block or reconstructed samples in one or more previous pictures, and / or the reference samples are reconstructed samples for easy explanation, but it is not limited to use the reconstructed samples as the reference samples. The Steps in the following are described in details to introduce how to generate predictors for the current block. All, any subset, or any extension of the steps can be used to generate the predictors for the target mode in this invention.

[0120] Step 0: For different block sizes (width x height as N x M) , different matrixes are pre-defined. In one embodiment, the matrix for the current block is pre-defined depending on the block size and / or block shape for the current block. The following shows an example of categorizing the block size into 3 categories. The proposed methods are not limited to applying to this example. The number of categories can be any pre-defined positive integer.

[0121] - For example, for blocks with size (categorized in S0) , N is 4 (or the smallest block size) , M is 4 (or the smallest block size) , and K0 candidate matrixes are pre-defined with the dimension of each candidate matrix being n0 x m0.

[0122] - For another example, for blocks with size (categorized in S1) , NxM is 4x8, 8x4, 8x8, 4xM, or Nx4, and K1 candidate matrixes are pre-defined with the dimension of each candidate matrix being n1 x m1.

[0123] - For another example, for blocks with sizes (categorized in S2) , NxM is the remaining size and K2 candidate matrixes are pre-defined with the dimension of each candidate matrix being n2 x m2.

[0124] - K0, K1, and K2 can be any pre-defined values such as 1, 2, 3, 4, etc. m0, m1, and m2 are the matrix input size for S0, S1, and S2 respectively. n0, n1, and n2 are the  matrix output size for S0, S1, and S2 respectively. A table in the following shows an example of different block sizes with different numbers of candidate matrixes.

[0125] The different block sizes (width x height as N x M) and different matrixes are pre-defined for categories S0, S1 and S2 in Table 1.

[0126] Table 1. Different block sizes and different matrixes are pre-defined for categories S0, S1 and S2

[0127] In one embodiment, the matrix is not indicated by a signalled index and is inferred for the current block when only one candidate matrix is available for the current block.

[0128] Step 1: The input reference samples for the matrix are derived by using initial reference samples.

[0129] Step 1-0: Several embodiments are proposed to prepare the initial reference samples. In one embodiment, the initial reference samples are not filtered by reference smoothing filter such as [1, 2, 1] filtering.

[0130] - Fig. 10A shows an example of the initial reference samples for regular MIP, where block 1010 corresponds to the current block. The initial reference samples refer to the neighbouring reconstructed samples adjacent to the current block. In Fig. 10A, the initial reference samples include the top N-row samples 1020 adjacent to the current block (from reference line 0) and / or the left M-column samples 1022 adjacent to the current block (from reference line 0) . In one embodiment (as shown in Fig. 10B) , the initial reference samples include the top N-row samples 1030 non-adjacent to the current block (from the reference line greater than 0) and / or the left M-column samples 1032 non-adjacent to the current block (from reference line greater than 0) . In another embodiment,  the size of the initial reference samples for top or left can be extended to any value smaller than or equal to (N+M) *k where k can be any positive integer larger than or equal to 1. In another embodiment, the size of the initial reference samples for the top region can be extended to any value smaller than or equal to N*k, where k can be any positive integer larger than or equal to 1. In another embodiment, the size of the initial reference samples for the left region can be extended to any value smaller than or equal to M*k where k can be any positive integer larger than or equal to 1. All or any subset of the samples in the top, left, or both regions can be used as the reference samples for MIP.

[0131] - Fig. 11A shows an example of the initial reference samples for IBC- / intraTMP- / inter-MIP, where block 1110 corresponds to a collocated region. The collocated region may have the same size as the current block and the initial reference samples are derived according to the above-mentioned methods for regular MIP (i.e., the initial reference samples include the top N-row samples 1120 adjacent to the current block (from reference line 0) and / or the left M-column samples 1122 adjacent to the current block (from reference line 0) ) . In one embodiment (as shown in Fig. 11B) , the initial reference samples refer to the current reconstructed samples (1130 and 1132 in Fig. 11B) of the collocated region for the current block. In one sub-embodiment, if the collocated region has the larger (or smaller) size than the current block, down-sampling (or up-sampling) operations are used to get the initial reference samples.

[0132] In one embodiment, when preparing the initial reference samples for the current block, availability of neighbouring reconstructed samples is checked and then the unavailable samples are padded from the available samples. The operations in this step are unified with what does in regular intra prediction mode.

[0133] Step 1-1: The size of the input reference sample is associated with the matrix size (m0, m1, or m2) . For S0, size = 2 at left and / or top side. In details, the size equal to 2 means 2 from top and 2 from left so m0 is 4. In one embodiment, m0 is set as any value smaller than 4. For example, size = 1 for S0 at left and top sides. m0 is set as 2. For S1 and / or S2, size = 4 at left and / or top side. The size equal to 4 means 4 from top and 4 from left so m1 and / or m2 are 8. In one embodiment, m1 and / or m2 are set as any values smaller than 8.

[0134] Step 1-2: If the size of the input reference samples is smaller than the size of the initial reference samples, down-sampling operations are used and the down-sampling factor is set as (the size of initial reference samples / the size of input reference samples) . An example of the down- sampling operations is shown in the following expression (2) .

[0135] The Step 1-2 is applied to the left side and / or above side, respectively. Then, all or any subset of input reference samples from the left side and / or above side are connected as bdryred [i] , where i is from 0 to (m0, m1, or m2) -1 (denoted as (m0 / m1 / m2) -1) for S0 / S1 / S2 respectively and slightly adjusted to form a vector used as the input reference samples for the matrix as input [i] as shown in Fig. 12A, Fig. 12 B and Fig. 12C for categories S0, S1 and S2 respectively.

[0136] In Figs. 12A-C, the dashed line means that the initial samples (with or without downsampling) are adjusted using bitDepth. For example, (1<< (bitDepth-1) ) –bdryred [i] . The solid line means that the initial samples (with or without downsampling) are adjusted using a predefined sample, such as bdryred [i] -bdryred [0] .

[0137] Step 2: The input reference samples for the matrix are multiplied with the matrix coefficients and used for generating the initial predictors for the current block. For example,

[0138] where or

[0139] The initial predictors are post-processed with a clip operation to make the predictor values within a pre-defined bit range. For example, the pre-defined bit range is from 0 to (1<<bitDepth for luma or chroma) . If the current block refers to a luma coding block, the bitDepth for luma is used; otherwise, the bitDepth for chroma is used.

[0140] Step 3: The initial predictors are up-sampled (or down-sampled) if the n0 / n1 / n2 are smaller (or larger) than the size of the current block. For example, the bilinear interpolation filter  is used and a pre-defined order is set to perform horizontal filtering and then perform vertical filtering, or to perform vertical filtering and then perform horizontal filtering.

[0141] In one embodiment, when generating predictors for the block using combined inter and intra prediction (CIIP) , the inter prediction is from a merge-indexed motion compensation prediction and the intra prediction is from an intra prediction mode suggested by TIMD or DIMD. When doing template matching (TM) refinement for the inter part, the target of the inter part is set as (2Tc-TIntra) , where TIntra is the predictor from the intra prediction mode suggested by TIMD or DIMD, and Tc is the neighbouring reconstructed samples on the template. When performing TM refinement for the intra part, the target of the intra part is set as (2Tc-Tinter) , where Tinter is the predictor from the inter prediction mode indicated by a merge index and / or refined motion information. In one sub-embodiment, the TM refinement can be iterative. For an example of one iteration, TM refinement for the inter part is done first and then TM refinement for the intra part is performed. For another example of one iteration, TM refinement for the intra part is done first and then TM refinement for the inter part is performed. One or more iterations can be applied. In another sub-embodiment, when refining for the intra part, the searching intra prediction modes include the derived intra prediction modes for the intra prediction mode in the beginning. For example, the derived intra prediction modes are to add an offset to the mode index of the intra prediction mode in the beginning where the offset can be positive or negative K. In another sub-embodiment, when refining for the inter part, the searched inter prediction modes include the pre-defined motion vector difference around the inter prediction mode in the beginning. The searched points may or may not be aligned with the TM refinement for the regular merge mode.

[0142] In another embodiment, when generating predictors for the block using a Multiple-Hypothesis (MH) mode such as TIMD or DIMD, one hypothesis of prediction is from the first intra prediction mode suggested by TIMD or DIMD and another hypothesis of prediction is from the second intra prediction mode suggested by TIMD or DIMD. For example, the first intra prediction mode and the second intra prediction mode are the intra prediction modes with the smallest TIMD cost and the second smallest TIMD cost. For another example, the first intra prediction mode and the second intra prediction mode are the intra prediction modes with the largest DIMD histogram and the second largest DIMD histogram. TM refinement can be used to improve the suggestion of intra prediction modes. When doing TM refinement for the second intra  prediction mode, the target is set as (2Tc-TIntra1) where TIntra1 is the predictors from the first intra prediction mode and Tc is the neighbouring reconstructed samples on the template. When doing TM refinement for the first intra prediction mode, the target is set as (2Tc-TIntra2) where Tintra2 is the predictors from the second intra prediction mode. In one sub-embodiment, the TM refinement can be iteratively. For an example of one iteration, TM refinement for the first intra prediction mode is done first and then TM refinement for the second intra prediction mode is performed. For another example of one iteration, TM refinement for the second intra prediction mode is done first and then TM refinement for the first intra prediction mode is performed. One or more iterations can be applied. In another sub-embodiment, when refining, the searched intra prediction modes include the derived intra prediction modes for the intra prediction mode in the beginning. For example, if the intra prediction mode in the beginning is the first intra prediction mode, its derived intra prediction modes are to add an offset to the mode index of the first intra prediction mode where the offset can be positive or negative K.

[0143] In one embodiment, when the down-sampling and / or up-sampling mechanisms are used to provide the candidates of the target mode, one or more matrixes for the block size categories (different from the block size category for the current block) are available for the current block as additional candidate matrixes for the current block or available for the current block as the replacement candidate matrixes for the current block to replace one or more existing matrixes for the current block. For example, when a target block size associated with the target block size category is smaller than a regular block size associated with a regular block size category for a regular MIP mode, reference samples from the top side, left side, or both, of the current block are down-sampled more than the regular MIP mode. For example, when a target block size associated with the target block size category is larger than a regular block size associated with a regular block size category for a regular MIP mode, reference samples from the top side, left side, or both, of the current block are up-sampled more than the regular MIP mode.

[0144] For an example of the current block being categorized in S0 (as a regular case or a regular MIP mode) , originally only the matrixes with size equal to n0 x m0 are available; with the proposed methods, the matrixes with size equal to n1 x m1 and / or the matrixes with size equal to n2 x m2 are available. The following shows a target block size associated with the target block size category is larger than a regular block size associated with a regular block size category for  the regular case. When using the matrixes from S1 and / or S2, the following methods are proposed. If the current block is 4x4 and m1 or m2 is set as 8, which implies 4 for the top and 4 for the left, all neighbouring reference samples adjacent to the top side and left side of the current block are used as the initial and / or input reference samples. In one sub-embodiment, if m1 or m2 is set as a value larger than the size of the prepared initial reference samples for the current block, the prepared initial reference samples for the current block are up-sampled to match the m1 or m2. In another sub-embodiment, if m1 or m2 is set as a value larger than size of the input reference samples for the current block, the input reference samples for the current block are up-sampled to match the m1 or m2. In another sub-embodiment, if the n1 or n2 is set as a value larger than the size of the current block, the initial predictors are down-sampled to match the size of the current block.

[0145] For an example of the current block being categorized in S1 (as a regular case or a regular MIP mode) , originally only the matrixes with size equal to n1 x m1 are available; with the proposed methods, the matrixes with size equal to n0 x m0 and / or the matrixes with size equal to n2 x m2 are available. When using the matrixes from S0 and / or S2, the following methods are proposed. In one sub-embodiment, if m0 is set as a value smaller than the size of the prepared initial and / or input reference samples for the current block, the prepared initial and / or input reference samples for the current block are down-sampled to match the m0. If the current block is 8x8 and m0 is set as 4, which implies a down-sampling factor, which can get 2 reference samples for the top and 2 reference samples for the left, neighbouring reference samples adjacent to the top side and left side of the current block are down-sampled more than regular to get the initial and / or input reference samples. When deriving the input reference samples for the current block, the down-sampling factor is set as (the size of initial reference samples / 2 (instead of original 4) ) for one side. That is, a larger down-sampling factor is used instead. In original S1 category, for one side, the 8x8 block has 8 samples down-sampled to 4 samples (due to m1 = 8 implying 4 samples from one side) with the down-sampling factor as 2 which can be calculated by 8 / 4. With the proposed methods to use S0 category smaller than original S1, for one side, the 8x8 block has 8 samples down-sampled to 2 samples (due to m0 = 4 implying 2 samples from one side) with the down-sampling factor as 4 which can be calculated by 8 / 2. In another sub-embodiment, if n0 is set as a value smaller than n1, the initial predictors are up-sampled more to match the size of the  current block. In another sub-embodiment, if m2 is set as a value larger than size of the prepared initial reference samples for the current block, the prepared initial reference samples for the current block are up-sampled to match m2. In another sub-embodiment, if m2 is set as a value larger than the size of the input reference samples for the current block, the input reference samples for the current block are up-sampled to match m2. In another sub-embodiment, if n2 is set as a value larger than size of the current block, the initial predictors are down-sampled to match the size of the current block.

[0146] For an example of the current block being categorized in S2 (as a regular case or a regular MIP mode) , originally only the matrixes with size equal to n2 x m2 are available; with the proposed methods, the matrixes with size equal to n0 x m0 and / or the matrixes with size equal to n1 x m1 are available. The following shows a target block size associated with the target block size category is smaller than a regular block size associated with a regular block size category for the regular case. When using the matrixes from S0 and / or S1, the following methods are proposed. In one sub-embodiment, if m0 or m1 is set as a value smaller than the size of the prepared initial and / or input reference samples for the current block, the prepared initial and / or input reference samples for the current block are down-sampled to match m0 or m1. If the current block is 16x16 and m0 is set as 4, which implies a down-sampling factor, which can get 2 reference samples for the top and 2 reference samples for the left, neighbouring reference samples adjacent to the top side and left side of the current block are down-sampled more than regular to get the initial and / or input reference samples. When deriving the input reference samples for the current block, the down-sampling factor is set as (the size of initial reference samples / 2 (instead of original 4) ) for one side. That is, a larger down-sampling factor is used instead. In original S2 category, for one side, the 16x16 block has 16 samples down-sampled to 4 samples (due to m2 = 8 implying 4 samples from one side) with the down-sampling factor as 4 which can be calculated by 16 / 4. With the proposed methods to use S0 category smaller than original S2, for one side, the 16x16 block has 16 samples down-sampled to 2 samples (due to m0 = 4 implying 2 samples from one side) with the down-sampling factor as 8 which can be calculated by 16 / 2. In another sub-embodiment, if n0 or n1 is set as a value smaller than n2, the initial predictors are up-sampled more to match the size of the current block.

[0147] In another embodiment, when the transposing mechanism is used to provide the  candidates of the target mode, one or more matrix coefficients or one or more reference samples are transposed as additional candidate matrixes for the current block or as the replacement candidate matrixes, which replace one or more existing matrixes. When applying the transposing mechanisms to the reference samples, several embodiments are proposed. In one embodiment, if originally the input reference samples for the top are connected following the input reference samples for the left, now the input reference samples for the left are connected following the input reference samples for the top; or if originally the input reference samples for the left are connected following the input reference samples for the top, now the input reference samples for the top are connected following the input reference samples for the left. In another embodiment, the initial predictors are transposed. For example, predTemp [y] [x] = initialPred [x] [y] and initialpred = predTemp.

[0148] In another embodiment, when the side-oriented mechanism is used to provide the candidate of the target mode, the reference samples are from either the top side or the left side. Originally, the reference samples are from both the left and top sides. With the proposed methods, the reference samples focus on the information of one side. For example, two lines from the top are referenced. One line is original line 0 from the top and the other line is any pre-defined line i (i >0) from the top. For another example, two lines of from the left are referenced. One line is original line 0 from the left and the other line is any pre-defined line i (i >0) from the left. The two lines can be adjacent or non-adjacent to each other.

[0149] In another embodiment, when the inheriting information is used to provide the candidate of the target mode, all or any subset or any combination of the following methods are applied. First, the coded information for the previous coded blocks is recorded as follows. For each coding block using the target mode, the matrix information is recorded. The matrix information may include the matrix size, matrix mode index (indicating which matrix being used) , transposing or not, any information for the target mode to get predictors, and / or any subset or extension of the above-mentioned matrix information (for example, matrix coefficients or any information of getting the matrix coefficients belonging to the matrix information) . Second, for the current block, an inheriting list or set is built by searching all or any subset of the coded blocks in a pre-defined range. In one embodiment, the pre-defined range refers to the current picture, slice, CTU, tile, or any pre-defined region located at the current picture. In another embodiment, the pre-defined range  is derived based on the current block. For example, the pre-defined range is a coded top range and / or coded left range around the current block. For another example, the pre-defined range follows the pattern of non-adjacent candidates. That is, the distances between non-adjacent spatial candidates and the current block depend on the width and / or height of the current block. In another embodiment, the pre-defined range is limited by CTU row. For example, if the current block is at top row inside a CTU row, the current block has a smaller range by not using much coded top range. When a coded block in the pre-defined range has the matrix information and satisfies a valid checking, the matrix information for the coded block is put into the inheriting list or set. In one embodiment, the valid checking includes the matrix input size (m) being larger than or equal to the current block size, which implies that the reference samples for the current block are not enough to use that matrix. That is, the valid checking depends on the input size of the to-be-put matrix, which may be inserted into the list or set if the valid checking is satisfied, and / or the size of the current block. In another embodiment, the valid checking includes the matrix output size (n) being smaller than or equal to the current block size. That is, the valid checking depends on the output size of the to-be-put matrix and / or the size of the current block. In another embodiment, the valid checking includes the to-be-put matrix information is not duplicated with all or any subset of the members already in the inheriting list or set. For example, full or partial pruning is used. In another embodiment, the order of the members in the inheriting list or set follows the searching order in the pre-defined range. In another embodiment, the matrix information selected by most coded blocks in the pre-defined range is put in the front of the inheriting list or set. Third, an inheriting index is signalled and / or parsed and / or inferred to indicate one or more pieces of matrix information from the inheriting list or set. Then, the indicated matrix information is used for the current block to generate predictors. If the matrix sizes of the indicated matrix information are not for the block size category of the current block, the proposed methods of down-sampling and / or up-sampling mechanisms can be applied here. In another embodiment, if a chroma block, for example, in a chroma DM mode, references the collocated luma block, which was coded by a matrix-based mode, the chroma block can inherit the matrix information from the collocated luma block. When the colour format is not 4: 4: 4 (e.g., 4: 2: 0) , the chroma has a different block size from the luma. Therefore, the proposed methods of down-sampling and / or up-sampling mechanisms can be applied here to support using inherited matrix information for chroma blocks.

[0150] In another embodiment, when the blending mechanism is used to provide the candidates of the target mode, the candidate using the blending mechanism is treated as an additional sub-mode for the target mode or treated to replace the prediction generation of the target mode. When the blending mechanism is applied to the current block using the target mode, several embodiments are proposed to generate the predictor for the current block. In one embodiment, the predictors for the current block are formed by combining one or more hypotheses of predictions generated according to one or more pieces of matrix information. In one sub-embodiment, the combining weighting is block-based weighting (i.e., uniform for the whole block) . In another sub-embodiment, the combining weighting is sample-based weighting (i.e., deriving weighting for each sample) . In another embodiment, the one or more pieces of matrix information are obtained by using a suggestion scheme to select from a set of candidate matrix information. The set of candidate matrix information may include all or any subset of the inheriting matrix information. The set of candidate matrix information may include all or any subset of the candidate matrix information of the current block. The suggestion scheme may refer to a boundary matching scheme, a template matching scheme (for example, DIMD and / or TIMD) , a pre-defined mapping table which stores the candidate information associated with different block sizes. For an example of the suggestion scheme being boundary matching scheme, for each candidate matrix information in the set, a boundary matching cost is calculated and the first K candidates with smaller boundary matching costs (as described later in this disclosure) are used for generating predictors for the current block. The hypothesis of prediction from the candidate with a smaller cost has a higher weight (similar to TIMD) . For another example of the suggestion scheme being the boundary matching scheme, one or more pieces of matrix information are suggested from the top boundary and another one or more pieces of matrix information are suggested from the left boundary. The hypothesis of prediction from the candidate suggested by the top boundary has a higher weight if the current sample is near the top boundary. The hypothesis of prediction from the candidate suggested by the left boundary has a higher weight if the current sample is near the left boundary. The weighting for the current sample may depend on the position of the current sample. An example of the weighting is shown below: wmatrixTop (x, y) +wmatrixLeft (x, y) =64,

[0151] If the matrix suggested from either the left or top boundary corresponds to a large boundary cost, the position-dependent weighting is further adjusted to reduce the weighting for the matrix with a very large boundary matching cost.

[0152] In another embodiment, the predictors for the current block are further combined with one or more hypotheses of predictions generated by one or more traditional intra prediction modes. In one sub-embodiment, the one or more traditional intra prediction modes are determined by TIMD, boundary matching, and / or DIMD suggestion. In another sub-embodiment, the one or more traditional intra prediction modes include at least planar, DC, horizontal, vertical, diagonal, any intra prediction mode in 67 and / or 131 domain, any intra prediction mode supported in the standard, or any subset of the above-mentioned modes. In another sub-embodiment, if the size of the current block is larger than or smaller than a pre-defined threshold (e.g., 4, 8, 16, 32, 64, …) , the used traditional intra prediction mode is a fixed default mode (e.g., planar) ; otherwise, the used traditional intra prediction mode is determined with the suggestion. In another embodiment, PDPC is further used to adjust the predictors for the current block as shown in Fig. 13. The horizontal neighbouring reconstructed samples (R-1, y) 1314 and / or vertical neighbouring reconstructed samples (Rx, -1) 1316 are used to adjust the predictor (x, y) 1312. An example for PDPC adjustment is shown as follows: Pred (x, y) = ( ( ( (wT×Rx, -1+wL×R-1, y+32) >>6)  <<6) + (64-wT-wL) ×pred (x, y) +32) >>6

[0153] In another embodiment, when the block-splitting mechanism is used to provide the candidates of the target mode, the candidate using the block-splitting mechanism is treated as an additional sub-mode for the target mode or treated to replace prediction and / or transform flows of the target mode. When the blending mechanism is applied to the current block using the target mode, a splitting method is determined to divide the current block into K subblocks first, where K is determined according to the selected splitting method and / or K is a positive integer larger than 1. In one embodiment, the candidate splitting methods include a splitting direction and / or a splitting number. The splitting direction may refer to one of horizontal direction, vertical direction, diagonal direction, any straightforward (or geometric) line which represents by an angle and / or a distance (for example, a distance from the block centre) , any GPM (Geometric Partitioning Mode) partition (for example, using a geometric line to split the current block into 2 subblocks) , any ISP  (Intra Sub-Partitions) splitting, or any subset or combination of the above-mentioned splitting directions. The splitting number may refer to any pre-defined positive value larger than 1. When the splitting direction is horizontal and the splitting number is 2, horizontal binary tree (HBT) splitting is the splitting method and the current block is divided into 2 subblocks horizontally. If the splitting number is extended to 4, the current block is divided into 4 subblocks horizontally. When the splitting direction is vertical and the splitting number is 2, vertical binary tree (VBT) splitting is the splitting method and the current block is divided into 2 subblocks vertically. If the splitting number is extended to 4, the current block is divided into 4 subblocks vertically. When the splitting direction is a combination of horizontal and vertical directions and the splitting number is 4, quadtree (QT) splitting is the splitting method and the current block is divided into 4 subblocks with a cross intersection on the block centre. In another embodiment, each subblock refers to a transform block. That is, the splitting method is applied to not only the prediction stage, but also the transform stage. Similar to ISP, in the HBT example (an MIP block 1410 split into two subblocks 1420 by HBT) as shown in Fig. 14, the first matrix is used to generate predictors for the first subblock by using the reference samples around the current block as shown in selection 1430. Afterward, all or any subset of the following steps will take place: (1) at the encoder, the residuals of the first subblock are obtained by the predictors for the first subblock and the original source for the first subblock; (2) the residuals of the first subblock are transformed with an implicit or explicit transform mode to get the coefficients of the first subblock; (3) at the encoder and / or decoder, the coefficients of the first subblock are inverse transformed with an implicit or explicit transform mode to obtain the recovered residuals of the first subblock; and (4) the reconstruction of the first subblock is generated by using the recovered residuals and the predictors obtained by the first matrix. For the following second subblock, the second matrix is used to generate predictors for the second subblock as shown in selection 1440 in Fig. 14 by using the reference samples around the second subblock block, which may include the reconstructed samples at the right side and / or bottom side for the first subblock and / or the reference samples around the current block. In another embodiment, each subblock refers to a prediction block. That is, the splitting method is applied to the prediction stage. Similar to GPM (Geometric Partitioning Mode) , the reference samples for each subblock are still around the current block. In another embodiment, the matrix is uniform for each subblock. That is, the first matrix for the first subblock is the same as the second matrix for the second subblock. In one sub-embodiment, when the splitting method is applied to  not only the prediction stage but also the transform stage, the matrix is uniform for each subblock in the current block. In another embodiment, the matrixes are different for each subblock or any subset of the subblocks. In one sub-embodiment, when the splitting method is applied to the prediction stage (not the transform stage) , the matrixes are different for each subblock or any subset of the subblocks. In this case, at the splitting boundary between the subblocks, one or more matrixes for the neighbouring subblocks are used for the current subblock to generate the predictors which will be blended with the predictors from the matrix for the current subblock by using weighting. The weighting may prefer the predictors from the matrix for the current subblock and / or equal weighting may be used when the sample is very close to the splitting boundary. In one embodiment, selection of the candidate splitting is explicitly signalled, implicitly derived, or inherited. In one embodiment, selection of the candidate matrix is explicitly signalled, implicitly derived, or inherited.

[0154] In another embodiment, when one or more proposed mechanisms are used, one or more matrixes or intra prediction modes are used to generate the final predictors for the current block. A representative prediction mode is required for the following transform process or stored for the subsequent coding luma or chroma blocks.

[0155] Boundary-Matching Costs

[0156] A boundary matching cost for a candidate mode refers to the discontinuity measurement (including top boundary matching and / or left boundary matching) between the current prediction (the predicted samples (predi, j, 0 ≤ i, j ≤ 3) within the current block 1510) , generated from the candidate mode, and the neighbouring reconstruction (the reconstructed samples (recoi, j) within one or more neighbouring blocks) as shown in Fig. 15. Top boundary matching means the comparison between the current top predicted samples and the neighbouring top reconstructed samples, and left boundary matching means the comparison between the current left predicted samples and the neighbouring left reconstructed samples.

[0157] In one embodiment, a pre-defined subset of the current prediction is used to calculate the boundary matching cost. n line (s) of top boundary within the current block and / or m line (s) of left boundary within the current block are used. (Moreover, n2 line (s) of top neighboring reconstruction and / or m2 line (s) of left neighboring reconstruction are used. )

[0158] - Here is an example of calculating a boundary matching cost. (n = 2, m = 2, n2 = 2, m2 = 2)

[0159] ○ where the weights (a, b, c, d, e, f, g, h, i, j, k, l) can any positive integers such as a = 2, b = 1, c = 1, d = 2, e = 1, f = 1, g = 2, h = 1, i = 1, j = 2, k = 1, l = 1.

[0160] - Here is another example of calculating a boundary matching cost. (n = 2, m = 2, n2 = 1, m2 =1)

[0161] ○ where the weights (a, b, c, g, h, i) can any positive integers such as a = 2, b = 1, c = 1, g = 2, h = 1, i = 1.

[0162] - Here is another example of calculating a boundary matching cost. (n = 1, m = 1, n2 = 2, m2 =2)

[0163] ○ where the weights (d, e, f, j, k, l) can any positive integers such as d = 2, e = 1, f = 1, j= 2, k = 1, l = 1.

[0164] - Here is another example of calculating a boundary matching cost. (n = 1, m = 1, n2 = 1, m2 =1)

[0165] ○ where the weights (a, c, g, i) can any positive integers such as a = 1, c = 1, g = 1, i = 1.

[0166] - Here is another example of calculating a boundary matching cost. (n = 2, m = 1, n2 = 2, m2 =1)

[0167] ○ where the weights (a, b, c, d, e, f, g, i) can any positive integers such as a = 2, b = 1, c= 1, d = 2, e = 1, f = 1, g = 1, i = 1.

[0168] - Here is another example of calculating a boundary matching cost. (n = 1, m = 2, n2 = 1, m2 =2)

[0169] ○ where the weights (a, c, g, h, i, j, k, l) can any positive integers such as a = 1, c = 1, g= 2, h = 1, i = 1, j = 2, k = 1, l = 1.

[0170] (The following examples for n and m can also be applied to n2 and m2. )

[0171] For another example, n can be any positive integer such as 1, 2, 3, 4, etc.

[0172] For another example, m can be any positive integer such as 1, 2, 3, 4, etc.

[0173] For another example, n and / or m vary with block width, height, or area.

[0174] - One possible way is that, for a larger block (area > threshold2) , m gets larger.

[0175] ○ Threshold2 = 64, 128, or 256.

[0176] ○ When area > threshold2, m is increased to 2. (Originally, m is 1. )

[0177] ○ When area > threshold2, m is increased to 4. (Originally, m is 1 or 2. )

[0178] - Another possible way is that, for a taller block (height > thrershold2 *width) , m gets larger and / or n gets smaller.

[0179] ○ Threshold2 = 1, 2, or 4.

[0180] ○ When height > thrershold2 *width, m is increased to 2. (Originally, m is 1. )

[0181] ○ When height > thrershold2 *width, m is increased to 4. (Originally, m is 1 or 2. )

[0182] - Another possible way is that, for a larger block (area > threshold2) , n gets larger.

[0183] ○ Threshold2 = 64, 128, or 256.

[0184] ○ When area > threshold2, n is increased to 2. (Originally, n is 1. )

[0185] ○ When area > threshold2, n is increased to 4. (Originally, n is 1 or 2. )

[0186] - Another possible way is that, for a wider block (width > thrershold2 *height) , n gets larger and / or m gets smaller.

[0187] ○ Threshold2 = 1, 2, or 4.

[0188] ○ When width > thrershold2 *height, n is increased to 2. (Originally, n is 1. )

[0189] ○ When width > thrershold2 *height, n is increased to 4. (Originally, n is 1 or 2. )

[0190] The MIP mode with one or more settings as described above can be implemented in an encoder side or a decoder side. For example, any of the MIP mode with one or more settings can be implemented in an inter and / or intra and / or IBC and / or prediction and / or transform coding module (e.g., Intra Pred. 150 / MC 152 in Fig. 1B) in a decoder or an inter and / or intra and / or IBC and / or prediction and / or transform coding module is an encoder (e.g., Intra Pred. 110 / Inter Pred. 112 in Fig. 1A) . Any of the proposed MIP mode with various settings can also be implemented as a circuit coupled to the inter and / or intra and / or IBC and / or prediction and / or transform coding module at the decoder or the encoder. However, the decoder or encoder may also use additional processing unit to implement the required processing for the proposed MIP mode with one or more settings. While the inter and / or intra and / or IBC and / or prediction and / or transform units (e.g., unit 110 / 112 in Fig. 1A and unit 150 / 152 in Fig. 1B) are shown as individual processing units, they may correspond to executable software or firmware codes stored on a media, such as hard disk or flash memory, for a CPU (Central Processing Unit) or programmable devices (e.g., DSP (Digital Signal Processor) or FPGA (Field Programmable Gate Array) ) .

[0191] Fig. 16 illustrates a flowchart of an exemplary video coding system where the MIP mode uses one or more settings according to an embodiment of the present invention. The steps shown in the flowchart may be implemented as program codes executable on one or more processors (e.g., one or more CPUs) at the encoder side. The steps shown in the flowchart may also be implemented based hardware such as one or more electronic devices or processors arranged to perform the steps in the flowchart. According to the method, input data associated with a current block are received in step 1610, wherein the input data comprise pixel data to be encoded at an encoder side or data associated with the current block to be decoded at a decoder side. A target  Matrix-based Intra Prediction (MIP) mode using an MIP mode setting is determined in step 1620, wherein the MIP mode setting incorporates extended MIP setting, down-sampling or up-sampling setting, block-splitting setting, side-oriented setting, or a combination thereof, wherein the MIP mode setting with the extended MIP setting includes an MRL (Multiple Reference Line) based MIP mode, an IBC (Intra Block Copy) or IntraTMP (Intra Template Matching Prediction) based MIP mode, or an inter based MIP mode, wherein the MIP mode setting with the down-sampling or up-sampling setting includes a down-sampled or up-sampled MIP candidate with a target block size category different from a regular MIP mode, wherein the MIP mode setting with the block-splitting setting includes a block-splitting MIP candidate generated by splitting the current block into subblocks, or wherein the MIP mode setting with the side-oriented setting includes a side-oriented MIP candidate with reference samples only from a top side or left side of the current block. The current block is encoded or decoded using the target MIP mode in step 1630.

[0192] The flowchart shown is intended to illustrate an example of video coding according to the present invention. A person skilled in the art may modify each step, re-arranges the steps, split a step, or combine steps to practice the present invention without departing from the spirit of the present invention. In the disclosure, specific syntax and semantics have been used to illustrate examples to implement embodiments of the present invention. A skilled person may practice the present invention by substituting the syntax and semantics with equivalent syntax and semantics without departing from the spirit of the present invention.

[0193] The above description is presented to enable a person of ordinary skill in the art to practice the present invention as provided in the context of a particular application and its requirement. Various modifications to the described embodiments will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. In the above detailed description, various specific details are illustrated in order to provide a thorough understanding of the present invention. Nevertheless, it will be understood by those skilled in the art that the present invention may be practiced.

[0194] Embodiment of the present invention as described above may be implemented in  various hardware, software codes, or a combination of both. For example, an embodiment of the present invention can be one or more circuit circuits integrated into a video compression chip or program code integrated into video compression software to perform the processing described herein. An embodiment of the present invention may also be program code to be executed on a Digital Signal Processor (DSP) to perform the processing described herein. The invention may also involve a number of functions to be performed by a computer processor, a digital signal processor, a microprocessor, or field programmable gate array (FPGA) . These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention. The software code or firmware code may be developed in different programming languages and different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, styles and languages of software codes and other means of configuring code to perform the tasks in accordance with the invention will not depart from the spirit and scope of the invention.

[0195] The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.

Claims

1.A method of video coding, the method comprising:receiving input data associated with a current block, wherein the input data comprise pixel data to be encoded at an encoder side or data associated with the current block to be decoded at a decoder side;determining a target Matrix-based Intra Prediction (MIP) mode using an MIP mode setting, wherein the MIP mode setting incorporates extended MIP setting, down-sampling or up-sampling setting, block-splitting setting, side-oriented setting, or a combination thereof, wherein the MIP mode setting with the extended MIP setting includes an MRL (Multiple Reference Line) based MIP mode, an IBC (Intra Block Copy) or IntraTMP (Intra Template Matching Prediction) based MIP mode, or an inter based MIP mode, wherein the MIP mode setting with the down-sampling or up-sampling setting includes a down-sampled or up-sampled MIP candidate with a target block size category different from a regular MIP mode, wherein the MIP mode setting with the block-splitting setting includes a block-splitting MIP candidate generated by splitting the current block into subblocks, or wherein the MIP mode setting with the side-oriented setting includes a side-oriented MIP candidate with reference samples only from a top side or left side of the current block; andencoding or decoding the current block using the target MIP mode.2.The method of Claim 1, wherein the target MIP mode is used as an additional mode or a replacement mode.3.The method of Claim 1, wherein the MRL based MIP mode uses reference samples comprising spatial neighbouring reconstructed samples non-adjacent to the current block.4.The method of Claim 1, wherein the IBC or IntraTMP based MIP mode uses reference samples comprising reconstructed samples indicated by one or more block vectors of the current block.5.The method of Claim 1, wherein the inter based MIP mode uses reference samples comprising reconstructed samples indicated by one or more motion vectors of the current block or reconstructed samples in one or more previous pictures.6.The method of Claim 1, wherein when a target block size associated with the target block size category is smaller than a regular block size associated with a regular block size category for the regular MIP mode, reference samples from the top side, left side, or both, of the current block are down-sampled more than the regular MIP mode.7.The method of Claim 1, wherein the block-splitting MIP candidate is associated with candidate splitting, and the candidate splitting comprises a splitting direction, a splitting number, or both.8.The method of Claim 7, wherein the splitting direction refers to one of horizontal direction, vertical direction, diagonal direction, any straightforward line represented by an angle and / or a distance from a block centre, any GPM (Geometric Partitioning Mode) partition, any ISP (Intra Sub-Partitions) splitting, or a combination thereof.9.The method of Claim 7, wherein selection of the candidate splitting is explicitly signalled, implicitly derived, or inherited.10.The method of Claim 1, wherein the side-oriented MIP candidate uses one neighbouring reference line adjacent to a boundary on the top side or left side of the current block, and one or more additional reference lines adjacent to or non-adjacent to said one neighbouring reference line.11.An apparatus of video coding, the apparatus comprising one or more electronics or processors arranged to:receive input data associated with a current block, wherein the input data comprise pixel data to be encoded at an encoder side or data associated with the current block to be decoded at a decoder side;determine a target Matrix-based Intra Prediction (MIP) mode using an MIP mode setting, wherein the MIP mode setting incorporates extended MIP setting, down-sampling or up-sampling setting, block-splitting setting, side-oriented setting, or a combination thereof, wherein the MIP mode setting with the extended MIP setting includes an MRL (Multiple Reference Line) based MIP mode, an IBC (Intra Block Copy) or IntraTMP (Intra Template Matching Prediction) based MIP mode, or an inter based MIP mode, wherein the MIP mode setting with the down-sampling or up-sampling setting includes a down-sampled or up-sampled MIP candidate with a target block size category different from a regular MIP mode, wherein the MIP mode setting with the block-splitting setting includes a block-splitting MIP candidate generated by splitting the current block into subblocks, or wherein the MIP mode setting with the side-oriented setting includes a side-oriented MIP candidate with reference samples only from a top side or left side of the current block; andencode or decode the current block using the target MIP mode.

Citation Information

Patent Citations

  • Transform-based image encoding method and apparatus therefor

    CN114902678A

  • Signaling of matrix intra prediction parameters in video coding

    US20200404325A1

  • Matrix-based intra prediction device and method

    US20220078449A1

  • Syntax signaling and parsing based on colour component

    US20220264124A1

Cited By

  • Image encoding method, encoding device, decoding method, and decoding device using matrix-based intra prediction

    WO2026089244A1