Encoding method, decoding method, encoder, decoder, and storage medium
By determining the optimal transform cluster and transform kernel in video encoding and decoding, the problem of insufficient adaptability of traditional intra-frame prediction tools is solved, and the compression efficiency and encoding/decoding performance of high-resolution video are improved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2024-10-30
- Publication Date
- 2026-05-07
AI Technical Summary
In high-resolution video compression, existing video encoding and decoding technologies suffer from low compression efficiency due to the inability of traditional intra-frame prediction tools to adapt to various non-angular and non-linear prediction tools.
By determining the optimal transform cluster for the current block, such as the LFNST or NSPT transform cluster, and selecting a more suitable transform kernel, the accuracy of transform prediction can be improved.
It improves the compression efficiency of the transformation technology and enhances encoding and decoding performance.
Smart Images

Figure CN2024128618_07052026_PF_FP_ABST
Abstract
Description
Encoding / decoding methods, encoders, decoders, and storage media Technical Field
[0001] This application relates to the field of video encoding and decoding technology, specifically to an encoding and decoding method, an encoder, a decoder, and a storage medium. Background Technology
[0002] As people's demands for video display quality have increased, high-resolution video, such as HD and UHD, has emerged. However, high-resolution video typically contains more information, thus requiring more bandwidth. To reduce bandwidth requirements, video coding standards involving video compression have been introduced.
[0003] In video encoding and decoding, after prediction, the coding unit (CLU) is subtracted from the original image to obtain the CLU's residual block. This residual block typically needs to be transformed to concentrate the residual energy for subsequent quantization operations, thus saving codewords. When transforming the residual block, the transform set is selected using the traditional intra-frame angle prediction mode. However, with the development of ECM (Elastic Compute Management), the number and forms of intra-frame prediction tools have far exceeded those of the H.266 / VVC era. Previous standards primarily used angle prediction for intra-frame prediction, while current ECM intra-frame prediction tools include not only various angle prediction tools but also multiple non-angle and even non-linear prediction tools. Related technologies that select transform sets using the traditional angle prediction mode are not applicable to different intra-frame prediction tools, affecting the compression efficiency of the transform technology.
[0004] Summary of the Invention
[0005] This application provides an encoding / decoding method, encoder, decoder, and storage medium, which can improve the compression efficiency of the transformation technology and thus enhance the encoding / decoding performance.
[0006] The technical solution of this application embodiment can be implemented as follows:
[0007] In a first aspect, embodiments of this application provide a decoding method applied to a decoder, the method comprising:
[0008] Parse the first syntax element of the current block in the bitstream;
[0009] Based on the value of the first syntax element of the current block, determine the transformation cluster of the current block;
[0010] Based on the transform cluster of the current block, determine the transform kernel of the current block;
[0011] Based on the transform kernel of the current block, the transform coefficients of the current block are inversely transformed to obtain the residual sample of the current block;
[0012] Based on the residual samples and prediction samples of the current block, determine the reconstruction samples of the current block.
[0013] Secondly, embodiments of this application provide an encoding method applied to an encoder, the method comprising:
[0014] Determine the transformation cluster for the current block;
[0015] Based on the transform cluster of the current block, determine the transform kernel of the current block;
[0016] The transformation coefficients of the current block are determined by transforming the residual samples of the current block based on the transformation kernel of the current block.
[0017] The transformation coefficients are quantized to obtain the residual coefficients of the current block;
[0018] The cost is calculated based on the residual coefficient of the current block to determine the cost value;
[0019] Encoding decisions are made based on cost value to determine the value of the first syntax element of the current block;
[0020] The first syntax element of the current block is encoded, and the resulting encoded bits are written into the bitstream.
[0021] Thirdly, embodiments of this application provide an encoder, which includes a first determining unit, a first processing unit, and an encoding unit; wherein:
[0022] The first determining unit is configured to determine the transformation cluster of the current block;
[0023] The first determining unit is also configured to determine the transform kernel of the current block based on the transform cluster of the current block;
[0024] The first processing unit is configured to transform the residual samples of the current block based on the transformation kernel of the current block, determine the transformation coefficients of the current block, quantize the transformation coefficients, and obtain the residual coefficients of the current block.
[0025] The first determining unit is also configured to calculate the cost based on the residual coefficient of the current block to determine the cost value;
[0026] The first determining unit is also configured to make encoding decisions based on cost value to determine the value of the first syntax element of the current block;
[0027] The encoding unit is configured to encode the first syntax element of the current block and write the resulting encoded bits into the bitstream.
[0028] Fourthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,
[0029] A first memory for storing computer programs that can run on a first processor;
[0030] The first processor is used to execute the method described in the second aspect when running a computer program.
[0031] Fifthly, embodiments of this application provide a decoder, which includes a decoding unit, a second determining unit, and a second processing unit; wherein:
[0032] The decoding unit is configured to parse the first syntax element of the current block in the bitstream;
[0033] The second determining unit is configured to determine the transformation cluster of the current block based on the value of the first syntax element of the current block;
[0034] The second determining unit is also configured to determine the transform kernel of the current block based on the transform cluster of the current block;
[0035] The second processing unit is configured to perform an inverse transformation on the transformation coefficients of the current block based on the transformation kernel of the current block to obtain the residual sample of the current block;
[0036] The second determining unit is further configured to determine the reconstructed sample of the current block based on the residual sample and the predicted sample of the current block.
[0037] Sixthly, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,
[0038] The second memory is used to store computer programs that can run on the second processor;
[0039] The second processor is used to execute the methods described in the first aspect when running a computer program.
[0040] In a seventh aspect, embodiments of this application provide a computer-readable storage medium that stores a bitstream generated by such encoding method.
[0041] Eighthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed, implements the method as described in the first aspect or the method as described in the second aspect.
[0042] This application provides an encoding / decoding method, encoder, decoder, and storage medium. At both the decoding and encoding ends, the method involves: determining the transform cluster of the current block; determining the transform kernel of the current block based on the transform cluster; performing an inverse transform on the transform coefficients of the current block based on the transform kernel to obtain the residual samples of the current block; and determining the reconstructed samples of the current block based on the residual samples and the predicted samples. Thus, when using transform techniques, the optimal transform cluster (such as LFNST or NSPT transform cluster) for the current block is determined. By using the optimal transform cluster, a more accurate transform kernel for the current block can be determined, improving the accuracy of transform prediction, thereby increasing the compression efficiency of the transform technique and enhancing encoding / decoding performance. Attached Figure Description
[0043] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0044] Figure 1 is a schematic diagram of the prediction process of an intra-frame prediction technique based on a neural network provided in an embodiment of this application;
[0045] Figure 2 is a schematic diagram of the input preprocessing process of an intra-frame prediction model based on a neural network provided in an embodiment of this application;
[0046] Figure 3 is a detailed encoding and decoding flowchart of an LFNST provided in an embodiment of this application;
[0047] Figure 4 is a schematic diagram illustrating the relationship between NSPT and LFNST according to an embodiment of this application;
[0048] Figure 5 is a schematic diagram of a DIMD prediction process provided in an embodiment of this application;
[0049] Figure 6 is a schematic block diagram of an encoder provided in an embodiment of this application;
[0050] Figure 7 is a schematic block diagram of a decoder provided in an embodiment of this application;
[0051] Figure 8 is a schematic diagram of the network architecture of an encoding / decoding system provided in an embodiment of this application;
[0052] Figure 9 is a flowchart illustrating a decoding method provided in an embodiment of this application;
[0053] Figure 10 is a flowchart illustrating an encoding method provided in an embodiment of this application;
[0054] Figure 11 is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application;
[0055] Figure 12 is a schematic diagram of the specific hardware structure of an encoder provided in an embodiment of this application;
[0056] Figure 13 is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application;
[0057] Figure 14 is a schematic diagram of the specific hardware structure of a decoder provided in an embodiment of this application;
[0058] Figure 15 is a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application. Detailed Implementation
[0059] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0061] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0062] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0063] In video images, a coding block (CB) is typically represented by a first image component, a second image component, and a third image component. These three image components are a luma component, a blue chroma component, and a red chroma component, respectively. Specifically, the luma component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. Thus, video images can be represented in YCbCr format or YUV format.
[0064] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application will be explained. The nouns and terms used in the embodiments of this application shall be interpreted as follows:
[0065] H.264 / Advanced Video Coding (AVC);
[0066] H.265 / High Efficiency Video Coding (HEVC);
[0067] H.266 / Versatile Video Coding (VVC);
[0068] VVC's reference software testing platform (VVC Test Model, VTM);
[0069] Enhanced Compression Model (ECM);
[0070] Joint Video Experts Team (JVET);
[0071] Coding Unit (CU);
[0072] Prediction Unit (PU);
[0073] Transform Unit (TU);
[0074] Coding Tree Unit (CTU);
[0075] Largest Coding Unit (LCU);
[0076] Direct export mode (DM);
[0077] Decoder-side intra-mode derivation (DIMD);
[0078] Convolutional Cross-Component Model (CCCM);
[0079] Block Vector Guided CCCM (BVGCCCM) based on convolutional cross-component prediction mode;
[0080] Gradient and Location-Based Convolutional Cross-Component Prediction Pattern (GLCCCM);
[0081] Cross-Component Linear Mode (CCLM);
[0082] Decoder-derived cross-component prediction (DDCCP) is generated at the decoder end.
[0083] Histogram of Gradient (HoG);
[0084] Discrete Cosine Transform (DCT);
[0085] Discrete Sine Transform (DST);
[0086] Multiple Transform Selection (MTS);
[0087] Multiple Transform Set Selection (MTSS);
[0088] Low-Frequency Non-Separable Transform (LFNST);
[0089] Non-Separable Primary Transform (NSPT);
[0090] Intra-frame prediction based on neural networks (PNN);
[0091] Cross-Component Prediction (CCP);
[0092] Extrapolation filter-based intra prediction (EIP);
[0093] Template-based Intra Mode Derivation (TIMD);
[0094] Matrix Weighted Intra Prediction (MIP);
[0095] Direct Block Vector (DBV);
[0096] Template-based Multiple Reference Line intra prediction (TMRL);
[0097] Sum of Absolute Difference (SAD);
[0098] Sum of Absolute Transform-based Difference (SATD);
[0099] Rate-Distortion Optimization (RDO).
[0100] It should be understood that, with the aim of exploring next-generation digital video compression technologies, a new generation of reference software model ECM is being developed based on the reference software VTM of the latest video coding standard H.266 / VVC.
[0101] 1.1 Encoding / Decoding Standards
[0102] Currently, common video codec standards (such as H.266 / VVC) all employ a block-based hybrid coding framework. Each frame in the video is divided into a largest coding unit (LCU) of the same size (e.g., 128x128, 64x64, etc.). Each LCU can be further divided into rectangular coding units (CUs) according to rules. Coding units may also be divided into prediction units (PUs), transform units (TUs), etc. The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module includes intra-prediction and inter-prediction. Inter-prediction includes motion estimation and motion compensation. Because there is a strong correlation between adjacent pixels in a video frame, intra-prediction is used in video codec technology to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in a video, inter-frame prediction methods are used in video encoding and decoding technology to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0103] The basic workflow of a video codec is as follows: At the encoding end, a frame is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. The prediction block is subtracted from the original image block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. The quantization coefficient matrix is then entropy-encoded and output to the bitstream. At the decoding end, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block. Simultaneously, the bitstream is parsed to obtain the quantization coefficient matrix. The quantization coefficient matrix is inverse-quantized and inverse-transformed to obtain a residual block. The prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. Loop filtering is performed on the reconstructed image based on the image or blocks to obtain the decoded image. The encoding end also requires similar operations to the decoding end to obtain the decoded image. The decoded image can serve as a reference frame for inter-frame prediction in subsequent frames. The block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined at the encoding end need to be output to the bitstream if necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoding end by parsing and analyzing existing information, thus ensuring that the decoded image obtained by the encoding end is the same as that obtained by the decoding end. The decoded image obtained by the encoding end is usually called the reconstructed image. During prediction, the current block can be divided into prediction units, and during transform, the current block can be divided into transform units. The division of prediction units and transform units can be different. The above is the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. The current block can be the current coding unit (CU) or the current prediction unit (PU), etc.
[0104] The Joint Video Coding Standards Organization (JVET) has established a group to research a coding model that surpasses the H.266 / VVC model, and has named this model, or platform test software, ECM. ECM builds upon VTM and incorporates newer and more efficient compression algorithms, currently exceeding VVC's coding performance by approximately 13%. ECM not only increases the coding unit size at specific resolutions but also integrates many module enhancement techniques, representing a significant algorithmic shift compared to VVC.
[0105] 1.2 Intra-frame prediction based on neural networks
[0106] Intra-frame prediction technology based on neural networks involves training a network using a dataset to obtain a model, and then using these models for intra-frame prediction. Here, the model refers to the neural network structure and the trained parameters. The prediction process of intra-frame prediction technology based on neural networks is shown in Figure 1.
[0107] As shown in Figure 1, the intra-frame prediction technique based on neural networks obtains the neighboring samples around the current coding unit as model input, specifically within the range of the upper neighbor (w+w+e). w )×n a The number of reconstructed samples, obtained from the left adjacent n. l ×(h+h+e h The number of reconstructed samples and the top left corner (n) a ×n l) The number of reconstructed samples. Here, a sample can also be called a pixel, and a sample includes location information and value.
[0108] The input preprocessing is shown in Figure 1. X is the reconstructed sample obtained above. Before inputting it into the model, X needs to be preprocessed (or pre-processed) to obtain... Then input into model f h,w (.;θ h,w The preprocessing part mainly consists of the following steps: 1. To obtain the mean of X, μ is subtracted from all samples; 2. Each sample in X is multiplied by... Q in 3. If there are unusable regions in the obtained input samples, then all sample values in that part of X are set to 0, as shown in Figure 2; 4. Reorder the processed X to obtain an n a (n l +2w+e w )+(2h+e h )n l vector The values of each variable in Figure 1 are as follows:
[0109] If min(h,w)≤8&&hw<256
[0110] n a =n l =min(h,w)
[0111] otherwise:
[0112] If h > 8
[0113] n a =h / 2
[0114] otherwise:
[0115] n a =h
[0116] If w > 8
[0117] n l =w / 2
[0118] otherwise:
[0119] n l =w
[0120] If h≤8, e h =4. Otherwise, e h =0.
[0121] If w≤8, e w =4. Otherwise, e w =0.
[0122] As can be seen from Figure 1, the output of the model includes the predicted vector. The prediction vector needs to be post-processed before it can be used as the prediction block of the current coding unit. The output post-processing includes the following steps: 1. Prediction vector 1. The length is w×h, and it needs to be arranged into a rectangular prediction block; 2. Divide the output samples rearranged into rectangular blocks by... Then add the input sample mean μ; 3. Perform a clamping operation on all output samples to limit all predicted sample values to an allowable range, such as [0, 2... b -1], where b is the number of bits used in the internal calculation.
[0123] Intra-frame prediction models based on neural networks output prediction vectors. In addition, it also includes grpIdx1, grpIdx2, and repIdx. Among them, grpIdx1 represents the transform kernel index used when the current coding unit performs LFNST or NSPT, grpIdx2 indicates whether the main transform coefficients after DCT2 are transposed when the current coding unit uses LFNST / NSPT, and repIdx represents the conventional prediction mode of the current coding unit, such as the value range of [0, 66] in the VVC stage.
[0124] This neural network-based intra-frame prediction mode requires a flag to indicate whether the current coding unit is in use. At the same time, this technique has certain limitations, including the coding unit size and the number of surrounding neighboring samples.
[0125] For fully connected neural networks, different coding unit sizes require training models of specific sizes. Currently, there are a total of seven models for intra-frame prediction techniques based on neural networks. Upsampling, subsampling, and transposition operations can improve the applicability of these models, as shown in Table 1.
[0126] Table 1. Model Information Used by Encoding Units
[0127] As shown in Table 1, the seven permissible model sizes are listed in Table 2:
[0128] Table 2 lists the allowed models and their corresponding complexities.
[0129] As shown in Table 1, when the coding unit is 4x4 in size, the 4x4 prediction model can be used directly to predict the 4x4 coding unit. When the current coding unit size is 8x4, it is not necessary to sample the input sample. Instead, the input sample needs to be transposed and then the 4x8 prediction model is used to predict the output sample. The output sample is then inverted to obtain the prediction block in the correct order. For example, for a 64x64 coding unit block, the input sample needs to be downsampled with a stride of 4. The obtained input sample is also preprocessed and then input into a 16x16 prediction model for prediction. After obtaining the output vector, the output vector needs to be post-processed and upsampled to obtain the prediction block of the correct size.
[0130] In this paper, we will refer to intra-frame prediction techniques based on neural networks as PNN.
[0131] 1.3 Low-frequency non-separable second-order transform and non-separable main transform
[0132] In video encoding and decoding, after prediction, the coding unit subtracts the original image to obtain the residual block of the coding unit. This residual block usually needs to be transformed to concentrate the residual energy to facilitate subsequent quantization operations and save coding codewords. In standards such as H.264 and H.265, all transformations are one-dimensional transformation calculations with horizontal and vertical separation. Although this greatly reduces the complexity of hardware implementation, it also results in a significant loss of coding performance. H.266 / VVC introduces the Low-Frequency Inseparable Quadratic Transform (LFNST). LFNST operates on the main transform coefficients, and the main transform is DCT-II in both the horizontal and vertical directions.
[0133] Figure 3 is a detailed flowchart of the LFNST encoding and decoding process. After the forward master transform, the encoder obtains the master transform residual coefficient block, and the high-frequency components are cleared to zero, resulting in residual coefficients only in the upper left corner. Different transform blocks require different coefficient regions to be cleared. For example, if the current transform block is 4x16, only the leftmost 4x4 portion is retained as the input for the LFNST transform. As mentioned above, clearing the coefficient region means setting the transform coefficient values in certain regions of the transform block to 0.
[0134] The transform kernel for the low-frequency non-separable secondary transform is trained based on the residual coefficients obtained after the intra-frame prediction undergoes the main transform. Therefore, corresponding transform kernels are trained according to different intra-frame prediction modes and different texture directions. Currently, in the ECM software, LFNST is divided into 35 transform sets, with 3 transform kernels in each transform set. Each coding unit selects the LFNST transform set through the traditional intra-frame prediction mode [0, 66] and the wide-angle mode [-14, 80]. The specific corresponding table is shown in Table 3. After selecting the transform set, the transform kernel is selected through the index. This lfnst_index needs to be written into the bitstream and transmitted to the decoder.
[0135] Table 3. Angle Patterns Corresponding to LFNST Transform Sets
[0136] The Non-Separable Principal Transform (NSPT) is similar to the Low-Frequency Non-Separable Quadratic Transform (LFNST), but the difference is that NSPT is itself the principal transform. Therefore, unlike LFNST, it does not require a first DCT-II principal transform to obtain the transformed residual coefficients before performing the LFNST transform on these coefficients. NSPT directly performs the non-separable transform on the residual blocks in the pixel domain. Specifically, it does not require clearing all residual values within the pixel domain residual block (i.e., zeroing), resulting in a limited number of residual coefficient blocks. These blocks are then integrated into a vector form and directly multiplied with the non-separable transform coefficient matrix to obtain the transformed residual coefficients.
[0137] Currently, NSPT in ECM is not used as a separate transform mode, but only replaces LFNST for a portion of the coding unit size. The current coding unit uses either NSPT or DCT-II+LFNST as shown in Figure 4.
[0138] As shown in Figure 4, coding units with a width or height of 4 and both less than 32 use NSPT; otherwise, coding units such as 32x4 and 4x32 use a combination of DCT-II and LFNST transforms. Both NSPT and LFNST require a zeroing operation. Unnecessary residual coefficients in the pixel-domain residual block are set to zero to obtain a residual vector of the required size, which is then multiplied by the NSPT transform matrix coefficients to obtain the transformed residual coefficients.
[0139] NSPT and LFNST have the same number of transform sets, both having 35 inseparable main transform sets, and both use intra-frame prediction mode to select transform sets. Furthermore, NSPT and LFNST use the same identifier for transform kernel selection; in the coding unit using NSPT as specified above, lfnst_index is used, just like nspt_index, to select different transform kernels within the transform set.
[0140] 1.4 Decoding End In-Frame Mode Export of DIMD
[0141] DIMD is an intra-prediction technique used in ECM, but it is not present in VVC. The core of this technique lies in deriving the intra-prediction mode at the decoding end using the same method as at the encoding end. This avoids transmitting the intra-prediction mode index of the current coding unit in the bitstream, thus saving bit overhead. The specific implementation involves two main steps:
[0142] The first step, deriving the prediction mode, involves the encoder / decoder performing Sobel operator calculations on the adjacent reconstructed sample regions surrounding the current coding unit. As shown in Figure 2, the gray-filled area is called the template region. The horizontal and vertical gradient information of the reconstructed samples in the template region is calculated. The ratio of the horizontal to vertical gradient of each reconstructed sample is directional. Through a certain table mapping relationship, these directional gradient magnitude values can be categorized into the corresponding texture direction's angle prediction mode. That is, after traversing the reconstructed samples of the template region, each traditional intra-frame prediction mode, including angle prediction and non-angle prediction (DC, PLANAR), will have its own gradient magnitude value. The traditional intra-frame prediction mode corresponding to the largest magnitude value is the optimal prediction mode for the current coding unit under the DIMD mode derivation. Similarly, the second-best intra-frame prediction mode, as well as other sequential intra-frame prediction modes, can be obtained.
[0143] The second step is to derive the prediction block. The same prediction block deriving method is used at the encoder and decoder ends to obtain the current prediction block. The encoder determines the following two conditions: 1. The gradient of the second prediction mode is not 0; 2. Neither the first nor the second prediction mode is a PLANA or DC prediction mode. If neither condition is met simultaneously, the current prediction block uses only the first prediction mode to calculate the predicted sample value, i.e., the normal prediction process is applied to the first prediction mode; otherwise, if both conditions are met, the current prediction block is derived using a weighted average method. Specifically, the PLANA mode occupies 1 / 3 of the weighting weight, and the remaining 2 / 3 is weighted by the first prediction mode based on the ratio of its gradient strength to the sum of the gradient strengths of the first and second prediction modes, and by the second prediction mode based on the ratio of its gradient strength to the sum of the gradient strengths of the first and second prediction modes. The three prediction modes—PLANA, the first, and the second—are weighted and averaged to obtain the prediction block of the current coding unit. The decoder obtains the prediction block using the same steps. The specific operation process is shown in Figure 5.
[0144] The specific weight calculations in the second step above are as follows:
[0145] Weight (PLANAR) = 1 / 3
[0146] Weight(mode1)=2 / 3*(amp1 / (amp1+amp2))
[0147] Weight(mode2)=1–Weight(PLANAR)–Weight(mode1)
[0148] In this code, mode1 and mode2 represent the first and second prediction modes, respectively, and amp1 and amp2 represent the gradient magnitude values of the first and second prediction modes, respectively. DIMD requires transmitting a flag bit to the decoder to indicate whether the current coding unit uses DIMD technology.
[0149] In this scheme, only the first step involves DIMD, and the scope of calculating gradient information and deriving the prediction mode is limited to the prediction block of the current coding unit, rather than the reconstructed samples of the template region.
[0150] Referring to Figure 6, a schematic block diagram of an encoder provided in an embodiment of this application is shown. As shown in Figure 6, the encoder (specifically a "video encoder") 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control and analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image buffer unit 110, etc. Among them, the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input raw video signal, a video coding block can be obtained by partitioning it through a Coding Tree Unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transform and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block. The motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide time prediction information. The motion estimation performed by the motion estimation unit 105 is a process of generating motion vectors, which can estimate the motion of the video coding block. Then, the motion compensation unit 104 uses the motion vectors determined by the motion estimation unit 105 as a basis for the motion estimation. Motion compensation is performed; after determining the intra-prediction mode, the intra-prediction unit 103 is also used to provide the selected intra-prediction data to the coding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the coding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstructing the residual block in the pixel domain. The reconstructed residual block is processed by the filter control analysis unit 107 and the filtering unit 108 to remove block artifacts, and then the reconstructed residual block is added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video coding block; the coding unit 109 is used to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-prediction mode, outputting the bitstream of the video signal; and the decoding image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoding image buffer unit 110.
[0151] Referring to Figure 7, it shows a schematic block diagram of a decoder provided in an embodiment of this application. As shown in Figure 7, the decoder (specifically a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206, etc., wherein the decoding unit 201 can perform header information decoding and CABAC decoding, and the filtering unit 205 can perform deblocking filtering and SAO filtering. After the input video signal undergoes the encoding process shown in Figure 6, the output video signal bitstream is generated. This bitstream is input into the decoder 200, first passing through the decoding unit 201 to obtain the decoded transform coefficients. These transform coefficients are then processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain. The intra-frame prediction unit 203 can generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and data from previously decoded blocks in the current frame or image. The motion compensation unit 204 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and uses... The prediction information is used to generate a predictive block of the video block being decoded; the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-prediction unit 203 or the motion compensation unit 204; the decoded video signal is passed through the filtering unit 205 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoding image buffer unit 206, which stores reference images for subsequent intra-prediction or motion compensation, and is also used for the output of the video signal, thus obtaining the recovered original video signal.
[0152] It should be noted that the method of this application embodiment is mainly applied to the intra-frame coding part shown in FIG6 and the intra-frame coding part shown in FIG7. That is to say, the method of this application embodiment can be applied to the encoder, the decoder, or even to both the encoder and the decoder, but the method of this application embodiment is not specifically limited.
[0153] It should also be noted that when the embodiments of this application are applied to the encoder 100, the "current block" specifically refers to the block to be encoded in the video image (which can also be simply referred to as the "encoded block"); when the embodiments of this application are applied to the decoder 200, the "current block" specifically refers to the block to be decoded in the video image (which can also be simply referred to as the "decoded block").
[0154] This application also provides a network architecture for an encoding / decoding system including an encoder and a decoder. Figure 8 shows a schematic diagram of the network architecture of an encoding / decoding system provided in this application embodiment. As shown in Figure 8, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. The electronic devices can be various types of devices with video encoding / decoding capabilities, such as smartphones, tablets, personal computers, personal digital assistants, navigators, digital phones, video phones, televisions, sensing devices, servers, etc., without specific limitations. Furthermore, the decoder or encoder in this application embodiment can be the aforementioned electronic device.
[0155] In related technologies, when transforming residual blocks, the LFNST / NSPT transform set is selected using the traditional intra-frame angle prediction mode. This is because LFNST / NSPT are trained using these transform set data. With the development of ECM, the number and forms of intra-frame prediction tools have far exceeded those of the H.266 / VVC era. Previous standards primarily used angle prediction tools, while current ECM intra-frame tools include not only various angle prediction tools but also various non-angle and even non-linear prediction tools. These new tools often produce textures different from those obtained by older angle predictions. Therefore, LFNST / NSPT can train corresponding transform sets on these new tools to obtain new LFNST / NSPT types.
[0156] In view of this, embodiments of this application provide an encoding and decoding method that, when using transform technology, determines the optimal transform cluster (such as LFNST or NSPT transform cluster) for the current block. By using the optimal transform cluster, a more accurate transform core for the current block can be determined, improving the accuracy of transform prediction, thereby improving the compression efficiency of transform technology and enhancing encoding and decoding performance.
[0157] The encoding / decoding method provided in this application embodiment can be a transformation method. When using transformation technology, the optimal transformation cluster for the current block can be determined based on the prediction technology used for the current block. Compared with a single transformation cluster, a more suitable transformation cluster can be selected for different prediction tools, thereby determining a more accurate transformation core for the current block, improving the accuracy of transformation prediction, thereby improving the compression efficiency of transformation technology and enhancing encoding / decoding performance.
[0158] To facilitate understanding of the technical solutions of the embodiments of this application, the technical solutions of this application are described in detail below through specific embodiments. The above-mentioned related technologies are optional solutions and can be arbitrarily combined with the technical solutions of the embodiments of this application, all of which fall within the protection scope of the embodiments of this application. The embodiments of this application include at least some of the following contents.
[0159] In one embodiment of this application, referring to FIG9, a flowchart of a decoding method provided by an embodiment of this application is shown. As shown in FIG9, the method may include:
[0160] S901: Parse the first syntax element of the current block in the bitstream;
[0161] In this embodiment, parsing the first syntax element is used to determine the transform cluster of the current block. Specifically, the first syntax element is used to determine the index or intermediate variable of the transform cluster of the current block.
[0162] In some embodiments, the first syntax element of the current block in the code stream is parsed when a preset condition is met. The preset condition is the parsing condition of the first syntax element of the current block.
[0163] In some embodiments, the first syntax element is used to indicate that the current block uses a first prediction technique. The first prediction technique can be an intra-frame prediction technique or an inter-frame prediction technique. For example, the first prediction technique includes, but is not limited to, at least one of the following: PNN, TIMD, DIMD, EIP, MIP, SGPM, TMP, CCCM, CCLM, CCP, etc.
[0164] The first syntax element includes one or more syntax elements indicating one or more prediction techniques. Each syntax element indicates whether the current block uses the corresponding prediction technique. The first prediction technique used by the current block is determined based on the values of one or more syntax elements. For example, if the first syntax element includes `pnn_flag`, and `pnn_flag` is true, the current block uses the PNN technique; if the first syntax element includes `timd_flag`, and `timd_flag` is true, the current block uses the TIMD technique. The first syntax element includes, but is not limited to, block-level syntax elements. The first syntax element may also include at least one of the following: sequence-level syntax elements, frame-level syntax elements, slice-level syntax elements, or any decoding unit-level syntax element to which the current block belongs.
[0165] For example, under the condition that the preset conditions are met, the first syntax element of the current block in the bitstream is parsed. The preset conditions include at least one of the following: the first prediction technique is allowed to be used in the current block; the size of the current block meets the size limit condition of the first prediction technique; the reference sample of the current block has been reconstructed.
[0166] The value of the second syntax element can be used to determine whether the first prediction technique is allowed in the current block. The second syntax element includes at least one of the following: a sequence-level syntax element, a frame-level syntax element, a slice-level syntax element, a block-level syntax element, or any decoding unit-level syntax element to which the current block belongs. For example, if the second syntax element is a sequence-level syntax element, it indicates whether the first prediction technique is allowed in the current sequence to which the current block belongs. If allowed, it determines that all decoding units in the current sequence are allowed to use the first prediction technique. As another example, if the second syntax element is a frame-level syntax element, it indicates whether the first prediction technique is allowed in the current frame (or image) to which the current block belongs. If allowed, it determines that all decoding units in the current frame are allowed to use the first prediction technique.
[0167] The size constraint of the first prediction technique is a size constraint that allows the first prediction technique to be used in the current block. The size constraint can specifically limit the size of the current block by at least one of the following: a width constraint, a height constraint, a width-to-height product constraint, a width-to-height ratio constraint, etc. The constraint value can specifically include at least one of the following: an upper limit value, a lower limit value, one or more specific values, etc.
[0168] For example, the first prediction technique is PNN, and the preset conditions corresponding to PNN include:
[0169] 1. PNN sequence levels allow the use of flag bits that are true;
[0170] 2. Size constraints for the current block, for example:
[0171] 2.0 Set the initial decoding block shape to blkShape{width,height}, where width is the width of the current block and height is the height of the current block;
[0172] 2.1 If the width of a block is equal to its height, and both are greater than 16, then the current block blkShape is set to blkShape{16,16}.
[0173] 2.2 If the height of the block is 32, and the width of the current block is 4, 8 or 16, then the current block blkShape is set to blkShape{4,16}, blkShape{8,16} or blkShape{16,16} respectively.
[0174] 2.3 Check Table 4 to see if the current block is allowed to use PNN technology based on its blkShape. If there is a matching blkShape in Table 4, then PNN technology is allowed. It should be noted that if the shape of the current block does not meet the conditions set in 2.0 and 2.1, you can check Table 4 based on the actual shape of the current block.
[0175] Table 4
[0176] In some embodiments, the first syntax element is used to indicate the transform cluster index value of the current block. For example, the first syntax element of the current block in the bitstream is parsed when preset conditions are met. The preset conditions include at least one of the following: the transform technique provided in this application embodiment is allowed to be used in the current block; the prediction technique is allowed to be used in the first prediction technique; the size of the current block meets the size limit condition of the transform technique; and the reference sample of the current block has been reconstructed.
[0177] For example, the method further includes: determining the first syntax element of the current block in the decoded bitstream when the current block uses a first prediction technique. The first prediction technique includes, but is not limited to, at least one of the following: PNN, TIMD, DIMD, EIP, MIP, SGPM, TMP, CCCM, CCLM, CCP, etc.
[0178] S902: Determine the transformation cluster of the current block based on the value of the first syntax element of the current block;
[0179] In some embodiments, the first syntax element is used to indicate that the current block uses a first prediction technique; based on the first prediction technique used by the current block, the transformation cluster of the current block is determined.
[0180] In some embodiments, based on the value of the first syntax element of the current block, it is determined that the current block uses a first prediction technique; based on the first prediction technique, a first identifier of the current block is determined; based on the first identifier of the current block, the transform cluster of the current block is determined. The first identifier is used to identify the transform cluster of the current block, and the first identifier can be a transform cluster index value.
[0181] For example, a first identifier of the current block is determined based on a first mapping relationship and a first prediction technique. The first mapping relationship includes a mapping relationship between one or more prediction techniques and the value of the first identifier. The first prediction technique may optionally include at least two transformation clusters.
[0182] For example, determining the first identifier of the current block based on the first prediction technique may include at least one of the following: when the first prediction technique is a first preset prediction technique, the first identifier is determined to be a first value, where the first preset prediction technique includes one or more prediction techniques; when the first prediction technique is a second preset prediction technique, the first identifier is determined to be a second value, where the second preset prediction technique includes one or more prediction techniques; when the first prediction technique is neither the first nor the second preset prediction technique, the first identifier is determined to be a third value. The first value, second value, and third value respectively indicate different transformation clusters. The value of the first identifier includes, but is not limited to, the first value, second value, and third value. The value of the second identifier can be one or more other values, used to indicate the transformation cluster corresponding to other preset prediction techniques.
[0183] The first preset prediction technique may include one or more prediction techniques for the same color component, and / or one or more prediction techniques for different color components. The second preset prediction technique may include one or more prediction techniques for the same color component, and / or one or more prediction techniques for different color components. The first preset prediction technique and the second preset prediction technique are different prediction techniques, specifically they may be prediction techniques for different color components, or different prediction techniques for the same color component.
[0184] In some embodiments, the prediction techniques for different color components correspond to different transform clusters. For example, for the luminance component, the first preset prediction technique includes, but is not limited to, at least one of the following: PNN, TIMD, DIMD, EIP, MIP, SGPM; and the second prediction technique includes, but is not limited to, TMP, inter-frame prediction. For the chrominance component, the first preset prediction technique includes, but is not limited to, at least one of the following: CCCM, CCLM, DDCCP; and the second preset prediction technique includes, but is not limited to, at least one of the following: DBV, BVGCCCM.
[0185] In some embodiments, a first identifier of the current block is determined based on a first prediction technique and the size of the current block.
[0186] For example, determining the first identifier of the current block based on the first prediction technology and the size of the current block may include at least one of the following: when the first prediction technology is a first preset prediction technology and the size of the current block meets a first size condition, determining the first identifier as a first value; when the first prediction technology is a first preset prediction technology and the size of the current block does not meet the first size condition, determining the first identifier as a third value; when the first prediction technology is a second preset prediction technology and the size of the current block meets a second size condition, determining the first identifier as a second value; when the first prediction technology is a second preset prediction technology and the size of the current block does not meet the second size condition, determining the first identifier as a third value.
[0187] In some embodiments, if the first prediction technique is a second preset prediction technique and the size of the current block does not meet the second size condition, the first identifier is determined to be the fourth value.
[0188] The first and second size conditions are selection conditions for the transform cluster. The size condition can specifically limit the size of the current block by one of the following: a limit value for width, a limit value for height, a limit value for the product of width and height, a limit value for the ratio of width to height, etc. The limit value can specifically include at least one of the following: an upper limit value, a lower limit value, one or more specific values, etc.
[0189] In some embodiments, when the first preset prediction technique is an intra-frame prediction technique based on a neural network, the first size condition may include: the width of the current block is greater than a first preset value, and the height of the current block is greater than a second preset value. The first preset value and the second preset value may be equal or unequal; for example, the first preset value and the second preset value may be 4.
[0190] In some embodiments, determining a first identifier for the current block based on a first prediction technique may include at least one of the following: when the first prediction technique is a first preset prediction technique, determining the first identifier as a first value; when the first prediction technique is a first preset prediction technique and the size of the current block meets a first size condition, determining the first identifier as a first value; when the first prediction technique is a second preset prediction technique, determining the first identifier as a second value; when the first prediction technique is a second preset prediction technique and the size of the current block meets a second size condition, determining the first identifier as a second value; when the first prediction technique is neither a first preset prediction technique nor a second preset prediction technique, or when the first prediction technique is a first preset prediction technique and the size of the current block does not meet the first size condition, or when the first prediction technique is a second preset prediction technique and the size of the current block does not meet the second size condition, determining the first identifier as a third value.
[0191] In some embodiments, the first syntax element is used to determine the transform cluster index value of the current block, that is, based on the value of the first syntax element, the first identifier of the current block is determined; based on the first identifier of the current block, the transform cluster of the current block is determined.
[0192] In some embodiments, the method further includes: determining a candidate transform cluster of the current block, the candidate transform cluster including one or more transform clusters; and determining the transform cluster of the current block from the candidate transform cluster of the current block based on the value of the first syntax element of the current block.
[0193] It should be noted that when a candidate transform cluster includes one transform cluster, the value of the first syntax element can be a default value, such as 0 or 1. When a candidate transform cluster includes multiple transform clusters, the value of the first syntax element is obtained by parsing the bitstream.
[0194] In some embodiments, the method further includes: determining candidate transform clusters for the current block based on the color components of the current block. That is, different color component prediction techniques can correspond to different transform clusters to further improve the compression efficiency of the transform technique.
[0195] For example, when the color component of the current block is the first color component, the candidate transform cluster of the current block is the candidate transform cluster to which the first color component belongs; when the color component of the current block is the second color component, the candidate transform cluster of the current block is the candidate transform cluster to which the second color component belongs. The first color component and the second color component are different color components; the first color component can be a luminance component, and the second color component can be a chrominance component. The chrominance components Cb and Cr can correspond to the same candidate transform cluster or different candidate transform clusters.
[0196] In some embodiments, the method further includes: determining a candidate transform cluster for the current block based on the transform operations performed on the current block. That is, when two or more different transform operations are included, different transforms can correspond to different transform clusters to further improve the compression efficiency of the transform technique. When two or more different transform operations are included, and the transform kernels of different transforms can be reused, different transforms can correspond to the same transform cluster or a large transform set (without identical transform kernels), and different transforms index the same transform cluster or large transform set.
[0197] For example, when the first transformation is performed in the current block, the candidate transformation cluster of the current block is the candidate transformation cluster to which the first transformation belongs; when the second transformation is performed in the current block, the candidate transformation cluster of the current block is the candidate transformation cluster to which the second transformation belongs.
[0198] The first transformation and the second transformation are different transformations. For example, the first transformation can be NSPT and the second transformation can be LFNST. For example, if the size of the current block satisfies the third size condition, the current block performs the first transformation; if the size of the current block satisfies the fourth size condition, the current block performs the second transformation.
[0199] The third and fourth size conditions are the selection conditions for NSPT and LFNST, respectively. The size conditions can specifically limit the size of the current block by one of the following: width limit, height limit, width-to-height product limit, width-to-height ratio limit, etc. The limit value can specifically include at least one of the following: upper limit, lower limit, one or more specific values, etc.
[0200] The third size condition includes at least one of the following: the width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is less than or equal to the fifth preset value; the height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is less than or equal to the fifth preset value.
[0201] The fourth size condition includes at least one of the following: the width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is greater than the fifth preset value; the height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is greater than the fifth preset value; the width and height of the current block are both greater than or equal to the fifth preset value.
[0202] The third and fourth preset values are both less than the fifth preset value. For example, the third preset value can be 4, the fourth preset value can be 8, and the fifth preset value can be 16.
[0203] In some embodiments, a candidate transform cluster for the current block is determined based on the color components and transform operations of the current block.
[0204] For example, if the color component of the current block is a first color component, and the current block performs a first transformation, the candidate transformation cluster of the current block is the first candidate transformation cluster to which the first color component belongs; if the color component of the current block is a first color component, and the current block performs a second transformation, the candidate transformation cluster of the current block is the second candidate transformation cluster to which the first color component belongs; if the color component of the current block is a second color component, and the current block performs a first transformation, the candidate transformation cluster of the current block is the third candidate transformation cluster to which the second color component belongs; if the color component of the current block is a second color component, and the current block performs a second transformation, the candidate transformation cluster of the current block is the fourth candidate transformation cluster to which the second color component belongs. The first and second candidate transformation clusters are the candidate transformation clusters corresponding to different transformations of the first color component, and the third and fourth candidate transformation clusters are the candidate transformation clusters corresponding to different transformations of the second color component.
[0205] S903: Determine the transform kernel of the current block based on the transform cluster of the current block;
[0206] In some embodiments, determining the transform kernel of the current block based on the transform cluster of the current block may include: determining the transform kernel of the current block based on the transform cluster of the current block, a second identifier and a third identifier of the current block, wherein the second identifier is used to indicate the transform set of the current block and the third identifier is used to indicate the transform kernel of the current block.
[0207] A transform cluster (which can be represented as a bucket or cluster) consists of M transform sets, where M is an integer greater than 1. For example, M can take values including, but not limited to, 35. A transform cluster can include 35 transform sets.
[0208] A transformation set consists of N transformation kernels, where N is an integer greater than 1. For example, N can be 3, but is not limited to 3.
[0209] The transformation kernel is used to perform transformation operations on the current block.
[0210] It is understandable that the first identifier, the second identifier, and the third identifier serve as indexes at different levels, and the transformation kernel used by the current block is determined based on the first identifier, the second identifier, and the third identifier.
[0211] In some embodiments, the transform set of the current block is determined based on the second identifier and the transform cluster of the current block; the transform kernel of the current block is determined based on the third identifier and the transform set of the current block.
[0212] In some embodiments, the transform kernel index value of the current block is determined based on the third identifier and the transform set of the current block; the transform kernel of the current block is determined from the first transform set based on the transform kernel index value of the current block. That is, the third identifier is used to indicate the transform kernel index value.
[0213] The first transform set consists of Q transform kernels, where Q is an integer greater than 1. Since transform kernels in a transform cluster may be identical, redundancy removal of transform kernels can reduce the number of transform kernels. This can also be understood as the first transform set not containing duplicate transform kernels.
[0214] For example, the first transform set can be determined by deduplicating the transform kernels in the transform cluster of the current block, or by deduplicating the transform kernels in the candidate transform cluster of the current block, or by deduplicating the transform kernels in all candidate transform clusters corresponding to the same transform.
[0215] In other words, the third identifier, combined with the first and second identifiers, can directly determine the transform kernel of the current block, or indirectly determine the transform kernel index value of the current block, and then determine the transform kernel from the first transform set through the transform kernel index value.
[0216] In some embodiments, the second identifier is determined based on the intra-prediction mode of the current block. The intra-prediction mode of the current block is determined by one of the following: output by an intra-prediction model based on a neural network; derived from reference samples of the current block; derived from gradient information of the predicted block of the current block; or set to a preset intra-prediction mode. The reference samples include reconstructed adjacent and / or non-adjacent samples surrounding the current block.
[0217] For example, if the first prediction technique used by the current block is PNN, the intra-prediction model based on neural networks will output repIdx in addition to the prediction vector. repIdx represents the traditional intra-prediction mode of the current block, such as a value range of [0, 66] in the VVC stage. If the first prediction technique used by the current block is PNN, the intra-prediction mode output by the model may not be used. If the current block uses other prediction techniques, the repIdx can also be output by the intra-prediction model based on neural networks.
[0218] The prediction based on the reference samples of the current block can be derived using prediction techniques other than PNN. The prediction based on the gradient information of the current block can be derived using the optimal intra-prediction mode derived in DIMD. The preset intra-prediction mode is a default intra-prediction mode; for example, the preset intra-prediction mode can be the PLANA mode, the DC mode, or other angle modes.
[0219] For example, a second identifier is determined based on a second mapping relationship and the intra-prediction mode of the current block. The second mapping relationship includes a mapping relationship between one or more intra-prediction modes and the values of the second identifier. For example, for the LFNST transform set, the second mapping relationship is shown in Table 3.
[0220] In some embodiments, the third identifier is determined by one of the following: obtained by parsing the bitstream; output by an intra-frame prediction model based on a neural network; or derived based on reference samples of the current block. The reference samples include reconstructed adjacent and / or non-adjacent samples surrounding the current block.
[0221] For example, if the first prediction technique used by the current block is PNN, the intra-prediction model based on neural networks will include grpIdx1 in addition to the output prediction vector. grpIdx1 represents the transform kernel index used for LFNST or NSPT in the current block. If the first prediction technique used by the current block is PNN, the grpIdx1 output by the model may not be used. If the current block uses other prediction techniques, the repIdx output by the intra-prediction model based on neural networks may also be used.
[0222] S904: Perform an inverse transformation on the transform coefficients of the current block based on the transform kernel of the current block to obtain the residual sample of the current block;
[0223] It should be noted that the transformation in the decoding process is usually called the inverse transformation, but in the actual text description, it can also be understood as a transformation, that is, the operation of matrix multiplication with the transformation kernel after inverse quantization of the residual coefficients (which can also be understood as the process of scaling the residual coefficients).
[0224] S905: Determine the reconstruction sample for the current block based on the residual sample and the prediction sample of the current block.
[0225] In some embodiments, the method further includes: determining a prediction sample for the current block based on a first prediction technique used by the current block.
[0226] For example, when the first prediction technique is PNN, the reference sample of the current block is obtained; the reference sample of the current block is preprocessed to obtain the input vector; the input vector is input into the intra-frame prediction model based on the neural network to obtain the output vector; the output vector is postprocessed to obtain the prediction sample of the current block.
[0227] The reference samples for the current block include one or more reconstructed samples from the upper adjacent region, left adjacent region, upper left adjacent region, upper right adjacent region, and lower left adjacent region of the current block.
[0228] By adopting the above technical solution, when using transform technology, the optimal transform cluster (such as LFNST or NSPT transform cluster) for the current block is determined. By using the optimal transform cluster, a more accurate transform core for the current block can be determined, improving the accuracy of transform prediction, thereby improving the compression efficiency of transform technology and enhancing encoding and decoding performance.
[0229] Specifically, when transforming the residual coefficients of the current block, the transform cluster for the current block is selected from the candidate transform clusters based on the prediction technique used by the current block. For example, existing ECM reference software has LFNST and NSPT. Regardless of the prediction technique, all blocks select the transform set corresponding to the current block from 35 transform sets based on the traditional angular or non-angular prediction mode [-14, 80]. The transform kernel applied to the residual block of the current block is then selected from this transform set based on lfnst_index / nspt_index. This application provides a transform method that uses different LFNST / NSPT transform clusters for different prediction techniques. Further, before transforming or inverse transforming the current block, if the prediction technique of the current block is determined to be a first prediction technique, the corresponding transform cluster is selected based on the first prediction technique. The corresponding transform set is selected based on the traditional intra-frame prediction mode of the current block, and the corresponding transform kernel is selected based on the index to transform or inverse transform the residual block. The 35 transform sets constitute a transform cluster (bucket or cluster), and each transform set contains a configuration of 3 transform kernels.
[0230] The pseudocode representation is as follows:
[0231] lfnst_kernel[set][type][index]={{{}}};
[0232] nspt_kernel[set][type][index]={{{}}};
[0233] Here, lfnst_kernel[set][type][index] represents the transform kernel of LFNST, and nspt_kernel[set][type][index] represents the transform kernel of NSPT.
[0234] For example, the first prediction technique is to use intra-frame prediction technique based on neural networks (PNN technique) as an example to illustrate the decoding method provided in the embodiments of this application.
[0235] The decoding end parses the bitstream.
[0236] 1. Parse the bitstream to obtain the prediction technique (also known as the prediction tool or prediction mode) of the current block (also called the current decoding unit). If it is an intra-frame prediction technique, and PNN prediction is allowed in the current block, then parse the PNN technique usage flag (such as pnn_flag) of the current block. If the flag indicates that the current block uses PNN technique for prediction (one way is to say pnn_flag is true, or another way is to say pu.intraDir[compID] == PNN_IDX), then proceed to step 2; otherwise, proceed to step 3.
[0237] 2. The decoding end uses PNN prediction technology.
[0238] 2.1 Obtaining Prediction Blocks and Residual Blocks
[0239] Obtain the reconstructed samples X adjacent to the current block, and preprocess the reconstructed samples X to obtain... Load the corresponding neural network-based intra-frame prediction model based on the width w and height h of the current block, and... The input is fed into the model for inference and computation, resulting in an output vector. For the output vector Post-processing is performed to obtain the predicted block that matches the current block size.
[0240] The residual coefficients in the parsed bitstream are used to obtain the residual block before the current block is transformed and dequantized. This residual block contains the residual coefficients before the current block is dequantized.
[0241] 2.2 Obtain the transform kernel and perform inverse transform on the residual block
[0242] The residual block R is obtained by inverse quantization of the residual block in section 2.1. quan .
[0243] If the current block uses PNN prediction technology, then the transform cluster type of LFNST / NSPT is set to 1 based on the PNN usage flag being true. The magnitude values in each direction are obtained on the prediction block using a gradient-based method (DIMD derived prediction mode technology). The intraMode of the current block is obtained based on the magnitude values, and the transform set is selected based on the intraMode. The corresponding transform kernel is selected based on the index (nspt_index / lfnst_index). In some embodiments, transform kernels in different transform clusters may be the same; therefore, the data structure of the LFNST / NSPT transform set is not necessarily in the form of [set][type][index]. In some cases, a large set can be formed, but the transform kernel index value in the large set is still obtained using the [set][type][index] form, and then the transform kernel is indexed from the large set.
[0244] If the block uses the NSPT transform (corresponding to the first transform), then R quan Multiplying the obtained NSPT transform kernel by the output residual block R yields the output residual block R. inv Residual block R inv With prediction blocks The blocks are overlaid to obtain the reconstructed block of the current block.
[0245] If the block uses the LFNST transform (corresponding to the second transform), then it will be multiplied with the obtained LFNST transform kernel to obtain the output residual vector V. lfnst After arranging the residual blocks into the shape required by DCT-II, inverse transformations are performed with both horizontal and vertical DCT-II to obtain residual block R. inv Residual block R inv With prediction blocks The blocks are overlaid to obtain the reconstructed block of the current block.
[0246] 3. Continue parsing information such as the usage flags or indices of other prediction techniques, and obtain the final prediction block for the current block based on the parsed information; parse the bitstream and obtain the residual coefficients, and obtain the residual block based on inverse quantization and inverse transform. Superimpose the final prediction block and the residual block to obtain the reconstructed sample block;
[0247] 4. After all the reconstructed sample blocks are processed by techniques such as loop filtering, the final reconstructed image is obtained, which can be used as both video output and as a reference for subsequent decoding.
[0248] The syntax elements of the PNN prediction technique are shown in Table 5.
[0249] Table 5
[0250] The pseudocode for the LFNST / NSPT transform cluster part of the PNN prediction technique corresponding to the above embodiments can be as follows:
[0251] Table 6
[0252] The values 0, 1, and 2 after "return" in the table above are used to select the transform cluster of LFNST / NSPT. In some implementation instances, the specific value of "type" can also be set to other values, such as 0, 2, ..., N, etc.
[0253] In the table above, the type value of prediction techniques such as TIMD, DIMD, EIP, MIP, SGPM, and PNN is 1, the type value of prediction techniques such as TMP and inter-frame prediction techniques is 2, and the type value of other prediction techniques is 0.
[0254] The pseudocode for the LFNST / NSPT transform cluster part of the PNN prediction technique corresponding to the above embodiment can also be as follows:
[0255] Table 7
[0256] It should be understood that the flag used to indicate whether the current block uses PNN technology can be represented by pnn_flag, or by a specific index value such as 220, and the value of PNN_IDX is defined as 220. If it is determined that the current block uses PNN technology during the parsing process, then cu.firstPU->intraDir[0] is set to 220.
[0257] In some embodiments, different LFNST / NSPT transform clusters can be used to improve coding performance for prediction techniques of different color components. The pseudocode for selecting the LFNST / NSPT transform cluster part of the PNN prediction technique corresponding to the above embodiments can also be as follows:
[0258] Table 8
[0259] In the table above, for the luminance component, the values 0, 1, and 2 after `return` are used to select the LFNST / NSPT transform cluster to which the luminance component belongs. Specifically, for the luminance component, the type value of prediction techniques such as TIMD, DIMD, EIP, MIP, SGPM, and PNN is 1, the type value of prediction techniques such as TMP and inter-frame prediction techniques is 2, and the type value of other prediction techniques is 0.
[0260] In the table above, for the chroma component, the values 3, 4, and 5 after `return` are used to select the LFNST / NSPT transform cluster to which the luminance component belongs. Specifically, for the chroma component, the type value for prediction techniques such as DDCCP, CCLM, and CCCM is 3; the type value for prediction techniques such as TMP and inter-frame prediction is 4; and the type value for other prediction techniques is 5.
[0261] It should be understood that the values of 3, 4, and 5 for the chrominance component's type are only to distinguish between the LFNST / NSPT transform clusters to which the luminance component belongs and those to which the chrominance component belongs. In practical applications, the values of type can also be the same. For example, for the chrominance component, the values of type can be 0, 1, and 2 to indicate the LFNST / NSPT transform cluster to which the chrominance component belongs.
[0262] In some implementation instances, the specific value of type can also be set to other values, such as 0, 2, ..., N, etc.
[0263] The following can be represented using pseudocode:
[0264] lfnst_kernel[compId][set][type][index]={{{}}};
[0265] nspt_kernel[compId][set][type][index]={{{}}}.
[0266] The following can also be represented using pseudocode:
[0267] COMPONENT_Y_lfnst_kernel[set][type][index]={{{}}};
[0268] COMPONENT_Y_nspt_kernel[set][type][index]={{{}}};
[0269] COMPONENT_C_lfnst_kernel[set][type][index]={{{}}};
[0270] COMPONENT_C_nspt_kernel[set][type][index]={{{}}}.
[0271] The pseudocode for the LFNST / NSPT transform cluster part of the PNN prediction technique corresponding to the above embodiment can also be as follows:
[0272] Table 9
[0273] While selecting different LFNST / NSPT transform clusters based on different prediction techniques, it is advisable to consider adding the width or height of the current block as an additional size constraint. For example, if the first prediction technique used for the current block is PNN, and both the width and height of the current block are greater than 4, then return 1 uses the type 0 bucket; otherwise, return 0 uses the type 1 bucket.
[0274] The technical solution provided in this application was implemented on the ECM reference software and tested under normal test conditions to obtain the following results.
[0275] Table 9
[0276] As shown in the table above, by employing the transformation technology provided in this application embodiment, different LFNST / NSPT transformation clusters are selected based on different prediction technologies, and the transformation operation is performed according to the selected optimal LFNST / NSPT transformation cluster. Under the configuration of ECM AI, this transformation technology can contribute 0.04% and 0.01% coding gain to the Y component classes E and C, respectively, and the modification is very direct and simple. Theoretically, there is no change in encoding and decoding time.
[0277] In another embodiment of this application, referring to FIG10, a flowchart of an encoding method provided by an embodiment of this application is shown. As shown in FIG10, the method may include:
[0278] S1001: Determine the transformation cluster for the current block;
[0279] In some embodiments, if the first prediction technique is permitted for the current block, a first identifier of the current block is determined based on the first prediction technique; and a transformation cluster of the current block is determined based on the first identifier of the current block.
[0280] In some embodiments, determining a first identifier of the current block based on a first prediction technique includes: when the first prediction technique is a first preset prediction technique, determining the first identifier as a first value, wherein the first preset prediction technique includes one or more prediction techniques; when the first prediction technique is a second preset prediction technique, determining the first identifier as a second value, wherein the second preset prediction technique includes one or more prediction techniques; and when the first prediction technique used by the current block is neither the first preset prediction technique nor the second preset prediction technique, determining the first identifier as a third value.
[0281] In some embodiments, the first preset prediction technique is an intra-frame prediction technique based on a neural network.
[0282] In some embodiments, determining a first identifier of the current block based on a first prediction technique includes: determining a first identifier of the current block based on the first prediction technique and the size of the current block.
[0283] For example, determining a first identifier of the current block based on a first prediction technique and the size of the current block includes at least one of the following: determining the first identifier as a first value when the first prediction technique is a first preset prediction technique and the size of the current block meets a first size condition; determining the first identifier as a third value when the first prediction technique is a first preset prediction technique and the size of the current block does not meet the first size condition; determining the first identifier as a second value when the first prediction technique is a second preset prediction technique and the size of the current block meets a second size condition; and determining the first identifier as a third value when the first prediction technique is a second preset prediction technique and the size of the current block does not meet the second size condition.
[0284] In some embodiments, when the first preset prediction technique is an intra-frame prediction technique based on a neural network, the first size condition includes: the width of the current block is greater than a first preset value, and the height of the current block is greater than a second preset value.
[0285] In some embodiments, if the first prediction technique is permitted for the current block, the transform cluster of the current block is determined. For example, the candidate transform clusters are traversed to determine the transform kernel of the current block.
[0286] In some embodiments, the method may further include: determining that the current block is allowed to use the first prediction technique when preset conditions are met; wherein the preset conditions include at least one of the following: the first prediction technique is allowed to be used in the current block; the size of the current block meets the size limitation condition of the first prediction technique.
[0287] In some embodiments, the method further includes: determining a candidate transform cluster for the current block, the candidate transform cluster including one or more transform clusters; and determining the transform cluster for the current block from the candidate transform clusters for the current block.
[0288] In some embodiments, the method further includes: determining candidate transform clusters for the current block based on the color components of the current block. That is, different color component prediction techniques can correspond to different transform clusters to further improve the compression efficiency of the transform technique.
[0289] For example, when the color component of the current block is the first color component, the candidate transform cluster of the current block is the candidate transform cluster to which the first color component belongs; when the color component of the current block is the second color component, the candidate transform cluster of the current block is the candidate transform cluster to which the second color component belongs. The first color component and the second color component are different color components; the first color component can be a luminance component, and the second color component can be a chrominance component. The chrominance components Cb and Cr can correspond to the same candidate transform cluster or different candidate transform clusters.
[0290] In some embodiments, the method further includes: determining a candidate transform cluster for the current block based on the transform operations performed on the current block. That is, when two or more different transform operations are included, different transforms can correspond to different transform clusters to further improve the compression efficiency of the transform technique. When two or more different transform operations are included, and the transform kernels of different transforms can be reused, different transforms can correspond to the same transform cluster or a large transform set (without identical transform kernels), and different transforms index the same transform cluster or large transform set.
[0291] For example, when the first transformation is performed in the current block, the candidate transformation cluster of the current block is the candidate transformation cluster to which the first transformation belongs; when the second transformation is performed in the current block, the candidate transformation cluster of the current block is the candidate transformation cluster to which the second transformation belongs.
[0292] The first transformation and the second transformation are different transformations. For example, the first transformation can be NSPT and the second transformation can be LFNST. For example, if the size of the current block satisfies the third size condition, the current block performs the first transformation; if the size of the current block satisfies the fourth size condition, the current block performs the second transformation.
[0293] The third size condition includes at least one of the following: the width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is less than or equal to the fifth preset value; the height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is less than or equal to the fifth preset value.
[0294] The fourth size condition includes at least one of the following: the width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is greater than the fifth preset value; the height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is greater than the fifth preset value; the width and height of the current block are both greater than or equal to the fifth preset value.
[0295] For example, the third preset value can be 4, the fourth preset value can be 8, and the fifth preset value can be 16.
[0296] In some embodiments, a candidate transform cluster for the current block is determined based on the color components and transform operations of the current block.
[0297] For example, if the color component of the current block is a first color component, and the current block performs a first transformation, the candidate transformation cluster of the current block is the first candidate transformation cluster to which the first color component belongs; if the color component of the current block is a first color component, and the current block performs a second transformation, the candidate transformation cluster of the current block is the second candidate transformation cluster to which the first color component belongs; if the color component of the current block is a second color component, and the current block performs a first transformation, the candidate transformation cluster of the current block is the third candidate transformation cluster to which the second color component belongs; if the color component of the current block is a second color component, and the current block performs a second transformation, the candidate transformation cluster of the current block is the fourth candidate transformation cluster to which the second color component belongs. The first and second candidate transformation clusters are the candidate transformation clusters corresponding to different transformations of the first color component, and the third and fourth candidate transformation clusters are the candidate transformation clusters corresponding to different transformations of the second color component.
[0298] S1002: Determine the transformation kernel of the current block based on the transformation cluster of the current block;
[0299] In some embodiments, determining the transform kernel of the current block based on the transform cluster of the current block may include: determining the transform set of the current block based on the transform cluster of the current block and a second identifier of the current block, wherein the second identifier is used to indicate the transform set of the current block; and determining the transform kernel of the current block based on the transform set of the current block.
[0300] A transform cluster (which can be represented as a bucket or cluster) consists of M transform sets, where M is an integer greater than 1. For example, M can take values including, but not limited to, 35. A transform cluster can include 35 transform sets.
[0301] A transformation set consists of N transformation kernels, where N is an integer greater than 1. For example, N can be 3, but is not limited to 3.
[0302] The transformation kernel is used to perform transformation operations on the current block.
[0303] In some embodiments, determining the transform kernel of the current block based on the transform set of the current block includes: determining a third identifier of the current block; and determining the transform kernel of the current block based on the third identifier and the transform set of the current block.
[0304] It is understandable that the first identifier, the second identifier, and the third identifier serve as indexes at different levels, and the transformation kernel used by the current block is determined based on the first identifier, the second identifier, and the third identifier.
[0305] In some embodiments, the second identifier is determined based on the intra-prediction mode of the current block. The intra-prediction mode of the current block is determined by one of the following: output by an intra-prediction model based on a neural network; derived from reference samples of the current block; derived from gradient information of the predicted block of the current block; or set to a preset intra-prediction mode. The reference samples include reconstructed adjacent and / or non-adjacent samples surrounding the current block.
[0306] In some embodiments, determining the transform kernel of the current block based on the third identifier and the transform set of the current block includes: determining the transform kernel index value of the current block based on the third identifier and the transform set of the current block; and determining the transform kernel of the current block from the first transform set based on the transform kernel index value of the current block. That is, the third identifier is used to indicate the transform kernel index value.
[0307] For example, the first transform set can be determined by deduplicating the transform kernels in the transform cluster of the current block, or by deduplicating the transform kernels in the candidate transform cluster of the current block, or by deduplicating the transform kernels in all candidate transform clusters corresponding to the same transform.
[0308] In some embodiments, the third identifier is determined by one of the following: output by an intra-frame prediction model based on a neural network; or derived based on reference samples of the current block. The reference samples include reconstructed neighboring and / or non-neighboring samples surrounding the current block.
[0309] In some embodiments, determining the transform kernel of the current block based on the transform set of the current block includes: traversing the transform set of the current block to determine the transform kernel of the current block. Correspondingly, the method further includes: making an encoding decision based on cost value to determine a third identifier of the current block; encoding the determined third identifier and writing the obtained encoded bits into the bitstream.
[0310] S1003: Transform the residual samples of the current block based on the transformation kernel of the current block to determine the transformation coefficients of the current block;
[0311] S1004: Quantize the transformation coefficients to obtain the residual coefficients of the current block;
[0312] In some embodiments, the method further includes: encoding the residual coefficients of the current block and writing the resulting encoded bits into the bitstream.
[0313] S1005: Calculate the cost based on the residual coefficient of the current block to determine the cost value;
[0314] In some embodiments, the residual coefficients of the current block are inversely quantized and inversely transformed to determine the residual samples after inverse transformation of the current block; based on the residual samples after inverse transformation of the current block and the predicted samples, the reconstructed samples of the current block are determined; based on the reconstructed samples of the current block and the original samples, the cost value is determined.
[0315] It should be noted that the generation value can be the generation value corresponding to the first prediction technique attempted by the current block, the generation value can be the generation value corresponding to a certain transformation cluster attempted by the first prediction technique, the generation value can be the generation value corresponding to a certain transformation kernel attempted by the first prediction technique, or the generation value corresponding to a certain transformation kernel in a certain transformation cluster attempted by the first prediction technique.
[0316] In some embodiments, the cost includes, but is not limited to, one of the following: rate distortion cost (RDO), sum of absolute errors (SAD), sum of transformed absolute errors (SATD), sum of squared differences (SSE), mean absolute difference (MAD), mean absolute error (MAE), mean squared error (MSE), etc.
[0317] It should also be noted that, generally speaking, the scaling operation of the transformed residual coefficients in the encoding process is conventionally called quantization, and the scaling operation of the decoded residual coefficients in the decoding process is conventionally called dequantization. However, in some text descriptions, coefficient scaling, parameter scaling, and quantization operations can all be understood as residual coefficient scaling, i.e., the dequantization operation described in the embodiments of this application.
[0318] In the usual sense, the transformation in the decoding process is called the inverse transformation, but in actual text descriptions, it can also be understood as a transformation, that is, the operation of matrix multiplication between the residual coefficients after inverse quantization and the transformation kernel.
[0319] S1006: Make encoding decisions based on cost value to determine the value of the first syntax element of the current block;
[0320] In some embodiments, the first syntax element is used to indicate that the current block uses a first prediction technique. The decoder determines the first prediction technique used by the current block based on the value of the first syntax element; and determines the first identifier of the current block based on the first prediction technique.
[0321] Accordingly, making encoding decisions based on cost value to determine the value of the first syntax element of the current block may include: making encoding decisions based on cost value to determine that the current block uses a first prediction technique; and determining the value of the first syntax element of the current block based on the determined first prediction technique.
[0322] In some embodiments, the first syntax element is used to indicate the transform cluster index value of the current block.
[0323] Accordingly, making encoding decisions based on cost value to determine the value of the first syntax element of the current block may include: making encoding decisions based on cost value to determine the transform cluster index value of the current block; and determining the value of the first syntax element based on the transform cluster index value of the current block.
[0324] S1007: Encode the first syntax element of the current block and write the resulting encoded bits into the bitstream.
[0325] For example, the first prediction technique is to use intra-frame prediction technique based on neural networks (PNN technique) as an example to illustrate the encoding method provided in the embodiments of this application.
[0326] The encoder iterates through the prediction techniques. If the current prediction mode type is intra-frame mode, the following steps are performed.
[0327] 1. If PNN technology is allowed in the current block (also known as the current coding unit), proceed to step 2; otherwise, skip step 2 and proceed to step 3.
[0328] 2. Try PNN technology on the encoding end:
[0329] 2.1 Obtaining Prediction Blocks and Residual Blocks
[0330] Obtain the reconstructed samples X adjacent to the current block, and preprocess the reconstructed samples X to obtain... Load the corresponding neural network-based intra-frame prediction model based on the width w and height h of the current block, and... The input is fed into the model for inference and computation, resulting in an output vector. For the output vector Post-processing is performed to obtain the predicted block that matches the current block size.
[0331] Predicted blocks The residual block R of the current block is obtained by subtracting the original image block from the original image block.
[0332] 2.2 Obtain the transform kernel and perform transform on the residual block
[0333] Based on the PNN techniques allowed for the current block, a transform cluster bucket of type 1 is selected; and the magnitude values in each direction are obtained on the prediction block using a gradient-based method (DIMD derived prediction mode technique). The intraMode of the current block is obtained based on the magnitude values, and the transform set is selected based on the intraMode. The corresponding transform kernel is selected based on the index (nspt_index / lfnst_index).
[0334] If the current block uses the NSPT transform (corresponding to the first transform), then the obtained NSPT transform kernel is used to perform an inseparable transform on the residual block. This involves setting all residual coefficients in the region of the residual block that is not needed by the current NSPT technique to zero, integrating them into a vector, multiplying it with the NSPT transform kernel, and obtaining the transformed residual coefficients R. final .
[0335] If the current block uses the LFNST transform (corresponding to the second transform), then first perform the horizontal DCT-II and vertical DCT-II one-dimensional master transforms on the residual block to obtain the new residual block R after the transform. DCT-II Based on the residual coefficient region required by LFNST, R... DCT-II The high-frequency coefficient region is set to zero, and the retained coefficient region is integrated into a vector form, which is then multiplied with the LFNST transform kernel to obtain the transformed residual coefficients R. final .
[0336] For the transformed residual coefficients R final Quantization and dequantization are performed. The residual coefficients after dequantization are multiplied by the LFNST transform kernel to obtain the residual coefficients after inverse transform. These residual coefficients are then superimposed on the prediction block and compared with the original image to obtain the rate-distortion cost. PNN .
[0337] 3. The encoding end iterates through untried prediction techniques and calculates the rate-distortion cost (RDOcost) of other prediction techniques.
[0338] 4. Cost of rate distortion PNN If the value is the smallest, the current block will be written into the bitstream using PNN prediction technology to complete the coding unit reconstruction process.
[0339] Otherwise, information from other optimal prediction techniques is written into the bitstream, transmitted to the decoding end, and the current block reconstruction process is completed.
[0340] 5. After traversing all blocks, the bitstream is output after passing through techniques such as loop filtering and entropy coding.
[0341] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG11, a schematic diagram of the composition structure of an encoder provided in an embodiment of this application is shown. As shown in FIG11, the encoder 110 may include a first determining unit 1101, a first processing unit 1102, and an encoding unit 1103; wherein,
[0342] The first determining unit 1101 is configured to determine the transformation cluster of the current block;
[0343] The first determining unit 1101 is also configured to determine the transformation kernel of the current block based on the transformation cluster of the current block;
[0344] The first processing unit 1102 is configured to transform the residual samples of the current block based on the transformation kernel of the current block, determine the transformation coefficients of the current block, quantize the transformation coefficients, and obtain the residual coefficients of the current block.
[0345] The first determining unit 1101 is also configured to perform cost calculation based on the residual coefficient of the current block to determine the cost value;
[0346] The first determining unit 1101 is also configured to make encoding decisions based on cost value to determine the value of the first syntax element of the current block;
[0347] Encoding unit 1103 is configured to encode the first syntax element of the current block and write the resulting encoded bits into the bit stream.
[0348] Understandably, each functional unit of the encoder also performs the encoding method of any of the foregoing embodiments.
[0349] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.
[0350] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0351] Therefore, embodiments of this application provide a computer-readable storage medium applied to an encoder 110, the computer-readable storage medium storing a computer program that, when executed by a first processor, implements the method of any of the foregoing embodiments.
[0352] This application provides a computer-readable storage medium that stores a bitstream generated by an encoding method such as described above.
[0353] Based on the composition of encoder 110 and the computer-readable storage medium, see Figure 12, which illustrates a specific hardware structure diagram of encoder 110 provided in this embodiment. As shown in Figure 12, encoder 110 may include: a first communication interface 1201, a first memory 1202, and a first processor 1203; the various components are coupled together through a first bus system 1204. It is understood that the first bus system 1204 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 1204 in Figure 12.
[0354] The first communication interface 1201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0355] The first memory 1202 is used to store computer programs that can run on the first processor 1203;
[0356] The first processor 1203 is used to execute the following when running computer programs:
[0357] Determine the transformation cluster for the current block;
[0358] Based on the transform cluster of the current block, determine the transform kernel of the current block;
[0359] The transformation coefficients of the current block are determined by transforming the residual samples of the current block based on the transformation kernel of the current block.
[0360] The transformation coefficients are quantized to obtain the residual coefficients of the current block;
[0361] The cost is calculated based on the residual coefficient of the current block to determine the cost value;
[0362] Encoding decisions are made based on cost value to determine the value of the first syntax element of the current block;
[0363] The first syntax element of the current block is encoded, and the resulting encoded bits are written into the bitstream.
[0364] It is understood that the first memory 1202 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1202 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0365] The first processor 1203 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1203 or by instructions in software form. The first processor 1203 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 1202. The first processor 1203 reads the information in the first memory 1202 and completes the steps of the above method in conjunction with its hardware.
[0366] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of this application, or combinations thereof. For software implementation, the technology of this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions of this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0367] Alternatively, as another embodiment, the first processor 1203 is also configured to execute any of the methods in the foregoing embodiments when running a computer program.
[0368] This embodiment provides an encoder in which, when using transform techniques, the optimal transform cluster (such as LFNST or NSPT transform cluster) for the current block is determined. By using the optimal transform cluster, a more accurate transform kernel for the current block can be determined, improving the accuracy of transform prediction, thereby improving the compression efficiency of transform techniques and enhancing coding performance.
[0369] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, referring to FIG13, a schematic diagram of the composition structure of a decoder 130 provided in an embodiment of this application is shown. As shown in FIG13, the decoder 130 may include: a decoding unit 1301, a second determining unit 1302, and a second processing unit 1303; wherein,
[0370] Decoding unit 1301 is configured to parse the first syntax element of the current block in the bitstream;
[0371] The second determining unit 1302 is configured to determine the transformation cluster of the current block based on the value of the first syntax element of the current block;
[0372] The second determining unit 1302 is also configured to determine the transform core of the current block based on the transform cluster of the current block;
[0373] The second processing unit 1303 is configured to perform an inverse transformation on the transformation coefficients of the current block based on the transformation kernel of the current block to obtain the residual sample of the current block;
[0374] The second determining unit 1302 is further configured to determine the reconstruction sample of the current block based on the residual sample and the prediction sample of the current block.
[0375] Understandably, each functional unit of the decoder also performs the decoding method of any of the aforementioned embodiments.
[0376] Based on the composition of the decoder 130 and the computer-readable storage medium, Figure 14 illustrates a schematic diagram of the specific hardware structure of the decoder 130 provided in this embodiment. As shown in Figure 14, the decoder 130 may include: a second communication interface 1401, a second memory 1402, and a second processor 1403; the various components are coupled together through a second bus system 1404. It is understood that the second bus system 1404 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 1404 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 1404 in Figure 14.
[0377] The second communication interface 1401 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0378] The second memory 1402 is used to store computer programs that can run on the second processor 1403;
[0379] The second processor 1403 is used to execute the following when running computer programs:
[0380] Parse the first syntax element of the current block in the bitstream;
[0381] Based on the value of the first syntax element of the current block, determine the transformation cluster of the current block;
[0382] Based on the transform cluster of the current block, determine the transform kernel of the current block;
[0383] Based on the transform kernel of the current block, the transform coefficients of the current block are inversely transformed to obtain the residual sample of the current block;
[0384] Based on the residual samples and prediction samples of the current block, determine the reconstruction samples of the current block.
[0385] Optionally, as another embodiment, the second processor 1403 is also configured to execute the method of any of the foregoing embodiments when running a computer program. It is understood that the second memory 1402 has similar hardware functions to the first memory 1202, and the second processor 1403 has similar hardware functions to the first processor 1203; these will not be described in detail here.
[0386] This embodiment provides a decoder in which, when using transform techniques, the optimal transform cluster (such as LFNST or NSPT transform cluster) for the current block is determined. By using the optimal transform cluster, a more accurate transform kernel for the current block can be determined, improving the accuracy of transform prediction, thereby improving the compression efficiency of transform techniques and enhancing decoding performance.
[0387] In another embodiment of this application, referring to FIG15, a schematic diagram of the composition structure of an encoding / decoding system provided in an embodiment of this application is shown. As shown in FIG15, the encoding / decoding system 150 may include an encoder 1501 and a decoder 1502.
[0388] In this embodiment, encoder 1501 can be any of the encoders in the foregoing embodiments, and decoder 1502 can be any of the decoders in the foregoing embodiments.
[0389] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0390] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0391] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict. The features disclosed in the several product embodiments provided in this application can be arbitrarily combined to obtain new product embodiments without conflict. The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined to obtain new method embodiments or device embodiments without conflict.
[0392] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims. Industrial applicability
[0393] This application provides an encoding / decoding method, encoder, decoder, and storage medium. At both the decoding and encoding ends, the method involves: determining the transform cluster of the current block; determining the transform kernel of the current block based on the transform cluster; performing an inverse transform on the transform coefficients of the current block based on the transform kernel to obtain the residual samples of the current block; and determining the reconstructed samples of the current block based on the residual samples and the predicted samples. Thus, when using transform techniques, the optimal transform cluster (such as LFNST or NSPT transform cluster) for the current block is determined. By using the optimal transform cluster, a more accurate transform kernel for the current block can be determined, improving the accuracy of transform prediction, thereby increasing the compression efficiency of the transform technique and enhancing encoding / decoding performance.
Claims
1. A decoding method applied to a decoder, the method comprising: Parse the first syntax element of the current block in the bitstream; Based on the value of the first syntax element of the current block, determine the transformation cluster of the current block; Based on the transform cluster of the current block, determine the transform kernel of the current block; Based on the transform kernel of the current block, the transform coefficients of the current block are inversely transformed to obtain the residual sample of the current block; Based on the residual samples and prediction samples of the current block, the reconstruction samples of the current block are determined.
2. The method according to claim 1, wherein, The first syntax element is used to instruct the current block to use a first prediction technique.
3. The method according to claim 2, wherein, Determining the transform cluster of the current block based on the value of the first syntax element of the current block includes: Based on the value of the first syntax element of the current block, it is determined that the current block uses the first prediction technique; Based on the first prediction technique, the first identifier of the current block is determined; Based on the first identifier of the current block, the transformation cluster of the current block is determined.
4. The method according to claim 3, wherein, The determination of the first identifier of the current block based on the first prediction technique includes at least one of the following: When the first prediction technique is a first preset prediction technique, the first identifier is determined to be a first value, and the first preset prediction technique includes one or more prediction techniques; When the first prediction technique is a second preset prediction technique, the first identifier is determined to be a second value, and the second preset prediction technique includes one or more prediction techniques; If the first prediction technique is neither the first preset prediction technique nor the second preset prediction technique, then the first identifier is determined to be a third value.
5. The method according to claim 4, wherein, The first preset prediction technique is an intra-frame prediction technique based on neural networks.
6. The method according to claim 3 or 4, wherein, Determining the first identifier of the current block based on the first prediction technique includes: Based on the first prediction technique and the size of the current block, a first identifier of the current block is determined.
7. The method according to claim 6, wherein, The determination of the first identifier of the current block based on the first prediction technique and the size of the current block includes at least one of the following: If the first prediction technique is a first preset prediction technique and the size of the current block meets the first size condition, then the first identifier is determined to be the first value; If the first prediction technique is a first preset prediction technique and the size of the current block does not meet the first size condition, the first identifier is determined to be a third value; If the first prediction technique is the second preset prediction technique, and the size of the current block meets the second size condition, then the first identifier is determined to be the second value; If the first prediction technique is the second preset prediction technique, and the size of the current block does not meet the second size condition, then the first identifier is determined to be the third value.
8. The method according to claim 7, wherein, When the first preset prediction technique is an intra-frame prediction technique based on a neural network, the first size condition includes: the width of the current block is greater than a first preset value, and the height of the current block is greater than a second preset value.
9. The method according to claim 2, wherein, The first syntax element of the current block in the parsed bitstream includes: Under the condition that the preset conditions are met, parse the first syntax element of the current block in the bitstream; The preset conditions include at least one of the following: The first prediction technique is permitted to be used in the current block; The size of the current block satisfies the size constraint of the first prediction technique.
10. The method according to any one of claims 1 to 9, wherein, The method further includes: Determine the candidate transform clusters for the current block, wherein the candidate transform clusters include one or more transform clusters; Based on the value of the first syntax element of the current block, the transformation cluster of the current block is determined from the candidate transformation cluster of the current block.
11. The method according to claim 10, wherein, Determining the candidate transform cluster for the current block includes: Based on the color components of the current block, a candidate transform cluster for the current block is determined.
12. The method according to claim 11, wherein, When the color component of the current block is the first color component, the candidate transform cluster of the current block is the candidate transform cluster to which the first color component belongs; When the color component of the current block is the second color component, the candidate transform cluster of the current block is the candidate transform cluster to which the second color component belongs.
13. The method according to claim 10, wherein, The method further includes: Based on the transformation operations performed on the current block, a candidate transformation cluster for the current block is determined.
14. The method according to claim 13, wherein, When the current block performs the first transformation, the candidate transformation cluster of the current block is the candidate transformation cluster to which the first transformation belongs; When the current block performs the second transformation, the candidate transformation cluster of the current block is the candidate transformation cluster to which the second transformation belongs.
15. The method according to claim 14, wherein, The first transform is the non-separable master transform NSPT, and the second transform is the low-frequency non-separable second transform LFNST.
16. The method according to claim 15, wherein, If the size of the current block satisfies the third size condition, the current block performs the first transformation; If the size of the current block satisfies the fourth size condition, the current block performs the second transformation.
17. The method according to claim 16, wherein, The third size condition includes at least one of the following: The width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is less than or equal to the fifth preset value; The height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is less than or equal to the fifth preset value; The fourth dimensional condition includes at least one of the following: The width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is greater than the fifth preset value; The height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is greater than the fifth preset value; The width and height of the current block are both greater than or equal to the fifth preset value.
18. The method according to claim 1, wherein, The step of determining the transform kernel of the current block based on the transform cluster of the current block includes: Based on the transform cluster of the current block, the second identifier and the third identifier of the current block, the transform kernel of the current block is determined. The second identifier is used to indicate the transform set of the current block, and the third identifier is used to indicate the transform kernel of the current block.
19. The method according to claim 18, wherein, The method of determining the transform kernel of the current block based on the transform cluster of the current block, the second identifier and the third identifier of the current block, includes: Based on the second identifier and the transform cluster of the current block, determine the transform set of the current block; Based on the third identifier and the transform set of the current block, the transform kernel of the current block is determined.
20. The method according to claim 19, wherein, Determining the transform kernel of the current block based on the third identifier and the transform set of the current block includes: Based on the third identifier and the transform set of the current block, determine the transform kernel index value of the current block; The transform kernel of the current block is determined from the first transform set based on the transform kernel index value of the current block.
21. The method according to claim 20, wherein, The first transform set is determined by removing redundancy from the transform kernels in the transform cluster of the current block.
22. The method according to claim 18, wherein, The second identifier is determined based on the intra-prediction mode of the current block.
23. The method according to claim 22, wherein, The intra-prediction mode of the current block is determined by one of the following: Output of an intra-frame prediction model based on neural networks; Derived based on the reference sample of the current block; Derived based on the gradient information of the predicted block of the current block; Set to the preset intra-frame prediction mode.
24. The method according to any one of claims 18 to 20, wherein, The third identifier is determined by one of the following: Obtained by parsing the bitstream; Output of an intra-frame prediction model based on neural networks; It is derived based on the reference sample of the current block.
25. The method according to any one of claims 1 to 24, wherein, The method further includes: Based on the first prediction technique used in the current block, a prediction sample for the current block is determined.
26. The method according to claim 25, wherein, The step of determining the prediction sample for the current block based on the first prediction technique used for the current block includes: When the first prediction technique is an intra-frame prediction technique based on a neural network, a reference sample of the current block is obtained; The reference samples of the current block are preprocessed to obtain the input vector; The input vector is fed into a neural network-based intra-frame prediction model to obtain an output vector; The output vector is post-processed to obtain the predicted sample of the current block.
27. The method according to claim 1, wherein, The method further includes: The residual coefficients of the current block in the parsed bitstream; The residual coefficients of the current block are dequantized to obtain the transform coefficients of the current block.
28. An encoding method applied to an encoder, the method comprising: Determine the transformation cluster for the current block; Based on the transform cluster of the current block, determine the transform kernel of the current block; The residual samples of the current block are transformed based on the transformation kernel of the current block to determine the transformation coefficients of the current block; The transformation coefficients are quantized to obtain the residual coefficients of the current block; The cost is calculated based on the residual coefficient of the current block to determine the cost value; Encoding decisions are made based on the cost value to determine the value of the first syntax element of the current block; The first syntax element of the current block is encoded, and the resulting encoded bits are written into the bitstream.
29. The method according to claim 28, wherein, Determining the transformation cluster of the current block includes: If the current block allows the use of the first prediction technique, a first identifier of the current block is determined based on the first prediction technique; Based on the first identifier of the current block, the transformation cluster of the current block is determined.
30. The method according to claim 29, wherein, Determining the first identifier of the current block based on the first prediction technique includes: When the first prediction technique is a first preset prediction technique, the first identifier is determined to be a first value, and the first preset prediction technique includes one or more prediction techniques; When the first prediction technique is a second preset prediction technique, the first identifier is determined to be a second value, and the second preset prediction technique includes one or more prediction techniques; When the first prediction technique used by the current block is not the first preset prediction technique or the second preset prediction technique, the first identifier is determined to be a third value.
31. The method according to claim 30, wherein, The first preset prediction technique is an intra-frame prediction technique based on neural networks.
32. The method according to claim 29 or 30, wherein, Determining the first identifier of the current block based on the first prediction technique includes: Based on the first prediction technique and the size of the current block, a first identifier of the current block is determined.
33. The method according to claim 32, wherein, The determination of the first identifier of the current block based on the first prediction technique and the size of the current block includes at least one of the following: If the first prediction technique is a first preset prediction technique and the size of the current block meets the first size condition, then the first identifier is determined to be the first value; If the first prediction technique is a first preset prediction technique and the size of the current block does not meet the first size condition, the first identifier is determined to be a third value; If the first prediction technique is the second preset prediction technique, and the size of the current block meets the second size condition, then the first identifier is determined to be the second value; If the first prediction technique is the second preset prediction technique, and the size of the current block does not meet the second size condition, then the first identifier is determined to be the third value.
34. The method according to claim 33, wherein, When the first preset prediction technique is an intra-frame prediction technique based on a neural network, the first size condition includes: the width of the current block is greater than a first preset value, and the height of the current block is greater than a second preset value.
35. The method according to claim 29, wherein, The method further includes: When the preset conditions are met, it is determined that the current block is allowed to use the first prediction technique; The preset conditions include at least one of the following: The first prediction technique is permitted to be used in the current block; The size of the current block satisfies the size constraint of the first prediction technique.
36. The method according to any one of claims 28 to 35, wherein, The first syntax element is used to instruct the current block to use a first prediction technique.
37. The method according to any one of claims 28 to 36, wherein, The method further includes: Determine the candidate transform clusters for the current block, wherein the candidate transform clusters include one or more transform clusters; The transformation cluster of the current block is determined from the candidate transformation cluster of the current block.
38. The method according to claim 37, wherein, Determining the candidate transform cluster for the current block includes: Based on the color components of the current block, a candidate transform cluster for the current block is determined.
39. The method according to claim 38, wherein, When the color component of the current block is the first color component, the candidate transform cluster of the current block is the candidate transform cluster to which the first color component belongs; When the color component of the current block is the second color component, the candidate transform cluster of the current block is the candidate transform cluster to which the second color component belongs.
40. The method of claim 37, wherein, Determining the candidate transform cluster for the current block includes: Based on the transformation operations performed on the current block, a candidate transformation cluster for the current block is determined.
41. The method according to claim 40, wherein, When the current block performs the first transformation, the candidate transformation cluster of the current block is the candidate transformation cluster to which the first transformation belongs; When the current block performs the second transformation, the candidate transformation cluster of the current block is the candidate transformation cluster to which the second transformation belongs.
42. The method according to claim 41, wherein, The first transformation is the non-separable master transformation NSPT, and the second transformation is the low-frequency non-separable quadratic transformation method LFNST.
43. The method according to claim 42, wherein, If the size of the current block satisfies the third size condition, the current block performs the first transformation; If the size of the current block satisfies the fourth size condition, the current block performs the second transformation.
44. The method according to claim 43, wherein, The third size condition includes at least one of the following: The width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is less than or equal to the fifth preset value; The height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is less than or equal to the fifth preset value; The fourth dimensional condition includes at least one of the following: The width of the current block is equal to the third preset value or the fourth preset value, and the height of the current block is greater than the fifth preset value; The height of the current block is equal to the third preset value or the fourth preset value, and the width of the current block is greater than the fifth preset value; The width and height of the current block are both greater than or equal to the fifth preset value.
45. The method according to claim 28, wherein, The step of determining the transform kernel of the current block based on the transform cluster of the current block includes: Based on the transform cluster of the current block and the second identifier of the current block, the transform set of the current block is determined, wherein the second identifier is used to indicate the transform set of the current block; Based on the transform set of the current block, determine the transform kernel of the current block.
46. The method according to claim 45, wherein, Determining the transform kernel of the current block based on the transform set of the current block includes: Determine the third identifier of the current block; Based on the third identifier and the transform set of the current block, the transform kernel of the current block is determined.
47. The method according to claim 46, wherein, Determining the transform kernel of the current block based on the third identifier and the transform set of the current block includes: Based on the third identifier and the transform set of the current block, determine the transform kernel index value of the current block; The transform kernel of the current block is determined from the first transform set based on the transform kernel index value of the current block.
48. The method according to claim 47, wherein, The first transform set is determined by removing redundancy from the transform kernels in the transform cluster of the current block.
49. The method according to claim 46 or 47, wherein, The third identifier is determined by one of the following: Output of an intra-frame prediction model based on neural networks; It is derived based on the reference sample of the current block.
50. The method of claim 45, wherein, Determining the transform kernel of the current block based on the transform set of the current block includes: Traverse the transform set of the current block to determine the transform kernel of the current block; The method further includes: making an encoding decision based on the cost value to determine a third identifier for the current block; The determined third identifier is encoded, and the resulting encoded bits are written into the bitstream.
51. The method according to claim 45, wherein, The second identifier is determined based on the intra-prediction mode of the current block.
52. The method according to claim 51, wherein, The intra-prediction mode of the current block is determined by one of the following: Output of an intra-frame prediction model based on neural networks; Derived based on the reference sample of the current block; Derived based on the gradient information of the predicted block of the current block; Set to the preset intra-frame prediction mode.
53. The method according to any one of claims 28 to 52, wherein, The method further includes: Based on the first prediction technique allowed for the current block, a prediction sample for the current block is determined; Based on the original samples and predicted samples of the current block, the residual samples of the current block are determined.
54. The method according to claim 53, wherein, The step of determining the prediction sample for the current block based on the first prediction technique allowed for the current block includes: When the first prediction technique is an intra-frame prediction technique based on a neural network, a reference sample of the current block is obtained; The reference samples of the current block are preprocessed to obtain the input vector; The input vector is fed into a neural network-based intra-frame prediction model to obtain an output vector; The output vector is post-processed to obtain the predicted sample of the current block.
55. The method according to claim 28, wherein, The method further includes: The residual coefficients of the current block are encoded, and the resulting encoded bits are written into the bitstream.
56. The method according to claim 28, wherein, The cost calculation based on the residual coefficient of the current block to determine the cost value includes: The residual coefficients of the current block are inversely quantized and inversely transformed to determine the residual sample after the inverse transformation of the current block; Based on the residual samples and predicted samples after the inverse transformation of the current block, the reconstructed samples of the current block are determined; The cost value is determined based on the reconstructed sample and the original sample of the current block.
57. An encoder, comprising a first determining unit, a first processing unit, and an encoding unit; wherein: The first determining unit is configured to determine the transformation cluster of the current block; The first determining unit is further configured to determine the transformation kernel of the current block based on the transformation cluster of the current block; The first processing unit is configured to transform the residual samples of the current block based on the transform kernel of the current block, determine the transform coefficients of the current block, quantize the transform coefficients, and obtain the residual coefficients of the current block. The first determining unit is further configured to perform cost calculation based on the residual coefficient of the current block to determine the cost value; The first determining unit is further configured to make an encoding decision based on the cost value and determine the value of the first syntax element of the current block; The encoding unit is configured to encode the first syntax element of the current block and write the resulting encoded bits into the bitstream.
58. An encoder, comprising a first memory and a first processor; wherein: The first memory is used to store computer programs that can run on the first processor; The first processor is configured to perform the method as described in any one of claims 28 to 56 when running the computer program.
59. A decoder, comprising a decoding unit, a second determining unit, and a second processing unit; wherein: The decoding unit is configured to parse the first syntax element of the current block in the bitstream; The second determining unit is configured to determine the transformation cluster of the current block based on the value of the first syntax element of the current block; The second determining unit is further configured to determine the transform kernel of the current block based on the transform cluster of the current block; The second processing unit is configured to perform an inverse transformation on the transformation coefficients of the current block based on the transformation kernel of the current block to obtain the residual sample of the current block; The second determining unit is further configured to determine the reconstructed sample of the current block based on the residual sample and the predicted sample of the current block.
60. A decoder, comprising a second memory and a second processor; wherein: The second memory is used to store computer programs that can run on the second processor; The second processor is configured to perform the method as described in any one of claims 1 to 27 when running the computer program.
61. A computer-readable storage medium, wherein, The computer-readable storage medium stores the bitstream generated by the encoding method as described in any one of claims 28 to 56.
62. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 27, or the method as described in any one of claims 28 to 56.
Citation Information
Patent Citations
Encoder, decoder and corresponding methods harmonzting matrix-based intra prediction and secoundary transform core selection
CN113632488A
Skin Cleansing Cosmetic composition for Gommage Peeling
KR1020210108213A
Video signal processing method and apparatus using multiple transform kernel
US20210321136A1
Decoding method, encoding method, decoder, and encoder
WO2024007116A1
Image encoding / decoding method and device, and recording medium storing bitstream
WO2024123148A1