Encoding and decoding method, code stream, encoder, decoder and storage medium

CN121773608APending Publication Date: 2026-03-31GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Intra-coded prediction technology based on interpolation in the existing video encoding standards has the problem of low encoding and codec performance.

Method used

The candidate filter model is obtained by combining the reference area and the filter differently, the filter model type is expanded, and the candidate filter model is sorted to determine the target filter model for intra prediction.

Benefits of technology

Improved intra prediction accuracy and codec performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121773608A_ABST
    Figure CN121773608A_ABST
Patent Text Reader

Abstract

The invention discloses a coding and decoding method, a code stream, a coder, a decoder and a storage medium. The method comprises the following steps: determining a plurality of candidate filtering models of a current block; sorting the plurality of candidate filtering models, and determining a target filtering model candidate list of the current block; determining a target filtering model of the current block according to the target filtering model candidate list; determining a coefficient of a target filter according to the target reference area; and performing intra-frame prediction on the current block according to the coefficient of the target filter, and determining a predicted value of the current block. Therefore, the candidate filtering models are obtained by performing different combinations on the reference region and the filter, so that the types of the filtering models are expanded, then the candidate filtering models are sorted to obtain the filtering model candidate list, and the target filtering model is determined from the filtering model candidate list to perform intra-frame prediction, so that the intra-frame prediction accuracy can be improved, and the intra-frame prediction efficiency is improved. And coding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field

[0001] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] As demand for video display quality increases, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information and therefore requires more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.

[0003] Currently, video coding standards have proposed intra-frame prediction techniques based on interpolation. Specifically, this technique uses the reconstructed pixel values ​​around the current block to obtain interpolation filter coefficients, which are then used to perform intra-frame prediction on the current block. However, existing technical solutions still have some drawbacks, resulting in low codec performance.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. By performing different combinations of reference areas and filters to obtain candidate filter models, the filter model types are expanded, and the candidate filter models are then sorted to obtain a filter model candidate list. The target filter model is determined from the filter model candidate list for intra-frame prediction, which can improve the intra-frame prediction accuracy and coding and decoding performance.

[0006] The technical solution of the embodiment of the present application can be implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0008] Decode the code stream and determine the target prediction mode used by the current block;

[0009] Determining multiple candidate filter models for the current block;

[0010] Sorting the multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters;

[0011] Determine a target filtering model for the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter;

[0012] Determining coefficients of the target filter according to the target reference area;

[0013] Perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

[0014] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0015] Determining multiple candidate filter models for the current block;

[0016] Sorting the multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters;

[0017] Determine a target filtering model for the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter;

[0018] Determining coefficients of the target filter according to the target reference area;

[0019] Performing intra-frame prediction on the current block according to the coefficient of the target filter to determine a prediction value of the current block;

[0020] Make an encoding decision based on the predicted value and original value of the current block, determine whether the current block uses the target prediction mode, and encode the prediction mode indication information.

[0021] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: an index value of a target filtering model of a current block, a residual value of the current block, prediction mode indication information, and reordering indication information of the current block; wherein the prediction mode indication information is used to indicate whether the current block uses a target prediction mode, and the reordering indication information is used to indicate whether the current block uses template matching to reorder the filtering model candidate list.

[0022] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit, a first prediction unit, and an encoding unit, wherein: the first determining unit is configured to determine multiple candidate filtering models for a current block;

[0023] The first determining unit is configured to sort the multiple candidate filtering models to determine a target filtering model candidate list for the current block; wherein the candidate filtering models include candidate reference regions and candidate filters;

[0024] The first determining unit is configured to determine a target filtering model of the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter;

[0025] The first determining unit is configured to determine the coefficients of the target filter according to the target reference area;

[0026] The first prediction unit is configured to perform intra-frame prediction on the current block according to the coefficient of the target filter to determine a prediction value of the current block;

[0027] The encoding unit is configured to make an encoding decision based on the predicted value and the original value of the current block, determine whether the current block uses the target prediction mode, and encode prediction mode indication information.

[0028] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein,

[0029] a first memory for storing a computer program capable of running on the first processor;

[0030] The first processor is configured to execute the method according to the second aspect when running a computer program.

[0031] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a decoding unit, a second determining unit, and a second prediction unit, wherein: the decoding unit is configured to decode a bitstream and determine that a current block uses a target prediction mode;

[0032] The second determining unit is configured to determine a plurality of candidate filtering models for the current block;

[0033] The second determining unit is configured to sort the multiple candidate filtering models to determine a target filtering model candidate list for the current block; wherein the candidate filtering models include candidate reference regions and candidate filters;

[0034] The second determining unit is configured to determine a target filtering model of the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter;

[0035] The second determining unit is configured to determine the coefficients of the target filter according to the target reference area;

[0036] The second prediction unit is configured to perform intra-frame prediction on the current block according to the coefficient of the target filter to determine a prediction value of the current block.

[0037] In a seventh aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein,

[0038] a second memory for storing a computer program capable of running on the second processor;

[0039] The second processor is configured to execute the method according to the first aspect when running a computer program.

[0040] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the method described in the first aspect or the method described in the second aspect.

[0041] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. By performing different combinations of reference areas and filters to obtain candidate filter models, the filter model types are expanded, and the candidate filter models are then sorted to obtain a filter model candidate list. The target filter model is determined from the filter model candidate list for intra-frame prediction, which can improve the intra-frame prediction accuracy and coding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] FIG1A is a schematic diagram of a method for calculating the average value m;

[0043] FIG1B is a second schematic diagram of a method for calculating the average value m;

[0044] FIG1C is a third schematic diagram of a method for calculating the average value m;

[0045] FIG2A is a schematic diagram showing a positional relationship between a current block and a reconstruction area;

[0046] FIG2B is a second schematic diagram of the positional relationship between the current block and the reconstruction area;

[0047] FIG2C is a third schematic diagram of the positional relationship between the current block and the reconstruction area;

[0048] FIG3A is a schematic diagram of a shape of an interpolation filter;

[0049] FIG3B is a second schematic diagram of the shape of an interpolation filter;

[0050] FIG3C is a third schematic diagram of the shape of an interpolation filter;

[0051] FIG4A is a first schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0052] FIG4B is a second schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0053] FIG4C is a third schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0054] FIG5A is a fourth schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0055] FIG5B is a fifth schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0056] FIG5C is a sixth schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0057] FIG6A is a seventh schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0058] FIG6B is a schematic diagram eight of a reference area of ​​a current block provided by an embodiment of the present application;

[0059] FIG6C is a ninth schematic diagram of a reference area of ​​a current block provided by an embodiment of the present application;

[0060] FIG7 is a schematic diagram of a prediction direction based on interpolation filtering;

[0061] FIG8 is a schematic diagram of an angle mode for intra-frame prediction;

[0062] FIG9 is a schematic diagram of a 3×3 window sliding in a prediction block;

[0063] FIG10 is a schematic diagram of the accumulated gradient amplitude values ​​at different angles;

[0064] FIG11A is a schematic block diagram of an encoder provided in an embodiment of the present application;

[0065] FIG11B is a schematic block diagram of a decoder according to an embodiment of the present application;

[0066] FIG12 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;

[0067] FIG13 is a schematic diagram of a flowchart of a decoding method provided in an embodiment of the present application;

[0068] FIG14 is a schematic diagram of seven reference areas of a current block provided by an embodiment of the present application;

[0069] FIG15 is a schematic diagram of three reference areas of a current block provided by an embodiment of the present application;

[0070] FIG16 is a schematic diagram of four reference areas of a current block provided by an embodiment of the present application;

[0071] FIG17 is a schematic diagram 1 of candidate filters with different numbers of taps provided by an embodiment of the present application;

[0072] FIG18 is a schematic diagram of a template area of ​​a current block provided in an embodiment of the present application;

[0073] FIG19A is a first schematic diagram of template region prediction provided by an embodiment of the present application;

[0074] FIG19B is a second schematic diagram of template region prediction provided by an embodiment of the present application;

[0075] FIG19C is a third schematic diagram of template region prediction provided by an embodiment of the present application;

[0076] FIG19D is a fourth schematic diagram of template region prediction provided by an embodiment of the present application;

[0077] FIG19E is a fifth schematic diagram of template region prediction provided by an embodiment of the present application;

[0078] FIG20 is a second schematic diagram of candidate filters with different numbers of taps provided in an embodiment of the present application;

[0079] FIG21 is a schematic diagram of the prediction directions of different filters in FIG20;

[0080] FIG22 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;

[0081] FIG23A is a first schematic diagram showing the distribution of linear and nonlinear terms of an interpolation filter provided by an embodiment of the present application;

[0082] FIG23B is a second schematic diagram of the distribution of linear terms and nonlinear terms of an interpolation filter provided in an embodiment of the present application;

[0083] FIG23C is a third schematic diagram of the distribution of linear terms and nonlinear terms of an interpolation filter provided in an embodiment of the present application;

[0084] FIG24A is a first schematic diagram showing the distribution of linear and nonlinear terms of another interpolation filter provided in an embodiment of the present application;

[0085] FIG24B is a second schematic diagram showing the distribution of linear and nonlinear terms of another interpolation filter provided in an embodiment of the present application;

[0086] FIG24C is a third schematic diagram showing the distribution of linear and nonlinear terms of another interpolation filter provided in an embodiment of the present application;

[0087] FIG25A is a first schematic diagram showing the distribution of linear and nonlinear terms of another interpolation filter provided in an embodiment of the present application;

[0088] FIG25B is a second schematic diagram showing the distribution of linear and nonlinear terms of another interpolation filter provided in an embodiment of the present application;

[0089] FIG25C is a third schematic diagram showing the distribution of linear and nonlinear terms of another interpolation filter provided in an embodiment of the present application;

[0090] FIG26A is a first schematic diagram of a reference area of ​​a narrow and long current block provided by an embodiment of the present application;

[0091] FIG26B is a second schematic diagram of a reference area of ​​a narrow and long current block provided by an embodiment of the present application;

[0092] FIG27 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0093] FIG28 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;

[0094] FIG29 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0095] FIG30 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;

[0096] FIG31 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0097] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0098] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0099] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0100] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0101] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0102] Joint Video Exploration Team (JVET);

[0103] H.266 / Versatile Video Coding (VVC);

[0104] VVC Test Model (VTM), a reference software testing platform for VVC;

[0105] Enhanced Compression Mode (ECM);

[0106] Extrapolation Intra Prediction (EIP)

[0107] Multiple Transform Selection (MTS);

[0108] Discrete Cosine Transform (DCT);

[0109] Discrete Sine Transform (DST);

[0110] Non-Separable Primary Transform (NSPT);

[0111] Low Frequency Non-separable Secondary Transform (LFNST);

[0112] Direct Current (DC) mode;

[0113] Planar mode (PLANAR);

[0114] Direct Mode (DM);

[0115] Intra Block Copy (IBC);

[0116] Wide Angle Intra Prediction (WAIP);

[0117] Sum of Squares for Error (SSE);

[0118] Mean Squared Error (MSE);

[0119] Sum of Absolute Difference (SAD).

[0120] It can be understood that the intra-frame prediction technology based on interpolation refers to a technology that obtains interpolation filter coefficients from the reconstructed pixel values ​​around the current block and is used to perform intra-frame prediction on the current block. Specifically, the intra-frame prediction technology based on interpolation filtering may include one or more of the following features:

[0121] (a) The number of taps of the interpolation filter should be greater than or equal to 2. The interpolation filter can have various shapes. The shape of the selected interpolation filter is controlled using syntax elements.

[0122] (b) The reconstructed pixels used to obtain the interpolation filter coefficients should be within one or several regions around the current block, and the region used to obtain the interpolation filter coefficients is selected using syntax elements.

[0123] (c) Interpolation filter prediction can be used for intra block prediction of luma or chroma.

[0124] (d) When using interpolation filtering to predict the current block, prediction should be performed in a certain order starting from the upper left corner to the lower right corner of the block.

[0125] (e) The input of the interpolation filter is the reconstructed pixel value and / or the predicted pixel value, or the reconstructed value and the predicted value with a certain value subtracted.

[0126] (f) Corresponding to (e), if a certain value is subtracted from the input of the interpolation filter, then the interpolation result should add this value back.

[0127] (g) The maximum and minimum values ​​can be obtained from the reconstructed pixel values ​​around the current block to limit the output range of the interpolation filter.

[0128] Furthermore, the specific intra-frame prediction technology based on interpolation filtering can be described in detail through the following aspects.

[0129] (1) Obtain the mean, minimum, and maximum values.

[0130] In a possible embodiment, the maximum and minimum values ​​of the reconstructed pixels are found in a reconstruction area of ​​13 rows and 13 columns around the current block. The maximum and minimum values ​​here can be used to limit the range of the prediction result.

[0131] In a possible embodiment, the value m to be subtracted from the input and added to the output of the interpolation filter is obtained according to the following method, where m is a value used in DC mode prediction and is a positive integer.

