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

The new SBT partitioning method solves the problem of low transform efficiency caused by mismatch in inter-frame prediction residual distribution, effectively concentrates residual energy, and improves transform coding efficiency.

WO2026086029A1PCT designated stage Publication Date: 2026-04-30HISENSE VISUAL TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HISENSE VISUAL TECH CO LTD
Filing Date
2025-01-08
Publication Date
2026-04-30

Smart Images

  • Figure CN2025071294_30042026_PF_FP_ABST
    Figure CN2025071294_30042026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an encoding method, a decoding method, an encoder, a decoder, a chip, a bitstream and a storage medium, which can improve the transform efficiency of transform encoding. The decoding method comprises: determining a first sub-block in a current CU, wherein one edge of the first sub-block partially coincides with one edge of the current CU, and the other edges of the first sub-block do not coincide with any edge of the current CU; and performing inverse transform on transform coefficients of the first sub-block, in order to obtain residual information corresponding to the first sub-block.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding and decoding methods, codecs, chips, bitstreams, and storage media

[0001] This application claims priority to Chinese patent applications filed on October 22, 2024, with application number 202411480359.3 and entitled "Encoding / Decoding Method, Encoder / Decoder, Chip, Bitstream and Storage Medium", and on October 22, 2024, with application number 202411480156.4 and entitled "Video Decoding Method, Video Encoding Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of video encoding and decoding, and more particularly to an encoding and decoding method, codec, chip, bitstream, and storage medium. Background Technology

[0003] Statistically, the residual energy of inter-frame prediction increases from the center of the predicted block towards the boundary. Furthermore, in many cases, the residual from inter-frame prediction is concentrated at a specific edge of the block, rather than distributed around the entire block boundary. If the transformation is still performed on the entire block, the energy cannot be effectively concentrated when the block and residual edge positions do not match (e.g., the residual region is part of the block), resulting in low transformation efficiency. Therefore, in H.266 / VVC, the sub-block transform (SBT) technique was introduced.

[0004] The current SBT mode is mainly designed for cases where residual energy is concentrated on one side of the residual block. The SBT mode can only be selected when the inter-frame residual distribution matches the SBT mode. For other types of residual distributions, the transformation effect using these SBT modes is not ideal. Summary of the Invention

[0005] Some embodiments of this application provide an encoding / decoding method, an encoding / decoding method, a chip, a bitstream, and a storage medium that can improve the transformation efficiency of transformation encoding.

[0006] In a first aspect, a decoding method is provided, applied to a decoder, comprising: determining a first sub-block in a current coding unit (CU), wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; and performing an inverse transform on the transform coefficients of the first sub-block to obtain residual information corresponding to the first sub-block.

[0007] Secondly, an encoding method is provided for an encoder, comprising: determining a first sub-block in a current encoding unit (CU), wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; and transforming the residual information of the first sub-block to obtain the transform coefficients of the first sub-block.

[0008] Thirdly, a decoder is provided, comprising: a determining unit configured to determine a first sub-block in a current encoding unit (CU), wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; and an inverse transform unit configured to perform an inverse transform on the transform coefficients of the first sub-block to obtain residual information corresponding to the first sub-block.

[0009] Fourthly, a decoder is provided, comprising: a memory for storing a computer program; and a processor for executing the method of the first aspect when running the computer program.

[0010] Fifthly, an encoder is provided, comprising: a determining unit configured to determine a first sub-block in a current encoding unit (CU), wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; and a transforming unit configured to transform the residual information of the first sub-block to obtain transform coefficients of the first sub-block.

[0011] In a sixth aspect, an encoder is provided, comprising: a memory for storing a computer program; and a processor for executing the method of the second aspect when running the computer program.

[0012] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program that, when executed, implements the method as described in the first or second aspect.

[0013] Eighthly, a computer program product is provided, including a computer program that, when executed, implements the method as described in the first or second aspect.

[0014] A ninth aspect provides a non-volatile computer-readable storage medium for storing bit streams, the bit streams being generated by an encoding method using an encoder, or the bit streams being decoded by a decoding method using a decoder, wherein the decoding method is the method described in the first aspect and the encoding method is the method described in the second aspect.

[0015] A tenth aspect is provided: a computer-readable storage medium storing a computer program that, when executed, implements the method as described in the first aspect or the second aspect.

[0016] In an eleventh aspect, a bitstream is provided, including a bitstream generated according to the method described in the second aspect.

[0017] In a twelfth aspect, a decoding chip is provided, the chip including a memory and a processor, the processor being configured to retrieve and execute a program or instructions from the memory to implement some or all of the steps described in the first aspect above.

[0018] In a thirteenth aspect, an encoding chip is provided, the chip including a memory and a processor, the processor being used to call and run a program or instructions from the memory to implement some or all of the steps described in the second aspect above.

[0019] Some embodiments of this application introduce a novel SBT partitioning method. Using this new SBT partitioning method, a first sub-block can be obtained. One edge of the first sub-block partially overlaps with one edge of the CU, and the remaining edges do not overlap with any edge of the CU. That is, the first sub-block can be located in the middle region of a certain edge of the CU. When the residual energy is distributed in the middle region of a certain edge of the CU, the first sub-block can match the residual position, thereby enabling the energy to be more effectively concentrated, which is beneficial to improving the transformation efficiency. Attached Figure Description

[0020] Figure 1 is a structural example diagram of a video encoder to which some embodiments of this application can be applied;

[0021] Figure 2 is a structural example diagram of a video decoder that can be applied to some embodiments of this application;

[0022] Figure 3 is a schematic diagram of transformation using SBT partitioning technique;

[0023] Figure 4 illustrates the relevant steps of the SBT technology;

[0024] Figure 5 shows the structure of the eight SBT modes;

[0025] Figure 6 shows the structure of the corner SBT pattern;

[0026] Figure 7 shows the structure of the central SBT mode;

[0027] Figure 8 is a schematic diagram of the structure of four SBT modes provided in some embodiments of this application;

[0028] Figure 9 is a structural schematic diagram of four other SBT modes provided in some embodiments of this application;

[0029] Figure 10 is a structural schematic diagram of four more SBT modes provided in some embodiments of this application;

[0030] Figure 11 is a flowchart illustrating a decoding method provided in some embodiments of this application;

[0031] Figure 12 is a schematic diagram of a specific division method for the upper and lower division method provided in some embodiments of this application;

[0032] Figure 13 is a schematic diagram of a specific division method for left and right division provided in some embodiments of this application;

[0033] Figure 14 is a schematic diagram of the base image transformed according to some embodiments of this application using a transformation kernel;

[0034] Figure 15 is a flowchart illustrating an encoding method provided in some embodiments of this application;

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

[0036] Figure 17 is a schematic diagram of the decoder provided in another embodiment of this application;

[0037] Figure 18 is a schematic diagram of the encoder provided in an embodiment of this application;

[0038] Figure 19 is a schematic diagram of the encoder provided in another embodiment of this application. Detailed Implementation

[0039] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0040] Figure 1 is a schematic block diagram of a video encoder involved in some embodiments of this application.

[0041] It should be understood that the video encoder 100 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.

[0042] This video encoder 100 can be applied to image data in luminance / chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).

[0043] For example, the video encoder 100 reads video data and, for each image in the video data, divides the image into several coding tree units (CTUs). In some examples, a CTU may be called a "tree block," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU can be further divided into several coding units (CUs) for encoding. CUs can be rectangular or square blocks. CUs can correspond to prediction units (PUs) and transform units (TUs).

[0044] In some embodiments, the current block may be referred to as the current coding unit (CU). A prediction block may also be referred to as a prediction image block or image prediction block, and a reconstructed image block may also be referred to as a reconstruction block or image reconstruction block. Due to the need for parallel processing, an image can be divided into slices. Slices within the same image can be processed in parallel, meaning they have no data dependency on each other. A "frame" is a commonly used term, generally understood as one image. In this document, "frame" can also be replaced with "image" or "slice," etc.

[0045] The video encoder 100 in some embodiments of this application will be described below with reference to Figure 1.

[0046] In some embodiments, the video encoder 100 may include a prediction module 110. The prediction module 110 includes an inter-frame prediction module 111 and an intra-frame prediction module 112. Because there is a strong correlation between adjacent pixels in an image of a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-frame prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent images, thereby improving encoding efficiency.

[0047] The inter-frame prediction module 111 can be used for inter-frame prediction, which can include motion estimation and motion compensation. It can reference image information from different images. Inter-frame prediction uses motion information to find reference blocks in the reference images and generates prediction blocks based on these reference blocks to eliminate temporal redundancy. The motion information includes a list of reference images, the reference image index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering needs to be used in the reference image to create the required fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks in the reference image found based on the motion vectors are called reference blocks. Some techniques use reference blocks as prediction blocks, while others process the reference blocks further to generate prediction blocks. Processing the reference blocks further to generate prediction blocks can also be understood as using the reference blocks as prediction blocks and then processing them to generate new prediction blocks.

[0048] The intra-frame prediction module 112 refers only to information from the same image to predict pixel information within the current image block, thereby eliminating spatial redundancy.

[0049] Intra-frame prediction has multiple prediction modes. Taking the international digital video coding standards H-series as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC extends this to 33 angular prediction modes and 2 non-angular prediction modes. High Efficiency Video Coding (HEVC) uses Planar, DC, and 33 angular modes, for a total of 35 prediction modes. Versatile Video Coding (VVC) uses Planar, DC, and 65 angular modes, for a total of 67 prediction modes.

[0050] It should be noted that with the increase in angle modes, intra-frame prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video.

[0051] In some embodiments, the video encoder 100 may include a residual module 120. The residual module 120 may generate a residual block of the CU based on pixel blocks of the CU and prediction blocks 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 the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the CU. The residual block can also be understood as residual information.

[0052] In some embodiments, the video encoder 100 may include a transformation module 125. The transformation module 125 can transform the residual information generated by the residual module 120 to obtain transformation coefficients.

[0053] In some embodiments, the video encoder 100 may include a quantization module 130. The quantization module 130 quantizes transform coefficients. The quantization module 130 quantizes the transform coefficients associated with the CU based on a quantization parameter (QP) value associated with the CU. The video encoder 100 can adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0054] In some embodiments, the video encoder 100 may include an inverse quantization module 135. The inverse quantization module 135 can apply inverse quantization to the quantized transform coefficients to obtain the transform coefficients.

[0055] In some embodiments, the video encoder 100 may include an inverse transform module 140. The inverse transform module 140 applies an inverse transform to the transform coefficients, which can be used to reconstruct the residual block.

[0056] In some embodiments, the video encoder 100 may include a reconstruction module 150. The reconstruction module 150 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction module 110 to generate reconstructed image blocks associated with the CU. By reconstructing each sample block of the CU in this manner, the video encoder 100 can reconstruct the pixel blocks of the CU.

[0057] In some embodiments, the video encoder 100 may include a loop filter module 160. The loop filter module 160 is used to process the pixels after inverse transform and inverse quantization to compensate for distortion information and provide a better reference for subsequent encoded pixels. For example, it may perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU.

[0058] In some embodiments, the loop filtering module 160 includes a deblocking filtering module. The deblocking filtering module is used to remove block artifacts. Block artifacts refer to the discontinuities at the boundaries of coded blocks in an image. The deblocking filtering module can smooth the block boundaries to effectively reduce or remove block artifacts.

[0059] In some embodiments, the loop filtering module 160 includes a sample adaptive offset (SAO) module. The SAO module can be used to remove ringing effects. For strong edges in an image, due to quantization distortion of the high-frequency AC coefficients, a ripple effect will be generated around the edges after decoding; this distortion can be called ringing. The SAO module can suppress ringing effects from the pixel domain perspective.

[0060] In some embodiments, the loop filtering module 160 includes an adaptive loop filter (ALF) module, which is used to remove ringing effects. ALF technology can include luma ALF, chroma ALF, and inter-component ALF. ALF can be based on the Wiener filtering principle, using the original image information and reconstructed image information to establish the Wiener-Hough equation and solve for a series of filter coefficients with the minimum mean square error to remove ringing effects.

[0061] In some embodiments, the video encoder 100 may include a decoded image buffer 170. The decoded image buffer 170 may store reconstructed pixel blocks. The inter-frame prediction module 111 may use a reference image containing the reconstructed pixel blocks to perform inter-frame prediction on PUs of other images. In addition, the intra-frame prediction module 112 may use the reconstructed pixel blocks in the decoded image buffer 170 to perform intra-frame prediction on other PUs in the same image as the CU.

[0062] In some embodiments, the video encoder 100 may include an entropy coding module 180. The entropy coding module 180 may receive quantized transform coefficients from the quantization module 130. The entropy coding module 180 may perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.

[0063] Figure 2 is a schematic block diagram of a video decoder involved in some embodiments of this application.

[0064] Video decoder 200 can receive a bitstream. In some embodiments, video decoder 200 may include an entropy decoding module 210. Entropy decoding module 210 can parse the bitstream to extract syntax elements from it. As part of parsing the bitstream, entropy decoding module 210 can parse the entropy-encoded syntax elements in the bitstream. Prediction module 220, inverse quantization module 230, inverse transform module 235, reconstruction module 240, and loop filtering module 250 can decode video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.

[0065] In some embodiments, the video decoder 200 may include a prediction module 220. The prediction module 220 includes an intra-frame prediction module 222 and an inter-frame prediction module 221.

[0066] Intra-prediction module 222 can perform intra-prediction to generate prediction blocks for PUs. Intra-prediction module 222 can use intra-prediction modes to generate prediction blocks for PUs based on pixel blocks of spatially adjacent PUs. Intra-prediction module 222 can also determine the intra-prediction mode of PUs based on one or more syntax elements parsed from the bitstream.

[0067] Inter-frame prediction module 221 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter-frame prediction coding, entropy decoding module 210 can parse the motion information of the PU. Inter-frame prediction module 221 can determine one or more reference blocks of the PU based on the motion information of the PU. Inter-frame prediction module 221 can generate prediction blocks for the PU based on one or more reference blocks of the PU.

[0068] In some embodiments, the video decoder 200 may include an inverse quantization module 230. The inverse quantization module 230 applies inverse quantization to the quantized transform coefficients to obtain the transform coefficients. The inverse quantization module 230 may use the QP value associated with the CU of the TU to determine the degree of quantization.

[0069] In some embodiments, the video decoder 200 may include an inverse transform module 235. The inverse transform module 235 can inversely transform the transform coefficients associated with the TU. After performing the inverse transform on the transform coefficients, the inverse transform module 235 can generate a residual block associated with the TU.

[0070] In some embodiments, the video decoder 200 may include a reconstruction module 240. The reconstruction module 240 uses a residual block associated with the TU of the CU and a prediction block of the PU of the CU to reconstruct pixel blocks of the CU. For example, the reconstruction module 240 may add samples of the residual block to the corresponding samples of the prediction block to reconstruct pixel blocks of the CU, thereby obtaining reconstructed image blocks.

[0071] In some embodiments, the video decoder 200 may include a loop filter module 250. The loop filter module 250 may perform deblocking filtering operations to reduce the block artifacts of pixel blocks associated with the CU.

