Filter selection method and apparatus incorporating the same

The filter selection method addresses the challenge of balancing complexity and accuracy in video coding by using template matching and truncated Lagrange filters, optimizing filter choice for intra prediction based on block geometry and angle, enhancing video coding efficiency and adaptability.

WO2026148460A1PCT designated stage Publication Date: 2026-07-16SHENZHEN TCL NEW-TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SHENZHEN TCL NEW-TECH CO LTD
Filing Date
2025-01-07
Publication Date
2026-07-16

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in achieving an optimal balance between computational complexity, hardware efficiency, and prediction accuracy in filter selection for intra prediction, particularly in handling complex textures and diverse content characteristics.

Method used

A filter selection method that includes obtaining candidate filters, performing template matching to select intermediate filters, determining boundary conditions, and using rule-based methods to choose target filters based on block size and prediction angle, while also incorporating truncated Lagrange interpolation filters to manage complexity and accuracy.

Benefits of technology

This approach enhances video coding efficiency by improving prediction accuracy and reducing computational overhead, making it suitable for real-time encoding systems with adaptable filter selection tailored to specific block characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025071114_16072026_PF_FP_ABST
    Figure CN2025071114_16072026_PF_FP_ABST
Patent Text Reader

Abstract

A filter selection method is provided. The method includes: obtaining a first candidate filter; determining whether a current prediction angle for prediction of a current block satisfies an angle threshold, and whether a geometrical property of the current block satisfies a geometrical threshold; when it is determined that the current prediction angle satisfies the angle threshold and the geometrical property of the current block satisfies the geometrical threshold, selecting the first candidate filter as a target filter for prediction of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

FILTER SELECTION METHOD AND APPARATUS INCORPORATING THE SAMETECHNICAL FIELD

[0001] The present disclosure generally relates to encoding and decoding technology, and in particular to a filter selection method, a video coding apparatus, and a computer readable medium.BACKGROUND

[0002] Intra prediction is a key technique in video and image compression, which is used to reduce redundancy within frames by predicting pixel values based on the neighboring sample pixels within the same frame. It helps coding images more efficiently by exploiting spatial correlations. The main intra prediction modes are DC Mode, Planar Mode, and Angular Mode, each designed to predict pixel values differently based on the structure of the block being encoded.

[0003] In DC mode, the entire block is predicted using the average of the reference samples around the block. This mode is often used for flat or smooth regions, where the pixel values don’ t change significantly. Planar mode predicts the pixel values by interpolating between the horizontal and vertical reference samples. It works well in regions with gentle gradients or smooth transitions. Angular mode predicts the pixel values along specific angles based on the direction of the texture in the block. Multiple predefined angles are used, and this mode is more suitable for regions with strong directional patterns, such as edges or lines.

[0004] Taking angular mode as an example, several filters are used to achieve accurate predictions, which are interpolation and smoothing filters. A simple modification of increasing the number of samples to be used for filtering also improves the coding performance. When a predictor is generated using the angular prediction mode, the position of the reference pixel that the current pixel exploits the best may not fall at an integer pixel position. Similar to VVC and HEVC, intra prediction in ECM employs two filtering mechanisms for reference samples: reference sample smoothing and interpolation filtering. Reference sample smoothing, which may be exclusively applied to integer-slope modes in luma blocks, modifies reference samples using a finite impulse response filter. This filter eliminates the need for multiplication operations, simplifying the design of integer-slope modes compared to fractional-slope modes, which rely on interpolation filters. FIG. 1 shows the 2-tap interpolation filter with 32 phases in HEVC.

[0005] The Enhanced Compression Mode (ECM) utilizes a 6-tap interpolation filter to refine the reference samples surrounding the current intra prediction block. The Interpolation Filtering is used for fractional-slope modes. When a sample projection falls on a fractional position between reference samples, interpolation filtering is applied to obtain the predicted sample value. FIG. 2 visualizes the fractional direction in VVC. This approach is advantageous because it allows for a more precise estimation of sample values that lie between the available reference samples, effectively capturing finer details and variations in the image.

[0006] The Enhanced Compression Mode (ECM) aims to enhance video coding efficiency beyond the capabilities of H. 266 / Versatile Video Coding (VVC) . One of the techniques employed in ECM is the avoidance of signaling a selected intra prediction mode by deriving it at both the encoder and decoder using previously encoded / decoded samples.

[0007] The use of interpolation filtering for fractional slope modes is particularly beneficial because it retains more high-frequency information, which is essential for accurately predicting sharp edges and detailed textures. This capability is crucial in scenarios where the reference samples may not align perfectly with the desired prediction direction, thus enhancing the overall quality of the reconstructed video.

[0008] This reference sample interpolation process is integrated with several other tools, such as DIMD, TIMD, TMRL, OBIC, and SGPM, to enhance the reference samples as part of the intra prediction angular mode. The interpolation filter set in ECM comprises several filters. In the development of ECM serval filter is been proposed. A 6-tap gaussian filter is applied for larger blocks (W >= 32 and H >=32) , existing VVC 4-tap gaussian interpolation filter is applied otherwise. The extended intra reference samples are derived using the 4-tap interpolation filter instead of the nearest neighbor rounding.

[0009] To optimize the interpolation process, ECM incorporates mode-dependent intra smoothing (MDIS) rules similar to those used in HEVC. These rules determine which of the two filters, DCT-IF or SIF, is used for interpolation based on the specific intra prediction mode. Chroma blocks are interpolated using a conventional linear filter.

[0010] As introduced above, filter selection for intra prediction is a critical aspect of modern video coding. However, achieving an optimal balance between computational complexity, hardware efficiency, and prediction accuracy remains challenging.SUMMARY

[0011] Accordingly, the present disclosure aims to provide a filter selection method, a video coding apparatus, and a computer readable medium.

[0012] A technical scheme adopted by the present disclosure is to provide a filter selection method. The method includes: obtaining a first candidate filter; determining whether a current prediction angle for prediction of a current block satisfies an angle threshold, and whether a geometrical property of the current block satisfies a geometrical threshold; and when it is determined that the current prediction angle satisfies the angle threshold and the geometrical property of the current block satisfies the geometrical threshold, selecting the first candidate filter as a target filter for prediction of the current block.

[0013] Another technical scheme adopted by the present disclosure is to provide a filter selection method. The method includes: obtaining a plurality of candidate filters; performing a template matching (TM) based selection to select an intermediate filter from the plurality of candidate filters; determining a truncated filter corresponding to the intermediate filter for prediction of a current block.

[0014] Another technical scheme adopted by the present disclosure is to provide a filter selection method. The method includes: determining whether a boundary condition is met; when it is determined that the boundary condition is not met: acquiring a first candidate filter and a second candidate filter, wherein a tap-length of the first candidate filter is higher than a tap-length of the second candidate filter; selecting a target filter for prediction of a current block based on a size of the current block and / or a current prediction angle for prediction of the current block.

[0015] Another technical scheme adopted by the present disclosure is to provide a filter selection method. The method includes: receiving an indication of a filter type; for a plurality of candidate filters belonging to the filter type, performing a template matching (TM) based selection to select a target filter for prediction of a current block from the plurality of candidate filters.

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

[0017] 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

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

[0019] FIG. 1 shows a reference filtering process applying a 2-tap interpolation filter in HEVC.

[0020] FIG. 2 shows 64 fractional directions in VVC.

[0021] FIG. 3 illustrates the process of projection of reference samples with an interpolation filter.

[0022] FIG. 4 is a flowchart of a filter selection method according to an embodiment of the present disclosure.

[0023] FIG. 5 shows an exemplary filter selection process involving rule-based filter early determination.

[0024] FIG. 6 is a flowchart of a filter selection method according to another embodiment of the present disclosure.

[0025] FIG. 7 shows an exemplary filter selection process involving hybrid use of truncated Lagrange interpolation filters for adaptive template matching.

[0026] FIG. 8 is a flowchart of a filter selection method according to another embodiment of the present disclosure.

[0027] FIG. 9 shows an exemplary filter selection process involving template matching cost guided boundary conditions estimation.

[0028] FIG. 10 is a flowchart of a filter selection method according to yet another embodiment of the present disclosure.

[0029] FIG. 11 is a schematic diagram of an apparatus for encoding or decoding according to an embodiment of the present disclosure.DETAILED DESCRIPTION

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

[0031] The present disclosure relates generally to the field of picture coding and specifically, to the improvement of reference sample filtering technique that is currently used as one of the prediction modes. The present disclosure relates to both a method and a device of pixel prediction, and the embodiments of the present disclosure may be applied in combination with other prediction methods as well as implemented as a hardware or a software module.

[0032] To help understand the technical solutions proposed in the embodiments of this application, brief introduction for several related technologies of the present disclosure will be given below, including: 1) Reference sample filtering; 2) Application field of reference sample interpolation; 3) Existing rule-based filter selection method; 4) Template matching in interpolation determination; 5) Truncated Lagrange Filter. ● Reference sample filtering

[0033] In VVC Reference sample filtering plays a vital role in improving the accuracy of predicted sample values, particularly when the prediction direction falls on a fractional position between reference samples. Two main mechanisms are used in reference sample filtering: interpolation filtering and smoothing.