[0132] For example, taking FIG. 1A , FIG. 1B , and FIG. 1C as examples, the calculation method for obtaining the value m can be divided into three cases:

[0133] (i) When the width of the current block is equal to its height, m ​​is equal to the average of the reconstructed pixels in the row above and the column to the left of the current block, as shown in FIG1A ;

[0134] (ii) When the width of the current block is greater than its height, m ​​is equal to the average value of the reconstructed pixels in a row above the current block, as shown in FIG1B ;

[0135] (iii) When the height of the current block is greater than its width, m is equal to the average value of the reconstructed pixels in a column on the left side of the current block, as shown in FIG1C .

[0136] In the implementation, the calculation method here can also be summarized as shown in Table 1.

[0137] Table 1

[0138] (2) Obtaining interpolation filter coefficients.

[0139] In a possible embodiment, three 15-tap interpolation filters and three reconstruction areas are defined.

[0140] Figure 2A shows a schematic diagram of the positional relationship between a current block and a reconstruction region. As shown in Figure 2A, the reconstruction region may include an upper adjacent region adjacent to the upper side of the current block and a left adjacent region adjacent to the left side of the current block; wherein the length of the upper adjacent region is 2×Width+13 and the width is 13; and the length of the left adjacent region is 2×Height+13 and the width is 13. Figure 2B shows another schematic diagram of the positional relationship between a current block and a reconstruction region. As shown in Figure 2B, the reconstruction region may include an upper adjacent region adjacent to the upper side of the current block; wherein the length of the upper adjacent region is 2×Width+13 and the width is 13. Figure 2C shows yet another schematic diagram of the positional relationship between a current block and a reconstruction region. As shown in Figure 2C, the reconstruction region may include a left adjacent region adjacent to the left side of the current block; wherein the length of the left adjacent region is 2×Height+13 and the width is 13. In Figures 2A, 2B, and 2C, Height and Width represent the current height and width, respectively. It should be noted that, for the reconstructed areas in FIG. 2A , FIG. 2B and FIG. 2C , that is, the reconstructed pixels in 13 rows and / or 13 columns around the current block can be used to obtain interpolation filter coefficients.

[0141] Figure 3A shows a schematic diagram of the shape of an interpolation filter. As shown in Figure 3A, the interpolation filter is in the shape of a 4×4 square. Figure 3B shows a schematic diagram of the shape of another interpolation filter. As shown in Figure 3B, the interpolation filter is in the shape of a 2×8 rectangle. Figure 3C shows a schematic diagram of the shape of yet another interpolation filter. As shown in Figure 3C, the interpolation filter is in the shape of an 8×2 rectangle. In Figures 3A, 3B, and 3C, the grid-filled portions represent the input positions of the interpolation filters, and the black-filled portions represent the output positions of the interpolation filters.

[0142] In this way, 3×3 different filtering modes can be derived by combining the three reconstruction areas with the three interpolation filter shapes in different ways (each filter shape combined with each reconstruction area can derive a filtering mode). The encoder decides a combination of filter shape and reconstruction area based on the rate-distortion cost. In this way, when predicting the current block, the encoder and decoder first determine the coefficients of the interpolation filter based on the determined filter shape and reconstruction area.

[0143] In a possible embodiment, the input of the interpolation filter is the reconstructed pixel value, and when obtaining the parameters, the selected interpolation filter is slid on the selected area, with the horizontal and vertical sliding steps being 1 pixel distance.

[0144] 4A , 4B , and 4C , which illustrate a schematic diagram of a structure in which a 4×4 filter slides in three reconstruction areas, namely, an L-shaped reconstruction area, an upper reconstruction area, and a left reconstruction area, to obtain inputs and outputs at possible positions of the interpolation filter.

[0145] 5A , 5B , and 5C , which illustrate a schematic diagram of an 8×2 filter sliding in three reconstruction areas, namely, an L-shaped reconstruction area, an upper reconstruction area, and a left reconstruction area, to obtain inputs and outputs at possible positions of the interpolation filter.

[0146] 6A , 6B , and 6C , which illustrate a schematic diagram of a structure in which a 2×8 filter slides in three reconstruction areas, namely, an L-shaped reconstruction area, an upper reconstruction area, and a left reconstruction area, to obtain inputs and outputs at possible positions of the interpolation filter.

[0147] Nine possible combinations are available, each yielding a set of interpolation filter coefficients. Solving each set of interpolation filter coefficients involves sliding the selected interpolation filter over the selected area, constructing a set of autocorrelation coefficient matrices and a set of cross-correlation coefficient vectors. These are then used to construct a linear system of equations, which are then solved to yield the interpolation filter coefficients.

[0148] In this case, for the constructed Wienerhof equation, specifically the autocorrelation coefficient matrix and the cross-correlation coefficient vector are constructed, the linear equation system is as follows:

[0149] in, represents the selected reconstruction area, t represents the reconstructed pixel value, r represents the coordinate position in the reconstruction area, p0…p N-1 Represents the coordinate relationship relative to position r, and the relative coordinates they refer to are the relative coordinate relationship between the input position and output position of the interpolation filter. c0…c N-1 is the coefficient of the interpolation filter to be solved (also called "filter coefficient"), and m is a value subtracted from the input of the interpolation filter (a value to be added to the output in this case).

[0150] The encoding complexity of current ECM reference software has increased by 6-8 times compared to VTM (VVC reference software), making encoding prohibitively expensive and difficult to implement. During the encoding phase, interpolation filtering requires rate-distortion filtering of nine coefficient sets derived from nine combinations of filter shapes and reconstruction region types to determine whether to use interpolation filtering and which coefficients to use. The computational complexity of obtaining these nine coefficient sets is high, resulting in an increase of over 3% in encoding time complexity.

[0151] (3) Predict the current block.

[0152] In one possible embodiment, the prediction process starts from the upper left corner of the current block and proceeds to the lower left corner in a certain order. The prediction formula is as follows:

[0153] Among them, pred r is the prediction result of position r in the current block, represents the input of the interpolation filter, When it is located in the reconstruction area, the reconstructed value is used as the input of the interpolation filter. When it is located in the current block, the already obtained predicted value is used as the input of the interpolation filter.

[0154] For example, as shown in Figure 7, the interpolation filter is predicted along the diagonal direction, where the grid-filled area represents the input position of the interpolation filter, and the black-filled area represents the output position of the interpolation filter. In addition, from an implementation perspective, the predicted points on the same diagonal line can be predicted in parallel.

[0155] (4) Classification of prediction blocks and selection of transform kernels.

[0156] After predicting the current block, a prediction block of the current block can be obtained, which includes a predicted value of at least one pixel in the current block. For the prediction block, different angle modes are suitable for using different transforms, including primary transform MTS, NSPT and secondary transform LFNST.

[0157] MTS includes some traditional transforms, such as DCT and DST. NSPT and LFNST are a series of transform coefficients obtained from a universal training set based on the optimal transform. The difference between NSPT and LFNST is that NSPT is used directly to transform the residual coefficients, while LFNST further transforms the transform coefficients after the DCT2 transform.

[0158] For traditional prediction modes (PLANAR mode, DC mode, and angle mode), non-separable primary transform (NSPT) or non-separable secondary transform (LFNST), different traditional prediction modes can be transformed corresponding to different groups of transform kernels according to a mapping such as a table lookup.

[0159] In the reference software ECM, as shown in FIG8 , conventional intra prediction modes may include:

[0160] (i) PLANAR mode: intra prediction mode index is 0;

[0161] (ii) DC mode: intra prediction mode index is 1;

[0162] (iii) Angular mode: Intra prediction mode index ranges from 2 to 66.

[0163] It should also be noted that, as shown in Figure 8, the intra-frame prediction mode can include angle modes of 2 to 66, as well as wide angle modes of -1 to 14 and 67 to 80. The arrows in Figure 8 point to the directions predicted by the angle modes existing in VVC, and the intra-frame prediction mode indexes used during encoding and decoding are 2 to 66. When the current block is a non-square block, some angle directions will be replaced by wide angle modes (such as -1 to -14 and 67 to 80 in Figure 8).

[0164] In the reference software ECM, NSPT and LFNST divide the transformation kernels of the traditional prediction mode into 35 groups, each with 3 selectable transformation kernels. Table 2 shows the correspondence between the traditional prediction modes and the transformation kernel groups.

[0165] Table 2

[0166] In one possible embodiment, a method is proposed herein for matching a prediction block based on interpolation filtering to a traditional prediction mode. Then, the prediction block based on interpolation filtering is matched to different transform kernels of a preset primary transform (separable or non-separable) or secondary transform (separable or non-separable) through the matched traditional prediction mode. Specifically, the prediction block based on interpolation filtering is matched to a PLANAR mode or a mode of angle directions 2 to 66 through the prediction value in the prediction block. Specifically, the following steps may be included:

[0167] The first step is to use a sliding 3×3 window to calculate the horizontal and vertical gradient values ​​G of each 3×3 window in the prediction block based on interpolation filtering. x and G y Among them, G x and G y They are respectively composed of 3×3 horizontal gradient operators M x and the vertical gradient operator M y It is obtained by multiplying the predicted value within the window position.

[0168] Figure 9 is a schematic diagram of a 3×3 window sliding in the prediction block, which can slide in the horizontal and vertical directions. Assuming that the prediction block based on interpolation filtering is a block with a width and height of (w,h), the sliding 3×3 window can calculate the G of the (w-2)×(h-2) positions at the center of the prediction block. x and G y .

[0169] The second step is to calculate the G at each position. x and G y The traditional angle direction O corresponding to each position is calculated according to the following formula, and the gradient amplitude value G corresponding to the angle of each position is calculated, as shown below: G=|G x |+|G y | (5)

[0170] In some embodiments, the calculation process of atan() can be simplified and completed by table lookup or some transformation.

[0171] In the third step, the gradient magnitude G at each position is accumulated over the derived traditional angle modes, resulting in a gradient magnitude histogram as shown in Figure 10. Finally, the traditional angle mode with the largest cumulative gradient magnitude is selected from the histogram as the prediction mode for the current block. Specifically, when the gradient magnitudes derived from all traditional angle modes are zero, the current block is matched to the traditional PLANAR mode as the corresponding prediction mode.

[0172] It should also be noted that, in the embodiment of the present application, the traditional prediction mode derived from the interpolation filter prediction will be used for the selection of the transformation kernel group of NSPT and LFNST.

[0173] However, after the interpolation filter intra-frame prediction technology was proposed at the JVET conference, feedback has shown that the cost-effectiveness of codec performance and encoder complexity needs to be improved. Using the latest ECM-8.0 reference software, the encoding time complexity of the related technical solution described here is 108% to 109%.

[0174] Based on this, an embodiment of the present application proposes an encoding method to determine the target filtering mode of the current block; determine the reference area of ​​the current block based on the size parameters and the target filtering mode of the current block; determine the filtering coefficient of the current block based on the reference area of ​​the current block; perform intra-frame prediction on the current block based on the filtering coefficient to determine the prediction value of the current block.

[0175] An embodiment of the present application proposes a decoding method, which decodes a code stream and determines a target filtering mode for a current block; determines a reference area for the current block based on a size parameter of the current block and the target filtering mode; determines a filtering coefficient for the current block based on the reference area of ​​the current block; and performs intra-frame prediction on the current block based on the filtering coefficient to determine a predicted value for the current block.

[0176] In this way, by making different combinations of reference areas and filters to obtain candidate filter models, thereby expanding the filter model types, and then sorting the candidate filter models to obtain a filter model candidate list, the best filter model can be determined for intra-frame prediction, thereby improving the intra-frame prediction accuracy and encoding and decoding performance.

[0177] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0178] Referring to Figure 11A, it shows a schematic block diagram of the composition of an encoder provided in an embodiment of the present application. As shown in Figure 11A, the encoder (specifically, a "video encoder") 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109 and a decoded image cache unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding on the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is the process of generating a motion vector, which can estimate the motion of the video coding block. The motion compensation unit 104 then calculates the motion vector based on the motion vector determined by the motion estimation unit 105. After determining the intra-frame prediction mode, the intra-frame prediction unit 103 is further configured to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is subjected to the filter control analysis unit 107 and the filtering unit 108 to remove the block effect artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode, and output the code stream of the video signal. The decoded image buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .

[0179] Referring to FIG11B , which shows a block diagram of a decoder provided in an embodiment of the present application, as shown in FIG11B , the decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is coded as shown in FIG11A , a code stream of the video signal is outputted. The code stream is inputted into the decoder 200 and first passes through the decoding unit 201 to obtain decoded transform coefficients. The transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain. The intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from the previously decoded block of the current frame or picture. The motion compensation unit 204 determines prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate the residual block. The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0180] Furthermore, the embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein Figure 12 shows a schematic diagram of a network architecture of a coding and decoding system provided by an embodiment of the present application. As shown in Figure 12, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., and the embodiment of the present application is not specifically limited. Here, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0181] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 11A and the intra-frame prediction unit 203 shown in Figure 11B. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.

