Methods and apparatus of filtered predictors for intratmp, IBC, or LIC mode in video coding

WO2024222424A1PCT designated stage expired Publication Date: 2024-10-31MEDIATEK INC

Patent Information

Application Number
PCT/CN2024/086336
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-24
Filing Date
2024-04-07
Publication Date
2024-10-31

Smart Images

  • Figure CN2024086336_31102024_PF_FP_ABST
    Figure CN2024086336_31102024_PF_FP_ABST
Patent Text Reader

Abstract

A method and apparatus for video coding using filtered predictors for IntraTMP, IBC and / or LIC mode are disclosed. According to the method, one or more reference templates for a reference block and one or more current templates for the current block are determined. A prediction model for predicting a target current sample in the current block is derived based on reference data, wherein the prediction model comprises one or more target reference samples and one or more gradient terms derived from the reference data, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates. A target predictor for the target current sample in the current block is generated according to the prediction model. The target current sample in the current block is encoded or decoded using the target predictor.
Need to check novelty before this filing date? Find Prior Art

Description

METHODS AND APPARATUS OF FILTERED PREDICTORS FOR INTRATMP, IBC, OR LIC MODE IN 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 / 497,755, filed on April 24, 2023. The U.S. Provisional Patent Application is hereby incorporated by reference in its entirety.FIELD OF THE INVENTION

[0003] The present invention relates to video coding system. In particular, the present invention relates to filtered predictors for IntraTMP, IBC, or LIC mode in a video coding system.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] Intra Block Copy

[0009] Intra block copy (IBC) is a tool adopted in HEVC extensions on SCC (Screen Content Coding) . 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. The luma block vector of an IBC-coded CU is in integer precision. The chroma block vector is rounded to integer precision as well. When combined with AMVR (Adaptive Motion Vector Resolution) , the IBC mode can switch between 1-pel and 4-pel motion vector precisions. An IBC-coded CU is treated as the third prediction mode other than intra or inter prediction modes. The IBC mode is applicable to the CUs with both width and height smaller than or equal to 64 luma samples.

[0010] At the encoder side, hash-based motion estimation is performed for IBC. The encoder performs RD check for blocks with either width or height no larger than 16 luma samples. For non-merge mode, the block vector search is performed using hash-based search first. If hash search does not return a valid candidate, block matching based local search will be performed.

[0011] In the hash-based search, hash key matching (32-bit CRC) between the current block and a reference block is extended to all allowed block sizes. The hash key calculation for every position in the current picture is based on 4x4 subblocks. For the current block of a larger size, a hash key is determined to match that of the reference block when all the hash keys of all 4×4 subblocks match the hash keys in the corresponding reference locations. If hash keys of multiple reference blocks are found to match that of the current block, the block vector costs of each matched reference are calculated and the one with the minimum cost is selected.

[0012] In block matching search, the search range is set to cover both the previous and current CTUs.

[0013] At CU level, IBC mode is signalled with a flag and it can be signalled as IBC AMVP (Advanced Motion Vector Prediction) mode or IBC skip / merge mode as follows:

[0014] – IBC skip / merge mode: a merge candidate index is used to indicate which of the block vectors in the list from neighbouring candidate IBC coded blocks is used to predict the current block. The merge list consists of spatial, HMVP (History based Motion Vector Prediction) , and pairwise candidates.

[0015] – IBC AMVP mode: block vector difference is coded in the same way as a motion vector difference. The block vector prediction method uses two candidates as predictors, one from left neighbour and one from above neighbour (if IBC coded) . When either neighbour is not available, a default block vector will be used as a predictor. A flag is signalled to indicate the block vector predictor index.

[0016] IBC Reference Region

[0017] To reduce memory consumption and decoder complexity, the IBC in VVC allows only the reconstructed portion of the predefined area including the region of current CTU and some region of the left CTU. Fig. 2 illustrates the reference region of IBC Mode, where each block represents 64x64 luma sample unit. Depending on the location of the current coded CU within the current CTU, the following applies:

[0018] – If the current block falls into the top-left 64x64 block of the current CTU (case 210 in Fig. 2) , then in addition to the already reconstructed samples in the current CTU, it can also refer to the reference samples in the top-right, bottom-left, and bottom-right 64x64 blocks of the left CTU, using current picture referencing (CPR) mode. (More details of CPR can be found in JVET-T2002 (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) ) . The current block can also refer to the reference samples in the top-right, bottom-left, and bottom-left 64x64 block of the left CTU and the reference  samples in the top-right 64x64 block of the current CTU, using CPR mode.

