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

JP2026532651APending Publication Date: 2026-09-30GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2026518467
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2026-09-30

AI Technical Summary

Benefits of technology

【0015】 本開示の実施形態は、符号化方法、復号化方法、ビットストリーム、エンコーダ、デコーダ、および記憶媒体を提案する。エンコーダとデコーダは、現在のブロックに対応する予測パラメータを決定し、現在のブロックの予測パラメータに基づいて、現在のブロックの第1参照ブロックを決定し、現在のブロックの第1参照ブロックに基づいて、現在のブロックの第1変換パラメータを決定し、現在のブロックの第1参照ブロックに基づいて、現在のブロックの予測ブロックを決定し、現在のブロックの予測ブロックおよび第1変換パラメータに基づいて、現在のブロックに対応する再構成ブロックを決定する。すなわち、本開示の実施形態では、予測パラメータに基づいて現在のブロックの第1参照ブロックを決定した後、データ処理を経ていない第1参照ブロックを直接使用して、現在のブロックの変換パラメータを決定することを選択でき、その後、決定された変換パラメータを、第1参照ブロックにデータ処理を施して得られた現在のブロックの予測ブロックと組み合わせて、現在のブロックの再構成を完了することができる。ここで、データ処理プロセスは、予測ブロックのテクスチャエッジ情報の一部をある程度損失させるため、データ処理前の初期予測値(すなわち第1参照ブロック)は、データ処理後の最終予測値(すなわち予測ブロック)と比較して、より豊富なテクスチャエッジ情報を有する。第1参照ブロックを使用して予測方向の導出を行うことで、より正確な変換パラメータを得ることができ、それにより符号化および復号化の性能を効果的に向上させることができる。同時に、予測パラメータによって直接指示される第1参照ブロックを決定した後、予測ブロックの生成、および変換パラメータと残差の生成などのステップを並行して実行でき、符号化·復号化のクリティカルパスの長さを短縮し、複雑度が高いという問題を解決し、これにより符号化·復号化効率を向上させることができる。したがって、本開示の実施形態による符号化方法、復号化方法は、符号化および復号化の効率と性能を向上させることができる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026532651000001_ABST
    Figure 2026532651000001_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium, the method comprising: an encoding / decoding device determining a prediction parameter corresponding to a current block; determining a first reference block of the current block based on the prediction parameter of the current block; determining a first transformation parameter of the current block based on the first reference block of the current block; determining a prediction block of the current block based on the first reference block of the current block; and determining a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] Embodiments of this disclosure relate to the video coding and decoding technology, and more particularly to coding methods, decoding methods, bitstreams, encoders, decoders, and storage media. [Background technology]

[0002] Common prediction techniques based on block vectors (BV), such as intra-template matching prediction (Intra TMP) and intra-block copy (IBC), can use the best-matching reconstructed block as the prediction block for the current encoded block. This prediction block is obtained as the final prediction block after undergoing data processing processes such as filtering and fusion. Based on this final prediction block, a set of low-frequency non-separable transforms (LFNSTs) can be derived by employing decoder-side intra-mode derivation (DIMD), and then the subsequent inverse transform process can be performed using the LFNST transform set.

[0003] However, the final predicted block, after undergoing data processing processes such as filtering and fusion, loses some texture edge information, which has a certain impact on the accuracy of the subsequent LFNST transformation set derivation. In other words, the derived LFNST transformation set is not necessarily an optimal match, which degrades encoding and decoding performance. On the other hand, the prediction process, which sequentially performs prediction block processing, LFNST transformation set derivation, and inverse transformation processing, also suffers from high complexity, which reduces encoding and decoding efficiency.

[0004] In other words, general prediction techniques based on BV have the problem of low coding and decoding efficiency and poor performance. Summary of the Invention Problem to be Solved by the Invention

[0005] Embodiments of the present disclosure provide an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium, which can effectively improve the efficiency and performance of encoding and decoding. Means for Solving the Problem

[0006] The technical solution of embodiments of the present disclosure can be implemented as follows.

[0007] According to a first aspect, embodiments of the present disclosure provide a decoding method applied to a decoder. The method includes: determining a prediction parameter corresponding to a current block; determining a first reference block of the current block based on the prediction parameter of the current block; determining a first transform parameter of the current block based on the first reference block of the current block; determining a prediction block of the current block based on the first reference block of the current block; determining a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transform parameter.

[0008] According to a second aspect, embodiments of the present disclosure provide an encoding method applied to an encoder. The method includes: determining a prediction parameter corresponding to a current block; determining a first reference block of the current block based on the prediction parameter of the current block; determining a first transform parameter of the current block based on the first reference block of the current block; Based on the first reference block of the current block, the predicted block of the current block is determined, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and the first transformation parameter.

[0009] According to a third aspect, embodiments of the present disclosure provide a bitstream. The bitstream is generated by bit encoding based on information to be encoded, and the information to be encoded is Prediction mode identification information corresponding to the current block, First identification information, The first transformation coefficient corresponding to the predicted residual, Conversion kernel index number, It includes at least one of the following.

[0010] According to a fourth aspect, embodiments of the present disclosure provide an encoder. The encoder includes a first determination unit, The first decision unit is configured to determine a prediction parameter corresponding to the current block, determine a first reference block of the current block based on the prediction parameter of the current block, determine a first transformation parameter of the current block based on the first reference block of the current block, determine a prediction block of the current block based on the first reference block of the current block, and determine a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

[0011] According to the fifth aspect, embodiments of the present disclosure provide an encoder. The encoder includes a first memory and a first processor. The first memory is used to store computer programs that can be executed on the first processor. The first processor is used to perform the method described in the second aspect when executing the computer program.

[0012] According to the sixth aspect, embodiments of the present disclosure provide a decoder. The decoder includes a second determination unit, The second decision unit is configured to determine a prediction parameter corresponding to the current block, determine a first reference block of the current block based on the prediction parameter of the current block, determine a first transformation parameter of the current block based on the first reference block of the current block, determine a prediction block of the current block based on the first reference block of the current block, and determine a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

[0013] According to the seventh aspect, embodiments of the present disclosure provide a decoder. The decoder includes a second memory and a second processor. The second memory is used to store computer programs that can be executed on the second processor. The second processor is used to perform the method described in the first aspect when executing the computer program.

[0014] According to Aspect VIII, embodiments of the present disclosure provide a computer storage medium that stores a computer program and, when the computer program is executed, implements the method described in Aspect VIII or Aspect VII.

[0015] Embodiments of the present disclosure propose an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium. The encoder and decoder determine prediction parameters corresponding to the current block, determine a first reference block of the current block based on the prediction parameters of the current block, determine a first transformation parameter of the current block based on the first reference block of the current block, determine a prediction block of the current block based on the first reference block of the current block, and determine a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. That is, in embodiments of the present disclosure, after determining the first reference block of the current block based on the prediction parameters, it is possible to choose to determine the transformation parameter of the current block using the first reference block which has not undergone data processing, and then the determined transformation parameter can be combined with the prediction block of the current block obtained by data processing the first reference block to complete the reconstruction of the current block. Here, since the data processing process causes some loss of texture edge information of the prediction block, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block). By using a first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, thereby effectively improving the performance of coding and decoding. At the same time, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block and generating the transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of coding and decoding, solving the problem of high complexity, and thereby improving coding and decoding efficiency. Therefore, the coding and decoding methods according to embodiments of this disclosure can improve the efficiency and performance of coding and decoding. [Brief explanation of the drawing]

[0016] [Figure 1] This is a schematic diagram illustrating the application of LFNST technology. [Figure 2] This is a schematic diagram illustrating the acquisition of reconstructed sample values ​​based on the BV prediction mode. [Figure 3] This is a schematic diagram showing the predictions for Intra TMP. [Figure 4] This is a schematic diagram illustrating the template types in Intra TMP technology. [Figure 5] This is a schematic diagram of the template search area. [Figure 6] This is a schematic diagram of the adjacent block. [Figure 7] This is a schematic diagram of TM-FLM prediction. [Figure 8] This is a schematic diagram showing a block diagram of the encoder configuration according to an embodiment of the present disclosure. [Figure 9] This is a schematic diagram showing the configuration block diagram of a decoder according to an embodiment of the present disclosure. [Figure 10] This is a schematic diagram showing the network architecture of an encoding and decoding system according to an embodiment of the present disclosure. [Figure 11] This is a schematic diagram showing the flow of the decryption method according to the embodiments of this disclosure. [Figure 12] This is a schematic diagram of the transformation matrix selection process according to the embodiments of this disclosure. [Figure 13] This is a first schematic diagram showing the acquisition of reconstructed sample values ​​based on the BV prediction mode according to an embodiment of the present disclosure. [Figure 14] This is a second schematic diagram showing the acquisition of reconstructed sample values ​​based on the BV prediction mode according to an embodiment of the present disclosure. [Figure 15] This is a schematic diagram showing the flow of the encoding method according to the embodiments of this disclosure. [Figure 16] This is a first schematic diagram showing the configuration structure of an encoder according to an embodiment of the present disclosure. [Figure 17] This is a second schematic diagram showing the configuration structure of an encoder according to an embodiment of the present disclosure. [Figure 18] This is a first schematic diagram showing the configuration structure of a decoder according to an embodiment of the present disclosure. [Figure 19]This is a second schematic diagram showing the configuration structure of a decoder according to an embodiment of the present disclosure. [Modes for carrying out the invention]

[0017] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of these embodiments will be described in detail below with reference to the drawings. The drawings are for illustrative purposes only and do not limit the embodiments of this disclosure.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as that ordinarily understood by a person skilled in the art of this disclosure. The terms used herein are used solely for the purpose of describing embodiments of this disclosure and are not intended to limit this disclosure.

[0019] In the following description, when “some embodiments” is referred to, it describes a subset of all possible embodiments, but “some embodiments” may be the same subset or different subsets of all possible embodiments and can be combined with each other as long as they do not conflict. Also, the terms “first / second / third” in relation to embodiments of the disclosure are used solely to distinguish similar objects and do not represent a particular order of objects, and it should be understood that “first / second / third” may be interchangeable in any order or sequence that allows embodiments of the disclosure to be carried out in an order other than that illustrated or described herein, where permitted.

[0020] In video images, it is generally understood that coded blocks are represented using the first, second, and third color components. These three color components are the luminance component, the blue difference component, and the red difference component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue difference component by the symbol Cb or U, and the red difference component by the symbol Cr or V. Therefore, video images can be represented in either YCbCr format or YUV format.

[0021] Currently, there are two main types of prediction modes based on block vectors (BV): intrablock copy (IBC) and intratemplate matching prediction (IntraTMP).

[0022] Here, Intrablock Copy (IBC) is an extension tool for screen content coding in H.266 / Versatile Video Coding (VVC), significantly improving the coding efficiency of screen content sequences.

[0023] IBC is a block-level coding mode in which the coding side performs block matching (BM) to determine the block vector (BV) of the current coded block. This is also called the motion vector (MV), and the block vector is a vector from the current block to a reference block. The IBC block vector is retrieved by searching in the reconstruction region of the frame in which the current coded block resides (i.e., the current coded frame), and the IBC motion vector is retrieved by searching in the reference frame in the time domain of the current coded frame.

[0024] IntraTMP, a prediction method based on intra templates, is also an encoding mode that performs intra prediction based on BV (Block Value). In its search process, the matching criterion is not the degree of matching of the encoded block itself, but rather template matching (TM).

[0025] Low-Frequency Non-Separable Transform (LFNST) techniques primarily involve five steps: setting core parameters, intra-predictive mode mapping, transformation matrix selection, matrix multiplication calculation, and construction of the linear transformation coefficient matrix. Specifically, since the transformation matrix in LFNST is related to the directional characteristics of the predictive modes, the selection of the transformation matrix is ​​achieved by determining the set of transformations corresponding to the intra-predictive modes.

[0026] On the decoding side, taking IBC and IntraTMP modes as examples, the basic decoding process involves several steps: obtaining the BV, obtaining the predicted value using the BV, and determining the reconstructed value.

[0027] First, the BV (Bitstream Value) is determined. In actual implementation, there are several ways to obtain the BV. For example, the decoder may directly obtain the optimal BV by searching for BVs within a certain range, or the decoder may first build a list of BV candidates and then determine the specific information of the BV to be used based on the syntactic elements in the bitstream.

[0028] Next, the predicted value is determined based on the BV. Using the BV, data processing processes such as copying, filtering, and merging are usually performed on the corresponding region pointed to by the BV to obtain the predicted value for the current block.

[0029] Furthermore, by decoding the bitstream, prediction residuals are obtained, and then by processing such as adding the prediction residuals and the predicted values, the final reconstructed values ​​are obtained.

[0030] On the decoding side, residual values ​​are obtained by performing inverse quantization and inverse transform on the quantization coefficients obtained from the bitstream. Here, the transformation step may include a linear transformation, or a linear transformation and a quadratic transformation. During decoding, the inverse transform of the quadratic transformation is performed first, followed by the inverse transform of the linear transformation.

[0031] On the encoding side, the residual value (original) is first obtained by subtracting the predicted value from the original data. Then, after transformation, quantization, inverse quantization, and inverse transformation, the residual value necessary for reconstruction that matches the decoding side is obtained.

[0032] Figure 1 is a schematic diagram illustrating the application of LFNST technology, and as shown in Figure 1, it shows the application location of LFNST technology provided by the relevant technical solution. As shown in Figure 1, in intra-prediction mode, LFNST technology is applied between the positive linear conversion unit 11 and the quantization unit 12 on the encoder side, and between the inverse quantization unit 13 and the inverse linear conversion unit 14 on the decoder side.

[0033] In other words, on the encoder side, the predicted residual of the current transformation block can be obtained by obtaining linear transformation coefficients through a positive linear transformation. Then, some of the linear transformation coefficients are quadraticly transformed by matrix multiplication to obtain fewer, more concentrated quadratic transformation coefficients, and further quantization is performed on these coefficients. On the decoder side, after analyzing the quantized values, inverse quantization is performed on them, the coefficients after inverse quantization are inversely quadratic transformed by matrix multiplication, and then an inverse linear transformation is performed on the coefficients after the inverse quadratic transformation to restore the predicted residual.

[0034] Figure 2 is a schematic diagram illustrating the acquisition of reconstructed sample values ​​based on the BV prediction mode. As shown in Figure 2, the sample value reconstruction process mainly involves several steps: S1. Determination of block vectors, S2. Generation of initial predicted values, S3. Generation of final predicted values, S4. Intra-prediction mode mapping, S5. Determination of transformation block matrix, S6. Inverse transformation of quadratic transformation, S7. Inverse transformation of linear transformation, and S8. Generation of reconstructed values.

[0035] S1. Determination of block vectors (1) Brightness: Input: A luminance position (xCb, yCb) specifying the relative position of the top-left sample of the current encoding block to the current top-left luminance sample of the image; a variable cbWidth specifying the width of the current encoding block in the luminance sample; and a variable cbHeight specifying the height of the current encoding block in the luminance sample.

[0036] Output: Block vector of luminance (BVL: Block Vector Luma).

[0037] Here, the above search process is performed on the decryption side.

[0038] In IntraTMP mode, the coding block template (T) is used to search for the matching template (T_BEST) that minimizes cost within a predefined search range in the current image, according to a predetermined cost function. Here, the offset of the optimal matching template relative to the current coding block template is the optimal block vector (BV_BEST: BEST Block Vector), and then the reconstruction block (Ref Block) corresponding to the matching template is used as the prediction block for the current coding block (Cur Block). Here, the coding block template is usually selected from the adjacent reconstruction region of the current coding block.

[0039] As an example, taking the adjacent reconstruction region of the current block as an example, Figure 3 is a schematic diagram showing the prediction of Intra TMP. As shown in Figure 3, the shaded area represents the reconstruction region, the grid-filled block is the current block, and the adjacent region of the current block is the first template (T). The vertically filled block is the reference block, and the adjacent region of the reference block is the second template (i.e., the optimal matching template, T_BEST). Here, the offset of the second template relative to the first template is the optimal block vector (BV_BEST), and in this case, the reference block can be block-copied and used as the prediction block for the current block.

[0040] In embodiments of this disclosure, the predetermined cost function may be the sum of absolute errors (SAD), the sum of absolute transformation differences (SATD), the mean squared error (MSE), the sum of squared errors (SSD), the mean absolute difference (MAD), the mean sum of squared errors (MSD), the normalized correlation coefficient (NCC), and so on, and no specific limitations are made here.

[0041] As an example, taking the absolute sum of errors (SAD) as an example, the cost function in this case is as follows:

[0042]

number

[0043] Specifically, in IntraTMP mode, the template type is first retrieved, then template samples surrounding the current block are retrieved based on that type, and a search is performed within a predefined search range.

[0044] The template type can be represented by refTemplateType. Figure 4 is a schematic diagram showing template types in Intra TMP technology. As shown in Figure 4, the blocks filled with grid lines are the current blocks, and the adjacent regions of the current blocks are template T. Six types of template types are shown here.

[0045] For example, these six template types are as follows:

[0046] If the upper left reference sample, upper reference sample, and left reference sample are all available, the value of refTemplateType is 1, and the template shape is as shown in Figure 4(a).

[0047] If only the left-hand reference sample is available, the value of refTemplateType is 2, and the template shape is as shown in Figure 4(b).

[0048] If only the upper reference sample is available, the value of refTemplateType is 3, and the template shape is as shown in Figure 4(c).

[0049] If only the left-side reference sample and the upper-left-side reference sample are available, the value of refTemplateType is 4, and the template shape is as shown in Figure 4(d).

[0050] If only the left-side reference sample and the lower-left-side reference sample are available, the value of refTemplateType is 5, and the template shape is as shown in Figure 4(e).

[0051] If only the upper reference sample and the upper right reference sample are available, the value of refTemplateType is 6, and the template shape is as shown in Figure 4(f).

[0052] The search area of ​​the IntraTMP technology is limited to the already reconstructed portion of the current image and is restricted by the size of the search area. Figure 5 is a schematic diagram of the template search area. As shown in Figure 5, the dark-colored background area is the already reconstructed area, the black-colored background block is the current block, and the dashed line frame is the search area window. Therefore, the search area of ​​the IntraTMP technology is not larger than the overlapping area between the reconstructed area shown by the dark background and the area shown by the dashed line frame.

[0053] If the final BV is determined directly by predetermined matching criteria, the entry with the lowest cost will be the final BV.

[0054] When a list of BV candidates is constructed according to a predetermined matching criterion, this list stores multiple BV candidates in ascending order of cost, and then the corresponding syntactic elements in the bitstream determine which BV candidate or several BV candidates are ultimately selected. One or more BV candidates are used as the BVs to obtain initial prediction samples.

[0055] BVL

[0000] = BVCandList[ BVIdx ]

[0000] BVL

[0001] = BVCandList[ BVIdx ]

[0001] In actual IBC implementations, since there are multiple methods for obtaining the BV, the bitstream may contain mode information for the BV acquisition method and corresponding parameter information. For example, if the IBC MERGE mode is obtained in the syntax element, the decoder constructs a MERGE list, parses the MERGE list option index, and then obtains specific BV information from the corresponding option in the MERGE list based on the index. As another example, in the case of normal IBC mode, the decoder obtains specific BV information by decoding the value of the syntax element describing the BV or BV prediction difference in the bitstream.

[0056] IBC modes can be broadly classified into two main modes: IBC MERGE and IBC ABVP. The BV acquisition process for both can be considered as consisting of the following three steps.

[0057] (1) When deriving BVL, it is necessary to construct an IBC block vector candidate list BVCandList in all cases.

[0058] (2) Then, based on the bitstream, determine the candidates in the selected list.

[0059] (3) Finally, the final BV is determined based on the candidates.

[0060] The information that an IBC candidate specifically remembers includes at least one of the following:

[0061] i. Prediction direction (L0 or L1, L0 is generally the default) ii.BV information (horizontal, vertical components) iii. Reference frame (default is the current image) iv. Inversion type (e.g., no inversion, horizontal inversion, and vertical inversion) v. Use of LIC (linear model) The procedure for constructing candidate lists is similar to that of IBC MERGE lists, but the maximum number of candidates differs between the two (for example, the length of an IBC MERGE candidate list is defined as 6, while the length of an IBC ABVP candidate list is defined as 2).

[0062] Step 1: Derivation of spatial candidates: When the usage conditions are met (for example, when the size condition IsGt4by4 is TRUE (TRUE if luminance width × height is greater than 16)), the process of deriving a candidate spatial block vector from adjacent coding units as defined in the decoding standard is invoked, taking the luminance coded block position (xCb, yCb), luminance coded block width cbWidth, and height cbHeight as input. The output is availability flags such as availableFlagA1, availableFlagB1, and block vectors BVA1, BVB1.

[0063] Candidate availability detection is as follows: It is determined whether all of the following conditions are met; if all are met, it is available. These conditions are: The offset position obtained by adding the BVP to the current block position must not exceed the Picture boundary. The block position indicated by adding BVP to the current block position must not overlap with the current block. The offset position obtained by adding BVP to the current block position must not exceed the IBC available area. This means that the block position indicated by adding BVP to the current block position has already been reconstructed.

[0064] Here, A1 and B1 are adjacent blocks. Figure 6 is a schematic diagram of adjacent blocks, and as shown in Figure 6, the relative positions of the adjacent blocks where A1 and B1 reside with respect to the current encoded block are the lower left corner and the upper right corner, respectively. Here, the scan order can be A1->B1->B0->A0->B2.

[0065] Step 2: Add the spatial candidate to the candidate list: When the usage conditions are met (for example, the size condition IsGt4by4 is TRUE), the block vector candidate list BVCandList is constructed as follows:

[0066] i = 0 if( availableFlagA1 ) BVCandList[i++] = BVA1 if( availableFlagB1 ) BVCandList[i++] = BVB1 ... Step 3: Check the number of valid entries in the candidate list: The derivation process for the variable numCurrCand (the number of candidates obtained so far) is as follows:

[0067] If the usage conditions are met (for example, if the size condition IsGt4by4 is TRUE), numCurrCand is set to be equal to the number of candidates in BVCandList. Otherwise, numCurrCand is set to 0.

[0068] Step 4: If the candidate list has not reached the specified number of entries (for example, 6 entries for IBC MERGE mode, 2 entries for IBC ABVP mode), proceed with deriving historical candidates, detecting availability, and adding: If numCurrCand is less than MaxNumIbcMERGECand (maximum number of candidates in IBC MERGE mode) and NumHmvpIbcCand (maximum number of candidates for the history-optimal block vector (Hmvp) in IBC mode) is greater than 0, the process for deriving IBC block vector candidates based on the history defined in the decoding standard is invoked, with BVCandList and numCurrCand as inputs and the modified BVCandList and numCurrCand as outputs.

[0069] Step 5: Verify the number of valid entries in the candidate list and continue adding other available candidates (e.g., pair mean candidates, zero-value BV candidates, etc.) until the specified number of entries is reached.

[0070] In the process of determining candidates in the selected list based on the bitstream, in IBV MERGE mode (general_MERGE_flag[xCb][yCb] is true) and IBC ABVP mode (general_MERGE_flag[xCb][yCb] is false), the candidate index BVIdx is derived as follows, and general_MERGE_flag indicates whether or not it is IBC MERGE mode.

[0071] BVIdx = general_MERGE_flag[xCb][yCb] ? MERGE_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb] In the process of determining the final BV based on the candidates, a specific BVL can be obtained in IBC MERGE mode based on the index BVIdx and the block vector candidate list BVCandList.

[0072] BVL

[0000] = BVCandList[ BVIdx ]

[0000] BVL

[0001] = BVCandList[ BVIdx ]

[0001] This BVL will be the final BV.

[0073] In IBC MBVD mode, similar to MMVD in VVC's inter-technology, a specific candidate from the IBC MERGE list is used as a starting point, and a candidate is selected from a set of candidate points corresponding to a predefined set of distances and directions, with the corresponding block vector being the final BV.

[0074] For example, in IBC MBVD, the distance set is defined as {1-pel, 2-pel, 4-pel, 8-pel, 12 pel, 16 pel, 24 pel, 32 pel, 40 pel, 48 pel, 56 pel, 64 pel, 72 pel, 80 pel, 88 pel, 96 pel, 104 pel, 112 pel, 120 pel, 128 pel}, and the BVD directions are two positive and negative horizontal directions and two positive and negative vertical directions.

[0075] The basic candidate is selected from the first five candidates in the reordered IBC MERGE list, and the refinement positions of the basic candidate's partial or all possible MBVDs (i.e., 20 × 4 candidates) are reordered based on the SAD cost between the template and the reference of each refinement position. Finally, the first eight refinement positions with the minimum template SAD are retained for MBVD index coding. The IBC-MBVD candidates do not inherit the inversion type from the RR-IBC coded adjacent blocks. The MBVD index is binarized by a Rice code with parameter 1.

[0076] In IBC TM MERGE mode, after obtaining the BVL based on the above information, local refinement of the BV can be performed using TM. Specifically, a search is performed within a small range centered on the obtained BVL, and the optimal BV within that range is selected as the final BV based on the criterion of minimizing the template matching cost.

[0077] The specific implementation process for refining the TM (Technical Response) for the candidate list of IBC MERGE mode is as follows:

[0078] When constructing candidates, the inversion type will default to no inversion; In IBC TM MERGE mode, a syntactic element is sent to specify whether to perform integer sample-precision TM refinement. The refinement motion vector and the position of the template used in each refinement step must conform to the constraints of the reference area.

[0079] A search is performed near the location indicated by the candidate, and the optimal location is determined using the SAD size between the template of the referenced block and the template of the current block.

[0080] On the other hand, in IBC ABVP mode, the BVL obtained by the index BVIdx and the block vector candidate list BVCandList is a predicted BVL, and the true BVL requires the addition of the block vector difference (BVD).

[0081] The final derived BV must satisfy the specified range (a coordinate range in terms of rows and columns).

