Encoding method, decoding method, bitstream, encoder, decoder, and storage medium

By optimizing the candidate list and filter parameter calculation of intra-frame prediction technology, the problem of poor applicability of filter coefficients in existing technologies is solved, thereby improving the compression efficiency and performance of video encoding and decoding.

WO2025260299A1PCT designated stage Publication Date: 2025-12-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/100239
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing video coding standards, when using methods such as Cholesky decomposition, LDL decomposition, or Gaussian elimination to solve for filter coefficients, the training process is not comprehensive enough, resulting in poor applicability of the filter in the prediction region and reduced encoding and decoding performance.

Method used

By determining the candidate list and regularization parameters for the current block, the cost of the filtering parameters is calculated, the applicability of the filter coefficients is optimized, and the prediction accuracy is improved, including parsing the syntax elements in the bitstream to indicate whether intra-frame prediction is used for the current block.

Benefits of technology

It improves the compression efficiency and performance of video encoding and decoding, enhances the applicability of filters in the prediction region, and improves the overall performance of encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024100239_26122025_PF_FP_ABST
    Figure CN2024100239_26122025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium. The method comprises: parsing a first syntax element in a bitstream; when the first syntax element indicates that the current block uses a first intra prediction technology, parsing a second syntax element in the bitstream and a mode index of the current block; when the second syntax element indicates that the current block does not use a merge mode of the first intra prediction technology, determining a first candidate list of the current block; determining mode information of the current block on the basis of the first candidate list and the mode index; determining filtering parameters of the current block on the basis of the mode information and regularization parameters; and performing prediction on the current block on the basis of the filtering parameters to determine a predicted block of the current block. In this way, the encoding and decoding performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding / decoding methods, bitstreams, encoders, decoders, and storage media Technical Field

[0001] This application relates to the field of video encoding and decoding technology, and in particular to an encoding and decoding method, a bitstream, an encoder, a decoder, and a storage medium. Background Technology

[0002] As people's demands for video display quality have increased, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information, thus requiring more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.

[0003] In video coding standards, for the Enhanced Compression Model (ECM) reference software, the tools that use methods such as Cholesky decomposition, LDL matrix decomposition, or Gaussian elimination to solve for various coefficients have not been fully considered during the training process, resulting in coefficients that are not good enough and cannot be well applied to the prediction region, thus reducing encoding and decoding performance.

[0004] Summary of the Invention

[0005] This application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium, which can improve encoding / decoding performance.

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

[0007] In a first aspect, embodiments of this application provide a decoding method applied to a decoder, the method comprising:

[0008] Parse the first syntax element in the bitstream;

[0009] When the first syntax element indicates that the current block uses the first intra-frame prediction technique, the second syntax element in the bitstream and the mode index of the current block are parsed.

[0010] When the second syntax element indicates that the current block does not use the merge mode of the first intra-frame prediction technique, the first candidate list of the current block is determined;

[0011] Based on the first candidate list and the pattern index, determine the pattern information of the current block;

[0012] Based on the pattern information and regularization parameters, determine the filtering parameters for the current block;

[0013] The current block is predicted based on the filtering parameters to determine the prediction block for the current block.

[0014] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:

[0015] Determine the first candidate list corresponding to the merging mode when the current block does not use the first intra-frame prediction technique, determine at least one set of first candidate filtering parameters based on at least one set of candidate mode information in the first candidate list and regularization parameters, and determine the first cost result corresponding to each of the at least one set of first candidate filtering parameters.

[0016] Determine the second candidate list corresponding to the merging mode when the current block uses the first intra-frame prediction technique, and determine the second cost result corresponding to at least one set of second candidate filter parameters in the second candidate list;

[0017] Determine the third cost result corresponding to the use of prediction techniques other than the first intra-frame prediction technique for the current block;

[0018] Based on the first cost result, the second cost result, and the third cost result, the value of the first syntax element is determined, wherein the first syntax element is used to indicate whether the current block uses the first intra-frame prediction technique;

[0019] The value of the first syntax element is encoded, and the resulting encoded bits are written into the bitstream.

[0020] Thirdly, embodiments of this application provide a bitstream that is generated by bit encoding according to the encoding method described in the second aspect; wherein the information to be encoded in the encoding method includes at least one of the following: the value of a first syntax element, the value of a second syntax element, and the pattern index of the current block;

[0021] The first syntax element indicates whether the current block uses the first intra-frame prediction technique, and the second syntax element indicates whether the current block uses the merging mode of the first intra-frame prediction technique.

[0022] Fourthly, embodiments of this application provide an encoder, which includes a first determining unit and an encoding unit, wherein:

[0023] The first determining unit is configured to: determine a first candidate list corresponding to the merging mode when the current block does not use the first intra-frame prediction technique; determine at least one set of first candidate filtering parameters based on at least one set of candidate mode information and regularization parameters in the first candidate list; and determine a first cost result corresponding to each of the at least one set of first candidate filtering parameters; determine a second candidate list corresponding to the merging mode when the current block uses the first intra-frame prediction technique; and determine a second cost result corresponding to each of the at least one set of second candidate filtering parameters in the second candidate list; and determine a third cost result corresponding to the current block using prediction techniques other than the first intra-frame prediction technique.

[0024] The first determining unit is further configured to determine the value of the first syntax element based on the first cost result, the second cost result, and the third cost result, wherein the first syntax element is used to indicate whether the current block uses the first intra-frame prediction technique;

[0025] The encoding unit is configured to encode the value of the first syntax element and write the resulting encoded bits into the bitstream.

[0026] Fifthly, embodiments of this application provide an encoder, which includes a first memory and a first processor, wherein:

[0027] A first memory for storing computer programs that can run on a first processor;

[0028] A first processor is configured to execute the steps of the encoding method as described in the second aspect when running a computer program.

[0029] Sixthly, embodiments of this application provide a decoder, which includes a parsing unit, a second determining unit, and a second predicting unit, wherein:

[0030] The parsing unit is configured to parse the first syntax element in the bitstream; and when the first syntax element indicates that the current block uses the first intra-frame prediction technique, it parses the second syntax element in the bitstream and the mode index of the current block.

[0031] The second determining unit is configured to, when the second syntax element indicates that the current block does not use the merging mode of the first intra-frame prediction technique, determine the first candidate list of the current block; determine the mode information of the current block based on the first candidate list and the mode index; and determine the filtering parameters of the current block based on the mode information and the regularization parameters.

[0032] The second prediction unit is configured to predict the current block based on the filtering parameters and determine the prediction block for the current block.

[0033] In a seventh aspect, embodiments of this application provide a decoder, which includes a second memory and a second processor, wherein:

[0034] The second memory is used to store computer programs that can run on the second processor;

[0035] The second processor is configured to execute the steps of the decoding method as described in the first aspect when running a computer program.

[0036] Eighthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the decoding method as described in the first aspect, or the steps of the encoding method as described in the second aspect.

[0037] In a ninth aspect, embodiments of this application provide a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the decoding method as described in the first aspect, or the steps of the encoding method as described in the second aspect.

[0038] This application provides an encoding / decoding method, a bitstream, an encoder, a decoder, and a storage medium. At the encoding end, a first candidate list is determined when the current block does not use a merging mode with the first intra-frame prediction technique. At least one set of first candidate filtering parameters is determined based on at least one set of candidate mode information and regularization parameters in the first candidate list, and a first cost result is determined for each of the at least one set of first candidate filtering parameters. A second candidate list is determined when the current block uses a merging mode with the first intra-frame prediction technique, and a second cost result is determined for each of the at least one set of second candidate filtering parameters in the second candidate list. A third cost result is determined for the current block using prediction techniques other than the first intra-frame prediction technique. Based on the first cost result, the second cost result, and the third cost result, the value of a first syntax element is determined. The first syntax element indicates whether the current block uses the first intra-frame prediction technique. The value of the first syntax element is encoded, and the resulting encoded bits are written into the bitstream. At the decoding end, the first syntax element in the bitstream is parsed; when the first syntax element indicates that the current block uses the first intra-frame prediction technique, the second syntax element in the bitstream and the mode index of the current block are parsed; when the second syntax element indicates that the current block does not use the first intra-frame prediction technique in a merging mode, the first candidate list of the current block is determined; based on the first candidate list and the mode index, the mode information of the current block is determined; based on the mode information and regularization parameters, the filtering parameters of the current block are determined; and based on the filtering parameters, the current block is predicted to determine the prediction block of the current block. Thus, when the current block uses the first intra-frame prediction technique and does not use the first intra-frame prediction technique in a merging mode, the first candidate list of the current block is determined. Then, based on the first candidate list and the mode index obtained from parsing the bitstream, the mode information of the current block, such as the template region and the shape of the filter, can be determined. Then, based on the mode information and regularization parameters, the coefficients of the filter in the filtering parameters can be determined, thereby improving the generalization ability and making the filter coefficients more applicable to the prediction of the current block. Predicting the current block based on the filter coefficients and the filter shape can improve the prediction accuracy of the current block, thereby improving compression efficiency and ultimately enhancing encoding and decoding performance. Attached Figure Description

[0039] Figure 1A is a schematic diagram of the filter shape.

[0040] Figure 1B is a schematic diagram of the filter shape.

[0041] Figure 1C is a schematic diagram of the filter shape;

[0042] Figure 2A is a schematic diagram of the training area for EIP prediction.

[0043] Figure 2B is a schematic diagram of the training area for EIP prediction.

[0044] Figure 2C is a schematic diagram of the training area for EIP prediction.

[0045] Figure 3 shows the positions of the adjacent and non-adjacent blocks of the current block;

[0046] Figure 4 is a schematic diagram of a video encoding and decoding network architecture provided in an embodiment of this application;

[0047] Figure 5 is a schematic block diagram of an encoder provided in an embodiment of this application;

[0048] Figure 6 is a schematic block diagram of a decoder provided in an embodiment of this application;

[0049] Figure 7 is a schematic flowchart of a decoding method provided in an embodiment of this application;

[0050] Figure 8 is a schematic flowchart of a decoding method provided in an embodiment of this application;

[0051] Figure 9 is a schematic flowchart of a decoding method provided in an embodiment of this application;

[0052] Figure 10 is a schematic flowchart of a decoding method provided in an embodiment of this application;

[0053] Figure 11 is a schematic flowchart of an encoding method provided in an embodiment of this application;

[0054] Figure 12 is a schematic flowchart of an encoding method provided in an embodiment of this application;

[0055] Figure 13 is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application;

[0056] Figure 14 is a schematic diagram of the hardware structure of an encoder provided in an embodiment of this application;

[0057] Figure 15 is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application;

[0058] Figure 16 is a schematic diagram of the hardware structure of a decoder provided in an embodiment of this application;

[0059] Figure 17 is a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application. Detailed Implementation

[0060] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0062] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is 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.

[0063] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0064] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application will be explained. The nouns and terms used in the embodiments of this application shall be interpreted as follows:

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

[0066] VVC's reference software testing platform (VVC Test Model, VTM);

[0067] Enhanced Compression Model (ECM);

[0068] Joint Video Experts Team (JVET);

[0069] Coding Unit (CU);

[0070] Coding Tree Unit (CTU);

[0071] Largest Coding Unit (LCU);

[0072] Prediction Unit (PU);

[0073] Transform Unit (TU);

[0074] Merge pattern;

[0075] Extrapolation filter-based Intra Prediction (EIP);

[0076] Convolutional Cross-Component Model (CCCM)

[0077] Template Matching Prediction (TMP);

[0078] Bi-prediction with CU-level weight (BCW);

[0079] Sum of Absolute Difference (SAD);

[0080] Sum of Absolute Transform-based Difference (SATD)

[0081] Currently, common video codec standards (such as H.266 / VVC) employ a block-based hybrid coding framework. Each image, sub-image, or frame in the video is divided into maximum coding units (MCUs) of the same size (e.g., 128×128, 64×64, etc.). Each MCU can be further divided into rectangular coding units according to rules. Coding units may also be divided into prediction units, transform units, etc. The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, inverse quantization, inverse transform, and in-loop filtering. The prediction module can include intra-prediction and inter-prediction, with inter-prediction including motion estimation and motion compensation. Because there is a strong correlation between adjacent pixels in an image of a video, intra-prediction is used in video codec technology to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in a video, inter-frame prediction methods are used in video encoding and decoding technology to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0082] The basic workflow of a video codec is as follows: At the encoding end, a frame is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. The original image block of the current block is subtracted from the prediction block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. The quantization coefficient matrix is ​​entropy-encoded and output to the bitstream. At the decoding end, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. On the other hand, the bitstream is parsed to obtain the quantization coefficient matrix. The quantization coefficient matrix is ​​inverse-quantized and inverse-transformed to obtain a residual block. The prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. Loop filtering is performed on the reconstructed image based on the image or based on the blocks to obtain a decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. The decoded image can serve as a reference frame for inter-frame prediction in subsequent frames. The block division information, prediction, transformation, quantization, entropy coding, loop filtering, and other mode or parameter information determined at the encoding end need to be output to the bitstream if necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoding end by parsing the bitstream and analyzing existing information. This ensures that the decoded image obtained by the encoding end is the same as that obtained by the decoding end. The decoded image obtained by the encoding end is usually 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. The above is the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. The embodiments of this application are applicable to the basic flow of a video codec under this block-based hybrid coding framework, but are not limited to this framework and flow.

[0083] In this embodiment, the current block (CB) can be the current coding unit, the current prediction unit, or the current transform unit, etc. Due to the need for parallel processing, an image can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning they have no data dependency. A "frame" is a commonly used term, generally understood as an image. In this embodiment, the term "frame" can also be replaced with an image or a slice, etc.

[0084] The Joint Video Coding Standards Organization (JVET) has established a group to research a coding model that surpasses the H.266 / VVC model, and has named this model, or platform test software, ECM. ECM builds upon VTM and incorporates newer and more efficient compression algorithms, currently exceeding VVC's coding performance by approximately 13%. ECM not only increases the coding unit size at specific resolutions but also integrates many module enhancement techniques, representing a significant algorithmic shift compared to VVC.

[0085] The following section provides a detailed introduction to the relevant technologies for EIP prediction.

[0086] EIP prediction is a new technology that only appears in the ECM stage. Its core idea is to diffuse existing texture information to areas that have not yet been predicted, which is similar to the function of the diffusion filter in the VVC stage.

[0087] (1) Computation-based EIP prediction.

[0088] Unlike angle prediction in traditional intra-frame prediction, EIP uses two-dimensional filters to perform prediction filtering on the current block. There are three sets of two-dimensional filters with different shapes, and the coefficients of these filters are all obtained by training on the reconstructed samples of the surrounding blocks. The training process is consistent with CCCM technology and can be solved using Cholesky's solution, LDL decomposition, Gaussian elimination, or any other method.