[0019] – If the current block falls into the top-right 64x64 block of the current CTU (case 220 in Fig. 2) , then in addition to the already reconstructed samples in the current CTU, if luma location (0, 64) relative to the current CTU has not yet been reconstructed, the current block can also refer to the reference samples in the bottom-left 64x64 block and bottom-right 64x64 block of the left CTU, using CPR mode; otherwise, the current block can also refer to reference samples in bottom-right 64x64 block of the left CTU.

[0020] – If the current block falls into the bottom-left 64x64 block of the current CTU (case 230 in Fig. 2) , then in addition to the already reconstructed samples in the current CTU, if luma location (64, 0) relative to the current CTU has not yet been reconstructed, the current block can also refer to the reference samples in the top-right 64x64 block and bottom-right 64x64 block of the left CTU, using CPR mode. Otherwise, the current block can also refer to the reference samples in the bottom-right 64x64 block of the left CTU, using CPR mode.

[0021] – If current block falls into the bottom-right 64x64 block of the current CTU (case 240 in Fig. 2) , it can only refer to the already reconstructed samples in the current CTU, using CPR mode.

[0022] Intra Template Matching Prediction (IntraTMP) Mode

[0023] Intra template matching prediction (IntraTMP) 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 matched with the current template in a reconstructed part of the current frame and uses the corresponding block as a prediction block. The encoder then signals the usage of this mode, and the same prediction operation is performed at the decoder side.

[0024] The prediction signal is generated by matching the L-shaped causal neighbour of the current block with another block in a predefined search area in Fig. 3 consisting of current CTU (R1) , top-left CTU (R2) , above CTU (R3) , left CTU (R4) . Sum of absolute differences (SAD) is used as a cost function. Within each region, the decoder searches for the template that has least SAD with respect to the current one and uses its corresponding block as a prediction block.

[0025] In Fig. 3, the current block 310 in R1 is matched with the corresponding block 312 in  R2. The templates for the current block and the matched block are shown as darker-colour L-shaped areas. Area 322 corresponds to reconstructed region in the current picture 320. Sum of absolute differences (SAD) is used as a cost function. Within each region, the decoder searches for the template that has least SAD with respect to the current one and uses its corresponding block as a prediction block.

[0026] The dimensions of all regions (SearchRange_w, SearchRange_h) are set proportional to the block dimension (BlkW, BlkH) to have a fixed number of SAD comparisons per pixel. That is:

[0027] SearchRange_w = a *BlkW,

[0028] SearchRange_h = a *BlkH,

[0029] where ‘a’ is a constant that controls the gain / complexity trade-off. In practice, ‘a’ is equal to 5.

[0030] To speed-up the template matching process, the search range of all search regions is subsampled by a factor of 2. This leads to a reduction of template matching search by 4. After finding the best match, a refinement process is performed. The refinement is done via a second template matching search around the best match with a reduced range. The reduced range is defined as min (BlkW, BlkH)  / 2.

[0031] The Intra template matching tool is enabled for CUs with size less than or equal to 64 in width and height. This maximum CU size for Intra template matching is configurable.

[0032] The Intra template matching prediction mode is signalled at CU level through a dedicated flag when DIMD (Decoder-side Intra Mode Derivation) is not used for current CU.

[0033] IntraTMP Derived Block Vector Candidates for IBC

[0034] In this method, block vector (BV) derived from the intra template matching prediction (IntraTMP) is used for intra block copy (IBC) . The stored IntraTMP BV of the neighbouring blocks along with IBC BV are used as spatial BV candidates in IBC candidate list construction.

[0035] IntraTMP block vector is stored in the IBC block vector buffer and, the current IBC  block can use both IBC BV and IntraTMP BV of neighbouring blocks as BV candidates for IBC BV candidate list as shown in Fig. 4.

[0036] In Fig. 4, block 410 corresponds to the current block and block 412 corresponds to a neighbouring IntraTMP block. The IntraTMP BV 416 is used to locate the best matching block 422 according to the matching cost between template 424 and template 414. Area 432 corresponds to reconstructed region in the current picture 430. IntraTMP block vectors are added to IBC block vector candidate list as spatial candidates.

[0037] IntraTMP block vectors are added to IBC block vector candidate list as spatial candidates.

[0038] A Model Trained by Templates for IntraTMP and IBC

[0039] In recent development, templates have been used for IntraTMP and IBC to help searching for the best reference block as a prediction block for the current block. According to this new technique, a model is trained by using data in the templates to obtain a better prediction. According to this technique, the prediction of the current block is not directly copied from the reference block. Instead, filtered values obtained by the trained model are considered instead.

[0040] A. Model used in IBC

[0041] In IBC, a single source model containing a spatial term is used: y=a0x0+offset,        (1)

