Coding method, decoding method, coder, decoder, and storage medium

By determining the reference region and candidate filter parameters in video encoding, the range of the candidate list is expanded, which solves the problem of insufficient accuracy of extrapolation filters within texture change blocks and improves encoding/decoding performance and compression efficiency.

WO2026036358A1PCT designated stage Publication Date: 2026-02-19GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/112548
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

In existing video coding standards, intra-frame prediction techniques based on extrapolation filters are not accurate enough when faced with large texture changes within the current block, leading to a decrease in encoding and decoding performance.

Method used

By determining the frame type of the current block, when using the merging mode of the first intra-frame prediction technique, the reference region and candidate filtering parameters are determined, a candidate list is constructed, and the values ​​of syntax elements are determined for encoding based on the cost results. At the decoding end, the syntax elements are parsed to determine the filtering parameters, expand the range of the candidate list, and improve the generalization ability of the filtering parameters and the accuracy of the predicted samples.

Benefits of technology

It improves the compression efficiency and performance of video encoding and decoding, and enhances the accuracy of predicted samples for the current block.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024112548_19022026_PF_FP_ABST
    Figure CN2024112548_19022026_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a coding method, a decoding method, a coder, a decoder, and a storage medium. The decoding method comprises: parsing a first syntax element in a bitstream; when the first syntax element indicates that a current block uses a merge mode of a first intra prediction technique and a frame type of the current block satisfies a preset type condition, parsing a first mode index in the bitstream, determining at least one reference region of the current block, and determining at least one set of candidate filtering parameters of the current block on the basis of the at least one reference region; determining a first candidate list of the current block on the basis of the at least one set of candidate filtering parameters; determining filtering parameters of the current block on the basis of the first candidate list and the first mode index; and determining a prediction sample of the current block on the basis of the filtering parameters. In this way, coding and decoding performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Coding method, encoder, decoder and storage medium TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of video coding technology, and in particular to a coding method, an encoder, a decoder and a storage medium. BACKGROUND

[0002] With the increasing demand for video display quality, high-resolution videos such as high-definition and ultra-high-definition videos have emerged. However, high-resolution videos usually have more information, and thus require more bandwidth. To reduce the bandwidth requirement, video coding standards involving video compression have been introduced.

[0003] In video coding standards, extrapolation filter-based intra prediction (EIP) is a new technology that has just emerged. In the extrapolation filter, when calculating the filter coefficients, the related technology does not take into account comprehensively, for example, always using the neighboring reconstructed samples of the current block for calculation. At this time, if there is a large texture change in the current block, the extrapolation filter trained based on the surrounding reconstructed samples may not be accurate, which reduces the coding performance.

[0004] SUMMARY

[0005] Embodiments of the present application provide a coding method, an encoder, a decoder and a storage medium, which can improve the coding performance.

[0006] The technical solutions of the embodiments of the present application can be implemented as follows:

[0007] In a first aspect, the embodiments of the present application provide a decoding method applied to a decoder, and the method comprises:

[0008] parsing a first syntax element in a bitstream;

[0009] when the first syntax element indicates that a merge mode of a first intra prediction technology is used for a current block and a frame type of the current block satisfies a preset type condition, parsing a first mode index in the bitstream, and determining at least one reference region of the current block, and determining at least one group of candidate filter parameters of the current block according to the at least one reference region;

[0010] determining a first candidate list of the current block according to the at least one group of candidate filter parameters;

[0011] determining a filter parameter of the current block according to the first candidate list and the first mode index;

[0012] determining a prediction sample of the current block according to the filter parameter.

[0013] In a second aspect, an encoding method is provided. The method is applied to an encoder and includes the following steps.

[0014] determining a frame type of the current block;

[0015] when the current block uses the merge mode of the first intra prediction technique, determining at least one reference region of the current block, determining at least one set of candidate filter parameters of the current block according to the at least one reference region, determining a first candidate list of the current block according to the at least one set of candidate filter parameters, and determining a first cost result corresponding to each set of candidate mode information in the first candidate list;

[0016] when the current block does not use the merge mode of the first intra prediction technique, determining a third candidate list of the current block, and determining a second cost result corresponding to each set of candidate mode information in the third candidate list;

[0017] determining a value of a first syntax element according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technique;

[0018] encoding the value of the first syntax element, and writing the obtained encoding bits into a bitstream.

[0019] In a third aspect, an encoder is provided. The encoder includes a first determining unit and an encoding unit, wherein:

[0020] The first determining unit is configured to determine a frame type of the current block, when the frame type of the current block meets a preset type condition, when the current block uses the merge mode of the first intra prediction technique, determine at least one reference region of the current block, determine at least one set of candidate filter parameters of the current block according to the at least one reference region, determine a first candidate list of the current block according to the at least one set of candidate filter parameters, and determine a first cost result corresponding to each set of candidate mode information in the first candidate list, when the current block does not use the merge mode of the first intra prediction technique, determine a third candidate list of the current block, and determine a second cost result corresponding to each set of candidate mode information in the third candidate list, and determine a value of a first syntax element according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technique;

[0021] The encoding unit is configured to encode the value of the first syntax element, and write the obtained encoding bits into a bitstream.

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

[0023] The first memory is configured to store a computer program capable of running on the first processor.

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

[0025] In a fifth aspect, an embodiment of the present application provides a decoder, comprising a decoding unit, a second determining unit and a second prediction unit, wherein:

[0026] The decoding unit is configured to parse a first syntax element in a bitstream.

[0027] The second determining unit is configured to, when the first syntax element indicates that a merge mode of a first intra prediction technology is used for a current block and a frame type of the current block satisfies a preset type condition, parse a first mode index in the bitstream, determine at least one reference region of the current block, determine at least one group of candidate filtering parameters of the current block according to the at least one reference region, determine a first candidate list of the current block according to the at least one group of candidate filtering parameters, and determine a filtering parameter of the current block according to the first candidate list and the first mode index.

[0028] The second prediction unit is configured to determine a prediction sample of the current block according to the filtering parameter.

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

[0030] The second memory is configured to store a computer program capable of running on the second processor.

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

[0032] In a seventh aspect, an embodiment of the present application provides a computer readable storage medium, having a computer program stored thereon, which, when executed by a processor, implements the method according to the first aspect or the method according to the second aspect.

[0033] In an eighth aspect, an embodiment of the present application provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the method according to the first aspect or the method according to the second aspect.

[0034] In a ninth aspect, an embodiment of the present application provides a computer readable storage medium, having a bitstream stored thereon, which is generated by executing the steps of the encoding method according to the second aspect.

[0035] The embodiment of the present application provides a coding method, an encoder, a decoder and a storage medium. At the encoding end, the frame type of a current block is determined; in the case that the frame type of the current block meets preset type conditions, when the current block uses a merge mode of a first intra prediction technology, at least one reference region of the current block is determined, at least one group of candidate filter parameters of the current block is determined according to the at least one reference region, a first candidate list of the current block is determined according to the at least one group of candidate filter parameters, and at least one group of candidate mode information in the first candidate list is determined to correspond to a first cost result respectively; when the current block does not use the merge mode of the first intra prediction technology, a third candidate list of the current block is determined, and at least one group of candidate mode information in the third candidate list is determined to correspond to a second cost result respectively; the value of a first syntax element is determined according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology; the value of the first syntax element is encoded, and the obtained coded bits are written into a 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 merge mode of the first intra prediction technology and the frame type of the current block meets the preset type conditions, the first mode index in the bitstream is parsed, at least one reference region of the current block is determined, at least one group of candidate filter parameters of the current block is determined according to the at least one reference region; the first candidate list of the current block is determined according to the at least one group of candidate filter parameters; the filter parameter of the current block is determined according to the first candidate list and the first mode index; and the prediction sample of the current block is determined according to the filter parameter. In this way, when the frame type of the current block meets the preset type conditions and the current block uses the merge mode of the first intra prediction technology, at least one group of candidate filter parameters of the current block is determined according to the at least one reference region, and then the at least one group of candidate filter parameters is used as the candidate mode information in the first candidate list, so that the candidate range in the first candidate list is expanded; according to the first candidate list and the first mode index obtained by parsing the bitstream, the filter parameter determined at this time has good generalization ability, so that the filter parameter can be better applied to the sample prediction in the current block; and the prediction is performed according to the determined filter parameter (for example, the coefficient of the filter and the shape of the filter), which can improve the prediction sample accuracy of the current block, thereby improving the compression efficiency and further improving the coding performance. BRIEF DESCRIPTION OF DRAWINGS

[0036] FIG. 1A is a structural schematic diagram of a filter shape;

[0037] FIG. 1B is a structural schematic diagram of a filter shape;

[0038] FIG. 1C is a structural schematic diagram of a filter shape;

[0039] FIG. 2A is a diagram illustrating a training area of EIP prediction;

[0040] FIG. 2B is a diagram illustrating a training area of EIP prediction;

[0041] FIG. 2C is a diagram illustrating a training area of EIP prediction;

[0042] FIG. 3 is a diagram illustrating the positions of neighboring blocks and non- neighboring blocks of a current block;

[0043] FIG. 4 is a diagram illustrating the positions of temporal candidate collocated blocks;

[0044] FIG. 5 is a diagram illustrating the scaling principle of temporal MVP;

[0045] FIG. 6 is a diagram illustrating a network architecture of video coding according to an embodiment of the present application;

[0046] FIG. 7 is a diagram illustrating a block diagram of an encoder according to an embodiment of the present application;

[0047] FIG. 8 is a diagram illustrating a block diagram of a decoder according to an embodiment of the present application;

[0048] FIG. 9 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0049] FIG. 10 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0050] FIG. 11 is a diagram illustrating collocated blocks and neighboring areas in a collocated picture according to an embodiment of the present application;

[0051] FIG. 12 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0052] FIG. 13 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0053] FIG. 14 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0054] FIG. 15 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0055] FIG. 16 is a diagram illustrating a flowchart of a decoding method according to an embodiment of the present application;

[0056] FIG. 17 is a diagram illustrating a flowchart of an encoding method according to an embodiment of the present application;

[0057] FIG. 18 is a diagram illustrating a block diagram of an encoder according to an embodiment of the present application;

[0058] FIG. 19 is a diagram illustrating a specific hardware structure of an encoder according to an embodiment of the present application;

[0059] FIG. 20 is a schematic diagram of a composition structure of a decoder provided by an embodiment of the present application;

[0060] FIG. 21 is a schematic diagram of a specific hardware structure of a decoder provided by an embodiment of the present application;

[0061] FIG. 22 is a schematic diagram of a composition structure of a codec system provided by an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to enable a person skilled in the art to more fully understand the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings, which are only used for reference and are not intended to limit the embodiments of the present application.

[0063] 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 the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0064] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

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

[0066] Before the embodiments of the present application are further described in detail, the terms and terms involved in the embodiments of the present application are explained, which are applicable to the following explanations:

[0067] H.266 / versatile video coding (VVC);

[0068] VVC test model (VTM) of the reference software test platform of VVC;

[0069] enhanced compression model (ECM);

[0070] Joint Video Experts Team (JVET);

[0071] Coding Unit (CU);

[0072] Coding Tree Unit (CTU);

[0073] Largest Coding Unit (LCU);

[0074] Prediction Unit (PU);

[0075] Transform Unit (TU);

[0076] Merge;

[0077] Motion Vector (MV);

[0078] Motion Vector Prediction (MVP);

[0079] Motion Vector Difference (MVD);

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

[0081] Convolutional Cross-Component Model (CCCM);

[0082] Intra Template Matching Prediction (intraTMP);

[0083] Sum of Absolute Difference (SAD);

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

[0085] Combined Inter and Intra Prediction (CIIP);

[0086] Merge with Motion Vector Difference (MMVD);

[0087] Geometric Partitioning Mode (GPM);

[0088] Affine Merge pattern;

[0089] Subblock-based Temporal Motion Vector Prediction (sbTMVP).

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

[0091] The basic process of a video codec is as follows: at the encoding end, a frame of image is divided into blocks, a prediction block of a current block is generated using intra prediction or inter prediction, a residual block is obtained by subtracting the prediction block from the original image block of the current block, a quantized coefficient matrix is obtained by transforming and quantizing the residual block, and the quantized coefficient matrix is entropy encoded and output to a bitstream. At the decoding end, a prediction block of a current block is generated using intra prediction or inter prediction, and on the other hand, a quantized coefficient matrix is obtained by parsing the bitstream, the quantized coefficient matrix is dequantized and inverse transformed to obtain a residual block, and the prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the reconstructed image is loop filtered based on the image or based on the block to obtain a decoded image. The encoding end also needs similar operations as the decoding end to obtain a decoded image. The decoded image can be used as a reference frame for subsequent inter prediction. The block division information, prediction, transformation, quantization, entropy encoding, loop filtering and other mode information or parameter information determined by the encoding end need to be output to the bitstream if necessary. The decoding end determines the same block division information, prediction, transformation, quantization, entropy encoding, loop filtering and other mode information or parameter information by parsing the bitstream and analyzing the existing information, so as to ensure that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is usually also called a reconstructed image. When predicting, the current block can be divided into prediction units, and when transforming, the current block can be divided into transform units. The division of the prediction units and the transform units can be different. The above is the basic process of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process can be optimized. The embodiments of the present application are applicable to the basic process of the video codec under the block-based hybrid coding framework, but are not limited to the framework and process.

[0092] In the embodiments of the present application, the current block (CB) can be a current coding unit, a current prediction unit, or a current transform unit, etc. Due to the need for parallel processing, an image can be divided into slices, etc., and the slices in the same image can be processed in parallel, that is, there is no data dependency between them. "Frame" is a commonly used term, which can generally be understood as a frame being an image. In the embodiments of the present application, the frame can also be replaced by an image or a slice, etc.

[0093] The international video coding standard organization JVET has established a team to study a coding model beyond H.266 / VVC, and named the model, i.e. the platform test software, as ECM. ECM starts to receive updated and more efficient compression algorithms on the basis of VTM, and currently has a coding performance of about 13% beyond VVC. ECM not only expands the size of the coding unit of a specific resolution, but also integrates many module improvement technologies, and has changed a lot in algorithm compared with VVC.

[0094] The related technologies of intra prediction are described in detail below.

[0095] a) Intra prediction technology based on extrapolation filter.

[0096] EIP prediction is a new technology only in the ECM stage, and its core idea is to diffuse the existing texture information to the area that has not been predicted, which is similar to the diffusion filter in the VVC stage.

[0097] (1) EIP prediction based on calculation.

[0098] Unlike the angle prediction in the traditional intra prediction, EIP uses a two-dimensional filter to predict the current block, and there are three groups of two-dimensional filters with different shapes. The coefficients of these filters are trained by the neighboring reconstructed samples around the current block. The training process is consistent with the CCCM technology, and can be solved by Cholesky solution, LDL decomposition or Gaussian elimination method and other methods.

[0099] As shown in FIGS. 1A, 1B and 1C, three EIP filter shapes are provided here, which are square, horizontal rectangle and vertical rectangle respectively. Among them, the grid filled part is the input part of the filter, and the white filled part is the output part of the filter, with 15 taps corresponding to 15 filter coefficients. EIP prediction has a delay, for example, when predicting the first sample point in the top left corner of the current block, the first square filter is used, then the three reconstructed sample points directly above, the three reconstructed sample points to the left, and the reconstructed sample points in the 3x3 square above and to the left of the first sample point are used as inputs to calculate the first predicted sample point in the top left corner of the current block. Assuming that the second sample point in the second row of the current block is predicted, then the predicted sample point directly above and the two reconstructed sample points adjacent to the left of the predicted sample point are used as inputs, and the 3x4 reconstructed sample points to the left are used as inputs to calculate the first sample point in the second row. As can be seen, the second predicted sample point depends on the first predicted sample point, that is, the prediction has a delay. In order to reduce this delay, diagonal and other scan orders can be used as the prediction order in 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, so that parallel processing can be achieved on the same diagonal.

[0100] Here, the calculation formula of EIP prediction is as follows:

[0101] In the above formula (1), pred (x,y) is the predicted sample point located at coordinate (x, y) in the current block, c i is the filter coefficient, To reconstruct or predict sample points. In the current implementation, EIP computes these filter coefficients by establishing a linear model using Gaussian elimination, modeling formula as follows:

[0102] The above formula (2) is transformed to obtain:

[0103] Where A is the matrix of input samples, y is the matrix of output samples, is the matrix of filter coefficients.

[0104] In addition, EIP prediction provides three templates to train these filter coefficients, as shown in FIG. 2A, FIG. 2B and FIG. 2C. Here, in FIG. 2A, the training area includes the left template and the upper template of the current block; in FIG. 2B, the training area includes the upper template of the current block; in FIG. 2C, the training area includes the left template of the current block. Wherein, the training area here can also be referred to as the template area.

[0105] As shown in FIG. 2A, FIG. 2B and FIG. 2C, taking a square filter as an example, fWidth represents the width of the square filter, and fHeight represents the height of the square filter. In FIG. 2A, leftSize represents the width of the left template, i.e. the number of columns on the left side of the current block; aboveSize represents the height of the upper template, i.e. the number of rows on the upper side of the current block; according to leftSize and aboveSize, the size of the template area can be determined, and the square filter scans in the template area to obtain the corresponding input sample and output sample. In FIG. 2B, for the upper template, leftSize represents the number of columns on the left side of the current block, and aboveSize represents the number of rows on the upper side of the current block; according to leftSize and aboveSize, the size of the upper template area can be determined, and the square filter scans in the template area to obtain the corresponding input sample and output sample. In FIG. 2C, for the left template, leftSize represents the number of columns on the left side of the current block, and aboveSize represents the number of rows on the upper side of the current block; according to leftSize and aboveSize, the size of the left template area can be determined, and the square filter scans in the template area to obtain the corresponding input sample and output sample.

[0106] (2) EIP prediction based on merging.

[0107] The EIP technique can also obtain filter coefficients of the EIP filter by merging information of peripheral adjacent blocks, non-adjacent blocks, a history list, and a time domain co-located block to construct an EIP list. The EIP list is initially empty, and the construction process is shown in FIG. 3 and is similar to the construction process of an inter merge mode list. As shown in FIG. 3, the black filled small block is a current block, blocks at positions 1-5 in FIG. 3 are referred to as adjacent blocks of the current block, and the remaining blocks are referred to as non-adjacent blocks of the current block.

[0108] First, the EIP merge mode obtains EIP information of adjacent blocks and non-adjacent blocks in a spatial domain and adds the EIP information to the EIP list. By searching positions shown in FIG. 3, whether the coding blocks corresponding to the positions use the EIP technique is checked in sequence. If the EIP technique is used, EIP information corresponding to the positions is obtained, for example, the EIP information can include filter shapes and filter coefficients. The filter shapes and filter coefficients are checked against EIP candidate modes in the EIP list. If the filter shapes and filter coefficients are the same as a candidate in the EIP list, the candidate is not added to the EIP list. Otherwise, the candidate is added to the EIP list.

[0109] Second, the EIP merge mode checks whether time domain information can be used. If the condition is met, EIP information of a co-located block in a reference image and EIP information of a co-located block of an offset motion vector are obtained. A check is also performed. If the EIP information does not exist, the EIP information is added to the EIP list. Here, the reference image can be a co-located image obtained from a reference list 0 and / or a co-located image obtained from a reference list 1.

[0110] Finally, the EIP merge mode obtains EIP information in an EIP history list. The EIP history list is constructed according to the same rule in the coding process. The history list only stores EIP information. The EIP merge mode obtains the latest EIP candidate information in the history list and performs a check. If the EIP candidate information does not exist, the EIP candidate information is added to the EIP list. After the EIP is selected as a coding mode of the current block, the EIP information is stored in the EIP history list. If the EIP history list is full, the EIP history list is updated according to a first in first out (FIFO) principle. The oldest candidate added to the EIP history list is removed to keep the EIP history list updated. After the EIP prediction is completed, the corresponding EIP information is also stored in the EIP history list. The EIP history list is kept updated in the same way.

[0111] After the EIP list of the EIP merge mode is constructed, the current block peripheral neighboring reconstructed samples are used as a template region, the EIP information of the EIP list is used to predict the template region to obtain a template region prediction block corresponding to each candidate mode, and the SAD or SATD cost between the template prediction block and the template reconstructed block is calculated, so that the EIP list can be sorted to obtain a sorted EIP list.

[0112] The encoder traverses the EIP candidates in the sorted EIP list, calculates the rate-distortion cost between the prediction block based on the current block and the original image block of each candidate, and the EIP candidate with the minimum cost is the optimal candidate in the merge mode. The corresponding candidate index is written into the code stream and transmitted to the decoder.

[0113] b) Inter merge prediction mode.

[0114] The inter merge mode directly uses one or a group of MVPs (each MVP includes single-direction or bidirectional motion information) to infer the MV information of the current block, performs motion compensation to obtain an inter prediction block, and then encodes the prediction residual. In the Merge mode, only the MV index needs to be transmitted, and the MVD and reference image index do not need to be transmitted, which is an efficient MV encoding method. In addition to the conventional Merge mode, H.266 / VVC also uses a variety of Merge extension modes, such as CIIP, MMVD, GPM, sbTMVP, and Affine Merge.

[0115] The conventional Merge mode refers to an inter-frame encoding mode in which the MVP motion vector information (such as reference image index and motion vector) is directly used as the MV information of the current block. The conventional Merge mode needs to establish a MVP candidate list (Merge candidate list, or referred to as “MergeMVP list”), select a candidate MVP in the MergeMVP list as the MV of the current block, and only encode the index of the selected MVP in the MergeMVP list to represent the MV information of the current block. In the conventional Merge mode, the obtained MV information can be used to obtain the prediction samples of the current block to complete the prediction operation.

[0116] The MergeMVP list is referred to as the Merge list hereinafter, and the construction process of the Merge list is as follows:

[0117] (1) Spatial candidate MVP.

[0118] In the Merge mode, the peripheral neighboring coded CU information of the current coding unit is obtained, and the MVs thereof are obtained as spatial candidates in the order shown in FIG. 3. Among them, the neighboring blocks 1-5 of the current block and other non-neighboring blocks of the current block are included.

[0119] (2) Temporal MVP.

[0120] After the spatial MVPs are obtained, the current block continues to obtain the temporal MVP (TMVP), which is determined according to the MV information of the corresponding position of the two most adjacent coded units (collocated CUs) in the already coded pictures. As shown in FIG. 4, for the temporal collocated block, if the C0 position is unavailable, the MV information of the C1 position can be obtained to determine the temporal MVP of the current block.

[0121] In addition, more temporal MVPs can be obtained according to the offset collocated block, or the temporal MVPs can be selected according to the distortion cost of the template region.

[0122] Here, the obtained temporal MVPs cannot be directly used, and need to be scaled according to the reference picture, the current picture and the collocated picture, etc. As shown in FIG. 5, tb represents the temporal distance between the current picture (curr_pic) and the corresponding reference picture (curr_ref), and td represents the temporal distance between the collocated picture (col_pic) and the corresponding collocated reference picture (col_ref), i.e. the difference in Picture Order Count (POC). Here, the scaling operation is MVPcur = tb / td*MVPcol. Wherein, MVPcol represents the temporal MVP obtained according to the collocated picture, and MVPcur represents the temporal MVP required by the current block.

[0123] (3) History List MVP.

[0124] After the temporal MVPs are obtained, the current block continues to obtain the history-based MVP (HMVP). The HMVP is to store the motion information of the previously coded blocks in a HMVP list with a limited length (for example, 5 or 25, etc.) as an option for constructing the MergeMVP list. The HMVP list can keep the maximum limited length unchanged according to the principle of first-in first-out, but its life cycle is each CTU row, i.e. the HMVP list is emptied before the first block of each CTU row is coded.

[0125] (4) Average MVP.

[0126] If there is still a free position in the MergeMVP list after the HMVP list is obtained, the average motion vector is calculated according to the first and second candidates in the MergeMVP list to obtain a new motion vector, i.e. the average MVP.

[0127] (5) Zero-value MVP.

[0128] If there are still empty positions in the MergeMVP list after adding the average MVP candidate, the list is filled with MV(0, 0).

[0129] That is, the extrapolation filter always uses the neighboring reconstructed samples to calculate the filter coefficients, and if there is a large texture change in the current block, the extrapolation filter trained based on the surrounding reconstructed samples may not be well adapted to this case. In addition, for the learning of the filter coefficients of the extrapolation filter, the ideal case is to learn based on the original image block of the current block to obtain the optimal filter coefficients. However, due to the large bit overhead of coefficient transmission, this method cannot well provide the coding performance.

[0130] Based on this, an embodiment of the present application provides an encoding method, determining the frame type of a current block; in the case that the frame type of the current block meets a preset type condition, when the current block uses a merge mode of a first intra prediction technology, determining at least one reference region of the current block, determining at least one group of candidate filter parameters of the current block according to the at least one reference region, and determining a first candidate list of the current block according to the at least one group of candidate filter parameters, and determining a first cost result corresponding to each of at least one group of candidate mode information in the first candidate list; when the current block does not use the merge mode of the first intra prediction technology, determining a third candidate list of the current block, and determining a second cost result corresponding to each of at least one group of candidate mode information in the third candidate list; determining the value of a first syntax element according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology; performing encoding processing on the value of the first syntax element, and writing the obtained encoding bits into a bitstream. The embodiment of the present application also provides a decoding method, parsing a first syntax element in a bitstream; in the case that the first syntax element indicates that the current block uses the merge mode of the first intra prediction technology and the frame type of the current block meets the preset type condition, parsing a first mode index in the bitstream, and determining at least one reference region of the current block, determining at least one group of candidate filter parameters of the current block according to the at least one reference region; determining a first candidate list of the current block according to the at least one group of candidate filter parameters; determining the filter parameter of the current block according to the first candidate list and the first mode index; and determining the prediction sample of the current block according to the filter parameter.

[0131] Thus, when the frame type of the current block satisfies the preset type condition and the current block uses the merge mode of the first intra prediction technology, at least one set of candidate filter parameters of the current block is determined according to at least one reference region, and the at least one set of candidate filter parameters is taken as candidate mode information in the first candidate list, thereby expanding the candidate range in the first candidate list. Thus, according to the first candidate list and the first mode index obtained by parsing the code stream, the determined filter parameters have good generalization ability, so that the filter parameters can be better applied to the sample prediction in the current block. Moreover, prediction is performed according to the determined filter parameters (for example, the coefficients of the filter and the shape of the filter), which can improve the prediction sample accuracy of the current block, thereby improving the compression efficiency and further improving the coding performance.

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

[0133] FIG. 6 is a schematic diagram of a network architecture of a video coding provided by an embodiment of the present application. As shown in FIG. 6, 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 in the implementation can be various types of devices having a video coding function, for example, the electronic devices can include a mobile phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital telephone, a video telephone, a television, a sensing device, a server, etc., and the embodiments of the present application are not limited thereto.

[0134] In the embodiments of the present application, a network architecture of a video coding system including a decoding method and an encoding method is provided. The decoder or the encoder in the embodiments of the present application can be the electronic device described above. That is, the electronic device in the embodiments of the present application has a video coding function, and generally includes a video / image encoder (referred to as an encoder) and a video / image decoder (referred to as a decoder).

