Coding and decoding method and device, codec, code stream and storage medium

CN121909646APending Publication Date: 2026-04-21GUANGDONG 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
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2023-09-23
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The interpolation-based intra prediction technology in the existing video encoding and codec standards has problems with low performance, resulting in low encoding and codec efficiency.

Method used

By generating a candidate list, the interpolation filtering model to be used in the current block is determined for intra prediction, reducing additional computing overhead and improving decoding efficiency.

Benefits of technology

It improves the prediction accuracy of the current block, saves codeword overhead and calculation time, and improves code rate and decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121909646A_ABST
    Figure CN121909646A_ABST
Patent Text Reader

Abstract

The invention discloses a coding and decoding method and device, a codec, a code stream and a storage medium, and the decoding method comprises the steps: generating a first candidate list according to a first interpolation filtering model used by a decoded block during decoding; determining a second interpolation filtering model to be used by the current block according to the first candidate list; performing intra-frame prediction on the current block by using a second interpolation filtering model to obtain a prediction block of the current block; and reconstructing the code stream according to the prediction block to obtain a reconstructed block of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method and device, codec, code stream, and storage medium Technical Field

[0001] The embodiments of the present application relate to video technology, including but not limited to coding and decoding methods and devices, codecs, bit streams, and storage media. 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 codec standards involving video compression have been introduced.

[0003] Currently, video codec standards have proposed intra-frame prediction techniques based on interpolation. Specifically, this technique uses the reconstructed pixel values ​​around the current block to obtain the filter coefficients of an interpolation filter model, 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 encoding and decoding method and apparatus, codec, bitstream, and storage medium provided in the embodiments of the present application are implemented as follows:

[0006] According to one aspect of an embodiment of the present application, a decoding method is provided, which is applied to a decoder and includes: generating a first candidate list based on a first interpolation filter model used when decoding a decoded block; determining a second interpolation filter model to be used for the current block based on the first candidate list; performing intra-frame prediction on the current block using the second interpolation filter model to obtain a predicted block of the current block; and reconstructing a bitstream based on the predicted block to obtain a reconstructed block of the current block. In this way, for the current block, since the decoder does not need to additionally calculate the filter coefficients of the interpolation filter model to be used for the current block, computational overhead and time overhead are saved, thereby benefiting in improving decoding efficiency.

[0007] According to one aspect of an embodiment of the present application, a coding method is provided. The method is applied to an encoder and includes: generating a first candidate list based on a first interpolation filter model used when decoding a decoded block; determining a second interpolation filter model to be used for the current block based on the first candidate list; performing intra-frame prediction on the current block using the second interpolation filter model to obtain a prediction block for the current block; determining a residual block for the current block based on the prediction block; and generating a bitstream based on the residual block.

[0008] In this way, on the one hand, the diversity of the candidate interpolation filter models of the current block (i.e., the models in the first candidate list) is increased, which is beneficial to improving the prediction accuracy of the current block, and thus beneficial to saving codeword overhead; on the other hand, for the current block, since there is no need to additionally calculate the filter coefficients of multiple combinations of interpolation filter models and determine which shape of interpolation filter model to use, the computational overhead and time overhead are saved, which is beneficial to improving the bit rate.

[0009] According to one aspect of an embodiment of the present application, a decoding device is provided, which is applied to a decoder, and the device includes: a first generation module, configured to generate a first candidate list based on a first interpolation filter model used when decoding a decoded block; a first determination module, configured to determine a second interpolation filter model to be used for the current block based on the first candidate list; a first prediction module, configured to use the second interpolation filter model to perform intra-frame prediction on the current block to obtain a prediction block of the current block; and a reconstruction module, configured to reconstruct a code stream based on the prediction block to obtain a reconstructed block of the current block.

[0010] According to one aspect of an embodiment of the present application, a decoder is provided, 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; and the first processor is used to execute the decoding method described in the embodiment of the present application when running the computer program.

[0011] According to one aspect of an embodiment of the present application, there is provided an encoding device, applied to an encoder, the device comprising: a second generation module, configured to generate a first candidate list based on a first interpolation filter model used when decoding a decoded block; a second determination module, configured to determine a second interpolation filter model to be used for the current block based on the first candidate list; a second prediction module, configured to use the second interpolation filter model to perform intra-frame prediction on the current block to obtain a prediction block of the current block; a third determination module, configured to determine a residual block of the current block based on the prediction block; and a third generation module, configured to generate a code stream based on the residual block.

[0012] According to one aspect of an embodiment of the present application, an encoder is provided, 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; and the second processor is used to execute the encoding method described in the embodiment of the present application when running the computer program.

[0013] According to one aspect of an embodiment of the present application, a code stream is provided. The code stream is generated by performing the encoding method described in the embodiment of the present application on a current block.

[0014] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor adapted to execute a computer program; and a computer-readable storage medium storing a computer program, wherein when the computer program is executed by the processor, the encoding method described in the embodiment of the present application is implemented, or when the computer program is executed by the processor, the decoding method described in the embodiment of the present application is implemented.

[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the encoding method described in the embodiment of the present application, or implements the decoding method described in the embodiment of the present application.

[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings herein are incorporated into and constitute a part of this specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, serve to illustrate the technical solutions of the present application. Obviously, the drawings described below are merely some embodiments of the present application. Those skilled in the art can, without inventive effort, derive other drawings from these drawings.

[0018] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0019] Figure 1 is a schematic diagram of the basic process of the encoder;

[0020] Figure 2 is a schematic diagram of the basic flow of the decoder;

[0021] FIG3 is a schematic diagram of a network structure of a coding and decoding system provided in an embodiment of the present application;

[0022] FIG4 is a schematic diagram of the shapes of three interpolation filter models;

[0023] FIG5 is a schematic diagram of the combination of three interpolation filter models and the reconstruction area used to determine the filter coefficients;

[0024] FIG6 is a schematic diagram of an interpolation filter model performing prediction in a diagonal direction;

[0025] FIG7 is a schematic diagram of an intra-frame prediction mode;

[0026] FIG8 is a schematic diagram of sliding a 3×3 window in the current block;

[0027] FIG9 is a schematic diagram of the accumulated amplitude values ​​in each angular direction;

[0028] FIG10 is a schematic diagram of a linear term of a 15-tap interpolation filter model;

[0029] FIG11 is a schematic diagram of adding a 3-tap nonlinear term to the 15-tap linear term of the interpolation filter model;

[0030] FIG12 is a second schematic diagram of adding a 3-tap nonlinear term to the 15-tap linear term of the interpolation filter model;

[0031] FIG13 is a schematic diagram showing an interpolation filter model with 15 taps of linear terms and an additional 5 taps of nonlinear terms;

[0032] FIG14 is a schematic diagram of a narrow and long prediction block / current block;

[0033] FIG15 is a first schematic diagram showing the position of a reconstruction area for obtaining filter coefficients of an interpolation filter model relative to a current block;

[0034] FIG16 is a second schematic diagram showing the position of the reconstruction area for obtaining the filter coefficients of the interpolation filter model relative to the current block;

[0035] FIG17 is a combined schematic diagram of the shape of the interpolation filter model and the reconstruction area for obtaining the filter coefficients of the interpolation filter model;

[0036] FIG18 is a second schematic diagram showing a combination of the shape of an interpolation filter model and a reconstruction region for obtaining filter coefficients of the interpolation filter model;

[0037] FIG19 is a third schematic diagram showing a combination of the shape of an interpolation filter model and a reconstruction region for obtaining filter coefficients of the interpolation filter model;

[0038] FIG20 is a schematic diagram of an implementation flow of the encoding method provided in an embodiment of the present application;

[0039] FIG21 is a schematic diagram of an implementation flow of a decoding method provided in an embodiment of the present application;

[0040] FIG22 is a schematic diagram illustrating a definition of a position of a current block in a current image according to an embodiment of the present application;

[0041] FIG23 is a schematic diagram of five predefined adjacent positions of a current block provided in an embodiment of the present application;

[0042] FIG24 is a schematic diagram of 59 non-adjacent positions of the first round of the current block provided by an embodiment of the present application;

[0043] FIG25 is a schematic diagram of 28 non-adjacent positions of the second round of the current block provided by an embodiment of the present application;

[0044] FIG26 is a schematic diagram of an initialized historical interpolation filter model table (i.e., a second candidate list) of length N4 provided in an embodiment of the present application;

[0045] FIG27 is a schematic diagram of adding interpolation filter models into a historical interpolation filter model table according to a decoding order according to an embodiment of the present application;

[0046] FIG28 is a schematic diagram of updating a historical interpolation filter model table according to a first-in-first-out principle according to an embodiment of the present application;

[0047] FIG29 is a schematic diagram of the positions of the interpolation filter models obtained from the 10 reference images 0 to 9 provided in an embodiment of the present application;

[0048] FIG30 is a schematic diagram of a template area required for reordering models according to an embodiment of the present application;

[0049] FIG31 is a schematic diagram of generating predicted values ​​on a template using an interpolation filter model in a diagonal direction according to an embodiment of the present application;

[0050] FIG32 is a schematic diagram of the structure of a decoding device provided in an embodiment of the present application;

[0051] FIG33 is a schematic structural diagram of an encoding device 33 provided in an embodiment of the present application;

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

[0053] Figure 35 is a schematic diagram of the structure of the encoder provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not intended to limit the scope of the present application.

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

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

[0057] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are intended to distinguish similar or different 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.

[0058] In the following description, "pixel" can also be understood as "pixel unit", "pixel point" or "sample", etc., which refers to the smallest unit representing image information. However, "sample" can refer to certain pixels / sampled pixels in a pixel set.

[0059] It should be noted that in the following description, “interpolation filter model” may also be described as “filter model” or “interpolation filter” or “model” or the like.

[0060] It should be pointed out that in the following description, the "merged interpolation filter model candidate list" can also be described as the "merged interpolation filter model list" or "interpolation filter model merged list" or "merged list" or "candidate list" or "merged candidate list" or "merged interpolation filter list" or "first candidate list" or the like.

[0061] It should be noted that in the following description, the “historical interpolation filtering model table” may also be described as a “historical model table” or a “historical interpolation model table” or a “historical list” or a “second candidate list” or the like.

[0062] It should be noted that in the following description, the "merged interpolation filtering mode identifier" may also be described as a "merged mode identifier" or a "second syntax identifier information" or the like.

[0063] It should be noted that in the following description, the “interpolation filtering prediction mode” may also be described as the “merged interpolation filtering mode” or the “merged mode”, etc.

[0064] The encoder and decoder frameworks and business scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. It will be appreciated by those skilled in the art that with the evolution of encoders and decoders and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0065] 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:

[0066] Joint Video Exploration Team (JVET);

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

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

[0069] Enhanced Compression Mode (ECM);

[0070] Extrapolation Intra Prediction (EIP)

[0071] Multiple Transform Selection (MTS);

[0072] Discrete Cosine Transform (DCT);

[0073] Discrete Sine Transform (DST);

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

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

[0076] Direct Current (DC) mode;

[0077] Planar mode (PLANAR);

[0078] Direct Mode (DM);

[0079] Intra Block Copy (IBC);

[0080] Wide Angle Intra Prediction (WAIP);

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

[0082] Mean Squared Error (MSE);

[0083] Sum of Absolute Difference (SAD).

[0084] Most video coding standards use a block-based hybrid coding framework. Each image, sub-image, or frame in a video is divided into square Largest Coding Units (LCUs) or Coding Tree Units (CTUs) of the same size (e.g., 128x128 or 64x64). Each LCU or CTU can be divided into rectangular Coding Units (CUs) according to a rule. Coding Units may also be divided into Prediction Units (PUs) and / or Transform Units (TUs). The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module includes intra-frame prediction and inter-frame prediction. Inter-frame prediction includes motion estimation and motion compensation. Because there is a strong correlation between adjacent pixels in a video frame, intra-frame prediction is used in video coding and decoding technology to eliminate spatial redundancy between adjacent pixels. Since there is a strong similarity between adjacent frames in a video, the inter-frame prediction method is used in video coding and decoding technology to eliminate the temporal redundancy between adjacent frames, thereby improving coding and decoding efficiency.

[0085] The basic process of a video codec is shown in Figure 1. At the encoder, as shown in Figure 1, a frame of image 101 is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The prediction block is subtracted from the original block of the current block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​entropy encoded and output as a bitstream. At the decoder (not shown), intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The bitstream is then parsed to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​inversely quantized and inversely transformed to obtain a residual block. The prediction block and the residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain a decoded image. The encoder also performs similar operations as the decoder to obtain a decoded image. The decoded image can be used as a reference image for inter-frame prediction in subsequent frames. Block division information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information determined by the encoder, if necessary, must be included in the output bitstream. At the decoder, as shown in Figure 2, parsing and analyzing existing information determines the same block division information as at the encoder, as well as prediction, transform, quantization, entropy coding, and loop filtering mode or parameter information. This ensures that the decoded image obtained by the encoder and the decoder are identical. The decoded image obtained by the encoder is often called the reconstructed image. During prediction, the current block can be divided into prediction units, and during transform, the current block can be divided into transform units. The division of prediction units and transform units can be different.

[0086] The above is the basic process of the video codec under the block-based hybrid coding framework. As technology develops, some modules or steps of the framework or process may be optimized. The encoding and decoding method provided in the embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to this framework and process. It is known to those skilled in the art that with the evolution of encoders and decoders and the emergence of new business scenarios, the method provided in the embodiment of the present application is also applicable to similar technical problems.

[0087] The current block may be a current coding unit (CU) or a current prediction unit (PU), etc.

[0088] Furthermore, an embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein FIG3 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 FIG3 , the network architecture includes one or more electronic devices 13 to 1N1 and a communication network 01, wherein the electronic devices 13 to 1N1 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.

[0089] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction and / or inter-frame prediction module shown in Figure 1 and the intra-frame prediction and / or inter-frame prediction module shown in Figure 2. The embodiment of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.

[0090] It should also be noted that, when applied to the intra-frame prediction and / or inter-frame prediction module of the encoding end, the "current block" specifically refers to the encoding block currently to be subjected to intra-frame prediction and / or inter-frame prediction; when applied to the intra-frame prediction and / or inter-frame prediction module of the decoding end, the "current block" specifically refers to the decoding block currently to be subjected to intra-frame prediction and / or inter-frame prediction.

[0091] In order to facilitate the understanding of the encoding and decoding method provided in the embodiments of the present application, some relevant terms and related implementation methods are first explained in Sections 1 and 2 below.

[0092] 1. Related instructions

[0093] 1.1. Some characteristics of intra-frame prediction technology based on interpolation filtering

[0094] Intra-frame prediction technology based on interpolation filtering refers to a technology that obtains the filter coefficients of an interpolation filter model through the reconstructed pixel values ​​around the current block, and uses the filter coefficients of the interpolation filter model to perform intra-frame prediction on the current block. Intra-frame prediction technology based on interpolation filtering may include one or more of the following features:

[0095] 1. The number of taps of the interpolation filter model should be greater than or equal to 2. The interpolation filter model can have multiple shapes, and the syntax elements are used to control the shape of the selected interpolation filter model.

[0096] 2. The reconstructed pixels used to obtain the filter coefficients of the interpolation filter model should be within one or several regions around the current block, and the regions used to obtain the filter coefficients of the interpolation filter model are selected using syntax elements.

[0097] 1.2. Specific Examples of Intra-frame Prediction Technology Based on Interpolation Filtering

[0098] 1.2.1. Obtaining the filter coefficients of the interpolation filter model

[0099] The implementation scheme defines three 15-tap interpolation filter models and three reconstruction areas, as shown in Figure 4, where the interpolation filter model 401 is 4x4 (filterHeight x filterWidth), the interpolation filter model 402 is 2x8, and the interpolation filter model 403 is 8x2. As shown in Figure 4, in the interpolation filter model represents the input position of the interpolation filter model, and □ represents the output position of the interpolation filter model.

[0100] Based on the shape of the interpolation filter model given in FIG4 , as shown in FIG5 , an example of a reconstruction area for determining the filter coefficients of the interpolation filter model is given. As shown in FIG5 , the reconstruction area includes an L-shaped reconstruction area (including reconstructed pixels in the upper left, left, lower left, upper and / or upper right), an upper reconstruction area (including reconstructed pixels in the upper left, upper and / or upper right), and / or a left reconstruction area (including reconstructed pixels in the upper left, left and / or lower left). In the figure, N2 is a variable. In the specific implementation process, it is a predefined value related to the current block size.

[0101] The three interpolation filter models in Figure 4 can be slid across the defined L-shaped reconstruction area, the upper reconstruction area, and the left reconstruction area to obtain the nine combinations shown in Figure 5. Each combination yields a set of filter coefficients for the interpolation filter model. The process for solving the filter coefficients for each set of interpolation filter models is as follows: sliding the selected interpolation filter model across the selected area to construct a set of autocorrelation coefficient matrices and a set of cross-correlation coefficient vectors. Using the autocorrelation coefficient matrix and cross-correlation coefficient vectors, a linear system is constructed to further solve the filter coefficients for the interpolation filter model.

[0102] 1.2.2. Predicting the current block

[0103] In the embodiment, the prediction process starts from the upper left corner of the current block and predicts toward the lower left corner in a certain order. The prediction formula is as follows:

[0104] Among them, pred r is the prediction result of position r in the prediction block, Represents the nth input of the interpolation filter model. When When it is located in the reconstruction area, the reconstructed value is used as the input of the interpolation filter model; when it is located in the prediction block, the predicted value is used as the input; c n is the filter coefficient of the nth interpolation filter model of the interpolation filter model, where n is greater than 0 and less than or equal to the total number of inputs of the interpolation filter model. Generally speaking, n in Cn should start from 0, for example, 0 to 14 (if the total number of inputs of the interpolation filter model is 15).