[0042] where y is in the current template or the current block, and x0 is the corresponding pixel of y in the reference template or the reference block for training and inference stages, respectively. a0 and offset are parameters of the model. During the training stage, the training dataset contains all the data in the reference and current templates. The pairs of (x0, y) are fed into the model to train the parameters a0 and offset. In the inference stage, the prediction block can be produced by the model with trained parameters a0 and offset when all the pixel values of the current block are fed into the model. As shown in equation (1) , the filtered predictor for IBC is a single-source predictor since only 1 input term (i.e., x0) is used.

[0043] Fig. 5A and Fig. 5B illustrate an example of model training and trained-model prediction respectively for IBC using a single source model containing a spatial term. In Fig. 5A, the current template 512 for the current block 510 and the reference template 522 for the reference block 520 are used to train the model. A prediction model is derived after the training. In other words, a sample, y in the current template can be related to a corresponding sample, x0 in the reference template as shown in Fig. 5A according to equation (1) . After the model is derived, the model is used in the inference stage to prediction a sample, y in the current block according to a corresponding sample, x0 in the reference block as shown in Fig. 5B using equation (1) .

[0044] B. Model used in IntraTMP

[0045] In IntraTMP, a multi-source model containing more than one spatial term is used:

[0046] where y is in the current template or the current block and x0, x1, …, xn are in the reference template or the reference block for training and inference stages, respectively. For the multi-source model, not only x0, the corresponding reference pixel of the current pixel, but also the neighbouring pixels of x0 are used. For example, the top, bottom, left and right pixels of x0 are also considered to be one of training inputs. In addition, a0, a1, …, an and offset are parameters of the model. During the training stage, the training dataset contains all the data in the reference and current templates. The sets of (x0, x1, …, xn, y) are fed into the model to train the parameters a0, a1, …, an and offset. In the inference stage, the prediction block can be produced by the model with trained parameters a0, a1, …, an and offset when all the pixel values of the current block are fed into the model.

[0047] Fig. 6A and Fig. 6B illustrate an example of model training and trained-model prediction respectively for IntraTMP using a multiple-source model containing multiple spatial terms. In Fig. 6A, the current template 612 for the current block 610 and the reference template 622 for the reference block 620 are used to train the model. A prediction model is derived after the training. In other words, a sample, y in the current template can be related to corresponding samples, x0, x1, …, xn in the reference template as shown in Fig. 6A according to equation (2) . After the model is derived, the model is used in the inference stage to prediction a sample, y in the  current block according to corresponding sample, x0, x1, …, xn in the reference block as shown in Fig. 6B using equation (2) .

[0048] Local Illumination Compensation (LIC)

[0049] Local Illumination Compensation (LIC) is a method to perform inter prediction by using neighbouring samples of the current block and reference block based on a linear model with a scaling factor a and an offset b. It derives the scaling factor a and the offset b by referring to the neighbouring samples of the current block and reference block. Moreover, it’s enabled or disabled adaptively for each CU. More details for LIC can be found in JVET-C1001 (Jianle Chen, et. al., “Algorithm Description of Joint Exploration Test Model 3” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29, 3rd Meeting: Geneva, CH, 26 May –1 June 2016, Document: JVET-C1001) .

[0050] In the present invention, methods and apparatus of new filtered predictors for IntraTMP, IBC and / or LIC are disclosed to improve the performance.

[0051] BRIEF SUMMARY OF THE INVENTION

[0052] A method and apparatus for video coding using filtered predictors for IntraTMP, IBC and / or LIC mode are disclosed. According to the method, input data associated with a current block are received, wherein the input data comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side. One or more reference templates for a reference block and one or more current templates for the current block are determined. A prediction model for predicting a target current sample in the current block is derived based on reference data, wherein the prediction model comprises one or more target reference samples and one or more gradient terms derived from the reference data, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates. A target predictor for the target current sample in the current block is generated according to the prediction model. The target current sample in the current block is encoded or decoded using the target predictor.

[0053] In one embodiment, the current block is coded in IntraTMP (intra Template Matching Prediction) , IBC (Intra Block Copy) or LIC (Local Illumination Compensation) mode.

[0054] In one embodiment, said one or more gradient terms comprise a vertical gradient and a horizontal gradient.

[0055] In one embodiment, said one or more target reference samples comprise a corresponding reference sample for the target current sample, a top reference sample, a bottom reference sample, a left reference sample, and a right reference sample of the corresponding reference sample. In one embodiment, a vertical gradient is calculated according to a first difference between the top reference sample and the bottom reference sample, and a horizontal gradient is calculated based on a second difference between the left reference sample and the right reference sample. In one embodiment, said one or more target reference samples further comprise a top-right reference sample, a top-left reference sample, a bottom-left reference sample, and a bottom-right reference sample of the target current sample. In one embodiment, a vertical gradient is calculated according to a first difference between a first sum of the top reference sample, the top-right reference sample and the top-left reference sample and a second sum of the bottom reference sample, the bottom-right reference sample and the bottom-left reference sample, and a horizontal gradient is calculated based on a second difference between a third sum of the left reference sample, the top-left reference sample and the bottom-left reference sample, and a fourth sum of the right reference sample, the top-right reference sample and the bottom-right reference sample.