[0135] FIG. 7 is a block diagram of an encoder according to an embodiment of the present application. As shown in FIG. 7, the encoder 100 can include a transform and quantization unit 101, an intra estimation unit 102, an intra prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filter unit 108, an encoding unit 109, and a decoded picture buffer unit 110, etc. The filter unit 108 can implement a deblocking filter and a sample adaptive offset (SAO) filter, 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 the division of a coding tree unit (CTU), and then the residual pixel information obtained after the intra or inter prediction is transformed by the transform and quantization unit 101 on the video coding block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra estimation unit 102 and the intra prediction unit 103 are used for intra prediction of the video coding block; in particular, the intra estimation unit 102 and the intra prediction unit 103 are used to determine the intra 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 prediction encoding of the received video coding block relative to one or more blocks in one or more reference images to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector that can estimate the motion of the video coding block, and then the motion compensation unit 104 performs motion compensation based on the motion vector determined by the motion estimation unit 105; after determining the intra prediction mode, the intra prediction unit 103 is also used to provide the selected intra prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used for reconstruction of the video coding block, reconstructing the residual block in the pixel domain, which removes the blocking artifact by the filter control analysis unit 107 and the filtering unit 108, and then adds the reconstructed residual block to a predictive block in one of the frames of the decoded image buffer unit 110 to generate a reconstructed video coding block; the encoding unit 109 is used to encode various encoding parameters and quantized transform coefficients, and in the CABAC-based encoding algorithm, the context content can be based on the adjacent coding block, which can be used to encode the information indicating the determined intra prediction mode, and output the code stream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video coding blocks will be continuously generated, which will be stored in the decoded image buffer unit 110.

[0136] FIG. 8 is a block diagram of a decoder according to an embodiment of the present application. As shown in FIG. 8, the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded picture buffer unit 206, etc. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is processed by the encoder of FIG. 7, a bitstream of the video signal is output. The bitstream is input into the decoder 200, and first passes through the decoding unit 201 to obtain decoded transform coefficients. The inverse transform and inverse quantization unit 202 processes the transform coefficients to generate a residual block in the pixel domain. The intra prediction unit 203 can be used to generate prediction data of a current video decoding block based on a determined intra prediction mode and data from previously decoded blocks of the current frame or picture. The motion compensation unit 204 determines prediction information for the video decoding block by parsing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded. The decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra prediction unit 203 or the motion compensation unit 204. The decoded video signal passes through the filtering unit 205 to remove blocking artifacts and improve video quality. The decoded video block is then stored in the decoded picture buffer unit 206, which stores reference pictures for subsequent intra prediction or motion compensation, and also outputs the video signal, i.e., the original video signal is recovered.

[0137] It should be noted that the method according to the embodiments of the present application is mainly applied to the intra estimation unit 102 and the intra prediction unit 103 as shown in FIG. 7, and the intra prediction unit 203 as shown in FIG. 8. That is, the embodiments of the present application can be applied to an encoder, a decoder, or both, but are not limited here.

[0138] It should be further noted that when the embodiments of the present application are applied to the encoder 100, the "current block" can refer to a current block to be encoded (also referred to as an "encoding block") in a video image. When the embodiments of the present application are applied to the decoder 200, the "current block" can refer to a current block to be decoded (also referred to as a "decoding block") in a video image.

[0139] In an embodiment of the present application, FIG. 9 is a flowchart of a decoding method according to an embodiment of the present application. As shown in FIG. 9, the method can include the following steps.

[0140] S901, parsing a first syntax element in a bitstream.

[0141] It should be noted that in the embodiments of the present application, the method is applied to a decoder, and mainly applied to the intra prediction part (marked with a bold frame) in FIG. 8. Wherein, when the current block uses intra prediction, the optimization scheme proposed herein is mainly for determining the filtering coefficients of the EIP technology in the intra prediction, so as to improve the compression efficiency.

[0142] It should be further noted that in the embodiments of the present application, some indication information in the form of syntax elements or flag can be written in the bitstream. In this way, by analyzing the value of the syntax element in the bitstream, the prediction technology used by the current block and whether the merging mode of the first intra prediction technology is used can be determined. Exemplarily, the first syntax element can be used to indicate whether the merging mode of the first intra prediction technology is used for the current block, the second syntax element can be used to indicate the prediction type of the current block, and the third syntax element can be used to indicate whether the first intra prediction technology is used for the current block.

[0143] In some embodiments, referring to FIG. 10, for step S901, the following can be included:

[0144] S1001, parsing the second syntax element in the bitstream.

[0145] S1002, when the second syntax element indicates that the current block uses intra prediction and the current block meets the preset condition, parsing the third syntax element in the bitstream.

[0146] S1003, when the third syntax element indicates that the current block uses the first intra prediction technology, parsing the first syntax element in the bitstream.

[0147] In the embodiments of the present application, the first intra prediction technology refers to the EIP technology, and the merging mode of the first intra prediction technology refers to the EIP merging (eip_merge) mode, so the first syntax element can be referred to as the eip_merge flag, which can be represented by eip_merge here; and the third syntax element can be referred to as the EIP use flag, which can be represented by eip_flag here.

[0148] In some embodiments, the method can further include: if the value of the first syntax element is a first value, determining that the first syntax element indicates that the current block uses the merging mode of the first intra prediction technology; and if the value of the first syntax element is a second value, determining that the first syntax element indicates that the current block does not use the merging mode of the first intra prediction technology.

[0149] That is, in the embodiments of the present application, when the merge mode of the first intra prediction technology is the EIP merge mode, if the value of eip_merge obtained by parsing the bitstream is the first value, it can be determined that the current block uses the EIP merge mode; if the value of eip_merge obtained by parsing the bitstream is the second value, it can be determined that the current block does not use the EIP merge mode.

[0150] In some embodiments, the method can further include: if the value of the second syntax element is the first value, determining that the second syntax element indicates that the current block uses intra prediction; and if the value of the second syntax element is the second value, determining that the second syntax element indicates that the current block uses inter prediction.

[0151] In the embodiments of the present application, the second syntax element can be used to indicate the prediction type of the current block, such as intra prediction or inter prediction. The second syntax element can be referred to as a prediction type identification bit. That is, if the value of the prediction type identification bit obtained by parsing the bitstream is the first value, the prediction type of the current block is intra prediction, i.e., the current block uses intra prediction; if the value of the prediction type identification bit obtained by parsing the bitstream is the second value, the prediction type of the current block is inter prediction, i.e., the current block uses inter prediction.

[0152] In the embodiments of the present application, before parsing the third syntax element in the bitstream, it is also necessary to determine whether the current block satisfies a preset condition. In some embodiments, the method can further include: determining whether a size parameter of the current block satisfies a preset size condition; and / or, determining whether the neighboring reference samples around the current block satisfy a preset number condition.

[0153] That is, in the embodiments of the present application, the current block satisfying the preset condition can include at least one of the following: the size parameter of the current block satisfying the preset size condition; and the neighboring reference samples around the current block satisfying the preset number condition.

[0154] In a possible implementation, the current block satisfying the preset condition can include: the size parameter of the current block satisfying the preset size condition; and the neighboring reference samples around the current block satisfying the preset number condition. That is, only when both conditions are satisfied, it is determined that the current block satisfies the preset condition.

[0155] For example, the size parameter of the current block satisfying the preset size condition can mean that the width or height of the current block meets the condition, such as the width or height of the current block being less than or equal to 32, and the like. The neighboring reference samples around the current block satisfying the preset number condition can mean that the number of the neighboring reference samples around the current block is greater than or equal to the sum of the EIP filter size and the template size, such as the number of the neighboring reference samples on the upper side being greater than or equal to 8 rows, the number of the neighboring reference samples on the left side being greater than or equal to 8 columns, and the like, which avoids the inaccurate EIP filter caused by the insufficient number of the neighboring reference samples around the current block, and the like, without any limitation here.

[0156] In a possible implementation, the current block not satisfying the preset condition can include at least one of the following: the size parameter of the current block not satisfying the preset size condition; and the neighboring reference samples around the current block not satisfying the preset number condition. That is, as long as any one of the two conditions does not meet the requirement, it is determined that the current block does not satisfy the preset condition.

[0157] For example, the size parameter of the current block not satisfying the preset size condition can mean that the width or height of the current block does not meet the condition, such as the width or height of the current block being greater than 32, and the like. The neighboring reference samples around the current block not satisfying the preset number condition can mean that the number of the neighboring reference samples around the current block is less than the sum of the EIP filter size and the template size, such as the number of the neighboring reference samples on the upper side being less than 8 rows, the number of the neighboring reference samples on the left side being less than 8 columns, and the like, without any limitation here.

[0158] In the embodiments of the present application, if the second syntax element indicates that the current block uses the intra prediction and the current block satisfies the preset condition, the third syntax element in the bitstream is parsed. In some embodiments, the method can further include: if the value of the third syntax element is the first value, it is determined that the third syntax element indicates that the current block uses the first intra prediction technology; and if the value of the third syntax element is the second value, it is determined that the third syntax element indicates that the current block does not use the first intra prediction technology.

[0159] That is, in the embodiments of the present application, when the first intra prediction technology is the EIP technology, if the value of eip_flag obtained by parsing the bitstream is the first value, it can be determined that the current block uses the EIP technology; and if the value of eip_flag obtained by parsing the bitstream is the second value, it can be determined that the current block does not use the EIP technology.

[0160] It can be understood that in the embodiments of the present application, the decoding end also needs to determine whether the first intra prediction technology is allowed to be used for the current sequence. For example, the fifth syntax element can be used to indicate whether the first intra prediction technology is allowed to be used for the current sequence.

[0161] In some embodiments, the method can further include: parsing the fifth syntax element in the bitstream; parsing the second syntax element in the bitstream when the fifth syntax element indicates that the first intra prediction technology is allowed to be used in the current sequence; parsing the third syntax element in the bitstream, i.e., parsing the value of eip_flag, when the second syntax element indicates that the current block uses intra prediction and the current block satisfies a preset condition; and parsing the first syntax element in the bitstream, i.e., parsing the value of eip_merge, when the third syntax element indicates that the current block uses the first intra prediction technology.

[0162] In the embodiments of the present application, the current sequence includes the current block. The fifth syntax element is a sequence-level syntax element, and the first syntax element, the second syntax element and the third syntax element are block-level (CU-level or PU-level) syntax elements.

[0163] In some embodiments, the method can further include: determining that the fifth syntax element indicates that the first intra prediction technology is allowed to be used in the current sequence when the value of the fifth syntax element is a first value; and determining that the fifth syntax element indicates that the first intra prediction technology is not allowed to be used in the current sequence when the value of the fifth syntax element is a second value.

[0164] In the embodiments of the present application, the fifth syntax element can be referred to as an EIP-allowed-to-be-used identification bit, and the fifth syntax element can be represented as sps_eip_enable_flag. That is, if the value of sps_eip_enable_flag obtained by parsing the bitstream is a first value, it can be determined that the EIP technology is allowed to be used in the current sequence; and if the value of sps_eip_enable_flag obtained by parsing the bitstream is a second value, it can be determined that the EIP technology is not allowed to be used in the current sequence.

[0165] It should be noted that in the embodiments of the present application, the first value is different from the second value, and the first value and the second value can be in the form of a parameter or in the form of a number. For example, the syntax element herein can be a parameter written in a profile, or can be a value of an identification bit (flag), which is not limited herein.

[0166] For example, the first value can be set as 1, and the second value can be set as 0; or the first value can be set as 0, and the second value can be set as 1; or the first value can be set as true, and the second value can be set as false; or the first value can be set as false, and the second value can be set as true; but this is not limited.

[0167] In the embodiments of the present application, taking the first value as true and the second value as false as an example, the decoding end first parses the fifth syntax element to obtain the EIP use permission identification bit from the code stream. If the value of sps_eip_enable_flag is true, it indicates that the current sequence allows the use of the EIP technology, and then the decoding end continues to parse the second syntax element to obtain the prediction type of the current block from the code stream. If the prediction type of the current block is intra prediction, and the current block meets the preset condition, then the decoding end continues to parse the third syntax element to obtain the EIP use identification bit of the current block from the code stream. If the value of eip_flag is true, it indicates that the current block uses the EIP technology, and then the first syntax element also needs to be parsed to obtain the eip_merge identification bit from the code stream. If the value of eip_merge is true, it indicates that the current block uses the EIP merge mode; if the value of eip_merge is false, it indicates that the current block does not use the EIP merge mode.

[0168] S902, when the first syntax element indicates that the current block uses the merge mode of the first intra prediction technology and the frame type of the current block meets the preset type condition, parsing the first mode index in the code stream, and determining at least one reference region of the current block, and determining at least one set of candidate filtering parameters of the current block according to the at least one reference region.

[0169] S903, determining the first candidate list of the current block according to the at least one set of candidate filtering parameters.

[0170] It should be noted that if the value of the first syntax element is the first value, that is, the current block uses the EIP technology and uses the EIP merge mode, then the EIP prediction based on the merge can be performed. Wherein the frame type of the current block meets the preset type condition, which can include: the frame type of the current block is a non-intra slice type, that is, the frame type of the current block is a non-Slice_I type. That is, only when the current block uses the EIP merge mode and the frame type of the current block is a non-Slice_I type, the EIP prediction method of the embodiments of the present application can be used at this time.

[0171] It should be further noted that when the current block uses the EIP technology and uses the EIP merge mode, the first mode index in the code stream also needs to be parsed at this time. In the embodiments of the present application, the first mode index can be represented by eip_index. Wherein, if the first syntax element indicates that the current block uses the merge mode of the first intra prediction technology, that is, the current block uses the EIP merge mode, then the first mode index is used to indicate the index sequence number of the mode information of the current block in the first candidate list.

[0172] In addition, in the embodiments of the present application, at least one reference region of the current block can be determined, and at least one set of candidate filtering parameters derived according to the at least one reference region of the current block can be used as candidate mode information in the first candidate list.

[0173] In the embodiments of the present application, the reference region can be determined according to a collocated picture or a vector parameter. The vector parameter can include at least one of a motion vector (MV) and a block vector (BV). In the embodiments of the present application, the vector parameter refers to a motion vector parameter, for example, a corresponding reference region can be determined according to the motion vector parameter, and at least one set of candidate filtering parameters of the current block can be determined.

[0174] In the embodiments of the present application, for the determination of the candidate filtering parameters, a decoded block similar to the current block can be searched in a decoded collocated picture or a reference picture, and a relevant region of the decoded block can be used for filter training to obtain the at least one set of candidate filtering parameters. It should be noted that the candidate filtering parameters can include a shape of a candidate filter and a coefficient of the candidate filter. The shape of the candidate filter can include at least one of a square filter, a horizontal matrix filter, and a vertical rectangular filter, but is not limited thereto.

[0175] The at least one reference region of the current block can be determined in several possible implementation manners.

[0176] In one possible implementation manner, the at least one reference region of the current block can be determined by determining at least one collocated picture, and determining at least one collocated region of the current block according to the at least one collocated picture, and determining the at least one collocated region as the at least one reference region of the current block.

[0177] Here, the collocated region includes at least one of a collocated block of the current block, or the collocated block and a reference template of the collocated block, or the collocated block and neighboring reference samples around the collocated block.

[0178] It should be noted that in the embodiments of the present application, the corresponding reference region can be determined based on the collocated block. For example, a current block in a current picture can use N nearest collocated picture information. When the current block is decoded, the current block can obtain a collocated block in a collocated picture and surrounding reference samples to form a reference region of the current block, and the reference samples in the reference region can be used as training samples for calculating filtering coefficients of the current block.

[0179] As shown in FIG. 5, the current block in the current picture is the curr_CU, the collocated block in the collocated picture is the col_CU, and the EIP technique based on the motion vector (MV-EIP) can obtain only the samples in the collocated block col_CU to form a reference region, or can obtain the collocated block col_CU and a reference template thereof to form a reference region, or can obtain the collocated block col_CU and a range of reference samples allowed around the collocated block col_CU, such as 6 rows and 6 columns of samples, to form a larger reference region, for training of the filter coefficients, as shown in FIG. 11.

[0180] It is also to be noted that in the embodiments of the present application, the collocated picture can also be replaced by any reference picture of the current block. At this time, the reference block of the current block is searched in the reference picture, and then the reference block of the same size as the current block is taken as the reference region, or the reference block and the reference samples allowed around the reference block can also be taken to form the reference region of the current block, which is not limited herein.

[0181] In another possible implementation, the determining of the at least one reference region of the current block can include: determining at least one vector parameter of the current block; and determining the at least one reference region of the current block according to the at least one vector parameter.

[0182] Here, the reference region includes one of the following: the reference block of the current block, or the reference block of the current block and a reference template of the reference block, or the reference block of the current block and the neighboring reference samples around the reference block.

[0183] It is to be noted that in the embodiments of the present application, the corresponding reference region can be determined based on the reference block. For example, when the current block is decoded, the reference region of the current block is formed by obtaining the reference block in the reference picture and the reference samples allowed around the reference block, and the reference samples in the reference region can also be taken as the training samples of the current block for calculation of the filter coefficients. For the current block, the reference block in the reference picture can be searched, and then the reference block of the same size as the current block is taken as the reference region, or the reference block and the reference samples allowed around the reference block can also be taken to form the reference region of the current block, such as the reference block and the reference template thereof taken as the reference region, or the reference block and 6 rows and 6 columns of samples around the reference block taken to form a larger reference region, which is not limited herein.

[0184] It is also to be noted that in the embodiments of the present application, the vector parameter can be a motion vector parameter, or can also be a block vector parameter. The motion vector parameter will be described in detail below.

[0185] In a possible implementation, the at least one vector parameter can include a first vector parameter. In some embodiments, determining the at least one vector parameter of the current block can include: determining a motion vector candidate list; and determining the first vector parameter of the current block according to one or more second candidate vector parameters in the motion vector candidate list.

[0186] In the embodiments of the present application, the motion vector of the reference region in the motion vector candidate list is obtained by a merge mode, and the process of obtaining the vector parameter is similar to the rules and order of the aforementioned inter-frame merge prediction mode. The motion vector candidate list includes one or more candidate vector parameters.

[0187] In some embodiments, determining the motion vector candidate list can include: determining one or more candidate vector parameters according to the first reference information of the current block; and determining the motion vector candidate list according to the one or more candidate vector parameters. The first reference information of the current block includes at least one of the following: a candidate vector parameter corresponding to a neighboring block of the current block; a candidate vector parameter corresponding to a non-neighboring block of the current block; a candidate vector parameter corresponding to a collocated block of the current block in a collocated picture; a candidate vector parameter contained in a first history list of the current block; an average candidate vector parameter of the current block; and a zero-value candidate vector parameter of the current block.

[0188] In the embodiments of the present application, the vector parameter herein can be a motion vector parameter, and one or more motion vector parameters for indicating a reference region are obtained by a merge mode to construct a motion vector candidate list. Here, the motion vector candidate list can be referred to as a motion vector merge candidate list (abbreviated as "Merge list"), and the first history list can be referred to as a history-based motion vector list (HMVP). Exemplarily, for determining the motion vector candidate list, the specific operation process is as follows:

[0189] First, spatial candidate vector parameters are determined. In the Merge mode, the current block obtains the information of the surrounding neighboring decoded CUs, and obtains their MVs as spatial candidates. The order of obtaining is shown in FIG. 3. The spatial candidates include the neighboring blocks 1-5 of the current block and other non-neighboring blocks of the current block.

[0190] Second, determine the temporal candidate vector parameters. After obtaining the spatial candidate vector parameters, the current block continues to obtain the temporal candidate vector parameters (TMVP), and the MV information is determined according to the decoded blocks (collocated CUs) at the corresponding positions in the two most adjacent decoded images. As shown in FIG. 4, for the temporal candidate collocated block, if the C0 position is unavailable, the MV information of the C1 position can be obtained to determine the temporal candidate MV of the current block. In addition, more temporal candidate vector parameters can be obtained according to the offset collocated block, or the temporal candidate vector parameters can be selected according to the distortion cost of the template region.

[0191] Here, the obtained temporal candidate MV generally cannot be directly used, and needs to be scaled according to the reference image, the current image, and the collocated image, etc. As shown in FIG. 5, the scaling operation is MVcur = tb / td*MVcol. Wherein, MVcol represents the MV information obtained according to the collocated image, and MVcur represents the temporal candidate vector parameters required by the current block.

[0192] Third, determine the first history list. After obtaining the temporal candidate vector parameters, the current block continues to obtain the history-based candidate vector parameters. The first history list is to store the motion information of the previously decoded blocks in a first history list with a limited length (for example, 5 or 25, etc.), as an option for constructing the Merge list. The first history list can maintain the maximum limited length of the list unchanged according to the principle of first-in first-out, but its life cycle is every CTU row, that is, the first history list is emptied before the first block of each CTU row is encoded.

[0193] Third, determine the average candidate vector parameters. If there are still empty positions in the Merge list after the first history list is obtained, the average motion vector is calculated according to the first and second candidates in the Merge list to obtain a new motion vector, that is, the average candidate vector parameters.

[0194] Finally, determine the zero-value candidate vector parameters. If there are still empty positions in the Merge list after the average candidate vector parameters are added, the Merge list is filled with MV (0, 0).

[0195] In some embodiments, determining the at least one first vector parameter according to the one or more candidate vector parameters in the motion vector candidate list can include: determining reference templates corresponding to the one or more candidate vector parameters in the motion vector candidate list; respectively performing cost calculation on the reference templates corresponding to the one or more candidate vector parameters and the first template of the current block to determine cost results corresponding to the one or more candidate vector parameters; sorting the motion vector candidate list according to the cost results corresponding to the one or more candidate vector parameters to determine a sorted motion vector candidate list; and determining the at least one first vector parameter based on the sorted motion vector candidate list.

[0196] In the embodiments of the present application, after the motion vector candidate list is determined, the reference template corresponding to each candidate vector parameter in the motion vector candidate list can be determined respectively, and then cost calculation is performed on the reference template corresponding to each candidate vector parameter and the first template of the current block to determine the cost result corresponding to each candidate vector parameter, so as to obtain the cost results corresponding to the one or more candidate vector parameters; the motion vector candidate list is sorted according to the cost results corresponding to the one or more candidate vector parameters, and finally the at least one first vector parameter is determined based on the sorted motion vector candidate list.

[0197] In the embodiments of the present application, the reference template of the current block can be referred to as the first template. Here, the cost calculation can be SAD cost calculation, or can be SATD cost calculation, or can be other cost calculation, such as Sum of Squared Errors (SSE), Mean Absolute Deviation (MAD), Mean Absolute Error (MAE), Mean Square Error (MSE), etc., which are not limited here.

[0198] That is, in the embodiments of the present application, for the obtained Merge list, the candidate vector parameters can be sorted by the distortion cost of the template region, that is, the samples of the reference block peripheral template region corresponding to each candidate vector parameter are obtained, and cost calculation is performed on these samples and the samples of the current block peripheral template region, for example, SAD or SATD calculation is performed to obtain the distortion cost corresponding to each candidate vector parameter, and the sorted Merge list is obtained by sorting from small to large.

[0199] In a possible implementation, only one first vector parameter is selected from the sorted motion vector candidate list. In some embodiments, the candidate vector parameter at the first position in the sorted motion vector candidate list can be determined as the first vector parameter.

[0200] In the embodiments of the present application, after the cost results corresponding to the one or more candidate vector parameters are obtained, the minimum cost result can be determined from the cost results, and the candidate vector parameter corresponding to the minimum cost result is determined as the first vector parameter of the current block. For example, still taking the template error as an example, the minimum template error can be determined from the cost results, and the candidate vector parameter corresponding to the minimum template error (i.e., the position difference between the reference block corresponding to the minimum error value and the current block) is determined as the first vector parameter of the current block.

[0201] That is, in the embodiments of the present application, the candidate vector parameter at the first position (i.e., the first element in the list) in the motion vector candidate list is selected as the first vector parameter of the current block.

[0202] In another possible implementation, after the motion vector candidate list is obtained, the candidate vector parameter at a preset position in the motion vector candidate list can also be determined as the first vector parameter of the current block. For example, the preset position can be the first position in the list, or can also be other positions, which are not limited here.

[0203] In yet another possible implementation, one or more first vector parameters are selected from the sorted motion vector candidate list. In some embodiments, N first vector parameters can be determined according to the N candidate vector parameters with higher ranks in the sorted motion vector candidate list; wherein N is a positive integer.

[0204] In the embodiments of the present application, after the cost results corresponding to the one or more candidate vector parameters are obtained, the N minimum cost results can also be determined from the cost results, and the N candidate vector parameters corresponding to the N minimum cost results are determined as the N first vector parameters of the current block. The N minimum cost results can refer to the N cost results with higher ranks when the cost results are sorted from small to large.

[0205] In the embodiments of the present application, after the N first vector parameters are obtained, the corresponding N reference regions can be obtained according to the N first vector parameters, and then the reference samples in the N reference regions are used as the training samples for calculating the filter coefficients of the current block. For example, the filter coefficients can be calculated for the reference samples in each of the N reference regions, or all the reference samples in the N reference regions can be used for calculating the filter coefficients. It should be noted that in the embodiments of the present application, the filter coefficients are usually calculated for the reference samples in each of the N reference regions, and the filtering effect is good.

[0206] That is, the motion vector based EIP technique (MV-EIP) can use the first candidate vector parameter in the sorted Merge list to obtain reference region samples in the reference picture, and train the EIP filter coefficients used by the current block. The MV-EIP can also use the first N candidate vector parameters in the sorted Merge list to obtain N reference region samples in the reference picture, and use the N reference region samples to train the EIP filter coefficients used by the current block. It should be noted that the reference region can represent a reference region of the same size as the current block in the reference picture and other reference regions of the same size after motion shift, or can represent a reference CU of the same size as the current block and its surrounding samples, or can even represent these co-located CUs and their surrounding samples, as shown in FIG. 11.

[0207] In a possible implementation, the at least one vector parameter can further include a second vector parameter. In some embodiments, determining the at least one vector parameter of the current block can include parsing the second vector parameter from the bitstream.

[0208] In the embodiments of the present application, the corresponding second vector parameter can be obtained through motion / block search. For example, the encoding end can search on the original picture through the sample block of the current block, and can obtain a matching block with the minimum error. The position difference between the matching block and the current block is the second vector parameter of the current block. Here, the second vector parameter needs to be written into the bitstream and transmitted to the decoding end, so that the decoding end can obtain the second vector parameter by parsing the bitstream. It should be noted that for the second vector parameter, the motion shift can also be performed in the embodiments of the present application to obtain one or more second vector parameters.

[0209] It should be further noted that in the embodiments of the present application, after obtaining the at least one vector parameter (such as the first vector parameter and the second vector parameter), the method can further include adding the at least one vector parameter to a preset storage area and / or a first history list of the current block.

[0210] For example, after saving the first vector parameter to the preset storage area and / or the first history list, the first vector parameter can be provided for the subsequent block to be decoded. If the subsequent decoded block uses the inter prediction mode of motion information, when the Merge list is constructed, if the current block is accessed and the current block uses the EIP merge technique, the vector parameter of the current block can be directly obtained from the preset storage area and / or the first history list, and the vector parameter can be used as a candidate vector parameter in the Merge list of the subsequent decoded block.