[0089] As shown in Figures 1A, 1B, and 1C, three EIP filter shapes are provided: square, horizontal rectangle, and vertical rectangle. The grid-filled portion is the filter's input, and the white-filled portion is the output, with 15 taps corresponding to 15 filter coefficients. EIP prediction has a time delay. For example, when predicting the first sample point in the top left corner of the current block, using the first square filter requires the three reconstructed sample points directly above, three reconstructed sample points directly to the left, and the reconstructed sample points of the 3×3 square in the top left corner as input to calculate the first predicted sample point in the top left corner of the current block. Similarly, predicting the first sample point in the second row of the current block requires the one predicted sample point directly above, two adjacent reconstructed sample points directly above, and 3×4 reconstructed sample points to the left as input to calculate the first sample point in the second row. Therefore, it can be seen that the second predicted sample point depends on the first predicted sample point, meaning the prediction has a time delay. To reduce this latency, the diagonal and other scan orders can be used as the prediction order within the current block, so that the prediction of all points on the diagonal does not depend on other points on the same diagonal as EIP input, thus enabling parallel processing on the same diagonal.

[0090] Here, the formula for calculating EIP prediction is as follows:

[0091] In the above formula (1), pred (x,y) For the predicted sample point located at coordinates (x, y) within the current block, c i These are the filter coefficients. To reconstruct or predict sample points, EIP calculates these filter coefficients using a linear model and Gaussian elimination, as shown in the following formula:

[0092] Transforming the above formula (2) yields:

[0093] Where A is the matrix of input samples, and y is the matrix of output samples. This is a matrix of filter coefficients.

[0094] In addition, EIP prediction provides three templates for training these filter coefficients, as shown in Figures 2A, 2B, and 2C. In Figure 2A, the training region includes the left and top templates of the current block; in Figure 2B, the training region includes the top template of the current block; and in Figure 2C, the training region includes the left template of the current block. These training regions can also be referred to as template regions.

[0095] As shown in Figures 2A, 2B, and 2C, taking a square filter as an example, fWidth represents the width of the square filter, and fHeight represents its height. In Figure 2A, leftSize represents the width of the left template, i.e., the number of columns to the left of the current block; aboveSize represents the height of the upper template, i.e., the number of rows above the current block. The size of the template region can be determined based on leftSize and aboveSize. The square filter scans within this template region to acquire the corresponding input and output samples. In Figure 2B, for the upper template, leftSize represents the number of columns to the left of the current block, and aboveSize represents the number of rows above the current block. The size of the upper template region can be determined based on leftSize and aboveSize. The square filter scans within this template region to acquire the corresponding input and output samples. In Figure 2C, for the left template, leftSize represents the number of columns to the left of the current block, and aboveSize represents the number of rows above the current block. The size of the left template region can be determined based on leftSize and aboveSize. The square filter scans this template region to obtain the corresponding input and output samples.

[0096] (2) EIP forecast based on merging.

[0097] EIP technology can also obtain the filter coefficients of the EIP filter by merging information from neighboring, non-neighboring, historical lists, and temporally co-located blocks, thus constructing an EIP list. This EIP list starts empty, and the construction process is shown in Figure 3, similar to the list construction process of the Inter-Merge Mode. In Figure 3, the black-filled blocks represent the current block, and the blocks labeled 1-5 are called neighboring blocks of the current block; the remaining labeled blocks are called non-neighboring blocks of the current block.

[0098] First, the EIP merging mode obtains the EIP information of adjacent and non-adjacent blocks in the spatial domain and adds them to the EIP list. By searching the positions shown in Figure 3, it sequentially checks whether the corresponding labeled coded blocks use EIP technology. If EIP technology is used, it obtains the EIP information corresponding to that position, which may include filter shape and filter coefficients. Then, it checks for duplicates with the EIP candidate patterns in the EIP list. If both the filter shape and filter coefficients are the same as a candidate pattern in the EIP list, it is not added to the EIP list; otherwise, it is added.

[0099] Secondly, the EIP merging mode checks whether time-domain information can be used. If the condition is met, it obtains the EIP information of the co-position block in the reference frame and the EIP information of the co-position block with the offset motion vector. A deduplication operation is also performed; if it does not appear before, it is added to the EIP list. Here, the reference frame can be a co-position frame obtained from reference list 0, and / or, it can also be a co-position frame obtained from reference list 1.

[0100] Finally, the EIP merging mode retrieves EIP information from the EIP history list. The EIP history list is constructed according to the same rules during encoding and decoding, and it only stores EIP information. The EIP merging mode retrieves the latest EIP candidate information from this history list and checks for duplicates; if no duplicates are found, it adds the candidate to the EIP list. At the encoding end, after each EIP is selected as the encoding mode for the current block, the EIP information is saved to the EIP history list. If the EIP history list is full, it is updated using a first-in, first-out (FIFO) principle, removing the earliest candidate added to the EIP history list to keep it updated. Similarly, after completing EIP prediction, the decoding end also needs to save the corresponding EIP information to the EIP history list, maintaining its update.

[0101] After constructing the EIP list for the EIP merging pattern, the adjacent reconstructed samples around the current block are used as template regions. The EIP information of the candidate EIP list is used to predict the template regions, and the corresponding template region prediction blocks are obtained for each candidate pattern. The SAD or SATD cost between the template prediction block and the template reconstruction block is calculated, and then the EIP list can be sorted to obtain the sorted EIP list.

[0102] The encoder iterates through the sorted EIP list to find the EIP candidates, calculates the rate-distortion cost between the predicted block and the original image block for each candidate based on the current block, and the EIP candidate with the lowest cost is the optimal candidate for this merging mode. The corresponding candidate index is written into the bitstream and transmitted to the decoder.

[0103] Understandably, in machine learning, inappropriate settings of training parameters or training samples can easily lead to overfitting. In practical applications, regularization methods are typically used to introduce additional information into the model's computation, improving its generalization ability and preventing overtraining and overfitting.

[0104] Current ECM reference software, including tools that use Cholesky decomposition, LDL decomposition, or Gaussian elimination to solve for various coefficients, also suffers from problems such as insufficient training samples, resulting in suboptimal coefficients. Alternatively, it can be understood as overtraining causing the trained coefficients to perform well only in the reconstructed sample region, failing to apply to the prediction region and thus reducing encoding / decoding performance.

[0105] Based on this, embodiments of this application provide an encoding method that: determines a first candidate list corresponding to a merging mode when the current block does not use the first intra-frame prediction technique; determines at least one set of first candidate filtering parameters based on at least one set of candidate mode information and regularization parameters in the first candidate list; and determines a first cost result corresponding to each of the at least one set of first candidate filtering parameters; determines a second candidate list corresponding to a merging mode when the current block uses the first intra-frame prediction technique; and determines a second cost result corresponding to each of the at least one set of second candidate filtering parameters in the second candidate list; determines a third cost result corresponding to the current block using prediction techniques other than the first intra-frame prediction technique; determines the value of a first syntax element based on the first cost result, the second cost result, and the third cost result, wherein the first syntax element is used to indicate whether the current block uses the first intra-frame prediction technique; and encodes the value of the first syntax element, writing the obtained encoded bits into the bitstream. This application also provides a decoding method, which involves parsing a first syntax element in the bitstream; when the first syntax element indicates that the current block uses a first intra-frame prediction technique, parsing a second syntax element in the bitstream and the mode index of the current block; when the second syntax element indicates that the current block does not use a merging mode of the first intra-frame prediction technique, determining a first candidate list for the current block; determining the mode information of the current block based on the first candidate list and the mode index; determining the filtering parameters of the current block based on the mode information and regularization parameters; and predicting the current block based on the filtering parameters to determine the prediction block of the current block.

[0106] In this way, when the current block uses the first intra-frame prediction technique and the current block does not use the first intra-frame prediction technique in the merging mode, the first candidate list of the current block is determined. Then, based on the first candidate list and the mode index obtained by parsing the bitstream, the mode information of the current block, such as the template region and the shape of the filter, can be determined. Then, based on the mode information and the regularization parameters, the coefficients of the filter in the filtering parameters can be determined, thereby improving the generalization ability and making the filter coefficients more applicable to the prediction of the current block. In this way, predicting the current block based on the filter coefficients and the shape of the filter can improve the prediction accuracy of the current block, thereby improving the compression efficiency and thus improving the encoding and decoding performance.

[0107] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0108] Figure 4 is a schematic diagram of a video encoding and decoding network architecture provided in an embodiment of this application. As shown in Figure 4, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. The electronic devices can be various types of devices with video encoding and decoding capabilities, such as mobile phones, tablets, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, servers, etc., and this embodiment of the application does not limit the scope of the application.

[0109] This application provides a network architecture for a video encoding / decoding system that includes decoding and encoding methods. The decoder or encoder in this application can be the aforementioned electronic device. That is, the electronic device in this application has video encoding / decoding capabilities and generally includes a video / image encoder (referred to as an encoder) and a video / image decoder (referred to as a decoder).

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

[0111] Figure 6 is a schematic block diagram of a decoder provided in an embodiment of this application. As shown in Figure 6, the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc. The decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding processing shown in Figure 5, the bitstream of the video signal is output. This bitstream is input into the decoder 200, first passing through the decoding unit 201 to obtain the decoded transform coefficients. The transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from previously decoded blocks in the current frame or image. The motion compensation unit 204 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and uses... The prediction information is used to generate a predictive block of the video block being decoded; the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoding image buffer unit 206, which stores reference images for subsequent intra-prediction or motion compensation, and is also used for the output of the video signal, thus obtaining the recovered original video signal.

[0112] It should be noted that the method of this application embodiment is mainly applied to the intra-frame estimation unit 102 and intra-frame prediction unit 103 as shown in FIG5 and the intra-frame prediction unit 203 as shown in FIG6. That is to say, the embodiment of this application can be applied to the encoder, the decoder, or even to both the encoder and the decoder, but no specific limitation is made here.

[0113] It should also be noted that when the embodiments of this application are applied to the encoder 100, the "current block" can refer to the block to be encoded in the video image (also known as the "encoded block"); when the embodiments of this application are applied to the decoder 200, the "current block" can refer to the block to be decoded in the video image (also known as the "decoded block").

[0114] In one embodiment of this application, Figure 7 is a schematic flowchart of a decoding method provided in this application. As shown in Figure 7, the method may include:

[0115] S701, the first syntax element in the parsing bitstream.

[0116] S702, when the first syntax element indicates that the current block uses the first intra-frame prediction technique, parse the second syntax element in the bitstream and the mode index of the current block.

[0117] It should be noted that in this embodiment, the method is applied to the decoder. Based on the structure of the decoder 200 shown in Figure 6, this decoding method is mainly applied to the intra-prediction part in Figure 6 (marked with a bold box). Specifically, when intra-prediction is used in the current block, this mainly focuses on the proposed optimization scheme for determining the filter coefficients of the EIP technique in intra-prediction, in order to improve compression efficiency.

[0118] It should also be noted that, in this embodiment, some indication information in the form of syntax elements, or flags, can be written into the bitstream. Thus, by parsing the values ​​of the syntax elements in the bitstream, the prediction technique used in the current block and whether the merging mode of the first intra-frame prediction technique is used can be determined. For example, the first syntax element can be used to indicate whether the current block uses the first intra-frame prediction technique, and the second syntax element can be used to indicate whether the current block uses the merging mode of the first intra-frame prediction technique.

[0119] In some embodiments, the method may further include: if the value of the first syntax element is a first value, then determining that the first syntax element indicates that the current block uses the first intra-frame prediction technique; if the value of the first syntax element is a second value, then determining that the first syntax element indicates that the current block does not use the first intra-frame prediction technique.

[0120] In this embodiment, the first intra-frame prediction technique refers to EIP (Enhanced Indication Prediction) technique. Therefore, the first syntax element can also be called the EIP usage flag, which can be represented by eip_flag. That is, if the parsed bitstream obtains the first value of eip_flag, then it can be determined that the current block uses EIP technique; if the parsed bitstream obtains the second value of eip_flag, then it can be determined that the current block does not use EIP technique.

[0121] In some embodiments, the method may further include: if the value of the second syntax element is a first value, then determining that the second syntax element indicates that the current block uses a merging mode of the first intra-frame prediction technique; if the value of the second syntax element is a second value, then determining that the second syntax element indicates that the current block does not use a merging mode of the first intra-frame prediction technique.

[0122] In this embodiment, the merging mode of the first intra-frame prediction technique refers to the EIP merging (eip_merge) mode. Therefore, the second syntax element can be called the eip_merge flag, and in this case, the second syntax element can be represented by eip_merge. That is, if the parsed bitstream obtains the first value of eip_merge, then it can be determined that the current block uses the EIP merging mode; if the parsed bitstream obtains the second value of eip_merge, then it can be determined that the current block does not use the EIP merging mode.

[0123] Understandably, before determining whether the current block uses the first intra-frame prediction technique, it is necessary to first determine whether the current sequence is allowed to use the first intra-frame prediction technique and to determine the prediction type of the current block. In the embodiments of this application, the third syntax element can be used to indicate whether the current sequence is allowed to use the first intra-frame prediction technique, and the fourth syntax element can be used to indicate the prediction type of the current block. The prediction type includes intra-frame prediction or inter-frame prediction.

[0124] In some embodiments, the method may further include: parsing a third syntax element in the bitstream; parsing a fourth syntax element in the bitstream when the third syntax element indicates that the current sequence allows the use of a first intra-frame prediction technique; continuing to execute steps S701 to S702, i.e., parsing a first syntax element in the bitstream, when the fourth syntax element indicates that the prediction type of the current block is intra-frame prediction; and parsing a second syntax element in the bitstream and the mode index of the current block when the first syntax element indicates that the current block uses the first intra-frame prediction technique.

[0125] In this embodiment of the application, the current sequence includes the current block. The third syntax element is a sequence-level syntax element, while the first, second, and fourth syntax elements are all block-level (CU-level or PU-level) syntax elements.

[0126] In some embodiments, the method may further include: if the value of the third syntax element is a first value, then determining that the third syntax element indicates that the current sequence is allowed to use the first intra-frame prediction technique; if the value of the third syntax element is a second value, then determining that the third syntax element indicates that the current sequence is not allowed to use the first intra-frame prediction mode.

[0127] In this embodiment, the third syntax element can be called the EIP enable flag, which can be represented by `sps_eip_enable_flag`. That is, if parsing the bitstream yields the first value for `sps_eip_enable_flag`, then it can be determined that the current sequence allows the use of EIP technology; if parsing the bitstream yields the second value for `sps_eip_enable_flag`, then it can be determined that the current sequence does not allow the use of EIP technology.

[0128] In some embodiments, the method may further include: if the value of the fourth syntax element is a first value, then determining that the prediction type of the current block indicated by the fourth syntax element is intra-frame prediction; if the value of the fourth syntax element is a second value, then determining that the prediction type of the current block indicated by the fourth syntax element is inter-frame prediction.

[0129] In this embodiment, the fourth syntax element can be referred to as the prediction type flag bit. That is, if the value of the prediction type flag bit obtained by parsing the bitstream is the first value, that is, intra-frame prediction, then the value of eip_flag can continue to be parsed; if the value of the prediction type flag bit obtained by parsing the bitstream is the second value, that is, inter-frame prediction, then the value of eip_flag is no longer parsed.

[0130] In the embodiments of this application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numeric form. For example, the syntax element here can be a parameter written in the profile, or it can be the value of a flag, without any limitation.