[0056] In one embodiment, said one or more target reference samples or said one or more gradient terms are clipped. In one embodiment, said one or more target reference samples comprise a corresponding reference sample for the target current sample, intensities of said one or more target reference samples except for the corresponding reference sample are clipped according to a target intensity of the corresponding reference sample. In one embodiment, the intensities of said one or more target reference samples except for the corresponding reference sample are clipped to a range within a threshold from the target intensity of the corresponding reference sample, wherein the threshold has a positive value. In one embodiment, the threshold is pre-defined. In one embodiment, the threshold is dependent on sample bit-depth, slice type, CU width, CU height,  prediction direction, quantization parameter, or a combination thereof. In one embodiment, the threshold is explicitly signalled or parsed at CU level, CTU level, slice level, picture level, or sequence level.

[0057] In one embodiment, intensities of said one or more gradient terms are clipped to a range within a threshold from 0, and wherein the threshold has a positive value. In one embodiment, the threshold is pre-defined. In one embodiment, the threshold is dependent on sample bit-depth, slice type, CU width, CU height, prediction direction, quantization parameter, or a combination thereof. In one embodiment, the threshold is explicitly signalled or parsed at CU level, CTU level, slice level, picture level, or sequence level.

[0058] According to another method, input data associated with a current block are received, wherein the input data comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side. One or more reference templates for a reference block and one or more current templates for the current block are determined. A prediction model for predicting a target current sample in the current block is derived based on reference data, wherein the prediction model comprises multiple target reference samples if the current block is coded in IBC (Intra Block Copy) or LIC (Local Illumination Compensation) mode, and the prediction model comprises a single target reference sample if the current block is coded in IntraTMP (intra Template Matching Prediction) mode, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates. A target predictor for the target current sample in the current block is generated according to the prediction model. The target current sample in the current block is encoded or decoded using the target predictor.BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0061] Fig. 2 illustrates an example of current CTU processing order and its available  reference samples in current and left CTU.

[0062] Fig. 3 illustrates an example of intra template matching search area used.

[0063] Fig. 4 illustrates an example of use of IntraTMP block vector for IBC block.

[0064] Fig. 5A illustrates an example of a training pair using a single source model containing a single spatial term.

[0065] Fig. 5B illustrates an example of an inference pair using a single source model containing a single spatial term.

[0066] Fig. 6A illustrates an example of a training pair using a multiple source model containing multiple spatial terms.

[0067] Fig. 6B illustrates an example of an inference pair using a multiple source model containing multiple spatial terms.

[0068] Fig. 7A illustrates an example of a training set using a multi-source model containing spatial and gradient terms in IntraTMP or IBC.

[0069] Fig. 7B illustrates an example of an inference set using a multi-source model containing spatial and gradient terms in IntraTMP or IBC.

[0070] Fig. 8A illustrates an example of a training pair using a multiple source model containing multiple spatial terms in LIC.

[0071] Fig. 8B illustrates an example of an inference pair using a multiple source model containing multiple spatial terms in LIC.

[0072] Fig. 9A illustrates an example of a training set using a multi-source model containing spatial and gradient terms in LIC.

[0073] Fig. 9B illustrates an example of an inference set using a multi-source model containing spatial and gradient terms in LIC.

[0074] Fig. 10 illustrates a flowchart of an exemplary video coding system that uses filtered predictors with a prediction model including multiple spatial terms and gradient terms according to an embodiment of the present invention.

[0075] Fig. 11 illustrates a flowchart of another exemplary video coding system that uses filtered predictors with a single source or multiple source prediction model according to an embodiment of the present invention.DETAILED DESCRIPTION OF THE INVENTION

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

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

[0078] In the present invention, methods and apparatus of new filtered predictors for IntraTMP, IBC and / or LIC are disclosed to improve the performance.

[0079] A Single Source Model Trained by Spatial Information from Templates for IntraTMP

[0080] In one embodiment, a single source model containing a spatial term is used: y=a0x0+offset,           (3)

[0081] where y is in the current template or the current block, and x0 is the corresponding pixel of y in the reference template or the reference block for training and inference stages, respectively. a0 and offset are parameters of the model. During the training stage, the training dataset contains all the data in the reference and current templates. The pairs of (x0, y) are fed into the model to train the parameters a0 and offset. In the inference stage, the prediction block can be produced by the model with trained parameters a0 and offset when all the pixel values of the current block are fed into the model. As shown in equation (3) , the filtered predictor for IBC is a single-source predictor since only 1 input term (i.e., x0) is used.