[0034] For interpolation filtering, as shown in FIG. 3, when a sample projection for a given prediction direction falls on a fractional position between reference samples, the predicted sample value is obtained by applying an interpolation filter to the reference samples around the fractional position. For luma blocks, 6-tap interpolation filters are employed in VVC. A 4-tap interpolation is used for the reference extension.

[0035] The predicted samples, denoted as pred (x, y) , are calculated using the formula:

[0036] In the formula, i0 represents the closest left-side integer position of the projected sample within the reference samples r; and p indicates the fractional part of the predicted sample's projection at a 1 / 32-pel accuracy. The interpolation filter coefficients, denoted as f [p] [i] , are signed integers with 6-bit precision. These coefficients either represent a DCT-based interpolation filter (DCTIF) or a 4-tap smoothing interpolation filter (SIF) .

[0037] For chroma components, the same linear 2-tap interpolation filter of HEVC is applied. The interpolation filter type is not explicitly signaled in the bitstream; instead, it is determined by the block size and intra prediction mode index mmm. If min (∣m-50∣, ∣m-18∣) >T, the SIF is used; otherwise, the DCTIF is applied. Here, T is a threshold that depends on the block size.

[0038] For smoothing filtering, in some cases, reference samples undergo smoothing before prediction to reduce noise and improve prediction accuracy, particularly for integer-slope modes in luma blocks. The smoothing is performed using a finite impulse response (FIR) filter, such as the {1, 2, 1}  / 4 filter. This is especially beneficial for larger blocks, where suppressing discontinuities and high-frequency noise in reference samples can significantly improve the quality of the reconstructed image. ● Application field of reference sample interpolation

[0039] Three typical techniques-Template-based Intra Mode Derivation (TIMD) , Decoder-side Intra Mode Derivation (DIMD) , and Template-based Multi-Reference Line Intra Prediction (TMRL) -all rely on the processing of reference samples or reference lines, with interpolation filtering playing a key role. Below is an explanation of the scope and benefits of each technique with respect to the usage of interpolation filtering.

[0040] JVET-V0098 introduces a template-based intra mode derivation (TIMD) method. This method calculates template costs for the most probable modes (MPM) list based on neighboring areas of previously reconstructed samples. These neighboring areas are located above and to the left of the current block. Position dependent intra prediction combination (PDPC) is included in the derivation of the TIMD mode.

[0041] For each mode in the MPM list, a sum of the template costs for the template areas is calculated. The mode with the smallest sum of template costs is selected as the TIMD mode. The encoder can indicate a flag to signal that a TIMD mode was selected for a block, avoiding explicit signaling of the intra prediction mode. On the decoder side, based on this indication, the intra prediction mode can be restored by performing the same MPM list check as the decoder. The size of a TIMD template is determined according to the size of the block.

[0042] For each generated prediction, the encoder and decoder may then determine a template cost, which is estimated as a prediction error based on a difference between the prediction samples determined for the intra prediction mode and the reconstructed samples of template. For example, a sum of squared differences (SSD) , a sum of absolute differences (SAD) , or a sum of absolute transformed differences (SATD) could be used as a template cost metric. The selected intra prediction mode may be referred to as the “TIMD intra prediction mode” and may be selected from the larger set of intra prediction modes (e.g., the set of 129 angular intra prediction modes) available to TIMD.

[0043] It should be noted that other selection criteria may be used to select an intra prediction mode from the applied intra prediction modes. In another example, the encoder and decoder may select the two intra prediction modes, from the applied intra prediction modes, that result in the first and second smallest prediction errors for a template area in a process referred to as “TIMD fusion. ” The encoder and decoder may use the two intra prediction modes by predicting current block using each of the two intra prediction modes and computing a final predictor based on a weighted average of each prediction determined using the two intra prediction modes.

[0044] Sizes of the template areas used in TIMD and DIMD methods are different from each other. Moreover, in ECM design, these two methods are alternative to each other: either TIMD or DIMD method is used to get one or several intra prediction modes for a current block, but not both methods.

[0045] The use of interpolation filtering, particularly with different tap filters, improves prediction accuracy by weighting the reference samples based on their fractional positions relative to the current block. This allows for smoother transitions between reference samples and enhances the quality of prediction in areas with complex directional patterns.

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

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

[0048] Each element of the TMRL candidate list comprises the template cost, reference line and intra prediction mode. Out of the 50 candidates, only 20 combinations that provide minimum template cost are selected. These 20 candidates are sorted in ascending order by the cost values.

[0049] The use of multiple reference lines provides TMRL with flexibility in choosing the most relevant reference data for a given block. Interpolation filtering is used to smooth the transition between these reference lines and the current block, especially when predicting from non-adjacent reference lines. The SAD-based template matching method ensures that the most accurate prediction is selected, and the usage of interpolation helps minimize prediction errors when reference lines are far from the current block. This results in better quality intra-prediction, especially in larger blocks or blocks with complex directional patterns. ● Existing rule-based filter selection method

[0050] US10341659B2 discloses systems and methods of switching interpolation filters. The method of switching interpolation filters is based on motion information and other criteria to enhance video coding efficiency. The patent describes a system that allows for the selection of optimal interpolation filters from a subset, which can be dynamically determined based on various factors such as motion estimation, coding level, and prediction mode. This adaptability aims to improve the quality of video encoding while managing complexity and signaling overhead. The criteria for selecting filters can include the coding level, prediction mode, and other coding tools being used, which can lead to different subsets of filters being considered. The coding level refers to the hierarchical structure of video encoding, which can include various levels such as sequence level, picture level, slice level, coding tree unit level, coding unit level, and transform unit level. The selection of filters can vary depending on the specific coding level being processed. For instance, certain filters may be more effective for high-detail coding units, while others may be suitable for lower-detail units. This adaptability allows the encoder to optimize performance based on the characteristics of the video content at different levels of granularity.

[0051] US382781B2 discloses interpolation filters for intra prediction in video coding. The key innovation of patent US10382781B2 lies in the development and application of multiple interpolation filters for intra prediction in video coding. This innovation includes several important aspects.

[0052] 1) Adaptive Filter Selection: The patent introduces a method for selecting different interpolation filters based on specific characteristics of the video data, such as the variance of neighboring reconstructed samples and the width-to-height ratio of the video block. This adaptive approach allows for more accurate predictions tailored to the content being processed.

[0053] 2) Use of Multiple Filters: The ability to apply multiple interpolation filters within a single block, slice, or picture enhances the flexibility and effectiveness of the prediction process. This can lead to improved video quality and compression efficiency by optimizing the prediction based on local content characteristics.

[0054] 3) Reference Sample Management: The patent describes a method for determining the number of reference samples to be stored in a reference buffer, which is crucial for generating accurate prediction information. This management of reference samples allows for better utilization of available data during the reconstruction of video blocks.

[0055] Integration of Various Filter Types: The innovation also encompasses the integration of different types of interpolation filters, such as cubic, Gaussian, and DCT-based filters, which can be selected based on the specific requirements of the video content.

[0056] There is another technique called Enhancement on Mode-Dependent Intra Smoothing (MDIS) . The Enhanced Compression Mode (ECM) employs the Mode-Dependent Intra Smoothing (MDIS) filter [1, 2, 1]  / 4 to refine intra reference samples based on specific conditions. This necessitates storing both unfiltered and filtered lines of intra reference samples for intra prediction. For directional intra modes, side reference samples are projected and extended to the main reference sample line. Subsequently, linear interpolation is applied to the reference sample line in cases of fractional pixel prediction for directional modes.

[0057] One proposal suggested replacing linear interpolation with a combination of cubic and Gaussian interpolation filters to significantly improve compression efficiency. These filters could be applied to either unfiltered or filtered reference samples, depending on separate interpolation filtering conditions. Applying Gaussian interpolation filtering on top of MDIS-filtered reference samples introduces two consecutive smoothing filtering operations, increasing complexity and requiring storage for both unfiltered and filtered intra reference sample lines.

[0058] To address this issue, an algorithm was proposed that disables MDIS filtering and MDIS conditions by convolving the MDIS filter [1, 2, 1]  / 4 with the 4-tap Gaussian interpolation filter from VVC, resulting in a 6-tap Gaussian interpolation filter. This approach eliminates the two-step smoothing filtering problem, but the [1, 2, 1]  / 4 filter is still applied for non-fractional prediction of samples. The algorithm determines which interpolation filter is to be used by comparing the block width (for vertical modes) or the block height (for horizontal modes) against a fixed threshold value of 8. By combining the MDIS filter with the Gaussian filter, the MDIS filtering before the extension of the main reference line is also avoided, which was proposed separately by switching the order of projection and MDIS filtering.

[0059] The Enhanced Compression Mode (ECM) proposes merging the two smoothing filtering operations for intra prediction of directional modes: MDIS filtering and Gaussian interpolation filtering. This approach differs from previous proposals by utilizing MDIS conditions to directly select between the two interpolation filters, eliminating the need for separate interpolation filter decisions. As a result, only the unfiltered reference sample line needs to be stored for MDIS, reducing line memory requirements. Additionally, the [1, 2, 1]  / 4 filtering for non-fractional sample prediction is avoided by employing zero-phase interpolation filter taps. ● Template matching in interpolation determination