[0082] (2) Chromatic difference: The BV of chromatic difference can be derived based on the luminance BV, and then prediction and reconstruction can be performed based on that BV. The process for deriving the chromatic difference BV based on the luminance BV is as follows.

[0083] Input: BVL of luminance (1 / 16 sample accuracy) Output: BVC (Block Vector Chroma) of color difference (1 / 32 sample precision) The derivation process may be direct scaling, or it may be refined using TM after scaling. Examples of scaling operations are as follows:

[0084] BVC

[0000] = ( ( BVL

[0000] >> ( 3 + SubWidthC ) ) × 32) BVC

[0001] = ( ( BVL

[0001] >> ( 3 + SubHeightC ) ) × 32) The variables SubWidthC and SubHeightC specifically depend on the color difference format sampling structure specified by sps_chroma_format_idc, and the specific correspondence is as follows:

[0085] [Table 1]

[0086] S2. Generating initial predicted values: Input: Luminance position (xCb, yCb) specifying the relative position of the top-left sample of the current encoded block to the current top-left luminance sample of the image; variable cbWidth specifying the width of the current encoded block in the luminance sample; variable cbHeight specifying the height of the current encoded block in the luminance sample; block vector (BV); variable cIdx specifying the color component index of the current block.

[0087] Output: Predicted sample sequence predSamples.

[0088] An example of a derivation process to obtain a predicted block by directly copying is as follows:

[0089] When cIdx is 0, i.e., the luminance component, for x = xCb..xCb + cbWidth - 1 and y = yCb..yCb + cbHeight - 1: xVb = ( x + ( BVL

[0000] >> 4 ) ) & ( IbcBufWidthY - 1 ) yVb = ( y + ( BVL

[0001] >> 4 ) ) & ( CtbSizeY - 1 ) predSamples[ x ][ y ] = ibcVirBuf

[0000] [ xVb ][ yVb ] IbcBufWidthY is the luminance sample width of the IBC storage's reconfiguration buffer, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconfiguration sample of the IBC storage.

[0090] For cIdx not being 0, i.e., for the chromatic difference component, for x = xCb / SubWidthC..xCb / SubWidthC + cbWidth / SubWidthC - 1 and y = yCb / SubHeightC..yCb / SubHeightC + cbHeight / SubHeightC - 1: xVb = ( x + ( BVC

[0000] >> 4 ) ) & ( IbcBufWidthC - 1 ) yVb = ( y + ( BVC

[0001] >> 4 ) ) & ( ( CtbSizeY / subHeightC ) - 1 ) predSamples[ x ][ y ] = ibcVirBuf[ cIdx ][ xVb ][ yVb ].

[0091] S3. Generating the final predicted values: In IntraTMP mode, in addition to obtaining predicted values ​​using the basic copy method, there are methods to obtain predicted values ​​by fusing multiple BV-corresponding locations, by filtering the reference blocks corresponding to the BVs before copying, and by subpixelating the BVs and interpolating their corresponding reference blocks before copying.

[0092] For example, in the decoding region search process, a list of BV candidates is obtained using template matching, and then the first N entries (e.g., N=3) are selected for weighted fusion. This method can be called IntraTMP Fusion mode.

[0093] Alternatively, after obtaining one optimal BV, multiple points are acquired around that BV, and the predicted values ​​corresponding to these points are weighted and merged to obtain the final predicted value. This method can be called IntraTMP FLM mode.

[0094] Alternatively, after obtaining one optimal BV, the templates are sorted by subpixel precision, the optimal direction and precision are selected, and the predicted values ​​are calculated using an interpolation filter. This method can be called IntraTMP SubPel mode.

[0095] In IBC mode, in addition to the basic method of obtaining predicted values ​​by copying as described above, IBC inversion mode requires a method of obtaining predicted values ​​after horizontally or vertically inverting the prediction region. For example, it indicates whether or not to invert a certain syntactic element, and if so, whether it is a horizontal or vertical inversion. The decoding side obtains the predicted sample values ​​of the encoded block by rearranging the reference region samples in reverse order horizontally or vertically based on the instructions of that syntactic element.

[0096] Alternatively, a template can be used to establish a model between the current block and the prediction region, process the prediction block according to the model, and then obtain the predicted value for the current block. For example, the IBC LIC mode is applied to IBC MERGE and IBC ABVP and uses a linear equation to compensate for local illumination changes. Similar to the LIC for interpretation of VVCs, the parameters of the linear equation can be expressed in terms of a scaling parameter α and an offset parameter β, i.e., α × p[x] + β compensates for illumination changes, where p[x] is the reference sample pointed to by the BV position x on the current image. The linear model parameters are derived using the least squares method.

[0097] Based on obtaining the predicted values ​​described above, there is also an FIBC mode, which establishes a linear model between the reference block template corresponding to the BV and the current block template, obtains filter coefficients, and then applies this linear filter model to the current block to obtain the final predicted value. There is also a prediction mode that fuses multiple IBC prediction blocks, determined by the relationship between multiple prediction blocks and the current block template, similar to the IntraTMP Fusion mode.

[0098] Based on the obtained prediction values ​​described above, weighted prediction can be performed using other intra-prediction methods, and the results after weighted prediction can be used as the final prediction result.

[0099] Weighted prediction methods include those that reference VVC's Inter-Intra Mixed Prediction (CIIP) method. This method weights and combines the results obtained by the above prediction process with the prediction results obtained by the normal intra-directional prediction mode at each sample location. It also includes methods that reference VVC's Inter-Geometric Prediction Mode (GPM) (Geometric Partitioning Mode). This method is based on a wedge-shaped partition and uses the results obtained by different prediction modes in different wedge-shaped regions, performing a weighted mixing near the wedge-shaped partition line that conforms to a certain rule.

[0100] The implementation process for some of the methods described above will be detailed below.

[0101] Intra TMP technology offers different prediction methods depending on the prediction mode. For example, in Intra TMP Fusion technology, after obtaining block vectors (BVs) corresponding to N candidate templates, N candidate reconstruction blocks are obtained using the BVs, and then weighted fusion is performed on the N candidate reconstruction blocks to obtain the predicted block for the current encoded block. Specifically, the final predicted value is generated by obtaining N candidate reconstruction blocks, determining weighted fusion weights, and then generating the predicted value through weighted fusion.

[0102] Here, when obtaining N candidate reconstruction blocks, block vectors (BV) corresponding to the N candidate templates are obtained. BV n based on which the candidate reconstruction block RefBlock is obtained from the current image n directly. Here, the horizontal offset of BV n is pX n , the vertical offset is pY n , and n=0,1...,N-1.

[0103] This is implemented by simple translational copying. For specific operations, for x=0...nTbW-1, y = 0...nTbH-1: RefBlock n [x][y] = recSamples[x + pX n [y + pY n Here, recSamples represents reconstructed samples of the current frame.

[0104] When determining weighted fusion weights, after obtaining N candidate reconstruction blocks RefBlock, it is necessary to calculate the weighted fusion weights W of the N candidate reconstruction blocks. The weights may be predefined fixed values, or may be values adaptively calculated using cost values, sample values, etc.

[0105] In an embodiment of the Intra TMP Fusion technique, the candidate template refT n and the template to be predicted refpredT n the weighted fusion weights are derived by using minimizing the MSE between the reconstructed value of and the sample value of.

[0106] Specifically, the MSE minimization process takes as input the autocorrelation matrix of the previous P matching reference samples refT, and the cross-correlation vector of the previous P matching reference samples refT and the current coded block adjacent template sample curT, and outputs the weight of the reconstruction block corresponding to each matching reference entry.​

[0107] When generating predicted values ​​by weighted fusion, the predicted block is calculated based on each candidate reconstruction block and its corresponding weighted fusion weight. Specifically, the current predicted block is obtained (i.e., the weighted prediction) by multiplying the value of each candidate reconstruction block by its corresponding weight and accumulating the results.

[0108] For x = 0…nTbW-1 and y = 0…nTbH-1, the calculation of the predicted value is as shown in the following formula.

[0109]

number

[0110] IntraTMP FLM mode, a linear filter model is established using the optimal matching template found in the previous step and the current coded block template. This primarily involves two processes: determining the reconstruction region used to calculate the filter coefficients, and calculating the filter coefficients. The specific calculation process for the predicted values ​​is as follows:

[0111] Figure 7 is a schematic diagram of the TM-FLM prediction. As shown in Figure 7, assuming that the number of filter taps nTap is 5, the shape of this filter is as shown in the left figure, and c0 to c4 are the respective tap coefficients of this filter. Here, the point corresponding to the tap coefficient c0 is the current target sample Y for prediction. pred [i][j] is the reconstructed sample ref[i][j] at the corresponding position within the optimal matching block. The other points are reconstructed samples adjacent to the current spatial position within the optimal matching reconstruction block. The points in the right figure represent the obtained predicted sample Y. pred [i][j]

[0112] The specific calculation process for the predicted values ​​is as follows:

[0113] For each current sample to be predicted (i,j), the sample position in the filter template is defined as (k,l), the corresponding reconstructed sample in the optimal matching block during filtering is defined as ref[i + k][j + l], and each filter coefficient at the (k,l) position in the filter template is defined as c k,l This is how it is defined.

[0114]

number

[0115] For i=0,…,nTbW-1 and j=0,…,nTbH-1:

number

number

number

[0116] In IBC technology, in IBC inversion mode, it is necessary to use a horizontally or vertically inverted version of the prediction region as a method for obtaining the predicted value. For example, it is necessary to indicate whether or not to invert a certain syntactic element, and if so, whether to invert it horizontally or vertically. The decoding side obtains the predicted sample value of the encoded block by rearranging the reference region samples in reverse order horizontally or vertically based on the instructions of that syntactic element.

[0117] The IBC LIC mode uses a template to establish a model between the current block and the prediction region, processes the prediction block according to the model, and then obtains the predicted value for the current block. The IBC LIC mode is applied to IBC MERGE and IBC ABVP and compensates for local illumination changes using a linear equation. Similar to the LIC for interpretation of VVCs, the parameters of the linear equation can be expressed in terms of a scaling parameter α and an offset parameter β, i.e., α × p[x] + β compensates for illumination changes, where p[x] is the reference sample pointed to by the BV position x on the current image. The linear model parameters are derived using the least squares method.

[0118] In Filter IBC mode, a linear model is established between the current block template and the reference block template corresponding to the BV, the filter coefficients are obtained, and then used for the current block to obtain the final predicted value.

[0119] The specific calculation process for the predicted values ​​is as follows:

[0120] For each current sample to be predicted (i,j), the sample position in the filter template is defined as (k,l), the corresponding reconstructed sample in the optimal matching block during filtering is defined as ref[i + k][j + l], and each filter coefficient at the (k,l) position in the filter template is defined as c k,l This is how it is defined.

[0121]

number

[0122] For i=0,…,nTbW-1 and j=0,…,nTbH-1:

number

number

[0123] Weighted prediction methods include those that reference VVC's Inter-Intra Mixed Prediction (CIIP) method. This method weights and combines the results obtained by the above prediction process with the prediction results obtained by the normal intra-directional prediction mode at each sample location. It also includes methods that reference VVC's Inter-Geometric Prediction Mode (GPM) method. This method is based on a wedge-shaped partition and uses the results obtained by different prediction modes in different wedge-shaped regions, performing a weighted mixing near the wedge-shaped partition line that conforms to a certain rule.

[0124] An example of an operation process in BV-based CIIP mode: The BV-based predicted value of the current block is weighted and merged with the predicted value of a certain intra-mode. The BV-based predicted portion can be obtained by applying the usual MERGE, TM MERGE, MBVD, and ABVP modes.

[0125] If the BV-based prediction portion is in a different mode, different weights can be set. For example, if the mode of the BV-based prediction portion is the normal IBC MERGE, TM MERGE, or MBVD mode, the weight ratio of the BV-based prediction to the intra-prediction is 13:3, and the intra-mode includes the TIMD mode of the current block and the intra-prediction mode at the candidate BV location. If the second prediction mode and the first prediction mode in the intra-mode are the same, it is determined whether the first prediction mode is the PLANAR mode, and if so, the second prediction mode is replaced with the horizontal prediction mode; otherwise, the second prediction mode is replaced with the PLANAR mode. If the BV-based prediction portion is in the ABVP mode, the weight ratio of the BV-based prediction to the intra-prediction is 1:1, and the TIMD mode is taken as the first prediction mode of the intra-prediction mode, and if the derived prediction mode is the horizontal prediction mode, PLANAR is taken as the second prediction mode of the intra-prediction mode; otherwise, the horizontal prediction mode is taken as the second prediction mode of the intra-prediction mode.

[0126] Example of an operating process in BV-based GPM mode: The BV-based prediction portion can be obtained by applying normal MERGE and TM MERGE.

[0127] For example, one partition can be a BV-based prediction mode and the other partition an INTRA mode. The same method as for interGPM is used to construct the intra-prediction mode (IPM) candidate list, with the size of the IPM candidate list being predefined as 3.

[0128] In practical terms, there are a total of 48 different geometric partitioning modes, which can be divided into two sets of geometric partitioning modes.

[0129] [Table 2]

[0130] [Table 3]

[0131] When using BV-based GPM, a flag for the BV-based GPM (e.g., IBC-GPM) geometric partition mode set is transmitted to indicate whether the first or second geometric partition mode set is selected. Then, the geometric partition mode index is transmitted. Furthermore, a BV-based GPM (or IBC-GPM) intra-partition flag is transmitted to indicate whether intra-prediction is used for the first subpartition. Here, the intra-prediction portion must transmit the intra-prediction mode index, and the IBC prediction portion must transmit the MERGE index.

[0132] S4. Intra Predictive Mode Mapping: Using the final predicted values ​​as input, the vertical and horizontal gradients of all predicted samples are calculated, and the direction with the greatest gradient is mapped to a kind of conventional intra-prediction mode.

[0133] This method is similar to existing DIMD techniques, namely, it uses gradient information between samples within a block to derive the dominant prediction direction.

[0134] One feasible approach is to use the Sobel operator to calculate the horizontal and vertical slopes of the final BV prediction. The formula for the Sobel operator is as follows: where G x This is used to calculate the horizontal slope, G y This is used to calculate the vertical slope.

[0135]

number

[0136] The input to this process is a predicted value p[x][y] based on the BV prediction mode, where x = 0..nTbW -1 and y = 0..nTbH -1, where nTbW represents the width of the transformed block obtained by the current BV prediction and nTbH represents the height of the transformed block obtained by the current BV prediction.

[0137] The output of this process is the conventional intra-prediction mode, IntraPredModeD, which is between [0,66].

[0138] mapHgV = {{2,1}, {1,2}} and mapVgH = {{3,4}, {4,3}} are set.

[0139] The table angTable is set to { 0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536}.

[0140] The value angOffset = {18, 18, 50, 50} is set.

[0141] HoG

[67] is set up as an array containing the gradient strengths for each conventional intra-prediction mode. At the start of this process, all values ​​in all HOG arrays are initialized to 0.

[0142] For each prediction sample p[x][y], if the conditions with x = 1…nTbW-2 and y = 1…nTbH-2 are met, the calculation process is as follows.

[0143] Calculate the horizontal gradient gHor[ x ][ y ] = p[x-1][y-1] + 2p[x-1][y] + p[x-1][y+1] - p[x+1][y-1] - 2p[x+1][y] - p[x+1][y+1].

[0144] Calculate the vertical gradient gVer[ x ][ y ] = p[x-1][y-1] + 2p[x][y-1] + p[x+1][y-1] - p[x-1][y+1] - 2p[x][y+1] - p[x+1][y+1].

[0145] Calculate iAmp[x][y] = abs(gHor[ x ][ y ]) + abs(gVer[ x ][ y ]).

[0146] Calculate signH[x][y] = gHor[x][y] < 0 ? 1 : 0.

[0147] Calculate signV[x][y] = gVer[x][y] < 0 ? 1 : 0.

[0148] Calculate HgV[x][y] = (abs(gHor[x][y]) > abs(gVer[x][y]) ? 1 : 0).

[0149] Calculate region[ x ][ y ] = (HgV[ x ][ y ] = = 1 ? mapHgV[ signH[ x ][ y ] ][ signV[ x ][ y ] ] :mapVgH[ signH[ x ][ y ] ][ signV[ x ][ y ] ]).

[0150] Calculate grad[ x][ y ] = (HgV[ x ][ y ] = = 1 ? abs(gVer[ x ][ y ]) / abs(gHor[ x ][ y ]) : abs(gVer[ x ][ y ]) / abs(gHor[ x ][ y ])).

[0151] Calculate grad[ x ][ y ] = round( grad[ x ][ y ] × (1 << 16) ).

[0152] Index angIdx[ x ][ y ] = argmin i Calculate (abs( angTable[ i ] - grad[ x ][ y ])).

[0153] In intra-mode, calculate ipm[ x ][ y ] = angOffset[ region[ x ][ y ] ] + angIdx[ x ][ y ].

[0154] Set HOG[ipm[ x ][ y ]] = HOG[ipm[ x ][ y ]] + iAmp[x][y].

[0155] If there are no non-zero amplitudes in HOG: Set IntraPredModeD to PLANAR Otherwise: IntraPredModeD to argmax i Set to (HoG[i]) Here, argmax i (L[i]), i=0,…,N returns the index from 0 to N that maximizes L (if there are multiple maximum values, the smaller index is returned). argmin i (L[i]), i=0,…,N returns the index from 0 to N that minimizes L (if there are multiple minimum values, the smaller index is returned).

[0156] Finally, map IntraPredModeD to predModeIntra.

[0157] S5. Determination of the transformation block matrix: Determining the transformation matrix is ​​divided into three steps: determining the transformation set, determining the transformation matrix group, and determining the transformation matrix size.

[0158] Here, when determining the transformation set, a selection is made among the four transformation sets (set0, set1, set2, set3) based on the intra prediction mode (predModeIntra) after the previous mapping, thereby determining the corresponding transformation set. The specific correspondences are shown in the table below.

[0159] [Table 4]

[0160] When determining the transformation matrix group, the choice of which of the two transformation matrix groups in the transformation set to select is determined based on the lfnst_idx transmitted from the encoding side. If lfnst_idx is 1, the first transformation matrix group is selected; if lfnst_idx is 2, the second transformation matrix group is selected.

[0161] When selecting the transformation matrix size, each transformation matrix group includes two sizes of elementary transformation matrices, with the sizes used on the decoding side being 16x16 and 48x16. The selection is based on nLfnstOutSzie; if nLfnstOutSzie is 16, the 16x16 elementary transformation matrix is ​​selected, and if nLfnstOutSzie is 48, the 48x16 elementary transformation matrix is ​​selected. If nonZeroSize is 8, only the first 8 rows of the transformation matrix are used for matrix multiplication calculations.

[0162] Here, the length of the linear transformation coefficient vector can be represented by nLfnstOutSzie.

[0163] S6. Inverse transform of a quadratic transform: Taking the inverse quadratic transformation coefficient vector u[i], i=0…nonZeroSize-1 as input, we multiply it using the transformation matrix to obtain the inverse linear transformation coefficient vector v[j], j=0…nLfnstOutSzie-1.

[0164] S7. Inverse transformation of a linear transformation: Using the one-dimensional inverse linear transformation coefficient vector v[j], j=0…nLfnstOutSzie-1, the two-dimensional inverse linear transformation coefficient matrix d'[x][y], x=0…nLfnstSize-1, y=0…nLfnstSize-1 of the current transformation block is constructed. Depending on the difference in intra-prediction mode, there are two types of filling scan orders: horizontal scan mode and vertical scan mode. Then, the inverse linear transformation coefficient matrix is ​​used to perform the inverse transform of the linear transformation and generate the prediction residual.

[0165] S8. Generating reconstructed values: This invokes the image reconstruction process for the specified color components defined in the decoding standard. To perform the reconstruction operation, for modes with residuals, the predicted signal and the residual signal must be added together.

[0166] Common BV-based prediction techniques, such as Intra TMP or IBC, use the best-matching reconstruction block (Ref Block) as the prediction block for the current encoded block (Cur Block). Based on the ultimately generated prediction block, they utilize Decoder-side Intra Mode Derivation (DIMD) techniques to derive the intra-directional prediction mode and determine the LFNST transformation set. When obtaining prediction values ​​using BV-based prediction methods, sub-pixel processing, filtering, or fusion is often required, and the processed values ​​are used to derive the LFNST transformation set.

[0167] However, the processed predicted values ​​obtained after data processing such as subpixel processing, filtering, or fusion lose some texture edge information, making it impossible to obtain the most accurate prediction direction in the subsequent derivation process. This affects the accuracy of the subsequent LFNST transformation set derivation to some extent. In other words, the derived LFNST transformation set is not necessarily the best match, leading to a decrease in encoding and decoding performance.

[0168] Furthermore, on the decoding side, the residuals undergo inverse quantization, then an inverse transform by LFNST in the direction derived by DIMD, and are then added to the predicted value to generate the reconstructed value. This means that after generating the predicted value, it is necessary to wait for the inverse LFNST transform in the direction derived by DIMD, then perform a linear inverse transform, and then send them together to the reconstructed value generation module, resulting in a long critical path and low efficiency. In other words, the prediction process, which sequentially executes prediction block processing, LFNST transform set derivation, and inverse transform processing, also suffers from high complexity, which reduces encoding and decoding efficiency.

[0169] Therefore, it is clear that general BV-based prediction techniques suffer from the problem of low encoding and decoding efficiency and poor performance.

[0170] To solve the above problems, embodiments of the present disclosure propose an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium. The encoder and decoder determine prediction parameters corresponding to the current block, determine a first reference block of the current block based on the prediction parameters of the current block, determine a first transformation parameter of the current block based on the first reference block of the current block, determine a prediction block of the current block based on the first reference block of the current block, and determine a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. In other words, in embodiments of the present disclosure, after determining the first reference block of the current block based on the prediction parameters, it is possible to choose to directly use the first reference block, which has not undergone data processing, to determine the transformation parameters of the current block, and then combine the determined transformation parameters with the prediction block of the current block obtained by data processing the first reference block to complete the reconstruction of the current block. Here, the data processing process loses some of the texture edge information of the prediction block. Therefore, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block). By using the first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, thereby effectively improving the performance of encoding and decoding. At the same time, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block and generating the transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding, solving the problem of high complexity, and thereby improving the encoding and decoding efficiency. Thus, the encoding and decoding methods according to the embodiments of this disclosure can improve the efficiency and performance of encoding and decoding.

[0171] The embodiments of this disclosure will be described in detail below with reference to the drawings.

[0172] Referring to Figure 8, this is a schematic diagram showing a configuration block diagram of the encoder provided by an embodiment of the present disclosure. As shown in Figure 8, the encoder (specifically, the “video encoder”) 100 may include a transform / 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 / inverse quantization unit 106, a filter control analysis unit 107, a filter unit 108, an encoding unit 109, and a decoding image buffer unit 110, etc. Here, the filter unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information coding and context-based adaptive binary arithmetic coding (CABAC). For the input original video signal, video coding blocks can be obtained by dividing the Coding Tree Unit (CTU). Subsequently, the residual sample information obtained after intra or interprediction is transformed by the transformation / quantization unit 101. This transformation includes converting the residual information from the sample region to the transformation region and quantizing the resulting transformation coefficients, which is used to further reduce the bitrate. The intraestimation unit 102 and intraprediction unit 103 are used to perform intraprediction on the video coding block. Specifically, the intraestimation unit 102 and intraprediction unit 103 are used to determine the intraprediction mode that should be used to encode the video coding block. The motion compensation unit 104 and motion estimation unit 105 are used to perform interpredictive coding on the received video coding block for one or more blocks within one or more reference frames, and to provide time prediction information.Motion estimation, performed by the motion estimation unit 105, is a process that generates motion vectors, which can estimate the motion of the video coding block. Then, motion compensation is performed by the motion compensation unit 104 based on the motion vectors determined by the motion estimation unit 105. After determining the intra-prediction mode, the intra-prediction unit 103 is used to provide further selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also transmits the calculated determined motion vector data to the coding unit 109. Furthermore, the inverse transform / inverse quantization unit 106 is used for the reconstruction of the video coding block, reconstructing the residual block in the sample region. The reconstructed residual block is then filtered by the filter control analysis unit 107 and the filter unit 108 to remove blocking artifacts. The reconstructed residual block is then added to the prediction block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block. The encoding unit 109 is used to encode various encoding parameters and post-quantization conversion coefficients. In a CABAC-based encoding algorithm, the context content can be used to encode information indicating the determined intra-prediction mode based on adjacent encoding blocks, and outputs a bitstream of the video signal. Meanwhile, the decoding image buffer unit 110 is used to store the reconstructed video encoding blocks and is used for prediction reference. As the encoding of the video image progresses, new reconstructed video encoding blocks are constantly generated, and all of these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.

[0173] Referring to Figure 9, this is a schematic diagram showing the configuration block diagram of the decoder provided by an embodiment of the present disclosure. As shown in Figure 9, the decoder (specifically, the “video decoder”) 200 may include a decoding unit 201, an inverse transform / inverse quantization unit 202, an intra prediction unit 203, a motion compensation unit 204, a filter unit 205, and a decoded image buffer unit 206, etc. Here, the decoding unit 201 can perform header information decoding and CABAC decoding, and the filter unit 205 can perform deblocking filtering and SAO filtering. The input video signal undergoes the encoding process shown in Figure 8 and outputs a bitstream of the video signal. This bitstream is input to the decoder 30, which first passes through the decoding unit 201 and is used to obtain the decoded transformation coefficients. These transformation coefficients are then processed by the inverse transform / inverse quantization unit 202 to generate residual blocks in the sample region. The intra-prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-prediction mode and data from previously decoded blocks of the current frame or image. The motion compensation unit 204 determines prediction information for the video decoding block by analyzing the motion vector and other relevant syntactic elements, and uses this prediction information to generate a prediction block for the video decoding block being decoded. The decoded video block is formed by adding the residual block from the inverse transform / inverse quantization unit 202 with the corresponding prediction block generated by the intra-prediction unit 203 or the motion compensation unit 204. The decoded video signal can then be filtered by the filter unit 205 to remove blocking artifacts and improve video quality. The decoded video block is then stored in the decoded image buffer unit 206, which stores a reference image for subsequent intra-prediction or motion compensation and is also used for outputting the video signal, i.e., obtaining the restored original video signal.

[0174] Furthermore, embodiments of the present disclosure also provide a network architecture for an encoding and decoding system including an encoder and a decoder. Here, Figure 10 shows a schematic diagram of the network architecture of an encoding and decoding system provided by embodiments of the present disclosure. As shown in Figure 10, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, where the electronic devices 13 to 1N can perform video interaction via the communication network 01. The electronic devices may be various types of devices having video encoding and decoding capabilities in the implementation process, for example, the electronic devices may include smartphones, tablet computers, personal computers, personal digital assistants, navigation devices, digital telephones, video phones, televisions, sensing devices, servers, etc., and embodiments of the present disclosure do not make any specific limitations. Here, the decoder or encoder described in embodiments of the present disclosure may be the above-mentioned electronic devices.

[0175] The methods of the embodiments of this disclosure are mainly applied to the intra-prediction unit 103 shown in Figure 8 and the intra-prediction unit 203 shown in Figure 9. In other words, the embodiments of this disclosure can be applied to an encoder, a decoder, or both an encoder and a decoder simultaneously, but the embodiments of this disclosure do not impose any specific limitations.

[0176] Furthermore, when applied to the intra-prediction unit 103, "current block" specifically refers to the coded block on which the current intra-prediction should be performed. When applied to the intra-prediction unit 203, "current block" specifically refers to the decoded block on which the current intra-prediction should be performed.

[0177] One embodiment of the present disclosure proposes a decoding method which is applied to a decoder. Figure 11 is a schematic diagram showing the flow of the decoding method according to an embodiment of the present disclosure, and as shown in Figure 11, the decoding process performed by the decoder may include the following steps.

[0178] In step 1101, the prediction parameters corresponding to the current block are determined.

[0179] In embodiments of this disclosure, the prediction parameters corresponding to the current block can first be determined.

[0180] The decoding method of the embodiments of this disclosure is applied to a decoder. This decoding method may also include a type of intra-prediction method, more specifically, a type of color component prediction method. Here, a video image can be divided into a plurality of decoding blocks, each decoding block may include a first color component, a second color component, and a third color component, and the current block in the embodiments of this disclosure refers to the decoding block in the video image for which intra-prediction is currently to be performed.

[0181] Here, if a prediction needs to be made for the first color component, the component to be predicted will be the first color component. If a prediction needs to be made for the second color component, the component to be predicted will be the second color component. If a prediction needs to be made for the third color component, the component to be predicted will be the third color component. Also, assuming that the current block makes a prediction for the first color component, and the first color component is the luminance component, that is, the component to be predicted is the luminance component, then the current block can also be called a luminance block. Alternatively, assuming that the current block makes a prediction for the second color component, and the second color component is the color difference component, that is, the component to be predicted is the color difference component, then the current block can also be called a color difference block.

[0182] In the embodiments of this disclosure, the prediction parameter corresponding to the current block may include the block vector of the current block.

[0183] In the embodiments of this disclosure, the first reference block is located within the same image as the current block. Correspondingly, the block vector represents the positional offset between the current block and the first reference block.

[0184] As understood, in embodiments of this disclosure, in the intra-prediction mode, the first reference block of the current block can be determined based on the block vector of the current block.

[0185] In embodiments of this disclosure, the prediction parameters corresponding to the current block may include the motion vector and reference image index of the current block.

[0186] In the embodiments of this disclosure, the first reference block is located within a reference image indicated by a reference image index. Correspondingly, the motion vector represents the positional offset between the current block and the first reference block.

[0187] As understood, in embodiments of this disclosure, in the interprediction mode, the first reference block of the current block can be determined based on the motion vector of the current block.

[0188] In this embodiment of the disclosure, the prediction parameter corresponding to the current block is an example block vector (BV), and the transformation scheme is an example LFNST, and the decoding method according to this embodiment will be explained exemplarily.

[0189] Furthermore, in embodiments of this disclosure, when determining the block vector of the current block, a first template corresponding to the current block can be determined first, a predetermined search area can be determined, a search can be performed within the predetermined search area, and the block vector of the current block can be determined.

[0190] Furthermore, in embodiments of this disclosure, when determining the block vector of the current block, a first template corresponding to the current block can be determined first, a predetermined search area can be determined, a search can be performed within the predetermined search area to construct a list of candidate block vectors for the current block, and the block vector of the current block can be determined based on the list of candidate block vectors.

[0191] Furthermore, in embodiments of this disclosure, when determining the block vector of the current block, the block vectors of the adjacent blocks corresponding to the current block can be determined first, a list of candidate block vectors for the current block can be constructed based on the block vectors of the adjacent blocks, and the block vector of the current block can be determined based on the list of candidate block vectors.

[0192] For example, in some embodiments, when acquiring a first template in IntraTMP mode, it is possible to first determine the template type corresponding to the current block, and then, based on the template type, further determine the first template corresponding to the current block. Here, it is possible to choose to determine the template type of the current block based on instruction information in the bitstream, to choose to determine the template type of the current block based on the size of the current block, or to determine the template type of the current block based on a reference sample of the current block.

[0193] In embodiments of the present disclosure, the reference sample of the current block may include adjacent reconstruction samples of the current block, that is, adjacent reconstruction samples of the current block may be used to search for a matching template within a predefined search area as a template.

[0194] In the embodiments of this disclosure, the reference sample of the current block, i.e., the adjacent reconstruction sample of the current block, may include the upper reference sample, upper left reference sample, upper right reference sample, left reference sample, and lower left reference sample of the current block.

[0195] In embodiments of the present disclosure, it is understood that when determining the template type of the current block using the reference samples of the current block, the template type can be classified and determined based on whether adjacent reference samples are available.

[0196] In other words, embodiments of the present disclosure may choose to determine the template type based on the availability information of the current block's reference sample, or based on information indicated in the bitstream, or a combination of the reference sample's availability information and the information indicated in the bitstream. The present disclosure does not impose any specific limitations.

[0197] In the embodiments of this disclosure, when determining a first template corresponding to the current block based on the template type, a template reference sample for the current block can be determined first based on the template type and the template size corresponding to the template type, and then the first template for the current block can be determined based on the template reference sample.

[0198] In the embodiments of this disclosure, the template size corresponding to the template type may be pre-configured, indicated by the syntax elements of the bitstream, or adaptively selected based on the block size or other information. For example, when retrieving the left template, the template width templateW_size can be set to 4, and when retrieving the top template, the template height templateH_size can be set to 4.

[0199] In embodiments of this disclosure, the block vector search process may include several parts, such as an initialization process, determination of a current intra-search area (a predetermined search area) for the first template, a search within the search area, and determination of one or more optimal block vectors.

[0200] In the embodiments of this disclosure, as shown in Figure 3, the shaded area represents the reconstruction area, the grid-filled block is the current block, and the adjacent area of ​​the current block is the first template (T). The vertical-filled block is the reference block, and the adjacent area of ​​the reference block is the second template (i.e., the optimal matching template, T_BEST). Here, the offset of the second template relative to the first template is the optimal block vector (BV_BEST).

[0201] In embodiments of this disclosure, the predetermined cost function may be the sum of absolute errors (SAD), the sum of absolute transformation differences (SATD), the mean squared error (MSE), the sum of squared errors (SSD), the mean absolute difference (MAD), the mean sum of squared errors (MSD), the normalized correlation coefficient (NCC), and so on, and no specific limitations are made here.

[0202] In embodiments of this disclosure, a matching cost value is determined between a matching template and a first template corresponding to a search point in a predetermined search area based on predetermined matching criteria, and then one or more block vectors are determined based on the matching cost value. Here, if there are multiple block vectors, a list of BV candidates can be constructed, which stores multiple BV candidates in ascending order of cost, and then the corresponding syntactic elements in the bitstream determine which BV candidate or several BV candidates are ultimately selected.

[0203] For example, in some embodiments, since there are multiple methods for obtaining the BV in IBC mode, the bitstream may contain mode information for the BV acquisition method and corresponding parameter information. For instance, if the IBC MERGE mode is obtained in the syntax element, the decoder constructs a MERGE list, parses the MERGE list option index, and then obtains specific BV information from the corresponding option in the MERGE list based on the index. In another example, in the case of normal IBC mode, the decoder obtains specific BV information by decoding the value of the syntax element describing the BV or BV prediction difference in the bitstream.

[0204] For example, in some embodiments, the specific derivation process for BV in IBC mode is as follows:

[0205] (1) Brightness: Input: A luminance position (xCb, yCb) specifying the relative position of the top-left sample of the current encoding block to the current top-left luminance sample of the image; a variable cbWidth specifying the width of the current encoding block in the luminance sample; and a variable cbHeight specifying the height of the current encoding block in the luminance sample.

[0206] Output: Brightness in BVL (Block Vector Luma).

[0207] The IBC modes are divided into IBCMERGE and IBCAMVP, and when deriving the BVL, it is necessary to construct an IBC block vector candidate list (BVCandList) in both cases. Below, we will introduce the list construction process for IBCMERGE. The list construction process for IBCAMVP is the same as that of IBCMERGE, but the maximum number of candidates for each is not the same.

[0208] Step 1: If IsGt4by4 is TRUE (the variable IsGt4by4 is TRUE if the luminance width × height is greater than 16), the process of deriving candidate spatial block vectors from adjacent coding units as defined in the decoding standard is invoked, taking the luminance coded block position (xCb, yCb), luminance coded block width cbWidth, and height cbHeight as inputs. The output is the availability flag availableFlagA1, availableFlagB1, and block vectors BVA1, BVB1, where A1 and B1 are adjacent blocks. As shown in Figure 6, the relative positions of the adjacent blocks where A1 and B1 reside with respect to the current coded block are the lower left corner and the upper right corner, respectively.

[0209] Step 2: If IsGt4by4 is TRUE, the block vector candidate list BVCandList is constructed as follows:

[0210] i=0 if(availableFlagA1) BVCandList [i++]=BVA1 if(availableFlagB1) BVCandList [i++]=BVB1 Step 3: The variable numCurrCand represents the number of candidates obtained so far, and the derivation process for numCurrCand is as follows.

[0211] If IsGt4by4 is TRUE, numCurrCand is set to be equal to the number of candidates in BVCandList. Otherwise, numCurrCand is set to 0.

[0212] Step 4: If numCurrCand is smaller than MaxNumIbcMERGECand (the maximum number of candidates in MERGE mode), and NumHmvpIbcCand (which represents the maximum number of candidates of history-based optimal block vector (Hmvp) in IBC mode) is greater than 0, invoke the derivation process of history-based IBC block vector candidates defined in the decoding standard with BVCandList and numCurrCand as inputs and the modified BVCandList and numCurrCand as outputs.

[0213] Step 5: If numCurrCand is less than MaxNumIbcMERGECand, the following is applied until numCurrCand equals MaxNumIbcMERGECand.

[0214] Set BVCandList[numCurrCand][0] (i.e., the horizontal component of BV) to be equal to 0.

[0215] Set BVCandList[numCurrCand][1] (i.e., the vertical component of BV) to be equal to 0.

[0216] Increment numCurrCand by 1.

[0217] Thus, the construction of the block vector candidate list BVCandList is completed. general_MERGE_flag is used to indicate whether the current mode is IBCMERGE mode, and the candidate index BVIdx is derived as follows.

[0218] BVIdx=general_MERGE_flag[xCb][yCb] ? MERGE_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb] Thus, the specific BVL can be obtained based on the index BVIdx and the block vector candidate list BVCandList.