[0105] As shown in FIG6 , the interpolation filter model 401 performs prediction along the diagonal direction. From an implementation point of view, the predicted points on the same diagonal line can be predicted in parallel. Here, ■ represents the output position of the interpolation filter model 401 , and □ represents the input position of the interpolation filter model 401 .

[0106] 1.2.3 Classification of Prediction Blocks and Selection of Transform Kernels

[0107] Different angular prediction modes are suitable for using different transforms, including primary transform MTS, NSPT and secondary transform LFNST.

[0108] MTS includes several 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.

[0109] For traditional prediction modes (such as PLANAR, DC and angle modes), 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.

[0110] In the reference software ECM, traditional intra prediction modes include:

[0111] ●PLANAR mode: intra prediction mode index is 0;

[0112] ●DC mode: intra prediction mode index is 1;

[0113] ●Angle mode: The intra prediction mode index is 2 to 66, as shown in FIG7 .

[0114] The arrows in Figure 7 point to the directions of the angle mode predictions in VVC. The 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 with wide angles (-1 to -14 and 67 to 80 in Figure 7).

[0115] In the reference software of ECM, NSPT and LFNST divide the traditional mode into 35 groups, each with 3 selectable transformation kernels. The following table shows the correspondence between the traditional mode and the transformation kernel group:

[0116] The basic transforms are also divided into multiple groups according to different traditional intra-frame prediction modes, and the transform kernel of the corresponding group is selected according to the traditional mode.

[0117] The implementation scheme proposes a method for matching an interpolation filter prediction block to a traditional prediction mode. This method then uses the matched traditional prediction mode to match the interpolation filter prediction block to a preset MTS, NSPT, LFNST, or other different transform kernels for primary (separable or non-separable) or secondary (separable or non-separable) transforms. Specifically, the prediction block based on the interpolation filter technique is matched to a planar mode or a mode with angles 2 to 66 using the prediction value on the prediction block.

[0118] In the first step, as shown in FIG8 , a sliding 3x3 window 801 is used to calculate the horizontal and vertical gradient values ​​of each 3x3 window in the interpolation filter prediction block (ie, the current block), G x and G y They are respectively composed of 3x3 horizontal gradient operators M x and the vertical gradient operator M y The horizontal gradient operator M is obtained by multiplying the predicted value within the window position. x and the vertical gradient operator M y As shown in the following formula.

[0119] and

[0120] Assuming that the interpolation filter prediction block is a block with a width and height of (w,h), the sliding 3x3 window can calculate the G of the (w-2)*(h-2) positions in the center of the interpolation filter prediction block. x and G y .

[0121] 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 amplitude value G of the gradient corresponding to the angle at each position is calculated:

[0122] G=|G x |+|G y | and

[0123] In some embodiments, the calculation process of atan can be simplified and completed by looking up a table or some other transformations.

[0124] In the third step, the gradient amplitude G at each position is accumulated over the derived traditional angle categories to obtain a gradient amplitude histogram. Finally, the traditional angle with the largest accumulated amplitude is selected as the angle corresponding to the current block. In particular, when the amplitude values ​​derived from all traditional angles are zero, the current block will match the category predicted by the traditional planar model. For example, the amplitude histogram shown in Figure 9 shows the accumulated amplitude values ​​for each angle direction.

[0125] 1.3 Some related improvements of intra-frame prediction technology based on interpolation filtering

[0126] 1.3.1. Use Maximum and / or Minimum Values ​​to Limit Ranges

[0127] After obtaining the filter coefficients of the interpolation filter model, when performing interpolation filtering on the current block, a set of adaptive maximum and minimum values ​​can be used to limit the output range of the interpolation filter model.

[0128] For example, a set of maximum and minimum values ​​is searched for in the reconstructed area surrounding the current block. When the interpolation filter model predicts each position in the current block, the output value at each position is constrained by the maximum and minimum values. Compared to the prediction formula given in Section 1.2, the following formula shows that additional operations are required to constrain the maximum and minimum values.

[0129] Among them, min and max are the minimum and maximum values ​​respectively.

[0130] 1.3.2. Sample mean removal

[0131] When obtaining the coefficients of the interpolation filter model, the mean can be subtracted from the input and output samples of the interpolation filter model. This way, the filter coefficients of the interpolation filter model obtained can be more conducive to improving the fitting effect of the interpolation filter model. This means that when using the interpolation filter model to predict the current block, the input needs to be subtracted from the mean before being fed into the interpolation filter model, and the output needs to be added to the mean to obtain the predicted value. Compared with the prediction formula given in Section 1.2.2, as shown in the following formula, the additional steps of removing the mean and adding the mean to the output are required.

[0132] Here, m is the mean value, which can be a certain reconstructed value in the reconstructed area around the current block, or the mean value of a part of the reconstructed values.

[0133] 1.3.3. Extension of Chroma Intra Prediction Mode

[0134] The Direct Mode / Derived Mode (DM) prediction mode is a widely used and efficient intra-frame chroma prediction mode. When the chroma block is selected using the DM mode, the chroma block will obtain the mode selected by the luminance block at the corresponding position for intra-frame prediction.

[0135] The interpolation filtering technique described in Section 1.2 only applies to the prediction of luma intra blocks. A straightforward approach is to extend this mode to chroma, but this requires deriving interpolation filter parameters for chroma as well, which incurs high computational complexity. Currently, there is no interpolation filter prediction mode for chroma. When DM mode is selected for a chroma intra block, DM mode is set to PLANAR prediction mode.

[0136] As described in Section 1.2, for luminance blocks using interpolation filtering mode, a traditional prediction mode can be derived by constructing a gradient histogram. This traditional mode can be used when the chrominance mode is selected as the DM mode and the interpolation filtering mode is selected for the luminance block at the corresponding position.

[0137] 1.3.4. Selection of the base transform kernel for the prediction block in interpolation filter mode

[0138] After the current block is predicted, the encoder will calculate the residual with the original pixel value. The residual will be further transformed and quantized. At the decoder side, the coefficients parsed from the bitstream will be dequantized and inverse transformed to obtain the reconstructed residual value. The reconstructed residual value is accumulated to the predicted value to obtain the reconstructed value.

[0139] Section 1.2 introduced a method for deriving a gradient histogram from the interpolation filter prediction results and matching it to the traditional prediction mode, further selecting the non-separable transform kernel. For basic transforms other than the non-separable transform, the transform kernel selection method is the same as that for the PLANAR mode. However, the interpolation filter mode has different characteristics from the PLANAR mode, and the selection of the basic transform kernel should be more optimized.

[0140] In the ECM reference software, basic transforms are divided into horizontal and vertical directions. The following seven transform modes are allowed in each direction: {'DCT2', 'DCT8', 'DST7', 'DCT5', 'DST4', 'DST1', 'IDTR'}. Among them, DCT2, DCT8, and DCT5 are subclasses of discrete cosine transform (DCT), DST7, DST4, and DST1 are subclasses of discrete sine transform (DST), and IDTR is identity transform, indicating no transformation.

[0141] In ECM, the most commonly used base transform mode is DCT2 in both horizontal and vertical directions (written as DCT2-DCT2). It is used as a transform before the inseparable secondary transform LFNST and is also used when the Multiple Transform Selection (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, based on the characteristics of the non-zero coefficients in the current block, up to six non-DCT2-DCT2 transform kernels can be selected for the current block.

[0142] This solution proposes that for the prediction block of the interpolation filter mode, the residual MTS basic transform kernel should be related to whether the interpolation filter mode is selected for the current block. More specifically, it can be related to which sub-mode of the interpolation filter mode is selected and / or the size and shape of the current block.

[0143] This proposal presents two basic change core candidates that can be used under the current MTS design of ECM.

[0144] 1. The optional basic transform kernel of 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 shown in the following table (the transform kernel is: horizontal transform - vertical transform):

[0145] When MTS is selected and the prediction mode of the current block is the interpolation prediction mode, a corresponding transform core is selected from the six transform cores according to the parsed MTS transform index for inverse transformation.

[0146] 2. The optional basic transform kernel of 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 shape and size of the block are: height x width), as shown in the following table:

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

[0148] The method for obtaining the candidate MTS transformation kernel may be:

[0149] 1. Encode a set of images or a set of videos using an encoder that includes an interpolation filter prediction mode;

[0150] 2. The residuals of the blocks with the selected interpolation filter mode are then sorted by category (e.g., block shape and size, interpolation filter mode) to screen other possible horizontal and vertical transform kernels. The kernel selection criteria can be SAD, SSE, or other metrics such as transform coding gain.

[0151] The transform coding gain is defined as the arithmetic mean of the transform coefficient variances divided by the geometric mean of the transform coefficient variances.

[0152] 1.3.5. Nonlinear and Bias Terms in Interpolation Filtering

[0153] In the interpolation filtering described in Section 1.2, 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.

[0154] Same as Section 1.2, this implementation uses 15 linear terms for the three cases shown in Figure 10. The linear terms of the 15 taps of the interpolation filter model are Where □ 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 Figure 11. In the interpolation filter model, the 15 tap linear terms (i.e. ), an example of adding 3 taps of nonlinear terms (i.e. ), where □ is the current position to be predicted.

[0155] On this basis, three tap nonlinear terms can be added, and the reconstructed pixel positions used by the nonlinear terms are shown in FIG11 .

[0156] 15 linear terms interpolate input t i , i ranges from 0 to 14, corresponding to the 14 light gray positions around the current position to be predicted, t i It is the reconstructed value or predicted value at the light gray position (depending on whether the input required for the current position to be predicted is located in the block to be predicted or the reference pixel area).

[0157] Interpolation input p of 3 nonlinear terms i =(t i ×t i +midVal)>>bitDepth, i is the three positions of dark gray, t i is the value of the linear term, midVal and bitDepth are equal to 512 and 10 in the case of 10 bits.

[0158] With the addition of nonlinear terms, the prediction formula for the current prediction position is as follows:

[0159] Among them, p i For nonlinear input, the calculation method is as described above, a, b are the number of linear input and nonlinear input respectively, c is still the filter coefficient, c i0 is the filter coefficient corresponding to the linear input, c i1 is the filter coefficient corresponding to the nonlinear input.

[0160] When obtaining the filter coefficients of the interpolation filter model, the corresponding nonlinear term value should also be increased when constructing the autocorrelation coefficient matrix and the cross-correlation coefficient vector. When a bias term exists, the bias term value should also be further increased.

[0161] In addition to the example of adding three nonlinear terms to a 15-tap interpolation filter model described above, the example shown in Figure 12 can also be used as the nonlinear term. This example adds three nonlinear terms (the dark gray portion) to the 15-tap linear term of the interpolation filter model (the light gray portion), where the white position represents the current position to be predicted. Figure 12 is simpler to calculate than Figure 11 because different interpolation filter model shapes all use the same nonlinear term.

[0162] In addition to using 3 nonlinear terms, more nonlinear terms can also be used. For example, Figure 13 is an example of using 5 nonlinear terms. On the basis of the 15-tap linear terms (light gray part) of the interpolation filter model, an example of adding 5-tap nonlinear terms (dark gray part) is given, where the white position is the current position to be predicted.

[0163] As in the examples above, the number of nonlinear terms should be a positive integer, and different designs can be made according to performance complexity requirements.

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

[0165] 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 ).

[0166] 1.3.6. Limiting the Enablement of Modes Based on Block Shape

[0167] For a block to be predicted (i.e., the current block) with a width of 16 and a height of 4, if the left reconstructed area is used to obtain the filter coefficients of the interpolation filter model, there will be more pixels to be predicted, while the area used to obtain the filter coefficients of the interpolation filter model will have fewer pixels. A schematic diagram is shown in Figure 14.

[0168] This solution proposes that when the ratio of the width to the height of the to-be-predicted block is width x a < height, the upper reconstruction area is prohibited from being used to derive the coefficients of the interpolation filter model. When height x a < width, the left reconstruction area is prohibited from being used to derive the filter coefficients of the interpolation filter model. For example, a = 2.

[0169] When encoding and decoding the interpolation filter mode, since some interpolation filter sub-modes are restricted according to the aspect ratio, and the number of allowed interpolation filter sub-modes is different under different aspect ratios, when parsing the interpolation filter identifier, the selection of its context model should be related to the shape of the block and the aspect ratio factor.

[0170] 2. A specific implementation method

[0171] 2.1 Definition of the interpolation filter model combination

[0172] The shape of the interpolation filter model in a solution is the same as the shape described in Section 1, which is three 15-tap filter model shapes. For the convenience of description and reference later, the three filter model shapes are called EIP_FILTER_S, EIP_FILTER_H, and EIP_FILTER_V from left to right.

[0173] The reconstruction areas for obtaining the filter coefficients of the interpolation filter model with respect to the current block are shown in Figures 15 and 16, which are three reconstruction areas. For the convenience of description and reference later, the three reconstruction areas are called EIP_AL_A_L (the reconstruction area composed of the reconstruction pixels of AL: Above Left, A: Above, and L: Left), EIP_AL_A (the reconstruction area composed of the reconstruction pixels of AL: Above Left and A: Above), and EIP_AL_L (the reconstruction area composed of the reconstruction pixels of AL: Above Left and L: Left) from left to right.

[0174] According to the shape of the defined interpolation filter model and the reconstruction area for obtaining the filter coefficients of the interpolation filter model, this scheme can have a total of 3x3=9 combinations of interpolation filter model shapes and reconstruction areas for obtaining the filter coefficients of the interpolation filter model, such as the combination {EIP_AL_A_L, EIP_FILTERS}, {EIP_AL_A_L, EIP_FILTER_V} and {EIP_AL_A_L, EIP_FILTER_H} shown in Figure 17; for example, the combination {EIP_AL_A, EIP_FILTERS}, {EIP_AL_A, EIP_FILTER_V} and {EIP_AL_A, EIP_FILTER_H} shown in Figure 18; and the combination {EIP_AL_L, EIP_FILTERS}, {EIP_AL_L, EIP_FILTER_V} and {EIP_AL_L, EIP_FILTER_H} shown in Figure 19.

[0175] 2.2. Representation of the combination of syntax element encoding and decoding and interpolation filter model in related schemes

[0176] In the relevant scheme, for 4x16, 16x4, 4x32, and 32x4 blocks, two EIP combinations are allowed as shown in the following table:

[0177] Therefore, in this solution, for other blocks of 4xN3, N3x4, 8x32, and 32x8, three EIP combinations are allowed, as shown in Table 5 below:

[0178] Table 5

[0179] For 8xN3 and N3x8 blocks, five EIP combinations are allowed, as shown in the following table:

[0180] For blocks of other shapes, nine EIP combinations are allowed, as shown in the following table:

[0181] The decoding end parses the bitstream, and when parsing the syntax elements of the intra-frame coding mode of the luma coding unit, it parses whether the interpolation filter prediction mode is used. If the interpolation filter mode is used, the number of interpolation filter modes allowed for the current block is further obtained based on the size and shape of the current block. As described in Section 3 below, when the current block is 4x16, 16x4, 4x32 or 32x4, 2 interpolation filter modes are allowed. When the current block is other 4xN3, N3x4 or 8x32, 32x8 shapes, 3 interpolation filter modes are allowed. When the current block is other 8xN3 or N3x8 shapes, 5 interpolation filter modes are allowed. When the current block is 16x16, 16x32, 32x16 or 32x32, 9 interpolation filter modes are allowed. And (EIP_AL_A_L, EIP_FILTER_S) is always the first of all interpolation filter modes. A binary code (binary code, first_mode) is used to indicate whether this mode is selected. If it is not this mode, a fixed-length code is used to indicate whether it is another mode, as shown in the following table: Coding unit syntax:

[0182] numOtherModes is a variable derived from the block shape and size, which identifies how many potential combinations there are in addition to the first combination. For example, for a 4x32 block, in addition to the first combination, there is only one other combination that can be used. In this case, numOtherModes is 1. At this time, as shown in Table 8, the encoding or decoding of other_mode should be skipped; for example, for an 8x16 block, in addition to the first combination, there are 4 other combinations that can be used. In this case, numOtherModes is 4, and 2 binary codes should be encoded or parsed to represent other_mode.

[0183] other_mode is represented by fixed-length codes of different lengths according to the shape and size of the current block, as described above. When the current block is 4x16, 16x4, 4x32, or 32x4, there are only two combination modes. Therefore, if it is not the first mode, there is no need to decode other_mode to determine which mode it is.

[0184] When the current block is other 4xN3 or N3x4 or 8x32, 32x8, since there are 3 combination modes, there are 2 other modes in total, so decode a fixed-length binary code length other_mode to determine which other mode it is;

[0185] When the current block is other 8xN3 or N3x8, since there are a total of 5 combination modes, there are a total of 4 other modes, so the other_mode of the two fixed-length binary codes is decoded to determine which other mode it is.

[0186] When the current block is 16x16, 16x32, 32x16 or 32xN3, there are a total of 9 combination modes, so there are a total of 8 other modes, so the other_mode of 3 fixed-length binary codes is decoded to determine which other mode it is.

[0187] In this solution, the above binary codes, including cu_eip_flag, first_mode uses context model encoding and decoding, while other_mode uses bypass encoding.

[0188] In conjunction with the description in Section 3 below, when cu_eip_flag is true, when each interpolation filter combination mode is represented by first_mode and / or other_mode, the value and binary symbol of the identifier are shown in the following table.

[0189] In the relevant scheme, for 4x16, 16x4, 4x32 and 32x4 blocks, two EIP combinations are allowed, as shown in the following table:

[0190] For other blocks of 4xN3, N3x4, 8x32, and 32x8, three EIP combinations are allowed, as shown in the following table:

[0191] For other 8xN3 and N3x8 blocks, five EIP combinations are allowed, as shown in the following table:

[0192] For blocks of other shapes, nine EIP combinations are allowed, as shown in the following table:

[0193] By using the index corresponding to the parsed codeword, the corresponding relationship between the index and the combination can be found in the table above to determine the combination of the reconstructed area and the filter model shape.

[0194] 2.3. Forecast of related scenarios

[0195] The decoder determines the position of the current block and the parsed prediction mode. If it is an interpolation filter prediction mode, the interpolation filter combination used is obtained according to the corresponding identifier. The reconstructed area and the shape of the interpolation filter model under the combination are used to derive / calculate the filter coefficients of the interpolation filter model. The obtained interpolation filter model is used to make predictions within the current block in the diagonal direction, from the upper left to the lower right. The predicted value needs to be limited to the corresponding bit precision. For example, at 10-bit precision, the calculation method for the predicted r position is shown in the following formula.

[0196] At the current r position, the input value of the interpolation filter is p away from r. n , p n Represents the position difference between the nth input and the current output position of the 15-tap interpolation filter model. n When the position is located outside the current block (as shown in Figure 6) Use the reconstructed value as r+p of the interpolation filter model n Input at position, when r+p n When the position is within the prediction block (as shown in FIG6 ), Use the predicted value as r+p of the interpolation filter model n As shown in FIG6 , positions 1 and 2 of the interpolation filter model 401 are the two input positions of the current prediction point ■. The point at position 1 is located in the reconstruction area, so the reconstructed value is used as input. The point at position 2 is located in the current block, so the predicted value is used as input.

[0197] As described in Section 1.3.3, for a chroma current block, when the chroma block is selected to use the DM mode for prediction, and the mode of the luminance block at the corresponding position of the current block is the interpolation filter mode, a gradient histogram is derived based on the luminance prediction value at the corresponding position, and a traditional intra-frame prediction mode (angle) is analyzed based on the gradient histogram, and this mode is used to predict the chroma.

[0198] 2.4. Transformation of related schemes

[0199] As described in Section 1.2.3, a gradient histogram is derived based on the brightness prediction value, and a traditional intra-frame prediction mode (angle) is analyzed based on the gradient histogram. This angle is used to select a group of secondary transform kernels, and the corresponding transform kernel is found in this group of secondary transform kernels according to the decoded secondary transform index for inverse transform.

[0200] In the reference software, a primary transform also sets a corresponding primary transform kernel group for each traditional intra-frame prediction mode based on the angle characteristics. In this method, a gradient histogram is derived based on the brightness prediction value, and a traditional intra-frame prediction mode (angle) is analyzed based on the gradient histogram to select the primary transform group. Then, the corresponding transform kernel is found based on the decoded primary transform index for inverse transformation.

[0201] 2.5. Some variants of related schemes

[0202] Variant 1, for 4x32 and 32x4 blocks, allows two EIP combinations, as shown in the following table:

[0203] Therefore, in this solution, for other 4xN3 and N3x4 blocks, three EIP combinations are allowed, as shown in the following table:

[0204] For 8xN3 and N3x8 blocks, five EIP combinations are allowed, as shown in the following table:

[0205] For blocks of other shapes, nine EIP combinations are allowed, as shown in the following table:

[0206] Variant 2: In the original interpolation filtering scheme, blocks of sizes 4x4 to 32x32 are allowed to use the interpolation filtering technique. The interpolation filtering technique may be further restricted to blocks of size 4x4 or 4xN3, or blocks whose width is greater than twice their height and whose height is greater than twice their width.

[0207] 2.6. Problem description of related solutions

[0208] The following table shows the encoding and decoding performance of the intra-frame prediction technology using interpolation filtering described in the relevant solution on the latest ECM reference software. It can be seen that the cost-effectiveness of the relevant solution (i.e., the resulting encoding performance gain and encoding and decoding time complexity) is still not ideal. Especially for a tool with high hardware complexity, the resulting encoding and decoding performance is particularly important.

[0209] The software complexity of the interpolation filtering technology mainly comes from the fact that the encoder needs to calculate / derive the filter coefficients of the interpolation filtering model under various interpolation filtering model shapes based on multiple reconstruction areas, while the decoder needs to derive the filtering of the interpolation filtering model under a combination. The derivation process has a high computational complexity.

[0210] Based on the above analysis, the embodiment of the present application provides the following encoding and decoding method.

[0211] First, an embodiment of the present application provides an encoding method, which can be applied to the encoder shown in Figure 1. Figure 20 is a schematic diagram of the implementation flow of the encoding method provided in the embodiment of the present application. As shown in Figure 20, the method includes the following steps 2001 to 2005:

[0212] Step 2001: Generate a first candidate list based on a first interpolation filter model used when decoding a decoded block;

[0213] Step 2002: determining a second interpolation filter model to be used for the current block according to the first candidate list;

[0214] Step 2003: Use the second interpolation filter model to perform intra-frame prediction on the current block to obtain a prediction block of the current block;

[0215] Step 2004: determining a residual block of the current block according to the prediction block;

[0216] Step 2005: Generate a bitstream according to the residual block.

[0217] In an embodiment of the present application, intra-frame prediction is performed on the current block by obtaining the first interpolation filter model used in decoding the decoded block; thus, on the one hand, the diversity of the candidate interpolation filter models of the current block (i.e., the models in the first candidate list) is increased, which is beneficial to improving the prediction accuracy of the current block, and further beneficial to saving codeword overhead; on the other hand, for the current block, since there is no need to additionally calculate the filter coefficients of the various combinations of interpolation filter models as described in Section 1.2.1 and to determine which shape of interpolation filter model to use, computational overhead and time overhead are saved, which is beneficial to improving the bit rate.

[0218] The following describes further optional implementations and related terms of each of the above steps.

[0219] In step 2001, a first candidate list is generated according to a first interpolation filter model used when decoding a decoded block.

[0220] It can be understood that the generated first candidate list records one or more first interpolation filter models, that is, records the model information of one or more first interpolation filter models; wherein the model information includes the filter coefficients and shape parameters of the interpolation filter model

[0221] In some embodiments, the first interpolation filter model includes at least one of the following:

[0222] A first type of model, wherein the first type of model includes an interpolation filter model used when decoding a decoded adjacent block of the current block;

[0223] A second type of model, wherein the second type of model includes an interpolation filter model used when decoding decoded non-adjacent blocks of the current block;

[0224] A third type of model, comprising historical interpolation filter models cached in the second candidate list in decoding order; wherein the historical interpolation filter model refers to a model used when decoding a block that has been decoded before the current block;

[0225] The fourth type of model includes an interpolation filter model used when decoding a decoded block on a reference frame of the current block.

[0226] It can be understood that the generated first candidate list may record one or more of the first to fourth types of models.

[0227] In other embodiments, generating the first candidate list based on the first interpolation filtering model used when decoding the decoded block includes: determining at least one third interpolation filtering model based on the reconstructed value of the reference area of ​​the current block; and generating the first candidate list based on the first interpolation filtering model used when decoding the decoded block and the at least one third interpolation filtering model.

[0228] In one possible implementation, one or more filter coefficients of the third interpolation filter model may be derived based on one or more combinations described in Section 1.2.1 above.

[0229] In an embodiment of the present application, in order to improve the accuracy of intra-frame prediction of the current block, in some embodiments, for generating / constructing a first candidate list, when the image frame where the current block is located is an intra-frame, the encoder / decoder can fill in the first candidate list in the order of the first type of model, the second type of model, and the third type of model.

[0230] In the embodiment of the present application, in order to improve the accuracy of intra-frame prediction of the current block, in other embodiments, when the image frame where the current block is located is an inter-frame, the first candidate list is filled in the order of the first type of model, the first sub-type model in the fourth type of model, the second type of model, the second sub-type model in the fourth type of model, and the third type of model; wherein,

[0231] The first subclass model includes an interpolation filter model used when decoding a decoded block at a first predefined position to the right, below, and / or to the lower right of a corresponding position of the current block on the reference frame;

[0232] The second subclass model includes an interpolation filtering model used when decoding a decoded block at a second predefined position of the current block on the reference frame, where the second predefined position is a position after the first predefined position is offset by an available motion vector of the current block.

[0233] It can be understood that the fourth type of model is a time-domain interpolation filter model. For example, the description of the first sub-category model can be found in Section 3.2 below, which describes the time-domain interpolation filter model. The description of the second sub-category model can be found in Section 3.2 below, which describes the offset time-domain interpolation filter model, and will not be repeated here.

[0234] For the first type of model, in one possible implementation, one or more neighboring blocks of the current block can be checked one by one in a certain order to see whether there is an interpolation filter model that can be added to the first candidate list. Specifically, the codec can check one by one in a certain order to see whether one or more neighboring blocks of the current block belong to blocks that have been reconstructed (i.e., decoded); if so, then continue to check whether the reconstructed block / decoded block uses an interpolation filter mode for intra-frame prediction; if so, and the interpolation filter model used for intra-frame prediction is not repeated / different from the current model in the first candidate list, then add / fill the interpolation filter model to the first candidate list.

[0235] Exemplarily, the encoder / decoder may check one by one in the order of 0 to 4 the predefined five adjacent blocks given in Section 3.2 below to see whether there is an interpolation filter model that can be added to the first candidate list.

[0236] For the second type of model, similarly, in a possible implementation, the codec can still check one by one in a certain order whether one or more non-adjacent blocks of the current block have an interpolation filter model that can be added to the first candidate list. Specifically, the codec can check one by one in a certain order whether one or more non-adjacent blocks of the current block belong to blocks that have been reconstructed (i.e., decoded); if so, continue to check whether the reconstructed block / decoded block uses an interpolation filter mode for intra-frame prediction; if so, and the interpolation filter model used for intra-frame prediction is not repeated / different from the current model in the first candidate list, then add / fill the interpolation filter model to the first candidate list.

[0237] Exemplarily, the encoder / decoder may check whether there is an interpolation filter model that can be added to the first candidate list according to the predefined 59 non-adjacent blocks and 28 non-adjacent blocks given in Section 3.2 below, in the order of the labels from small to large as shown in the figure.

[0238] It can be understood that for a first candidate list of a given length, for example, the maximum length / maximum number of models of the first candidate list is equal to the second number, after checking the first and second types of models, there may still be a situation where the first candidate list is still not filled. At this time, the third type of model can be used to fill the first candidate list.

[0239] In some embodiments, the second number is equal to a second predefined number, for example, the second number is equal to twelve.

[0240] In some embodiments, during the process of filling the first candidate list with models, if the current number of models in the first candidate list is equal to the second number, filling the first candidate list is terminated.

[0241] In some embodiments, after completing the model filling of the first candidate list, for example, after traversing the first category model to the fourth category model, or after traversing the first category model to the third category model, if the number of models in the first candidate list is less than the second number, a predefined interpolation filtering model is used to fill the number of models in the first candidate list to the second number.

[0242] Of course, in other embodiments, after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, the encoder / decoder may also continue to fill the first candidate list without using the predefined interpolation filter model.

[0243] In some embodiments, the interpolation filter models in the first candidate list are different from each other. Before populating the interpolation filter models into the first candidate list, the codec may first perform a duplication check operation, and only populate the interpolation filter model to be populated into the first candidate list if the model information of the interpolation filter model to be populated into the first candidate list is different from that of the model in the first candidate list.

[0244] Alternatively, in some other embodiments, the interpolation filter models in the first candidate list that do not belong to the second candidate list are different from each other. In the scheme mentioned below where the maximum number of models in the fourth candidate list is equal to the current number of models in the second candidate list, the interpolation filter models in the first candidate list that belong to the second candidate list are allowed to be the same, that is, the interpolation filter models that belong to the second candidate list are not checked for duplication.

[0245] In some embodiments, the codec may also limit the maximum number of each type of model in the first candidate list. The number of the first type of model in the first candidate list is less than or equal to a first threshold; and / or

[0246] The number of the second type of models in the first candidate list is less than or equal to a second threshold; and / or

[0247] The number of the third type of models in the first candidate list is less than or equal to a third threshold; and / or

[0248] The number of the fourth type of models in the first candidate list is less than or equal to a fourth threshold.

[0249] The first threshold, the second threshold, the third threshold, and the fourth threshold may be predefined as the same value or as different values. For example, in some embodiments, the first threshold>the second threshold>the third threshold>the fourth threshold.

[0250] In some embodiments, the first to fourth thresholds may be values ​​greater than 0.

[0251] In step 2002, a second interpolation filter model to be used for the current block is determined according to the first candidate list.

[0252] In some embodiments, the encoder may determine the second interpolation filter model as follows: reorder the interpolation filter models in the first candidate list in order from small to large according to the prediction errors of the interpolation filter models in the first candidate list on the template area of ​​the current block to obtain a third candidate list; and determine the second interpolation filter model to be used for the current block based on the third candidate list.

[0253] In some embodiments, the method further includes: an encoder determining a first index of the second interpolation filter model in the third candidate list; and writing the first index into a bitstream.

[0254] It can be understood that the reordering method is used to reorder the interpolation filter models in the first candidate list in order of prediction error from small to large, so that when a model in the list is selected as the second interpolation filter model of the current block, fewer codewords can be used to represent the first index of the model in the third candidate list.

[0255] In one possible implementation, determining the second interpolation filter model to be used for the current block based on the third candidate list includes: selecting the second interpolation filter model to be used for the current block based on prediction errors of the interpolation filter models in the third candidate list. For example, selecting the interpolation filter model with the smallest prediction error in the third candidate list as the second interpolation filter model.

[0256] In an embodiment of the present application, the encoder / decoder may directly use the third candidate list to determine the second interpolation filter model to be used for the current block, or may first truncate the third candidate list and then further select the second interpolation filter model from it.

[0257] Specifically, in some other embodiments, the method also includes: the encoder intercepts the first first number of interpolation filter models in the third candidate list to obtain a fourth candidate list (that is, the first number of interpolation filter models with the smallest prediction errors in the third candidate list are used as the final candidate list); and determines the second index of the second interpolation filter model in the fourth candidate list; and writes the second index into the bitstream; wherein the first number is greater than the second number.

[0258] For the third type of model, in some embodiments, the codec can use a second candidate list to record the models used when decoding blocks that were already decoded before the current block. Specifically, in one possible implementation, the codec can cache historical interpolation filter models in the second candidate list on a first-in, first-out basis, based on the encoding / decoding / reconstruction order of each block. That is, the second candidate list caches the historical interpolation filter models on a first-in, first-out basis.

[0259] In some embodiments, the codec may clear (ie, initialize) the second candidate list when starting encoding / decoding of each slice, each tile, each picture, or each coding tree unit (CTU).

[0260] For a more detailed description of the second candidate list, please refer to the description of the historical interpolation filter model in Section 3.2 below.

[0261] In an embodiment of the present application, the fourth candidate list can be a list of fixed length or a list of variable length. That is, the first number can be a fixed value equal to the first predefined number (e.g., the first number is equal to 6) or a variable value. In the case where the first number is a variable value, the codec can determine the maximum number of symbols required to identify the truncated unary code that is appropriate for the number, that is, the identifier required to indicate the index of the last model in the fourth candidate list.

[0262] For example, if the first number is equal to 2, the unary truncated codes encoding the indexes of the models in the fourth candidate list are as shown in the following table:

[0263] For another example, if the first number is equal to 3, the unary truncated codes encoding the indexes of the models in the fourth candidate list are as shown in the following table:

[0264] For details and examples of how the fourth candidate list can be of variable length, please refer to the description of Solution 4 in Section 4.4 below.

[0265] For a solution in which the first number is a variable value, in a possible implementation, the first number is equal to the current number of models in the second candidate list.

[0266] In some embodiments, the historical interpolation filter models in the second candidate list do not include the interpolation filter models in the first candidate list that were used for blocks that were decoded before the current block. In other words, the second candidate list caches interpolation filter models that do not use merge list / merge mode for intra prediction.

[0267] When reordering the interpolation filter models in the first candidate list, the encoder / decoder can determine the prediction error based on the template area of ​​the current block, that is, in some embodiments, according to the interpolation filter models in the first candidate list, the template area of ​​the current block is intra-predicted to obtain a first prediction value of the template area; and according to the first prediction value of the template area and the reconstructed value of the template area, the prediction error of the corresponding interpolation filter model is determined.

[0268] For example, in some embodiments, the encoder / decoder may determine the SAD (sum of absolute difference), SSE (sum of squares due to error), SATD (sum of absolute transformed difference), or MSE (mean-square error) between the first predicted value of the template region and the reconstructed value of the template region, thereby obtaining a prediction error of the corresponding interpolation filter model. That is, the prediction error is represented by SAD, SSE, SATD, or MSE. The smaller the SAD, SSE, SATD, or MSE, the smaller the prediction error.

[0269] An interpolation filter model is used to determine a first prediction value for a sample in the template region. Input values ​​at input positions of the interpolation filter model may all use reconstructed values ​​of samples at corresponding positions. Alternatively, when a first input position of an interpolation filter model in the first candidate list is outside the template region, the input value at the first input position is equal to the reconstructed value at the sample position corresponding to the first input position. Furthermore, when a second input position of an interpolation filter model in the first candidate list is within the template region, the input value at the second input position is equal to a second prediction value or reconstructed value at the sample position corresponding to the second input position; wherein the second prediction value is a prediction value obtained when decoding the sample corresponding to the second input position.

[0270] For relevant instructions on determining the first prediction value, please refer to the description in Section 3.2 below.