[0060] Template matching, in context of reference sample interpolation, refers to comparing the reference samples (obtained from reconstructed neighboring blocks) with the predicted samples (derived using interpolation filters) to identify the most suitable filter or candidate list for interpolation. The process begins by extracting reference samples from the template area of the reconstructed block adjacent to the current block. A set of interpolation filters S= {f1, f2, . . ., fN} are applied to the reference samples to generate predicted samples. The predicted samples are then compared with the reference samples using a similarity metric (e.g., SAD or SATD) . The filter with the lowest cost is selected as the optimal filter. Finally, the information about the selected filter is encoded into the bitstream to ensure the same filter is applied during decoding.

[0061] Reference samples are pixel values extracted from the template area of the adjacent reconstructed block (Rec block) . Reference samples are located in the region adjacent to the boundary of the current block and are the basis for predicting pixel values in the current block. The Template Area is the designated area within the reconstructed block (Rec block) near the boundary shared with the current block. Reference samples are taken from this region. The template area can be processed line by line or in smaller blocks (e.g., 4x4 or 2x2) .

[0062] Predicted samples are the pixel values computed using the reference samples and interpolation filters. Predicted samples represent an estimation of the current block's pixels and are compared against the reference samples to evaluate similarity. These measures derive a cost value, and it shows how similar the reference samples and predicted samples are. Common metrics for such similarity estimation may include SAD, STAD, and etc.

[0063] Template-based Intra Interpolation Filter (TMIF) introduces Template Matching (TM) to improve filter adaptability by dynamically selecting the best filter candidate for each block. The same three filter types as the ECM method are used, which are 6-Tap DCTIF and 4-Tap / 6-Tap SIF.

[0064] The selection method includes filter candidate list construction and template cost calculation, and cost-based selection. If the ECM rule selects SIF, the candidate list includes {4-tap SIF, 6-tap SIF, DCTIF} . Then the TM costs between reconstructed samples and predicted samples generated by each candidate filter are calculated. The filter producing the lowest cost is selected.

[0065] TIMF method may bring several improvements over ECM while it also faces several challenges. The use of Template Matching (TM) allows the method to adapt dynamically to the specific texture characteristics of each block. This enhances the accuracy of prediction, as it tailors the selection of filters to the unique features of each block. By evaluating multiple filter candidates for each block, this method overcomes the limitations associated with the rigid rule-based selection inherent in ECM. This flexibility allows for a more nuanced and effective choice of filters, contributing to improved overall performance. While this method offers several advantages, it also introduces a higher level of computational complexity. The need to calculate the cost for multiple filter candidates for each block, particularly for larger blocks or those with complex textures, requires significant computational resources. The increased computational demands of this method may pose challenges for real-time encoding systems, which may struggle to handle the additional load. This could potentially impact the efficiency of these systems and may require hardware upgrades or optimizations to mitigate.

[0066] More details can be found from: “On interpolation filter for intra template prediction, C. Zhou, Z. Lv, G. Wang (vivo) , JVET-AJ0216” .

[0067] There is also a TM cost-based filter selection method for TIMD. This study concentrates on Template Matching (TM) specifically for Template-based Intra Mode Derivation (TIMD) , with the aim of enhancing filter selection precision within TIMD. The filters used include a 6-Tap Cubic Filter and 4-Tap / 6-Tap Gaussian Filters. The 6-tap Gaussian filters are applied to larger blocks, while the 4-tap Gaussian filters are utilized for smaller blocks.

[0068] The selection method consists of Candidate Filter Application and Template Cost Calculation. Both cubic and Gaussian filters are applied to the template area, using up to three intra prediction modes derived from TIMD. The sum of Absolute Transformed Differences (SATD) between the reconstructed template and the predictor is calculated for each filter. The filter with the lowest STD is chosen for all three prediction modes in TIMD.

[0069] The proposed method introduces several advancements over the ECM (Edge Classification Method) , as well as a few challenges. Utilizing the costs derived from Template Matching (TM) , this method ensures that the selected filter closely aligns with the specific texture characteristics of the template. This alignment enhances the precision of filter selection. The evaluation process is streamlined by considering only two types of filters -cubic and Gaussian. This focused approach simplifies the TM process, making it less complex compared to TMIF (Template Matching Intra Filter) . The necessity to calculate the Sum of Absolute Transformed Differences (SATD) for multiple modes and filters introduces an added level of computational complexity. This increase in complexity could potentially strain resources. The integration of TM into the process restricts the use of other advanced features of TIMD, such as blending. This constraint could potentially limit the overall flexibility of the TIMD process.

[0070] More details can be found from: “On interpolation filter selection for TIMD, Z. Zhang, J. Chen, X. Li, R. -L. Liao, Y. Ye (Alibaba) , JVET-AJ0116” . ● Truncated Lagrange Filter

[0071] In the realm of signal processing, fractional delay (FD) filters are essential for various applications, including sampling rate conversion and digital waveguide synthesis. Traditional Lagrange interpolation is widely used to design finite impulse response (FIR) filters that approximate fractional delays. By increasing the tap length of the prototype filter, the frequency response performance can be significantly enhanced, allowing for a more accurate approximation of ideal frequency characteristics. For instance, the High Efficiency Video Coding (HEVC) standard employs a 4-tap filter for intra prediction, which effectively interpolates fractional directions in video frames. More recently, the Enhanced Coding Mode (ECM) has introduced a 6-tap filter, further improving the interpolation accuracy and visual quality of the encoded video. However, increasing the tap length can introduce challenges such as overshoot and ringing phenomena, particularly near discontinuity points in the signal, where abrupt changes occur.

[0072] Conversely, truncating the filter by reducing the tap length can yield several advantages, including lower computational complexity and reduced circuit design complexity, making the implementation more efficient. The performance degradation resulting from truncation is often limited, allowing for a balance between efficiency and effectiveness. While Lagrange filters have been effectively utilized for fractional direction interpolation in video coding, the application of truncated filters remains an unexplored area, presenting an opportunity for further research and development.

[0073] More details can be found from: “V. Valimaki and A. Haghparast, Fractional Delay Filter Design Based on Truncated Lagrange Interpolation, IEEE Signal Processing Letters, vol. 14, no. 11, pp. 816-819, Nov. 2007” .

[0074] Filter selection for intra prediction is a critical aspect of modern video coding. However, achieving an optimal balance between computational complexity, hardware efficiency, and prediction accuracy remains challenging. Template Matching (TM) offers texture adaptability but comes with significant computational cost, while rule-based filter selection is computationally efficient but lacks flexibility in handling complex textures. Additionally, high-norm filter coefficients introduce hardware design difficulties due to increased bit depth requirements. The existing filter determination methods may have several limitations as described below.

[0075] One potential issue is complexity of template matching based filter selection. The computational complexity of Template Matching (TM) -based filter selection, driven by the need for multiple predictions and cost evaluations, poses a challenge in low-latency encoding and decoding scenarios.

[0076] Another potential issue is limitation of rule-based filter selection. While rule-based conditional filter selection methods offer low computational complexity, they lack the adaptability needed to handle complex or non-uniform textures.

[0077] Another potential issue is low compression efficiency due to insufficient variety in the available filter set. Low compression efficiency and adaptability due to insufficient variety in the available filter set. This limitation results in a suboptimal trade-off between computational complexity and prediction accuracy, particularly in scenarios requiring diverse filter designs.

[0078] Embodiments of the present disclosure aim to solve at least some of the above issues.

[0079] FIG. 4 is a flowchart of a filter selection method according to an embodiment of the present disclosure. As shown in FIG. 4, the method includes operations described in blocks S101 to S103.

[0080] In S101, a first candidate filter is obtained.

[0081] The first candidate filter may be any filter that needs to be evaluated. For example, the first candidate filter may be a pre-defined Lagrange filter with a certain tap length (e.g., 6-tap, 8-tap, 10-tap, and N-tap with N>10) . Alternatively, the first candidate filter may be constructed.

[0082] The process of constructing a filter and / or a candidate set of Lagrange filters with varying tap lengths and interpolation mechanism with a filter are given below. In the candidate set of filters, a prototype filter or its truncated filter may be obtained. The candidate set of filters may include varying tap lengths to cover different frequency requirement and different phases to cover accuracy requirement.

[0083] Based on the direction precision or phase mode, a set of filter candidates may be obtained. In one example, he coefficients Ci may differentiate by the indicated different direction modes.

[0084] The Lagrange interpolation filter may use S neighboring samples to calculate the interpolated value. where i is the index of the current Lagrange basis polynomial, x is the current interpolation position,  and are the positions of the j support points.

[0085] In the phase represents each fractional position between x and x+1. For 32 phases,  For 64 phases,  For 128 phases,

[0086] For example, in a prototype 10-tap Lagrange filter, 10 neighboring samples are used to calculate the interpolated value. The coefficients for these 10 taps are pre-determined based on the relative position of the sample.

[0087] Let: 1) C (p, i) be the filter coefficient for phase p at position i , where i=0~9 are the positions of the neighboring samples; and 2) s [i] be the neighboring samples around the current position, the interpolated value y at a fractional position corresponding to phase can be expressed as:

[0088] The above formula means that for each phase p, a different set of 10 coefficients C (p, i) ∈ f (p, 0) , f (p, 1) , . . ., f (p, 9) is applied to the neighboring samples s [0] , s [1] , . . ., s [9] to derive the interpolated value.

[0089] Rounding operation and norm selection may be involved as existing methods: Cint=round (C (p, i) *NN) where C (p, i) is the fractional part of the filter coefficient and NN is the norm number.