[0082] Fig. 5A and Fig. 5B illustrate an example of model training and trained-model prediction respectively for IntraTMP using a single source model containing a spatial term. In Fig. 5A, the current template 512 for the current block 510 and the reference template 522 for the reference block 520 are used to train the model. A prediction model is derived after the training. In other words, a sample, y in the current template can be related to a corresponding sample, x0 in the reference template as shown in Fig. 5A according to equation (3) . After the model is derived, the model is used in the inference stage to prediction a sample, y in the current block according to a corresponding sample, x0 in the reference block as shown in Fig. 5B using equation (3) .

[0083] A Multi-Source Model Trained by Spatial Information from Templates for IBC

[0084] In one embodiment, a multi-source model containing more than one spatial term is used for IBC:

[0085] where y is in the current template or the current block and x0, x1, …, xn are in the reference template or the reference block for training and inference stages, respectively. For the multi-source  model, not only x0, the corresponding reference pixel of the current pixel, but also the neighbouring pixels of x0 are used. For example, the top, bottom, left and right pixels of x0 are also considered to be one of training inputs. In addition, a0, a1, …, an and offset are parameters of the model. During the training stage, the training dataset contains all the data in the reference and current templates. The sets of (x0, x1, …, xn, y) are fed into the model to train the parameters a0, a1, …, an and offset. In the inference stage, the prediction block can be produced by the model with trained parameters a0, a1, …, an and offset when all the pixel values of the current block are fed into the model.

[0086] Fig. 6A and Fig. 6B illustrate an example of model training and trained-model prediction respectively for IBC using a multiple-source model containing multiple spatial terms. In Fig. 6A, the current template 612 for the current block 610 and the reference template 622 for the reference block 620 are used to train the model. A prediction model is derived after the training. In other words, a sample, y in the current template can be related to corresponding samples, x0, x1, …, xn in the reference template as shown in Fig. 6A according to equation (4) . After the model is derived, the model is used in the inference stage to prediction a sample, y in the current block according to corresponding sample, x0, x1, …, xn in the reference block as shown in Fig. 6B using equation (4) .

[0087] A Multi-Source Model Trained by Spatial and Gradient Information from Templates for IntraTMP and IBC

[0088] In one embodiment, a multi-source model containing spatial and gradient terms is used:

[0089] where y is in the current template or the current block and x0, x1, …, xn are in the reference template or the reference block for training and inference stages, respectively. x0 is the corresponding reference pixel of the current pixel y, and x1, …, xn are the neighbouring pixels of x0. g0, g1, …, gm are the gradient terms calculated from the reference pixels.

[0090] In one example, g0 corresponds to vertical gradient and g1 corresponds to horizontal  gradient. For example, a simple vertical gradient can be acquired by calculating the difference between the top and bottom pixels of x0. That is, if x2 is the top pixel of x0 and x7 is the bottom pixel of x0, vertical gradient is x7-x2.

[0091] If a more complicated vertical gradient is needed, it can be generated by ( (x6+x7+x8) - (x1+x2+x3) )  / 3, where x1 is the top left pixel of x0, x2 is the top pixel of x0, x3 is the top right pixel of x0, x6 is the bottom left pixel of x0, x7 is the bottom pixel of x0, and x8 is the bottom right pixel of x0. Accordingly, the vertical gradient in the above examples is

[0092] g0= x7-x2, or

[0093] g0= ( (x6+x7+x8) - (x1+x2+x3) )  / 3.

[0094] For another example, horizontal gradient can be generated by x5-x4 or ( (x3+x5+x8) - (x1+x4+x6) )  / 3 according to users. Here, x1 is the top left pixel of x0, x3 is the top right pixel of x0, x4 is the left pixel of x0, x5 is the right pixel of x0, x6 is the bottom left pixel of x0, and x8 is the bottom right pixel of x0. Moreover, the gradients can be other directions such as diagonal gradient or any angular gradients. Accordingly, the horizontal gradient in the above examples is

[0095] g1= x5-x4, or

[0096] g1= ( (x3+x5+x8) - (x1+x4+x6) )  / 3.

[0097] In addition, the range of usable pixels can depend on the size of CU. For example, the set of xn can be the samples within a k×k block which centres at x0, where k is larger when size of CU is larger.