[0211] It should be further explained that in the embodiments of the present application, after obtaining the at least one vector parameter (for example, the first vector parameter and the second vector parameter), the at least one reference region of the current block can be determined according to the at least one vector parameter. Wherein, the first vector parameter and the second vector parameter obtained above can be used as the vector parameter for determining the at least one reference region, or only the first vector parameter can be used as the vector parameter for determining the reference region, or only the second vector parameter can be used as the vector parameter for determining the reference region, or all the candidate vector parameters in the motion vector candidate list can be used as the vector parameter for determining the plurality of reference regions, which is not limited here.

[0212] In another possible implementation, according to the at least one vector parameter, determining the at least one reference region of the current block can further include: determining a first reference region indicated by the current vector parameter in the current reference image; performing motion offset on the first reference region according to the at least one offset to determine at least one second reference region in the current reference image; and determining the at least one reference region of the current block according to the first reference region and / or the at least one second reference region.

[0213] In the embodiments of the present application, for the at least one vector parameter, the current vector parameter is any one of the at least one vector parameter. Taking the current vector parameter as an example, first, a first reference region indicated by the current vector parameter in the current reference image is determined; then, at least one second reference region in the current reference image is determined by performing motion offset on the first reference region according to the at least one offset; and the at least one reference region of the current block is determined according to the first reference region and / or the at least one second reference region. That is, for each vector parameter in the at least one vector parameter, the at least one reference region can be determined according to the at least one offset.

[0214] In the embodiments of the present application, the offset here can be a pre-set motion offset. After the first reference region is determined, motion offset is performed according to the at least one offset, and other second reference regions of the same size can be obtained, so that more reference regions can be obtained, which is convenient for subsequent calculation of more groups of candidate filter coefficients.

[0215] In some embodiments, according to the at least one reference region, at least one group of candidate filter parameters of the current block is determined, referring to FIG. 12, taking the first candidate reference region as an example, the method can include:

[0216] S1201, determining a first candidate reference region in the at least one reference region.

[0217] S1202, determining training samples corresponding to at least one candidate filter according to the reconstructed samples of the first candidate reference region.

[0218] S1203, performing filter training on the training samples corresponding to the at least one candidate filter, to determine at least one set of candidate filter parameters corresponding to the first candidate reference region, the candidate filter parameters including a shape of the candidate filter and coefficients of the candidate filter.

[0219] In the embodiments of the present application, the first candidate reference region is any one of the at least one reference region. The reference region includes a reference block and / or a reference template. Here, the reconstructed samples of the reference region can include the reconstructed samples corresponding to the size and position of the current block (i.e., the reconstructed samples in the reference block), can also include the reconstructed samples adjacent to the periphery of the reference block (i.e., the reconstructed samples in the reference template), and can even include the reference block and the allowable reconstructed samples around the reference block (e.g., 6 rows and 6 columns of reconstructed samples around the reference block); here, no limitation is made.

[0220] In the embodiments of the present application, if only one vector parameter is included in the at least one vector parameter, then the corresponding reference region can be obtained according to the one vector parameter, and then at least one set of candidate filter parameters can be calculated according to the reference region; if multiple vector parameters are included in the at least one vector parameter, then multiple reference regions can be obtained according to the multiple vector parameters, and then at least one set of candidate filter parameters can be calculated according to the multiple reference regions; here, no specific limitation is made.

[0221] In the embodiments of the present application, since the shape of the filter can include at least one of a square filter, a horizontal matrix filter and a vertical rectangular filter, different training samples can be corresponded under different shapes of the filter, so that different coefficients of the filter can be trained. Here, the coefficients of the filter can also be referred to as "filter coefficients" or "filtering coefficients".

[0222] In the embodiments of the present application, taking the first candidate reference region as an example, according to the reconstructed samples of the first candidate reference region, the input samples and the output samples of the candidate filter can be determined in combination with the shape of the candidate filter, and then the input samples and the output samples of the candidate filter are calculated, so that the coefficients of the candidate filter can be obtained, such as the filtering coefficient calculation of the foregoing formula (3); so that at least one set of candidate filter parameters corresponding to each vector parameter can be determined.

[0223] In some embodiments, the method can further include: dividing the reconstructed samples of the first candidate reference region to determine at least two groups of reconstructed samples; determining, according to the at least two groups of reconstructed samples, at least one candidate filter combination corresponding to training samples, wherein the candidate filter combination includes candidate filters corresponding to the at least two groups of reconstructed samples respectively; and performing filter training according to the training samples corresponding to the at least one candidate filter combination to determine at least one candidate filter parameter combination corresponding to the first candidate reference region.

[0224] In the embodiments of the present application, the candidate filter parameter combination can include at least one group of candidate filter parameters corresponding to the at least two groups of reconstructed samples respectively. Here, the reconstructed samples of the first candidate reference region can be divided, and then filter training can be performed on the at least two groups of divided reconstructed samples respectively to obtain at least one candidate filter combination. The number of candidate filters included in the candidate filter combination is related to the number of groups of divided reconstructed samples. For example, if the reconstructed samples of the first candidate reference region are divided into two groups of reconstructed samples, then each candidate filter combination includes two candidate filters, and correspondingly, each candidate filter parameter combination includes two groups of candidate filter parameters, such as a first group of filter parameters and a second group of filter parameters. In this way, according to the condition of one or more samples in the current block, the first group of filter parameters can be adaptively selected for prediction or the second group of filter parameters can be adaptively selected for prediction.

[0225] That is, in the embodiments of the present application, the candidate filter parameters calculated according to the reconstructed samples of the first candidate reference region can be only one group of candidate filter parameters, or can be one group of candidate filter parameter combinations. In other words, here, only one group of candidate filter parameters can be used to act on the current block, or at least two groups of candidate filter parameters can be used to act on the current block simultaneously, and no limitation is made in this regard.

[0226] In a possible implementation, dividing the reconstructed samples of the first candidate reference region to determine at least two groups of reconstructed samples can include: determining a sample reference value corresponding to the first candidate reference region; dividing a first reconstructed sample in the first candidate reference region into a first group of reconstructed samples in the at least two groups of reconstructed samples when the first reconstructed sample is greater than the sample reference value; and dividing the first reconstructed sample into a second group of reconstructed samples in the at least two groups of reconstructed samples when the first reconstructed sample is less than the sample reference value.

[0227] In the embodiments of the present application, the first reconstructed sample can be any one of the reconstructed samples in the reference region. For the case that the first reconstructed sample in the first candidate reference region is equal to the sample reference value, if the first reconstructed sample in the first candidate reference region is equal to the sample reference value, the first reconstructed sample can be divided into the first group of reconstructed samples in the at least two groups of reconstructed samples, or the first reconstructed sample can also be divided into the second group of reconstructed samples in the at least two groups of reconstructed samples, which is not limited herein.

[0228] In the embodiments of the present application, the sample reference value can include a sample mean value or a sample median value. The sample mean value can be obtained by performing mean value calculation on the reconstructed samples in the first candidate reference region, and the sample median value can also be referred to as a sample median, which is the number in the middle position of the reconstructed samples in the first candidate reference region. In addition, the sample reference value can also be other sample values, such as a preset value, which is not limited herein.

[0229] For example, taking the case of dividing into two groups of reconstructed samples, if the sample reference value is the sample mean value, when the first reconstructed sample in the first candidate reference region is greater than the sample mean value, the first reconstructed sample is divided into the first group of reconstructed samples; when the first reconstructed sample in the first candidate reference region is less than the sample mean value, the first reconstructed sample is divided into the second group of reconstructed samples. Or, if the sample reference value is the sample median value, when the first reconstructed sample in the first candidate reference region is greater than the sample median value, the first reconstructed sample is divided into the first group of reconstructed samples; when the first reconstructed sample in the first candidate reference region is less than the sample median value, the first reconstructed sample is divided into the second group of reconstructed samples. In this way, after obtaining the at least one group of candidate filter parameter combinations, the samples in the current block can be predicted by using multiple groups of filter parameters, and the prediction sample accuracy of the current block is improved.

[0230] In another possible implementation, after determining the motion vector candidate list, all the candidate vector parameters in the motion vector candidate list can be used to determine a group of candidate filter parameters. Correspondingly, the method can further include: determining the reference region indicated by each of the one or more candidate vector parameters according to the one or more candidate vector parameters in the motion vector candidate list; determining the candidate filter parameter corresponding to each of the one or more candidate vector parameters according to the reference region indicated by each of the one or more candidate vector parameters; and determining the at least one group of candidate filter parameters of the current block according to the candidate filter parameter corresponding to each of the one or more candidate vector parameters.

[0231] In the embodiments of the present application, the reference region indicated by each of the one or more candidate vector parameters is determined, and the candidate filter parameters corresponding to each of the one or more candidate vector parameters are determined. In a specific embodiment, the method can further include: determining the reference region indicated by the current vector parameter in the one or more candidate vector parameters; determining the training samples corresponding to the at least one candidate filter according to the reconstructed samples of the reference region; and performing filter training according to the training samples corresponding to the at least one candidate filter to determine the at least one set of candidate filter parameters corresponding to the current vector parameter. Here, the current vector parameter is any one of the one or more candidate vector parameters.

[0232] That is, in the embodiments of the present application, for each of the one or more candidate vector parameters in the motion vector candidate list, the reference region indicated by each of the one or more candidate vector parameters is determined, and the candidate filter parameters corresponding to each of the one or more candidate vector parameters are determined, that is, the at least one set of candidate filter parameters corresponding to each of the one or more candidate vector parameters, and then all the candidate filter parameters obtained are used as the candidate mode information in the first candidate list.

[0233] In another possible implementation, the at least one set of candidate filter parameters of the current block is determined according to the at least one reference region, and the method can further include: determining the reference block corresponding to each of the at least one reference region; obtaining the filter parameters of the reference block when the reference block uses the first intra prediction technology; and using the filter parameters of the reference block as the set of candidate filter parameters of the current block.

[0234] In the embodiments of the present application, the reference block corresponding to the current block can be obtained according to the at least one reference region obtained. If the reference block uses the EIP technology, the filter parameters of the reference block, such as the shape of the filter and the coefficients of the filter, can be obtained, and then the filter parameters of the reference block are used as the set of candidate filter parameters of the current block.

[0235] It can be understood that after the at least one set of candidate filter parameters is determined, the first candidate list of the current block can be determined according to the at least one set of candidate filter parameters. In some embodiments, determining the first candidate list of the current block according to the at least one set of candidate filter parameters can include: determining the second candidate list of the current block; and determining the first candidate list of the current block according to the at least one set of candidate filter parameters and the second candidate list.

[0236] In the embodiments of the present application, if the current block uses the EIP technology and uses the EIP merge mode, the second candidate list of the current block can be determined first. The second candidate list can include the at least one set of candidate filter parameters, and the candidate filter parameters include the shape of the candidate filter and the coefficients of the candidate filter.

[0237] In some embodiments, determining the second candidate list of the current block can comprise: determining at least one set of second candidate filter parameters according to the second reference information of the current block; and determining the second candidate list of the current block according to the at least one set of second candidate filter parameters.

[0238] In the embodiments of the present application, the second reference information of the current block comprises 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; and a second history list of the current block based on the first intra prediction technology.

[0239] Exemplarily, for determining the second candidate list of the current block, the specific operation process is as follows:

[0240] Firstly, the EIP merge mode obtains the EIP information of the neighboring block and the non-neighboring block on the spatial domain of the current block, for example, the EIP information can comprise the shape of the filter and the coefficient of the filter, and adds the same to the second candidate list. For example, by searching the positions as shown in FIG. 3, the decoding blocks corresponding to the labels are checked in sequence to determine whether the EIP technology is used, and if the EIP technology is used, the EIP information corresponding to the position is obtained; and the obtained EIP information is checked with the EIP candidate filter parameters in the second candidate list, if the obtained EIP information is the same as a candidate in the second candidate list, the EIP information is not added to the second candidate list, otherwise, the EIP information is added to the second candidate list.

[0241] Secondly, the EIP merge mode checks whether the temporal information can be used, if the condition is met, the EIP information of the collocated block in the reference image and the collocated block EIP information of the offset motion vector are obtained. The same checking operation is performed, if the obtained EIP information does not appear in the second candidate list, the EIP information is added to the second candidate list. Here, the reference image can be the collocated image obtained from the reference list 0, and / or, can also be the collocated image obtained from the reference list 1.

[0242] Finally, the EIP merge mode obtains the EIP information in the second history list (i.e., the EIP history list). The second history list is constructed according to the same rule in the coding process, and the second history list only saves the EIP information. The EIP merge mode obtains the latest EIP information in the second history list, and performs the checking, if there is no same, the EIP information is added to the second candidate list. Here, the decoding end needs to save the corresponding EIP information into the second history list after completing the EIP prediction of the current block, if the second history list is full, the second history list is updated according to the principle of first in first out, and the candidate added to the second history list at the earliest time is removed, so as to keep the update of the second history list.

[0243] Thus, after the second candidate list of the EIP merge mode is constructed, at least one set of candidate filter parameters can be added to the second candidate list to determine the first candidate list of the current block.

[0244] In some embodiments, determining the first candidate list of the current block according to the at least one set of candidate filter parameters and the second candidate list can include: updating the second candidate list based on the at least one set of candidate filter parameters to obtain an updated candidate list; performing cost calculation on the template region of the current block based on at least one set of candidate filter parameters in the updated candidate list to determine a respective cost result of the at least one set of candidate filter parameters in the updated candidate list; and sorting the at least one set of candidate filter parameters in the updated candidate list according to the cost results to determine the first candidate list of the current block.

[0245] In the embodiments of the present application, the second candidate list is updated based on the at least one set of candidate filter parameters, specifically, the at least one set of candidate filter parameters is added to the second candidate list, and a duplicate checking operation is also required in this process. In some embodiments, updating the second candidate list based on the at least one set of candidate filter parameters can include: adding the first candidate filter parameter to the second candidate list when the first candidate filter parameter does not exist in the second candidate list; and skipping the step of adding the first candidate filter parameter to the second candidate list when the first candidate filter parameter exists in the second candidate list; wherein the first candidate filter parameter is any one of the at least one set of candidate filter parameters.

[0246] That is, in the embodiments of the present application, if the first candidate filter parameter has appeared in the second candidate list, the first candidate filter parameter can be skipped and not added to the second candidate list; and if the first candidate filter parameter has not appeared in the second candidate list, the first candidate filter parameter can be added to the second candidate list to update the second candidate list.

[0247] Further, for the obtained updated candidate list, the at least one set of candidate filter parameters in the updated candidate list can be used to predict the template region using the reconstructed samples adjacent to the current block as the template region, to obtain the corresponding template region prediction samples under each set of candidate filter parameters, to calculate the cost value (such as SAD cost value or SATD cost value, etc.) between the template prediction samples and the template reconstructed samples, and then to sort the updated candidate list according to the cost value to obtain a sorted candidate list, and the sorted candidate list is determined as the first candidate list of the current block.

[0248] It should be noted that in the embodiments of the present application, generally, the updated candidate list stores at most 12 sets of candidate filter parameters, and the first candidate list can include at least part of the candidate filter parameters in the updated candidate list. For example, after the 12 sets of candidate filter parameters in the updated candidate list are sorted in ascending order according to the template cost, the first 6 sets of candidate filter parameters after the sorting can be selected to form the first candidate list of the current block, but the application is not limited thereto.

[0249] It should be further noted that in the embodiments of the present application, the obtained at least one set of candidate filter parameters can be updated to the first candidate list, and similarly, the obtained at least one set of candidate filter parameter combination can also be updated to the first candidate list. In this way, the first mode index in the code stream can be used to indicate a set of candidate filter parameters in the first candidate list, or can also indicate a set of candidate filter parameter combination (including at least two sets of candidate filter parameters) in the first candidate list, and the application is not limited thereto.

[0250] S904, determining the filter parameter of the current block according to the first candidate list and the first mode index.

[0251] S905, determining the prediction sample of the current block according to the filter parameter.

[0252] In the embodiments of the present application, after the first candidate list of the current block is determined, the mode information of the current block can be determined according to the first candidate list and the first mode index in the code stream about the use of the EIP technology by the current block, at this time, the determined mode information is directly determined as the filter parameter of the current block, that is, the EIP information corresponding to the first mode index in the first candidate list, for example, including the shape of the filter and the coefficient of the filter. In this way, the samples in the current block are predicted according to the shape of the filter and the coefficient of the filter to determine the prediction sample of the current block.

[0253] For example, taking the number of 15 filter coefficients as an example, the calculation formula of the prediction sample of the current block is as follows:

[0254] In the above formula (4), pred (x,y) is the prediction value of the coordinate (x, y) in the current block, c i is the coefficient of the filter, is the reconstructed sample point or the prediction sample point, and b is a constant term. For example, taking a square filter as an example, the top-left corner of the tap position is the last sample of the input sample, and the sample input here is a constant term input, not a reconstructed sample or a prediction sample input. Similarly, for horizontal matrix filters and vertical rectangular filters, the top-left corner of the tap position is also the last sample of the input sample, and the sample input here is a constant term input.

[0255] In some embodiments, when the filtering parameters are at least two groups of filtering parameters indicated by the filter combination, determining the prediction sample of the current block according to the filtering parameters can comprise: when the current sample in the current block satisfies a first condition, selecting a first group of filtering parameters from the at least two groups of filtering parameters, and determining the prediction value of the current sample by predicting the current sample according to the first group of filtering parameters; when the current sample in the current block satisfies a second condition, selecting a second group of filtering parameters from the at least two groups of filtering parameters, and determining the prediction value of the current sample by predicting the current sample according to the second group of filtering parameters. Wherein the current sample is any one of one or more samples in the current block.

[0256] In the embodiments of the present application, the first mode index here is used to indicate a group of candidate filter parameter combinations (i.e. at least two groups of candidate filter parameters). For example, assuming that the at least two groups of candidate filter parameters include a first group of filter parameters and a second group of filter parameters, when the current sample in the current block satisfies a first condition, the first group of filter parameters can be selected to predict the current sample to determine the prediction value of the current sample; when the current sample in the current block satisfies a second condition, the second group of filter parameters can be selected to predict the current sample to determine the prediction value of the current sample.

[0257] In some embodiments, the method can further comprise: determining a first reference value corresponding to the current sample; determining that the current sample in the current block satisfies the first condition when the first reference value is greater than the sample reference value; determining that the current sample in the current block satisfies the second condition when the first reference value is less than the sample reference value.

[0258] In the embodiments of the present application, for the case where the first reference value is equal to the sample reference value, it can be determined that the current sample in the current block satisfies the first condition, at which time the first group of filter parameters is used to predict the current sample; or it can also be determined that the current sample in the current block satisfies the second condition, at which time the second group of filter parameters is used to predict the current sample, which is not limited here.

[0259] In the embodiments of the present application, determining the first reference value corresponding to the current sample can comprise: determining the filter input sample corresponding to the current sample; determining the first reference value corresponding to the current sample according to the filter input sample. Wherein the first reference value can include the input sample mean or the input sample median. Wherein the input sample mean can be obtained by mean calculation of the filter input sample corresponding to the current sample, and the sample median can also be referred to as the sample median, which is the number in the middle position of the filter input sample corresponding to the current sample. In addition, the first reference value can also be other sample values, such as a preset value, which is not limited.

[0260] In the embodiments of the present application, still taking the first candidate reference region as an example, for the sample reference value, the first set of filter parameters and the second set of filter parameters are determined according to two sets of reconstructed samples of the first candidate reference region based on the sample reference value. That is, the sample reference value can be obtained based on the reconstructed samples of the first candidate reference region. Exemplarily, the sample reference value can include a sample mean value or a sample median value. The sample mean value can be obtained by performing mean value calculation on the reconstructed samples in the first candidate reference region, and the sample median value, also referred to as a sample median, is the number in the middle position of the reconstructed samples in the first candidate reference region. In addition, the sample reference value can also be other sample values, such as a preset numerical value, and no limitation is made herein.

[0261] It should be noted that in the embodiments of the present application, the calculation manner of the first reference value needs to be consistent with the calculation manner of the sample reference value. Exemplarily, if the sample reference value is calculated by mean value, the first reference value is also calculated by mean value accordingly; or if the sample reference value is calculated by median value, the first reference value is also calculated by median value accordingly.

[0262] In this way, if the first set of reconstructed samples is the reconstructed sample greater than the sample reference value in the first candidate reference region, and the second set of reconstructed samples is the reconstructed sample less than the sample reference value in the first candidate reference region, the first set of filter parameters can be calculated according to the first set of reconstructed samples, and the second set of filter parameters can be calculated according to the second set of reconstructed samples. Then, for the current sample in the current block, the first reference value corresponding to the current sample can be calculated according to the filter input sample corresponding to the current sample. If the first reference value is greater than the sample reference value, it is determined that the current sample satisfies the first condition, and at this time, the first set of filter parameters can be selected to predict the current sample to obtain the prediction value of the current sample. If the first reference value is less than the sample reference value, it is determined that the current sample satisfies the second condition, and at this time, the second set of filter parameters can be selected to predict the current sample to obtain the prediction value of the current sample.

[0263] It can be understood that in the embodiments of the present application, if the value of the first syntax element is the first value, that is, the first syntax element indicates that the current block uses the merge mode of the first intra prediction technology, but the frame type of the current block does not satisfy the preset type condition, the EIP prediction of the related technology can be performed on the current block. In some embodiments, referring to FIG. 13, after step S901, the method can further include:

[0264] S1301, when the first syntax element indicates that the current block uses the merge mode of the first intra prediction technology and the frame type of the current block does not satisfy the preset type condition, determining the second candidate list of the current block.

[0265] S1302, determining a filter parameter of the current block according to the second candidate list and the first mode index.

[0266] S1303, determining a prediction sample of the current block according to the filter parameter.

[0267] In the embodiments of the present application, if the current block uses the EIP merge mode, but the frame type of the current block does not satisfy the preset type condition, for example, the frame type of the current block is Slice_I type; at this time, the current block can use the EIP prediction method of the related art, and no longer determine at least one reference region of the current block and derive at least one set of candidate filter parameters as the candidate mode information of the current block according to the at least one reference region, but directly use the second candidate list of the current block to determine the filter parameter of the current block.

[0268] In the embodiments of the present application, the second candidate list is constructed based on the EIP prediction of the related art. Wherein, determining the second candidate list of the current block can include: determining at least one set of second candidate filter parameters according to the second reference information of the current block; determining the second candidate list of the current block according to the at least one set of second candidate filter parameters.

[0269] In the embodiments of the present application, the second reference information of the current block includes at least one of the following: whether the neighboring block of the current block uses the first intra prediction technology; whether the non-neighboring block of the current block uses the first intra prediction technology; whether the temporal collocated block of the current block uses the first intra prediction technology; the second history list of the current block based on the first intra prediction technology.

[0270] Exemplarily, for determining the second candidate list of the current block, the specific operation process is as follows:

[0271] Firstly, the EIP merge mode obtains the EIP information of the neighboring block and the non-neighboring block on the spatial domain of the current block, for example, the EIP information can include the shape of the filter and the coefficient of the filter, which is added to the second candidate list. For example, by searching the positions as shown in FIG. 3, the decoding blocks corresponding to the labels are checked in turn to see whether they use the EIP technology, if they use the EIP technology, the EIP information corresponding to the positions is obtained; and the EIP information obtained is checked with the EIP candidate filter parameters in the second candidate list, if the EIP information obtained is the same as a candidate in the second candidate list, it is not added to the second candidate list, otherwise it is added to the second candidate list.

[0272] Secondly, the EIP merge mode checks whether the time domain information can be used. If the condition is satisfied, the EIP information of the same position block in the reference image and the EIP information of the same position block of the offset motion vector are obtained. The same position block checking operation is performed. If the obtained EIP information does not exist in the second candidate list, the EIP information is added to the second candidate list. Here, the reference image can be the same position image obtained from the reference list 0 and / or the same position image obtained from the reference list 1.

[0273] Finally, the EIP merge mode obtains the EIP information in the second history list (i.e., the EIP history list). The second history list is constructed according to the same rule in the coding process. The second history list only stores the EIP information. The EIP merge mode obtains the latest EIP information in the second history list and performs the same position block checking operation. If there is no same EIP information, the EIP information is added to the second candidate list. Here, the decoding end needs to store the corresponding EIP information in the second history list after completing the EIP prediction of the current block. If the second history list is full, the second history list is updated according to the first-in-first-out principle. The candidate added to the second history list at the earliest time is removed to keep the second history list updated.

[0274] In the embodiment of the present application, the first mode index can also be used to indicate the index sequence number of the mode information of the current block in the second candidate list. In this way, after the second candidate list of the EIP merge mode is constructed, the mode information of the current block can be determined according to the second candidate list and the first mode index of the current block using the EIP technology in the code stream. At this time, the determined mode information is directly determined as the filter parameter of the current block, i.e., the EIP information corresponding to the first mode index in the second candidate list, which can include the shape of the filter and the coefficient of the filter. In this way, the samples in the current block are predicted according to the shape of the filter and the coefficient of the filter to determine the prediction samples of the current block.

[0275] It can also be understood that in the embodiment of the present application, if the value of the first syntax element is the second value, i.e., the first syntax element indicates that the current block does not use the EIP merge mode, the current block can perform the EIP prediction based on calculation. Referring to FIG. 14, after step S901, the method can further include:

[0276] S1401, when the first syntax element indicates that the current block does not use the merge mode of the first intra prediction technology, parsing the second mode index in the code stream and determining the third candidate list of the current block.

[0277] It should be noted that if the first syntax element has the second value, i.e., the current block uses the EIP technique and does not use the EIP merge mode, a third candidate list of the current block can be determined. The third candidate list can include at least one set of candidate mode information, and the candidate mode information at this time includes a candidate template region and a shape of a candidate filter.

[0278] It should also be noted that when the current block uses the EIP technique and does not use the EIP merge mode, a second mode index in the code stream also needs to be parsed at this time. In the embodiments of the present application, the second mode index can also be denoted as eip_index. If the first syntax element indicates that the current block does not use the merge mode of the first intra prediction technique, i.e., the current block does not use the EIP merge mode, the second mode index can indicate the index sequence number of the filter parameter of the current block in the third candidate list.

[0279] It should also be noted that in the embodiments of the present application, the first mode index and the second mode index are two index sequence numbers written in the code stream when the current block uses the EIP technique. Here, the first mode index and the second mode index can be represented by the same syntax element in the code stream, or can also be represented by different syntax elements. When the first mode index and the second mode index are represented by the same syntax element, the first mode index and the second mode index are used to represent different values of the syntax element corresponding to different modes used by the current block. For example, in the case where the current block uses the EIP technique, if the current block uses the EIP merge mode, the first mode index is used to indicate the corresponding index sequence number in the first candidate list or the second candidate list; if the current block does not use the EIP merge mode, the second mode index is used to indicate the corresponding index sequence number in the third candidate list.