[0090] The first candidate filter may also be a truncated filter. The filter coefficient truncating process is briefly introduced below.

[0091] In the filter coefficients truncating process, higher weighted coefficients are re-arranged to a shorter-tap filter coefficients set. This step can be generalized for truncating multiple taps at designed position, depending on the application requirements or frequency response performance.

[0092] For a prototype filter, let the filter coefficients be: CP= [c0, c1, c2, …cn] , where ci∈real number

[0093] The goal is to truncate the coefficients elements ci. One method is reducing the number of coefficients from N (longer tap) to M (shorter tap) .

[0094] In a first option, M may be a predefined value, where M≤N. Critical properties such as prediction accuracy and sum constraint may be preserved. Another method to determine the M may import the constraint from external: where K is derived from the difference from the prototype filter and target truncated filter.

[0095] In a second option, a truncation threshold τ may be defined, and the coefficients that are least significant may be truncated based on their magnitude or contribution. Then M may be derived from this threshold. The value τ could be predefined as a constant value or a performance requested value. For example, for a position with value in each phase less than a predefined threshold (ex, 3) , the coefficient value is truncated.

[0096] Then the top M coefficients that are retained are: Ctruncated= [c′0, c′1, c′2, …, c′M] , c′∈CP, c′0≥τ

[0097] In a third option, coefficients are accumulated from inner side of the prototype filter coefficients, until the amount reaches a target tap number M. This accumulated value may be derived as:

[0098] In a fourth option, coefficients are accumulated from inner side of the prototype filter coefficients, until the accumulated result reaches a threshold:

[0099] The threshold may be a predefined value. For example, Threshold=0.95 means once Valueaccumulated reaches 95%of overall coefficients, the rest coefficients will be discarded and the truncating is ended.

[0100] For this prototype filter with N taps, its truncated filter with inner M taps at center may be represented as:

[0101] Whether the truncated coefficients meet the normalization constraint (i.e., the norm number, NN) may be evaluated, and an adjustment value may be calculated:

[0102] If ∑iCtruncated [i] does not equal to norm number NN, then a coefficient adjustment is requested.

[0103] Specifically, after the edge part of the prototype coefficient is truncated, the remaining coefficient total value may not be equal to the norm number, then one method from the following options could be used to Rounding / re-arrange truncated coefficients.

[0104] In one method, the coefficients may be adjusted by weighting of the post-truncating loss.

[0105] The fractional component of Cdiscarded [i] can be extracted as: Cdiscarded= [c′0, …, c′K∪c′j-K…, c′M] , c′j∈CP, c′t<τ

[0106] In a first option, the weighting factor W (i, F) to the per-position value to emphasize its importance of current position in the overall remained coefficients can be obtained as:

[0107] In a second option, the weighting factor W (i, F) to the fractional part from the prototype generation to emphasize its importance before rounding in the overall coefficients can be obtained as:

[0108] Once weight value is obtained, the redistributing of discard value may be performed as follows.

[0109] In a first option, the coefficient weight factor W (i, F) is sorted in descending / ascending order. The weighted coefficients CweightAdjusted [i] are then adjusted based on the coefficient WF importance. Specifically, 1) all W (i, F) are sorted in descending / ascending order; 2) from sorted list, apply ± 1 to the corresponding position i; 3) apply adjustment for each coefficient until the sum is equal to the norm number:

[0110] In a second option, the coefficient weight factor W (i, F) is sorted in descending / ascending order by sign group. The weighted coefficients CweightAdjusted [i] are then adjusted based on the coefficient WF. Specifically, 1) all W (i, F) are sorted in descending / ascending order within different sign (±) groups; 2) for the positive (+) sorted list, apply + 1 to the corresponding position i; 3) for the negative (-) sorted list, apply -1 to the corresponding position i; 4) apply adjustment for each coefficient until the sum is equal to the norm number.

[0111] In a third option, the taps of the prototype filter are divided into groups based on position or weight (e.g., left, right part of the coefficients) . A first level adjustment is performed within each group, which is similar to the steps in the first or second option, and includes: sorting W (i, F) in descending / ascending order or sign group; within the sorted list, applying a value of +1 or -1 to the corresponding position i; and re-doing adjustment for each coefficient until the sum is equal to the norm number.

[0112] In a fourth option, the step size for coefficient adjustment may be dynamically adjusted. Larger step sizes may be allowed for significant errors, while finer adjustments are used for smaller errors. For example, with a given threshold NTapLength , if Valueadjust>NTapLength , the step size is dynamically adjusted based on error magnitude. Firstly, all W (i, F) are sorted in descending / ascending order and / or with groups divided based on their sign (+ / -) . Secondly, within the sorted list, applying a value of +K or –K to the corresponding position I, where K may be a value derived from sorted W (i, F) of overall norm difference Valueadjust:

[0113] For W (i, F) with top order and Krounded<1 , the value of K is set equal to 1. Re-do adjustment for each coefficient until the sum is equal to the norm number.

[0114] In another method, the coefficients may be adjusted by considering sign-based offsets.

[0115] In one option, for Cint [i] set to zero, an offset is recorded. This offset is added to the neighboring position. The following table shows an example:

[0116] The value of position 0 and 7 is offset to the neighboring position 1 and 6.

[0117] In another option, for Cint [i] set to zero, an offset is recorded. This offset is added to the nearest coefficient position with the same sign. The following table shows an example:

[0118] The value of position 0 and 7 is offset to the nearest neighboring position with same sign 2 and 5.

[0119] A constraint check may be performed to ensure the sum of the normalized coefficients matches the target norm number NN.

[0120] In an alternative method, the coefficients can be adjusted based on a set of learned weights, rather than rule-based adjustment methods. Specifically, the method involves adjusting filter coefficients using learned weights instead of traditional rule-based methods. After truncation and normalization, coefficients are adjusted based on a set of weights that indicate their relative importance, ensuring the sum constraint is met. The adjustment is distributed proportionally or to the most significant weights, and the coefficients are updated accordingly. Weights are optimized to minimize the error between the original and interpolated samples, with different sets of weights configured for various filter tap lengths and phases. These weights can be configured offline, using pre-trained data, or online, adapting to content and signaled from encoder to decoder. More detailed information may be found in patent application PCT / CN2024 / 142388.

[0121] The constructed filter or the set of candidate filters may be grouped into logical categories such as “cubic, ” “smoothing, ” or “others” . An identifier or index may be added for each filter to facilitate selection during subsequent stages.

[0122] In S102, whether a current prediction angle for prediction of a current block satisfies an angle threshold, and whether a geometrical property of the current block satisfies a geometrical threshold are determined.

[0123] In this operation, the first candidate filter may be estimated by a rule-based filter early determination method. Introduction of the rule-based method is given below.

[0124] The process uses pre-defined conditions (e.g., block size, prediction mode, or texture characteristics) or derived / obtained conditions to determine whether a filter should be used. The filter selection method depends on prediction mode, prediction angular and / or block geometric property (size: width, height; aspect ratio; and etc. ) , where the truncated interpolation filter or prototype interpolation filter including 4-tap, 6-tap, 8-tap, and / or N-tap (N>8) and / or different norms (ex, 64, 256 …8192 and etc. ) can be estimated. The selection may depend on current block width, height and prediction angular, and extra intra prediction mode.

[0125] In the filter determination, two conditions are tested. These two conditions are evaluated to fit the filters with their best performance scenarios. One condition is the angular value difference (conditionang ) . The conditionang compares the comparison value (ValueD ) with a difference threshold (ThresholdD) . The comparison value ValueD is the difference between current prediction angle and the predefined horizontal angle, or the difference between current prediction angle and the predefined vertical angle. Another condition is the geometrical condition (conditiongeo ) . The conditiongeo compares the current block geometric value (ValueG ) with a geometric threshold (ThresholdG) .

[0126] For example, a filter denoted as filterA may be utilized if both conditions for this filter are satisfied. Otherwise, a set of filters denoted as filter setB may be further estimated by, for example, template matching mechanism.

[0127] The filterA is a filter element in a predefined filter set. The filter set may include filters with different phase, coefficients norm or tap length design. For example,

[0128] In the tested conditions, the comparison value ValueD may be the angular value difference, angular mode index difference, current block geometric value (infogeo ) difference and so on. Accordingly, whether the condition is true can be determined based on: conditionang=ValueD>ThresholdD ValueD=f (prediction angular, horizontal angular, vertical angular, …, infogeo)

[0129] Similarly, the current block geometric value ValueG may be related to the width, height or geometric value (infogeo) of the current block. The current block geometric value infogeo may refer to width, height, split depth, etc. Accordingly, whether the condition is true can be determined based on: conditiongeo=ValueG<ThresholdG ValueG=f (width, height, infogeo)

[0130] An exemplary method for acquiring the comparison value ValueD is given below.

[0131] The information needed may include at least one selected from: the prediction angle, the horizontal angle, the vertical angle, extra intra prediction direction mode (statusE) , and the split depth (depthsplit) of the current block. ValueD=f (prediction angular, horizontal angular, vertical angular, statusE, …, infogeo)

[0132] It should be noticed, the prediction angle, horizontal angle, and vertical angle may be replaced by their indexed. i.e., IndexPred Ang, indexHor Ang and indexVer Ang. ValueD=f (IndexPred Ang, indexHor Ang, indexVer Ang, statusE)