[0271] Whether the encoder / decoder needs to reorder the first candidate list can be controlled by using syntax elements. In some embodiments, the encoder can write first syntax identification information into the bitstream; when the first syntax identification information is equal to a first value, it indicates that the interpolation filter models in the first candidate list are reordered; when the first syntax identification information is equal to a second value, it indicates that the interpolation filter models in the first candidate list are not reordered. For example, the first value is equal to 1 and the second value is equal to 0.

[0272] In an embodiment in which the encoder does not reorder the first candidate list, the encoder may determine a third index of the second interpolation filter model in the first candidate list; and write the third index into the bitstream.

[0273] The codec can also use syntax elements to control whether to use the encoding / decoding method described in the embodiment of the present application to encode / decode the current block. In one possible implementation, the encoder writes the second syntax identification information into the bitstream; wherein, when the second syntax identification information is equal to the third value, it indicates that the encoding / decoding method described in the embodiment of the present application is used to determine the reconstructed block of the current block, that is, the merging mode based on the interpolation filter model is used to perform intra-frame prediction on the current block, which can also be understood as using the first candidate list to implement encoding of the current block. When the second syntax identification information is equal to the fourth value, it indicates that the merging mode based on the interpolation filter model is not used to perform intra-frame prediction on the current block. For example, the third value is equal to 1, and the fourth value is equal to 0.

[0274] In the embodiment of the present application, certain conditions may be set for whether to encode the second grammar identification information, or the second grammar identification information may be encoded by default.

[0275] Specifically, in some embodiments, the encoder writes the second syntax identification information into the codestream when determining that at least one of the following conditions is met:

[0276] a first condition, the first condition including that the number of the first type of models is greater than or equal to a fifth threshold;

[0277] a second condition, the second condition including that the number of the second type of models is greater than or equal to a sixth threshold;

[0278] A third condition, the third condition including that the number of the third type of models is greater than or equal to a seventh threshold;

[0279] The fourth condition includes that the number of the fourth type of models is greater than or equal to an eighth threshold.

[0280] In the embodiment of the present application, the fifth threshold, the sixth threshold, the seventh threshold and the eighth threshold are all values ​​greater than 0.

[0281] Without using a predefined interpolation filter model to fill the first candidate list, the number of interpolation filter models in the final fourth candidate list may be equal to 1. In this case, the encoder may not encode the first syntax identification information, and both the encoder and the decoder will use this interpolation filter model in the fourth candidate list as the second interpolation filter model to be used for the current block.

[0282] In other embodiments, when the number of interpolation filter models in the fourth candidate list is greater than 1, or when the number of interpolation filter models in the fourth candidate list is greater than 1 and the second syntax identification information is equal to the third value, the second index is written into the code stream.

[0283] Of course, in some embodiments, the encoder / decoder may also determine whether the number of interpolation filter models in the first candidate list is equal to 1; when the number of interpolation filter models in the first candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the first candidate list; when the number of interpolation filter models in the first candidate list is greater than 1, or when the number of interpolation filter models in the first candidate list is greater than 1 and the second syntax identification information is equal to the third value, the encoder writes the first index, the second index or the third index into the bitstream.

[0284] The present application provides a decoding method, which can be applied to the decoder shown in FIG2 . FIG21 is a schematic diagram of an implementation flow of the decoding method provided in the present application embodiment. As shown in FIG21 , the method includes the following steps 2101 to 2105:

[0285] Step 2101: Generate a first candidate list based on a first interpolation filter model used when decoding a decoded block;

[0286] Step 2102: determining a second interpolation filter model to be used for the current block according to the first candidate list;

[0287] Step 2103: Use the second interpolation filter model to perform intra-frame prediction on the current block to obtain a prediction block of the current block;

[0288] Step 2104: reconstruct the code stream according to the predicted block to obtain a reconstructed block of the current block.

[0289] It can be understood that in the embodiment of the present application, the decoder performs intra-frame prediction on the current block by obtaining the first interpolation filter model used by the decoded block during decoding; in this way, for the current block, since there is no need to additionally calculate the filter coefficients of the interpolation filter model to be used for the current block, computational overhead and time overhead are saved, which is beneficial to improving decoding efficiency.

[0290] In some embodiments, the first interpolation filter model includes at least one of the following:

[0291] A first type of model, wherein the first type of model includes an interpolation filter model used when decoding a decoded adjacent block of the current block;

[0292] A second type of model, wherein the second type of model includes an interpolation filter model used when decoding decoded non-adjacent blocks of the current block;

[0293] A third type of model, comprising historical interpolation filter models cached in the second candidate list in decoding order; wherein the historical interpolation filter model refers to a model used when decoding a block that has been decoded before the current block;

[0294] The fourth type of model includes an interpolation filter model used when decoding a decoded block on a reference frame of the current block.

[0295] In some embodiments, the decoding method further includes: determining at least one third interpolation filter model based on the reconstructed value of the reference area of ​​the current block; and generating a first candidate list based on the first interpolation filter model used when decoding the decoded block and the at least one third interpolation filter model.

[0296] In some embodiments, when the image frame where the current block is located is an intra-frame, the first candidate list is filled in the order of the first type of model, the second type of model, and the third type of model.

[0297] In some embodiments, when the image frame where the current block is located is an inter-frame frame, the first candidate list is filled in sequence according to the order of the first category model, the first subcategory model in the fourth category model, the second category model, the second subcategory model in the fourth category model, and the third category model; wherein the first subcategory model includes the interpolation filter model used when decoding the decoded block at a first predefined position to the right, below and / or lower right of the corresponding position of the current block on the reference frame; the second subcategory model includes the interpolation filter model used when decoding the decoded block at a second predefined position of the current block on the reference frame, and the second predefined position is the position after the first predefined position is offset by the available motion vector of the current block.

[0298] In some embodiments, determining the second interpolation filtering model to be used for the current block based on the first candidate list includes: reordering the interpolation filtering models in the first candidate list in order from small to large according to the prediction errors of the interpolation filtering models in the first candidate list on the template area of ​​the current block to obtain a third candidate list; and determining the second interpolation filtering model to be used for the current block based on the third candidate list.

[0299] In some embodiments, determining the second interpolation filter model to be used for the current block based on the third candidate list includes: parsing the bitstream to obtain the first index of the second interpolation filter model in the third candidate list; and obtaining the second interpolation filter model from the third candidate list based on the first index.

[0300] In some embodiments, determining the second interpolation filter model to be used for the current block based on the third candidate list includes: intercepting the first first number of interpolation filter models in the third candidate list to obtain a fourth candidate list; parsing the bitstream to obtain the second index of the second interpolation filter model in the fourth candidate list; and obtaining the second interpolation filter model from the fourth candidate list based on the second index.

[0301] In some embodiments, the decoding method further includes: caching the historical interpolation filter model in a second candidate list according to a first-in-first-out principle based on the reconstruction order of the blocks.

[0302] In some embodiments, the first number is equal to the current number of models in the second candidate list.

[0303] In some embodiments, the historical interpolation filter models in the second candidate list do not include the interpolation filter models in the first candidate list based on which blocks that have been decoded before the current block are based.

[0304] In some embodiments, the first number is equal to a first predefined number.

[0305] In some embodiments, the number of models in the first candidate list is equal to a second number, and the second number is greater than the first number.

[0306] In some embodiments, the second number is equal to a second predefined number.

[0307] In some embodiments, when the current number of models in the first candidate list is equal to the second number, filling of the first candidate list is finished.

[0308] In some embodiments, after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, a predefined interpolation filtering model is used to fill the number of models in the first candidate list to the second number.

[0309] In some embodiments, after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, the first candidate list is not continued to be filled using the predefined interpolation filter model.

[0310] In some embodiments, the interpolation filter models in the first candidate list are different from each other.

[0311] In some embodiments, the interpolation filter models in the first candidate list that do not belong to the second candidate list are different from each other.

[0312] In some embodiments, the number of the first type of models in the first candidate list is less than or equal to a first threshold.

[0313] In some embodiments, the number of the second type of models in the first candidate list is less than or equal to a second threshold.

[0314] In some embodiments, the number of the third type of models in the first candidate list is less than or equal to a third threshold.

[0315] In some embodiments, the number of the fourth category of models in the first candidate list is less than or equal to a fourth threshold.

[0316] In some embodiments, the decoding method further includes: performing intra-frame prediction on the template area of ​​the current block according to the interpolation filtering model in the first candidate list to obtain a first prediction value of the template area; and determining the prediction error of the corresponding interpolation filtering model according to the first prediction value of the template area and the reconstructed value of the template area.

[0317] In some embodiments, when a first input position of an interpolation filter model in the first candidate list is outside the template area, an input value of the first input position is equal to a reconstructed value at a sample position corresponding to the first input position.

[0318] In some embodiments, when the second input position of the interpolation filtering model in the first candidate list is located on the template area, the input value of the second input position is equal to the second predicted value or reconstructed value at the sample position corresponding to the second input position; wherein, the second predicted value is the predicted value obtained when decoding the sample corresponding to the second input position.

[0319] In some embodiments, the decoding method further includes: parsing the code stream to obtain first syntax identification information; and when the first syntax identification information is equal to a first value, reordering the interpolation filter models in the first candidate list.

[0320] In some embodiments, when the first syntax identification information is equal to a second value, the interpolation filter models in the first candidate list are not reordered.

[0321] In some embodiments, determining the second interpolation filter model to be used for the current block based on the first candidate list includes: parsing the bitstream to obtain the third index of the second interpolation filter model in the first candidate list; and obtaining the second interpolation filter model from the first candidate list based on the third index.

[0322] In some embodiments, the decoding method further includes: parsing the code stream to obtain second syntax identification information; and when the second syntax identification information is equal to a third value, using the decoding method to determine a reconstructed block of the current block.

[0323] In some embodiments, the code stream is parsed to obtain the second syntax identification information when at least one of the following conditions is met:

[0324] a first condition, the first condition including that the number of the first type of models is greater than or equal to a fifth threshold;

[0325] a second condition, the second condition including that the number of the second type of models is greater than or equal to a sixth threshold;

[0326] A third condition, the third condition including that the number of the third type of models is greater than or equal to a seventh threshold;

[0327] The fourth condition includes that the number of the fourth type of models is greater than or equal to an eighth threshold.

[0328] In some embodiments, when the number of interpolation filter models in the fourth candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the fourth candidate list.

[0329] In some embodiments, when the number of interpolation filter models in the fourth candidate list is greater than 1, or when the number of interpolation filter models in the fourth candidate list is greater than 1 and the second syntax identification information is equal to the third numerical value, the code stream is parsed to obtain a second index.

[0330] In some embodiments, when the number of interpolation filter models in the first candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the first candidate list.

[0331] In some embodiments, when the number of interpolation filter models in the first candidate list is greater than 1, or when the number of interpolation filter models in the first candidate list is greater than 1 and the second syntax identification information is equal to the third value, the code stream is parsed to obtain the first index, the second index or the third index.

[0332] In some embodiments, reconstructing the bitstream according to the prediction block to obtain the reconstructed block of the current block includes: parsing the bitstream to obtain a residual block of the current block; and reconstructing the reconstructed block of the current block according to the prediction block and the residual block.

[0333] It should be noted that the above description of the decoding method embodiment is similar to the description of the encoding method embodiment described above, and has similar beneficial effects as the encoding method embodiment. For technical details not disclosed in the decoding method embodiment of this application, please refer to the description of the encoding method embodiment of this application for understanding.

[0334] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.

[0335] 3. Introduction to the encoding and decoding method provided in the embodiment of this application

[0336] 3.1. Overview of the Encoding and Decoding Methods Provided in the Embodiments of the Present Application

[0337] In related schemes, the software complexity of the interpolation filtering technology mainly comes from: for the current block, the encoder needs to derive the filter coefficients of the interpolation filtering model under multiple reconstruction areas and interpolation filtering model shapes, while the decoder needs to derive the interpolation filtering coefficients under one combination. The derivation process has a high computational complexity.

[0338] In an embodiment of the present application, it is proposed to construct a merged interpolation filter model candidate list (merge EIP list), that is, the first candidate list mentioned above, which includes one or more of the following interpolation filter models:

[0339] 1. Model information of the interpolation filter model used by the decoded block. For example, in some embodiments, the model information includes information indicating the shape of the interpolation filter model and information indicating the filter coefficients of the interpolation filter model;

[0340] 2. Interpolate the traditional intra prediction mode information derived from the gradient histogram of the decoded block.

[0341] In an embodiment of the present application, the obtained interpolation filter model of the decoded block (the interpolation filter model that has been derived when predicting the decoded block) is used for prediction on the current block, thereby increasing the pattern diversity of the interpolation filter model. At the same time, no additional calculation is required to calculate the relevant information of the interpolation filter model, such as the filter coefficient and / or the shape of the interpolation filter model.

[0342] Furthermore, for this merged list, template matching technology can be used to reorder the interpolation filter models in the merged list from small to large according to the error between the predicted value and the reconstructed value on the template. In this way, when the interpolation filter model in the merged list is selected, fewer codewords can be used to represent the index of this pattern in the merged list.

[0343] 3.2. Constructing a list of candidate merged interpolation filter models

[0344] The merged interpolation filter model candidate list may include one or more interpolation filter models in a), b), c) and d) below:

[0345] a) Adjacent interpolation filter model (i.e., the first type of model), refers to the interpolation filter model used by blocks at reference row and column positions adjacent to the current block;

[0346] b) Non-adjacent interpolation filter model (also known as the second type of model), refers to the interpolation filter model used by blocks at reference row and column positions that are not adjacent to the current block;

[0347] c) Historical interpolation filter model (also known as the third type of model) refers to using a cache to store the interpolation filter model used by the blocks that have been decoded before the current block in the decoding order;

[0348] d) The interpolation filter model in the time domain (also known as the fourth type of model) refers to the interpolation filter model used for the blocks on the reference frame.

[0349] In some embodiments, the merged list includes one or more interpolation filter models in a), b), c) and d) and one or more models calculated based on the reconstructed area around the current block as described in Section 1 to construct a merged list of interpolation filter models.

[0350] For example, as shown in Figure 22, it shows a schematic diagram of the definition of the position of the current block in the current image required for use in a~d. The coordinates of the upper left corner of the current block in the current image are (posX, posY), the width of the current block is Width, and the height is Height. The coordinates of the lower right corner of the current block are (posX+Width-1, posY+Height-1), and the position in the middle of the current block is (posX+Width / 2, posY+Height / 2).

[0351] a) Adjacent interpolation filter model

[0352] For the current block, several predefined positions adjacent to the current block are checked one by one in a certain order to see whether they belong to blocks that have been reconstructed, and whether the reconstructed block uses an interpolation filter mode for prediction. If so, and the interpolation filter model used for prediction is not repeated with the model in the constructed merged interpolation filter model candidate list, the interpolation filter model used for prediction is added to the merged interpolation filter model candidate list.

[0353] Figure 23 shows an example. In this example, there are five adjacent positions around the current block, numbered 0 to 4. Here, the coordinates of the top left corner of the current block are defined as (posX, posY), the width of the current block is defined as Width, and the height of the current block is defined as Height. The relative coordinates of the five predefined positions relative to the top left corner are: Position 0 (-1, Height-1), Position 1 (Width-1, -1), Position 2 (-1, -1), Position 3 (Width, -1), and Position 4 (-1, Height). These five positions may partially originate from the same reconstructed block due to differences in the partitioning tree to which the current block belongs. Care is taken to verify that the predefined positions are in a certain order and that the obtained interpolation filter models are not added repeatedly to the merge list. In this example, the predefined order is the position number order, i.e., 0 to 4.

[0354] In some embodiments, the predefined adjacent positions may be other positions on adjacent rows and columns to the current block, the number of predefined adjacent positions may not be five, and the predefined order may also be different.

[0355] b) Non-adjacent interpolation filter model

[0356] For the current block, several predefined positions around the current block that are not adjacent to the current block are checked one by one in a certain order to see whether they belong to blocks that have been reconstructed, and whether the reconstructed block uses an interpolation filter mode for prediction. If so, and the interpolation filter model used for prediction is not repeated with the model in the constructed merged interpolation filter model list, the interpolation filter model used for prediction is added to the merged interpolation filter model candidate list.

[0357] In some embodiments, the predefined non-adjacent position check is performed in two rounds, with the first round covering 59 positions and the second round covering 28 positions. When describing the relative position relative to the top left corner of the current block (posX, posY), W represents the width of the current block and H represents the height of the current block. For example, 2H represents twice the height, H / 2 represents half the height, and 3 / 2H represents 1.5 times the height.

[0358] For example, in one possible implementation, as shown in FIG24 , which shows 59 non-adjacent positions in the first round, the inspection order is carried out in the order from small to large according to the numbers in the figure, where the coordinates of each position relative to the corner coordinates (posX, posY) of the current block are as shown in the mark below each numbered position in FIG24 .

[0359] For example, in one possible implementation, as shown in FIG25 , which shows 28 non-adjacent positions of the second round, the inspection order is carried out in the order of the numbers in the figure from small to large, where the coordinates of each position relative to the corner coordinates (posX, posY) of the current block are as shown in the mark below each numbered position in FIG25 .

[0360] In some embodiments, the predefined non-adjacent positions may be other positions on rows and / or columns that are not adjacent to the current block. The number of predefined adjacent positions may differ from the number in the two rounds described above, and the predefined order may also be different. Specifically, the predefined non-adjacent positions may be positions near the positions defined in FIG. 24 and FIG. 25 of this solution.

[0361] c) Historical interpolation filter model