[0280] In some embodiments, the third candidate list of the current block is determined, and the method can include: 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 third candidate list of the current block according to the shape of the at least one candidate template region and the at least one candidate filter.

[0281] In the embodiments of the present application, the candidate template region can include at least one of the following: an upper template region, and / or a left template region. The shape of the candidate filter can include at least one of the following: a square filter, a horizontal matrix filter, and a vertical rectangular filter.

[0282] In a specific embodiment, there are at most three shapes of the candidate filter, such as a square filter, a horizontal matrix filter and a vertical rectangular filter, as shown in FIG. 1A, FIG. 1B and FIG. 1C. There are at most three template regions, such as only an upper template region, or only a left template region, or both an upper template region and a left template region, as shown in FIG. 2A, FIG. 2B and FIG. 2C. In this way, the decoding end can obtain at most nine groups of candidate mode information by combining different candidate template regions and different shapes of the filter, i.e., the maximum length of the third candidate list is 9.

[0283] It should be further noted that in the embodiments of the present application, the candidate mode information allowed to be used by the current block can be determined according to the width and height of the current block, and the candidate mode information allowed to be used by the current block is used to form the third candidate list.

[0284] For example, if the size of the current block is relatively small, such as a 4x4 current block, the template region can only have one option, i.e., both an upper template region and a left template region, and combined with the three shapes of the candidate filter, three groups of candidate mode information can be obtained, i.e., the third candidate list only includes three groups of candidate mode information.

[0285] That is, in the embodiments of the present application, according to the width and height of the current block, the shape of the candidate filter can only select one, two or three shapes, and the candidate template region can only select one, two or three template regions. In this way, according to the combination of at least one candidate template region and at least one shape of the candidate filter, the third candidate list of the current block can be obtained.

[0286] S1402, determining the mode information of the current block according to the third candidate list and the second mode index.

[0287] S1403, determining the filtering parameter of the current block according to the mode information.

[0288] S1404, determining the prediction sample of the current block according to the filtering parameter.

[0289] In the embodiments of the present application, after the third candidate list is determined, the candidate mode information corresponding to the second mode index in the third candidate list can be determined as the mode information of the current block. The mode information herein can include the template region and the shape of the filter.

[0290] In the embodiments of the present application, the filtering parameter of the current block can include the shape of the filter and the coefficient of the filter. Accordingly, in some embodiments, determining the filtering parameter of the current block according to the mode information can include: determining the shape of the filter and the template region of the current block according to the mode information; determining the input sample and the output sample of the filter according to the template region of the current block; and determining the coefficient of the filter according to the filter training based on the input sample and the output sample of the filter.

[0291] In the embodiments of the present application, the coefficient of the filter can also be referred to as "filter coefficient" or "filtering coefficient". Here, since the mode information includes the template region and the shape of the filter, the input sample and the output sample of the filter can be determined according to the template region, and then the coefficient of the filter can be obtained by calculation based on the input sample and the output sample of the filter.

[0292] In this way, in the embodiments of the present application, after determining the third candidate list of the current block, the mode information of the current block can be determined according to the third candidate list and the second mode index in the code stream, and at this time, the filtering parameter of the current block, such as the shape of the filter and the coefficient of the filter, can be further determined according to the determined mode information. In this way, the prediction sample of the current block can be obtained by predicting the sample in the current block according to the shape of the filter and the coefficient of the filter, as shown in the above formula (5).

[0293] It can also be understood that, in the embodiments of the present application, the extrapolation filter (i.e., the EIP filter) can be applied to the inter prediction mode. If the image in which the current block is located is a non-intra decoded image, and the current prediction mode is an inter prediction mode, which is the same as other extended inter prediction modes, at this time, a MergeMVP list belonging to the EIP technology can also be established, and the related parameters such as the EIP filter are the same as those in the technical solutions in the foregoing embodiments. Hereinafter, this can be referred to as interEIP.

[0294] In some embodiments, referring to FIG. 15, after step S1001, the method can further include:

[0295] S1501, when the second syntax element indicates that the current block uses the inter prediction, parsing a fourth syntax element in the code stream.

[0296] S1502, when the fourth syntax element indicates that the current block uses the merge mode of the first inter prediction technology, parsing a merge index in the code stream.

[0297] S1503, determining a third vector parameter corresponding to the merge index according to the motion vector candidate list.

[0298] S1504, determining a third reference region of the current block according to the third vector parameter, and determining at least one group of candidate filtering parameters of the current block according to the third reference region.

[0299] S1505, determining the filtering parameter of the current block according to the at least one group of candidate filtering parameters.

[0300] S1506, determining the prediction sample of the current block according to the filtering parameter.

[0301] In the embodiments of the present application, the fourth syntax element is used to indicate whether the current block uses the merge mode of the first inter prediction technology, the merge mode of the first inter prediction technology refers to the inter EIP merge mode, so the fourth syntax element can be called inter_EIP_merge flag, which can be represented by inter_EIP_merge here.

[0302] In some embodiments, the method can further include: if the value of the fourth syntax element is the first value, determining that the fourth syntax element indicates that the current block uses the merge mode of the first inter prediction technology; and if the value of the fourth syntax element is the second value, determining that the fourth syntax element indicates that the current block does not use the merge mode of the first inter prediction technology.

[0303] That is, in the embodiments of the present application, when the current block uses inter prediction, if the value of inter_EIP_merge obtained by parsing the code stream is the first value, it can be determined that the current block uses the inter EIP merge mode; if the value of inter_EIP_merge obtained by parsing the code stream is the second value, it can be determined that the current block does not use the inter EIP merge mode.

[0304] It should be noted that in the embodiments of the present application, the first value is different from the second value, and the first value and the second value can be in the form of a parameter or in the form of a number. For example, the syntax element here can be a parameter written in a profile, or the value of a flag, which is not limited here.

[0305] 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 this is also not limited.

[0306] It should be further noted that in the embodiments of the present application, when the current block uses the inter-EIP merge mode, the merge index in the code stream also needs to be parsed at this time. The merge index can be denoted as EIP_merge_index, and the merge index can be used to indicate the index sequence number of the third vector parameter in the motion vector candidate list. In this way, according to the motion vector candidate list constructed according to the foregoing embodiments, the third vector parameter corresponding to the EIP_merge_index is determined; then the third reference region of the current block is determined according to the third vector parameter, and then at least one set of candidate filter parameters of the current block can be determined according to the third reference region, and the filter parameters of the current block are determined based on the at least one set of candidate filter parameters, and the filter parameters are applied to the current block for prediction, and the prediction samples of the current block can be obtained.

[0307] It should be further noted that in the embodiments of the present application, at least one set of candidate filter parameters of the current block is determined according to the third reference region, and the candidate filter parameters can include the shape of the candidate filter and the coefficients of the candidate filter. Since the shape of the candidate filter can be various, such as a square filter, a horizontal matrix filter and a vertical rectangular filter, at least one set of filter coefficients can be calculated according to the third reference region and the shape of at least one filter, so as to obtain at least one set of candidate filter parameters.

[0308] Then, according to the at least one set of candidate filter parameters, the filter parameters of the current block are determined, which can be: predicting the template region of the current block by using the at least one set of candidate filter parameters to determine the template region prediction block corresponding to each set of candidate filter parameters; calculating the cost (such as SAD or SATD cost) between the template region prediction block corresponding to each set of candidate filter parameters and the template reconstructed block, and determining the set of candidate filter parameters corresponding to the minimum cost as the filter parameters of the current block.

[0309] That is, in the inter prediction mode, if the prediction mode of the current block is the Merge mode, and the Merge_flag of the current block is true and the regular_merge is false, the fourth syntax element inter_EIP_merge flag bit needs to be parsed, and if the inter_EIP_merge flag bit is true, the EIP_merge_index needs to be parsed. According to the EIP_merge_index, the candidate MV (i.e. the third vector parameter) in the motion vector candidate list is obtained, and then the reference region in the reference image is obtained according to the candidate MV to determine the EIP filter parameter, and then the determined filter parameter is applied to the current block, and the prediction samples of the current block can be obtained.

[0310] In some embodiments, the method can further include: determining a fourth candidate list according to the motion vector candidate list when the fourth syntax element indicates that the current block uses a merge mode of the first inter prediction technique; wherein the fourth candidate list includes at least one set of candidate filter parameters; parsing a merge index in the bitstream; determining the filter parameters of the current block according to the fourth candidate list and the merge index; and determining the prediction samples of the current block according to the filter parameters.

[0311] In a possible implementation, determining the fourth candidate list according to the motion vector candidate list can include: determining one or more sets of candidate filter parameters corresponding to one or more candidate vector parameters in the motion vector candidate list; determining a fifth candidate list according to the one or more sets of candidate filter parameters; performing cost calculation on a template region of the current block according to one or more sets of candidate filter parameters in the fifth candidate list, respectively, to determine a cost result corresponding to each of the one or more sets of candidate filter parameters in the fifth candidate list; and determining the fourth candidate list according to the sorting of the one or more sets of candidate filter parameters in the fifth candidate list according to the cost results.

[0312] In the embodiments of the present application, in the process of determining the fifth candidate list, for one or more candidate vector parameters in the motion vector candidate list, assuming that the first candidate vector parameter in the motion vector candidate list can train three sets of candidate filter parameters, the three sets of candidate filter parameters can be updated to the first three positions in the fifth candidate list; for the second candidate vector parameter in the motion vector candidate list, three sets of candidate filter parameters can be trained, and the three sets of candidate filter parameters can be updated to the fourth to sixth positions in the fifth candidate list; and the three sets of candidate filter parameters corresponding to one or more candidate vector parameters in the motion vector candidate list can be sequentially updated to the fifth candidate list.

[0313] In some embodiments, considering that there are too many candidate filter parameters in the fifth candidate list, at least part of the candidate filter parameters can be selected to form the fourth candidate list. In some embodiments, the method can further include: determining the top M sets of candidate filter parameters in the sorting as the fourth candidate list after the sorting of the one or more sets of candidate filter parameters in the fifth candidate list according to the cost results; wherein M is a positive integer.

[0314] In the embodiments of the present application, the one or more sets of candidate filter parameters in the fifth candidate list can be sorted according to the cost results, and then the sorted fifth candidate list can be determined as the fourth candidate list, or the top M sets of candidate filter parameters in the sorting can be determined as the fourth candidate list, that is, the fifth candidate list is truncated to a preset length to obtain the fourth candidate list.

[0315] It should be noted that in the embodiments of the present application, the motion vector candidate list includes one or more candidate vector parameters, and the fourth candidate list includes one or more sets of candidate filter parameters. The merge index herein refers to the index sequence number of the filter parameters of the current block in the fourth candidate list. In this way, after the fourth candidate list is determined, the filter parameters of the current block can be directly obtained according to the fourth candidate list and the merge index obtained by parsing the code stream.

[0316] That is, in the embodiments of the present application, after the inter EIP MergeMVP list (i.e., the motion vector candidate list) is obtained, the EIP filter shape acting on the current block can be allowed to be determined according to the size and shape of the current block. For example, if the current block is a 16x16 square coding block, three EIP filter shapes can be allowed, and the EIP MergeMVP list is updated. Specifically, after the first candidate MV of the EIP MergeMVP list obtains the training sample, the candidate filter parameters of the three EIP shapes are trained, and are updated to the first three positions of the new EIP MergeMVP list; in this way, after the second candidate MV of the original EIP MergeMVP list obtains the training sample, the candidate filter parameters of the three EIP shapes are trained, and are updated to the fourth to sixth positions of the EIP MergeMVP list to obtain the fifth candidate list.

[0317] It should be noted that the updated EIP MergeMVP list can be reordered according to the template error. In a possible implementation, the reordered EIP MergeMVP list can be truncated to a list of a specific length (e.g., only the top M sets of candidate filter parameters are reserved), to save the transmission of code words.

[0318] In some embodiments, the method can further include: determining a first prediction sample of the current block according to the third vector parameter; determining a second prediction sample of the current block according to the filter parameter; and performing weighted calculation on the first prediction sample and the second prediction sample to determine a prediction sample of the current block.

[0319] That is, in the embodiments of the present application, after the prediction block of the current block is obtained according to the interEIP, the inter prediction block obtained by the original candidate MV can be weighted and averaged to obtain the final prediction block of the current block. The weight value of the weighted prediction can be a preset value, or can be obtained by other means such as SATD or SAD ratio calculation, which is not limited herein.

[0320] It can also be understood that, in the embodiments of the present application, the MV-EIP or interEIP proposed for the foregoing embodiments, in general, the EIP candidate has only one filter to predict the current block. In a possible implementation, the EIP candidate can also have multiple filters, and the training process divides the training samples into two groups according to the size relationship with the sample mean (alpha), and trains a separate filter for each group of samples to form an EIP candidate. When applied to the current block, if the EIP candidate contains two filters, the sample mean (alpha) stored in the EIP candidate is obtained, and according to the size relationship between the mean (beta) of the input samples corresponding to the current sample and alpha, the corresponding filter is selected to predict the current sample. Wherein, the calculation of beta can be the mean of several input samples in the grid part of the filter as shown in FIG. 1A-1C, which is not limited in this regard.

[0321] The embodiment of the present application provides a decoding method, parsing a first syntax element in a code stream; when the first syntax element indicates that a current block uses a merge mode of a first intra prediction technology and a frame type of the current block meets a preset type condition, parsing a first mode index in the code stream, and determining at least one reference area of the current block, determining at least one group of candidate filtering parameters of the current block according to the at least one reference area; determining a first candidate list of the current block according to the at least one group of candidate filtering parameters; determining a filtering parameter of the current block according to the first candidate list and the first mode index; and determining a prediction sample of the current block according to the filtering parameter. In this way, when the current block uses the merge mode of the first intra prediction technology and the frame type of the current block meets the preset type condition, at least one group of candidate filtering parameters of the current block is determined according to at least one reference area, and then the at least one group of candidate filtering parameters is used as candidate mode information in the first candidate list, which expands the candidate range in the first candidate list; and according to the first candidate list and the first mode index obtained by parsing the code stream, the filtering parameter determined at this time has good generalization ability, so that the filtering parameter can be better applied to sample prediction in the current block; and prediction according to the determined filtering parameter (such as the coefficient of the filter and the shape of the filter) can also improve the accuracy of the prediction sample of the current block, thereby improving the compression efficiency and further improving the coding performance.

[0322] In another embodiment of the present application, FIG. 16 is a flowchart of an encoding method provided by an embodiment of the present application. As shown in FIG. 16, the method can include:

[0323] S1601, determining a frame type of a current block.

[0324] It should be noted that in the embodiments of the present application, the method is applied to the encoder, and mainly applied to the intra prediction part (marked with a bold frame) in FIG. 7. Wherein, when the current block uses intra prediction, the optimization scheme proposed herein is mainly for determining the filtering coefficient of the EIP technology in the intra prediction, so as to improve the compression efficiency.

[0325] It should be further noted that in the embodiments of the present application, the frame type of the current block can include I frame, B frame and P frame, and whether it is slice (Slice) type or block (CU) type, etc. Exemplarily, the frame type of the current block satisfies the preset type condition, which can include: the frame type of the current block is a non-intra slice type, that is, the frame type of the current block is a non-Slice I type. That is, only when the frame type of the current block is a non-Slice I type, the EIP prediction method of the embodiments of the present application can be used.

[0326] S1602, in the case that the frame type of the current block satisfies the preset type condition, when the current block uses the merge mode of the first intra prediction technology, at least one reference region of the current block is determined, at least one set of candidate filtering parameters of the current block is determined according to the at least one reference region, and a first candidate list of the current block is determined according to the at least one set of candidate filtering parameters, and at least one set of candidate mode information in the first candidate list is determined to correspond to a first cost result respectively.

[0327] It should be noted that in the embodiments of the present application, when the current block uses the merge mode of the first intra prediction technology, the EIP prediction based on merging can be performed at this time, first at least one reference region of the current block is needed, then at least one set of candidate filtering parameters of the current block is determined according to the at least one reference region, and then the first candidate list is determined, wherein the first candidate list can include at least one set of candidate mode information, the candidate mode information at this time can include the shape of the candidate filter and the coefficient of the candidate filter; and then at least one set of candidate mode information in the first candidate list is calculated to correspond to a first cost result respectively.

[0328] In the embodiments of the present application, the reference region can be determined according to the co-located image, or can be determined according to the vector parameter. Wherein, the vector parameter can include at least one of motion vector (Motion Vector, MV) and block vector (Block Vector, BV). In the embodiments of the present application, the vector parameter herein specifically refers to the motion vector parameter, for example, the corresponding reference region can be determined according to the motion vector parameter, and then at least one set of candidate filtering parameters of the current block is determined.

[0329] In the embodiments of the present application, for the determination of the candidate filter parameters, a coded block similar to the current block can be searched in the co-located picture or the reference picture, and then the relevant area of the coded block is used for filter training to obtain the corresponding at least one set of candidate filter parameters. It should be noted that the candidate filter parameters can include the shape of the candidate filter and the coefficients of the candidate filter. The shape of the candidate filter can include at least one of a square filter, a horizontal matrix filter and a vertical rectangular filter, but is not limited thereto.

[0330] The at least one reference area of the current block can be determined in several possible implementation manners.

[0331] In one possible implementation manner, the determination of the at least one reference area of the current block can include: determining at least one co-located picture; determining at least one co-located area of the current block according to the at least one co-located picture, and determining the at least one co-located area as the at least one reference area of the current block.

[0332] Here, the co-located area includes one of the co-located block of the current block, or the co-located block and the reference template of the co-located block of the current block, or the co-located block and the adjacent reference samples around the co-located block of the current block.

[0333] It should be noted that in the embodiments of the present application, the corresponding reference area can be determined based on the co-located block. For example, the current block in the current picture can use N nearest co-located picture information. When the current block is coded, the reference area of the current block is composed of the co-located block in the co-located picture and the reference samples available around the co-located block, and the reference samples in the reference area can be used as the training samples for calculating the filter coefficients of the current block.

[0334] As shown in the foregoing FIG. 5, the curr_CU in the current picture is the current block, and the col_CU in the col_pic is the co-located block. The EIP technology based on the motion vector (MV-EIP) can only obtain the samples in the co-located block col_CU to compose the reference area, or can obtain the co-located block col_CU and the reference template thereof to compose the reference area, or can obtain the co-located block col_CU and the allowable reference sample range around the co-located block, for example, 6 rows and 6 columns of samples, to compose a larger reference area for filter coefficient training, as shown in FIG. 11.

[0335] It should be further noted that in the embodiments of the present application, the co-located picture can also be replaced by any reference picture of the current block. At this time, the reference block of the current block is searched in the reference picture, and then the reference block with the same size as the current block is used as the reference area, or the reference block and the allowable reference samples around the reference block can be used to compose the reference area of the current block, which is not limited herein.

[0336] In another possible implementation, determining the at least one reference region of the current block can include: determining at least one vector parameter of the current block; and determining the at least one reference region of the current block according to the at least one vector parameter.

[0337] Here, the reference region includes one of the following: a reference block of the current block, or the reference block of the current block and a reference template of the reference block, or the reference block of the current block and neighboring reference samples around the reference block.

[0338] It should be noted that in the embodiments of the present application, the corresponding reference region can be determined based on the reference block. For example, when encoding the current block, the current block can obtain the reference region by obtaining the reference block in the reference image and the reference samples around the reference block, and the reference samples in the reference region can also be used as the training samples for calculating the filter coefficients of the current block. For the current block, the reference block in the reference image can be found, and then the reference block with the same size as the current block can be used as the reference region, or the reference block and the reference samples around the reference block can be used to form the reference region of the current block, for example, the reference block and the reference template thereof can be used as the reference region, or the reference block and the 6 rows and 6 columns of samples around the reference block can be used to form a larger reference region, and the like, which are not limited herein.

[0339] It should be further noted that in the embodiments of the present application, the vector parameter can be a motion vector parameter, or can also be a block vector parameter. The motion vector parameter will be described in detail below.

[0340] In a possible implementation, the at least one vector parameter can include a first vector parameter. In some embodiments, determining the at least one vector parameter of the current block can include: determining a motion vector candidate list; and determining the first vector parameter of the current block according to one or more second candidate vector parameters in the motion vector candidate list.

[0341] In the embodiments of the present application, the motion vector of the reference region in the motion vector candidate list is obtained by the merge mode, and the process of obtaining the vector parameter is similar to the rules and order of the aforementioned inter-frame merge prediction mode. The motion vector candidate list includes one or more candidate vector parameters.

[0342] In some embodiments, determining the motion vector candidate list can include: determining one or more candidate vector parameters according to first reference information of the current block; and determining the motion vector candidate list according to the one or more candidate vector parameters; wherein the first reference information of the current block includes at least one of: candidate vector parameters corresponding to neighboring blocks of the current block; candidate vector parameters corresponding to non-neighboring blocks of the current block; candidate vector parameters corresponding to collocated blocks of the current block in a collocated picture; candidate vector parameters included in a first history list of the current block; an average candidate vector parameter of the current block; and a zero value candidate vector parameter of the current block.

[0343] In the embodiments of the present application, the vector parameter herein can be a motion vector parameter, and one or more motion vector parameters used for indicating a reference region are obtained through a merge mode to construct a motion vector candidate list. Herein, the motion vector candidate list can be referred to as a motion vector merge candidate list (abbreviated as "Merge list"), and the first history list can be referred to as a history-based motion vector list (HMVP). Exemplarily, for determining the motion vector candidate list, the specific operation process is as follows:

[0344] First, spatial candidate vector parameters are determined. In the Merge mode, the current block obtains the MVs of the surrounding neighboring coded CUs to obtain the spatial candidates, and the obtaining sequence is shown in FIG. 3. The spatial candidates include the neighboring blocks 1-5 of the current block and other non-neighboring blocks of the current block.

[0345] Second, temporal candidate vector parameters are determined. After the spatial candidate vector parameters are obtained, the current block continues to obtain the temporal candidate vector parameters (TMVP), and the MV information is determined according to the coded blocks (collocated CUs) at the corresponding positions in the two most neighboring coded pictures. As shown in FIG. 4, for the temporal candidate collocated block, if the C0 position is unavailable, the MV information of the C1 position can be obtained to determine the temporal candidate MV of the current block. In addition, more temporal candidate vector parameters can be obtained according to the offset collocated block, or the temporal candidate vector parameters can be selected according to the distortion cost of the template region.

[0346] Herein, the obtained temporal candidate MV generally cannot be directly used, and needs to be scaled according to the reference picture, the current picture and the collocated picture, etc. As shown in FIG. 5, the scaling operation is MVcur = tb / td*MVcol. Wherein, MVcol represents the MV information obtained according to the collocated picture, and MVcur represents the temporal candidate vector parameter required by the current block.

[0347] Again, the first history list is determined. After the temporal candidate vector parameters are obtained, the current block proceeds to obtain history-based candidate vector parameters. The first history list is to store the motion information of previously coded blocks in a first history list of a defined length (e.g. 5 or 25, etc.) as alternatives for constructing the Merge list. The first history list can be maintained according to a first-in-first-out principle to keep the maximum defined length of the list unchanged, but its life cycle is per CTU row, i.e. the first history list is emptied before the first block of each CTU row is coded.

[0348] Again, the average candidate vector parameter is determined. If there are still empty positions in the Merge list after the first history list is obtained, the average motion vector is calculated according to the first and second candidates in the Merge list, and a new motion vector, i.e. the average candidate vector parameter, is obtained.

[0349] Finally, the zero-value candidate vector parameter is determined. If there are still empty positions in the Merge list after the average candidate vector parameter is added, the Merge list is filled with MV(0, 0).

[0350] In some embodiments, determining the at least one first vector parameter according to one or more candidate vector parameters in the motion vector candidate list can include: determining reference templates corresponding to the one or more candidate vector parameters in the motion vector candidate list; respectively performing cost calculation on the reference templates corresponding to the one or more candidate vector parameters and the first template of the current block to determine cost results corresponding to the one or more candidate vector parameters; sorting the motion vector candidate list according to the cost results corresponding to the one or more candidate vector parameters to determine a sorted motion vector candidate list; and determining the at least one first vector parameter based on the sorted motion vector candidate list.

[0351] In the embodiments of the present application, after the motion vector candidate list is determined, the reference template corresponding to each candidate vector parameter in the motion vector candidate list can be determined respectively, and then the cost calculation is performed on the reference template corresponding to each candidate vector parameter and the first template of the current block to determine the cost result corresponding to each candidate vector parameter, so as to obtain the cost results corresponding to the one or more candidate vector parameters; the motion vector candidate list is sorted according to the cost results corresponding to the one or more candidate vector parameters, and finally the at least one first vector parameter is determined based on the sorted motion vector candidate list.

[0352] In the embodiments of the present application, the reference template of the current block can be referred to as a first template. The cost calculation herein can be SAD cost calculation, or can also be SATD cost calculation, or can also be other cost calculation, such as Sum of Squared Errors (SSE), Mean Absolute Deviation (MAD), Mean Absolute Error (MAE), Mean Square Error (MSE), etc., which are not limited herein.

[0353] That is, in the embodiments of the present application, for the obtained Merge list, the candidate vector parameters can be sorted according to the distortion costs of the template regions, and the samples of the reference block surrounding template regions corresponding to each candidate vector parameter can be obtained, and the samples of the current block surrounding template regions are used for cost calculation, for example, SAD or SATD calculation, to obtain the distortion cost corresponding to each candidate vector parameter, and the sorted Merge list is obtained according to the small-to-large order.

[0354] In a possible implementation, only one first vector parameter is selected from the sorted motion vector candidate list. In some embodiments, the candidate vector parameter at the first position in the sorted motion vector candidate list can be determined as the first vector parameter.

[0355] In the embodiments of the present application, after the cost results corresponding to one or more candidate vector parameters are obtained, the minimum cost result can be determined from the cost results, and the candidate vector parameter corresponding to the minimum cost result is determined as the first vector parameter of the current block. For example, the minimum template error is determined from the template errors, and the candidate vector parameter corresponding to the minimum template error (i.e., the position difference between the reference block corresponding to the minimum error value and the current block) is determined as the first vector parameter of the current block.

[0356] That is, in the embodiments of the present application, the candidate vector parameter at the first position in the motion vector candidate list (i.e., the first element in the list) can be selected as the first vector parameter of the current block.

[0357] In another possible implementation, after the motion vector candidate list is obtained, the candidate vector parameter at a preset position in the motion vector candidate list can also be determined as the first vector parameter of the current block. For example, the preset position is the first position in the list, or can also be other positions, which are not limited herein.

[0358] In yet another possible implementation, one or more first vector parameters are selected from the sorted motion vector candidate list. In some embodiments, N first vector parameters can be determined according to N top-ranked candidate vector parameters in the sorted motion vector candidate list, where N is a positive integer.

[0359] In the embodiments of the present application, after the cost results corresponding to the one or more candidate vector parameters are obtained, N minimum cost results can also be determined from the cost results, and the candidate vector parameters corresponding to the N minimum cost results are determined as the N first vector parameters of the current block. The N minimum cost results can refer to the N top-ranked cost results when the cost results are sorted from small to large.