[0072] In some embodiments, the video decoder 200 may include a decoded image buffer 260. The video decoder 200 may store the reconstructed image of the CU in the decoded image buffer 260. The video decoder 200 may use the reconstructed image in the decoded image buffer 260 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0073] The basic process of video encoding and decoding is as follows: At the encoding end, an image is divided into blocks. For the current block, the prediction module 110 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. The residual module 120 can calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. This residual block can also be called residual information. Through the transformation process of the transformation module 125 and the quantization process of the quantization module 130, the residual block can remove information that is not sensitive to the human eye, thereby eliminating visual redundancy. In some embodiments, the residual block before transformation by the transformation module 125 can be called a temporal residual block, and the temporal residual block after quantization by the quantization module 130 can be called a frequency residual block or a frequency domain residual block. The entropy coding module 180 receives the quantized transformation coefficients output by the quantization module 130 and can perform entropy coding on the quantized transformation coefficients to output a bitstream. For example, the entropy coding module 180 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.

[0074] At the decoding end, the entropy decoding module 210 parses the bitstream to obtain the prediction information and quantization coefficient matrix of the current block. The prediction module 220 uses the prediction information to generate a prediction block for the current block using intra-frame prediction or inter-frame prediction. The inverse quantization module 230 uses the quantization coefficient matrix obtained from the bitstream to inverse quantize the quantization coefficient matrix to obtain transform coefficients; the inverse transform module 235 performs an inverse transform on the transform coefficients 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 form a reconstructed image. The loop filtering module 250 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain a decoded image. The encoding end also requires similar operations to the decoding end to obtain a decoded image. This decoded image can also be called a reconstructed image, which can be used as a reference image for inter-frame prediction of subsequent images.

[0075] It should be noted that the block partitioning information determined at the encoding end, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding end by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.

[0076] It is understandable that the "inverse transformation" of the transform coefficients at the decoding end can also be referred to as "transformation" in the standard text. In some embodiments of this application, "transformation" and "inverse transformation" correspond to two opposite processes. For example, "transformation" converts the spatial domain values ​​to frequency domain coefficients, while "inverse transformation" converts the frequency domain coefficients back to spatial domain values. If the standard only specifies decoding, then "transformation" in the standard text refers to the decoding part, specifically the "inverse transformation" in this document. The "inverse transformation" of the transform coefficients at the decoding end can also be referred to as "transformation" in the standard text.

[0077] The above describes the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. This application is applicable to the basic flow of a video codec under this block-based hybrid coding framework, but is not limited to this framework and flow.

[0078] The preceding text has described in detail the encoding and decoding frameworks provided by some embodiments of this application. As mentioned above, during encoding, prediction is usually performed first. Prediction refers to obtaining a predicted block that is the same as or similar to the current block based on the spatial or temporal correlation properties of the image. There are many prediction methods, such as intra-frame prediction and inter-frame prediction.

[0079] It's possible for a predicted block and the original block to be completely identical for a given coded block. However, it's difficult to guarantee that the predicted blocks of all coded blocks in a video will be identical to the original blocks. Especially for natural videos, or videos captured by a camera, the predicted blocks and original blocks usually differ. Irregular motion, distortion, occlusion, brightness variations, and other changes in the video are difficult to predict completely. Therefore, hybrid coding frameworks subtract the predicted block from the original block of the current block to obtain a residual block. The residual block is usually much simpler than the original block, thus using prediction can significantly improve compression efficiency. After obtaining the residual block, the encoder typically doesn't encode it but first performs a transform. The transform converts the residual block from the spatial domain to the frequency domain. After the residual block is transformed to the frequency domain, most of the residual energy is concentrated in certain regions, rather than all regions of the current block.

[0080] For inter-frame prediction, residual energy increases from the center of the prediction block towards the boundary. In many cases, the inter-frame prediction residual is concentrated at a certain edge of the block, rather than distributed around the entire block boundary. Therefore, based on the characteristics of the inter-frame prediction residual, the H.266 / VVC transform coding module allows the use of SBT (Single-Bit Transform) technique for CUs employing inter-frame prediction, i.e., transforming only the prediction residual of a portion of the CU.

[0081] The basic principle of SBT is shown in Figure 3. SBT technology assumes that a portion of the residuals in the current block are very small and can be treated as zero. Therefore, the CU can be divided into two TUs. Only the prediction residuals of one TU are transformed and quantized, while the prediction residuals of the other TU are set to zero and not processed. For the selected TU, a transformation kernel can be determined based on its partitioning method and the information of the selected location. A TU can also be called a sub-block.

[0082] Referring to Figure 3, TU can be divided into TU1 and TU2. During the transformation, only the prediction residual of TU1 can be transformed, while the prediction residual of TU2 is set to 0.

[0083] SBT technology involves two steps: TU partitioning and transformation kernel determination, as shown in Figure 4. This transformation kernel can also be called an implicit transformation kernel. The two steps are described below.

[0084] TU division

[0085] In H.266 / VVC, SBT has two partitioning methods, each with two partitioning ratios and two positions, resulting in a total of 8 SBT patterns, as shown in Figure 5.

[0086] The two partitioning methods are vertical partitioning (SBT-V) and horizontal partitioning (SBT-H). Figures (a) and (c) in Figure 5 show vertical partitioning, while Figures (b) and (d) show horizontal partitioning.

[0087] The two partitioning ratios are 2:2 and 1:3 (or 3:1). A 2:2 partition means that the width (or height) of the partitioned TU may be equal to half the width (or height) of the partitioned CU. A 1:3 or 3:1 partition means that the width (or height) of the partitioned TU may be equal to one-quarter the width (or height) of the partitioned CU. In a 1:3 or 3:1 partition, only the residuals of the smaller regions are retained, while the residuals of the larger regions are set to 0.

[0088] The divided TU has two positions: position 0 and position 1. Position 0 indicates that the TU is the left or top piece, and position 1 indicates that the TU is the right or bottom piece.

[0089] SBT partitioning imposes certain constraints on the dimensions of the CU. For example, for a 2:2 vertical (or horizontal) partition, the CU's width (or height) must be greater than or equal to 8. Similarly, for a 1:3 or 3:1 vertical (or horizontal) partition, the CU's width (or height) must be greater than or equal to 16. Therefore, the basic condition for performing SBT is that the CU's width or height must be greater than or equal to 8.

[0090] In H.266 / VVC, the SPS layer defines the Subblock Transform (SBT) enable flag (sps_sbt_enabled_flag). When the SPS layer enables SBT, the CU layer's cu_sbt_flag indicates whether the current CU is performing SBT. If SBT is performed, the CU layer will further indicate the SBT partitioning method and the selected position of the TU.

[0091] The eight modes of SBT can be distinguished by three flags: cu_sbt_quad_flag, cu_sbt_pos_flag, and cu_sbt_horizontal_flag.

[0092] `cu_sbt_quad_flag` is used to identify the partitioning method of the current sub-block. A value of 1 indicates a 1:3 or 3:1 partitioning method; a value of 0 indicates a 2:2 partitioning method.

[0093] `cu_sbt_pos_flag` is used to identify the position of the currently selected sub-block. A value of 1 for `cu_sbt_pos_flag` indicates that the second sub-block (i.e., the right block or the bottom block) is selected; a value of 0 for `cu_sbt_pos_flag` indicates that the first sub-block (i.e., the left block or the top block) is selected.

[0094] `cu_sbt_horizontal_flag` is used to identify the partitioning method of the current sub-block. A value of 1 indicates a horizontal partition; a value of 0 indicates a vertical partition.

[0095] The specific process of SBT mode encoding can be shown in Figure 1.

[0096] Table 1

[0097] Determining the implicit transformation kernel

[0098] Currently, commonly used transformation methods include the discrete cosine transform (DCT) and the discrete sine transform (DST).

[0099] The DCT transform includes eight types of transforms, namely DCT-1 to DCT-8. The transform formulas involved in DCT-1 to DCT-8 are introduced below.

[0100] The transformation formula corresponding to DCT-1 is:

[0101] The transformation formula corresponding to DCT-2 is:

[0102] The transformation formula corresponding to DCT-3 is:

[0103] The transformation formula corresponding to DCT-4 is:

[0104] The transformation formula corresponding to DCT-5 is:

[0105] The transformation formula corresponding to DCT-6 is:

[0106] The transformation formula corresponding to DCT-7 is:

[0107] The transformation formula corresponding to DCT-8 is:

[0108] Wherein, ε and η in the above formula satisfy the following formula:

[0109] Of the eight types of DCTs mentioned above, the first four correspond to even-order real-even discrete Fourier transforms (DFTs), while the latter four correspond to odd-order real-even DFTs. A real-even DFT indicates that the input signal is a real number and is an even function.

[0110] Similar to DCT, DST also has eight types of transformations, namely DST1 to DST8. The transformation formulas involved in DST-1 to DST-8 are introduced below.

[0111] The transformation formula corresponding to DST-1 is:

[0112] The transformation formula corresponding to DST-2 is:

[0113] The transformation formula corresponding to DST-3 is:

[0114] The transformation formula corresponding to DST-4 is:

[0115] The transformation formula corresponding to DST-5 is:

[0116] The transformation formula corresponding to DST-6 is:

[0117] The transformation formula corresponding to DST-7 is:

[0118] The transformation formula corresponding to DST-8 is:

[0119] Wherein, ε and η in the above formula satisfy the following formula:

[0120] Of the eight types of DSTs mentioned above, the first four correspond to even-order real odd DFTs, and the latter four correspond to odd-order real odd DFTs. A real odd DFT indicates that the input signal is a real number and is an odd function.

[0121] Images are generally two-dimensional. Performing two-dimensional transformations on an image results in extremely high computational and memory overhead, which current hardware cannot support. Therefore, current standards employ one-dimensional transformations. This means splitting the two-dimensional transformation into two one-dimensional transformations in the horizontal and vertical directions, performing them in two steps. For example, the horizontal transformation can be performed first, followed by the vertical transformation. Alternatively, the vertical transformation can be performed first, followed by the horizontal transformation.

[0122] Each transform scheme can include multiple transform kernels. A transform kernel can be applied individually to the horizontal or vertical transform. For a code block, the encoder can select a suitable transform kernel and transmit its index to the bitstream; the decoder can then determine the inverse transform kernel based on the index. Different transform kernels can be selected for horizontal and vertical transforms. For example, DCT8 can be used for the horizontal transform, while DST7 can be used for the vertical transform. The technique of selecting a suitable transform scheme from the multiple transform schemes mentioned above is commonly referred to as multiple transform selection (MTS).

[0123] The SBT transform kernel of the luma block is implicitly determined by the sub-block partitioning method and the position of the selected sub-block, as shown in Table 2. Furthermore, when the width or height of the TU after SBT partitioning is greater than 32, DCT-2 transform is used in both the vertical and horizontal directions, because DST-7 and DCT-8 only support a maximum of 32-point transform.

[0124] Table 2

[0125] When performing SBT on chroma blocks, only the DCT-2 transform kernel can be used.

[0126] As shown in Table 2, if the SBT-V partitioning method is used and the selected sub-block is at Position 0, the horizontal transform kernel is DCT-8 and the vertical transform kernel is DST-7. If the SBT-V partitioning method is used and the selected sub-block is at Position 1, the horizontal transform kernel is DST-7 and the vertical transform kernel is DST-7. If the SBT-H partitioning method is used and the selected sub-block is at Position 0, the horizontal transform kernel is DST-7 and the vertical transform kernel is DCT-8. If the SBT-H partitioning method is used and the selected sub-block is at Position 1, the horizontal transform kernel is DST-7 and the vertical transform kernel is DST-7.

[0127] Corner and center subblock transformations for SBT

[0128] At the 35th (AI) meeting of the Joint Video Experts Team (JEVT), proposal JVET-AI0282 proposed incorporating corner and center block partitioning into SBT technology. The corner and center block partitioning technology is described in detail below.

[0129] TU division

[0130] Proposal JVET-AI0282 adds corner and center block partitioning modes to the original eight modes of SBT technology, as shown in Figures 6 and 7.

[0131] For the Corner mode, the size of the child block can be 1 / 2 CU width × 1 / 2 CU height, or 1 / 4 CU width × 1 / 4 CU height. There are a total of 4 positions for the child block, namely top left (position 0), top right (position 1), bottom left (position 2), and bottom right (position 3), as shown in Figure 6.

[0132] For the center block mode, the sub-block size can be 1 / 2 CU width × 1 / 2 CU height, as shown in Figure 7. Non-zero residual sub-blocks can only be located in the center position, so there is no need to encode the position of the sub-blocks.

[0133] SBT partitioning imposes some restrictions on the size of the CU. When the size of the sub-block is 1 / 2 CU width × 1 / 2 CU height, the width and height of the CU must be greater than or equal to 8; when the size of the sub-block is 1 / 4 CU width × 1 / 4 CU height, the width and height of the CU must be greater than or equal to 16.

[0134] As mentioned above, nine new modes have been added to SBT, namely a center mode and a 4×2 corner mode.

[0135] For the nine newly added modes, the transform kernel corresponding to the luma block is still implicitly determined by the sub-block partitioning method and the selected position, and their correspondence is shown in Table 3. When performing SBT on the chroma block, only the DCT-2 transform kernel is used.

[0136] Table 3

[0137] As shown in Table 3, if the corner partitioning method is used and the selected sub-block is at Position 0, the horizontal transform kernel is DCT-8 and the vertical transform kernel is DCT-8. If the corner partitioning method is used and the selected sub-block is at Position 1, the horizontal transform kernel is DST-7 and the vertical transform kernel is DCT-8. If the corner partitioning method is used and the selected sub-block is at Position 2, the horizontal transform kernel is DCT-8 and the vertical transform kernel is DST-7. If the corner partitioning method is used and the selected sub-block is at Position 3, the horizontal transform kernel is DST-7 and the vertical transform kernel is DST-7. If the center partitioning method is used, the horizontal transform kernel is DST-1 and the vertical transform kernel is DST-1.

[0138] Statistically, the residual energy of inter-frame prediction increases from the center of the predicted block towards the boundary. Furthermore, in many cases, the residual from inter-frame prediction is concentrated at a specific edge of the block, rather than distributed around the entire block boundary. If the entire block is still transformed, when the block and residual edge positions do not match (e.g., the residual region is part of the block), the energy cannot be effectively concentrated, leading to low transformation efficiency. Therefore, the SBT technique was introduced in H.266 / VVC.

[0139] However, in H.266 / VVC, the current SBT mode is mainly designed for cases where residual energy is concentrated on one side of the residual block. SBT mode is only selected when the inter-frame residual distribution matches one of the eight modes. For other types of residual distributions, the transformation effect using these eight modes is not ideal. Therefore, adding more SBT partitioning modes can better match the diverse inter-frame residual distributions.

[0140] Although corner and center block partitioning patterns have been introduced, some residual distributions still cannot be matched with the current SBT pattern. For example, when the residual distribution is in the middle of one side of the CU, the current SBT pattern cannot match this residual distribution well, resulting in inefficient energy concentration and low conversion efficiency.

[0141] To address the aforementioned issues, some embodiments of this application provide an encoding method, comprising: determining a first sub-block in the current CU, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; and transforming the residual information of the first sub-block to obtain the transformation coefficients of the first sub-block.

[0142] Furthermore, some embodiments of this application also provide a decoding method, including: determining a first sub-block in the current CU, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; performing an inverse transformation on the transformation coefficients of the first sub-block to obtain the residual information corresponding to the first sub-block.

[0143] Some embodiments of this application introduce a novel SBT partitioning method. Using this new SBT partitioning method, a first sub-block can be obtained. One edge of the first sub-block partially overlaps with one edge of the CU, and the remaining edges do not overlap with any edge of the CU. That is, the first sub-block can be located in the middle region of a certain edge of the CU. When the residual energy is distributed in the middle region of a certain edge of the CU, the first sub-block can match the residual position, thereby enabling the energy to be more effectively concentrated, which is beneficial to improving the transformation efficiency.

[0144] The following section, using Figures 8 and 9 as examples, will provide a detailed introduction to the first sub-block, taking a square as the example.