[0131] For example, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true; but no limitation is made on this.

[0132] In this embodiment, taking a first value being true and a second value being false as an example, the decoder first parses the third syntax element to obtain the EIP enable flag from the bitstream. If the value of `sps_eip_enable_flag` is true, it indicates that the current sequence allows the use of EIP technology. Then, the decoder continues to parse the fourth syntax element to obtain the prediction type of the current block from the bitstream. If the prediction type of the current block is intra-frame prediction, then the decoder continues to parse the first syntax element to obtain the EIP use flag of the current block from the bitstream. If the value of `eip_flag` is true, it indicates that the current block uses EIP technology. Then, the second syntax element also needs to be parsed to obtain the `eip_merge` flag from the bitstream. If the value of `eip_merge` is true, it indicates that the current block uses EIP merging mode; if the value of `eip_merge` is false, it indicates that the current block does not use EIP merging mode.

[0133] It is also understandable that when using EIP technology in the current block, it is necessary not only to parse the second syntax element in the bitstream, but also to parse the pattern index of the current block in the bitstream.

[0134] In this embodiment, the mode index can be represented by eip_index. Specifically, if the second syntax element indicates that the current block does not use the merging mode of the first intra-frame prediction technique (i.e., the current block does not use the EIP merging mode), then eip_index can indicate the index number of the mode information of the current block in the first candidate list; if the second syntax element indicates that the current block uses the merging mode of the first intra-frame prediction technique (i.e., the current block uses the EIP merging mode), then eip_index can indicate the index number of the filtering parameters of the current block in the second candidate list.

[0135] S703, when the second syntax element indicates that the current block does not use the merging mode of the first intra-frame prediction technique, the first candidate list of the current block is determined.

[0136] In this embodiment, if the current block uses EIP technology but does not use EIP merging mode, then a first candidate list for the current block can be determined. The first candidate list may include at least one set of candidate mode information, and the candidate mode information includes the shape of the candidate template region and the candidate filter.

[0137] In some embodiments, determining a first candidate list for the current block may include: determining the shape of at least one candidate template region and at least one candidate filter based on the width and height of the current block; and determining the first candidate list for the current block based on the shape of the at least one candidate template region and at least one candidate filter.

[0138] In this embodiment, the candidate template region may include at least one of the following: an upper template region, and / or a left template region. The shape of the candidate filter may include at least one of the following: a square filter, a horizontal matrix filter, and a vertical rectangular filter.

[0139] In one specific embodiment, the candidate filter can have a maximum of three shapes, such as a square filter, a horizontal matrix filter, and a vertical rectangular filter, as shown in Figures 1A, 1B, and 1C. The candidate template region can have a maximum of three template regions, such as including only the upper template region, only the left template region, or both the upper and left template regions, as shown in Figures 2A, 2B, and 2C. Thus, by combining different candidate template regions and different filter shapes, the decoder can obtain a maximum of nine sets of candidate mode information, meaning the maximum length of the first candidate list is 9.

[0140] It should also be noted that, in the embodiments of this application, the candidate mode information allowed to be used by the current block can be determined based on the width and height of the current block, and the candidate mode information allowed to be used by the current block constitutes the first candidate list.

[0141] For example, if the current block size is relatively small, such as a 4×4 current block, then the template region can only have one choice, that is, it can include both the upper template region and the left template region. Then, by combining it with the shapes of the three candidate filters, three sets of candidate mode information can be obtained, that is, the first candidate list only includes three sets of candidate mode information.

[0142] In other words, in this embodiment, depending on the width and height of the current block, the shape of the candidate filter may be selected from only one, two, or three of these shapes, and the candidate template region may also be selected from only one, two, or three of these template regions. Thus, by combining the shapes of at least one candidate template region and at least one candidate filter, a first candidate list for the current block can be obtained.

[0143] S704, determine the mode information of the current block based on the first candidate list and the mode index.

[0144] S705 determines the filtering parameters for the current block based on the mode information and regularization parameters.

[0145] In this embodiment, after determining the first candidate list, the candidate mode information corresponding to the mode index in the first candidate list can be determined as the mode information of the current block. The mode information may include the template region and the shape of the filter.

[0146] In this embodiment, the filtering parameters of the current block may include the shape of the filter and the coefficients of the filter. Accordingly, referring to FIG8, the method for determining the filtering parameters of the current block may include:

[0147] S801 determines the shape of the filter and the input and output samples of the filter based on the mode information.

[0148] S802 determines the filter coefficients based on the regularization parameters and the input and output samples of the filter.

[0149] In this embodiment, the filter coefficients can also be simply referred to as "filter coefficients" or "filter parameters". Here, since the pattern information includes the template region and the shape of the filter, the input and output samples of the filter can be determined based on the template region. Then, the filter coefficients are calculated based on the regularization parameters and the input and output samples of the filter.

[0150] In this embodiment, parameter regularization is introduced for encoding tools that require methods such as Cholesky decomposition, LDL decomposition, or Gaussian elimination. The modified calculation formula for the filter coefficients in the aforementioned formula (3) is as follows:

[0151] Where A is the matrix of input samples, and y is the matrix of output samples. λI is the matrix of filter coefficients, and λI is the regularization parameter added to formula (4).

[0152] It's important to note that regularization is a strategy that modifies a learning algorithm to reduce generalization error. It improves the model's performance on the test set by adding extra constraints and penalties to the original model. The main goal of regularization is to prevent overfitting by limiting the model's complexity, thereby improving its generalization ability. Here, the filter coefficients can also be seen as those obtained through model training on the original model; therefore, the filter coefficients can be called "model parameters." For example, insufficient training samples or overtraining often lead to overfitting. Regularization methods are a collective term for a class of methods that introduce additional information into the original model in such cases to prevent overfitting and improve the model's generalization performance.

[0153] It should also be noted that regularization methods can be implemented in various ways, including L1 regularization and L2 regularization, which are achieved by adding the L1 norm and L2 norm of the parameters to the objective function as penalty terms, respectively. L1 regularization tends to produce sparse models, i.e., many parameters are zero, which is helpful for feature selection; while L2 regularization reduces the complexity of the model by making the parameters closer to zero. The effectiveness of regularization depends on the choice of regularization parameters. In the embodiments of this application, the regularization method here is L2 regularization.

[0154] It should also be noted that, in the embodiments of this application, for the regularization parameter λI, λ is a constant value, which can be set to 192, 128, 64, etc.; I is the number of coefficients of the filter. Since the number of coefficients of the filter is usually fixed, such as 15, the regularization parameter λI can be regarded as an adaptively set constant value.

[0155] In one possible implementation, the regularization parameter can be λI as a whole. However, considering that I is constant for filters of the same shape, and only λ needs to be determined, in another possible implementation, λ can be defined as a regularization parameter and then multiplied by I to form λI in formula (4) for calculating the filter coefficients.

[0156] Understandably, the regularization parameter can be adaptively set based on the number of training samples in the template region, or it can be adaptively set based on the input information of the filter, or it can be adaptively set based on the size of the current block, etc. The following will explain in detail several possible implementation methods.

[0157] In one possible implementation, the method may include: determining a regularization parameter based on the number of training samples in the template region.

[0158] In some embodiments, determining the regularization parameter based on the number of training samples in the template region may include: determining the regularization parameter as a first parameter value when the number of training samples in the template region is greater than a preset sample threshold; and determining the regularization parameter as a second parameter value when the number of training samples in the template region is less than the preset sample threshold.

[0159] It should be noted that, in the embodiments of this application, if the number of training samples in the template region is equal to the preset sample threshold, then the regularization parameter can be set to the first parameter value, or the regularization parameter can be set to the second parameter value, without any specific limitation.

[0160] In other words, in this embodiment, by determining the number of training samples, a regularization parameter can be set for the corresponding condition in formula (4). In a specific embodiment, the value of the first parameter is less than the value of the second parameter. That is, the number of training samples can be negatively correlated with the regularization parameter. For example, for the current block with fewer than a preset sample threshold, a larger regularization parameter can be set; while for the current block with more than a preset sample threshold, a relatively smaller regularization parameter can be set.

[0161] For example, when the number of training samples is less than or equal to 1024, λ can be set to 192 and I is the number of filter coefficients; otherwise, when the number of training samples is greater than 1024 and less than or equal to 8192, λ can be set to 128 and I is the number of filter coefficients; otherwise, λ can be set to 64 and I is the number of filter coefficients.

[0162] For example, when the number of training samples is less than or equal to 2024, λ can be set to 192, and I is the number of filter coefficients; otherwise, λ can be set to 128, and I is the number of filter coefficients.

[0163] For example, when the number of training samples is less than or equal to 2048, λ can be set to 192, and I is the number of filter coefficients; otherwise, λ can be set to 128, and I is the number of filter coefficients.

[0164] For example, when the number of training samples is less than or equal to 2560, λ can be set to 192, and I is the number of filter coefficients; otherwise, λ can be set to 128, and I is the number of filter coefficients.

[0165] In another specific embodiment, the number of training samples can also be positively correlated with the regularization parameter. For example, a smaller regularization parameter can be set for the current block with fewer than a preset sample threshold, while a larger regularization parameter can be set for the current block with more than the preset sample threshold. In this case, the first parameter value is greater than the second parameter value.

[0166] It should also be noted that in the embodiments of this application, when a small regularization parameter is set according to the number of training samples, it can even be set to zero in some cases, indicating that no regularization optimization is performed at this time, and no specific limitation is made in this regard.

[0167] In another possible implementation, the method may include determining regularization parameters based on the size of the current block.

[0168] In some embodiments, determining the regularization parameter based on the size of the current block may include: determining the regularization parameter as a third parameter value when the size of the current block is greater than a preset size threshold; and determining the regularization parameter as a fourth parameter value when the size of the current block is less than the preset size threshold.

[0169] It should be noted that in the embodiments of this application, if the size of the current block is equal to the preset size threshold, the regularization parameter can be set to the third parameter value, or the regularization parameter can be set to the fourth parameter value, without specific limitations.

[0170] In other words, in this embodiment, by determining the size of the current block, a regularization parameter can be added to formula (4) for the corresponding situation. In a specific embodiment, the value of the third parameter is less than the value of the fourth parameter. That is, the size of the current block and the regularization parameter can be negatively correlated. For example, for a current block whose size is less than a preset size threshold, a larger regularization parameter can be set; while for a current block whose size is greater than the preset size threshold, a relatively smaller regularization parameter can be set.

[0171] In another specific embodiment, the size of the current block can be positively correlated with the regularization parameter. For example, a smaller regularization parameter can be set for a current block whose size is smaller than a preset size threshold, while a larger regularization parameter can be set for a current block whose size is larger than the preset size threshold. In this case, the value of the third parameter is greater than the value of the fourth parameter.

[0172] It should also be noted that in the embodiments of this application, when a small regularization parameter is set according to the size of the current block, it can even be set to zero in some cases, indicating that no regularization optimization is performed at this time, and no specific limitation is made in this regard.

[0173] In another possible implementation, the method may include: determining the input information corresponding to the filter; and determining the regularization parameters based on the input information.

[0174] It should be noted that, in the embodiments of this application, the input information corresponding to the filter may include tap position or input type. That is, as can be seen from formula (4), the regularization parameter λI is in matrix form, and different regularization parameters can be set according to different tap positions or input types.

[0175] In one specific embodiment, when the input information includes the tap position, determining the regularization parameter based on the input information may include: determining the regularization parameter to be zero when the sample corresponding to the tap position is a constant term; and determining the regularization parameter to be a non-zero parameter value when the sample corresponding to the tap position is a non-constant term.

[0176] For example, when setting regularization parameters based on tap positions, taking a square filter as an example, the top-left tap position is the last sample in the input sample set. The input sample here is a constant term input, not the input for reconstructed or predicted samples. For this tap position, no regularization parameter needs to be added; that is, the regularization parameter can be set to zero. Similarly, for horizontal matrix filters and vertical rectangular filters, the top-left tap position is also the last sample in the input sample set, and the input sample here is a constant term input.

[0177] Thus, in this embodiment of the application, if the sample corresponding to the tap position is a constant term, then no regularization optimization is required, that is, the regularization parameter is set to zero; if the sample corresponding to the tap position is a non-constant term, then a non-zero regularization parameter can be added, while the matrix calculation at the constant term position remains unchanged.

[0178] In other words, in this embodiment, whether to perform regularization optimization can be determined based on whether the sample corresponding to the tap position is a constant term. In addition, whether to perform regularization optimization can also be determined based on the input type. For example, if the input sample is a directional input or an input with different color components, regularization optimization may not be performed, that is, the regularization parameter can be set to zero. There are no limitations here.

[0179] In another possible implementation, the regularization parameter is a constant.

[0180] It should be noted that in this embodiment, when the regularization parameter can be implemented in hardware, it can be set to a fixed constant. In this case, the first parameter value is equal to the second parameter value, and the third parameter value is equal to the fourth parameter value. That is, the setting of the regularization parameter will not change based on the number of training samples, the size of the current block, etc.

[0181] It should also be noted that, in this embodiment, different regularization parameters can be set according to the shape of the current block, the shape of the filter, etc. Furthermore, in this embodiment, the parameter regularization method can be applied to any tool that uses Cholesky decomposition, LDL decomposition, and Gaussian elimination, such as CCCM, TMP filtering, TMP fusion, BCW, etc., without any limitation.

[0182] S706, predict the current block based on the filtering parameters and determine the prediction block for the current block.

[0183] In this embodiment of the application, after determining the filtering parameters of the current block, including the shape of the filter and the coefficients of the filter, the current block can be predicted based on the shape of the filter and the coefficients of the filter to determine the prediction block of the current block.

[0184] Here, taking 15 filter coefficients as an example, the calculation formula for the prediction block is as follows:

[0185] In the above formula (5), pred (x,y) c is the predicted value located at coordinates (x, y) within the current block. i These are the coefficients of the filter. b is a constant term used to reconstruct or predict sample points.

[0186] It is also understood that, in the embodiments of this application, if the value of the second syntax element is a second value, that is, when the second syntax element indicates that the current block uses the EIP merging mode, then merge-based EIP prediction needs to be performed. Referring to Figure 9, after step S702, the method may further include:

[0187] S901, when the second syntax element indicates that the current block uses the merging mode of the first intra-frame prediction technique, a second candidate list for the current block is determined.

[0188] In this embodiment, if the current block uses EIP technology and EIP merging mode, a second candidate list for the current block can be determined. The second candidate list may include at least one set of candidate filtering parameters, and these parameters include the shape and coefficients of the candidate filters.

[0189] In some embodiments, determining a second candidate list for the current block may include: determining a third candidate list for the current block based on reference information of the current block; calculating the cost of each template region of the current block based on at least one set of candidate filtering parameters in the third candidate list, and determining the cost value corresponding to each of the at least one set of candidate filtering parameters in the third candidate list; sorting the at least one set of candidate filtering parameters in the third candidate list according to the cost value, and determining a second candidate list for the current block.