[0219] BVL[0]=BVCandList[BVIdx][0] BVL[1]=BVCandList[BVIdx][1] In IBCAMVP mode, the BVL obtained from the index BVIdx and the block vector candidate list BVCandList is a predicted BVL. The true BVL requires the addition of the block vector difference (BVD), and the specific process is as follows.

[0220] Step 1: Obtain the horizontal and vertical components of BVD. Here, MvdL0 is the difference in the forward motion vector.

[0221] BVd[0]=MvdL0[xCb][yCb][0] BVd[1]=MvdL0[xCb][yCb][1] Step 2: Rounding is performed on the predicted BVL obtained above. Here, the right shift parameter AmvrShift is used for rounding, and the left shift parameter AmvrShift is used to improve the resolution.

[0222] offset=(AmvrShift == 0)? 0 :((1 << (AmvrShift - 1))- 1)BVL[0]=Sign(BVL[0])×(((Abs(BVL[0])+offset)>>AmvrShift)<< AmvrShift) BVL[1]=Sign(BVL[1])×(((Abs(BVL[1])+offset)>>AmvrShift)< <AmvrShift) Step 3: The true BVL is derived as follows. Its range must be controlled between -217 and 217-1.

[0223] u[0]=(BVL[0]+BVd[0]+218)% 218 BVL[0]=(u[0] >= 217)? (u[0] - 218): u[0] u[1]=(BVL[1]+BVd[1]+218)% 218 BVL[1]=(u[1] >= 217)? (u[1] - 218): u[1] (2) Chromatic difference: In the case of double tree partitioning, IBC is not performed on the chromatic difference. In the case of single tree partitioning, it is necessary to derive the BV of the chromatic difference.

[0224] Input: BVL of luminance (1 / 16 sample accuracy) Output: Chroma difference BVC (Block Vector Chroma) (1 / 32 sample accuracy) The derivation process is as follows:

[0225] BVC[0]=((BVL[0] >>(3+SubWidthC))×32) BVC[1]=((BVL[1] >>(3+SubHeightC))×32) The specific derivation process for prediction samples using BV is as follows:

[0226] Input: Luminance position (xCb, yCb) specifying the relative position of the top-left sample of the current encoded block to the current top-left luminance sample of the image; variable cbWidth specifying the width of the current encoded block in the luminance sample; variable cbHeight specifying the height of the current encoded block in the luminance sample; block vector (BV); variable cIdx specifying the color component index of the current block.

[0227] Output: Predicted sample array predSamples.

[0228] The derivation process is as follows:

[0229] When cIdx is 0, i.e., the luminance component, for x = xCb..xCb + cbWidth - 1 and y = yCb..yCb + cbHeight - 1: xVb=(x+(BV[0] >>4))&(IbcBufWidthY - 1) yVb=(y+(BV[1] >>4))&(CtbSizeY - 1) predSamples[x][y]=ibcVirBuf[0][xVb][yVb] IbcBufWidthY is the luma sample width of the reconstruction buffer of IBC storage, CtbSizeY is the size of a CTU (Coding Tree Unit), and ibcVirBuf is the reconstruction sample of IBC storage.

[0230] When cIdx is not 0, that is, for a chrominance component, for x=xCb / SubWidthC..xCb / SubWidthC+cbWidth / SubWidthC- 1 and y=yCb / SubHeightC..yCb / SubHeightC+cbHeight / SubHeightC- 1: xVb=(x+(BV[0] >>5))&(IbcBufWidthC- 1) yVb=(y+(BV[1] >>5))&((CtbSizeY / subHeightC)- 1) predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb] The variables SubWidthC and SubHeightC specifically depend on the chrominance format sampling structure specified by sps_chroma_format_idc, and the specific correspondence is as shown in Table 1.

[0231] Further, in the embodiment of the present disclosure, the bitstream can be decoded first to determine the prediction mode identification information corresponding to the current block, and then when the prediction mode identification information indicates that the current block uses the prediction mode based on prediction parameters, the prediction parameter determination process, that is, the foregoing step 1101 can be performed.

[0232] In embodiments of the present disclosure, it is understood that after receiving a video bitstream, a predictive mode identifier corresponding to the current block can first be determined, where the predictive mode identifier indicates the encoding mode of the current block and the parameters associated with that mode.

[0233] In the embodiments of this disclosure, the prediction mode typically includes a conventional intra-prediction mode and a non-conventional intra-prediction mode. The conventional intra-prediction mode may further include DC mode, PLANAR mode, and angle mode, while the non-conventional intra-prediction mode may further include MIP mode, CCLM mode, IBC mode, PLT mode, IntraTMP mode, and the like.

[0234] In embodiments of the present disclosure, it is understood that predictive coding is performed on the encoder side for the current block, in which process the predictive mode for the current block is determined, the corresponding predictive mode identifier is written to the bitstream, and transmitted by the encoder to the decoder.

[0235] In response to this, the decoder can obtain predictive mode identifier information corresponding to the current block by decoding the bitstream, and subsequently determine which encoding mode is specifically used for decoding the current block based on the predictive mode identifier information.

[0236] In embodiments of this disclosure, the prediction mode identification information can be used to indicate whether the current block uses a prediction mode based on prediction parameters.

[0237] For example, in some embodiments, prediction mode identification information can be used to determine whether the current block uses a block vector-based prediction mode, such as IBC mode or IntraTMP mode.

[0238] For example, in some embodiments, if the value of the prediction mode identifier is a first value, it is determined that the prediction mode identifier indicates that the current block should use a prediction mode based on prediction parameters, and if the value of the prediction mode identifier is a second value, it is determined that the prediction mode identifier indicates that the current block should not use a prediction mode based on prediction parameters.

[0239] In the embodiments of this disclosure, the first and second values ​​are different, and the first and second values ​​may be in parameter form or numerical form. Specifically, the first prediction mode identification information and the second prediction mode identification information may be parameters written in the profile, or flag values, and no specific limitations are made here. Furthermore, regarding the first and second values, the first value can be set to 1 and the second value to 0. Alternatively, the first value can be set to 0 and the second value to 1. Alternatively, the first value can be set to true and the second value to false. Alternatively, the first value can be set to false and the second value to true. Here, in the embodiments of this disclosure, the first value is set to 0 and the second value is set to 1, but no specific limitations are made.

[0240] In step 1102, the first reference block of the current block is determined based on the prediction parameters of the current block.

[0241] In embodiments of this disclosure, after determining the prediction parameters corresponding to the current block, a first reference block of the current block can be determined based on the prediction parameters of the current block.

[0242] In the embodiments of this disclosure, at least one reference block corresponding to the current block can be determined based on the block vector of the current block.

[0243] In embodiments of this disclosure, at least one reference block corresponding to the current block can be determined based on the motion vector of the current block. In embodiments of this disclosure, the first reference block of the current block may be an initial prediction block obtained directly based on prediction parameters. For example, the first reference block may be an initial prediction block derived directly using the block vector of the current block, or an initial prediction block derived directly based on the motion vector of the current block.

[0244] For example, in some embodiments, in IntraTMP mode, the determined block vector of the current block may be the optimal block vector BV_BEST(pX_BEST, pY_BEST), where pX_BEST and pY_BEST are the horizontal and vertical offsets of the optimal matching template relative to the current block template, and also the horizontal and vertical offsets of the optimal matching reconstructed block relative to the current block.

[0245] Furthermore, in embodiments of this disclosure, determining the first reference block corresponding to the current block based on the determined block vector can be achieved using a simple translation copy. The specific operation is as follows:

[0246] For x = 0 ... nTbW-1, y = 0 ... nTbH-1, predSamples[x][y] = recSamples[x + pX_BEST][y + pY_BEST] (7) Here, recSamples represents the reconstructed samples of the current frame.

[0247] For example, in some embodiments, in IBC mode, the input is: luminance position (xCb, yCb) specifying the relative position of the top-left sample of the current coded block to the current top-left luminance sample; a variable cbWidth specifying the width of the current coded block in the luminance sample; a variable cbHeight specifying the height of the current coded block in the luminance sample; a block vector (BV); and a variable cIdx specifying the color component index of the current block. The output is: an array of predicted samples, predSamples.

[0248] When cIdx is 0, i.e., the luminance component, for x = xCb..xCb + cbWidth - 1 and y = yCb..yCb + cbHeight - 1: xVb = ( x + ( BVL

[0000] >> 4 ) ) & ( IbcBufWidthY - 1 ) yVb = ( y + ( BVL

[0001] >> 4 ) ) & ( CtbSizeY - 1 ) predSamples[ x ][ y ] = ibcVirBuf

[0000] [ xVb ][ yVb ] IbcBufWidthY is the luminance sample width of the IBC storage's reconfiguration buffer, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconfiguration sample of the IBC storage.

[0249] For cIdx not being 0, i.e., for the chromatic difference component, for x = xCb / SubWidthC..xCb / SubWidthC + cbWidth / SubWidthC - 1 and y = yCb / SubHeightC..yCb / SubHeightC + cbHeight / SubHeightC - 1: xVb = ( x + ( BVC

[0000] >> 4 ) ) & ( IbcBufWidthC - 1 ) yVb = ( y + ( BVC

[0001] >> 4 ) ) & ( ( CtbSizeY / subHeightC ) - 1 ) predSamples[ x ][ y ] = ibcVirBuf[ cIdx ][ xVb ][ yVb ].

[0250] In step 1103, the first transformation parameter of the current block is determined based on the first reference block of the current block.

[0251] In embodiments of this disclosure, after determining the first reference block of the current block based on the prediction parameters of the current block, the first transformation parameters of the current block can be determined based on the first reference block of the current block.

[0252] In embodiments of this disclosure, the transformation parameter of the current block, for example, the first transformation parameter, may include an index reference (e.g., LFNST) indicating the transformation matrix to be used, or it may be the transformation matrix itself.

[0253] Furthermore, in embodiments of the present disclosure, when determining the first transformation parameter of the current block based on the first reference block of the current block, the statistical characteristic parameter of the first reference block can be determined first, and then the first transformation parameter can be determined based on the statistical characteristic parameter.

[0254] In embodiments of this disclosure, the statistical characteristic parameter includes a covariance matrix.

[0255] Furthermore, in embodiments of the present disclosure, when determining the first transformation parameter of the current block based on the first reference block of the current block, intra-mode information corresponding to the current block can be determined first based on the first reference block of the current block, and then the first transformation parameter can be determined based on the intra-mode information.

[0256] In embodiments of this disclosure, it is understood that the intra-mode information corresponding to the current block may include conventional intra-predictive mode indication information determined after intra-predictive mode mapping.

[0257] In the embodiments of this disclosure, when determining intra-mode information corresponding to the current block based on the first reference block of the current block, the horizontal and vertical slopes corresponding to the first reference block of the current block can be determined first, and then the intra-mode information corresponding to the current block can be determined based on the horizontal and vertical slopes.

[0258] In the embodiments of this disclosure, when determining the horizontal and vertical slopes corresponding to the first reference block of the current block, it is possible to choose to determine the horizontal and vertical slopes corresponding to the first reference block based on a predetermined operator.

[0259] For example, in some embodiments, a predetermined operator can be used to determine gradient information, for instance, the Sobel operator. Here, the Sobel operator can complete the calculation of the horizontal and vertical gradients of the first reference block.

[0260] For example, in some embodiments, the Sobel operator is G x and G y Includes G x This is used to calculate the horizontal slope, G y This is used to calculate the vertical slope.

[0261]

number

number

[0262] In the embodiments of this disclosure, the intra-mode information corresponding to the current block in the first prediction histogram, which is determined based on the gradient direction of the maximum amplitude, may be a conventional intra-prediction mode, predModeIntra, where predModeIntra is between [0, 66].

[0263] For example, in some embodiments, the vertical and horizontal gradients of all prediction samples for a first reference block can be calculated based on a first reference block directly obtained by prediction parameters, and then the direction in which the gradient is greatest can be mapped to a kind of conventional intra-prediction mode, i.e., the intra-mode information predModeIntra corresponding to the current block can be determined.

[0264] In other words, in the embodiments of this disclosure, gradient information between samples in a first reference block can be used to derive a dominant prediction direction, thereby completing the mapping of intra-prediction modes based on the first reference block and obtaining the corresponding intra-mode information, predModeIntra.

[0265] For example, in some embodiments, the Sobel operator can be used to calculate the horizontal and vertical slopes of the first reference block under the Intra TMP, thereby completing the slope analysis, and based on the first reference block, a conventional intra prediction mode can be derived, i.e., the corresponding intra mode information predModeIntra can be determined. Here, Gx This is used to calculate the horizontal slope, G y This is used to calculate the vertical slope.

[0266] For example, in some embodiments, the input is a first reference block based on the BV mode, i.e., an initial prediction value p[x][y], where x = 0..nTbW - 1, y = 0..nTbH - 1, where nTbW represents the width of the transformed block obtained by the current BV prediction mode, and nTbH represents the height of the transformed block obtained by the current BV prediction mode.

[0267] For example, in some embodiments, the output is intra-mode information corresponding to the current block, a conventional intra-predictive mode predModeIntra, where predModeIntra is between [0, 66].

[0268] For example, in some embodiments, the following operations can be performed sequentially in the process of performing intra-predictive mode mapping based on a first reference block.

[0269] Set mapHgV = {{2,1}, {1,2}} and mapVgH = {{3,4}, {4,3}}. Set angTable = { 0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536} Set angOffset = {18, 18, 50, 50} The HoG

[67] is set up as an array containing the gradient strengths for each conventional intra-prediction mode. At the start of this process, all values ​​in all HOG arrays are initialized to 0.

[0270] For each prediction sample p[x][y], with x = 1…nTbW-2 and y = 1…nTbH-2, the calculation process is as follows.