[0182] It should also be noted that, when applied to the intra-frame prediction unit 103, the "current block" specifically refers to the coding block currently to be intra-frame predicted; when applied to the intra-frame prediction unit 203, the "current block" specifically refers to the decoding block currently to be intra-frame predicted. In the embodiment of the present application, the current block includes at least a first color component and a second color component. For the first color component of the current block, the block at this time can be simply referred to as the first color component block; and when the first color component is a luminance component, the first color component block can also be referred to as a luminance block. Similarly, for the second color component of the current block, the block at this time can be simply referred to as the second color component block; and when the second color component is a chrominance component, the second color component block can also be referred to as a chrominance block.

[0183] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be combined arbitrarily with the technical solutions of the embodiments of the present application as optional solutions, and all of them fall within the scope of protection of the embodiments of the present application. The embodiments of the present application include at least part of the following contents.

[0184] In one embodiment of the present application, referring to FIG13 , a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG13 , the method may include:

[0185] S1301: Decode the code stream and determine the target prediction mode used by the current block;

[0186] It should be noted that the target prediction mode of the embodiment of the present application is an intra-frame prediction mode, specifically a prediction mode for intra-frame prediction based on a target filter model. The target filter model of the embodiment of the present application is determined by sorting the candidate filter models. In some embodiments, the target prediction mode may refer to an improvement based on an interpolation filter prediction mode. More specifically, it may be an intra-frame prediction mode based on a cross-component convolutional intra-frame prediction model (Convolutional Cross-Component intra prediction Model, CCCM), or an intra-frame prediction mode based on a gradient linear model (Generalized Linear Models, GLM), etc.

[0187] In some embodiments, the method may include: decoding a code stream, and determining prediction mode indication information of a current block; the indication information is used to indicate whether the current block uses a target prediction mode.

[0188] The prediction mode indication information may include block-level syntax elements for indicating whether the current block uses the target prediction mode. When it is determined that the current block selects the target prediction mode, the decoding method of any one of the embodiments of the present application is executed, otherwise it is not executed.

[0189] S1302: Determine multiple candidate filter models for the current block;

[0190] It should be noted that if it is determined that the current block uses the target prediction mode, multiple candidate filtering models for the current block are further determined, where the candidate filtering model includes a candidate reference region and a candidate filter, and specifically may refer to a filtering model that uses the candidate reference region and the candidate filter to perform intra-frame prediction on the current block. The multiple candidate filtering models may specifically include two or more candidate filtering models.

[0191] In some embodiments, determining multiple candidate filtering models for the current block includes: determining at least one candidate reference area for the current block, and determining at least one candidate filter for the current block; and determining multiple candidate filtering models for the current block based on the at least one candidate reference area and the at least one candidate filter.

[0192] In some embodiments, if one filter and B reconstruction regions are used, a maximum of 1xB = B filter models can be obtained for each block to be predicted. By simplifying the types of filters and expanding the types of reconstruction regions used to calculate filter coefficients, prediction accuracy can be improved.

[0193] In some other implementation schemes, a maximum of AxB filter models can be obtained using A filters and B reconstruction areas. On the basis of expanding the types of reconstruction areas used to calculate filter coefficients, appropriately increasing the types of filters can further improve the prediction accuracy.

[0194] In some embodiments, determining at least one candidate reference area for the current block includes: determining at least one candidate reference area by combining at least one sub-reference area reconstructed from the current block; wherein the at least one sub-reference area includes at least one of the following: an upper adjacent area, a left adjacent area, and an upper-left adjacent area of ​​the current block.

[0195] As shown in Figure 14, the current block (also called the "block to be predicted") can combine the three reconstructed sub-reference regions (including the upper reconstructed region, the left reconstructed region, and the upper-left reconstructed region) to obtain a maximum of seven reference regions. When using seven combinations, 1×7 filter models can be obtained for a given filter, and the reconstructed regions under different combinations can each obtain filter coefficients under a given filter shape. In some embodiments, a given filter can be a 4×4 filter.

[0196] In some embodiments, at least one candidate reference region is determined by combining at least one reconstructed sub-reference region of the current block, including: determining a second candidate reference region based on the reconstructed upper and upper-left adjacent regions of the current block; determining a third candidate reference region based on the reconstructed left and upper-left adjacent regions of the current block; and determining a fourth candidate reference region based on the reconstructed upper, left, and upper-left adjacent regions of the current block. As shown in FIG15 , three filter models can be obtained using three types of reconstructed regions.

[0197] In some embodiments, at least one candidate reference region is determined by combining at least one reconstructed sub-reference region of the current block, including: determining a first candidate reference region based on the reconstructed upper and left adjacent regions of the current block; determining a second candidate reference region based on the reconstructed upper and upper-left adjacent regions of the current block; determining a third candidate reference region based on the reconstructed left and upper-left adjacent regions of the current block; and determining a fourth candidate reference region based on the reconstructed upper, left, and upper-left adjacent regions of the current block. As shown in FIG16 , four filter models can be obtained using four types of reconstructed regions.

[0198] In some embodiments, determining at least one candidate filter for the current block includes: determining at least one candidate filter according to at least one candidate filter shape and a specific number of taps.

[0199] Figure 17 shows three filter shapes and candidate filter examples with different tap numbers. The grid-filled boxes are the filter inputs, and the blank-filled boxes are the filter outputs.

[0200] In some embodiments, the method further comprises: determining a size parameter of the candidate reference region based on a size parameter of the current block and a size parameter of the candidate filter; wherein the size parameter includes height and / or width. Exemplarily, determining a minimum parameter from the height and width of the current block; determining a height of the candidate reference region based on the minimum parameter and the height of the candidate filter; and determining a width of the candidate reference region based on the minimum parameter and the width of the candidate filter. More specifically:

[0201] The width of the left reference area and the upper left reference area is min(blockWidth,blockHeight)+filterWidth-1

[0202] The height of the upper reference area and the upper left reference area is min(blockWidth,blockHeight)+filterHeight-1

[0203] The filterWidth-1 and filterHeight-1 of each tap filter are shown in Table 3.

[0204] Table 3

[0205] In an embodiment of the present application, the size of the reference area of ​​the current block is associated with the shape and minimum parameters of the filter. Simply put, if the size of the current block is large, a large reference area can be used; if the size of the current block is small, a small reference area can be used. The number of rows and columns of the reference area can be derived based on the size of the current block. For example, as shown in Figures 4A, 5A, and 6A, the L-shaped reconstruction area on the upper left side of the current block is the reference area, and the width and height of the reference area depend on the size of the filter used in the current block and the size of the variable N. The size of the variable N is equal to the smaller of the width and height of the current block. For example, for a 2×8 current block, the value of the variable N is 2; for a 4×4 current block, the value of the variable N is 4.

[0206] S1303: Sort multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters;

[0207] In some embodiments, the candidate reference regions in the candidate filter models can be sorted based on the number of samples, and the samples are added to the candidate list in order according to the number of samples, with samples with a large number of samples added first and samples with a small number of samples added later. It should be noted that since the input and output of the candidate filter when determining the filter coefficient based on the candidate reference region are both reference samples within the candidate reference region, the number of samples can be the number of samples within the candidate reference region that serve as the output of the candidate filter. Generally, the more samples there are, the higher the prediction accuracy. Therefore, sorting based on the number of samples can be understood as a way of sorting the prediction accuracy of the candidate filter models.

[0208] Exemplarily, sorting multiple candidate filter models to determine a target filter model candidate list for the current block includes: determining a first candidate reference region and a first candidate filter for a first candidate filter model among the multiple candidate filter models; using reference samples within the first candidate reference region as input samples for the first candidate filter, and determining the number of samples within the first candidate reference region that serve as output samples for the first candidate filter; sorting the first candidate filter models based on the number of samples within the first candidate reference region to obtain a first filter model candidate list; and obtaining a target filter model candidate list based on the first filter model candidate list. As shown in FIG4A , when a 4×4 filter slides within an L-shaped reconstruction region and counts reference samples within the L-shaped reconstruction region as input samples for the filter, the number of output samples within the L-shaped reconstruction region, i.e., the number of samples within the dotted region within the L-shaped reconstruction region near the current block, is the number of samples within the dotted region within the L-shaped reconstruction region. The grid-filled portion represents the input sample position of the filter, and the blank-filled portion represents the output sample position of the filter.

[0209] In some embodiments, multiple candidate filtering models are sorted to determine a candidate list of target filtering models for the current block, which also includes: determining the coefficients of the first candidate filter based on the first candidate reference area; in the process of sorting the first candidate filtering models according to the number of samples in the first candidate reference area, deleting the first candidate filtering models with repeated coefficients of the first candidate filter to obtain a first filtering model candidate list.

[0210] It should be noted that when constructing the candidate list of filter models, since different models may have the same filter coefficients, the models should be checked for duplicates and redundant models should be removed to improve intra-frame prediction efficiency. If A filters and B reconstruction areas are used, a maximum of AxB filter models can be obtained. Considering the possibility of models with duplicate filter coefficients, in some cases, the number of filter models after deduplication should be less than or equal to AxB.

[0211] In some embodiments, the first filter model candidate list is directly used as the target filter model candidate list. In other embodiments, a target filter model candidate list is obtained based on the first filter model candidate list, including: reordering the first filter model candidate list based on template matching to obtain a target filter model candidate list. That is, using the candidate filter model to make a prediction in the current block template; comparing the degree of matching between the predicted value and the reconstructed value of the current block template, and reordering the candidate filter models; and determining the target filter model based on the reordering result. Reordering the candidate filter models and determining the target filter model based on the reordering result can improve the prediction accuracy. Furthermore, if the index value of the target filter model is encoded, the encoded binary symbols can be reduced.

[0212] Exemplarily, the first filter model candidate list is reordered based on template matching to obtain a target filter model candidate list, including: determining the second candidate reference area and the second candidate filter of the second candidate filter model in the first filter model candidate list; determining the coefficient of the second candidate filter based on the second candidate reference area; predicting the current block template based on the coefficient of the second candidate filter to obtain the predicted value of the current block template; performing cost calculation based on the predicted value and the reconstructed value of the current block template to obtain a first cost parameter; reordering the first filter model candidate list based on the first cost parameter to obtain a target filter model candidate list. In an embodiment of the present application, the cost function used for cost calculation can be the sum of absolute error SAD, the sum of absolute transform difference SATD, the mean square error MSE, the sum of squared errors SSD, the mean absolute difference MAD, the mean sum of squared errors MSD, the absolute value DCT of the transform coefficient, the normalized correlation coefficient NCC, etc., which are not specifically limited here.

[0213] It should be noted that the template can be composed of reconstructed pixels from one or more areas of the top, top right, left, bottom left, and top left of the current block. In addition, a template area of ​​N rows and M columns can be used, where N and M are positive integers related to the shape and size of the current block, and can also be pre-set.

[0214] It should also be noted that the portion of the reconstructed pixels to be retrieved can be determined by the value of the template type parameter (refTemplateType). For example, when the value of refTemplateType is 1, the reconstructed pixels on the left, upper left, and upper sides of the current block are retrieved; or, when the value of refTemplateType is 2, only the reconstructed pixels on the left four columns of the current block are retrieved; or, when the value of refTemplateType is 3, only the reconstructed pixels on the upper four rows of the current block are retrieved.

[0215] Use the models in the candidate list one by one to make predictions on the template area of ​​the current block. The prediction can be made in a predefined direction, such as a diagonal direction, a horizontal direction, a vertical direction, etc. For example, as shown in FIG18 , the template area of ​​the current block includes an upper template area and a left template area, and the width and height of the template area are both greater than 1 pixel. As shown in FIG19A , a 4×4 candidate filter is used to make predictions on the upper template area and the left template area respectively in the diagonal direction. As shown in FIG19B , an 8×2 candidate filter is used to make predictions on the upper template area and the left template area respectively in the diagonal direction. As shown in FIG19C , a 2×8 candidate filter is used to make predictions on the upper template area and the left template area respectively in the diagonal direction.

[0216] Exemplarily, the template region of the current block includes an upper template region, a left template region, and an upper-left template region, and the width and height of the template region are both equal to 1 pixel. As shown in FIG19D , when prediction is performed in the upper template region, the filter moves horizontally, and as shown in FIG19E , when prediction is performed in the left template region, the filter moves vertically.

[0217] In some embodiments, the calculation method for generating a prediction value on a template may specifically include: determining the prediction value of the first template sample in the current block template based on the coefficient of the second candidate filter and the reconstructed value of the reference sample in the second candidate reference area; determining the prediction value of the second template sample in the current block template based on the coefficient of the second candidate filter, the reconstructed value of the reference sample in the second candidate reference area and the predicted value of the predicted template sample; wherein the predicted template sample includes the first template sample and / or the second template sample.

[0218] It should be noted that the template prediction method can be the same as the prediction method of the current block, that is, when predicting the non-upper left corner position of the left and upper templates, the input of some filters uses the predicted value on the template. The advantage of this is that the true predicted value of the model can be better made in the template area. The disadvantage is that, like the prediction of the block to be predicted, since some predicted values ​​need to be used as the input of the filter, there will be dependencies between pixels. For example, if the prediction is made in diagonal order, the prediction of the pixel value on the current diagonal line of the template needs to use the predicted value of the previous diagonal line, that is, there is a diagonal dependency.

