Encoding method, decoding method, encoder, decoder, code stream, and storage medium
Patent Information
- Application Number
- CA3317358
- Authority / Receiving Office
- CA · CA
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-09
- Filing Date
- 2024-01-16
- Publication Date
- 2026-08-05
Abstract
Description
ENCODING METHOD, DECODING METHOD, ENCODER, DECODER, CODE STREAM, AND STORAGE MEDIUM
[0001] This application claims priority to Chinese Patent Application No. PCT / CN2024 / 071312, filed with the China National Intellectual Property Administration on January 9, 2024, and entitled "ENCODING METHOD, DECODING METHOD, ENCODER, DECODER, CODE STREAM, AND STORAGE MEDIUM", the disclosure of which is hereby incorporated by reference in its entirety. TECHNICAL FIELD
[0002] The disclosure relates to the technical field of video coding, and in particular to, an encoding method, a decoding method, an encoder, a decoder, a bitstream and a storage medium. BACKGROUND
[0003] Redundant information of residual information can be removed by a transform operation to improve compression performance of a video. A non-separable transform operation is an important transform operation. However, current encoding and decoding manners for the non-separable transform operation are sometimes unreasonable and may degrade the encoding and decoding performance. SUMMARY
[0004] The disclosure provides an encoding method, a decoding method, an encoder, a decoder, a bitstream and a storage medium. Various aspects of the disclosure are described below.
[0005] In a first aspect, there is provided a decoding method, applied to a decoder. The decoding method includes: determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block; determining neighbouring information of the current transform block according to the first information; and determining a coefficient of the current transform block according to the neighbouring information.
[0006] In a second aspect, there is provided an encoding method, applied to an encoder. The encoding method includes: determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block; determining neighbouring information of the current transform block according to the first information; and encoding a coefficient of the current transform block according to the neighbouring information.
[0007] In a third aspect, there is provided a decoder, including: a first determining unit, configured to determine first information, the first information being used for indicating whether non-separable transform is used for a current transform block; a second determining unit, configured to determine neighbouring information of the current transform block according to the first information; and a third determining unit, configured to determine a coefficient of the current transform block according to the neighbouring information.
[0008] In a fourth aspect, there is provided a decoder, including: a memory for storing a computer program, and a processor configured to perform the method of the first aspect while running the computer program.
[0009] In a fifth aspect, there is provided an encoder, including: a first determining unit, configured to determine first information, the first information being used for indicating whether non-separable transform is used for a current transform block; a second determining unit, configured to determine neighbouring information of the current transform block according to the first information; and an encoding unit, configured to encode a coefficient of the current transform block according to the neighbouring information.
[0010] In a sixth aspect, there is provided an encoder, including: a memory for storing a computer program, and a processor configured to perform the method of the second aspect while running the computer program.
[0011] In a seventh aspect, there is provided a computer storage medium having stored thereon a computer program that, when executed, performs the method of the first aspect or the second aspect.
[0012] In an eighth aspect, there is provided a computer program product including a computer program that, when executed, performs the method of the first aspect or the second aspect.
[0013] In a ninth aspect, there is provided a non-volatile computer-readable storage medium storing a bitstream generated using an encoder by an encoding method of the second aspect, or decoded using a decoder by a decoding method of the first aspect.
[0014] In a tenth aspect, there is provided a computer storage medium having stored thereon a computer program that, when executed, performs the method of the first aspect or the second aspect.
[0015] In an eleventh aspect, there is provided a bitstream including a bitstream generated according to the method of the second aspect.
[0016] In the embodiments of the disclosure, identification information at the transform block level (that is, the first information mentioned above) is introduced to indicate whether the non- separable transform is used. Compared with the identification information at the coding block level in the related art, the identification information at the transform block level facilitates selecting appropriate neighbouring information, thereby contributing to improving the encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] FIG. 1 is an exemplary structural diagram of a video encoder to which an embodiment of the disclosure is applicable.
[0018] FIG. 2 is an exemplary structural diagram of a video decoder to which an embodiment of the disclosure is applicable.
[0019] FIG. 3 is an exemplary diagram of LFNST transform and inverse transform processes.
[0020] FIG. 4 is an exemplary diagram of two kinds of neighbouring information.
[0021] FIG. 5 is a schematic flowchart of a decoding method according to an embodiment of the disclosure.
[0022] FIG. 6 is a schematic flowchart of an encoding method according to an embodiment of the disclosure.
[0023] FIG. 7 is a schematic flowchart for determining neighbouring information according to an embodiment of the disclosure.
[0024] FIG. 8 is another schematic flowchart for determining neighbouring information according to an embodiment of the disclosure.
[0025] FIG. 9 is another schematic flowchart for determining neighbouring information according to an embodiment of the disclosure.
[0026] FIG. 10 is another schematic flowchart for determining neighbouring information according to an embodiment of the disclosure.
[0027] FIG. 11 is a schematic diagram for determining a histogram of gradient according to an embodiment of the disclosure.
[0028] FIG. 12 is a schematic structural diagram of a decoder according to an embodiment of the disclosure.
[0029] FIG. 13 is a schematic structural diagram of a decoder according to another embodiment of the disclosure.
[0030] FIG. 14 is a schematic structural diagram of an encoder according to an embodiment of the disclosure.
[0031] FIG. 15 is a schematic structural diagram of an encoder according to another embodiment of the disclosure. DETAILED DESCRIPTION
[0032] Hereinafter, technical solutions in the disclosure will be described with reference to the accompanying drawings.
[0033] FIG. 1 is a schematic block diagram of a video encoder involved in embodiments of the disclosure.
[0034] It is to be understood that the video encoder 100 may be used for lossy compression of a picture as well as for lossless compression of the picture. The lossless compression may be visually lossless compression or mathematically lossless compression.
[0035] The video encoder 100 may be applied to picture data in a luma-chroma (YCbCr, YUV) format. For example, the YUV ratio may be 4:2:0, 4:2:2, or 4:4:4, where Y represents luma, Cb (U) represents blue chroma, Cr (V) represents red chroma, and U and V represent chroma for describing colour and saturation. For example, in the colour format, 4:2:0 indicates that there are 4 luma components and 2 chroma components (YYYYCbCr) per 4 pixels; 4:2:2 indicates that there are 4 luma components and 4 chroma components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 indicates full-pixel display (YYYYCbCrCbCrCbCrCbCr).
[0036] For example, the video encoder 100 reads video data, and partitions each picture in the video data into several Coding Tree Units (CTUs). and in some examples, the CTU may be referred to as a "tree block", a "Largest coding unit" (LCU), or a "Coding Tree Block" (CTB). Each CTU may be associated with a sample block having a same size within the picture. Each sample may correspond to one luma (or luminance) sample and two chroma (or chrominance) samples. Thus, each CTU may be associated with one luma sample block and two chroma sample blocks. The size of one CTU is, for example, 128×128, 64×64, 32×32, or the like. One CTU may be further partitioned into several Coding Units (CUs) for coding, which may be rectangular or square blocks. The CU may correspond to a Prediction Unit (PU) and a Transform Unit (TU).
[0037] In some embodiments, as shown in FIG. 1, the video encoder 100 may include a prediction module 110, a residual module 120, a transform / quantization module 130, an inverse transform / quantization module 140, a reconstruction module 150, a in-loop filtering module 160, a decoded picture buffer 170, and an entropy encoding module 180. It is to be noted that the video encoder 100 may include more, fewer, or different functional components.
[0038] Optionally, in the disclosure, the current block may be referred to as a current Coding Unit (CU). The prediction block may also be referred to as a prediction picture block or a picture prediction block, and a reconstructed picture block may also be referred to as a reconstructed block or a picture-reconstruction block. Due to the need for parallel processing, the picture may be partitioned into slices. Slices in the same picture may be processed in parallel, that is, there is no data dependency between them. The term "frame" is a commonly used term, and as generally understood, one frame is one picture. The frames described herein may also be replaced with pictures or slices, or the like.
[0039] In some embodiments, the prediction module 110 includes an inter prediction module 111 and an intra prediction module 112. Because there is a strong correlation between neighbouring samples in one picture of a video, the intra prediction method is used to eliminate spatial redundancy between neighbouring samples in the video encoding and decoding technology. Because of the strong similarity between neighbouring pictures in the video, the inter- prediction method is used to eliminate temporal redundancy between neighbouring pictures in the video encoding and decoding technology, thus improving the coding efficiency.
[0040] The inter prediction module 111 may be used for inter prediction, which may include motion estimation and motion compensation. Picture information of different pictures may be referred to. In inter prediction, motion information is used to find a reference block from a reference picture, and a prediction block is generated according to the reference block, so as to eliminate temporal redundancy. The motion information includes a reference picture list where the reference picture is located, a reference picture index, and a motion vector. The motion vector may be of an integer sample or a fractional sample. If the motion vector is of a fractional sample, interpolation filtering is required to be performed in a reference picture to generate a required fractional sample block. Herein, an integer sample block or a fractional sample block found in a reference picture according to a motion vector is referred to as a reference block. In some technologies, the reference block is directly used as a prediction block, and in some technologies, the reference block is further processed to generate the prediction block. Generating the prediction block by processing the reference block can also be understood as treating the reference block as an prediction block, and then further processing the prediction block to generate a new prediction block.
[0041] The intra prediction module 112 predicts sample information within a current picture block by referencing only information of the same picture, so as to eliminate spatial redundancy.
[0042] There are many prediction modes for intra prediction. Taking the H-series of international digital video coding standards as an example, the H.264 / AVC standard includes 8 angular prediction modes and 1 non-angular prediction mode, and the H.265 / HEVC standard is extended to include 33 angular prediction modes and 2 non-angular prediction modes. The intra prediction modes used by High Efficiency Video Coding (HEVC) include Planar mode (Planar), DC mode (DC) and 33 angular modes, with a total of 35 prediction modes. The intra modes used by Versatile Video Coding (VVC) are Planar, DC and 65 angular modes, with 67 prediction modes in total.
[0043] It is to be noted that as the number of angular modes increases, intra prediction becomes more accurate, which complies better with the development demands of high-definition and ultra-high-definition digital videos.
[0044] The residual module 120 may generate a residual block of the CU based on the sample block of the CU and the prediction block of the CU. For example, the residual module 120 may generate a residual block of the CU such that each sample in the residual block has a value equal to a difference between a sample in the sample block of the CU and a corresponding sample in the prediction block of the CU.
[0045] The transform / quantization module 130 may quantize the transform coefficients. The transform / quantization module 130 may quantize transform coefficients associated with the CU based on Quantization Parameter (QP) values associated with the CU. The video encoder 100 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP values associated with the CU.
[0046] The inverse transform / quantization module 140 may apply inverse quantization and inverse transform to the quantized transform coefficients, respectively, to reconstruct a residual block from the quantized transform coefficients.
[0047] The reconstruction module 150 may add samples of the reconstructed residual blocks to corresponding samples of one or more prediction blocks generated by the prediction module 110 to produce a reconstructed picture block associated with the CU. By reconstructing each sample block of the CU in this manner, the video encoder 100 may reconstruct the sample block of the CU.
[0048] The in-loop filtering module 160 is used for processing the samples subjected to inverse transform and inverse quantization, compensating for distortion information, and providing a better reference for subsequent coding samples. For example, a deblocking filtering operation may be performed to reduce blocking artifacts of a sample block associated with a CU.
[0049] In some embodiments, the in-loop filtering module 160 includes a deblocking filtering module and a Sample Adaptive Offset / Adaptive Loop Filtering (SAO / ALF) module, where the deblocking filtering module is used to deblock the blocking artifacts and the SAO / ALF module is used to remove ringing artifacts.
[0050] The decoded picture buffer 170 may store the reconstructed sample block. The inter- prediction module 111 may perform inter prediction on PUs of other pictures using the reference picture containing the reconstructed sample block. In addition, the intra prediction module 112 may use the reconstructed sample block in the decoded picture buffer 170 to perform intra prediction on other PUs in the same picture as the CU.
[0051] The entropy coding module 180 may receive the quantized transform coefficients from the transform / quantization module 130. The entropy coding module 180 may perform one or more entropy coding operations on the quantized transform coefficients to generate entropy coded data.
[0052] FIG. 2 is a schematic block diagram of a video decoder involved in embodiments of the disclosure.
[0053] As shown in FIG. 2, the video decoder 200 includes an entropy decoding module 210, a prediction module 220, an inverse quantization / transform module 230, a reconstruction module 240, an in-loop filtering module 250, and a decoded picture buffer 260. It is to be noted that the video decoder 200 may include more, fewer, or different functional components.
[0054] The video decoder 200 may receive a bitstream. The entropy decoding module 210 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding module 210 may parse entropy-encoded syntax elements in the bitstream. The prediction module 220, the inverse quantization / transform module 230, the reconstruction module 240 and the in-loop filtering module 250 may decode the video data according to the syntax elements extracted from the bitstream, i.e., generate decoded video data.
[0055] In some embodiments, the prediction module 220 includes an intra prediction module 222 and an inter prediction module 221.
[0056] The intra prediction module 222 may perform intra prediction to generate a prediction block of a PU. The intra prediction module 222 may use an intra prediction mode to generate a prediction block of the PU based on a sample block of a spatially neighbouring PU. The intra prediction module 222 may also determine the intra prediction mode of the PU based on one or more syntax elements parsed from the bitstream.
[0057] The inter prediction module 221 may construct a first reference picture list (List 0) and a second reference picture list (List 1) according to syntax elements parsed from the bitstream. Further, if the PU uses inter prediction coding, the entropy decoding module 210 may parse motion information of the PU. The inter prediction module 221 may determine one or more reference blocks of the PU according to the motion information of the PU. The inter prediction module 221 may generate a prediction block of the PU according to one or more reference blocks of the PU.
[0058] The inverse quantization / transform module 230 reversibly quantizes (i.e., de-quantizes) transform coefficients associated with a TU. The inverse quantization / transform module 230 may use a QP value associated with a CU of the TU to determine a degree of quantization.
[0059] After inversely quantizing the transform coefficients, the inverse quantization / transform module 230 may apply one or more inverse transforms to the inversely quantized transform coefficients to generate a residual block associated with the TU.
[0060] The reconstruction module 240 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct a sample block of the CU. For example, the reconstruction module 240 may add a sample of the residual block to a corresponding sample of the prediction block to reconstruct the sample block of the CU, resulting in a reconstructed picture block.
[0061] The in-loop filtering module 250 may perform an deblocking filtering operation to reduce blocking artifacts of a sample block associated with a CU.
[0062] The video decoder 200 may store the reconstructed picture of the CU in the decoded picture buffer 260. The video decoder 200 may use the reconstructed picture in the decoded picture buffer 260 as a reference picture for subsequent prediction, or transmit the reconstructed picture to a display device for presentation.
[0063] The basic flow of video encoding and decoding is as follows: at the encoding end, one picture is partitioned into blocks, and for a current block, the prediction module 110 generates a prediction block of the current block using intra prediction or inter prediction. The residual module 120 may calculate a residual block, i.e. a difference between a prediction block and an original block of the current block, based on the prediction block and the original block of the current block. The residual block may also be referred to as residual information. The residual block can be transformed and quantized by the transform / quantization module 130, and information that is insensitive to the human eye can be removed to eliminate visual redundancy. Optionally, a residual block before being transformed and quantized by the transform / quantization module 130 may be referred to as a time-domain residual block, and a time-domain residual block after being transformed and quantized by the transform / quantization module 130 may be referred to as a frequency residual block or a frequency-domain residual block. The entropy encoding module 180 receives quantized transform coefficients output by the transform / quantization module 130, entropy encodes the quantized transform coefficients, and outputs a bitstream. For example, the entropy encoding module 180 may eliminate character redundancy according to a target context model and probability information of the binary bitstream.
[0064] At the decoding end, the entropy decoding module 210 can parse the bitstream to obtain prediction information, a quantization coefficient matrix and the like of the current block, and the prediction module 220 generates a prediction block of the current block by using intra prediction or inter prediction for the current block based on the prediction information. The inverse quantization / transform module 230 performs inverse quantization and inverse transform on a quantization coefficient matrix obtained from the bitstream to obtain a residual block. The reconstruction module 240 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed picture, and the in-loop filtering module 250 performs in-loop filtering on the reconstructed picture based on the picture or based on the block to obtain a decoded picture. The encoding end also needs to perform operations similar to those of the decoding end to obtain a decoded picture. The decoded picture may also be referred to as a reconstructed picture, and the reconstructed picture may serve as a reference picture for a subsequent picture for inter-prediction.
[0065] It is to be noted that the block partition information determined by the encoding end, and mode information or parameter information relating to prediction, transform, quantization, entropy coding and in-loop filtering, are carried in the bitstream when necessary. The decoding end, by parsing the bitstream and analyzing based on available information, determines the same block partition information and mode information or parameter information relating to prediction, transform, quantization, entropy coding and in-loop filtering as the encoding end, thereby ensuring that the decoded picture obtained at the encoding end is identical to that obtained at the decoding end.
[0066] It is to be understood that the "inverse transform" of the transform coefficients by the decoding end may also be referred to as a "transform" in the text of the standard. "Transform" and "inverse transform" in the embodiments of the disclosure correspond to two opposite processes. For example, "transform" converts a numerical value in the spatial domain to a coefficient in the frequency domain, and "inverse transform" converts a coefficient in the frequency domain to a numerical value in the spatial domain. If the standard only specifies decoding, then "transform" in the text of the standard is a part of decoding and refers to the "inverse transform" in the present disclosure. The "inverse transform" of the transform coefficients by the decoding end may also be referred to as a "transform" in the text of the standard.
[0067] The above is the basic workflow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or workflow may be optimized. The present disclosure is applicable to the basic workflow of the video codec under the block-based hybrid coding framework, but is not limited to the framework and workflow.
[0068] The encoding and decoding framework provided in the embodiments of the present disclosure has been described in detail above. The disclosure relates to the transform technology The transform technology can be applied to the transform / inverse transform module in the encoding and decoding framework The transform technology involved in the present disclosure is introduced below.
[0069] Dual tree (DT) partition
[0070] As can be seen from the foregoing, the encoder and decoder in the embodiments of the disclosure can be applied to picture data in a luma-chroma (YCbCr, YUV) format. Typically, there is a significant difference between picture details contained in the luma component and the chroma component. The luma component possesses a large amount of detail information, whereas the chroma component carries less information and appears relatively smooth. Therefore, the luma component is more suitable for being partitioned into smaller blocks in most cases to represent more details; conversely, the chroma component does not require fine partitioning in most cases.
[0071] In the Versatile Video Coding (VVC) standard, a partitioning technology with different partitions for a luma component and a chroma component is adopted, namely, a Dual Tree (DT) partitioning technology. The DT partitioning technology is applied to intra-coded pictures. For intra-coded pictures, different partition schemes may be used for the luma component and the chroma component. Starting from each coding tree unit, the luma component uses a luma partitioning tree, and the chroma component uses a chroma partitioning tree. Since the luma component and the chroma component have their respective coding tree units, the luma component and the chroma component also have their respective coding units.
[0072] For an inter-coded picture or a coded picture to which the DT partition scheme is not applicable, the luma component and the chroma component do not use different partition trees, and one coding unit includes a luma block and a chroma block.
[0073] Karhunen-Loève (K-L) transform
[0074] The K-L transform is named after Kari Karhunen and Michel Loève. The K-L transform is an orthogonal transform of an input vector X, so that an output vector can remove the correlation of the data.
[0075] The K-L transform is a transform established based on statistical characteristics, and is the optimal transform in terms of mean square error (MSE). Therefore, it occupies an important position in data compression technology.
[0076] Although the K-L transform is the optimal transform in terms of MSE, the input signal must be known in advance, and a series of cumbersome mathematical operations, such as the computation of covariance and eigenvectors, are required. Therefore, the K-L transform is not widely used in practical engineering. Nevertheless, the K-L transform is theoretically the optimal method; therefore, when searching for transform methods that are sub-optimal but easier to implement, the K-L transform can provide an evaluation criterion for assessing transform performance.
[0077] Taking image processing as an example, in the K-L transform, the energy of an image becomes concentrated, thereby contributing to image compression. However, in practice, the K- L transform is input-dependent, which means that a transform mechanism needs to be stored for each input picture, and the transform mechanism varies from picture to picture. This is impractical for practical applications.
[0078] Non-separable transform
[0079] The non-separable transform refers to a two-dimensional transform that cannot be decomposed into two one-dimensional transforms in the horizontal and vertical directions. The non-separable transform in the disclosure may include Low-Frequency Non-Separable Transform (LFNST) and Non-Separable Primary Transform (NSPT). These two transform manners are described below.
[0080] The LFNST is a transform based on the principle of K-L transform. Due to complexity considerations in VVC, the LFNST is applied to the transform coefficients after the primary transform, and is therefore referred to as a secondary transform. The LFNST may act on the low- frequency coefficients after the primary transform to remove redundant information in the low- frequency coefficients. The primary transform may be, for example, a Discrete Cosine Transform Type-II (DCT-II) transform, and this transform manner may also be referred to as a DCT-II + LFNST transform. In some implementations, the primary transform may also be referred to as a main transform.
[0081] In VCC, the LFNST can have two different sized transform kernels. One is a transform kernel with 64-coefficient input and 16-coefficient output, and the other is a transform kernel with 16-coefficient input and 8-coefficient output. Transform kernels of different sizes may be adapted to transform blocks of different sizes. For example, a transform kernel with a 64- coefficient input is suitable for transform blocks of size greater than or equal to 8×8, and a transform kernel with a 16-coefficient input is suitable for transform blocks of other sizes, such as 4×4. The 64-coefficient input transform kernel may also be referred to as a large-size transform kernel, and the 16-coefficient input transform kernel may also be referred to as a small- size transform kernel.
[0082] Hereinafter, the transform and inverse transform flows of the LFNST will be described with reference to FIG. 3.
[0083] At the encoding end, the residual information may be transformed using a forward primary transform and the LFNST. For example, the forward primary transform may be performed on the residual information to obtain a first coefficient, and then the first coefficient is transformed using the LFNST to obtain a transformed coefficient. When the LFNST is used, 64 coefficients in the top-left 8×8 region may be taken as the input for the large-size transform kernel, or the 16 coefficients in the top-left <semantics>4×4<annotation encoding="application / x-tex">4\times4< / annotation>< / semantics> region may be taken as the input for the small- size transform kernel, with the remaining regions being set with all-zero coefficients by default. After being processed by the transform kernel, transformed coefficients are generated, and the transformed coefficients are then quantized to yield coefficients of transform blocks. The transformed coefficients are signalled in the bitstream. Similarly, at the decoding side, the coefficients of the transform block can be obtained by parsing the bitstream, the coefficients of the transform block can be inversely quantized to obtain the transformed coefficients, and then the inverse LFNST and the inverse primary transform are performed on the transformed coefficients to obtain the residual information. When the inverse LFNST is performed, 16 positions in a top-left 4×4 region may include an output of the large-size inverse transform kernel, or the first 8 positions in a top-left scanning order may include an output of the small-size inverse transform kernel, and the coefficients at the other positions are 0 by default.
[0084] In VCC, the selection of the transform kernel for the LFNST depends not only on the size of the transform block, but also on an intra prediction mode used during prediction of the transform block and an LFNST index parsed from the bitstream. In the implementation process, the LFNST transform coefficients exist in a multi-dimensional array g_lfnstMxN[][][][]. Specifically, the first dimension is an index associated with the intra prediction mode, the second dimension is a transform kernel index parsed from the bitstream, and the third and fourth dimensions are transform coefficients.
[0085] Table 1 shows correspondences between intra prediction modes and related indexes. Table 1 [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document]
[0086] In Table 1, IntraPredMode is an intra prediction mode, Tr. set index is an index related to the intra prediction mode. When the intra prediction mode is less than 0, the related index is 1; when the intra prediction mode is greater than or equal to 0 and less than or equal to 1, the related index is 0; when the intra prediction mode is greater than or equal to 2 and less than or equal to 12, the related index is 1; when the intra prediction mode is greater than or equal to 13 and less than or equal to 23, the related index is 2; when the intra prediction mode is greater than or equal to 24 and less than or equal to 44, the related index is 3; when the intra prediction mode is greater than or equal to 45 and less than or equal to 55, the related index is 2; when the intra prediction mode is greater than or equal to 56 and less than or equal to 80, the related index is 1; when the intra prediction mode is greater than or equal to 81 and less than or equal to 83, the related index is 0.
[0087] In the Enhanced Compression Model (ECM), some enhancement technologies for LFNST and NSPT technologies are adopted.
[0088] Compared to the LFNST technique in VCC, the LFNST enhancement technique includes more transform kernel sizes and finer transform kernel set partitioning. For transform kernel sizes, transform kernels of different sizes may be used for transform blocks greater than or equal to <semantics>16×16<annotation encoding="application / x-tex">16\times16< / annotation>< / semantics>, transform blocks greater than or equal to <semantics>8×8<annotation encoding="application / x-tex">8\times8< / annotation>< / semantics> and less than <semantics>16×16<annotation encoding="application / x-tex">16\times16< / annotation>< / semantics>, and transform blocks greater than or equal to <semantics>4×4<annotation encoding="application / x-tex">4\times4< / annotation>< / semantics> and less than <semantics>8×8<annotation encoding="application / x-tex">8\times8< / annotation>< / semantics>. Regarding the partitioning of the transform kernel sets, the transform kernels can be divided into 35 sets according to the intra prediction modes; furthermore, based on the transform kernel indexes parsed from the bitstream, the transform kernels can be divided into 3 sets.
[0089] The transform principle of the NSPT technique is similar to that of the LFNST technique. The NSPT replaces the original transform manner that uses DCT-II as a primary transform and LFNST as a secondary transform; instead, the NSPT directly utilizes the NSPT primary transform coefficients obtained on a set-by-set basis to perform transform and inverse transform on the residual. In ECM-11.0, the NSPT technique may be applicable to a transform block having a size of 4x4, 4x8, 4x16, 4x32, 8x4, 8x8, 8x16, 8x32, 16x4, 16x8, 32x4, 32x8. The NSPT technique and the LFNST technique have the same set classification and the same number of input and output coefficients. For a transform block size applicable to the NSPT, the NSPT transform coefficients may be directly acquired based on parsed LFNST flags and indexes, so as to replace the original DCT-II + LFNST transform.
[0090] Whether the LFNST or NSPT is used may be indicated by an LFNST Identifier (ID). The LFNST ID may be represented by, for example, cu.lfnstIdx or lfnstIdx. The LFNST ID may be an ID at a coding unit level.
[0091] Taking the LFNST as an example, if the LFNST ID indicates that LFNST is used, the transform coefficient is obtained after undergoing the primary transform and the LFNST. If the LFNST ID indicates that the LFNST is not used, the transform coefficient is obtained after only undergoing the primary transform. At the encoding end, if the LFNST is used, the transform and quantization module can perform primary transform on the residual information first, and then perform the LFNST, so as to obtain transform coefficients, and after being quantized, the transform coefficients are represented by corresponding IDs, and signalled into the bitstream. At the decoding end, the decoder can obtain the LFNST IDs and the corresponding IDs by parsing the bitstream, and first construct the quantized coefficients. The quantized coefficients undergo inverse quantization to obtain transform coefficients. If the LFNST IDs indicates that LFNST is used, the decoder may first perform inverse LFNST on the transform coefficients, and then perform primary inverse transform, thereby obtaining reconstructed residual information. If the LFNST IDs indicate that the LFNST is not used, the decoder may perform primary inverse transform on the transform coefficients to obtain the reconstructed residual information.
[0092] Taking the NSPT as an example, if the LFNST ID indicates that NSPT is used, the transform coefficient is obtained after undergoing the NSPT. If the LFNST ID indicates that the NSPT is not used, the transform coefficient is obtained after only undergoing the primary transform. At the encoding end, if the NSPT is used, the transform and quantization module can perform the NSPT on the residual information first so as to obtain transform coefficients, and after being quantized, the transform coefficients are represented by corresponding IDs, and signalled into the bitstream. At the decoding end, the decoder can obtain the LFNST IDs and the corresponding IDs by parsing the bitstream, and first construct the quantized coefficients. The quantized coefficients undergo inverse quantization to obtain transform coefficients. If the LFNST IDs indicates that NSPT is used, the decoder may perform inverse NSPT on the transform coefficients, thereby obtaining reconstructed residual information. If the LFNST IDs indicate that the NSPT is not used, the decoder may perform inverse primary transform on the transform coefficients to obtain the reconstructed residual information.
[0093] As can be seen from the foregoing, for an intra-coded picture, luma and chroma components may use different partition trees. In this case, for a luma transform block, its own LFNST ID may be used to indicate whether the luma transform block uses non-separable transform, and for a chroma transform block, its own LFNST ID may also be used to indicate whether the chroma transform block uses non-separable transform. For an inter-coded picture or a coded picture to which the DT division manner is not applicable, since one coding unit includes both a luma block and a chroma block, in this case, the LFNST ID controls only whether the luma block uses the non-separable transform, and the chroma block does not use the non- separable transform, but only uses the primary transform or the inverse primary transform. For example, if the LFNST ID indicates that the coding unit uses the non-separable transform, it only indicates that the luma block corresponding to the coding unit uses the non-separable transform, and the chroma block corresponding to the coding unit does not use the non-separable transform.
[0094] A non-separable transform operation is an important transform operation. However, at present, in some scenarios, the encoding and decoding manner of the non-separable transform operation is sometimes unreasonable, which may degrade the encoding and decoding performance. Hereinafter, this problem will be described by way of example.
[0095] In ECM-11.0, coefficient(s) of the transform block can be represented by target parameters. An absolute value of a transform block coefficient is represented by accumulation and combination of target parameters. The target parameters may include, for example, one or more of the following: sig coeff flag, abs level gtx flag, par level flag, abs remainder, dec abs level.
[0096] The sig coeff flag is a flag coded based on a context model, and is used to indicate whether a coded coefficient at a current position of a transform block is zero. If a current transform block coefficient is 0, sig_coeff_flag =1.
[0097] The abs level gtx flag is a flag coded based on the context model, and is used to indicate whether an absolute value of the coded coefficient at the current position of the transform block is greater than x. x is positive. In ECM-x 11.0, the values of x may be 1 and 3. Taking <semantics>x=1<annotation encoding="application / x-tex">x = 1< / annotation>< / semantics> as an example, if the coefficient of the transform block is greater than 1, then abs level gt1 flag = 1. Taking <semantics>N=3<annotation encoding="application / x-tex">N = 3< / annotation>< / semantics> as an example, if the coefficient of the transform block is greater than 3, then abs level <semantics>gt3<annotation encoding="application / x-tex">gt3< / annotation>< / semantics> flag =1.
[0098] The par level flag is a flag coded based on the context model, and is used to indicate whether a coded coefficient at a current position of a transform block is odd or even. If the coefficient of the transform block is odd, par_level_flag =1.
[0099] The abs remainder is a remainder syntax element that is bypass-coded using Golomb- Rice coding, and is used to indicate a remaining portion of an absolute value of a coefficient coded at a current position of a current transform block. For example, if an absolute value of a level of the transform block coefficient is greater than a second value, a fourth parameter may be used to represent a remaining absolute value of the quantized transform block coefficient.
[0100] The dec abs level is an absolute value of a current coefficient and is bypass coded using Golomb-Rice coding. In the process of coding and decoding coefficients of a current block, when the number of flags coded based on a context model exceeds a threshold, the remaining coefficients are no longer represented by sig coeff flag, abs level gtx flag, par level flag and abs remainder. Instead, the absolute values of the coefficients are directly coded using Golomb- Rice coding.
[0101] At the encoding end, the encoder can transform and quantize the residual information to obtain the coefficients of the transform block, and further encode the target parameters according to the coefficients of the transform block, so that the encoded target parameters can represent the coefficients of the transform block.
[0102] At the decoding end, the decoder can obtain target parameters from the bitstream, determine the coefficients of the transform block based on the values of the target parameters, and perform inverse quantization and inverse transformation on the coefficients of the transform block to obtain residual information.
[0103] Context model indexes and / or Rice parameters need to be used when target parameters are encoded and decoded. The context model index can be used to select the context model, and the Rice parameter may be a Rice parameter used in Golomb-Rice coding when abs remainder and dec abs level are encoded and decoded.
[0104] The context model index and / or the Rice parameter may be determined based on neighbouring information of the transform block. Which neighbouring information is used depends on whether non-separable transform is used for the transform block. If the non-separable transform is used for the transform block, the neighbouring information is neighbouring information of the transform block in a scanning order; and if the non-separable transform is not used for the transform block, the neighbouring information is neighbouring information of the transform block in a spatial domain. For example, if the non-separable transform is used for the transform block, the context model indexes and / or Rice parameters used to encode and decode the above parameters may be determined based on neighbouring information in the scanning order. If the non-separable transform is not used for the transform block, the context model indexes and / or the Rice parameters used to encode and decode the above parameters may be determined based on the neighbouring information in the spatial domain.
[0105] The embodiments of the disclosure do not impose any specific limitation on a number of neighbouring information. For example, the neighbouring information may include information of five neighbouring positions. Of course, the neighbouring information may also include information of other number of neighbouring positions.
[0106] The neighbouring information may be information of neighbouring position(s) (or neighbouring transform block(s)) of the current transform block, and the information of the neighbouring positions may include decoded values or partially decoded values of the neighbouring positions. During determining the context model index and / or the Rice parameter, the context model index and / or the Rice parameter may be determined based on decoded values or partially decoded values of the neighbouring positions. For example, decoded values or partially decoded values of the neighbouring positions may be accumulated, and based on the accumulated value, a context model index and / or a Rice parameter may be determined.
[0107] Hereinafter, with reference to FIG. 4, a manner of determining the context model index and / or the Rice parameter will be described by taking neighbouring information including information of five neighbouring positions as an example.
[0108] Referring to FIG. 4, the left side of FIG. 4 shows five neighbouring positions in the spatial domain. If non-separable transform is not used for the transform block, the context model index and / or the Rice parameter may be derived by accumulating decoded values or partially decoded values of these five locations and using the accumulated value as a basis. The right side of FIG. 4 shows five neighbouring positions in the scanning order. If the non-separable transform is used for the transform block, the context model index and / or the Rice parameter may be derived by accumulating the decoded values or partially decoded values at these five positions and using the accumulated value as a basis.
[0109] In some scenarios (such as ECM-11.0), which neighbouring information is used for the current transform block is determined based on the LFNST ID (cu.lfnstIdx). If the LFNST ID indicates that the non-separable transform is used, the neighbouring information used for the current transform block is neighbouring information in a scanning order; and if the LFNST ID indicates that the non-separable transform is not used, the neighbouring information used for the current transform block is neighbouring information in a spatial domain. This determination manner is applicable to cases of using different partition trees for luma and chroma, but there are some problems for cases where different partition trees are not used for luma and chroma, which are analyzed below.
[0110] Since the LFNST ID is a coding unit level identifier, a luma block and a chroma block share one coding unit. For an inter-coded picture or a coded picture to which the DT division manner is not applicable, if the LFNST ID indicates that a non-separable transform is used, both the luma block and the chroma block use neighbouring information in the scanning order as the neighbouring information. However, as can be known from the foregoing description, for an inter-coded picture or a coded picture to which DT (Dual Tree) partition is not applicable, if the LFNST ID indicates that the non-separable transform is used, the LFNST ID only indicates that the luma block uses the non-separable transform, whereas the chroma block does not use the non-separable transform. Theoretically, the chroma block should use neighbouring information in a spatial domain as its neighbouring information. Therefore, if the LFNST ID is used as a condition for determining which neighbouring information to use, the chroma block will use unreasonable information to determine the coefficient of the transform block, and thus the transform performance is degraded.
[0111] Similarly, at the encoding end, for the chroma block, unreasonable information will be used to encode the coefficient of the transform block, which will degrade the transform performance.
[0112] The above is merely an example that describes an inappropriate manner of determining the transform block coefficient, and the embodiments of the disclosure are not limited thereto.
[0113] In view of the above problems, an embodiment of the disclosure provides a decoding method, including: determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block; determining neighbouring information of the current transform block according to the first information; and determining a coefficient of the current transform block according to the neighbouring information.
[0114] In addition, an embodiment of the disclosure also provides an encoding method, including: determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block; determining neighbouring information of the current transform block according to the first information; and encoding a coefficient of the current transform block according to the neighbouring information.
[0115] In the embodiments of the disclosure, identification information at the transform block level (that is, the first information mentioned above) is introduced to indicate whether the non- separable transform is used. Compared with the identification information at the coding block level in the related art, the identification information at the transform block level facilitates selecting appropriate neighbouring information, thereby contributing to improving the encoding and decoding performance.
[0116] The decoding method according to the embodiments of the disclosure is first described in detail by way of examples hereinafter.
[0117] FIG. 5 is a schematic flowchart of a decoding method according to an embodiment of the disclosure. The method of FIG. 5 may be applied to a decoder.
[0118] Referring to FIG. 5, in an operation S510, first information is determined, where the first information is used for indicating whether non-separable transform is used for a current transform block. The current transform block may be a current transform block to be decoded. In some implementations, the current transform block is a luma block. In other implementations, the current transform block may also be a chroma block. The current transform block may be an inter prediction block or an intra prediction block.
[0119] The non-separable transform may be the LFNST or NSPT described above.
[0120] There are many manners of determining the first information, and the manner of determining the first information will be described in detail below.
[0121] With continued reference to FIG. 5, in an operation S520, neighbouring information of the current transform block is determined according to the first information. The neighbouring information may be, for example, neighbouring information of the current transform block in a spatial domain, or may be neighbouring information of the current transform block in a scanning order.
[0122] In some implementations, if the first information indicates that the non-separable transform is used for the current transform block, the neighbouring information of the current transform block is the neighbouring information of the current transform block in the scanning order. In other implementations, if the first information indicates that the non-separable transform is not used for the current transform block, the neighbouring information of the current transform block is the neighbouring information of the current transform block in the spatial domain.
[0123] With continued reference to FIG. 5, in an operation S530, a coefficient of the current transform block is determined according to the neighbouring information.
[0124] In the embodiments of the disclosure, the coefficient of the transform block is determined according to appropriate neighbouring information, thereby obtaining appropriate transform block coefficients, which facilitates enhancing the transform performance.
[0125] The embodiments of the disclosure do not impose any specific limitation on the determination manner in the operation S530. In some implementations, the coefficient of the current transform block may be directly obtained based on the neighbouring information. In other implementations, a context model index and / or a Rice parameter may be determined according to the neighbouring information; and the coefficient of the current transform block is then determined according to the context model index and / or Rice parameter.
[0126] The coefficient of the current transform block may be represented by target parameter(s), which may be parsed from the bitstream, and the target parameters can represent the coefficient of the current transform block through superposition and / or combination. The target parameter may include one or more of the following parameters: a first parameter, a second parameter, a third parameter, a fourth parameter, and a fifth parameter. These five parameters can represent the coefficient of the current transform block through superposition and combination. These five parameters are explained below.
[0127] The first parameter may be used for indicating whether the coefficient of the current transform block is zero, and the first parameter may also be referred to as a non-zero flag. The first parameter may be represented by the sig coeff flag (of course, the first parameter may also be represented by any other letters and / or numbers). If the coefficient of the current transform block is zero, the value of the first parameter may be 1; if the coefficient of the current transform block is not zero, the value of the first parameter may be 0.
[0128] The second parameter may be used for indicating whether an absolute value of the coefficient of the current transform block is greater than a first value. The second parameter may be represented by the abs_level_gtx_flag (of course, the second parameter may be represented by any other letters and / or numbers), and the first value may be x. The values of x may be 1, 2, 3, etc. If the absolute value of the coefficient of the current transform block is greater than the first value, the value of the second parameter may be 1; if the absolute value of the coefficient of the current transform block is not greater than the first value, the value of the second parameter may be 0.
[0129] The third parameter may be used for indicating parity of the absolute value of the coefficient of the current transform block. The third parameter may be represented by the par level flag (of course, the third parameter may be represented by any other letters and / or numbers). If the coefficient of the current transform block is odd, the value of the third parameter may be 1; if the coefficient of the current transform block is even, the value of the third parameter may be 0.
[0130] The fourth parameter may be used for representing a remainder of the coefficient of the current transform block. For example, if an absolute value of the level of the transform block coefficients is greater than a second value, the fourth parameter may be used for representing the remaining transform block coefficient. The fourth parameter may be represented by the abs remainder (of course, the fourth parameter may also be represented by any other letters and / or numbers).
[0131] The fifth parameter may be used to represent an absolute value of the coefficient of the current transform block, and when a context model-based ID used to encode and decode the current block exceeds a threshold, the absolute value of the coefficient may be represented by directly encoding and decoding the fifth parameter. The fifth parameter may be represented by dec abs level (of course, the fifth parameter may be represented by any other letters and / or numbers).
[0132] The operation of determining the coefficient of the current transform block according to the context model index and / or the Rice parameter may be: decoding a target parameter in a bitstream according to the context model index and / or the Rice parameter; and determining the coefficient of the current transform block according to the target parameter. After obtaining the target parameter(s), the target parameter(s) may be superimposed and / or combined to obtain the coefficient of the transform block.
[0133] Hereinafter, a manner of determining the first information will be described.
[0134] The first information is determined based on one or more of: second information; whether a transform skip mode is used for the current transform block; whether different partition trees are used for a luma component and a chroma component; a type of the current transform block; and a type of the current coding block. The above information will be explained below.
[0135] The second information is used for indicating whether the non-separable transform is used, and the second information is information corresponding to a current coding block. Alternatively, the second information is indication information at a coding block (or coding unit) level. In some implementations, the second information may be represented by cu.lfnstIdx or lfnstIdx.
[0136] If the transform skip mode is used for the current transform block, it means that the current transform block does not undergo a transform operation, but directly undergoes a quantization operation. For example, the quantization operation may be performed directly on the residual information to obtain the coefficient of the transform block. Therefore, if the transform skip mode is used for the current transform block, it means that the non-separable transform is not used for the current transform block.
[0137] If different partition trees are used for the luma component and the chroma component, the luma component and the chroma component have respective independent coding units; If different partition trees are not used for the luma component and the chroma component, that is, the same partition tree is used for the luma component and the chroma component, the luma component and the chroma component share one coding unit. Whether different partition trees are used for the luma component and the chroma component can be determined by whether a DT partition is used for the luma component and the chroma component. If the DT partition is used for the luma component and the chroma component, different partition trees are used for the luma component and the chroma component; If the DT partition is not used for the luma component and the chroma component, different partition trees are not used for the luma component and the chroma component.
[0138] The type of the current transform block may include a chroma transform block and a luma transform block.
[0139] The type of the current encoding block may include one or more of: intra-coded block, inter-coded block, and Intra Block Copy (IBC) coded block. In the conventional scheme, the non-separable transform is only applied to intra-coded blocks, whereas the scheme in the embodiments of the disclosure can be extended to inter-coded blocks and / or IBC coded blocks.
[0140] In some implementations, the first information may be determined based on whether the transform skip mode is used for the current transform block. For example, if the transform skip mode is used for the current transform block, the first information indicates that the non- separable transform is not used for the current transform block.
[0141] In some implementations, the first information may be determined based on the second information. For example, if the second information indicates that the non-separable transform is not used, the first information indicates that the non-separable transform is not used for the current transform block.
[0142] In some implementations, the first information may be determined based on the type of the current coding block. For example, if the current coding block does not belong to the coding block of the preset type, the first information indicates that the non-separable transform is not used for the current coding block.
[0143] In some embodiments, the coding block of the preset type may be a coding block for which the non-separable transform can be used. The coding block of the preset type may include one or more of: intra-coded block, inter-coded block, and IBC coded block. Taking the coding block of the preset type that includes an intra-coded block but does not include an inter-coded block and an IBC coded block as an example, if the current coding block does not belong to the intra-coded block, that is, the current coding block belongs to the inter-coded block or the IBC coded block, the first information indicates that the non-separable transform is not used for the current coding block. Taking the coding block of the preset type that include the intra-coded block and the inter-coded block as an example, if the current coding block belongs to the IBC coded block, the first information indicates that the non-separable transform is not used for the current coding block. Taking the coding block of the preset type that include the intra-coded block and the IBC coded block as an example, if the current coding block belongs to the inter- coded block, the first information indicates that the non-separable transform is not used for the current coding block.
[0144] In some implementations, the first information may be determined based on: whether the transform skip mode is used for the current transform block, the second information, and whether different partition trees are used for the luma component and the chroma component. In some implementations, in a case where the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are used for the luma component and the chroma component. In other words, if the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, and different partition trees are used for the luma component and the chroma component, then the first information indicates that the non- separable transform is used for the current transform block. |0145| In some implementations, the first information may be determined based on: the type of the current coding block, whether the transform skip mode is used for the current transform block, the second information, and whether different partition trees are used for the luma component and the chroma component. In some implementations, in a case where the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are used for the luma component and the chroma component. In other words, if the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, and different partition trees are used for the luma component and the chroma component, then the first information indicates that the non-separable transform is used for the current transform block.
[0146] In some implementations, the first information may be determined based on: whether the transform skip mode is used for the current transform block, the second information, whether different partition trees are used for the luma component and the chroma component, and a type of the current transform block. In some implementations, in a case where the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block. In other words, if the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the luma block, then the first information indicates that the non-separable transform is used for the current transform block (i.e., luma transform block).
[0147] In some implementations, in a case where the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non- separable transform is not used for the current transform block. The second condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block. In other words, if the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the chroma block, then the first information indicates that the non-separable transform is not used for the current transform block (i.e., chroma transform block).
[0148] In some implementations, the first information may be determined based on: a type of the current coding block, whether the transform skip mode is used for the current transform block, the second information, whether different partition trees are used for the luma component and the chroma component, and a type of the current transform block. In some implementations, in a case where the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block. In other words, if the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block, the second information indicates that the non- separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the luma block, then the first information indicates that the non-separable transform is used for the current transform block (i.e., luma transform block).
[0149] In some implementations, in a case where the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non-separable transform is not used for the current transform block. The second condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block. In other words, if the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the chroma block, then the first information indicates that the non-separable transform is not used for the current transform block (i.e., chroma transform block).
[0150] By determining the first information in the above manner, it is possible to accurately determine whether the non-separable transform is used for the current transform block, and thus it is possible to determine appropriate transform block coefficients, which is beneficial to improving the transform performance.
[0151] In the conventional scheme, the non-separable transform is only applied to the intra- coded block, but the embodiment of the disclosure can be applied to one or more of the intra- coded block, the inter-coded block, and the IBC coded block.
[0152] Before the second information is parsed, the type of the current transform block may also be determined. The second information is parsed when the third condition is satisfied. If the third condition is not satisfied, the second information may not be parsed.
[0153] The third condition may include that the current coding block belongs to a coding block of a preset type. The coding block of the preset type is a coding block for which the non-separable transform can be used. The coding block of the preset type may include one or more of: intra- coded block, inter-coded block, and IBC coded block.
[0154] That is, if the current coding block belongs to the coding block of the preset type, the second information may be parsed. If the current coding block does not belong to the coding block of the preset type, the second information may not be parsed.
[0155] Taking the coding block of the preset type including an intra-coded block as an example, if the coding block of the preset type includes the intra-coded block, the decoder may parse the second information when the current coding block is the intra-coded block.
[0156] Taking the coding block of the preset type including an inter-coded block as an example, if the coding block of the preset type includes the inter-coded block, the decoder may parse the second information when the current coding block is the inter-coded block.
[0157] Taking the coding block of the preset type including an IBC coded block as an example, if the coding block of the preset type includes the IBC coded block, the decoder may parse the second information when the current coding block is the IBC coded block.
[0158] If the decoder does not parse the second information, it may be inferred by default that the non-separable transform is not used for the current transform block.
[0159] After the coefficients of the transform block are obtained, the residual information can be determined according to the coefficients of the current transform block. For example, an inverse quantization and inverse transform operation may be performed on the coefficients of the current transform block to obtain residual information. An inverse transform manner used depends on whether the non-separable transform is used for the current transform block. If the non-separable transform is used for the current transform block, the inverse transform manner includes non-separable inverse transform. If the non-separable transform is not used for the current transform block, the inverse transform manner includes primary inverse transform and does not include the non-separable inverse transform.
[0160] After the residual information is obtained, the reconstruction information can be determined based on the residual information.
[0161] In some implementations, the residual information may be determined according to a transform kernel and the coefficients of the current transform block. For example, an inverse quantization operation can be performed on the coefficients of the current transform block to obtain transformed coefficients; and an inverse transform operation is performed on the transformed coefficients by utilizing a transform kernel to obtain residual information.
[0162] In some implementations, if the non-separable transform is used for the current transform block, or if the first information indicates that the non-separable transform is used for the current transform block, a transform kernel may be determined based on angular information of the current transform block. If the current transform block is an intra transform block, the transform kernel may be determined according to an intra angular direction. If the current transform block is an inter transform block or an IBC transform block, the angular information of the current transform block may be determined according to a histogram of gradients. For specific determination manners, reference can be found in the following description.
[0163] Of course, apart from using the histogram of gradients to determine the angular information of the transform block, the angular information of the transform block may also be determined in alternative ways according to the embodiments of the present disclosure. For example, a list of candidate intra prediction modes may be obtained from around the current transform block by means of template matching, and an angle may be determined by means of sorting template costs.
[0164] The decoding method according to the embodiment of the disclosure has been described in detail above with reference to FIG. 5. An encoding method according to an embodiment of the present disclosure is described in detail below with reference to FIG. 6.
[0165] FIG. 6 is a schematic flowchart of an encoding method according to an embodiment of the disclosure. The method of FIG. 6 may be applied to an encoder.
[0166] Referring to FIG. 6, in an operation S610, the first information is determined. The first information is used for indicating whether non-separable transform is used for a current transform block. The current transform block may be a current transform block to be decoded. In some implementations, the current transform block is a luma block. In other implementations, the current transform block may also be a chroma block. The current transform block may be an inter prediction block or an intra prediction block.
[0167] The non-separable transform may be LFNST or NSPT.
[0168] There are many manners of determining the first information, and the manner of determining the first information will be described in detail below.
[0169] With continued reference to FIG. 6, in an operation S620, neighbouring information of the current transform block is determined according to the first information. The neighbouring information may be, for example, neighbouring information of the current transform block in a spatial domain, or may be neighbouring information of the current transform block in a scanning order.
[0170] In some implementations, if the first information indicates that the non-separable transform is used for the current transform block, the neighbouring information of the current transform block is the neighbouring information of the current transform block in the scanning order. In other implementations, if the first information indicates that the non-separable transform is not used for the current transform block, the neighbouring information of the current transform block is the neighbouring information of the current transform block in the spatial domain.
[0171] With continued reference to FIG. 6, in an operation S630, a coefficient of the current transform block is encoded according to the neighbouring information.
[0172] In the embodiments of the disclosure, the coefficient of the transform block is encoded according to appropriate neighbouring information, thereby encoding the coefficients of the transform block using an appropriate manner, which facilitates enhancing the transform performance.
[0173] The embodiments of the disclosure do not impose any specific limitation on the encoding manner in the operation S630. In some implementations, the coefficient of the current transform block may be directly encoded based on the neighbouring information. In other implementations, a context model index and / or a Rice parameter may be determined according to the neighbouring information; and the coefficient of the current transform block is then encoded according to the context model index and / or Rice parameter.
[0174] The coefficient of the current transform block may be represented by target parameter(s), and the target parameters can represent the coefficient of the current transform block through superposition and / or combination. The target parameter may include one or more of the following parameters: a first parameter, a second parameter, a third parameter, a fourth parameter, and a fifth parameter. These five parameters can represent the coefficient of the current transform block through superposition and combination. These five parameters are explained below.
[0175] The first parameter may be used for indicating whether the coefficient of the current transform block is zero, and the first parameter may also be referred to as a non-zero flag. The first parameter may be represented by the sig_coeff_flag (of course, the first parameter may also be represented by any other letters and / or numbers). If the coefficient of the current transform block is zero, the value of the first parameter may be 1; if the coefficient of the current transform block is not zero, the value of the first parameter may be 0.
[0176] The second parameter may be used for indicating whether an absolute value of the coefficient of the current transform block is greater than a first value. The second parameter may be represented by the abs level gtx flag (of course, the second parameter may be represented by any other letters and / or numbers), and the first value may be x. The values of x may be 1, 2, 3, etc. If the absolute value of the coefficient of the current transform block is greater than the first value, the value of the second parameter may be 1; if the absolute value of the coefficient of the current transform block is not greater than the first value, the value of the second parameter may be 0.
[0177] The third parameter may be used for indicating parity of the absolute value of the coefficient of the current transform block. The third parameter may be represented by the par level flag (of course, the third parameter may be represented by any other letters and / or numbers). If the coefficient of the current transform block is odd, the value of the third parameter may be 1; if the coefficient of the current transform block is even, the value of the third parameter may be 0.
[0178] The fourth parameter may be used for representing a remainder of the coefficient of the current transform block. For example, if an absolute value of the level of the transform block coefficients is greater than a second value, the fourth parameter may be used for representing the remaining transform block coefficient. The fourth parameter may be represented by the abs remainder (of course, the fourth parameter may also be represented by any other letters and / or numbers).
[0179] The fifth parameter may be used to represent an absolute value of the coefficient of the current transform block, and when a context model-based ID used to encode and decode the current block exceeds a threshold, the absolute value of the coefficient may be represented by directly encoding and decoding the fifth parameter. The fifth parameter may be represented by dec abs level (of course, the fifth parameter may be represented by any other letters and / or numbers).
[0180] In some implementations, encoding the coefficients of the current transform block may be encoding the coefficients of the current transform block into target parameters.
[0181] In some implementation, a target parameter may be signalled according to the context model index and / or the Rice parameter, where the target parameter may be used for representing the coefficient of the current block.
[0182] Hereinafter, a manner of determining the first information will be described.
[0183] The first information is determined based on one or more of: second information; whether a transform skip mode is used for the current transform block; whether different partition trees are used for a luma component and a chroma component; a type of the current transform block; and a type of the current coding block. The above information will be explained below.
[0184] The second information is used for indicating whether the non-separable transform is used, and the second information is information corresponding to a current coding block. Alternatively, the second information is indication information at a coding block (or coding unit) level. In some implementations, the second information may be represented by cu.lfnstIdx or lfnstIdx.
[0185] If the transform skip mode is used for the current transform block, it means that the current transform block does not undergo a transform operation, but directly undergoes a quantization operation. For example, the quantization operation may be performed directly on the residual information to obtain the coefficient of the transform block. Therefore, if the transform skip mode is used for the current transform block, it means that the non-separable transform is not used for the current transform block.
[0186] If different partition trees are used for the luma component and the chroma component, the luma component and the chroma component have respective independent coding units; If different partition trees are not used for the luma component and the chroma component, that is, the same partition tree is used for the luma component and the chroma component, the luma component and the chroma component share one coding unit. Whether different partition trees are used for the luma component and the chroma component can be determined by whether a DT partition is used for the luma component and the chroma component. If the DT partition is used for the luma component and the chroma component, different partition trees are used for the luma component and the chroma component; If the DT partition is not used for the luma component and the chroma component, different partition trees are not used for the luma component and the chroma component.
[0187] The type of the current transform block may include a chroma transform block and a luma transform block.
[0188] The type of the current encoding block may include one or more of: intra-coded block, inter-coded block, and Intra Block Copy (IBC) coded block. In the conventional scheme, the non-separable transform is only applied to intra-coded blocks, whereas the scheme in the embodiments of the disclosure can be extended to inter-coded blocks and / or IBC coded blocks.
[0189] In some implementations, the first information may be determined based on whether the transform skip mode is used for the current transform block. For example, if the transform skip mode is used for the current transform block, the first information indicates that the non- separable transform is not used for the current transform block.
[0190] In some implementations, the first information may be determined based on the second information. For example, if the second information indicates that the non-separable transform is not used, the first information indicates that the non-separable transform is not used for the current transform block.
[0191] In some implementations, the first information may be determined based on the type of the current coding block. For example, if the current coding block does not belong to the coding block of the preset type, the first information indicates that the non-separable transform is not used for the current coding block.
[0192] In some embodiments, the coding block of the preset type may be a coding block for which the non-separable transform can be used. The coding block of the preset type may include one or more of: intra-coded block, inter-coded block, and IBC coded block. Taking the coding block of the preset type that includes an intra-coded block but does not include an inter-coded block and an IBC coded block as an example, if the current coding block does not belong to the intra-coded block, that is, the current coding block belongs to the inter-coded block or the IBC coded block, the first information indicates that the non-separable transform is not used for the current coding block. Taking the coding block of the preset type that include the intra-coded block and the inter-coded block as an example, if the current coding block belongs to the IBC coded block, the first information indicates that the non-separable transform is not used for the current coding block. Taking the coding block of the preset type that include the intra-coded block and the IBC coded block as an example, if the current coding block belongs to the inter- coded block, the first information indicates that the non-separable transform is not used for the current coding block.
[0193] In some implementations, the first information may be determined based on: whether the transform skip mode is used for the current transform block, the second information, and whether different partition trees are used for the luma component and the chroma component. In some implementations, in a case where the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are used for the luma component and the chroma component. In other words, if the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, and different partition trees are used for the luma component and the chroma component, then the first information indicates that the non- separable transform is used for the current transform block.
[0194] In some implementations, the first information may be determined based on: the type of the current coding block, whether the transform skip mode is used for the current transform block, the second information, and whether different partition trees are used for the luma component and the chroma component. In some implementations, in a case where the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are used for the luma component and the chroma component. In other words, if the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, and different partition trees are used for the luma component and the chroma component, then the first information indicates that the non-separable transform is used for the current transform block.
[0195] In some implementations, the first information may be determined based on: whether the transform skip mode is used for the current transform block, the second information, whether different partition trees are used for the luma component and the chroma component, and a type of the current transform block. In some implementations, in a case where the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block. In other words, if the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the luma block, then the first information indicates that the non-separable transform is used for the current transform block (i.e., luma transform block).
[0196] In some implementations, in a case where the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non- separable transform is not used for the current transform block. The second condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block. In other words, if the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the chroma block, then the first information indicates that the non-separable transform is not used for the current transform block (i.e., chroma transform block).
[0197] In some implementations, the first information may be determined based on: a type of the current coding block, whether the transform skip mode is used for the current transform block, the second information, whether different partition trees are used for the luma component and the chroma component, and a type of the current transform block. In some implementations, in a case where the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block. In other words, if the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block, the second information indicates that the non- separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the luma block, then the first information indicates that the non-separable transform is used for the current transform block (i.e., luma transform block).
[0198] In some implementations, in a case where the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non-separable transform is not used for the current transform block. The second condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block. In other words, if the current coding block belongs to the coding block of the preset type, the transform skip mode is not used for the current transform block, the second information indicates that the non-separable transform is used, different partition trees are not used for the luma component and the chroma component, and the current transform block is the chroma block, then the first information indicates that the non-separable transform is not used for the current transform block (i.e., chroma transform block).
[0199] By determining the first information in the above manner, it is possible to accurately determine whether the non-separable transform is used for the current transform block, and thus it is possible to determine appropriate transform block coefficients, which is beneficial to improving the transform performance.
[0200] In the conventional scheme, the non-separable transform is only applied to the intra- coded block, but the embodiment of the disclosure can be applied to one or more of the intra- coded block, the inter-coded block, and the IBC coded block.
[0201] Before the second information is encoded, the type of the current transform block may also be determined. The second information is encoded when the third condition is satisfied. If the third condition is not satisfied, the second information may not be encoded.
[0202] The third condition may include that the current coding block belongs to a coding block of a preset type. The coding block of the preset type is a coding block for which the non-separable transform can be used. The coding block of the preset type may include one or more of: intra- coded block, inter-coded block, and IBC coded block.
[0203] That is, if the current coding block belongs to the coding block of the preset type, the second information may be encoded. If the current coding block does not belong to the coding block of the preset type, the second information may not be encoded.
[0204] Taking the coding block of the preset type including an intra-coded block as an example, if the coding block of the preset type includes the intra-coded block, the encoder may encode the second information when the current coding block is the intra-coded block.
[0205] Taking the coding block of the preset type including an inter-coded block as an example, if the coding block of the preset type includes the inter-coded block, the encoder may encode the second information when the current coding block is the inter-coded block.
[0206] Taking the coding block of the preset type including an IBC coded block as an example, if the coding block of the preset type includes the IBC coded block, the encoder may encode the second information when the current coding block is the IBC coded block.
[0207] If the encoder does not encode the second information, it may be inferred by default that the non-separable transform is not used for the current transform block.
[0208] In some implementations, the current transform block may be transformed to determine transform coefficients. The transform manner may include primary transform, or the transform manner may include non-separable transform. For example, the transform manner may include the primary transform and the LFNST. For another example, the transform manner may include the NSPT. After the transformed coefficients are obtained, the transformed coefficients can be quantized to determine the coefficients of the current transform block.
[0209] In some implementations, the current transform block may be transformed using a transform kernel to obtain the transform coefficients.
[0210] In some implementations, if the non-separable transform is used for the current transform block, or if the first information indicates that the non-separable transform is used for the current transform block, a transform kernel may be determined based on angular information of the current transform block. If the current transform block is an intra transform block, the transform kernel may be determined according to an intra angular direction. If the current transform block is an inter transform block or an IBC transform block, the angular information of the current transform block may be determined according to a histogram of gradients. For specific determination manners, reference can be found in the following description.
[0211] Of course, apart from using the histogram of gradients to determine the angular information of the transform block, the angular information of the transform block may also be determined in alternative ways according to the embodiments of the present disclosure. For example, a list of candidate intra prediction modes may be obtained from around the current transform block by means of template matching, and an angle may be determined by means of sorting template costs.
[0212] Hereinafter, embodiments of the disclosure will be described in more detail with reference to specific examples. It is to be noted that the examples below are merely intended to help those skilled in the art understand the embodiments of the disclosure, and is not intended to limit the embodiments of the disclosure to specific numerical values or specific scenarios illustrated. It will be apparent to those skilled in the art that various equivalent modifications or variations may be made from the examples given below, and such modifications or variations also fall within the scope of the embodiments of the disclosure.
[0213] In the ECM, since the transforms such LFNST and NSPT and their inverse transform require selecting a transform kernel according to an intra angular direction, the LFNST and the NSPT are applied to a block that uses an intra prediction mode. This implies that the decoder may further determine whether to decode an lfnst idx only when a coding unit is an intra-coded unit. The decoder obtains whether there is a transform block in the current coding unit that needs to be inversely transformed using LFNST or NSPT by parsing the syntax element lfnst_idx at the coding unit level.
[0214] When the value of the syntax element is non-zero, the current coding unit contains a transform block that needs to be inversely transformed using LFNST or NSPT, and when the value of the syntax element is zero, the transform block in the current encoding unit is free from inverse transform using LFNST or NSPT. Since the LFNST and the NSPT have an angular direction dependence, in ECM, they are used only for the transform block in the coding unit using the intra coding mode.
[0215] Regardless of whether separate tree partitions are used for luma and chroma, selection of a context model and determination of a Rice parameter during a coefficient decoding process are performed in the following manner: if Ifnst idx is 0, information at five positions in the left side of FIG. 4 is used to derive the context model and the Rice parameter; and if Ifnst idx is 1, information at five positions in the right side of FIG. 4 is used to derive the context model and the Rice parameter.
[0216] Then, the quantized transform coefficients are constructed according to the parsed syntax element, the quantized transform coefficients are inversely quantized to obtain the transform coefficients, the transform coefficients are inversely transformed according to the selected transform mode (LFNST / NSPT, or other transform mode) to obtain the residual coefficients, and the obtained residual coefficients are added to the predicted value to obtain the reconstructed block.
[0217] In VCC, the steps to decode coding unit syntax are as follows. [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document]
[0218] In transform_tree() of VVC, syntax elements of each transform unit and syntax elements related to coefficient coding of a transform block are coded and decoded. In VVC, lfnst_idx representing an LFNST index is encoded and decoded after the transform_tree. However, in ECM (e.g., ECM-11.0), since selection of a context model and selection of a Rice parameter during encoding and decoding of transform block coefficients need to be based on a value of the lfnst_idx, the contents encoded and decoded in the transform_tree are divided into two parts. The first part includes syntax elements other than coefficient values, and the second part includes syntax elements related to the coefficient values. Therefore, in ECM-11.0, changes to the coding unit syntax table are as follows. [Image disponible dans le document PDF, Image available in the PDF document]
[0219] During actual encoding and decoding of coefficients, a coding unit-level lfnst idx may be used to determine and select a context model and determine a Rice parameter.
[0220] During derivation of the Rice parameter, a process of calculating absolute values of coefficients of five neighbouring positions is as follows. <semantics>locSumAbs=0<annotation encoding="application / x-tex">locSumAbs = 0< / annotation>< / semantics> if <semantics>(1fnstIdx==0)<annotation encoding="application / x-tex">(1 \text{fnstIdx} = = 0)< / annotation>< / semantics> { if <semantics>1fnst idx<annotation encoding="application / x-tex">1 \text{fnst idx}< / annotation>< / semantics> is zero ... ... / / accumulating absolute values of spatial-domain neighbours else { ... ... / / accumulate absolute values in the scanning order locSumAbs = Clip3 (0, 31, locSumAbs – baseLevel * 5)
[0221] The process of deriving the necessary variables locNumSig and locSumAbsPass1 in sig_coeff_flag, abs_level_gtx_flag, par_level_flag is as follows. locNumSig <semantics>=0<annotation encoding="application / x-tex">=0< / annotation>< / semantics> locSumAbsPass1=0 if (transform_skip_flag [x0] [y0] [cIdx] && !sh_ts_residual_coding_disabled_flag) { ... ... / / variable computation under transform skip } else { if <semantics>(1fnstIdx==0)<annotation encoding="application / x-tex">(1 \text{fnstIdx} = =0)< / annotation>< / semantics> { / / if 1 fnst idx is zero ... ... / / accumulating spatial-domain information else { ... ... / / accumulating information in the scanning order
[0222] In ECM-11.0, If instidix was originally used to determine which adjacent information to use, but, as described above, in this manner, a case occurs in which the LFNST and the NSPT are not applied to the chroma transform block even if Ifnstidx is equal to non-zero, when different partitions are not applied to the luma component and the chroma component. Therefore, in the embodiments of the present disclosure, instead of using the lfnst idx as a condition, a variable If stApplied is used as a condition to determine which neighbouring information to use.
[0223] In ECM-11.0, the value of lfnstIdx is equal to the value of the coding unit syntax element lfnst idx, whereas in the embodiments of the disclosure, the value of lfnstApplied can be obtained as follows. IfnstApplied = (! transform skip flag || sh ts residual coding disabled flag) && lfnstIdx && (treeType! = SINGLE TREE? true: isLuma (compID))
[0224] If stApplied is used to determine whether the LFNST or NSPT is used by the current transform block as the transform mode, (! transform skip flag sh ts residual coding disabled flag) indicates that the transform skip mode is not used by the current transform block, and lfnstIdx indicates that the lfnst idx of the current coding unit is non- zero.
[0225] (treeType! = SINGLE TREE? true: isLuma (compID)) is used to obtain a Boolean variable (true or false). When treeType indicates different partitions for luma and chroma, the Boolean variable true is obtained. When treeType indicates the same partition for luma and chroma, it is necessary to further determine whether the colour component of the current transform block is luma. If it is a luma component, the Boolean variable true is obtained; otherwise, the Boolean variable false is obtained.
[0226] Correspondingly, during deriving of the Rice parameter, the process of calculating the sum of the absolute values of the coefficients of the five neighbouring positions is as follows. <semantics>locSumAbs=0<annotation encoding="application / x-tex">locSumAbs = 0< / annotation>< / semantics> if (! lfnstApplied) {if lfnstApplied is zero ... ... / / accumulating absolute values of spatial-domain neighbours } else { ... ... / / accumulating absolute values in the scanning order locSumAbs = Clip3 (0, 31, locSumAbs – baseLevel * 5)
[0227] The process of deriving the necessary variables locNumSig and locSumAbsPass1 in sig_coeff_flag, abs_level_gtx_flag, par_level_flag is as follows. locNumSig =0 locSumAbsPass1=0 if (transform skip flag & &! sh ts residual coding disabled flag) { ... ... / / variable computation under transform skip } else { if (!lfnstApplied) { / / if lfnstApplied is zero ... ... / / accumulating spatial-domain information else { ... ... / / accumulating information in the scanning order
[0228] FIG. 7 to FIG. 10 illustrate several manners of determining neighbouring information, which are described below. The schemes of FIG. 7 to FIG. 10 are applicable to both the encoding end and the decoding end.
[0229] The scheme shown in FIG. 7 is applicable to intra-coded blocks, that is, if the current coding block is an intra-coded block, neighbouring information can be determined in the manner shown in FIG. 7.
[0230] Referring to FIG. 7, it may be determined whether the current coding block adopts separate partitions for luma and chroma. If the current coding block adopts separate partitions for luma and chroma, a conventional practice may be used. For example, neighbouring information may be determined according to lfnst idx. If the value of lfnst idx is 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain. If the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order.
[0231] If the current coding block does not adopt separate partitions for luma and chroma, the type of the current transform block can be further determined, such as whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0232] The scheme shown in FIG. 8 is applicable to a case where the non-separable transform can be used for an intra-coded block and an inter-coded block.
[0233] Referring to FIG. 8, it may be determined whether the current coding block is an intra- coded block. If the current coding block is the intra-coded block, it is further determined whether the current coding block adopts separate partitions for luma and chroma. If the current coding block adopts separate partitions for luma and chroma, a conventional practice may be used. For example, neighbouring information may be determined according to lfnst idx. If the value of If st idx is 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain. If the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order.
[0234] If the current coding block does not adopt separate partitions for luma and chroma, the type of the current transform block can be further determined, such as determining whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0235] If the current coding block is not an intra-coded block, it may be further determined whether the current coding block is an inter-coded block. If the current coding block is not the inter-coded block, the conventional practice may be used. If the current coding block is the inter- coded block, the type of the current transform block can be further determined, such as determining whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0236] The scheme shown in FIG. 9 is applicable to a case where the non-separable transform can be used for an intra-coded block and an IBC coded block.
[0237] Referring to FIG. 9, it may be determined whether the current coding block is an intra- coded block. If the current coding block is the intra-coded block, it is further determined whether the current coding block adopts separate partitions for luma and chroma. If the current coding block adopts separate partitions for luma and chroma, a conventional practice may be used. For example, neighbouring information may be determined according to lfnst idx. If the value of If nst idx is 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain. If the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order.
[0238] If the current coding block does not adopt separate partitions for luma and chroma, the type of the current transform block can be further determined, such as determining whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst_idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0239] If the current coding block is not an intra-coded block, it may be further determined whether the current coding block is an IBC coded block. If the current coding block is not the IBC coded block, the conventional practice may be used. If the current coding block is the IBC coded block, the type of the current transform block can be further determined, such as determining whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0240] The scheme shown in FIG. 10 is applicable to a case where the non-separable transform can be used for an intra-coded block, an inter-coded block and an IBC coded block.
[0241] Referring to FIG. 10, it may be determined whether the current coding block is an intra- coded block or an IBC coded block. If the current coding block is the intra-coded block or the IBC coded block, it is further determined whether the current coding block adopts separate partitions for luma and chroma. If the current coding block adopts separate partitions for luma and chroma, a conventional practice may be used. For example, neighbouring information may be determined according to Ifnst idx. If the value of Ifnst idx is 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain. If the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order.
[0242] If the current coding block does not adopt separate partitions for luma and chroma, the type of the current transform block can be further determined, such as determining whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0243] If the current coding block is not the intra-coded block or the IBC coded block, it may be further determined whether the current coding block is an inter-coded block. If the current coding block is not the inter-coded block, the conventional practice may be used. If the current coding block is the inter-coded block, the type of the current transform block can be further determined, such as determining whether the current transform block is a luma transform block. If the current transform block is the luma transform block and the value of lfnst idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the scanning order. If the current transform block is a chroma transform block and the value of If st idx is not 0, the neighbouring information is the neighbouring information of the current transform block in the spatial domain.
[0244] Determination of angular information of the current transform block
[0245] During an inverse transform, when the LFNST or the NSPT is used for the current transform block, since the LFNST and the NSPT have a characteristic of requiring joint derivation based on the lfnst idx and an intra prediction mode, a histogram of gradients may be used to derive an angle for the current transform block. A method for calculating the angle by using the histogram of gradients is as follows.
[0246] Referring to FIG. 11, in a first step, a sliding 3x3 window is used to calculate horizontal and vertical gradient values, <semantics>gx<annotation encoding="application / x-tex">g_x< / annotation>< / semantics> and <semantics>gy<annotation encoding="application / x-tex">g_y< / annotation>< / semantics>, of each 3x3 window in a prediction block. <semantics>gx<annotation encoding="application / x-tex">g_x< / annotation>< / semantics> and <semantics>gy<annotation encoding="application / x-tex">g_y< / annotation>< / semantics> are obtained by calculating the dot products of a 3x3 horizontal gradient operator <semantics>Mx<annotation encoding="application / x-tex">M_x< / annotation>< / semantics> and a 3x3 vertical gradient operator <semantics>Mν<annotation encoding="application / x-tex">M_{\nu}< / annotation>< / semantics> with the prediction values within the window position, respectively. [Image disponible dans le document PDF, Image available in the PDF document]
[0247] Assuming that the prediction block is a block having a width and a height of (w, h), the sliding 3x3 window may be used to calculate <semantics>gx<annotation encoding="application / x-tex">g_x< / annotation>< / semantics> and <semantics>gy<annotation encoding="application / x-tex">g_y< / annotation>< / semantics> at (w-2)*(h-2) positions at a center of an interpolation-filtered prediction block.
[0248] In a second step, according to <semantics>gx<annotation encoding="application / x-tex">g_x< / annotation>< / semantics> and <semantics>gy<annotation encoding="application / x-tex">g_y< / annotation>< / semantics> at each position, a corresponding conventional angular direction (angle) at each position is calculated according to the following formula, and a gradient amplitude value (Amp) corresponding to the angle at each position is calculated [Image disponible dans le document PDF, Image available in the PDF document]
[0249] In some embodiments, the calculation process of the atan may also be simplified. For example, it may be implemented by looking up a table or some variations.
[0250] In a third step, the gradient amplitude value (Amp) at each position is separately accumulated into its derived angular category to obtain a histogram of gradient amplitude values; and finally, an angle having a maximum accumulated amplitude value is selected as an angle corresponding to the current prediction block. When magnitude values derived for all angles are zero, the current block is matched to a category of a conventional PLANAR prediction mode.
[0251] In some embodiments, rather than using the prediction values of the current transform block to construct the histogram to derive the angle, it is also possible to use the reconstructed values around the current transform block to calculate the histogram of gradients and derive the angle.
[0252] In some embodiments, it is also possible that a list of candidate intra prediction modes may be obtained from around a current transform block through another manner such as template matching, and an angle used for selecting a transform kernel of LFNST or NSPT is determined by template cost sorting.
[0253] Non-separable transform applied to inter-coded blocks
[0254] In some embodiments, the LFNST / NSPT may also be used in the residual transform process of the inter-coded transform block. Since an inter-coded block only exists in an inter- coded picture, and the inter-coded picture uses the same tree partition for luma and chroma by default, selection of a context model and determination of a Rice parameter during a coefficient coding and decoding process on the inter-coded block are similar to the schemes described above. In these embodiments, like intra-predicted coding units, LFNST / NSPT is used only for luma transform blocks, not for chroma transform blocks. The specific flowchart is shown in FIG. 8.
[0255] The flow of using LFNST / NSPT on an inter-coded block is as follows. At the decoder side, for an inter CU, it is determined, by parsing lfnst idx, whether the coding unit includes a transform block using the LFNST / NSPT. Different from the conventional manner, the parsing of If st idx needs to be based on whether the current coding unit is of an interprediction type, as one of the conditions. An example of a procedure for parsing Ifnst idx in VVC the text of the standard is as follows. coding unit (x0, y0, cbWidth, cbHeight, cqtDepth, treeType, modeType) { Descriptor ... ... / / encoding and decoding of preceding coding unit-level syntax elements [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] lfnst idx ae (v) [Image disponible dans le document PDF, Image available in the PDF document]
[0256] CuPredMode [chType] [x0] [y0] = <semantics>=<annotation encoding="application / x-tex">=< / annotation>< / semantics> MODE_INTRA is used to determine whether the current coding block is an intra-coded block, and CuPredMode [chType] [x0] [y0] = = MODE INTER) is used to determine whether the current coding block is an inter-coded block.
[0257] The decoder may derive the context model and Rice parameters and parse the coefficients according to the manner in FIG. 8.
[0258] Application of non-separable transform to IBC coded Block
[0259] In some embodiments, the LFNST / NSPT may also be extended to coding units of type IBC. When an IBC-type coding unit is within a picture with a same partition for luma and chroma, the context model index and the Rice parameter in the coefficient coding process may also be determined in the manner described above, with the specific flow being similar to the processing manner used for the inter-type coding unit.
[0260] Similar to inter-type coding units, when parsing lfnst_idx, it is necessary to set whether the coding unit is of the IBC type as one of the conditions. An example of a procedure for parsing Ifnst idx in VVC the text of the standard is as follows, [Image disponible dans le document PDF, Image available in the PDF document]
[0261] CuPredMode [chType] [x0] [y0] = <semantics>=<annotation encoding="application / x-tex">=< / annotation>< / semantics> MODE_INTRA is used to determine whether the current coding block is an intra-coded block, and CuPredMode [chType] [x0] [y0] = = MODE_IBC is used to determine whether the current coding block is an IBC coded block.
[0262] When the LFNST / NSPT is applied only to the IBC CU and not to the inter CU, the execution flow is shown in FIG. 9, and when the LFNST / NSPT can be applied to the IBC CU and the inter CU, the execution flow is shown in FIG. 10.
[0263] Tables 2 and 3 show the test results of the embodiments of the disclosure. Table 2 shows the test results when the scheme of the embodiment of the disclosure is used for the intra CU, and table 3 shows the test results when the scheme of the embodiment of the disclosure is used for the inter CU. Table 2 [Image disponible dans le document PDF, Image available in the PDF document] Table 3 [Image disponible dans le document PDF, Image available in the PDF document]
[0264] As can be seen from Tables 2 and 3, after the scheme in the embodiment of the present disclosure is applied to an inter-coded block, certain improvements in coding performance can be obtained on the chroma components U and V.
[0265] Embodiments of the method of the disclosure are described in detail above with reference to FIG. 1 to FIG. 11, and embodiments of the device of the disclosure are described in detail below with reference to FIG. 12 to FIG. 15. It is to be understood that the description of the method embodiments and the description of the device embodiments correspond to each other, and therefore, for the portions not described in detail, reference can be made to the foregoing method embodiments.
[0266] FIG. 12 is a schematic structural diagram of a decoder according to an embodiment of the disclosure. As shown in FIG. 12, the decoder 1200 includes a first determining unit 1210, a second determining unit 1220, and a third determining unit 1230. The first determining unit 1210 is configured to determine first information, the first information being used for indicating whether non-separable transform is used for a current transform block; the second determining unit 1220 is configured to determine neighbouring information of the current transform block according to the first information; and the third determining unit 1230 is configured to determine a coefficient of the current transform block according to the neighbouring information.
[0267] In some implementations, the first information indicates that the non-separable transform is used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a scanning order.
[0268] In some implementations, the first information indicates that the non-separable transform is not used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a spatial domain.
[0269] In some implementations, the third determining unit 1230 is configured to determine a context model index and / or a Rice parameter according to the neighbouring information; and determine the coefficient of the current transform block according to the context model index and / or the Rice parameter.
[0270] In some implementations, the third determining unit 1230 is configured to decode a target parameter in a bitstream according to the context model index and / or the Rice parameter, the target parameter being used for representing the coefficient of the current block; and determine the coefficient of the current transform block according to the target parameter.
[0271] In some implementations, the first information is determined based on one or more of: second information for indicating whether the non-separable transform is used, and the second information being information corresponding to a current coding block; whether a transform skip mode is used for the current transform block; whether different partition trees are used for a luma component and a chroma component; a type of the current transform block; and a type of the current coding block.
[0272] In some implementations, in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, and if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes one of: different partition trees are used for the luma component and the chroma component; and different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block.
[0273] In some implementations, in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non-separable transform is not used for the current transform block. Herein, the second condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block.
[0274] In some implementations, in a case where the current coding block does not belong to a coding block of a preset type, the first information indicates that the non-separable transform is not used for the current transform block.
[0275] In some implementations, the decoder 1200 further includes a parsing unit, configured to, in a case where a third condition is satisfied, parse the second information, where the third condition includes that the current coding block belongs to a coding block of a preset type.
[0276] In some implementations, the coding block of the preset type includes one or more of: intra-coded block, inter-coded block, and Intra Block Copy (IBC) coded block.
[0277] In some implementations, the decoder 1200 further includes a fourth determining unit and a fifth determining unit. The fourth determining unit is configured to determine residual information according to the coefficient of the current transform block; and the fifth determining unit is configured to determine reconstruction information according to the residual information.
[0278] In some implementations, if the first information indicates that the non-separable transform is used for the current transform block, the fourth determining unit is configured to: determine a transform kernel according to angular information of the current transform block; and determine the residual coefficient according to the transform kernel and the coefficient of the current transform block.
[0279] In some implementations, if the current coding block is an inter-coded block or an IBC coded block, the decoder further includes: a sixth determining unit, configured to determine the angular information of the current transform block using a histogram of gradients.
[0280] In some implementations, the current transform block is a luma block or a chroma block.
[0281] In some implementations, the non-separable transform is LFNST or NSPT.
[0282] It is to be understood that in the embodiments of the disclosure, the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and the like, or certainly may be a module, or may also be non-modular. Moreover, the respective components in the embodiment may be integrated into one processing unit, or each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or a software function module.
[0283] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this embodiment essentially, or the part that makes a technical contribution relative to the prior art, or all or part of the technical solutions may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor to perform all or part of the operations of the methods described in the embodiments of the present disclosure. The storage medium includes various media capable of storing program codes, such as USB flash drive, mobile hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or an optical disk.
[0284] Therefore, an embodiment of the disclosure provides a computer-readable storage medium, which applied to the decoder 1200, having stored thereon a computer program that, when executed by a processor, implements the decoding method above.
[0285] Referring to FIG. 13, based on the composition of the decoder 1200 and the computer- readable storage medium described above, it illustrates a schematic diagram showing a specific hardware structure of a decoder according to an embodiment of the disclosure. As shown in FIG. 13, the decoder 1300 may include a communication interface 1310, a memory 1320, and a processor 1330, where the various components are coupled together by a bus system 1340. It may be understood that, the bus system 1340 is configured to implement connection and communication between the components. In addition to a data bus, the bus system 1340 includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus system 1340 in FIG. 13.
[0286] The communication interface 1310 is configured to receive and send signals in the process of sending and receiving information to or from other external network element(s).
[0287] The memory 1320 is configured to store a computer program.
[0288] The processor 1330 is configured to, when running the computer program, perform:
[0289] determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block;
[0290] determining neighbouring information of the current transform block according to the first information; and
[0291] determining a coefficient of the current transform block according to the neighbouring information.
[0292] It is to be understood that the memory 1320 in the embodiments of the disclosure may be either volatile memory or non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory can be Read-Only Memory (ROM), Programmable ROM (PROM), Erasable Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or Flash memory. The volatile memory can be Random Access Memory (RAM), which serves as external high-speed cache. By way of illustration, but not by way of limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchlink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DR RAM). The memory 1320 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable type of memory.
[0293] The processor 1330 of the embodiments of the disclosure may be an integrated circuit chip having signal processing capabilities. In the implementation process, the operations of the above-described methods may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 1330. The processor 1330 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 device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logical block diagrams disclosed in the embodiments of the disclosure may be implemented or executed. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the method disclosed in the embodiments of the disclosure may be directly embodied as execution by a hardware decoding processor, or execution by hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable and writable programmable memory, or register, etc. The storage medium is located in the memory 1320, and the processor 1330 reads information in the memory 1320, and performs the operations of the above methods in combination with its hardware.
[0294] It is to be understood that the embodiments described herein may be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented within 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, micro-controllers, microprocessors, other electronic units designed to perform the functions described in the present disclosure, or a combination thereof. For software implementation, the techniques described herein may be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code may be stored in memory and executed by a processor. The memory may be implemented in the processor or external to the processor.
[0295] Optionally, as another embodiment, the processor 1330 is further configured to perform the decoding method described in the foregoing embodiments, when executing the computer program.
[0296] FIG. 14 is a schematic structural diagram of an encoder according to an embodiment of the disclosure. As shown in FIG. 14, the encoder 1400 includes a first determining unit 1410, a second determining unit 1420, and an encoding unit 1430. The first determining unit 1410 is configured to determine first information, the first information being used for indicating whether non-separable transform is used for a current transform block; the second determining unit 1420 is configured to determine neighbouring information of the current transform block according to the first information; and the encoding unit 1430 is configured to encode a coefficient of the current transform block according to the neighbouring information.
[0297] In some implementations, the first information indicates that the non-separable transform is used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a scanning order.
[0298] In some implementations, the first information indicates that the non-separable transform is not used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a spatial domain.
[0299] In some implementations, the encoding unit 1430 is configured to determine a context model index and / or a Rice parameter according to the neighbouring information; and encode the coefficient of the current transform block according to the context model index and / or the Rice parameter.
[0300] In some implementation, the encoding unit 1430 is configured to signal a target parameter according to the context model index and / or the Rice parameter, the target parameter being used for representing the coefficient of the current block.
[0301] In some implementations, the first information is determined based on one or more of: second information for indicating whether the non-separable transform is used, and the second information being information corresponding to a current coding block; whether a transform skip mode is used for the current transform block; whether different partition trees are used for a luma component and a chroma component; a type of the current transform block; and a type of the current coding block.
[0302] In some implementations, in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, and if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block. Herein, the first condition includes one of: different partition trees are used for the luma component and the chroma component; and different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block.
[0303] In some implementations, in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non-separable transform is not used for the current transform block. Herein, the second condition includes: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block.
[0304] In some implementations, in a case where the current coding block does not belong to a coding block of a preset type, the first information indicates that the non-separable transform is not used for the current transform block.
[0305] In some implementations, the encoding unit 1430 is configured to: in a case where a third condition is satisfied, encode the second information, where the third condition includes that the current coding block belongs to a coding block of a preset type.
[0306] In some implementations, the coding block of the preset type includes one or more of: intra-coded block, inter-coded block, and Intra Block Copy (IBC) coded block.
[0307] In some implementations, the encoder 1400 further includes a third determining unit and a fourth determining unit. The third determining unit is configured to transform the current transform block to determine a transformed coefficient; and the fourth determining unit is configured to quantize the transformed coefficient to determine the coefficient of the current transform block.
[0308] In some implementations, if the first information indicates that the non-separable transform is used for the current transform block, the third determining unit is further configured to: determine a transform kernel according to angular information of the current transform block; and transform the current transform block using the transform kernel to determine the transformed coefficient.
[0309] In some implementations, if the current transform block is an inter transform block or an IBC transform block, the encoder further includes: a fifth determining unit, configured to determine the angular information of the current transform block using a histogram of gradients.
[0310] In some implementations, the current transform block is a luma block or a chroma block.
[0311] In some implementations, the non-separable transform is LFNST or NSPT.
[0312] It is to be understood that in the embodiments of the disclosure, the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, and the like, or certainly may be a module, or may also be non-modular. Moreover, the respective components in the embodiment may be integrated into one processing unit, or each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or a software function module.
[0313] If the integrated unit is implemented in the form of a software functional module and is not sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this embodiment essentially, or the part that makes a technical contribution relative to the prior art, or all or part of the technical solutions may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor to perform all or part of the operations of the methods described in the embodiments of the present disclosure. The storage medium includes various media capable of storing program codes, such as USB flash drive, mobile hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or an optical disk.
[0314] Therefore, an embodiment of the disclosure provides a computer-readable storage medium, which applied to the encoder 1400, having stored thereon a computer program that, when executed by a processor, implements the encoding methods in the embodiments above.
[0315] Referring to FIG. 15, based on the composition of the encoder 1400 and the computer- readable storage medium described above, it illustrates a schematic diagram showing a specific hardware structure of an encoder according to an embodiment of the disclosure. As shown in FIG. 15, the encoder 1500 may include a communication interface 1510, a memory 1520, and a processor 1530, where the various components are coupled together by a bus system 1540. It may be understood that, the bus system 1540 is configured to implement connection and communication between the components. In addition to a data bus, the bus system 1540 includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the bus system 1540 in FIG. 15.
[0316] The communication interface 1510 is configured to receive and send signals in the process of sending and receiving information to or from other external network element(s).
[0317] The memory 1520 is configured to store a computer program.
[0318] The processor 1530 is configured to, when running the computer program, perform:
[0319] determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block;
[0320] determining neighbouring information of the current transform block according to the first information; and
[0321] encoding a coefficient of the current transform block according to the neighbouring information.
[0322] It can be understood that the memory 1520 in the embodiments of the disclosure may be either volatile memory or non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory can be Read-Only Memory (ROM), Programmable ROM (PROM), Erasable Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or Flash memory. The volatile memory can be Random Access Memory (RAM), which serves as external high-speed cache. By way of illustration, but not by way of limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchlink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DR RAM). The memory 1520 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable type of memory.
[0323] The processor 1530 of the embodiments of the disclosure may be an integrated circuit chip having signal processing capabilities. In the implementation process, the operations of the above-described methods may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 1530. The processor 1530 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 device, a discrete gate or transistor logic device, or a discrete hardware component. The methods, steps, and logical block diagrams disclosed in the embodiments of the disclosure may be implemented or executed. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the method disclosed in the embodiments of the disclosure may be directly embodied as execution by a hardware decoding processor, or execution by hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable and writable programmable memory, or register, etc. The storage medium is located in the memory 1520, and the processor 1530 reads information in the memory, and performs the operations of the above methods in combination with its hardware.
[0324] It is to be understood that the embodiments described herein may be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented within 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, micro-controllers, microprocessors, other electronic units designed to perform the functions described in the present disclosure, or a combination thereof. For software implementation, the techniques described herein may be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described herein. The software code may be stored in memory and executed by a processor. The memory may be implemented in the processor or external to the processor.
[0325] Optionally, as another embodiment, the processor 1530 is further configured to perform the encoding methods described in the embodiments above, when executing the computer program.
[0326] It should be noted that in the disclosure, the terms "comprising", "including" or any other variation thereof are intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a list of elements includes not only those elements, but also other elements not explicitly listed or elements inherent to such a process, method, article or apparatus. An element defined by the phrase 'comprising an / a...' does not, without further restriction, exclude the presence of additional identical elements in a process, method, article, or apparatus that includes the element.
[0327] The above serial numbers of the embodiments of the disclosure are only for the purpose of descriptions, and do not represent advantages and disadvantages of the embodiments.
[0328] The methods disclosed in several method embodiments provided in the disclosure can be arbitrarily combined without conflict to obtain new method embodiments.
[0329] The features disclosed in several product embodiments provided in the disclosure can be arbitrarily combined without conflict to obtain new product embodiments.
[0330] The features disclosed in several method or apparatus embodiments provided in the disclosure can be arbitrarily combined without conflict to obtain new method or apparatus embodiments.
[0331] What described above are only the specific implementations of the present disclosure, but the scope of protection of the disclosure is not limited thereto. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the disclosure shall fall within the scope of protection of the disclosure. Therefore, the scope of protection of the disclosure is defined by the scope of protection of the claims.
Claims
1. A decoding method, applied to a decoder, the method comprising: determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block; determining neighbouring information of the current transform block according to the first information; and determining a coefficient of the current transform block according to the neighbouring information.
2. The method of claim 1, wherein the first information indicates that the non-separable transform is used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a scanning order.
3. The method of claim 1, wherein the first information indicates that the non-separable transform is not used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a spatial domain.
4. The method of claim 1, wherein determining the coefficient of the current transform block according to the neighbouring information comprises: determining a context model index and / or a Rice parameter according to the neighbouring information; and determining the coefficient of the current transform block according to the context model index and / or the Rice parameter.
5. The method of claim 4, wherein determining the coefficient of the current transform block according to the context model index and / or the Rice parameter comprises: decoding a target parameter in a bitstream according to the context model index and / or the Rice parameter, the target parameter being used for representing the coefficient of the current block; and determining the coefficient of the current transform block according to the target parameter.
6. The method of any one of claims 1 to 5, wherein the first information is determined based on one or more of: second information for indicating whether the non-separable transform is used, and the second information being information corresponding to a current coding block; whether a transform skip mode is used for the current transform block; whether different partition trees are used for a luma component and a chroma component; a type of the current transform block; and a type of the current coding block.
7. The method of claim 6, wherein in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, and if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block, wherein the first condition comprises one of: different partition trees are used for the luma component and the chroma component; and different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block.
8. The method of claim 6, wherein in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non-separable transform is not used for the current transform block, wherein the second condition comprises: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block.
9. The method of claim 7 or 8, wherein the coding block of the preset type comprises one or more of: intra-coded block, inter-coded block, and Intra Block Copy (IBC) coded block.
10. The method of any one of claims 1 to 9, further comprising: determining residual information according to the coefficient of the current transform block; and determining reconstruction information according to the residual information.
11. The method of any one of claims 1 to 10, wherein the non-separable transform is Low- Frequency Non-Separable Transform (LFNST) or Non-Separable Primary Transform (NSPT).
12. An encoding method, applied to an encoder, the method comprising: determining first information, the first information being used for indicating whether non-separable transform is used for a current transform block; determining neighbouring information of the current transform block according to the first information; and encoding a coefficient of the current transform block according to the neighbouring information.
13. The method of claim 12, wherein the first information indicates that the non-separable transform is used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a scanning order.
14. The method of claim 12, wherein the first information indicates that the non-separable transform is not used for the current transform block, and the neighbouring information is neighbouring information of the current transform block in a spatial domain.
15. The method of claim 12, wherein encoding the coefficient of the current transform block according to the neighbouring information comprises: determining a context model index and / or a Rice parameter according to the neighbouring information; and encoding the coefficient of the current transform block according to the context model index and / or the Rice parameter.
16. The method of claim 15, wherein encoding the coefficient of the current transform block according to the context model index and / or the Rice parameter comprises: signalling a target parameter according to the context model index and / or the Rice parameter, the target parameter being used for representing the coefficient of the current block.
17. The method of any one of claims 12 to 15, wherein the first information is determined based on one or more of: second information for indicating whether the non-separable transform is used, and the second information being information corresponding to a current coding block; whether a transform skip mode is used for the current transform block; whether different partition trees are used for a luma component and a chroma component; a type of the current transform block; and a type of the current coding block.
18. The method of claim 17, wherein in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, and if a first condition is satisfied, the first information indicates that the non-separable transform is used for the current transform block, wherein the first condition comprises one of: different partition trees are used for the luma component and the chroma component; and different partition trees are not used for the luma component and the chroma component, and the current transform block is a luma block.
19. The method of claim 17, wherein in a case where the current coding block belongs to a coding block of a preset type, a transform skip mode is not used for the current transform block and the second information indicates that the non-separable transform mode is used, if a second condition is satisfied, the first information indicates that the non-separable transform is not used for the current transform block, wherein the second condition comprises: different partition trees are not used for the luma component and the chroma component, and the current transform block is a chroma block.
20. A non-volatile computer-readable storage medium having stored thereon a computer program and a bitstream, wherein when the computer program is executed by a processor, the computer program implements the decoding method of any one of claims 1 to 11 to decode the bitstream to generate a video or an image or implements the encoding method of claim 12 to generate the bitstream.