[0145] Based on the different sizes of the first sub-block, the partitioning patterns can be divided into three main categories. In the first category, the size of the first sub-block is 1 / 2 CU width × 1 / 2 CU height, as shown in Figure 8. In the second category, the size of the first sub-block is either 1 / 2 CU width × 1 / 4 CU height or 1 / 4 CU width × 1 / 2 CU height, as shown in Figure 9. In the third category, the size of the first sub-block is 1 / 4 CU width × 1 / 4 CU height, as shown in Figure 10.

[0146] As shown in Figure 8, the first type of partitioning pattern can include four SBT patterns, namely Figure (a), Figure (b), Figure (c), and Figure (d) in Figure 8.

[0147] In Figure 8(a), the first sub-block is located above the CU. The top edge of the first sub-block partially overlaps with the top edge of the CU, and the remaining three edges of the first sub-block do not overlap with any edge of the CU. The top edge of the first sub-block overlaps with the top edge of the CU, and the length of the top edge of the first sub-block is less than the length of the top edge of the CU. The left edge of the first sub-block is parallel to the left edge of the CU and is separated from it. The right edge of the first sub-block is parallel to the right edge of the CU and is separated from it. The bottom edge of the first sub-block is parallel to the bottom edge of the CU and is separated from it.

[0148] In Figure 8(a), the line connecting the center of the first sub-block and the center of CU is a vertical line. In other words, the distance between the left side of the first sub-block and the left side of CU is equal to the distance between the right side of the first sub-block and the right side of CU. In other words, the midpoint of the upper side of the first sub-block coincides with the midpoint of the upper side of CU.

[0149] In Figure 8(b), the first sub-block is located below the CU. The bottom edge of the first sub-block partially overlaps with the bottom edge of the CU, and the remaining three edges of the first sub-block do not overlap with any edge of the CU. The bottom edge of the first sub-block overlaps with the bottom edge of the CU, and the length of the bottom edge of the first sub-block is less than the length of the bottom edge of the CU. The left edge of the first sub-block is parallel to the left edge of the CU and is separated from it. The right edge of the first sub-block is parallel to the right edge of the CU and is separated from it. The top edge of the first sub-block is parallel to the top edge of the CU and is separated from it.

[0150] In Figure 8(b), the line connecting the center of the first sub-block and the center of CU is a vertical line. In other words, the distance between the left side of the first sub-block and the left side of CU is equal to the distance between the right side of the first sub-block and the right side of CU. Or, the midpoint of the lower side of the first sub-block coincides with the midpoint of the lower side of CU.

[0151] In Figure 8(c), the first sub-block is located to the left of CU. The left side of the first sub-block partially overlaps with the left side of CU, and the remaining three sides of the first sub-block do not overlap with any side of CU. The left side of the first sub-block overlaps with the left side of CU, and the length of the left side of the first sub-block is less than the length of the left side of CU. The right side of the first sub-block is parallel to the right side of CU and is separated from it. The top side of the first sub-block is parallel to the top side of CU and is separated from it. The bottom side of the first sub-block is parallel to the bottom side of CU and is separated from it.

[0152] In Figure 8(c), the line connecting the center of the first sub-block and the center of the CU is a horizontal line. In other words, the distance between the upper side of the first sub-block and the upper side of the CU is equal to the distance between the lower side of the first sub-block and the lower side of the CU. Or, the midpoint of the left side of the first sub-block coincides with the midpoint of the left side of the CU.

[0153] In Figure 8(d), the first sub-block is located to the right of CU. The right side of the first sub-block partially overlaps with the right side of CU, and the remaining three sides of the first sub-block do not overlap with any side of CU. The right side of the first sub-block overlaps with the right side of CU, and the length of the right side of the first sub-block is less than the length of the right side of CU. The left side of the first sub-block is parallel to the left side of CU and is separated from it. The top side of the first sub-block is parallel to the top side of CU and is separated from it. The bottom side of the first sub-block is parallel to the bottom side of CU and is separated from it.

[0154] In Figure 8(d), the line connecting the center of the first sub-block and the center of CU is a horizontal line. In other words, the distance between the upper side of the first sub-block and the upper side of CU is equal to the distance between the lower side of the first sub-block and the lower side of CU. Or, the midpoint of the right side of the first sub-block coincides with the midpoint of the right side of CU.

[0155] In Figure 8, the width of the first sub-block is equal to half the width of the CU, and the height of the first sub-block is equal to half the height of the CU. That is to say, the size of the first sub-block is 1 / 2 CU width × 1 / 2 CU height.

[0156] As shown in Figure 9, the first category of partitioning patterns can include four SBT patterns, namely (a), (b), (c), and (d) in Figure 9.

[0157] In Figure 9(a), the first sub-block is located above the CU. The top edge of the first sub-block partially overlaps with the top edge of the CU, and the remaining three edges of the first sub-block do not overlap with any edge of the CU. The top edge of the first sub-block overlaps with the top edge of the CU, and the length of the top edge of the first sub-block is less than the length of the top edge of the CU. The left edge of the first sub-block is parallel to the left edge of the CU and is separated from it. The right edge of the first sub-block is parallel to the right edge of the CU and is separated from it. The bottom edge of the first sub-block is parallel to the bottom edge of the CU and is separated from it.

[0158] In Figure 9(a), the height of the first sub-block is equal to 1 / 4 of the height of the CU, and the width of the first sub-block is equal to 1 / 2 of the width of the CU. That is to say, the size of the first sub-block is 1 / 2 CU width × 1 / 4 CU height.

[0159] In Figure 9(a), the line connecting the center of the first sub-block and the center of CU is a vertical line. In other words, the distance between the left side of the first sub-block and the left side of CU is equal to the distance between the right side of the first sub-block and the right side of CU. In other words, the midpoint of the upper side of the first sub-block coincides with the midpoint of the upper side of CU.

[0160] In Figure 9(b), the first sub-block is located below the CU. The bottom edge of the first sub-block partially overlaps with the bottom edge of the CU, and the remaining three edges of the first sub-block do not overlap with any edge of the CU. The bottom edge of the first sub-block overlaps with the bottom edge of the CU, and the length of the bottom edge of the first sub-block is less than the length of the bottom edge of the CU. The left edge of the first sub-block is parallel to the left edge of the CU and is separated from it. The right edge of the first sub-block is parallel to the right edge of the CU and is separated from it. The top edge of the first sub-block is parallel to the top edge of the CU and is separated from it.

[0161] In Figure 9(b), the height of the first sub-block is equal to 1 / 4 of the height of the CU, and the width of the first sub-block is equal to 1 / 2 of the width of the CU. That is to say, the size of the first sub-block is 1 / 2 CU width × 1 / 4 CU height.

[0162] In Figure 9(b), the line connecting the center of the first sub-block and the center of CU is a vertical line. In other words, the distance between the left side of the first sub-block and the left side of CU is equal to the distance between the right side of the first sub-block and the right side of CU. Or, the midpoint of the lower side of the first sub-block coincides with the midpoint of the lower side of CU.

[0163] In Figure 9(c), the first sub-block is located to the left of CU. The left side of the first sub-block partially overlaps with the left side of CU, and the remaining three sides of the first sub-block do not overlap with any side of CU. The left side of the first sub-block overlaps with the left side of CU, and the length of the left side of the first sub-block is less than the length of the left side of CU. The right side of the first sub-block is parallel to the right side of CU and is separated from it. The top side of the first sub-block is parallel to the top side of CU and is separated from it. The bottom side of the first sub-block is parallel to the bottom side of CU and is separated from it.

[0164] In Figure 9(c), the height of the first sub-block is equal to 1 / 2 of the height of the CU, and the width of the first sub-block is equal to 1 / 4 of the width of the CU. That is to say, the size of the first sub-block is 1 / 4 of the width of the CU × 1 / 2 of the height of the CU.

[0165] In Figure 9(c), the line connecting the center of the first sub-block and the center of the CU is a horizontal line. In other words, the distance between the upper side of the first sub-block and the upper side of the CU is equal to the distance between the lower side of the first sub-block and the lower side of the CU. Or, the midpoint of the left side of the first sub-block coincides with the midpoint of the left side of the CU.

[0166] In Figure 9(d), the first sub-block is located to the right of CU. The right side of the first sub-block partially overlaps with the right side of CU, and the remaining three sides of the first sub-block do not overlap with any side of CU. The right side of the first sub-block overlaps with the right side of CU, and the length of the right side of the first sub-block is less than the length of the right side of CU. The left side of the first sub-block is parallel to the left side of CU and is separated from it. The top side of the first sub-block is parallel to the top side of CU and is separated from it. The bottom side of the first sub-block is parallel to the bottom side of CU and is separated from it.

[0167] In Figure 9(d), the height of the first sub-block is equal to 1 / 2 of the height of the CU, and the width of the first sub-block is equal to 1 / 4 of the width of the CU. That is to say, the size of the first sub-block is 1 / 4 of the width of the CU × 1 / 2 of the height of the CU.

[0168] In Figure 9(d), the line connecting the center of the first sub-block and the center of CU is a horizontal line. In other words, the distance between the upper side of the first sub-block and the upper side of CU is equal to the distance between the lower side of the first sub-block and the lower side of CU. Or, the midpoint of the right side of the first sub-block coincides with the midpoint of the right side of CU.

[0169] As shown in Figure 10, the first type of partitioning pattern can include four SBT patterns, namely (a), (b), (c), and (d) in Figure 10.

[0170] In Figure 10(a), the first sub-block is located above the CU. The top edge of the first sub-block partially overlaps with the top edge of the CU, and the remaining three edges of the first sub-block do not overlap with any edge of the CU. The top edge of the first sub-block overlaps with the top edge of the CU, and the length of the top edge of the first sub-block is less than the length of the top edge of the CU. The left edge of the first sub-block is parallel to the left edge of the CU and is separated from it. The right edge of the first sub-block is parallel to the right edge of the CU and is separated from it. The bottom edge of the first sub-block is parallel to the bottom edge of the CU and is separated from it.

[0171] In Figure 10(a), the line connecting the center of the first sub-block and the center of CU is a vertical line, or in other words, the distance between the left side of the first sub-block and the left side of CU is equal to the distance between the right side of the first sub-block and the right side of CU.

[0172] In Figure 10(b), the first sub-block is located below the CU. The bottom edge of the first sub-block partially overlaps with the bottom edge of the CU, and the remaining three edges of the first sub-block do not overlap with any edge of the CU. The bottom edge of the first sub-block overlaps with the bottom edge of the CU, and the length of the bottom edge of the first sub-block is less than the length of the bottom edge of the CU. The left edge of the first sub-block is parallel to the left edge of the CU and is separated from it. The right edge of the first sub-block is parallel to the right edge of the CU and is separated from it. The top edge of the first sub-block is parallel to the top edge of the CU and is separated from it.

[0173] In Figure 10(b), the line connecting the center of the first sub-block and the center of the CU is a vertical line, or in other words, the distance between the left side of the first sub-block and the left side of the CU is equal to the distance between the right side of the first sub-block and the right side of the CU.

[0174] In Figure 10(c), the first sub-block is located to the left of CU. The left side of the first sub-block partially overlaps with the left side of CU, and the remaining three sides of the first sub-block do not overlap with any side of CU. The left side of the first sub-block overlaps with the left side of CU, and the length of the left side of the first sub-block is less than the length of the left side of CU. The right side of the first sub-block is parallel to the right side of CU and is separated from it. The top side of the first sub-block is parallel to the top side of CU and is separated from it. The bottom side of the first sub-block is parallel to the bottom side of CU and is separated from it.

[0175] In Figure 10(c), the line connecting the center of the first sub-block and the center of the CU is a horizontal line. In other words, the distance between the upper side of the first sub-block and the upper side of the CU is equal to the distance between the lower side of the first sub-block and the lower side of the CU.

[0176] In Figure 10(d), the first sub-block is located to the right of CU. The right side of the first sub-block partially overlaps with the right side of CU, and the remaining three sides of the first sub-block do not overlap with any side of CU. The right side of the first sub-block overlaps with the right side of CU, and the length of the right side of the first sub-block is less than the length of the right side of CU. The left side of the first sub-block is parallel to the left side of CU and is separated from it. The top side of the first sub-block is parallel to the top side of CU and is separated from it. The bottom side of the first sub-block is parallel to the bottom side of CU and is separated from it.

[0177] In Figure 10(d), the line connecting the center of the first sub-block and the center of the CU is a horizontal line. In other words, the distance between the upper side of the first sub-block and the upper side of the CU is equal to the distance between the lower side of the first sub-block and the lower side of the CU.

[0178] The width of the first sub-block in Figure 10 is equal to 1 / 4 of the width of the CU, and the height of the first sub-block is equal to 1 / 4 of the height of the CU.

[0179] It should be noted that in the embodiments of this application, the upper side can also be called the upper edge, the lower side can also be called the lower edge, the left side can also be called the left edge, and the right side can also be called the right edge.

[0180] It should be noted that the above content applies to both the encoding and decoding methods described below.

[0181] The following section will first provide detailed examples of the decoding methods of some embodiments of this application.

[0182] Figure 11 is a schematic flowchart of a decoding method provided in some embodiments of this application. The method in Figure 11 can be applied to a decoder.

[0183] Referring to Figure 11, in step S1110, the first sub-block in the current CU is determined.

[0184] The first sub-block can also be called a transform block, transform unit (TU), non-zero residual block, or residual block, etc. The first sub-block is the sub-block that needs to undergo inverse transformation; in other words, the residual corresponding to the first sub-block is not zero.

[0185] The region containing the first sub-block is a portion of the current CU. The decoder can divide the current CU into multiple sub-blocks, and some of these sub-blocks are the first sub-blocks. For example, these multiple sub-blocks may include only one first sub-block or multiple first sub-blocks; some embodiments of this application do not specifically limit this. Alternatively, the current CU may include one non-zero residual block or multiple non-zero residual blocks.

[0186] The aforementioned sub-blocks may also include one or more sub-blocks with a residual of 0, which the decoder can set to 0. Alternatively, the decoder can set the residuals of all sub-blocks in the current CU except the first sub-block to 0.

[0187] The shape of the first sub-block can be any shape, and some embodiments of this application do not specifically limit it. For example, the shape of the first sub-block can be a square, rectangle, triangle, trapezoid, or other arbitrary polygon.

[0188] The first sub-block can be located in the middle region of an edge in the current CU. In other words, one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU, as shown in Figures 8-10.

[0189] In step S1120, the transformation coefficients of the first sub-block are inversely transformed to obtain the residual information corresponding to the first sub-block.

[0190] In some implementations, since the decoder can set the residuals of all sub-blocks except the first sub-block to 0, the residual information corresponding to the first sub-block can also be understood as the residual information corresponding to the current CU.

[0191] The decoder can decode the information in the bitstream using the entropy decoding module to obtain the transform coefficients of the first sub-block, and then perform an inverse transform on these transform coefficients to obtain the residual information corresponding to the first sub-block. In some implementations, the dequantization / transform module can obtain the quantization coefficient matrix corresponding to the first sub-block from the bitstream, and then perform dequantization and inverse transform on this quantization coefficient matrix to obtain the residual information.

[0192] In some implementations, the decoder can decode the first identification information and the second identification information, and determine the first sub-block in the current CU based on the first identification information and the second identification information.