[0219] In other embodiments, the calculation method for generating the prediction value on the template may specifically include: obtaining the prediction value of the current block template according to the coefficients of the second candidate filter and the reconstructed values ​​of the reference samples in the second candidate reference area.

[0220] It should be noted that since the template area has been reconstructed, all reconstructed pixel values ​​can be used as filter input. This may result in low template matching accuracy in some cases due to the difference in prediction method from the block to be predicted. The advantage of this is that it is well parallelized and all positions on the template can be calculated in parallel, resulting in high computational efficiency.

[0221] In some embodiments, the method further includes: decoding the code stream and determining reordering indication information; when determining that the current block uses template matching to reorder the filter model candidate list according to the reordering indication information, reordering the first filter model candidate list based on template matching to obtain a target filter model candidate list; when determining that the current block does not use template matching technology to reorder the filter model candidate list according to the reordering indication information, using the first filter model candidate list as the target filter model candidate list.

[0222] Exemplarily, the reordering indication information includes a first syntax element and a second syntax element; wherein the first syntax element is used to indicate whether the current block is allowed to use the template matching technology; the second syntax element is used to indicate whether the current block uses template matching to reorder the filter model candidate list;

[0223] Decoding the code stream and determining the reordering indication information may include: decoding the code stream and determining a value of a first syntax element; when the value of the first syntax element is a first numerical value, decoding the code stream and determining a value of a second syntax element; when the value of the second syntax element is the first numerical value, determining that the current block uses template matching to reorder the filtering model candidate list; when the value of the first syntax element is the second numerical value, or the value of the second syntax element is the second numerical value, determining that the current block does not use template matching technology to reorder the filtering model candidate list.

[0224] It should be noted that the template matching-based technology is controlled by a unified first syntax element to determine whether it is turned on. This flag can be at the sequence level, image level, slice level, coding tree unit level, etc. This flag controls whether some or all template matching-based technologies, including the template matching-based reordering filter model candidate list in the embodiment of the present application, are allowed to be turned on. When the unified flag is turned on, further decoding of the flag of each template matching technology will be allowed, and the template matching-based reordering filter model candidate list here can also be controlled by this unified flag switch. Template matching-based reordering filter model candidate list can be controlled by a second syntax element to determine whether it is turned on. This flag can be at the sequence level, image level, slice level, coding tree unit level, etc.

[0225] S1304: Determine a target filtering model for the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference region and a target filter;

[0226] In some embodiments, determining the target filter model for the current block based on the target filter model candidate list may include: obtaining the first filter model in the target filter model candidate list as the target filter model. In other words, obtaining the first filter model in the target filter model candidate list (reordered or unreordered) as the target filter model.

[0227] In other embodiments, the method further includes: decoding the bitstream to determine an index value of a target filter model; and determining the target filter model for the current block based on a target filter model candidate list, which may include: determining the target filter model for the current block based on the index value of the target filter model and the target filter model candidate list. In some embodiments, the index value is used to determine the target filter model from the first M candidate filter models in the target filter model candidate list. In some embodiments, M is less than the total number of models in the target filter model candidate list.

[0228] Exemplarily, decoding the bitstream and determining the index value of the target filtering model may include: decoding the bitstream, determining N binary symbols indicating the index value of the target filtering model; wherein N is an integer; and determining the index value of the target filtering model based on the N binary symbols. In some embodiments, an index reference value is determined based on the N binary symbols; and the index value is determined based on the index reference value. In other embodiments, the index value is determined based on the N binary symbols.

[0229] In some embodiments, the index value may be encoded in a binary format using one of the following encoding methods: truncated unary coding, truncated binary coding, or truncated Golomb Rice coding. Each binary symbol may be decoded using a context model or equal probability decoding.

[0230] Furthermore, taking the case where the target filtering model candidate list includes 4 candidate filtering models as an example, the representation and meaning of each model index are exemplified.

[0231] Table 4-1 Candidate list without reordering

[0232] Table 4-2 Reordered candidate list

[0233] The encoding and decoding method of the binary symbols in Table 4-1 and Table 4-2 is truncated unary code, and each binary symbol can be encoded and decoded using a context model or equal probability encoding and decoding.

[0234] Table 5-1 Candidate list without reordering

[0235] Table 5-2 Reordered candidate list

[0236] The encoding and decoding method of the binary symbols in Table 5-1 and Table 5-2 is truncated binary code, and each binary symbol can be encoded and decoded using a context model or an equal probability encoding and decoding.

[0237] Table 6-1 Candidate list without reordering

[0238] Table 6-2 Reordered candidate list

[0239] The encoding and decoding method of the binary symbols in Table 6-1 and Table 6-2 is truncated exponential Columbus, and each binary symbol can be encoded and decoded using the context model or equal probability encoding and decoding.

[0240] S1305: Determine the coefficients of the target filter according to the target reference area;

[0241] In some embodiments, a method for determining the coefficients of a filter (including the coefficients of a candidate filter and a target filter) may include: determining at least one sub-reference area contained in a current reference area; wherein the current reference area is a target reference area, a first candidate reference area, or a second candidate reference area; obtaining the autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference areas; and determining the coefficients of the current filter based on the autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference areas.

[0242] In some embodiments, the method further includes: determining multiple sub-reference areas of the current block, and the multiple sub-reference areas do not overlap with each other; determining the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of the multiple sub-reference areas based on the multiple sub-reference areas and the candidate filters; storing the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of the multiple sub-reference areas in a preset cache area; obtaining the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of at least one sub-reference area, including: obtaining the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of the at least one sub-reference area from the preset cache area.

[0243] For example, the various reference regions shown in FIG. 16 are each composed of a combination of three sub-reference regions: the upper, left, and upper-left sub-reference regions. Therefore, after obtaining the autocorrelation coefficient matrices and cross-correlation coefficient vectors for the upper, left, and upper-left sub-reference regions, any two or more sub-reference regions can be combined to obtain the autocorrelation coefficient matrix and cross-correlation coefficient vector for the complete reference region, thereby further solving the filter coefficients. In this embodiment of the present application, after deriving the filter coefficients based on the combination of the current sub-reference regions, the autocorrelation coefficient matrix and cross-correlation coefficient vector of each unconstructed sub-reference region need to be cached for subsequent use in other combinations, thereby reducing subsequent computational complexity.

[0244] S1306: Perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

[0245] In some embodiments, intra-frame prediction is performed on the current block based on the coefficients of the target filter to determine the predicted value of the current block, including: determining the reconstructed value of the reference sample of the target reference area for the pixel to be predicted in the current block; and determining the predicted value of the predicted pixel in the current block based on the coefficients of the target filter and the reconstructed value of the reference sample. It should be noted that, in order to reduce computational complexity, the embodiments of the present application can use the prediction method shown in formula (2) to determine the predicted value.

[0246] In other embodiments, a prediction method that removes the mean of input samples and output samples may be used, or a prediction method that finds the maximum and minimum values ​​in a reference area to limit the range of the predicted value may be used.

[0247] FIG20 is a schematic diagram of filters corresponding to different numbers of axis heads in an embodiment of the present application. As shown in FIG20 , 10 types of filters corresponding to 10 tap numbers are given.

[0248] Figure 21 is a schematic diagram of the prediction directions of the different filters in Figure 20. As shown in Figure 20, the filters are predicted along the diagonal direction. The grid-filled areas represent the filter input positions, and the blank areas represent the filter output positions. In addition, from an implementation perspective, points to be predicted on the same diagonal can be predicted in parallel.

[0249] By adopting the above technical solution, candidate filter models are obtained by making different combinations of reference areas and filters, thereby expanding the filter model types. The candidate filter models are then sorted to obtain a filter model candidate list. The best filter model can be determined for intra-frame prediction, thereby improving the intra-frame prediction accuracy and encoding and decoding performance.

[0250] In another embodiment of the present application, referring to FIG22 , a schematic flow chart of an encoding method provided by an embodiment of the present application is shown. As shown in FIG22 , the method may include:

[0251] S2201: Determine multiple candidate filtering models for the current block;

[0252] It should be noted that if the encoder determines that the current block allows the use of the target prediction mode, it further determines multiple candidate filter models for the current block, where the candidate filter model includes a candidate reference region and a candidate filter, and specifically may refer to a filter model that uses the candidate reference region and the candidate filter to perform intra-frame prediction on the current block. The multiple candidate filter models may specifically include two or more candidate filter models.

[0253] In some embodiments, determining multiple candidate filtering models for the current block includes: determining at least one candidate reference area for the current block, and determining at least one candidate filter for the current block; and determining multiple candidate filtering models for the current block based on the at least one candidate reference area and the at least one candidate filter.

[0254] In some embodiments, if one filter and B reconstruction regions are used, a maximum of 1xB = B filter models can be obtained for each block to be predicted. By simplifying the types of filters and expanding the types of reconstruction regions used to calculate filter coefficients, prediction accuracy can be improved.

[0255] In some other implementation schemes, a maximum of AxB filter models can be obtained using A filters and B reconstruction areas. On the basis of expanding the types of reconstruction areas used to calculate filter coefficients, appropriately increasing the types of filters can further improve the prediction accuracy.

[0256] In some embodiments, determining at least one candidate reference area for the current block includes: determining at least one candidate reference area by combining at least one sub-reference area reconstructed from the current block; wherein the at least one sub-reference area includes at least one of the following: an upper adjacent area, a left adjacent area, and an upper-left adjacent area of ​​the current block.

[0257] As shown in Figure 14, the current block can combine the three reconstructed sub-reference regions (including the upper reconstructed region, the left reconstructed region, and the upper-left reconstructed region) to obtain a maximum of seven reference regions. When using seven combinations, 1×7 filter models can be obtained for a given filter, and the reconstructed regions under different combinations can each obtain filter coefficients under a given filter shape. In some embodiments, a given filter can be a 4×4 filter.

[0258] In some embodiments, at least one candidate reference region is determined by combining at least one reconstructed sub-reference region of the current block, including: determining a second candidate reference region based on the reconstructed upper and upper-left adjacent regions of the current block; determining a third candidate reference region based on the reconstructed left and upper-left adjacent regions of the current block; and determining a fourth candidate reference region based on the reconstructed upper, left, and upper-left adjacent regions of the current block. As shown in FIG15 , three filter models can be obtained using three types of reconstructed regions.

[0259] In some embodiments, at least one candidate reference region is determined by combining at least one reconstructed sub-reference region of the current block, including: determining a first candidate reference region based on the reconstructed upper and left adjacent regions of the current block; determining a second candidate reference region based on the reconstructed upper and upper-left adjacent regions of the current block; determining a third candidate reference region based on the reconstructed left and upper-left adjacent regions of the current block; and determining a fourth candidate reference region based on the reconstructed upper, left, and upper-left adjacent regions of the current block. As shown in FIG16 , four filter models can be obtained using four types of reconstructed regions.

[0260] In some embodiments, determining at least one candidate filter for the current block includes: determining at least one candidate filter according to at least one candidate filter shape and a specific number of taps.

[0261] Figure 17 shows three filter shapes and candidate filter examples with different tap numbers. The grid-filled boxes are the filter inputs, and the blank-filled boxes are the filter outputs.

[0262] In some embodiments, the method further comprises: determining a size parameter of the candidate reference region based on a size parameter of the current block and a size parameter of the candidate filter; wherein the size parameter includes height and / or width. Exemplarily, determining a minimum parameter from the height and width of the current block; determining a height of the candidate reference region based on the minimum parameter and the height of the candidate filter; and determining a width of the candidate reference region based on the minimum parameter and the width of the candidate filter. More specifically:

[0263] The width of the left reference area and the upper left reference area is min(blockWidth,blockHeight)+filterWidth-1

[0264] The height of the upper reference area and the upper left reference area is min(blockWidth,blockHeight)+filterHeight-1

[0265] The filterWidth-1 and filterHeight-1 of each tap filter are shown in Table 3.

[0266] In an embodiment of the present application, the size of the reference area of ​​the current block is associated with the shape and minimum parameters of the filter. Simply put, if the size of the current block is large, a large reference area can be used; if the size of the current block is small, a small reference area can be used. The number of rows and columns of the reference area can be derived based on the size of the current block. For example, as shown in Figures 4A, 5A, and 6A, the L-shaped reconstruction area on the upper left side of the current block is the reference area, and the width and height of the reference area depend on the size of the filter used in the current block and the size of the variable N. The size of the variable N is equal to the smaller of the width and height of the current block. For example, for a 2×8 current block, the value of the variable N is 2; for a 4×4 current block, the value of the variable N is 4.

[0267] S2202: Sort multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters;