[0271] Calculate the horizontal gradient gHor[ x ][ y ] = p[x-1][y-1] + 2.p[x-1][y] + p[x-1][y+1] - p[x+1][y-1] - 2.p[x+1][y] - p[x+1][y+1] Calculate the vertical gradient gVer[ x ][ y ] = p[x-1][y-1] + 2.p[x][y-1] + p[x+1][y-1] - p[x-1][y+1] - 2.p[x][y+1] - p[x+1][y+1] Calculate iAmp[x][y] = abs(gHor[ x ][ y ]) + abs(gVer[ x ][ y ]) Calculate signH[x][y] = gHor[x][y] < 0 ? 1 : 0 Calculate signV[ x ][ y ] = gVer[ x ][ y ] < 0 ? 1 : 0. Calculate HgV[ x ][ y ] = (abs(gHor[ x ][ y ]) > abs(gVer[ x ][ y ]) ? 1 : 0). Calculate region[ x ][ y ] = (HgV[ x ][ y ] = = 1 ? mapHgV[ signH[ x ][ y ] ][ signV[ x ][ y ] ] :mapVgH[ signH[ x ][ y ] ][ signV[ x ][ y ] ]) Calculate grad[ x][ y ] = (HgV[ x ][ y ] = = 1 ? abs(gVer[ x ][ y ]) / abs(gHor[ x ][ y ]) : abs(gVer[ x ][ y ]) / abs(gHor[ x ][ y ])) Calculate grad[ x ][ y ] = round( grad[ x ][ y ] × (1 << 16) ). Angle index angIdx[ x ][ y ] = argmin i Calculate (abs( angTable[ i ] - grad[ x ][ y ])) The intra-prediction mode calculates ipm[ x ][ y ] = angOffset[ region[ x ][ y ] ] + angIdx[ x ][ y ]. Set HOG[ipm[ x ][ y ]] = HOG[ipm[ x ][ y ]] + iAmp[x][y] If there are no non-zero amplitudes in HOG: Set predModeIntra to PLANAR Otherwise: predModeIntra to argmax i Set to (HoG[i]) Here, argmax i (L[i]), i=0,…,N returns the index from 0 to N that maximizes L (if there are multiple maximum values, it returns the smaller index), and argmin i (L[i]), i=0,…,N returns the index from 0 to N that minimizes L (if there are multiple minimum values, the smaller index is returned). Finally, the mapping for the intra prediction mode, predModeIntra, is completed.

[0272] In embodiments of this disclosure, the initial predicted value obtained directly based on the prediction parameters, for example, the first reference block directly indicated by the BV, has more texture edge information than the final predicted value obtained after subsequent data processing processes such as filtering, merging, and sub-pixelating. This is because data processing processes performed based on the initial predicted value, such as filtering, merging, and sub-pixelating, for example, low-pass filtering, are equivalent to a type of smoothing operation, and the final predicted value obtained after processing loses some texture edge information.

[0273] In response to this, in the embodiments of this disclosure, in the process of mapping intra-prediction modes based on predicted values, the initial predicted values ​​have richer texture edge information. Therefore, compared to mapping intra-prediction modes using final predicted values, using initial predicted values ​​allows for the derivation of more accurate gradient direction, predicted angle, and angular amplitude, thereby enabling the determination of a more matched conventional intra-prediction mode.

[0274] Furthermore, in embodiments of this disclosure, when determining a first transformation parameter based on intra-mode information, a candidate set of transformation kernels can first be determined based on intra-mode information corresponding to the current block, where the candidate set of transformation kernels includes any number of transformation kernels, and the candidate set of transformation kernels includes one of the following: an LFNST transformation kernel candidate set, an NSPT transformation kernel candidate set, and a transformation kernel candidate set determined based on the prediction direction. Subsequently, a first transformation kernel can be determined within the candidate set of transformation kernels, and finally, the first transformation parameter can be determined based on the first transformation kernel.

[0275] In the embodiments of this disclosure, the first transformation parameter can be understood as a first transformation kernel or a first transformation matrix; that is, the first transformation kernel may be a first transformation matrix.

[0276] In the embodiments of this disclosure, the size of the matrix corresponding to the first transformation parameter can be determined based on the current block size, that is, the size of the first transformation matrix can be determined based on the current block size.

[0277] In other words, in embodiments of the present disclosure, the set of candidate translation kernels determined based on intra-mode information corresponding to the current block may be any one of the set of candidate translation kernels determined based on any prediction direction. For example, the set of candidate translation kernels may be an LFNST translation kernel set or an NSPT translation kernel set, and the present disclosure does not make any specific limitations.

[0278] In the embodiments of this disclosure, when determining the LFNST conversion kernel candidate set based on intra-mode information corresponding to the current block, the LFNST conversion kernel candidate set corresponding to the intra-mode information can be determined based on the mapping relationship between the intra-mode and the conversion kernel candidate set.

[0279] For example, in some embodiments, after determining that the current block can use LFNST technology, it is necessary to determine which LFNST translation kernel (which can be represented as kernel) the current block will use. Here, LFNST has a total of four candidate translation kernel sets, which may include set0, set1, set2, and set3. Here, based on the coding parameters of the current block or the coding block in which the current block resides, a selected candidate translation kernel set can be implicitly derived, for example, based on the intra-prediction mode of the current block, it can be determined which of the four candidate translation kernel sets to use.

[0280] In embodiments of this disclosure, it is understood that the value of the LFNST index number (which can be represented by SetIdx) can be determined based on the value of the intra-mode information predModeIntra corresponding to the current block. Specifically, the value of the LFNST index number is set to indicate that the current block uses LFNST and that the LFNST translation kernel is an index number in the LFNST translation kernel candidate set. Typically, the LFNST translation set includes four translation kernel candidate sets (set0, set1, set2, set3), with SetIdx values ​​of 0, 1, 2, and 3, respectively.

[0281] For example, in some embodiments, the mapping relationship between the intra-mode and the candidate set of conversion kernels may be as shown in Table 4, and the corresponding LFNST conversion kernel candidate set can be determined based on the value of predModeIntra and Table 4.

[0282] Furthermore, in embodiments of the present disclosure, the bitstream can be decoded and a transformation kernel index number can be determined, and then, based on the transformation kernel index number, a first transformation kernel can be determined within the LFNST transformation kernel candidate set, thereby determining the first transformation parameters.

[0283] In the embodiments of this disclosure, the LFNST conversion kernel candidate set includes two predetermined conversion kernels. After decoding the bitstream and obtaining the conversion kernel index number, a conversion kernel indicated by the conversion kernel index number can be selected from the LFNST conversion kernel candidate set based on the value of the obtained conversion kernel index number. For example, if the value of the conversion kernel index number is 1, the first LFNST conversion kernel group (i.e., the first conversion matrix group) in the LFNST conversion kernel candidate set is selected, or if the value of the conversion kernel index number is 2, the second LFNST conversion kernel group (i.e., the second conversion matrix group) in the LFNST conversion kernel candidate set is selected.

[0284] Furthermore, in embodiments of this disclosure, with respect to the value of the translation kernel index number (i.e., lfnst_idx), if the value of the translation kernel index number is equal to 0, LFNST is not used; if the value of the translation kernel index number is greater than 0, LFNST is used and the index of the translation kernel is equal to the value of the translation kernel index number, or the index of the translation kernel is equal to the value of the translation kernel index number minus 1. Thus, based on the translation kernel index number, the LFNST translation kernel used by the current block, i.e., the first translation kernel, can be further determined.

[0285] Furthermore, in the embodiments of this disclosure, a primary conversion coefficient length parameter and a secondary conversion coefficient length parameter can be set.

[0286] In embodiments of this disclosure, it is understood that it is also necessary to set core parameters. Here, regarding the setting of core parameters, it is first necessary to set the length of the quadratic transformation coefficient vector that will be input to the LFNST calculation (which can be expressed as nonZeroSize), i.e., to set the quadratic transformation coefficient length parameter, and also to set the length of the output linear transformation coefficient vector (which can be expressed as nLfnstOutSzie), i.e., to set the linear transformation coefficient length parameter.

[0287] Furthermore, in the embodiments of this disclosure, when determining the first transformation parameters based on the first transformation kernel, the transformation matrix size can be determined based on the linear transformation coefficient length parameter and / or the quadratic transformation coefficient length parameter, thereby determining the first transformation parameters based on the first transformation kernel and the transformation matrix size.

[0288] In embodiments of the present disclosure, it is understood that the first transformation parameter may be a transformation matrix corresponding to the current block.

[0289] In embodiments of this disclosure, the initial predicted values ​​obtained directly based on the prediction parameters, such as the first reference block directly indicated by the BV, have more texture edge information than the final predicted values ​​obtained through subsequent data processing processes such as filtering, merging, and sub-pixelation. Therefore, by using the initial predicted values ​​in the process of mapping intra-prediction modes based on the predicted values, more accurate gradient directions, predicted angles, and angular amplitudes can be derived, thereby determining a more matched conventional intra-prediction mode.

[0290] In response to this, in embodiments of the present disclosure, after determining the corresponding intra-prediction mode using initial prediction values ​​directly obtained by prediction parameters, for example, a first reference block directly indicated by BV, a more accurate LFNST transformation kernel can be obtained, thereby determining a better-matched transformation matrix.

[0291] For example, in some embodiments, Figure 12 is a schematic diagram of the transformation matrix selection process according to embodiments of the present disclosure, and as shown in Figure 12, the derivation of the transformation parameters, i.e., the transformation matrix, may specifically include the following steps.

[0292] S5.1. Determination of the conversion set.

[0293] Here, when determining the transformation set, a selection is made among four transformation sets (set0, set1, set2, set3) based on the intra prediction mode predModeIntra after the previous mapping, thereby determining the corresponding transformation set, i.e., the corresponding LFNST transformation kernel candidate set.

[0294] S5.2. Determination of transformation matrix groups.

[0295] When determining the transformation matrix group, i.e., the corresponding transformation kernel, the choice of which of the two transformation matrix groups in the transformation set to select is determined based on the lfnst_idx transmitted from the encoding side. If lfnst_idx is 1, the first transformation matrix group is selected; if lfnst_idx is 2, the second transformation matrix group is selected.

[0296] S5.3. Selection of transformation matrix size.

[0297] When selecting the transformation matrix size, each transformation matrix group includes two sizes of elementary transformation matrices, with the sizes used on the decoding side being 16x16 and 48x16. The selection is based on nLfnstOutSzie; if nLfnstOutSzie is 16, the 16x16 elementary transformation matrix is ​​selected, and if nLfnstOutSzie is 48, the 48x16 elementary transformation matrix is ​​selected. If nonZeroSize is 8, only the first 8 rows of the transformation matrix are used for matrix multiplication calculations.

[0298] In step 1104, the predicted block of the current block is determined based on the first reference block of the current block.

[0299] In embodiments of this disclosure, after determining the first reference block of the current block based on the prediction parameters of the current block, the prediction block of the current block can be determined based on the first reference block of the current block.

[0300] Furthermore, in embodiments of this disclosure, when determining the predicted block of the current block based on the first reference block of the current block, the predicted block of the current block can be determined by performing a modification process on the first reference block according to a predetermined processing strategy.

[0301] In embodiments of this disclosure, the predetermined processing strategy includes at least one of a plurality of processes: fusion processing, filtering processing, subpixel processing, and sample inversion processing.

[0302] For example, in some embodiments, when determining the predicted block of the current block based on the first reference block of the current block in IntraTMP mode, methods can be used to obtain a predicted value by fusing multiple BV-corresponding positions, by filtering and copying the reference block corresponding to the BV, and by sub-pixelating the BV and interpolating its corresponding reference block before copying.

[0303] For example, in the decoding region search process, a list of BV candidates is obtained using template matching, and then the first N entries (e.g., N=3) are selected for weighted fusion. This method can be called IntraTMP Fusion mode.

[0304] Alternatively, after obtaining one optimal BV, multiple points are acquired around that BV, and the predicted values ​​corresponding to these points are weighted and merged to obtain the final predicted value. This method can be called IntraTMP FLM mode.

[0305] Alternatively, after obtaining one optimal BV, the templates are sorted by subpixel precision, the optimal direction and precision are selected, and the predicted values ​​are calculated using an interpolation filter. This method can be called IntraTMP SubPel mode.

[0306] For example, in some embodiments, in IBC mode, in addition to the basic method of obtaining predicted values ​​by copying described above, in IBC inversion mode, a method is required to obtain predicted values ​​after horizontally or vertically inverting the prediction region. For example, it may indicate whether or not to invert a certain syntactic element, and if so, whether to invert horizontally or vertically. Based on the instructions of that syntactic element, the decoding side obtains the predicted sample values ​​of the encoded block by rearranging the reference region samples in reverse order horizontally or vertically.

[0307] Alternatively, a template can be used to establish a model between the current block and the prediction region, process the prediction block according to the model, and then obtain the predicted value for the current block. For example, the IBC LIC mode is applied to IBC MERGE and IBC ABVP and uses a linear equation to compensate for local illumination changes. Similar to the LIC for interpretation of VVCs, the parameters of the linear equation can be expressed in terms of a scaling parameter α and an offset parameter β, i.e., α × p[x] + β compensates for illumination changes, where p[x] is the reference sample pointed to by the BV position x on the current image. The linear model parameters are derived using the least squares method.

[0308] Based on obtaining the predicted values ​​described above, there is also an FIBC mode, which establishes a linear model between the reference block template corresponding to the BV and the current block template, obtains filter coefficients, and then uses them on the current block to obtain the final predicted value. There is also a prediction mode that fuses multiple IBC prediction blocks, determined by the relationship between multiple prediction blocks and the current block template, similar to the IntraTMP Fusion mode.

[0309] Based on the obtained prediction values ​​described above, it is also possible to perform weighted predictions using other intra-prediction methods and use the results after weighted prediction as the final prediction result.

[0310] Weighted prediction methods include those modeled after VVC's Inter-Intra Mixed Prediction (CIIP) method. This method weights and combines the results obtained by the above prediction process with the prediction results obtained by the normal intra-directional prediction mode at each sample location. It also includes methods modeled after VVC's Inter-Geometric Prediction Mode (GPM) method. This method is based on a wedge-shaped partition and uses the results obtained by different prediction modes in different wedge-shaped regions, performing a weighted mixing near the wedge-shaped partition line that conforms to a certain rule.

[0311] For example, in some embodiments, Intra TMP technology has different prediction methods depending on the prediction mode. For instance, Intra TMP Fusion technology obtains block vectors (BVs) corresponding to N candidate templates, then uses the BVs to obtain N candidate reconstruction blocks, and then performs weighted fusion on the N candidate reconstruction blocks to obtain the predicted block for the current encoded block. Specifically, the final predicted value is generated by the steps of obtaining N candidate reconstruction blocks, determining weighted fusion weights, and then generating the predicted value by weighted fusion.

[0312] Here, when we obtain N candidate reconstruction blocks, we obtain a block vector (BV) corresponding to the N candidate templates. n Based on this, the candidate reconstruction block RefBlock is directly from the current image. n Obtain BV n The horizontal offset is pX n The vertical offset is pY n Therefore, n = 0, 1, ..., N-1.

[0313] This is achieved by a simple translation copy. The specific operation is as follows, for x = 0…nTbW-1, y = 0…nTbH-1: RefBlock n [x][y] = recSamples[x + pX n ][y + pY n ] Here, recSamples represents the reconstructed samples of the current frame.

[0314] When determining weighted fusion weights, it is necessary to obtain N candidate reconstruction blocks (RefBlock) and then calculate the weighted fusion weights W of the N candidate reconstruction blocks. The weights may be predefined deterministic values, or they may be adaptively calculated values ​​using cost values, sample values, etc.

[0315] For example, in some embodiments, in embodiments of Intra TMP Fusion technology, candidate template refT n The reconstruction value and the template that should be predicted, recfredT n The weighted fusion weights are derived by minimizing the MSE between the sample values.

[0316] Specifically, the MSE minimization process takes the autocorrelation matrix of the previous P matching reference samples refT and the cross-correlation vector between the previous P matching reference samples refT and the current coded block adjacent template sample curT as input, and outputs the weights of the reconstructed block corresponding to each matching reference entry.

[0317] When generating predicted values ​​by weighted fusion, the predicted block is calculated based on each candidate reconstruction block and its corresponding weighted fusion weight. Specifically, the current predicted block is obtained (i.e., the weighted prediction) by multiplying the value of each candidate reconstruction block by its corresponding weight and accumulating the results.

[0318] For x = 0…nTbW-1 and y = 0…nTbH-1, the calculation of the predicted values ​​is as shown in equation (2). Each predicted value predSamples x,y The spatially stored data becomes the output prediction block of Intra TMP Fusion.

[0319] As an example, in some embodiments, a linear filter model is established in IntraTMP FLM mode using the optimal matching template found in the previous step and the current coded block template. This mainly involves two processes: determining the reconstruction region used to calculate the filter coefficients, and calculating the filter coefficients. For example, as shown in Figure 7, assuming that the number of filter taps nTap is 5, the shape of this filter is as shown in the left figure, where c0 to c4 are the respective tap coefficients of this filter, and the point corresponding to tap coefficient c0 is the current sample Y to be predicted. pred[i][j] is the reconstructed sample ref[i][j] at the corresponding position in the optimal matching block. The other points are reconstructed samples adjacent to the current spatial position within the optimal matching reconstruction block. The points in the right figure are the obtained predicted sample Y pred [i][j]

[0320] For each current sample to be predicted (i,j), the sample position in the filter template is defined as (k,l), the corresponding reconstructed sample in the optimal matching block during filtering is defined as ref[i + k][j + l], and each filter coefficient at the (k,l) position in the filter template is defined as c k,l This is defined as follows. The specific calculation process is as shown in equations (3) to (6).

[0321] For example, in some embodiments, in Intra TMP SubPel mode, the optimal BV is scanned in eight directions: 1 / 4, 1 / 2, 3 / 4, and up / down / left / right, upper left, upper right, lower left, and lower right. These are then sorted based on template cost, and an interpolation filter is used to calculate the predicted value for the reference block corresponding to the BV with the minimum template cost.

[0322] For example, in some embodiments of IBC technology, the IBC inversion mode requires that the predicted region be horizontally or vertically inverted as a method for obtaining the predicted value. For instance, it may indicate whether or not to invert a certain syntactic element, and if so, whether it is a horizontal or vertical inversion. The decoding side obtains the predicted sample value of the encoded block by rearranging the reference region samples in reverse order horizontally or vertically based on the instructions of that syntactic element.

[0323] For example, in some embodiments, the IBC LIC mode utilizes a template to establish a model between the current block and the prediction region, processes the prediction block according to the model, and then obtains the predicted value for the current block. The IBC LIC mode is applied to IBC MERGE and IBC ABVP and compensates for local illumination changes using a linear equation. Similar to the LIC for interpretation of VVCs, the parameters of the linear equation can be expressed in terms of a scaling parameter α and an offset parameter β, i.e., α × p[x] + β compensates for illumination changes, where p[x] is the reference sample pointed to by the BV position x on the current image. The linear model parameters are derived using the least squares method.

[0324] As an example, in some embodiments, in Filter IBC mode, a linear model is established between the current block template and the reference block template corresponding to the BV, the filter coefficients are obtained, and then used for the current block to obtain the final predicted value. Here, for each current sample to be predicted (i, j), the sample position in the filter template is defined as (k, l), the corresponding reconstructed sample in the optimal matching block during filtering is defined as ref[i + k][j + l], and each filter coefficient at the (k, l) position in the filter template is defined as c k,l This is defined as follows. The specific calculation process is as shown in equations (3) to (5).

[0325] Based on the obtained prediction values ​​described above, it is also possible to perform weighted predictions using other intra-prediction methods and use the results after weighted prediction as the final prediction result.

[0326] Weighted prediction methods include those modeled after VVC's Inter-Intra Mixed Prediction (CIIP) method. This method weights and combines the results obtained by the above prediction process with the prediction results obtained by the normal intra-directional prediction mode at each sample location. It also includes methods modeled after VVC's Inter-Geometric Prediction Mode (GPM) method. This method is based on a wedge-shaped partition and uses the results obtained by different prediction modes in different wedge-shaped regions, performing a weighted mixing near the wedge-shaped partition line that conforms to a certain rule.

[0327] An example of an operation process in BV-based CIIP mode: The BV-based predicted value of the current block is weighted and merged with the predicted value of a certain intra-mode. The BV-based predicted portion can be obtained by applying the usual MERGE, TM MERGE, MBVD, and ABVP modes.

[0328] If the BV-based prediction portion is in a different mode, different weights can be set. For example, if the mode of the BV-based prediction portion is the normal IBC MERGE, TM MERGE, or MBVD mode, the weight ratio of the BV-based prediction to the intra-prediction is 13:3, and the intra-mode includes the TIMD mode of the current block and the intra-prediction mode at the candidate BV location. If the second prediction mode and the first prediction mode in the intra-mode are the same, it is determined whether the first prediction mode is the PLANAR mode, and if so, the second prediction mode is replaced with the horizontal prediction mode; otherwise, the second prediction mode is replaced with the PLANAR mode. If the BV-based prediction portion is in the ABVP mode, the weight ratio of the BV-based prediction to the intra-prediction is 1:1, and the TIMD mode is taken as the first prediction mode of the intra-prediction mode, and if the derived prediction mode is the horizontal prediction mode, PLANAR is taken as the second prediction mode of the intra-prediction mode; otherwise, the horizontal prediction mode is taken as the second prediction mode of the intra-prediction mode.

[0329] Example of an operating process in BV-based GPM mode: The BV-based prediction portion can be obtained by applying normal MERGE and TM MERGE.

[0330] For example, one partition can be a BV-based prediction mode and the other partition an INTRA mode. The same method as for InterGPM is used to construct the intra-prediction mode (IPM) candidate list, with the size of the IPM candidate list being predefined as 3.

[0331] In practical implementation, there are a total of 48 different geometric partitioning modes, which can be divided into two sets of geometric partitioning modes, as shown in Tables 2 and 3.

[0332] When using BV-based GPM, a flag for the BV-based GPM (e.g., IBC-GPM) geometric partition mode set is transmitted to indicate whether the first or second geometric partition mode set is selected. Then, the geometric partition mode index is transmitted. Furthermore, a BV-based GPM (or IBC-GPM) intra-partition flag is transmitted to indicate whether intra-prediction is used for the first subpartition. Here, the intra-prediction portion must transmit the intra-prediction mode index, and the IBC prediction portion must transmit the MERGE index.

[0333] In step 1105, the reconstructed block corresponding to the current block is determined based on the predicted block and the first transformation parameter of the current block.

[0334] In embodiments of this disclosure, after determining the first reference block and predicted block of the current block based on the prediction parameters of the current block, a reconstructed block corresponding to the current block can be determined based on the predicted block and the first transformation parameters of the current block.

[0335] Furthermore, in embodiments of this disclosure, the bitstream can be decoded and a first transformation coefficient corresponding to the predicted residual can be determined.

[0336] Furthermore, in embodiments of the present disclosure, when determining the reconstructed block corresponding to the current block based on the predicted block of the current block and a first transformation parameter, the predicted residual can be determined based on the first transformation parameter and a first transformation coefficient, and then the reconstructed block corresponding to the current block can be determined based on the predicted block of the current block and the predicted residual.

[0337] In the embodiments of this disclosure, when determining the predicted residual based on the first transformation parameter and the first transformation coefficient, the second transformation coefficient can be determined by performing an inverse quadratic transformation based on the first transformation coefficient and the first transformation parameter, and then performing an inverse linear transformation based on the second transformation coefficient to determine the predicted residual.

[0338] In embodiments of this disclosure, it is understood that the first transformation coefficient may be an inverse quadratic transformation coefficient vector u[i], and the second transformation coefficient may be an inverse linear transformation coefficient vector v[j].

[0339] In other words, in the embodiments of this disclosure, after determining the first transformation parameter, i.e., the transformation matrix, the inverse quadratic transformation coefficient vector u[i] (i=0…nonZeroSize-1) is taken as input and multiplied using the transformation matrix to obtain the inverse linear transformation coefficient vector v[j] (j=0…nLfnstOutSzie-1). Then, the one-dimensional inverse linear transformation coefficient vector v[j] (j=0…nLfnstOutSzie-1) is used to construct the two-dimensional inverse linear transformation coefficient matrix d'[x][y] (x=0…nLfnstSize-1, y=0…nLfnstSize-1) of the current transformation block. Here, depending on the difference in intra-prediction mode, there are two types of filling scan sequences: horizontal scan mode and vertical scan mode. Then, the inverse linear transformation coefficient matrix is ​​used to perform the inverse transformation of the linear transformation and generate the prediction residual.

[0340] Furthermore, in embodiments of this disclosure, a quadratic transformation coefficient vector u[i] is taken as input and multiplied using a transformation matrix to obtain a linear transformation coefficient vector v[j]. Here, i=0,1,…,nonZeroSize-1, j=0,1,…,nLfnstOutSize-1. Assuming that the transformation matrix obtained in the previous step is lowFreqTransMatrix, the specific calculation process for v[j] is as follows.

[0341]

number

[0342]

number

number

[0343] Furthermore, in embodiments of this disclosure, after determining the predicted residual corresponding to the current block and the predicted block of the current block, an image reconstruction process for specified color components defined by the decoding standard can be invoked. Here, in order to perform the reconstruction operation, for modes with residuals, it is necessary to add the predicted signal and the residual signal.

[0344] In summary, the decoding method proposed by steps 1101 to 1105 above uses initial predicted values ​​based on BV, i.e., the first reference block directly indicated by BV, to directly derive the prediction direction, thereby guiding the selection of the transformation set related to the direction. On the other hand, compared to the final predicted values ​​after subsequent data processing processes such as filtering, fusion, and sub-pixelation, the initial predicted values ​​have richer texture edge information. Therefore, by using the initial predicted values, more accurate gradient direction, predicted angle, and angular amplitude can be derived, thereby determining a more matched conventional intra-prediction mode. Furthermore, a highly accurate LFNST transformation kernel can be obtained, a more matched transformation matrix can be determined, and consequently, the performance of encoding and decoding can be effectively improved. On the other hand, after determining the first reference block directly indicated by BV, steps such as generating prediction blocks and generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding, solving the problem of high complexity, improving encoding and decoding efficiency, and simultaneously being advantageous for hardware design implementation.