[0193] The first identification information can be used to indicate the partitioning method of the current CU into sub-blocks. For example, the partitioning method can include a first partitioning method and a second partitioning method. The first partitioning method can be understood as vertical partitioning (UD partitioning), and the second partitioning method can be understood as horizontal partitioning (LR partitioning). If the current CU adopts the first partitioning method, the top edge of the first sub-block partially coincides with the top edge of the current CU, or the bottom edge of the first sub-block partially coincides with the bottom edge of the current CU; if the current CU adopts the second partitioning method, the left edge of the first sub-block partially coincides with the left edge of the current CU, or the right edge of the first sub-block partially coincides with the right edge of the current CU.

[0194] The above division methods will be described in more detail below with reference to Figures 8-10. Taking Figure 8 as an example, Figures (a) and (b) in Figure 8 show a top-bottom division, while Figures (c) and (d) in Figure 8 show a left-right division. Alternatively, this division method can include both top-bottom and left-right divisions. Taking Figure 9 as an example, Figures (a) and (b) in Figure 9 show a top-bottom division, while Figures (c) and (d) in Figure 9 show a left-right division. Alternatively, this division method can include both top-bottom and left-right divisions. Taking Figure 10 as an example, Figures (a) and (b) in Figure 10 show a top-bottom division, while Figures (c) and (d) in Figure 10 show a left-right division.

[0195] If the value of the first identifier is 1, it means that the current CU is using the second partitioning method; if the value of the first identifier is 0, it means that the current CU is using the first partitioning method.

[0196] The second identification information can be used to indicate the position of the first sub-block in the current CU. The position of the first sub-block in the current CU includes top, bottom, left, and right. In other words, the first sub-block can be the top sub-block, bottom sub-block, left sub-block, or right sub-block. For example, the first sub-block shown in Figure 8(a) is the top sub-block, the first sub-block shown in Figure 8(b) is the bottom sub-block, the first sub-block shown in Figure 8(c) is the left sub-block, and the first sub-block shown in Figure 8(d) is the right sub-block. As another example, the first sub-block shown in Figure 9(a) is the top sub-block, the first sub-block shown in Figure 9(b) is the bottom sub-block, the first sub-block shown in Figure 9(c) is the left sub-block, and the first sub-block shown in Figure 9(d) is the right sub-block. For example, the first sub-block shown in Figure 10(a) is the top sub-block, the first sub-block shown in Figure 10(b) is the bottom sub-block, the first sub-block shown in Figure 10(c) is the left sub-block, and the first sub-block shown in Figure 10(d) is the right sub-block.

[0197] The top child block can also be called the top block, the bottom child block can also be called the bottom block, the left child block can also be called the left block, and the right child block can also be called the right block.

[0198] The positions of the top and left blocks will be referred to as position 0, and the positions of the bottom and right blocks will be referred to as position 1. Of course, the positions of the top and left blocks, as well as the positions of the bottom and right blocks, can also be represented by other identifiers.

[0199] If the value of the second identifier is 1, it means that the first sub-block is the lower sub-block or the right sub-block; if the value of the second identifier is 0, it means that the first sub-block is the upper sub-block or the left sub-block.

[0200] The decoder can determine the first sub-block in the current CU based on the first and second identification information. Determining the first sub-block in the current CU can be understood as determining the sub-blocks in the current CU that need to undergo inverse transformation, or determining which sub-blocks in the current CU have non-zero residuals.

[0201] For example, taking Figure 8 as an example, if the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the upper block shown in Figure 8(a). If the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the lower block shown in Figure 8(b). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the left block shown in Figure 8(c). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the right block shown in Figure 8(d).

[0202] For example, taking Figure 9 as an example, if the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the upper block shown in Figure 9(a). If the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the lower block shown in Figure 9(b). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the left block shown in Figure 9(c). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the right block shown in Figure 9(d).

[0203] For example, taking Figure 10 as an example, if the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the upper block shown in Figure 10(a). If the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the lower block shown in Figure 10(b). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the left block shown in Figure 10(c). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the right block shown in Figure 10(d).

[0204] In some implementations, the first identification information can be represented by the syntax element cu_sbt_udlr_hor_flag, and the second identification information can be represented by the syntax element cu_sbt_udlr_pos_flag. Of course, the first and second identification information can also be represented by any other letters and / or numbers.

[0205] In some implementations, the third identification information can be decoded before the first and second identification information are decoded. The third identification information is used to indicate whether the current CU uses the target partitioning mode. The target partitioning mode can be understood as a partitioning mode newly introduced in some embodiments of this application. The target partitioning mode can include any one or more modes shown in Figures 8-10. For example, the target partitioning mode can include the four modes shown in Figure 8. Alternatively, the target partitioning mode can include the four modes shown in Figure 9. Alternatively, the target partitioning mode can include the four modes shown in Figure 10. Alternatively, the target partitioning mode can include the four modes shown in Figure 8 and the four modes shown in Figure 9. Alternatively, the target partitioning mode can include the four modes shown in Figure 8 and the four modes shown in Figure 10. Alternatively, the target partitioning mode can include the four modes shown in Figure 8, the four modes shown in Figure 9, and the four modes shown in Figure 10. Alternatively, the target partitioning mode can include the four modes shown in Figure 9 and the four modes shown in Figure 10.

[0206] In some implementations, the third identifier information can be used to indicate whether the current CU is using the target partitioning mode or another mode. Other modes can be understood as traditional modes; for example, other modes may include the eight modes shown in Figure 5 above, and the nine modes shown in Figures 6 and 7. For instance, if the value of the third identifier information is a preset value, it indicates that the current CU is using the target partitioning mode; if the value of the third identifier information is not a preset value, it indicates that the current CU is using another mode.

[0207] If the third identifier indicates that the current CU is using the target partitioning mode, or if the value of the third identifier is a preset value, then the decoder decodes the first identifier and the second identifier. If the third identifier indicates that the current CU is not using the target partitioning mode, or indicates that the current CU is using another mode, or if the value of the third identifier is not a preset value, then the decoder does not need to decode the first identifier and the second identifier.

[0208] In some implementations, the default value can be 1. If the value of the third identifier is 1, it means that the current CU uses the target partitioning mode; if the value of the third identifier is 0, it means that the current CU uses other partitioning modes and does not use the target partitioning mode.

[0209] The third identifier can be represented using the syntax element cu_sbt_udlr_flag. Of course, the third identifier can also be represented using any other letters and / or numbers.

[0210] The decoder can use the first identification information, the second identification information, and the fourth identification information to determine the first sub-block in the current CU.

[0211] In some implementations, the decoder can decode the fourth identification information, which can be used to indicate the size information of the first sub-block. The size information of the first sub-block may include the width and / or height information of the first sub-block. The width information of the first sub-block may refer to the ratio of the width of the first sub-block to the width of the current CU, and the height information of the first sub-block may refer to the ratio of the height of the first sub-block to the height of the current CU.

[0212] In some implementations, the fourth identification information can be used to indicate the division ratio of the first sub-block. As an example, if the target division pattern includes the division patterns shown in Figure 8 and Figure 9, the division ratio can include a 1 / 2 division ratio and a 1 / 4 division ratio. The 1 / 2 division ratio can correspond to the four patterns shown in Figure 8, and the 1 / 4 division ratio can correspond to the four patterns shown in Figure 9. When the value of the fourth identification information is 1, it represents a 1 / 2 division ratio; when the value of the fourth identification information is 0, it represents a 1 / 4 division ratio. Here, the division ratio refers to: for the overlapping boundary of the TU and the sub-block, the overlapping boundary of the TU is fixed as 1 / 2 of the size of the corresponding side of the CU; for the non-overlapping side, the ratio of the size of the TU to the size of the corresponding side of the CU.

[0213] As another example, if the target partitioning pattern includes the partitioning patterns shown in Figure 8 and Figure 10, then the partitioning ratio can include a 1 / 2 partitioning ratio and a 1 / 4 partitioning ratio. A 1 / 2 partitioning ratio can correspond to the four patterns shown in Figure 8, and a 1 / 4 partitioning ratio can correspond to the four patterns shown in Figure 10. When the value of the fourth identifier is 1, it represents a 1 / 2 partitioning ratio; when the value of the fourth identifier is 0, it represents a 1 / 4 partitioning ratio.

[0214] As another example, if the target partitioning pattern includes the partitioning patterns shown in Figure 8, Figure 9, and Figure 10, then three values ​​can be used to represent the above partitioning patterns respectively. If the value of the fourth identifier is the first value, it represents the partitioning pattern shown in Figure 8; if the value of the fourth identifier is the second value, it represents the partitioning pattern shown in Figure 9; and if the value of the fourth identifier is the third value, it represents the partitioning pattern shown in Figure 10.

[0215] The width of the first sub-block can be 1 / n of the width of the current CU, and the height of the first sub-block can be 1 / m of the height of the current CU. Here, n and m are both integers greater than 1. For example, in Figure 8, the width of the first sub-block is 1 / 2 of the width of the current CU, i.e., n = 2, and the height of the first sub-block is 1 / 2 of the height of the current CU, i.e., m = 2. In Figure 9, the width of the first sub-block is 1 / 2 of the width of the current CU, i.e., n = 2, and the height of the first sub-block is 1 / 4 of the height of the current CU, i.e., m = 4; or, the width of the first sub-block is 1 / 4 of the width of the current CU, i.e., n = 4, and the height of the first sub-block is 1 / 2 of the height of the current CU, i.e., m = 2. In Figure 10, the width of the first sub-block is 1 / 4 of the width of the current CU, i.e., n = 4, and the height of the first sub-block is 1 / 4 of the height of the current CU, i.e., m = 4.

[0216] In some implementations, if the decoder does not decode the fourth identifier information, the size information of the first sub-block is set to the default value. For example, if the target partitioning mode only includes the four modes shown in Figure 8, the default size information of the first sub-block is: the width of the first sub-block is half the width of the current CU, and the height of the first sub-block is half the height of the current CU. Similarly, if the target partitioning mode only includes the four modes shown in Figure 9, the default size information of the first sub-block is: the width of the first sub-block is one-quarter the width of the current CU, and the height of the first sub-block is half the height of the current CU, or the width of the first sub-block is one-quarter the width of the current CU, and the height of the first sub-block is one-quarter the height of the current CU. Furthermore, if the target partitioning mode only includes the four modes shown in Figure 10, the default size information of the first sub-block is: the width of the first sub-block is one-quarter the width of the current CU, and the height of the first sub-block is one-quarter the height of the current CU.

[0217] The fourth identifier can be represented using the syntax element cu_sbt_udlr_hal_flag. Of course, the fourth identifier can also be represented using any other letters and / or numbers.

[0218] To ensure that the size of the first sub-block meets the requirements, some embodiments of this application impose certain restrictions on the first and second partitioning methods for the current CU. For example, the conditions for the current CU to adopt the first partitioning method include: the width of the current CU is greater than or equal to 32, and the height of the current CU is greater than or equal to 16. Similarly, the conditions for the current CU to adopt the second partitioning method include: the width of the current CU is greater than or equal to 16, and the height of the current CU is greater than or equal to 32.

[0219] The following section uses the partitioning patterns shown in Figures 8 and 9 as examples to introduce the partitioning method of CU into sub-blocks and the index of the sub-blocks. It should be noted that the partitioning pattern shown in Figure 10 can also refer to this method, but for the sake of simplicity, it will not be elaborated here.

[0220] Figure 12 illustrates the specific partitioning method for dividing a CU into four sub-blocks using a top-bottom partitioning approach, along with the index of each sub-block. In Figure 12, the left side represents a 1 / 2 partitioning ratio, and the right side represents a 1 / 4 partitioning ratio. The numbers in the sub-blocks in Figure 12 represent their indices.

[0221] For the left side of Figure 12, the first sub-block can be the sub-block with index 1, the sub-block with index 2, or the sub-blocks with indices 1 and 2. The decoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block is the sub-block with index 1, the decoder can set the residuals of the sub-blocks with indices 0, 2, and 3 to 0. If the first sub-block is the sub-block with index 2, the decoder can set the residuals of the sub-blocks with indices 0, 1, and 3 to 0. If the first sub-block is the sub-blocks with indices 1 and 2, the decoder can set the residuals of the sub-blocks with indices 0 and 3 to 0.

[0222] For the right side of Figure 12, the first sub-block can be the sub-block with index 1, the sub-block with index 3, or the sub-blocks with indices 1 and 3. The decoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block is the sub-block with index 1, the decoder can set the residuals of the sub-blocks with indices 0, 2, 3, and 4 to 0. If the first sub-block is the sub-block with index 3, the decoder can set the residuals of the sub-blocks with indices 0, 1, 2, and 4 to 0. If the first sub-block is the sub-blocks with indices 1 and 3, the decoder can set the residuals of the sub-blocks with indices 0, 2, and 4 to 0.

[0223] Figure 13 illustrates the specific partitioning method for dividing a CU into four sub-blocks using a left-right partitioning approach, along with the index of each sub-block. In Figure 13, the left side represents a 1 / 2 partitioning ratio, and the right side represents a 1 / 4 partitioning ratio. The numbers in the sub-blocks in Figure 13 represent their indices.

[0224] For the left side of Figure 13, the first sub-block can be the sub-block with index 1, the sub-block with index 2, or the sub-blocks with indices 1 and 2. The decoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block is the sub-block with index 1, the decoder can set the residuals of the sub-blocks with indices 0, 2, and 3 to 0. If the first sub-block is the sub-block with index 2, the decoder can set the residuals of the sub-blocks with indices 0, 1, and 3 to 0. If the first sub-block is the sub-blocks with indices 1 and 2, the decoder can set the residuals of the sub-blocks with indices 0 and 3 to 0.

[0225] For the right side of Figure 13, the first sub-block can be the sub-block with index 1, the sub-block with index 3, or the sub-blocks with indices 1 and 3. The decoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block is the sub-block with index 1, the decoder can set the residuals of the sub-blocks with indices 0, 2, 3, and 4 to 0. If the first sub-block is the sub-block with index 3, the decoder can set the residuals of the sub-blocks with indices 0, 1, 2, and 4 to 0. If the first sub-block is the sub-blocks with indices 1 and 3, the decoder can set the residuals of the sub-blocks with indices 0, 2, and 4 to 0.

[0226] Based on the proportion and position of the sub-block partitioning pattern, the index of the first sub-block can be determined. When the partitioning proportion is 1 / 2, if the position is position 0, the index of the first sub-block is 1, and the first sub-block can be understood as the left sub-block; when the partitioning proportion is 1 / 2, if the position is position 1, the index of the first sub-block is 2, and the first sub-block can be understood as the right sub-block; when the partitioning proportion is 1 / 4, if the position is position 0, the index of the first sub-block is 1, and the first sub-block can be understood as the left sub-block; when the partitioning proportion is 1 / 4, if the position is position 1, the index of the first sub-block is 3, and the first sub-block can be understood as the right sub-block. Therefore, once the partitioning pattern proportion and position are determined, the index of the sub-block can be used to determine whether the sub-block is the first sub-block (or a non-zero residual block).

[0227] It should be noted that the above introduction is based on the example that the height (or width) of the first sub-block is 1 / 2 or 1 / 4 of the height (or width) of the CU. Of course, the size of the first sub-block can also be other sizes. The size of the first sub-block can be adaptively adjusted to divide the region according to the distribution of residual energy.

[0228] Some embodiments of this application extend the current SBT partitioning mode, enabling SBT to be applicable to a wider variety of inter-frame prediction residual distributions and making the energy of the transformed sub-blocks of the corresponding residual distribution more concentrated, thereby improving transformation efficiency and saving coding bits. Encoding using the method of adding SBT mode provided in some embodiments of this application can improve coding performance.