[0362] In steps a) and b), although most locations in a large area around the current block have been checked to see whether an interpolation filter mode is selected, whether there are non-repeated interpolation filter models, and whether they should be added to the merge list, in many cases, for a merge list of a given length, the above steps still cannot fill the merge list. In an embodiment of the present application, it is proposed to further add historical interpolation filter models to the merge list.

[0363] First, based on the order of reconstructing each block, a table based on the first-in-first-out principle (such as the historical interpolation filter model table with an initial length of N4 shown in Figure 26, also known as the second candidate list) is used to record whether each block has a non-repeated interpolation filter model. When decoding each slice, the historical interpolation filter model table will be initialized and cleared.

[0364] Then, in the order of decoding each block, add the interpolation filter model, as shown in Figure 27.

[0365] Whenever a newly decoded interpolation filter model is added to the historical interpolation filter model table, it must first be checked for duplication with existing models in the table. Non-duplicate models will be added to the historical interpolation filter model table. When the historical interpolation filter model table is already full, the newly decoded non-duplicate interpolation filter model will be placed at the end of the historical interpolation filter model table, while the interpolation model at the beginning of the historical interpolation filter model table will be removed, and the remaining models will be moved forward one position according to the existing order. As shown in Figure 28, it shows that the historical interpolation filter model table is updated according to the first-in, first-out principle.

[0366] The models in the historical interpolation filter model table will be used to continue filling the merged list without duplication when the merged list is not filled to the length after the merged list is filled with models at adjacent and non-adjacent positions.

[0367] In addition to being initialized (cleared) for each tile as described in this solution, the historical interpolation filter model table can also be initialized at the beginning of each slice, each image, and each coding tree unit (CTU).

[0368] d) Temporal interpolation filter model (also known as the first sub-category model in the fourth category, which is only available when the current frame is an inter-frame coded frame)

[0369] The temporal interpolation filter model is obtained by obtaining the interpolation filter model from the reference frame of the current frame when the current frame is an inter-frame coded frame. Since the reference frame has a larger portion of the reconstructed image than the current image, in addition to the reconstructed blocks above, left, upper left, lower left, and / or upper right of the current block, the reconstructed blocks and interpolation filter models can also be obtained from the right, lower, and / or lower right positions of the reference image.

[0370] In some embodiments, the interpolation filter model is obtained by examining several positions in the reference image, and the corresponding position in the reference image is found by the coordinates of the current block in the current image.

[0371] For example, in a possible implementation, the positions of the interpolation filter models used to obtain the reference image in the reference image are shown in FIG29 , where the positions of the interpolation filter models used to obtain the interpolation filter models in the 10 reference images 0 to 9 are tested in the order of 0->1->…->9, with priority given to the test. Position, when When location is not available, use □ location instead Unavailable means that the image, slice, or image is outside the specified area, and does not mean that the interpolation filter mode is not used at the location.

[0372] Check whether there is an interpolation filter model at each position in the given order. If it exists and is not repeated with the existing models in the merge list, it is added to the merge list.

[0373] In some embodiments, the position in the time domain may also include other positions in the reference image, for example, positions near the positions listed in FIG.

[0374] Interpolation filter model of offset time domain (also known as the second sub-category model in the fourth category model)

[0375] In addition to the above-mentioned time domain position, the time domain position offset can be guided by the motion vector to obtain the offset time domain position, and the interpolation filter model can be obtained from the offset time domain position. For example, an available motion vector is obtained in a certain order from the adjacent blocks around the current block. The surrounding adjacent blocks are the blocks at the five adjacent positions defined in a). In accordance with the order in a), the blocks at the selected positions are checked one by one to see if there is an available motion vector. If so, the positions 0 to 9 in the vector domain diagram 29 are used to obtain the positions 0' to 9' shifted by the motion vector. The reference image pointed to by the motion vector (for example, in bidirectional prediction, the motion vector can come from one of the two reference images) 0' to 9' is checked in order to see if there is an interpolation filter model. If so, and if it exists and is not repeated with the existing model in the merge list, it is added to the merge list.

[0376] In some embodiments, the offset positions in the time domain may also include other positions in the reference image, but the determination of these positions is related to the motion vector, for example, some positions near FIG.

[0377] The order in which the merge list is constructed

[0378] In the embodiment of the present application, the merged list should contain one or more of the interpolation filter models obtained in a), b), c), and d). In some embodiments, when constructing the merged list based on a), b), c), and d), it should be filled in a certain order. For example, here is a possible filling order:

[0379] 1. Adjacent interpolation filter model;

[0380] 2. Temporal interpolation filter model (only available when the current frame is an inter-frame coded frame);

[0381] 3. The first round of non-adjacent interpolation filter model;

[0382] 4. Second round of non-adjacent interpolation filter model;

[0383] 5. Offset time domain interpolation filter model (only available when the current frame is an inter-frame coded frame);

[0384] 6. Historical interpolation filter model.

[0385] In addition to the described filling order, other orders can also be used to fill the merge list.

[0386] In some embodiments, the merge list may have a defined length, and when the length is exceeded, no further interpolation filter models are added to the merge list.

[0387] Furthermore, in some embodiments, the merge list may have a fixed length for each type of model, for example, the number of adjacent interpolation filter models does not exceed N5, the number of time-domain interpolation filter models does not exceed M1, and so on.

[0388] The merged list may be a list including only the above-mentioned a), b), c), and d), or it may also include one or more interpolation filter models calculated based on the reconstructed pixel values ​​around the current block introduced in Section 1.

[0389] In some embodiments, whether to use the merged interpolation filtering mode is constrained by higher-level syntax elements, such as sequence-level, frame-level, and slice-level syntax elements, which control whether the merged interpolation filtering mode is allowed in the current scope. These syntax elements can be independent or dependent on higher-level syntax elements that control the interpolation filtering mode.

[0390] 3.2. Reordering of the Merged Interpolation Filter Model Candidate List

[0391] In the embodiments of the present application, two methods are proposed for reordering interpolation filter models in a merged interpolation filter model candidate list. FIG30 is a schematic diagram of the template region required for reordering the models. The template region comprises several rows above the current block (template height) and several columns to the left (template width). The template height / width can be varied based on the shape of the current block; for example, larger template height / width are used for larger blocks. Furthermore, the template height and template width can also differ.

[0392] The models in the merged interpolation filter model candidate list are used one by one to make predictions on the upper template area and the left template area. The predictions can be made in a predefined direction, such as a diagonal direction, a horizontal direction, a vertical direction, etc. For example, as shown in Figure 31, the interpolation filter model is used to generate prediction values ​​on the template in the diagonal direction.

[0393] There are two calculation methods for generating predicted values ​​on the template using the interpolation filter model:

[0394] 1. The prediction method can be the same as that in the current block, that is, when predicting the non-upper-left corner position of the left and upper templates, the input of part of the interpolation filter model uses the predicted value on the template. The advantage of this is that the true predicted value of the model can be better determined in the template area. The disadvantage is that, like the prediction on the current block, since part of the predicted value needs to be used as the input of the interpolation filter model, 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.

[0395] 2. Since the template area has been reconstructed, all reconstructed pixel values ​​can be used as the input of the interpolation filter model. This is different from the prediction method on the current block, 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.

[0396] According to the difference between the predicted value and the reconstructed value of the interpolation filter model in the merged interpolation filter model candidate list on the template area, the interpolation filter models in the merged list are sorted from small to large according to the cost, and the sorted merged list is used as the final merged list to predict the interpolation filter model of the current block. The index in this merged list will be encoded into the bitstream and parsed from the bitstream to indicate that when the interpolation filter mode is selected, the interpolation filter model used for current block prediction is obtained in the reordered merged list.

[0397] The reordering technology can be to rearrange the merged interpolation filter model candidate list according to the order of the interpolation filter models based on the template cost, or to select a part of the merged list as the final merged list according to the template cost from small to large.

[0398] In some embodiments, sorting may also be performed only on the upper template or the left template.

[0399] In some embodiments, whether to use the reordering technique is restricted by certain higher-level syntax elements, such as sequence-level, frame-level, and slice-level syntax elements. These syntax elements (i.e., first syntax identification information) control whether the reordering merge interpolation filtering mode is permitted within the current scope. These syntax elements can be independent or dependent on one or more of the higher-level syntax elements for the interpolation filtering mode, the merge interpolation filtering mode, and the template matching technique.

[0400] 4. Implementation process

[0401] This solution exemplifies the method introduced in Section 2, and on this basis adds merged interpolation filter modes and merged interpolation filter mode reordering technology. It can also perform merged interpolation filter modes and merged interpolation filter mode sorting based on different interpolation filter modes introduced in Section 2.

[0402] The following implementations can be used when encoding and decoding the combined interpolation filter mode identifier:

[0403] 1. The merged interpolation filter mode flag (i.e., the second syntax flag information) may be encoded and decoded for each block that is allowed to use interpolation filter prediction to indicate whether the merged interpolation filter mode is selected;

[0404] In some embodiments, in order to avoid wasting this identifier when encoding and decoding some blocks that cannot construct a candidate list containing available merged interpolation filter models, some default models can be used for this situation. For example, when there is no available interpolation filter model in the merged list or the merged list is not fully filled, the default model is used to fill or fill it up.

[0405] 2. The merged interpolation filter mode identifier can also be encoded and decoded based on certain conditions to indicate whether the merged interpolation filter mode is selected. This is because, in some cases, the current block does not have an available interpolation filter model in a), b), c), or d), so it is impossible to construct a merge list containing available interpolation filter models. Therefore, if the merged interpolation filter mode identifier is encoded and decoded at this time, it will cause a waste of codewords. The certain conditions here are met to ensure that there is an available model in the merge list constructed by the current block, or there are multiple available models.

[0406] In some embodiments, the certain condition may be at least one of the conditions described in 1-5 below:

[0407] 1. When there are at least N6 blocks in the adjacent position using the interpolation filter mode (N6>1), that is, the first condition;

[0408] 2. When there are at least M2 blocks in non-adjacent positions using the interpolation filter mode (M2>0), that is, the second condition;

[0409] 3. When the number of historical interpolation filter models is at least M3 (M3>0), that is, the third condition;

[0410] 4. When the number of time-domain interpolation filter models is at least M4 (M4>0), that is, the fourth condition;

[0411] 5. Combination of 1 to 4 above.

[0412] When encoding and decoding the merge interpolation filter mode identifier based on certain conditions, the default model can also be used to fill the merge list.

[0413] For example, in some embodiments, the certain condition may be at least one of the following:

[0414] 1. When blocks in five adjacent positions around the current block (such as those in adjacent positions 0 to 4 in FIG. 23 ) are checked for interpolation filter prediction mode, if such a block is detected, encoding and decoding are combined with the interpolation filter mode flag. In some embodiments, these can be different positions and in different orders.

[0415] 2. When there is no block using the interpolation filter prediction mode in 1, further check b) non-adjacent position. If it is found, the encoding and decoding merge the interpolation filter mode identifier.

[0416] 3. When there is no block using the interpolation filter mode in 1 and 2, further check whether there is a historical interpolation filter model c). If it is found, the encoding and decoding merge the interpolation filter mode identifier.

[0417] When the merge interpolation filter mode flag is encoded or decoded as true, the index of the merge interpolation filter model is further encoded or decoded.

[0418] 4.1. Solution 1

[0419] Based on the intra-frame prediction and / or inter-frame prediction scheme described in Section 1-2, a merged interpolation filtering mode is added to construct a merged list with a maximum length of 12, including a), b), c), d) and added in the order described in Section 3.1, where the length of the historical interpolation filtering model table is 6.

[0420] The merge list is opened when at least one or more blocks in the five adjacent positions around the current block use the interpolation filter mode. There may be 1 to 12 interpolation filter models in the list. In some embodiments, the codec uses a reordering technique. When the number of models is greater than 1, reordering is used and the maximum length of the final merge list is limited to 6. This means that there may be 1 to 6 models in the final merge list. In some embodiments, the index of the selected model is encoded and decoded using a truncated unary code that can represent a maximum of 6 symbols, as shown in the following table:

[0421] 4.1.1 Parsing Syntax Elements

[0422] In some embodiments, the parsing of syntax elements related to interpolation filter prediction mode at the coding unit level is shown in the following table:

[0423] Coding unit syntax

[0424] cu_eip_flag identifies the enable flag of the coding unit level interpolation filtering technology. A value of 1 indicates that the interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the bitstream, the default value is 0.

[0425] eip_merge_flag identifies the enable flag of the coding unit level merge interpolation filtering technology. A value of 1 indicates that the merge interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the code stream, the default value is 0.

[0426] The eip_merge_idx identifier represents the index of the merged interpolation filter model candidate list when using the merged interpolation filter technology. This index is used to obtain the selected interpolation filter model from the list. In this solution, the maximum length of the reordered merged interpolation filter model candidate list is 6.

[0427] first_mode indicates whether the first interpolation filter combination (EIP_AL_A_L, EIP_FILTER_S) is selected when the mode is not merge mode. 1 indicates selected, and 0 indicates not selected. If this syntax element does not exist in the code stream, the default value is 0.

[0428] other_mode indicates which other combination is selected when the first interpolation filter combination is not selected. When there is only one other combination available for the current block, this syntax element does not need to be encoded. If this syntax element does not exist in the bitstream, it defaults to 0.

[0429] 4.1.2 Rebuilding the current block

[0430] The prediction mode is determined based on the parsed syntax elements. If the interpolation filtering prediction mode is selected for the current block, it is further determined whether the merged interpolation filtering mode is selected.

[0431] If it is not the merged interpolation filter mode, the process of obtaining the interpolation filter model and the prediction process are the same as those described in Section 2.3.

[0432] If the merge interpolation filter mode is used, first construct a merge list with a maximum length of 12 according to the method described in 3.2. When the filled models are less than 12, there is no need to use the default model to further fill the list. In the process of adding models to the merge list, a duplicate check operation is required to ensure that the interpolation filter models added to the merge list are not repeated. Then, determine whether to use reordering based on whether the number of models in the merge list is greater than 1.

[0433] 1. If re-sorting is not required, the current list will be directly used as the final merged list.

[0434] 2. If reordering is required, the prediction values ​​are generated based on the template using the interpolation method described in Section 3.2, using all reconstructed values. The prediction values ​​are then sorted in ascending order using the SAD of the template reconstruction values ​​as the cost. The top six interpolation filter models with the lowest SAD costs are selected and sorted in ascending order of SAD as the final merge list. In some cases, the number of models may be less than six. In some embodiments, reordering is still performed in this case, and all models are sorted in the final merge list.

[0435] According to the decoded eip_merge_idx, the interpolation filter model in the final merge list is obtained for prediction. The binary identifier of eip_merge_idx corresponds to the corresponding final merge list index as follows:

[0436] After obtaining the interpolation filter model, the other prediction and transformation related steps are the same as those in Sections 2.3 and 2.4.

[0437] In some embodiments, some of the conditions in Section 4.1.1, hasMergeFlag, can also be replaced by the following conditions described at the beginning of Section 4:

[0438] 1. When there are at least N6 blocks in the adjacent position using interpolation filter mode (N6>1);

[0439] 2. When there are at least M2 blocks in non-adjacent positions using interpolation filter mode (M2>0);

[0440] 3. When the number of historical interpolation filter models is at least M3 (M3>0);

[0441] 4. When the number of interpolation filter models in the time domain is at least M4 (M4>0);

[0442] 5. Combination of 1 to 4 above.

[0443] Specifically, it can be that first, the five surrounding positions are checked one by one. If the block at the position uses the interpolation filtering mode, hasMergeFlag is true, otherwise further check b); for the block at the non-adjacent position, if the block at the position uses the interpolation filtering mode, hasMergeFlag is returned as true, otherwise hasMergeFlag is false.

[0444] Alternatively, first check the five surrounding positions one by one. If the block at the position uses the interpolation filtering mode, hasMergeFlag is true, otherwise further check b); for the block at the non-adjacent position, if the block at the position uses the interpolation filtering mode, hasMergeFlag is true, otherwise further check c); whether the historical interpolation filtering model exists, if so, hasMergeFlag is true, otherwise hasMergeFlag is false.

[0445] In some embodiments, when the merged interpolation filter model candidate list constructed in Section 4.1.2 has less than 12 models, the list is first filled with default models, and then reordered and reduced to 6 models.

[0446] 4.2. Solution 2

[0447] Based on the intra-frame prediction and / or inter-frame prediction scheme described in Section 1-2, a merged interpolation filtering mode is added to construct a merged list with a maximum length of 12, including a), b), c), d) and in the order of addition described in Section 3.1, where the length of the historical interpolation filtering model table is 6.

[0448] The merge list is opened when at least one or more blocks in the five adjacent positions around the current block use the interpolation filter mode. The list may contain 1 to 12 interpolation filter models. In some embodiments, a reordering technique is used. When the number of models is greater than one, the reordering is performed to determine the final interpolation filter model for merging the interpolation filter modes.

[0449] 4.2.1 Parsing Syntax Elements

[0450] In some embodiments, the parsing of syntax elements related to interpolation filter prediction mode at the coding unit level is shown in the following table:

[0451] Coding unit syntax

[0452] cu_eip_flag identifies the enable flag of the coding unit level interpolation filtering technology. A value of 1 indicates that the interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the bitstream, the default value is 0.

[0453] eip_merge_flag identifies the enable flag of the coding unit level merge interpolation filtering technology. A value of 1 indicates that the merge interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the bitstream, the default value is 0. Since there is only one interpolation filter model in the final merge list in this solution, there is no need to encode and decode the list index as in the previous solution.

[0454] first_mode indicates whether the first interpolation filter combination (EIP_AL_A_L, EIP_FILTER_S) is selected when the mode is not merge mode. 1 indicates selected, and 0 indicates not selected. If this syntax element does not exist in the code stream, the default value is 0.

