Intra-prediction method with side template matching and apparatus incorporating the same
The intra-prediction method optimizes video compression by utilizing side-matching differences to determine the spatial position of edges, improving prediction accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN TCL NEW-TECH CO LTD
- Filing Date
- 2025-01-07
- Publication Date
- 2026-07-16
AI Technical Summary
Existing intra-prediction methods in video compression do not effectively utilize the spatial position of the strongest edge in the template area, leading to inefficiencies in predicting pixel values within blocks.
An intra-prediction method that determines reference areas on either side of a current block, generates angular parameters, and selects a target prediction mode based on side-matching differences to optimize prediction.
Improves the accuracy and efficiency of intra-prediction by considering the spatial position of edges, enhancing video compression performance.
Smart Images

Figure CN2025071121_16072026_PF_FP_ABST
Abstract
Description
INTRA-PREDICTION METHOD WITH SIDE TEMPLATE MATCHING AND APPARATUS INCORPORATING THE SAMETECHNICAL FIELD
[0001] The present disclosure generally relates to encoding and decoding technology, and in particular to an intra-prediction method, a video coding apparatus, and a computer readable medium.BACKGROUND
[0002] Intra-prediction is a key component of video compression techniques. It involves predicting the pixel values in a current block based on the pixel values of previously encoded blocks within the same frame. This process is crucial for achieving high compression efficiency, as it allows for the representation of a block's content with reference to existing data, thereby reducing the need for storing redundant information.
[0003] The traditional intra-prediction modes may depend on directional prediction. This involves predicting pixel values based on the patterns observed in a certain direction within the reference area. For example, angular modes involve prediction in one specific direction, while the planar mode involves prediction in two directions (horizontal and vertical) , essentially using a bilinear interpolation mechanism.
[0004] In existing block-based intra prediction methods, rectangular blocks do not cover the entire edges inside the picture. An edge resides within a predicted block, and also it may prolong outside a block to be predicted.
[0005] In ECM-15, there are two mechanisms that utilizes information about edges in the template area of a predicted block to determine intra prediction direction for this block: these are TIMD, DIMD. Besides, there is a mechanism to split a block into two non-rectangular parts and apply different intra prediction modes inside each of these parts (SGPM) . However, neither of these mechanisms utilizes spatial position of the strongest edge in the template area.SUMMARY
[0006] Accordingly, the present disclosure aims to provide an intra-prediction method, a video coding apparatus, and a computer readable medium.
[0007] A technical scheme adopted by the present disclosure is to provide an intra-prediction method. The method includes: determining one or more reference areas located at a first side of a current block; determining a template area located at a second side of the current block, wherein the first side is an above side of the current block and the second side is a left side of the current block, or wherein the first side is the left side of the current block and the second side is the above side of the current block; acquiring a plurality of angular parameters for intra prediction; generating, from the one or more reference areas, a plurality of predictors on the template area based on the plurality of angular parameters, respectively; comparing the plurality of predictors with reconstructed samples within the template area to acquire a plurality of side-matching differences corresponding to the plurality of angular parameters, respectively; and selecting a target angular parameter with an optimal side-matching difference for prediction of the current block.
[0008] Another technical scheme adopted by the present disclosure is to provide an intra-prediction method. The method may be executed by a decoder. The method includes: receiving, from an encoder, a bitstream; wherein the bitsream comprises a first indication for a list of positive intra prediction modes and a second indication for a target prediction mode; wherein the target prediction mode is determined by comparing a plurality of predictors corresponding to the list of positive intra prediction modes on a template area with reconstructed samples within the template area and selecting one having an optimal side-matching difference.
[0009] Another technical scheme adopted by the present disclosure is to provide a video coding apparatus. The apparatus includes a processor and a memory. The memory is configured to store executable instructions that, when executed by the processor, cause the processor to perform any of the foregoing methods.
[0010] Another technical scheme adopted by the present disclosure is to provide a computer readable medium. The computer readable medium is configured to store executable instructions that, when executed by the processor, cause the processor to perform any of the foregoing methods.BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to clearly explain the technical solutions in the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are merely some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings may also be obtained based on these drawings without any creative work.
[0012] FIG. 1 shows a schematic diagram of a video encoding system.
[0013] FIG. 2 shows a schematic diagram of a video decoding system.
[0014] FIG. 3 shows the prediction process in Planar mode.
[0015] FIG. 4 illustrates directions of several angular prediction modes.
[0016] FIG. 5 illustrates an example of generation (extension) of main reference line.
[0017] FIG. 6 illustrates reference lines and template areas involved in TIMD.
[0018] FIG. 7 illustrates reference lines involved in fusion of TIMD.
[0019] FIG. 8 shows several reference lines used in TMRL.
[0020] FIG. 9 show exemplary definitions of reference samples for applying PDPC to various angular modes.
[0021] FIG. 10 shows a scenario where conventional PDPC cannot be applied.
[0022] FIG. 11 is a flowchart illustrating the rules of PDPC application in angular prediction.
[0023] FIG. 12 shows the decoding process of conventional TIMD.
[0024] FIG. 13 shows the procedure for generating predictors on the templates.
[0025] FIG. 14 illustrates the process for determining VIPM based on the partition mode in SGPM.
[0026] FIG. 15 give a part of BlowingBubbles sequence for QP32 with partitioning information.
[0027] FIG. 16 shows potential spatial position of an edge area with respect to the current block.
[0028] FIG. 17 is a flowchart of an intra-prediction method according to an embodiment of the present disclosure.
[0029] FIG. 18 illustrates the proposed template matching operation for an adjacent reference line.
[0030] FIG. 19 illustrates the proposed template matching operation for a non-adjacent reference line.
[0031] FIG. 20 shows the usage of more than one lines in template matching operation.
[0032] FIG. 21 shows the process for estimating the gradient difference of a predictor using the SAD metric.
[0033] FIG. 22 is the flowchart for constructing a predictor and obtaining its corresponding template matching costs.
[0034] FIG. 23 shows an example of the refinement step of the angular parameter angParam.
[0035] FIG. 24 shows the flowchart of arbitrary angle intra prediction using side matching operation.
[0036] FIG. 25 illustrates the flowchart for refinement of intra prediction direction obtained by TIMD.
[0037] FIG. 26 illustrates the flowchart for selection of fusion intra prediction modes with refinement process.
[0038] FIG. 27 is a flowchart of an intra-prediction method according to an embodiment of the present disclosure.
[0039] FIG. 28 shows an intra prediction mode signaling mechanism with template side matching.
[0040] FIG. 29 shows a design of TMRL improvement using side matching cost.
[0041] FIG. 30 is a schematic diagram of an apparatus for encoding or decoding according to an embodiment of the present disclosure.DETAILED DESCRIPTION
[0042] The disclosure will now be described in detail with reference to the accompanying drawings and examples. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] In the context of video compression, color image or a frame of a color video usually consists of three color components, namely a luma component Y and two chroma components Cb and Cr. Each component is represented as a data matrix. The data matrix for each component is decomposed into blocks associated with specific encoding parameters. A block is usually a square or rectangle whose dimensions are integer powers of 2. The coding of an image is processed in raster scanning order: from left to right, then from top to bottom. Within a specific block or a plurality of blocks, luma component is usually coded before chroma components.
[0044] Popular video coding standards such as Versatile Video Coding (VVC) uses a prediction / transform hybrid coding framework. Prediction refers to predicting current block (i.e., the block to be coded) using coded blocks or coded areas within the same frame (i.e., intra prediction) or from a different frame (i.e., inter prediction) . When performing intra or inter prediction, the encoder tries multiple intra prediction modes available to the coding standard, computes and compares corresponding prediction blocks and chooses the best prediction mode. The difference between original current block and the prediction block generated by the chosen prediction mode, namely the residual, will also be coded. By transmitting prediction modes and residuals only, the encoder is able to instruct the decoder to decode and reconstruct the original image or video or its approximation.
[0045] The present disclosure relates generally to the field of picture coding and specifically, to the improvement of intra and inter block prediction techniques. The scope of the present disclosure includes but is not limited to predicting a block in a video coding process by processing samples of a reference area and using the results of this processing as a predictor.
[0046] The present disclosure relates to both a method and a device of intra prediction, and the embodiments of this invention may be applied in combination with other intra prediction methods as well as implemented as a hardware or a software module.
[0047] To help understand the technical solutions proposed in the embodiments of this application, a brief introduction of video encoding and decoding system will be provided below.
[0048] As shown in FIG. 1, a video encoding system 110 may include multiple modules, such as block partitioning unit 1101, transform and quantization unit 1102, intra-frame estimation unit 1103, intra-frame prediction unit 1104, motion compensation unit 1105, motion estimation unit 1106, an inverse transformation and inverse quantization unit 1107, a filter control analysis unit 1108, a filtering unit 1109, an encoding unit 1110, an encoded image buffer unit 1111 and a subtractor 1112.
[0049] Original video signals include video frames. Each video frame is divided into blocks by a block partitioning unit 1101. For each of the video frames, the subtractor 1112 generates residual pixel information about a residual frame by subtracting the input video frame from the output of the intra-frame prediction unit 1104 or the motion compensation unit 1105. The residual pixel information obtained after intra-frame prediction or inter-frame prediction (motion compensation) , is transformed by the transformation and quantization unit 1102. The transformation includes transforming the residual pixel information from the pixel domain to a transform domain, and the resulting transform coefficients are quantized to further reduce the bit rate. The intra-frame estimation unit 1103 performs intra-frame estimation, and the intra-frame prediction unit 1104 performs intra-frame prediction on the video reconstructed blocks. Motion estimation performed by the motion estimation unit 1106 is a process of generating a motion vector that can estimate the displacement of the reconstructed video block, and then motion compensation is performed by the motion compensation unit 1105 based on the determined motion vector. After determining an intra-frame prediction mode, the intra-frame prediction unit 1104 provides selected intra-frame predicted data to the encoding unit 1110, and the motion estimation unit 1106 also sends calculated motion vector data to the encoding unit 1110. The inverse transform and inverse quantization unit 1107 reconstructs the video reconstructed blocks and reconstructs a residual block in the pixel domain, and the filtering unit 1109 is controlled by the filter analysis unit 1108 to remove the blocking artifacts in the reconstructed residual block, and the encoding unit 1110 adds the reconstructed residual block to the prediction block of the encoded image buffer unit 1111 to generate a reconstructed block. The encoding unit 1110 is used for encoding various encoding parameters and quantized transform coefficients (quantized transform coefficients) into bitstream, and outputs the bitstream of the video signals. The encoded image buffer unit 1111 is used for storing reconstructed blocks as the reference blocks for intra-frame prediction. As the video image encoding progresses, new reconstructed blocks are continuously generated, and these blocks are stored in the encoded image buffer unit 1111.
[0050] As shown in FIG. 2, a video decoding system 120 may include multiple modules such as a decoding unit 1201, an inverse transform and inverse quantization unit 1202, an intra-frame prediction unit 1203, a motion compensation unit 1204, a filtering unit 1205, a decoded image buffer unit 1206 and a post filtering unit 1207.
[0051] The input signals of video frames are encoded by the video encoding system 110 to obtain an output bitstream. The video encoding system 110 transmits the bitstream to the video decoding system 120. The video decoding system 120 receives the bitstream representing the video frames in an encoded format (i.e., in a compressed format) . In the video decoding system 120, the bitstream is processed by the decoding unit 1201 to obtain decoded transform coefficients. The inverse transform and inverse quantization unit 1202 process the transform coefficients to generate a residual block in the pixel domain. The intra-frame prediction unit 1203 is operable to generate an intra-frame prediction block for a current video decoding block based on a determined intra-frame prediction mode and data from previously decoded blocks of the current video frame or picture. The motion compensation unit 1204 determines the inter-frame prediction information for the current video decoding block and generates an inter-frame prediction block by parsing the motion vector and other associated syntax elements. Finally, the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 1202 and the corresponding prediction block generated by the intra-frame prediction unit 1203 or the motion compensation unit 1204. In order to improve video quality, the decoded video blocks are filtered through the filtering unit 1205 to remove blocking artifacts. The decoded video block is then stored in the decoded image buffer unit 1206 as the reference block for subsequent intra-prediction or motion compensation, and for video output, i.e., to reproduce and reconstruct the original video signals. The output video can be optionally further processed by a post filtering unit 1207 for more suitable or enhanced viewing experiences.
[0052] Embodiments of the present disclosure are mainly used for the intra-frame prediction unit 1104 of the video encoding system 110 and the intra-frame prediction unit 1203 of the video decoding system 120. If a better prediction effect can be obtained in the video encoding system 110 through the intra-frame prediction method provided by the embodiments of the present disclosure, then the quality of video decoding and reconstruction can also be improved. The video decoding system 120 receives the bitstream representing the video frames. The bitstream includes the luma component of the video frame. The intra-frame prediction unit 1203 of the video decoding system 120 can thus obtain the luma component of the reference blocks and the luma component of the current block and calculate the Hamming difference and the weights accordingly. The intra-frame prediction unit 1203 can perform the same intra-frame prediction method as the intra-frame prediction unit 1104.
[0053] Introduction for several related technologies of the present disclosure will be given below, including: 1) Regular intra prediction modes; 2) Template-based Intra Mode derivation (TIMD) and TIMD fusion; 3) TIMD fusion with non-angular predictor; 4) Intra-prediction fusion of TIMD mode; 4) Intra prediction fusion of TIMD mode; 5) Template-based multiple reference line intra prediction; 6) Position-dependent Intra Prediction Combination (PDPC) ; 7) Gradient PDPC; 8) Decoder side intra mode derivation (DIMD) ; 9) Occurrence-based intra coding (OBIC) ; 10) Low Frequency Non-Separable Transform (LFNST) set selection; 11) Decoding process of existing technologies. ● Regular intra prediction modes
[0054] In H. 266 / VVC and ECM, regular intra prediction modes (IPM) refer to three types of intra prediction modes that directly use neighbouring coded samples as reference samples to generate predictors. Theses prediction modes have been supported since H. 264 / AVC. These modes include: Planar mode; DC mode; and Angular modes.
[0055] In Planar mode, as shown in FIG. 3 the predicted sample at location S= (x, y) of a W×H block is the weighted average of four reconstructed samples, which includes: two orthogonal projections from (x, y) to the above reference line A=R (x, -1) and to the left reference line B=R (-1, y) ; one reference sample on the above reference line, located to the top-right of the block C=R (W, -1) ; one reference sample on the left reference line, located to the bottom-left of the block D=R (-1, H) .
[0056] The Planar mode prediction function is: Pred (x, y) = [Ph (x, y) ·H+Pv (x, y) ·W+W·H] >> (log2 W+log2 H+1) Ph (x, y) = (W-x-1) ·B+ (x+1) ·C Pv (x, y) = (H-y-1) ·A+ (y+1) ·D x∈ [0, W-1] , y∈ [0, H-1]
[0057] In DC mode, every sample in the prediction block is filled with the average value of the reference samples to the left and / or above the current block.
[0058] If W>H, DC value is the average value of reference samples at the top of the current block.
[0059] If W<H, DC value is the average value of reference samples to the left of the current block.
[0060] If W=H, DC value is the average value of reference samples at the top or to the left of the current block.
[0061] In the above formulas, W and H are the width and height of the current block, respectively.
[0062] Angular modes are directional prediction modes that draw samples from reference lines and propagate these samples in respective angles. In VVC and ECM, angular modes have 65 directions, coded as mode numbers 2 to 66, as shown in FIG. 4. As for Template-based Intra Mode Derivation (TIMD) in ECM, which is to be introduced below, one more direction is inserted between each pair of neighbouring directions, resulting in 129 directions, represented as mode numbers 2 to 130.
[0063] Mode 34 in IPM or mode 66 in TIMD is the ‘diagonal’ mode, as the prediction direction points exactly to the northwest. For mode numbers greater than diagonal mode, the above reference line is the main reference line and the left reference line is the secondary reference line. Samples in the secondary reference line are warped as an extension of the main reference line according to the prediction direction before predictor generation is processed. For mode numbers smaller than diagonal mode, the roles of above reference line and left reference line are reversed. To generate predictors, the image is first transposed. The computations are processed using the ‘mirrored’ mode number: 68-x for regular IPM or 132-x for TIMD, x is the original mode number. The output predictor is transposed back.
[0064] For modes greater than or equal to diagonal mode: Mode 50 in IPM or mode 98 in TIMD is the ‘vertical’ mode, as the prediction direction points upwards; Mode numbers greater than vertical mode are referred to as ‘positive’ modes, while mode numbers smaller than vertical mode are referred to as ‘negative’ modes.
[0065] For modes smaller than diagonal mode, the sign of that mode is equal to its mirrored mode. In summary, the signs of angular modes are as follows: in IPM, modes 2 to 17 and modes 51 to 66 are positive; modes 19 to 49 are negative; in TIMD, modes 2 to 33 and modes 99 to 130 are positive; modes 35 to 97 are negative.
[0066] In VVC and ECM, key procedures for computation of predicted samples using angular modes include: 1) generating a vector of reference samples as the main reference line; 2) finding the indices of reference samples on the main reference line and the interpolation filter based on the location of sample to be predicted and the prediction angle. For the first step, samples in the main reference line can be: reconstructed samples located on chosen reference line, which is either the above or the left reference line based on the angular mode number; padding via copying existing samples on main reference line; warping the reconstructed samples located on the reference line other than the chosen line into virtual locations of the main reference line by interpolation. An example is given in FIG. 5. For the second step, a fractional number corresponding to the ratio of the change of reference sample location and the distance from the sample to be predicted and the reference line is available in the look-up table indexed by the prediction mode number.
[0067] For a 1 / 32-sample precision of intra prediction (when a total of 66 regular intra prediction modes are used) , the following lookup table (Table 1) is used to determine this displacement: Table 1
[0068] For a 1 / 64-sample precision of intra prediction (when a total of 66 regular intra prediction modes are used) , the following lookup table (Table 2) is used to determine this displacement: Table 2
[0069] The index Δmode in this table is determined based on directional intra prediction mode m as follows.
[0070] For a 1 / 32-sample precision of intra prediction (when a total of 66 regular intra prediction modes are used) , MHOR=18, MVER=50, MDIA=34.
[0071] For a 1 / 64-sample precision of intra prediction (when a total of 131 regular intra prediction modes are used) , MHOR=34, MVER=98, MDIA=66.
[0072] Sign s is determined as follows:
[0073] When m≥MDIA, prediction is performed row-wise, and subsample displacement Δ of a reference sample with respect to the predicted sample is obtained as follows: Δ=s·angParam· (y+ridx+1) where y∈ [0, H-1] is the index of predicted row, ridx is the index of a reference line.
[0074] When m<MDIA, prediction is performed column-wise, and subsample displacement Δ of a reference sample with respect to the predicted sample is obtained as follows: Δ=s·angParam· (x+ridx+1) where x∈ [0, W-1] is the index of predicted column, ridx is the index of a reference line.
[0075] Integer and fractional displacements are obtained from a subsample displacement as follows: Δfrac=Δ mod p where p is a number of subsample positions per 1-sample distance. p=32 for 1 / 32-sample precision; p=64 for 1 / 64-sample precision.
[0076] The fractional reference sample location is decomposed into an integer part indicating the index of reference sample and a fractional part indicating the set of interpolation filter coefficients. The predicted values may be computed based on one or several reference samples and the coefficients of the interpolation filter.
[0077] Multiple reference lines (MRL) can be adopted for angular modes. In MRL, the reference lines are shifted upwards and leftwards by n lines when reference line index iRL=n. By denoting the coordinates of the top-left sample of the current block as (0, 0) , the coordinates for the above reference line and the left reference line are yRef=- (iRL+1) and xRef=- (iRL+1) , respectively. ● Template-based Intra Mode Derivation (TIMD) and TIMD fusion
[0078] A template-based intra mode derivation (TIMD) method approach was proposed in JVET-V0098. The use of TIMD to implicitly derive an intra prediction mode for a current block 300 is shown in FIG. 6. As depicted, the neighbouring areas of the current block 300 serve as a template 310. One of these areas are above the current block and the other one is to the left of the current block. A cost, denoted as template matching (TM) cost, is calculated based on a difference (e.g., Sum of Absolute Transformed Differences -SATD) between the prediction and the reconstructed samples of the template. The intra prediction mode with the minimum TM cost is selected and used for intra prediction of the Coding Unit (CU) . For each candidate intra prediction mode, prediction samples of the template are generated using the reference samples, which are in the reference line 320 of template, positioned above and to the left of the template 310. The candidate is constructed from the most probable modes (MPM) list, and the candidate modes can be 67 intra prediction modes as in VVC or extended to the larger set of intra prediction modes (e.g., the set of 131 intra prediction modes) available to TIMD.
[0079] In other words, the prediction samples of the template can be considered as the TIMD template predictor. It calculates the prediction results only on the template area, and the intra prediction mode represented by this template predictor is eventually selected and used for intra prediction of the CU.
[0080] A flag is signalled in sequence parameter set (SPS) to enable / disable TIMD. When the flag is true, a CU level flag is signalled to indicate whether TIMD is used for the current block. If the TIMD flag is true, the remaining syntax elements related to regular intra prediction mode are skipped. TIMD is allowed to be combined with intra sub-partitions (ISP) and multiple reference line (MRL) . When TIMD is combined with ISP or MRL and the TIMD flag is true, the derived TIMD mode is used as the intra prediction mode for ISP or MRL.
[0081] Instead of selecting the only one mode with the smallest TM cost, TIMD fusion was proposed to choose the first two intra prediction modes with the smallest TM costs for the intra modes derived using TIMD method and then compute a final predictor based on a weighted average of each prediction.
[0082] Whether to enable TIMD fusion is based on the judgment that the costs of the two selected modes (IPM1 and IPM2) are compared with a threshold. For example, the cost factor of 2 is applied as follows: cost2<2·cost1 where cost1 and cost2 are the TM costs of the two selected modes.
[0083] If this condition is true, the fusion is applied, and the weights of the modes are computed from their TM cost as follows: w1=cost2 / (cost1+cost2) w2=1-w1
[0084] Otherwise, the only IPM1 is used as the TIMD mode.
[0085] More details can be obtained from: 1) ” Y. Wang, L. Zhang, K. Zhang, Z. Deng and N. Zhang, EE2-related: Template-based intra mode derivation using MPMs, document JVET-V0098, Joint Video Experts Team (JVET) , Apr. 2021” ; 2) ” K. Cao, N. Hu, V. Seregin, M. Karczewicz, Y. Wang, K. Zhang, L.Zhang, EE2-related: Fusion for template-based intra mode derivation, document JVET-W0123, Joint Video Experts Team (JVET) , Jul. 2021” . ● TIMD fusion with non-angular predictor
[0086] In addition to fusing the first two intra prediction modes, the non-angular intra mode IPM3 is also included in the TIMD fusion process. The non-angular intra mode IPM3 is firstly selected from DC mode and Planar mode with the lowest TM cost and added to the TIMD fusion process if the IPM3 is different from the two selected TIMD intra modes (IPM1 and IPM2) . Whether to enable this TIMD fusion with non-angular intra mode is also based on a judgment of TM costs. For example, the cost factor of 1.5 is applied as follows: cost3<1.5·cost1 where cost1 and cost3 are the TM costs of IPM1 and IPM3.
[0087] If this condition is true, the fusion with non-angular intra mode is applied. The weights wi used during the TIMD fusion process are computed from their TM cost:
[0088] In addition to fusion with block-wise weights, location-dependent sample-based blending is also supported where the selection of location-dependent weights depends on a ratio of the normalized TM cost of the selected TIMD predictors computed in ABOVE and LEFT templates area.
[0089] More details can be obtained from: “P. Andrivon, M. Blestel, EE2-1.20: TIMD fusion with non-angular predictor, document JVET-AG0092, Joint Video Experts Team (JVET) , Jan. 2024” . ● Intra prediction fusion of TIMD mode
[0090] Proposal JVET-AB0157 ( “EE2-1.12: Combination of EE2-1.10 and EE2-1.11” ) and JVET-AB0148 ( “EE2-1.11: Intra prediction fusion” ) includes description of an intra prediction method that uses a linear combination of two intra predictors that were obtained for the same intra prediction mode but for different reference lines.
[0091] Particularly, if the angular intra prediction modes including the single mode which is derived from TIMD mode, the proposed method derives intra prediction by weighting intra predictions obtained from multiple reference lines represented as pfusion=w0pline+w1pline+1, where pline is the intra prediction from the primarily reference line and pline+1 is the prediction from the line above the primarily reference line. The weights are set as w0=3 / 4 and w1=1 / 4.
[0092] For two intra prediction modes which are derived from TIMD fusion, pline is used for the first mode IPM1 (w0=1, w1=0) and pline+1 is used for the second mode IPM2 (w0=0, w1=1) .
[0093] The primary reference line (also noted as reference line 0) is adjacent to the current block, and the secondary reference line is above / left to the primary reference line, as shown in FIG. 7.
[0094] More details can be obtained from: “H. Wang, V. Seregin, M. Karczewicz, EE2-1.11: Intra prediction fusion, document JVET-AB0148, Joint Video Experts Team (JVET) , Oct. 2022” . ● Template-based multiple reference line intra prediction
[0095] Template-based multiple reference line intra prediction (TMRL) mode combines reference line and prediction mode together and uses a template matching method to construct a list of candidate combinations. An index to the candidate combination list is coded to indicate which reference line and prediction mode is used in coding the current block. The regular multiple reference line (MRL) for the non-TIMD part is replaced with TMRL mode.
[0096] The TMRL mode extends reference line candidate list and the intra-prediction-mode candidate list. The extended reference line candidate list is {1, 3, 5, 7, 12} . The size of the intra-prediction-mode candidate list is 10. The construction of the intra-prediction-mode candidate list is similar to MPM except the planar mode is excluded from the intra-prediction-mode candidate list, DC mode is added after 5 neighboring PUs’ modes and DIMD modes if its not included and the angular modes with delta angles from ±1 to ±4 (compared the existing angular modes in the intra-prediction-mode candidate list) are added. The precision of angular prediction is extended from 65 to 129. Additionally non-adjacent positions are added as candidates in constructing the intra candidate list. If the neighbouring or non-adjacent blocks are coded with SGPM or GPM modes, the intra modes of the blocks are replaced by the partitioning angles.
[0097] The TMRL candidate is constructed as follows. There are 5x10=50 combinations of the extended reference line and the allowed intra-prediction modes for a block. Since the extended reference line starts from reference line 1, the area covered by reference line 0 is used for template matching. The SAD costs over the template area (see FIG. 8) are calculated between the predictions (generated by 50 combinations) and the reconstructions. The 20 combinations with the least SAD cost are selected in an ascending order to form the TMRL candidate list.
[0098] For TMR signalling instead of coding the reference line and the intra mode directly, an index to the TMRL candidate list is coded to indicate which combination of reference line and prediction mode is used for coding the current block. ● Position-dependent Intra Prediction Combination (PDPC)
[0099] In VVC and in recent studies towards future video coding standards, the result of intra prediction modes (DC, planar, and several angular modes) are further modified by a position-dependent intra prediction combination (PDPC) method. The basic idea of PDPC is combining an original intra-predicted block with values from its neighbouring reference samples along the intra-prediction direction from an opposite boundary.
[0100] The final prediction sample Pred (x′, y′) is generated by Pred0 (x′, y′) , which is predicted with an intra prediction mode (DC, planar, angular) and a linear combination of the boundary reference samples according to the following equation: Pred (x′, y′) = (ωL×R (-1, y) +ωT×R (x, -1) -ωTL×R (-1, -1) + (64-ωL-ωT+ωTL) ×Pred0 (x′, y′) +32) >>6
[0101] In the formula, R (-1, y) and R (x, -1) are the reference samples located at the top and left boundaries of the current sample (x′, y′) , respectively, and R (-1, -1) is the reference sample located at the top-left corner of the current block. ωL, ωT and ωTL are the weights for the reference samples R (-1, y) R (x, -1) and R (-1, -1) , respectively. The PDPC weights and scale factors can depend on prediction modes and the block sizes. The PDPC weights for the reference sample are calculated by: ωT=32>> ( (y<<1) >>nScale) ωL=32>> ( (x<<1) >>nScale) nScale=min (2, log2 (H) -floor (log2 (3×invAngle-2) ) +8) where W and H are the width and height of current block.
[0102] PDPC is always applied to the following intra modes without signaling: planar, DC, horizontal, vertical, and angular modes with positive angles (modes with mode number less than 18 or greater than 50) .
[0103] In PDPC for DC mode and Planar mode, the coordinates of boundary reference samples R (-1, y) and R (x, -1) are on the same row and the same column as the current sample (x′, y′) , respectively, or in other word, R (-1, y′) and R (x′, -1) are used. ωTL is set to 0 (ωTL=0) .
[0104] In PDPC for angular modes, if the current angular mode is horizontal or vertical, left or top reference samples may not be used, respectively. If the current angular mode is horizontal mode, ωT is equal to ωTL (ωT=ωTL) . As to vertical mode, ωL is equal to ωTL (ωL=ωTL) . For other angular modes, ωTL is equal to 0 (ωTL=0) .
[0105] FIG. 9 (a) to (d) show exemplary definitions of reference samples R (-1, y) and R (x, -1) for applying PDPC to various angular modes. The prediction sample Pred (x′, y′) is located at (x′, y′) within a prediction block. R (-1, y) , R (x, -1) , and R (-1, -1) represent the reference samples located at the left, top, and top-left of the prediction block, respectively.
[0106] FIG. 9 (a) shows a top-right diagonal mode PDPC. FIG. 9 (b) shows a bottom-left diagonal mode of the PDPC. FIG. 9 (c) shows an adjacent diagonal top-right mode of the PDPC. FIG. 9 (d) shows an adjacent diagonal bottom-left mode of the PDPC. In an example, such as shown in FIG. 9 (a) , the coordinate x of the reference sample R (x, -1) can given by: x=x′+y′+1, and the coordinate y of the reference sample R (-1, y) can be given by: y=x′+y′+1.
[0107] For other angular modes, such as shown in FIG. 9 (c) and (d) , the reference samples R (-1, y) and R (x, -1) are located in a fractional sample position. When the reference samples R (-1, y) and R (x, -1) are located in a fractional sample position. the sample value of a nearest integer sample location is used.
[0108] PDPC can be applied to a block with both a width and a height greater than or equal to 4. Additionally, if the current block is using block-based delta pulse code modulation (BDPCM) mode, PDPC is not applied. If the current block is using a multiple reference line (MRL) intra prediction mode and the MRL index is larger than 0, PDPC is not applied. ● Gradient PDPC
[0109] For some scenarios, the traditional PDPC may not be applied due to the unavailability of the secondary reference samples. The encoder and decoder may alternatively compute PDPC for angular modes using gradient based PDPC.
[0110] Whether to apply PDPC is not checked explicitly for every pixel. Instead, a video coder modifies the factor nScale to be derived from the prediction direction (invAngle) and block size, which automatically specifies the PDPC range or the region where PDPC should be applied. As a consequence, when nScale<0, PDPC is not applied (which is shown in FIG. 10, for a given prediction direction for bottom-left sample Pred (x′, y′) inside prediction block) , because the diagonally opposite reference pixel is not available. In this case, gradient PDPC can be applied to replace the traditional PDPC.
[0111] To perform gradient PDPC, video encoder or video decoder may compute the intensity variation or “gradient” along the prediction direction, as shown by arrow in FIG. 10. For a sample at position (x, y) , video encoder and decoder can fetch a value of horizontally-aligned reference sample R (-1, y) , from the left reference line of current block. To compute the gradient along this prediction direction and offset (astraight line with the same slope as the prediction direction and containing sample R (-1, y) , the encoder and decoder may derive a value for the corresponding pixel in the top reference line, e.g., reference sample R (-1+d, -1) , where d is the horizontal displacement depending on the angular direction. The gradient term can be calculated as R (-1, y) -R (-1+d, -1) .
[0112] In some examples, the values of d are derived in 1 / 32 -pixel accuracy (for integer implementation, d should be a multiple of 32) . The integer (dInt) and fractional (dFrac) of d can be derived using: dInt=d>>5 dFrac=d&31
[0113] Two tap (linear) filtering can be applied when d is at fractional position, then R (-1+d, -1) is computed as: R (-1+d, -1) = (32-dFrac) ×R (-1+dInt, -1) +dFrac×R (-1+dInt+1, -1)
[0114] This 2-tap filtering is performed once per row. Finally, the prediction sample is computed: Pred (x′, y′) = (ωL (x) × (R (-1, y) -R (-1+d, -1) ) + (64-ωL (x) ) ×Pred0 (x′, y′) +32) >>6 where Pred0 (x′, y′) is the predicted value before applying gradient PDPC.
[0115] FIG. 11 is a flowchart illustrating the rules of PDPC application in angular prediction. Both PDPC and gradient PDPC are supported in the derivation of the TIMD mode following the same rules. ● Decoder-side intra mode derivation (DIMD)
[0116] Decoder side intra mode derivation (DIMD) mode is an intra prediction method which derives one or several intra modes from the reconstructed neighbouring samples (e.g., luma samples) of current block. DIMD involves performing a gradient analysis on the reconstructed neighbouring samples. The neighbouring area has an L-shape and is 3 samples wide. When DIMD is used for the current block, both the encoder and decoder calculates horizontal and vertical gradients within the neighbouring area to construct the histogram of gradients (HoG) . These up to five predictors with the highest bin of the histogram are selected and then are combined with the planar mode or block vector-based predictor, with weights derived from the HoG.
[0117] An intra direction corresponding to each pair of determined horizontal and vertical gradients Gx and Gy is determined as follows:
[0118] An intra prediction mode is obtained from the angle Θ (e.g., one of the 67 intra prediction modes defined in the H. 266 VVC standard) . A magnitude “G ” for the pair of gradients and the corresponding intra prediction mode is determined as follows: |G|=|Gx| + |Gy|
[0119] When constructing a HoG, a bin of the histogram to be updated is obtained by taking the value of the determined intra prediction mode, and the height of the bin (i.e., a value associated with this bin) is updated using the determined magnitude |G|.
[0120] The DIMD is signaled in the bitstream for intra coded blocks using a flag. At the decoder, if the DIMD flag is true, the intra prediction mode is derived by the gradient analysis described above. If not, the following intra prediction mode will be parsed from the bitstream. ● Occurrence-based intra coding (OBIC)
[0121] The occurrence-based intra coding (OBIC) was proposed in JVET-AH0076. OBIC derives the intra prediction modes of the current block based on the sample-wise occurrence of the intra modes in its spatial neighbourhood. The spatial neighbourhood includes both adjacent and non-adjacent blocks, and the intra prediction modes of these blocks are collected to construct an occurrence histogram. Unlike DIMD, which uses HoGs, the OBIC method constructs the Histogram of Occurrences, which consists of intra modes and their sample-wise occurrences. The occurrence values are calculated based on the number of samples that are coded in a certain intra prediction mode in that neighbouring block. For example, if a block is coded with the mode IPMi, the occurrence histogram for that mode will be updated as: O[IPMi] =O [IPMi] +Wk×Hk
[0122] In the formula, Wk and Hk are the width and height of a spatial neighbouring block k. The occurrences of the existing modes from the spatial neighbourhood blocks are accumulated into the histogram.
[0123] Up to five angular modes with the highest occurrence, along with the planar mode or block vector-based prediction (same as in DIMD) , are selected from the histogram and used for final prediction by blending the prediction of the selected modes. Some blocks use more than one intra mode for prediction. In such cases, all the intra modes of these blocks are selected and included when creating the OBIC histogram: for DIMD, up to 5 angular modes; for TIMD, up to 2 modes; for SGPM, 2 modes; for OBIC, up to 5 angular modes.
[0124] Moreover, the virtual intra prediction modes (VIPMs) of following blocks are considered only in inter slices when creating the histogram of OBIC mode: MIP block, Intra TMP block, EIP block.
[0125] The OBIC mode is used as a sub-mode of DIMD and is applied to only luma blocks. Moreover, the mode is disabled for blocks that have less than 64 samples.
[0126] More details can be obtained from: “R. G. Youvalari, M. Abdoli, A. Tissier, EE2-2.2: Occurrence-based intra coding (OBIC) , document JVET-AH0076, Joint Video Experts Team (JVET) , Apr. 2024” . ● Low Frequency Non Separable Transform (LFNST) set selection
[0127] LFNST is a secondary transform tool which performs matrix multiplication on the transform coefficients of intra-coded blocks after a primary transform in order to further concentrate the residuals to fewer number of coefficients. On the encoder side, LFNST is applied between the forward primary transform and quantization. Correspondingly, on the decoder side, the inverse LFNST is applied between the inverse primary transform and dequantization.
[0128] In the LFNST design, the LFNST set and LFNST transpose flag are both determined by the intra prediction mode (predModeIntra) of the current transform block.
[0129] In ECM-13.0, there are 35 LFNST sets and 3 transform matrices (kernels) per set, and the LFNST set (lfnstTrSetIdx ) for a given intra mode (predModeIntra ) is derived according to the following formula:
[0130] The LFNST transpose flag determines the scan order of the LFNST output. The LFNST transpose flag is determined by predModeIntra as: 1) if predModeIntra is less than or equal to 34, the LFNST transpose flag is set to 0; 2) else, the LFNST transpose flag is set to 1.
[0131] For blocks using MIP or IntraTMP prediction, the index of LFNST set is derived as follows. DIMD is used to derive the intra prediction mode of the current block based on the MIP or IntraTMP predicted samples. For MIP, this is done before upsampling. Specifically, a horizontal gradient and a vertical gradient are calculated for each predicted sample to build a HoG. Then the intra prediction mode with the largest histogram amplitude values is used to determine the LFNST transform set and LFNST Transpose flag.
[0132] Exemplary mapping from intra prediction modes to LFNST sets used in ECM-14 is shown in Table 3. Table 3 Mapping of intra prediction modes to LFNST set index
[0133] More details can be obtained from: “M. Coban, R. -L. Liao, K. Naser, J. L. Zhang, Algorithm description of Enhanced Compression Model 13 (ECM 13) , document JVET-AI2025, Joint Video Experts Team (JVET) , Apr. 2024” . ● Decoding process of related technologies
[0134] As for the decoding process of TIMD, the decoding process of conventional TIMD is shown in FIG. 12.
[0135] In step 2101, obtain the most probable modes (MPM) list by checking the coded blocks in the neighbourhood of the current block.
[0136] In step 2102, generate predictors on the templates with each IPM in the MPM list.
[0137] In step 2103, evaluate template costs based on the generated predictors for each IPM in the MPM list.
[0138] In step 2104, obtain 1 to 3 IPMs with the lowest template costs.
[0139] In step 2105, generate predictor for the current block using the IPMs obtained.
[0140] Specifically, in step 2102, for each IPM, the procedures for generating predictors on the templates can be further decomposed into three steps as shown in FIG. 13.
[0141] In step 2201, obtain templates and corresponding reference samples. Within the same MPM list, this step is identical for each IPM and results from one execution should be able to serve all IPMs.
[0142] In step 2202, generate predictor on the templates with the IPM under consideration.
[0143] In step 2203, apply PDPC on the predictor generated in step 2202 if PDPC is applicable.
[0144] As for the decoding process of virtual intra prediction mode in TIMD and SGPM, virtual intra prediction mode (VIPM) is a valid IPM index to be provided when a block is checked for the IPM index but is not coded in regular IPM. VIPM can be used as: an index for obtaining the LFNST transform matrix set to be used for coding the residuals of the corresponding block; or the IPM to be provided when the coding of subsequent blocks enquires the prediction mode of the current block. For example, in OBIC, when the IPM of a location coded by SGPM is enquired, VIPM should be used as if that location were coded in that IPM.
[0145] In SGPM, VIPM is determined based on the partition mode, as shown in FIG. 14.
[0146] In step 2301, decode SGPM to obtain the partition mode.
[0147] In step 2302, derive VIPM from a lookup table based on the partition mode in SGPM.
[0148] In TIMD with fusion, the VIPM is the first mode in the TIMD mode list.
[0149] The existing intra-prediction methods may have several limitations as described below.
[0150] One potential issue is distinct reference used for prediction in template and predicted block. In existing block-based intra prediction methods rectangular blocks do not cover the entire edges inside the picture. An edge resides within a predicted block, and also it may prolong outside a block to be predicted. As shown in FIG. 15, a strong edge could be noticed. It is not straight and there’s a background (tiled wall) . The part of a picture that contains the edge is split by the encoder to a multiple of blocks. Almost each of these blocks has an edge in its template area.
[0151] In ECM-15, there are two mechanisms that utilizes information about edges in the template area of a predicted block to determine intra prediction direction for this block: these are TIMD, DIMD. Besides, there is a mechanism to split a block into two non-rectangular parts and apply different intra prediction modes inside each of these parts (SGPM) . However, none of these mechanisms utilizes spatial position of the strongest edge in the template area. FIG. 16 shows potential spatial position of an edge area with respect to the current block.
[0152] Another potential issue is limited number of angular modes in the TIMD candidate list. In the current design of ECM-15.0 intra prediction is performed in accordance with the table of intra prediction angles. Currently, it is not possible to perform an intra prediction using an arbitrary angle, because template-based matching methods determine the minimum value of template matching cost for a predetermined lists of modes. This problem is even more important for TIMD where just a limited number of angular modes are handled. The reason why some modes are omitted in the TIMD search is the high computational complexity of its TM cost derivation. To keep the TIMD complexity within a feasible range for state-of-the-art hardware, some angular modes have to be excluded from the TIMD search.
[0153] Another potential issue is inaccurate mode derivation in TIMD due to the usage of different reference lines for predicting TIMD templates and a current block. If an adjacent reference line is selected for predicting a current block, whereas other reference lines (with index of 2 or 4 subject to the block size) are used to generate predictors for TIMD templates, this inconsistency in the usage of reference lines can result in that angular modes derived by TIMD are inaccurate as the samples in these reference lines used at different stages of the TIMD process can be inconsistent with each other owing to different reasons such as sensor and quantization noise, different content contained within these reference lines, etc.
[0154] Another potential issue is limited accuracy of DIMD mode derivation. DIMD templates used for mode derivation has the depth of 2 or 3 subject to the size of a predicted (current) block that might be not enough to accurately derive angular direction (especially, for larger blocks) .
[0155] The present disclosure proposes an idea of using template matching between top and left areas (e.g., templates) of the current block to determine certain prediction parameters. Embodiments of the present disclosure may be utilized to solve one or more of the above mentioned issues.
[0156] FIG. 17 is a flowchart of an intra-prediction method according to an embodiment of the present disclosure. As shown in FIG. 17, the method includes operations described in blocks S501 to S506.
[0157] In S501, one or more reference areas located at a first side of a current block are determined.
[0158] In S502, a template area located at a second side of the current block is determined.
[0159] The first side may be the above side of the current block while the second side may be the left side of the current block. Alternatively, the first side may be the left side of the current block while the second side may be the above side of the current block.
[0160] For example, in FIG. 18, reference line index is set to 0 and the left and the top templates are spatially adjacent to the current block. The top template may be utilized as the reference area in this process while the left template may be taken as the template area.
[0161] For example, in FIG. 19, reference line index is greater than 0 and the left and the top reference lines (templates) are spatially non-adjacent to the current block. Similarly, the top template may be utilized as the reference area in this process while the left template may be taken as the template area.
[0162] Both the reference area and the template area may contain edge areas. Template matching between these two areas that are aligned with different sides of the current block (predicted block) may be utilized to identify existence of this kind of edge area and use it for prediction parameter update.
[0163] It should be noticed that, the reference area (s) and the template area may belong to the same reference line or belong to different reference lines, which is not limited by the present disclosure.
[0164] In some embodiments, more than just one reference lines could be used in this process. For example, the number of the reference areas mentioned in S501 may be larger than one, or the reference areas may include multiple reference lines. For example, the template area may also include multiple reference lines. As shown in FIG. 20, one main reference line may be utilized to generate projection on several lines of side reference. In subsequent steps, when an intra prediction mode is vertical (top reference samples are selected as main reference) , a top template is projected onto a left template as shown in FIG. 20 (a) . When an intra prediction mode is horizontal (left reference samples are selected as main reference) , a left template is projected onto a top template as shown in FIG. 20 (b) .
[0165] In S503, multiple angular parameters for intra prediction are acquired.
[0166] In this step, the multiple angular parameters for intra prediction are candidate parameters for prediction of the current block. For example, the angular parameters may be potential offset values for determination of the slope of directional intra prediction mode. For example, the angular parameters may be indications / indexes for different prediction modes. For example, the angular parameters may be combinations of prediction modes and their corresponding reference lines.
[0167] In one embodiment, the plurality of angular parameters comprise a plurality of offset values used for angular prediction. As introduced in foregoing sections of the present disclosure, each angular prediction mode may correspond to an angular parameter (angParam) . This parameter can also be taken as an offset value. The angular parameters mentioned in S503 may include such angular parameters. These parameters will be compared in subsequent steps so as to select one parameter from them for the prediction of the current block.
[0168] In one embodiment, the one or more reference areas comprise a plurality of reference lines, and the plurality of angular parameters comprise a plurality pairs of angular prediction modes and reference line indexes. In this case, the angular parameters mentioned in S503 may include both angular prediction modes and their corresponding reference line indexes. These parameters will be compared in subsequent steps such that which pair of angular prediction mode and it corresponding reference line should be used for prediction of the current block may be determined.
[0169] In one embodiment, the operation of acquiring the plurality of angular parameters for intra prediction comprises: acquiring a candidate prediction mode; and acquiring a plurality of extended prediction modes with higher precision than the candidate prediction mode; wherein the plurality of angular parameters comprise the candidate prediction mode and the plurality of extended prediction modes. In this case, the candidate prediction mode may be any one of existing angular prediction mode with a certain precision. The extended prediction modes may have higher precision than the candidate prediction mode. The angular parameters include both the candidate prediction mode and the extended prediction modes. They will be compared in subsequent steps such that which prediction mode should be used for prediction of the current block may be determined.
[0170] For example, a set of higher precision modes (e.g., in 1 / 64 sample precision) may be specified for an input mode mi (for 1 / 32 sample precision) . The precision conversion operation E (·) is performed over mode index as follows: E (m) = (m<<1) –2
[0171] The resulting set of modes in for an input mode mi is defined as: E (mi) ±1, E (mi) ±2 …E (mi) ±Bmax where Bmax is a predetermined constant that determines how many modes in the resulting set of modes will be selected.
[0172] In practical implementations, Bmax could be set to values of 1, 2 or 3.
[0173] In S504, multiple predictors on the template area are generated from the one or more reference areas based on the multiple angular parameters.
[0174] Reference samples within the reference area are projected onto the template area based on each of the angular parameters to generate its corresponding predictor on the template area. The method for projecting reference samples to a specific area may be similar as that for conventional angular prediction mode.
[0175] In S505, the predictors are compared with reconstructed samples within the template area to acquire multiple side-matching differences corresponding to the angular parameters.
[0176] In one embodiment, the plurality of side-matching differences are determined based on template matching (TM) costs of the plurality of predictors within the template area.
[0177] In this case, template matching (TM) costs are calculated for the predictors obtained in the previous step. The TM costs may be obtained by: 1) calculating per-sample differences between the predictor and reconstructed samples of the template area; 2) applying an estimation metric to the per-sample differences. This process may be similar to existing TM cost estimation method.
[0178] In another embodiment, the plurality of side-matching differences are determined based on gradient differences between predicted samples of the plurality of predictors and reconstructed samples within the template area.
[0179] In this case, the side-matching differences for predictors may be determined. This determination involves calculation of gradient values for the predictor samples and reconstructed samples. FIG. 21 shows the process. Detailed explanations are given below.
[0180] When predictor is obtained for the template on the left side, gradient could be calculated as follows: G (t, c) =p (-r-c-1, t+1) -p (-r-c-1, t) , t∈ [0, H-1]
[0181] In the formula, r is the reference line index, c is the index of a column (in case template depth is nonzero) . H is template height (which e.g., could be equal to the height of the current block) .
[0182] When predictor is obtained for the template on the above side, gradient could be calculated as follows: G (t, c) =p (t+1, -r-c-1) -p (t, -r-c-1) , t∈ [0, W-1]
[0183] In the formula, r is the reference line index, c is the index of a row (in case template depth is nonzero) . W is template width (which e.g., could be equal to the width of the current block) .
[0184] The step of obtaining a sum could be defined as follows: where pp are samples of predictor and pr are reconstructed samples.
[0185] In the above example, the metric of sum of absolute differences (SAD) is applied. It should be understood that other metrics for difference estimation could also be utilized.
[0186] The determined side-matching differences for the predictors may be compared in the subsequent step.
[0187] In S506, a target angular parameter with an optimal side-matching difference is selected for prediction of the current block.
[0188] Within the multiple angular parameters, the one with the minimal side-matching difference may be selected as the target angular parameter. That is, the target angular parameter may have the minimum TM cost or the minimum gradient difference.
[0189] When calculating side-matching difference for a non-square block, horizontal and vertical intra prediction modes may have different number of predicted samples. Hence, for a correct comparison of metrics calculated for horizontal and vertical modes, certain adjustment can be performed. In one embodiment, a width of the template is less than a height of the template, and the plurality of angular parameters comprise one or more vertical intra prediction modes and one or more horizontal intra prediction modes. In this case, side-matching differences corresponding to the one or more vertical intra prediction modes are multiplied by an aspect ratio which is equal to the height divided by the width. In another embodiment, a width of the template is larger than a height of the template, and the plurality of angular parameters comprise one or more vertical intra prediction modes and one or more horizontal intra prediction modes. In this case, side-matching differences corresponding to the one or more horizontal intra prediction modes are multiplied by an aspect ratio which is equal to the width divided by the height.
[0190] Specifically, if the width is shorter than the height, the side-matching difference for the vertical intra prediction mode are multiplied by the value of an aspect ratio k , where k=H / W. If the height is shorter than the width, the side-matching difference for the horizontal intra prediction mode are multiplied by the value of an aspect ratio k, where k=W / H. In the above formulas, W and H are the width and height, respectively.
[0191] According to the above-explained method of the present disclosure, template side-matching may be utilized to select an angular parameters from multiple candidates for the prediction of a current block. Thus, implementation of the present disclosure may improve prediction accuracy especially for the cases where the template on both sides of the current block has corresponding edge areas.
[0192] In one embodiment, the method may further include: determining a Low Frequency Non-separable Transform index corresponding to the target angular parameter. The above process may be used to refine intra prediction mode index value that is used as an input for LFNST set determination. It could be observed that for intra prediction modes greater than 66, LFNST set 2 is selected. Hence, the process may further include the following steps: 1) checking whether an intra prediction mode is less than 66, and if it is not, the following steps are not performed; 2) refining the input intra prediction mode with the method shown in FIG. 17; 3) determining the LFNST set based on the intra prediction mode index refined in the previous step.
[0193] Several examples are given below to better illustrate and explain the above-disclosed method.
[0194] One example is about constructing a predictor and obtaining template matching costs. The steps of this embodiment are shown in FIG. 22. It could be noticed that an edge area in a top template may be projected to the corresponding edge areas on the left template. This projection could be performed using an intra prediction mechanism, i.e.:
[0195] 1) Determine an angular parameter angParam (denoted as Δ) , that specifies an increment of subsample position for each predicted row (if prediction is from the above reference samples) or column (if prediction is from the left reference samples) in subsample precision.
[0196] 2) For each row or column, determine the value of subpixel offset Δang (y) = (y+1+mrlIdx) ·Δ, wherein y∈ [0, H] is the row index and “mrlIdx” is the reference line index (i.e. the number of rows between top boundary of predicted block and reference line to which projection is calculated) .
[0197] 3) Determine integer and fractional offsets (Δint and Δfrac, respectively) , so that: Δang (y) =P·Δint (y) +Δfrac (y)
[0198] In the formula, P denotes precision (i.e. the number of subsample positions for subsample interpolation) , and Δfrac∈ [0, P-1]
[0199] 4) Obtain predicted left template signal pLEFT (y) by projecting top template reconstructed samples rTOP: pLEFT (y) =rTOP (y+Δint (y) ) ×F (Δfrac (y) ) where ” ×” denotes convolution operation and F (Δfrac) is an interpolation filter defined for a fractional offset Δfrac.
[0200] 5) Calculate template matching cost metric between the predicted left template signal pLEFT (y) and reconstructed samples of the left template rLEFT : C=M (rLEFT, pTOP) . For example, SAD, SSD (SSE) , MR-SAD, HAD (SATD) or any combinations of these metrics could be used as function M (·) .
[0201] 6) Repeat the above steps with different values of the increment Δ to find the value that provides minimum of the template matching cost metric C.
[0202] Particularly, precision value could be defined as P=64 or P=32 depending on the complexity constraints and the number of predetermined phases of interpolation filters.
[0203] The same mechanism could be applied to project left template onto the top template (e.g., by swapping left and top templates and invoking the above-described steps) .
[0204] Another example is about arbitrary angle intra prediction using side matching operation.
[0205] In current intra prediction design, a per-row (or per-column) displacement Δ is based on a lookup table. In contrast, in the embodiment, the displacement Δ of intra prediction is determined in a more precise way. The value of angParam is refined based on the calculated costs. An example of the refinement step is shown in FIG. 23. The flowchart of the corresponding exemplary refinement algorithm is shown in FIG. 24. The steps are as follows:
[0206] In Step 1, the initial positive intra prediction mode minit is determined, e.g. by calculating template matching cost.
[0207] In Step 2, angular parameters are determined for the modes neighbouring to minit:
[0208] Angular parameters angParamL and angParamR are determined for modes mL and mR, respectively.
[0209] In Step 3, initial values of the potentially updated angParam values are determined by taking a half of the distance between angParam and angParamL on the one side, and angParam and angParamR on the other side.
[0210] Initialization is complete at the next Step 4, wherein iteration counter is set equal to 0.
[0211] The next steps are iteratively performed until maximum number of iterations maxIter is reached, or the angParam value providing the lowest cost is found.
[0212] Before the cost checking, the left and right costs CL and CR are initialized to some large number (i.e. “infinite cost” ) . This initialization is required to handle the cases when CL or CR are not calculated, e.g., when due to at some iteration angParam becomes equal to angParamL or angParamR.
[0213] The costs of CL and CR in Step 5 (which could be performed independently, i.e. in parallel) are obtained by constructing a set of predicted samples using angular intra prediction with angular parameters angParamL and angParamR, respectively.
[0214] In the next step 6, CL and CR are compared with the current cost C. If neither of them is smaller than C, the current angParam value is considered as a refined value providing the locally minimum cost, and further steps are not performed.
[0215] Otherwise, next iteration is performed. Initialization for the next iteration is performed in Step 7. The value of δ is calculated as being equal to the half of distance between the current angParam value and the angParam of the best-cost candidate determined in Step 5. New angParam and cost C of the current best candidates are assigned to the angParam and cost of the newly determined best candidate (angParamL and cost CL or angParamR and cost CR) , and the new candidates angParamL and angParamR are selected by subtracting and adding δ to the updated angParam value.
[0216] Iteration counter is increased, and next iteration is performed if maximum number of iterations is not reached. Exemplary values for maxIter could be defined as 3, 4 or 5.
[0217] In an alternative method, a set of equally distributed angParam candidate values are specified between angParaminit and angParamL, and between angParaminit and angParamR. The candidate that provides the lowest cost is selected as the refined angParam. As compared with previously-described embodiment, the costs for the angParam candidates may be calculated in parallel.
[0218] The side-matching mechanism introduced above may be applied for various types of existing intra-prediction method. Introductions for several examples are given below.
[0219] In one embodiment, the method is utilized in Template-based Intra Mode Derivation (TIMD) . The operation of acquiring the plurality of angular parameters comprises: acquiring multiple intra prediction modes with best template matching (TM) costs in the template area; selecting one or more positive prediction modes from the multiple intra prediction modes; and determining a set of modes in higher precision from the one or more positive prediction modes; wherein the plurality of angular parameters comprise both the one or more positive prediction modes and the set of modes in higher precision.
[0220] The side-matching mechanism can be used for refinement of intra prediction direction obtained by TIMD. In this solution direction of a mode that is obtained by TIMD mechanism is refined by calculating a cost of projection of a main reference line to a template located on the same side of a current block as a side reference. The following steps could be performed as shown in FIG. 25.
[0221] In the first step, “Get K intra prediction modes with best cost by template matching” , TIMD predictors are obtained for intra prediction modes in non-extended precision (i.e. 66 intra prediction mode with precision of P=32 subsample steps) and a total of N modes that provide minimum TIMD template matching cost are selected. This step could be performed like it is done in the prior art.
[0222] In step 2, these N modes are classified into 2 groups: positive and negative ones. The sign of the increment Δ that is predetermined for a directional intra prediction mode determines this classification: 1) if Δ>0, an intra prediction mode is classified as positive mode; 2) otherwise, (if Δ≤0, or not defined when an intra prediction mode is non-angular) , an intra prediction mode is classified as negative mode.
[0223] Next, the following steps are performed for each of the positive modes that were classified in step 2. Specifically, in step 3, a set of modes in higher precision are determined from the positive mode mi being processed. The modes in a higher precision have smaller angular steps (angular difference) between neighboring angular modes. In step 4, a side template matching operation is performed for each of the extended precision modes of the set of modes in higher precision determined in the previous step.
[0224] The result of steps 3 and 4 is the best extended precision mode mbest that is determined throughout all the extended precision modes of respective positive modes {mi} .
[0225] In step 5, TIMD matching cost is determined for the best extended precision positive mode mbest.
[0226] Based on this determined TIMD cost and the TIMD cost of the best negative mode, the resulting mode is selected in step 6. Negative angular modes have negative tangent values corresponding to their angles. For example, if best negative mode provides smaller TIMD cost than the best positive mode, the best negative mode is selected, and otherwise, best positive mode is selected.
[0227] In one embodiment, the method is utilized in fusion intra prediction modes. The operation of acquiring the plurality of angular parameters comprises: acquiring a list of fusion intra prediction modes; selecting a positive prediction mode from the list of fusion intra prediction modes; and obtain a plurality of refinement modes for the positive prediction mode; wherein the plurality of angular parameters comprise both the positive prediction mode and the plurality of refinement modes.
[0228] The side-matching mechanism can be used for selection of fusion intra prediction modes with refinement process. The flowchart of this solution is shown in FIG. 26. In this solution the following steps could be performed:
[0229] 1) Determining a list of fusion intra prediction mode.
[0230] 2) Select positive modes from this list {mi} .
[0231] The following steps are performed for each element of {mi} . The order in which these steps are performed matters, because {mi} is updated in these steps. In this solution, the modes mi are iterated by the assigned fusion weights.
[0232] 3) Obtain a list of candidate replacement mode M. The candidate replacement mode should not be included in the list of positive modes {mi} .
[0233] 4) Get side matching costs for each of the candidates and determine the candidate mode mbest providing minimum cost among the candidates.
[0234] 5) Update mi with mbest.
[0235] Finally, for the refined list {mi} obtained at the previous steps, fusion may be performed.
[0236] This solution may be applicable to both DIMD and TIMD fusion process.
[0237] The present disclosure further provides an intra-prediction method. As shown in FIG. 27, the method may include operations described in blocks S601 to S603.
[0238] In S601, Multiple predictors corresponding to a list of positive intra prediction modes on a template area are compared with reconstructed samples within the template area.
[0239] In S602, One target prediction mode which has the optimal side-matching difference is selected.
[0240] In S603, the encoder transmits a bitstream to the decoder, and the decoder receives the bitstream. The bitstream includes a first indication for the list of positive intra prediction mode, and a second indication for the target prediction mode.
[0241] In this method, the determination of the target prediction mode may be performed at the encoder side. Then an indication for the selected prediction mode may be transmitted to the decoder, which may reduce computational complexity at the decoder.
[0242] FIG. 28 shows an intra prediction mode signaling mechanism with template side matching. In this solution, intra prediction mode signaling mechanism design uses template side matching to reduce the number of bins required to encode an intra prediction mode.
[0243] For a block that is coded using an irregular intra prediction mode, “isSideMatched” flag is signaled using the context mode. The value of this flag is used to determine the further signaling.
[0244] When the value of “isSideMatched” flag is 0, an MPM flag is signaled and all the following syntax elements are signaled as known from the prior art.
[0245] When the value of “isSideMatched” flag is 1, an index of a positive mode “smIndex” is signaled in the list of positive intra prediction mode. The list is sorted using side template matching costs, and “smIndex” indicates a position of this mode within this list. “smIndex” syntax element could be signaled using Truncated unary code or an Exp-Golomb coding mechanism.
[0246] FIG. 29 shows a design of TMRL improvement using side matching cost. After TMRL list is prepared, position of a mode within this list may be signaled using a group index and an index within this group.
[0247] In this solution, bins to encode position within a group could be context-coded, so that the performed sorting will make selection of a mode with lower index more probable than selection of a mode with higher index.
[0248] FIG. 30 conceptually illustrates an apparatus 700 with which some embodiments of the invention are implemented. The apparatus may be an encoder or a decoder. The apparatus 700 may be a computer (e.g., a desktop computer, personal computer, tablet computer, etc. ) , phone, PDA, or any other sort of electronic device. Such an apparatus includes various types of computer readable media and interfaces for various other types of computer readable media. The apparatus 700 includes a processor 702 and a memory 704. The memory 704 is configured to store executable instructions that, when executed by the processor, cause the processor to perform any one of the foregoing decoding or encoding methods.
[0249] The processor 702 may be a single processor or a multi-core processor in different embodiments. In some embodiments, the processor may include a GPU, NPU or DSP which may offload various computations or complement the image processing provided by the processor 702.
[0250] Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media) . Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM) , recordable compact discs (CD-R) , rewritable compact discs (CD-RW) , read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM) , a variety of recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc. ) , flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc. ) , magnetic and / or solid state hard drives, read-only and recordable discs, ultra density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.
[0251] While the above discussion primarily refers to microprocessor or multi-core processors that execute software, some embodiments are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) . In some embodiments, such integrated circuits execute instructions that are stored on the circuit itself. In addition, some embodiments execute software stored in programmable logic devices (PLDs) , ROM, or RAM devices.
[0252] As used in this specification and any claims of this application, the terms “computer” , “server” , “processor” , and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. As used in this specification and any claims of this application, the terms “computer readable medium, ” “computer readable media, ” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral signals.
[0253] The present disclosure further provides a computer readable media which is configured to store executable instructions. When the instructions are executed by a processor, the processor may perform any one of the foregoing methods and processes. Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium) . When these instructions are executed by one or more computational or processing unit (s) (e.g., one or more processors, cores of processors, or other processing units) , they cause the processing unit (s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, random access memory (RAM) chips, hard drives, erasable programmable read only memories (EPROMs) , electrically erasable programmable read-only memories (EEPROMs) , etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.
[0254] In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the invention. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.
[0255] While the disclosure has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the invention can be embodied in other specific forms without departing from the spirit of the invention. In addition, a number of the figures conceptually illustrate processes and methods. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process.
[0256] The foregoing is merely embodiments of the present disclosure, and is not intended to limit the scope of the disclosure. Any transformation of equivalent structure or equivalent process which uses the specification and the accompanying drawings of the present disclosure, or directly or indirectly application in other related technical fields, are likewise included within the scope of the protection of the present disclosure.
Claims
1.An intra-prediction method, comprising:determining one or more reference areas located at a first side of a current block;determining a template area located at a second side of the current block, wherein the first side is an above side of the current block and the second side is a left side of the current block, or wherein the first side is the left side of the current block and the second side is the above side of the current block;acquiring a plurality of angular parameters for intra prediction;generating, from the one or more reference areas, a plurality of predictors on the template area based on the plurality of angular parameters, respectively;comparing the plurality of predictors with reconstructed samples within the template area to acquire a plurality of side-matching differences corresponding to the plurality of angular parameters, respectively; andselecting a target angular parameter with an optimal side-matching difference for prediction of the current block.2.The method of claim 1,wherein the plurality of angular parameters comprise a plurality of offset values used for angular prediction.3.The method of claim 1,wherein the one or more reference areas comprise a plurality of reference lines;wherein the plurality of angular parameters comprise a plurality pairs of angular prediction modes and reference line indexes.4.The method of claim 1,wherein the plurality of side-matching differences are determined based on template matching (TM) costs of the plurality of predictors within the template area.5.The method of claim 1,wherein the plurality of side-matching differences are determined based on gradient differences between predicted samples of the plurality of predictors and reconstructed samples within the template area.6.The method of claim 1,wherein the method is utilized in Template-based Intra Mode Derivation (TIMD) ;wherein the acquiring the plurality of angular parameters comprises:acquiring multiple intra prediction modes with best template matching (TM) costs in the template area;selecting one or more positive prediction modes from the multiple intra prediction modes; anddetermining a set of modes in higher precision from the one or more positive prediction modes;wherein the plurality of angular parameters comprise both the one or more positive prediction modes and the set of modes in higher precision.7.The method of claim 1,wherein the method is utilized in fusion intra prediction modes;wherein the acquiring the plurality of angular parameters comprises:acquiring a list of fusion intra prediction modes;selecting a positive prediction mode from the list of fusion intra prediction modes; andobtain a plurality of refinement modes for the positive prediction mode;wherein the plurality of angular parameters comprise both the positive prediction mode and the plurality of refinement modes.8.The method of claim 1, further comprising:determining a Low Frequency Non-separable Transform index corresponding to the target angular parameter.9.The method of claim 1, wherein the acquiring the plurality of angular parameters for intra prediction comprises:acquiring a candidate prediction mode; andacquiring a plurality of extended prediction modes with higher precision than the candidate prediction mode;wherein the plurality of angular parameters comprise the candidate prediction mode and the plurality of extended prediction modes.10.The method of claim 1,wherein a width of the template is less than a height of the template;wherein the plurality of angular parameters comprise one or more vertical intra prediction modes and one or more horizontal intra prediction modes;wherein side-matching differences corresponding to the one or more vertical intra prediction modes are multiplied by an aspect ratio which is equal to the height divided by the width.11.The method of claim 1,wherein a width of the template is larger than a height of the template;wherein the plurality of angular parameters comprise one or more vertical intra prediction modes and one or more horizontal intra prediction modes;wherein side-matching differences corresponding to the one or more horizontal intra prediction modes are multiplied by an aspect ratio which is equal to the width divided by the height.12.The method of claim 1, wherein the acquiring the plurality of angular parameters for intra prediction comprises:acquiring an initial offset value corresponding to an initial angular mode;acquiring a first offset value corresponding to a first angular mode;acquiring a second offset value corresponding to a second angular mode, wherein the first angular mode and the second angular mode are next to the initial angular mode;obtaining one or more first potential offset values between the initial offset value and the first offset value; andobtaining one or more second potential offset values between the initial offset value and the second offset value;wherein the plurality of angular parameters comprise the initial offset value, the one or more first potential offset values, and the one or more second potential offset values.13.An intra-prediction method, executed by a decoder, comprising:receiving, from an encoder, a bitstream;wherein the bitsream comprises a first indication for a list of positive intra prediction modes and a second indication for a target prediction mode;wherein the target prediction mode is determined by comparing a plurality of predictors corresponding to the list of positive intra prediction modes on a template area with reconstructed samples within the template area and selecting one having an optimal side-matching difference.14.A video coding apparatus, comprising a processor and a memory, wherein the memory is configured to store executable instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 13.15.A computer readable medium storing executable instructions that, when executed by a processor, cause the processor to perform the method of any of claims 1 to 13.