[0268] In some embodiments, the candidate reference regions in the candidate filter models can be sorted based on the number of samples, and the samples are added to the candidate list in order according to the number of samples, with samples with a large number of samples added first and samples with a small number of samples added later. It should be noted that since the input and output of the candidate filter when determining the filter coefficient based on the candidate reference region are both reference samples within the candidate reference region, the number of samples can be the number of samples within the candidate reference region that serve as the output of the candidate filter. Generally, the more samples there are, the higher the prediction accuracy. Therefore, sorting based on the number of samples can be understood as a way of sorting the prediction accuracy of the candidate filter models.

[0269] Exemplarily, sorting multiple candidate filter models to determine a target filter model candidate list for the current block includes: determining a first candidate reference region and a first candidate filter for a first candidate filter model among the multiple candidate filter models; using reference samples within the first candidate reference region as input samples for the first candidate filter, and determining the number of samples within the first candidate reference region that serve as output samples for the first candidate filter; sorting the first candidate filter models based on the number of samples within the first candidate reference region to obtain a first filter model candidate list; and obtaining a target filter model candidate list based on the first filter model candidate list. As shown in FIG4A , when a 4×4 filter slides within an L-shaped reconstruction region and counts reference samples within the L-shaped reconstruction region as input samples for the filter, the number of output samples within the L-shaped reconstruction region, i.e., the number of samples within the dotted region within the L-shaped reconstruction region near the current block, is the number of samples within the dotted region within the L-shaped reconstruction region. The grid-filled portion represents the input sample position of the filter, and the blank-filled portion represents the output sample position of the filter.

[0270] In some embodiments, multiple candidate filtering models are sorted to determine a candidate list of target filtering models for the current block, which also includes: determining the coefficients of the first candidate filter based on the first candidate reference area; in the process of sorting the first candidate filtering models according to the number of samples in the first candidate reference area, deleting the first candidate filtering models with repeated coefficients of the first candidate filter to obtain a first filtering model candidate list.

[0271] It should be noted that when constructing the candidate list of filter models, since different models may have the same filter coefficients, the models should be checked for duplicates and redundant models should be removed to improve intra-frame prediction efficiency. If A filters and B reconstruction areas are used, a maximum of AxB filter models can be obtained. Considering the possibility of models with duplicate filter coefficients, in some cases, the number of filter models after deduplication should be less than or equal to AxB.

[0272] In some embodiments, the first filter model candidate list is directly used as the target filter model candidate list. In other embodiments, a target filter model candidate list is obtained based on the first filter model candidate list, including: reordering the first filter model candidate list based on template matching to obtain the target filter model candidate list. In other words, the candidate filter models are used to make predictions in the current block template; the degree of match between the predicted value and the reconstructed value of the current block template is compared to reorder the candidate filter models; and the target filter model is determined based on the reordering results. Reordering the candidate filter models and determining the target filter model based on the reordering results can improve prediction accuracy. Furthermore, encoding the index value of the target filter model can reduce the number of encoded binary symbols.

[0273] Exemplarily, the first filter model candidate list is reordered based on template matching to obtain a target filter model candidate list, including: determining the second candidate reference area and the second candidate filter of the second candidate filter model in the first filter model candidate list; determining the coefficient of the second candidate filter based on the second candidate reference area; predicting the current block template based on the coefficient of the second candidate filter to obtain the predicted value of the current block template; performing cost calculation based on the predicted value and the reconstructed value of the current block template to obtain a first cost parameter; reordering the first filter model candidate list based on the first cost parameter to obtain a target filter model candidate list. In an embodiment of the present application, the cost function used for cost calculation can be the sum of absolute error SAD, the sum of absolute transform difference SATD, the mean square error MSE, the sum of squared errors SSD, the mean absolute difference MAD, the mean sum of squared errors MSD, the absolute value DCT of the transform coefficient, the normalized correlation coefficient NCC, etc., which are not specifically limited here.

[0274] It should be noted that the template can be composed of reconstructed pixels from one or more areas of the top, top right, left, bottom left, and top left of the current block. In addition, a template area of ​​N rows and M columns can be used, where N and M are positive integers related to the shape and size of the current block, and can also be pre-set.

[0275] It should also be noted that the portion of the reconstructed pixels to be obtained can be determined by the value of the template type parameter (refTemplateType). For example, when the value of refTemplateType is 1, the reconstructed pixels of the left, upper left, and upper sides of the current block are obtained; or, when the value of refTemplateType is 2, only the reconstructed pixels of the four left columns of the current block are obtained; or, when the value of refTemplateType is 3, only the reconstructed pixels of the four upper rows of the current block are obtained.

[0276] Use the models in the candidate list one by one to make predictions on the template area of ​​the current block. The prediction can be made in a predefined direction, such as a diagonal direction, a horizontal direction, a vertical direction, etc. For example, as shown in FIG18 , the template area of ​​the current block includes an upper template area and a left template area, and the width and height of the template area are both greater than 1 pixel. As shown in FIG19A , a 4×4 candidate filter is used to make predictions on the upper template area and the left template area respectively in the diagonal direction. As shown in FIG19B , an 8×2 candidate filter is used to make predictions on the upper template area and the left template area respectively in the diagonal direction. As shown in FIG19C , a 2×8 candidate filter is used to make predictions on the upper template area and the left template area respectively in the diagonal direction.

[0277] Exemplarily, the template region of the current block includes an upper template region, a left template region, and an upper-left template region, and the width and height of the template region are both equal to 1 pixel. As shown in FIG19D , when prediction is performed in the upper template region, the filter moves horizontally, and as shown in FIG19E , when prediction is performed in the left template region, the filter moves vertically.

[0278] In some embodiments, the calculation method for generating a prediction value on a template may specifically include: determining the prediction value of the first template sample in the current block template based on the coefficient of the second candidate filter and the reconstructed value of the reference sample in the second candidate reference area; determining the prediction value of the second template sample in the current block template based on the coefficient of the second candidate filter, the reconstructed value of the reference sample in the second candidate reference area and the predicted value of the predicted template sample; wherein the predicted template sample includes the first template sample and / or the second template sample.

[0279] It should be noted that the template prediction method can be the same as the prediction method of the current block, that is, when predicting the non-upper left corner position of the left and upper templates, the input of some filters uses the predicted value on the template. The advantage of this is that the true predicted value of the model can be better made in the template area. The disadvantage is that, like the prediction of the block to be predicted, since some predicted values ​​need to be used as the input of the filter, there will be dependencies between pixels. For example, if the prediction is made in diagonal order, the prediction of the pixel value on the current diagonal line of the template needs to use the predicted value of the previous diagonal line, that is, there is a diagonal dependency.

[0280] In other embodiments, the calculation method for generating the prediction value on the template may specifically include: obtaining the prediction value of the current block template according to the coefficients of the second candidate filter and the reconstructed values ​​of the reference samples in the second candidate reference area.

[0281] It should be noted that since the template area has been reconstructed, all reconstructed pixel values ​​can be used as filter input. This is different from the prediction method of the block to be predicted, so the accuracy of template matching is low. The advantage of this is that it is well parallelized, and all positions on the template can be calculated in parallel, which has high computational efficiency.

[0282] In some embodiments, the method further includes: determining reordering indication information; when determining that the current block uses template matching to reorder the filter model candidate list according to the reordering indication information, reordering the first filter model candidate list based on template matching to obtain a target filter model candidate list; when determining that the current block does not use template matching technology to reorder the filter model candidate list according to the reordering indication information, using the first filter model candidate list as the target filter model candidate list; and encoding the reordering indication information.

[0283] Exemplarily, the reordering indication information includes a first syntax element and a second syntax element; wherein the first syntax element is used to indicate whether the current block is allowed to use the template matching technology; the second syntax element is used to indicate whether the current block uses template matching to reorder the filter model candidate list;

[0284] Determining the reordering indication information may include: the value of the first syntax element is a first numerical value, determining the value of the second syntax element; the value of the second syntax element is the first numerical value, determining that the current block uses template matching to reorder the filtering model candidate list; the value of the first syntax element is a second numerical value, or the value of the second syntax element is the second numerical value, determining that the current block does not use template matching technology to reorder the filtering model candidate list.

[0285] It should be noted that the template matching-based technology is controlled by a unified first syntax element to determine whether it is turned on. This flag can be at the sequence level, image level, slice level, coding tree unit level, etc. This flag controls whether some or all template matching-based technologies, including the template matching-based reordering filter model candidate list in the embodiment of the present application, are allowed to be turned on. When the unified flag is turned on, further encoding of the flag of each template matching technology will be allowed, and the template matching-based reordering filter model candidate list here can also be controlled by this unified flag switch. Template matching-based reordering filter model candidate list can be controlled by a second syntax element to determine whether it is turned on. This flag can be at the sequence level, image level, slice level, coding tree unit level, etc.

[0286] S2203: Determine a target filtering model for the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference region and a target filter;

[0287] In some embodiments, determining the target filter model for the current block based on the target filter model candidate list may include: obtaining the first filter model in the target filter model candidate list as the target filter model. In other words, obtaining the first filter model in the target filter model candidate list (reordered or unreordered) as the target filter model.

[0288] In some embodiments, determining a target filter model for a current block based on a target filter model candidate list includes sequentially obtaining first M candidate filter models in the target filter model candidate list as the target filter model. Further, the encoder determines an optimal filter model from the first M candidate filter models through encoding decision making.

[0289] S2204: Determine the coefficients of the target filter according to the target reference area;

[0290] In some embodiments, a method for determining the coefficients of a filter (including the coefficients of a candidate filter and a target filter) may include: determining at least one sub-reference area contained in a current reference area; wherein the current reference area is a target reference area, a first candidate reference area, or a second candidate reference area; obtaining the autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference areas; and determining the coefficients of the current filter based on the autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference areas.

[0291] In some embodiments, the method further includes: determining multiple sub-reference areas of the current block, and the multiple sub-reference areas do not overlap with each other; determining the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of the multiple sub-reference areas based on the multiple sub-reference areas and the candidate filters; storing the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of the multiple sub-reference areas in a preset cache area; obtaining the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of at least one sub-reference area, including: obtaining the autocorrelation coefficient matrix and cross-correlation coefficient vector of each of the at least one sub-reference area from the preset cache area.

[0292] For example, the various reference regions shown in FIG. 16 are each composed of a combination of three sub-reference regions: the upper, left, and upper-left sub-reference regions. Therefore, after obtaining the autocorrelation coefficient matrices and cross-correlation coefficient vectors for the upper, left, and upper-left sub-reference regions, any two or more sub-reference regions can be combined to obtain the autocorrelation coefficient matrix and cross-correlation coefficient vector for the complete reference region, thereby further solving the filter coefficients. In this embodiment of the present application, after deriving the filter coefficients based on the combination of the current sub-reference regions, the autocorrelation coefficient matrix and cross-correlation coefficient vector of each unconstructed sub-reference region need to be cached for subsequent use in other combinations, thereby reducing subsequent computational complexity.

[0293] S2205: Perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

[0294] In some embodiments, intra-frame prediction is performed on the current block based on the coefficients of the target filter to determine the predicted value of the current block, including: determining the reconstructed value of the reference sample of the target reference area for the pixel to be predicted in the current block; and determining the predicted value of the predicted pixel in the current block based on the coefficients of the target filter and the reconstructed value of the reference sample. It should be noted that, in order to reduce computational complexity, the embodiments of the present application can use the prediction method shown in formula (2) to determine the predicted value.

[0295] In other embodiments, a prediction method that removes the mean of input samples and output samples may be used, or a prediction method that finds the maximum and minimum values ​​in a reference area to limit the range of the predicted value may be used.

[0296] FIG20 is a schematic diagram of filters corresponding to different numbers of axis heads in an embodiment of the present application. As shown in FIG20 , 10 types of filters corresponding to 10 tap numbers are given.

[0297] Figure 21 is a schematic diagram of the prediction directions of the different filters in Figure 20. As shown in Figure 20, the filters are predicted along the diagonal direction. The grid-filled areas represent the filter input positions, and the blank areas represent the filter output positions. In addition, from an implementation perspective, points to be predicted on the same diagonal can be predicted in parallel.

[0298] S2206: Make an encoding decision based on the predicted value and original value of the current block, determine whether the current block uses the target prediction mode, and encode prediction mode indication information.

[0299] It should be noted that the target prediction mode in the embodiments of the present application is an intra-frame prediction mode, specifically a prediction mode that performs intra-frame prediction based on a target filter model. The prediction mode indication information may include block-level syntax elements that indicate whether the current block uses the target prediction mode. The encoded prediction mode indication information is transmitted to the decoder. The decoder parses the prediction mode indication information and determines that the target prediction mode is selected for the current block. The decoding method of any one of the embodiments of the present application is executed; otherwise, it is not executed.

[0300] In some embodiments, a cost calculation is performed based on the predicted value and the original value of the current block to determine a second cost parameter; an encoding decision is made based on the second cost parameter to determine whether the current block uses the target prediction mode; prediction mode indication information is determined based on the decision result; the prediction mode indication information is encoded, and the obtained encoding bits are written into the bitstream.