[0455] other_mode indicates which other combination is selected when the first interpolation filter combination is not selected. When there is only one other combination available for the current block, this syntax element does not need to be encoded. If this syntax element does not exist in the bitstream, it defaults to 0.

[0456] 4.2.2 Rebuilding the current block

[0457] The prediction mode is determined based on the parsed syntax elements. If the interpolation filtering prediction mode is selected for the current block, it is further determined whether the merged interpolation filtering mode is selected.

[0458] If it is not the merged interpolation filter mode, the process of obtaining the interpolation filter model and the prediction process are the same as those described in Section 2.3;

[0459] If the merge interpolation filter mode is used, first construct a merge list with a maximum length of 12 according to the method described in Section 3.2. When the number of filled models is less than 12, there is no need to use the default model to further fill the list. In the process of adding models to the list, a duplicate check operation is required to ensure that the interpolation filter models added to the merge list are not repeated. Then, determine whether to use reordering based on whether the number of models in the merge list is greater than 1.

[0460] 1. If reordering is not required, the current list will be directly used as the final merged list;

[0461] 2. If reordering is required, the prediction values ​​are generated on the template using the interpolation method described in Section 3.2, and the SAD of the template reconstruction value is used as the cost to sort them from small to large. The interpolation filter model with the smallest SAD cost is selected as the final interpolation filter model used in the merge mode.

[0462] After obtaining the interpolation filter model, the other prediction and transformation related steps are the same as those in Sections 2.3 and 2.4.

[0463] In some embodiments, some of the conditions in Section 4.2.1, hasMergeFlag, can also be replaced by the ones described at the beginning of Section 4:

[0464] 1. When there are at least N6 blocks in the adjacent position using interpolation filter mode (N6>1);

[0465] 2. When there are at least M2 blocks in non-adjacent positions using interpolation filter mode (M2>0);

[0466] 3. When the number of historical interpolation filter models is at least M3 (M3>0);

[0467] 4. When the number of interpolation filter models in the time domain is at least M4 (M4>0);

[0468] 5. Combination of 1 to 4 above.

[0469] Specifically, it can be that first, the five surrounding positions are checked one by one. If the block at the position uses the interpolation filtering mode, hasMergeFlag is true. Otherwise, further check b) the block at the non-adjacent position. If the block at the position uses the interpolation filtering mode, hasMergeFlag is returned as true, otherwise hasMergeFlag is false.

[0470] Alternatively, first check the five surrounding positions one by one. If the block at the position uses the interpolation filtering mode, hasMergeFlag is true, otherwise further check b); for the block at the non-adjacent position, if the block at the position uses the interpolation filtering mode, hasMergeFlag is true, otherwise further check c); whether the historical interpolation filtering model exists, if so, hasMergeFlag is true, otherwise hasMergeFlag is false.

[0471] In some embodiments, when the merged interpolation filter model candidate list constructed in Section 4.2.2 has less than 12 candidates, the list is first filled with the default model, and then reordered and reduced to one model.

[0472] In some embodiments, the constructed merged list does not need to be reduced to less than or equal to 6 models after reordering, but rather remains less than or equal to N7 models, where N7 is a value ranging from 1 to the maximum value of the merged list length.

[0473] 4.3. Option 3

[0474] Solution 3 is not based on certain conditions when encoding and decoding the combined interpolation filter mode identifier.

[0475] Based on the intra-frame prediction and / or inter-frame prediction scheme described in Section 1-2, a merged interpolation filtering mode is added to construct a merged list with a maximum length of 12, including a), b), c), d) and added in the order described in 3.1, where the length of the historical interpolation filtering model table is 6.

[0476] There may be 0 to 12 interpolation filter models in the list. In some embodiments, the codec uses a reordering technique. When the number of models is greater than 1, reordering is used to determine a maximum of 6 interpolation filter models to form the final merged list.

[0477] When there are no models in the final merge list (0 models), the encoder will encode the merge mode flag as false.

[0478] 4.3.1 Parsing Syntax Elements

[0479] In some embodiments, the parsing of syntax elements related to interpolation filter prediction mode at the coding unit level is shown in the following table:

[0480] Coding unit syntax

[0481] cu_eip_flag identifies the enable flag of the coding unit level interpolation filtering technology. A value of 1 indicates that the interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the bitstream, the default value is 0.

[0482] eip_merge_flag identifies the enable flag of the coding unit level merge interpolation filtering technology. A value of 1 indicates that the merge interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the code stream, the default value is 0.

[0483] The eip_merge_idx identifier represents the index of the merged interpolation filter model candidate list when using the merged interpolation filter technology. This index is used to obtain the selected interpolation filter model from the list. In some embodiments, the maximum length of the reordered merged interpolation filter model candidate list is 6.

[0484] first_mode indicates whether the first interpolation filter combination (EIP_AL_A_L, EIP_FILTER_S) is selected when the mode is not merge mode. 1 indicates selected, and 0 indicates not selected. If this syntax element does not exist in the code stream, the default value is 0.

[0485] other_mode indicates which other combination is selected when the first interpolation filter combination is not selected. When there is only one other combination available for the current block, this syntax element does not need to be encoded. If this syntax element does not exist in the bitstream, it defaults to 0.

[0486] 4.3.2 Rebuilding the current block

[0487] The prediction mode is determined based on the parsed syntax elements. If the interpolation filtering prediction mode is selected for the current block, it is further determined whether the merged interpolation filtering mode is selected.

[0488] If it is not the merged interpolation filter mode, the process of obtaining the interpolation filter model and the prediction process are the same as those described in Section 2.3;

[0489] If the merge interpolation filter mode is used, a merge list with a maximum length of 12 is first constructed according to the method described in 3.2. When the number of models filled is less than 12, there is no need to use the default model to further fill the merge list. During the process of adding models to the merge list, a duplicate check operation is required to ensure that the interpolation filter models added to the merge list are not repeated. Then, whether to use reordering is determined based on whether the number of models in the merge list is greater than 1:

[0490] 1. If reordering is not required, the current list will be directly used as the final merged list;

[0491] 2. If reordering is required, the prediction values ​​are generated based on the template using the interpolation method described in Section 3.2, using all reconstructed values. The prediction values ​​are then sorted in ascending order using the SAD of the template reconstruction values ​​as the cost. The top six interpolation filter models with the lowest SAD costs are selected and sorted in ascending order of SAD as the final merge list. In some cases, the number of models may be less than six. In some embodiments, reordering is still performed in this case, and all models are sorted in the final merge list.

[0492] When constructing the merged interpolation filter model candidate list, the encoder has skipped the block that constructs the empty merged interpolation filter model candidate list and encoded eip_merge_flag as false when making the decision, so the decoder will not decode the situation where eip_merge_flag is true but an empty merged interpolation filter model candidate list is constructed.

[0493] After obtaining the interpolation filter model, the other prediction and transformation related steps are the same as those in Sections 2.3 and 2.4.

[0494] In some embodiments, when the merged interpolation filter model candidate list constructed in Section 4.3.2 has less than 12, the default model is first used to fill the list, and then the list is reordered and reduced to one model.

[0495] In some embodiments, the constructed merged list does not need to be reduced to less than or equal to 6 models after reordering, but rather remains less than or equal to N7 models, where N7 is a value ranging from 1 to the maximum value of the merged list length, such as selecting only one model in Section 4.1.

[0496] 4.4. Solution 4

[0497] Schemes 1 to 3 all describe the process of first constructing a merged interpolation filter model candidate list with a maximum length of 12, then using template matching technology to sort them and select the 6 with the lowest cost as the final merged interpolation filter model candidates. In this case, if Schemes 1 to 3 do not use the default model to fill, it cannot be guaranteed that there will be 6 interpolation filter models in both the merged interpolation filter model candidate list and the final merged list. In Schemes 1 to 3, unary truncation codes are used to encode and decode the final list index. When the final merged list has fewer than 6 models, the truncated unary code always needs to support the index when there are 6 models in the encoding and decoding lists, which will result in codeword waste. In the example of Scheme 4, the codec uses a variable final candidate list length to ensure that there are always enough interpolation filter models in the merged list, so that codewords are not wasted.

[0498] In this solution, the merged interpolation filter model candidate list is still constructed using four types of interpolation filter models: a), b), c), and d). Among them, c) the maximum length of the historical interpolation filter model table is 6, and it is filled in the merged interpolation filter model candidate list last in order.

[0499] When recording historical interpolation filter models, only those that used interpolation filter mode and not merge mode are counted. At the same time, models in the historical interpolation filter model table are not checked for duplicates. This way, when parsing the bitstream, the decoder updates the counter for the number of models in the historical interpolation filter model table each time it encounters a code stream that uses interpolation filter mode but not merge interpolation filter mode, indicating an increase in the number of available models.

[0500] When constructing the merged list, since the merged list may include models in the historical interpolation filter model table, the number of models in the merged list should always be greater than or equal to the number of models in the historical interpolation filter model table. When the final merged list is obtained based on the reordering construction, it can be known that at least a number of models greater than or equal to the number of models in the historical interpolation filter model table should be removed from the reordering. Therefore, in one possible implementation, the length of the final merged list is made equal to the number of models in the historical interpolation filter model table.

[0501] At the same time, when decoding the syntax elements of each block, the decoder can also determine whether to decode the merged interpolation filter mode identifier by obtaining whether there is a model in the historical interpolation filter model table, or the number of existing models. When the merged interpolation filter mode is selected, the range of the number of models in the final merged list is determined. Once the range is determined, the index can be further decoded.

[0502] 4.4.1 Parsing Syntax Elements

[0503] In some embodiments, the parsing of syntax elements related to interpolation filtering prediction mode at the coding unit level is shown in the following table.

[0504] Coding unit syntax

[0505] cu_eip_flag identifies the enable flag of the coding unit level interpolation filtering technology. A value of 1 indicates that the interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the bitstream, the default value is 0.

[0506] eip_merge_flag identifies the enable flag of the coding unit level merge interpolation filtering technology. A value of 1 indicates that the merge interpolation filtering technology is used for the current luminance block, and a value of 0 indicates that it is not used. If this syntax element does not exist in the bitstream, the default value is 0. Since there is only one interpolation filter model in the final merge interpolation filter model candidate list in this scheme, there is no need to encode and decode the list index as in the previous scheme.

[0507] first_mode indicates whether the first interpolation filter combination (EIP_AL_A_L, EIP_FILTER_S) is selected when the mode is not merge mode. 1 indicates selected, and 0 indicates not selected. If this syntax element does not exist in the code stream, the default value is 0.

[0508] other_mode indicates which other combination is selected when the first interpolation filter combination is not selected. When there is only one other combination available for the current block, this syntax element does not need to be encoded. If this syntax element does not exist in the bitstream, it defaults to 0.

[0509] In the above syntax element table, compared with the previous solutions, the main additions are getNumHistModel(cu) and updateNumHistModel(cu). The former obtains the final merge list length at this time based on the model count value in the historical interpolation filter model table, while the latter updates the model count in the historical interpolation filter model table based on the non-merged interpolation filter mode obtained by decoding.

[0510] In the reference software, GDR mode can be turned on conditionally. When GDR is turned on, an intra-frame will be divided into multiple parts and packaged in several consecutive frames, avoiding the problem that I-frame transmission consumes more bandwidth than B-frame and P-frame.

[0511] In order to support the opening of GDR mode, two counters are needed to count the number of models in the available historical interpolation filter model table, one for counting only when the current CU is located in a clean area (GDR refreshed area), and one for complete counting.

[0512] The following table shows an example of the number of models in the historical interpolation filter model table:

[0513] When GDR mode is enabled, the count value is obtained from availHistEip1; when GDR mode is disabled, the count value is obtained from availHistEip0.

[0514] The following table shows an example of obtaining the number of models in the historical interpolation filter model table:

[0515] Since the historical interpolation filter model table may have an initialization (clearing) operation for each frame, each slice, each tile or each CTU, the count value here should also be cleared accordingly.

[0516] When encoding and decoding the eip_merge_flag, the maximum number of symbols required to identify the truncated unary code can be determined based on the length of the final merge list, that is, the model count value in the historical interpolation filter model table. For example, in some embodiments, the maximum count value in the historical interpolation filter model table is 6. However, due to differences in the decoding order of the current block, the count values ​​may be 0, 1, 2, 3, 4, 5, or 6.

[0517] 0 means that there is no model in the historical interpolation filter model table at this time, so the merged interpolation filter prediction mode identifier is neither encoded nor decoded at this time, and it is not used by default;

[0518] 1 means that there is 1 model in the historical interpolation filter model table at this time, which means that the final merge list length will be 1, with 1 model, so it is necessary to decode eip_merge_flag at this time. When its decoded value is true, the merge interpolation filter mode is selected, otherwise the merge interpolation filter mode is not used;

[0519] 2 means that there are 2 models in the historical interpolation filter model table at this time, which means that the length of the final merge list will be 2, with 2 models, so it is necessary to decode eip_merge_flag at this time; when its decoded value is true, the merge interpolation filter mode is selected, otherwise the merge interpolation filter mode is not used, and the eip_merge_idx needs to be further parsed by truncating the unary code to determine which model in the final merge list is selected for prediction of the current block. The parsed unary truncated code of eip_merge_idx and the index relationship are as follows:

[0520] 3 means that there are 3 models in the historical interpolation filter model table at this time, which means that the length of the final merge list will be 3, with 3 models. Therefore, it is necessary to decode eip_merge_flag at this time. When its decoded value is true, the merge interpolation filter mode is selected. Otherwise, the merge interpolation filter mode is not used, and the eip_merge_idx needs to be further parsed by truncating the unary code to determine which model in the final merge list is selected for prediction of the current block. The parsed unary truncated code of eip_merge_idx and the index relationship are as follows:

[0521] 4 means that there are 4 models in the historical interpolation filter model table at this time, which means that the final merge list length will be 4, with 4 models. Therefore, it is necessary to decode eip_merge_flag at this time. When its decoded value is true, the merge interpolation filter mode is selected. Otherwise, the merge interpolation filter mode is not used, and the eip_merge_idx needs to be further parsed by truncating the unary code to determine which model in the final merge list is selected for prediction of the current block. The parsed unary truncated code of eip_merge_idx and the index relationship are as follows:

[0522] 5 means that there are 5 models in the historical interpolation filter model table at this time, which means that the length of the final merge list will be 5, with 5 models, so it is necessary to decode eip_merge_flag at this time; when its decoded value is true, the merge interpolation filter mode is selected, otherwise the merge mode is not used, and the eip_merge_idx needs to be further parsed by truncating the unary code to determine which model in the final merge list is selected for prediction of the current block. The parsed unary truncated code of eip_merge_idx and the index relationship are as follows:

[0523] 6 means that there are 6 models in the historical interpolation filter model table at this time, which means that the final merge list length will be 6, with 6 models, so it is necessary to decode eip_merge_flag at this time; when its decoded value is true, the merge interpolation filter mode is selected, otherwise the merge interpolation filter mode is not used, and the eip_merge_idx needs to be further parsed by truncating the unary code to determine which model in the final merge list is selected for prediction of the current block. The parsed unary truncated code of eip_merge_idx and the index relationship are as follows:

[0524] In some embodiments, other truncated codes may also be used, for example, using a truncated binary code to encode and decode eip_merge_idx.

[0525] 4.4.2 Rebuilding the current block

[0526] The prediction mode is determined based on the parsed syntax elements. If the interpolation filtering prediction mode is selected for the current block, it is further determined whether the merged interpolation filtering mode is selected.

[0527] If it is not the merged interpolation filter mode, the process of obtaining the interpolation filter model and the prediction process are the same as those described in Section 2.3.

[0528] If the merge interpolation filter mode is used, a merge list with a maximum length of 12 is first constructed according to the method described in 3.2. When the number of models filled is less than 12, the models added to the merge list need to be checked for duplicates, except for the models in the historical interpolation filter model table, to ensure that the interpolation filter models added to the merge list are not repeated. Then, whether to use reordering is determined based on whether the number of models in the merge list is greater than 1.

[0529] 1. If re-sorting is not required, the current list will be directly used as the final merged list.

[0530] 2. If reordering is required, the prediction values ​​are generated on the template using the interpolation method described in Section 3.2, and the SAD of the template reconstruction value is used as the cost to sort them from small to large. The N7 (N7 is equal to the number of models in the historical interpolation filter model table) interpolation filter models with the smallest SAD cost are selected as the final interpolation filter model candidates for the merged interpolation filter mode.

[0531] According to the parsed eip_merge_idx, the model in the final merge list is selected and the current block is predicted and reconstructed according to the method described above.

[0532] 5. Test results

[0533] The test results of the scheme described in Section 4.1 are as follows:

[0534] The test results of the scheme described in Section 4.2 are as follows:

[0535] In the embodiments of this application,

[0536] 1. A merged interpolation filtering method and a reordering of the candidate list of merged interpolation filtering models are proposed;

[0537] 2. The construction of the combined interpolation filter model candidate list should include one or more of a), b), c), and d);

[0538] 3. When the number of models in the merged interpolation filter model candidate list is insufficient, the default interpolation filter model (i.e., the predefined interpolation filter model) can be used to fill the list;

[0539] 4. When reordering and merging the candidate list of interpolation filter models, the length of the reordered list can be limited. For example, the number of models in the list after reordering can be kept less than or equal to the number of models in the list before reordering.

[0540] 5. For the merged interpolation filter mode identifier, conditional judgment can be used to control whether to encode and decode the identifier symbol;