[0345] Furthermore, in embodiments of the present disclosure, after determining a first reference block corresponding to the current block, a predicted block for the current block can be determined based on the first reference block of the current block, then a second transformation parameter corresponding to the current block can be determined based on the predicted block of the current block, and finally, a reconstructed block corresponding to the current block can be determined based on the predicted block of the current block and the second transformation parameter corresponding to the current block.

[0346] In embodiments of this disclosure, the transformation parameter of the current block, for example, the second transformation parameter, may include an index reference (e.g., LFNST) indicating the transformation matrix to be used, or it may be the transformation matrix itself.

[0347] Furthermore, in embodiments of the present disclosure, the bitstream can be decoded and a first identification information can be determined, where the value of the first identification information is a first value, determined using a first transformation parameter, and where the value of the first identification information is a second value, determined using a second transformation parameter.

[0348] In other words, in embodiments of the present disclosure, it is possible to determine, based on first identification information transmitted in the bitstream, whether to use a first transformation parameter determined based on a first reference block or a second transformation parameter determined based on a prediction block.

[0349] In embodiments of this disclosure, an initial predicted value, i.e., a first transformation parameter generated by the first reference block of the current block, and a final predicted value, i.e., a second transformation parameter generated by the prediction block of the current block, can be used in combination, and a certain conditional decision can be made to select which data-derived prediction direction (or gradient direction) to use. For example, it can be decided whether to use the first transformation parameter or the second transformation parameter based on first identification information determined by the decoded bitstream.

[0350] In the embodiments of this disclosure, the first and second values ​​are different, and the first and second values ​​may be in parameter form or numerical form. Specifically, the first prediction mode identification information and the second prediction mode identification information may be parameters written in the profile, or flag values, and no specific limitations are made here. Furthermore, regarding the first and second values, the first value can be set to 1 and the second value to 0. Alternatively, the first value can be set to 0 and the second value to 1. Alternatively, the first value can be set to true and the second value to false. Alternatively, the first value can be set to false and the second value to true. Here, in the embodiments of this disclosure, the first value is set to 0 and the second value is set to 1, but no specific limitations are made.

[0351] For example, in some embodiments, the encoding side can decide whether to directly adopt the prediction direction derived from one of the prediction data based on the agreement between the prediction direction derived from the initial prediction and the prediction direction derived from the final prediction, or to use a first identification information in the bitstream to instruct and decide which prediction data's prediction direction to use.

[0352] Furthermore, in embodiments of this disclosure, a first prediction histogram corresponding to a first reference block and a second prediction histogram corresponding to a prediction block can be determined.

[0353] In response to this, embodiments of the present disclosure can determine a first gradient direction and a second gradient direction in a first prediction histogram, and if the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block can be determined based on a first transformation parameter, and if the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block can be determined based on a second transformation parameter.

[0354] In the embodiments of this disclosure, the first gradient direction may be the gradient direction with the highest (maximum) amplitude in the first predicted histogram, and the second gradient direction may be the gradient direction with the next highest amplitude in the first predicted histogram.

[0355] In response to this, embodiments of the present disclosure can determine a first gradient direction and a second gradient direction in a second prediction histogram, and if the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block can be determined based on the first transformation parameter, and if the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block can be determined based on the second transformation parameter.

[0356] In the embodiments of this disclosure, the first gradient direction may be the gradient direction with the highest (maximum) amplitude in the second prediction histogram, and the second gradient direction may be the gradient direction with the next highest amplitude in the second prediction histogram.

[0357] In embodiments of this disclosure, an initial predicted value, i.e., a first transformation parameter generated by the first reference block of the current block, and a final predicted value, i.e., a second transformation parameter generated by the prediction block of the current block, can be used in combination, and decisions can be made based on a mode histogram (first prediction histogram or second prediction histogram). If the highest amplitude and the next highest amplitude differ significantly, for example, if they exceed a predetermined threshold, a spike value can be considered to exist, in which case the direction is derived using the predicted value before data processing (initial predicted value); otherwise, the direction is derived using the predicted value after data processing (final predicted value).

[0358] Furthermore, in embodiments of the present disclosure, it is possible to determine the template direction corresponding to the first template, then determine a first correlation parameter between the gradient direction with the maximum amplitude in the first prediction histogram and the template direction, and simultaneously determine a second correlation parameter between the gradient direction with the maximum amplitude in the second prediction histogram and the template direction, if the first correlation parameter is greater than or equal to the second correlation parameter, the reconstructed block corresponding to the current block can be determined based on the first transformation parameter, and if the first correlation parameter is less than the second correlation parameter, the reconstructed block corresponding to the current block can be determined based on the second transformation parameter.

[0359] In the embodiments of this disclosure, an initial predicted value, i.e., a first transformation parameter generated by the first reference block of the current block, and a final predicted value, i.e., a second transformation parameter generated by the prediction block of the current block, can be used in combination. Here, the template direction (the template direction of the first template) can be used as a reference, and the gradient directions derived by the reference block before data processing (initial predicted value) and the prediction block after data processing (final predicted value) can be compared. The gradient direction closest to the template direction can be selected as the gradient direction to be used in the end, i.e., a transformation matrix corresponding to the predicted data close to the template direction can be selected for subsequent transformation processing.

[0360] Furthermore, in embodiments of this disclosure, when determining the first transformation parameters, the horizontal and vertical slopes corresponding to the first reference block can be determined based on a partial or all sample within the first reference block.

[0361] Furthermore, in embodiments of this disclosure, when determining the second transformation parameters, the horizontal and vertical slopes corresponding to the prediction block can be determined based on partial or all samples within the prediction block.

[0362] In other words, in the embodiments of this disclosure, all or partial sample values ​​can be selected to derive the direction. For example, following the point selection method of CCLM, four points can be obtained on the upper and left sides, and the direction can be derived.

[0363] Furthermore, in embodiments of this disclosure, a modification process can be performed on the first reference block of the current block according to a first processing strategy to determine the first predicted block corresponding to the first reference block, and then a modification process can be performed on the first predicted block according to a second processing strategy to determine the predicted block of the current block.

[0364] In response to this, embodiments of the present disclosure can further determine a third transformation parameter corresponding to the current block based on a first prediction block, and then determine a reconstructed block corresponding to the current block based on the prediction block of the current block and the third transformation parameter corresponding to the current block.

[0365] In embodiments of this disclosure, the transformation parameter of the current block, for example, the third transformation parameter, may include an index reference (e.g., LFNST) indicating the transformation matrix to be used, or it may be the transformation matrix itself.

[0366] It is also understood that, in embodiments of this disclosure, if multi-stage processing is required between the final predicted value and the initial predicted value, it is possible to choose to use the intermediate predicted values ​​(i.e., the first prediction block) as input for determining the prediction direction. For example, if the predicted values ​​based on BV first go through filtering and then fused to obtain the final predicted value, the filtered intermediate prediction information, i.e., the third transformation parameter, can be used as input for determining the corresponding transformation matrix.

[0367] In embodiments of this disclosure, the first and second processing strategies may include at least one of a plurality of processes, including fusion, filtering, subpixel processing, and sample inversion.

[0368] Therefore, the decoding method according to the embodiments of this disclosure is a method for obtaining reconstructed values ​​based on a BV prediction mode. The focus is on the generation of the predicted values ​​and the residual quadratic transformation selection method that depends on the predicted values. For the initial predicted values ​​obtained by BV, a direction derivation similar to DIMD technique is performed, and using the derived direction as a guide, a transformation related to the direction is selected, and an inverse transformation is performed using the transformation matrix to generate residuals. On the other hand, compared to the final predicted values ​​that have undergone subsequent data processing processes such as filtering, fusion, and sub-pixelation, the initial predicted values ​​have richer texture edge information. Therefore, by using the initial predicted values, more accurate gradient direction, predicted angle, and angular amplitude can be derived, thereby determining a more matched conventional intra-prediction mode. Furthermore, a highly accurate LFNST transformation kernel can be obtained, a more matched transformation matrix can be determined, and consequently, the performance of encoding and decoding can be effectively improved. On the other hand, after determining the first reference block directly indicated by the BV, steps such as generating the prediction block and generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path for encoding and decoding, solving the problem of high complexity, improving encoding and decoding efficiency, and simultaneously being advantageous for realizing hardware design.

[0369] For example, in some embodiments, Figure 13 is a first schematic diagram showing the acquisition of reconstructed sample values ​​based on the BV prediction mode according to embodiments of the present disclosure, and as shown in Figure 13, the sample value reconstruction process may mainly include several steps: S1. determination of block vectors, S2. generation of initial prediction values, S3. generation of final prediction values, S4. intra-prediction mode mapping, S5. determination of transformation block matrix, S6. inverse transformation of quadratic transformation, S7. inverse transformation of linear transformation, and S8. generation of reconstructed values.

[0370] Here, for the intra-prediction mode mapping step, the input is not the final predicted value corresponding to the current block, but the initial predicted value directly indicated by the BV corresponding to the current block, i.e., the first reference block of the current block.

[0371] In the embodiments of this disclosure, the initial predicted value obtained directly based on the prediction parameters, for example, the first reference block directly indicated by the BV, has more texture edge information than the final predicted value obtained after subsequent data processing processes such as filtering, merging, and sub-pixelating. This is because data processing processes performed based on the initial predicted value, such as filtering, merging, and sub-pixelating, for example, low-pass filtering, are equivalent to a type of smoothing operation, and the final predicted value obtained after processing loses some texture edge information.

[0372] In response to this, in the embodiments of this disclosure, in the process of mapping intra-prediction modes based on predicted values, the initial predicted values ​​have richer texture edge information. Therefore, compared to mapping intra-prediction modes using final predicted values, using initial predicted values ​​allows for the derivation of more accurate gradient direction, predicted angle, and angular amplitude, thereby enabling the determination of a more matched conventional intra-prediction mode.

[0373] In response to this, in the embodiments of the present disclosure, after determining the corresponding intra-prediction mode using initial prediction values ​​directly obtained by prediction parameters, for example, a first reference block directly indicated by BV, a more accurate LFNST transform kernel can be obtained, thereby determining a better-matched transform matrix and effectively improving the performance of encoding and decoding.

[0374] For example, in some embodiments, Figure 14 is a second schematic diagram showing the acquisition of reconstructed sample values ​​based on the BV prediction mode according to embodiments of the present disclosure, and as shown in Figure 14, the sample value reconstruction process may mainly include several steps: S1. determination of block vectors, S2. generation of initial prediction values, S3. generation of final prediction values, S4. intra-prediction mode mapping, S5. determination of the transformation block matrix, S9. inverse transformation, and S8. generation of reconstructed values.

[0375] Here, for the intra-prediction mode mapping step, the input is not the final predicted value corresponding to the current block, but the initial predicted value directly indicated by the BV corresponding to the current block, i.e., the first reference block of the current block.

[0376] In the embodiments of this disclosure, the initial predicted value obtained directly based on the prediction parameters, for example, the first reference block directly indicated by the BV, has more texture edge information than the final predicted value obtained after subsequent data processing processes such as filtering, merging, and sub-pixelating. This is because data processing processes performed based on the initial predicted value, such as filtering, merging, and sub-pixelating, for example, low-pass filtering, are equivalent to a type of smoothing operation, and the final predicted value obtained after processing loses some texture edge information.

[0377] In response to this, in embodiments of the present disclosure, the transformation scheme used to perform the inverse transformation in S9 may employ a transformation method other than LFNST. For example, if a non-separable primary transform (NSPT) is employed, the transformation matrix can also be determined using an initial predicted value directly indicated by BV that corresponds to the current block.

[0378] In the embodiments of this disclosure, the decoding method according to the embodiments of this disclosure is illustrated by using a block vector (BV) as an example of the prediction parameter corresponding to the current block and LFNST as an example of the transformation scheme. However, the prediction parameter and transformation scheme are not limited; that is, the solution according to the embodiments of this disclosure can be applied to other prediction parameters, transformation parameters, and transformation schemes.

[0379] Embodiments of the present disclosure provide a decoding method. The decoder determines prediction parameters corresponding to the current block, determines a first reference block of the current block based on the prediction parameters of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. In other words, in embodiments of the present disclosure, after determining the first reference block of the current block based on the prediction parameters, it is possible to choose to directly use the first reference block, which has not undergone data processing, to determine the transformation parameters of the current block, and then combine the determined transformation parameters with the prediction block of the current block obtained by data processing the first reference block to complete the reconstruction of the current block. Here, the data processing process loses some of the texture edge information of the prediction block. Therefore, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block). By using the first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, thereby effectively improving the performance of encoding and decoding. At the same time, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block and generating the transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding, solving the problem of high complexity, and thereby improving the encoding and decoding efficiency. Thus, the encoding and decoding methods according to the embodiments of this disclosure can improve the efficiency and performance of encoding and decoding.

[0380] One embodiment of the present disclosure proposes an encoding method, which is applied to an encoder. Figure 15 is a flowchart of the encoding method proposed in the embodiment of the present disclosure, and as shown in Figure 15, the encoding process performed by the encoder may include the following steps.

[0381] Step 1501: Determine the prediction parameters corresponding to the current block.

[0382] In embodiments of this disclosure, the prediction parameters corresponding to the current block can first be determined.

[0383] Furthermore, the encoding method of the embodiments of this disclosure is applied to an encoder. Moreover, this encoding method may include a type of intra-prediction method, more specifically, a type of color component prediction method. Here, a video image can be divided into a plurality of encoding blocks, each encoding block may include a first color component, a second color component, and a third color component, and the current block in the embodiments of this disclosure refers to the encoding block in the video image that is currently subject to intra-prediction.

[0384] Here, if we need to predict the first color component, the component to be predicted is the first color component. If we need to predict the second color component, the component to be predicted is the second color component. If we need to predict the third color component, the component to be predicted is the third color component. Furthermore, assuming that the current block predicts the first color component, and the first color component is the luminance component, i.e., the component to be predicted is the luminance component, the current block is also called a luminance block. Alternatively, assuming that the current block predicts the second color component, and the second color component is the chrominance component, i.e., the component to be predicted is the chrominance component, the current block is also called a chrominance block.

[0385] In the embodiments of this disclosure, the prediction parameter corresponding to the current block may include the block vector of the current block.

[0386] In the embodiments of this disclosure, the first reference block is located in the same image as the current block. Accordingly, the block vector represents the positional offset between the current block and the first reference block.

[0387] To make it clear, in embodiments of this disclosure, in the intra-prediction mode, the first reference block of the current block is determined based on the block vector of the current block.

[0388] In embodiments of this disclosure, the prediction parameters corresponding to the current block may include the motion vector and reference image index of the current block.

[0389] In the embodiments of this disclosure, the first reference block is located within the reference image indicated by the reference image index. Correspondingly, the motion vector represents the positional offset between the current block and the first reference block.

[0390] To make it clear, in embodiments of this disclosure, in the interprediction mode, the first reference block of the current block is determined based on the motion vector of the current block.

[0391] In this embodiment of the disclosure, a block vector (BV) is used as an example of the prediction parameter corresponding to the current block, and LFNST is used as an example of the transformation scheme, and the encoding method proposed in this embodiment of the disclosure will be explained exemplarily.

[0392] Furthermore, in the embodiments of this disclosure, when determining the block vector of the current block, a first template corresponding to the current block can be determined first, and a predetermined search area can be determined. A search is performed within the predetermined search area to determine the block vector of the current block.

[0393] Furthermore, in the embodiments of this disclosure, when determining the block vector of the current block, a first template corresponding to the current block can be determined first, and a predetermined search area can be determined. A search is performed within the predetermined search area to construct a list of candidate block vectors for the current block. Based on the list of candidate block vectors, the block vector of the current block is determined.

[0394] Furthermore, in the embodiments of this disclosure, when determining the block vector of the current block, the block vectors of the adjacent blocks corresponding to the current block can be determined first. Based on the block vectors of the adjacent blocks, a list of candidate block vectors for the current block is constructed. Based on the list of candidate block vectors, the block vector of the current block is determined.

[0395] For example, in some embodiments, when acquiring a first template in IntraTMP mode, the template type corresponding to the current block can be determined first, and then the first template corresponding to the current block can be further determined based on the template type. Here, it can also be chosen to determine the template type of the current block based on instruction information in the bitstream. Alternatively, it can be chosen to determine the template type of the current block based on the size of the current block. Furthermore, it can also be chosen to determine the template type of the current block based on a reference sample of the current block.

[0396] To make it clear, in embodiments of the present disclosure, the reference sample of the current block may include adjacent already reconstructed samples of the current block, that is, adjacent already reconstructed samples of the current block may be used as templates, and the system may choose to search for matching templates within a predefined search area.

[0397] In embodiments of this disclosure, the reference samples of the current block, i.e., the adjacent already reconstructed samples of the current block, may include the upper reference sample, upper left reference sample, upper right reference sample, left reference sample, and lower left reference sample of the current block.

[0398] To make it clear, in embodiments of this disclosure, when determining the template type of the current block using the reference samples of the current block, the template type can be classified and determined based on the availability of adjacent reference samples.

[0399] In other words, in embodiments of the present disclosure, the template type can be determined based on the availability information of the reference sample of the current block, based on the information indicated by the bitstream, or by a combination of the availability information of the reference sample and the information indicated by the bitstream. The present disclosure does not make any specific limitations.

[0400] In the embodiments of this disclosure, when determining the first template corresponding to the current block based on the template type, the template reference sample for the current block can be determined first based on the template type and the template size corresponding to the template type, and then the first template for the current block can be determined based on the template reference sample.

[0401] In the embodiments of this disclosure, the template size corresponding to the template type may be pre-configured, indicated by a bitstream syntax element, or adaptively selected based on block size or other information. For example, when obtaining the left template, the template width templateW_size can be set to 4, and when obtaining the top template, the template height templateH_size can be set to 4.

[0402] In embodiments of this disclosure, the block vector search process may include several parts, such as an initialization process, determination of a search area (a predetermined search area) for a first template in the current intranet, searching within the search area, and determination of one or more optimal block vectors.

[0403] In the embodiments of this disclosure, as shown in Figure 3, the shaded area represents the reconstruction area, the grid-filled block is the current block, and the adjacent area of ​​the current block is the first template (T). The vertically filled block is the reference block, and the adjacent area of ​​the reference block is the second template (i.e., the best match template, T_BEST). Here, the offset of the second template relative to the first template is the best block vector (BV_BEST).

[0404] In embodiments of this disclosure, the predetermined cost function may be the absolute sum of errors (SAD), the absolute sum of transformation differences (SATD), the mean squared error (MSE), the sum of squared errors (SSD), the mean absolute difference (MAD), the mean sum of squared errors (MSD), the normalized correlation (NCC), etc., but is not specifically limited thereto.

[0405] In embodiments of this disclosure, a matching cost value is determined between a matching template (matching template) corresponding to a search point in a predetermined search area and a first template based on predetermined matching criteria. Next, one or more block vectors are determined based on the matching cost value. If there are multiple block vectors, a list of BV candidates can be established, which stores multiple BV candidates in ascending order of cost, and then the corresponding syntactic elements in the bitstream are used to determine which BV candidate is ultimately selected.

[0406] For example, in some embodiments, there are various ways to obtain BV in IBC mode. For instance, in IBC MERGE mode, the encoder constructs a MERGE list, determines the MERGE list option index, and then obtains specific BV information from the corresponding option in the MERGE list based on the index. Alternatively, for example, in normal IBC mode, the encoder can obtain specific BV information based on BV or BV prediction difference.

[0407] For example, in some embodiments, the specific flow for deriving BV in IBC mode is as follows:

[0408] (1) Brightness: Input: A luminance position (xCb, yCb) specifying the position of the top-left sample of the current encoding block relative to the top-left luminance sample of the current image; a variable cbWidth specifying the width of the current encoding block in the luminance sample; and a variable cbHeight specifying the height of the current encoding block in the luminance sample.

[0409] Output: Brightness in BVL (Block Vector Luma).

[0410] The IBC modes are divided into IBCMERGE and IBCAMVP, and in both cases, it is necessary to construct an IBC block vector candidate list (BVCandList) when deriving the BVL. The list construction flow for IBCMERGE is shown below, and the list construction flow for IBCAMVP is the same as for IBCMERGE, but the maximum number of candidates differs between the two.

[0411] Step 1: If IsGt4by4 is TRUE (the variable IsGt4by4 is TRUE if the product of luminance width and height is greater than 16), the process for deriving candidate spatial block vectors from adjacent coding units as defined in the decoding standard is invoked, taking the luminance coded block position (xCb, yCb), luminance coded block width cbWidth, and height cbHeight as inputs. The outputs are the availability flags availableFlagA1 and availableFlagB1, and the block vectors BVA1 and BVB1, where A1 and B1 are adjacent blocks. As shown in Figure 6, the relative positions of the adjacent blocks where A1 and B1 are located and the current coded block are the lower left corner and the upper right corner, respectively.

[0412] Step 2: If IsGt4by4 is TRUE, the block vector candidate list BVCandList is constructed as follows:

[0413] i=0 if(availableFlagA1) BVCandList [i++]=BVA1 if(availableFlagB1) BVCandList [i++]=BVB1 Step 3: The variable numCurrCand represents the number of candidates obtained so far. The derivation process for numCurrCand is as follows:

[0414] If IsGt4by4 is equal to TRUE, numCurrCand is set to equal to the number of candidates in BVCandList. Otherwise, numCurrCand is set to 0.

[0415] Step 4: If numCurrCand is less than MaxNumIbcMERGECand (maximum number of candidates in MERGE mode) and NumHmvpIbcCand (represents the maximum number of candidates for the past optimal block vector (Hmvp) in IBC mode) is greater than 0, call the derivation process of IBC block vector candidates based on the history specified in the decoding standard, with BVCandList and numCurrCand as inputs and the modified BVCandList and numCurrCand as outputs.

[0416] Step 5: If numCurrCand is less than MaxNumIbcMERGECand, the following applies until numCurrCand is equal to MaxNumIbcMERGECand:

[0417] BVCandList[numCurrCand][0] (i.e., the horizontal component of BV) is set to equal to 0.

[0418] BVCandList[numCurrCand][1] (i.e., the vertical component of BV) is set to equal to 0.

[0419] numCurrCand increases by 1.

[0420] In this way, the construction of the block vector candidate list BVCandList is completed, and general_MERGE_flag is used to indicate whether or not it is in IBC MERGE mode, and the candidate index BVIdx is derived in the following way.

[0421] BVIdx=general_MERGE_flag[xCb][yCb] ? MERGE_idx[xCb][yCb]:mvp_l0_flag[xCb][yCb] In this way, a specific BVL can be obtained based on the index BVIdx and the block vector candidate list BVCandList.

[0422] BVL[0]=BVCandList[BVIdx][0] BVL[1]=BVCandList[BVIdx][1] In IBCAMVP mode, the specific BVL obtained based on the index BVIdx and the block vector candidate list BVCandList is a predicted BVL. The actual BVL requires the addition of the block vector difference (BVD), and the specific flow is as follows.

[0423] Step 1: Obtain the horizontal and vertical components of BVD. Here, MvdL0 is the difference of the forward motion vector.

[0424] BVd[0]=MvdL0[xCb][yCb][0] BVd[1]=MvdL0[xCb][yCb][1] Step 2: Perform a rounding operation on the predicted BVL obtained above. Here, the right shift parameter AmvrShift is used for rounding, and the left shift parameter AmvrShift is used to increase the resolution.

[0425] offset=(AmvrShift == 0)? 0 :((1 << (AmvrShift - 1))- 1)BVL[0]=Sign(BVL[0])×(((Abs(BVL[0])+offset)>>AmvrShift)<< AmvrShift) BVL[1]=Sign(BVL[1])×(((Abs(BVL[1])+offset)>>AmvrShift)< <AmvrShift) Step 3: The actual BVL derivation is as follows, and its range needs to be controlled between -217 and 217 - 1.

[0426] u[0]=(BVL[0]+BVd[0]+218)% 218 BVL[0]=(u[0] >= 217)? (u[0] - 218): u[0] u[1]=(BVL[1]+BVd[1]+218)% 218 BVL[1]=(u[1] >= 217)? (u[1] - 218): u[1] (2) Chromatic difference: In the case of dual-tree partitioning, IBC is not performed on chromatic difference. In the case of single-tree partitioning, it is necessary to derive the BV of the chromatic difference.

[0427] Input: Brightness BVL (1 / 16 pixel precision) Output: Color difference BVC (Block Vector chroma) (1 / 32 pixel precision) The derivation process is as follows:

[0428] BVC[0]=((BVL[0] >>(3+SubWidthC))×32) BVC[1]=((BVL[1] >>(3+SubHeightC))×32) Here, the specific flow of the prediction sample using BV is as follows:

[0429] Input: Luminance position (xCb, yCb) specifying the position of the top-left sample of the current encoding block relative to the top-left luminance sample of the current image; variable cbWidth specifying the width of the current encoding block in the luminance sample; variable cbHeight specifying the height of the current encoding block in the luminance sample; block vector (BV); variable cIdx specifying the color component index of the current block.

[0430] Output: Predicted sample array predSamples.

[0431] The derivation process is as follows:

[0432] If cIdx is equal to 0, i.e., the luminance component, then for x = xCb..xCb + cbWidth - 1 and y = yCb..yCb + cbHeight - 1: xVb=(x+(BV[0] >>4))&(IbcBufWidthY - 1) yVb=(y+(BV[1] >>4))&(CtbSizeY - 1) predSamples[x][y]=ibcVirBuf[0][xVb][yVb] IbcBufWidthY is the width of the luminance samples in the reconstruction buffer stored by the IBC, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconstruction sample stored by the IBC.