[0190] In the embodiments of this application, the reference information of the current block may include at least one of the following: whether the adjacent blocks of the current block use the first intra-frame prediction technique; whether the non-adjacent blocks of the current block use the first intra-frame prediction technique; whether the temporal co-occurrence blocks of the current block use the first intra-frame prediction technique; and a historical list of the current block based on the first intra-frame prediction technique.

[0191] For example, the specific procedure for determining the third candidate list for the current block is as follows:

[0192] First, the EIP merging mode obtains the EIP information of neighboring and non-neighboring blocks in the current block's spatial domain. For example, the EIP information may include the filter shape and filter coefficients, and this information is added to the third candidate list. For instance, by searching the positions shown in Figure 3, the corresponding decoder blocks are checked sequentially to see if they use EIP technology. If they do, the EIP information corresponding to that position is obtained; and then compared with the EIP candidate filter parameters in the third candidate list for deduplication. If the obtained EIP information is the same as a candidate in the third candidate list, it is not added to the third candidate list; otherwise, it is added to the third candidate list.

[0193] Secondly, the EIP merging mode checks whether time-domain information can be used. If the condition is met, it acquires the EIP information of the co-position block in the reference frame and the EIP information of the co-position block with the offset motion vector. A deduplication operation is also performed; if the acquired EIP information has not appeared in the third candidate list, it is added to the third candidate list. Here, the reference frame can be a co-position frame acquired from reference list 0, and / or, it can also be a co-position frame acquired from reference list 1.

[0194] Finally, the EIP merging mode retrieves EIP information from the EIP history list. The EIP history list is constructed according to the same rules during encoding and decoding, and it only stores EIP information. The EIP merging mode retrieves the latest EIP information from this history list and checks for duplicates. If no duplicates are found, it adds the EIP to the third candidate list. Here, after the decoder completes the EIP prediction for the current block, it needs to save the corresponding EIP information to the EIP history list. If the EIP history list is full, it is updated using a first-in, first-out (FIFO) principle, removing the earliest candidate added to the EIP history list to ensure its continued update.

[0195] In this way, after constructing the third candidate list of the EIP merging mode, the adjacent reconstructed samples around the current block can be used as template regions. The candidate filtering parameters of the third candidate list are used to predict the template regions, and the corresponding template region prediction blocks under each set of candidate filtering parameters are obtained. The cost value between the template prediction block and the template reconstruction block (such as SAD cost value or SATD cost value) is calculated. Then, the third candidate list is sorted according to the cost value to obtain the sorted second candidate list.

[0196] In one possible implementation, the third candidate list typically stores a maximum of 12 candidate filtering parameters, and the second candidate list may include at least some of the candidate filtering parameters from the third candidate list. For example, after sorting the 12 candidate filtering parameters in the third candidate list according to their template cost in ascending order, only the first 6 sorted candidate filtering parameters can be selected to form the second candidate list for the current block, but this is not specifically limited.

[0197] S902, determine the mode information of the current block based on the second candidate list and the mode index.

[0198] S903 determines the filtering parameters for the current block based on the mode information.

[0199] S904, predict the current block based on the filtering parameters and determine the prediction block for the current block.

[0200] In this embodiment, after determining the second candidate list of the current block, the mode information of the current block can be determined based on the second candidate list and the mode index in the bitstream. The determined mode information is then directly used as the filtering parameters of the current block, i.e., the EIP information corresponding to the mode index in the second candidate list, which may include, for example, the shape of the filter and the coefficients of the filter. Thus, the current block is predicted based on the shape of the filter and the coefficients of the filter, and the prediction block of the current block is determined, as shown in formula (5) above.

[0201] It is also understood that, in the embodiments of this application, the filtering parameters for the current block can also be determined based on the template cost. Referring to Figure 10, the method may further include:

[0202] S1001 determines multiple sets of candidate filtering parameters for the current block based on various candidate regularization parameters and mode information.

[0203] S1002, calculate the cost of the template region of the current block according to multiple sets of candidate filtering parameters, and determine the cost value corresponding to each of the multiple sets of candidate filtering parameters;

[0204] S1003, determine the minimum cost value based on the cost value corresponding to each of the multiple sets of candidate filter parameters, and determine the candidate filter parameter corresponding to the minimum cost value as the filter parameter of the current block.

[0205] It should be noted that, in the embodiments of this application, the cost calculation here can be SAD cost calculation, SATD cost calculation, or other cost calculations, such as Sum of Squared Errors (SSE), Mean Absolute Deviation (MAD), Mean Absolute Error (MAE), Mean Square Error (MSE), etc., without any limitation.

[0206] It should also be noted that, in the embodiments of this application, multiple sets of candidate filtering parameters for the current block can be determined based on various candidate regularization parameters. Then, based on these multiple sets of candidate filtering parameters, the template region of the current block is predicted, and the SAD or SATD cost of the template prediction block and the template reconstruction block is calculated. Finally, the set of candidate filtering parameters corresponding to the minimum cost is used as the filtering parameters for the current block. For example, if the shape of the filter is determined, the filter coefficients (hereinafter referred to as "filter coefficients") can be used as an example. Based on various candidate regularization parameters, the filter coefficients under different regularization parameter conditions can also be used as candidates. The template region is then predicted, and the SAD or SATD cost of the template prediction block and the template reconstruction block is calculated. Finally, the filter coefficient corresponding to the minimum cost is used as the filter coefficient for the current block.

[0207] Understandably, in the embodiments of this application, after predicting the current block based on the shape and coefficients of the filter and determining the predicted block of the current block, the residual information in the bitstream can be further parsed, and the residual information can be inversely quantized and inversely transformed to determine the residual block of the current block; the reconstructed block of the current block can be determined based on the predicted block and the residual block of the current block, which can be obtained by superimposing the predicted block and the residual block of the current block.

[0208] It is also understood that, in the embodiments of this application, after all the reconstructed blocks are processed by techniques such as loop filtering, the final reconstructed image is obtained, which can be used as both video output and as a reference for subsequent decoding.

[0209] This application provides a decoding method. When parsing the bitstream and determining that the current block uses a merging mode where the first intra-frame prediction technique is used but the current block does not use the first intra-frame prediction technique, a first candidate list for the current block is determined. Then, based on the first candidate list and the mode index in the bitstream, the mode information of the current block, such as the template region and the shape of the filter, can be determined. Then, based on the mode information and regularization parameters, the coefficients of the filter in the filtering parameters can be determined, thereby improving the generalization ability and making the filter coefficients more applicable to the prediction of the current block. In this way, predicting the current block based on the filter coefficients and the filter shape can improve the prediction accuracy of the current block, thereby improving compression efficiency and thus improving encoding and decoding performance.

[0210] In another embodiment of this application, Figure 11 is a schematic flowchart of an encoding method provided in this application. This encoding method is applied to an encoder. Based on the structure of the encoder 100 shown in Figure 5, this encoding method is mainly applied to the intra-frame prediction part (marked with a bold box) in Figure 5. As shown in Figure 11, this encoding method may include:

[0211] S1101, determine the first candidate list corresponding to the merging mode when the current block does not use the first intra-frame prediction technique, determine at least one set of first candidate filtering parameters based on at least one set of candidate mode information and regularization parameters in the first candidate list, and determine the first cost result corresponding to each of the at least one set of first candidate filtering parameters.

[0212] It should be noted that, in the embodiments of this application, determining the first candidate list corresponding to the merging mode when the current block does not use the first intra-frame prediction technique may include: determining the shape of at least one candidate template region and at least one candidate filter based on the width and height of the current block; and determining the first candidate list based on the shape of at least one candidate template region and at least one candidate filter.

[0213] In other words, when the current block does not use the first intra-frame prediction technique in the merging mode, i.e., when the current block uses computation-based EIP prediction, then a first candidate list for the current block can be determined. This first candidate list can include at least one set of candidate mode information, and the candidate mode information includes the candidate template region and the shape of the candidate filter.

[0214] In this embodiment, the candidate template region may include at least one of the following: an upper template region, and / or a left template region. The shape of the candidate filter may include at least one of the following: a square filter, a horizontal matrix filter, and a vertical rectangular filter.

[0215] In one specific embodiment, the candidate filter can have a maximum of three shapes, such as a square filter, a horizontal matrix filter, and a vertical rectangular filter, as shown in Figures 1A, 1B, and 1C. The candidate template region can have a maximum of three template regions, such as including only the upper template region, only the left template region, or both the upper and left template regions, as shown in Figures 2A, 2B, and 2C. Thus, by combining different candidate template regions and different filter shapes, the decoder can obtain a maximum of nine sets of candidate mode information, meaning the maximum length of the first candidate list is 9.

[0216] It should also be noted that, in the embodiments of this application, the candidate mode information allowed to be used by the current block can be determined based on the width and height of the current block, and the candidate mode information allowed to be used by the current block constitutes the first candidate list.

[0217] For example, if the current block size is relatively small, such as a 4×4 current block, then the template region can only have one choice, that is, it can include both the upper template region and the left template region. Then, by combining it with the shapes of the three candidate filters, three sets of candidate mode information can be obtained, that is, the first candidate list only includes three sets of candidate mode information.

[0218] In other words, in this embodiment, depending on the width and height of the current block, the shape of the candidate filter may be selected from only one, two, or three of these shapes, and the candidate template region may also be selected from only one, two, or three of these template regions. Thus, by combining the shapes of at least one candidate template region and at least one candidate filter, a first candidate list for the current block can be obtained.

[0219] Understandably, in this embodiment, parameter regularization is introduced for coding tools that require methods such as Cholesky decomposition, LDL decomposition, or Gaussian elimination. For the calculation of the filter coefficients in the aforementioned formula (4), λI is the regularization parameter added to formula (4). Here, for the regularization parameter λI, λ is a constant value, which can be set to 192, 128, 64, etc.; I is the number of filter coefficients. Since the number of filter coefficients is usually fixed, for example, 15, the regularization parameter λI can be considered as an adaptively set constant value.

[0220] In this embodiment, for at least one set of candidate pattern information in the first candidate list, different candidate pattern information can be set with the same regularization parameter or with different regularization parameters. Specifically, the regularization parameter can be adaptively set based on the number of training samples in the candidate template region, or it can be adaptively set based on the input information of the candidate filter, or it can be adaptively set based on the size of the current block, etc. Several possible implementation methods will be described in detail below.

[0221] In one possible implementation, the method may include: determining a regularization parameter based on the number of training samples in the candidate template region.

[0222] In some embodiments, determining the regularization parameter based on the number of training samples in the candidate template region may include: determining the regularization parameter as a first parameter value when the number of training samples in the candidate template region is greater than a preset sample threshold; and determining the regularization parameter as a second parameter value when the number of training samples in the candidate template region is less than the preset sample threshold.

[0223] It should be noted that, in the embodiments of this application, if the number of training samples in the candidate template region is equal to the preset sample threshold, then the regularization parameter can be set to the first parameter value, or the regularization parameter can be set to the second parameter value, without any specific limitation.

[0224] In other words, in this embodiment, by determining the number of training samples, a regularization parameter can be set for the corresponding condition in formula (4). In a specific embodiment, the value of the first parameter is less than the value of the second parameter. That is, the number of training samples can be negatively correlated with the regularization parameter. For example, for the current block with fewer than a preset sample threshold, a larger regularization parameter can be set; while for the current block with more than a preset sample threshold, a relatively smaller regularization parameter can be set.

[0225] For example, when the number of training samples is less than or equal to 1024, λ can be set to 192 and I is the number of filter coefficients; otherwise, when the number of training samples is greater than 1024 and less than or equal to 8192, λ can be set to 128 and I is the number of filter coefficients; otherwise, λ can be set to 64 and I is the number of filter coefficients.

[0226] For example, when the number of training samples is less than or equal to 2024, λ can be set to 192, and I is the number of filter coefficients; otherwise, λ can be set to 128, and I is the number of filter coefficients.

[0227] For example, when the number of training samples is less than or equal to 2048, λ can be set to 192, and I is the number of filter coefficients; otherwise, λ can be set to 128, and I is the number of filter coefficients.

[0228] For example, when the number of training samples is less than or equal to 2560, λ can be set to 192, and I is the number of filter coefficients; otherwise, λ can be set to 128, and I is the number of filter coefficients.

[0229] In another specific embodiment, the number of training samples can also be positively correlated with the regularization parameter. For example, a smaller regularization parameter can be set for the current block with fewer than a preset sample threshold, while a larger regularization parameter can be set for the current block with more than the preset sample threshold. In this case, the first parameter value is greater than the second parameter value.

[0230] It should also be noted that in the embodiments of this application, when a small regularization parameter is set according to the number of training samples, it can even be set to zero in some cases, indicating that no regularization optimization is performed at this time, and no specific limitation is made in this regard.

[0231] In another possible implementation, the method may include determining regularization parameters based on the size of the current block.

[0232] In some embodiments, determining the regularization parameter based on the size of the current block may include: determining the regularization parameter as a third parameter value when the size of the current block is greater than a preset size threshold; and determining the regularization parameter as a fourth parameter value when the size of the current block is less than the preset size threshold.

[0233] It should be noted that in the embodiments of this application, if the size of the current block is equal to the preset size threshold, the regularization parameter can be set to the third parameter value, or the regularization parameter can be set to the fourth parameter value, without specific limitations.

[0234] In other words, in this embodiment, by determining the size of the current block, a regularization parameter can be added to formula (4) for the corresponding situation. In a specific embodiment, the value of the third parameter is less than the value of the fourth parameter. That is, the size of the current block and the regularization parameter can be negatively correlated. For example, for a current block whose size is less than a preset size threshold, a larger regularization parameter can be set; while for a current block whose size is greater than the preset size threshold, a relatively smaller regularization parameter can be set.

[0235] In another specific embodiment, the size of the current block can be positively correlated with the regularization parameter. For example, a smaller regularization parameter can be set for a current block whose size is smaller than a preset size threshold, while a larger regularization parameter can be set for a current block whose size is larger than the preset size threshold. In this case, the value of the third parameter is greater than the value of the fourth parameter.

[0236] It should also be noted that in the embodiments of this application, when a small regularization parameter is set according to the size of the current block, it can even be set to zero in some cases, indicating that no regularization optimization is performed at this time, and no specific limitation is made in this regard.

[0237] In another possible implementation, the method may include: determining the input information corresponding to the candidate filter; and determining the regularization parameters based on the input information.

[0238] It should be noted that, in the embodiments of this application, the input information corresponding to the candidate filter may include tap position or input type. That is, as can be seen from formula (4), the regularization parameter λI is in matrix form, and different regularization parameters can be set according to different tap positions or input types.

[0239] In one specific embodiment, when the input information includes the tap position, determining the regularization parameter based on the input information may include: determining the regularization parameter to be zero when the sample corresponding to the tap position is a constant term; and determining the regularization parameter to be a non-zero parameter value when the sample corresponding to the tap position is a non-constant term.

[0240] For example, when setting regularization parameters based on tap positions, taking a square filter as an example, the top-left tap position is the last sample in the input sample set. The input sample here is a constant term input, not the input for reconstructed or predicted samples. For this tap position, no regularization parameter needs to be added; that is, the regularization parameter can be set to zero. Similarly, for horizontal matrix filters and vertical rectangular filters, the top-left tap position is also the last sample in the input sample set, and the input sample here is a constant term input.

