Decoding method and encoding method for VIPM determination

WO2026199618A1PCT designated stage Publication Date: 2026-10-01SHENZHEN TCL NEW-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/086732
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-03-24
Filing Date
2025-04-01
Publication Date
2026-10-01

Smart Images

  • Figure CN2025086732_01102026_PF_FP_ABST
    Figure CN2025086732_01102026_PF_FP_ABST
Patent Text Reader

Abstract

A decoding method and an encoding method for VIPM determination are provided. The decoding method includes: determining a template area of the current block; generating a histogram of gradient (HoG) or histogram of occurrence (HoO) for the template area; determining a plurality of intra-prediction modes (IPMs) based on the HoG or HoO; deriving an aggregated IPM based on the plurality of IPMs; and determining a virtual intra-prediction mode (VIPM) of the current block based on the aggregated IPM.
Need to check novelty before this filing date? Find Prior Art

Description

DECODING METHOD AND ENCODING METHOD FOR VIPM DETERMINATIONTECHNICAL FIELD

[0001] The present disclosure generally relates to encoding and decoding technology, and in particular to a decoding method for VIPM determination, an encoding method for VIPM determination, a video coding apparatus, and a storage medium.BACKGROUND

[0002] Under the context of video compression, colour image or a frame of a colour video usually consists of three colour components, namely a luma component Y and two chroma components Cb and Cr. Each component is represented as a data matrix. The data matrix for each component is decomposed into blocks associated with specific encoding parameters. A block is usually a square or rectangle whose dimensions are integer powers of 2. The coding of an image is processed in raster scanning order: from left to right, then from top to bottom. Within a specific block or a plurality of blocks, luma component is usually coded before chroma components.

[0003] Popular video coding standards such as Versatile Video Coding (VVC) uses a prediction / transform hybrid coding framework. Prediction refers to predicting current block (i.e., the block to be coded) using coded blocks or coded areas within the same frame (i.e., intra prediction) or from a different frame (i.e., inter prediction) . When performing intra or inter prediction, the encoder tries multiple intra prediction modes available to the coding standard, computes and compares corresponding prediction blocks and chooses the best prediction mode. The difference between original current block and the prediction block generated by the chosen prediction mode, namely the residual, will also be coded. By transmitting prediction modes and residuals only, the encoder is able to instruct the decoder to decode and reconstruct the original image or video or its approximation.

[0004] Virtual intra prediction mode (VIPM) is a valid IPM index to be provided when a block is checked for the IPM index but is not coded in regular IPM. VIPM serves dual purposes in the coding process. Firstly, it acts as an index to retrieve the LFNST or NSPT transform kernel / set, which is then utilized for coding the residuals of a corresponding block. Secondly, VIPM is employed as the Intra Prediction Mode (IPM) for subsequent blocks that require the prediction mode of the current block for their coding.

[0005] In existing technologies, only one high-ranked mode in a histogram of gradient (HoG) is utilized as the VIPM to determine the final transform set for a coding block, which is only convincing when the amplitude of this high-ranked mode is significant enough. There is one case that the amplitudes among the high-ranked modes and low-ranked modes do not differ too much, where one top-ranked mode can hardly indicate the directionality of the prediction residuals. In other words, determining the final transform set depending on one high-ranked mode is not effective when the amplitude of this mode is not absolutely dominant in the HoG.SUMMARY

[0006] Accordingly, the present disclosure aims to provide a decoding method for VIPM determination, an encoding method for VIPM determination, a video coding apparatus, and a storage medium.

[0007] A technical scheme adopted by the present disclosure is to provide a decoding method. The method includes: determining a template area of the current block; generating a histogram of gradient (HoG) or histogram of occurrence (HoO) for the template area; selecting a plurality of intra-prediction modes (IPMs) based on the HoG or HoO; deriving an aggregated IPM based on the plurality of IPMs; and determining a virtual intra-prediction mode (VIPM) of the current block based on the aggregated IPM.

[0008] Another technical scheme adopted by the present disclosure is to provide an encoding method. The method includes: determining a template area of the current block; generating a histogram of gradient (HoG) or histogram of occurrence (HoO) for the template area; selecting a plurality of intra-prediction modes (IPMs) based on the HoG or HoO; deriving an aggregated IPM based on the plurality of IPMs; and determining a virtual intra-prediction mode (VIPM) of the current block based on the aggregated IPM.

[0009] Another technical scheme adopted by the present disclosure is to provide a video coding apparatus. The apparatus includes a processor and a memory. The memory is configured to store executable instructions that, when executed by the processor, cause the processor to perform any of the foregoing methods.

[0010] Another technical scheme adopted by the present disclosure is to provide a computer readable medium. The computer readable medium is configured to store executable instructions that, when executed by the processor, cause the processor to perform any of the foregoing methods.BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to clearly explain the technical solutions in the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are merely some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings may also be obtained based on these drawings without any creative work.

[0012] FIG. 1 illustrates directions of different angular modes in VVC and ECM.

[0013] FIG. 2 shows the process of a DIMD prediction mode according to related art.

[0014] FIG. 3 illustrates exemplary reference lines and templates for an 8 by 8 block in ECM-12.0 when TIMD is employed.

[0015] FIG. 4 is a flowchart of a decoding method for VIPM determination according to an embodiment of the present disclosure.

[0016] FIG. 5 shows a condition check process for determining whether the VIPM adjustment method should be applied.

[0017] FIG. 6 is a flowchart of an encoding method for VIPM determination according to an embodiment of the present disclosure.

[0018] FIG. 7 is a schematic diagram of a coding apparatus according to an embodiment of the present disclosure.DETAILED DESCRIPTION

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

[0020] To help understand the technical solutions proposed in the embodiments of this application, several related technologies of the present disclosure are introduced in following sections.

[0021] (1) Angular intra modes and non-angular intra modes

[0022] Current intra prediction modes can be roughly classified into two types: angular intra modes and non-angular intra modes. The basic idea of angular intra modes is to extend the pixels adjacent to a coding block along a certain angle to predict the pixel values within the coding block. Specifically, the encoder uses the pixel values of adjacent blocks to make predictions along specific predefined directions (angles) , which include horizontal, vertical, and several diagonal directions. By selecting the optimal prediction angle, the prediction error can be minimized, thus improving encoding efficiency. This technique is widely used in modern video coding standards such as H. 264 / AVC, H. 265 / HEVC and H.266 / VVC. Angular prediction can better adapt to edges and texture features in images, thereby enhancing compression efficiency and image quality.

[0023] VVC supports 65 angular modes, which currently is the same as ECM. In VVC and ECM, angular modes have 65 directions, coded as mode numbers 2 to 66, as shown in FIG. 1.