[0433] If cIdx is not equal to 0, i.e., it is a color difference component, then for x = xCb / SubWidthC ... xCb / SubWidthC + cbWidth / SubWidthC - 1 and y = yCb / SubHeightC ... yCb / SubHeightC + cbHeight / SubHeightC - 1: xVb=(x+(BV[0] >>5))&(IbcBufWidthC- 1) yVb=(y+(BV[1] >>5))&((CtbSizeY / subHeightC)- 1) predSamples[x][y]=ibcVirBuf[cIdx][xVb][yVb] The variables SubWidthC and SubHeightC specifically depend on the color difference format sampling structure specified by sps_chroma_format_idc, and the specific correspondence is shown in Table 1.

[0434] Furthermore, in embodiments of this disclosure, it is possible to first determine the prediction mode corresponding to the current block, and if it is determined that the current block uses a prediction mode based on prediction parameters, the process of determining the prediction parameters, i.e., step 1501 above, can be performed. At the same time, prediction mode identifier information corresponding to the current block can be determined and written to the bitstream.

[0435] To make it clear, in embodiments of this disclosure, the decoding side can, after receiving the video bitstream, first determine predictive mode identifiers corresponding to the current block. Here, the predictive mode identifiers indicate the encoding mode of the current block and the parameters associated with that mode.

[0436] In the embodiments of this disclosure, the prediction mode typically includes a conventional intra-prediction mode and a non-conventional intra-prediction mode. The conventional intra-prediction mode may include DC mode, PLANAR mode, angle mode, etc., while the non-conventional intra-prediction mode may include MIP mode, CCLM mode, IBC mode, PLT mode, IntraTMP mode, etc.

[0437] To make it clear, in embodiments of this disclosure, predictive coding is performed on the encoder side for the current block, in which process the predictive mode for the current block is determined, the corresponding predictive mode identifier is written to the bitstream, and transmitted from the encoder to the decoder.

[0438] In response to this, the decoder can obtain predictive mode identifier information corresponding to the current block by decoding the bitstream, and subsequently determine which encoding mode is specifically the decoding mode of the current block based on the predictive mode identifier information.

[0439] In embodiments of this disclosure, the prediction mode identification information can be used to indicate whether the current block uses a prediction mode based on prediction parameters.

[0440] For example, in some embodiments, prediction mode identification information can be used to determine whether the current block uses a block vector-based prediction mode, such as IBC mode or IntraTMP mode.

[0441] For example, in some embodiments, if it is determined that the current block uses a prediction mode based on prediction parameters, the value of the prediction mode identifier is determined to be a first value. If it is determined that the current block does not use a prediction mode based on prediction parameters, the value of the prediction mode identifier is determined to be a second value.

[0442] In the embodiments of this disclosure, the first and second values ​​are different, and the first and second values ​​may be in parameter form or numerical form. Specifically, the first prediction mode identification information and the second prediction mode identification information may be parameters written in the profile, or they may be flag values, but this is not specifically limited here. Also, regarding the first and second values, the first value can be set to 1 and the second value can be set to 0. Alternatively, the first value can be set to 0 and the second value can be set to 1. Alternatively, the first value can be set to true and the second value can be set to false. Alternatively, the first value can be set to false and the second value can be set to true. Here, in the embodiments of this disclosure, the first value is set to 0 and the second value is set to 1, but this is not a specific limitation.

[0443] Step 1502: Determine the first reference block of the current block based on the prediction parameters of the current block.

[0444] In embodiments of this disclosure, after determining the prediction parameters corresponding to the current block, a first reference block of the current block can be determined based on the prediction parameters of the current block.

[0445] In the embodiments of this disclosure, at least one reference block corresponding to the current block can be determined based on the block vector of the current block.

[0446] In embodiments of this disclosure, at least one reference block corresponding to the current block can be determined based on the motion vector of the current block. It should be noted that in embodiments of this disclosure, the first reference block of the current block can be an initial prediction block directly obtained based on prediction parameters. For example, the first reference block can be an initial prediction block directly derived using the block vector of the current block, or it can be an initial prediction block directly derived based on the motion vector of the current block.

[0447] For example, in some embodiments, the block vector of the current block determined in IntraTMP mode can be the optimal block vector (BV_BEST)(pX_BEST, pY_BEST), where pX_BEST and pY_BEST are the horizontal and vertical offsets of the optimal match template relative to the current block template, and also the horizontal and vertical offsets of the optimal match reconstructed block relative to the current block.

[0448] Furthermore, in embodiments of this disclosure, determining the first reference block corresponding to the current block based on the determined block vector can be achieved using simple translation and copying. The specific operation is as follows:

[0449] Regarding x = 0 ... nTbW-1 and y = 0 ... nTbH-1: predSamples[x][y] = recSamples[x + pX_BEST][y + pY_BEST] (7) Here, recSamples represents the reconstructed samples of the current frame.

[0450] For example, in some embodiments, the IBC mode has the following inputs: a luminance position (xCb, yCb) specifying the position of the top-left sample of the current coded block relative to the top-left luminance sample of the current image; a variable cbWidth specifying the width of the current coded block in the luminance sample; a variable cbHeight specifying the height of the current coded block in the luminance sample; a block vector (BV); and a variable cIdx specifying the color component index of the current block. The output is an array of predicted samples, predSamples.

[0451] If cIdx is equal to 0, i.e., the luminance component, then for x = xCb..xCb + cbWidth - 1 and y = yCb..yCb + cbHeight - 1: xVb = ( x + ( BVL

[0000] >> 4 ) ) & ( IbcBufWidthY - 1 ) yVb = ( y + ( BVL

[0001] >> 4 ) ) & ( CtbSizeY - 1 ) predSamples[ x ][ y ] = ibcVirBuf

[0000] [ xVb ][ yVb ] IbcBufWidthY is the width of the luminance samples in the reconstruction buffer stored by the IBC, CtbSizeY is the size of the CTU (Coding Tree Unit), and ibcVirBuf is the reconstruction sample stored by the IBC.

[0452] If cIdx is not equal to 0, i.e., a chrominance component, then for x = xCb / SubWidthC..xCb / SubWidthC + cbWidth / SubWidthC - 1 and y = yCb / SubHeightC..yCb / SubHeightC + cbHeight / SubHeightC - 1: xVb = ( x + ( BVC

[0000] >> 4 ) ) & ( IbcBufWidthC - 1 ) yVb = ( y + ( BVC

[0001] >> 4 ) ) & ( ( CtbSizeY / subHeightC ) - 1 ) predSamples[ x ][ y ] = ibcVirBuf[ cIdx ][ xVb ][ yVb ].

[0453] Step 1503: Determine the first transformation parameter of the current block based on the first reference block of the current block.

[0454] In embodiments of this disclosure, after determining the first reference block of the current block based on the prediction parameters of the current block, the first transformation parameters of the current block can be determined based on the first reference block of the current block.

[0455] In embodiments of this disclosure, the transformation parameter of the current block, for example, the first transformation parameter, may include an index reference (e.g., LFNST) to indicate the transformation matrix to be used, or it may be the transformation matrix itself.

[0456] Furthermore, in embodiments of this disclosure, when determining the first transformation parameter of the current block based on the first reference block of the current block, the statistical characteristic parameter of the first reference block can be determined first. Then, the first transformation parameter is determined based on the statistical characteristic parameter.

[0457] In the embodiments of this disclosure, the statistical characteristic parameters include the covariance matrix.

[0458] Furthermore, in embodiments of this disclosure, when determining the first transformation parameter of the current block based on the first reference block of the current block, intra-mode information corresponding to the current block can be determined first based on the first reference block of the current block. Next, the first transformation parameter is determined based on the intra-mode information.

[0459] To make it clear, in embodiments of this disclosure, the intra-mode information corresponding to the current block may include conventional intra-predictive mode indication information determined after intra-predictive mode mapping.

[0460] In the embodiments of this disclosure, when determining intra-mode information corresponding to the current block based on the first reference block of the current block, the horizontal and vertical slopes corresponding to the first reference block of the current block can be determined first. Next, intra-mode information corresponding to the current block is determined based on the horizontal and vertical slopes.

[0461] In the embodiments of this disclosure, when determining the horizontal and vertical slopes corresponding to the first reference block of the current block, it is possible to choose to determine the horizontal and vertical slopes corresponding to the first reference block based on a predetermined operator.

[0462] For example, in some embodiments, a predetermined operator can be used to determine gradient information, for instance, the predetermined operator may be the Sobel operator. Here, the Sobel operator can complete the calculation of the horizontal and vertical gradients of the first reference block.

[0463] For example, in some embodiments, the Sobel operator is G x and G y Includes G x This is used to calculate the horizontal slope, G y This is used to calculate the vertical slope.

[0464]

number

number

[0465] In the embodiments of this disclosure, the intra-mode information corresponding to the current block, which is determined based on the gradient direction of the maximum amplitude in the first prediction histogram, can be a conventional intra-prediction mode predModeIntra, where predModeIntra is between [0, 66].

[0466] For example, in some embodiments, the vertical and horizontal gradients of all prediction samples of a first reference block can be calculated based on a first reference block directly obtained based on prediction parameters, and then the direction of the maximum gradient is mapped to a conventional intra-prediction mode, i.e., the intra-mode information predModeIntra corresponding to the current block is determined.

[0467] In other words, in embodiments of the present disclosure, gradient information between samples in a first reference block can be used to derive a dominant prediction direction, thereby completing the mapping of intra-prediction modes based on the first reference block and obtaining the corresponding intra-mode information, predModeIntra.

[0468] For example, in some embodiments, the horizontal and vertical slopes of the first reference block under Intra TMP can be calculated using the Sobel operator, thereby completing the slope analysis, and a conventional intra prediction mode can be derived based on the first reference block, i.e., the corresponding intra mode information predModeIntra can be determined. Here, G x This is used to calculate the horizontal slope, G y This is used to calculate the vertical slope.

[0469] For example, in some embodiments, the input is a first reference block based on the BV mode, i.e., an initial prediction value p[x][y], where x = 0..nTbW - 1, y = 0..nTbH - 1, where nTbW represents the width of the transformed block obtained based on the current BV prediction mode, and nTbH represents the height of the transformed block obtained based on the current BV prediction mode.

[0470] For example, in some embodiments, the output is intra-mode information corresponding to the current block, a conventional intra-predictive mode predModeIntra, where predModeIntra is between [0, 66].

[0471] For example, in some embodiments, the process of performing intra-predictive mode mapping based on a first reference block may sequentially involve the following operations:

[0472] Set mapHgV = {{2,1}, {1,2}} and mapVgH = {{3,4}, {4,3}}. Set angTable = { 0, 2048, 4096, 6144, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 47104, 53248, 59392, 65536} Set angOffset = {18, 18, 50, 50} The HoG

[67] array is set to contain the gradient strengths for each conventional intra-prediction mode. At the start of this process, all values ​​in all HOG arrays are initialized to 0. For each prediction sample p[x][y], with x = 1…nTbW-2 and y = 1…nTbH-2, the calculation process is as follows.

[0473] Calculate the horizontal gradient gHor[ x ][ y ] = p[x-1][y-1] + 2p[x-1][y] + p[x-1][y+1] - p[x+1][y-1] - 2p[x+1][y] - p[x+1][y+1] Calculate the vertical gradient gVer[ x ][ y ] = p[x-1][y-1] + 2p[x][y-1] + p[x+1][y-1] - p[x-1][y+1] - 2p[x][y+1] - p[x+1][y+1] Calculate iAmp[x][y] = abs(gHor[ x ][ y ]) + abs(gVer[ x ][ y ]) Calculate signH[x][y] = gHor[x][y] < 0 ? 1 : 0 Calculate signV[ x ][ y ] = gVer[ x ][ y ] < 0 ? 1 : 0. Calculate HgV[ x ][ y ] = (abs(gHor[ x ][ y ]) > abs(gVer[ x ][ y ]) ? 1 : 0). Calculate region[ x ][ y ] = (HgV[ x ][ y ] = = 1 ? mapHgV[ signH[ x ][ y ] ][ signV[ x ][ y ] ] :mapVgH[ signH[ x ][ y ] ][ signV[ x ][ y ] ]) Calculate grad[ x][ y ] = (HgV[ x ][ y ] = = 1 ? abs(gVer[ x ][ y ]) / abs(gHor[ x ][ y ]) : abs(gVer[ x ][ y ]) / abs(gHor[ x ][ y ])) Calculate grad[ x ][ y ] = round( grad[ x ][ y ] × (1 << 16) ). Angle index angIdx[ x ][ y ] = argmin i Calculate (abs( angTable[ i ] - grad[ x ][ y ])) The intra-prediction mode calculates ipm[ x ][ y ] = angOffset[ region[ x ][ y ] ] + angIdx[ x ][ y ]. Set HOG[ipm[ x ][ y ]] = HOG[ipm[ x ][ y ]] + iAmp[x][y] If there are no non-zero amplitudes in HOG: Set predModeIntra to PLANAR Otherwise: predModeIntra to argmax i Set to (HoG[i]) Here, argmax i (L[i]), i=0,…,N returns the index from 0 to N that maximizes L (if there are multiple maximum values, the smaller index is returned), argmin i (L[i]), i=0,…,N returns the index from 0 to N that minimizes L (if there are multiple minimum values, the smaller index is returned). Finally, complete the mapping for the intra-predictive mode, predModeIntra.

[0474] In the embodiments of this disclosure, the initial predicted value obtained directly based on the prediction parameters, for example, the first reference block directly indicated by the BV, has more texture edge information compared to the final predicted value after subsequent data processing processes such as filtering, merging, and sub-pixelating. This is because data processing processes performed based on the initial predicted value, such as filtering, merging, and sub-pixelating, for example, low-pass filtering, are equivalent to a type of smoothing operation, and the final predicted value obtained after processing loses some texture edge information.

[0475] In response to this, in the embodiments of the present disclosure, in the process of mapping intra-prediction modes based on predicted values, the initial predicted values ​​have richer texture edge information. Therefore, compared to mapping intra-prediction modes using final predicted values, using the initial predicted values ​​allows for the derivation of more accurate gradient direction, predicted angle, and angular amplitude, thereby enabling the determination of a more matching conventional intra-prediction mode.

[0476] Furthermore, in embodiments of this disclosure, when determining the first transformation parameters based on intra-mode information, a candidate set of transformation kernels can first be determined based on the intra-mode information corresponding to the current block. Here, the candidate set of transformation kernels includes any number of transformation kernels. The candidate set of transformation kernels includes one of the following: an LFNST transformation kernel candidate set, an NSPT transformation kernel candidate set, and a transformation kernel candidate set determined based on the prediction direction. Next, the first transformation kernel is determined within the candidate set of transformation kernels. Finally, the first transformation parameters can be determined based on the first transformation kernel.

[0477] In the embodiments of this disclosure, the first transformation parameter can be understood as a first transformation kernel, or as a first transformation matrix; that is, the first transformation kernel can be the first transformation matrix.

[0478] In the embodiments of this disclosure, the size of the matrix corresponding to the first transformation parameter can be determined based on the current block size, that is, the size of the first transformation matrix can be determined based on the current block size.

[0479] In other words, in embodiments of the present disclosure, the set of candidate translation kernels determined based on intra-mode information corresponding to the current block can be any one of the candidate translation kernel sets determined based on the prediction direction. For example, the candidate translation kernel set can be an LFNST translation kernel set or an NSPT translation kernel set, but the present disclosure does not make any specific limitations.

[0480] In the embodiments of this disclosure, when determining the LFNST conversion kernel candidate set based on intra-mode information corresponding to the current block, the LFNST conversion kernel candidate set corresponding to the intra-mode information can be determined based on the mapping relationship between the intra-mode and the conversion kernel candidate set.

[0481] For example, in some embodiments, after determining that the current block can use LFNST technology, it is necessary to determine which LFNST translation kernel (which can be represented as kernel) the current block will use. Here, there are a total of four candidate translation kernel sets for LFNST, and these four candidate translation kernel sets may include set0, set1, set2, and set3. Here, the selected candidate translation kernel set can be implicitly derived based on the coding parameters of the current block or the coding block in which the current block is located. For example, based on the intra-prediction mode of the current block, it can be determined which of the four candidate translation kernel sets to use.

[0482] To make it clear, in embodiments of this disclosure, the value of the LFNST index number (which can be represented by SetIdx) can be determined based on the value of the intra-mode information predModeIntra corresponding to the current block. Specifically, the value of the LFNST index number is set to indicate that the current block uses LFNST and that the LFNST translation kernel is an index number in the LFNST translation kernel candidate set. Typically, an LFNST translation set contains four translation kernel candidate sets (set0, set1, set2, set3), with SetIdx values ​​corresponding to 0, 1, 2, and 3, respectively.

[0483] For example, in some embodiments, the mapping relationship between the intra-mode and the candidate conversion kernel set can be as shown in Table 4, and the corresponding LFNST conversion kernel set can be determined based on the value of predModeIntra and Table 4.

[0484] Furthermore, in embodiments of this disclosure, a first conversion kernel can also be determined within the LFNST conversion kernel candidate set, and the first conversion parameters can be determined. Next, a conversion kernel index number is determined based on the first conversion kernel, and the conversion kernel index number is written to the bitstream.

[0485] In the embodiments of this disclosure, since the LFNST conversion kernel candidate set includes two predetermined conversion kernels, by setting a conversion kernel index number, it is possible to select the conversion kernel indicated by the conversion kernel index number from the LFNST conversion kernel candidate set based on the value of the obtained conversion kernel index number. For example, if the value of the conversion kernel index number is 1, the LFNST conversion kernel of the first group of the LFNST conversion kernel candidate set (i.e., the conversion matrix of the first group) is selected. Alternatively, if the value of the conversion kernel index number is 2, the LFNST conversion kernel of the second group of the LFNST conversion kernel candidate set (i.e., the conversion matrix of the second group) is selected.

[0486] Furthermore, in embodiments of this disclosure, if the value of the translation kernel index number (i.e., lfnst_idx) is equal to 0, LFNST is not used. If the value of the translation kernel index number is greater than 0, LFNST is used, and the translation kernel index is equal to the value of the translation kernel index number, or equal to the value of the translation kernel index number minus 1. Thus, based on the translation kernel index number, the LFNST translation kernel used by the current block, i.e., the first translation kernel, can be further determined.

[0487] Furthermore, in the embodiments of this disclosure, a primary conversion coefficient length parameter and a secondary conversion coefficient length parameter can be set.

[0488] To ensure understanding, the embodiments of this disclosure also require setting core parameters. Regarding the setting of core parameters, first, the length of the input quadratic transformation coefficient vector for the LFNST calculation (which can be expressed as nonZeroSize), i.e., the quadratic transformation coefficient length parameter, must be set. Furthermore, the length of the output linear transformation coefficient vector (which can be expressed as nLfnstOutSzie), i.e., the linear transformation coefficient length parameter, must be set.

[0489] Furthermore, in the embodiments of this disclosure, when determining the first transformation parameters based on the first transformation kernel, the transformation matrix size can be determined based on the linear transformation coefficient length parameter and / or the quadratic transformation coefficient length parameter. This allows the first transformation parameters to be determined based on the first transformation kernel and the transformation matrix size.

[0490] To make it clear, in embodiments of this disclosure, the first transformation parameter may be the transformation matrix corresponding to the current block.

[0491] In the embodiments of this disclosure, the initial predicted values ​​obtained directly based on the prediction parameters, such as the first reference block directly indicated by the BV, have more texture edge information compared to the final predicted values ​​obtained after subsequent data processing processes such as filtering, merging, and sub-pixel processing. Therefore, by using the initial predicted values ​​in the process of mapping intra-prediction modes based on the predicted values, more accurate gradient directions, predicted angles, and angular amplitudes can be derived, thereby enabling the determination of a more accurate conventional intra-prediction mode.

[0492] In response to this, in embodiments of the present disclosure, after determining the corresponding intra-prediction mode using initial prediction values ​​directly obtained based on prediction parameters, for example, a first reference block directly indicated by BV, a more accurate LFNST transform kernel can be obtained, thereby determining a more matching transform matrix.

[0493] For example, in some embodiments, as shown in Figure 12, the derivation of transformation parameters, i.e., transformation matrices, may specifically include the following steps.

[0494] S5.1: Determine the conversion set.

[0495] Here, when determining the transformation set, a selection is made from four transformation sets (set0, set1, set2, set3) based on the aforementioned intra prediction mode predModeIntra after mapping, thereby determining the corresponding transformation set, and thus determining the corresponding LFNST transformation kernel candidate set.

[0496] S5.2: Determine the transformation matrix group.

[0497] When determining the transformation matrix group, i.e., the corresponding transformation kernel, the choice of which of the two transformation matrix groups in the transformation set to select must be determined based on the lfnst_idx sent from the encoding side. If lfnst_idx is 1, the first group of transformation matrices is selected; if lfnst_idx is 2, the second group of transformation matrices is selected.

[0498] S5.3: Select the size of the transformation matrix.

[0499] When selecting the transformation matrix size, each transformation matrix group includes two sizes of elementary transformation matrices, with the sizes used being 16x16 and 48x16. The selection is based on nLfnstOutSzie; if nLfnstOutSzie is 16, the 16x16 elementary transformation matrix is ​​selected, and if nLfnstOutSzie is 48, the 48x16 elementary transformation matrix is ​​selected. If nonZeroSize is 8, only the first 8 rows of the transformation matrix are used for matrix multiplication calculations.

[0500] Step 1504: Determine the predicted block of the current block based on the first reference block of the current block.

[0501] In embodiments of this disclosure, after determining the first reference block of the current block based on the prediction parameters of the current block, the prediction block of the current block can be determined based on the first reference block of the current block.

[0502] Furthermore, in embodiments of this disclosure, when determining the predicted block of the current block based on the first reference block of the current block, it is possible to perform a modification process on the first reference block according to a predetermined processing strategy to determine the predicted block of the current block.

[0503] In embodiments of this disclosure, a predetermined processing strategy includes at least one of a plurality of processes: fusion processing, filtering processing, subpixel processing, and sample inversion processing.

[0504] For example, in some embodiments, when determining the predicted block of the current block based on the first reference block of the current block in IntraTMP mode, methods can be used to obtain a predicted value by fusing the positions corresponding to multiple BVs, a method of filtering and copying the reference blocks corresponding to the BVs, and a method of interpolating the corresponding reference blocks with subpixel precision and then copying the BVs.

[0505] For example, in the region search process, after obtaining a list of BV candidates through template matching, the top N entries (e.g., N=3) are selected and weighted fusion is performed. This method can be called IntraTMP Fusion mode.

[0506] Alternatively, after obtaining one optimal BV, multiple points around that BV are obtained, and the predicted values ​​corresponding to these points are weighted and merged to obtain the final predicted value. This method can be called IntraTMP FLM mode.

[0507] Alternatively, after obtaining one optimal BV, the template is sorted by subpixel precision, the best direction and precision are selected, and the predicted value is calculated using an interpolation filter. This method can be called IntraTMP SubPel mode.

[0508] For example, in some embodiments, in IBC mode, in addition to the basic copy-based prediction method described above, in IBC inversion mode, the prediction region must be inverted horizontally or vertically before the prediction values ​​are obtained. For example, a single syntax element may indicate whether or not to invert, and if so, whether it is a horizontal or vertical inversion. Based on this syntax instruction, the samples in the reference region are rearranged horizontally or vertically in reverse order to obtain the predicted sample values ​​of the encoded block.

[0509] Alternatively, a template can be used to establish a model between the current block and the predicted region, and after processing the predicted block according to the model, the predicted value for the current block can be obtained. For example, the IBC LIC mode is applied to IBC MERGE and IBC ABVP and compensates for local illumination changes using a linear equation. Similar to the LIC for interpretation of VVCs, the parameters of the linear equation can be expressed as a scaling parameter α and an offset parameter β, i.e., α × p[x] + β compensates for illumination changes, where p[x] is a reference sample that points to the position x on the current image where the BV is located. The linear model parameters are derived using the least squares method.

[0510] Based on the above prediction value acquisition, there is also an FIBC mode, which establishes a linear model between the reference block template corresponding to the BV and the current block template, obtains filter coefficients, and then applies this linear filtering model to the current block to obtain the final prediction value. There is also a prediction mode similar to the IntraTMP Fusion mode, which fuses multiple IBC prediction blocks determined based on the relationship between multiple prediction blocks and the current block template.

[0511] Based on the above predicted values, a weighted prediction can be performed using other intra-prediction methods, and the result after weighted prediction can be used as the final prediction result.

[0512] The weighted prediction method includes referencing VVC's inter / intra-hybrid prediction (CIIP) method. This involves weighting and combining the results obtained in the above prediction process with the prediction results obtained in the normal intra-directional prediction mode at each sample location. It also includes referencing VVC's inter-geometric prediction mode (GPM) method. This is based on wedge partitioning and uses results obtained in different prediction modes in different wedge regions, performing weighted mixing according to certain rules near the wedge partition lines.

[0513] For example, in some embodiments, Intra TMP technology has different prediction methods depending on the prediction mode. For instance, Intra TMP Fusion technology obtains block vectors (BVs) corresponding to N candidate templates, then uses the BVs to obtain N candidate reconstruction blocks, and then weights-fused the N candidate reconstruction blocks to obtain the predicted block for the current encoded block. Specifically, the final predicted value is generated by the steps of obtaining N candidate reconstruction blocks, determining weighted fusion weights, and then generating the predicted value by weighted fusion.

[0514] Here, when obtaining N candidate reconstruction blocks, we obtain block vectors (BVs) corresponding to the N candidate templates, and BV n Based on the current image, candidate reconstruction block RefBlock n Obtain it directly. Here, BV n The horizontal offset is pX n The vertical offset is pY n Therefore, n = 0, 1, ..., N-1.

[0515] This is achieved using simple translation and copying. The specific operations are as follows: For x = 0…nTbW-1, y = 0…nTbH-1, RefBlock n [x][y] = recSamples[x + pX n ][y + pY n ] Here, recSamples represents the reconstructed samples of the current frame.