[0360] In the embodiments of the present application, after the N first vector parameters are obtained, N reference regions corresponding to the N first vector parameters can be obtained, and then the reference samples in the N reference regions are used as training samples for calculating the filter coefficients of the current block. For example, the filter coefficients can be calculated for the reference samples in each of the N reference regions, or the filter coefficients can be calculated for all the reference samples in the N reference regions. It should be noted that in the embodiments of the present application, the filter coefficients are usually calculated for the reference samples in each of the N reference regions, and the filtering effect is good.

[0361] That is, the EIP technology based on motion vector (MV-EIP) can use the first candidate vector parameter in the sorted Merge list to obtain the reference region samples in the reference image, and train the EIP filter coefficients used by the current block. The MV-EIP can also obtain N reference region samples in the reference image by obtaining the top N candidate vector parameters in the sorted Merge list, and train the EIP filter coefficients used by the current block using the obtained N reference region samples. It should be noted that the reference region can refer to a reference region in the reference image that is equal in size to the current block and other reference regions of the same size after motion shift, or can refer to a reference CU that is equal in size to the current block and its surrounding samples, or can even refer to these co-located CUs and their surrounding samples, as shown in FIG. 11.

[0362] In a possible implementation, the at least one vector parameter can further include a second vector parameter. In some embodiments, determining the at least one vector parameter of the current block can include: searching in the current image based on the current block to determine one or more candidate reference blocks; determining cost results corresponding to the one or more candidate reference blocks according to cost calculation between the one or more candidate reference blocks and the current block respectively, and determining a minimum cost result from the cost results corresponding to the one or more candidate reference blocks, and determining a candidate reference block corresponding to the minimum cost result as a matching block; and determining the second vector parameter of the current block according to a vector parameter between the current block and the matching block.

[0363] In some embodiments, the method can further include: encoding the second vector parameter of the current block, and writing the obtained encoding bits into a bitstream.

[0364] In the embodiments of the present application, the encoding end can also obtain the corresponding second vector parameter through motion / block search. For example, the encoding end searches in the original image through the sample block of the current block, and obtains a matching block with the minimum error, and the position difference between the matching block and the current block is the second vector parameter of the current block. Here, the second vector parameter needs to be written into the bitstream and transmitted to the decoding end, so that the decoding end can obtain the second vector parameter by parsing the bitstream.

[0365] It should be further noted that in the embodiments of the present application, after obtaining the at least one vector parameter (such as the first vector parameter and the second vector parameter), the method can further include: adding the at least one vector parameter to a preset storage area and / or a first history list of the current block.

[0366] For example, taking the obtained first vector parameter as an example, after saving the first vector parameter to the preset storage area and / or the first history list, the first vector parameter can be provided for the subsequent blocks to be encoded. If the subsequent encoded blocks use the inter-frame prediction mode of motion information, when constructing the Merge list, if the current block is accessed and the current block uses the EIP merge technology, the vector parameter of the current block can be directly obtained from the preset storage area and / or the first history list, and the vector parameter is used as a candidate vector parameter in the Merge list of the subsequent encoded blocks.

[0367] It should be further noted that, in the embodiments of the present application, after obtaining the at least one vector parameter (for example, the first vector parameter and the second vector parameter), at least one reference region of the current block can be determined according to the at least one vector parameter. Wherein, the first vector parameter and the second vector parameter obtained above can be used as the vector parameter for determining the at least one reference region, or only the first vector parameter can be used as the vector parameter for determining the reference region, or only the second vector parameter can be used as the vector parameter for determining the reference region, or all the candidate vector parameters in the motion vector candidate list can be used as the vector parameter for determining the plurality of reference regions, which is not limited here.

[0368] In another possible implementation, according to the at least one vector parameter, determining the at least one reference region of the current block can further include: determining a first reference region indicated by the current vector parameter in the current reference image; performing motion offset on the first reference region according to the at least one offset to determine at least one second reference region in the current reference image; and determining the at least one reference region of the current block according to the first reference region and / or the at least one second reference region.

[0369] In the embodiments of the present application, for the at least one vector parameter, the current vector parameter is any one of the at least one vector parameter. Taking the current vector parameter as an example, first, a first reference region indicated by the current vector parameter in the current reference image is determined; then, at least one second reference region in the current reference image is determined by performing motion offset on the first reference region according to the at least one offset; and the at least one reference region of the current block is determined according to the first reference region and / or the at least one second reference region. That is, for each vector parameter in the at least one vector parameter, at least one reference region can be determined according to the at least one offset.

[0370] In the embodiments of the present application, the offset here can be a pre-set motion offset. After the first reference region is determined, motion offset is performed according to the at least one offset, and other second reference regions of the same size can be obtained, so that more reference regions can be obtained, which facilitates subsequent calculation of more groups of candidate filter coefficients.

[0371] In some embodiments, taking the first candidate reference region as an example, according to the at least one reference region, determining at least one group of candidate filter parameters of the current block can include: determining a first candidate reference region in the at least one reference region; determining training samples corresponding to at least one candidate filter according to the reconstructed samples of the first candidate reference region; and performing filter training on the training samples corresponding to the at least one candidate filter to determine at least one group of candidate filter parameters corresponding to the first candidate reference region, wherein the candidate filter parameters include the shape of the candidate filter and the coefficients of the candidate filter.

[0372] In the embodiments of the present application, the first candidate reference region is any one of the at least one reference region. The reference region includes a reference block and / or a reference template. Here, the reconstructed samples of the reference region can include the reconstructed samples corresponding to the size and position of the current block (i.e., the reconstructed samples in the reference block), can also include the reconstructed samples adjacent to the periphery of the reference block (i.e., the reconstructed samples in the reference template), and can even include the reference block and the allowable reconstructed samples around the reference block (e.g., 6 rows and 6 columns of reconstructed samples around the reference block); here, no limitation is made.

[0373] In the embodiments of the present application, if only one vector parameter is included in the at least one vector parameter, then the corresponding reference region can be obtained according to the one vector parameter, and then at least one group of candidate filter parameters is calculated according to the reference region; if multiple vector parameters are included in the at least one vector parameter, then multiple reference regions can be obtained according to the multiple vector parameters, and then at least one group of candidate filter parameters is calculated according to the multiple reference regions; here, no specific limitation is made.

[0374] In the embodiments of the present application, since the shape of the filter can include at least one of a square filter, a horizontal matrix filter and a vertical rectangular filter, different training samples can be obtained under different shapes of the filter, so that different coefficients of the filter can be trained. Here, the coefficients of the filter can also be referred to as "filter coefficients" or "filtering coefficients".

[0375] In the embodiments of the present application, taking the first candidate reference region as an example, according to the reconstructed samples of the first candidate reference region, the input samples and the output samples of the candidate filter can be determined in combination with the shape of the candidate filter, and then the input samples and the output samples of the candidate filter are calculated, so that the coefficients of the candidate filter can be obtained, such as the filtering coefficient calculation of the foregoing formula (3); so that at least one group of candidate filter parameters corresponding to each vector parameter can be determined.

[0376] In some embodiments, the method can further include: dividing the reconstructed samples of the first candidate reference region to determine at least two groups of reconstructed samples; determining the training samples corresponding to at least one candidate filter combination according to the at least two groups of reconstructed samples, wherein the candidate filter combination includes the candidate filters corresponding to the at least two groups of reconstructed samples respectively; performing filter training according to the training samples corresponding to the at least one candidate filter combination to determine at least one group of candidate filter parameter combinations corresponding to the first candidate reference region.

[0377] In the embodiments of the present application, the candidate filter parameter combination can include at least two candidate filter parameter sets corresponding to the respective at least two groups of reconstructed samples. Here, the reconstructed samples of the first candidate reference region can be divided into at least two groups of reconstructed samples, and then filter training is performed on the at least two groups of reconstructed samples respectively to obtain at least one candidate filter combination. The number of candidate filters included in the candidate filter combination is related to the number of groups of divided reconstructed samples. For example, if the reconstructed samples of the first candidate reference region are divided into two groups of reconstructed samples, then each candidate filter combination includes two candidate filters, and correspondingly, each candidate filter parameter combination includes two candidate filter parameters, such as a first filter parameter and a second filter parameter. In this way, according to the condition of one or more samples in the current block, the first filter parameter can be adaptively selected for prediction or the second filter parameter can be adaptively selected for prediction.

[0378] That is, in the embodiments of the present application, the candidate filter parameters calculated according to the reconstructed samples of the first candidate reference region can be only one candidate filter parameter, or can be a candidate filter parameter combination. In other words, here, only one candidate filter parameter can be used to act on the current block, or at least two candidate filter parameters can be used to simultaneously act on the current block, and no limitation is made in this regard.

[0379] In a possible implementation, dividing the reconstructed samples of the first candidate reference region to determine the at least two groups of reconstructed samples can include: determining a sample reference value corresponding to the first candidate reference region; when a first reconstructed sample in the first candidate reference region is greater than the sample reference value, dividing the first reconstructed sample into a first group of reconstructed samples in the at least two groups of reconstructed samples; and when the first reconstructed sample in the first candidate reference region is less than the sample reference value, dividing the first reconstructed sample into a second group of reconstructed samples in the at least two groups of reconstructed samples.

[0380] In the embodiments of the present application, the first reconstructed sample can be any reconstructed sample in the reference region. For the case where the first reconstructed sample in the first candidate reference region is equal to the sample reference value, if the first reconstructed sample in the first candidate reference region is equal to the sample reference value, the first reconstructed sample can be divided into the first group of reconstructed samples in the at least two groups of reconstructed samples, or the first reconstructed sample can be divided into the second group of reconstructed samples in the at least two groups of reconstructed samples, and no limitation is made in this regard.

[0381] In the embodiments of the present application, the sample reference value can include a sample mean or a sample median. The sample mean can be obtained by averaging the reconstructed samples in the first candidate reference region, and the sample median can be the sample in the middle position of the reconstructed samples in the first candidate reference region. In addition, the sample reference value can also be other sample values, such as a preset value, and the present application is not limited in this regard.

[0382] For example, if the sample reference value is the sample mean, when the first reconstructed sample in the first candidate reference region is greater than the sample mean, the first reconstructed sample is divided into the first group of reconstructed samples; and when the first reconstructed sample in the first candidate reference region is less than the sample mean, the first reconstructed sample is divided into the second group of reconstructed samples. Alternatively, if the sample reference value is the sample median, when the first reconstructed sample in the first candidate reference region is greater than the sample median, the first reconstructed sample is divided into the first group of reconstructed samples; and when the first reconstructed sample in the first candidate reference region is less than the sample median, the first reconstructed sample is divided into the second group of reconstructed samples. In this way, after obtaining at least one group of candidate filter parameter combinations, the samples in the current block can be predicted using multiple groups of filter parameters, thereby improving the prediction sample accuracy of the current block.

[0383] In another possible implementation, after determining the motion vector candidate list, all the candidate vector parameters in the motion vector candidate list can be used to determine a group of candidate filter parameters. Accordingly, the method can further include: determining the reference region indicated by each of the one or more candidate vector parameters according to the one or more candidate vector parameters in the motion vector candidate list; determining the candidate filter parameter corresponding to each of the one or more candidate vector parameters according to the reference region indicated by each of the one or more candidate vector parameters; and determining at least one group of candidate filter parameters of the current block according to the candidate filter parameter corresponding to each of the one or more candidate vector parameters.

[0384] In the embodiments of the present application, the candidate filter parameter corresponding to each of the one or more candidate vector parameters is determined according to the reference region indicated by each of the one or more candidate vector parameters. For example, in a specific embodiment, the method can further include: determining the reference region indicated by the current vector parameter; determining the training sample corresponding to at least one candidate filter according to the reconstructed samples of the reference region; and determining at least one group of candidate filter parameters corresponding to the current vector parameter by filter training according to the training sample corresponding to at least one candidate filter. The current vector parameter herein is any one of the one or more candidate vector parameters.

[0385] That is, in the embodiments of the present application, for one or more candidate vector parameters in the motion vector candidate list, each candidate vector parameter can determine a respective indicated reference region, and according to the reference region, a respective corresponding candidate filter parameter can be determined, i.e. at least one set of candidate filter parameters corresponding to each candidate vector parameter, and then all the obtained candidate filter parameters are taken as the candidate mode information in the first candidate list.

[0386] In yet another possible implementation, at least one set of candidate filter parameters of the current block is determined according to the at least one reference region, and the method can further include: determining a respective reference block corresponding to the at least one reference region; obtaining filter parameters of the reference block when the reference block uses the first intra prediction technology; and taking the filter parameters of the reference block as the set of candidate filter parameters of the current block.

[0387] In the embodiments of the present application, according to the obtained at least one reference region, a reference block corresponding to the current block can be obtained. If the reference block uses the EIP technology, the filter parameters of the reference block, such as the shape of the filter and the coefficients of the filter, can be obtained, and then the filter parameters of the reference block are taken as the set of candidate filter parameters of the current block.

[0388] It can be understood that after the at least one set of candidate filter parameters is determined, the first candidate list of the current block can be determined according to the at least one set of candidate filter parameters. In some embodiments, determining the first candidate list of the current block according to the at least one set of candidate filter parameters can include: determining a second candidate list of the current block; and determining the first candidate list of the current block according to the at least one set of candidate filter parameters and the second candidate list.

[0389] In the embodiments of the present application, if the current block uses the EIP technology and uses the EIP merge mode, the second candidate list of the current block can be determined first. The second candidate list can include at least one set of at least one set of candidate filter parameters, and the candidate filter parameters include the shape of the candidate filter and the coefficients of the candidate filter.

[0390] In some embodiments, determining the second candidate list of the current block can include: determining at least one set of second candidate filter parameters according to second reference information of the current block; and determining the second candidate list of the current block according to the at least one set of second candidate filter parameters.

[0391] In the embodiments of the present application, the second 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; and a second history list of the current block based on the first intra prediction technology.

[0392] Exemplarily, for determining the second candidate list of the current block, the specific operation process is as follows:

[0393] Firstly, the EIP merging mode acquires the EIP information of the adjacent blocks and the non-adjacent blocks on the current block empty domain, for example, the EIP information can include the shape of the filter and the coefficients of the filter, and adds the same to the second candidate list. For example, by searching the positions as shown in FIG. 3, the encoding blocks corresponding to the labels are checked in sequence to see whether the EIP technology is used, and if the EIP technology is used, the EIP information corresponding to the positions is acquired; and the acquired EIP information is checked with the EIP candidate filter parameters in the second candidate list, if the acquired EIP information is the same as a candidate in the second candidate list, the acquired EIP information is not added to the second candidate list, otherwise, the acquired EIP information is added to the second candidate list.

[0394] Secondly, the EIP merging mode checks whether the time domain information can be used, if the condition is met, the EIP information of the same position block in the reference image and the EIP information of the same position block of the offset motion vector are acquired. The same checking operation is performed, if the acquired EIP information does not appear in the second candidate list, the acquired EIP information is added to the second candidate list. Here, the reference image can be the same position image acquired from the reference list 0, and / or, can be the same position image acquired from the reference list 1.

[0395] Finally, the EIP merging mode acquires the EIP information in the second history list (i.e., the EIP history list). The second history list is constructed according to the same rule in the encoding process, and the second history list only saves the EIP information. The EIP merging mode acquires the latest EIP information in the second history list, and performs the checking operation, if there is no same, the EIP information is added to the second candidate list. Here, after the EIP prediction of the current block is completed, the corresponding EIP information needs to be saved in the second history list, if the second history list is filled, the second history list is updated according to the first-in-first-out principle, and the candidate added to the second history list at the earliest time is removed, so as to keep the update of the second history list.

[0396] In this way, after the second candidate list of the EIP merging mode is constructed, at least one set of candidate filter parameters can be added to the second candidate list to determine the first candidate list of the current block.

[0397] In some embodiments, determining the first candidate list of the current block according to the at least one set of candidate filtering parameters and the second candidate list can comprise: updating the second candidate list based on the at least one set of candidate filtering parameters to obtain an updated candidate list; performing cost calculation on a template region of the current block respectively according to the at least one set of candidate filtering parameters in the updated candidate list to determine a respective cost result of the at least one set of candidate filtering parameters in the updated candidate list; and sorting the at least one set of candidate filtering parameters in the updated candidate list according to the cost results to determine the first candidate list of the current block.

[0398] In the embodiments of the present application, the second candidate list is updated based on the at least one set of candidate filtering parameters, specifically, the at least one set of candidate filtering parameters is added to the second candidate list, and a duplicate checking operation is also required in this process. In some embodiments, updating the second candidate list based on the at least one set of candidate filtering parameters can comprise: adding the first candidate filtering parameter to the second candidate list when the first candidate filtering parameter does not exist in the second candidate list; and skipping the step of adding the first candidate filtering parameter to the second candidate list when the first candidate filtering parameter exists in the second candidate list; wherein the first candidate filtering parameter is any one of the at least one set of candidate filtering parameters.

[0399] That is, in the embodiments of the present application, if the first candidate filtering parameter has appeared in the second candidate list, the first candidate filtering parameter can be skipped, i.e., the first candidate filtering parameter is not added to the second candidate list; if the first candidate filtering parameter has not appeared in the second candidate list, the first candidate filtering parameter can be added to the second candidate list to update the second candidate list.

[0400] Further, for the obtained updated candidate list, the at least one set of candidate filtering parameters in the updated candidate list can also be used to predict a template region using the reconstructed samples adjacent to the current block as the template region to obtain template region prediction samples corresponding to each set of candidate filtering parameters, and the cost value (such as SAD cost value or SATD cost value, etc.) between the template prediction samples and the template reconstructed samples is calculated, and then the updated candidate list is sorted according to the cost value to obtain a sorted candidate list, and the sorted candidate list is determined as the first candidate list of the current block.

[0401] It should be noted that in the embodiments of the present application, the updated candidate list usually stores at most 12 sets of candidate filtering parameters, and the first candidate list can include at least part of the candidate filtering parameters in the updated candidate list. For example, after the 12 sets of candidate filtering parameters in the updated candidate list are sorted from small to large according to the template cost, only the first 6 sets of candidate filtering parameters after sorting can be selected to form the first candidate list of the current block, but this is not limited.

[0402] It should be further noted that in the embodiments of the present application, the obtained at least one set of candidate filter parameters can be updated into the first candidate list, and similarly, the aforementioned obtained at least one set of candidate filter parameter combination can also be updated into the first candidate list. In this way, the first mode index in the bitstream can be used to indicate a set of candidate filter parameters in the first candidate list, or can also be used to indicate a set of candidate filter parameter combination (including at least two sets of candidate filter parameters) in the first candidate list, which is not limited here.

[0403] It should be further noted that in the embodiments of the present application, when the frame type of the current block is not Slice_I type, and the current block uses the merging mode of the first intra prediction technology, i.e., the current block uses the EIP prediction based on merging, then the first candidate list can be determined, and further the first cost result corresponding to each set of candidate in the first candidate list can be determined. In some embodiments, taking the first set of candidate mode information in the first candidate list as an example, determining the first cost result corresponding to each set of candidate mode information in the first candidate list can include: determining the first set of candidate filter parameters according to the first set of candidate mode information in the first candidate list; determining the first candidate prediction sample of the current block according to the first set of candidate filter parameters; and performing cost calculation according to the first candidate prediction sample of the current block and the original image sample of the current block to obtain the first cost result corresponding to the first set of candidate mode information. Wherein, the first set of candidate mode information is any one in the first candidate list.

[0404] In the embodiments of the present application, taking the first set of candidate mode information in the first candidate list as an example, the first set of candidate filter parameters is the candidate filter parameter determined according to the first set of candidate mode information, for example, the first set of candidate filter parameters can include the shape of the candidate filter and the coefficient of the candidate filter. That is, according to the shape of the candidate filter and the coefficient of the candidate filter in the first set of candidate filter parameters, the sample in the current block can be predicted to determine the first candidate prediction sample of the current block; and then according to the first candidate prediction sample of the current block and the original image sample, the cost calculation can be performed to obtain the first cost result corresponding to the first set of candidate filter parameters. Wherein, the cost calculation here can also be rate-distortion cost calculation, or can be SAD or SATD cost calculation, or even other cost calculation, such as SSE, MAD, MAE, MSE, etc., which is not limited.

[0405] Exemplarily, taking the rate-distortion cost calculation as an example, at least one set of candidate mode information in the first candidate list is traversed, and a rate-distortion cost result between candidate prediction samples of the current block obtained by each set of candidate mode information and original image samples is calculated, and 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 using the EIP merge mode.

[0406] S1603, when the current block does not use the merge mode of the first intra prediction technology, determining a third candidate list of the current block, and determining a second cost result corresponding to each of at least one set of candidate mode information in the third candidate list.

[0407] In the embodiments of the present application, step S1602 and step S1603 can be executed in parallel, or can be executed sequentially, or step S1603 can be executed first and then step S1602, which is not limited here.

[0408] It should be noted that in the embodiments of the present application, when the current block does not use the merge mode of the first intra prediction technology, that is, the current block uses the EIP prediction based on calculation, the third candidate list can be determined at this time. The third candidate list can include at least one set of candidate mode information, and the candidate mode information at this time includes the shape of the candidate template region and the candidate filter; and then the second cost result corresponding to each of at least one set of candidate mode information in the third candidate list is calculated.

[0409] It should be further noted that in the embodiments of the present application, for the determination of the third candidate list, the method can include: 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; and determining the third candidate list according to the shape of at least one candidate template region and at least one candidate filter.

[0410] In the embodiments of the present application, the candidate template region can include at least one of the following: an upper template region, and / or a left template region. The shape of the candidate filter can include at least one of the following: a square filter, a horizontal matrix filter, and a vertical rectangular filter.

[0411] In a specific embodiment, there are at most three shapes of candidate filters, such as a square filter, a horizontal matrix filter, and a vertical rectangular filter, which can be specifically referred to FIG. 1A, FIG. 1B, and FIG. 1C. There are at most three template regions of candidate template regions, such as only including an upper template region, or only including a left template region, or including both an upper template region and a left template region, which can be specifically referred to FIG. 2A, FIG. 2B, and FIG. 2C. In this way, the decoding end can obtain at most nine sets of candidate mode information by combining different candidate template regions and different shapes of filters, that is, the maximum length of the third candidate list is 9.

[0412] It should be further noted that, in the embodiments of the present application, the candidate mode information allowed to be used by the current block can be determined according to the width and height of the current block, and the candidate mode information allowed to be used by the current block is used to form the third candidate list.

[0413] Exemplarily, if the size of the current block is relatively small, for example, the current block is 4x4, at this time, the template region can only have one option, that is, simultaneously including the upper template region and the left template region, and when combined with the shapes of the three candidate filters, three groups of candidate mode information can be obtained, that is, the third candidate list only includes three groups of candidate mode information.

[0414] That is, in the embodiments of the present application, according to the width and height of the current block, the shape of the candidate filter can only select one, two or three shapes, and the candidate template region can also only select one, two or three template regions. In this way, according to the combination of at least one candidate template region and at least one shape of the candidate filter, the third candidate list of the current block can be obtained.

[0415] It can also be understood that, after the third candidate list is determined, 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 third candidate list as an example, the second cost result corresponding to each group of candidate mode information in the third candidate list is determined, and the method can include: determining the second group of candidate filter parameters according to the second group of candidate mode information in the third candidate list; determining the second candidate prediction sample of the current block according to the second group of candidate filter parameters; and performing cost calculation according to the second candidate prediction sample of the current block and the original image sample of the current block to obtain the second cost result corresponding to the second group of candidate mode information. Wherein, the second group of candidate mode information is any group in the third candidate list.

[0416] In the embodiments of the present application, the second group of candidate filter parameters is the candidate filter parameter determined according to the second group of candidate mode information, for example, the second group of candidate filter parameters can include the shape of the candidate filter and the coefficient of the candidate filter. That is, according to the shape of the candidate filter and the coefficient of the candidate filter in the second group of candidate filter parameters, the sample in the current block can be predicted to determine the second candidate prediction sample of the current block; and then, according to the second candidate prediction sample of the current block and the original image sample, the cost calculation can be performed to obtain the second cost result corresponding to the second group of candidate filter parameters. Wherein, the cost calculation here can be rate-distortion cost calculation, or can also be SAD or SATD cost calculation, or even other cost calculation, such as SSE, MAD, MAE, MSE, etc., which are not limited in any way.

[0417] Exemplarily, taking the rate-distortion cost calculation as an example, at least one set of candidate mode information in the third candidate list is traversed, and a rate-distortion cost result between candidate prediction samples of the current block obtained by each set of candidate mode information and original image samples 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 not using the EIP merge mode.

[0418] S1604, determining a value of the first syntax element according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology.

[0419] S1605, performing encoding processing on the value of the first syntax element, and writing the obtained encoded bits into a bitstream.

[0420] In the embodiments of the present application, the first cost result and the second cost result can be used to determine whether the current block uses the merge mode of the first intra prediction technology. In some embodiments, the method can include: if the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, it can be determined that the current block uses the merge mode of the first intra prediction technology; and 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 does not use the merge mode of the first intra prediction technology.

[0421] It should be further noted that in the embodiments of the present 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 at this time can select to use the merge mode of the first intra prediction technology, or can also select not to use the merge mode of the first intra prediction technology.

[0422] In some embodiments, for determining the value of the first syntax element, the method can include: if the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, determining that the value of the first syntax element is a first value; and if the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, determining that the value of the first syntax element is a second value.

[0423] In the embodiments of the present application, the merge mode of the first intra prediction technology is referred to as an EIP merge mode, and the first syntax element can be referred to as an eip_merge flag. In this case, the first syntax element can be represented as eip_merge. That is, if the minimum cost result in the first cost results is smaller than the minimum cost result in the second cost results, i.e., the current block uses the EIP merge mode, the value of eip_merge can be determined as the first value; if the minimum cost result in the first cost results is larger than the minimum cost result in the second cost results, i.e., the current block does not use the EIP merge mode, the value of eip_merge can be determined as the second value.

[0424] In some embodiments, referring to FIG. 17, after step S1603, the method can further include:

[0425] S1701, when the current block uses intra prediction and the current block satisfies a preset condition, determining a third cost result corresponding to other prediction technologies than the first intra prediction technology.

[0426] In the embodiments of the present application, the encoding end can also traverse other prediction technologies than the first intra prediction technology, and perform cost calculation on the third candidate prediction samples obtained by predicting the samples in the current block according to the other prediction technologies and the original image samples, to obtain the third cost result corresponding to the other prediction technologies. For example, rate-distortion cost calculation is performed on the third candidate prediction samples and the original image samples, to obtain the corresponding rate-distortion cost result. In this case, the minimum rate-distortion cost result is the minimum cost result in the third cost result.

[0427] It should be noted that in the embodiments of the present application, step S1602, step S1603 and step S1701 can be executed in parallel, or can be executed sequentially, or step S1603 can be executed first, and then step S1602 and step S1701 can be executed, and the like, which is not limited herein.

[0428] S1702, determining the value of a third syntax element according to the first cost result, the second cost result and the third cost result, wherein the third syntax element is used to indicate whether the current block uses the first intra prediction technology.

[0429] S1703, performing encoding processing on the value of the third syntax element, and writing the obtained encoded bits into a bitstream.