[0024] With the identification of angular intra modes, the rest intra modes are classified as non-angular intra modes in the present disclosure, such as the DC mode, the planar mode, DIMD, OBIC, TIMD, IntraTMP and so on. A more details about intra modes in ECM can be found in JVET-AI2025.

[0025] (2) Decode-side Intra Mode Derivation (DIMD)

[0026] In the recent video technology standardization activities, angular modes are extended to 65, and they are very likely to increase in the future for finer-grained angular prediction. If all of them are derived at the encoder side and explicitly signaled to a decoder, a significant amount of overhead will be spent on intra mode coding. For example, the intra mode signaling overhead once reached around 10%of overall bitrate in all intra coding configuration. To further improve the coding efficiency, one group of coding tools is continuously studied and developed. For these tools, instead of signaling intra mode explicitly, the mode information is derived at both encoder and decoder from the neighboring reconstructed samples of current block.

[0027] One typical coding tool with implicit mode derivation is DIMD. In this technique, one or more intra prediction modes are determined based on estimation of Histogram of Gradients (HOG) in a template area located to the left, above-left, and above the current block. For samples in the template area, several edge operators may be applied to them. Typically, one edge operator is a horizontal (it detects gradients for horizontally-aligned edges) and another one is a vertical edge detector (it detects gradients for vertically-aligned edges) . Results of these operations are correspondingly denoted as “horizontal gradient” Gx and “vertical gradient” Gy. These gradients are used to update a bin of HoG by increasing a value inside the bin by the sum of the absolute values of the gradients. Index of the bin is determined based on a ratio of Gx to Gy (or vice versa, Gy to Gx) and a combination of gradients’ signs.

[0028] FIG. 2 shows the process of a DIMD prediction mode according to related art.

[0029] In Step 101, the size and location of a coding block (can also be denoted as current block) are acquired. This information is used to check the availability of neighbouring reconstructed samples at Step 102. If at least either the above template or the left template is available, gradient parameters (such as the gradient direction and the gradient magnitude) are computed at Step 103 to build a Histogram of Gradients (HoG) . After the HoG is built, several modes with high-ranked magnitude values will be selected and their predictors will be blended to generate the final predictor at Step 104.

[0030] (3) Occurrence-based intra coding (OBIC)

[0031] OBIC derives the intra prediction modes of the current block based on the sample-wise occurrence of the intra modes in the spatial neighbourhood of the block. Instead of HoGs as in DIMD, the OBIC method uses the Histogram of Occurrence (HoO) , which consists of the intra modes and their sample-wise occurrences. For this mode, adjacent and non-adjacent spatial neighbouring blocks are checked and the intra prediction modes of the blocks are collected to build the occurrence histogram. The occurrences are calculated based on the number of samples that are coded in a certain intra prediction mode in that neighbourhood. Several modes with the highest occurrence (same as in DIMD) are selected from the histogram and used for final prediction by blending the prediction of the selected modes. The blending weights are calculated similar to the DIMD mode, but instead of using gradient values from the template, the occurrences are used for OBIC.

[0032] (4) Template-based Intra Mode Derivation (TIMD)

[0033] TIMD is proposed in JVET-V0098. In this method template cost is being calculated for modes of the most probable modes (MPM) list. The template cost is obtained for the neighbouring areas of previously reconstructed samples. One of these areas are above the current block and the other one is to the left of the current block.

[0034] For each mode of the MPM list, a sum of the template costs for the template areas is calculated, which may be based on a sum of absolute differences (SAD) or a sum of absolute transformed differences (SATD) metric, and the mode that provides the smallest sum of template costs is selected as a TIMD mode. The definition of the template and reference lines may be slightly different during the developing process of this tool. An illustration for an 8x8 block in ECM-12.0 is showed in FIG. 3.

[0035] Encoder may indicate a flag, which indicates that for a block TIMD mode is selected, instead of signalling this intra prediction mode explicitly. On the decoder side, based on this indication, the intra prediction mode could be restored by the same check of the MPM list that was performed on the encoder side.

[0036] Several high-ranked modes with the minimum SATD and several non-angular intra prediction mode (i.e. DC or Planar) with the lowest SATD cost are selected as the TIMD modes. These TIMD modes are blended with the weights after applying PDPC process, and such weighted intra prediction is finally used to code the current CU.

[0037] (5) Non-regular intra prediction modes

[0038] In H. 266 / VVC and ECM, there are some non-regular intra prediction modes which are not coded in the above mentioned regular intra prediction modes. Examples include, but are not limited to, MIP, IntraTMP, EIP, SGPM, and NNIP.

[0039] Matrix-weighted Intra Prediction (MIP) : MIP takes as input one line of reconstructed neighboring boundary samples to the left of the block and one line of reconstructed neighboring boundary samples above the block. The prediction samples are generated through matrix-vector multiplication of the neighboring reconstructed samples with trained matrices.

[0040] Intra Template Matching Prediction (IntraTMP) : In IntraTMP, a prediction block is copied from a reconstructed region of the current picture, with the location determined using template matching.

[0041] Extrapolation Filter-based Intra Prediction (EIP) : EIP is an intra prediction mode that progressively predicts each pixel in the current block from the pixel's reconstructed or predicted neighbors.

[0042] Spatial Geometric Partitioning Mode (SGPM) : SGPM is a bi-prediction mode that behaves similarly to geometric partitioning mode but uses intra modes in both partitions.

[0043] Neural Network-based Intra Prediction (NNIP) : In NNIP, the prediction block is generated by a neural network-based intra prediction model.

[0044] (6) Low Frequency Non-Separable Transform (LFNST) and NSPT set selection

[0045] LFNST is a secondary transform tool which performs matrix multiplication on the transform coefficients of intra-coded blocks after a primary transform in order to further concentrate the residuals to fewer number of coefficients. On the encoder side, LFNST is applied between the forward primary transform and quantization. Correspondingly, on the decoder side, the inverse LFNST is applied between the inverse primary transform and dequantization.

[0046] In the LFNST design, the LFNST set and LFNST transpose flag are both determined by the intra prediction mode (predModeIntra) of the current transform block. If the current block is not coded using the regular intra prediction mode, it will be mapped to a predModeIntra index, using the VIPM derivation method.

[0047] In ECM, there are 35 LFNST sets and 3 transform matrices (kernels) per set, and the LFNST set (lfnstTrSetIdx) for a given intra mode (predModeIntra) is derived according to the following formula:

[0048] Three different kernels, LFNST4, LFNST8, and LFNST16, are defined to indicate LFNST kernel sets, which are applied to 4×N / N×4 (N≥4) , 8×N / N×8 (N≥8) , and M×N (M, N≥16) , respectively.

