Directional intra-prediction method and apparatus
By determining multiple sets of reference samples with adaptive weights and biases, the method addresses inefficiencies in conventional intra prediction methods, enhancing compression performance and accuracy in video coding.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN TCL NEW-TECH CO LTD
- Filing Date
- 2024-10-23
- Publication Date
- 2026-04-30
AI Technical Summary
Conventional intra prediction methods in video coding, such as those used in VVC, face inefficiencies due to the use of fixed weights for reference lines, which can propagate noise and fail to account for varying content types, leading to reduced compression performance.
A method that determines multiple sets of reference samples for a current block, applies specific filtering operators, and generates a predictor based on these samples and derived prediction parameters, including adaptive weights and biases, to improve prediction accuracy.
Enhances compression performance by adaptively addressing different content types within reference lines, reducing noise propagation and improving prediction accuracy.
Smart Images

Figure CN2024126880_30042026_PF_FP_ABST
Abstract
Description
DIRECTIONAL INTRA-PREDICTION METHOD AND APPARATUSTECHNICAL FIELD
[0001] The present disclosure generally relates to video encoding and decoding technology, and in particular to a prediction method for video decoding, a directional intra-prediction method, a video coding apparatus and a non-transitory computer readable medium.BACKGROUND
[0002] In video coding, methods to generate a predictor for a block from previously reconstructed samples are generally referred to as a block prediction methods. These previously reconstructed samples are called “reference samples (or template samples) ” , and their spatial location within a picture is referred to as “reference area (or template area) ” .
[0003] When reference area and a predicted block belong to different pictures, a block prediction method is called a block inter-prediction method. When reference area and a predicted block belong to the same picture, a block prediction method is called as a block intra-prediction.
[0004] Intra prediction methods may define one or several reference lines within a reference area and samples of a predicted block are obtained by processing of these reference lines. This processing may comprise several operations as follows.
[0005] In a first step, a reference area is determined (e.g., selection of the distance to the predicted block, as it is done in Multi-Reference Line (MRL) / Template-Matching based Multi-Reference Line (TMRL) prediction) . Reference lines and template area as defined in TMRL are shown in FIG. 1. In TMRL a sorted list of candidates is prepared as shown in FIG. 2. In this list, each candidate is a pair of intra prediction mode and reference line index (which defines a distance to the predicted block) . In this method, a template area is predicted using parameters defined in each of the candidate within a sorted candidate list, and the candidates are sorted based on the cost metrics calculated for the prediction result with regard to the reconstructed samples of the reference area.
[0006] In a second step, samples within a reference line are selected based on a position of the predicted sample within a predicted block.
[0007] Then, a Finite Impulse Response (FIR) may be applied to the selected samples within a reference line to obtain the value of a predicted samples. An FIR may be defined differently for each position within a predicted block. Particularly, this FIR could be an interpolation filter that is determined for each row or column of a predicted block based on the fractional part of the displacement of a predicted row or column with respect to a reference line.
[0008] Directional intra prediction is performed by propagating a reference line inside a block to be predicted in some spatial direction. In VVC, 92 intra prediction directions are defined (see FIG. 3 (a) ) . These prediction directions correspond to intra prediction modes, each of these modes is assigned a number called an intra prediction index.SUMMARY
[0009] Accordingly, the present disclosure aims to provide a prediction method for video decoding, a directional intra-prediction method, a video coding apparatus and a non-transitory computer readable medium.
[0010] A technical scheme adopted by the present disclosure is to provide a prediction method for video decoding. The method includes: determining a plurality sets of reference samples for a current block; deriving one or more prediction parameters with regard to the plurality sets of reference samples by using a set of template samples; and generating a predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters.
[0011] Another technical scheme adopted by the present disclosure is to provide a direction intra-prediction method for video decoding. The method includes: determining a reference area of a current block; applying a specific filtering operator to samples and / or proximity of samples within the reference area to acquire filtering results of the samples within the reference area; applying a first interpolation filter to a first subset of samples within the reference area to generate a first set of predicted samples for the current block, wherein the filtering results of the first subset of samples meet a specific threshold; and applying a second interpolation filter to a second subset of samples within the reference area to generate a second set of predicted samples for the current block, wherein the filtering results of the second subset of samples do not meet the specific threshold.
[0012] Another technical scheme adopted by the present disclosure is to provide a directional intra-prediction method for video decoding. The method includes: determining a reference area of a current block, wherein the reference area comprises a first reference line and a second reference line; applying a specific filtering operator to samples and / or proximity of samples within the reference area to acquire filtering results of the samples within the reference area; in response to the filtering results of a subset of samples within the reference area meet a specific threshold: determining an intensity difference along a specific direction between a first sample of the first reference line and a second sample of the second reference line at each of the subset of samples; and applying the intensity difference to generate a corresponding predicted sample, wherein the first sample, the second sample, and the corresponding predicted sample are substantially along the specific direction .
[0013] 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.
[0014] 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
[0015] 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.
[0016] FIG. 1 shows reference lines and template area as defined in the TMRL mode.
[0017] FIG. 2 is a sorted list of candidates used in the TMRL mode.
[0018] FIG. 3 (a) illustrates directions for angular intra prediction modes in VVC.
[0019] FIG. 3 (b) illustrates integer-slope mode and fractional-slope intra-prediction mode in VVC.
[0020] FIG. 4 illustrates the usage of 2 adjacent reference lines with pre-determined weights to predict a block.
[0021] FIG. 5 illustrates the usage of 2 non-adjacent reference lines with pre-determined weights to predict a block.
[0022] FIG. 6 shows multiple angular modes with positive angles.
[0023] FIG. 7 shows exemplary definitions of reference samples for applying PDPC to various angular modes.
[0024] FIG. 8 illustrates a gradient PDPC method for replacing the traditional PDPC.
[0025] FIG. 9 illustrates rules for determination of PDPC application in angular prediction.
[0026] FIG. 10 shows template areas utilized in TMRL mode.
[0027] FIG. 11 is a flowchart of a prediction method for video decoding according to an embodiment of the present disclosure.
[0028] FIG. 12 illustrates usage of an adjacent reference line to determine the prediction parameters applied to two non-adjacent reference lines during prediction of the current block.
[0029] FIG. 13 illustrates interpolation of samples of reference lines A and B according to a selected angular prediction direction.
[0030] FIG. 14 shows samples of reference lines A and B which are to be included in a synthetic reference line.
[0031] FIG. 15 shows a synthetic reference line combined from samples of reference lines A and B.
[0032] FIG. 16 illustrates usage of a sliding window for classifying reference samples of the reference area.
[0033] FIG. 17 illustrates usage of an adjacent reference subarea for determining the prediction parameters applied to classified reference samples taken from the non-adjacent subarea during prediction of the current block.
[0034] FIG. 18 illustrates a process for deriving the gradient magnitude parameters from a 2 by 2 block.
[0035] FIG. 19 is a flowchart of a directional intra-prediction method according to an embodiment of the present disclosure.
[0036] FIG. 20 illustrates an intra-prediction interpolation filtering process with the classification applied to adjacent reference samples and performed by an edge operator.
[0037] FIG. 21 illustrates an intra-prediction interpolation filtering process with the classification applied to non-adjacent reference samples and performed by an edge operator.
[0038] FIG. 22 is a flowchart of a directional intra-prediction method according to another embodiment of the present disclosure.
[0039] FIG. 23 is a flowchart of a directional intra-prediction method according to yet another embodiment of the present disclosure.
[0040] FIG. 24 shows reference samples utilized for gradient PDPC propagation within a template area, and a direction derived for the gradient PDPC propagation.
[0041] FIG. 25 illustrates a process for deriving the gradient magnitude parameters from a 2 by 2 block.
[0042] FIG. 26 is a flowchart of a directional intra-prediction method according to another embodiment of the present disclosure.
[0043] FIG. 27 is a schematic diagram of a video coding apparatus according to an embodiment of the present disclosure.DETAILED DESCRIPTION
[0044] 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.
[0045] The present disclosure relates to both a method and an apparatus of intra prediction, and embodiments of the present disclosure may be applied in combination with other intra prediction methods as well as implemented as a hardware or a software module. The following sections provide introduction for several related technologies of the present disclosure.
[0046] ● Reference Sample Generation
[0047] In VVC, the intra prediction samples are generated using reference samples that are obtained from reconstructed samples of neighboring blocks. For a W×H block, the reference samples are constituted of the 2·H reconstructed samples to the left of the block, the top left reconstructed sample and the 2·W reference samples above the block. However, for MRL the reference samples are not directly adjacent to the block. In general, not all reference samples are available, i.e., located at already reconstructed sample positions, and unavailable reference samples are generated by a padding mechanism. This padding mechanism is very similar to the method used in HEVC. First, the availability determination for the reference samples is performed on the basis of 4×4 units of the neighboring reconstructed samples. Here, the set of available units always forms a contiguous interval of a subset of the reference samples. The outermost reconstructed samples of this interval are then used as values for the corresponding unavailable parts of the reference samples.
[0048] ● Angular Intra Prediction
[0049] Angular intra prediction is a directional intra prediction method that is supported in both AVC and HEVC and that is also part of VVC. In comparison to HEVC, the angular intra prediction of VVC was modified by increasing the prediction accuracy and by an adaptation to the new partitioning framework. The former was realized by enlarging the number of angular prediction directions and by more accurate interpolation filters, while the latter was achieved by introducing wide-angular intra prediction modes.
[0050] In VVC, the number of directional modes available for a given block is increased to 65 directions from the 33 HEVC directions. The angular modes of VVC are depicted in FIG. 3 (a) . The directions having even indices between 2 and 66 are equivalent to the directions of the angular modes supported in HEVC.
[0051] For blocks of square shape, an equal number of angular modes is assigned to the top and left side of a block. On the other hand, for intra blocks of rectangular shape, which are not present in HEVC, but which are a central part of VVC’s partitioning scheme, more intra prediction directions are assigned to the longer side of a block. The additional modes allocated along a longer side are called Wide-Angle Intra Prediction (WAIP) modes, since they correspond to prediction directions with angles greater than 45° relative to the horizontal or vertical mode.
[0052] A WAIP mode for a given mode index is defined by mapping the original directional mode to a mode that has the opposite direction with an index offset equal to one, as shown in FIG. 3 (a) . For a given rectangular block, the aspect ratio, i.e., the ratio of width to height, is used to determine which angular modes are to be replaced by the corresponding wide-angular modes. In Table 1, the last and first WAIP mode indices and, respectively, the first and last non-WAIP mode indices are enumerated for each aspect ratio that can occur for intra blocks in VVC. It can be seen from this table that the last WAIP modes, which belong to the sets {-14, -12, -10, -6} and {72, 76, 78, 80} correspond to the counter-diagonals of a given rectangular block and have integer slope. Thus, they have similar properties as the two counter-diagonal modes 2 and 66, which determine the range of angular prediction modes in the case of square blocks in FIG. 3 (a) .
[0053] Table 1 Intra Prediction Modes Corresponding to the Conter-Diagonals of Blocks with Different Aspect Ratios
[0054] For square-shaped blocks in VVC, each pair of predicted samples that are horizontally or vertically adjacent are predicted from a pair of adjacent reference samples. To the contrary, WAIP extends the angular range of directional prediction beyond 45°, and therefore, for a coding block predicted with a WAIP mode, adjacent predicted samples may be predicted from non-adjacent reference samples. To suppress discontinuities caused by this phenomenon, the reference samples are always smoothed for WAIP modes. This smoothing is performed by either enabling reference sample filtering or by selecting the smoothing interpolation filters.
[0055] The introduction of WAIP modes does not cause any changes in the intra mode coding. Rather, for the latter, each mode in the range [67, 80] is treated as its corresponding mode in the range [2, 14] and each mode in the range [-14, -1] is treated as its corresponding mode in the range [53, 66] . The mapping of a non-WAIP mode to the corresponding WAIP mode is invoked only within the process of intra prediction generation of a block.
[0056] ● Reference Sample Filtering
[0057] Similar to HEVC, intra prediction in VVC has two filtering mechanisms applied to reference samples, namely reference sample smoothing and interpolation filtering. Only one of these two mechanisms can be applied on a given block in order to avoid a latency increase that would be caused by a sequential application of two filtering operations. More precisely, reference sample smoothing is applied only to integer-slope modes in luma blocks while interpolation filtering is applied to fractional-slope modes.
[0058] For reference sample smoothing, the reference samples are filtered using the finite impulse response filter {1, 2, 1} / 4. Reference sample smoothing is invoked for integer-slope modes if the number of samples in the given block is more than 32.
[0059] For interpolation filtering, if a sample projection for a given prediction direction falls on a fractional position between reference samples as shown in FIG. 3 (b) , the predicted sample value is obtained by applying an interpolation filter to the reference samples around the fractional sample position.
[0060] For luma blocks, 4-tap interpolation filters are used and the predicted sample pred (x, y) is obtained as:
[0061] Here, i0 denotes the closest left-side integer position of a predicted sample projection within the reference samples r , while p∈ {0, …, 31} constitutes the fractional part of the predicted sample projection with respect to i0 at a 1 / 32-pel accuracy as depicted in FIG. 3 (b) .
[0062] The interpolation filter coefficients f [p] [i] in (1) are signed integers whose magnitudes are stored in 6-bit precision. They either represent a DCT-based interpolation filter (DCTIF) or a 4-tap smoothing interpolation filter (SIF) and are delineated in the VVC specification. The DCTIF used as a non-smoothing filter is constructed in the same way as the chroma DCTIF used for motion compensation in both HEVC and VVC. The SIF is obtained by convolving the linear 2-tap interpolation filter of HEVC with {1, 2, 1} / 4 and is thus consistent with the reference sample smoothing described above. For the chroma components, the linear 2-tap interpolation filter of HEVC is used in VVC.
[0063] The type of the interpolation filter is not signaled in the bitstream and is determined based on the size of the block and the intra prediction mode index m . If min (|m-50|, |m-18|) > T, the SIF is used, otherwise, the DCTIF (i.e. the non-smoothing filter) is used. Here, T is a threshold that depends on the block size.
[0064] In ECM, the 4-tap DCTIF (non-smoothing) interpolation filter is replaced with a 6-tap Lagrange (cubic, non-smoothing) interpolation filter, as described in JVET-D0119, for the derivation of predicted samples from the reference samples.
[0065] For reference sample filtering, a 6-tap smoothing filter is applied to larger blocks (W >= 32 and H >=32) . Otherwise, existing VVC 4-tap smoothing interpolation filter is applied. The 6-tap smoothing filter obtained as the result of convolving the linear 2-tap interpolation filter with {1, 2, 1} / 4 twice (i.e. the linear 2-tap interpolation filter is convolved with {1, 2, 1} / 4 and then the results of that convolution is convolved with {1, 2, 1} / 4 again) . The extended intra reference samples are derived using the 4-tap interpolation filter instead of the nearest neighbor rounding.
[0066] For more information, please refer to [J. Pfaff; A. Filippov; S. Liu; X. Zhao; J. Chen; S. De-Luxán-Hernández; T. Wiegand; V. Rufitskiy; A. K. Ramasubramonian; G. Van der Auwera, "Intra Prediction and Mode Coding in VVC, " in IEEE Transactions on Circuits and Systems for Video Technology, vol. 31, no. 10, pp. 3834-3847, Oct. 2021, doi: 10.1109 / TCSVT. 2021.3072430] , and [M. Coban, R. -L. Liao, K. Naser, J. L. Zhang, "Algorithm description of Enhanced Compression Model 14 (ECM 14) , " JVET contribution JVET-AI2025] .
[0067] ● Weights for intra predictors
[0068] 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.
[0069] Particularly, for angular intra prediction modes including the single mode case of TIMD and DIMD, 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 default reference line and pline+1 is the prediction from the line above the default reference line. The weights are set as w0=3 / 4 and w1=1 / 4 [JVET-AB0157] . FIG. 4 illustrates the usage of 2 adjacent reference lines with pre-determined weights to predict a block, and FIG. 5 illustrates the usage of 2 non-adjacent reference lines with pre-determined weights to predict a block.
[0070] This technique referred to as intra prediction fusion derives predicted samples as a weighted combination of multiple predictors generated from different reference lines. In this process multiple intra predictors are generated and then fused by weighted averaging. The process of deriving the predictors to be used in the fusion process is described as follows.
[0071] For angular intra prediction modes including the single mode case of TIMD and DIMD, 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 default reference line and pline+1 is the prediction from the line above the default reference line. The weights are set as w0=3 / 4 and w1=1 / 4.
[0072] For TIMD mode with blending, pline is used for the first mode (w0=1, w1=0 ) and pline+1 is used for the second mode (w0=0, w1=1) .
[0073] For DIMD mode with blending, the number of predictors selected for a weighted average is increased from 3 to 6.
[0074] The angular intra prediction fusion method is applied to luma blocks when angular intra mode has non-integer slope (required reference samples interpolation) and the block size is greater than 16, it is used with MRL and not applied for ISP coded blocks. In the method studied in the sub-test a, PDPC is applied for the intra prediction mode using the closest to the current block reference line.
[0075] The TIMD mode with blending method is applied when all the following conditions are satisfied: 1) both the first and second modes are angular prediction mode; 2) the current block is not ISP coded block; 3) all of the following conditions are false: abs (predModeIntra1–predModeIntra2) is greater than Threshold (set to 8 or 4 depending on block size) ; (predModeIntra1-EXT_HOR_IDX) * (predModeIntra2-EXT_HOR_IDX) is less than 0; and (predModeIntra1-EXT_VER_IDX) * (predModeIntra2-EXT_VER_IDX) is less than 0.
[0076] ● Position-dependent Intra Prediction Combination (PDPC)
[0077] 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.
[0078] 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:
[0079] Pred (x′, y′) = (ωL×R (-1, y) +ωT×R (x, -1) -ωTL×R (-1, -1) + (64-ωL-ωT+ωTL) ×Pred0 (x′, y′) +32) >>6
[0080] In the above equation, 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 can be 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=(log2 (W) +log2 (H) -2) >>2
[0081] where W and H are the width and height of current block.
[0082] PDPC is force 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) . In FIG. 6, the angular modes with positive angles are marked.
[0083] The PDPC process for a DC mode and a planar mode can be identical. In this case, the coordinates of R (-1, y) and R (x, -1) are the same as the current sample (x′, y′) , which means they are R (-1, y′) and R (x′, -1) , respectively. And ωTL is equal to 0 (ωTL=0) . For angular modes, if the current angular mode is horizontal or vertical, left or top reference samples may not be used, respectively. For example, if the current angular mode is horizontal mode, ωTL is equal to ωT (ωTL=ωT) .In addition, with respect to the vertical mode, ωTL is equal to ωL (ωTL=ωL) . For other angular modes, ωTL may be equal to 0 (ωTL=0) .
[0084] FIG. 7 (a) - (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′) can be located at (x′, y′) within a prediction block. R (-1, y) , R (x, -1) , and R (-1, -1) can represent the reference samples located at the left, top, and top-left of the prediction block, respectively.
[0085] FIG. 7 (a) shows a top-right diagonal mode PDPC. FIG. 7 (b) shows a bottom-left diagonal mode of the PDPC. FIG. 7 (c) shows an adjacent diagonal top-right mode of the PDPC. FIG. 7 (d) shows an adjacent diagonal bottom-left mode of the PDPC. In an example, such as shown inFIG. 7 (a) , the coordinate x of the reference sample R (x, -1) can be 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.
[0086] For other angular modes, such as shown in FIGs. 7 (c) and 7 (d) , the reference samples R (-1, y) and R (x, -1) can be 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 can be used.
[0087] 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.
[0088] ● Gradient PDPC
[0089] 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.
[0090] 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 dimension, 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. 8, 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.
[0091] To perform gradient PDPC, video encoder or video decoder may compute the intensity variation or “gradient” along the prediction direction, as shown by the arrow in FIG. 8. 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) .
[0092] 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
[0093] Two tap (linear) filtering can be applied when d is at fractional position, then R (-1+d, -1) is computed as:
[0094] R (-1+d, -1) = (32-dFrac) ×R (-1+dInt, -1) +dFrac×R (-1+dInt+1, -1)
[0095] This 2-tap filtering is performed once per row. Finally, the prediction sample is computed:
[0096] Pred (x′, y′) = (ωL (x) × (R (-1, y) -R (-1+d, -1) ) + (64-ωL (x) ) ×Pred0 (x′, y′) +32) >>6
[0097] FIG. 9 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.
[0098] ● Template-based multiple reference line intra prediction
[0099] 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.
[0100] 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 it is 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.
[0101] 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. 10) 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.
[0102] For TMR signaling 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.
[0103] In conventional intra prediction fusion, the weights are defined to be equal and respectively for the main ( “default” ) reference line and for the next reference line (the line which is above the “default” reference line) . The reason to select such specific weight values is not well substantiated. Thus, the weight values are fixed for each reference line, i.e. the dependency on content is not taken into account. Besides, other factors (e.g., potential changes of DC / mean values for reference line distant from a block) are not considered in the prior-art either. Moreover, the reference area can comprise different sorts of content including edges, strong textures, or smooth regions. Thus, using one set of fixed weights for all kinds of reference areas and making no difference between different types of content may reduce the compression efficiency of prediction techniques. Several drawbacks of the conventional intra prediction fusion are introduced below.
[0104] Reference lines may be noisy and this noise may be propagated inside the predicted block by directional intra prediction. The nature of this noise can be different (e.g., quantization noise, sensor noise) . To reduce its impact on predicted blocks in the best way, weights applied to reference lines should be determined with respect to the content of these reference lines rather than taking predefined fixed values based on offline training. Adaptive noise suppression mechanisms usually demonstrate higher efficiency compared to FIR filters with predefined filter coefficients (e.g., as done in intra prediction fusion where a weighted average of 2 predictors is used as a final predictors that boils down to a 2-tap FIR filter with fixed coefficients) .
[0105] Reference lines may comprise directional (edges) and non-directional (textures, homogeneous regions, etc. ) content, which may require different prediction parameters. For example, edges appearing in reference lines should be processed by a non-smoothing filter whereas a smoothing filter might be applied to smoothing areas, which frequently are very noisy. At least, different sorts of content (e.g., edges. strong textures, smooth regions) might need to get prediction parameters adjusted (e.g., weight values) to construct a more accurate predictor. However, interpolation filtering like PDPC filtering as well as intra prediction fusion are applied to reference samples without differentiating reference samples that can reduce the compression performance of these techniques. Thus, sticking to fixed weights without classifying samples contained in reference lines may lead to the degradation of the compression performance.
[0106] Reference lines distant from a block may have a DC level (i.e. a mean value) significantly different from the DC level in a predicted block. Missing this aspect in a prediction model might adversely affect the compression performance of methods involving distant reference lines.
[0107] The present disclosure aims to provide a scheme for selectively applying derivation mechanism to reference samples to determine prediction parameters or prediction filters. Embodiments of the present disclosure may solve one or several of the foregoing limitations in the conventional intra prediction fusion.
[0108] FIG. 11 is a flowchart of a prediction method for video decoding according to an embodiment of the present disclosure. As shown in FIG. 11, the method may include operations described in blocks S101 to S103.
[0109] In S101, multiple sets of reference samples for a current block are determined.
[0110] The current block refers to the specific block of image data that is currently being processed. The current block can be of various sizes, such as 4x4, 8x8, 16x16 pixels, etc., depending on the specific video coding standard being used. During the decoding process, the current block is the block that is presently being decoding or being predicted.
[0111] The sets of reference samples may be selected in different ways. In one embodiment, the sets of reference samples may correspond to samples of different reference lines determined for predicting the current block, respectively. In another embodiment, one set of reference samples may be selected from several reference lines. For example, the sets of reference samples may be determined as samples contained in multiple reference lines, and samples in one reference line may be taken as one set of reference samples.
[0112] In S102, one or more prediction parameters with regard to the sets of reference samples are determined by using a set of template samples.
[0113] The template samples refer to samples within a template area for determination of prediction parameters. The template area for determination of prediction parameters may be pre-defined (e.g., by the coding standard) , or it may be indicated by an encoder to the decoder in a bitstream. For example, the template samples may be determined as samples contained in one reference line.
[0114] These template samples may be utilized determine the prediction parameter (s) for different sets of reference samples. The prediction parameter (s) may include, but are not limited to, weights assigned to different sets of reference samples for prediction of the current block, and / or a bias term for adjusted the weighted sum of predictors of different sets of reference samples for prediction of the current block.
[0115] The template samples may be closer to the current block in comparison with the sets of reference samples. Thus, determining prediction parameters for the sets of reference samples by using the set of template samples can reflect the attributes of the current block in the predicted block.
[0116] In S103, a predictor for the current block is generated based on the set of reference samples and the one or more prediction parameters.
[0117] Based on the prediction parameters and the reference samples, the predictor for the current block may be acquired. For example, the predictor for the current block may be equal to a weighted sum of predictors of different sets of reference samples.
[0118] According to the above description, at least some prediction parameters are derived rather than being pre-defined. In other words, the present embodiment involves content-driven process, and may result in a more accurate predictor for the current block compared to the conventional intra prediction fusion method which uses fixed weights values.
[0119] A detailed introduction about how to determine the multiple sets of reference samples and the template samples, and about determination of prediction parameters is given below.
[0120] The multiple sets of reference samples may include N non-adjacent reference lines while the set of template samples may include 1 adjacent reference line. The N non-adjacent reference lines may be fetched to be available for the prediction parameter derivation by matching them with the adjacent reference line, and for prediction construction processes. Specifically, the multiple sets of reference samples may include a first reference line and a second reference line which are not adjacent to the current block, and the set of template samples may include a third reference line which is adjacent to the current block. For example, in FIG. 12, a primary reference line and a secondary reference line are utilized to generate the predicted block, and an adjacent reference line may be utilized for determining prediction parameters. In TMRL, the primary reference line and the secondary reference line may be selected from several candidates by matching them with the adjacent reference line (i.e., reference line 0) .
[0121] In general, both linear models and non-linear ones are applicable to combine predictors generated with involving 2 or more non-adjacent reference lines.
[0122] For an N-parameter linear model, the predicted sample p [x, y] at position (x, y) is calculated as follows:
[0123] In the above equation, L=N-1 is the number of the reference lines involved in the prediction process; wi is a weighting coefficient associated with reference line i. b is the bias term that defines the mean value within the predicted block. Thus, the number of model parameters equals L+1. Alternatively, the number N of model parameters can be defined by the number of reference samples involved in the prediction process.
[0124] For non-linear model where reference samples belonging to the involved reference lines (2 or more) are combined by using some heuristic rules based, for example, on the template matching procedure as FIGs. 13 to 15 illustrate. In that design, for a case of 2 reference lines, a reference line used for the angular prediction process is combined from the reference samples belonging to the reference lines A and B. FIG. 13 shows how template matching process is performed for each individual sample of reference lines A and B. To build a synthetic reference line, we select such reference samples that have a smaller difference with the reference samples of the adjacent reference line. To make this comparison possible, the following steps should be performed.
[0125] 1) Samples of reference lines A and B are interpolated onto the adjacent reference line according to a selected angular prediction direction to get values and to compare them with sample values of the adjacent reference line.
[0126] 2) The difference and is computed.
[0127] 3) For the synthetic reference line, such a sample value is taken that has the smallest difference with the adjacent reference line.
[0128] There exist different methods for derivation of prediction parameters of different models. For illustrative purpose, a case with two sets of reference samples is taken for introduction of these methods.
[0129] In one embodiment, the one or more prediction parameters comprise a bias. The operation of generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters includes: determining the predictor as a weighted sum of predictors of the plurality sets of reference samples for the current block plus the bias. In this embodiment, weights of the predictors of the plurality sets of reference samples are pre-configured.
[0130] The bias may be determined as a mean value difference between a weighted sum of mean values of the plurality sets of reference samples and a mean value of the set of template samples. It should be noticed. Weights of the mean values of the plurality sets of reference samples are equal to the weights of the predictors of the plurality sets of reference samples
[0131] For example, in a 1-parameter model, just mean / DC level changes are compensated to minimize the difference between the mean value of the adjacent reference line and the mean value of the predictor based on reference line fusion. This prediction model for the predicted sample p [x, y] looks as follows : p [x, y] = w0 ·p0 [x, y] + w1 ·p1 [x, y] + Δm
[0132] In the above equation, x and y are coordinates, which define the location of sample p within the predicted block; p0 [x, y] and·p1 [x, y] are intermediate sample values obtained by predicting the sample at the position of (x, y) using the primary reference line and the secondary one, respectively; w0 and w1 are the weighting coefficients that take predefined fixed values for given reference line indices; Δm is the difference between the mean value of the adjacent reference line and the weighted average mNON-ADJ of the mean values of the 2 non-adjacent reference lines: mNON-ADJ = w0 ·m0 + w1 ·m1
[0133] In the above equation, m0 and·m1 are the mean values of the primary and secondary non- adjacent reference lines. Thus, Δm is defined as Δm = mADJ -mNON-ADJ. Note that w0 and w1 can take different values for different reference lines. This model might be efficiently used when illumination conditions are changing significantly from a reference line to a reference line that results in considerable variations of the mean values of these reference lines.
[0134] In another embodiment, the one or more prediction parameters comprise a plurality of weights. The operation of generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters includes: determining the predictor as a weighted sum of predictors of the plurality sets of reference samples for the current block according to the plurality of weights.
[0135] Accordingly, the weights of the predictors of the plurality sets of reference samples for calculating the set of template samples may be derived by solving a linear regression between the set of template samples and a weighted sum of predictors of the plurality sets of reference samples. It should be noticed, weights of the predictors of the plurality sets of reference samples for the set of template samples are same as the plurality of weights of the plurality sets of reference samples for generating the predicted block.
[0136] A specific way for deriving the weights involves Template Matching (TM) cost calculation. A plurality of template matching costs of predictors of the plurality sets of reference samples with regard to the set of template samples may be calculated, and the plurality of weights of the plurality sets of reference samples may be derived based on the plurality of template matching costs.
[0137] For example, in a 2 parameter model, two weighting coefficients are adjusted. This model is defined by the following formula: p [x, y] = w0 ·p0 [x, y] + w1 ·p1 [x, y]
[0138] In the above equation, w0 and w1 are the weighting coefficients, which can be derived by solving a linear regression (the difference between the adjacent reference line and the 2 non-adjacent reference lines is minimized) or by using the approach adopted in TIMD (Template-based Intra-prediction Mode Derivation) . In the latter case, template matching (TM) costs are calculated as the value of a metric (e.g., SAD, HAD, MR-SAD) between the adjacent reference line and a non-adjacent reference line projected onto the adjacent reference line according to a given angular prediction direction. The weights w0 and w1 are computed from their TM costs as follows: w0 = c1 / (c0 + c1) w1 = 1 –w0
[0139] In the above equations, c0 and c1 are the TM costs for the primary and secondary non-adjacent reference lines, respectively. This 2-parametric model can be considered as an alternative to building a synthetic (synthesized) reference line as this model can be applied to reference lines piecewisely and higher weights can be assigned to reference samples, which have better correlation with the adjacent reference line.
[0140] In another embodiment, the one or more prediction parameters comprise a plurality of weights and a bias. The operation of generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters includes: determining the predictor as a weighted sum of predictors of the plurality sets of reference samples for the current block according to the plurality of weights plus the bias.
[0141] Accordingly, the plurality of weights of the plurality sets of reference samples and the bias may be acquired by solving a linear or non-linear regression between the set of template samples, predictors of the plurality sets of reference samples for the set of template samples, the plurality of weights for the predictors, and the bias.
[0142] For example, a 3-parameter model includes weighting coefficients and a bias term. Accordingly, the predicted sample p [x, y] can be computed as follows: p [x, y] = w0 ·p0 [x, y] + w1 ·p1 [x, y] + b
[0143] In the above equation, w0 and w1 are the weighting coefficients derived, for example, by using any method to solve a linear regression (usually, resulting in getting such parameter values that correspond to the minimal value of L2-norm for a given order of the selected regression model) ; b is the bias term that defines the DC level within the predicted block. To solve the linear regression, a source matrix is constructed from samples of non-adjacent reference subarea, and a target matrix is constructed from samples of the adjacent reference subarea. This model combines the advantages of the two previous models, i.e. different weights are assigned to different reference lines and the illumination changes are compensated by the bias term b.
[0144] It should be understood, other models can also be used to combine non-adjacent reference lines even if their efficiency can hardly exceed that of the above-mentioned models for camera-generated content.
[0145] On the other hand, a possible implementation may relate the model size (i.e. number of model parameters) to the overall number of reference samples being used for prediction. Such dependency may e.g. be obtained indirectly from the coded block size or prediction mode. In general, one would expect the model size to grow with increasing number of reference samples, which is closely related to an overfitting phenomena known from machine learning. This dependency may be linear or non-linear (e.g. quadratic or logarithmic) .
[0146] Alternatively, the multiple sets of reference samples may be determined by classifying a given reference area. For example, the operation of determining the plurality sets of reference samples for the current block may include: determining a reference area of the current block; applying a specific filtering operator to at least part of samples within the reference area to acquire filtered results of the samples within the reference area; and dividing the samples within the reference area into the plurality sets of reference samples based on the filtered results.
[0147] The reference area includes reconstructed samples used not only for predicting the current block but also for prediction parameter derivation. For example, the reference area may include one or more of reference lines (adjacent or non-adjacent to the current block) . Positions of the reference area may be applied with a classifier so as to divide samples within the reference area into several (at least two) groups, i.e., the reference area may be divided into several subareas. Values of prediction parameters to be applied to reference samples of each subarea may be derived. The derivation methods can include both mathematically substantiated approach based, for example, on solving a system of linear equations and heuristics-based algorithms with TM cost involvement. Then the derived prediction parameters may be applied to samples of each subarea of the reference area to generate the predictor of the current bock.
[0148] FIG. 16 illustrates a predicted block and a reconstructed area. The reconstructed area is the source of reference samples for the block if it is intra-coded or predicted using Combined Intra / Inter-Prediction (CIIP) . In addition to the inherent features of the reference samples such as geometric location, the determination of reference subareas can be more efficient by involving a classifier. This classifier differentiates reference samples by acquiring a set of neighboring reference samples within the proximity defined by the size of a sliding window and categorizes this set as belonging to one of the groups by estimating some features of these reference samples within the window (e.g., an edge operator of NxM size can be considered as one of the particular embodiments of the concept of the sliding window) .
[0149] The basic idea behind this solution is to classify the reference samples involved in intra prediction (reference line) fusion into (two) groups and to derive the prediction parameters for each group separately.
[0150] FIG. 17 depicts a block predicted using an adjacent reference subarea (exemplarily represented by reference line 0 also referred to as “adjacent reference line” and a non-adjacent reference subarea (comprising 2 non-adjacent reference lines) . In this specific case, when a classifier is applied to the reference area, just samples within the two non-adjacent reference subareas are split into two groups. For predefined regression models, values of prediction parameters to be applied to the groups of reference samples for predicting the current block by fusing reference samples of different groups may be derived as follows: 1) samples belonging to each group are projected onto the adjacent reference subarea; 2) independently for the groups, their projected samples are matched with the collocated samples of the adjacent reference subarea, and is performed to build input matrices for solving the regression models; 3) the regression models are solved that results in getting the sets of regression model parameters for each group. Then, the derived values of the regression model parameters may be applied to the non-adjacent reference subareas to determine the predicted block. In this solution, such a predictor is constructed in a way that at least one of its predicted samples is obtained as a combination of samples belonging to several different subareas (i.e. the non-adjacent subarea should include samples belonging to these groups) , and at least some prediction parameters are derived (i.e. determined with regard to the adjacent reference line) rather than being predefined.
[0151] The filtering operator for classifying the reference area to acquire the multiple sets of reference samples may be an m by n edge operator, where m and n are positive integers larger than one (m≥1, n≥1) . The size m may be equal to the size n, or the size m may be different from the size n.
[0152] In one embodiment, the operation of applying the specific filtering operator to at least part of samples within the reference area to acquire filtered results of the samples within the reference area may include: applying the edge operator to samples within the reference area from a first position to a last position to acquire a gradient magnitude parameter and a gradient direction parameter at each position. In this case, the gradient magnitude parameter is an absolute sum of a horizontal gradient and a vertical gradient, the gradient direction parameter is an angle difference between a first angle derived from the horizontal gradient and the vertical gradient and a second angle corresponding to a directional prediction mode of the current block.
[0153] FIG. 18 shows an exemplary implementation of the filtering operator. As shown in FIG. 18, an edge operator may be applied to reference samples involved in the prediction process (e.g., interpolation filtering or gradient PDPC) . As the output of the edge operator, we get the gradient magnitude of M and the gradient directionality defined by the variable A. These output values may be utilized for classification of the reference samples. In FIG. 18, the filtering operator includes a horizontal edge operator Fx and a vertical edge operator Fy, which are:
[0154] The process for acquiring the gradient magnitude parameter and the gradient direction parameter includes: fetching the reference subarea including reference samples of 2×2 size (e.g., S00, S01, S10, and S11 as shown in FIG. 18) ; applying the 2×2 edge operator; computing the values of Gx and Gy; and calculating the values of M and A.
[0155] The values of the horizontal Gx and vertical Gy gradient components are computed by elementwisely multiplying the 2x2 Sxy matrix of reference samples (i.e. S00, S01, S10, S11) by the edge operator kernels Fx and Fy, respectively: Gx=Sxy·Fx Gy=Sxy·Fy
[0156] where
[0157] Substituting scalar values into the above formula, we get the following expression: Gx=S00· (-1) + S01· (-1) +S10· (1) +S11· (1) Gy=S00· (1) + S01· (-1) +S10· (1) +S11· (-1)
[0158] The value of the gradient magnitude M and the gradient direction A are calculated as follows: M=abs (Gx) +abs (Gy)
[0159] where tan-1 () stands for the inverse tangent function.
[0160] It should be understood, the above edge operator is merely an example. The edge operator may be of different kernels and / or sizes based on different contents included in the reference area. Other types of filtering operators may be utilized, as long as they can be used to generate the gradient magnitude parameter and the gradient direction parameter.
[0161] Outputs of the filtering operator (denoted as gradient magnitude parameter Mi and gradient direction parameter Ai) may then be compared with a given gradient magnitude threshold (denoted as MTHR) and a given reference angle (denoted as Ar) . The difference between the gradient direction parameters and the reference angle is determined as ΔAi=Ai-Ar, and the result is compared with a direction difference threshold (denoted as ΔATHR) . Samples within the reference area may be divided into two groups based on whether their corresponding outputs satisfy the threshold, for example, whether satisfy Mi > MTHR and ΔAi<ΔATHR.
[0162] In an alternatively implementation, multiple thresholds (intervals) can be utilized, and by comparing the corresponding filtering outputs of samples with these thresholds, samples within the reference area can be divided into more than two groups.
[0163] The above-described filtering operator serves to acquire the directional property of the reference area. It should be understood, other types of operators to determine directionality within the reference area could be engaged.
[0164] One approach for determining the directionality within the reference area may include: 1) determining a subarea by applying an edge or line detector; 2) applying an edge operator inside this subarea to determine direction within the subarea. The purpose of this combination is to apply edge detection only within such areas of reference samples, that contain directional content.
[0165] For example, for larger reference areas (e. g, with template width greater than 8 or template height greater than 8) directionality could be detected by applying e.g., edge detector based on the Gabor filter (see, e.g., Mehrotra, R. &Namuduri, Kamesh &Ranganathan, N.. (1992) . Gabor filter-based edge detection. Pattern Recognition. 25.1479-1494.10.1016 / 0031-3203 (92) 90121-X) . Based on the results of Gabor edge detection, a subarea in the reference area is selected, e.g. edge operator is applied to the positions that are detected, i.e. classified to be a part of an edge.
[0166] For example, line detection using Radon transform (and its variations, e.g., weighted Radon transform) could be utilized to detect position of lines within the template area. Result of line detection is further used to specify a subarea, in which edge operators are applied.
[0167] Another approach to determine a subarea is to apply a texture Segmentation method. In this method, edge operator is applied to the samples that are located on the boundaries of textures of different classes. For more details, please refer to “Texture Segmentation Comparison Using Grey Level Co-occurrence Probabilities and Markov Random Fields” (David A, Claussi and Bing Yue) .
[0168] For the sets of reference samples determined in the above way, the prediction parameters for them in generating the predictor of the current block may be determined in a similar way as the sets of reference samples located in different sub-reference areas (e.g., primary reference line and secondary reference line) , which has been explained in foregoing sections and will not be repeated herein. Additionally, a multi-model mechanism can be applied.
[0169] Specifically, the one or more prediction parameters may include a plurality pairs of linear model parameters. Each of the plurality pairs of linear model parameters comprises a weight and a bias. The operation of generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters includes: applying the plurality pairs of linear model parameters for the plurality of sets of reference samples respectively to generate the predictor.
[0170] Correspondingly, the operation of deriving the one or more prediction parameters with regard to the plurality sets of reference samples by using the set of template samples may include: solving a linear regression between samples within each set of the plurality sets of reference samples and corresponding samples within the set of template samples to derive a corresponding pair of linear model.
[0171] That is, for each class (group) of samples, a linear model is assigned and the parameters of this model are derived using just the reference samples belonging to this class. Taking two classes (class 0 and class 1) of samples as example, the predicted sample p [x, y] at position (x, y) is calculated as follows:
[0172] In the above equation, pinterp [x, y] is the sample value within the current block obtained by interpolating reference samples, which can belong to either class 0 or class 1 according to the classifier results. So, the model parameters w and b are selected according to the class of samples involved in the interpolation process. In the case, when a projection falls onto a sub-sample position, the class of the nearest samples is considered to determine the class of the interpolated sample.
[0173] The subscripts of 0 and 1 can denote the index of a reference sample group determined by a classifier rather than the index of a reference line ( “0” and “1” for a primary reference one and a secondary one, respectively) . In the case of a classifier with a binary output (i.e. splitting reference samples into 2 groups) , the above description is valid. Thus, the same models can be used in the design with the binary classifier. However, non-binary classifiers, which split reference samples into more than 2 groups, require models with a bigger number of prediction parameters.
[0174] The present disclosure further provides a directional intra-prediction method. The method shares a similar idea of prediction based on content properties as the method above, but is achieved in a different way. FIG. 19 is a flowchart of a directional intra-prediction method according to an embodiment of the present disclosure. As shown in FIG. 19, the method may include operations described in blocks S201 to S204. The basic idea behind this solution is to select intra-prediction interpolation filtering parameters (e.g., filter type, its strength, etc. ) based on the result of a classifier applied to the reference samples involved in the intra prediction process. Note that this solution is applicable to both: a scenario where just one reference line is used for angular prediction and the intra prediction fusion where 2 or more angular predictors obtained from 2 or more reference lines are combined together (e.g., as a weighted average of these 2 or more predictors) .
[0175] In S201, a reference area of a current block may be determined.
[0176] The reference area may be, for example, multiple reference lines adjacent or not adjacent to the current block. The template area may be pre-defined (e.g., by the coding standard) , or it may be indicated by an encoder to the decoder in a bitstream.
[0177] In S202, a specific filtering operator is applied to samples and / or proximity of samples within the reference area to acquire filtering results of the samples within the reference area.
[0178] The specific filtering operator, also can be noted as a classifier, may be applied to the proximity of the reference samples to acquire the filtering results at positions of the reference area.
[0179] In one embodiment, each of the filtering results comprises a gradient magnitude parameter and a gradient direction parameter. The gradient magnitude parameter is an absolute sum of a horizontal gradient and a vertical gradient. The gradient direction parameter is an angle difference between a first angle derived from the horizontal gradient and the vertical gradient and a second angle corresponding to a directional prediction mode of the current block.
[0180] For example, the specific filtering operator may be a 2 by 2 edge operator comprising a horizontal edge operator and a vertical edge operator.
[0181] FIG. 20 conceptually shows an application of a 2×2 edge operator to positions of a reference area of the current block. In FIG. 20, the reference area include a primary reference line adjacent to the current block and a secondary reference line. FIG. 21 conceptually shows another application of a 2×2 edge operator to positions of a reference area of the current block. In FIG. 21, the reference area include a primary reference line and a secondary reference line which are both non-adjacent to the current block.
[0182] In S203, a first interpolation filter is applied to a first subset of samples within the reference area to generate a first set of predicted samples of the current block.
[0183] In S204, a second interpolation filter is applied to a second subset of samples within the reference area to generate a second set of predicted samples for the current block.
[0184] FIG. 22 illustrates a flowchart about how to make a decision on utilization of the first interpolation filter (non-smoothing filter) and the second interpolation filter (smoothing filter) .
[0185] The specific filter operator applied to the reference area may be similar to that described in FIG. 18. Similarly, the gradient magnitude parameter and the gradient direction parameter may be determined in a same way as that of FIG. 18. Specifically, for each of reference samples contained in the reference area, a classifier is applied to the proximity of the reference sample with an index value of i to obtain the gradient parameters Mi (magnitude) and Ai (angle’s tangent, directionality) .
[0186] The obtained values of the gradient parameters Mi (magnitude) and Ai (angle’s tangent, directionality) are compared with the threshold values of MTHR and ATHR to identify whether a gradient value has a significant magnitude (i.e. corresponding to an edge or a strong texture) and if so, this directionality is aligned with the angular direction used to predict the block. If this condition is met, a non-smoothing filter is selected for these part of reference samples encompassed by the classifier; otherwise, a smoothing filter should be taken.
[0187] The gradient magnitude threshold may be determined based on a size of the current block. For example, the gradient magnitude threshold may be determined based on a size of the current block and a bit-depth of a color component to be predicted within the current block. Alternatively or additionally, the gradient magnitude threshold may be determined based on a size of the current block and a sample value range within a selected area.
[0188] Similarly, the angle difference threshold may be determined based on a size of the current block.
[0189] An exemplary values of the thresholds is given in Table 1.
[0190] Table 1
[0191] The value of bit-depth is the number of bits per sample for a given color component (e.g., for luma or one of the chroma components) in the reconstructed picture. Since the bit-depth defines the valid range of sample values for the given color component, it determines the range of sample differences, what gradients essentially are. So, the thresholds MTHR in Table 1 specify how big the differences between neighboring samples should be to consider them significant.
[0192] Secondly, the thresholds in ΔATHR Table 1 specify how small the difference between the gradient direction and the direction derived from an intra prediction mode should be to consider them aligned. If the absolute value of the angular mode difference ΔAi is less than the threshold, the decision for this sample position is that the direction is aligned. Since smaller blocks usually localize areas of high activity like edges and strong textures, which require accurate prediction, the threshold value of the angular mode difference ΔATHR is kept small. On the contrary, larger blocks tend to localize smoother areas where the requirements for the accuracy of angular predictors are not that strong. Hence, the threshold value ΔATHR of an angular mode difference can be greater than that for smaller blocks.
[0193] In another case, the gradient magnitude threshold may be defined adaptively for each block. Although this method may bring higher computational complexity, it may achieve higher accuracy compared with the previous one. This method is s based on estimating the actual range of reconstructed samples in the proximity of a current (predicted) block instead of sticking to the predefined value computed with using the color component bit-depth, which defines the maximum range of sample values.
[0194] In a first step, the reconstructed area where the range of values should be estimated is defined. For example, this range may be evaluated within the area limited by 13 lines above and 13 lines to the left so as to keep this area aligned with the reference area available for TMRL that allows us to avoid extending the internal memory buffer for our method compared to the prior-art.
[0195] In a second step, the minimal sample value (Smin) and maximum sample value (Smax) values of samples for a given color component are found by iterating over the reconstructed area defined at the first step. That is, the actual sample range is [Smin, Smax] .
[0196] Then the range width is calculated as: ΔS = Smax -Smin. And the gradient threshold may be defined according to the sample range width. An example is given in Table 2.
[0197] Table 2
[0198] Based on any of the above methods, samples within the reference area may be divided into a first subset of samples and a second subset of samples. The filtering results of the first subset of samples meet the specific threshold (i.e., Mi > MTHR and ΔAi<ΔATHR) . The filtering results of the second subset of samples does not meet the specific threshold (i.e., Mi < MTHR or ΔAi>ΔATHR) . Thus, the first subset of samples represents samples with significant gradient in the direction aligned with the direction derived from an intra prediction mode for generating a predictor for the current block.
[0199] Accordingly, a first interpolation filter may be applied to the first subset of samples while a second interpolation filter may be applied to the second subset of samples. In some embodiments, the first interpolation filter is a non-smoothing filter, and the second interpolation filter is a smoothing filter. In other words, the second interpolation filter is more “smoothing” than the first interpolation filter. A smoothing filter may generate filtering results which is smoother (e.g., with smaller variance) compared with the original values to which the smoothing filter is applied.
[0200] Moreover, the first set of predicted samples and the second set of predicted samples may be “merged” to generate prediction for the current block. For example, fixed weights of 0.75 and 0.25 may be used for the first set of predicted samples and the second set of predicted samples respectively. Alternatively, adaptive weight determination as explained in foregoing sections of the present disclosure may be adopted.
[0201] It is worth noting that interpolation filters applied to different reference lines might be of different sizes (e.g., a 6-tap and 8-tap filters are applied to a primary reference line and a secondary one, respectively) .
[0202] The present disclosure further provides a directional intra-prediction method. The method shares a similar idea of prediction based on content properties as the method above, but is achieved in a different way. FIG. 23 is a flowchart of a directional intra-prediction method according to yet another embodiment of the present disclosure. As shown in FIG. 23 the method may include operations described in blocks S301 to S304. The basic idea behind this solution is, on the one hand, to extend gradient Position-Dependent Prediction Combination (PDPC) to negative angular modes, where gradient PDPC is not applied yet, and, on the other hand, to propagate gradient values into a predicted block in a more adaptive way that allows to selectively enable and disable this propagation into the block. FIG. 24 illustrates the gradient PDPC mechanism applied to negative angular modes.
[0203] In S301, a reference area of a current block is determined.
[0204] The reference area may be, for example, multiple reference lines adjacent or not adjacent to the current block. The template area may be pre-defined (e.g., by the coding standard) , or it may be indicated by an encoder to the decoder in a bitstream.
[0205] In S302, a specific filtering operator is applied to samples and / or proximity of samples within the reference area to acquire filtering results of the samples within the reference area.
[0206] The specific filtering operator, also can be noted as a classifier, may be applied to the proximity of the reference samples to acquire the filtering results at positions of the reference area.
[0207] In one embodiment, the specific filtering operator is an edge operator (e.g., a 2×2 edge operator) including a horizontal gradient operator and a vertical gradient operator. Each of the filtering results comprises a gradient magnitude parameter and a gradient direction parameter. The gradient magnitude parameter is an absolute sum of a horizontal gradient and a vertical gradient. The gradient direction parameter is an angle difference between a first angle derived from the horizontal gradient and the vertical gradient and a second angle corresponding to a directional prediction mode of the current block.
[0208] That is, the edge operator is applied to the proximity of the reference sample with the index value of i to obtain the gradient parameters Mi (magnitude) and Ai (angle’s tangent, directionality) .
[0209] In S303, if the filtering results of a subset of samples within the reference area meet a specific threshold, an intensity difference along a specific direction between a first sample of the first reference line and a second sample of the second reference line at each of the subset of samples is determined.
[0210] The obtained values of the gradient parameters Mi (magnitude) and Ai (angle’s tangent, directionality) are compared with the threshold values of MTHR and ATHR to identify whether a gradient value has a significant magnitude (i.e. corresponding to an edge or a strong texture) and, whether this directionality is aligned with the angular direction used to predict the block. The filtering operator, the filtering results and the thresholds may be implemented in the same way as the method described in foregoing sections of the present disclosure, and, for simplicity and clarity, will not be repeated herein.
[0211] If the condition is met (i.e., Mi > MTHR and ΔAi<ΔATHR) for a subset of samples i within the reference area, the value of ΔGi should be derived. ΔGi represents the intensity difference between a first sample and a second sample. The first sample belongs to a first reference line and the second sample belongs to a second reference line. Moreover, the first sample and the second sample are along a specific direction. As described in foregoing sections of the present disclosure, prediction results of directional intra prediction modes may be acquired through reference sample smoothing or reference sample interpolation filtering. In the former case, ΔGi may be determined based on the difference between the smoothing results with regard to the first sample and the second sample. In the latter case, ΔGi may be determined based on the difference between the interpolation results with regard to the first sample and the second sample.
[0212] In one embodiment, the specific direction corresponds to a selected directional intra-prediction mode for the current block. In another embodiment, the specific direction corresponds to a direction represented by the specific filtering operator.
[0213] The process for acquiring the value of difference ΔG that is determined for a sample position in the reference area of a predicted block is shown in FIG. 25. There are several ways to achieve the process.
[0214] In one embodiment, the operation of determining the intensity difference along the specific direction between the first sample of the first reference line and the second sample of the second reference line may include: determining a first subsample position corresponding to the first sample at either the first reference line or the second reference line based on a per-row subsample increment specified for a selected directional intra-prediction mode for the current block; determining a second subsample position corresponding to the second sample at a same reference line as the first subsample position based on the per-row subsample increment specified for the selected directional intra-prediction mode for the current block; applying an interpolation filter to the first subsample position to acquire a first interpolation result; applying the interpolation filter to the second subsample position to acquire a second interpolation result; and calculate the difference between the first interpolation result and the second interpolation result to acquire the intensity difference.
[0215] Specifically, the value of difference ΔG is calculated in the direction specified by the intra prediction mode of the block being predicted. For a sample position within reference line 0, a subsample position on reference line 0 is determined (e.g., by taking the value of a per-row subsample increment specified for the intra prediction mode) , whereas for a sample position within reference line 1, a subsample position on reference line 0 is determined (e.g., using the same way as for reference line 0) . In the determined subsample positions, interpolation filters are applied to reference samples of reference lines 0 and 1 so as to obtain the value v0 and the value v1 for reference lines 0 and 1, respectively. Hence, the values v0 and v1 geometrically correspond to the projections of a given sample within the predicted (current) block onto reference lines 0 and 1 according to the applied angular mode. Thus, the difference ΔG is calculated as follows: ΔG=v0-v1
[0216] In another embodiment, the operation of determining the intensity difference along the specific direction between the first sample of the first reference line and the second sample of the second reference line may include: determining a first subsample position corresponding to the first sample at either the first reference line or the second reference line based on a direction represented by the specific filtering operator; determining a second subsample position corresponding to the second sample at a same reference line as the first subsample position based on the direction represented by the specific filtering operator; applying a first interpolation filter to the first subsample position to acquire a first interpolation result; applying a second interpolation filter to the second subsample position to acquire a second interpolation result; and calculate the difference between the first interpolation result and the second interpolation result to acquire the intensity difference.
[0217] Specifically, the value of difference ΔG is calculated in the direction specified by the edge operator (the direction corresponding to one of the bins of the HoG, e.g., the direction corresponding to the HoG bin with the highest magnitude) applied in the area of the sample position for which ΔG is calculated. This alternative embodiment might require to double the number of interpolation operations as the gradient directions might differ from the prediction direction that results in interpolating a sample of the predicted block from both reference lines according to the gradient direction. This method involves the following steps.
[0218] 1) According to the gradient direction A obtained at one of the previous steps, the fractional sample position p0 and the fractional sample position p1 are inferred for a primary reference line (reference line 0) and a secondary reference line (reference line 1) , respectively. This operation is similar to that for conventional angular prediction.
[0219] 2) According to the fractional sample position p0 and the fractional sample position p1, 2 sets and of interpolation filter coefficients are either fetched from look-up tables or computed for the primary reference line (reference line 0) and the secondary reference line (reference line 1) , respectively. L0 and L1 denote the lengths of interpolation filters applied to the primary reference line (reference line 0) and the secondary reference line (reference line 1) , respectively.
[0220] 3) Interpolation is performed for both the primary reference line (reference line 0) and the secondary reference line (reference line 1) that results in the interpolated sample values and respectively.
[0221] 4) The difference ΔG is calculated as
[0222] Note that the lengths of interpolation filters applied to the primary reference line (reference line 0) and the secondary reference line (reference line 1) can be same in the most practical use-cases. The sets of interpolation filter coefficients denoted as and can be found in the prior art including the specifications of video coding standards such as H. 265 / HEVC and H.266 / VVC.
[0223] In S304, the intensity difference is applied to generate a corresponding predicted sample.
[0224] FIG. 26 illustrates the complete process for determination and propagation of the intensity difference ΔGi. Once the subset of samples i within the reference area and values of ΔGi are derived, values of ΔGi may be propagated into the predicted block. In this way, gradients of the adjacent reference area is propagated inside the predicted block.
[0225] In this operation, the value of difference ΔG that is determined for a sample position in the boundary area of a predicted block is further propagated inside the predicted block in the direction determined by an intra prediction mode specified for the block. In another embodiment, propagation direction of the difference ΔG is determined locally, e.g. by applying an edge operator.
[0226] Specifically, the operation of applying the intensity difference to generate a corresponding predicted sample includes: adjusting the corresponding predicted sample based on the intensity difference and a position of the corresponding predicted sample within the current block.
[0227] The position of the corresponding predicted sample can be used to reflect a distance from the sample i with the intensity difference ΔGi and the corresponding predicted sample. This distance may be further applied in a “decay function” , which means the further the corresponding predicted sample is away from the sample i, the weaker the influence of the intensity difference ΔGi to the predicted sample should be.
[0228] For example, for vertical directions (i.e. directions with the mode index greater than or equal to 34 for the normal angular mode precision and 66 for the extended angular mode precision specified in TIMD and TMRL) , predicted samples are determined as:
[0229] ΔG is a gradient magnitude determined for the reference samples that are used to intra-predict a sample at position (x, y) ; and f (y) is a decay function which could be defined as: f (y) =1 / dy
[0230] d is the base, which defines how fast the propagated value decays to 0 with increasing of y. This parameter d usually takes the values, which are a power of 2, i.e. 2k, where k is a positive integer greater than 0. Hence, d can be equal to 2, 4, 8, 16, etc. so as to use a right shift operation instead of a division operation.
[0231] Similarly, for horizontal directions (i.e. directions with the mode index less than 34 for the normal angular mode precision and 66 for the extended angular mode precision specified in TIMD and TMRL) predicted samples are determined as:
[0232] and f (x) =1 / dx
[0233] d is the base, which defines how fast the propagated value decays to 0 with increasing of x. Like in the case of vertical directions, this parameter d usually takes the values, which are a power of 2, i.e. 2k, where k is a positive integer greater than 0. Hence, d can be equal to 2, 4, 8, 16, etc. so as to use a right shift operation instead of a division operation.
[0234] FIG. 27 conceptually illustrates a video coding apparatus 400 with which some embodiments of the invention are implemented. The apparatus may be a video encoder or a video decoder. The apparatus 400 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 400 includes a processor 402 and a memory 404. The memory 404 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.
[0235] The processor 402 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 402.
[0236] 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.
[0237] 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.
[0238] 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.
[0239] 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.
[0240] 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.
[0241] 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.
[0242] 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.A prediction method for video decoding, comprising:determining a plurality sets of reference samples for a current block;deriving one or more prediction parameters with regard to the plurality sets of reference samples by using a set of template samples; andgenerating a predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters.2.The method of claim 1,wherein the plurality sets of reference samples comprise a first reference line and a second reference line which are not adjacent to the current block;wherein the set of template samples comprises a third reference line which is adjacent to the current block.3.The method of claim 1, wherein the one or more prediction parameters comprise a bias, and wherein the generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters comprises:determining the predictor as a weighted sum of predictors of the plurality sets of reference samples for the current block plus the bias;wherein weights of the predictors of the plurality sets of reference samples are pre-configured.4.The method of claim 3, wherein the deriving the one or more prediction parameters with regard to the plurality sets of reference samples by using the set of template samples comprises:determining the bias as a mean value difference between a weighted sum of mean values of the plurality sets of reference samples and a mean value of the set of template samples;wherein weights of the mean values of the plurality sets of reference samples are equal to the weights of the predictors of the plurality sets of reference samples.5.The method of claim 1, wherein the one or more prediction parameters comprise a plurality of weights, and wherein the generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters comprises:determining the predictor as a weighted sum of predictors of the plurality sets of reference samples for the current block according to the plurality of weights.6.The method of claim 5, wherein the deriving the one or more prediction parameters with regard to the plurality sets of reference samples by using the set of template samples comprises:solving a linear regression between the set of template samples and a weighted sum of predictors of the plurality sets of reference samples for the set of template samples to acquire weights of the predictors of the plurality sets of reference samples for the set of template samples;wherein the weights of the predictors of the plurality sets of reference samples for the set of template samples are same as the plurality of weights.7.The method of claim 5, wherein the deriving the one or more prediction parameters with regard to the plurality sets of reference samples by using the set of template samples comprises:determining a plurality of template matching costs of predictors of the plurality sets of reference samples with regard to the set of template samples; andderiving the plurality of weights based on the plurality of template matching costs of the plurality sets of reference samples.8.The method of claim 1, wherein the one or more prediction parameters comprise a plurality of weights and a bias, and wherein the generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters comprises:determining the predictor as a weighted sum of predictors of the plurality sets of reference samples for the current block according to the plurality of weights plus the bias.9.The method of claim 8, wherein the deriving the one or more prediction parameters with regard to the plurality sets of reference samples by using the set of template samples comprises:solving a linear or non-linear regression between the set of template samples, predictors of the plurality sets of reference samples for the set of template samples, the plurality of weights for the predictors, and the bias to acquire the plurality of weights and the bias..10.The method of claim 1, wherein the determining the plurality sets of reference samples for the current block comprises:determining a reference area of the current block;applying a specific filtering operator to at least part of samples within the reference area to acquire filtered results of the samples within the reference area; anddividing the samples within the reference area into the plurality sets of reference samples based on the filtered results.11.The method of claim 10,wherein the specific filtering operator is an m by n edge operator, where m and n are positive integers larger than one.12.The method of claim 11, wherein the applying a specific filtering operator to at least part of samples within the reference area to acquire filtered results of the samples within the reference area comprises:applying the edge operator to samples within the reference area from a first position to a last position to acquire a gradient magnitude parameter and an gradient direction parameter at each position;wherein the gradient magnitude parameter is an absolute sum of a horizontal gradient and a vertical gradient;wherein the gradient direction parameter is an angle difference between a first angle derived from the horizontal gradient and the vertical gradient and a second angle corresponding to a directional prediction mode of the current block.13.The method of claim 10,wherein the one or more prediction parameters comprise a plurality pairs of linear model parameters, wherein each of the plurality pairs of linear model parameters comprises a weight and a bias;wherein the generating the predictor for the current block based on the plurality sets of reference samples and the one or more prediction parameters comprises:applying the plurality pairs of linear model parameters for the plurality of sets of reference samples respectively to generate the predictor.14.The method of claim 13, wherein the deriving the one or more prediction parameters with regard to the plurality sets of reference samples by using the set of template samples comprises:solving a linear regression between samples within each set of the plurality sets of reference samples and corresponding samples within the set of template samples to derive a corresponding pair of linear model.15.A directional intra-prediction method for video decoding, comprising:determining a reference area of a current block;applying a specific filtering operator to samples and / or proximity of samples within the reference area to acquire filtering results of the samples within the reference area;applying a first interpolation filter to a first subset of samples within the reference area to generate a first set of predicted samples for the current block, wherein the filtering results of the first subset of samples meet a specific threshold; andapplying a second interpolation filter to a second subset of samples within the reference area to generate a second set of predicted samples for the current block, wherein the filtering results of the second subset of samples do not meet the specific threshold.16.The method of claim 15,wherein each of the filtering results comprises a gradient magnitude parameter and an gradient direction parameter;wherein the gradient magnitude parameter is an absolute sum of a horizontal gradient and a vertical gradient;wherein the gradient direction parameter is an angle difference between a first angle derived from the horizontal gradient and the vertical gradient and a second angle corresponding to a prediction direction of the current block.17.The method of claim 16,wherein the specific threshold comprises a gradient magnitude threshold and an angle difference threshold.18.The method of claim 17,wherein the angle difference threshold is determined based on a size of the current block.19.The method of claim 17,wherein the gradient magnitude threshold is determined based on a size of the current block and a bit-depth of a color component to be predicted within the current block.20.The method of claim 17,wherein the gradient magnitude threshold is determined based on a size of the current block and a sample value range within a selected area.21.The method of claim 15,wherein the first interpolation filter is a non-smoothing filter;wherein the second interpolation filter is a smoothing filter.22.The method of claim 15,wherein the specific filtering operator is a 2 by 2 edge operator comprising a horizontal edge operator and a vertical edge operator.23.A directional intra-prediction method for video decoding, comprising:determining a reference area of a current block, wherein the reference area comprises a first reference line and a second reference line;applying a specific filtering operator to samples and / or proximity of samples within the reference area to acquire filtering results of the samples within the reference area;in response to the filtering results of a subset of samples within the reference area meet a specific threshold:determining an intensity difference along a specific direction between a first sample of the first reference line and a second sample of the second reference line at each of the subset of samples; andapplying the intensity difference to generate a corresponding predicted sample, wherein the first sample, the second sample, and the corresponding predicted sample are substantially along the specific direction.24.The method of claim 23, whereinwherein each of the filtering results comprises a gradient parameter and an gradient direction parameter;wherein the gradient magnitude parameter is an absolute sum of a horizontal gradient and a vertical gradient;wherein the gradient direction parameter is an angle difference between a first angle derived from the horizontal gradient and the vertical gradient and a second angle corresponding to a directional prediction mode of the current block.25.The method of claim 24,wherein the specific threshold comprises a gradient magnitude threshold and an angle difference threshold.26.The method of claim 23,wherein the specific filtering operator is a 2 by 2 edge operator comprising a horizontal edge operator and a vertical edge operator.27.The method of claim 23,wherein the specific direction corresponds to a selected directional intra-prediction mode for the current block; orwherein the specific direction corresponds to a direction represented by the specific filtering operator.28.The method of claim 23, wherein the determining the intensity difference along the specific direction between the first sample of the first reference line and the second sample of the second reference line comprises:determining a first subsample position corresponding to the first sample at either the first reference line or the second reference line based on a per-row subsample increment specified for a selected directional intra-prediction mode for the current block;determining a second subsample position corresponding to the second sample at a same reference line as the first subsample position based on the per-row subsample increment specified for the selected directional intra-prediction mode for the current block;applying an interpolation filter to the first subsample position to acquire a first interpolation result;applying the interpolation filter to the second subsample position to acquire a second interpolation result; andcalculate the difference between the first interpolation result and the second interpolation result to acquire the intensity difference.29.The method of claim 23, wherein the determining the intensity difference along the specific direction between the first sample of the first reference line and the second sample of the second reference line comprises:determining a first subsample position corresponding to the first sample at either the first reference line or the second reference line based on a direction represented by the specific filtering operator;determining a second subsample position corresponding to the second sample at a same reference line as the first subsample position based on the direction represented by the specific filtering operator;applying a first interpolation filter to the first subsample position to acquire a first interpolation result;applying a second interpolation filter to the second subsample position to acquire a second interpolation result; andcalculate the difference between the first interpolation result and the second interpolation result to acquire the intensity difference.30.The method of claim 23, wherein the applying the intensity difference to generate a corresponding predicted sample comprises:adjusting the corresponding predicted sample based on the interpolation difference and a position of the corresponding predicted sample within the current block.31.The method of claim 30, when a direction of a directional prediction mode applied to the current block belongs to vertical directions, the corresponding predicted sample is determined as: whereinis adjusted value of the corresponding predicted sample at position (x, y) of the current block;p (x, y) is original value of the corresponding predicted sample at position (x, y) of the current block;ΔG is the intensity difference;f (y) is a decay function which is defined as:f (y) =1 / dywhereind is a preconfigured constant.32.The method of claim 30, when a direction of a directional prediction mode applied to the current block belongs to horizontal directions, the corresponding predicted sample is determined as: whereinis adjusted value of the corresponding predicted sample at position (x, y) of the current block;p (x, y) is original value of the corresponding predicted sample at position (x, y) of the current block;ΔG is the intensity difference;f (x) is a decay function which is defined as:f (x) =1 / dxwhereind is a preconfigured constant.33.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 32.34.A non-transitory 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 32.