[0229] In some implementations, the decoder can determine the transform kernel needed for the inverse transform and use that kernel to perform the inverse transform on the transform coefficients. The decoder can determine the transform kernel based on the partitioning method and the position of the first sub-block in the current CU; or, in other words, the decoder can determine the transform kernel based on the first and second identifier information.

[0230] The aforementioned transform kernel may include a first transform kernel for the horizontal direction and a second transform kernel for the vertical direction. For the luminance component of the first sub-block, the first transform kernel may be any one of the following: DST-1, DCT-8, DST-7, and the second transform kernel may be any one of the following: DST-1, DCT-8, DST-7.

[0231] For the chromaticity components of the first sub-block, the inverse transform kernel is DCT-2.

[0232] The selection of the transform kernel is described below with reference to Table 4.

[0233] Table 4

[0234] As shown in Table 4, if the current CU uses the first partitioning method and the first sub-block is at position 0, then the transform kernel for the luminance component in the horizontal direction is DST-1, and the transform kernel in the vertical direction is DCT-8. If the current CU uses the first partitioning method and the first sub-block is at position 1, then the transform kernel for the luminance component in the horizontal direction is DST-1, and the transform kernel in the vertical direction is DST-7. If the current CU uses the second partitioning method and the first sub-block is at position 0, then the transform kernel for the luminance component in the horizontal direction is DCT-8, and the transform kernel in the vertical direction is DST-1. If the current CU uses the second partitioning method and the first sub-block is at position 1, then the transform kernel for the luminance component in the horizontal direction is DST-7, and the transform kernel in the vertical direction is DST-1.

[0235] The selection principle of the above-mentioned transformation kernel is introduced below.

[0236] Based on the characteristics of transform coding, the higher the similarity between the transform basis function and the signal, the greater the compression ratio. Because DST-1 is suitable for residual distributions that first increase and then decrease, the horizontal transform of the first partitioning method and the vertical transform of the second partitioning method use DST-1 transform; because DCT-8 is suitable for decreasing residual distributions, the vertical transform of position 0 in the first partitioning method and the horizontal transform of position 0 in the second partitioning method use DCT-8; because DST-7 is suitable for increasing residual distributions, the vertical transform of position 1 in the first partitioning method and the horizontal transform of position 1 in the second partitioning method use DST-7.

[0237] The base images of the four transform kernels shown in Table 4 are illustrated in Figure 14. Figure 14(a) shows the base image with the DST-1 transform kernel in the horizontal direction and the DCT-8 transform kernel in the vertical direction; Figure 14(b) shows the base image with the DST-1 transform kernel in the horizontal direction and the DST-7 transform kernel in the vertical direction; Figure 14(c) shows the base image with the DCT-7 transform kernel in the horizontal direction and the DST-1 transform kernel in the vertical direction; and Figure 14(d) shows the base image with the DST-7 transform kernel in the horizontal direction and the DST-1 transform kernel in the vertical direction.

[0238] Theoretically, the more consistent the energy distribution of the base image with the residual distribution, the better the transformation effect and the more concentrated the energy. The white areas in Figure 14 represent high-energy regions. As can be seen from Figure 14, the image energy distribution in the upper left corner region of the base images for the four transformation combinations shows a high degree of consistency with the residual distribution of the corresponding partitioning methods. This indicates that after transformation by the corresponding transformation combination, the energy can be effectively concentrated in the upper left corner region, improving compression efficiency. This demonstrates the rationality and effectiveness of the transformation kernels selected in some embodiments of this application.

[0239] The transform kernel mentioned above is a pre-set transform kernel, but some embodiments of this application are not limited to this. For example, a suitable transform kernel can be trained using a deep learning model based on the features of the residual block, thereby further improving coding efficiency.

[0240] Table 4 shows only four transform kernels: DCT-2, DCT-8, DST-7, and DST-1. However, some embodiments of this application are not limited to these. Other types of transform kernels, such as DCT-5 and DST-4, can be added to some embodiments of this application to better capture different types of residual energy. Among them, DST4 and DST7 have similar increasing patterns and are suitable for increasing residual distributions.

[0241] The binary representation scheme for the above-mentioned identification information can be shown in Table 5.

[0242] Table 5

[0243] Table 5 shows the binary representation scheme for the syntax elements cu_sbt_udlr_flag, cu_sbt_udlr_hal_flag, cu_sbt_udlr_hor_flag, and cu_sbt_udlr_pos_flag. As shown in Table 5, the binary representation scheme for cu_sbt_udlr_flag, cu_sbt_udlr_hal_flag, cu_sbt_udlr_hor_flag, and cu_sbt_udlr_pos_flag uses a fixed-length encoding scheme, and the maximum value of the syntax elements cu_sbt_udlr_flag, cu_sbt_udlr_hal_flag, cu_sbt_udlr_hor_flag, and cu_sbt_udlr_pos_flag is 1.

[0244] The aforementioned identification information can be decoded using a context model to improve encoding efficiency. The following describes how the context model is determined. Determining the context model can include defining its parameters. These parameters can include one or more of the following: context index (ctxId), initialization value (initValue), shiftIdx, and context index increment (ctxInc). ShiftIdx is used to update the context model.

[0245] The association between the above-mentioned identification information ctxId and initType can be shown in Table 6.

[0246] As shown in Table 6, if the initialization type of cu_sbt_udlr_flag is 1, then the context index of cu_sbt_udlr_flag is 0; if the initialization type of cu_sbt_udlr_flag is 2, then the context index of cu_sbt_udlr_flag is 1. Similarly, if the initialization type of cu_sbt_udlr_hal_flag is 1, then the context index of cu_sbt_udlr_hal_flag is 0; if the initialization type of cu_sbt_udlr_hal_flag is 2, then the context index of cu_sbt_udlr_hal_flag is 1. If the initialization type of cu_sbt_udlr_hor_flag is 1, then the context index of cu_sbt_udlr_hor_flag is 0 to 2; if the initialization type of cu_sbt_udlr_hor_flag is 2, then the context index of cu_sbt_udlr_hor_flag is 3 to 5. If the initialization type of cu_sbt_udlr_pos_flag is 1, then the context index of cu_sbt_udlr_pos_flag is 0; if the initialization type of cu_sbt_udlr_pos_flag is 2, then the context index of cu_sbt_udlr_pos_flag is 1.

[0247] Table 6

[0248] In some implementations, the decoder can determine the first context model corresponding to the third identifier information based on the initialization type (initType) of the third identifier information, and perform entropy decoding on the third identifier information based on the first context model. For example, the decoder can determine the context index increment (ctxId) based on the initialization type of the third identifier information, and determine the initial value of the first context model based on the context index increment.

[0249] Table 7 shows the correspondence between the initial value of the third identification information cu_sbt_udlr_flag and the context index increment.

[0250] Table 7

[0251] As shown in Table 7, when the ctxIdx of cu_sbt_udlr_flag is 0, the initValue of cu_sbt_udlr_flag is 35 and the shiftIdx is 10. When the ctxIdx of cu_sbt_udlr_flag is 1, the initValue of cu_sbt_udlr_flag is 35 and the shiftIdx is 10.

[0252] In some implementations, the decoder can determine the second context model corresponding to the second identifier information based on the initialization type of the second identifier information, and perform entropy decoding on the second identifier information based on the second context model. For example, the decoder can determine the context index increment (ctxId) based on the initialization type of the second identifier information, and determine the initial value of the second context model based on the context index increment.

[0253] Table 8 shows the correspondence between the initial value of the second identification information cu_sbt_udlr_pos_flag and the context index increment.

[0254] Table 8

[0255] As shown in Table 8, when the ctxIdx of cu_sbt_udlr_pos_flag is 0, the initValue of cu_sbt_udlr_pos_flag is 28 and the shiftIdx is 13. When the ctxIdx of cu_sbt_udlr_pos_flag is 1, the initValue of cu_sbt_udlr_pos_flag is 20 and the shiftIdx is 13.

[0256] In some implementations, the decoder can determine the third context model corresponding to the first identifier information based on the initialization type of the first identifier information and the size relationship between the height and width of the current CU, and perform entropy decoding on the first identifier information based on the third context model.

[0257] In some implementations, the decoder can determine the context index increment (ctxId) based on the initialization type of the first identifier information, and determine the initial value of the third context model based on the context index increment.

[0258] Table 9 shows the correspondence between the initial value of the first identifier information cu_sbt_udlr_hor_flag and the context index increment.

[0259] Table 9

[0260] As shown in Table 9, when the ctxIdx of cu_sbt_udlr_hor_flag is 0, the initValue of cu_sbt_udlr_hor_flag is 20, and the shiftIdx is 8. When the ctxIdx of cu_sbt_udlr_hor_flag is 1, the initValue of cu_sbt_udlr_hor_flag is 43, and the shiftIdx is 4. When the ctxIdx of cu_sbt_udlr_hor_flag is 2, the initValue of cu_sbt_udlr_hor_flag is 12, and the shiftIdx is 1. When the ctxIdx of cu_sbt_udlr_hor_flag is 3, the initValue of cu_sbt_udlr_hor_flag is 35, and the shiftIdx is 8. When the ctxIdx of cu_sbt_udlr_hor_flag is 4, the initValue of cu_sbt_udlr_hor_flag is 51, and the shiftIdx is 4. When the ctxIdx of cu_sbt_udlr_hor_flag is 5, the initValue of cu_sbt_udlr_hor_flag is 27, and the shiftIdx is 1.

[0261] In some implementations, the decoder can determine the fourth context model corresponding to the fourth identifier information based on the initialization type of the fourth identifier information, and perform entropy decoding on the fourth identifier information based on the fourth context model. For example, the decoder can determine the context index increment (ctxId) based on the initialization type of the fourth identifier information, and determine the initial value of the fourth context model based on the context index increment.

[0262] Table 10 shows the correspondence between the initial value of the fourth identification information cu_sbt_udlr_hal_flag and the context index increment.

[0263] Table 10

[0264] As shown in Table 10, when the ctxIdx of cu_sbt_udlr_hal_flag is 0, the initValue of cu_sbt_udlr_hal_flag is 35 and the shiftIdx is 10. When the ctxIdx of cu_sbt_udlr_hal_flag is 1, the initValue of cu_sbt_udlr_hal_flag is 35 and the shiftIdx is 10.

[0265] The syntax elements cu_sbt_udlr_flag, cu_sbt_udlr_hal_flag, and cu_sbt_udlr_pos_flag all select the corresponding ctxId according to initType. The syntax element cu_sbt_udlr_hor_flag indicates whether the sub-block division selects the up-down division (or horizontal division) or the left-right division (or vertical division), which is related to the size of the CU. Therefore, the CU can select different contexts in three cases: cbWidth = cbHeight, cbWidth < cbHeight, and cbWidth > cbHeight, as shown in Table 11.

[0266] Table 11 shows the corresponding relationship between ctxInc and binIdx.

[0267] Table 11

[0268] As can be seen from Table 11, for the syntax element cu_sbt_udlr_hor_flag, when binIdx = 0, if the width and height of the CU are equal, then ctxInc = 0; if the width of the CU is less than the height of the CU, then ctxInc = 1; if the width of the CU is greater than the height of the CU, then ctxInc = 2.

[0269] The initial values of the context models described above are all default values. Of course, in some embodiments of the present application, the probability situation of the context model after the encoding of each frame of each sequence can also be recorded through training, and the initial value of the context model can be changed according to the training results.

[0270] Combined with FIGS. 11-14 above, the decoding method provided by some embodiments of the present application has been described in detail. Below, in combination with FIG. 15, the encoding method provided by some embodiments of the present application will be described in detail.

[0271] FIG. 15 is a schematic flowchart of an encoding method provided by some embodiments of the present application. The method shown in FIG. 15 can be applied to an encoder.

[0272] Referring to FIG. 15, in step S1510, a first sub-block in the current CU is determined. For example, the encoder can determine the first sub-block according to the residual energy distribution in the current CU.

[0273] The first sub-block can also be referred to as a transform block, a transform unit (TU), a non-zero residual block, or a residual block, etc. The first sub-block is the sub-block that needs to be transformed, or in other words, the residual corresponding to the first sub-block is not 0.

[0274] The region containing the first sub-block is a portion of the current CU. The encoder can divide the current CU into multiple sub-blocks, and some of these sub-blocks are designated as the first sub-block. For example, these multiple sub-blocks may include only one first sub-block or multiple first sub-blocks; some embodiments of this application do not specifically limit this. Alternatively, the current CU may include one non-zero residual block or multiple non-zero residual blocks.

[0275] The aforementioned sub-blocks may also include one or more sub-blocks with a residual of 0, which the encoder can set to 0. Alternatively, the encoder can set the residuals of all sub-blocks in the current CU except the first sub-block to 0.

[0276] The shape of the first sub-block can be any shape, and some embodiments of this application do not specifically limit it. For example, the shape of the first sub-block can be a square, rectangle, triangle, trapezoid, or other arbitrary polygon.

[0277] The first sub-block can be located in the middle region of an edge in the current CU. In other words, one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU, as shown in Figures 8-10.

[0278] In step S1520, the residual information of the first sub-block is transformed to obtain the transformation coefficients of the first sub-block.

[0279] The encoder can also quantize the transform coefficients to obtain quantized coefficients. In some implementations, the transform / quantization module can transform and quantize the residual information to obtain quantized coefficients.

[0280] In some implementations, the encoder can encode the first identification information and the second identification information. For example, the encoder can encode the first identification information and the second identification information based on the position of the first sub-block.

[0281] The first identification information can be used to indicate the partitioning method of the current CU into sub-blocks. For example, the partitioning method can include a first partitioning method and a second partitioning method. The first partitioning method can be understood as vertical partitioning (UD partitioning), and the second partitioning method can be understood as horizontal partitioning (LR partitioning). If the current CU adopts the first partitioning method, the top edge of the first sub-block partially coincides with the top edge of the current CU, or the bottom edge of the first sub-block partially coincides with the bottom edge of the current CU; if the current CU adopts the second partitioning method, the left edge of the first sub-block partially coincides with the left edge of the current CU, or the right edge of the first sub-block partially coincides with the right edge of the current CU.

[0282] The above division methods will be described in more detail below with reference to Figures 8-10. Taking Figure 8 as an example, Figures (a) and (b) in Figure 8 show a top-bottom division, while Figures (c) and (d) in Figure 8 show a left-right division. Alternatively, this division method can include both top-bottom and left-right divisions. Taking Figure 9 as an example, Figures (a) and (b) in Figure 9 show a top-bottom division, while Figures (c) and (d) in Figure 9 show a left-right division. Alternatively, this division method can include both top-bottom and left-right divisions. Taking Figure 10 as an example, Figures (a) and (b) in Figure 10 show a top-bottom division, while Figures (c) and (d) in Figure 10 show a left-right division.

[0283] If the value of the first identifier is 1, it means that the current CU is using the second partitioning method; if the value of the first identifier is 0, it means that the current CU is using the first partitioning method.

[0284] The second identification information can be used to indicate the position of the first sub-block in the current CU. The position of the first sub-block in the current CU includes top, bottom, left, and right. In other words, the first sub-block can be the top sub-block, bottom sub-block, left sub-block, or right sub-block. For example, the first sub-block shown in Figure 8(a) is the top sub-block, the first sub-block shown in Figure 8(b) is the bottom sub-block, the first sub-block shown in Figure 8(c) is the left sub-block, and the first sub-block shown in Figure 8(d) is the right sub-block. As another example, the first sub-block shown in Figure 9(a) is the top sub-block, the first sub-block shown in Figure 9(b) is the bottom sub-block, the first sub-block shown in Figure 9(c) is the left sub-block, and the first sub-block shown in Figure 9(d) is the right sub-block. For example, the first sub-block shown in Figure 10(a) is the top sub-block, the first sub-block shown in Figure 10(b) is the bottom sub-block, the first sub-block shown in Figure 10(c) is the left sub-block, and the first sub-block shown in Figure 10(d) is the right sub-block.