[0049] Non-separable primary transform (NSPT) replaces the separable DCT-II plus LFNST transform combinations on several block sizes. The affected block sizes are 4×4, 4×8, 8×4 and 8×8, 4×16, 16×4, 8×16 and 16×8. All NSPTs consist of 35 sets and 3 candidates (similar to the current LFNST) . And the kernel derivation method for an intra mode is the same as LFNST. More details can be referred to JVET-AJ2025.

[0050] (7) Multiple transform set selection (MTSS) and implicit MTS

[0051] Multiple transform set selection (MTSS) for intra LFNST / NSPT is proposed to allow blocks coded with the non-regular modes to select one LFNST / NSPT transform set out of 2 candidate sets. When LFNST / NSPT is used for these blocks, one more bin is employed to indicate whether the 1st or the 2nd candidate transform set is selected.

[0052] The derivation methods for transform sets are summarized in Table 1 below. Table 1. Transform set selection for different modes

[0053] MTSS can be applied to CUs with number of pixels equal or larger than 128. For CUs less than 256 pixels only the first secondary set candidate can be used, for larger CUs all 3 candidates can be used.

[0054] In ECM, implicit MTS is a method where LFNST / NSPT transform set can be derived from the TU size and the Intra Prediction Mode (IPM) of current coding block by using a pre-trained lookup table.

[0055] The existing MTSS scheme use one high-ranked mode in a HoG to determine the final transform set for a coding block, which is only convincing when the amplitude of this high-ranked mode is significant enough. There is one case that the amplitudes among the high-ranked modes and low-ranked modes do not differ too much, where one top-ranked mode can hardly indicate the directionality of the prediction residuals. In other words, determining the final transform set depending on one high-ranked mode is not effective when the amplitude of this mode is not absolutely dominant in the HoG.

[0056] One potential issue is that high-ranked modes in a HoG may be ineffective enough to indicate the directionality of the residual block. For the case that the amplitudes in a HoG are numerically close to each other, one high-ranked IPM can hardly indicate the characteristics of the prediction residuals for a coding block.

[0057] Another potential issue is that currently only one of several high-ranked modes in a HoG can be used to determine the transform set. In the current scheme, the mode used to determine the transform set will be chosen from several high-ranked IPMs in a HoG. If the IPM which can provide the best performance does not exist in the several high-ranked IPMs, it can never be chosen. This is harmful to the coding performance.

[0058] Another potential issue is that the amplitude difference and prediction direction difference among different IPMs in a HoG is not fully utilized. Currently the amplitude is employed to perform ranking to obtain several high-ranked intra prediction mode, but the extent of the amplitude variation is not considered. At the same time, the discrepancy of the prediction directions among different IPMs is also not considered. This information may be taken into consideration for a more representative IPM.

[0059] The present disclosure proposes a new scheme to derive the VIPM for determining the transform set. The prediction direction of the derived VIPM is supposed to has high correlation to the directionality of the prediction residuals. This may be achieved by aggregating the prediction directions of several high-ranked modes. The basic idea is to aggregate the prediction directions of several high-ranked IPMs when none of them is numerical dominant to represent the directionality of the prediction residuals. Amplitude discrepancy and direction discrepancy among different IPMs in a HoG may be employed to analyze the dominance. Embodiments of the present disclosure may be applied in combination with different intra-or inter-prediction methods as well as implemented as a hardware or a software module. Most of the state-of-the-art hybrid video codecs perform a transform operation for a block of a picture, and the subdivision of a picture into blocks is a part of state-of-the art signalling. The embodiment of the invention utilizes information about the size of the block just like many other size-dependent tools, e.g. Mode Dependent Intra Smoothing (MDIS) or Position Dependent Prediction Combination (PDPC) . Hence, this embodiment does not require additional block-level signalling if applied in the encoding and decoding processes of state-of-the-art video coding standards, such as H.266 / VVC, ECM, and AV1.

[0060] FIG. 4 is a flowchart of a decoding method for VIPM determination according to an embodiment of the present disclosure. As shown in FIG. 4, the method includes operations described in blocks S201 to S205.

[0061] In S201, a template area of the current block is determined.

[0062] The current block refers to a block of image or video data that is currently being processed (decoded) .

[0063] The template area contains samples of which the values are already known and can be utilized for building the histogram. For example, samples within the template area may already be reconstructed or predicted. The template area may correspond to the reconstructed vicinity of the current block. It can be determined based on the decoded prediction mode for the current block. For example, if the DIMD mode is utilized for the current block, the template may be determined as the left template, above template and / or the above-left template adjacent to the current block. For example, if the OBIC mode is utilized for the current block, the template may be determined as neighboring reconstructed blocks of the current block. Alternatively, for some other prediction modes, the template may be determined as the predictor of the current block generated based on such prediction modes.

[0064] In S202, the HoG or HoO is generated for the template area.

[0065] In this operation, a histogram is built according to samples within the template, that is, samples in the reconstructed vicinity or in the predictor of the current block. For instance, for blocks predicted with DIMD, OBIC and TIMD, the samples are collected from the vicinity of the coding block, while for other modes samples are collected from the predictor of a coding block.

[0066] The histogram may be a histogram of gradients (HoG) or a histogram of occurrence (HoO) . For instance, for blocks predicted with OBIC, the amplitude of each category in the histogram is the cumulative occurrence of an IPM, while for blocks predicted with other modes the amplitudes in their histograms are gradients with different orientations.

[0067] Methods for building the HoG or HoO for a set of samples in the template may be similar to those used in existing technologies. More details can be found in, for example, document JVET-AJ2025.

[0068] In S203, A plurality of IPMs are determined based on the HoG or HoO.

[0069] Each bin in the HoG or HoO refers to an angular prediction mode, i.e., an intra-prediction mode (IPM) . The plurality of IPMs may be derived based on the HoG or HoO. Then, these IPMs may be evaluated to select some or all of them for further operation. For clarity, The plurality of IPMs determined for aggregation operation in subsequent operations can be denoted as candidate IPMs for aggregation operation.

[0070] In one embodiment, all IPMs derived based on the HoG or HoO can be taken as the candidate IPMs for aggregation operation. In another embodiment, only part of the IPMs are taken as the candidate IPMs for aggregation operation.

[0071] There is a case that the amplitudes of serval high-ranked modes have a significant difference. Those IPMs that have relatively small amplitudes may be regarded as a kind of noise when computing the aggregated IPM. Hence, IPM with relatively smaller amplitudes will be excluded. Specifically, the operation of selecting the candidate IPMs based on the HoG or HoO may include: selecting a top IPM with a highest amplitude in the HoG or HoO; and selecting one or more other IPMs with amplitudes among highest in the HoG or HoO. In other words, the top IPM which has the highest amplitude in the HoG or HoO is always taken as one of the candidate IPMs. Other high-ranked IPMs having the second highest amplitude, third highest amplitude and so on may be evaluated to determine which ones of them are selected as the candidate IPMs.