[0241] Thus, in this embodiment of the application, if the sample corresponding to the tap position is a constant term, then no regularization optimization is required, that is, the regularization parameter is set to zero; if the sample corresponding to the tap position is a non-constant term, then a non-zero regularization parameter can be added, while the matrix calculation at the constant term position remains unchanged.

[0242] In other words, in this embodiment, whether to perform regularization optimization can be determined based on whether the sample corresponding to the tap position is a constant term. In addition, whether to perform regularization optimization can also be determined based on the input type. For example, if the input sample is a directional input or an input with different color components, regularization optimization may not be performed, that is, the regularization parameter can be set to zero. There are no limitations here.

[0243] In another possible implementation, the regularization parameter is a constant.

[0244] It should be noted that in this embodiment, when the regularization parameter can be implemented in hardware, it can be set to a fixed constant. In this case, the first parameter value is equal to the second parameter value, and the third parameter value is equal to the fourth parameter value. That is, the setting of the regularization parameter will not change based on the number of training samples, the size of the current block, etc.

[0245] It should also be noted that, in this embodiment, different regularization parameters can be set according to the shape of the current block, the shape of the filter, etc. Furthermore, in this embodiment, the parameter regularization method can be applied to any tool that uses Cholesky decomposition, LDL decomposition, and Gaussian elimination, such as CCCM, TMP filtering, TMP fusion, BCW, etc., without any limitation.

[0246] In one possible implementation, the regularization parameter can be λI as a whole. However, considering that I is constant for filters of the same shape, and only λ needs to be determined, in another possible implementation, λ can be defined as the regularization parameter and then multiplied by I to form λI in formula (4) for calculating the filter coefficients. Here, no restrictions are placed on the regularization parameter.

[0247] It is also understandable that after determining the first candidate list and the regularization parameters, the first cost result corresponding to each group of candidates can be further determined. In some embodiments, taking the first group of candidate mode information in the first candidate list as an example, at least one group of first candidate filtering parameters is determined based on at least one group of candidate mode information in the first candidate list and the regularization parameters, and the first cost result corresponding to each of the at least one group of first candidate filtering parameters is determined. This method may include: determining the first group of candidate filtering parameters based on the first group of candidate mode information in the first candidate list and the regularization parameters; predicting the current block based on the first group of candidate filtering parameters to determine the first candidate prediction block of the current block; and calculating the cost based on the first candidate prediction block of the current block and the original image block of the current block to obtain the first cost result corresponding to the first group of candidate filtering parameters. Wherein, the first group of candidate mode information is any group in the first candidate list.

[0248] In this embodiment, the first set of candidate filtering parameters is determined by combining the first set of candidate pattern information with regularization parameters. For example, the first set of candidate filtering parameters may include the shape and coefficients of the candidate filters. Then, based on the shape and coefficients of the candidate filters in the first set of candidate filtering parameters, the current block is predicted to determine the first candidate prediction block of the current block. Then, based on the first candidate prediction block of the current block and the original image block, the cost is calculated to obtain the first cost result corresponding to the first set of candidate filtering parameters.

[0249] In the embodiments of this application, the cost calculation here may be rate distortion cost calculation, or it may be SAD or SATD cost calculation, or even other cost calculations, such as SSE, MAD, MAE, MSE, etc., without any limitation.

[0250] For example, taking rate-distortion cost calculation as an example, at least one set of candidate mode information in the first candidate list is traversed, and the rate-distortion cost result between the candidate prediction block of the current block and the original image block obtained by each set of candidate mode information is calculated. The minimum rate-distortion cost result at this time is the minimum cost result in the first cost result, that is, the minimum cost result of the current block without using the EIP merging mode.

[0251] S1102, determine the second candidate list corresponding to the merging mode of the first intra-frame prediction technique used in the current block, and determine the second cost result corresponding to at least one set of second candidate filter parameters in the second candidate list.

[0252] It should be noted that, in the embodiments of this application, determining the second candidate list corresponding to the merging mode of the current block using the first intra-frame prediction technique may include: determining a third candidate list for the current block based on the reference information of the current block; calculating the cost of the template region of the current block according to at least one set of candidate filtering parameters in the third candidate list, and determining the cost value corresponding to each of the at least one set of candidate filtering parameters in the third candidate list; sorting the at least one set of candidate filtering parameters in the third candidate list according to the cost value, and determining the second candidate list for the current block.

[0253] In the embodiments of this application, the reference information of the current block may include at least one of the following: whether the adjacent blocks of the current block use the first intra-frame prediction technique; whether the non-adjacent blocks of the current block use the first intra-frame prediction technique; whether the temporal co-occurrence blocks of the current block use the first intra-frame prediction technique; and a historical list of the current block based on the first intra-frame prediction technique.

[0254] For example, the specific procedure for determining the third candidate list for the current block is as follows:

[0255] First, the EIP merging mode obtains the EIP information of neighboring and non-neighboring blocks in the current block's spatial domain. For example, the EIP information may include the filter shape and filter coefficients, and this information is added to the third candidate list. For instance, by searching the positions shown in Figure 3, the corresponding labeled coding blocks are checked sequentially to see if they use EIP technology. If they do, the EIP information corresponding to that position is obtained; and then compared with the EIP candidate filter parameters in the third candidate list for deduplication. If the obtained EIP information is the same as a candidate in the third candidate list, it is not added to the third candidate list; otherwise, it is added to the third candidate list.

[0256] Secondly, the EIP merging mode checks whether time-domain information can be used. If the condition is met, it acquires the EIP information of the co-position block in the reference frame and the EIP information of the co-position block with the offset motion vector. A deduplication operation is also performed; if the acquired EIP information has not appeared in the third candidate list, it is added to the third candidate list. Here, the reference frame can be a co-position frame acquired from reference list 0, and / or, it can also be a co-position frame acquired from reference list 1.

[0257] Finally, the EIP merging mode retrieves EIP information from the EIP history list. The EIP history list is constructed according to the same rules during encoding and decoding, and it only stores EIP information. The EIP merging mode retrieves the latest EIP information from this history list and checks for duplicates. If no duplicates are found, it is added to the third candidate list. Here, the encoder saves the EIP information to the EIP history list each time an EIP technology is selected as the prediction technology for the current block. If the EIP history list is full, it is updated using a first-in, first-out (FIFO) principle, removing the earliest candidate added to the EIP history list to keep it up-to-date.

[0258] In this way, after constructing the third candidate list of the EIP merging mode, the adjacent reconstructed samples around the current block can be used as template regions. The candidate filtering parameters of the third candidate list are used to predict the template regions, and the corresponding template region prediction blocks under each set of candidate filtering parameters are obtained. The cost value between the template prediction block and the template reconstruction block (such as SAD cost value or SATD cost value) is calculated. Then, the third candidate list is sorted according to the cost value to obtain the sorted second candidate list.

[0259] In one possible implementation, the third candidate list typically stores a maximum of 12 candidate filtering parameters, and the second candidate list may include at least some of the candidate filtering parameters from the third candidate list. For example, after sorting the 12 candidate filtering parameters in the third candidate list according to their template cost in ascending order, only the first 6 sorted candidate filtering parameters can be selected to form the second candidate list for the current block, but this is not specifically limited.

[0260] Understandably, in the embodiments of this application, after determining the second candidate list, the second cost result corresponding to each group of candidates can be further determined. In some embodiments, taking the second group of candidate mode information in the second candidate list as an example, determining the second cost result corresponding to at least one group of second candidate filtering parameters in the second candidate list may include: predicting the current block according to the second group of candidate filtering parameters in the second candidate list to determine the second candidate prediction block of the current block; calculating the cost according to the second candidate prediction block of the current block and the original image block of the current block to obtain the second cost result corresponding to the second group of candidate filtering parameters. Wherein, the second group of candidate filtering parameters is any group in the second candidate list.

[0261] For example, taking the second set of candidate filtering parameters in the second candidate list as an example, the second set of candidate filtering parameters may include the shape and coefficients of the candidate filters. By predicting the current block based on the shape and coefficients of the candidate filters in the second set of candidate filtering parameters, the second candidate prediction block of the current block can be determined; then, by calculating the cost based on the second candidate prediction block of the current block and the original image block, the second cost result corresponding to the second set of candidate filtering parameters can be obtained.

[0262] In the embodiments of this application, the cost calculation here can also be rate-distortion cost calculation, or it can be SAD or SATD cost calculation, or even other cost calculations, such as SSE, MAD, MAE, MSE, etc., without any limitation.

[0263] For example, taking rate-distortion cost calculation as an example, at least one set of candidate filtering parameters in the second candidate list is traversed, and the rate-distortion cost result between the candidate prediction block of the current block and the original image block obtained by each set of candidate filtering parameters is calculated. The minimum rate-distortion cost result at this time is the minimum cost result in the second cost result, that is, the minimum cost result of the current block using the EIP merging mode.

[0264] S1103, determine the third cost result corresponding to the prediction technique other than the first intra-frame prediction technique used in the current block.

[0265] In this embodiment, the encoder can also traverse other prediction techniques besides the first intra-frame prediction technique, and calculate the cost of the third candidate prediction block obtained by predicting the current block using other prediction techniques, together with the original image block, to obtain the third cost result corresponding to the other prediction techniques. For example, by calculating the rate-distortion cost of the third candidate prediction block and the original image block, the corresponding rate-distortion cost result can be obtained. The minimum rate-distortion cost result at this time is the minimum cost result among the third cost results.

[0266] It should be noted that in the embodiments of this application, steps S1101, S1102 and S1103 can be executed in parallel, or they can be executed sequentially, or step S1102 can be executed first, followed by steps S1101 and S1103, etc., without any limitation.

[0267] S1104, based on the first cost result, the second cost result and the third cost result, determine the value of the first syntax element, wherein the first syntax element is used to indicate whether the current block uses the first intra-frame prediction technique.

[0268] S1105, encode the value of the first syntax element and write the resulting encoded bits into the bitstream.

[0269] In this embodiment of the application, the first cost result, the second cost result, and the third cost result can be used to determine whether the current block uses the first intra-frame prediction technique. In some embodiments, the method may include: if the minimum cost result among the first cost result and the second cost result is less than the minimum cost result among the third cost result, it can be determined that the current block uses the first intra-frame prediction technique; if the minimum cost result among the first cost result and the second cost result is greater than the minimum cost result among the third cost result, it can be determined that the current block does not use the first intra-frame prediction technique.

[0270] It should be noted that, in the embodiments of this application, if the minimum cost result among the first cost result and the second cost result is equal to the minimum cost result among the third cost result, the current block may choose to use the first intra-frame prediction technique, or it may choose not to use the first intra-frame prediction technique.

[0271] In some embodiments, the method for determining the value of the first syntax element may include: if the minimum cost result among the first cost result and the second cost result is less than the minimum cost result among the third cost result, then the value of the first syntax element is determined to be a first value; if the minimum cost result among the first cost result and the second cost result is greater than the minimum cost result among the third cost result, then the value of the first syntax element is determined to be a second value.

[0272] In this embodiment, the first intra-frame prediction technique can refer to EIP (Enhanced Indication Prediction) technique. Therefore, the first syntax element can also be called the EIP usage flag, which can be represented by eip_flag. That is, if the minimum cost result among the first and second cost results is less than the minimum cost result among the third cost results, i.e., the current block uses EIP technique, then the value of eip_flag can be determined to be the first value; if the minimum cost result among the first and second cost results is greater than the minimum cost result among the third cost results, i.e., the current block does not use EIP technique, then the value of eip_flag can be determined to be the second value.

[0273] In some embodiments, when the current block uses EIP technology, referring to FIG12, after step S1102, the method may further include:

[0274] S1201, based on the first cost result and the second cost result, determine the value of the second syntax element, wherein the second syntax element is used to indicate whether the current block uses the merging mode of the first intra-frame prediction technique.

[0275] S1202, encode the value of the second syntax element and write the resulting encoded bits into the bitstream.

[0276] In this embodiment of the application, the first cost result and the second cost result can be used to determine whether the current block uses the merging mode of the first intra-frame prediction technique. In some embodiments, the method may include: if the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, it can be determined that the current block uses the merging mode of the first intra-frame prediction technique; if the minimum cost result in the first cost result is less than the minimum cost result in the second cost result, it can be determined that the current block does not use the merging mode of the first intra-frame prediction technique.

[0277] It should also be noted that, in the embodiments of this application, if the minimum cost result in the first cost result is equal to the minimum cost result in the second cost result, the current block may choose to use the merging mode of the first intra-frame prediction technique, or it may choose not to use the merging mode of the first intra-frame prediction technique.

[0278] In some embodiments, the method for determining the value of the second syntax element may include: if the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, then the value of the second syntax element is determined to be a first value; if the minimum cost result in the first cost result is less than the minimum cost result in the second cost result, then the value of the second syntax element is determined to be a second value.

[0279] In this embodiment, the merging mode of the first intra-frame prediction technique refers to the EIP merging mode. Therefore, the second syntax element can be called the eip_merge flag, and in this case, the second syntax element can be represented by eip_merge. That is, if the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, i.e., the current block uses the EIP merging mode, then the value of eip_merge can be determined to be the first value; if the minimum cost result in the first cost result is less than the minimum cost result in the second cost result, i.e., the current block does not use the EIP merging mode, then the value of eip_merge can be determined to be the second value.

[0280] It should also be noted that, in the embodiments of this application, based on the first cost result, the second cost result, and the third cost result, if the minimum cost result in the third cost result is the minimum value among the three, then it is determined that the current block does not use the first intra-frame prediction technique, that is, the current block does not use the EIP technique; if the minimum cost result in the first cost result is the minimum value among the three, then it is determined that the current block uses the first intra-frame prediction technique and does not use the first intra-frame prediction technique merging mode, that is, the current block uses the EIP technique and does not use the EIP merging mode; if the minimum cost result in the second cost result is the minimum value among the three, then it is determined that the current block uses the first intra-frame prediction technique and uses the first intra-frame prediction technique merging mode, that is, the current block uses the EIP technique and uses the EIP merging mode.

[0281] Understandably, in the embodiments of this application, when using EIP technology in the current block, while writing the value of eip_merge into the bitstream, it is also necessary to determine the optimal mode index and write it into the bitstream.

[0282] In some embodiments, when the current block uses EIP technology and does not use EIP merging mode, the method may further include: when the minimum cost result in the first cost result is less than the minimum cost result in the second cost result, determining the first candidate information corresponding to the minimum cost result in the first cost result; determining the mode index of the current block according to the index of the first candidate information in the first candidate list; encoding the mode index of the current block, and writing the obtained encoded bits into the bitstream.

[0283] In this embodiment of the application, if the minimum cost result in the first cost result is less than the minimum cost result in the second cost result, that is, the current block uses EIP technology and does not use EIP merging mode, i.e., based on calculated EIP prediction, then the first candidate information corresponding to the minimum cost result in the first cost result can be determined, and the index of the first candidate information in the first candidate list is determined as the optimal mode index, i.e., the mode index of the current block; and the mode index of the current block is encoded, and the obtained encoded bits are written into the bit stream.