[0285] The top child block can also be called the top block, the bottom child block can also be called the bottom block, the left child block can also be called the left block, and the right child block can also be called the right block.

[0286] The positions of the top and left blocks will be referred to as position 0, and the positions of the bottom and right blocks will be referred to as position 1. Of course, the positions of the top and left blocks, as well as the positions of the bottom and right blocks, can also be represented by other identifiers.

[0287] If the value of the second identifier is 1, it means that the first sub-block is the lower sub-block or the right sub-block; if the value of the second identifier is 0, it means that the first sub-block is the upper sub-block or the left sub-block.

[0288] For example, taking Figure 8 as an example, if the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the upper block shown in Figure 8(a). If the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the lower block shown in Figure 8(b). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the left block shown in Figure 8(c). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the right block shown in Figure 8(d).

[0289] For example, taking Figure 9 as an example, if the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the upper block shown in Figure 9(a). If the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the lower block shown in Figure 9(b). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the left block shown in Figure 9(c). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the right block shown in Figure 9(d).

[0290] For example, taking Figure 10 as an example, if the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the upper block shown in Figure 10(a). If the first identifier indicates a vertical division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the lower block shown in Figure 10(b). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 0, then the first sub-block is the left block shown in Figure 10(c). If the first identifier indicates a horizontal division and the second identifier indicates the position of the first sub-block as position 1, then the first sub-block is the right block shown in Figure 10(d).

[0291] In some implementations, the first identification information can be represented by the syntax element cu_sbt_udlr_hor_flag, and the second identification information can be represented by the syntax element cu_sbt_udlr_pos_flag. Of course, the first and second identification information can also be represented by any other letters and / or numbers.

[0292] In some implementations, the third identification information can be encoded before the first and second identification information. The third identification information is used to indicate whether the current CU uses the target partitioning mode. The target partitioning mode can be understood as a partitioning mode newly introduced in some embodiments of this application. The target partitioning mode can include any one or more modes shown in Figures 8-10. For example, the target partitioning mode can include the four modes shown in Figure 8. Alternatively, the target partitioning mode can include the four modes shown in Figure 9. Alternatively, the target partitioning mode can include the four modes shown in Figure 10. Alternatively, the target partitioning mode can include the four modes shown in Figure 8 and the four modes shown in Figure 9. Alternatively, the target partitioning mode can include the four modes shown in Figure 8 and the four modes shown in Figure 10. Alternatively, the target partitioning mode can include the four modes shown in Figure 8, the four modes shown in Figure 9, and the four modes shown in Figure 10. Alternatively, the target partitioning mode can include the four modes shown in Figure 9 and the four modes shown in Figure 10.

[0293] The encoder can determine whether to use a target partitioning mode to partition the current CU based on the residual energy distribution of the current CU. For example, the encoder can match the residual energy distribution with the above partitioning modes (such as matching with the rate-distortion optimization (RDO) criterion) to find a suitable partitioning mode, and encode each identification information based on the matched partitioning mode.

[0294] In some implementations, the third identification information can be used to indicate whether the current CU is using a target partitioning mode or another mode. Other modes can be understood as traditional modes; for example, other modes may include the eight modes shown in Figure 5 above and the nine modes shown in Figures 6 and 7.

[0295] If the third identification information indicates that the current CU uses the target partitioning mode, the encoder encodes the first and second identification information; if the third identification information indicates that the current CU does not use the target partitioning mode or indicates that the current CU uses another mode, the encoder does not need to encode the first and second identification information.

[0296] If the value of the third identifier is 1, it means that the current CU uses the target partitioning mode; if the value of the third identifier is 0, it means that the current CU uses other partitioning modes and does not use the target partitioning mode.

[0297] The third identifier can be represented using the syntax element cu_sbt_udlr_flag. Of course, the third identifier can also be represented using any other letters and / or numbers.

[0298] In some implementations, the encoder can encode fourth identification information, which can be used to indicate the size information of the first sub-block. The size information of the first sub-block may include the width and / or height information of the first sub-block. The width information of the first sub-block may refer to the ratio of the width of the first sub-block to the width of the current CU, and the height information of the first sub-block may refer to the ratio of the height of the first sub-block to the height of the current CU.

[0299] In some implementations, the fourth identification information can be used to indicate the division ratio of the first sub-block. As an example, if the target division pattern includes the division patterns shown in Figure 8 and Figure 9, the division ratio can include a 1 / 2 division ratio and a 1 / 4 division ratio. The 1 / 2 division ratio can correspond to the four patterns shown in Figure 8, and the 1 / 4 division ratio can correspond to the four patterns shown in Figure 9. When the value of the fourth identification information is 1, it represents a 1 / 2 division ratio; when the value of the fourth identification information is 0, it represents a 1 / 4 division ratio. Here, the division ratio refers to: for the overlapping boundary of the TU and the sub-block, the overlapping boundary of the TU is fixed as 1 / 2 of the size of the corresponding side of the CU; for the non-overlapping side, the ratio of the size of the TU to the size of the corresponding side of the CU.

[0300] As another example, if the target partitioning pattern includes the partitioning patterns shown in Figure 8 and Figure 10, then the partitioning ratio can include a 1 / 2 partitioning ratio and a 1 / 4 partitioning ratio. A 1 / 2 partitioning ratio can correspond to the four patterns shown in Figure 8, and a 1 / 4 partitioning ratio can correspond to the four patterns shown in Figure 10. When the value of the fourth identifier is 1, it represents a 1 / 2 partitioning ratio; when the value of the fourth identifier is 0, it represents a 1 / 4 partitioning ratio.

[0301] As another example, if the target partitioning pattern includes the partitioning patterns shown in Figure 8, Figure 9, and Figure 10, then three values ​​can be used to represent the above partitioning patterns respectively. If the value of the fourth identifier is the first value, it represents the partitioning pattern shown in Figure 8; if the value of the fourth identifier is the second value, it represents the partitioning pattern shown in Figure 9; and if the value of the fourth identifier is the third value, it represents the partitioning pattern shown in Figure 10.

[0302] The width of the first sub-block can be 1 / n of the width of the current CU, and the height of the first sub-block can be 1 / m of the height of the current CU. Here, n and m are both integers greater than 1. For example, in Figure 8, the width of the first sub-block is 1 / 2 of the width of the current CU, i.e., n = 2, and the height of the first sub-block is 1 / 2 of the height of the current CU, i.e., m = 2. In Figure 9, the width of the first sub-block is 1 / 2 of the width of the current CU, i.e., n = 2, and the height of the first sub-block is 1 / 4 of the height of the current CU, i.e., m = 4; or, the width of the first sub-block is 1 / 4 of the width of the current CU, i.e., n = 4, and the height of the first sub-block is 1 / 2 of the height of the current CU, i.e., m = 2. In Figure 10, the width of the first sub-block is 1 / 4 of the width of the current CU, i.e., n = 4, and the height of the first sub-block is 1 / 4 of the height of the current CU, i.e., m = 4.

[0303] In some implementations, if the size information of the first sub-block is a default value, the encoder may not encode the fourth identification information to save bit overhead. For example, if the target partitioning mode only includes the four modes shown in Figure 8, the default size information of the first sub-block is: the width of the first sub-block is 1 / 2 of the width of the current CU, and the height of the first sub-block is 1 / 2 of the height of the current CU. Similarly, if the target partitioning mode only includes the four modes shown in Figure 9, the default size information of the first sub-block is: the width of the first sub-block is 1 / 4 of the width of the current CU, and the height of the first sub-block is 1 / 2 of the height of the current CU, or the width of the first sub-block is 1 / 4 of the width of the current CU, and the height of the first sub-block is 1 / 4 of the height of the current CU. Furthermore, if the target partitioning mode only includes the four modes shown in Figure 10, the default size information of the first sub-block is: the width of the first sub-block is 1 / 4 of the width of the current CU, and the height of the first sub-block is 1 / 4 of the height of the current CU.

[0304] The fourth identifier can be represented using the syntax element cu_sbt_udlr_hal_flag. Of course, the fourth identifier can also be represented using any other letters and / or numbers.

[0305] To ensure that the size of the first sub-block meets the requirements, some embodiments of this application impose certain restrictions on the first and second partitioning methods for the current CU. For example, the conditions for the current CU to adopt the first partitioning method are: the width of the current CU is greater than or equal to 32, and the height of the current CU is greater than or equal to 16. Similarly, the conditions for the current CU to adopt the second partitioning method are: the width of the current CU is greater than or equal to 16, and the height of the current CU is greater than or equal to 32.

[0306] The following section uses the partitioning patterns shown in Figures 8 and 9 as examples to introduce the partitioning method of CU into sub-blocks and the index of the sub-blocks. It should be noted that the partitioning pattern shown in Figure 10 can also refer to this method, but for the sake of simplicity, it will not be elaborated here.

[0307] Figure 12 illustrates the specific partitioning method for dividing a CU into four sub-blocks using the top-bottom partitioning approach, along with the index of each sub-block. In Figure 12, the left side represents a 1 / 2 partitioning ratio, and the right side represents a 1 / 4 partitioning ratio.

[0308] For the left side of Figure 12, the first sub-block can be the sub-block with index 1, the sub-block with index 2, or the sub-blocks with indices 1 and 2. The encoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block can be the sub-block with index 1, the encoder can set the residuals of the sub-blocks with indices 0, 2, and 3 to 0. If the first sub-block can be the sub-block with index 2, the encoder can set the residuals of the sub-blocks with indices 0, 1, and 3 to 0. If the first sub-block can be the sub-blocks with indices 1 and 2, the encoder can set the residuals of the sub-blocks with indices 0 and 3 to 0.

[0309] For the right side of Figure 12, the first sub-block can be the sub-block with index 1, the sub-block with index 3, or the sub-blocks with indices 1 and 3. The encoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block can be the sub-block with index 1, the encoder can set the residuals of the sub-blocks with indices 0, 2, 3, and 4 to 0. If the first sub-block can be the sub-block with index 3, the encoder can set the residuals of the sub-blocks with indices 0, 1, 2, and 4 to 0. If the first sub-block can be the sub-blocks with indices 1 and 3, the encoder can set the residuals of the sub-blocks with indices 0, 2, and 4 to 0.

[0310] Figure 13 illustrates the specific partitioning method for dividing a CU into four sub-blocks using the top-bottom partitioning approach, along with the index of each sub-block. In Figure 13, the left side represents a 1 / 2 partitioning ratio, and the right side represents a 1 / 4 partitioning ratio.

[0311] For the left side of Figure 13, the first sub-block can be the sub-block with index 1, the sub-block with index 2, or the sub-blocks with indices 1 and 2. The encoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block can be the sub-block with index 1, the encoder can set the residuals of the sub-blocks with indices 0, 2, and 3 to 0. If the first sub-block can be the sub-block with index 2, the encoder can set the residuals of the sub-blocks with indices 0, 1, and 3 to 0. If the first sub-block can be the sub-blocks with indices 1 and 2, the encoder can set the residuals of the sub-blocks with indices 0 and 3 to 0.

[0312] For the right side of Figure 13, the first sub-block can be the sub-block with index 1, the sub-block with index 3, or the sub-blocks with indices 1 and 3. The encoder can force the residuals of the remaining sub-blocks to 0. For example, if the first sub-block can be the sub-block with index 1, the encoder can set the residuals of the sub-blocks with indices 0, 2, 3, and 4 to 0. If the first sub-block can be the sub-block with index 3, the encoder can set the residuals of the sub-blocks with indices 0, 1, 2, and 4 to 0. If the first sub-block can be the sub-blocks with indices 1 and 3, the encoder can set the residuals of the sub-blocks with indices 0, 2, and 4 to 0.

[0313] The index of the first sub-block can be determined based on the proportion and position of the sub-block partitioning pattern. When the partitioning proportion is 1 / 2, if the position is position 0, the index of the first sub-block is 1; when the partitioning proportion is 1 / 2, if the position is position 1, the index of the first sub-block is 2; when the partitioning proportion is 1 / 4, if the position is position 0, the index of the first sub-block is 1; when the partitioning proportion is 1 / 4, if the position is position 1, the index of the first sub-block is 3. Therefore, once the partitioning pattern proportion and position are determined, the index of the sub-block can be used to determine whether the sub-block is the first sub-block (or a non-zero residual block).

[0314] It should be noted that the above introduction is based on the example that the height (or width) of the first sub-block is 1 / 2 or 1 / 4 of the height (or width) of the CU. Of course, the size of the first sub-block can also be other sizes. The size of the first sub-block can be adaptively adjusted to divide the region according to the distribution of residual energy.

[0315] Some embodiments of this application extend the current SBT partitioning mode, enabling SBT to be applicable to a wider variety of inter-frame prediction residual distributions and making the energy of the transformed sub-blocks of the corresponding residual distribution more concentrated, thereby improving transformation efficiency and saving coding bits. Encoding using the method of adding SBT mode provided in some embodiments of this application can improve coding performance.

[0316] In some implementations, the encoder can determine the transformation kernel needed for the transformation and use that kernel to transform the residual information. The encoder can determine the transformation kernel based on the partitioning method and the position of the first sub-block in the current CU, or in other words, the encoder can determine the transformation kernel based on the first identification information and the second identification information.

[0317] The aforementioned transform kernel may include a first transform kernel for the horizontal direction and a second transform kernel for the vertical direction. For the luminance component of the first sub-block, the first transform kernel may be any one of the following: DST-1, DCT-8, DST-7, and the second transform kernel may be any one of the following: DST-1, DCT-8, DST-7.

[0318] For the chromaticity components of the first sub-block, the transform kernel used for transformation is DCT-2.

[0319] The selection of the transform kernel can be shown in Table 4 above.

[0320] As shown in Table 4, if the current CU uses the first partitioning method and the first sub-block is at position 0, then the transform kernel for the luminance component in the horizontal direction is DST-1, and the transform kernel in the vertical direction is DCT-8. If the current CU uses the first partitioning method and the first sub-block is at position 1, then the transform kernel for the luminance component in the horizontal direction is DST-1, and the transform kernel in the vertical direction is DST-7. If the current CU uses the second partitioning method and the first sub-block is at position 0, then the transform kernel for the luminance component in the horizontal direction is DCT-8, and the transform kernel in the vertical direction is DST-1. If the current CU uses the second partitioning method and the first sub-block is at position 1, then the transform kernel for the luminance component in the horizontal direction is DST-7, and the transform kernel in the vertical direction is DST-1.

[0321] The selection principle of the above-mentioned transformation kernel is introduced below.

[0322] Based on the characteristics of transform coding, the higher the similarity between the transform basis function and the signal, the greater the compression ratio. Because DST-1 is suitable for residual distributions that first increase and then decrease, the horizontal transform of the first partitioning method and the vertical transform of the second partitioning method use DST-1 transform; because DCT-8 is suitable for decreasing residual distributions, the vertical transform of position 0 in the first partitioning method and the horizontal transform of position 0 in the second partitioning method use DCT-8; because DST-7 is suitable for increasing residual distributions, the vertical transform of position 1 in the first partitioning method and the horizontal transform of position 1 in the second partitioning method use DST-7.