[0072] Optionally, the high-ranked IPMs with the highest magnitudes in the histogram may be sorted in a descending order based on their amplitudes, which may facilitate the selection process.

[0073] Several ways for obtaining the candidate IPMs from the high-ranked IPMs are introduced below.

[0074] (1) The high-ranked modes with the accumulative relative amplitude ratio smaller than a threshold are used for aggregation.

[0075] In this embodiment, the accumulative relative amplitude ratio of each candidate IPM is less than a first threshold. In other words, the accumulative relative amplitude ratio of the high-ranked IPMs other than the top IPM are calculated, and those with the accumulative relative amplitude ratio less than the first threshold are selected as the candidate IPMs for subsequent aggregation operation.

[0076] The method for calculating the relative amplitude ratio is explained below. Assuming the number of IPMs to be considered is N, the relative amplitude ratio of an IPM among the top N IPMs is defined as the amplitude ratio between the amplitude of the current IPM and the sum of all the N amplitudes. The calculation of the relative amplitude ratio for the i-th IPM r (i) is as follow.

[0077] In the formula, A (i) and A (j) are the i th and j th high-ranked amplitude in the HoG, respectively.

[0078] The accumulative relative amplitude ratio of the i th sorted IPM accr (i) means the accumulative sum of the relative amplitude ratios of the top i+1 IPMs in a HoG, which can be calculated as the following:

[0079] Based on the definition of accumulative relative amplitude ratio, whether the ith sorted IPM in the top N IPMs will be used for computing the aggregated IPM is determined by check the following condition: accr (i) <K, i=1, 2, …      Eq. 3 where K is a predefined threshold belonging to (0, 1] .

[0080] The threshold value K can be predefined. An instance for this threshold is 0.6, and it is noteworthy that K can be other values. It is worth noting that the “less than” sign in Eq. 3 can also be replaced by a “less than or equal to” sign as few cases will be affected and the impact is negligible. At the same time, it should be noticed that the IPM with the highest amplitude in a HoG may always be adopted without checking the condition in Eq. 3.

[0081] In conclusion, for each IPM in the top N IPMs, whether it is kept as the candidate IPMs for further aggregation may be determined by the following procedures:

[0082] a) Calculate its relative amplitude ratio according to Eq. 1.

[0083] b) Calculate its accumulative relative amplitude ratio according to Eq. 2.

[0084] c) Compare its accumulative relative amplitude ratio with a predefined threshold, referring to Eq. 3.

[0085] d) Make a decision on the adoption of this IPM. If the accumulative relative amplitude ratio is greater than  / greater than or equal to a threshold, this angular mode will not be used for aggregation in the following step. Otherwise, it will be kept.

[0086] (2) The high-ranked IPMs with the relative amplitude ratio greater than a threshold are used for aggregation.

[0087] In this embodiment, the relative amplitude ratio (also denoted as the normalized amplitude) of each candidate IPM is larger than a second threshold. In other words, the relative amplitude ratio of the high-ranked IPMs other than the top IPM are calculated, and those with the relative amplitude ratio larger than the second threshold are selected as the candidate IPMs for subsequent aggregation operation.

[0088] In this embodiment, instead of using the accumulative relative amplitude ratio, the relative amplitude ratio is employed to exclude some IPMs with small amplitudes.

[0089] The method for calculating the relative amplitude ratio r (i) of the ith high-ranked IPM is similar as introduced above. The relative amplitude ratio can also be taken as the normalized amplitude.

[0090] For each IPM that belongs to the top N angular modes in a HoG, a condition will be checked, which is: r (i) >T, i=1, 2, ...       Eq. 4 where T is a predefined threshold belonging to (0, 1] .

[0091] The threshold value T can be predefined. An instance for this threshold is 0.1, and it is noteworthy that T can be other values. It is worth noting that the “greater than” sign in Eq. 4 can also be replaced by a “greater than or equal to” sign as few cases will be affected and the impact is negligible. At the same time, it should be noticed that the IPM with the highest amplitude in a HoG will always be employed for aggregation without checking the condition in Eq. 4.

[0092] In conclusion, for each IPM in the top N IPMs, whether it is kept as the candidate IPMs for further aggregation may be determined by the following procedures:

[0093] a) Calculate its relative amplitude ratio according to Eq. 1.

[0094] b) Compare its relative amplitude ratio with a predefined threshold, referring to Eq. 4.

[0095] c) Make a decision on the adoption of this IPM for aggregation. If the relative amplitude ratio is greater than  / greater than or equal to a threshold, this IPM will be used. Otherwise, it will not be kept for aggregation.

[0096] (3) The high-ranked IPMs with the amplitude ratio compared to the amplitude of the top-ranked IPM greater than a threshold are used for aggregation.

[0097] In this embodiment, the amplitude ratio of each candidate IPM (except for the top IPM) to the top IPM is larger than a third threshold. In other words, the amplitude ratios of the high-ranked IPMs to the top IPM are calculated, and those with the amplitude ratios greater than the third threshold are selected as the candidate IPMs for subsequent aggregation operation.

[0098] Specifically, another amplitude ratio r′ (i) is defined as:

[0099] In the formula, A (i) and A (0) are the i th and the top-ranked amplitude in a HoG, respectively. This ratio compares the amplitude of the ith IPM to that of the top-ranked IPM. Hence, top-ranked IPM has always has the highest amplitude ratio 1.

[0100] Then the condition to be checked may be: r′ (i) >T′, i=1, 2, ...       Eq. 6 where T′ is a predefined threshold belonging to [0, 1) .

[0101] The threshold value T′ can be predefined. An instance for this threshold is 0.8, and it is noteworthy that T′ can be other values. It is worth noting that the “greater than” sign in Eq. 6 can also be replaced by a “greater than or equal to” sign as few cases will be affected and the impact is negligible. At the same time, it should be noticed that the IPM with the highest amplitude in a HoG will always be employed for aggregation without checking the condition in Eq. 6.

[0102] In conclusion, for each IPM in the top N IPMs, whether it is kept as the candidate IPMs for further aggregation may be determined by the following procedures:

[0103] a) Calculate its amplitude ratio according to Eq. 5.

[0104] b) Compare its amplitude ratio with a predefined threshold, referring to Eq. 6.

[0105] c) Make a decision on the adoption of this IPM for aggregating. If the amplitude ratio is greater than  / greater than or equal to a threshold, this IPM will be used. Otherwise, it will not be kept for aggregating.