[0516] When determining weighted fusion weights, it is necessary to obtain N candidate reconstruction blocks (RefBlock) and then calculate the weighted fusion weights W of the N candidate reconstruction blocks. The weights can be predefined fixed values, or they can be adaptively calculated values ​​using cost values, sample values, etc.

[0517] For example, in some embodiments, the Intra TMP Fusion technology is used as a candidate template refT n Reconstruction values ​​and prediction target template refpredT n The weighted fusion weights are derived by minimizing the MSE of the sample values.

[0518] Specifically, the MSE minimization process takes the autocorrelation matrix of the first P matching reference samples refT and the cross-correlation vector between the first P matching reference samples refT and the current coded block adjacent template sample curT as input, and outputs the weights of the reconstructed block corresponding to each matching reference entry.

[0519] When generating predicted values ​​through weighted fusion, a predicted block is calculated based on each candidate reconstruction block and its corresponding weighted fusion weight. Specifically, the value of each candidate reconstruction block is multiplied by its corresponding weight, and these multiplies are accumulated to obtain the current predicted block (i.e., weighted prediction).

[0520] For x = 0…nTbW-1 and y = 0…nTbH-1, the calculation of the predicted values ​​is as shown in equation (2). The output prediction block of Intra TMP Fusion is a spatial storage of each predicted value predSamples_(x,y).

[0521] For example, in some embodiments, the IntraTMP FLM mode establishes a linear filtering model using the best-match template found in the previous step and the current coded block template. This mainly involves two processes: determining the reconstruction region used to calculate the filter coefficients, and calculating the filter coefficients. For example, as shown in Figure 7, assuming the number of filter taps nTap is 5, the shape of this filter is as shown in the left figure, where C0 to C4 are the respective tap coefficients of this filter, and the point corresponding to tap coefficient C0 is the current sample Y to be predicted. pred[i][j] is the reconstructed sample ref[i][j] at the corresponding position within the best-matched block. The other points are reconstructed samples adjacent to the current spatial position within the best-matched reconstructed block. The points in the right figure are the obtained predicted sample Y pred [i][j]

[0522] For each current sample to be predicted (i, j), if the sample position in the filter template is defined as (k, l), then the corresponding reconstructed sample in the best-match block during filtering is defined as ref[i + k][j + l], and each filter coefficient at the (k, l) position in the filter template is c k,l It is defined as follows, and the specific calculation process is as shown in equations (3) to (6).

[0523] For example, in some embodiments, the Intra TMP SubPel mode scans the optimal BV in eight directions: 1 / 4, 1 / 2, 3 / 4, and up / down / left / right, top-left, top-right, bottom-left, and bottom-right, sorting them based on template cost, and then uses an interpolation filter to calculate the predicted value for the reference block corresponding to the BV with the minimum template cost.

[0524] For example, in some embodiments of IBC technology, the IBC inversion mode requires that the prediction region be inverted horizontally or vertically before obtaining the predicted values. For instance, a single syntax element indicates whether or not to invert, and if so, whether it is a horizontal or vertical inversion. Based on this syntax instruction, the samples in the reference region are rearranged horizontally or vertically in reverse order to obtain the predicted sample values ​​of the encoded block.

[0525] For example, in some embodiments, the IBC LIC mode uses a template to establish a model between the current block and the predicted region, processes the predicted block according to the model, and then obtains the predicted value for the current block. The IBC LIC mode is applied to IBC MERGE and IBC ABVP and compensates for local illumination changes using a linear equation. This is the same as the LIC for interpretation of VVCs, and the parameters of the linear equation can be expressed as a scaling parameter α and an offset parameter β, i.e., α × p[x] + β compensates for illumination changes, where p[x] is a reference sample that points to the position x on the current image where the BV is located. The linear model parameters are derived using the least squares method.

[0526] For example, in some embodiments, the Filter IBC mode establishes a linear model using the current block template and a reference block template corresponding to the BV, obtains filter coefficients, and then uses them on the current block to obtain the final predicted values. Here, for each current sample to be predicted (i, j), if the sample position in the filter template is defined as (k, l), then the corresponding reconstructed sample in the best-match block during filtering is defined as ref[i + k][j + l], and each filter coefficient at the (k, l) position in the filter template is c k,l It is defined as follows, and the specific calculation process is as shown in equations (3) to (5).

[0527] Based on the above-mentioned predicted values, a weighted prediction can be performed using other intra-prediction methods, and the result after weighted prediction can be used as the final prediction result.

[0528] The weighted prediction method includes referencing VVC's inter / intra-hybrid prediction (CIIP) method. This involves weighting and combining the results obtained in the above prediction process with the prediction results obtained in the normal intra-directional prediction mode at each sample location. It also includes referencing VVC's inter-geometric prediction mode (GPM) method. This is based on wedge partitioning and uses results obtained in different prediction modes in different wedge regions, performing weighted mixing according to certain rules near the wedge partition lines.

[0529] An example of an operation process in CIIP mode based on BV: Weighted fusion of the BV-based prediction of the current block and the prediction of a certain intra-mode. The BV-based prediction portion can be obtained by applying the usual MERGE, TM MERGE, MBVD, and ABVP modes.

[0530] If the BV-based prediction portion is in a different mode, different weights can be set. For example, if the BV-based prediction portion is in the normal IBC MERGE, TM MERGE, or MBVD mode, the weight ratio of BV-based prediction to intra-prediction is 13:3, and the intra-mode includes the TIMD mode of the current block and the intra-prediction mode at the candidate BV location. If the second and first prediction modes within the intra-mode are the same, it is determined whether the first prediction mode is in the PLANAR mode. If so, the second prediction mode is replaced with the horizontal prediction mode; otherwise, the second prediction mode is replaced with the PLANAR mode. If the BV-based prediction portion is in the ABVP mode, the weight ratio of BV-based prediction to intra-prediction is 1:1, and the TIMD mode is taken as the first prediction mode of the intra-prediction mode. If the derived prediction mode is the horizontal prediction mode, PLANAR is taken as the second prediction mode of the intra-prediction mode; otherwise, the horizontal prediction mode is taken as the second prediction mode of the intra-prediction mode.

[0531] Example of an operation process in GPM mode based on BV: The BV-based prediction portion can be treated with standard MERGE or TM MERGE.

[0532] For example, one partition can be implemented as a BV-based prediction mode and the other as an INTRA mode, and the intra-prediction mode (IPM) candidate list can be constructed using the same method as for inter-GPM, with the size of the IPM candidate list predefined as 3.

[0533] In the specific implementation, there are a total of 48 geometric partitioning modes, which can be divided into two sets of geometric partitioning modes, as shown in Tables 2 and 3.

[0534] When using BV-based GPM, send the BV-based GPM (e.g., IBC-GPM) geometric partition mode set flag to indicate whether the first or second geometric partition mode set is selected, and then send the geometric partition mode index. Additionally, send the BV-based GPM (or IBC-GPM) intra-partition flag to indicate whether intra-prediction is used for the first subpartition. Here, the intra-prediction portion must send the intra-prediction mode index, and the IBC prediction portion must send the MERGE index.

[0535] Step 1505: Determine the reconstructed block corresponding to the current block based on the predicted block and the first transformation parameter of the current block.

[0536] In embodiments of this disclosure, after determining the first reference block and predicted block of the current block based on the prediction parameters of the current block, a reconstructed block corresponding to the current block can be determined based on the predicted block and the first transformation parameters of the current block.

[0537] Furthermore, in the embodiments of this disclosure, a first transformation coefficient corresponding to the predicted residual can be determined.

[0538] Furthermore, in embodiments of this disclosure, when determining the reconstructed block corresponding to the current block based on the predicted block and first transformation parameters of the current block, the predicted residual can be determined based on the first transformation parameters and first transformation coefficients. Next, the reconstructed block corresponding to the current block can be determined based on the predicted block and predicted residual of the current block.

[0539] In the embodiments of this disclosure, when determining the predicted residual based on the first transformation parameter and the first transformation coefficient, the second transformation coefficient can be determined by performing an inverse quadratic transformation based on the first transformation coefficient and the first transformation parameter. Next, the predicted residual can be determined by performing an inverse linear transformation based on the second transformation coefficient.

[0540] To make it clear, in embodiments of this disclosure, the first transformation coefficient can be the inverse quadratic transformation coefficient vector u[i], and the second transformation coefficient can be the inverse linear transformation coefficient vector v[j].

[0541] In other words, in the embodiments of this disclosure, after determining the first transformation parameter, i.e., the transformation matrix, the inverse quadratic transformation coefficient vector u[i], i=0…nonZeroSize-1 is taken as input and multiplied by the transformation matrix to obtain the inverse linear transformation coefficient vector v[j], j=0…nLfnstOutSzie-1. Next, the one-dimensional inverse linear transformation coefficient vector v[j], j=0…nLfnstOutSzie-1 is used to construct the two-dimensional inverse linear transformation coefficient matrix d'[x][y], x=0…nLfnstSize-1, y=0…nLfnstSize-1 of the current transformation block. Here, depending on the difference in intra-prediction mode, there are two filling scan sequences for horizontal and vertical scan modes. Subsequently, the inverse transformation of the linear transformation is performed using the inverse linear transformation coefficient matrix to generate the prediction residual.

[0542] Furthermore, in the embodiments of this disclosure, a quadratic transformation coefficient vector u[i] is taken as input and multiplied by a transformation matrix to obtain a linear transformation coefficient vector v[j], where i=0,1,…,nonZeroSize-1 and j=0,1,…,nLfnstOutSize-1. Assuming that the transformation matrix obtained in the above step is lowFreqTransMatrix, the specific calculation process for v[j] is as follows.

[0543]

number

[0544]

number

number

[0545] Furthermore, in embodiments of this disclosure, after determining the predicted residual corresponding to the current block and the predicted block of the current block, an image reconstruction process for a specified color component as defined in the decoding standard can be invoked. Here, in order to perform the reconstruction operation, for modes with residuals, the predicted signal and the residual signal must be added together.

[0546] In summary, the encoding method proposed in steps 1501 to 1505 above directly derives the prediction direction using the initial prediction value based on the BV, i.e., the first reference block directly indicated by the BV, thereby leading to the selection of a transformation set related to direction. On the other hand, compared to the final prediction value after subsequent data processing processes such as filtering, fusion, and subpixel analysis, the initial prediction value has richer texture edge information. Therefore, by using the initial prediction value, more accurate gradient direction, prediction angle, and angular amplitude can be derived. This allows for the determination of a more matching conventional intra-prediction mode, the acquisition of a more accurate LFNST transformation kernel, the determination of a more matching transformation matrix, and ultimately, an effective improvement in encoding and decoding performance. On the other hand, after determining the first reference block directly indicated by the BV, steps such as prediction block generation and generation of transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding, solving the problem of high complexity, improving encoding and decoding efficiency, and simultaneously facilitating hardware design implementation.

[0547] Furthermore, in embodiments of the present disclosure, after determining a first reference block corresponding to the current block, a predicted block for the current block may be determined based on the first reference block of the current block, then a second transformation parameter corresponding to the current block may be determined based on the predicted block of the current block, and finally, a reconstructed block corresponding to the current block may be determined based on the predicted block of the current block and the second transformation parameter corresponding to the current block.

[0548] In embodiments of this disclosure, the transformation parameter of the current block, for example, the second transformation parameter, may include an index reference (e.g., LFNST) to indicate the transformation matrix to be used, or it may be the transformation matrix itself.

[0549] Furthermore, in embodiments of this disclosure, if it is determined that a first conversion parameter is to be used, the value of the first identification information may be determined to be a first value, and if it is determined that a second conversion parameter is to be used, the value of the first identification information may be determined to be a second value, and the first identification information may be written to the bitstream.

[0550] In other words, in embodiments of the present disclosure, it is possible to determine, based on first identification information transmitted in the bitstream, whether to use a first transformation parameter determined based on a first reference block or a second transformation parameter determined based on a prediction block.

[0551] To make it clear, in embodiments of the present disclosure, an initial prediction, i.e., a first transformation parameter generated by the first reference block of the current block, and a final prediction, i.e., a second transformation parameter generated by the prediction block of the current block, can be used in combination, where a certain conditional decision can be made to determine which data-derived prediction direction (or gradient direction) to select. For example, the decoder can decide whether to use the first or second transformation parameter based on a first identification information determined based on the decoded bitstream.

[0552] In the embodiments of this disclosure, the first and second values ​​are different, and the first and second values ​​may be in parameter form or numerical form. Specifically, the first prediction mode identification information and the second prediction mode identification information may be parameters written in the profile, or they may be flag values, but this is not specifically limited here. Also, regarding the first and second values, the first value can be set to 1 and the second value can be set to 0. Alternatively, the first value can be set to 0 and the second value can be set to 1. Alternatively, the first value can be set to true and the second value can be set to false. Alternatively, the first value can be set to false and the second value can be set to true. Here, in the embodiments of this disclosure, the first value is set to 0 and the second value is set to 1, but this is not a specific limitation.

[0553] For example, in some embodiments, the encoding side can decide, based on the agreement between the prediction direction derived from the initial prediction and the prediction direction derived from the final prediction, whether to directly adopt the prediction direction derived from one of the prediction data, or to use a first identification information in the bitstream to indicate which prediction data's prediction direction to use.

[0554] Furthermore, in embodiments of this disclosure, a first prediction histogram corresponding to a first reference block and a second prediction histogram corresponding to a prediction block can be determined, respectively.

[0555] In response to this, embodiments of the present disclosure can determine a first gradient direction and a second gradient direction in the first prediction histogram. If the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the second transformation parameter.

[0556] In the embodiments of this disclosure, the first gradient direction can be the gradient direction with the highest (maximum) amplitude in the first predicted histogram, and the second gradient direction can be the gradient direction with the next highest amplitude in the first predicted histogram.

[0557] In response to this, embodiments of the present disclosure can determine the first and second gradient directions in the second prediction histogram. If the amplitude difference between the first and second gradient directions is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the amplitude difference between the first and second gradient directions exceeds a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the second transformation parameter.

[0558] In the embodiments of this disclosure, the first gradient direction can be the gradient direction with the highest (maximum) amplitude in the second predicted histogram, and the second gradient direction can be the gradient direction with the next highest amplitude in the second predicted histogram.

[0559] To make it clear, in embodiments of this disclosure, an initial predicted value, i.e., a first transformation parameter generated by the first reference block of the current block, and a final predicted value, i.e., a second transformation parameter generated by the prediction block of the current block, can be used in combination, where a decision can be made based on a mode histogram (first prediction histogram or second prediction histogram). If the difference between the highest amplitude and the next highest amplitude is large, for example, if it exceeds a predetermined threshold, a spike value can be considered to exist, and direction derivation is performed using the predicted value before data processing (initial predicted value), otherwise direction derivation is performed using the predicted value after data processing (final predicted value).

[0560] Furthermore, in embodiments of this disclosure, the template direction corresponding to the first template can be determined. Next, a first correlation parameter is determined between the gradient direction with the largest amplitude in the first prediction histogram and the template direction. Simultaneously, a second correlation parameter is determined between the gradient direction with the largest amplitude in the second prediction histogram and the template direction. If the first correlation parameter is greater than or equal to the second correlation parameter, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the first correlation parameter is less than the second correlation parameter, the reconstructed block corresponding to the current block is determined based on the second transformation parameter.

[0561] To make it clear, in embodiments of this disclosure, an initial predicted value, i.e., a first transformation parameter generated by the first reference block of the current block, and a final predicted value, i.e., a second transformation parameter generated by the prediction block of the current block, can be used in combination, where the template direction (the template direction of the first template) is used as a reference, and the gradient directions derived by the reference block before data processing (initial predicted value) and the prediction block after data processing (final predicted value) are compared, and the gradient direction closest to the template direction is selected as the gradient direction to be used in the end, i.e., a transformation matrix corresponding to the prediction data with a close template direction is selected and subsequent transformation processing is performed.

[0562] Furthermore, in embodiments of this disclosure, when determining the first transformation parameters, the horizontal and vertical slopes corresponding to the first reference block can be determined based on a partial or full sample within the first reference block.

[0563] Furthermore, in embodiments of this disclosure, when determining the second transformation parameters, the horizontal and vertical slopes corresponding to the prediction block can be determined based on partial or full samples within the prediction block.

[0564] In other words, in embodiments of this disclosure, all or partial sample values ​​can be selected to derive the direction. For example, following the selection point method of CCLM, four points can be obtained on the upper and left sides, and the direction can be derived.

[0565] Furthermore, in embodiments of this disclosure, a modification process can be performed on the first reference block of the current block according to a first processing strategy to determine the first predicted block corresponding to the first reference block, and then a modification process can be performed on the first predicted block according to a second processing strategy to determine the predicted block of the current block.

[0566] In response to this, embodiments of the present disclosure may also determine a third transformation parameter corresponding to the current block based on a first prediction block, and then determine a reconstructed block corresponding to the current block based on the prediction block of the current block and the third transformation parameter corresponding to the current block.

[0567] In embodiments of this disclosure, the transformation parameter of the current block, for example, the third transformation parameter, may include an index reference (e.g., LFNST) to indicate the transformation matrix to be used, or it may be the transformation matrix itself.

[0568] To make it clearer, in embodiments of this disclosure, if multi-stage processing is required between the final predicted value and the initial predicted value, it is also possible to choose to use the intermediate predicted values ​​(i.e., the first prediction block) as input for the prediction direction determination. For example, if the predicted values ​​based on BV are first filtered and then fused to obtain the final predicted value, the filtered intermediate prediction information can be used as input to determine the corresponding transformation matrix, e.g., the third transformation parameter.

[0569] In embodiments of this disclosure, the first and second processing strategies may include at least one of a plurality of processes: fusion, filtering, subpixel processing, and sample inversion.

[0570] Therefore, the encoding method proposed in the embodiments of this disclosure is a method for obtaining reconstructed values ​​based on a BV prediction mode. In particular, focusing on the generation of predicted values ​​and the residual quadratic transformation selection method that depends on the predicted values, a directional inference similar to that of DIMD techniques can be performed on the initial predicted values ​​obtained by BV, a transformation related to direction can be selected based on the inference direction, an inverse transformation can be performed using the transformation matrix, and residuals can be generated. On the other hand, compared to the final predicted values ​​that have undergone subsequent data processing processes such as filtering, fusion, and subpixel, the initial predicted values ​​have richer texture edge information. By using the initial predicted values, more accurate gradient directions, predicted angles, and angular amplitudes can be derived. This makes it possible to determine a more matching conventional intra-prediction mode, obtain a more accurate LFNST transformation kernel, determine a more matching transformation matrix, and ultimately effectively improve the performance of encoding and decoding. On the other hand, after determining the first reference block directly indicated by the BV, steps such as generating prediction blocks and generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path for encoding and decoding, solving the problem of high complexity, improving encoding and decoding efficiency, and simultaneously facilitating the realization of hardware design.

[0571] For example, in some embodiments, as shown in Figure 13, the sample value reconstruction process may mainly include several steps: S1: determination of block vectors, S2: generation of initial predicted values, S3: generation of final predicted values, S4: intra-prediction mode mapping, S5: determination of transformation block matrix, S6: inverse transformation of quadratic transformation, S7: inverse transformation of linear transformation, and S8: generation of reconstructed values.

[0572] Here, in the step of intra-prediction mode mapping, the input is not the final predicted value corresponding to the current block, but the initial predicted value directly indicated by the BV corresponding to the current block, i.e., the first reference block of the current block.

[0573] In the embodiments of this disclosure, the initial predicted value obtained directly based on the prediction parameters, for example, the first reference block directly indicated by the BV, has more texture edge information compared to the final predicted value after subsequent data processing processes such as filtering, merging, and sub-pixelating. This is because data processing processes performed based on the initial predicted value, such as filtering, merging, and sub-pixelating, for example, low-pass filtering, are equivalent to a type of smoothing operation, and the final predicted value obtained after processing loses some texture edge information.

[0574] In response to this, in the embodiments of the present disclosure, in the process of mapping intra-prediction modes based on predicted values, the initial predicted values ​​have richer texture edge information. Therefore, compared to mapping intra-prediction modes using final predicted values, using the initial predicted values ​​allows for the derivation of more accurate gradient direction, predicted angle, and angular amplitude, thereby enabling the determination of a more matching conventional intra-prediction mode.

[0575] In response to this, in embodiments of the present disclosure, after determining the corresponding intra-prediction mode using initial prediction values ​​directly obtained based on prediction parameters, such as a first reference block directly indicated by BV, a more accurate LFNST transform kernel can be obtained, thereby determining a more matching transform matrix and effectively improving the performance of encoding and decoding.

[0576] For example, in some embodiments, as shown in Figure 14, the sample value reconstruction process may mainly include several steps: S1: determination of block vectors, S2: generation of initial predicted values, S3: generation of final predicted values, S4: intra-prediction mode mapping, S5: determination of transformation block matrix, S9: inverse transformation, and S8: generation of reconstructed values.

[0577] Here, in the step of intra-prediction mode mapping, the input is not the final predicted value corresponding to the current block, but the initial predicted value directly indicated by the BV corresponding to the current block, i.e., the first reference block of the current block.

[0578] In the embodiments of this disclosure, the initial predicted value obtained directly based on the prediction parameters, for example, the first reference block directly indicated by the BV, has more texture edge information compared to the final predicted value after subsequent data processing processes such as filtering, merging, and sub-pixelating. This is because data processing processes performed based on the initial predicted value, such as filtering, merging, and sub-pixelating, for example, low-pass filtering, are equivalent to a type of smoothing operation, and the final predicted value obtained after processing loses some texture edge information.

[0579] In response to this, in embodiments of the present disclosure, if a transformation method other than LFNST is adopted as the transformation method for S9: inverse transformation, for example, a non-separable primary transform (NSPT), the transformation matrix can also be determined using an initial predicted value directly indicated by BV that corresponds to the current block.

[0580] In the embodiments of this disclosure, the proposed coding method was illustrated by using a block vector (BV) as the prediction parameter corresponding to the current block and LFNST as the transformation scheme. However, the prediction parameter and transformation scheme are not limited; that is, the proposed method can be applied to other prediction parameters, transformation parameters, and transformation schemes.

[0581] Embodiments of the present disclosure provide an encoding method. The encoder determines prediction parameters corresponding to the current block, determines a first reference block of the current block based on the prediction parameters of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. That is, in embodiments of the present disclosure, after determining the first reference block of the current block based on the prediction parameters, the transformation parameter of the current block can be determined using the first reference block which has not been processed, and then the determined transformation parameter can be used to combine with the prediction block of the current block obtained by processing the first reference block to complete the reconstruction of the current block. Here, since the data processing process causes some loss of texture edge information in the prediction block, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block). By using the first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, thereby effectively improving the performance of encoding and decoding. At the same time, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block, and generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding and solving the problem of high complexity, thereby improving the encoding and decoding efficiency. Therefore, the encoding and decoding methods proposed in the embodiments of this disclosure can improve the encoding and decoding efficiency and performance.

[0582] In a further embodiment of the present disclosure, based on the same inventive idea as the embodiments described above, Figure 16 is a first schematic diagram showing the configuration of an encoder proposed in an embodiment of the present disclosure, and as shown in Figure 16, the encoder 100 may include a first determination unit 111.

[0583] The first decision unit 111 is configured to determine a prediction parameter corresponding to the current block, determine a first reference block of the current block based on the prediction parameter of the current block, determine a first transformation parameter of the current block based on the first reference block of the current block, determine a prediction block of the current block based on the first reference block of the current block, and determine a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

[0584] In the embodiments of this disclosure, the encoder 100 can also be considered as a data processing mode (or "entropy encoder") and is used to perform encoding processing on the values ​​of syntactic elements to be encoded.

[0585] To make it clear, in the embodiments of this disclosure, a “unit” can be a part of a circuit, a part of a processor, a part of a program or software, and can be a module or non-modular. Furthermore, each component in this embodiment may be integrated into a single processing unit, each unit may exist individually physically, or two or more units may be integrated into a single unit. The integrated unit may be implemented in hardware form or in the form of a software function module.

[0586] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored on a computer-readable storage medium. Based on this understanding, the essence of the technical solution of this embodiment, or a part that contributes to existing technology, or all or part of this technical solution can be embodied in the form of a software product, which is stored on a storage medium and contains several instructions for causing a computer device (such as a personal computer, server, or network device) or processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes all kinds of media capable of storing program code, such as U disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0587] Accordingly, embodiments of the present disclosure provide a computer-readable storage medium applicable to an encoder 100, which stores a computer program, and when the computer program is executed by a first processor, implements an encoding method described in any one of the embodiments described above.

[0588] Based on the above configuration of encoder 100 and computer-readable storage medium, Figure 17 is a second schematic diagram showing the configuration of the encoder proposed in an embodiment of the present disclosure, and as shown in Figure 17, encoder 100 may include a first memory 121, a first processor 122, a first communication interface 123, and a first bus system 124. The first memory 121, the first processor 122, and the first communication interface 123 are coupled by the first bus system 124. To understand this, the first bus system 124 is used to provide connection communication between these components. In addition to the data bus, the first bus system 124 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 10 all types of buses are marked as the first bus system 124.

[0589] The first communication interface 123 is used for receiving and transmitting signals in the process of sending and receiving information with other external network elements.

[0590] The first memory 121 is used to store computer programs that can be executed on the first processor.

[0591] The first processor 122 is used when executing the computer program to determine a prediction parameter corresponding to the current block, to determine a first reference block of the current block based on the prediction parameter of the current block, to determine a first transformation parameter of the current block based on the first reference block of the current block, to determine a prediction block of the current block based on the first reference block of the current block, and to determine a reconfiguration block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