[0323] The base images of the four transform kernels shown in Table 4 are illustrated in Figure 14. Figure 14(a) shows the base image with the DST-1 transform kernel in the horizontal direction and the DCT-8 transform kernel in the vertical direction; Figure 14(b) shows the base image with the DST-1 transform kernel in the horizontal direction and the DST-7 transform kernel in the vertical direction; Figure 14(c) shows the base image with the DCT-7 transform kernel in the horizontal direction and the DST-1 transform kernel in the vertical direction; and Figure 14(d) shows the base image with the DST-7 transform kernel in the horizontal direction and the DST-1 transform kernel in the vertical direction.

[0324] Theoretically, the more consistent the energy distribution of the base image with the residual distribution, the better the transformation effect and the more concentrated the energy. The white areas in Figure 14 represent high-energy regions. As can be seen from Figure 14, the image energy distribution in the upper left corner region of the base images for the four transformation combinations shows a high degree of consistency with the residual distribution of the corresponding partitioning methods. This indicates that after transformation by the corresponding transformation combination, the energy can be effectively concentrated in the upper left corner region, improving compression efficiency. This demonstrates the rationality and effectiveness of the transformation kernels selected in some embodiments of this application.

[0325] The transform kernel mentioned above is a pre-set transform kernel, but some embodiments of this application are not limited to this. For example, a suitable transform kernel can be trained using a deep learning model based on the features of the residual block, thereby further improving coding efficiency.

[0326] Table 4 shows only four transform kernels: DCT-2, DCT-8, DST-7, and DST-1. However, some embodiments of this application are not limited to these. Other types of transform kernels, such as DCT-5 and DST-4, can be added to some embodiments of this application to better capture different types of residual energy. Among them, DST4 and DST7 have similar increasing patterns and are suitable for increasing residual distributions.

[0327] The binary representation scheme for the aforementioned identification information is shown in Table 5 above. As can be seen from Table 5, the maximum value cMax for all four identification information is 1.

[0328] The aforementioned identification information can be encoded using a context model to improve encoding efficiency. The following describes how the context model is determined. Determining the context model can include defining its parameters. These parameters can include one or more of the following: context index (ctxId), initialization value (initValue), shiftIdx, and context index increment (ctxInc). ShiftIdx is used to update the context model.

[0329] The association between the above-mentioned identifier information ctxId and initType can be shown in Table 6 above.

[0330] As shown in Table 6, if the initialization type of cu_sbt_udlr_flag is 1, then the context index of cu_sbt_udlr_flag is 0; if the initialization type of cu_sbt_udlr_flag is 2, then the context index of cu_sbt_udlr_flag is 1. Similarly, if the initialization type of cu_sbt_udlr_hal_flag is 1, then the context index of cu_sbt_udlr_hal_flag is 0; if the initialization type of cu_sbt_udlr_hal_flag is 2, then the context index of cu_sbt_udlr_hal_flag is 1. If the initialization type of cu_sbt_udlr_hor_flag is 1, then the context index of cu_sbt_udlr_hor_flag is 0 to 2; if the initialization type of cu_sbt_udlr_hor_flag is 2, then the context index of cu_sbt_udlr_hor_flag is 3 to 5. If the initialization type of cu_sbt_udlr_pos_flag is 1, then the context index of cu_sbt_udlr_pos_flag is 0; if the initialization type of cu_sbt_udlr_pos_flag is 2, then the context index of cu_sbt_udlr_pos_flag is 1.

[0331] In some implementations, the encoder can determine the first context model corresponding to the third identifier information based on the initialization type (initType) of the third identifier information, and then perform entropy encoding on the third identifier information based on the first context model. For example, the encoder can determine the context index increment (ctxId) based on the initialization type of the third identifier information, and then determine the initial value of the first context model based on the context index increment.

[0332] The correspondence between the initial value of the third identifier information cu_sbt_udlr_flag and the context index increment can be shown in Table 7 above.

[0333] As shown in Table 7, when the ctxIdx of cu_sbt_udlr_flag is 0, the initValue of cu_sbt_udlr_flag is 35 and the shiftIdx is 10. When the ctxIdx of cu_sbt_udlr_flag is 1, the initValue of cu_sbt_udlr_flag is 35 and the shiftIdx is 10.

[0334] In some implementations, the encoder can determine the second context model corresponding to the second identifier information based on the initialization type of the second identifier information, and then perform entropy encoding on the second identifier information based on the second context model. For example, the encoder can determine the context index increment (ctxId) based on the initialization type of the second identifier information, and then determine the initial value of the second context model based on the context index increment.

[0335] The correspondence between the initial value of the second identifier information cu_sbt_udlr_pos_flag and the context index increment can be shown in Table 8 above.

[0336] As shown in Table 8, when the ctxIdx of cu_sbt_udlr_pos_flag is 0, the initValue of cu_sbt_udlr_pos_flag is 28 and the shiftIdx is 13. When the ctxIdx of cu_sbt_udlr_pos_flag is 1, the initValue of cu_sbt_udlr_pos_flag is 20 and the shiftIdx is 13.

[0337] In some implementations, the encoder can determine the third context model corresponding to the first identification information based on the initialization type of the first identification information and the size relationship between the height and width of the current CU, and then perform entropy encoding on the first identification information based on the third context model.

[0338] In some implementations, the encoder can determine the context index increment (ctxId) based on the initialization type of the first identifier information, and determine the initial value of the third context model based on the context index increment.

[0339] The correspondence between the initial value of the first identifier information cu_sbt_udlr_hor_flag and the context index increment can be shown in Table 9 above.

[0340] As shown in Table 9, when the ctxIdx of cu_sbt_udlr_hor_flag is 0, the initValue of cu_sbt_udlr_hor_flag is 20, and the shiftIdx is 8. When the ctxIdx of cu_sbt_udlr_hor_flag is 1, the initValue of cu_sbt_udlr_hor_flag is 43, and the shiftIdx is 4. When the ctxIdx of cu_sbt_udlr_hor_flag is 2, the initValue of cu_sbt_udlr_hor_flag is 12, and the shiftIdx is 1. When the ctxIdx of cu_sbt_udlr_hor_flag is 3, the initValue of cu_sbt_udlr_hor_flag is 35, and the shiftIdx is 8. When the ctxIdx of cu_sbt_udlr_hor_flag is 4, the initValue of cu_sbt_udlr_hor_flag is 51, and the shiftIdx is 4. When the ctxIdx of cu_sbt_udlr_hor_flag is 5, the initValue of cu_sbt_udlr_hor_flag is 27, and the shiftIdx is 1.

[0341] In some implementations, the encoder can determine the fourth context model corresponding to the fourth identifier information based on the initialization type of the fourth identifier information, and then perform entropy encoding on the fourth identifier information based on the fourth context model. For example, the encoder can determine the context index increment (ctxId) based on the initialization type of the fourth identifier information, and then determine the initial value of the fourth context model based on the context index increment.

[0342] The correspondence between the initial value of the fourth identifier information cu_sbt_udlr_hal_flag and the context index increment can be shown in Table 10 above.

[0343] As shown in Table 10, when the ctxIdx of cu_sbt_udlr_hal_flag is 0, the initValue of cu_sbt_udlr_hal_flag is 35 and the shiftIdx is 10. When the ctxIdx of cu_sbt_udlr_hal_flag is 1, the initValue of cu_sbt_udlr_hal_flag is 35 and the shiftIdx is 10.

[0344] The syntax elements cu_sbt_udlr_flag, cu_sbt_udlr_hal_flag, and cu_sbt_udlr_pos_flag all select the corresponding ctxId according to initType. The syntax element cu_sbt_udlr_hor_flag indicates whether the sub-block division selects the up-down division (or horizontal division) or the left-right division (or vertical division), which is related to the size of the CU. Therefore, the CU can select different contexts in three cases: cbWidth = cbHeight (width is equal to height), cbWidth < cbHeight (width is less than height), and cbWidth > cbHeight (width is greater than height), as shown in Table 11.

[0345] The corresponding relationship between ctxInc and binIdx can be as shown in Table 11 in the above text.

[0346] As can be seen from Table 11, for the syntax element cu_sbt_udlr_hor_flag, when binIdx = 0, if the width and height of the CU are equal, then ctxInc = 0; if the width of the CU is less than the height of the CU, then ctxInc = 1; if the width of the CU is greater than the height of the CU, then ctxInc = 2.

[0347] The initial values of the context models described above are all default values. Of course, in some embodiments of the present application, the probability of the context model after the encoding of each frame of each sequence can be recorded through training, and the initial value of the context model can be changed according to the training results.

[0348] The method embodiments of the present application have been described in detail above in conjunction with FIGS. 1 to 15. Below, the apparatus embodiments of the present application will be described in detail in conjunction with FIGS. 16 to 19. It should be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments. Therefore, the parts not described in detail can be referred to the previous method embodiments.

[0349] FIG. 16 is a schematic structural diagram of a decoder provided by an embodiment of the present application. As shown in FIG. 16, the decoder 1600 includes: a determination unit 1610 and an inverse transformation unit 1620. The determination unit 1610 is configured to determine a first sub-block in the current coding unit CU, one side of the first sub-block partially coincides with one side of the current CU, and the other sides of the first sub-block do not coincide with any side of the current CU; the inverse transformation unit 1620 is configured to perform an inverse transformation on the transformation coefficients of the first sub-block to obtain the residual information corresponding to the first sub-block.

[0350] In some implementations, the decoder 1600 further includes a decoding unit configured to decode the first identification information and the second identification information, wherein the first identification information is used to indicate the division method of the current CU into sub-blocks, and the second identification information is used to indicate the position of the first sub-block in the current CU; the determining unit 1610 is configured to determine the first sub-block in the current CU based on the first identification information and the second identification information.

[0351] The decoding unit is configured to decode a third identification information before decoding the first identification information and the second identification information, wherein the third identification information is used to indicate whether the current CU uses a target partitioning mode, wherein the sub-blocks after the current CU is partitioned using the target partitioning mode include the first sub-block; and is configured to decode the first identification information and the second identification information if the third identification information indicates that the current CU uses the target partitioning mode.

[0352] In some implementations, the decoder 1600 further includes a decoding unit configured to decode fourth identification information, the fourth identification information being used to indicate the size information of the first sub-block; and a determining unit 1610 configured to determine the first sub-block in the current CU based on the first identification information, the second identification information, and the fourth identification information.

[0353] In some implementations, the determining unit 1610 is configured to determine the size information of the first sub-block as a default value if the fourth identification information is not decoded, wherein the fourth identification information is used to indicate the size information of the first sub-block.

[0354] In some implementations, the partitioning method includes a first partitioning method and a second partitioning method. If the current CU adopts the first partitioning method, the upper side of the first sub-block partially coincides with the upper side of the current CU, or the lower side of the first sub-block partially coincides with the lower side of the current CU. If the current CU adopts the second partitioning method, the left side of the first sub-block partially coincides with the left side of the current CU, or the right side of the first sub-block partially coincides with the right side of the current CU.

[0355] In some implementations, the condition for the current CU to adopt the first partitioning method is that the width of the current CU is greater than or equal to 32 and the height of the current CU is greater than or equal to 17; the condition for the current CU to adopt the second partitioning method is that the width of the current CU is greater than or equal to 17 and the height of the current CU is greater than or equal to 32.

[0356] In some implementations, the first sub-block is square in shape, the width of the first sub-block is 1 / n of the width of the current CU, and the height of the first sub-block is 1 / m of the height of the current CU, where n and m are both integers greater than 1.

[0357] In some implementations, n = 2, m = 2; or n = 4, m = 4; or n = 2, m = 4; or n = 4, m = 2.

[0358] In some implementations, the line connecting the center of the first sub-block and the center of the current CU is a horizontal or vertical line.

[0359] In some implementations, the determining unit 1610 is configured to determine the transformation kernel to be used for the inverse transformation based on the partitioning method and the position of the first sub-block in the current CU; the inverse transformation unit 1620 is configured to perform the inverse transformation on the transformation coefficients using the transformation kernel.

[0360] In some implementations, the transform kernel corresponding to the luminance component of the first sub-block includes a first transform kernel for the horizontal direction and a second transform kernel for the vertical direction. The first transform kernel is any one of the following: DST-1, DCT-8, DST-7, and the second transform kernel is any one of the following: DST-1, DCT-8, DST-7.

[0361] In some implementations, the transform kernel corresponding to the chromaticity component of the first sub-block is DCT-2.

[0362] In some implementations, the determining unit 1610 is configured to determine the first context model corresponding to the third identifier information based on the initialization type of the third identifier information; the decoder further includes a decoding unit configured to perform entropy decoding on the third identifier information based on the first context model.

[0363] In some implementations, the determining unit 1610 is configured to determine the second context model corresponding to the second identifier information based on the initialization type of the second identifier information; the decoder further includes a decoding unit configured to perform entropy decoding on the second identifier information based on the second context model.

[0364] In some implementations, the determining unit 1610 is configured to determine the third context model corresponding to the first identification information based on the initialization type of the first identification information and the size relationship between the height and width of the current CU; the decoder further includes a decoding unit configured to perform entropy decoding on the first identification information based on the third context model.

[0365] In some implementations, the determining unit 1610 is configured to determine the fourth context model corresponding to the fourth identifier information based on the initialization type of the fourth identifier information; the decoder further includes a decoding unit configured to perform entropy decoding on the fourth identifier information based on the fourth context model.

[0366] In some implementations, the decoder further includes a processing unit configured to set the residuals of sub-blocks in the current CU other than the first sub-block to 0.

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

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

[0369] Therefore, some embodiments of this application provide a computer-readable storage medium applied to a decoder 1600, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned decoding method.

[0370] Based on the composition of the decoder 1600 described above and the computer-readable storage medium, referring to Figure 17, a schematic diagram of the specific hardware structure of the decoder provided in some embodiments of this application is shown. As shown in Figure 17, the decoder 1700 may include: a communication interface 1710, a memory 1720, and a processor 1730; the various components are coupled together through a bus system 1740. It is understood that the bus system 1740 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 1740 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1740 in Figure 17.

[0371] The communication interface 1710 is used for receiving and sending signals during the process of sending and receiving information with other external network elements.

[0372] Memory 1720 is used to store computer programs.

[0373] Processor 1730, when running the computer program, performs the following:

[0374] The first sub-block in the current encoding unit (CU) is determined, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU.

[0375] The transformation coefficients of the first sub-block are inversely transformed to obtain the residual information corresponding to the first sub-block.

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

[0377] The processor 1730 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above methods can be completed by the integrated logic circuitry in the hardware of the processor 1730 or by software instructions. The processor 1730 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in some embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in some embodiments of this application can be implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1720. Processor 1730 reads the information in memory 1720 and completes the steps of the above method in conjunction with its hardware.

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

[0379] In some embodiments, as another example, the processor 1730 is also configured to perform the decoding method described in the foregoing embodiments when running the computer program.

[0380] In some embodiments of this application, a decoding chip is also provided, which includes a processor and a memory. The processor is configured to call and run a computer program from the memory, enabling a device equipped with the decoding chip to perform any of the decoding methods described above.

[0381] Figure 18 is a schematic diagram of the encoder provided in an embodiment of this application. As shown in Figure 18, the encoder 1800 includes a determining unit 1810 and a transforming unit 1820. The determining unit 1810 is configured to determine a first sub-block in the current encoding unit CU, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU; the transforming unit 1820 is configured to transform the residual information of the first sub-block to obtain the transform coefficients of the first sub-block.

[0382] In some implementations, the encoder 1800 further includes an encoding unit configured to encode first identification information and second identification information, wherein the first identification information is used to indicate the division method of the current CU into sub-blocks, and the second identification information is used to indicate the position of the first sub-block in the current CU.