[0133] The indexHor Ang and indexVer Ang are the predefined horizontal index and vertical index. Because the IndexPred Ang may appear in the middle of indexHor Ang and indexVer Ang, a minimum selection is needed in the calculation. ValueD=minimum (differenceH, differenceV)

[0134] The differenceH, differenceV here represents the absolute difference between two index value as follow: differenceH=abs (IndexPred Ang-indexHor Ang) differenceV=abs (IndexPred Ang-indexVer Ang)

[0135] The predefined horizontal angular mode indexHor Ang and vertical mode indexVer Ang value may be different, if there is multiple indexing modes for intra prediction angles. Thus, a selection for predefined value between multiple mode is needed. For example, in JVET ECM extra intra prediction direction mode statusE is used to identify the indexing mode. The horizontal angular mode indexHor Ang and vertical mode indexVer Ang can be obtained base on the value of extra intra prediction mode statusE.

[0136] An exemplary method for acquiring the difference threshold ThresholdD is given below.

[0137] The derivation of ThresholdD is based on the current block width / height (valuew, valueh) , split depth (depthsplit) of the current block and extra intra prediction direction mode (StatusE) . ThresholdD=f (valuew, valueh, depthsplit, StatusE)

[0138] The ThresholdD may differ, if there is multiple indexing modes for intra prediction angles. Thus, a selection for ThresholdD between multiple mode StatusE is needed.

[0139] The ValueE represent the threshold for extra intra prediction mode and ValueN represent the threshold for non-extra intra prediction mode. The ValueN may differ with ValueE with a ratio parameter k.

[0140] The ValueE is a representation of geometric value. Such as, area of the block, ratio of the block width / height.

[0141] In one example, the ValueE could be equal to a log2 representation of geometrical value (log2size) .

[0142] In an implementation, it may use k=2 as an adjust ratio for ValueN, then ThresholdD is defined as follow.

[0143] In one example, a fixed prediction angular mode index difference could be defined.

[0144] An exemplary method for acquiring the geometric threshold ThresholdG is given below.

[0145] The derivation of ThresholdG is based on the current block width / height (valuew, valueh) , split depth (depthsplit) of the current block, and extra intra prediction direction mode (StatusE) . ThresholdG=f (valuew, valueh, depthsplit, StatusE)

[0146] The ThresholdG may differ, if there is multiple indexing modes for intra prediction angles. Thus, a selection for ThresholdG between multiple mode StatusE is needed.

[0147] In one example, a log2 representation of geometric threshold could be define. Then, the ThresholdG is defined as follow.

[0148] In one example, a width / height geometric threshold could be obtained as following orders.

[0149] In one example, current block geometric area threshold could be obtained as following orders.

[0150] In one example, geometric block width / height or height / width ratio threshold could be obtained as following orders.

[0151] For the final determination of filterearly, the following computation method options are proposed.

[0152]

[0153] filterearly condition are filter elements in a pre-defined filter set. And filter setTM candidate is a filter candidate list for further TM cost-based selection. For example:

[0154] The determination of is as follow, and the  follows the same way. The determination between 32 phase filter and 64phase filter is rely on the status of extra intra prediction direction mode StatusE

[0155] In one example, the filter determination is obtained by evaluating prediction angle difference ValueD, the threshold difference ThresholdD , additionally a log2 representation of geometric ThresholdG of current block is also been tested. The obtain of ValueD obtain of adaptive prediction angular value difference ThresholdD may refer to foregoing sections of the present disclosure, and the obtain of log2 representation of geometric ThresholdG may refer to foregoing sections of the present disclosure. The implementation for filteradap may look like: ValueD=minimum (abs (IndexPred Ang-indexHor Ang) , abs (IndexPred Ang-indexVer Ang) )

[0156] For conditions indicate current filter is inside of the filter afollowing TM cost-based selection is needed.

[0157] In S103, the first candidate filter is selected as a target filter for prediction of the current block when it is determined that the current prediction angle satisfies the angle threshold and the geometrical property of the current block satisfies the geometrical threshold.

[0158] When the criteria set forth in the previous step is met, the first candidate filter may be selected as the target filter for prediction of the current block. That is, it may be utilized for generating predicted samples of the current block. In some case, other estimations may be performed, and the first candidate filter may be taken as one of the candidate filters involved in subsequent estimations.

[0159] Additionally, when it is determined that the current prediction angle does not satisfy the angle threshold or the geometrical property of the current block does not satisfy the geometrical threshold, the process may further includes: obtaining a plurality of second candidate filters; performing a template matching (TM) based selection to select the target filter from the plurality of second candidate filters.

[0160] The method of template matching cost computation for a filter (e.g., each filter from the second candidate filters) is given below.

[0161] Costs (e.g., SAD, SATD) between predicted pixel values and reference samples (i.e., samples in the template area for template matching determination) may be calculated for each filter. For each filter fi, obtain the cost value Ci as:

[0162] Different evaluation metrics and methods may be applied.

[0163] In a first option, sum of absolute differences (SAD) evaluation may be applied. This method calculates the absolute difference between predicted and reference pixel values, providing a simple yet effective cost measure:

[0164] In a second option, mean squared error (MSE) evaluation may be applied. This method obtains the average of the squares of the differences value between predicted and reference pixel values:

[0165] In a third option, normalized cross-correlation (NCC) evaluation may be applied. This method measures the similarity between predicted and reference pixel values by normalizing the cross-correlation:

[0166] In a fourth option, sum of the absolute transformed difference (SATD) evaluation may be applied. For the derived difference X, the corresponding SATD may be calculated as: where M is the difference matrix size, and H is the normalized M×M Hadamard matrix.

[0167] The filters may be sorted in ascending order based on their template matching costs.

[0168] For example, all filters may be ranked based on their costs Ci in ascending order: where

[0169] For example, filters may be ranked based on their costs Ci in ascending order with in a filter set S:

[0170] In one embodiment, the filter with the lowest template matching cost may be obtained as the target filter for subsequent prediction process. That is, let where i1 corresponds to the index of the filter with the lowest cost.

[0171] The solution described above offers a structured approach to optimize filter selection and application, particularly in managing complexity. The rule-based early determination step reduces computational complexity by selecting appropriate filters based on block size, prediction angle / mode, or texture characteristics, thus calculations for template matching may be reduced. A specific example of this solution is provided with reference with FIG. 5. Steps shown in FIG. 5 are explained below.

[0172] The first step involves construction of candidate filter and / or filter sets. A predefined filter (or a candidate set) of Lagrange filters with varying tap lengths (e.g., 6-tap, 8-tap, 10-tap, and N-tap where N>10) may be obtained along with a secondary filter candidate set which contains other type of interpolation filter.

[0173] Then the rule-based early determination is performed. Conditions to choose one or more filters (e.g., shorter or longer filters) may be verified based on the block size, prediction angle / mode, or texture characteristics. For example, an 8-tap filter may be evaluated. If the condition verification passes, the 8-tap filter may be utilized for subsequent prediction process.

[0174] If the condition verification does not pass, template matching cost calculation may be performed for representative filter (s) . The TM cost calculation may be performed for the other filters from the filter set. Based on the TM costs of the filters, a target filter which has the minimal TM cost may be selected.

[0175] Finally, the selected filter may be utilized for reference sample filtering. The method for reference sample filtering may be similar to existing technologies.

[0176] It should be noted that, the adaptive filter selection and filtering method, based on the position of prediction, can be effectively applied to various coding modes. These include angular intra prediction, Template-based Intra Mode Derivation (TIMD) , Directional Intra Mode Derivation (DIMD) , and Template-based Multi-Reference Line (TMRL) , where tools have a reference sample extending process. This approach may also be applied with a video codec tool that selectively uses different interpolation filters to improve inter-predicted pixel values.

[0177] FIG. 6 is a flowchart of a filter selection method according to another embodiment of the present disclosure. As shown in FIG. 6, the method includes operations described in blocks S201 to S203.

[0178] In S201, multiple candidate filters are obtained.

[0179] The candidate filters may be any filters that need to be evaluated. For example, they can be a set of Lagrange filters with varying tap lengths along with secondary filter candidate set containing other type of interpolation filters.

[0180] In some embodiments, the multiple candidate filters may be representative filters selected from an initial set of candidate filters.

[0181] In S202, the template matching (TM) based selection is performed to select an intermediate filter from the candidate filters.

[0182] In this operation, TM cost evaluation may be performed for the candidate filters. The intermediate filter may be the filter with the minimal TM cost. This intermediate filter will be further evaluated in subsequent step (s) .

[0183] In S203, a truncated filter corresponding to the intermediate filter is determined for prediction of a current block.

[0184] The method for acquiring a truncated filter corresponding to the intermediate filter may be similar to the filter truncation method explained in foregoing section of the present disclosure.

[0185] In some embodiments, the operation of determining the truncated filter corresponding to the intermediate filter may include: acquiring a plurality of truncated filters corresponding to the intermediate filter; and performing a TM-based selection to select the truncated filter with minimal TM cost from the plurality of truncated filters.

[0186] For example, if the lowest-cost filter is a Lagrange filter and there are multiple Lagrange filters in a filter set S, the following operations may be performed.

[0187] 1) Obtain truncated filter coefficients with the same tap length.