[0592] To ensure understanding, the first memory 121 in embodiments of this disclosure may include volatile memory, non-volatile memory, or both volatile and non-volatile memory. Here, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external high-speed cache. Many forms of RAM are available, including, but are not limited to, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous-connected dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). The first memory 121 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0593] On the other hand, the first processor 122 may be an integrated circuit chip having signal processing capabilities. In the implementation process, each step of the above method can be completed by hardware integrated logic circuits or software-form instructions within the first processor 122. The first processor 122 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, an discrete gate or transistor logic device, or a discrete hardware component. Each method, step, and logic block diagram disclosed in embodiments of this disclosure can be implemented or executed. The general-purpose processor can be a microprocessor, and this processor can be any conventional processor, etc. The steps of the method disclosed in embodiments of this disclosure can be executed directly by a hardware decode processor or can be completed by a combination of hardware and software modules within the decode processor. The software modules can be placed in storage media that are mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. This storage medium is placed in the first memory 121, and the first processor 122 reads the information in the first memory 121 and completes the steps of the above method in combination with its hardware.

[0594] To ensure understanding, these embodiments described in this disclosure can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. In hardware implementations, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this disclosure, or a combination thereof. In software implementations, the technology described in this disclosure can be implemented by modules (e.g., processes, functions, etc.) that perform the functions described in this disclosure. The software code can be stored in memory and executed by a processor. The memory can be implemented within or outside the processor.

[0595] Optionally, in another embodiment, the first processor 122 is further configured to perform the method described in any one of the above embodiments when executing the computer program.

[0596] This embodiment provides an encoder that determines prediction parameters corresponding to the current block, determines a first reference block of the current block based on the prediction parameters of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. That is, in the embodiment of this disclosure, after determining the first reference block of the current block based on the prediction parameters, the transformation parameter of the current block can be determined using the first reference block which has not been processed by data processing, and then the determined transformation parameter can be used to combine with the prediction block of the current block obtained by performing data processing on the first reference block to complete the reconstruction of the current block. Here, since the data processing process causes some loss of texture edge information of the prediction block, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block), and by using the first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, and consequently, the performance of encoding and decoding can be effectively improved. Simultaneously, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block, generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding, solving the problem of high complexity, and thereby improving encoding and decoding efficiency. Therefore, the encoding and decoding methods proposed in the embodiments of this disclosure can improve encoding and decoding efficiency and performance.

[0597] In a further embodiment of the present disclosure, based on the same inventive idea as the embodiments described above, Figure 18 is a first schematic diagram showing the configuration of a decoder proposed in an embodiment of the present disclosure, and as shown in Figure 18, the decoder 200 may include a second determination unit 211.

[0598] The second decision unit 211 is configured to determine a prediction parameter corresponding to the current block, determine a first reference block of the current block based on the prediction parameter of the current block, determine a first transformation parameter of the current block based on the first reference block of the current block, determine a prediction block of the current block based on the first reference block of the current block, and determine a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

[0599] In the embodiments of this disclosure, the decoder 200 can also be considered as a data processing mode (or "entropy decoder") and is used to perform decoding on the values ​​of the syntactic elements to be decoded.

[0600] To make it clear, in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, and can be a module or non-modular. Furthermore, each component in this embodiment may be integrated into a single processing unit, each unit may exist individually physically, or two or more units may be integrated into a single unit. The integrated unit may be implemented in hardware form or in the form of a software function module.

[0601] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium applicable to the decoder 200, which stores a computer program, and when the computer program is executed by the second processor, implements the method described in any one of the embodiments described above.

[0602] Based on the above-described configuration of the decoder 200 and the computer-readable storage medium, Figure 19 is a second schematic diagram showing the configuration of the decoder proposed in the embodiments of this disclosure, and as shown in Figure 19, the decoder 200 may include a second memory 221, a second processor 222, a second communication interface 223, and a second bus system 224. The second memory 221, the second processor 222, and the second communication interface 223 are coupled by the second bus system 224. To make it clear, the second bus system 224 is used to provide connection communication between these components. In addition to the data bus, the second bus system 224 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 12 all types of buses are marked as the second bus system 224.

[0603] The second communication interface 223 is used for receiving and transmitting signals in the process of sending and receiving information with other external network elements.

[0604] The second memory 221 is used to store computer programs that can be executed on the second processor.

[0605] The second processor 222 is used when executing the computer program to determine a prediction parameter corresponding to the current block, to determine a first reference block of the current block based on the prediction parameter of the current block, to determine a first transformation parameter of the current block based on the first reference block of the current block, to determine a prediction block of the current block based on the first reference block of the current block, and to determine a reconfiguration block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

[0606] To ensure understanding, the second memory 221 in embodiments of this disclosure may include volatile memory, non-volatile memory, or both volatile and non-volatile memory. Here, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external high-speed cache. Many forms of RAM are available, including, but are not limited to, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous-connected dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). The second memory 221 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0607] On the other hand, the second processor 222 may be an integrated circuit chip having signal processing capabilities. In the implementation process, each step of the above method can be completed by hardware integrated logic circuits or software-form instructions within the second processor 222. The second processor 222 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, an discrete gate or transistor logic device, or a discrete hardware component. Each method, step, and logic block diagram disclosed in embodiments of this disclosure can be implemented or executed. The general-purpose processor can be a microprocessor, and this processor can be any conventional processor, etc. The steps of the method disclosed in embodiments of this disclosure can be performed directly by a hardware decode processor or completed by a combination of hardware and software modules within the decode processor. The software module can be placed in a storage medium that is mature in this art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, or registers. This storage medium is placed in the second memory 221, and the second processor 222 reads the information in the second memory 221 and, in combination with its hardware, completes the steps of the method described above.

[0608] To ensure understanding, these embodiments described in this disclosure can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. In hardware implementations, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this disclosure, or a combination thereof. In software implementations, the technology described in this disclosure can be implemented by modules (e.g., processes, functions, etc.) that perform the functions described in this disclosure. The software code can be stored in memory and executed by a processor. The memory can be implemented within or outside the processor.

[0609] Optionally, in another embodiment, the second processor 222 is further configured to perform the method described in any one of the above embodiments when executing the computer program.

[0610] This embodiment provides a decoder. This decoder determines prediction parameters corresponding to the current block, determines a first reference block of the current block based on the prediction parameters of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. That is, in the embodiment of this disclosure, after determining the first reference block of the current block based on the prediction parameters, the transformation parameter of the current block can be determined using the first reference block which has not been processed by data processing, and then the determined transformation parameter can be used to combine with the prediction block of the current block obtained by performing data processing on the first reference block to complete the reconstruction of the current block. Here, since the data processing process causes some loss of texture edge information of the prediction block, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block), and by using the first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, and consequently, the performance of encoding and decoding can be effectively improved. Simultaneously, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block, generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding, solving the problem of high complexity, and thereby improving encoding and decoding efficiency. Therefore, the encoding and decoding methods proposed in the embodiments of this disclosure can improve encoding and decoding efficiency and performance.

[0611] Furthermore, embodiments of the present disclosure also propose a bitstream, which is generated by bit encoding based on information to be encoded, wherein the information to be encoded includes at least one of the following: prediction mode identifier information corresponding to the current block, first identifier information, first transformation coefficients corresponding to the prediction residual, and transformation kernel index number.

[0612] The “includes,” “incorporates,” or any other variation thereof in this disclosure is intended to be non-exclusive, so that a process, method, article, or apparatus containing a set of elements includes not only those elements but also other elements not expressly enumerated, or elements specific to such process, method, article, or apparatus. An element limited by the expression “one includes…” does not preclude the presence of other identical elements in a process, method, article, or apparatus containing that element.

[0613] The above embodiment numbers in this disclosure are for descriptive purposes only and do not indicate any superiority or inferiority among the embodiments.

[0614] The methods disclosed in some of the method embodiments provided in this disclosure can be arbitrarily combined, insofar as they do not conflict, to obtain new method embodiments.

[0615] The features disclosed in some of the product embodiments provided in this disclosure can be combined in any way, as long as they do not conflict, to obtain new product embodiments.

[0616] The features disclosed in some of the method or device embodiments provided in this disclosure can be combined in any way, as long as they do not conflict, to obtain new method or device embodiments.

[0617] The above are merely specific embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any modification or substitution that a person skilled in the art could easily conceive within the scope of the art disclosed herein should be included within the scope of protection of the present disclosure. Accordingly, the scope of protection of the present disclosure should be determined by the scope of protection of the claims described herein.

[0618] (Industrial applicability) Embodiments of the present disclosure propose an encoding method, a decoding method, a bitstream, an encoder, a decoder, and a storage medium. The encoding and decoding device determines prediction parameters corresponding to the current block, determines a first reference block of the current block based on the prediction parameters of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block and the first transformation parameter of the current block. That is, in embodiments of the present disclosure, after determining the first reference block of the current block based on the prediction parameters, the transformation parameter of the current block can be determined directly using the first reference block that has not been processed for data, and then the reconstruction of the current block can be completed by using the determined transformation parameter and combining it with the prediction block of the current block obtained by processing the first reference block for data. Here, since the data processing process causes some loss of texture edge information in the prediction block, the initial prediction value before data processing (i.e., the first reference block) has richer texture edge information compared to the final prediction value after data processing (i.e., the prediction block). By using the first reference block to derive the prediction direction, more accurate transformation parameters can be obtained, thereby effectively improving the performance of encoding and decoding. At the same time, after determining the first reference block directly indicated by the prediction parameters, steps such as generating the prediction block, and generating transformation parameters and residuals can be performed in parallel, shortening the length of the critical path of encoding and decoding and solving the problem of high complexity, thereby improving the encoding and decoding efficiency. Therefore, the encoding and decoding methods proposed in the embodiments of this disclosure can improve the encoding and decoding efficiency and performance.

Claims

1. A decoding method applicable to a decoder, Determining the prediction parameters corresponding to the current block, Based on the prediction parameters of the current block, the first reference block of the current block is determined, Based on the first reference block of the current block, the first transformation parameter of the current block is determined, Based on the first reference block of the current block, the predicted block of the current block is determined, A decoding method comprising determining a reconstructed block corresponding to the current block based on the predicted block of the current block and the first transformation parameter.

2. The prediction parameters include the block vector of the current block, The method according to claim 1.

3. The first reference block is located within the same image as the current block. The block vector represents the positional offset between the current block and the first reference block. The method according to claim 2.

4. The aforementioned prediction parameters include the motion vector of the current block and the reference image index. The method according to claim 1.

5. The first reference block is located within the reference image indicated by the reference image index, The motion vector represents the positional offset between the current block and the first reference block. The method according to claim 4.

6. Determining the first transformation parameter of the current block based on the first reference block of the current block is: Determining the statistical characteristic parameters of the first reference block, This includes determining the first transformation parameter based on the aforementioned statistical characteristic parameter, The method according to claim 1.

7. The aforementioned statistical characteristic parameters include the covariance matrix, The method according to claim 6.

8. Determining the first transformation parameter of the current block based on the first reference block of the current block is: Based on the first reference block of the current block, the intra-mode information corresponding to the current block is determined, This includes determining the first conversion parameter based on the intra-mode information, The method according to claim 1.

9. Determining intra-mode information corresponding to the current block based on the first reference block of the current block means that To determine the horizontal and vertical slopes corresponding to the first reference block of the current block, This includes determining intra-mode information corresponding to the current block based on the horizontal and vertical gradients, The method according to claim 8.

10. Determining the horizontal and vertical slopes corresponding to the first reference block of the current block is: This includes determining the horizontal and vertical slopes corresponding to the first reference block based on a predetermined operator, The method according to claim 9.

11. Determining intra-mode information corresponding to the current block based on the horizontal and vertical gradients is: A first predicted histogram is determined based on the aforementioned horizontal and vertical gradients, If there are no non-zero amplitudes in the first prediction histogram, the intra-mode information corresponding to the current block is determined to be a planar mode. If non-zero amplitudes exist in the first prediction histogram, the intra-mode information corresponding to the current block is determined based on the gradient direction of the maximum amplitude in the first prediction histogram. The method according to claim 9.

12. Determining the first conversion parameter based on the intra-mode information is: Determining a set of candidate conversion kernels based on intra-mode information corresponding to the current block, wherein the set of candidate conversion kernels includes any number of conversion kernels. The first conversion kernel is determined within the aforementioned set of conversion kernel candidates, This includes determining the first transformation parameters based on the first transformation kernel, The method according to claim 9.

13. The aforementioned conversion kernel candidate set includes one of the LFNST conversion kernel candidate set, the NSPT conversion kernel candidate set, and a conversion kernel candidate set determined based on the prediction direction. The method according to claim 12.

14. Determining the LFNST conversion kernel candidate set based on the intra-mode information corresponding to the current block means that This includes determining the conversion kernel candidate set corresponding to the intra-mode information based on the mapping relationship between the intra-mode and the conversion kernel candidate set, The method according to claim 13.

15. The above method further, Decrypting the bitstream and determining the transformation kernel index number, This includes determining the first conversion kernel within the candidate set of conversion kernels based on the conversion kernel index number, and determining the first conversion parameters. The method according to claim 13.

16. The above method further, This includes determining the matrix size corresponding to the first transformation parameter based on the current block size, The method according to claim 13.

17. Determining the predicted block of the current block based on the first reference block of the current block is: This includes performing a modification process on the first reference block according to a predetermined processing strategy and determining the predicted block of the current block, The method according to claim 1.

18. The predetermined processing strategy includes at least one of the following: fusion processing, filtering processing, subpixel processing, and sample inversion processing. The method according to claim 17.

19. The above method further, This includes decoding the bitstream and determining the first transformation coefficient corresponding to the prediction residual. The method according to any one of claims 1 to 18.

20. Determining the reconstructed block corresponding to the current block based on the predicted block of the current block and the first transformation parameter is: The predicted residual is determined based on the first transformation parameter and the first transformation coefficient, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and the predicted residual, The method according to claim 19.

21. Determining the predicted residual based on the first transformation parameter and the first transformation coefficient is: Based on the first transformation coefficient and the first transformation parameter, the inverse transformation of the quadratic transformation is performed to determine the second transformation coefficient, This includes performing an inverse transformation of the linear transformation based on the second transformation coefficient and determining the predicted residual, The method according to claim 20.

22. The above method further, Based on the first reference block of the current block, the predicted block of the current block is determined, Based on the predicted block of the current block, a second transformation parameter corresponding to the current block is determined, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and a second transformation parameter corresponding to the current block, The method according to claim 2.

23. The above method further, Decrypting the bitstream and determining the first identification information, If the value of the first identification information is a first value, it is decided to use the first conversion parameter, The process includes deciding to use the second conversion parameter if the value of the first identification information is a second value, The method according to claim 22.

24. The above method further, This includes determining a first prediction histogram corresponding to the first reference block and a second prediction histogram corresponding to the prediction block. The method according to claim 22.

25. The above method further, Determining the first and second gradient directions within the first prediction histogram, If the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the second transformation parameter, The method according to claim 24.

26. The above method further, Determining the first and second gradient directions in the second prediction histogram, If the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the second transformation parameter, The method according to claim 24.

27. The above method further, The process includes determining the horizontal and vertical slopes based on a partial or full sample within the first reference block. The method according to claim 9.

28. The above method further, The first processing strategy involves performing a modification process on the first reference block of the current block, and determining the first predicted block corresponding to the first reference block. This includes performing a modification process on the first prediction block in accordance with a second processing strategy to determine the prediction block of the current block, The method according to claim 18.

29. The above method further, Based on the first predicted block, a third transformation parameter corresponding to the current block is determined, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and a third transformation parameter corresponding to the current block, The method according to claim 28.

30. The above method further, Determine the first template corresponding to the current block and determine a predetermined search area. This includes performing a search within the predetermined search area and determining the block vector of the current block, The method according to claim 24.

31. The above method further, Determine the first template corresponding to the current block and determine a predetermined search area. Perform a search within the predetermined search area and construct a list of candidate block vectors for the current block. This includes determining the block vector of the current block based on the block vector candidate list, The method according to claim 24.

32. The above method further, The block vector of the adjacent block corresponding to the current block is determined, Based on the block vectors of the adjacent blocks, a list of candidate block vectors for the current block is constructed. This includes determining the block vector of the current block based on the block vector candidate list, The method according to claim 24.

33. The above method further, Determining the template direction corresponding to the first template, The first correlation parameter is determined between the gradient direction with the maximum amplitude in the first prediction histogram and the template direction, The second correlation parameter is determined between the gradient direction with the maximum amplitude in the second prediction histogram and the template direction, If the first correlation parameter is equal to or greater than the second correlation parameter, the reconstructed block corresponding to the current block is determined based on the first transformation parameter, If the first correlation parameter is less than the second correlation parameter, the reconstruction block corresponding to the current block is determined based on the second transformation parameter, The method according to any one of claims 30 to 32.

34. The above method further, Decode the bitstream and determine the prediction mode identification information corresponding to the current block, If the prediction mode identification information indicates that the current block should use a prediction mode based on the prediction parameters, the process of determining the prediction parameters is performed, The method according to any one of claims 1 to 33.

35. An encoding method applied to an encoder, Determining the prediction parameters corresponding to the current block, Based on the prediction parameters of the current block, the first reference block of the current block is determined, Based on the first reference block of the current block, the first transformation parameter of the current block is determined, Based on the first reference block of the current block, the predicted block of the current block is determined, An encoding method comprising determining a reconstructed block corresponding to the current block based on the predicted block of the current block and the first transformation parameter.

36. The prediction parameters include the block vector of the current block, The method according to claim 35.

37. The first reference block is located within the same image as the current block. The block vector represents the positional offset between the current block and the first reference block. The method according to claim 36.

38. The aforementioned prediction parameters include the motion vector of the current block and the reference image index. The method according to claim 35.

39. The first reference block is located within the reference image indicated by the reference image index, The motion vector represents the positional offset between the current block and the first reference block. The method according to claim 38.

40. Determining the first transformation parameter of the current block based on the first reference block of the current block is: Determining the statistical characteristic parameters of the first reference block, This includes determining the first transformation parameter based on the aforementioned statistical characteristic parameter, The method according to claim 35.

41. The aforementioned statistical characteristic parameters include the covariance matrix, The method according to claim 40.

42. Determining the first transformation parameter of the current block based on the first reference block of the current block is: Based on the first reference block of the current block, the intra-mode information corresponding to the current block is determined, This includes determining the first conversion parameter based on the intra-mode information, The method according to claim 35.

43. Determining intra-mode information corresponding to the current block based on the first reference block of the current block means that To determine the horizontal and vertical slopes corresponding to the first reference block of the current block, This includes determining intra-mode information corresponding to the current block based on the horizontal and vertical gradients, The method according to claim 42.

44. Determining the horizontal and vertical slopes corresponding to the first reference block of the current block is: This includes determining the horizontal and vertical slopes corresponding to the first reference block based on a predetermined operator, The method according to claim 43.

45. Determining intra-mode information corresponding to the current block based on the horizontal and vertical gradients is: A first predicted histogram is determined based on the aforementioned horizontal and vertical gradients, If there are no non-zero amplitudes in the first prediction histogram, the intra-mode information corresponding to the current block is determined to be the PLANAR mode. If non-zero amplitudes exist in the first prediction histogram, the intra-mode information corresponding to the current block is determined based on the gradient direction of the maximum amplitude in the first prediction histogram. The method according to claim 43.

46. Determining the first conversion parameter based on the intra-mode information is: Determining a set of candidate conversion kernels based on intra-mode information corresponding to the current block, wherein the set of candidate conversion kernels includes any number of conversion kernels. The first conversion kernel is determined within the aforementioned set of conversion kernel candidates, This includes determining the first transformation parameters based on the first transformation kernel, The method according to claim 43.

47. The aforementioned conversion kernel candidate set includes one of the LFNST conversion kernel candidate set, the NSPT conversion kernel candidate set, and a conversion kernel candidate set determined based on the prediction direction. The method according to claim 46.

48. Determining the LFNST conversion kernel candidate set based on the intra-mode information corresponding to the current block means that This includes determining the conversion kernel candidate set corresponding to the intra-mode information based on the mapping relationship between the intra-mode and the conversion kernel candidate set, The method according to claim 47.

49. The above method further, The first conversion kernel is determined within the set of candidate conversion kernels, and the first conversion parameters are determined. The process includes determining a conversion kernel index number based on the first conversion kernel and writing the conversion kernel index number to a bitstream, The method according to claim 47.

50. The above method further, This includes determining the matrix size corresponding to the first transformation parameter based on the current block size, The method according to claim 47.

51. Determining the predicted block of the current block based on the first reference block of the current block is: This includes performing a modification process on the first reference block according to a predetermined processing strategy and determining the predicted block of the current block, The method according to claim 35.

52. The predetermined processing strategy includes at least one of the following: fusion processing, filtering processing, subpixel processing, and sample inversion processing. The method according to claim 51.

53. The above method further, This includes determining the first transformation coefficient corresponding to the predicted residual. The method according to any one of claims 35 to 52.

54. Determining the reconstructed block corresponding to the current block based on the predicted block of the current block and the first transformation parameter is: The predicted residual is determined based on the first transformation parameter and the first transformation coefficient, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and the predicted residual, The method according to claim 53.

55. Determining the predicted residual based on the first transformation parameter and the first transformation coefficient is: Based on the first transformation coefficient and the first transformation parameter, the inverse transformation of the quadratic transformation is performed to determine the second transformation coefficient, This includes performing an inverse transformation of the linear transformation based on the second transformation coefficient and determining the predicted residual, The method according to claim 54.

56. The above method further, Based on the first reference block of the current block, the predicted block of the current block is determined, Based on the predicted block of the current block, a second transformation parameter corresponding to the current block is determined, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and a second transformation parameter corresponding to the current block, The method according to claim 36.

57. The above method further, If it is determined that the first conversion parameter is used, the value of the first identification information is determined to be the first value, If it is determined that the second conversion parameter is used, the value of the first identification information is determined to be the second value, The process includes writing the aforementioned first identification information to a bitstream, The method according to claim 56.

58. The above method further, This includes determining a first prediction histogram corresponding to the first reference block and a second prediction histogram corresponding to the prediction block. The method according to claim 56.

59. The above method further, Determining the first and second gradient directions within the first prediction histogram, If the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the second transformation parameter, The method according to claim 58.

60. The above method further, Determining the first and second gradient directions in the second prediction histogram, If the amplitude difference between the first gradient direction and the second gradient direction is less than or equal to a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the first transformation parameter. If the amplitude difference between the first gradient direction and the second gradient direction exceeds a predetermined threshold, the reconstructed block corresponding to the current block is determined based on the second transformation parameter, The method according to claim 58.

61. The above method further, The process includes determining the horizontal and vertical slopes based on a partial or full sample within the first reference block. The method according to claim 43.

62. The above method further, The first processing strategy involves performing a modification process on the first reference block of the current block, and determining the first predicted block corresponding to the first reference block. This includes performing a modification process on the first prediction block in accordance with a second processing strategy to determine the prediction block of the current block, The method according to claim 52.

63. The above method further, Based on the first predicted block, a third transformation parameter corresponding to the current block is determined, The process includes determining a reconstructed block corresponding to the current block based on the predicted block of the current block and a third transformation parameter corresponding to the current block, The method according to claim 62.

64. The above method further, Determine the first template corresponding to the current block and determine a predetermined search area. This includes performing a search within the predetermined search area and determining the block vector of the current block, The method according to claim 58.

65. The above method further, Determine the first template corresponding to the current block and determine a predetermined search area. Perform a search within the predetermined search area and construct a list of candidate block vectors for the current block. This includes determining the block vector of the current block based on the block vector candidate list, The method according to claim 58.

66. The above method further, The block vector of the adjacent block corresponding to the current block is determined, Based on the block vectors of the adjacent blocks, a list of candidate block vectors for the current block is constructed. This includes determining the block vector of the current block based on the block vector candidate list, The method according to claim 58.

67. The above method further, Determining the template direction corresponding to the first template, The first correlation parameter is determined between the gradient direction with the maximum amplitude in the first prediction histogram and the template direction, The second correlation parameter is determined between the gradient direction with the maximum amplitude in the second prediction histogram and the template direction, If the first correlation parameter is equal to or greater than the second correlation parameter, the reconstructed block corresponding to the current block is determined based on the first transformation parameter, If the first correlation parameter is less than the second correlation parameter, the reconstruction block corresponding to the current block is determined based on the second transformation parameter, The method according to any one of claims 64 to 66.

68. The above method further, When a prediction mode based on the prediction parameters is used for the current block, the process of determining the prediction parameters is performed. The process includes determining prediction mode identification information corresponding to the current block and writing the prediction mode identification information to a bitstream. The method according to any one of claims 35 to 67.

69. It is a bitstream, The bitstream is generated by bit encoding based on the information to be encoded, and the information to be encoded is, A bitstream comprising at least one of the following: prediction mode identifier information corresponding to the current block, first identifier information, first transformation coefficients corresponding to the prediction residuals, and a transformation kernel index number.

70. An encoder, wherein the encoder includes a first determination unit, An encoder configured such that the first determination unit determines a prediction parameter corresponding to the current block, determines a first reference block of the current block based on the prediction parameter of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

71. An encoder, wherein the encoder includes a first memory and a first processor. The first memory is used to store computer programs that can be executed on the first processor. The first processor is an encoder used to perform the method according to any one of claims 35 to 68 when executing the computer program.

72. A decoder, wherein the decoder includes a second determination unit. A decoder configured such that the second decision unit determines a prediction parameter corresponding to the current block, determines a first reference block of the current block based on the prediction parameter of the current block, determines a first transformation parameter of the current block based on the first reference block of the current block, determines a prediction block of the current block based on the first reference block of the current block, and determines a reconstructed block corresponding to the current block based on the prediction block of the current block and the first transformation parameter.

73. A decoder, wherein the decoder includes a second memory and a second processor. The second memory is used to store computer programs that can be executed on the second processor. The second processor is a decoder used to perform the method according to any one of claims 1 to 34 when executing the computer program.

74. A computer-readable storage medium that stores a computer program, and when the computer program is executed, implements the method according to any one of claims 1 to 34 or the method according to any one of claims 35 to 68.