[0106] The HoG or HoO may contains plenty of IPMs. If all of them are involved in the above process for determining the candidate IPMs, a lot of computation resources are needed. Similarly, if the number of the selected candidate IPMs is very large, a lot of computation resources are needed. Accordingly, in some embodiments, an amount limitation may be determined. The amount limitation may be used in the above process for determining the candidate IPMs. For example, the amount limitation may be used as the value of the parameter “N” in above Eq. 1. Alternatively, the amount limitation may be used for limit the number of candidate IPMs. In other words, the candidate IPMs derived based on any of the foregoing methods may be checked. If their number is larger than the amount limitation, some of them may be excluded from the candidate IPMs such that the number of the final candidate IPMs can be limited to the amount limitation. The amount limitation of the candidate IPMs may be determined based on a size of the current block.

[0107] In this embodiment, the maximum number of IPMs that will be possibly used varies according to the size of the coding block. As the texture complexity tends to be different among different sizes of coding blocks, it is proposed to determine the maximum number of modes to be considered according to the block size. Generally speaking, larger blocks can have more complicated textures, hence, the maximum number of IPMs allowed for a larger block will not be smaller than that for a smaller block.

[0108] The block size can be expressed as (W, H) , where W and H are the width and height of the coding block, respectively. In one embodiment, the total number of samples H×H in a coding block is used to represent the block size. An example of adapting the maximum number of IPMs to the block size is showed in Table 2. Table 2. Dependency of maximum number of the IPMs allowed for a coding block and the number of  samples in it.

[0109] An alternative option is shown in Table 3. Table 3. An alternative dependency of maximum number of IPMs allowed for a coding block and the  number of samples in it.

[0110] Another alternative option is shown in Table 4. Table 4. Another alternative dependency of maximum number of IPMs allowed for a coding block and  the number of samples in it.

[0111] Another possible criterion is the smaller value between W and H, which can be noted as min (W, H) , and one possible alternative dependency is listed in Table 5. Table 5. One example for the relationship between maximum number of IPMs allowed for a coding  block and the smaller value between the block width and block height.

[0112] Another possible criterion is the mean of W and H, which can be noted as and one possible alternative dependency is listed in Table 6. Table 6. One example for the relationship between the maximum number of IPMs allowed for a coding  block and the mean of the block width and block height.

[0113] A special case is that all possible angular modes are allowed for blocks with any possible sample numbers, which can be regarded as no block size constraint at all.

[0114] It should be clarified that other combinations of sample numbers in a coding block and the maximum number of IPMs are also possible, as long as the maximum number of IPMs goes along the block size non-decreasingly.

[0115] It is noteworthy that the maximum number of IPMs allowed is not the exact number of modes that will be used for derive the aggregated IPM. It means that the final number of IPMs used will not exceed this number. The high-ranked IPMs should also satisfy other conditions when used for aggregation.

[0116] In some embodiments, the candidate IPMs derived based on any of the foregoing methods may be further checked. The method shown in FIG. 4 may further include: checking whether a mode difference between each of the one or more other IPMs (that are selected as the candidate IPMs for aggregation) and the top IPM is less than a fourth threshold; and excluding one or more IPMs with the mode difference larger than the fourth threshold from the plurality of IPMs.

[0117] The discrepancy of the IPMs is defined as the discrepancy of prediction directions (angles) those IPMs represent. If two angles are close, it is regarded that the discrepancy of the two corresponding IPMs is insignificant, otherwise the discrepancy of the two corresponding IPMs is defined as significant. In practice, as an intra mode index has one-to-one correspondence with an angular mode (referring to FIG. 1) and angular intervals of two adjacent angular modes are approximately equal among all the angular modes, it is proposed to use the difference of the intra mode indexes to represent the discrepancy of the angular modes.

[0118] Based on the definition above, an IPM is optionally adopted according to the discrepancy of this mode and the top-ranked mode in a HoG in this embodiment. More specifically, an IPM is adopted only when the discrepancy of this IPM and the top-ranked IPM is insignificant. The idea behind this embodiment is that the top-ranked mode is very likely to be the optimal VIPM candidate and the adjustment should not make it vary too much.

[0119] The filtering process may generally contain three steps as follows.

[0120] a) Identify the IPM index of the top-ranked IPM.

[0121] b) The absolute difference between the IPM index of the ith IPM Ii and I0, |Ii-I0|, will be compared with a predefined threshold d. Exemplary values for this threshold can be 30, 17 or other positive integers. It is worth noting that if d is not smaller than the maximum number of IPMs (67 currently in ECM) , all IPMs becomes available. The comparison can be formulated as: |Ii-I0|<d, i=0, 1, 2, ...       Eq. 7

[0122] It is noteworthy that the “less than” operator in Eq. 7 can be replaced by “less than or equal to” instead as few coding blocks will be affected and the impact is negligible.

[0123] c) Finally, for an IPM that satisfies Eq. 7, it will be available for computing the aggregated IPM, otherwise it will be excluded.

[0124] It should be noticed that, not all of the above methods are obligatory for acquiring the multiple IPMs (candidate IPMs) used for subsequent aggregation operation. Instead, these methods can be selectively combined in part or in whole according to practical needs, allowing for flexibility in the approach to obtaining the IPMs for aggregation.

[0125] In other embodiments of the present disclosure, to derive the aggregated IPM, instead of using all the candidate IPMs using the method above, that is the top IPM with a highest amplitude in the HoG or HoO; and one or more other IPMs with amplitudes among highest in the HoG or HoO. Only one of candidate IPMs, that is a selected IPM. And then the selected IPM and a set of IPMs with mode indices close to the index of this selected IPM will be used. These IPMs with mode indices close to the index of the specific selected IPM may also belong to all the candidate IPMs or may not belong to it.

[0126] Then, the plurality of IPMs used to derive the aggregated IPM include the set of the IPMs and the selected IPM. Or the plurality of IPMs used to derive the aggregated IPM include only the set of the IPMs. Since the set of the IPMs include the selected IPM and several IPMs with mode indices close to the index of this selected IPM, it can provide better coding performance in some cases.

[0127] In some embodiments of the present disclosure, the set of IPMs with mode indices close to index of the selected IPM can be determined by the following method. First, determine whether model index of a candidate IPM is larger than a lower range bound and smaller than an upper range bound; then determinie whether an amplitude of the candidate IPM is larger than an amplitude of the target IPM multiplied by a constant. When the model index of the candidate IPM is larger than the lower range bound and smaller than the upper range bound, and the amplitude of the candidate IPM is larger than the amplitude of the target IPM, the candidate IPM is selected as one or more candidates of the set of IPMs.

[0128] In some embodiments of the present disclosure, the lower range bound is smaller than the mode index of the selected IPM.

[0129] In some embodiments of the present disclosure, the upper range bound is bigger than the mode index of the selected IPM.

[0130] In some embodiments of the present disclosure, the lower range bound is determined by subtracting a predefined constant from the mode index of the selected IPM.