[0284] Thus, in this embodiment of the application, after obtaining the first candidate information corresponding to the minimum cost result in the first cost result, the method may further include: when the current block uses the first intra-frame prediction technique and the current block does not use the first intra-frame prediction technique in a merging mode, determining the filtering parameters of the current block according to the first candidate information and the regularization parameter; and predicting the current block according to the filtering parameters of the current block to determine the prediction block of the current block.

[0285] In other words, in this embodiment, the first candidate information may include the shape of the filter and the template region, and the filtering parameters of the current block may include the shape of the filter and the coefficients of the filter. Thus, the current block uses computation-based EIP prediction. After obtaining the first candidate information, the coefficients of the filter can be determined based on the input and output samples in the template region and the regularization parameters. Then, the current block is predicted based on the shape of the filter and the coefficients of the filter to determine the prediction block of the current block, as shown in the aforementioned formula (5).

[0286] In some embodiments, when the current block uses EIP technology and uses EIP merging mode, the method may further include: when the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, determining the second candidate information corresponding to the minimum cost result in the second cost result; determining the mode index of the current block according to the index of the second candidate information in the second candidate list; encoding the mode index of the current block, and writing the obtained encoded bits into the bitstream.

[0287] In this embodiment of the application, if the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, that is, the current block uses EIP technology and uses EIP merging mode, i.e., EIP prediction based on merging, then the second candidate information corresponding to the minimum cost result in the second cost result can be determined, and the index of the second candidate information in the second candidate list is determined as the optimal mode index, i.e., the mode index of the current block; and the mode index of the current block is encoded, and the obtained encoded bits are written into the bit stream.

[0288] Thus, in this embodiment of the application, after obtaining the second candidate information corresponding to the minimum cost result in the second cost result, the method may further include: when the current block uses the first intra-frame prediction technique and the current block uses the merging mode of the first intra-frame prediction technique, determining the filtering parameters of the current block according to the second candidate information corresponding to the minimum cost result in the second cost result; and predicting the current block according to the filtering parameters of the current block to determine the prediction block of the current block.

[0289] In other words, in this embodiment of the application, the current block uses EIP prediction based on merging. After obtaining the second candidate information, the filtering parameters of the current block can be directly determined based on the second candidate information, such as the shape of the filter and the coefficients of the filter. Then, the current block is predicted based on the shape of the filter and the coefficients of the filter to determine the prediction block of the current block, as shown in the aforementioned formula (5).

[0290] It is also understandable that before determining whether the current block uses the first intra-frame prediction technique, it is necessary to first determine whether the current sequence is allowed to use the first intra-frame prediction technique and to determine the prediction type of the current block. In the embodiments of this application, the third syntax element can be used to indicate whether the current sequence is allowed to use the first intra-frame prediction technique, and the fourth syntax element can be used to indicate the prediction type of the current block. The prediction type includes intra-frame prediction or inter-frame prediction.

[0291] In this embodiment of the application, the current sequence includes the current block. The third syntax element is a sequence-level syntax element, while the first, second, and fourth syntax elements are all block-level (CU-level or PU-level) syntax elements.

[0292] In some embodiments, the method may further include: determining the value of the third syntax element as a first value when the current sequence allows the use of the first intra-frame prediction technique; and determining the value of the third syntax element as a second value when the current sequence does not allow the use of the first intra-frame prediction technique.

[0293] In this embodiment, the third syntax element can be called the EIP enable flag, which can be represented by `sps_eip_enable_flag`. That is, if the current sequence allows the use of EIP technology, then the value of `sps_eip_enable_flag` is determined to be the first value; if the current sequence does not allow the use of EIP technology, then the value of `sps_eip_enable_flag` is determined to be the second value.

[0294] In some embodiments, the method may further include: when the prediction type of the current block is intra-frame prediction, determining that the value of the fourth syntax element is a first value; and when the prediction type of the current block is inter-frame prediction, determining that the value of the fourth syntax element is a second value.

[0295] In the embodiments of this application, the fourth syntax element can be referred to as the prediction type identifier bit. That is, if the prediction type of the current block is intra-frame prediction, then the value of the fourth syntax element is determined to be the first value; if the prediction type of the current block is inter-frame prediction, then the value of the fourth syntax element is determined to be the second value.

[0296] In the embodiments of this application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numeric form. For example, the syntax element here can be a parameter written in the profile, or it can be the value of a flag, without any limitation.

[0297] For example, the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true; but no limitation is made on this.

[0298] In this embodiment, the encoder first encodes the value of the third syntax element and writes the resulting encoded bits into the bitstream. When the current sequence allows the use of the first intra-frame prediction technique, the encoder also needs to encode the value of the fourth syntax element and write the resulting encoded bits into the bitstream. When the prediction type of the current block is intra-frame prediction, the encoder also needs to encode the value of the first syntax element and write the resulting encoded bits into the bitstream. When the current block uses EIP (Encoding Injection Propagation) technology, the encoder also needs to encode the value of the second syntax element and the corresponding mode index and write the resulting encoded bits into the bitstream.

[0299] Furthermore, this application embodiment also provides a bitstream, which is generated by bit encoding according to the encoding method; wherein, the information to be encoded corresponding to the encoding method includes at least one of the following: the value of the first syntax element, the value of the second syntax element, the value of the third syntax element, the value of the fourth syntax element, and the pattern index of the current block.

[0300] In this embodiment, the first syntax element indicates whether the current block uses the first intra-frame prediction technique; the second syntax element indicates whether the current block uses the merging mode of the first intra-frame prediction technique; the third syntax element indicates whether the current sequence allows the use of the first intra-frame prediction technique; and the fourth syntax element indicates the prediction type of the current block. Here, the prediction type includes intra-frame prediction or inter-frame prediction.

[0301] In this embodiment of the application, by encoding these information to be encoded, the obtained encoded bits are written into the bitstream, and then the bitstream is transmitted from the encoding end to the decoding end, so that the decoding end can determine whether the first intra-frame prediction technology is currently used and whether the current block uses the merging mode of the first intra-frame prediction technology by parsing the bitstream.

[0302] This application provides an encoding method that determines a first candidate list corresponding to a merging mode when the current block does not use the first intra-frame prediction technique; determines at least one set of first candidate filtering parameters based on at least one set of candidate mode information and regularization parameters in the first candidate list, and determines a first cost result corresponding to each of the at least one set of first candidate filtering parameters; determines a second candidate list corresponding to a merging mode when the current block uses the first intra-frame prediction technique, and determines a second cost result corresponding to each of the at least one set of second candidate filtering parameters in the second candidate list; determines a third cost result corresponding to a prediction technique other than the first intra-frame prediction technique used by the current block; and determines whether the current block uses the first intra-frame prediction technique and whether the current block uses the merging mode of the first intra-frame prediction technique based on the first cost result, the second cost result, and the third cost result, and writes these results into the bitstream. This allows the subsequent decoding end to determine, by parsing the bitstream, the merging mode of the current block when it uses intra-frame prediction (IB) and when it does not, based on the first candidate list of the current block and the mode index in the bitstream. This enables the determination of the current block's mode information, such as the template region and the shape of the filter. Then, based on the mode information and regularization parameters, the filter coefficients in the filtering parameters can be determined, thereby improving generalization ability and ensuring that the filter coefficients are better applied to the prediction of the current block. Predicting the current block based on its coefficients and shape improves prediction accuracy, thus increasing compression efficiency and ultimately enhancing encoding / decoding performance.

[0303] In another embodiment of this application, based on the encoding and decoding method of the foregoing embodiments, the technical solution of this application mainly involves: introducing parameter regularization for encoding tools that require methods such as Cholesky decomposition, LDL decomposition, or Gaussian elimination. The modified coefficient calculation formula is shown in the aforementioned formula (4). Wherein, λI is the regularization parameter added to the formula.

[0304] In one specific embodiment, the detailed solution of this application includes the following:

[0305] (a) Adaptive parameter regularization based on the number of training samples:

[0306] The aforementioned encoding tools all require adjacent or non-adjacent reconstructed samples as training samples to train the filter coefficients. Therefore, by determining the number of training samples, a regularization parameter is added to the calculation formula accordingly. For example, for encoding blocks with fewer than a certain threshold of training samples, a larger regularization parameter is set; while for encoding blocks with more than a certain threshold of training samples, a relatively smaller regularization parameter is set, or no regularization is performed.

[0307] (b) Adaptive parameter regularization based on input information:

[0308] As can be seen from the optimized formula (4), λI is also a matrix, and different regularization parameters can be set according to different tap positions / types in the input information. For example, no regularization is performed on samples with constant terms, that is, regularization parameters are added to the calculation of samples with non-constant terms, while the matrix calculation of constant positions is not changed.

[0309] (c) Adaptive parameter regularization term based on block size:

[0310] Here, for coding blocks whose size is less than a certain threshold, a larger regularization parameter is set; while for coding blocks whose size is greater than a certain threshold, a relatively smaller regularization parameter is set, or no regularization is performed.

[0311] Furthermore, in this embodiment of the application, taking the size of the coding block as an example, for coding blocks whose size is greater than a certain threshold, a larger regularization parameter can be set; while for coding blocks whose size is less than a certain threshold, a relatively smaller regularization parameter can be set. No specific limitation is made here.

[0312] In one specific embodiment, at the encoding end, the encoder traverses the prediction modes. If the current prediction type is intra-frame prediction, it obtains the allowable flag bit of this application embodiment. This flag bit is a sequence-level identifier bit, indicating that the current encoder is allowed to use intra-frame prediction technology based on extrapolation filtering (i.e., EIP technology), which can be represented in the form of sps_eip_enable_flag.

[0313] The specific process at the encoding end is as follows:

[0314] Step 1: If the EIP allow flag is true, proceed to Step 2; if the EIP allow flag or other conditions are not met, the encoding end will not attempt EIP technology, i.e., skip Step 2 and proceed directly to Step 3.

[0315] Step 2, the encoding end attempts EIP technology:

[0316] Step 2-1, EIP prediction based on calculation.

[0317] The encoder constructs up to nine candidate pattern information by combining training templates from different regions with filters of different shapes. For example, if the upper template region and the square filter are considered as one candidate, then this candidate can only use the reconstructed samples from the upper template region as training samples for the square filter. Similarly, the filter coefficients of the nine candidate pattern information are calculated sequentially. When calculating these filter coefficients, different regularization parameters are set according to the number of training samples. For example, when the number of training samples is less than or equal to 2024, λ is set to 192, and I is the number of filter coefficients; otherwise, λ is set to 128, and I is the number of filter coefficients. It should be noted that there are a maximum of nine candidate pattern information here. Specifically, the number of candidate pattern information allowed for the current block can be determined based on the width and height of the current block to obtain a calculated EIP candidate list.

[0318] Step 2-2, based on merged EIP predictions.

[0319] The candidate list in the EIP merging mode is obtained according to the method of the foregoing embodiment, and all candidates in the candidate list are sorted to obtain the merged EIP candidate list.

[0320] Steps 2-3: The encoding end calculates the EIP rate distortion cost.

[0321] The algorithm iterates through both the computation-based EIP candidate list and the merge-based EIP candidate list, calculating the rate-distortion cost of the predicted block versus the original image block for each candidate. The minimum rate-distortion cost is the minimum cost of the current EIP technique. It records whether the candidate is an EIP merging mode, saves its mode index in the corresponding candidate list, and also saves the corresponding filter shape and filter coefficients.

[0322] Step 3: The encoder iterates through the untried prediction techniques and calculates their optimal cost results.

[0323] Step 4: If EIP is allowed and the rate-distortion cost of the optimal EIP candidate is minimized, then write the EIP merging mode information (eip_merge) of the current coding block into the bitstream, write the optimal mode index (eip_index) into the bitstream, and save its filter shape and filter coefficients to the history list. The coding block reconstruction process is then complete.

[0324] Otherwise, information from other optimal modes is written into the bitstream, transmitted to the decoding end, and the encoding block reconstruction process is completed.

[0325] Step 5: After traversing all coding units, the bitstream is output after passing through techniques such as loop filtering and entropy coding.

[0326] In another specific embodiment, at the decoding end, the decoder parses or obtains the EIP enable flag, which is a sequence-level flag (sps_eip_enable_flag) indicating that the current decoder allows the use of EIP technology.

[0327] The specific process at the decoding end is as follows:

[0328] Step 1: Parse the bitstream to obtain the prediction type of the current decoded block. If it is intra-frame prediction, parse the EIP usage flag of the current decoded block. If the EIP_flag usage flag of the current decoded block is true, it means that the current decoded block uses EIP prediction technology, and the EIP_merge flag and EIP_index of the current decoded block need to be parsed.

[0329] If the eip_flag flag of the current decoding block is not used, it means that the current decoding block does not use EIP prediction technology, and proceed to step 3.

[0330] Step 2: If the eip_merge flag of the current decoding block is true, it means that the current decoding block uses the EIP merging mode, and step 2-1 is executed; otherwise, it means that the current decoding block does not use the EIP merging mode, and step 2-2 is executed.

[0331] Step 2-1, based on the merged EIP prediction.

[0332] The candidate list in the EIP merging mode is obtained according to the method of the foregoing embodiment, and all candidates in the candidate list are sorted to obtain a merge-based EIP candidate list. The corresponding EIP information in the list is obtained according to the eip_index. Using the EIP information corresponding to the candidate, i.e., the filter shape and filter coefficients, prediction is performed on the current coded block to obtain the prediction block of the current decoded block.

[0333] Step 2-2, EIP prediction based on calculation.

[0334] Based on the width and height of the current decoded block, information on several allowed candidate modes is obtained to generate a computationally-based EIP candidate list. The maximum length of this EIP list is 9, representing a combination of 3 different template regions and 3 different filter shapes. The corresponding EIP information, including the template region and filter shape, is retrieved from this list based on the `eip_index`. Input and output samples corresponding to the filter shape within the template region are then used to calculate filter coefficients. Different regularization parameters are set based on the number of training samples during the calculation of these filter coefficients. For example, when the number of training samples is less than or equal to 2024, λ is set to 192, and I is the number of filter coefficients; otherwise, λ is set to 128, and I is the number of filter coefficients. The calculated filter coefficients are then applied to the current decoded block for prediction, yielding the predicted block for the current decoded block.

[0335] Step 3: Continue to parse the information such as the technology usage flag or index, and obtain the final prediction block of the current decoded block based on the parsed information;

[0336] Step 4: Parse the bitstream and obtain residual information. Obtain the residual block based on inverse quantization and inverse transform. Superimpose the final predicted block and the residual block to obtain the reconstructed block of the current decoded block.

[0337] Step 5: After all the reconstructed blocks are processed by techniques such as loop filtering, the final reconstructed image is obtained, which can be used as both video output and as a reference for subsequent decoding.

[0338] Understandably, in the embodiments of this application, the parameter regularization method can be applied to any tool that uses Cholesky decomposition, LDL decomposition, and Gaussian elimination, such as CCCM technology, TmpFilter technology, TmpFusion technology, BCW technology, etc.