[0541] 6. When the merge interpolation filter mode flag is true, and the maximum length of the reordered merge interpolation filter model candidate list defined by the scheme is greater than 1, an index needs to be further decoded to indicate the selected interpolation filter model in the list;

[0542] 7. When the maximum length of the reordered merged interpolation filter model candidate list is 1, no further decoding index is required.

[0543] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps; or steps in different embodiments may be combined to form a new technical solution.

[0544] Based on the above embodiments, the present invention provides a decoding device, which is applied to a decoder. FIG32 is a schematic structural diagram of the decoding device provided by the present invention. As shown in FIG32 , the decoding device 32 includes:

[0545] A first generating module 3201 is configured to generate a first candidate list according to a first interpolation filter model used when decoding a decoded block;

[0546] A first determining module 3202 is configured to determine a second interpolation filter model to be used for the current block according to the first candidate list;

[0547] A first prediction module 3203 is configured to perform intra-frame prediction on the current block using the second interpolation filter model to obtain a prediction block of the current block;

[0548] The reconstruction module 3204 is configured to reconstruct the code stream according to the prediction block to obtain a reconstructed block of the current block.

[0549] In some embodiments, the first interpolation filter model includes at least one of the following:

[0550] A first type of model, wherein the first type of model includes an interpolation filter model used when decoding a decoded adjacent block of the current block;

[0551] A second type of model, wherein the second type of model includes an interpolation filter model used when decoding decoded non-adjacent blocks of the current block;

[0552] A third type of model, comprising historical interpolation filter models cached in the second candidate list in decoding order; wherein the historical interpolation filter model refers to a model used when decoding a block that has been decoded before the current block;

[0553] The fourth type of model includes an interpolation filter model used when decoding a decoded block on a reference frame of the current block.

[0554] Further, in some embodiments, the first generation module 3201 is configured to: determine at least one third interpolation filter model based on the reconstructed value of the reference area of ​​the current block; and generate a first candidate list based on the first interpolation filter model used when decoding the decoded block and the at least one third interpolation filter model.

[0555] In some embodiments, the first generation module 3201 is configured to: when the image frame where the current block is located is an intra-frame, fill the first candidate list in the order of the first type of model, the second type of model, and the third type of model.

[0556] In some embodiments, the first generation module 3201 is configured to: when the image frame where the current block is located is an inter-frame frame, fill the first candidate list in sequence according to the order of the first category model, the first subcategory model in the fourth category model, the second category model, the second subcategory model in the fourth category model, and the third category model; wherein the first subcategory model includes the interpolation filter model used when decoding the decoded block at the first predefined position to the right, below and / or lower right of the corresponding position of the current block on the reference frame; the second subcategory model includes the interpolation filter model used when decoding the decoded block at the second predefined position of the current block on the reference frame, and the second predefined position is the position after the first predefined position is offset by the available motion vector of the current block.

[0557] In some embodiments, the first determination module 3202 is configured to: reorder the interpolation filtering models in the first candidate list in order from small to large according to the prediction errors of the interpolation filtering models in the first candidate list on the template area of ​​the current block to obtain a third candidate list; and determine the second interpolation filtering model to be used for the current block based on the third candidate list.

[0558] In some embodiments, the decoding device 32 also includes a parsing module configured to parse the code stream to obtain the first index of the second interpolation filter model in the third candidate list; a first determination module 3202 is configured to obtain the second interpolation filter model from the third candidate list based on the first index.

[0559] In some embodiments, the decoding device 32 also includes a parsing module, configured to parse the code stream to obtain the second index of the second interpolation filter model in the fourth candidate list; the first determination module 3202 is configured to: intercept the first first number of interpolation filter models in the third candidate list to obtain a fourth candidate list; according to the second index, obtain the second interpolation filter model from the fourth candidate list.

[0560] In some embodiments, the decoding device 32 further includes a cache module configured to cache the historical interpolation filter model in the second candidate list according to a first-in-first-out principle based on the reconstruction order of the blocks.

[0561] In some embodiments, the first number is equal to the current number of models in the second candidate list.

[0562] In some embodiments, the historical interpolation filter models in the second candidate list do not include the interpolation filter models in the first candidate list based on which blocks that have been decoded before the current block are based.

[0563] In some embodiments, the first number is equal to a first predefined number.

[0564] In some embodiments, the number of models in the first candidate list is equal to a second number, and the second number is greater than the first number.

[0565] In some embodiments, the second number is equal to a second predefined number.

[0566] In some embodiments, the first generation module 3201 is configured to: when the current number of models in the first candidate list is equal to the second number, end filling the first candidate list.

[0567] In some embodiments, the first generation module 3201 is configured to: after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, use a predefined interpolation filtering model to fill the number of models in the first candidate list to the second number.

[0568] In some embodiments, the first generation module 3201 is configured to: after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, continue to fill the first candidate list without using the predefined interpolation filter model.

[0569] In some embodiments, the interpolation filter models in the first candidate list are different from each other.

[0570] In some embodiments, the interpolation filter models in the first candidate list that do not belong to the second candidate list are different from each other.

[0571] In some embodiments, the number of the first type of models in the first candidate list is less than or equal to a first threshold.

[0572] In some embodiments, the number of the second type of models in the first candidate list is less than or equal to a second threshold.

[0573] In some embodiments, the number of the third type of models in the first candidate list is less than or equal to a third threshold.

[0574] In some embodiments, the number of the fourth category of models in the first candidate list is less than or equal to a fourth threshold.

[0575] In some embodiments, the first determination module 3202 is further configured to: perform intra-frame prediction on the template area of ​​the current block according to the interpolation filtering model in the first candidate list to obtain a first prediction value of the template area; and determine the prediction error of the corresponding interpolation filtering model based on the first prediction value of the template area and the reconstructed value of the template area.

[0576] In some embodiments, when a first input position of an interpolation filter model in the first candidate list is outside the template area, an input value of the first input position is equal to a reconstructed value at a sample position corresponding to the first input position.

[0577] In some embodiments, when the second input position of the interpolation filtering model in the first candidate list is located on the template area, the input value of the second input position is equal to the second predicted value or reconstructed value at the sample position corresponding to the second input position; wherein, the second predicted value is the predicted value obtained when decoding the sample corresponding to the second input position.

[0578] In some embodiments, the decoding device 32 also includes a parsing module configured to parse the code stream to obtain first syntax identification information; the reconstruction module 3204 is further configured to: when the first syntax identification information is equal to the first numerical value, reorder the interpolation filter models in the first candidate list.

[0579] In some embodiments, when the first syntax identification information is equal to a second value, the interpolation filter models in the first candidate list are not reordered.

[0580] In some embodiments, the decoding device 32 also includes a parsing module configured to parse the code stream to obtain the third index of the second interpolation filter model in the first candidate list; the first determination module 3202 is configured to obtain the second interpolation filter model from the first candidate list based on the third index.

[0581] In some embodiments, the decoding device 32 further includes a parsing module configured to parse the code stream to obtain second syntax identification information; when the second syntax identification information is equal to a third value, the decoding device 32 uses the decoding method to determine the reconstructed block of the current block.

[0582] Furthermore, in some embodiments, the parsing module is configured to parse the code stream to obtain the second syntax identification information when at least one of the following conditions is met:

[0583] a first condition, the first condition including that the number of the first type of models is greater than or equal to a fifth threshold;

[0584] a second condition, the second condition including that the number of the second type of models is greater than or equal to a sixth threshold;

[0585] A third condition, the third condition including that the number of the third type of models is greater than or equal to a seventh threshold;

[0586] The fourth condition includes that the number of the fourth type of models is greater than or equal to an eighth threshold.

[0587] In some embodiments, when the number of interpolation filter models in the fourth candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the fourth candidate list.

[0588] In some embodiments, the parsing module is configured to: parse the code stream to obtain a second index when the number of interpolation filter models in the fourth candidate list is greater than 1, or when the number of interpolation filter models in the fourth candidate list is greater than 1 and the second syntax identification information is equal to the third numerical value.

[0589] In some embodiments, when the number of interpolation filter models in the first candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the first candidate list.

[0590] In some embodiments, the parsing module is configured to: parse the code stream to obtain the first index, the second index or the third index when the number of interpolation filter models in the first candidate list is greater than 1, or when the number of interpolation filter models in the first candidate list is greater than 1 and the second syntax identification information is equal to the third value.

[0591] In some embodiments, the reconstruction module 3204 is configured to: parse the bitstream to obtain a residual block of the current block; and reconstruct the current block according to the prediction block and the residual block to obtain a reconstructed block.

[0592] An embodiment of the present application provides an encoding device, which is applied to an encoder. FIG33 is a schematic structural diagram of the encoding device provided in an embodiment of the present application. As shown in FIG33 , the encoding device 33 includes:

[0593] The second generating module 3301 is configured to generate a first candidate list according to a first interpolation filter model used when decoding the decoded block;

[0594] A second determining module 3302 is configured to determine a second interpolation filter model to be used for the current block according to the first candidate list;

[0595] A second prediction module 3303 is configured to perform intra-frame prediction on the current block using the second interpolation filter model to obtain a prediction block of the current block;

[0596] A third determining module 3304 is configured to determine a residual block of the current block according to the prediction block;

[0597] The third generating module 3305 is configured to generate a code stream according to the residual block.

[0598] In some embodiments, the first interpolation filter model includes at least one of the following:

[0599] A first type of model, wherein the first type of model includes an interpolation filter model used when decoding a decoded adjacent block of the current block;

[0600] A second type of model, wherein the second type of model includes an interpolation filter model used when decoding decoded non-adjacent blocks of the current block;

[0601] A third type of model, comprising historical interpolation filter models cached in the second candidate list in decoding order; wherein the historical interpolation filter model refers to a model used when decoding a block that has been decoded before the current block;

[0602] The fourth type of model includes an interpolation filter model used when decoding a decoded block on a reference frame of the current block.

[0603] Further, in some embodiments, the second generation module 3301 is configured to: determine at least one third interpolation filter model based on the reconstructed value of the reference area of ​​the current block; and generate a first candidate list based on the first interpolation filter model used when decoding the decoded block and the at least one third interpolation filter model.

[0604] In some embodiments, the second generation module 3301 is configured to: when the image frame where the current block is located is an intra-frame, fill the first candidate list in the order of the first type of model, the second type of model, and the third type of model.

[0605] In some embodiments, the second generation module 3301 is configured to: when the image frame where the current block is located is an inter-frame frame, fill the first candidate list in sequence according to the order of the first category model, the first subcategory model in the fourth category model, the second category model, the second subcategory model in the fourth category model, and the third category model; wherein the first subcategory model includes the interpolation filter model used when decoding the decoded block at the first predefined position to the right, below and / or lower right of the corresponding position of the current block on the reference frame; the second subcategory model includes the interpolation filter model used when decoding the decoded block at the second predefined position of the current block on the reference frame, and the second predefined position is the position after the first predefined position is offset by the available motion vector of the current block.

[0606] In some embodiments, the second determination module 3302 is configured to: reorder the interpolation filtering models in the first candidate list in order from small to large according to the prediction errors of the interpolation filtering models in the first candidate list on the template area of ​​the current block to obtain a third candidate list; and determine the second interpolation filtering model to be used for the current block based on the third candidate list.

[0607] In some embodiments, the third generation module 3305 is further configured to: determine a first index of the second interpolation filter model in the third candidate list; and write the first index into the bitstream.

[0608] In some embodiments, the third generation module 3305 is further configured to: intercept the first first number of interpolation filter models in the third candidate list to obtain a fourth candidate list; and determine the second index of the second interpolation filter model in the fourth candidate list; and write the second index into the code stream.

[0609] In some embodiments, the encoding device 33 further includes a cache module configured to cache the historical interpolation filter model in the second candidate list according to the first-in-first-out principle based on the encoding order of the blocks.

[0610] In some embodiments, the first number is equal to the current number of models in the second candidate list.

[0611] In some embodiments, the historical interpolation filter models in the second candidate list do not include the interpolation filter models in the first candidate list based on which blocks that have been decoded before the current block are based.

[0612] In some embodiments, the first number is equal to a first predefined number.

[0613] In some embodiments, the number of models in the first candidate list is equal to a second number, and the second number is greater than the first number.

[0614] In some embodiments, the second number is equal to a second predefined number.

[0615] In some embodiments, the second generation module 3301 is configured to end filling the first candidate list when the current number of models in the first candidate list is equal to the second number.

[0616] In some embodiments, the second generation module 3301 is configured to, after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, use a predefined interpolation filtering model to fill the number of models in the first candidate list to the second number.

[0617] In some embodiments, after completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, the first candidate list is not continued to be filled using the predefined interpolation filter model.

[0618] In some embodiments, the interpolation filter models in the first candidate list are different from each other.

[0619] In some embodiments, the interpolation filter models in the first candidate list that do not belong to the second candidate list are different from each other.

[0620] In some embodiments, the number of the first type of models in the first candidate list is less than or equal to a first threshold.

[0621] In some embodiments, the number of the second type of models in the first candidate list is less than or equal to a second threshold.

[0622] In some embodiments, the number of the third type of models in the first candidate list is less than or equal to a third threshold.

[0623] In some embodiments, the number of the fourth category of models in the first candidate list is less than or equal to a fourth threshold.

[0624] In some embodiments, the second determination module 3302 is configured to: perform intra-frame prediction on the template area of ​​the current block according to the interpolation filtering model in the first candidate list to obtain a first prediction value of the template area; and determine the prediction error of the corresponding interpolation filtering model based on the first prediction value of the template area and the reconstructed value of the template area.

[0625] In some embodiments, when a first input position of an interpolation filter model in the first candidate list is outside the template area, an input value of the first input position is equal to a reconstructed value at a sample position corresponding to the first input position.

[0626] In some embodiments, when the second input position of the interpolation filtering model in the first candidate list is located on the template area, the input value of the second input position is equal to the second predicted value or reconstructed value at the sample position corresponding to the second input position; wherein, the second predicted value is the predicted value obtained when decoding the sample corresponding to the second input position.

[0627] In some embodiments, the third generation module 3305 is further configured to: write first syntax identification information into the bitstream; wherein, when the first syntax identification information is equal to a first value, it indicates that the interpolation filter models in the first candidate list are reordered.

[0628] In some embodiments, when the first syntax identification information is equal to a second value, it indicates that the interpolation filter models in the first candidate list are not reordered.

[0629] In some embodiments, the third generation module 3305 is further configured to determine a third index of the second interpolation filter model in the first candidate list; and write the third index into the bitstream.

[0630] In some embodiments, the third generation module 3305 is further configured to write second syntax identification information into the bitstream; wherein, when the second syntax identification information is equal to a third value, it indicates that the method is used to determine the reconstructed block of the current block.

[0631] In some embodiments, the third generating module 3305 is configured to write the second syntax identification information into the codestream when at least one of the following conditions is met:

[0632] a first condition, the first condition including that the number of the first type of models is greater than or equal to a fifth threshold;

[0633] a second condition, the second condition including that the number of the second type of models is greater than or equal to a sixth threshold;

[0634] A third condition, the third condition including that the number of the third type of models is greater than or equal to a seventh threshold;

[0635] The fourth condition includes that the number of the fourth type of models is greater than or equal to an eighth threshold.

[0636] In some embodiments, when the number of interpolation filter models in the fourth candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the fourth candidate list.

[0637] In some embodiments, the third generation module 3305 is configured to write the second index into the bitstream when the number of interpolation filter models in the fourth candidate list is greater than 1, or when the number of interpolation filter models in the fourth candidate list is greater than 1 and the second syntax identification information is equal to the third numerical value.

[0638] In some embodiments, when the number of interpolation filter models in the first candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the first candidate list.

[0639] In some embodiments, the third generation module 3305 is configured to write the first index, the second index or the third index into the code stream when the number of interpolation filter models in the first candidate list is greater than 1, or when the number of interpolation filter models in the first candidate list is greater than 1 and the second syntax identification information is equal to the third numerical value.

[0640] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of this application, please refer to the description of the method embodiment of this application for understanding.

[0641] It should be noted that the division of modules in the device described in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation. In addition, the functional units in the various embodiments of the present application can be integrated into a processing unit, or they can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. It can also be implemented in the form of a combination of software and hardware.

[0642] It should be noted that, in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0643] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, it implements a coding and decoding method such as an encoder side, or implements a coding and decoding method such as a decoder side.

[0644] An embodiment of the present application provides a decoder, as shown in FIG34 , the decoder 34 includes: a first communication interface 3401, a first memory 3402, and a first processor 3403; each component is coupled together via a first bus system 3404. It is understood that the first bus system 3404 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 3404 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 3404 in FIG34 . Among them,

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

[0646] A first memory 3402 is used to store computer programs that can be run on the first processor 3403;

[0647] The first processor 3403 is configured to execute the decoding method described in the embodiment of the present application when running the computer program.

[0648] It is understood that the first memory 3402 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 3402 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0649] The first processor 3403 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 3403. The above-mentioned first processor 3403 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 3402 , and the first processor 3403 reads the information in the first memory 3402 and completes the steps of the above method in combination with its hardware.

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

[0651] Optionally, as another embodiment, the first processor 3403 is further configured to execute any one of the aforementioned method embodiments on the decoder side when running the computer program.

[0652] The present application implements an encoder, as shown in FIG35 , the encoder 35 includes: a second communication interface 3501, a second memory 3502, and a second processor 3503; each component is coupled together via a second bus system 3504. It is understood that the second bus system 3504 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 3504 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 3504 in FIG35 . Among them,

[0653] The second communication interface 3501 is used to receive and send signals when sending and receiving information with other external network elements;

[0654] The second memory 3502 is used to store computer programs that can be run on the second processor 3503;