[0131] In some embodiments of the present disclosure, the upper range bound is determined by adding a predefined constant from the mode index of the selected IPM.

[0132] Specifically, To determine a set of IPMs, denoted as Ω′, of which mode indices are to be aggregated, some related factors are defined as follows.

[0133] IPMc : the mode index of a selected IPM c. A common practice for the specific selected IPM is the top-ranked IPM, other selected IPM is also possible

[0134] Ac: the amplitude of the selected IPM c.

[0135] Bl: the lower range bound of IPM index of the set of IPMs.

[0136] Bu: the upper range bound of IPM index of the set of IPMs.

[0137] Then, Ω′ consists of all the IPMs of which their mode indices satisfy the following conditions in Equation 8 and Equation 9,

[0138] Bl<IPMi<Bu,                           Eq. 8

[0139] A (i) >m ×Ac.             Eq. 9

[0140] where IPMi is the mode index of the ith IPM and A (i) is the amplitude the ith IPM. A typical value for the predefined threshold m can be 0.25, and other values is also possible. Specially, when m is less than 0, all IPMs can satisfy the condition in equation 9. It is worth noting that the “greater than” sign in equation 9 can also be replaced by a “greater than or equal to” sign as few cases will be affected and the impact is negligible. Bl and Bu should satisfy the following conditions in Equation 10 and Equation 11.

[0141] Bl<IPMc.                                                 Eq. 10

[0142] Bu>IPMc.                                                 Eq. 11

[0143] One common practice for Bl and Bu makes the following conditions in Equation 12 and Equation 13 satisfied.

[0144] Bl= IPMc-α.                                             Eq. 12

[0145] Bu= IPMc+α.                                             Eq. 13

[0146] where α is a predefined positive constant, and a typical value for it is 5. Of course, other positive constant is also possible.

[0147] In S204, an aggregated IPM is derived based on the multiple IPMs.

[0148] In this operation, an aggregated IPM will be computed from the selected IPMs that satisfy the amplitude and / or the IPM index constraints. There are many possible ways to aggregate the selected IPMs.

[0149] In some embodiments, the operation of deriving the aggregated IPM based on the multiple IPMs may include: calculating a weighted arithmetic average or a weighted geometric average of mode indexes of the multiple IPMs to obtain a mode index of the aggregated IPM. A detailed explanation is given below.

[0150] (1) Aggregated IPM is computed by weighted arithmetic average

[0151] Some factors related to the computation are defined as follows. IPMi is the mode index of the ith selected IPM. wi is the weight for the ith selected. Ω is the set of selected IPMs. Then, the mode index of the aggregated IPM IPMag can be computed as: IPMag=round (∑i∈Ωwi ×IPMi) . Eq. 14

[0152] In the formula, round () means rounding off as IPMag should be an integer. This operator can also be replaced by ceil (rounding up) or floor (rounding down) . The weight wi is related to the amplitudes of the selected IPMs, which is computed as: where A (i) and A (j) are the ith and jth selected IPMs, respectively.

[0153] The difference between Eq. 1 and Eq. 9 is that the denominator in Eq. 9 only considers the selected IPMs.

[0154] Another possible variant for weight calculation is: where N′ is the number of selected IPMs in Ω.

[0155] In this variant, each IPM is treated equally regardless of their amplitudes. In other words, the mean value of the mode indexes of the multiple IPMs is calculated and taken as the mode index of the aggregated IPM.

[0156] (2) Aggregated IPM is computed by weighted geometric average

[0157] In this option, the aggregated IPM, IPMag, can also computed by geometric average based on the following equation.

[0158] In the formula, round () means rounding off as IPMag should be an integer. This operator can also be replaced by ceil (rounding up) or floor (rounding down) . The weight wi is related to the amplitudes of the selected IPMs, which can be calculated according to Eq. 9 or Eq. 10.

[0159] When the plurality of the IPMs are the set of IPMs include the selected IPM and several IPMs with mode indices close to the index of this selected IPM . Then the mode index of the aggregated IPM IPMag can be computed as Equation 18.

[0160] IPMag=round (∑i∈Ω′wi ×IPMi) .                            Eq. 18

[0161] The only difference between Equation 18 and Equation 14 is that Ω and Ω′ may consist of different IPMs. The weight wi is related to the amplitudes of the corresponding IPM, which can be calculated according to Equation 15 or Equation 16.

[0162] Similarly, IPMag can also computed by geometric average based on the following equation 19.

[0163]

[0164] where N′ is the number of selected IPMs in Ω′. The operator round () means rounding off as IPMag should be an integer. This operator can also be replaced by ceil (rounding up) or floor (rounding down) . The weight wi is related to the amplitudes of the selected IPMs, which can be calculated according to Equation 15 or Equation 16.

[0165] It should be understood, the above methods are merely examples. The multiple IPMs can also be aggregated in other ways to obtain the aggregated IPM.

[0166] In S205, the VIPM of the current block is determined based on the aggregated IPM.

[0167] With the aggregated IPM acquired in previous operation, the VIPM (s) of the current block can be determined. In this operation, the VIPM (s) or the VIPM candidate (s) (e.g., in MTSS) of the current block may be determined or updated using the aggregated IPM, which is supposed to be better aligned with the directionality of the prediction residuals.

[0168] One or two original VIPM (s) may be determined in advance. Specifically, the original VIPM may be acquired by: decoding a current prediction mode of the current block; and deriving the original VIPM of the current block based on the current prediction mode. This process is similar to that used in MTSS. The aggregated IPM may be utilized to replace or update the original VIPM (s) of the current block.

[0169] In one embodiment, the current block may only have one VIPM, and the aggregated IPM may be set as the VIPM of the current block. In this case, if the aggregated IPM is not equal to the original first IPM candidate, the first IPM candidate is set to this aggregated IPM.

[0170] In another embodiment, the current block may have a first VIPM and a second VIPM. The aggregated IPM may be set as the first VIPM of the current block, while the second VIPM of the current block is set to an original VIPM (e.g., the first original VIPM) . In this case, if the condition for a second IPM candidate is satisfied (like it is done in existing technologies) , the second IPM candidate is set to the first original IPM candidate or the IPM with the highest amplitude. In another case, if the condition for a second IPM candidate is satisfied (like it is done in existing technologies) , the second IPM candidate is kept unchanged (set to the second original IPM candidate) .

[0171] In yet another embodiment, the current block may have a first VIPM and a second VIPM. The first VIPM of the current block may be set to an original VIPM (e.g., the first original VIPM) , that is, the first VIPM is kept unchanged. In contrast, the second VIPM of the current block may be set to the aggregated IPM. In this case, the first VIPM candidate is not modified. If the aggregated IPM is not equal to the first VIPM candidate and a second VIPM candidate exists, the second VIPM candidate is set to the aggregated IPM.