[0339] Understandably, in this embodiment, the adaptive parameter regularization term can be fixed as a constant during hardware implementation. Furthermore, in this embodiment, different regularization parameters can be set according to the shape of the coded block and the shape of the filter.

[0340] It can also be understood that, in the embodiments of this application, the filter coefficients under different regularization parameters are calculated as candidates, prediction is performed in the template region, and the SAD or SATD cost of the template prediction block and the template reconstruction block is calculated. The filter coefficient corresponding to the minimum cost is the EIP filter coefficient used in the current block.

[0341] Based on the encoding and decoding method described in the foregoing embodiments, this technical solution was implemented in the ECM reference software and tested under normal testing conditions. The results are shown in Table 1 below. The encoding time (EncT) and decoding time (DecT) are theoretically 100%. The data in Table 1 show significant fluctuations in encoding and decoding times due to testing on different servers and at different times, which can be ignored.

[0342] Table 1

[0343] As can be seen from Table 1 above, this technology can contribute close to 0.05% coding gain under the ECM AI configuration, and the modification is very direct and simple, thereby improving coding performance.

[0344] In this application embodiment, the specific implementation of the aforementioned embodiments is described in detail through the above embodiments. It can be seen that, according to the technical solution of the aforementioned embodiments, an adaptive parameter regularization term based on the number of training samples and an adaptive parameter regularization term based on the filter input information (tap position / type) are provided. This improves the generalization ability, allowing the filter coefficients to be better applied to the prediction of the current block; thus, predicting the current block based on the filter coefficients and the filter shape improves the prediction accuracy of the current block, thereby improving compression efficiency and ultimately enhancing encoding and decoding performance.

[0345] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, FIG13 is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application. As shown in FIG13, the encoder 130 includes a first determining unit 1301 and an encoding unit 1302, wherein:

[0346] The first determining unit 1301 is configured to: determine a first candidate list corresponding to the merging mode when the current block does not use the first intra-frame prediction technique; determine at least one set of first candidate filtering parameters based on at least one set of candidate mode information and regularization parameters in the first candidate list; and determine a first cost result corresponding to each of the at least one set of first candidate filtering parameters; determine a second candidate list corresponding to the merging mode when the current block uses the first intra-frame prediction technique; and determine a second cost result corresponding to each of the at least one set of second candidate filtering parameters in the second candidate list; and determine a third cost result corresponding to the current block using other prediction techniques besides the first intra-frame prediction technique.

[0347] The first determining unit 1301 is further configured to determine the value of the first syntax element based on the first cost result, the second cost result and the third cost result, wherein the first syntax element is used to indicate whether the current block uses the first intra-frame prediction technique.

[0348] The encoding unit 1302 is configured to encode the value of the first syntax element and write the resulting encoded bits into the bit stream.

[0349] In some embodiments, the first determining unit 1301 is further configured to determine the value of the first syntax element as a first value if the minimum cost result among the first cost result and the second cost result is less than the minimum cost result among the third cost result; and to determine the value of the first syntax element as a second value if the minimum cost result among the first cost result and the second cost result is greater than the minimum cost result among the third cost result.

[0350] In some embodiments, the first determining unit 1301 is further configured to determine the value of the second syntax element based on the first cost result and the second cost result, wherein the second syntax element is used to indicate whether the current block uses the merging mode of the first intra-frame prediction technique; the encoding unit 1302 is further configured to encode the value of the second syntax element and write the obtained encoded bits into the bitstream.

[0351] In some embodiments, the first determining unit 1301 is further configured to determine the value of the second syntax element as a first value if the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result; and to determine the value of the second syntax element as a second value if the minimum cost result in the first cost result is less than the minimum cost result in the second cost result.

[0352] In some embodiments, the first determining unit 1301 is further configured to determine the first candidate information corresponding to the minimum cost result in the first cost result when the minimum cost result in the first cost result is less than the minimum cost result in the second cost result; and to determine the mode index of the current block according to the index of the first candidate information in the first candidate list; the encoding unit 1302 is further configured to encode the mode index of the current block and write the obtained encoded bits into the code stream.

[0353] In some embodiments, the first determining unit 1301 is further configured to determine the second candidate information corresponding to the minimum cost result in the second cost result when the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result; and to determine the mode index of the current block according to the index of the second candidate information in the second candidate list; the encoding unit 1302 is further configured to encode the mode index of the current block and write the obtained encoded bits into the code stream.

[0354] In some embodiments, the first determining unit 1301 is further configured to determine the shape of at least one candidate template region and at least one candidate filter based on the width and height of the current block; and to determine a first candidate list based on the shape of at least one candidate template region and at least one candidate filter; wherein the first candidate list includes at least one set of candidate mode information, and the candidate mode information includes the shape of the candidate template region and the candidate filter.

[0355] In some embodiments, the first determining unit 1301 is further configured to determine a regularization parameter based on the number of training samples in the candidate template region.

[0356] In some embodiments, the first determining unit 1301 is further configured to determine the regularization parameter as a first parameter value when the number of training samples in the candidate template region is greater than a preset sample threshold, and to determine the regularization parameter as a second parameter value when the number of training samples in the candidate template region is less than the preset sample threshold.

[0357] In some embodiments, the value of the first parameter is less than the value of the second parameter.

[0358] In some embodiments, the first determining unit 1301 is further configured to determine regularization parameters based on the size of the current block.

[0359] In some embodiments, the first determining unit 1301 is further configured to determine the regularization parameter as a third parameter value when the size of the current block is greater than a preset size threshold; and to determine the regularization parameter as a fourth parameter value when the size of the current block is less than the preset size threshold.

[0360] In some embodiments, the value of the third parameter is less than the value of the fourth parameter.

[0361] In some embodiments, the first determining unit 1301 is further configured to determine the input information corresponding to the candidate filter; and to determine the regularization parameter based on the input information.

[0362] In some embodiments, the first determining unit 1301 is further configured to determine the regularization parameter to be zero when the sample corresponding to the tap position is a constant term, and to determine the regularization parameter to be a non-zero parameter value when the sample corresponding to the tap position is a non-constant term.

[0363] In some embodiments, the regularization parameter is a constant.

[0364] In some embodiments, referring to FIG13, encoder 130 further includes a first prediction unit 1303; the first determination unit 1301 is further configured to determine the filtering parameters of the current block based on the first candidate information corresponding to the minimum cost result in the first cost result and the regularization parameter when the current block uses the first intra-frame prediction technique and the current block does not use the first intra-frame prediction technique in the merging mode; the first prediction unit 1303 is configured to predict the current block based on the filtering parameters of the current block to determine the prediction block of the current block.

[0365] In some embodiments, the first determining unit 1301 is further configured to determine the filtering parameters of the current block based on the second candidate information corresponding to the minimum cost result in the second cost result when the current block uses the first intra-frame prediction technique and the current block uses the merging mode of the first intra-frame prediction technique; the first prediction unit 1303 is further configured to predict the current block based on the filtering parameters of the current block to determine the prediction block of the current block.

[0366] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0367] In another embodiment of this application, FIG14 is a schematic diagram of the hardware structure of an encoder provided in an embodiment of this application. As shown in FIG14, the encoder 130 may include: a first communication interface 1401, a first memory 1402, and a first processor 1403; the various components are coupled together through a first bus system 1404. It is understood that the first bus system 1404 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1404 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all buses are labeled as the first bus system 1404 in FIG14. Wherein:

[0368] The first communication interface 1401 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0369] The first memory 1402 is used to store computer programs that can run on the first processor 1403;

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

[0371] A first candidate list is determined when the current block does not use the first intra-frame prediction technique in the merging mode. At least one set of first candidate filtering parameters is determined based on at least one set of candidate mode information and regularization parameters in the first candidate list, and a first cost result is determined for each of the at least one set of first candidate filtering parameters. A second candidate list is determined when the current block uses the first intra-frame prediction technique in the merging mode, and a second cost result is determined for each of the at least one set of second candidate filtering parameters in the second candidate list. A third cost result is determined when the current block uses prediction techniques other than the first intra-frame prediction technique. Based on the first cost result, the second cost result, and the third cost result, the value of a first syntax element is determined, whereby the first syntax element indicates whether the current block uses the first intra-frame prediction technique. The value of the first syntax element is encoded, and the resulting encoded bits are written into the bitstream.

[0372] It is understood that the first memory 1402 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1402 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0373] The first processor 1403 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1403 or by instructions in software form. The first processor 1403 may 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 1402. The first processor 1403 reads the information in the first memory 1402 and completes the steps of the above method in conjunction with its hardware.

[0374] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0375] Alternatively, as another embodiment, the first processor 1403 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0376] This embodiment provides an encoder that determines whether the current block uses the first intra-frame prediction technique and its merging mode through cost calculation, and writes this information into the bitstream. This allows the subsequent decoder, when determining whether the current block uses the first intra-frame prediction technique or not through the merging mode, to determine the current block's mode information, such as the template region and filter shape, based on the first candidate list and the mode index in the bitstream. Then, based on the mode information and regularization parameters, the filter coefficients in the filtering parameters can be determined, thereby improving generalization ability and ensuring the filter coefficients are better suited for the current block's prediction. Predicting the current block based on its coefficients and shape improves prediction accuracy, thereby increasing compression efficiency and ultimately enhancing encoding / decoding performance.

[0377] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, FIG15 is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application. As shown in FIG15, the decoder 150 includes a parsing unit 1501, a second determining unit 1501, and a second predicting unit 1502, wherein:

[0378] The parsing unit 1501 is configured to parse the first syntax element in the bitstream; and when the first syntax element indicates that the current block uses the first intra-frame prediction technique, it parses the second syntax element in the bitstream and the mode index of the current block.

[0379] The second determining unit 1502 is configured to, when the second syntax element indicates that the current block does not use the merging mode of the first intra-frame prediction technique, determine the first candidate list of the current block; determine the mode information of the current block according to the first candidate list and the mode index; and determine the filtering parameters of the current block according to the mode information and the regularization parameter.

[0380] The second prediction unit 1503 is configured to predict the current block based on the filtering parameters and determine the prediction block of the current block.

[0381] In some embodiments, the second determining unit 1502 is further configured to determine a regularization parameter based on the number of training samples in the template region.

[0382] In some embodiments, the second determining unit 1502 is further configured to determine the regularization parameter as a first parameter value when the number of training samples in the template region is greater than a preset sample threshold, and to determine the regularization parameter as a second parameter value when the number of training samples in the template region is less than the preset sample threshold.

[0383] In some embodiments, the value of the first parameter is less than the value of the second parameter.

[0384] In some embodiments, the second determining unit 1502 is further configured to determine regularization parameters based on the size of the current block.

[0385] In some embodiments, the second determining unit 1502 is further configured to determine the regularization parameter as a third parameter value when the size of the current block is greater than a preset size threshold, and to determine the regularization parameter as a fourth parameter value when the size of the current block is less than the preset size threshold.

[0386] In some embodiments, the value of the third parameter is less than the value of the fourth parameter.

[0387] In some embodiments, the second determining unit 1502 is further configured to determine the input information corresponding to the filter; and to determine the regularization parameter based on the input information.

[0388] In some embodiments, the second determining unit 1502 is further configured to determine the regularization parameter to be zero when the sample corresponding to the tap position is a constant term, and to determine the regularization parameter to be a non-zero parameter value when the sample corresponding to the tap position is a non-constant term.

[0389] In some embodiments, the second determining unit 1502 is further configured to determine the shape of the filter and the input and output samples of the filter based on the mode information; and to determine the coefficients of the filter based on the regularization parameters and the input and output samples of the filter.

[0390] In some embodiments, the second determining unit 1502 is further configured to determine the shape of at least one candidate template region and at least one candidate filter based on the width and height of the current block; and to determine a first candidate list of the current block based on the shape of at least one candidate template region and at least one candidate filter; wherein the first candidate list includes at least one set of candidate pattern information, and the candidate pattern information includes the shape of the candidate template region and the candidate filter.

[0391] In some embodiments, the regularization parameter is a constant.

[0392] In some embodiments, the second determining unit 1502 is further configured to determine multiple sets of candidate filtering parameters for the current block based on multiple candidate regularization parameters and pattern information; calculate the cost of the template region of the current block according to the multiple sets of candidate filtering parameters to determine the cost value corresponding to each of the multiple sets of candidate filtering parameters; and determine the minimum cost value according to the cost value corresponding to each of the multiple sets of candidate filtering parameters, and determine the candidate filtering parameter corresponding to the minimum cost value as the filtering parameter of the current block.

[0393] In some embodiments, the second determining unit 1502 is further configured to determine a second candidate list for the current block when the second syntax element indicates that the current block uses the merging mode of the first intra-frame prediction technique; and to determine mode information of the current block based on the second candidate list and the mode index; and to determine filtering parameters of the current block based on the mode information; the second prediction unit 1503 is further configured to predict the current block based on the filtering parameters to determine the prediction block of the current block.

[0394] In some embodiments, the second determining unit 1502 is further configured to: determine a third candidate list for the current block based on reference information of the current block; calculate the cost of each template region of the current block based on at least one set of candidate filtering parameters in the third candidate list to determine the cost value corresponding to each of the at least one set of candidate filtering parameters in the third candidate list; and sort the at least one set of candidate filtering parameters in the third candidate list based on the cost value to determine a second candidate list for the current block; wherein the reference information for the current block includes at least one of the following: whether the adjacent blocks of the current block use the first intra-frame prediction technique; whether the non-adjacent blocks of the current block use the first intra-frame prediction technique; whether the temporal co-location blocks of the current block use the first intra-frame prediction technique; and a historical list of the current block based on the first intra-frame prediction technique.

[0395] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.

[0396] In another embodiment of this application, FIG16 is a schematic diagram of the hardware structure of a decoder provided in an embodiment of this application. As shown in FIG16, the decoder 150 may include: a second communication interface 1601, a second memory 1602, and a second processor 1603; the various components are coupled together through a second bus system 1604. It is understood that the second bus system 1604 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 1604 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all buses are labeled as the second bus system 1604 in FIG16. Wherein:

[0397] The second communication interface 1601 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0398] The second memory 1602 is used to store computer programs that can run on the second processor 1603;

[0399] The second processor 1603 is configured to perform the following when running the computer program:

[0400] The process involves parsing the first syntax element in the bitstream; parsing the second syntax element and the mode index of the current block when the first syntax element indicates that the current block uses the first intra-frame prediction technique; determining the first candidate list for the current block when the second syntax element indicates that the current block does not use the first intra-frame prediction technique in a merged mode; determining the mode information of the current block based on the first candidate list and the mode index; determining the filtering parameters of the current block based on the mode information and the regularization parameters; and predicting the current block based on the filtering parameters to determine the predicted block of the current block.

[0401] Alternatively, as another embodiment, the second processor 1603 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0402] It is understood that the second memory 1602 has similar hardware functions to the first memory 1402, and the second processor 1603 has similar hardware functions to the first processor 1403; these will not be described in detail here.