[0301] In some embodiments, determining a target filter model for a current block based on a target filter model candidate list includes: sequentially obtaining the first M candidate filter models in the target filter model candidate list as the target filter model; the method further includes: when determining that the current block uses a target prediction mode, determining an index value of an optimal filter model corresponding to the target prediction mode; encoding the index value of the optimal filter model, and writing the resulting coded bits into a bitstream. In some embodiments, M is less than the total number of models in the target candidate list, and making encoding decisions based on the first M candidate filter models can reduce computational time complexity at the encoder end.

[0302] It should be noted that if the encoding end determines to use the target prediction mode through encoding decision and determines the index value of the best filtering model from M candidate filtering models, the encoded index value is passed to the decoding end, the decoding end parses the index value of the best filtering model and determines the best filtering model from the target filtering model candidate list.

[0303] Exemplarily, encoding the index value of the target filtering model and writing the obtained coded bits into the bitstream includes: determining N binary symbols for indicating the index value of the target filtering model; where N is an integer; encoding the N binary symbols and writing the obtained coded bits into the bitstream.

[0304] In some embodiments, the index value may be encoded using one of the following encoding methods: truncated unary coding, truncated binary coding, or truncated Golomb Rice coding. Each binary symbol may be encoded using a context model or equal probability coding.

[0305] By adopting the above technical solution, candidate filter models are obtained by making different combinations of reference areas and filters, thereby expanding the filter model types, and then the candidate filter models are sorted to obtain a filter model candidate list. The best filter model can be determined for intra-frame prediction, thereby improving the intra-frame prediction accuracy and coding performance.

[0306] In another embodiment of the present application, based on the encoding and decoding method described in the aforementioned embodiment, an improvement of the intra-frame prediction mode based on interpolation filtering is provided. The following describes the improvements in detail from several aspects.

[0307] (1) Use maximum and / or minimum values ​​to limit the range of predicted values.

[0308] In one possible embodiment, the prediction process starts from the upper left corner of the current block and proceeds to the lower left corner in a certain order. The prediction formula is as follows:

[0309] Among them, a and b in Clip(a,b,c) represent the output range of the limited prediction results. r is the prediction result of position r in the current block, min, max are the minimum and maximum values ​​obtained above, and m is a certain value obtained above. Represents the input of the interpolation filter, which needs to be subtracted from m and further multiplied by the corresponding filter coefficient and summed. When it is located in the reconstruction area, the reconstructed value is used as the input of the interpolation filter. When it is located in the current block, the already obtained predicted value is used as the input of the interpolation filter.

[0310] For example, as shown in Figure 5, the interpolation filter is predicted along the diagonal direction, where the grid-filled area represents the input position of the interpolation filter, and the black-filled area represents the output position of the interpolation filter. In addition, from an implementation perspective, the predicted points on the same diagonal line can be predicted in parallel.

[0311] (2) Sample mean removal

[0312] When obtaining filter coefficients, the input samples and output samples of the filter can subtract the mean value, so that the parsed filter coefficients can be more conducive to improving the fitting effect of the interpolation filter. This means that when using the interpolation filter to predict the current block, correspondingly, the input needs to subtract the mean value and be sent to the interpolation filter, and the output needs to add the mean value to obtain the predicted value. Compared with the basic prediction formula, steps of subtracting the mean value and adding the mean value to the output need to be added additionally. [[ID=​​​​​​​​​​​​​​​​​​The DM mode is an efficient intra-frame chroma prediction mode used in many standards for prediction. When the chroma block selects the DM mode, the chroma block will obtain the mode selected by the luminance block at the corresponding position for intra-frame prediction. The interpolation filtering technology described in the above embodiment only works on the prediction of intra-frame blocks of luminance. A direct approach is to extend the mode to chroma, but this will result in the need to derive filtering parameters for chroma, which will bring high computational complexity. In related technologies, there is no interpolation filtering prediction mode for chroma. When the DM mode is selected for the chroma intra-frame block, the DM mode will be set to PLANAR mode.

[0320] However, for the luminance block using the interpolation filter mode, a traditional prediction mode can be derived by constructing a gradient histogram. This traditional mode can be used when the chrominance mode selects the DM mode and the interpolation filter mode is selected for the luminance block at the corresponding position.

[0321] (5) Selection of the basic transform kernel for the prediction block in the interpolation filter mode.

[0322] After the current block is predicted, the encoder calculates the residual value between the predicted value and the original value. The residual value will be further transformed and quantized. At the decoder, the quantized coefficients parsed from the bitstream will be inverse quantized and inverse transformed to obtain the reconstructed residual value. The reconstructed residual value is added to the predicted value to obtain the reconstructed value.

[0323] The aforementioned embodiment introduces a method for deriving a gradient histogram from the interpolation filter prediction results and matching it to a traditional prediction mode, further selecting an inseparable transform kernel. For base transform kernels other than the inseparable transform kernel, the transform kernel selection method is the same as that for the PLANAR mode. However, the interpolation filter mode differs from the PLANAR mode in its characteristics, and the selection of the base transform kernel should be more optimized.

[0324] In the reference software ECM, basic transforms are divided into horizontal and vertical directions. The following seven transforms are allowed in each direction: {'DCT2', 'DCT8', 'DST7', 'DCT5', 'DST4', 'DST1', 'IDTR'}. DCT2, DCT8, and DCT5 are subclasses of the discrete cosine transform; DST7, DST4, and DST1 are subclasses of the discrete sine transform; and IDTR stands for identity transform, indicating no transformation.

[0325] In the reference software ECM, the most commonly used base transform mode is DCT2 in both the horizontal and vertical directions, written as DCT2-DCT2. This is used as the primary transform before the inseparable secondary transform (LFNST) and is also used when the Multiple Transform Select (MTS) technology is disabled. When MTS mode is selected, the transform process is a combination of the base transforms in the horizontal and vertical directions, rather than an inseparable transform. In ECM, up to six non-DCT2-DCT2 transform kernels can be selected for the current block, depending on the characteristics of the non-zero coefficients in the current block.

[0326] In the embodiments of the present application, for a prediction block in an interpolation filtering mode, the residual MTS base transform kernel should be related to whether the current block has selected an interpolation filtering mode. More specifically, it can be related to the selected sub-mode of the interpolation filtering mode and / or the size and shape of the current block. For example, the embodiments of the present application provide two implementations of base transform kernel candidates that can be used under the current MTS design of ECM.

[0327] In one possible implementation, the optional base transform kernel of the MTS is related to whether the interpolation filter prediction mode is selected for the current block. If the interpolation filter prediction mode is used for the current block, the six MTS transform kernels are as follows (the transform kernel is: horizontal transform - vertical transform). See Table 7 for details.

[0328] Table 7

[0329] When MTS is selected and the prediction mode of the current block is the interpolation prediction mode, a corresponding target transform kernel is selected from the six transform kernels according to the parsed MTS transform kernel index value for inverse transform.

[0330] In another possible implementation, the base transform kernel selectable by the MTS is related to whether the interpolation filter mode is selected for the current block and the size and shape of the current block. The block shape is: height × width. See Table 8 for details.

[0331] Table 8

[0332] When MTS is selected and the prediction mode of the current block is interpolation prediction mode, the corresponding target transform kernel is selected according to the parsed MTS transform kernel index value and the shape and size of the block for inverse transformation. In this embodiment, the interpolation filter prediction mode can be applied to 4×4 to 32×32 luma blocks.

[0333] It should also be noted that the method for obtaining the candidate MTS transformation core may include:

[0334] Step 1: Encode the image set or video set using an encoder that includes an interpolation filter prediction mode

[0335] Step 2: The residuals of the blocks with the selected interpolation filter mode are sorted by category (e.g., block shape and size, interpolation filter mode) to select possible horizontal and vertical transform kernels. The kernel selection criteria can be the SAD size, SSE size, or other metrics such as transform coding gain. Transform coding gain is defined as the arithmetic mean of the transform coefficient variances divided by the geometric mean of the transform coefficient variances.

[0336] (6) Nonlinear terms and bias terms in interpolation filtering.

[0337] In the interpolation filtering described in the aforementioned embodiment, the prediction of the interpolation filtering does not contain nonlinear terms or bias terms. In order to improve the coding performance gain brought by the nonlinear terms or bias terms, nonlinear terms or bias terms can also be added to the interpolation filtering. Among them, the 15 linear terms used in this implementation process are the three cases shown in Figures 3A, 3B, and 3C. The linear terms of the 15 taps of the interpolation filter are grid filling positions, and the black filling position is the current position to be predicted. On this basis, 3 tap nonlinear terms can be added. The reconstructed pixel positions used by the nonlinear terms are shown in Figures 23A, 23B, and 23C, specifically three dot-filled positions.

[0338] Here, the interpolation input p of 15 linear terms i =t i -m, i takes values ​​from 0 to 14, corresponding to the 14 grid filling positions around the current predicted position, t i is the reconstructed value or predicted value at the grid filling position (depending on whether the input required for the current predicted position is located in the current block or in the reference area), and m is a subtracted value, which can be the reconstructed value of the upper left corner of the current block, or the average value of the reference area, which is not specifically limited here.

[0339] Here, the interpolation input p of the three nonlinear terms i =((t i -m)×(t i -m)+midVal)>>bitDepth, i is the three positions filled with points, t i is the value of the nonlinear term, midVal and bitDepth are equal to 512 and 10 in the case of 10 bits. Thus, when the nonlinear term is added, for the current prediction position, the calculation formula of the prediction value is as follows:

[0340] It should also be noted that in obtaining the interpolation filter coefficients, the corresponding nonlinear term value should also be increased when constructing the autocorrelation coefficient matrix and the cross-correlation coefficient vector; and / or, when there is a bias term, the bias term value should also be further increased when constructing the autocorrelation coefficient matrix and the cross-correlation coefficient vector.

[0341] In addition to the above embodiment, three tap nonlinear terms are added to the 15 tap linear terms of the target filter, as shown in Figures 24A, 24B, and 24C. The nonlinear terms are specifically three dot-filled positions, and the black-filled position represents the current position to be predicted. Among them, Figures 24A, 24B, and 24C all add three nonlinear terms compared to Figures 23A, 23B, and 23C, but because different filter shapes all use the same nonlinear terms, the calculation is simpler, further reducing complexity.

[0342] Furthermore, regarding the number of nonlinear terms, in addition to using 3 nonlinear terms, the embodiment of the present application may also use more nonlinear terms. For example, 5 nonlinear terms are used in Figures 25A, 25B, and 25C. As shown in Figures 25A, 25B, and 25C, on the basis of the 15-tap linear terms of the interpolation filter, 5-tap nonlinear terms are added. The nonlinear terms are specifically filled with dots, and the black filled positions represent the current position to be predicted. That is, in the embodiment of the present application, the number of nonlinear terms should be a positive integer, the specific number is not limited, and different designs can be made according to performance complexity requirements.

[0343] In some embodiments, when the linear term is de-meaned, the nonlinear term may also be de-meaned.

[0344] The bias term is a filter coefficient that adds a tap. When calculating the prediction value, this filter coefficient is used to multiply a constant. This constant can be a constant related to the bit depth of the pixel. For example, for a 10-bit video sequence, this constant can be 512 (i.e., 2 10-1 ). Thus, for the current predicted position, the calculation formula for the predicted value is as follows:

[0345] In the embodiments of the present application, the specific implementation of the aforementioned embodiments is elaborated in detail through the above embodiments. It can be seen that according to the technical solutions of the aforementioned embodiments, candidate filter models are obtained by making different combinations of reference areas and filters, thereby expanding the filter model types, and then the candidate filter models are sorted to obtain a filter model candidate list, which can determine the best filter model for intra-frame prediction, thereby improving the intra-frame prediction accuracy and encoding and decoding performance.

[0346] Furthermore, the performance of the encoding and decoding method provided in the embodiment of the present application was tested, taking the four reference areas shown in FIG16 and the filter shape shown in FIG20 as examples.

[0347] Test Results - 1:8 tap filter, no reordering

[0348] Test Results - 2:9 Tap Filter, No Reordering

[0349] Test Results - 3:10 Tap Filter, No Reordering

[0350] Test Results - 4:12 Tap Filter, No Reordering

[0351] Test Results - 5:14 Tap Filter, No Reordering

[0352] Test Results - 6:15 Tap Filter, No Reordering

[0353] Test results - 7:8 tap filter with reordering

[0354] Test results - 8:9 tap filter with reordering

[0355] Test results - 9:10 tap filter with reordering

[0356] Test results - 10:12 tap filter with reordering

[0357] Test results - 11:14 tap filter with reordering

[0358] Test results - 12:15 tap filter with reordering

[0359] It can be seen from the above test results that the embodiments of the present application have improved the encoding and decoding performance of both the luminance component and the chrominance component.

[0360] In another embodiment of the present application, the embodiment of the present application further provides a code stream, which is generated by bit encoding based on the information to be encoded; wherein, the information to be encoded includes at least one of the following: the index value of the target filtering model of the current block, the residual value of the current block, the prediction mode indication information and the reordering indication information of the current block; wherein, the prediction mode indication information is used to indicate whether the current block uses the target prediction mode, and the reordering indication information is used to indicate whether the current block uses template matching to reorder the filtering model candidate list.

[0361] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, see FIG27 , which shows a schematic diagram of the composition structure of an encoder provided by an embodiment of the present application. As shown in FIG27 , the encoder 270 may include a first determination unit 2701, a first prediction unit 2702, and an encoding unit 2703, wherein:

[0362] A first determining unit 2701 is configured to determine a plurality of candidate filtering models for a current block;

[0363] The first determining unit 2701 is configured to sort multiple candidate filtering models to determine a target filtering model candidate list for the current block; wherein the candidate filtering models include candidate reference regions and candidate filters;

[0364] The first determining unit 2701 is configured to determine a target filtering model of the current block according to a target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter;

[0365] A first determining unit 2701 is configured to determine coefficients of a target filter according to a target reference area;

[0366] A first prediction unit 2702 is configured to perform intra-frame prediction on a current block according to coefficients of a target filter to determine a prediction value of the current block;

[0367] The encoding unit 2703 is configured to make an encoding decision based on the predicted value and the original value of the current block, determine whether the current block uses the target prediction mode, and encode prediction mode indication information.

[0368] It can be understood that each functional unit of the encoder also executes the encoding method described in any one of the aforementioned embodiments.

[0369] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0370] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0371] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 270. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0372] Based on the composition of the encoder 270 and the computer-readable storage medium, refer to Figure 28, which shows a specific hardware structure diagram of the encoder 270 provided in an embodiment of the present application. As shown in Figure 28, the encoder 270 may include: a first communication interface 2801, a first memory 2802 and a first processor 2803; each component is coupled together through a first bus system 2804. It can be understood that the first bus system 2804 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 2804 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 2804 in Figure 28. Among them,