[0098] For this model, the training dataset contains calculated gradients and the data in the reference and current templates. The sets of (x0, x1, …, xn, g0, g1, …, gm, y) are fed into the model to train the parameters a0, a1, …, an, b0, b1, …, bm and offset. In the inference stage, the prediction block can be produced by the model with trained parameters a0, a1, …, an, b0, b1, …, bm and offset when the pixel values of the current block are fed into the model. The surrounding samples x0, x1, …, x8 in the above examples for IntraTMP or IBC are shown in Fig. 7A, where the current template 712 for the current block 710 and the reference template 722 for the reference  block 720 are used to train the model. Fig. 7B illustrates an example of inference stage corresponding to the training model in Fig. 7A for IntraTMP or IBC. In Fig. 7B, the model trained based on the current template 712 and the reference template 722 are used to predict a sample in the current block 710 based on corresponding samples in the reference block 720.

[0099] In the proposed method, no additional information should be signalled since parameters of the model can be derived by decoder. A model can be ready once the reference template and the current template can be accessed.

[0100] A Multi-Source Model in LIC

[0101] In LIC, a linear model with a scaling factor and an offset is used for inter prediction. To get the better prediction, multi-source models are proposed.

[0102] In one embodiment, a multi-source model containing more than one spatial term is used:

[0103] where y is in the current template, which is the neighbouring sample of the current block, or in the current block and x0, x1, …, xn are in the reference template, which are the neighbouring samples of the reference block, or in the reference block for training and inference stages, respectively. In this model, not only x0, the corresponding reference sample of the current sample y, but also the neighbouring pixels of x0 are used. For example, the top (x1) , bottom (x2) , left (x3) and right (x4) samples of x0 are also considered to be the inputs of the model as shown in Fig. 8A for the training stage and Fig. 8B for the inference stage. In Fig. 8A, the current template 812 for the current block 810 and the reference template 822 for the reference block 820 are shown. In Fig. 8B, the current template 812 for the current block 810 and the reference template 822 for the reference block 820 are shown.

[0104] During the training stage, the sets of (x0, x1, …, xn, y) are fed into the model to train the parameters a0, a1, …, an and offset. In the inference stage, the prediction block can be produced by the model with trained parameters a0, a1, …, an and offset when the pixel values of the current block are fed into the model.

[0105] In another embodiment, a multi-source model containing spatial and gradient terms is used:

[0106] where y is in the current template, which is the neighbouring sample of the current block, or in the current block and x0, x1, …, xn are in the reference template, which are the neighbouring samples of the reference block, or in the reference block for training and inference stages, respectively. x0 is the corresponding reference sample of the current sample y, and x1, …, xn are the neighbouring pixels of x0. g0, g1, …, gm are the gradient terms calculated from reference samples.

[0107] In one example, g0 corresponds to vertical gradient and g1 corresponds to horizontal gradient. For example, the typical gradients such as vertical and horizontal gradients can be acquired easily. When x2 is the top pixel of x0 and x7 is the bottom pixel of x0, vertical gradient is x7-x2. When x4 is the left pixel of x0 and x5 is the right pixel of x0, horizontal gradient is x5-x4. Alternately, a more complicated vertical gradient can be calculated by ( (x6+x7+x8) - (x1+x2+x3) )  / 3 where x1 is the top left pixel of x0, x2 is the top pixel of x0, x3 is the top right pixel of x0, x6 is the bottom left pixel of x0, x7 is the bottom pixel of x0, and x8 is the bottom right pixel of x0. A more complicated horizontal gradient can be generated by ( (x3+x5+x8) - (x1+x4+x6) )  / 3, where x1 is the top left pixel of x0, x3 is the top right pixel of x0, x4 is the left pixel of x0, x5 is the right pixel of x0, x6 is the bottom left pixel of x0, and x8 is the bottom right pixel of x0. Moreover, the gradients can be other directions such as diagonal gradient or any angular gradients. Accordingly, the vertical gradient and horizontal gradient in the above examples are:

[0108] For this model, the training dataset contains calculated gradients and the data in the reference and current templates. The sets of (x0, x1, …, xn, g0, g1, …, gm, y) are fed into the model to train the parameters a0, a1, …, an, b0, b1, …, bm and offset. In the inference stage, the  prediction block can be produced by the model with trained parameters a0, a1, …, an, b0, b1, …, bm and offset when the pixel values of the current block are fed into the model. The surrounding samples x0, x1, …, x8 in the above examples for LIC are shown in Fig. 9A, where the current template 912 for the current block 910 and the reference template 922 for the reference block 920 are used to train the model. Fig. 9B illustrates an example of inference stage corresponding to the training model in Fig. 9A for LIC. In Fig. 9B, the model trained based on the current template 912 and the reference template 922 are used to predict a sample in the current block 910 based on corresponding samples in the reference block 920.

[0109] The proposed multi-source models can be viewed as extended versions of the original design for LIC. The number of the model inputs is expanded without increasing the total number of training data. In other words, the training data still come from the reference and the current templates. Therefore, no additional information will be signalled, and the parameters of the model can be derived by decoder.