[0403] This embodiment provides a decoder that, when analyzing the bitstream and determining that the current block uses a merging mode where the first intra-frame prediction technique is used but not in the current block, determines a first candidate list for the current block. Then, based on the first candidate list and the mode index obtained from analyzing the bitstream, the mode information of the current block, such as the template region and the shape of the filter, can be determined. Furthermore, based on the mode information and regularization parameters, the filter coefficients in the filtering parameters can be determined, thereby improving generalization ability and allowing the filter coefficients to be better applied to the prediction of the current block. Thus, predicting the current block based on the filter coefficients and the filter shape improves the prediction accuracy of the current block, thereby increasing compression efficiency and ultimately enhancing encoding and decoding performance.

[0404] In another embodiment of this application, FIG17 is a schematic diagram of the composition structure of an encoding and decoding system provided in an embodiment of this application. As shown in FIG17, the encoding and decoding system 170 may include an encoder 1701 and a decoder 1702.

[0405] In this embodiment, encoder 1701 can be any of the encoders described in the foregoing embodiments, and decoder 1702 can be any of the decoders described in the foregoing embodiments.

[0406] In some embodiments, this application also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor (e.g., a first processor or a second processor), the computer program implements the method as described in any of the foregoing embodiments.

[0407] In some embodiments, this application also provides a computer program product, including a computer program or instructions. When executed by a processor (e.g., a first processor or a second processor), the computer program or instructions implement the method as described in any of the foregoing embodiments.

[0408] In some embodiments, this application also provides a computer program that, when executed by a processor (e.g., a first processor or a second processor), implements the method as described in any of the foregoing embodiments.

[0409] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0410] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0411] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0412] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0413] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0414] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0415] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0416] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

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

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

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

[0420] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability

[0421] In this embodiment, at the encoding end, a first candidate list is determined when the current block does not use the first intra-frame prediction technique in the merging mode. At least one set of first candidate filtering parameters is determined based on at least one set of candidate mode information and regularization parameters in the first candidate list, and a first cost result is determined for each of the at least one set of first candidate filtering parameters. A second candidate list is determined when the current block uses the first intra-frame prediction technique in the merging mode, and a second cost result is determined for each of the at least one set of second candidate filtering parameters in the second candidate list. A third cost result is determined for the current block using other prediction techniques besides the first intra-frame prediction technique. The value of a first syntax element is determined based on the first cost result, the second cost result, and the third cost result. The value of the first syntax element is encoded, and the obtained encoded bits are written into the bitstream. At the decoding end, the first syntax element in the bitstream is parsed; when the first syntax element indicates that the current block uses the first intra-frame prediction technique, the second syntax element in the bitstream and the mode index of the current block are parsed; when the second syntax element indicates that the current block does not use the first intra-frame prediction technique in a merging mode, the first candidate list of the current block is determined; based on the first candidate list and the mode index, the mode information of the current block is determined; based on the mode information and regularization parameters, the filtering parameters of the current block are determined; and based on the filtering parameters, the current block is predicted to determine the prediction block of the current block. Thus, when the current block uses the first intra-frame prediction technique and does not use the first intra-frame prediction technique in a merging mode, the first candidate list of the current block is determined. Then, based on the first candidate list and the mode index obtained from parsing the bitstream, the mode information of the current block, such as the template region and the shape of the filter, can be determined. Then, based on the mode information and regularization parameters, the coefficients of the filter in the filtering parameters can be determined, thereby improving the generalization ability and making the filter coefficients more applicable to the prediction of the current block. Predicting the current block based on the filter coefficients and the filter shape can improve the prediction accuracy of the current block, thereby improving compression efficiency and ultimately enhancing encoding and decoding performance.

Claims

1. A decoding method applied to a decoder, the method comprising: parsing a first syntax element in a bitstream; when the first syntax element indicates that a current block uses a first intra prediction technique, parsing a second syntax element in the bitstream and a mode index of the current block; when the second syntax element indicates that the current block does not use a merge mode of the first intra prediction technique, determining a first candidate list of the current block; determining mode information of the current block according to the first candidate list and the mode index; determining a filter parameter of the current block according to the mode information and a regularization parameter; predicting the current block according to the filter parameter to determine a prediction block of the current block.

2. The method of claim 1, wherein, The mode information comprises a template region and a shape of a filter; the method further comprises: determining the regularization parameter according to a number of training samples in the template region.

3. The method of claim 2, wherein, The determining the regularization parameter according to the number of training samples in the template region comprises: when the number of training samples in the template region is greater than a preset sample threshold, determining the regularization parameter as a first parameter value; when the number of training samples in the template region is less than the preset sample threshold, determining the regularization parameter as a second parameter value.

4. The method of claim 3, wherein, The first parameter value is less than the second parameter value.

5. The method of claim 1, wherein, The method further comprises: determining the regularization parameter according to a size of the current block.

6. The method of claim 5, wherein, The determining the regularization parameter according to the size of the current block comprises: when the size of the current block is greater than a preset size threshold, determining the regularization parameter as a third parameter value; when the size of the current block is less than the preset size threshold, determining the regularization parameter as a fourth parameter value.

7. The method of claim 6, wherein, The third parameter value is less than the fourth parameter value.

8. The method of claim 2, wherein, The method further comprises: determining input information corresponding to the filter; determining the regularization parameter according to the input information.

9. The method of claim 8, wherein, When the input information comprises tap positions, the determining the regularization parameter according to the input information comprises: when a sample corresponding to the tap position is a constant term, determining the regularization parameter as zero; when the sample corresponding to the tap position is a non-constant term, determining the regularization parameter as a non-zero parameter value.

10. The method of claim 2, wherein, The filter parameter comprises a shape of the filter and a coefficient of the filter; the determining the filter parameter of the current block according to the mode information and the regularization parameter comprises: determining the shape of the filter and input samples and output samples of the filter according to the mode information; determining the coefficient of the filter according to the regularization parameter and the input samples and the output samples of the filter.

11. The method according to any one of claims 1 to 10, wherein, The determining the first candidate list of the current block comprises: determining shapes of at least one candidate template region and at least one candidate filter according to a width and a height of the current block; determining the first candidate list of the current block according to the shapes of the at least one candidate template region and the at least one candidate filter; wherein the first candidate list comprises at least one group of candidate mode information, and the candidate mode information comprises the candidate template region and the shape of the candidate filter.

12. The method of claim 1, wherein, The regularization parameter is a constant.

13. The method according to any one of claims 1 to 10, wherein, The determining the filter parameter of the current block according to the mode information and the regularization parameter further includes: determining a plurality of groups of candidate filter parameters of the current block based on a plurality of candidate regularization parameters and the mode information; performing cost calculation on a template region of the current block respectively according to the plurality of groups of candidate filter parameters to determine respective cost values corresponding to the plurality of groups of candidate filter parameters; determining a minimum cost value according to the respective cost values corresponding to the plurality of groups of candidate filter parameters, and determining a candidate filter parameter corresponding to the minimum cost value as the filter parameter of the current block.

14. The method according to any one of claims 1 to 13, wherein, The method further includes: when the second syntax element indicates that the current block uses the merge mode of the first intra prediction technology, determining a second candidate list of the current block; determining mode information of the current block according to the second candidate list and the mode index; determining a filter parameter of the current block according to the mode information; performing prediction on the current block according to the filter parameter to determine a prediction block of the current block. The determining the second candidate list of the current block includes:

15. The method of claim 14, wherein, determining a third candidate list of the current block according to reference information of the current block; performing cost calculation on a template region of the current block respectively according to at least one group of candidate filter parameters in the third candidate list to determine respective cost values corresponding to the at least one group of candidate filter parameters in the third candidate list; sorting the at least one group of candidate filter parameters in the third candidate list according to the cost values to determine the second candidate list of the current block; wherein the reference information of the current block includes at least one of the following: whether a neighboring block of the current block uses the first intra prediction technology; whether a non-neighboring block of the current block uses the first intra prediction technology; whether a temporal collocated block of the current block uses the first intra prediction technology; a history list of the current block based on the first intra prediction technology.

16. An encoding method applied to an encoder, the method comprising: determining a first candidate list corresponding to when a current block does not use a merge mode of a first intra prediction technology, determining at least one group of first candidate filter parameters according to at least one group of candidate mode information in the first candidate list and a regularization parameter, and determining respective first cost results corresponding to the at least one group of first candidate filter parameters; determining a second candidate list corresponding to when the current block uses the merge mode of the first intra prediction technology, and determining respective second cost results corresponding to at least one group of second candidate filter parameters in the second candidate list; determining a third cost result corresponding to when the current block uses a prediction technology other than the first intra prediction technology; determining a value of a first syntax element according to the first cost result, the second cost result, and the third cost result, wherein the first syntax element is used to indicate whether the current block uses the first intra prediction technology; performing encoding processing on the value of the first syntax element, and writing obtained encoding bits into a bitstream. ​ 17. The method of claim 16, wherein, The determining the value of the first syntax element according to the first cost result, the second cost result and the third cost result comprises: if the minimum cost result in the first cost result and the second cost result is smaller than the minimum cost result in the third cost result, determining the value of the first syntax element as a first value; if the minimum cost result in the first cost result and the second cost result is larger than the minimum cost result in the third cost result, determining the value of the first syntax element as a second value.

18. The method of claim 16, wherein, The method further comprises: determining the value of a second syntax element according to the first cost result and the second cost result, wherein the second syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology; encoding the value of the second syntax element and writing the obtained encoding bits into a bitstream.

19. The method of claim 18, wherein, The determining the value of the second syntax element according to the first cost result and the second cost result comprises: if the minimum cost result in the first cost result is larger than the minimum cost result in the second cost result, determining the value of the second syntax element as a first value; if the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, determining the value of the second syntax element as a second value.

20. The method of claim 19, wherein, The method further comprises: when the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, determining first candidate information corresponding to the minimum cost result in the first cost result; determining the mode index of the current block according to the index of the first candidate information in the first candidate list; encoding the mode index of the current block and writing the obtained encoding bits into a bitstream.

21. The method of claim 19, wherein, The method further comprises: when the minimum cost result in the first cost result is larger than the minimum cost result in the second cost result, determining second candidate information corresponding to the minimum cost result in the second cost result; determining the mode index of the current block according to the index of the second candidate information in the second candidate list; encoding the mode index of the current block and writing the obtained encoding bits into a bitstream.

22. The method of claim 16, wherein, The determining the first candidate list corresponding to the current block not using the merge mode of the first intra prediction technology comprises: determining the shape of at least one candidate template region and at least one candidate filter according to the width and height of the current block; determining the first candidate list according to the shape of the at least one candidate template region and the at least one candidate filter; wherein the first candidate list comprises at least one group of candidate mode information, and the candidate mode information comprises the shape of the candidate template region and the candidate filter.

23. The method of claim 22, wherein, The method further comprises: determining the regularization parameter according to the number of training samples in the candidate template region.

24. The method of claim 23, wherein, The determining the regularization parameter according to the number of training samples in the candidate template region comprises: determining the regularization parameter as a first parameter value when the number of training samples in the candidate template region is greater than a preset sample threshold; determining the regularization parameter as a second parameter value when the number of training samples in the candidate template region is less than the preset sample threshold.

25. The method of claim 24, wherein, The first parameter value is less than the second parameter value.

26. The method of claim 16, wherein, The method further comprises: determining the regularization parameter according to the size of the current block.

27. The method of claim 26, wherein, The determination of the regularization parameter according to the size of the current block comprises: determining the regularization parameter as a third parameter value when the size of the current block is greater than a preset size threshold; determining the regularization parameter as a fourth parameter value when the size of the current block is less than the preset size threshold.

28. The method of claim 27, wherein, The third parameter value is less than the fourth parameter value.

29. The method of claim 22, wherein, The method further comprises: determining input information corresponding to the candidate filter; determining the regularization parameter according to the input information.

30. The method of claim 29, wherein, When the input information comprises tap positions, the determination of the regularization parameter according to the input information comprises: determining the regularization parameter as zero when the sample corresponding to the tap position is a constant term; determining the regularization parameter as a non-zero parameter value when the sample corresponding to the tap position is a non-constant term.

31. The method of claim 16, wherein, The regularization parameter is a constant.

32. The method of any one of claims 16 to 31, wherein, The method further comprises: when the current block uses the first intra prediction technology and the current block does not use the merge mode of the first intra prediction technology, determining the filter parameter of the current block according to the first candidate information corresponding to the minimum cost result in the first cost result and the regularization parameter; performing prediction on the current block according to the filter parameter of the current block to determine the prediction block of the current block.

33. The method of any one of claims 16 to 31, wherein, The method further comprises: when the current block uses the first intra prediction technology and the current block uses the merge mode of the first intra prediction technology, determining the filter parameter of the current block according to the second candidate information corresponding to the minimum cost result in the second cost result; performing prediction on the current block according to the filter parameter of the current block to determine the prediction block of the current block.

34. A bitstream, wherein, The code stream is generated by bit encoding according to the encoding method of any one of claims 16 to 33; wherein the to-be-encoded information corresponding to the encoding method comprises at least one of the following: the value of the first syntax element, the value of the second syntax element and the mode index of the current block; wherein the first syntax element is used to indicate whether the current block uses the first intra prediction technology, and the second syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology.

35. An encoder, comprising a first determining unit and an encoding unit, wherein: the first determining unit is configured to determine a first candidate list corresponding to when the current block does not use the merge mode of the first intra prediction technology, determine at least one group of first candidate filter parameters according to at least one group of candidate mode information in the first candidate list and a regularization parameter, and determine a first cost result corresponding to each of the at least one group of first candidate filter parameters; and determining a second cost result corresponding to each of at least one second candidate filter parameter in a second candidate list corresponding to the current block using the first intra prediction technique; and determining a third cost result corresponding to the current block using a prediction technique other than the first intra prediction technique; The first determining unit is further configured to determine a value of a first syntax element according to the first cost result, the second cost result, and the third cost result, wherein the first syntax element is used to indicate whether the current block uses the first intra prediction technique. The encoding unit is configured to encode the value of the first syntax element and write the obtained encoded bits into a bitstream.

36. An encoder, comprising a first memory and a first processor, wherein: the first memory is configured to store a computer program capable of running on the first processor; the first processor is configured to execute the steps of the encoding method in any one of claims 16-33 when running the computer program.

37. A decoder, comprising a parsing unit, a second determining unit, and a second prediction unit, wherein: the parsing unit is configured to parse a first syntax element in a bitstream, and parse a second syntax element and a mode index of a current block in the bitstream when the first syntax element indicates that the current block uses a first intra prediction technique; the second determining unit is configured to determine a first candidate list of the current block when the second syntax element indicates that the current block does not use a merge mode of the first intra prediction technique; determine mode information of the current block according to the first candidate list and the mode index; and determine filter parameters of the current block according to the mode information and a regularization parameter; the second prediction unit is configured to predict the current block according to the filter parameters and determine a prediction block of the current block.

38. A decoder, comprising a second memory and a second processor, wherein: the second memory is configured to store a computer program capable of running on the second processor; the second processor is configured to execute the steps of the decoding method in any one of claims 1-15 when running the computer program.

39. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by a processor to implement the steps of the decoding method in any one of claims 1-15, or to implement the steps of the encoding method in any one of claims 16-33.