[0373] The first communication interface 2801 is used to receive and send signals when sending and receiving information with other external network elements;

[0374] A first memory 2802 is used to store computer programs that can be run on the first processor 2803;

[0375] The first processor 2803 is configured to, when running the computer program, execute:

[0376] Determining multiple candidate filter models for the current block;

[0377] Sorting multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters;

[0378] Determine the target filter model of the current block according to the target filter model candidate list; wherein the target filter model includes a target reference area and a target filter;

[0379] Determining the coefficients of the target filter according to the target reference area;

[0380] Performing intra-frame prediction on the current block according to the coefficient of the target filter to determine the prediction value of the current block;

[0381] Make an encoding decision based on the predicted value and original value of the current block, determine whether the current block uses the target prediction mode, and encode the prediction mode indication information.

[0382] It can be understood that each functional unit of the encoder also executes the encoding method described in any one of the aforementioned embodiments.

[0383] It is understood that the first memory 2802 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 2802 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0384] The first processor 2803 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 2803. The above-mentioned first processor 2803 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 2802 , and the first processor 2803 reads the information in the first memory 2802 and completes the steps of the above method in combination with its hardware.

[0385] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0386] Optionally, as another embodiment, the first processor 2803 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.

[0387] This embodiment provides an encoder. For this encoder, candidate filter models are obtained by performing different combinations of reference areas and filters, thereby expanding the filter model types. The candidate filter models are then sorted to obtain a filter model candidate list. The target filter model is determined from the filter model candidate list for intra-frame prediction, which can improve the intra-frame prediction accuracy and encoding performance.

[0388] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, see FIG27 , which shows a schematic diagram of the structure of a decoder provided by an embodiment of the present application. As shown in FIG27 , the decoder 290 may include a decoding unit 2901, a second determination unit 2902, and a second prediction unit 2903, wherein:

[0389] The decoding unit 2901 is configured to decode the code stream and determine a target prediction mode to be used for the current block;

[0390] A second determining unit 2902 is configured to determine a plurality of candidate filtering models for the current block;

[0391] The second determining unit 2902 is configured to sort the multiple candidate filtering models and determine a target filtering model candidate list for the current block; wherein the candidate filtering models include candidate reference regions and candidate filters;

[0392] The second determining unit 2902 is configured to determine a target filtering model for the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter;

[0393] A second determining unit 2902 is configured to determine coefficients of a target filter according to the target reference area;

[0394] The second prediction unit 2903 is configured to perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

[0395] It can be understood that each functional unit of the decoder also executes the decoding method described in any one of the aforementioned embodiments.

[0396] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0397] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium for use in decoder 290. The computer-readable storage medium stores a computer program that, when executed by a second processor, implements any of the methods described in the aforementioned embodiments.

[0398] Based on the composition of the decoder 290 and the computer-readable storage medium, refer to Figure 28, which shows a specific hardware structure diagram of the decoder 290 provided in an embodiment of the present application. As shown in Figure 28, the decoder 290 may include: a second communication interface 3001, a second memory 3002 and a second processor 3003; each component is coupled together through a second bus system 3004. It can be understood that the second bus system 3004 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 3004 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 3004 in Figure 28. Among them,

[0399] The second communication interface 3001 is used to receive and send signals during the process of sending and receiving information between other external network elements;

[0400] The second memory 3002 is used to store computer programs that can be run on the second processor 3003;

[0401] The second processor 3003 is configured to, when running the computer program, execute:

[0402] Decode the code stream and determine the target prediction mode used by the current block;

[0403] Determining multiple candidate filter models for the current block;

[0404] Sorting multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters;

[0405] Determine the target filter model of the current block according to the target filter model candidate list; wherein the target filter model includes a target reference area and a target filter;

[0406] Determining the coefficients of the target filter according to the target reference area;

[0407] Perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

[0408] It can be understood that each functional unit of the decoder also executes the decoding method described in any one of the aforementioned embodiments.

[0409] Optionally, as another embodiment, the second processor 3003 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0410] It can be understood that the hardware functions of the second memory 3002 and the first memory 2802 are similar, and the hardware functions of the second processor 3003 and the first processor 2803 are similar; they will not be described in detail here.

[0411] This embodiment provides a decoder. For this decoder, candidate filter models are obtained by performing different combinations of reference areas and filters, thereby expanding the filter model types. The candidate filter models are then sorted to obtain a filter model candidate list. The target filter model is determined from the filter model candidate list for intra-frame prediction, which can improve the intra-frame prediction accuracy and decoding performance.

[0412] In yet another embodiment of the present application, referring to FIG29 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG29 , the coding and decoding system 310 may include an encoder 3101 and a decoder 3102 .

[0413] In the embodiment of the present application, the encoder 3101 may be the encoder described in any one of the aforementioned embodiments, and the decoder 3102 may be the decoder described in any one of the aforementioned embodiments.

[0414] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0415] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0416] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0417] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0418] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0419] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability

[0420] In an embodiment of the present application, whether at the encoding or decoding end, multiple candidate filter models for the current block are determined; the multiple candidate filter models are sorted to determine a target filter model candidate list for the current block; based on the target filter model candidate list, the target filter model for the current block is determined; based on the target reference area, the coefficients of the target filter are determined; based on the coefficients of the target filter, intra-frame prediction is performed on the current block to determine the predicted value of the current block. In this way, by combining different reference areas and filters to obtain candidate filter models, thereby expanding the filter model types, and then sorting the candidate filter models to obtain a filter model candidate list, the optimal filter model can be determined for intra-frame prediction, thereby improving the accuracy of intra-frame prediction and encoding and decoding performance.

Claims

1. A decoding method, applied to a decoder, the method comprising: Decode the bitstream and determine the target prediction mode used by the current block; Determine multiple candidate filter models for the current block; Sorting the multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters; Determine a target filter model of the current block according to the target filter model candidate list; wherein the target filter model includes a target reference area and a target filter; Determining coefficients of the target filter according to the target reference area; Perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

2. The method according to claim 1, wherein: The determining of multiple candidate filter models for the current block comprises: Determine at least one candidate reference region for the current block, and determine at least one candidate filter for the current block; A plurality of candidate filter models for the current block are determined according to the at least one candidate reference region and the at least one candidate filter.

3. The method according to claim 2, wherein: The determining of at least one candidate reference region of the current block includes: The at least one candidate reference region is determined by combining at least one sub-reference region reconstructed according to the current block; wherein the at least one sub-reference region includes at least one of the following: an upper adjacent region, a left adjacent region and an upper-left adjacent region of the current block.

4. The method according to claim 3, wherein: The combining at least one sub-reference region reconstructed according to the current block to determine the at least one candidate reference region includes: Determine a first candidate reference region according to the reconstructed upper adjacent region and the left adjacent region of the current block; Determine a second candidate reference region according to the reconstructed upper adjacent region and the upper left adjacent region of the current block; Determine a third candidate reference region according to the reconstructed left adjacent region and the upper left adjacent region of the current block; A fourth candidate reference region is determined according to the reconstructed upper adjacent region, the left adjacent region and the upper-left adjacent region of the current block.

5. The method according to any one of claims 1 to 4, wherein: The method further comprises: Determining a size parameter of the candidate reference area according to a size parameter of the current block and a size parameter of the candidate filter; The size parameters include height and / or width.

6. The method according to claim 5, wherein: The determining the size parameter of the candidate reference area according to the size parameter of the current block and the size parameter of the candidate filter comprises: Determine the minimum parameter from the height and width of the current block; Determine the heights of the upper sub-reference region and the upper left sub-reference region of the candidate reference region according to the minimum parameter and the difference of the height of the candidate filter minus one; The widths of the left sub-reference region and the upper left sub-reference region of the candidate reference region are determined according to the minimum parameter and a difference of the width of the candidate filter minus one.

7. The method according to any one of claims 1 to 6, wherein: The step of sorting the plurality of candidate filter models to determine a target filter model candidate list for the current block includes: Determine a first candidate reference region and a first candidate filter of a first candidate filtering model among the multiple candidate filtering models; Using reference samples in the first candidate reference area as input samples of the first candidate filter, and determining the number of samples in the first candidate reference area as output samples of the first candidate filter; Sort the first candidate filter models according to the number of samples in the first candidate reference area to obtain a first filter model candidate list; According to the first filtering model candidate list, the target filtering model candidate list is obtained.

8. The method according to claim 7, wherein: The step of sorting the plurality of candidate filter models to determine a target filter model candidate list for the current block further includes: Determining coefficients of the first candidate filter according to the first candidate reference area; In the process of sorting the first candidate filter models according to the number of samples in the first candidate reference area, first candidate filter models having repeated coefficients of the first candidate filter are deleted to obtain the first filter model candidate list.

9. The method according to claim 7 or 8, wherein: The step of obtaining the target filtering model candidate list according to the first filtering model candidate list includes: The first filtering model candidate list is reordered based on template matching to obtain the target filtering model candidate list.

10. The method according to claim 9, wherein: The reordering of the first filter model candidate list based on template matching to obtain the target filter model candidate list includes: Determine a second candidate reference region and a second candidate filter of a second candidate filtering model in the first filtering model candidate list; Determining coefficients of the second candidate filter according to the second candidate reference area; Predicting the current block template according to the coefficient of the second candidate filter to obtain a predicted value of the current block template; Performing cost calculation according to the predicted value and the reconstructed value of the current block template to obtain a first cost parameter; The first filtering model candidate list is reordered according to the first cost parameter to obtain the target filtering model candidate list.

11. The method according to claim 10, wherein: The step of predicting the current block template according to the coefficient of the second candidate filter to obtain a predicted value of the current block template includes: Determining a prediction value of a first template sample in a current block template according to coefficients of the second candidate filter and a reconstructed value of a reference sample in the second candidate reference area; Determine a predicted value of a second template sample in the current block template according to the coefficient of the second candidate filter, the reconstructed value of the reference sample in the second candidate reference area, and the predicted value of the predicted template sample; The predicted template samples include the first template samples and / or the second template samples.

12. The method according to claim 10, wherein: The predicting the current block template according to the coefficients of the second candidate filter to obtain the predicted value of the current block template includes: obtaining the predicted value of the current block template according to the coefficients of the second candidate filter and the reconstructed values ​​of the reference samples in the second candidate reference area.

13. The method according to claim 9, wherein: The method further comprises: Decoding the code stream and determining reordering indication information; When it is determined according to the reordering indication information that the current block uses template matching to reorder the filter model candidate list, reorder the first filter model candidate list based on template matching to obtain the target filter model candidate list; When it is determined according to the reordering indication information that the current block does not use the template matching technology to reorder the filtering model candidate list, the first filtering model candidate list is used as the target filtering model candidate list.

14. The method according to claim 13, wherein: The reordering indication information includes a first syntax element and a second syntax element; wherein the first syntax element is used to indicate whether the current block is allowed to use the template matching technology; The second syntax element is used to indicate whether the current block uses template matching to reorder the filter model candidate list; The decoding of the code stream and determining the reordering indication information include: Decoding the bitstream to determine a value of the first syntax element; The value of the first syntax element is a first value, decoding the bitstream, and determining the value of the second syntax element; The value of the second syntax element is a first value, and it is determined that the current block uses template matching to reorder the filter model candidate list; The value of the first syntax element is the second value, or the value of the second syntax element is the second value, and it is determined that the current block does not use the template matching technology to reorder the filter model candidate list.