[0172] In yet another embodiment, the current block may have a first VIPM and a second VIPM. The first VIPM of the current block may be set to an a first aggregated IPM, the first aggregated IPM can be obtained from any one of the above methods for calculating the aggregated IPM, for example, it can be obtained based on the top IPM, and / or the one or more other IPMs, it also can be obtained based on the selected IPM and the set of IPMs. The second VIPM of the current block may be set to an a second aggregated IPM, the second aggregated IPM can be obtained from any one of the above methods for calculating the aggregated IPM, for example, it can be obtained based on the top IPM, and / or the one or more other IPMs, it also can be obtained based on the selected IPM and the set of IPMs. The first aggregated IPM and the second aggregated IPM can be different. In one case, only when the condition for a second IPM candidate is satisfied (like it is done in existing technologies) , the second IPM will be set. In other case, if the condition for a second IPM candidate does not satisfied (like it is done in existing technologies) , the second IPM candidate is kept unchanged (set to the second original IPM candidate)

[0173] According to the present disclosure, multiple IPMs may be selected from the HoG of the HoO built for the template area of the current block, and then be utilized to generate an aggregated IPM. The aggregated IPM may be utilized to determine the VIPM of the current block. Compared to the existing VIPM determination technologies where only the top-ranked one or two IPMs are considered for determining the VIPM, the aggregated IPM introduced by the present disclosure may better represent the directionality of the current block and / or residuals of the current block. Thus, implementation of the present disclosure may improve the transform selection process, and therefore improve coding performance.

[0174] In addition, it is not always necessary to perform the VIPM determination / update method. In some embodiments, before the operation of determining the VIPM of the current block based on the aggregated IPM, the method shown in FIG. 4 may further include: verifying whether a size of the current block satisfies a fifth threshold; and responsive to the size of the current block satisfying the fifth threshold, performing the determining the VIPM of the current block based on the aggregated IPM.

[0175] This embodiment aims at setting application conditions to VIPM adjustment. FIG. 5 shows a condition check process for determining whether the VIPM adjustment method should be applied. The VIPM determination method as described in foregoing sections may be applied when the requirement of block size is satisfied. Otherwise, the conventional MTSS method may be used. The introduction of the block size constraint to the VIPM adjustment is given below.

[0176] The block size constraint can be set to prevent from adjusting the VIPM (s) of small blocks. Generally speaking, larger blocks can have more complicated textures and higher resolution of prediction angles. Hence, VIPM adjustment may achieve better performance for large blocks.

[0177] One example is using the total number of samples W×H in a coding block to represent the block size, where W and H are the width and height of the coding block, respectively. Then, then constraint is expressed as W×H> t,       Eq. 20

[0178] In the formula, t is a predefined constant. A typical value for it can be 256, and other positive values are also possible. It is noteworthy that the “greater than” operator in Eq. 12 can be replaced by “greater than or equal to” instead as few coding blocks will be affected and the impact is negligible.

[0179] Another example sets constraints to the width and height of a coding block separately. In this example, VIPM adjustment is applicable when the following conditions are satisfied: W> t0,        Eq. 21 H> t1,

[0180] In the formula, t0 and t1 are predefined thresholds. A typical value for t0 and t1 can be 16, and other positive values are also possible. It is noteworthy that the “greater than” operator in Eq. 13 can be replaced by “greater than or equal to” instead as few coding blocks will be affected and the impact is negligible.

[0181] Another example sets constraints to the smaller value between W and H , denoted as min (W, H) . In this example, VIPM adjustment is applicable when the following conditions are satisfied: min (W, H) > t2,        Eq. 22

[0182] In the formula, t2 is a predefined threshold. A typical value for t2 is 16, and other positive values are also possible. It is noteworthy that the “greater than” operator in Eq. 14 can be replaced by “greater than or equal to” instead as few coding blocks will be affected and the impact is negligible.

[0183] The present disclosure further provide an encoding method. FIG. 6 is a flowchart of an encoding method for VIPM determination according to an embodiment of the present disclosure. As shown in FIG. 6, the method include operations described in blocks S301 to S305.

[0184] In S301, a template of the current block is determined.

[0185] In S302, the HoG or HoO is generated for the template area.

[0186] In S303, multiple IMPs are determined based on the HoG or HoO.

[0187] In S304, an aggregated IPM is derived based on the multiple IPMs.

[0188] In S305, the VIPM of the current block is determined based on the aggregated IPM.

[0189] Operations described in S301 to S305 are similar to those described in S201 to S205, details of which will not be repeated for simplicity and clarity.

[0190] The encoding device may utilize the derived VIPM (s) of the current block to determine the transform set. Then the transform set may be utilized to encoding the residual information of the current block.

[0191] According to the present disclosure, multiple IPMs may be selected from the HoG of the HoO built for the template area of the current block, and then be utilized to generate an aggregated IPM. The aggregated IPM may be utilized to determine the VIPM of the current block. Compared to the existing VIPM determination technologies where only the top-ranked IPM is considered for determining the VIPM, the aggregated IPM introduced by the present disclosure may better represent the directionality of the current block and / or residuals of the current block. Thus, implementation of the present disclosure may improve the transform selection process, and therefore improve coding performance.

[0192] Implementation of the present disclosure may improve the coding efficiency. An appropriate transform set makes the energy of the residuals more concentrated to the low frequency transformed coefficients. Finally, less bits will be required to encode the signals and the coding efficiency can be improved. This benefit depends on that the prediction direction of the intra mode derived based on the present disclosure are closer to the directionality of the prediction residuals. From the perspective of bitrate and picture quality, the invention can reduce the bitrate and improve the picture quality. As to the bitrate reduction, a more appropriate transform set leads to less non-zero coefficients, and therefore less numbers of bits required to be transferred from an encoder to a decoder. For constant bitrate coding, bits saved by this invention can be used to reduce the distortion introduced by quantization and thus provide better PSNR as compared with the prior art, which means better picture quality.

[0193] FIG. 7 conceptually illustrates an apparatus 400 with which some embodiments of the invention are implemented. The apparatus 400 may be an encoding device or a decoding device. 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.

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

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

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

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

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

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

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