[0188] A truncate constraint obtained from this step is filter tap length from other filter candidate set. fTr=truncate (fselect)

[0189] 2) Option 1: Obtain Template Costs value or reuse sorted per-set ranking results, Ranked_FiltersCategorised. Apply truncated filters fTr or fselect to R and derive costs value.

[0190] 3) Option 2: Obtain Template Costs value within tap-length closed filter. Apply truncated filters fT-1 and fT+1 to R and derive costs value.

[0191] 4) Obtain final truncated filter. Obtain the truncated filter with the lowest cost for final reference sample interpolation filtering.

[0192] In some embodiments, the operation of determining the truncated filter corresponding to the intermediate filter may include: acquiring a plurality of truncated filters corresponding to the intermediate filter; selecting the truncated filter from the plurality of truncated filters based on a size of the current block, a current prediction angle for prediction of the current block, or texture characteristics of the current block.

[0193] The method for acquiring the result of the comparison difference ValueD, the difference threshold ThresholdD , and the comparison of the current block geometric value ValueG , with the geometric threshold ThresholdG. It described similar procedure in foregoing sections of the present disclosure related to rule-based selection method. The final determination of the prototype or truncated filter, filteradap, may be performed as follows.

[0194] In a first option, the determination of filter relies on the comparison of adaptive prediction angular ValueD and its ThresholdD , then a geometric restriction ThresholdG for current block is also been tested. For a coding frames with coding blocks may have two different phase conditions, filteradap is a selected by the extra intra prediction direction mode StatusE.

[0195] filter32p, and filter64p are filter elements in a pre-defined filter set. For example,

[0196] The determination of filter32p is as follow, and the determination of filter64p follows the same method.

[0197] In one example, the filter determination is obtained by evaluating prediction angle difference ValueD, the threshold difference ThresholdD, and a log2 representation of geometric ThresholdG of current block. The obtain of ValueD and the obtain of adaptive prediction angular value difference ThresholdD may refer to foregoing sections of the present disclosure, and the obtain of log2 representation of geometric ThresholdG may refer to foregoing sections of the present disclosure. The implementation for filteradap may look like:

[0198] The implementation for filter64p may look like: ValueD=minimum (abs (IndexPred Ang-indexHor Ang) , abs (IndexPred Ang-indexVer Ang) )

[0199] In a second option, the filter determination relies on comparison of adaptive prediction angular value difference and the corresponding threshold, additionally the geometric width / height ratio value of current block is also been checked. For a coding frames with coding blocks may have two different phase conditions, filteradap is a selected by the extra intra prediction direction mode StatusE.

[0200] The determination of filter32p is as follow, and the determination of filter64p follows the same method.

[0201] The value sidepred ang is derived to indicate whether the prediction angle pointing to the longer side of the current block. Where absolute difference to horizontal index as differenceH and absolute difference to horizontal index as differenceV.

[0202] In another embodiment involved with TIMD, the determination of a 6-tap Lagrange filter and a truncated Lagrange filter could be depending on following values adaptive prediction angular ValueD and its ThresholdD with geometric restriction ThresholdG.

[0203] filter64p are filter elements in a predefined filter set. For example,

[0204] The determination of filter32p is as follow, and the determination of filter64p follows the same method.

[0205] In one example, the adaptive prediction angular value difference ThresholdD , may be represented with a log2 representation of geometric ThresholdG. The implementation for filter64p may look like: ValueD=minimum (abs (IndexPred Ang-indexHor Ang) , abs (IndexPred Ang-indexVer Ang) )

[0206] In another embodiment involved with TMRL, the determination of a 4-tap Lagrange filter and a truncated Lagrange filter could be depending on following values adaptive prediction angular ValueD and its ThresholdD with geometric restriction ThresholdG.

[0207] filter64p are filter elements in a predefined filter set. For example,

[0208] The determination of filter32p is as follow, and the determination of filter64p follows the same method.

[0209] In one example, the adaptive prediction angular value difference ThresholdD , may be represented with a log2 representation of geometric ThresholdG. The implementation for filter64p may look like: ValueD=minimum (abs (IndexPred Ang-indexHor Ang) , abs (IndexPred Ang-indexVer Ang) )

[0210] In some embodiments, the truncated Lagrange filter, utilized for interpolation, can be determined by a machine-learned model, which may include, but is not limited to, decision trees, support vector machines, neural networks, and logistic regression.

[0211] For instance, a decision tree might be employed to ascertain which truncated Lagrange filter (e.g., from a candidate set) will be utilized for interpolation. The features considered for decision-making in tree nodes may encompass at least one from the following categories:

[0212] 1) Information related to geometrical properties, which includes: the height and width of the current block, the ratio between the height and width of the current block, the number of samples in the current block, and the split depth of the current block.

[0213] 2) Intra mode-related information, which includes: The mode index (e.g., the current intra mode index, the current angular value, the current angular mode index, the difference between the current angular value and a predefined horizontal / vertical angular value, and the difference between the current angular mode index and a predefined horizontal / vertical angular mode index) .

[0214] 3) Information related to matching cost, which includes: the TM cost of prototype Lagrange filters.

[0215] The information gain brought by each feature (i.e., the reduction in information entropy after splitting using this feature) is calculated. The feature that results in the largest information gain is identified as the optimal split feature for the current depth. This process of calculating information gain and identifying features is iterated until all nodes of the tree have been determined.

[0216] The leaf node contains at least one of the following: the tap length of the prototype Lagrange filter to be used; the offset length of the truncated Lagrange filter to be used; or the norm of the Lagrange filter to be used.

[0217] It should be noted that, for other machine learning methods, one or more of the features utilized by the decision tree described above can serve as input.

[0218] This solution uniquely emphasizes complexity reduction through two key steps: One step involves obtaining a representative filter to perform template matching, ensuring efficient filter selection by focusing on key candidates. Additionally, another step introduces optional truncation for low-cost filters, where the candidates from the first step are truncated (e.g., reducing a 12-tap filter to a 6-tap) to further decrease computational demands. Collectively, these steps streamline the process, enhancing efficiency while maintaining prediction accuracy. A specific example of this solution is provided with reference with FIG. 7. Steps shown in FIG. 7 are explained below.

[0219] The first step involves construction of candidate filter sets. A predefined candidate set of prototype Lagrange filters and or truncated Lagrange filters with varying tap lengths (e.g., 6-tap, 8-tap, 10-tap, and N-tap where N>10) may be obtained along with a secondary filter candidate set which contains other type of interpolation filter.

[0220] Then, representative filters may be obtained to reduce the number of TM filter candidates used in subsequent estimation. Denoting the set of all candidate filters as: S= {f1, f2, f3, …fN} , the representative filter may be selected in different ways as follows.

[0221] In one option, mid-range selection may be applied. The filter fm with Tm may be obtained: Tm=median ( {T1, T2, T3, …, TN} ) where Tm is the median tap length.

[0222] In one option, interval sampling may be applied. Filters fs at regular intervals from S may be obtained. fs= {fk|k≡0 (mod I) } where I is the sampling interval, and I can be a predefined value such as 2.

[0223] In one option, prevalence-based selection may be applied. Filters that are historically or empirically most used in prior evaluations (e.g., a 6-tap or 8-tap filter if these are the standard in the codec) may be obtained.

[0224] Then, template matching costs for the representative filter (s) may be performed. The filter with lowest cost may be selected as an intermediate filter for further estimation. Multiple truncated filters corresponding to the intermediate filter may be obtained. The truncated filters may be used for precision refinement. Template costs for these truncated filters may be calculated, and the one with the lowest cost may be selected as the target filter for subsequent prediction process. Alternatively, rule-based selection may be applied for the truncated filters. The choice for the target filter may be adjusted based on the block size, prediction angle / mode, or texture characteristics.

[0225] In an alternative method, neither the TM costs determination process or the rule-based selection process is performed. The truncated filter (s) of the intermediate filter may be directly selected in order to reduce computational complexity.

[0226] It should be noted, Position-based adaptive filter selection and filtering can be effectively applied to various coding modes such as angular intra prediction, Template-based Intra Mode Derivation (TIMD) , Directional Intra Mode Derivation (DIMD) , and Template-based Multi-Reference Line (TMRL) , where tools have a reference sample extending process. This approach may also be applied with video codec tools that selectively use different interpolation filters to improve the inter-predicted pixel value.

[0227] FIG. 8 is a flowchart of a filter selection method according to another embodiment of the present disclosure. As shown in FIG. 8, the method includes operations described in blocks S301 to S303.

[0228] In S301, whether a boundary condition is met is determined. When the boundary condition is not met, operations in S302 and S303 are performed.

[0229] In one embodiment, the operation of determining whether the boundary condition is met may include: determining whether a difference between the current prediction angle and a reference direction is lower than a range threshold. When it is determined that the difference between the current prediction angle and the reference direction is lower than the range threshold, the boundary condition is met.

[0230] For example, the range threshold may be equal to a product of a scaling factor and a total range of angle indices.

[0231] For example, the range threshold may be derived based on a height and a width of the current block.

[0232] In another embodiment, the operation of determining whether the boundary condition is met may include: determining whether a geometrical property of the current block meets a geometric threshold. When it is determined that the geometrical property of the current block meets the geometric threshold, the boundary condition is met.