[0655] The second processor 3503 is configured to execute the encoding method described in the embodiment of the present application when running the computer program.

[0656] Optionally, as another embodiment, the second processor 3503 is further configured to execute the aforementioned encoder side method embodiment when running the computer program.

[0657] It can be understood that the hardware functions of the second memory 3502 are similar to those of the first memory 3402, and the hardware functions of the second processor 3503 are similar to those of the first processor 3403; they will not be described in detail here.

[0658] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium, and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0659] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, they will not be repeated here.

[0660] The term "and / or" in this article is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, object A and / or object B can mean: object A exists alone, object A and object B exist at the same time, and object B exists alone.

[0661] It should be noted that, in this document, 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.

[0662] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.

[0663] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed across multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of this embodiment.

[0664] In addition, all functional modules in the embodiments of the present application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the above-mentioned integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0665] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0666] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.

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

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

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

[0670] The above is merely an 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.

Claims

1. A decoding method, the method being applied to a decoder, the method comprising: Generate a first candidate list according to a first interpolation filter model used when decoding the decoded block; Determining, according to the first candidate list, a second interpolation filter model to be used for the current block; Using the second interpolation filter model, performing intra-frame prediction on the current block to obtain a prediction block of the current block; The code stream is reconstructed according to the prediction block to obtain a reconstructed block of the current block.

2. The method according to claim 1, wherein: The first interpolation filter model includes at least one of the following: A first type of model, wherein the first type of model includes an interpolation filter model used when decoding a decoded neighboring block of the current block; A second type of model, wherein the second type of model includes an interpolation filter model used when decoding decoded non-adjacent blocks of the current block; A third type of model, the third type of model comprising historical interpolation filter models cached in the second candidate list in a decoding order; wherein the historical interpolation filter model refers to a model used when decoding a block that has been decoded before the current block; The fourth type of model includes an interpolation filter model used when decoding a decoded block on a reference frame of the current block.

3. The method according to claim 2, wherein: Also includes: Determining at least one third interpolation filter model according to the reconstruction value of the reference area of ​​the current block; A first candidate list is generated according to the first interpolation filter model used when decoding the decoded block and the at least one third interpolation filter model.

4. The method according to claim 2, wherein: When the image frame where the current block is located is an intra-frame, the first candidate list is filled in the order of the first type of model, the second type of model, and the third type of model.

5. The method according to claim 2, wherein: When the image frame where the current block is located is an inter-frame, the first candidate list is filled in the order of the first type of model, the first sub-type model in the fourth type of model, the second type of model, the second sub-type model in the fourth type of model, and the third type of model; wherein, The first subclass model comprises an interpolation filter model used when decoding a decoded block at a first predefined position to the right, below and / or to the lower right of a corresponding position of the current block on the reference frame; The second subclass model comprises an interpolation filter model used when decoding a decoded block at a second predefined position of the current block on the reference frame, wherein the second predefined position is a position after the first predefined position is offset by an available motion vector of the current block.

6. The method according to any one of claims 1 to 5, wherein: The step of determining, according to the first candidate list, a second interpolation filter model to be used for the current block comprises: reordering the interpolation filter models in the first candidate list according to the order of prediction errors of the interpolation filter models in the first candidate list on the template area of ​​the current block from small to large, to obtain a third candidate list; A second interpolation filter model to be used for the current block is determined according to the third candidate list.

7. The method according to claim 6, wherein: The step of determining, according to the third candidate list, a second interpolation filter model to be used for the current block comprises: Parse the bitstream to obtain the first index of the second interpolation filter model in the third candidate list; According to the first index, the second interpolation filter model is obtained from the third candidate list.

8. The method according to claim 6, wherein: The step of determining, according to the third candidate list, a second interpolation filter model to be used for the current block comprises: Intercepting the first first number of interpolation filter models in the third candidate list to obtain a fourth candidate list; Parse the bitstream to obtain a second index of the second interpolation filter model in the fourth candidate list; According to the second index, the second interpolation filter model is obtained from the fourth candidate list.

9. The method according to claim 8, wherein: Also includes: According to the reconstruction order of the blocks, the historical interpolation filter model is cached in the second candidate list according to the first-in-first-out principle.

10. The method according to claim 9, wherein: The first number is equal to the current number of models in the second candidate list.

11. The method according to claim 10, wherein: The historical interpolation filter models in the second candidate list do not include the interpolation filter models in the first candidate list that are used by blocks that have been decoded before the current block.

12. The method according to claim 8, wherein: The first number is equal to a first predefined number.

13. The method according to any one of claims 8 to 12, wherein: The number of models in the first candidate list is equal to a second number, and the second number is greater than the first number.

14. The method according to claim 13, wherein: The second number is equal to a second predefined number.

15. The method according to claim 13, wherein: When the current number of models in the first candidate list is equal to the second number, filling of the first candidate list is finished.

16. The method according to claim 15, wherein: After completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, a predefined interpolation filtering model is used to fill the number of models in the first candidate list to the second number.

17. The method according to claim 15, wherein: After completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, the first candidate list is continued to be filled without using the predefined interpolation filter model.

18. The method according to any one of claims 2 to 17, wherein: The interpolation filter models in the first candidate list are different from each other.

19. The method according to any one of claims 2 to 17, wherein: The interpolation filter models in the first candidate list that do not belong to the second candidate list are different from each other.

20. The method according to any one of claims 2 to 17, wherein: The number of the first type of models in the first candidate list is less than or equal to a first threshold.

21. The method according to any one of claims 2 to 17, wherein: The number of the second type of models in the first candidate list is less than or equal to a second threshold.

22. The method according to any one of claims 2 to 17, wherein: The number of the third type of models in the first candidate list is less than or equal to a third threshold.

23. The method according to any one of claims 2 to 17, wherein: The number of the fourth type of models in the first candidate list is less than or equal to a fourth threshold.

24. The method according to claim 6, wherein: Also includes: Performing intra-frame prediction on the template region of the current block according to the interpolation filter model in the first candidate list to obtain a first prediction value of the template region; A prediction error of a corresponding interpolation filter model is determined according to the first prediction value of the template region and the reconstructed value of the template region.

25. The method according to claim 24, wherein: In the case where the first input position of the interpolation filter model in the first candidate list is outside the template area, The input value of the first input position is equal to the reconstructed value at the sample position corresponding to the first input position.

26. The method according to claim 24 or 25, wherein: In the case where the second input position of the interpolation filter model in the first candidate list is located on the template area, The input value of the second input position is equal to a second predicted value or a reconstructed value at the sample position corresponding to the second input position; wherein the second predicted value is a predicted value obtained when decoding the sample corresponding to the second input position.

27. The method according to claim 6, wherein: Also includes: Parsing the code stream to obtain first syntax identification information; When the first syntax identification information is equal to a first value, the interpolation filter models in the first candidate list are reordered.

28. The method according to claim 27, wherein: When the first syntax identification information is equal to a second value, the interpolation filter models in the first candidate list are not reordered.

29. The method according to claim 28, wherein: The step of determining, according to the first candidate list, a second interpolation filter model to be used for the current block comprises: Parsing the bitstream to obtain a third index of the second interpolation filter model in the first candidate list; According to the third index, the second interpolation filter model is obtained from the first candidate list.

30. The method according to any one of claims 1 to 29, wherein: Also includes: Parsing the code stream to obtain second syntax identification information; When the second syntax identification information is equal to a third value, the decoding method is used to determine a reconstructed block of the current block.

31. The method according to claim 30, wherein: When at least one of the following conditions is met, the code stream is parsed to obtain the second syntax identification information: A first condition, wherein the first condition includes that the number of the first type of models is greater than or equal to a fifth threshold; a second condition, the second condition comprising that the number of the second type of models is greater than or equal to a sixth threshold; A third condition, the third condition comprising that the number of the third type of models is greater than or equal to a seventh threshold; The fourth condition includes that the number of the fourth type of models is greater than or equal to an eighth threshold.

32. The method of claim 30, wherein: When the number of interpolation filter models in the fourth candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the fourth candidate list.

33. The method of claim 30, wherein: When the number of interpolation filter models in the fourth candidate list is greater than 1, or when the number of interpolation filter models in the fourth candidate list is greater than 1 and the second grammar identification information is equal to the third value, parse the code stream to obtain a second index.

34. The method of claim 30, wherein: When the number of interpolation filter models in the first candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the first candidate list.

35. The method of claim 30, wherein: When the number of interpolation filter models in the first candidate list is greater than 1, or when the number of interpolation filter models in the first candidate list is greater than 1 and the second grammar identification information is equal to the third value, parse the code stream to obtain the first index, the second index or the third index.

36. The method according to any one of claims 1 to 35, wherein: The reconstructing the code stream according to the prediction block to obtain the reconstructed block of the current block includes: Parsing a bitstream to obtain a residual block of the current block; A reconstructed block of the current block is obtained by reconstructing the predicted block and the residual block.

37. A coding method, the method being applied to an encoder, the method comprising: Generate a first candidate list according to a first interpolation filter model used when decoding the decoded block; Determining, according to the first candidate list, a second interpolation filter model to be used for the current block; Using the second interpolation filter model, performing intra-frame prediction on the current block to obtain a prediction block of the current block; Determine a residual block of the current block according to the prediction block; A code stream is generated according to the residual block.

38. The method of claim 37, wherein: The first interpolation filter model includes at least one of the following: A first type of model, wherein the first type of model includes an interpolation filter model used when decoding a decoded neighboring block of the current block; A second type of model, wherein the second type of model includes an interpolation filter model used when decoding decoded non-adjacent blocks of the current block; A third type of model, the third type of model comprising historical interpolation filter models cached in the second candidate list in a decoding order; wherein the historical interpolation filter model refers to a model used when decoding a block that has been decoded before the current block; The fourth type of model includes an interpolation filter model used when decoding a decoded block on a reference frame of the current block.

39. The method of claim 38, wherein: Also includes: Determining at least one third interpolation filter model according to the reconstruction value of the reference area of ​​the current block; A first candidate list is generated according to the first interpolation filter model used when decoding the decoded block and the at least one third interpolation filter model.

40. The method of claim 38, wherein: When the image frame where the current block is located is an intra-frame, the first candidate list is filled in the order of the first type of model, the second type of model, and the third type of model.

41. The method of claim 38, wherein: When the image frame where the current block is located is an inter-frame, the first candidate list is filled in the order of the first type of model, the first sub-type model in the fourth type of model, the second type of model, the second sub-type model in the fourth type of model, and the third type of model; wherein, The first subclass model comprises an interpolation filter model used when decoding a decoded block at a first predefined position to the right, below and / or to the lower right of a corresponding position of the current block on the reference frame; The second subclass model comprises an interpolation filter model used when decoding a decoded block at a second predefined position of the current block on the reference frame, wherein the second predefined position is a position after the first predefined position is offset by an available motion vector of the current block.

42. The method according to any one of claims 37 to 41, wherein: The step of determining, according to the first candidate list, a second interpolation filter model to be used for the current block comprises: reordering the interpolation filter models in the first candidate list according to the order of prediction errors of the interpolation filter models in the first candidate list on the template area of ​​the current block from small to large, to obtain a third candidate list; A second interpolation filter model to be used for the current block is determined according to the third candidate list.

43. The method of claim 42, wherein: Also includes: Determine a first index of the second interpolation filter model in the third candidate list; The first index is written into the bitstream.

44. The method of claim 42, wherein: Also includes: Intercepting the first first number of interpolation filter models in the third candidate list to obtain a fourth candidate list; Determine a second index of the second interpolation filter model in the fourth candidate list; The second index is written into the bitstream.

45. The method of claim 44, wherein: Also includes: According to the coding order of the blocks, the historical interpolation filter model is cached in the second candidate list according to the first-in-first-out principle.

46. ​​The method of claim 45, wherein: The first number is equal to the current number of models in the second candidate list.

47. The method of claim 46, wherein: The historical interpolation filter models in the second candidate list do not include the interpolation filter models in the first candidate list that are used by blocks that have been decoded before the current block.

48. The method of claim 44, wherein: The first number is equal to a first predefined number.

49. The method according to any one of claims 44 to 48, wherein: The number of models in the first candidate list is equal to a second number, and the second number is greater than the first number.

50. The method of claim 49, wherein: The second number is equal to a second predefined number.

51. The method of claim 49, wherein: When the current number of models in the first candidate list is equal to the second number, filling of the first candidate list is finished.

52. The method of claim 51, wherein: After completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, a predefined interpolation filtering model is used to fill the number of models in the first candidate list to the second number.

53. The method of claim 51, wherein: After completing the model filling of the first candidate list, if the number of models in the first candidate list is less than the second number, the first candidate list is continued to be filled without using the predefined interpolation filter model.

54. A method according to any one of claims 38 to 53, wherein: The interpolation filter models in the first candidate list are different from each other.

55. A method according to any one of claims 38 to 53, wherein: The interpolation filter models in the first candidate list that do not belong to the second candidate list are different from each other.

56. A method according to any one of claims 38 to 53, wherein: The number of the first type of models in the first candidate list is less than or equal to a first threshold.

57. A method according to any one of claims 38 to 53, wherein: The number of the second type of models in the first candidate list is less than or equal to a second threshold.

58. A method according to any one of claims 38 to 53, wherein: The number of the third type of models in the first candidate list is less than or equal to a third threshold.

59. The method according to any one of claims 38 to 53, wherein: The number of the fourth type of models in the first candidate list is less than or equal to a fourth threshold.

60. The method of claim 42, wherein: Also includes: Performing intra-frame prediction on the template region of the current block according to the interpolation filter model in the first candidate list to obtain a first prediction value of the template region; A prediction error of a corresponding interpolation filter model is determined according to the first prediction value of the template region and the reconstructed value of the template region.

61. The method of claim 60, wherein: In the case where the first input position of the interpolation filter model in the first candidate list is outside the template area, The input value of the first input position is equal to the reconstructed value at the sample position corresponding to the first input position.

62. The method of claim 60 or 61, wherein: In the case where the second input position of the interpolation filter model in the first candidate list is located on the template area, The input value of the second input position is equal to a second predicted value or a reconstructed value at the sample position corresponding to the second input position; wherein the second predicted value is a predicted value obtained when decoding the sample corresponding to the second input position.

63. The method of claim 42, wherein: Also includes: The first syntax identification information is written into the bitstream; wherein, when the first syntax identification information is equal to a first value, it indicates that the interpolation filter models in the first candidate list are reordered.

64. The method of claim 63, wherein: When the first syntax identification information is equal to a second value, it indicates that the interpolation filter models in the first candidate list are not reordered.

65. The method of claim 64, wherein: Also includes: Determine a third index of the second interpolation filter model in the first candidate list; The third index is written into the bitstream.

66. A method according to any one of claims 37 to 65, wherein: Also includes: Writing the second syntax identification information into the bitstream; wherein, when the second syntax identification information is equal to the third value, it indicates that the method is used to determine the reconstructed block of the current block.

67. The method of claim 66, wherein: When at least one of the following conditions is met, the second syntax identification information is written into the codestream: A first condition, wherein the first condition includes that the number of the first type of models is greater than or equal to a fifth threshold; a second condition, the second condition comprising that the number of the second type of models is greater than or equal to a sixth threshold; A third condition, the third condition comprising that the number of the third type of models is greater than or equal to a seventh threshold; The fourth condition includes that the number of the fourth type of models is greater than or equal to an eighth threshold.

68. The method of claim 66, wherein: When the number of interpolation filter models in the fourth candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the fourth candidate list.

69. The method of claim 66, wherein: When the number of interpolation filter models in the fourth candidate list is greater than 1, or when the number of interpolation filter models in the fourth candidate list is greater than 1 and the second syntax identification information is equal to the third value, the second index is written into the code stream.

70. The method of claim 66, wherein: When the number of interpolation filter models in the first candidate list is equal to 1, the second interpolation filter model is equal to the interpolation filter model in the first candidate list.

71. The method of claim 66, wherein: When the number of interpolation filter models in the first candidate list is greater than 1, or when the number of interpolation filter models in the first candidate list is greater than 1 and the second syntax identification information is equal to the third value, the first index, the second index or the third index is written into the code stream.

72. A decoding device, applied to a decoder, the device comprising: A first generating module, configured to generate a first candidate list according to a first interpolation filter model used when decoding the decoded block; A first determining module, configured to determine a second interpolation filter model to be used for the current block according to the first candidate list; A first prediction module is configured to use the second interpolation filter model to perform intra-frame prediction on the current block to obtain a prediction block of the current block; The reconstruction module is configured to reconstruct the code stream according to the prediction block to obtain a reconstructed block of the current block.

73. A decoder 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 1 to 36 when running the computer program.

74. An encoding device, applied to an encoder, the device comprising: A second generating module is configured to generate a first candidate list according to a first interpolation filter model used when decoding the decoded block; A second determination module, configured to determine a second interpolation filter model to be used for the current block according to the first candidate list; a second prediction module, configured to use the second interpolation filter model to perform intra-frame prediction on the current block to obtain a prediction block of the current block; A third determination module, configured to determine a residual block of the current block according to the prediction block; The third generating module is configured to generate a code stream according to the residual block.

75. An encoder 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 used to execute the method according to any one of claims 37 to 71 when running the computer program.

76. A code stream, wherein the code stream is generated by executing the encoding method described in any one of claims 37 to 71 on a current block.

77. An electronic device comprising: a processor adapted to execute a computer program; A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by the processor, implements the method as described in any one of claims 1 to 36, or the computer program, when executed by the processor, implements the method as described in any one of claims 37 to 71.

78. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the method according to any one of claims 1 to 36, or implements the method according to any one of claims 37 to 71.