[0430] In the embodiments of the present 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 prediction technology. In some embodiments, the method can comprise: 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, it can be determined that the current block uses the first intra prediction technology; 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, it can be determined that the current block does not use the first intra prediction technology.

[0431] It should be noted that in the embodiments of the present application, if the minimum cost result in the first cost result and the second cost result is equal to the minimum cost result in the third cost result, the current block can choose to use the first intra prediction technology or can choose not to use the first intra prediction technology.

[0432] In some embodiments, for determining the value of the third syntax element, the method can comprise: 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 that the value of the third syntax element is 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 that the value of the third syntax element is a second value. In addition, if the minimum cost result in the first cost result and the second cost result is equal to the minimum cost result in the third cost result, the value of the third syntax element can be the first value or the second value, which is not specifically limited here.

[0433] In the embodiments of the present application, the first intra prediction technology can be the EIP technology, so the third syntax element can also be referred to as the EIP use identification bit, and the third syntax element can be represented by eip_flag at this time. That is, 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, i.e. the current block uses the EIP technology, it can be determined that the value of eip_flag is the 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, i.e. the current block does not use the EIP technology, it can be determined that the value of eip_flag is the second value.

[0434] It should be further explained that, in the embodiments of the present application, according to 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, it is determined that the current block does not use the first intra prediction technology, i.e., the current block does not use the EIP technology; if the minimum cost result in the first cost result is the minimum value among the three, it is determined that the current block uses the first intra prediction technology and uses the merge mode of the first intra prediction technology, i.e., the current block uses the EIP technology and uses the EIP merge mode; if the minimum cost result in the second cost result is the minimum value among the three, it is determined that the current block uses the first intra prediction technology and does not use the merge mode of the first intra prediction technology, i.e., the current block uses the EIP technology and does not use the EIP merge mode.

[0435] It can be understood that, in the embodiments of the present application, when the current block uses the EIP technology, the value of eip_merge needs to be written into the code stream, and the optimal mode index also needs to be determined and written into the code stream.

[0436] In some embodiments, when the current block uses the EIP technology and uses the EIP merge mode, the method can further include: when the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, determining the first candidate mode information corresponding to the minimum cost result in the first cost result; determining the first mode index of the current block according to the index sequence number of the first candidate mode information in the first candidate list; and performing encoding processing on the first mode index of the current block, and writing the obtained encoding bits into the code stream.

[0437] In the embodiments of the present application, if the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, i.e., the current block uses the EIP technology and uses the EIP merge mode, i.e., the EIP prediction based on merging, then the first candidate mode information corresponding to the minimum cost result in the first cost result can be determined, the index sequence number of the first candidate mode information in the first candidate list is determined as the optimal mode index, i.e., the first mode index of the current block using the EIP technology; and the first mode index of the current block is performed encoding processing, and the obtained encoding bits are written into the code stream.

[0438] In this way, in the embodiments of the present application, after obtaining the first candidate mode information corresponding to the minimum cost result in the first cost result, the method can further include: when the current block uses the first intra prediction technology and uses the merge mode of the first intra prediction technology, directly determining the filtering parameter of the current block according to the first candidate mode information; and predicting the samples in the current block according to the filtering parameter of the current block to determine the prediction samples of the current block.

[0439] That is, in the embodiments of the present application, the current block uses the EIP prediction based on merging, after obtaining the first candidate mode information, the filter parameters of the current block, such as the shape of the filter and the coefficients of the filter, can be directly determined according to the first candidate mode information; then the samples in the current block are predicted according to the shape of the filter and the coefficients of the filter, to determine the prediction samples of the current block, as shown in the foregoing formula (4).

[0440] In some embodiments, when the current block uses the EIP technology and does not use the EIP merging mode, the method can further include: when the minimum cost result in the first cost results is greater than the minimum cost result in the second cost results, determining the second candidate mode information corresponding to the minimum cost result in the second cost results; determining the second mode index of the current block according to the index sequence number of the second candidate mode information in the third candidate list; and performing encoding processing on the second mode index of the current block, and writing the obtained encoding bits into the bitstream.

[0441] In the embodiments of the present application, if the minimum cost result in the first cost results is greater than the minimum cost result in the second cost results, that is, the current block uses the EIP technology and does not use the EIP merging mode, that is, the EIP prediction based on calculation, then the second candidate mode information corresponding to the minimum cost result in the second cost results can be determined, the index sequence number of the second candidate mode information in the third candidate list is determined as the optimal mode index, that is, the second mode index of the current block using the EIP technology; and the second mode index of the current block is encoded, and the obtained encoding bits are written into the bitstream.

[0442] In this way, in the embodiments of the present application, after obtaining the second candidate mode information corresponding to the minimum cost result in the second cost results, the method can further include: when the current block uses the first intra prediction technology and the current block does not use the merging mode of the first intra prediction technology, determining the filter parameters of the current block according to the second candidate mode information corresponding to the minimum cost result in the second cost results; and predicting the samples in the current block according to the filter parameters of the current block, to determine the prediction samples of the current block.

[0443] That is, in the embodiments of the present application, the second candidate mode information can include the shape of the filter and the template region, and the filter parameters of the current block can include the shape of the filter and the coefficients of the filter. In this way, the current block uses the EIP prediction based on calculation, after obtaining the second candidate mode information, the coefficients of the filter can be determined according to the input samples and the output samples in the template region; then the samples in the current block are predicted according to the shape of the filter and the coefficients of the filter, to determine the prediction samples of the current block, as shown in the foregoing formula (4).

[0444] It can also be understood that, before determining whether the current block uses the first intra prediction technology, it is also necessary to determine whether the current sequence allows the first intra prediction technology to be used and to determine the prediction type of the current block. In the embodiments of the present application, a fifth syntax element can be used to indicate whether the current sequence allows the first intra prediction technology to be used; a second syntax element can be used to indicate the prediction type of the current block. The prediction type includes intra prediction or inter prediction.

[0445] In the embodiments of the present application, the current block is included in the current sequence. The fifth syntax element is a sequence-level syntax element, and the first syntax element, the second syntax element and the third syntax element are all block-level (CU-level or PU-level) syntax elements.

[0446] In some embodiments, the method can further include: determining the value of the fifth syntax element; and encoding the value of the fifth syntax element, and writing the obtained coded bits into the bitstream.

[0447] In a possible implementation, for determining the value of the fifth syntax element, it can include: when the current sequence allows the first intra prediction technology to be used, determining that the value of the fifth syntax element is a first value; and when the current sequence does not allow the first intra prediction technology to be used, determining that the value of the fifth syntax element is a second value.

[0448] In the embodiments of the present application, the third syntax element can be referred to as an EIP use permission identification bit, and the fifth syntax element can be represented as sps_eip_enable_flag at this time. That is, if the current sequence allows the EIP technology to be used, it is determined that the value of sps_eip_enable_flag is a first value; and if the current sequence does not allow the EIP technology to be used, it is determined that the value of sps_eip_enable_flag is a second value.

[0449] In some embodiments, the method can further include: determining the value of the second syntax element; and encoding the value of the second syntax element, and writing the obtained coded bits into the bitstream.

[0450] In a possible implementation, for determining the value of the second syntax element, it can include: when the current block uses intra prediction, determining that the value of the second syntax element is a first value; and when the current block uses inter prediction, determining that the value of the second syntax element is a second value.

[0451] In the embodiments of the present application, the second syntax element can be referred to as a prediction type identification bit. That is, if the prediction type of the current block is intra prediction, it is determined that the value of the second syntax element is a first value; and if the prediction type of the current block is inter prediction, it is determined that the value of the second syntax element is a second value.

[0452] In the embodiments of the present application, the first value is different from the second value, and the first value and the second value can be in the form of a parameter or in the form of a number. For example, the syntax element herein can be a parameter written in a profile or a value of an identification flag, and no limitation is made herein.

[0453] For example, the first value can be set as 1, and the second value can be set as 0; or the first value can be set as 0, and the second value can be set as 1; or the first value can be set as true, and the second value can be set as false; or the first value can be set as false, and the second value can be set as true; but no limitation is made herein.

[0454] In the embodiments of the present application, the encoding end first encodes the value of the fifth syntax element, and writes the obtained encoding bits into a bitstream. When the first intra prediction technology is allowed to be used in the current sequence, the encoding end further encodes the value of the second syntax element, and writes the obtained encoding bits into the bitstream. When the prediction type of the current block is intra prediction and the current block satisfies a preset condition, the encoding end further encodes the value of the third syntax element, and writes the obtained encoding bits into the bitstream. When the EIP technology is used in the current block, the encoding end further encodes the value of the first syntax element and the corresponding mode index (for example, the first mode index and the second mode index), and writes the obtained encoding bits into the bitstream.

[0455] It can be understood that in the embodiments of the present application, the filtering parameter of the current block can include the shape of the filter and the coefficient of the filter. Accordingly, in some embodiments, determining the filtering parameter of the current block according to the mode information can include: determining the shape of the filter and the template region of the current block according to the mode information; determining the input sample and the output sample of the filter according to the template region of the current block; and determining the coefficient of the filter according to the input sample and the output sample of the filter.

[0456] It should be noted that the coefficient of the filter can also be referred to as "filter coefficient" or "filtering coefficient". Here, since the mode information includes the template region and the shape of the filter, the input sample and the output sample of the filter can be determined according to the template region, and then the coefficient of the filter can be obtained by calculation according to the input sample and the output sample of the filter.

[0457] Thus, in the embodiments of the present application, after the third candidate list of the current block is determined, the mode information of the current block can be determined according to the third candidate list and the second mode index in the code stream, and at this time, the filter parameters of the current block, such as the shape of the filter and the coefficients of the filter, can be further determined according to the determined mode information. Thus, the prediction samples of the current block can be obtained by performing prediction on the samples in the current block according to the shape of the filter and the coefficients of the filter, as shown in the above formula (5).

[0458] It can also be understood that, in the embodiments of the present application, if the current block uses the merge mode of the first intra prediction technology, but the frame type of the current block does not satisfy the preset type condition, the EIP prediction of the related technology can be performed on the current block. In some embodiments, the method can further include: determining the second candidate list of the current block when the current block uses the merge mode of the first intra prediction technology and the frame type of the current block does not satisfy the preset type condition; determining the filter parameters of the current block according to the second candidate list and the first mode index; and determining the prediction samples of the current block according to the filter parameters.

[0459] In the embodiments of the present application, if the current block uses the EIP merge mode and the frame type of the current block does not satisfy the preset type condition, for example, the frame type of the current block is Slice_I type; at this time, the EIP prediction method of the related technology can be used for the current block, and at least one reference region of the current block and at least one set of candidate filter parameters derived according to the at least one reference region as the candidate mode information of the current block are no longer determined, but the second candidate list of the current block is directly used to determine the filter parameters of the current block.

[0460] In the embodiments of the present application, the second candidate list is constructed based on the EIP prediction of the related technology. Wherein, determining the second candidate list of the current block can include: determining at least one set of second candidate filter parameters according to the second reference information of the current block; and determining the second candidate list of the current block according to the at least one set of second candidate filter parameters.

[0461] In the embodiments of the present application, the second reference information of the current block includes at least one of the following: whether the neighboring block of the current block uses the first intra prediction technology; whether the non-neighboring block of the current block uses the first intra prediction technology; whether the temporal collocated block of the current block uses the first intra prediction technology; and the second history list of the current block based on the first intra prediction technology.

[0462] Exemplarily, for determining the second candidate list of the current block, the specific operation process is as follows:

[0463] Firstly, the EIP merge mode acquires EIP information of neighboring blocks and non-neighboring blocks on the current block empty domain, for example, the EIP information can include the shape of the filter and the coefficients of the filter, and is added to the second candidate list. For example, by searching the positions as shown in FIG. 3, whether the coding blocks corresponding to the labels use the EIP technology is checked in turn, if the EIP technology is used, the EIP information corresponding to the positions is acquired; and the acquired EIP information is checked with the EIP candidate filter parameters in the second candidate list, if the acquired EIP information is the same as a candidate in the second candidate list, the EIP information is not added to the second candidate list, otherwise, the EIP information is added to the second candidate list.

[0464] Secondly, the EIP merge mode checks whether the time domain information can be used, if the condition is met, the EIP information of the same position block in the reference image and the EIP information of the same position block of the offset motion vector are acquired. The same checking operation is performed, if the acquired EIP information does not appear in the second candidate list, the EIP information is added to the second candidate list. Here, the reference image can be the same position image acquired from the reference list 0, and / or, can be the same position image acquired from the reference list 1.

[0465] Finally, the EIP merge mode acquires the EIP information in the second history list (i.e. the EIP history list). The second history list is constructed according to the same rule in the encoding process, and the second history list only saves the EIP information. The EIP merge mode acquires the latest EIP information in the second history list, and performs the checking, if there is no same, the EIP information is added to the second candidate list. Here, after the EIP prediction of the current block is completed, the corresponding EIP information needs to be saved in the second history list, if the second history list is full, the second history list is updated according to the first-in-first-out principle, and the candidate added to the second history list at the earliest is removed, so as to keep the update of the second history list.

[0466] In this way, after the second candidate list of the EIP merge mode is constructed, the mode information of the current block can be determined according to the second candidate list and the first mode index about the current block using the EIP technology in the code stream, at this time, the determined mode information is directly determined as the filter parameter of the current block, that is, the EIP information corresponding to the first mode index in the second candidate list, for example, can include the shape of the filter and the coefficients of the filter. In this way, the samples in the current block are predicted according to the shape of the filter and the coefficients of the filter, and the prediction samples of the current block are determined.

[0467] It should be noted that in the embodiments of the present application, the first mode index and the second mode index are two index numbers written in the code stream when the EIP technology is used for the current block. Here, the first mode index and the second mode index can be represented by the same syntax element in the code stream, or can be represented by different syntax elements. When the first mode index and the second mode index are represented by the same syntax element, the first mode index and the second mode index are used to represent different values of the syntax element corresponding to different modes used by the current block. For example, in the case of using the EIP technology for the current block, if the EIP merge mode is used for the current block, the first mode index is used to indicate the corresponding index number in the first candidate list or the second candidate list; if the EIP merge mode is not used for the current block, the second mode index is used to indicate the corresponding index number in the third candidate list.

[0468] It can also be understood that in the embodiments of the present application, the extrapolation filter (i.e., the EIP filter) can be applied to the inter prediction mode. If the image in which the current block is located is a non-intra coded image, and the current prediction mode is an inter prediction mode, the same as other extended inter merge prediction modes, at this time, a MergeMVP list belonging to the EIP technology can also be established, and the related parameters of the EIP filter are the same as those in the technical solutions in the foregoing embodiments. Hereinafter, this can be referred to as interEIP.

[0469] In some embodiments, the method can further include: when the current block uses inter prediction and the current block uses the merge mode of the first inter prediction technology, determining a motion vector candidate list; determining one or more candidate prediction blocks corresponding to each of the one or more candidate vector parameters in the motion vector candidate list; determining a cost result corresponding to each of the one or more candidate vector parameters according to the cost calculation of the one or more candidate prediction blocks corresponding to each of the one or more candidate vector parameters and the current block respectively; determining a minimum cost result from the cost results corresponding to each of the one or more candidate vector parameters, and determining the candidate vector parameter corresponding to the minimum cost result as a third vector parameter; determining a merge index of the third vector parameter in the motion vector candidate list; and performing encoding processing on the merge index, and writing the obtained encoding bits into the code stream.

[0470] It should be noted that in the embodiments of the present application, a fourth syntax element can also be set, which is used to indicate whether the current block uses the merge mode of the first inter prediction technology. In some embodiments, the method can further include: when the current block uses inter prediction, determining the value of the fourth syntax element; and performing encoding processing on the value of the fourth syntax element, and writing the obtained encoding bits into the code stream.

[0471] It should be noted that in the embodiments of the present application, the fourth syntax element is used to indicate whether the current block uses the merge mode of the first inter prediction technology, the merge mode of the first inter prediction technology refers to the inter EIP merge mode, and therefore the fourth syntax element can be referred to as the inter_EIP_merge flag, which can be represented by inter_EIP_merge.

[0472] In some embodiments, the method can further include: determining that the fourth syntax element has the first value if the current block uses the merge mode of the first inter prediction technology; and determining that the fourth syntax element has the second value if the current block does not use the merge mode of the first inter prediction technology.

[0473] That is, in the embodiments of the present application, when the current block uses inter prediction, if the current block uses the inter EIP merge mode, which can be represented by inter_EIP_merge, the first value of inter_EIP_merge can be written in the code stream, and then it can be determined that the current block uses the inter EIP merge mode; if the current block does not use the inter EIP merge mode, the second value of inter_EIP_merge can be written in the code stream, and then it can be determined that the current block does not use the inter EIP merge mode.

[0474] It should be noted that in the embodiments of the present application, the first value is different from the second value, and the first value and the second value can be in the form of a parameter or in the form of a number. For example, the syntax element herein can be a parameter written in a profile, or a value of a flag, which is not limited herein.

[0475] For example, the first value can be set as 1, and the second value can be set as 0; or the first value can be set as 0, and the second value can be set as 1; or the first value can be set as true, and the second value can be set as false; or the first value can be set as false, and the second value can be set as true; but this is not limited.

[0476] It is also to be noted that, in the embodiments of the present application, when the current block uses the inter-EIP merge mode, the corresponding merge index needs to be written in the code stream. The merge index can be denoted as EIP_merge_index, and the merge index can be used to indicate the index number of the third vector parameter in the motion vector candidate list. In this way, according to the motion vector candidate list constructed according to the foregoing embodiments, the third vector parameter can be determined by combining the EIP_merge_index in the code stream at the decoding end. Then, the third reference region of the current block is determined according to the third vector parameter, and at least one set of candidate filter parameters of the current block can be determined according to the third reference region. The filter parameters of the current block are determined based on the at least one set of candidate filter parameters, and the filter parameters are applied to the current block for prediction, so that the prediction samples of the current block can be obtained.

[0477] It is also to be noted that, in the embodiments of the present application, at least one set of candidate filter parameters of the current block is determined according to the third reference region. The candidate filter parameters can include the shape of the candidate filter and the coefficients of the candidate filter. Since the shape of the candidate filter can be various, such as a square filter, a horizontal matrix filter and a vertical rectangular filter, at least one set of filter coefficients can be calculated according to the third reference region and the shape of at least one filter, so as to obtain at least one set of candidate filter parameters.

[0478] Then, the filter parameters of the current block are determined according to the at least one set of candidate filter parameters. The filter parameters of the current block can be determined by predicting the template region of the current block by using the at least one set of candidate filter parameters, determining the template region prediction block corresponding to each set of candidate filter parameters, calculating the cost (such as SAD or SATD cost) between the template region prediction block corresponding to each set of candidate filter parameters and the template reconstructed block, and determining the set of candidate filter parameters corresponding to the minimum cost as the filter parameters of the current block.

[0479] That is, in the inter prediction mode, if the prediction mode of the current block is the Merge mode, and the Merge_flag of the current block is true and the regular_merge is false, the fourth syntax element inter_EIP_merge identification bit needs to be encoded. If the inter_EIP_merge identification bit is true, the EIP_merge_index needs to be continuously encoded. The candidate MV (i.e., the third vector parameter) in the motion vector candidate list is obtained according to the EIP_merge_index. The reference region in the reference image is obtained according to the candidate MV, so as to determine the EIP filter parameters. Then, the determined filter parameters are applied to the current block, so that the prediction samples of the current block can be obtained.

[0480] In some embodiments, the method can further include: when the current block uses inter prediction and the current block uses a merge mode of the first inter prediction technique, determining a fourth candidate list according to the motion vector candidate list; wherein the fourth candidate list includes at least one set of candidate filter parameters; performing encoding cost calculation on the current block respectively according to the at least one set of candidate filter parameters, determining a cost result corresponding to each of the at least one set of candidate filter parameters; determining a minimum cost result from the cost results corresponding to the at least one set of candidate filter parameters, and determining a candidate filter parameter corresponding to the minimum cost result as the filter parameter of the current block; determining a merge index of the filter parameter of the current block in the fourth candidate list; and performing encoding processing on the merge index, and writing the obtained encoding bits into the bitstream.

[0481] In a possible implementation, determining the fourth candidate list according to the motion vector candidate list can include: determining at least one set of candidate filter parameters corresponding to each of one or more candidate vector parameters in the motion vector candidate list; determining a fifth candidate list according to the at least one set of candidate filter parameters corresponding to each of the one or more candidate vector parameters; performing cost calculation on a template region of the current block respectively according to one or more sets of candidate filter parameters in the fifth candidate list, and determining a cost result corresponding to each of the one or more sets of candidate filter parameters in the fifth candidate list; and sorting the one or more sets of candidate filter parameters in the fifth candidate list according to the cost results, and determining the fourth candidate list.

[0482] In the embodiments of the present application, in the process of determining the fifth candidate list, for one or more candidate vector parameters in the motion vector candidate list, if a first candidate vector parameter in the motion vector candidate list can train three sets of candidate filter parameters, the three sets of candidate filter parameters can be updated to the first three positions in the fifth candidate list; if a second candidate vector parameter in the motion vector candidate list can train three sets of candidate filter parameters, the three sets of candidate filter parameters can be updated to the fourth to sixth positions in the fifth candidate list; and so on, and three sets of candidate filter parameters corresponding to each of the one or more candidate vector parameters in the motion vector candidate list can be sequentially updated to the fifth candidate list.

[0483] In some embodiments, considering that there are too many candidate filter parameters in the fifth candidate list, at least part of the candidate filter parameters can be selected to form the fourth candidate list. In some embodiments, the method can further include: after sorting the one or more sets of candidate filter parameters in the fifth candidate list according to the cost results, determining M sets of candidate filter parameters at the front of the sorting as the fourth candidate list; wherein M is a positive integer.

[0484] In the embodiments of the present application, the one or more groups of candidate filter parameters in the fifth candidate list can be ranked according to the cost results, and then the ranked fifth candidate list is determined as the fourth candidate list, or the top M groups of candidate filter parameters are determined as the fourth candidate list, that is, the fifth candidate list is truncated to a preset length to obtain the fourth candidate list.

[0485] It should be further noted that, in the embodiments of the present application, the motion vector candidate list includes one or more candidate vector parameters, and the fourth candidate list includes one or more groups of candidate filter parameters. The merge index here refers to the index sequence number of the filter parameter of the current block in the fourth candidate list. In this way, after the fourth candidate list is determined, the filter parameter of the current block can be directly obtained at the decoding end according to the fourth candidate list and the merge index written in the code stream.

[0486] That is, in the embodiments of the present application, after the inter-frame EIP MergeMVP list (i.e., the motion vector candidate list) is obtained, the EIP filter shape acting on the current block can be allowed to be determined according to the size and shape of the current block. For example, if the current block is a 16x16 square coding block, three EIP filter shapes can be allowed, and the EIP MergeMVP list is updated. Specifically, after the first candidate MV of the EIP MergeMVP list obtains the training sample, the candidate filter parameters of the three EIP shapes are trained, and are updated to the first three positions of the new EIP MergeMVP list; in this way, after the second candidate MV of the original EIP MergeMVP list obtains the training sample, the candidate filter parameters of the three EIP shapes are trained, and are updated to the fourth to sixth positions of the EIP MergeMVP list to obtain the fifth candidate list.

[0487] It should be further noted that the updated EIP MergeMVP list can be reordered according to the template error. In one possible implementation, the reordered EIP MergeMVP list can be truncated to a list of a specific length (for example, only the top M groups of candidate filter parameters are retained), to save the transmission of code words.

[0488] In some embodiments, the method can further include: determining a first prediction sample of the current block according to the third vector parameter; determining a second prediction sample of the current block according to the filter parameter; and determining a prediction sample of the current block by weighted calculation according to the first prediction sample and the second prediction sample.

[0489] That is, in the embodiments of the present application, after the prediction block of the current block is obtained according to the interEIP, the final prediction block of the current block can be obtained by weighted average of the inter prediction block obtained according to the original candidate MV. The weight value of the weighted prediction can be a preset value, or can be obtained by other ways such as SATD or SAD ratio calculation, which is not limited here.

[0490] It can also be understood that, in the embodiments of the present application, for the MV-EIP or interEIP proposed in the foregoing embodiments, the EIP candidate usually has only one filter to predict the current block. In a possible implementation, the EIP candidate can also have multiple filters, and the training process divides the training samples into two groups according to the size relationship with the sample mean (alpha), and trains a separate filter for each group of samples to form an EIP candidate. When applied to the current block, if the EIP candidate contains two filters, the sample mean (alpha) stored in the EIP candidate is obtained, and according to the size relationship between the mean (beta) of the input samples corresponding to the current sample and alpha, the corresponding filter is selected to predict the current sample. Wherein, the calculation of beta can be the mean of several input samples in the grid part of the filter shown in FIG. 1A-1C, which is not limited.

[0491] Further, the present application also provides a code stream, which is generated by bit coding according to the encoding method; wherein the to-be-encoded information 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, the value of the fifth syntax element, the first mode index of the current block, the second mode index of the current block and the second vector parameter.

[0492] In the embodiments of the present application, the fifth syntax element can be used to indicate whether the first intra prediction technology is allowed to be used in the current sequence, the second syntax element can be used to indicate the prediction type of the current block, the third syntax element is used to indicate whether the first intra prediction technology is used in the current block, the first syntax element is used to indicate whether the merge mode of the first intra prediction technology is used in the current block, and the fourth syntax element is used to indicate whether the merge mode of the first inter prediction technology is used in the current block.

[0493] In the embodiments of the present application, the prediction type can include intra prediction or inter prediction. By encoding these to-be-encoded information, the obtained encoding bits are written into the code stream, and then transmitted from the encoding end to the decoding end through the code stream, so that the information such as whether the first intra prediction technology is used and whether the merge mode of the first intra prediction technology is used in the current block can be determined by parsing the code stream at the decoding end.

[0494] The embodiment of the present application provides a coding method, determines the frame type of a current block; in the case that the frame type of the current block meets preset type conditions, when the current block uses a merge mode of a first intra prediction technology, at least one reference region of the current block is determined, at least one set of candidate filter parameters of the current block is determined according to the at least one reference region, a first candidate list of the current block is determined according to the at least one set of candidate filter parameters, and at least one set of candidate mode information in the first candidate list is determined to correspond to a first cost result respectively; when the current block does not use the merge mode of the first intra prediction technology, a third candidate list of the current block is determined, and at least one set of candidate mode information in the third candidate list is determined to correspond to a second cost result respectively; the value of a first syntax element is determined according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology; the value of the first syntax element is subjected to coding processing, and the obtained coding bits are written into a bitstream. In this way, when the frame type of the current block meets preset type conditions and the current block uses the merge mode of the first intra prediction technology, at least one set of candidate filter parameters of the current block is determined according to at least one reference region, and then the at least one set of candidate filter parameters is used as candidate mode information in the first candidate list, thereby expanding the candidate range in the first candidate list; the filter parameter determined according to the first candidate list has good generalization ability, so that the filter parameter can be better applied to sample prediction in the current block; and prediction is further performed according to the determined filter parameter (for example, the coefficient of the filter and the shape of the filter), which can improve the prediction sample accuracy of the current block, thereby improving the compression efficiency and further improving the coding performance.