15. The method according to claim 14, wherein: The first syntax element comprises at least one of the following: syntax elements at a sequence level, a picture level, a slice level, and a coding tree unit level; The second syntax element includes at least one of the following: syntax elements at a sequence level, a picture level, a slice level, and a coding tree unit level.

16. The method according to claim 1, wherein: The method further comprises: Decoding the bitstream to determine the index value of the target filtering model; The step of determining the target filtering model of the current block according to the target filtering model candidate list includes: The target filtering model of the current block is determined according to the index value of the target filtering model and the target filtering model candidate list.

17. The method according to claim 16, wherein: The decoding bitstream determines the index value of the target filtering model, including: Decoding the bitstream to determine N binary symbols for indicating the index value of the target filtering model; wherein N is an integer; An index value of the target filtering model is determined according to the N binary symbols.

18. The method according to claim 1, wherein: Determining the target filtering model of the current block according to the target filtering model candidate list includes: obtaining the first filtering model in the target filtering model candidate list as the target filtering model.

19. The method according to any one of claims 1 to 18, wherein: The method comprises: Determine at least one sub-reference region included in the current reference region; wherein the current reference region is the target reference region, the first candidate reference region, or the second candidate reference region; Obtaining an autocorrelation coefficient matrix and a mutual correlation coefficient vector of each of the at least one sub-reference regions; The coefficients of the current filter are determined according to the autocorrelation coefficient matrix and the cross-correlation coefficient vector of each of the at least one sub-reference regions.

20. The method according to claim 19, wherein: The method further comprises: Determine a plurality of sub-reference regions of the current block, wherein the plurality of sub-reference regions do not overlap with each other; Determine, according to the multiple sub-reference regions and the candidate filters, an autocorrelation coefficient matrix and a cross-correlation coefficient vector of each of the multiple sub-reference regions; storing the autocorrelation coefficient matrices and the mutual correlation coefficient vectors of the plurality of sub-reference regions in a preset buffer area; The obtaining of the autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference regions comprises: The autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference regions are obtained from the preset buffer area.

21. The method according to claim 1, wherein: The intra-frame prediction of the current block is performed according to the coefficient of the target filter to determine the prediction value of the current block, including: Determine a reconstruction value of a reference sample of a pixel to be predicted in the current block in the target reference area; The predicted value of the predicted pixel in the current block is determined according to the coefficient of the target filter and the reconstructed value of the reference sample.

22. The method according to claim 1, wherein: The target prediction mode includes an interpolation filtering mode.

23. A coding method, applied to an encoder, the method comprising: Determine multiple candidate filter models for the current block; Sorting the multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters; Determine a target filter model of the current block according to the target filter model candidate list; wherein the target filter model includes a target reference area and a target filter; Determining coefficients of the target filter according to the target reference area; Performing intra-frame prediction on the current block according to the coefficient of the target filter to determine a prediction value of the current block; Make an encoding decision based on the predicted value and original value of the current block, determine whether the current block uses the target prediction mode, and encode the prediction mode indication information.

24. The method according to claim 23, wherein: The determining of multiple candidate filter models for the current block comprises: Determine at least one candidate reference region for the current block, and determine at least one candidate filter for the current block; A plurality of candidate filter models for the current block are determined according to the at least one candidate reference region and the at least one candidate filter.

25. The method according to claim 24, wherein: The determining of at least one candidate reference region of the current block includes: The at least one candidate reference region is determined by combining at least one sub-reference region reconstructed according to the current block; wherein the at least one sub-reference region includes at least one of the following: an upper adjacent region, a left adjacent region and an upper-left adjacent region of the current block.

26. The method according to claim 25, wherein: The combining at least one sub-reference region reconstructed according to the current block to determine the at least one candidate reference region includes: Determine a first candidate reference region according to the reconstructed upper adjacent region and the left adjacent region of the current block; Determine a second candidate reference region according to the reconstructed upper adjacent region and the upper left adjacent region of the current block; Determine a third candidate reference region according to the reconstructed left adjacent region and the upper left adjacent region of the current block; A fourth candidate reference region is determined according to the reconstructed upper adjacent region, the left adjacent region and the upper-left adjacent region of the current block.

27. The method according to any one of claims 23 to 26, wherein: The method further comprises: Determining a size parameter of the candidate reference area according to a size parameter of the current block and a size parameter of the candidate filter; The size parameters include height and / or width.

28. The method according to claim 27, wherein: The determining the size parameter of the candidate reference area according to the size parameter of the current block and the size parameter of the candidate filter comprises: Determine the minimum parameter from the height and width of the current block; Determine the heights of the upper sub-reference region and the upper left sub-reference region of the candidate reference region according to the minimum parameter and the difference of the height of the candidate filter minus one; The widths of the left sub-reference region and the upper left sub-reference region of the candidate reference region are determined according to the minimum parameter and a difference of the width of the candidate filter minus one.

29. The method according to any one of claims 23 to 28, wherein: The step of sorting the plurality of candidate filter models to determine a target filter model candidate list for the current block includes: Determine a first candidate reference region and a first candidate filter of a first candidate filtering model among the multiple candidate filtering models; Using reference samples in the first candidate reference area as input samples of the first candidate filter, and determining the number of samples in the first candidate reference area as output samples of the first candidate filter; Sort the first candidate filter models according to the number of samples in the first candidate reference area to obtain a first filter model candidate list; According to the first filtering model candidate list, the target filtering model candidate list is obtained.

30. The method of claim 29, wherein: The step of sorting the plurality of candidate filter models to determine a target filter model candidate list for the current block further includes: Determining coefficients of the first candidate filter according to the first candidate reference area; In the process of sorting the first candidate filter models according to the number of samples in the first candidate reference area, first candidate filter models having repeated coefficients of the first candidate filter are deleted to obtain the first filter model candidate list.

31. The method according to claim 29 or 30, wherein: The step of obtaining the target filtering model candidate list according to the first filtering model candidate list includes: The first filtering model candidate list is reordered based on template matching to obtain the target filtering model candidate list.

32. The method according to claim 31, wherein: The reordering of the first filter model candidate list based on template matching to obtain the target filter model candidate list includes: Determine a second candidate reference region and a second candidate filter of a second candidate filtering model in the first filtering model candidate list; Determining coefficients of the second candidate filter according to the second candidate reference area; Predicting the current block template according to the coefficient of the second candidate filter to obtain a predicted value of the current block template; Performing cost calculation according to the predicted value and the reconstructed value of the current block template to obtain a first cost parameter; The first filtering model candidate list is reordered according to the first cost parameter to obtain the target filtering model candidate list.

33. The method of claim 32, wherein: The step of predicting the current block template according to the coefficient of the second candidate filter to obtain a predicted value of the current block template includes: Determining a prediction value of a first template sample in a current block template according to coefficients of the second candidate filter and a reconstructed value of a reference sample in the second candidate reference area; Determine a predicted value of a second template sample in the current block template according to the coefficient of the second candidate filter, the reconstructed value of the reference sample in the second candidate reference area, and the predicted value of the predicted template sample; The predicted template samples include the first template samples and / or the second template samples.

34. The method of claim 32, wherein: The predicting the current block template according to the coefficients of the second candidate filter to obtain the predicted value of the current block template includes: obtaining the predicted value of the current block template according to the coefficients of the second candidate filter and the reconstructed values ​​of the reference samples in the second candidate reference area.

35. The method of claim 31, wherein: The method further comprises: Determining reordering instruction information; When it is determined according to the reordering indication information that the current block uses template matching to reorder the filter model candidate list, reorder the first filter model candidate list based on template matching to obtain the target filter model candidate list; When it is determined according to the reordering indication information that the current block does not use the template matching technology to reorder the filter model candidate list, using the first filter model candidate list as the target filter model candidate list; The reordering indication information is encoded.

36. The method of claim 35, wherein: The reordering indication information includes a first syntax element and a second syntax element; wherein the first syntax element is used to indicate whether the current block is allowed to use the template matching technology; The second syntax element is used to indicate whether the current block allows template matching to be used to reorder the filter model candidate list; The determining of the reordering indication information includes: The value of the first syntax element is a first value, and the value of the second syntax element is determined; The value of the second syntax element is a first value, and it is determined that the current block uses template matching to reorder the filter model candidate list; The value of the first syntax element is the second value, or the value of the second syntax element is the second value, and it is determined that the current block does not use the template matching technology to reorder the filter model candidate list.

37. The method of claim 36, wherein: The first syntax element comprises at least one of the following: syntax elements at a sequence level, a picture level, a slice level, and a coding tree unit level; The second syntax element includes at least one of the following: syntax elements at a sequence level, a picture level, a slice level, and a coding tree unit level.

38. The method of claim 23, wherein: Determining the target filter model of the current block according to the target filter model candidate list includes: sequentially acquiring the first M candidate filter models in the target filter model candidate list as the target filter model; wherein M is a positive integer; The method further comprises: The decision result indicates that the current block uses the target prediction mode, and determines the index value of the best filtering model corresponding to the target prediction mode; The index value of the optimal filtering model is encoded, and the obtained encoded bits are written into a bitstream.

39. The method of claim 38, wherein: The step of encoding the index value of the target filter model and writing the obtained coded bits into a bitstream comprises: Determine N binary symbols for indicating the index value of the target filtering model; wherein N is an integer; The N binary symbols are encoded, and the obtained encoded bits are written into a bit stream.

40. The method of claim 23, wherein: Determining the target filtering model of the current block according to the target filtering model candidate list includes: obtaining the first filtering model in the target filtering model candidate list as the target filtering model.

41. A method according to any one of claims 23 to 40, wherein: The method comprises: Determine at least one sub-reference region included in the current reference region; wherein the current reference region is the target reference region, the first candidate reference region, or the second candidate reference region; Obtaining an autocorrelation coefficient matrix and a mutual correlation coefficient vector of each of the at least one sub-reference regions; The coefficients of the current filter are determined according to the autocorrelation coefficient matrix and the cross-correlation coefficient vector of each of the at least one sub-reference regions.

42. The method according to claim 41, wherein: The method further comprises: Determine a plurality of sub-reference regions of the current block, wherein the plurality of sub-reference regions do not overlap with each other; Determine, according to the multiple sub-reference regions and the candidate filters, an autocorrelation coefficient matrix and a cross-correlation coefficient vector of each of the multiple sub-reference regions; storing the autocorrelation coefficient matrices and the mutual correlation coefficient vectors of the plurality of sub-reference regions in a preset buffer area; The obtaining of the autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference regions comprises: The autocorrelation coefficient matrix and the mutual correlation coefficient vector of each of the at least one sub-reference regions are obtained from the preset buffer area.

43. The method of claim 23, wherein: The intra-frame prediction of the current block is performed according to the coefficient of the target filter to determine the prediction value of the current block, including: Determine a reconstruction value of a reference sample of a pixel to be predicted in the current block in the target reference area; The predicted value of the predicted pixel in the current block is determined according to the coefficient of the target filter and the reconstructed value of the reference sample.

44. The method of claim 23, wherein: The target prediction mode includes an interpolation filtering mode.

45. A code stream, the code stream is generated by bit encoding according to information to be encoded; wherein, The information to be encoded includes at least one of the following: an index value of a target filtering model of a current block, a residual value of the current block, prediction mode indication information, and reordering indication information of the current block; wherein the prediction mode indication information is used to indicate whether the current block uses a target prediction mode, and the reordering indication information is used to indicate whether the current block uses template matching to reorder a filtering model candidate list.

46. ​​An encoder, comprising a first determining unit, a first predicting unit, and an encoding unit, wherein: The first determining unit is configured to determine a plurality of candidate filtering models for the current block; The first determination unit is configured to sort the multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters; The first determination unit is configured to determine a target filtering model of the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter; The first determination unit is configured to determine the coefficient of the target filter according to the target reference area; The first prediction unit is configured to perform intra-frame prediction on the current block according to the coefficient of the target filter to determine a prediction value of the current block; The encoding unit is configured to make an encoding decision based on the predicted value and the original value of the current block, determine whether the current block uses the target prediction mode, and encode the prediction mode indication information.

47. An encoder, comprising a first memory and a first processor, wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 23 to 44 when running the computer program.

48. A decoder, comprising a decoding unit, a second determining unit and a second predicting unit, wherein: The decoding unit is configured to decode the bit stream and determine the target prediction mode used by the current block; The second determining unit is configured to determine a plurality of candidate filtering models for the current block; The second determination unit is configured to sort the multiple candidate filter models to determine a target filter model candidate list for the current block; wherein the candidate filter models include candidate reference regions and candidate filters; The second determination unit is configured to determine a target filtering model of the current block according to the target filtering model candidate list; wherein the target filtering model includes a target reference area and a target filter; The second determination unit is configured to determine the coefficient of the target filter according to the target reference area; The second prediction unit is configured to perform intra-frame prediction on the current block according to the coefficients of the target filter to determine a prediction value of the current block.

49. A decoder, comprising a second memory and a second processor, wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 22 when running the computer program.

50. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 22 is implemented, or the method according to any one of claims 23 to 44 is implemented.