[0201] 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 decoding method, comprising:determining a template area of the current block;generating a histogram of gradient (HoG) or histogram of occurrence (HoO) for the template area;determining a plurality of intra-prediction modes (IPMs) based on the HoG or HoO;deriving an aggregated IPM based on the plurality of IPMs; anddetermining a virtual intra-prediction mode (VIPM) of the current block based on the aggregated IPM.2.The method of claim 1,wherein the VIPM comprise a first VIPM;wherein the determining the VIPM of the current block based on the aggregated IPM comprises:setting the first VIPM of the current block to the aggregated IPM.3.The method of claim 2, wherein the setting the first VIPM of the current block to the aggregated IPM comprises:when the aggregated IPM is not equal to an original IPM which is used as the first VIPM of the current block, setting the first VIPM of the current block to the aggregated IPM.4.The method of claim 2,wherein the VIPM further comprises a second VIPM;wherein the method further comprises:decoding a current prediction mode of the current block; andderiving an original VIPM of the current block based on the current prediction mode;wherein the determining the VIPM of the current block based on the aggregated IPM further comprises: setting the second VIPM of the current block to the original VIPM.5.The method of claim 4, wherein the setting the second VIPM of the current block to the original VIPM comprises:when the second VIPM of the current block is available, setting the second VIPM of the current block to the original VIPM.6.The method of claim 4, wherein the setting the second VIPM of the current block to the original VIPM, comprises:setting the second VIPM of the current block to the original VIPM with highest amplitude.7.The method of claim 1,wherein the VIPM comprises a first VIPM and a second VIPM;wherein the determining the VIPM of the current block based on the aggregated IPM comprises: setting the second VIPM of the current block to the aggregated IPM.8.The method of claim 7,wherein the first VIPM is set to an original VIPM of the current block;wherein the setting the second VIPM of the current block to the aggregated IPM comprises:when the second VIPM is available and the aggregated IPM is not equal to the original VIPM, setting the second VIPM of the current block to the aggregated IPM.9.The method of claim 1, wherein the VIPM comprises a first VIPM and a second VIPM;wherein the determining the VIPM of the current block based on the aggregated IPM comprises: setting the first VIPM of the current block to a first aggregated IPM, the aggregated IPM comprises the first aggregated IPM.10.The method of claim 9, the method further comprises:setting the second VIPM of the current block to a second aggregated IPM, the aggregated IPM comprises the second aggregated IPM, the second aggregated IPM is different from the first aggregated IPM.11.The method of claim 9-10, wherein the setting the second VIPM of the current block to the aggregated, comprises:when the second VIPM of the current block is available, setting the second VIPM of the current block to the second aggregated VIPM.12.The method of claim 1,wherein the determining the plurality of IPMs based on the HoG or HoO comprises:selecting a top IPM with a highest amplitude in the HoG or HoO; andselecting one or more other IPMs with amplitudes among highest in the HoG or HoO.13.The method of claim 8, wherein an accumulative relative amplitude ratio of each of the one or more other IPMs is less than a first threshold.14.The method of claim 8, wherein a normalized amplitude of each of the one or more other IPMs is larger than a second threshold.15.The method of claim 8, wherein an amplitude ratio of each of the one or more other IPMs to the top IPM is larger than a third threshold.16.The method of claim 8, wherein an amount limitation of the plurality of IPMs is determined based on a size of the current block.17.The method of claim 8, further comprising:checking whether a mode difference between each of the one or more other IPMs and the top IPM is less than a fourth threshold; andexcluding one or more IPMs with the mode difference larger than the fourth threshold from the plurality of IPMs.18.The method of claim 12-17, the method further comprising:the plurality of IPMs comprise the top IPM,and / or the one or more other IPMs.19.The method of claim 12-17, the method further comprising:determining one selected IPM, the one selected IPM is the top IPM.20.The method of claim 12-17, the method further comprising:determining one selected IPM, the one selected IPM is selected from the one or more other IPMs.21.The method of claims 12-17, the method further comprising:determining a set of IPMs with mode indices close to mode index of the selected IPM;wherein the plurality of IPMs comprise the set of IPMs and the selected IPM.22.The method of claims 21, wherein the determining a set of IPMs with mode indices close to index of the selected IPM, comprises:determining whether model index of a candidate IPM is larger than a lower range bound and smaller than an upper range bound;determining whether an amplitude of the candidate IPM is larger than an amplitude of the target IPM multiplied by a constant;when the model index of the candidate IPM is larger than the lower range bound and smaller than the upper range bound, and the amplitude of the candidate IPM is larger than the amplitude of the target IPM, the candidate IPM is selected as one or more candidates of the set of IPMs.23.The method of claims 22, wherein the constant is 0.25.24.The method of claims 22, wherein the lower range bound is smaller than the mode index of the selected IPM.25.The method of claims 22, wherein the upper range bound is bigger than the mode index of the selected IPM.26.The method of claims 22, wherein the lower range bound is determined by subtracting a predefined constant from the mode index of the selected IPM.27.The method of claims 22, wherein the upper range bound is determined by adding a predefined constant from the mode index of the selected IPM.28.The method of claim 1, wherein the deriving the aggregated IPM based on the plurality of IPMs comprises:calculating a weighted arithmetic average or a weighted geometric average of mode indexes of the plurality of IPMs to obtain a mode index of the aggregated IPM.29.The method of claim 18-27, wherein weights of the plurality of IPMs for calculating the weighted arithmetic average or the weighted geometric average of mode indexes are determined based on normalized amplitudes of the plurality of IPMs.30.The method of claim 18-27, wherein the deriving the aggregated IPM based on the plurality of IPMs comprises:calculating a mean value of the mode indexes of the plurality of IPMs as a mode index of the aggregated IPM.31.The method of claim 1, wherein the determining the VIPM of the current block based on the aggregated IPM comprises:verifying whether a size of the current block satisfies a fifth threshold; andresponsive to the size of the current block satisfying the fifth threshold, performing the determining the VIPM of the current block based on the aggregated IPM.32.The method of claim 31,wherein the size of the current block is a product of a width and a height of the current block;wherein the verifying whether the size of the current block satisfies the fifth threshold comprises:verifying whether the product of the width and the height of the current block is larger than then fifth threshold.33.The method of claim 31,wherein the size of the current block comprises a width and a height of the current block;wherein the fifth threshold comprises a width threshold and a height threshold;wherein the verifying whether the size of the current block satisfies the fifth threshold comprises:verifying whether the width of the current block is larger than the weight threshold, and whether the height of the current block is larger than the height threshold.34.The method of claim 31,wherein the size of the current block is a smaller one between a weight and a height of the current block;wherein the verifying whether the size of the current block satisfies the fifth threshold comprises:verifying whether the smaller one between the weight and the height of the current block is larger than the fifth threshold.35.An encoding method, comprising:determining a template area of the current block;generating a histogram of gradient (HoG) or histogram of occurrence (HoO) for the template area;selecting a plurality of intra-prediction modes (IPMs) based on the HoG or HoO;deriving an aggregated IPM based on the plurality of IPMs; anddetermining a virtual intra-prediction mode (VIPM) of the current block based on the aggregated IPM.36.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 35.37.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 35.