[0110] Clipping Operation in the Filter Footprint

[0111] To properly train the multi-source model, the training data should be reliable. Here, a clipping operation is introduced to the multi-source model to reduce the outliers. In other words, the spatial training data should be clipped more for the multi-source model containing than the one spatial term. The spatial and / or gradient training data should be clipped for the multi-source model containing spatial and gradient terms.

[0112] In the proposed method, the intensities of neighbouring samples x1, x2, …, xn are clipped with reference to the intensity of the centre sample x0:

[0113] where xi is the neighbouring sample of x0 and x′i is the clipped value of xi. ths is a threshold that determines whether the intensity of neighbouring sample xi is close to the centre sample x0. While the intensity difference between xi and xo is larger than ths, it identifies that xi and xo are  not similar. Under this situation, the neighbouring sample is clipped within the range of x0-ths to x0+ths. In one embodiment, ths is a predefined value which can depend on sample bit-depth, slice type, CU width / height, prediction direction, and / or quantization parameter. In another embodiment, ths is explicitly signalled at CU level, CTU level, slice level, picture level, or sequence level.

[0114] For the gradient terms, the intensities are clipped by a threshold thg:

[0115] where gj is the gradient term calculated by reference pixels and g′j is the clipped gradient term. thg is a threshold that decides whether the gradient is smooth or sharp. The sharp gradient should be avoided to reduce the fluctuation. Therefore, the gradient is clipped within the range of -thg to thg. In one embodiment, thg is a predefined value which can depend on sample bit-depth, slice type, CU width / height, prediction direction, and / or quantization parameter. In another embodiment, thg is explicitly signalled at CU level, CTU level, slice level, picture level, or sequence level.

[0116] Any of the foregoing proposed filtered predictor methods can be implemented in encoders and / or decoders. For example, any of the proposed filtered predictor methods can be implemented in an inter / intra / predictor derivation module of an encoder, and / or an inter / intra / predictor derivation module of a decoder. Alternatively, any of the proposed methods can be implemented as circuits coupled to the inter / intra / predictor derivation module of the encoder and / or the inter / intra / predictor derivation module of the decoder, so as to provide the information needed by the inter / intra / predictor derivation module. For example, any of the proposed filtered predictor methods can be implemented in an Intra / Inter coding module (e.g. Intra Pred. 150 / MC 152 in Fig. 1B) in a decoder or an Intra / Inter coding module is an encoder (e.g. Intra Pred. 110 / Inter Pred. 112 in Fig. 1A) . Any of the proposed filtered predictor methods can also be implemented as a circuit coupled to the intra / inter coding module at the decoder or the encoder. However, the decoder or encoder may also use additional processing unit to implement the required cross-component prediction processing. While the Intra Pred. 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) ) .

[0117] Fig. 10 illustrates a flowchart of an exemplary video coding system that uses filtered predictors with a prediction model including multiple spatial terms and gradient terms 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 1010, wherein the input data comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side. One or more reference templates for a reference block and one or more current templates for the current block are determined in step 1020. A prediction model for predicting a target current sample in the current block is derived based on reference data in step 1030, wherein the prediction model comprises one or more target reference samples and one or more gradient terms derived from the reference data, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates. A target predictor for the target current sample in the current block is generated according to the prediction model in step 1040. The target current sample in the current block is encoded or decoded using the target predictor in step 1050.

[0118] Fig. 11 illustrates a flowchart of another exemplary video coding system that uses filtered predictors with a single source or multiple source prediction model according to an embodiment of the present invention. According to another method, input data associated with a current block are received in step 1110, wherein the input data comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side. One or more reference templates for a reference block and one or more current templates for the current block are determined in step 1120. A prediction model for predicting a target current sample in the current block is derived based on reference data in step 1130, wherein the prediction model comprises multiple target reference samples if the current block is coded in IBC (Intra Block  Copy) or LIC (Local Illumination Compensation) mode, and the prediction model comprises a single target reference sample if the current block is coded in IntraTMP (intra Template Matching Prediction) mode, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates. A target predictor for the target current sample in the current block is generated according to the prediction model in step 1140. The target current sample in the current block is encoded or decoded using the target predictor in step 1150.

[0119] The flowcharts shown are 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.

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

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