[0233] Here the boundary means the decision boundaries where the prediction angle is very close to the angle threshold or the block geometric property is very close to the geometric threshold. If the boundary condition is met, further evaluation for the candidate filters may be needed. Exemplary methods for determining whether the boundary condition is met are given below.

[0234] A range Rangle (e.g., Rangle=1 or Rangle=2) within which the current angle is considered near a reference direction is defined.

[0235] If the following formula is true, the block can be marked as an angle-based boundary case: TA-Rangle<Δθ<TA+Rangle where TA is the angle threshold in rule-based filter selection method.

[0236] The angle range Rangle may be derived based on the granularity of prediction angle indices in the codec: Rangle=kθ·IndexRange where kθ is the scaling factor (e.g., 0.01) , IndexRange is the total range of angle indices (e.g., [0, 127] ) .

[0237] Alternatively, the angle range Rangle may be derived based on the block geometric constraint: Rangle=kθ·f (H, W) where kθ is the scaling factor (e.g., 0.5) , f (H, W) is the block geometric constraint derived from  height and width (e.g.,  ) .

[0238] The size (geometric) condition focuses on the proximity of the block size to a predefined threshold, which ensures only the smallest or largest sizes near the decision boundary are evaluated in subsequent steps.

[0239] For example, if the block geometric constraint is equal to the original threshold, it can be taken as the boundary case: f (H, W) =TB_origianl

[0240] In another example, the geometric boundary constraint may be different from the original threshold: TBnew<f (H, W) =TB_original

[0241] The threshold TBnew can be a value derived from the original threshold: TBnew = TB_original*K

[0242] In this formula, K can be a constant value, for example K=2. Alternatively, K may be a ratio derived from the block geometric values, for example, K=Block_depth / 2.

[0243] The above angle-based and size-based criteria may be considered together. When the block satisfies either or both criteria, it may be determined that the boundary condition is met.

[0244] In S302, a first candidate filter and a second candidate filter are acquired.

[0245] The first candidate filter may has a longer tap-length than the second filter. For example, the first candidate filter may be denoted as Filterlonger , while the second filter may be denoted as Filtershorter.

[0246] When the boundary condition is not met, the target filter may be selected from the first candidate filter and the second candidate filter.

[0247] In S303, a target filter for prediction of a current block is selected based on a size of the current block and / or a current prediction angle for prediction of the current block.

[0248] Criteria about whether to use the longer-tap filter or the shorter-tap filter may be established based on the prediction angle and the block size. Let θ represent the prediction angle (in degrees or pre-defined index number) , and Δθ be the difference between θ and pre-defined horizontal or vertical angle. W and H represent the block width and height respectively, and f (H, W) is the block geometric value derived from height and width. The block geometric constraint is set as threshold TB. The selection of the target filter from the first candidate filter and the second candidate filter may be as follow:

[0249] Additionally, when it is determined that the boundary condition is met, the process may further include: obtaining a plurality of third candidate filters; and performing a template matching (TM) based selection to select the target filter from the plurality of third candidate filters.

[0250] In other words, when the boundary condition is met, further evaluation may be performed for other candidate filters. This evaluation may be based on TM cost comparison. Details about TM cost comparison has been described in foregoing sections of the present disclosure and will not be repeated herein.

[0251] This solution primarily addresses accuracy by incorporating template matching (TM) for boundary cases, enhancing its ability to match the texture characteristics of the current block. Although it introduces additional TM for these specific cases, it improves precision by ensuring that the selected filter aligns more closely with the texture details of the block, thereby optimizing the overall prediction quality. A specific example of this solution is provided with reference with FIG. 9. Steps shown in FIG. 9 are explained below.

[0252] The first step involves definition of conditions for initial filter selection. Criteria are established based on the prediction angle and block size to determine whether a longer-tap or shorter-tap filter should be used. These conditions are utilized as the primary decision-making framework for filter selection.

[0253] Then, boundary cases are identified. In addition to the condition thresholds, an offset (angle degrees and / or slightly larger / smaller block sizes) threshold is set. These boundary cases, within the condition threshold to offset, are identified as candidate cases for which template matching cost is to be used to perform filter selection.

[0254] Then template matching may be performed for filter selection in boundary cases. Template matching is performed using one or several filters and other filters from the filter set. A filter is then selected based on the template matching cost.

[0255] The selected filter may be utilized for reference sample filtering.

[0256] It should be noted that, the position of prediction-based Adaptive filter selection and filtering is found to be effectively applicable to various coding modes such as angular intra prediction, Template-based Intra Mode Derivation (TIMD) , Directional Intra Mode Derivation (DIMD) , and Template-based Multi-Reference Line (TMRL) where tools are involved in the reference sample extending process. This approach can also be applied with video codec tools that selectively utilize different interpolation filters to enhance the inter-predicted pixel value.

[0257] FIG. 10 is a flowchart of a filter selection method according to another embodiment of the present disclosure. As shown in FIG. 10, the method includes operations described in blocks S401 to S403.

[0258] In S401, the encoder determines the most used filter type, and the most used filter type is coded.

[0259] In S402, the encoder transmits an indication of the most used filter type via a bitstream, and the decoder receives this indication.

[0260] In S403, for candidate filters belong to the filter type, the decoder performs a TM-based selection to select a target filter for prediction of a current block from the candidate filters.

[0261] This solution addresses the high complexity of filter selection on the decoder side by utilizing signal-guided template matching. On the encoder side, it identifies and signals the most frequently used filter or filter type within a coding period. The decoder then uses this signal to streamline the filter selection process: if a specific filter or filter type is signaled, the decoder can directly apply it or limit template matching to a predefined candidate list, thereby reducing computational demands while maintaining effective interpolation. A more detailed explanation is given below.

[0262] The encoder side process may include:

[0263] 1) Performing template matching for filter selection. Template matching may be performed for one or several filters from one or more filter sets. A filter may be selected based on the template matching cost evaluation results.

[0264] 2) Coding the most used filter type. This involves collecting statistics on the filter that is used most significantly within a coding period, which can be a picture, slice, coding tree unit (CTU) , and so on.If a particular filter is used beyond a specified threshold, a signal value is assigned to represent the most frequently used filter. If a specific filter type is used beyond a certain threshold, a signal value is assigned to represent the corresponding list of most frequently used filter candidates. If neither of the above cases applies, a signal is used to denote the status.

[0265] A counter for each filter fi used in a coding period (e.g., picture, slice, CTU) may be maintained:

[0266] If Usage (fi) is no less than a first threshold (threshold for an individual filter) denoted as THfilter, an index of fi may be added into picture, slice or CTU header to reduce complexity of template matching on the decoder side. The threshold could be a predefined constant value, for example 0.95.

[0267] If Usage (fi ) is no less than a second threshold (threshold for a filter type) denoted as THfilter-set, an index of the filter type can be signaled. The threshold could be a predefined constant value, for example 0.75.

[0268] If no dominant filter or filter type exists, no specific signal is transmitted.

[0269] For example. A syntax structure could consist of a variable-length code that represents different scenarios:

[0270] 1) Base case: the first 1 to 3 bits may be utilized to identify the type of filter.

[0271] 2) Extended case: if the signal indicates a candidate list, additional bits specify an index of which filter within the list is selected can be adopted. It could use variable-length coding (e.g., Golomb-Rice (use in picture or slice header level coding structure) or CABAC (use in CTU level Coding structure) ) to index filters efficiently.

[0272] An example of providing such indication in sequence parameter set (SPS) is given in the following table:

[0273] An example of providing such indication in picture parameter set (PPS) is given in the following table:

[0274] An example of providing such indication in slice header (PH) is given in the following table:

[0275] An example of providing such indication in coding tree unit (CTU) is given in the following table:

[0276] The decoder side process may include:

[0277] 1) Decoding the filter type flag. An interpolation filter signal is decoded from a coding structure (such as a picture, slice, CTU, etc. ) , using the flag to further determine the specific interpolation filter.

[0278] The relative syntax may be allocated at coding structure such as picture, slice header, or CTU and etc, as described above.

[0279] A 1-bit TM reference interpolation filter selection flag may be obtained. If the first bit is '0', no significant filter is signaled; full template matching is proceeded with. Filter Selection Using Template Matching is then applied. If the first bit is '1', the following additional bits are obtained.

[0280] A 1-bit TM reference sample interpolation filter list ID and reference sample interpolation filter flag may be obtained. If the two bits are '00', within the predefined first candidate list, all candidate filters are selected by TM cost. If the two bits are '10', within the predefined second candidate list, all candidate filters are selected by TM cost. If the two bits are '01', within the predefined first candidate list, a filter index follows. If the two bits are '11', within the predefined second candidate list, a filter index follows.

[0281] Variable-length bit of reference sample interpolation filter index may be obtained. The subsequent bits are parsed to identify the filter within the candidate list. Variable-length coding could be used (e.g., Golomb-Rice (used in picture or slice header level coding structure) or CABAC (used in CTU level Coding structure) ) . If the signal identifies a filter, the indicated filter is applied. If the signal identifies a range between two filters, template matching is proceeded with its upper and lower bound filters.