[0495] In another embodiment of the present application, based on the coding method described in the foregoing embodiment, the technical scheme of the embodiment of the present application is mainly as follows: a reference block similar to the current block is found, and the related region of the reference block is used to train the coefficients of the allowed extrapolation filter of the current block, and the filter parameters of the trained extrapolation filter are applied to the current block (such as a "current coding unit") to obtain the prediction sample of the current block. This technical scheme can be called MV-EIP.

[0496] In a possible implementation manner, the manner of obtaining the reference region includes:

[0497] (a) the reference region based on the same block:

[0498] As mentioned above, the N nearest neighboring collocated picture information can be used in the current picture to train the EIP filter coefficients for the current block. The training samples for the EIP filter coefficients of the current block can be obtained from the collocated block in the collocated picture and its surrounding samples. As shown in FIG. 5, the curr_CU in the current picture is the current block, and the col_CU in the col_pic is the collocated block. The MV-EIP can obtain the samples in the col_CU to train the EIP filter coefficients, or can obtain the samples in the col_CU and its surrounding samples to form a larger reference region, and use more samples to train the EIP filter coefficients. As shown in FIG. 11, the reference region is used to train the EIP filter coefficients, and thus the reference region can also be referred to as a "training region".

[0499] Similarly, the collocated picture can also be replaced by any reference picture of the current picture. In this case, the reference block of the current block is searched in the reference picture, and then the reference block of the same size as the current block is used as the reference region, or the reference block and its surrounding reference samples can be used to form the reference region of the current block, which is not limited here.

[0500] (b) Motion vector of the reference region based on the merge mode:

[0501] The motion vector used to obtain the reference region can be obtained by the merge mode (Merge). The process of obtaining the motion vector is similar to the rules and order described in related technologies, and is not described here in detail. The obtained Merge list can be sorted by the distortion cost of the template region. The samples of the template region around the reference block can be obtained according to each candidate MVP, and the samples are used to calculate the distortion cost of each candidate MVP by SAD or SATD. The sorted Merge list is obtained by sorting from small to large.

[0502] The first candidate MVP of the sorted Merge list can be used by the MV-EIP to obtain the reference region samples in the reference picture, and to train the EIP filter coefficients used by the current block. The MV-EIP can also obtain all the samples in the N reference regions in the reference picture by obtaining the first N candidate MVPs in the Merge list, and use all the obtained reference region samples to train the EIP filter coefficients used by the current block. It should be noted that the reference region here can represent the reference region of the same size as the current block in the reference picture and other reference regions of the same size after motion shift, and can also represent the collocated CUs and their surrounding samples, as shown in FIG. 11.

[0503] In the embodiments of the present application, one candidate MVP in the Merge list can be selected as the candidate MV of the current block.

[0504] (c) the motion vector obtained based on the motion search points to a reference region:

[0505] The motion vector indicating the reference region can be obtained by motion search. The motion vector is obtained by searching the original image corresponding to the original image block of the current block on the original image to obtain the most matched (i.e., the smallest error) motion vector. The motion vector information needs to be transmitted to the decoding end, and the transmission efficiency can be improved by motion vector prediction (MVP) or vector sign prediction (MV Sign Prediction) and the like.

[0506] In a specific embodiment, at the encoding end, the encoder traverses the prediction mode, and if the current prediction mode type is an intra mode, an allowed use identification bit of the embodiments of the present application is obtained. The identification bit is a sequence level flag, indicating that the current encoder allows the use of the extrapolation filter-based intra prediction technology (i.e., EIP technology), which can be represented in the form of sps_eip_enable_flag.

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

[0508] Step 1, if the EIP allowed use identification bit is true, step 2 is executed; if the EIP allowed use identification bit or other conditions do not meet the requirements, the encoding end does not attempt EIP prediction, i.e., step 2 is directly executed after step 3 is skipped.

[0509] The above conditions in which the other conditions do not meet the requirements for using EIP prediction include the following: 1) the size of the current coding unit does not meet the requirements, such as the width or height of the coding unit being greater than 32; 2) the number of neighboring reconstructed samples around the current coding unit is insufficient, such as the number of neighboring samples on the upper side of the current coding unit being less than the size of the EIP filter and the size of the template, such as the number of neighboring samples on the upper side being less than 8 rows and the number of neighboring samples on the left side being less than 8 columns.

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

[0511] Step 2.1, EIP prediction based on calculation.

[0512] The encoding end constructs up to 9 candidate modes by combining the training templates of different regions and filters of different shapes. For example, if the top template region and a square filter are a candidate, the candidate can only use the reconstructed samples of the top template region as the training sample input of the square filter. Similarly, the filter coefficients of the 9 candidate mode information are calculated in turn. It should be noted that there are up to 9 candidate mode information, which can be determined according to the width and height of the current block to determine the candidate mode information allowed to be used by the current block to obtain the EIP candidate list based on the calculation.

[0513] Step 2.2, EIP prediction based on merging.

[0514] The method according to the foregoing embodiment obtains the EIP candidate list in the merging mode.

[0515] If the frame type in which the current block is located is a non-intra slice type, i.e., a non-Slice_I type, the MergeMVP list of the current coding unit is obtained according to the method in the related art, and the sorted MergeMVP list is obtained by sorting. The first candidate MVP of the sorted MergeMVP list is used to obtain the reference block region in the reference image, and the reference samples of the reference block region are used to train the coefficients of the extrapolation filter. The allowable extrapolation filter includes up to three filter shapes, as shown in FIGS. 1A, 1B and 1C, which depends on the block size and shape of the current coding unit. The EIP model obtained by training the reference samples will also be added to the EIP candidate list;

[0516] All candidates in the list are sorted to maintain the maximum length of the EIP candidate list.

[0517] Step 2.3, the encoding end calculates the EIP rate-distortion cost.

[0518] The EIP candidate list based on the calculation and the EIP candidate list based on the merging are traversed, the rate-distortion cost of the prediction sample and the original image sample is calculated for each candidate filter, and the minimum rate-distortion cost is the minimum cost of the current EIP. Record whether the candidate is in the merging mode, its index sequence number in the list, and save its filter shape and filter coefficient.

[0519] Step 3, the encoding end traverses the untried prediction techniques and calculates the optimal cost result.

[0520] Step 4, if EIP is allowed to be used and the rate-distortion cost of the optimal EIP candidate is minimum, the current coding unit whether to use EIP merging mode information (eip_merge) is written into the code stream, and the optimal candidate index (eip_index) is written into the code stream, and its filter shape and filter coefficient are saved in the history list. The encoding block reconstruction process is completed.

[0521] Otherwise, the information of other optimal mode is written into the bitstream, transmitted to the decoding end, and the encoding block reconstruction process is completed.

[0522] Step 5, after traversing all the encoding units, the output bitstream is obtained through loop filtering, entropy coding and other technologies.

[0523] In a specific embodiment, at the decoding end, the decoder parses or obtains an EIP allowed use identification bit, which is a sequence level flag (sps_eip_enable_flag) indicating that the current decoder allows the use of the EIP technology.

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

[0525] Step 1, parse the bitstream to obtain the prediction type of the current encoding unit, if it is intra prediction and other restriction conditions are met, parse the eip use identification bit of the current encoding unit; otherwise, the default eip use identification bit (eip_flag) is false, that is, the current encoding unit does not use the EIP technology.

[0526] The above other restriction conditions can include: 1) the size of the current encoding unit does not meet the condition, such as the width or height of the encoding unit being greater than 32; 2) the number of neighboring reconstructed samples around the current encoding unit is insufficient, such as the number of neighboring samples on the top side being less than the sum of the EIP filter size and the template size, for example, the number of neighboring samples on the top side is less than 8 rows and the number of neighboring samples on the left side is less than 8 columns.

[0527] If the eip_flag of the current encoding unit is true, it indicates that the current encoding unit uses the EIP prediction technology, and the eip_merge identification bit and eip_index of the current encoding unit need to be parsed; if the eip_flag of the current encoding unit is false, it indicates that the current encoding unit does not use the EIP prediction technology, and step 3 is executed.

[0528] Step 2, if the eip_merge identification bit of the current encoding unit is true, it indicates that the current encoding unit uses the EIP merge mode, and step 2.1 is executed; otherwise, it indicates that the current encoding unit does not use the EIP merge, and step 2.2 is executed.

[0529] Step 2.1, EIP prediction based on merge.

[0530] According to the method of the foregoing embodiment, the EIP candidate list in the merge mode is obtained.

[0531] If the frame type of the current block is not the intra slice type, i.e. not Slice I type, the MergeMVP list of the current coding unit is obtained according to the method in the related art, and the sorted MergeMVP list is obtained by sorting. The first candidate MVP of the sorted MergeMVP list is used to obtain the reference block region in the reference image, and the reference samples of the reference block region are used to train the coefficients of the extrapolation filter. The allowable extrapolation filter includes at most three filter shapes, as shown in FIG. 1A, FIG. 1B and FIG. 1C, which depends on the block size and shape of the current coding unit. The EIP model obtained by training the reference samples will also be added to the EIP candidate list;

[0532] All candidates in the list are sorted, and the maximum length of the EIP candidate list is maintained.

[0533] According to the eip_index, the EIP information of the corresponding pair of positions in the list is obtained. The EIP information corresponding to the candidate, i.e. the filter shape and the filter coefficient, is used to predict the current coding unit to obtain the prediction samples of the current coding unit.

[0534] Step 2.2, based on the calculated EIP prediction.

[0535] According to the width and height of the current coding unit, the EIP list allowed to be used by the current coding unit is obtained, and the maximum length of the EIP list is 9, i.e. the combination of 3 different region templates and 3 different shape filters. According to the eip_index, the corresponding EIP information in the list is obtained, including the template region and the filter shape. In the template region, the filter input and output corresponding to the filter shape are calculated to obtain the filter coefficients. The calculated filter coefficients are applied to the current coding unit to predict the prediction samples of the current coding unit.

[0536] Step 3, continue to parse the usage identification bit or index information of other technologies, and obtain the final prediction samples of the current coding unit according to the parsed information;

[0537] Step 4, parse the bitstream and obtain the residual information, and obtain the residual samples according to the inverse quantization and inverse transform. The final prediction samples and the residual samples are superimposed to obtain the reconstructed samples of the current coding unit;

[0538] Step 5, after all the reconstructed samples are processed by loop filtering and other technologies, the final reconstructed image is obtained, which can be used as video output and can also be used as decoding reference.

[0539] It can be understood that, in the embodiments of the present application, another possible implementation manner of the MV-EIP is an inter prediction mode. If the current image is a non-intra coded frame and the current prediction mode is an inter prediction mode, a MergeMVP list related to the EIP is established, and the related parameters such as the EIP filter are obtained in the same manner as the foregoing scheme. This is referred to as interEIP below.

[0540] In a possible implementation manner, the operation of the decoding end is as follows: if the current coding unit prediction mode is a Merge mode, and the Merge_flag of the current coding unit is true and the regular_merge is false, the fourth syntax element inter_EIP_merge flag bit needs to be parsed, and if the inter_EIP_merge is true, the EIP_merge_index needs to be parsed. The candidate MVP in the MergeMVP list of the EIP is obtained according to the EIP_merge_index, then the reference region in the reference image is obtained according to the MVP to train the EIP filter coefficient, and finally the trained EIP filter is applied to the current coding unit.

[0541] Further, after the interEIP MergeMVP list is obtained, the shape of the EIP filter applied to the current coding unit can be determined according to the size and shape of the current coding unit. For example, if the current coding unit is a 16x16 square coding block, three EIP filter shapes can be allowed, and the EIP MergeMVP list is updated. Specifically, after the first candidate MVP of the EIP MergeMVP list is obtained to train the sample, the filter coefficients of the three EIP shapes are trained, and are updated to the first three positions of the new EIP MergeMVP list; similarly, after the second candidate MVP of the original EIP MergeMVP list is obtained to train the sample, the filter coefficients of the three EIP shapes are trained, and are updated to the fourth to sixth positions of the new EIP MergeMVP list.

[0542] It should be further noted that the new EIP MergeMVP list can be reordered according to the template error. In another possible implementation, the reordered EIP MergeMVP list can be truncated to a list of a specific length to save the transmission of code words.

[0543] Further, after the prediction sample of the current coding unit is obtained according to the interEIP, the inter prediction sample obtained by the original candidate MVP can be weighted and averaged to obtain the final prediction sample of the current coding unit. The weighted prediction weight can be a preset value, or can be obtained by other manners such as the SATD or SAD ratio calculation.

[0544] It is also appreciated that the MV-EIP or interEIP proposed in the embodiments of the present application generally has only one filter for predicting the current coding unit. In a possible implementation, the EIP candidate can have multiple filters, and the training process divides the training samples into two groups according to the size relationship between the sample mean (alpha), and trains a separate filter for each group of samples to form an EIP candidate. When applied to the current coding unit, if the EIP candidate contains two filters, the sample mean (alpha) stored in the EIP candidate is obtained, and according to the size relationship between the filter input sample mean (beta) of the current sample point and alpha, the corresponding filter coefficient is selected to predict the current sample point. Wherein, the calculation of beta can be the mean of several input samples of the filter grid part in FIG. 1A-1C, which is not limited here.

[0545] In the embodiments of the present application, the specific implementation of the foregoing embodiments is described in detail, and it can be seen from the foregoing embodiments that according to the technical solutions of the foregoing embodiments, an extrapolation filter prediction based on a motion vector is provided, which can include an extrapolation filter prediction based on motion vector information and multiple generation modes of a motion vector indicating a reference region, thereby being able to expand the candidate range in the first candidate list; thus, according to the first candidate list and the first mode index obtained by parsing the code stream, the determined filter parameters have good generalization ability, so that the filter parameters can be better applied to the sample prediction in the current block; and according to the determined filter parameters (such as the coefficients of the filter and the shape of the filter), the prediction accuracy of the prediction samples of the current block can be improved, thereby improving the compression efficiency and further improving the coding performance.

[0546] In still another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, FIG. 18 is a schematic diagram of the composition structure of an encoder provided in the embodiments of the present application. As shown in FIG. 18, the encoder 100 includes a first determination unit 1801 and an encoding unit 1802, wherein:

[0547] The first determining unit 1801 is configured to determine a frame type of the current block; in a case where the frame type of the current block satisfies a preset type condition, when a merge mode of a first intra prediction technology is used for the current block, determine at least one reference region of the current block, determine at least one set of candidate filtering parameters of the current block according to the at least one reference region, and determine a first candidate list of the current block according to the at least one set of candidate filtering parameters, and determine a first cost result corresponding to each of at least one set of candidate mode information in the first candidate list; when the merge mode of the first intra prediction technology is not used for the current block, determine a third candidate list of the current block, and determine a second cost result corresponding to each of at least one set of candidate mode information in the third candidate list; and determine a value of a first syntax element according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the merge mode of the first intra prediction technology is used for the current block.

[0548] The encoding unit 1802 is configured to perform encoding processing on the value of the first syntax element, and write the obtained encoding bits into a bitstream.

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

[0550] In some embodiments, the first determining unit 1801 is further configured to, when the minimum cost result in the first cost result is smaller than the minimum cost result in the second cost result, determine a first candidate mode information corresponding to the minimum cost result in the first cost result, and determine a first mode index of the current block according to an index sequence number of the first candidate mode information in the first candidate list; and the encoding unit 1802 is further configured to perform encoding processing on the first mode index of the current block, and write the obtained encoding bits into the bitstream.

[0551] In some embodiments, the first determining unit 1801 is further configured to, when the minimum cost result in the first cost result is greater than the minimum cost result in the second cost result, determine a second candidate mode information corresponding to the minimum cost result in the second cost result, and determine a second mode index of the current block according to an index sequence number of the second candidate mode information in the third candidate list; and the encoding unit 1802 is further configured to perform encoding processing on the second mode index of the current block, and write the obtained encoding bits into the bitstream.

[0552] In some embodiments, the first determining unit 1801 is further configured to determine a third cost result corresponding to a prediction technique other than the first intra prediction technique, when the current block uses the intra prediction and the current block satisfies a preset condition; and determine a value of a third syntax element according to the first cost result, the second cost result and the third cost result, wherein the third syntax element is used to indicate whether the current block uses the first intra prediction technique; and the encoding unit 1802 is further configured to encode the value of the third syntax element, and write the obtained encoding bits into the bitstream.

[0553] In some embodiments, the first determining unit 1801 is further configured to determine the value of the third syntax element as a first value, if a minimum cost result in the first cost result and the second cost result is smaller than a minimum cost result in the third cost result; and determine the value of the third syntax element as a second 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.

[0554] In some embodiments, the first determining unit 1801 is further configured to determine a value of a second syntax element, wherein the second syntax element is used to indicate a prediction type of the current block; and the encoding unit 1802 is further configured to encode the value of the second syntax element, and write the obtained encoding bits into the bitstream.

[0555] In some embodiments, the first determining unit 1801 is further configured to determine at least one collocated picture; and determine at least one collocated region of the current block according to the at least one collocated picture, and determine the at least one collocated region as at least one reference region of the current block; wherein the collocated region comprises one of the following: a collocated block of the current block, or a collocated block of the current block and a reference template of the collocated block, or a collocated block of the current block and neighboring reference samples around the collocated block.

[0556] In some embodiments, the first determining unit 1801 is further configured to determine at least one vector parameter of the current block; and determine at least one reference region of the current block according to the at least one vector parameter; wherein the reference region comprises one of the following: a reference block of the current block, or a reference block of the current block and a reference template of the reference block, or a reference block of the current block and neighboring reference samples around the reference block.

[0557] In some embodiments, the first determining unit 1801 is further configured to determine a first reference region indicated by a current vector parameter in a current reference picture; determine at least one second reference region in the current reference picture by performing motion offset on the first reference region according to at least one offset; and determine at least one reference region of the current block according to the first reference region and / or the at least one second reference region; wherein the current vector parameter is any one of the at least one vector parameter.

[0558] In some embodiments, the vector parameter comprises a first vector parameter; the first determining unit 1801 is further configured to determine a motion vector candidate list; and determine the at least one first vector parameter according to one or more candidate vector parameters in the motion vector candidate list.

[0559] In some embodiments, the first determining unit 1801 is further configured to determine reference templates corresponding to the one or more candidate vector parameters in the motion vector candidate list; determine cost results corresponding to the one or more candidate vector parameters according to cost calculation respectively performed on the reference templates corresponding to the one or more candidate vector parameters and the first template of the current block; sort the motion vector candidate list according to the cost results corresponding to the one or more candidate vector parameters to obtain a sorted motion vector candidate list; and determine the at least one first vector parameter based on the sorted motion vector candidate list.

[0560] In some embodiments, the first determining unit 1801 is further configured to determine N first vector parameters according to N candidate vector parameters with higher ranks in the sorted motion vector candidate list; wherein N is a positive integer.

[0561] In some embodiments, the first determining unit 1801 is further configured to determine a candidate vector parameter at a first position in the sorted motion vector candidate list as the first vector parameter.

[0562] In some embodiments, the vector parameter comprises a second vector parameter; the first determining unit 1801 is further configured to determine one or more candidate reference blocks based on a search of the current block in the current image; determine cost results corresponding to the one or more candidate reference blocks according to cost calculation respectively performed on the one or more candidate reference blocks and the current block; determine a minimum cost result from the cost results corresponding to the one or more candidate reference blocks, and determine a candidate reference block corresponding to the minimum cost result as a matching block of the current block; and determine the second vector parameter of the current block according to a vector parameter between the current block and the matching block.

[0563] In some embodiments, the encoding unit 1802 is further configured to perform encoding processing on the second vector parameter, and write obtained encoding bits into a bitstream.

[0564] In some embodiments, the first determining unit 1801 is further configured to add the at least one vector parameter to a preset storage area and / or a first history list of the current block after determining the at least one vector parameter of the current block.

[0565] In some embodiments, the first determining unit 1801 is further configured to determine a first candidate reference region in the at least one reference region; determine training samples corresponding to at least one candidate filter according to the reconstructed samples of the first candidate reference region; perform filter training according to the training samples corresponding to the at least one candidate filter, to determine at least one set of candidate filter parameters corresponding to the first candidate reference region, the candidate filter parameters including a shape of the candidate filter and coefficients of the candidate filter; and the first candidate reference region is any one of the at least one reference region.

[0566] In some embodiments, the first determining unit 1801 is further configured to divide the reconstructed samples of the first candidate reference region to determine at least two sets of reconstructed samples; determine training samples corresponding to at least one candidate filter combination according to the at least two sets of reconstructed samples, wherein the candidate filter combination includes candidate filters corresponding to the at least two sets of reconstructed samples respectively; and perform filter training according to the training samples corresponding to the at least one candidate filter combination, to determine at least one set of candidate filter parameter combinations corresponding to the first candidate reference region, wherein the candidate filter parameter combination includes a set of candidate filter parameters corresponding to the at least two sets of reconstructed samples respectively.

[0567] In some embodiments, the first determining unit 1801 is further configured to determine a sample reference value corresponding to the first candidate reference region, wherein the sample reference value includes a sample mean value or a sample median value; and when a first reconstructed sample in the first candidate reference region is greater than the sample reference value, divide the first reconstructed sample to a first set of reconstructed samples in the at least two sets of reconstructed samples; when the first reconstructed sample in the first candidate reference region is less than the sample reference value, divide the first reconstructed sample to a second set of reconstructed samples in the at least two sets of reconstructed samples; and the first reconstructed sample is any one of the reconstructed samples in the reference region.

[0568] In some embodiments, the first determining unit 1801 is further configured to determine a second candidate list of the current block; and determine the first candidate list of the current block according to the at least one set of candidate filter parameters and the second candidate list.

[0569] In some embodiments, the first determining unit 1801 is further configured to update the second candidate list based on the at least one set of candidate filter parameters to obtain an updated candidate list; perform cost calculation on a template region of the current block respectively according to the at least one set of candidate filter parameters in the updated candidate list, to determine a cost result corresponding to each of the at least one set of candidate filter parameters in the updated candidate list; and sort the at least one set of candidate filter parameters in the updated candidate list according to the cost results, to determine the first candidate list of the current block.

[0570] In some embodiments, the first determining unit 1801 is further configured to add the first candidate filter parameter to the second candidate list when the first candidate filter parameter does not exist in the second candidate list; and skip adding the first candidate filter parameter to the second candidate list when the first candidate filter parameter exists in the second candidate list. The first candidate filter parameter is any one of the at least one group of candidate filter parameters.

[0571] In some embodiments, the first determining unit 1801 is further configured to determine shapes of the at least one candidate template region and the at least one candidate filter according to a width and a height of the current block; and determine a third 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. The third candidate list includes the at least one group of candidate mode information, and the candidate mode information includes the shapes of the candidate template region and the candidate filter.

[0572] In some embodiments, the first determining unit 1801 is further configured to determine a motion vector candidate list when the current block uses inter prediction and the current block uses a merge mode of the first inter prediction technique; determine one or more candidate vector parameters each corresponding to a candidate prediction block in the motion vector candidate list; determine a cost result corresponding to each of the one or more candidate vector parameters according to a cost calculation of the candidate prediction block corresponding to each of the one or more candidate vector parameters and the current block; determine a minimum cost result from the cost results corresponding to the one or more candidate vector parameters, and determine a third vector parameter corresponding to the minimum cost result as the current block; determine a merge index of the third vector parameter in the motion vector candidate list; and the encoding unit 1802 is further configured to encode the merge index, and write the obtained encoding bits into the bitstream.

[0573] In some embodiments, the first determining unit 1801 is further configured to determine a fourth candidate list according to the motion vector candidate list when the current block uses inter prediction and the current block uses a merge mode of the first inter prediction technique. The fourth candidate list includes at least one group of candidate filter parameters. The encoding unit 1802 is further configured to determine a cost result corresponding to each of the at least one group of candidate filter parameters according to an encoding cost calculation of the current block according to each of the at least one group of candidate filter parameters; determine a minimum cost result from the cost results corresponding to the at least one group of candidate filter parameters, and determine a filter parameter corresponding to the minimum cost result as the current block; determine a merge index of the filter parameter of the current block in the fourth candidate list; and encode the merge index, and write the obtained encoding bits into the bitstream.

[0574] In some embodiments, the first determining unit 1801 is further configured to determine a value of a fourth syntax element when the current block uses the inter prediction, wherein the fourth syntax element is used to indicate whether the current block uses a merge mode of the first inter prediction technique; and the encoding unit 1802 is further configured to encode the value of the fourth syntax element, and write the obtained encoded bits into the bitstream.

[0575] In some embodiments, the first determining unit 1801 is further configured to determine at least one set of candidate filter parameters corresponding to each of the one or more candidate vector parameters according to the one or more candidate vector parameters in the motion vector candidate list; determine a fifth candidate list according to the at least one set of candidate filter parameters; respectively perform cost calculation on a template region of the current block according to each of the one or more sets of candidate filter parameters in the fifth candidate list, and determine a cost result corresponding to each of the one or more sets of candidate filter parameters in the fifth candidate list; and sort the one or more sets of candidate filter parameters in the fifth candidate list according to the cost results, and determine a fourth candidate list.

[0576] In some embodiments, the first determining unit 1801 is further configured to determine the M sets of candidate filter parameters with higher ranks in the fifth candidate list as the fourth candidate list after sorting the one or more sets of candidate filter parameters in the fifth candidate list according to the cost results, wherein M is a positive integer.

[0577] In some embodiments, referring to FIG. 18, the encoder 100 further includes a first prediction unit 1803; and the first determining unit 1801 is further configured to determine the filter parameter of the current block according to the first candidate mode information corresponding to the minimum cost result in the first cost results when the current block uses the first intra prediction technique and the current block uses a merge mode of the first intra prediction technique; and the first prediction unit 1803 is configured to determine the prediction sample of the current block according to the filter parameter of the current block.

[0578] In some embodiments, the first determining unit 1801 is further configured to determine the filter parameter of the current block according to the second candidate mode information corresponding to the minimum cost result in the second cost results when the current block uses the first intra prediction technique and the current block does not use the merge mode of the first intra prediction technique; and the first prediction unit 1803 is further configured to determine the prediction sample of the current block according to the filter parameter of the current block.

[0579] It can be understood that, in the embodiments of the present application, the "unit" can be part of a circuit, part of a processor, part of a program or software, etc., and of course can also be a module, and can also be non-modular. Moreover, the components in the embodiments can be integrated in a processing unit, or can be physically present as individual units, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function module.

[0580] In still another embodiment of the present application, FIG. 19 is a specific hardware structure diagram of an encoder provided by the embodiments of the present application. As shown in FIG. 19, the encoder 100 can include a first communication interface 1901, a first memory 1902 and a first processor 1903; the components are coupled together through a first bus system 1904. It can be understood that the first bus system 1904 is used to realize the connection communication between the components. The first bus system 1904 includes not only a data bus, but also a power supply bus, a control bus and a state signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the first bus system 1904 in FIG. 19. Among them,

[0581] The first communication interface 1901 is configured to receive and send signals in the process of transceiving information with other external network elements (for example, a decoder);