[0122] 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 comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side;determining one or more reference templates for a reference block and one or more current templates for the current block;deriving a prediction model for predicting a target current sample in the current block based on reference data, wherein the prediction model comprises one or more target reference samples and one or more gradient terms derived from the reference data, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates;generating a target predictor for the target current sample in the current block according to the prediction model; andencoding or decoding the target current sample in the current block using the target predictor.2.The method of Claim 1, wherein the current block is coded in IntraTMP (Intra Template Matching Prediction) , IBC (Intra Block Copy) or LIC (Local Illumination Compensation) mode.3.The method of Claim 1, wherein said one or more gradient terms comprise a vertical gradient and a horizontal gradient.4.The method of Claim 1, wherein said one or more target reference samples comprise a corresponding reference sample for the target current sample, a top reference sample, a bottom reference sample, a left reference sample, and a right reference sample of the corresponding reference sample.5.The method of Claim 4, wherein a vertical gradient is calculated according to a first difference between the top reference sample and the bottom reference sample, and a horizontal gradient is calculated based on a second difference between the left reference sample and the right reference sample.6.The method of Claim 4, wherein said one or more target reference samples further comprise a top-right reference sample, a top-left reference sample, a bottom-left reference sample, and a bottom-right reference sample of the target current sample.7.The method of Claim 6, wherein a vertical gradient is calculated according to a first difference between a first sum of the top reference sample, the top-right reference sample and the top-left reference sample and a second sum of the bottom reference sample, the bottom-right reference sample and the bottom-left reference sample, and a horizontal gradient is calculated based on a second difference between a third sum of the left reference sample, the top-left reference sample and the bottom-left reference sample, and a fourth sum of the right reference sample, the top-right reference sample and the bottom-right reference sample.8.The method of Claim 1, wherein said one or more target reference samples or said one or more gradient terms are clipped.9.The method of Claim 8, wherein said one or more target reference samples comprise a corresponding reference sample for the target current sample, intensities of said one or more target reference samples except for the corresponding reference sample are clipped according to a target intensity of the corresponding reference sample.10.The method of Claim 9, wherein the intensities of said one or more target reference samples except for the corresponding reference sample are clipped to a range within a threshold from the target intensity of the corresponding reference sample, wherein the threshold has a positive value.11.The method of Claim 10, wherein the threshold is pre-defined.12.The method of Claim 11, wherein the threshold is dependent on sample bit-depth, slice type, CU width, CU height, prediction direction, quantization parameter, or a combination thereof.13.The method of Claim 10, wherein the threshold is explicitly signalled or parsed at CU level, CTU level, slice level, picture level, or sequence level.14.The method of Claim 8, wherein intensities of said one or more gradient terms are clipped to a range within a threshold from 0, and wherein the threshold has a positive value.15.The method of Claim 14, wherein the threshold is pre-defined.16.The method of Claim 15, wherein the threshold is dependent on sample bit-depth, slice type, CU width, CU height, prediction direction, quantization parameter, or a combination thereof.17.The method of Claim 14, wherein the threshold is explicitly signalled or parsed at CU level, CTU level, slice level, picture level, or sequence level.18.An apparatus for 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 comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side;determine one or more reference templates for a reference block and one or more current templates for the current block;derive a prediction model for predicting a target current sample in the current block based on reference data, wherein the prediction model comprises one or more target reference samples and one or more gradient terms derived from the reference data, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates;generate a target predictor for the target current sample in the current block according to the prediction model; andencode or decode the target current sample in the current block using the target predictor.19.A method of video coding, the method comprising:receiving input data associated with a current block, wherein the input data comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side;determining one or more reference templates for a reference block and one or more current templates for the current block;deriving a prediction model for predicting a target current sample in the current block based on reference data, wherein the prediction model comprises multiple target reference samples if the current block is coded in IBC (Intra Block Copy) or LIC (Local Illumination Compensation) mode, and the prediction model comprises a single target reference sample if the current block is coded in IntraTMP (Intra Template Matching Prediction) mode, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates;generating a target predictor for the target current sample in the current block according to the prediction model; andencoding or decoding the target current sample in the current block using the target predictor.20.An apparatus for 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 comprises pixel data to be encoded at an encoder side or coded data associated with the current block to be decoded at a decoder side;determine one or more reference templates for a reference block and one or more current templates for the current block;derive a prediction model for predicting a target current sample in the current block based on reference data, wherein the prediction model comprises multiple target reference samples if the current block is coded in IBC (Intra Block Copy) or LIC (Local Illumination Compensation) mode, and the prediction model comprises a single target reference sample if the current block is coded in IntraTMP (Intra Template Matching Prediction) mode, and wherein parameters of the prediction model are determined based on said one or more reference templates and said one or more current templates;generate a target predictor for the target current sample in the current block according to the prediction model; andencode or decode the target current sample in the current block using the target predictor.

Citation Information

Patent Citations

  • Encoding method, encoder and computer readable storage medium

    CN115988212A

  • Method and apparatus for video coding

    US20220312004A1

  • Affine prediction improvements for video coding

    US20230107138A1

Cited By

  • Prediction refinement using template area for intra block copy and intra template matching

    WO2026139054A1