[0282] 2) Performing template matching for filter selection corresponding to the filter type flag. Template matching is conducted using one or several filters from the filter set, and a filter is selected based on the template matching cost. If the signal does not identify any filters or categories, full template matching (TM) cost-based selection is performed on the decoder. If the signal specifies a filter type candidate list, TM cost-based selection is conducted within the targeted filter candidate list on the decoder. If the signal directly identifies a filter, this target filter is used for filtering.

[0283] It should be noted that, the position of prediction-based adaptive filter selection and filtering can be effectively applied to various coding modes such as Angular Intra Prediction, Template-based Intra Mode Derivation (TIMD) , Directional Intra Mode Derivation (DIMD) , and Template-based Multi-Reference Line (TMRL) , where tools engage in a reference sample extending process. This approach can also be applied with video codec tools that selectively use different interpolation filters to improve the value of inter-predicted pixels.

[0284] Optionally, implicit signal may be used. For example, relative information of the neighboring blocks may be utilized for the current block, such as interpolation filter flag, filter candidate list index, and or filter index.

[0285] This embodiment describes the process of implicit derivation from neighboring blocks, where neighboring blocks interpolation filter settings can be re-used to suggest a suitable filter or filter candidate list.

[0286] The steps performed at the encoding side may include:

[0287] 1) Obtain neighboring filter analysis.

[0288] Firstly, neighboring block filter signals or stored filter settings are obtained. Prediction loss lossNB filter is derived using the neighboring block filter signal as:

[0289] In this step, various evaluation metrics / methods such as SAD, MSE, NCC, or SATD can be adopted.

[0290] 2) Perform current block filter analysis (optional) .

[0291] TM cost-based filter selection may be performed. Prediction loss lossCB filter of the selected filter may be obtained.

[0292] 3) Obtain the comparison result of costs.

[0293] If step 2) is performed, the results in previous steps may be compared, that is, lossNB filter and lossCB filter are compared. If |lossCB filter-lossNB filter| is below a predefined threshold THmerge, reuse the neighboring block’s filter.

[0294] If step 2) is not performed, the loss lossNB filter is directly compared with a predefined threshold THmerge. If it is below the threshold, reuse the neighboring block’s filter.

[0295] 4) Merge signal flag derivation.

[0296] A merge flag flagmerge may be derived to indicate whether to reuse the neighboring signals. If flagmerge=TRUE, reuse neighboring block’s filter candidate index or list. If flagmerge=FALSE, use block’s filter candidate index or list.

[0297] 5) Merge signal encoding.

[0298] If flagmerge=TRUE , filter candidate index or list does not need to be encoded. If flagmerge=FALSE, encode block’s filter candidate index or list.

[0299] An example of providing such indication in coding unit (CU) is given in the following table:

[0300] The steps performed at the decoding side may include:

[0301] 1) Merge flag decoding

[0302] The merge flag flagmerge may be decoded from the bitstream.

[0303] If flagmerge=TRUE, filter candidate index or list does not need to be obtained from the bitstream. Optionally, the filter signal FlagNB may be retrieved from the neighboring block and decoded. Alternatively, the filter index settings may be retrieved from the decoded neighboring block.

[0304] If flagmerge=FALSE, obtain block’s filter candidate index or list.

[0305] 2) Final selection

[0306] The filter identified through either merging or the bitstream signal may be applied to perform interpolation for the current block.

[0307] The present disclosure addresses the challenges faced by existing filter selection methods by proposing a hybrid approach that combines TM and rule-based methods to optimize filter selection while managing complexity and hardware constraints. TM improves texture adaptability by selecting the best filter candidates based on block-specific characteristics, while conditional rules reduce complexity by limiting the number of candidate filters for TM evaluation. Additionally, the use of truncated filters allows for further reduction in computational complexity while retaining most of the performance benefits of higher-tap filters, enhancing the overall efficiency of the system.

[0308] The key elements proposed by the present disclosure may include:

[0309] 1) Hybrid Filter Selection Framework

[0310] Rather than treating rule-based selection and TM as separate stages, this method combines their strengths into a unified workflow. Rule-based criteria act as an initial filter, leveraging simple block characteristics to quickly narrow down the pool of potential filter candidates. The reduced candidate set is then evaluated with TM, which uses block-specific metrics (e.g., Sum of Absolute Differences (SAD) or Sum of Absolute Transformed Differences (SATD) ) to identify the best-performing filter. This streamlined process ensures that computational resources are focused only on relevant candidates, reducing complexity without sacrificing accuracy.

[0311] 2) Truncated Filter Application

[0312] Another novel aspect of this approach is the application of truncated filters. High-tap filters, such as 18-tap filters, are truncated into shorter versions (e.g., 6-tap filters) to lower computational demands while preserving most of the original filter’s interpolation performance. In the hybrid selection framework, truncated filters serve as efficient yet adaptive alternatives. They reduce the overhead of TM evaluation while maintaining high prediction accuracy, especially in cases where block texture or signal characteristics do not require full longer filter tap precision.

[0313] Benefits brought by embodiments of the present disclosure may include at least one of the follows:

[0314] 1) Reduced complexity and Trade-off

[0315] By applying an early determination stage with TM selectively, the number of filters evaluated with TM is reduced, and thus the computational overhead may be lowered without sacrificing significant prediction accuracy. Additionally, integrating rule-based selection as a preliminary stage ensures that computational resources are focused only on the most relevant candidates, striking a balance between complexity and performance.

[0316] 2) Improved texture and filter adaptability

[0317] TM enhances texture adaptability by enabling filter selection tailored to the unique characteristics of each block. This approach improves prediction quality for non-uniform and complex patterns. Simultaneously, combining TM with rule-based selection improves filter adaptiveness, allowing the system to efficiently handle both smooth regions and high-frequency textures, ensuring robust performance across diverse scenarios.

[0318] 3) Application of truncated filters

[0319] The introduction of truncated filters in the TM process further reduces computational complexity by decreasing the number of coefficients in higher-tap filters, such as truncating a longer M-tap filter into a shorter N-tap filter. This approach retains most of the original filter's performance while lowering the processing requirements. Within TM, truncated filters serve as efficient alternatives, maintaining the adaptability and quality of interpolation while streamlining computation.

[0320] FIG. 11 conceptually illustrates an apparatus 500 with which some embodiments of the invention are implemented. The apparatus 500 may be an encoding device or a decoding device. The apparatus 500 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 500 includes a processor 502 and a memory 504. The memory 504 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.

[0321] The processor 502 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 502.

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

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

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

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

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

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

[0328] 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 filter selection method, comprising:obtaining a first candidate filter;determining whether a current prediction angle for prediction of a current block satisfies an angle threshold, and whether a geometrical property of the current block satisfies a geometrical threshold; andwhen it is determined that the current prediction angle satisfies the angle threshold and the geometrical property of the current block satisfies the geometrical threshold, selecting the first candidate filter as a target filter for prediction of the current block.2.The method of claim 1, when it is determined that the current prediction angle does not satisfy the angle threshold or the geometrical property of the current block does not satisfy the geometrical threshold, further comprising:obtaining a plurality of second candidate filters;performing a template matching (TM) based selection to select the target filter from the plurality of second candidate filters.3.A filter selection method, comprising:obtaining a plurality of candidate filters;performing a template matching (TM) based selection to select an intermediate filter from the plurality of candidate filters;determining a truncated filter corresponding to the intermediate filter for prediction of a current block.4.The method of claim 3, wherein the determining the truncated filter corresponding to the intermediate filter comprises:acquiring a plurality of truncated filters corresponding to the intermediate filter;performing a TM-based selection to select the truncated filter with minimal TM cost from the plurality of truncated filters.5.The method of claim 3, wherein the determining the truncated filter corresponding to the intermediate filter comprises:acquiring a plurality of truncated filters corresponding to the intermediate filter;selecting the truncated filter from the plurality of truncated filters based on a size of the current block, a current prediction angle for prediction of the current block, or texture characteristics of the current block.6.A filter selection method, comprising:determining whether a boundary condition is met;when it is determined that the boundary condition is not met:acquiring a first candidate filter and a second candidate filter, wherein a tap-length of the first candidate filter is higher than a tap-length of the second candidate filter;selecting a target filter for prediction of a current block based on a size of the current block and / or a current prediction angle for prediction of the current block.7.The method of claim 6, when it is determined that the boundary condition is met, further comprising:obtaining a plurality of third candidate filters;performing a template matching (TM) based selection to select the target filter from the plurality of third candidate filters.8.The method of claim 6, wherein the determining whether the boundary condition is met comprises:determining whether a difference between the current prediction angle and a reference direction is lower than a range threshold;wherein when it is determined that the difference between the current prediction angle and the reference direction is lower than the range threshold, the boundary condition is met.9.The method of claim 8,wherein the range threshold is equal to a product of a scaling factor and a total range of angle indices.10.The method of claim 8,wherein the range threshold is derived based on a height and a width of the current block.11.The method of claim 6, wherein the determining whether the boundary condition is met comprises:determining whether a geometrical property of the current block meets a geometric threshold;wherein when it is determined that the geometrical property of the current block meets the geometric threshold, the boundary condition is met.12.A filter selection method in a decoding process, comprising:receiving an indication of a filter type;for a plurality of candidate filters belonging to the filter type, performing a template matching (TM) based selection to select a target filter for prediction of a current block from the plurality of candidate filters.13.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 12.14.A computer readable medium storing executable instructions that, when executed by a processor, cause the processor to perform the method of any of claims 1 to 12.