[0582] The first memory 1902 is configured to store a computer program capable of running on the first processor 1903;

[0583] The first processor 1903 is configured to, when running the computer program, perform:

[0584] determining the frame type of the current block; in the case that the frame type of the current block meets a preset type condition, determining at least one reference region of the current block when the current block uses the merge mode of the first intra prediction technology, determining at least one set of candidate filtering parameters of the current block according to the at least one reference region, and determining a first candidate list of the current block according to the at least one set of candidate filtering parameters, and determining a first cost result corresponding to each of at least one set of candidate mode information in the first candidate list; in the case that the current block does not use the merge mode of the first intra prediction technology, determining a third candidate list of the current block, and determining a second cost result corresponding to each of at least one set of candidate mode information in the third candidate list;

[0585] determining the value of a first syntax element according to the first cost result and the second cost result, wherein the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology; and encoding the value of the first syntax element, and writing the obtained coded bits into a bitstream.

[0586] It is to be appreciated that the first memory 1902 in embodiments of the application can be volatile or nonvolatile memory, or can include both volatile and nonvolatile memory. In one example, nonvolatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as the external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The first memory 1902 of the system and method described herein are intended to include, without being limited to, these and any other suitable types of memory.

[0587] The first processor 1903 can be an integrated circuit chip, which has the processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the first processor 1903. The first processor 1903 described above can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as a hardware code processor to execute, or be executed by a combination of hardware and software modules in the code processor. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the first storage 1902, and the first processor 1903 reads the information in the first storage 1902, and combines the hardware to complete the steps of the above method.

[0588] It can be understood that the embodiments described in the present application can be realized by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be realized in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for executing functions described in the present application or a combination thereof. For software implementation, the technology described in the present application can be realized by modules (such as processes, functions, etc.) for executing functions described in the present application. The software code can be stored in the memory and executed by the processor. The memory can be implemented in the processor or outside the processor.

[0589] Optionally, as another embodiment, the first processor 1903 is further configured to execute the method of any one of the preceding embodiments when running the computer program.

[0590] The embodiment provides an encoder. When a frame type of a current block satisfies a preset type condition and the current block uses a merge mode of a first intra prediction technology, at least one set of candidate filter parameters of the current block is determined according to at least one reference region, and the at least one set of candidate filter parameters is taken as candidate mode information in a first candidate list, thereby expanding a candidate range in the first candidate list. The filter parameters determined according to the first candidate list have good generalization ability, so that the filter parameters can be better applied to sample prediction in the current block. Moreover, prediction is performed according to the determined filter parameters (for example, coefficients of a filter and a shape of the filter), and the prediction sample accuracy of the current block is improved, thereby improving compression efficiency and further improving encoding performance.

[0591] In still another embodiment of the present application, based on the same inventive concept of the preceding embodiments, FIG. 20 is a schematic diagram of a composition structure of a decoder provided by the embodiment of the present application. As shown in FIG. 20, the decoder 200 includes a decoding unit 2001, a second determining unit 2002 and a second prediction unit 2003, wherein:

[0592] The decoding unit 2...

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 merge mode of a first intra prediction technique is used for the current block and a frame type of the current block satisfies a preset type condition, parsing a first mode index in the bitstream, and determining at least one reference region of the current block, from which at least one set of candidate filter parameters of the current block are determined; determining a first candidate list of the current block according to the at least one set of candidate filter parameters; determining a filter parameter of the current block according to the first candidate list and the first mode index; determining a prediction sample of the current block according to the filter parameter.

2. The method of claim 1, wherein, The determining the at least one reference region of the current block comprises: determining at least one collocated picture; determining at least one collocated region of the current block according to the at least one collocated picture, and determining the at least one collocated region as the at least one reference region of the current block; wherein the collocated region comprises one of: a collocated block of the current block, or a collocated block of the current block and a reference template of the collocated block, or a collocated block of the current block and neighboring reference samples around the collocated block.

3. The method of claim 1 or 2, wherein, The determining the at least one reference region of the current block comprises: determining at least one vector parameter of the current block; determining at least one reference region of the current block according to the at least one vector parameter; wherein the reference region comprises one of: a reference block of the current block, or a reference block of the current block and a reference template of the reference block, or a reference block of the current block and neighboring reference samples around the reference block.

4. The method of claim 3, wherein, The determining the at least one reference region of the current block according to the at least one vector parameter comprises: determining a first reference region indicated by a current vector parameter in a current reference picture; motion shifting the first reference region according to at least one offset to determine at least one second reference region in the current reference picture; determining the at least one reference region of the current block according to the first reference region and / or the at least one second reference region; wherein the current vector parameter is any one of the at least one vector parameter.

5. The method of claim 3, wherein, The vector parameter comprises a first vector parameter; and the determining the at least one vector parameter of the current block comprises: determining a motion vector candidate list; determining at least one first vector parameter according to one or more candidate vector parameters in the motion vector candidate list.

6. The method of claim 5, wherein, The determining the at least one first vector parameter according to one or more candidate vector parameters in the motion vector candidate list comprises: determining reference templates corresponding to the one or more candidate vector parameters in the motion vector candidate list; determining cost results corresponding to the one or more candidate vector parameters according to cost calculation of the reference templates corresponding to the one or more candidate vector parameters and a first template of the current block, respectively. ordering the motion vector candidate list according to cost results corresponding to the one or more candidate vector parameters, to obtain an ordered motion vector candidate list; determining the at least one first vector parameter based on the ordered motion vector candidate list.

7. The method of claim 6, wherein, The determining the at least one first vector parameter based on the ordered motion vector candidate list includes: determining N first vector parameters according to N candidate vector parameters with higher ranks in the ordered motion vector candidate list; N is a positive integer.

8. The method of claim 6, wherein, The determining the at least one first vector parameter based on the ordered motion vector candidate list includes: determining the first vector parameter as a candidate vector parameter with a first rank in the ordered motion vector candidate list.

9. The method of claim 5, wherein, The determining the motion vector candidate list includes: determining one or more candidate vector parameters according to first reference information of the current block; determining the motion vector candidate list according to the one or more candidate vector parameters; wherein the first reference information of the current block includes at least one of: a candidate vector parameter corresponding to a neighboring block of the current block; a candidate vector parameter corresponding to a non-neighboring block of the current block; a candidate vector parameter corresponding to a collocated block in a collocated picture of the current block; a candidate vector parameter included in a first history list of the current block; an average candidate vector parameter of the current block; a zero-value candidate vector parameter of the current block.

10. The method of claim 3, wherein, The vector parameter includes a second vector parameter; and the determining the at least one vector parameter of the current block includes: parsing the second vector parameter from a bitstream.

11. The method of claim 3, wherein, The method further includes: adding the at least one vector parameter to a preset storage area and / or a first history list of the current block after the at least one vector parameter of the current block is determined.

12. The method of any one of claims 1 to 11, wherein, The determining the at least one set of candidate filter parameters of the current block according to the at least one reference region includes: determining a first candidate reference region in the at least one reference region; determining training samples corresponding to at least one candidate filter according to reconstructed samples of the first candidate reference region; performing filter training according to the training samples corresponding to the at least one candidate filter, to determine at least one set of candidate filter parameters corresponding to the first candidate reference region, the candidate filter parameters including a shape of the candidate filter and coefficients of the candidate filter; wherein the first candidate reference region is any one of the at least one reference region.

13. The method of claim 12, wherein, The method further includes: dividing the reconstructed samples of the first candidate reference region to determine at least two sets of reconstructed samples; determining training samples corresponding to at least one candidate filter combination according to the at least two sets of reconstructed samples, wherein the candidate filter combination includes candidate filters corresponding to the at least two sets of reconstructed samples respectively; performing filter training according to the training samples corresponding to the at least one candidate filter combination, to determine at least one set of candidate filter parameter combinations corresponding to the first candidate reference region. The candidate filter parameter combination includes a group of candidate filter parameters corresponding to each of the at least two groups of reconstructed samples.

14. The method of claim 13, wherein, The dividing of the reconstructed samples in the first candidate reference region to determine the at least two groups of reconstructed samples comprises: determining a sample reference value corresponding to the first candidate reference region, wherein the sample reference value comprises a sample mean value or a sample median value; when a first reconstructed sample in the first candidate reference region is greater than the sample reference value, dividing the first reconstructed sample into a first group of reconstructed samples in the at least two groups of reconstructed samples; when the first reconstructed sample in the first candidate reference region is less than the sample reference value, dividing the first reconstructed sample into a second group of reconstructed samples in the at least two groups of reconstructed samples; wherein the first reconstructed sample is any one of the reconstructed samples in the reference region.

15. The method of any one of claims 1 to 14, wherein, The determining of the first candidate list of the current block according to the at least one candidate filter parameter comprises: determining a second candidate list of the current block; determining the first candidate list of the current block according to the at least one candidate filter parameter and the second candidate list.

16. The method of claim 15, wherein, The determining of the first candidate list of the current block according to the at least one candidate filter parameter and the second candidate list comprises: updating the second candidate list based on the at least one candidate filter parameter to obtain an updated candidate list; performing cost calculation on a template region of the current block according to at least one candidate filter parameter in the updated candidate list to determine a cost result corresponding to the at least one candidate filter parameter in the updated candidate list; sorting the at least one candidate filter parameter in the updated candidate list according to the cost result to determine the first candidate list of the current block.

17. The method of claim 16, wherein, The updating of the second candidate list based on the at least one candidate filter parameter comprises: when a first candidate filter parameter does not exist in the second candidate list, adding the first candidate filter parameter to the second candidate list; when the first candidate filter parameter exists in the second candidate list, skipping the step of adding the first candidate filter parameter to the second candidate list; wherein the first candidate filter parameter is any one of the at least one candidate filter parameter.

18. The method of claim 12, wherein, When the filter parameter indicates at least two groups of filter parameters of a filter combination, the determining of the prediction sample of the current block according to the filter parameter comprises: when a current sample in the current block satisfies a first condition, selecting a first group of filter parameters from the at least two groups of filter parameters, and predicting the current sample according to the first group of filter parameters to determine a prediction value of the current sample; when the current sample in the current block satisfies a second condition, selecting a second group of filter parameters from the at least two groups of filter parameters, and predicting the current sample according to the second group of filter parameters to determine the prediction value of the current sample.

19. The method of claim 18, wherein, The method further comprises: determining a first reference value corresponding to the current sample; determining that a current sample in the current block satisfies a first condition when the first reference value is greater than the sample reference value; determining that the current sample in the current block satisfies a second condition when the first reference value is less than the sample reference value.

20. The method of any one of claims 1 to 19, wherein, The method further comprises: parsing a second syntax element in the bitstream; when the second syntax element indicates that the current block uses intra prediction and the current block satisfies a preset condition, parsing a third syntax element in the bitstream; when the third syntax element indicates that the current block uses a first intra prediction technology, parsing the first syntax element in the bitstream.

21. The method of claim 20, wherein, The current block satisfies the preset condition includes at least one of: a size parameter of the current block satisfies a preset size condition; neighboring reference samples around the current block satisfy a preset number condition.

22. The method of any one of claims 1 to 21, wherein, The method further comprises: when the first syntax element indicates that the current block uses a merge mode of the first intra prediction technology and a frame type of the current block does not satisfy a preset type condition, determining a second candidate list of the current block; determining a filter parameter of the current block according to the second candidate list and the first mode index; determining a prediction sample of the current block according to the filter parameter.

23. The method of any one of claims 1 to 21, wherein, The method further comprises: when the first syntax element indicates that the current block does not use the merge mode of the first intra prediction technology, parsing a second mode index in the bitstream, and determining a third candidate list of the current block; determining mode information of the current block according to the third candidate list and the second mode index; determining a filter parameter of the current block according to the mode information; determining a prediction sample of the current block according to the filter parameter.

24. The method of claim 23, wherein, The filter parameter includes a shape of the filter and a coefficient of the filter; and the determining the filter parameter of the current block according to the mode information includes: determining the shape of the filter and a template region of the current block according to the mode information; determining input samples and output samples of the filter according to the template region of the current block; determining the coefficient of the filter according to filter training of the input samples and the output samples of the filter.

25. The method of claim 23, wherein, The determining the third candidate list of the current block includes: determining at least one candidate template region and a shape of at least one candidate filter according to a width and a height of the current block; determining the third candidate list of the current block according to the at least one candidate template region and the shape of the at least one candidate filter; wherein the third candidate list includes 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.

26. The method of claim 20, wherein, The method further comprises: when the second syntax element indicates that the current block uses inter prediction, parsing a fourth syntax element in the bitstream; when the fourth syntax element indicates that the current block uses a merge mode of a first inter prediction technology, parsing a merge index in the bitstream; determining a third vector parameter corresponding to the merge index according to a motion vector candidate list; determining a third reference region of the current block according to the third vector parameter, and determining at least one group of candidate filter parameters of the current block according to the third reference region; determining a filter parameter of the current block according to the at least one group of candidate filter parameters; determining a prediction sample of the current block according to the filter parameter.

27. The method of claim 26, wherein, The method further comprises: when the fourth syntax element indicates that the current block uses a merge mode of a first inter prediction technology, determining a fourth candidate list according to a motion vector candidate list; wherein the fourth candidate list comprises at least one group of candidate filter parameters; parsing a merge index in a bitstream; determining a filter parameter of the current block according to the fourth candidate list and the merge index; determining a prediction sample of the current block according to the filter parameter.

28. The method of claim 27, wherein, The determining of the fourth candidate list according to the motion vector candidate list comprises: determining at least one group of candidate filter parameters corresponding to each of one or more candidate vector parameters in the motion vector candidate list according to the one or more candidate vector parameters; determining a fifth candidate list according to the at least one group of candidate filter parameters corresponding to each of the one or more candidate vector parameters; determining a cost result corresponding to each of one or more groups of candidate filter parameters in the fifth candidate list according to a cost calculation of a template region of the current block by the one or more groups of candidate filter parameters respectively; determining the fourth candidate list according to a sorting of the one or more groups of candidate filter parameters in the fifth candidate list according to the cost result.

29. The method of claim 28, wherein, The method further comprises: after the sorting of the one or more groups of candidate filter parameters in the fifth candidate list according to the cost result, determining M groups of candidate filter parameters in front of the sorting as the fourth candidate list; wherein M is a positive integer.

30. The method of claim 26, wherein, The method further comprises: determining a first prediction sample of the current block according to the third vector parameter; determining a second prediction sample of the current block according to the filter parameter; determining a prediction sample of the current block according to a weighted calculation of the first prediction sample and the second prediction sample.

31. An encoding method applied to an encoder, the method comprising: determining a frame type of a current block; when the current block uses a merge mode of a first intra prediction technology, determining at least one reference region of the current block in a case where the frame type of the current block satisfies a preset type condition, determining at least one group of candidate filter parameters of the current block according to the at least one reference region, and determining a first candidate list of the current block according to the at least one group of candidate filter parameters, and determining a first cost result corresponding to each of at least one group of candidate mode information in the first candidate list; when the current block does not use the merge mode of the first intra prediction technology, determining a third candidate list of the current block, and determining a second cost result corresponding to each of at least one group of candidate mode information in the third candidate list; determining a filter parameter of the current block according to the fourth candidate list and the merge index; determining a prediction sample of the current block according to the filter parameter. determining a value of a first syntax element according to the first cost results and the second cost results, wherein the first syntax element is used to indicate whether the current block uses a merge mode of a first intra prediction technology; encoding the value of the first syntax element, and writing the obtained encoding bits into a bitstream.

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

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

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

35. The method of claim 31, wherein, The method further comprises: when the current block uses intra prediction and the current block satisfies a preset condition, determining a third cost result corresponding to a prediction technology other than the first intra prediction technology used by the current block; determining a value of a third syntax element according to the first cost results, the second cost results and the third cost results, wherein the third syntax element is used to indicate whether the current block uses the first intra prediction technology; encoding the value of the third syntax element, and writing the obtained encoding bits into a bitstream.

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

37. The method of claim 35, wherein, determining a value of a second syntax element, wherein the second syntax element is used to indicate a prediction type of the current block; encoding the value of the second syntax element, and writing the obtained encoding bits into a bitstream. ​ 38. The method of claim 31, wherein, The determining the at least one reference region of the current block comprises: determining at least one collocated picture; determining at least one collocated region of the current block according to the at least one collocated picture, and determining the at least one collocated region as the at least one reference region of the current block; wherein the collocated region comprises one of: a collocated block of the current block, or a collocated block of the current block and a reference template of the collocated block, or a collocated block of the current block and neighboring reference samples around the collocated block.

39. The method of claim 31 or 38, wherein, The determining the at least one reference region of the current block comprises: determining at least one vector parameter of the current block; determining at least one reference region of the current block according to the at least one vector parameter; wherein the reference region comprises one of: a reference block of the current block, or a reference block of the current block and a reference template of the reference block, or a reference block of the current block and neighboring reference samples around the reference block.

40. The method of claim 39, wherein, The determining the at least one reference region of the current block according to the at least one vector parameter comprises: determining a first reference region indicated by a current vector parameter in a current reference picture; motion shifting the first reference region according to at least one offset to determine at least one second reference region in the current reference picture; determining the at least one reference region of the current block according to the first reference region and / or the at least one second reference region; wherein the current vector parameter is any one of the at least one vector parameter.

41. The method of claim 39, wherein, The vector parameter comprises a first vector parameter; and the determining the at least one vector parameter of the current block comprises: determining a motion vector candidate list; determining at least one first vector parameter according to one or more candidate vector parameters in the motion vector candidate list.

42. The method of claim 41, wherein, The determining at least one first vector parameter according to one or more candidate vector parameters in the motion vector candidate list comprises: determining reference templates corresponding to the one or more candidate vector parameters in the motion vector candidate list; determining cost results corresponding to the one or more candidate vector parameters according to cost calculation of the reference templates corresponding to the one or more candidate vector parameters and a first template of the current block, respectively; sorting the motion vector candidate list according to the cost results corresponding to the one or more candidate vector parameters to determine a sorted motion vector candidate list; determining the at least one first vector parameter based on the sorted motion vector candidate list.

43. The method of claim 42, wherein, The determining the at least one first vector parameter based on the sorted motion vector candidate list comprises: determining N first vector parameters according to N candidate vector parameters with a higher rank in the sorted motion vector candidate list; wherein N is a positive integer.

44. The method of claim 42, wherein, The determining the at least one first vector parameter based on the sorted motion vector candidate list comprises: determining a candidate vector parameter at a first position in the sorted motion vector candidate list as the first vector parameter.

45. The method of claim 39, wherein, The vector parameters comprise a second vector parameter; and the determining the at least one vector parameter of the current block comprises: searching in a current picture based on the current block to determine one or more candidate reference blocks; performing cost calculation on the one or more candidate reference blocks respectively with the current block to determine cost results corresponding to the one or more candidate reference blocks; determining a minimum cost result from the cost results corresponding to the one or more candidate reference blocks, and determining a candidate reference block corresponding to the minimum cost result as a matching block of the current block; determining the second vector parameter of the current block according to a vector parameter between the current block and the matching block.

46. The method of claim 45, wherein, The method further comprises: encoding the second vector parameter, and writing obtained encoding bits into a bitstream.

47. The method of claim 39, wherein, The method further comprises: after determining the at least one vector parameter of the current block, adding the at least one vector parameter into a preset storage area and / or a first history list of the current block.

48. The method of any one of claims 31 to 47, wherein, The determining the at least one set of candidate filter parameters of the current block according to the at least one reference region comprises: determining a first candidate reference region in the at least one reference region; determining training samples corresponding to at least one candidate filter according to reconstructed samples of the first candidate reference region; performing filter training according to the training samples corresponding to the at least one candidate filter to determine at least one set of candidate filter parameters corresponding to the first candidate reference region, the candidate filter parameters comprising a shape of the candidate filter and coefficients of the candidate filter; wherein the first candidate reference region is any one of the at least one reference region.

49. The method of claim 48, wherein, The method further comprises: dividing the reconstructed samples of the first candidate reference region to determine at least two sets of reconstructed samples; determining training samples corresponding to at least one candidate filter combination according to the at least two sets of reconstructed samples, wherein the candidate filter combination comprises candidate filters corresponding to the at least two sets of reconstructed samples respectively; performing filter training according to the training samples corresponding to the at least one candidate filter combination to determine at least one set of candidate filter parameter combinations corresponding to the first candidate reference region; wherein the candidate filter parameter combination comprises a set of candidate filter parameters corresponding to the at least two sets of reconstructed samples respectively.

50. The method of claim 49, wherein, The dividing the reconstructed samples of the first candidate reference region to determine at least two sets of reconstructed samples comprises: determining a sample reference value corresponding to the first candidate reference region; wherein the sample reference value comprises a sample mean value or a sample median value; when a first reconstructed sample in the first candidate reference region is greater than the sample reference value, dividing the first reconstructed sample into a first set of reconstructed samples in the at least two sets of reconstructed samples; when the first reconstructed sample in the first candidate reference region is less than the sample reference value, dividing the first reconstructed sample into a second set of reconstructed samples in the at least two sets of reconstructed samples; wherein the first reconstructed sample is any one of the reconstructed samples in the reference region.

51. The method of any one of claims 31 to 50, wherein, The method further comprises: determining a second candidate list of the current block; determining a first candidate list of the current block according to the at least one set of candidate filter parameters and the second candidate list.

52. The method of claim 51, wherein, The method further comprises: updating the second candidate list based on the at least one set of candidate filter parameters to obtain an updated candidate list; performing cost calculation on a template region of the current block according to at least one set of candidate filter parameters in the updated candidate list to determine a cost result corresponding to each of the at least one set of candidate filter parameters in the updated candidate list; sorting the at least one set of candidate filter parameters in the updated candidate list according to the cost result to determine the first candidate list of the current block.

53. The method of claim 52, wherein, The method further comprises: adding a first candidate filter parameter to the second candidate list when the first candidate filter parameter does not exist in the second candidate list; skipping the step of adding the first candidate filter parameter to the second candidate list when the first candidate filter parameter exists in the second candidate list; wherein the first candidate filter parameter is any one of the at least one set of candidate filter parameters.

54. The method of claim 31, wherein, The method further 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 a third 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 third candidate list comprises at least one set of candidate mode information, and the candidate mode information comprises the shapes of the candidate template region and the candidate filter.

55. The method of claim 31, wherein, The method further comprises: when the current block uses inter prediction and the current block uses a merge mode of a first inter prediction technology, determining a motion vector candidate list; determining a candidate prediction block corresponding to each of one or more candidate vector parameters in the motion vector candidate list; performing cost calculation on the current block according to the candidate prediction block corresponding to each of the one or more candidate vector parameters to determine a cost result corresponding to each of the one or more candidate vector parameters; determining a third vector parameter corresponding to a minimum cost result from the cost result corresponding to each of the one or more candidate vector parameters; determining a merge index of the third vector parameter in the motion vector candidate list; performing encoding processing on the merge index and writing the obtained encoded bits into a bitstream.

56. The method of claim 55, wherein, The method further comprises: when the current block uses inter prediction and the current block uses a merge mode of a first inter prediction technology, determining a fourth candidate list according to a motion vector candidate list; wherein the fourth candidate list comprises at least one set of candidate filter parameters. According to the at least one set of candidate filter parameters, a cost calculation is performed on the current block to determine a cost result corresponding to each of the at least one set of candidate filter parameters; A minimum cost result is determined from the cost results corresponding to the at least one set of candidate filter parameters, and a candidate filter parameter corresponding to the minimum cost result is determined as the filter parameter of the current block; A merge index of the filter parameter of the current block in the fourth candidate list is determined; The merge index is encoded, and the obtained encoding bits are written into a bitstream.

57. The method of claim 55 or 56, wherein, The method further includes: When the current block uses inter prediction, a value of a fourth syntax element is determined, where the fourth syntax element is used to indicate whether the current block uses a merge mode of a first inter prediction technology; The value of the fourth syntax element is encoded, and the obtained encoding bits are written into a bitstream.

58. The method of claim 56, wherein, The fourth candidate list is determined according to the motion vector candidate list, including: According to one or more candidate vector parameters in the motion vector candidate list, at least one set of candidate filter parameters corresponding to each of the one or more candidate vector parameters is determined; According to the at least one set of candidate filter parameters corresponding to each of the one or more candidate vector parameters, a fifth candidate list is determined; According to one or more sets of candidate filter parameters in the fifth candidate list, a cost calculation is performed on a template region of the current block to determine a cost result corresponding to each of the one or more sets of candidate filter parameters in the fifth candidate list; According to the cost results, the one or more sets of candidate filter parameters in the fifth candidate list are sorted to determine the fourth candidate list.

59. The method of claim 58, wherein, The method further includes: After the one or more sets of candidate filter parameters in the fifth candidate list are sorted according to the cost results, M sets of candidate filter parameters with higher ranks are determined as the fourth candidate list, where M is a positive integer.

60. An encoder, including a first determining unit and an encoding unit, wherein: The first determining unit is configured to determine a frame type of a current block, and when the current block uses a merge mode of a first intra prediction technology, determine at least one reference region of the current block, determine at least one set of candidate filter parameters of the current block according to the at least one reference region, and determine a first candidate list of the current block according to the at least one set of candidate filter parameters, and determine a first cost result corresponding to each of at least one set of candidate mode information in the first candidate list, when the frame type of the current block meets a preset type condition; When the current block does not use the merge mode of the first intra prediction technology, determine a third candidate list of the current block, and determine a second cost result corresponding to each of at least one set of candidate mode information in the third candidate list; And determine a value of a first syntax element according to the first cost result and the second cost result, where the first syntax element is used to indicate whether the current block uses the merge mode of the first intra prediction technology. The encoding unit is configured to encode the value of the first syntax element and write the obtained coded bits into a bitstream.

61. 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 method in any of claims 31-59 when running the computer program.

62. A decoder, comprising a decoding unit, a second determining unit and a second prediction unit, wherein: the decoding unit is configured to parse a first syntax element in a bitstream; the second determining unit is configured to, when the first syntax element indicates that the current block uses a merge mode of a first intra prediction technique and a frame type of the current block satisfies a preset type condition, parse a first mode index in the bitstream, determine at least one reference region of the current block, determine at least one set of candidate filtering parameters of the current block according to the at least one reference region, determine a first candidate list of the current block according to the at least one set of candidate filtering parameters, and determine a filtering parameter of the current block according to the first candidate list and the first mode index; the second prediction unit is configured to determine prediction samples of the current block according to the filtering parameter.

63. 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 method in any of claims 1-30 when running the computer program. The computer program is executed by a processor to implement the method in any of claims 1-30, or to implement the method in any of claims 31-59. The bitstream is generated by executing the steps of the encoding method in any of claims 31-59.

64. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by a processor to implement the method in any of claims 1-30, or to implement the method in any of claims 31-59.

65. A computer-readable storage medium having a code stream stored thereon, wherein, The bitstream is generated by executing the steps of the encoding method in any of claims 31-59.

Citation Information

Patent Citations

  • Spatial extrapolation of pixel values in intraframe video coding and decoding

    US20030138150A1

  • Device and method for competition-based intra prediction encoding / decoding using multiple prediction filters

    US20130215960A1