[0383] In some implementations, the encoding unit is configured to encode a third identification information before encoding the first and second identification information, the third identification information being used to indicate whether the current CU uses a target partitioning mode, wherein the sub-blocks after the current CU is partitioned using the target partitioning mode include the first sub-block; and if the third identification information indicates that the current CU uses the target partitioning mode, then the first and second identification information are encoded.

[0384] In some implementations, encoder 1800 further includes an encoding unit configured to encode fourth identification information, which is used to indicate the size information of the first sub-block.

[0385] In some implementations, encoder 1800 further includes a processing unit configured to not encode the fourth identification information if the size information of the first sub-block is a default value, the fourth identification information being used to indicate the size information of the first sub-block.

[0386] In some implementations, the partitioning method includes a first partitioning method and a second partitioning method. If the current CU adopts the first partitioning method, the upper side of the first sub-block partially coincides with the upper side of the current CU, or the lower side of the first sub-block partially coincides with the lower side of the current CU. If the current CU adopts the second partitioning method, the left side of the first sub-block partially coincides with the left side of the current CU, or the right side of the first sub-block partially coincides with the right side of the current CU.

[0387] In some implementations, the condition for the current CU to adopt the first partitioning method is that the width of the current CU is greater than or equal to 32 and the height of the current CU is greater than or equal to 17; the condition for the current CU to adopt the second partitioning method is that the width of the current CU is greater than or equal to 17 and the height of the current CU is greater than or equal to 32.

[0388] In some implementations, the first sub-block is square in shape, the width of the first sub-block is 1 / n of the width of the current CU, and the height of the first sub-block is 1 / m of the height of the current CU, where n and m are both integers greater than 1.

[0389] In some implementations, n = 2, m = 2; or n = 4, m = 4; or n = 2, m = 4; or n = 4, m = 2.

[0390] In some implementations, the line connecting the center of the first sub-block and the center of the current CU is a horizontal or vertical line.

[0391] In some implementations, the determining unit is configured to: determine the transformation kernel to be used for the transformation based on the partitioning method and the position of the first sub-block in the current CU; the transformation unit is configured to: transform the residual information of the first sub-block using the transformation kernel.

[0392] In some implementations, the transform kernel corresponding to the luminance component of the first sub-block includes a first transform kernel for the horizontal direction and a second transform kernel for the vertical direction. The first transform kernel is any one of the following: DST-1, DCT-8, DST-7, and the second transform kernel is any one of the following: DST-1, DCT-8, DST-7.

[0393] In some implementations, the transform kernel corresponding to the chromaticity component of the first sub-block is DCT-2.

[0394] In some implementations, the determining unit is configured to: determine the first context model corresponding to the third identifier information based on the initialization type of the third identifier information; the encoder further includes an encoding unit configured to perform entropy encoding on the third identifier information based on the first context model.

[0395] In some implementations, the determining unit is configured to: determine the second context model corresponding to the second identification information based on the initialization type of the second identification information; the encoder further includes an encoding unit configured to perform entropy encoding on the second identification information based on the second context model.

[0396] In some implementations, the determining unit is configured to: determine the third context model corresponding to the first identification information based on the initialization type of the first identification information and the size relationship between the height and width of the current CU; the encoder further includes an encoding unit configured to perform entropy encoding on the first identification information based on the third context model.

[0397] In some implementations, the determining unit is configured to: determine the fourth context model corresponding to the fourth identification information based on the initialization type of the fourth identification information; the encoder further includes an encoding unit configured to perform entropy encoding on the fourth identification information based on the fourth context model.

[0398] In some implementations, the encoder further includes a processing unit configured to set the residuals of the sub-blocks in the current CU other than the first sub-block to 0.

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

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

[0401] Therefore, some embodiments of this application provide a computer-readable storage medium applied to an encoder 1800, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the encoding method in the foregoing embodiments.

[0402] Based on the composition of the encoder 1800 described above and the computer-readable storage medium, referring to Figure 19, a schematic diagram of the specific hardware structure of the encoder provided in some embodiments of this application is shown. As shown in Figure 19, the encoder 1900 may include: a communication interface 1910, a memory 1920, and a processor 1930; the various components are coupled together through a bus system 1940. It is understood that the bus system 1940 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 1940 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 1940 in Figure 19.

[0403] The communication interface 1910 is used for receiving and sending signals during the process of sending and receiving information with other external network elements.

[0404] Memory 1920 is used to store computer programs.

[0405] Processor 1930, when running the computer program, is configured to perform:

[0406] The first sub-block in the current encoding unit (CU) is determined, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU.

[0407] The residual information of the first sub-block is transformed to obtain the transformation coefficients of the first sub-block.

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

[0409] The processor 1930 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above methods can be completed by the integrated logic circuitry in the hardware of the processor 1930 or by instructions in software form. The processor 1930 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in some embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in some embodiments of this application can be implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1920. Processor 1930 reads the information in memory 1920 and, in conjunction with its hardware, completes the steps of the above method.

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

[0411] In some embodiments, as another example, the processor 1930 is also configured to perform the encoding method described in the foregoing embodiments when running the computer program.

[0412] In some embodiments of this application, an encoding chip is also provided, which includes a processor and a memory, the processor being configured to call and run a computer program from the memory, enabling a device equipped with the encoding chip to perform any of the decoding methods described above.

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

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

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

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

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

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

Claims

1. A decoding method, comprising: Applied to the decoder, including: The first sub-block in the current encoding unit (CU) is determined, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU. The transformation coefficients of the first sub-block are inversely transformed to obtain the residual information corresponding to the first sub-block.

2. The method according to claim 1, characterized in that, Determining the first sub-block in the current coding unit (CU) includes: The first identification information and the second identification information are decoded. The first identification information is used to indicate the division method of the current CU into sub-blocks, and the second identification information is used to indicate the position of the first sub-block in the current CU. Based on the first identification information and the second identification information, the first sub-block in the current CU is determined.

3. The method according to claim 2, characterized in that, Before decoding the first and second identification information, the method further includes: The third identification information is decoded, which is used to indicate whether the current CU uses the target partitioning mode, wherein the sub-blocks after the current CU is partitioned using the target partitioning mode include the first sub-block; Decoding the first and second identification information includes: If the third identification information indicates that the current CU uses the target partitioning mode, then the first identification information and the second identification information are decoded.

4. The method according to claim 3, characterized in that, The method further includes: The fourth identification information is decoded, and the fourth identification information is used to indicate the size information of the first sub-block; The step of determining the first sub-block in the current CU based on the first identification information and the second identification information includes: Based on the first identification information, the second identification information, and the fourth identification information, the first sub-block in the current CU is determined.

5. The method according to claim 2, characterized in that, The method further includes: If the fourth identification information is not decoded, the size information of the first sub-block is determined to be the default value, and the fourth identification information is used to indicate the size information of the first sub-block.

6. The method according to claim 2, characterized in that, The division method includes a first division method and a second division method. If the current CU adopts the first division method, then the upper side of the first sub-block coincides with the upper side of the current CU, or the lower side of the first sub-block coincides with the lower side of the current CU. If the current CU adopts the second partitioning method, then the left side of the first sub-block partially overlaps with the left side of the current CU, or the right side of the first sub-block partially overlaps with the right side of the current CU.

7. The method according to claim 6, characterized in that, The conditions under which the current CU can adopt the first division method include: the width of the current CU is greater than or equal to 32, and the height of the current CU is greater than or equal to 16. The conditions under which the current CU can adopt the second division method include: the width of the current CU is greater than or equal to 16, and the height of the current CU is greater than or equal to 32.

8. The method according to any one of claims 1-7, characterized in that, The first sub-block is square in shape, and its width is 1 / n of the width of the current CU. The height of the first sub-block is 1 / m of the height of the current CU, where n and m are both integers greater than 1.

9. The method according to claim 8, characterized in that, n = 2, m = 2; or n = 4, m = 4; or n = 2, m = 4; or n = 4, m = 2.

10. The method according to claim 8, characterized in that, The line connecting the center of the first sub-block and the center of the current CU is a horizontal line or a vertical line.

11. The method according to claim 2, characterized in that, The method further includes: Based on the partitioning method and the position of the first sub-block in the current CU, the transformation kernel required to perform the inverse transformation is determined; The inverse transformation of the transformation coefficients of the first sub-block includes: The transformation coefficients are inversely transformed using the transformation kernel.

12. The method according to claim 11, characterized in that, The transform kernel corresponding to the luminance component of the first sub-block includes a first transform kernel for the horizontal direction and a second transform kernel for the vertical direction. The first transform kernel is any one of the following: DST-1, DCT-8, DST-7. The second transform kernel is any one of the following: DST-1, DCT-8, DST-7.

13. The method according to claim 11, characterized in that, The transform kernel corresponding to the chromaticity component of the first sub-block is DCT-2.

14. The method according to claim 3, characterized in that, The method further includes: Based on the initialization type of the third identification information, the first context model corresponding to the third identification information is determined; Decoding the third identifier information includes: Based on the first context model, the third identification information is entropy decoded.

15. The method according to claim 2, characterized in that, The method further includes: Based on the initialization type of the second identification information, determine the second context model corresponding to the second identification information; Decoding the first and second identification information includes: Based on the second context model, the second identification information is entropy decoded.

16. The method according to claim 2, characterized in that, The method further includes: Based on the initialization type of the first identification information and the size relationship between the height and width of the current CU, the third context model corresponding to the first identification information is determined. Decoding the first and second identification information includes: Based on the third context model, the first identification information is entropy decoded.

17. The method according to claim 4, characterized in that, The method further includes: Based on the initialization type of the fourth identification information, determine the fourth context model corresponding to the fourth identification information; Decoding the fourth identifier information includes: Based on the fourth context model, the fourth identification information is entropy decoded.

18. The method according to any one of claims 1-7, characterized in that, The method further includes: Set the residuals of the sub-blocks in the current CU other than the first sub-block to 0.

19. An encoding method, characterized in that, Applied to encoders, including: The first sub-block in the current encoding unit (CU) is determined, wherein one edge of the first sub-block partially overlaps with one edge of the current CU, and the other edges of the first sub-block do not overlap with any edge of the current CU. The residual information of the first sub-block is transformed to obtain the transformation coefficients of the first sub-block.

20. The method according to claim 19, characterized in that, The method further includes: The first identification information and the second identification information are encoded. The first identification information is used to indicate the division method of the current CU into sub-blocks, and the second identification information is used to indicate the position of the first sub-block in the current CU.

21. The method according to claim 20, characterized in that, Before encoding the first identification information and the second identification information, the method further includes: The third identification information is encoded to indicate whether the current CU uses the target partitioning mode, wherein the sub-blocks after the current CU is partitioned using the target partitioning mode include the first sub-block; The encoding of the first identification information and the second identification information includes: If the third identification information indicates that the current CU uses the target partitioning mode, then the first identification information and the second identification information are encoded.

22. The method according to claim 21, characterized in that, The method further includes: The fourth identification information is encoded, and the fourth identification information is used to indicate the size information of the first sub-block.

23. The method according to claim 20, characterized in that, The method further includes: If the size information of the first sub-block is a default value, then the fourth identification information is not encoded. The fourth identification information is used to indicate the size information of the first sub-block.

24. The method according to claim 20, characterized in that, The division method includes a first division method and a second division method. If the current CU adopts the first division method, then the upper side of the first sub-block coincides with the upper side of the current CU, or the lower side of the first sub-block coincides with the lower side of the current CU. If the current CU adopts the second partitioning method, then the left side of the first sub-block partially overlaps with the left side of the current CU, or the right side of the first sub-block partially overlaps with the right side of the current CU.

25. The method according to claim 24, characterized in that, The conditions under which the current CU can adopt the first division method include: the width of the current CU is greater than or equal to 32, and the height of the current CU is greater than or equal to 16. The conditions under which the current CU can adopt the second division method include: the width of the current CU is greater than or equal to 16, and the height of the current CU is greater than or equal to 32.

26. The method according to any one of claims 19-25, characterized in that, The first sub-block is square in shape, and its width is 1 / n of the width of the current CU. The height of the first sub-block is 1 / m of the height of the current CU, where n and m are both integers greater than 1.

27. The method according to claim 26, characterized in that, n = 2, m = 2; or n = 4, m = 4; or n = 2, m = 4; or n = 4, m = 2.

28. The method according to claim 26, characterized in that, The line connecting the center of the first sub-block and the center of the current CU is a horizontal line or a vertical line.

29. The method according to claim 20, characterized in that, The method further includes: Based on the division method and the position of the first sub-block in the current CU, the transformation kernel to be used for the transformation is determined; The transformation of the residual information of the first sub-block includes: The residual information of the first sub-block is transformed using the transformation kernel.

30. The method according to claim 29, characterized in that, The transform kernel corresponding to the luminance component of the first sub-block includes a first transform kernel for the horizontal direction and a second transform kernel for the vertical direction. The first transform kernel is any one of the following: DST-1, DCT-8, DST-7. The second transform kernel is any one of the following: DST-1, DCT-8, DST-7.

31. The method according to claim 29, characterized in that, The transform kernel corresponding to the chromaticity component of the first sub-block is DCT-2.

32. The method according to claim 21, characterized in that, The method further includes: Based on the initialization type of the third identification information, the first context model corresponding to the third identification information is determined; The encoding of the third identification information includes: Based on the first context model, the third identification information is entropy encoded.

33. The method according to claim 20, characterized in that, The method further includes: Based on the initialization type of the second identification information, determine the second context model corresponding to the second identification information; The encoding of the first identification information and the second identification information includes: Based on the second context model, the second identification information is entropy encoded.

34. The method according to claim 20, characterized in that, The method further includes: Based on the initialization type of the first identification information and the size relationship between the height and width of the current CU, the third context model corresponding to the first identification information is determined. The encoding of the first identification information and the second identification information includes: Based on the third context model, the first identification information is entropy encoded.

35. The method according to claim 22, characterized in that, The method further includes: Based on the initialization type of the fourth identification information, determine the fourth context model corresponding to the fourth identification information; The encoding of the fourth identification information includes: Based on the fourth context model, the fourth identification information is entropy encoded.

36. The method according to any one of claims 19-25, characterized in that, The method further includes: Set the residuals of the sub-blocks in the current CU other than the first sub-block to 0.

37. A decoder, characterized in that, include: Memory, used to store computer programs; A processor, configured to perform the method as described in any one of claims 1-18 when running the computer program.

38. An encoder, characterized in that, include: Memory, used to store computer programs; A processor, configured to perform the method as described in any one of claims 19-36 when running the computer program.

39. A decoding chip, characterized in that, It includes a processor and a memory, the processor being configured to invoke a program or instructions from the memory to cause the method as described in any one of claims 1-18 to be executed.

40. An encoding chip, characterized in that, It includes a processor and a memory, the processor being configured to invoke a program or instructions from the memory to cause the method as described in any one of claims 19-36 to be executed.

41. A non-volatile computer-readable storage medium for storing bit streams, characterized in that, The bitstream is generated by using an encoder's encoding method, or the bitstream is decoded by using a decoder's decoding method, wherein the decoding method is the method as described in any one of claims 1-18, and the encoding method is the method as described in any one of claims 19-36.

42. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1-18 or 19-36.

43. A bitstream, characterized in that, The bitstream includes the bitstream generated by the method as described in any one of claims 19-36.

Citation Information

Patent Citations

  • Decoding and encoding method, decoding end and encoding end

    CN111988618A

  • Method and apparatus for transform-based image encoding

    CN114556921A

  • Method for encoding and decoding current block of video data and method for providing video data

    CN118075476A

  • Method and device for processing video signal

    WO2020162732A1

  • Method and apparatus for video encoding and decoding, computer-readable medium and electronic device

    WO2024212676A1