Video decoding method, video encoding method, and related device

By using the encoding information near the encoding block to determine the transformation information of the current encoding block, the problem of high encoding cost in video encoding technology is solved, and the code rate consumption is reduced and the decoding efficiency is improved.

WO2024255479A1PCT designated stage expired Publication Date: 2024-12-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/091163
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-14
Filing Date
2024-05-06
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

In the existing video encoding technology, the transform information of the encoding block needs to be encoded, resulting in high code rate consumption.

Method used

By determining the encoding information of the adjacent encoding block of the current encoding block, the transformation information of the current encoding block is determined, and decoding or encoding processing is performed based on the transformation information, thereby reducing the encoding cost of the transformation information.

Benefits of technology

Reduces the bit rate consumption during video encoding and decoding and improves decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091163_19122024_PF_FP_ABST
    Figure CN2024091163_19122024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a video decoding method, a video encoding method, and a related device. The video decoding method comprises: determining a current encoding block in a video code stream, and determining a neighboring encoding block of the current encoding block; according to encoding information of the neighboring encoding block, determining transformation information of the current encoding block; and on the basis of the determined transformation information of the current encoding block, decoding the current encoding block. The embodiments of the present application can reduce the bitrate consumption in video encoding and decoding processes.
Need to check novelty before this filing date? Find Prior Art

Description

Video decoding method, video encoding method and related equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 14, 2023, with application number 202310709242.7 and application name “A video decoding method, a video encoding method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of audio and video technology, and in particular to a video decoding method, a video encoding method, a video decoding device, a video encoding device, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0003] In existing video coding technologies, video frames can be divided into a series of coding blocks, and video compression can be achieved by combining video coding methods such as prediction, transformation, and entropy coding. Among them, there are multiple transformation methods for transforming coding blocks. For example, various transformation division methods (such as Residual Quad Tree (RQT), position-based transform (PBT), etc.) can be used for transformation; for example, various transformation combinations (such as DCT discrete cosine transform kernel, DST discrete sine transform kernel, etc.) can be used for transformation. Different transformation methods will obtain different transformation information. When the encoding end transforms the coding block, it also needs to encode the transformation information, which usually results in higher bit rate consumption.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a video decoding method, a video encoding method and related devices, which can reduce the bit rate consumption in the video encoding and decoding process.

[0006] In one aspect, an embodiment of the present application provides a video decoding method, the method comprising:

[0007] Determine a current coding block in a video stream and determine adjacent coding blocks of the current coding block;

[0008] Determine the transformation information of the current coding block based on the coding information of the adjacent coding blocks;

[0009] Based on the determined transformation information of the current coding block, decoding processing is performed on the current coding block.

[0010] In one aspect, an embodiment of the present application provides a video encoding method, the method comprising:

[0011] Determine a current coding block in the video and determine adjacent coding blocks of the current coding block;

[0012] Determine the transformation information of the current coding block based on the coding information of the adjacent coding blocks;

[0013] Based on the determined transformation information of the current coding block, the current coding block is coded to obtain a video stream.

[0014] In one aspect, an embodiment of the present application provides a video decoding device, comprising:

[0015] A processing unit, configured to determine a current coding block in a video stream;

[0016] The processing unit is further configured to determine adjacent coding blocks of a current coding block;

[0017] The processing unit is further configured to determine transformation information of a current coding block based on coding information of adjacent coding blocks;

[0018] The decoding unit is configured to perform decoding processing on the current coding block based on the determined transformation information of the current coding block.

[0019] In one aspect, an embodiment of the present application provides a video encoding apparatus, the apparatus comprising:

[0020] a processing unit for determining a current coding block in the video;

[0021] The processing unit is further configured to determine an adjacent coding block of the current coding block;

[0022] The processing unit is further configured to determine transformation information of the current coding block based on the coding information of the adjacent coding blocks;

[0023] The encoding unit is configured to perform encoding processing on the current encoding block based on the determined transformation information of the current encoding block to obtain a video code stream.

[0024] In one aspect, an embodiment of the present application provides a computer device, comprising:

[0025] a processor suitable for executing a computer program;

[0026] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned video decoding method or the above-mentioned video encoding method is implemented.

[0027] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is loaded by a processor and executed such as the above-mentioned video decoding method or the above-mentioned video encoding method.

[0028] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the above-mentioned video decoding method or the above-mentioned video encoding method is implemented.

[0029] In an embodiment of the present application, in the process of encoding and decoding the current coding block in the video, the transformation information of the current coding block can be determined based on the coding information of the adjacent coding blocks of the current coding block, and the encoding and decoding processing of the current coding block can be implemented based on the determined transformation information of the current coding block. In this way, there is no need to encode the transformation information of the current coding block, which can reduce the encoding cost consumed by encoding the transformation information of the current coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] FIG1 is a basic working flow diagram of a video encoder provided by an exemplary embodiment of the present application;

[0031] FIG2 is a schematic diagram of a residual quadtree partitioning mode provided by an exemplary embodiment of the present application;

[0032] FIG3 is a schematic diagram of a position-based sub-block transformation provided by an exemplary embodiment of the present application;

[0033] FIG4a is a schematic diagram of a sub-block transformation provided by an exemplary embodiment of the present application;

[0034] FIG4 b is a schematic diagram of a transformation combination corresponding to each of 12 residual position patterns provided by an exemplary embodiment of the present application;

[0035] FIG5 is an architecture diagram of a video encoding and decoding system provided by an exemplary embodiment of the present application;

[0036] FIG6 is a flow chart of a video decoding method provided by an exemplary embodiment of the present application;

[0037] FIG7a is a schematic diagram of a transform block adjacent to a current coding block provided by an exemplary embodiment of the present application;

[0038] FIG7b is a schematic diagram of a transform block adjacent to a current coding block provided by another exemplary embodiment of the present application;

[0039] FIG8 is a schematic diagram showing the positional relationship between a first adjacent coding block and a second adjacent coding block and a current coding block, provided by an exemplary embodiment of the present application;

[0040] FIG9 is a flow chart of a video encoding method provided by an exemplary embodiment of the present application;

[0041] FIG10 is a schematic structural diagram of a video decoding device provided by an exemplary embodiment of the present application;

[0042] FIG11 is a schematic structural diagram of a video encoding device provided by another exemplary embodiment of the present application;

[0043] FIG12 is a schematic structural diagram of a computer device provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0044] The following is an introduction to the technical terms involved in this application:

[0045] 1. Video Encoding

[0046] A video can be composed of one or more video frames, each of which contains part of the video signal of the video. The acquisition method of the video signal can be divided into two methods: camera shooting or computer generation. Due to the different statistical characteristics corresponding to different acquisition methods, the compression encoding method of the video may also be different. Among the mainstream video coding technologies, taking HEVC (High Efficiency Video Coding, international video coding standard HEVC / H.265), VVC (versatile video coding, international video coding standard VVC / H.266), and AVS (Audio Video Coding Standard, China's national video coding standard) as examples, a hybrid coding framework is adopted, under which the following series of operations and processing of the video are allowed:

[0047] 1) Block partition structure: According to the size of the video frame, the video frame can be divided into several non-overlapping processing units, and each processing unit will perform similar compression operations. This processing unit is called CTU (coding tree unit) or LCU (Largest Coding Unit). The CTU can be further divided into more refined parts to obtain one or more basic coding units, called CU (coding unit or coding block). The coding block (CU) is the most basic element in a coding link. The subsequent embodiments of this application describe various encoding and decoding processing flows that may be used for each coding block.

[0048] 2) Prediction coding: This includes prediction modes such as intra-frame prediction and inter-frame prediction. The original video signal contained in the coding block in the video frame is predicted by the reconstructed video signal in the selected coding block to obtain a residual. The encoder needs to select a suitable prediction mode from many possible prediction modes for the current coding block and inform the decoder of the selected prediction mode. Here, the current coding block can be the coding block being encoded. The prediction mode may include:

[0049] a. Intra-frame prediction (Intra-picture Prediction): The reconstructed video signal used for prediction comes from an already coded and reconstructed area within the same video frame. That is, the current coding block and the predicted reference coding block used by the current coding block are located in the same video frame. The basic idea of ​​intra-frame prediction is to remove spatial redundancy by utilizing the correlation between adjacent pixels within the same video frame. In video coding, adjacent pixels refer to the reconstructed pixels of the coded coding blocks surrounding the current coding block within the same video frame.

[0050] b. Inter-picture prediction: The reconstructed video signal used for prediction comes from other video frames that have been encoded and are different from the current frame. That is, the current coding block and the predicted reference coding block referenced by the current coding block are located in different video frames. The current frame refers to the video frame where the current coding block is located.

[0051] 3) Transform & Quantization: The residual is converted to the transform domain through transformations such as the Discrete Fourier Transform (DFT), Discrete Cosine Transform (DCT), and Discrete Sine Transform (DST). The residual in the transform domain is called the transform coefficient. The residual in the transform domain is further subjected to a lossy quantization operation, which loses some information, making the quantized signal more suitable for compression.

[0052] In some video coding standards, there may be more than one transform method to choose from. Therefore, the encoder also needs to select one of these transform methods for the current coding block and inform the decoder. The degree of quantization is usually determined by the QP (Quantization Parameters). When the QP value is large, the transform coefficients representing a larger value range will be quantized to the same output, which usually results in greater distortion and lower bitrate. Conversely, when the QP value is small, the transform coefficients representing a smaller value range will be quantized to the same output, which usually results in less distortion and correspondingly higher bitrate.

[0053] 4) Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically encoded based on the frequency of occurrence of each value, and finally output as a binary (0 or 1) video stream. At the same time, the encoding will generate other information, such as the selected prediction mode, motion vectors, etc. This other information also needs to be entropy encoded to reduce the bit rate. Among them, statistical coding is a lossless coding method that can effectively reduce the bit rate required to express the same signal. Common statistical coding methods include variable length coding (VLC) or context-based binary arithmetic coding (CABAC).

[0054] 5) Loop Filtering: The coded blocks are subjected to inverse quantization, inverse transformation, and prediction compensation (the inverse operations of 2) to 4) above) to reconstruct the decoded image corresponding to the coded blocks. Compared with the original image, the reconstructed decoded image has some information different from the original image due to the influence of quantization, resulting in distortion. Therefore, a filter can be used to filter the reconstructed decoded image to effectively reduce the degree of distortion caused by quantization. The filter can be, for example, a deblocking filter, SAO (sample adaptive offset), or ALF (adaptive loop filter). Since these filtered reconstructed decoded images will serve as prediction reference coded blocks for other coded blocks that need to be encoded subsequently and are used in the prediction process of other coded blocks, the above filtering operation is also called loop filtering, and the filtering operation within the coding loop.

[0055] Based on the description of steps 1)-5) above, the embodiment of the present application provides a basic workflow diagram of a video encoder. Please refer to FIG1, which is a basic workflow diagram of a video encoder provided by an exemplary embodiment of the present application. In FIG1, the current coding block is the kth coding block in the current frame (current image) (as shown in FIG1). k [x,y]) is used as an example, k is a positive integer, and k is less than or equal to the total number of coding blocks contained in the current frame. k [x,y] represents the pixel point (referred to as pixel) with coordinates [x,y] in the kth coding block, where x represents the horizontal coordinate of the pixel and y represents the vertical coordinate of the pixel; s k [x,y] can obtain the prediction signal after motion compensation or intra-frame prediction. The prediction signal and the original signal s k [x,y] is subtracted to get the residual u k [x,y]; then the residual u k [x,y] is transformed and quantized. The output data of the quantization process has two different destinations, A and B:

[0056] A: The data output by the quantization process can be sent to an entropy encoder for entropy encoding to obtain an encoded video stream, which is then output to a buffer for storage and waiting to be transmitted.

[0057] B. The data output by quantization processing can also be dequantized and inverse transformed to obtain the residual u′ after inverse transformation. k [y,y] The residual u′ after the inverse transformation k [x,y] and prediction signal Add up to get a new prediction signal And the new prediction signal Then, the new prediction signal can be sent to the buffer of the current image. After intra-frame prediction processing, we get The new prediction signal After loop filtering, the reconstructed signal sk can be obtained k [x,y], and reconstruct the signal s′ k [x,y] is sent to the decoded image buffer for storage to generate the reconstructed video. Reconstructed signal s′ k [x,y] is obtained through motion compensation prediction in It can represent the prediction reference coding block referenced by the current coding block, m x and m yThey respectively represent the horizontal and vertical components of the motion vector of the prediction reference coding block referenced by the current encoding.

[0058] Among them, since the prediction methods used in the predictive coding process (such as intra-frame prediction and inter-frame prediction) have large errors, the residual needs to be transmitted to compensate for the predicted video frame (i.e., image), thereby improving the quality of the reconstructed video frame (i.e., decoded image). Therefore, residual processing is an important processing process in the hybrid coding framework.

[0059] As shown in Figure 1, in the hybrid coding framework, the residual is the difference between the original signal (i.e., the original video frame) and the predicted signal (i.e., the predicted video frame):

[0060] In the HEVC, VVC and AVS3 video coding standards, residual processing includes the following two processing methods (1) and (2):

[0061] (1) Transformation and quantization:

[0062] By utilizing the correlation of the residuals, the energy of the residuals is concentrated through transformation processing, so that the energy is concentrated in fewer low-frequency transformation coefficients. That is to say, after the residuals of most coding blocks are transformed, the transformation coefficients corresponding to the residuals of most coding blocks are smaller. The so-called correlation of residuals means that the residuals between coding blocks are correlated. Schematically, the residual of a coding block will refer to the residual of its adjacent coding block, so the residual of the coding block is correlated with the residual of the adjacent coding block to which it refers. After subsequent quantization processing, the smaller transformation coefficients will become zero values, which greatly reduces the cost of coding residuals. Taking the traditional DCT as an example, the transformation is shown below, and a two-dimensional discrete transformation is achieved through two separate one-dimensional discrete transformations (horizontal transformation and vertical transformation). Co k =CU k C T

[0063] Among them, Co k Represents the transform coefficient after the residual transform of the current coding block, U k represents the residual, C represents the transformation kernel of the vertical transformation; C T Represents the transformation kernel for the horizontal transformation.

[0064] Due to the diversity of residual distribution, a single DCT cannot adapt to all residual characteristics. Therefore, transform kernels such as DST7 and DCT8 are introduced into the transform process, so that a transform combination can be introduced during the transform of the residual to solve the problem that a single DCT cannot adapt to all residual characteristics. Among them, the transform combination can refer to a combination of a transform kernel for horizontal transform and a transform kernel for vertical transform, and the horizontal transform and the vertical transform can use the same or different transform kernels. Transform kernels include but are not limited to: DCT2, DCT8, DST7, etc. Among them, DCT2 and DCT8 refer to different DCT transform modes, and DST7 refers to a transform mode of DST.

[0065] Taking AMT (Adaptive Multi-core Transform) technology as an example, the possible transform combinations for a transform block (i.e., the residual block to be transformed) are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8), (DST7, DST7). Taking (DCT2, DCT2) as an example, DCT2 represents the transform kernel for the horizontal transform, and DCT2 represents the transform kernel for the vertical transform. Similarly, (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8), (DST7, DST7) can be understood.

[0066] It should be understood that for a transform block, the specific choice of transform combination needs to be decided by using the RDO (Rate-distortion optimization) rule at the encoding end. Although adaptive multi-core transform can improve the adaptability of the transform module to the residual, the problem that comes with it is the encoding cost of the transform kernel index (used to indicate which transform kernel to use).

[0067] (2) Transform skip (TS): During the video encoding process, there are some residuals with weak correlation. For these residuals, the encoding efficiency can be improved by skipping the transformation based on (1). That is, the transformation process of these residuals is skipped and the residuals are directly quantized.

[0068] 2. Common transformation division methods

[0069] In the embodiments of the present application, when transforming a coding block, various common transform partitioning methods are involved. For example, these transform partitioning methods may include, but are not limited to, RQT (Residual Quad Tree), PBT (Position Based Transform), SBT (Sub-block Transform), and so on. RQT, PBT, and SBT are described below.

[0070] ①RQT

[0071] In the HEVC standard, RQT uses a recursive quadtree to divide the coding block and encodes the optimal division information in the video stream for transmission. Please refer to Figure 2, which is a schematic diagram of a residual quadtree division mode provided by an exemplary embodiment of the present application. In Figure 2, the left side is a schematic diagram of the coding block being divided, and the right side is a tree structure of the coding block after being processed by the quadtree, where 1 represents division and 0 represents no division. In Figure 2, coding block 10 corresponds to 1, that is, coding block 10 is quad-divided into 4 sub-blocks (i.e., sub-block 11, sub-block 12, sub-block 13 and sub-block 14 in Figure 2). The first sub-block (i.e., sub-block 11) corresponds to 1, meaning that sub-block 11 is further divided into four sub-blocks (sub-block 111, sub-block 112, sub-block 113, and sub-block 114). The second sub-block (i.e., sub-block 12) corresponds to 0, and the third sub-block (i.e., sub-block 13) corresponds to 0, meaning that sub-blocks 12 and 13 will not be divided again. The fourth sub-block (i.e., sub-block 14) corresponds to 1, meaning that sub-block 14 is further divided into four sub-blocks (sub-block 141, sub-block 142, sub-block 143, and sub-block 144). Sub-blocks 111, 112, and 113 all correspond to 0, meaning that sub-blocks 111, 112, and 113 will not be divided again. Subblock 114 corresponds to 1, meaning that subblock 114 is further divided into four subblocks (subblock 1141, subblock 1142, subblock 1143, and subblock 1144). Subblocks 1141, 1142, 1143, and 1144 all correspond to 0, meaning that subblocks 1141, 1142, 1143, and 1144 are no longer divided. Subblock 141 corresponds to 1, meaning that subblock 141 is further divided into four subblocks (subblock 1411, 1412, 1413, and 1414). Subblocks 1411, 1412, 1413, and 1414 all correspond to 0, meaning that subblocks 1411, 1412, 1413, and 1414 are no longer divided.

[0072] As can be seen from FIG. 2 , if RQT is used to perform transform and partition processing on a coding block, the transform and partition mode of the coding block requires more bits (ie, a longer encoding code length) to represent.

[0073] ②PBT

[0074] Please refer to Figure 3, which is a schematic diagram of a position-based sub-block transform provided for an exemplary embodiment of the present application. As shown in Figure 3, in the AVS3 standard, the position-based sub-block transform can quad-divide the coding block into four sub-blocks (i.e., sub-block 31, sub-block 32, sub-block 33, and sub-block 34 in Figure 3), and preset a transform combination according to the position of each sub-block. Among them, the transform combination may include a transform kernel for horizontal transform and a transform kernel for vertical transform. The transform kernel for horizontal transform and the transform kernel for vertical transform may be the same or different. Schematically, as shown in Figure 3, the transform combination of sub-block 31 is (DCT8, DCT8), the transform combination of sub-block 32 is (DST7, DCT8), the transform combination of sub-block 33 is (DCT8, DST7), and the transform combination of sub-block 33 is (DST7, DST7).

[0075] Whether any coding block (such as the current coding block) uses PBT can be adaptively identified by a flag bit. In one implementation, if the flag bit is a first value (such as 1), the current coding block uses PBT; if the flag bit is a second value (such as 0), the current coding block does not use PBT.

[0076] ③SBT

[0077] Please refer to Figure 4a, which is a schematic diagram of a sub-block transformation provided by an exemplary embodiment of the present application. As shown in Figure 4a, SBT corresponds to 12 residual position modes (i.e., residual position modes a to l in Figure 4a), and each residual position mode only transforms part of the sub-block area. Schematically, residual position mode a only transforms the sub-block area 41 marked by color, residual position mode b only transforms the sub-block area 42 marked by color; residual position mode c only transforms the sub-block area 43 marked by color; residual position mode d only transforms the sub-block area 44 marked by color, and residual position mode e only transforms the sub-block area 45 marked by color. The residual position mode f only transforms the sub-block area 46 marked by the color, and the residual position mode g only transforms the sub-block area 47 marked by the color; the residual position mode h only transforms the sub-block area 48 marked by the color; the residual position mode i only transforms the sub-block area 49 marked by the color, and the residual position mode j only transforms the sub-block area 410 marked by the color; the residual position mode k only transforms the sub-block area 411 marked by the color, and the residual position mode l only transforms the sub-block area 412 marked by the color.

[0078] In specific implementation, in each residual position mode, the sub-block area that needs to be transformed is no longer divided, but is directly transformed and quantized; while the sub-block area that does not need to be transformed is cleared. Schematically, taking residual position mode a as an example, in Figure 4a, only the sub-block area 41 in residual position mode a is transformed, and the area other than the sub-block area 41 in residual position mode a is cleared. It should be understood that the sub-block area that needs to be transformed can be called a sub-block transformation area, and the 12 residual position modes correspond to sub-block transformation areas in different positions.

[0079] Among them, the size of the sub-block transformation area can be 1, 1 / 2 or 1 / 4 of the size of the corresponding direction of the coding block. Among them, the size includes width and height, and the corresponding direction of the coding block can include at least one of the following: the direction corresponding to the width of the coding block, the direction corresponding to the height of the coding block. Schematically, let the width of the coding block be W and the height be H, and the size of the sub-block transformation area corresponding to the first row in Figure 4a is 1 / 2 of the size of the corresponding direction of the coding block. For example, for the residual position mode a in Figure 4a, the width of the sub-block transformation area is equal to the width of the coding block, and the height of the sub-block transformation area is equal to 1 / 2 of the height of the coding block, that is, the height of the sub-block transformation area is H / 2; for another example, for the residual position mode c in Figure 4a, the width of the sub-block transformation area is equal to 1 / 2 of the width of the coding block, that is, the width of the sub-block transformation area is W / 2, and the height of the sub-block transformation area is equal to the height of the coding block. The size of the sub-block transform region corresponding to the second and third rows in Figure 4a is 1 / 4 of the size of the coding block in the corresponding direction. For example, for the residual position mode e in Figure 4a, the width of the sub-block transform region is equal to the width of the coding block, and the height of the sub-block transform region is equal to 1 / 4 of the height of the coding block, that is, the height of the sub-block transform region is H / 4; for another example, for the residual position mode k in Figure 4a, the width of the sub-block transform region is equal to 1 / 2 of the width of the coding block, that is, the width of the sub-block transform region is W / 2, and the height of the sub-block transform region is equal to 1 / 2 of the height of the coding block, that is, the height of the sub-block transform region is H / 2.

[0080] In an embodiment of the present application, for each of the 12 residual position modes corresponding to SBT, a corresponding transformation combination can be set. As shown in Figure 4b, a schematic diagram of the transformation combination corresponding to each of the 12 residual position modes provided in an exemplary embodiment of the present application is shown. In Figure 4b, the transform combination corresponding to residual position mode a can be (DST7, DCT8); the transform combination corresponding to residual position mode b can be (DST7, DST7), the transform combination corresponding to residual position mode c can be (DCT8, DST7), and the transform combination corresponding to residual position mode d can be (DST7, DST7); the transform combination corresponding to residual position mode e can be (DST7, DCT8), and the transform combination corresponding to residual position mode f can be (DST7, DST7); the transform combination corresponding to residual position mode g can be (DCT8, DST7), and the transform combination corresponding to residual position mode h can be (DST7, DST7); the transform combination corresponding to residual position mode i can be (DCT8, DCT8), and the transform combination corresponding to residual position mode j can be (DST7, DCT8); the transform combination corresponding to residual position mode k can be (DCT8, DST7), and the transform combination corresponding to residual position mode l can be (DST7, DST7).

[0081] It should be understood that, taking the transform combination corresponding to the residual position mode a as (DST7, DCT8) as an example, DST7 in (DST7, DCT8) is the transform kernel for the horizontal transform, and DCT8 is the transform kernel for the vertical transform. The remaining residual position modes can be understood with reference to the residual position mode a and will not be described here. At the decoding end, it is only necessary to decode the transform information of the sub-block transform area, and perform inverse transform and inverse quantization based on the transform information of the sub-block transform area; the residual corresponding to the sub-block area other than the sub-block transform area (that is, the sub-block area that has not been transformed) is set to 0 by default. As can be seen from Figures 4a and 4b, SBT corresponds to a variety of residual position modes, and also requires more bits to identify the residual position mode adopted by the current coding block, which will also result in a large amount of bit rate consumption to a certain extent.

[0082] It should be noted that when performing residual transformation on the coding block, there will be some sub-block areas in the coding block whose transformation coefficients after residual transformation are 0, and other sub-block areas whose transformation coefficients after residual transformation are not 0. The residual transformation corresponding to the transformation coefficient not being 0 can be called a non-zero transformation.

[0083] 3. Video Decoding

[0084] On the decoding end, after obtaining the video bitstream for each coding block, entropy decoding is first performed on the video bitstream to obtain information about various prediction modes and quantized transform coefficients. Each transform coefficient is then dequantized and inversely transformed to obtain a residual. Furthermore, based on the known prediction mode information, the prediction signal corresponding to the coding block is obtained. The residual and the prediction signal are added to obtain a reconstructed video signal, which can be used to reconstruct the decoded image corresponding to the coding block. This reconstructed video signal undergoes loop filtering to produce the final output signal.

[0085] The video coding and decoding solution provided in the embodiments of the present application can be applied to video codecs (such as video codecs using sub-block transformation technology) or video compression products.

[0086] Please refer to Figure 5, which is a schematic diagram of the architecture of a video encoding and decoding system provided in an embodiment of the present application. The video encoding and decoding system 50 may include an encoding device 501 and a decoding device 502. The encoding device 501 is located at the encoding end, and the decoding device 502 is located at the decoding end. The encoding device 501 can be a terminal or a server; the decoding device 502 can be a terminal or a server, and a communication connection can be established between the encoding device 501 and the decoding device 502. Among them, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, a smart TV, etc., but is not limited to these. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0087] (1) For the encoding device 501:

[0088] The encoding device 501 can obtain a video to be encoded, which can be captured by a camera or generated by a computer. The camera can be a hardware component provided in the encoding device 501. For example, if the encoding device 501 is a terminal, the camera can be a common camera, a stereo camera, a light field camera, etc. provided in the terminal. The camera can also refer to a hardware device connected to the encoding device 501. For example, if the encoding device 501 is a server, the camera can be a camera connected to the server.

[0089] Wherein, a video includes one or more video frames, and the encoding device 501 can divide each video frame into one or more coding blocks and encode each coding block. When encoding any coding block, the adjacent coding blocks of the coding block being encoded (hereinafter referred to as the current coding block) can be determined, and the transformation information of the current coding block can be determined based on the coding information of the adjacent coding blocks. Wherein, the adjacent coding blocks refer to the coding blocks after the transformation division processing has been performed. The coding information of the adjacent coding blocks may include at least one of the following: transformation information of the adjacent coding blocks (such as transformation division mode, transformation combination, etc.), the residual of the adjacent coding blocks, the transformation coefficient of the adjacent coding blocks, etc. At this time, the transformation information of the current coding block based on the coding information of the adjacent coding blocks can include the following two ways:

[0090] ① The coding information of the adjacent coding block includes: the transformation information of the adjacent coding block. Under this implementation method, the current coding block can directly inherit the transformation information of the adjacent coding block. The so-called inheritance means that the transformation information of the adjacent coding block is directly determined as the transformation information of the current coding block.

[0091] ② The coding information of the adjacent coding block includes the residual or transformation coefficient of the adjacent coding block, and the transformation information of the current coding block includes the residual position mode of the current coding block under SBT. In this implementation method, the encoding device 501 can derive the residual position mode of the transformation coding residual of the current coding block under the SBT mode based on the residual or transformation coefficient of the adjacent coding block.

[0092] After determining the transform information of the current coding block, the encoding device 501 can encode the current coding block based on the determined transform information of the current coding block to obtain a video stream. Illustratively, the transform information of the current coding block includes a transform partitioning method. The encoding device 501 can transform and partition the current coding block based on the transform partitioning method to obtain transform coefficients of the current coding block, and perform quantization, entropy coding, and other operations on the transform coefficients of the current coding block to obtain a video stream. After obtaining the video stream, the video stream can be sent to the decoding device 502 for decoding by the decoding device 502.

[0093] (2) For the decoding device 502:

[0094] After receiving the video code stream sent by the encoding device 501, the decoding device 502 can determine the current coding block in the video code stream, where the current coding block refers to the coding block being decoded, and determine the adjacent coding blocks of the current coding block, and determine the transformation information of the current coding block based on the coding information of the adjacent coding blocks.

[0095] The decoding device may determine the transformation information of the current coding block based on the coding information of the adjacent coding block in the following two ways:

[0096] ① The coding information of the adjacent coding block includes: the transformation information of the adjacent coding block. Under this implementation method, the current coding block can directly inherit the transformation information of the adjacent coding block.

[0097] ② The coding information of the adjacent coding block includes the residual or transformation coefficient of the adjacent coding block, and the transformation information of the current coding block includes the residual position mode of the current coding block under SBT. In this implementation method, the decoding device 502 can derive the residual position mode of the transformation coding residual of the current coding block under the SBT mode based on the residual or transformation coefficient of the adjacent coding block.

[0098] After determining the transformation information of the current coding block, the decoding device 502 can perform decoding processing on the current coding block based on the determined transformation information of the current coding block to reconstruct the video frame where the current coding block is located. As an implementation method, the transformation information of the current coding block includes a transformation partitioning method. The decoding device 502 can perform inverse transformation processing on the current coding block based on the transformation partitioning method to obtain the residual of the current coding block, and the residual of the current coding block can be used to reconstruct the video frame where the current coding block is located. As another implementation method, the transformation information of the current coding block includes a residual position mode of the transformation coding residual of the current coding block in the SBT mode. The decoding device 502 can perform inverse transformation processing on the current coding block based on the residual position mode to obtain the residual of the current coding block. The residual of the current coding block can be used to reconstruct the video frame where the current coding block is located.

[0099] In an embodiment of the present application, during the encoding and decoding process of the video, the transformation information of the current coding block can be determined based on the encoding information of the adjacent coding blocks. This can reduce the encoding cost consumed for encoding the transformation information of the current coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the encoding and decoding efficiency.

[0100] Please refer to Figure 6, which is a flowchart of a video decoding method provided by an exemplary embodiment of the present application. The video decoding method can be executed by the decoding device 502 in the above-mentioned video encoding and decoding system. The video decoding method described in this embodiment may include the following steps S601-S604:

[0101] S601: Determine the current coding block in the video stream. The video stream includes one or more video frames, each of which may include one or more coding blocks. The current coding block refers to the coding block being decoded in the video stream.

[0102] S602: Determine adjacent coding blocks of the current coding block.

[0103] The adjacent coding blocks include spatial domain adjacent coding blocks and / or temporal domain adjacent coding blocks.

[0104] i. A spatially adjacent coding block refers to a coding block adjacent to a current coding block in a current frame of a video. The current frame refers to a video frame in which the current coding block is located. The current coding block refers to a coding block being decoded in the current frame.

[0105] Determining the adjacent coding blocks of the current coding block may include: searching for coding blocks adjacent to the current coding block in the current frame of the video, and determining the coding blocks adjacent to the current coding block as spatially adjacent coding blocks of the current coding block. Adjacent here may mean that at least one vertex or one edge overlaps between the coding block and the current coding block, and the number of spatially adjacent coding blocks may be one or more.

[0106] Among them, searching for a coding block adjacent to the current coding block in the current frame of the video may include: searching for a transform block adjacent to the current coding block in the current frame of the video, and determining the coding block where the transform block adjacent to the current coding block is located as the coding block adjacent to the current coding block. The transform block refers to a small block obtained by dividing the coding block using a residual basic unit. The residual basic unit may include a 4×4 pixel block, an 8×8 pixel block, etc., that is, the transform block may be a 4×4 small block, an 8×8 small block, etc. in the coding block. Schematically, as shown in Figure 7a, a schematic diagram of a transform block adjacent to the current coding block provided by an exemplary embodiment of the present application is provided. In Figure 7a, A, B, C, D, and E are transform blocks. A, B, C, D, E and the current coding block are all located in the current frame. The transform blocks adjacent to the current coding block found in the current frame of the video include A, B, C, D, and E. At this time, the coding block where transform blocks A to E are located can be determined as the spatially adjacent coding block of the current coding block.

[0107] ii. A temporally adjacent coding block refers to a coding block adjacent to a reference coding block in a reference frame of a video; the number of temporally adjacent coding blocks may be one or more. A reference frame is any video frame or a specified video frame in a video other than the current frame. As an implementation method, an embodiment of the present application provides a reference frame list, which includes one or more video frames of a video. The reference frame may be any video frame in the reference frame list. Schematically, the video frames in the reference frame list are arranged in sequence, and the reference frame may be the first video frame in the reference frame list. As another implementation method, the reference frame may be a video frame specified in a sequence header of the video code stream or in a frame header of the current frame where the current coding block is located.

[0108] The position of the reference coding block in the reference frame is the same as the position of the current coding block in the current frame. Schematically, if the current coding block is at position A in the current frame, then the position of the reference coding block in the reference frame is the same as position A.

[0109] In one implementation, determining the adjacent coding blocks of the current coding block may include: determining a reference frame corresponding to the current frame, and mapping the current coding block in the current frame to the reference frame to obtain a reference coding block having the same position as the current coding block in the reference frame, and then searching for a coding block adjacent to the reference coding block in the reference frame, and determining the found coding block adjacent to the reference coding block as a time-domain adjacent coding block of the current coding block.

[0110] Among them, the method of searching for a coding block adjacent to a reference coding block in a reference frame can be: searching for a transform block adjacent to the reference coding block in the reference frame, and determining the coding block where the transform block adjacent to the reference coding block is located as the coding block adjacent to the reference coding block. The transform block can be a 4×4 small block, an 8×8 small block, etc. in the coding block. Schematically, as shown in FIG7b , a schematic diagram of a transform block adjacent to a current coding block is provided for another exemplary embodiment of the present application. In FIG7b , the current coding block in the current frame is mapped to the reference frame to obtain a reference coding block with the same position as the current coding block in the reference frame. Then, the transform block adjacent to the reference coding block is searched in the reference frame. In FIG7b , the transform blocks A and B adjacent to the reference coding block are found in the reference frame. At this time, the coding block where transform block A is located and the coding block where transform block B is located can be determined as the time domain adjacent coding blocks of the current coding block.

[0111] S603: Determine transformation information of the current coding block according to coding information of adjacent coding blocks.

[0112] The coding information includes at least one of the following: transform information, residual, and transform coefficient. The transform information includes at least one of a transform division method and a transform combination. The transform division method includes at least one of the following: RQT, PBT, and SBT; the transform combination includes a transform kernel for a horizontal transform and a transform kernel for a vertical transform, and the transform kernel includes at least one of the following: a discrete cosine transform kernel (such as DCT2 and DCT8), a discrete sine transform kernel (DST7), and a skip transform (such as TS). According to the coding information of the adjacent coding blocks, determining the transform information of the current coding block may include but is not limited to the following two methods (method 1) and method 2):

[0113] 1) The current coding block directly inherits the transformation information of the adjacent coding block.

[0114] The coding information of the adjacent coding blocks includes transformation information of the adjacent coding blocks. Determining the transformation information of the current coding block according to the coding information of the adjacent coding blocks includes: determining the transformation information of the adjacent coding blocks as the transformation information of the current coding block.

[0115] As an implementation method, when the transformation information of the adjacent coding block includes a transformation partitioning method, the transformation partitioning method of the adjacent coding block can be determined as the transformation partitioning method of the current coding block, that is, the current coding block can inherit the transformation partitioning method of the adjacent coding block. For example, if the transformation partitioning formula of the adjacent coding block is RQT, then the optimal partitioning method of the RQT of the adjacent coding block can be determined as the transformation partitioning method of the current coding block, that is, the current coding block directly inherits the optimal partitioning method of the RQT of the adjacent coding block. Here, the so-called optimal partitioning method may refer to the partitioning method with the lowest rate-distortion cost. For another example, if the transformation partitioning method of the adjacent coding block is SBT, then the SBT of the adjacent coding block can be determined as the transformation partitioning method of the current coding block, that is, the current coding block inherits the SBT of the adjacent coding block.

[0116] As another implementation, when the transform information of the adjacent coding block includes a transform partitioning mode and a transform combination, the transform partitioning mode and transform combination of the adjacent coding block can be determined as the transform information of the current coding block, that is, the current coding block inherits the transform partitioning mode of the adjacent coding block and the transform combination corresponding to the transform partitioning mode. For example, the transform partitioning mode of the adjacent coding block is PBT, and the transform combination corresponding to PBT is shown in Figure 3. The transform combination corresponding to PBT includes: the transform combination (DCT8, DCT8) corresponding to sub-block 31, the transform combination (DST7, DCT8) corresponding to sub-block 32, the transform combination (DCT8, DST7) corresponding to sub-block 33, and the transform combination (DST7, DST7) corresponding to sub-block 34; then the PBT of the adjacent coding block and the transform combination corresponding to the PBT can be determined as the transform information of the current coding block, that is, the current coding block inherits the PBT of the adjacent coding block and the transform combination corresponding to the PBT.

[0117] It is understandable that the codec and decoder can agree to determine the transformation information of the adjacent coding block as the transformation information of the current coding block; or, in some optional implementations, a series of control methods can be used to control whether the current coding block enables the transformation inheritance mode, thereby determining the transformation information of the adjacent coding block as the transformation information of the current coding block; in this implementation, the decoding device can detect whether the current coding block enables the transformation inheritance mode, and if it is determined that the current coding block enables the transformation inheritance mode, the transformation information of the adjacent coding block is determined as the transformation information of the current coding block. The activation control method of the transformation inheritance mode may include at least one of the following (1) and (2):

[0118] (1) Setting a transform inheritance mode flag in the video bitstream. When the transform inheritance mode flag is a first preset value (e.g., 1), it indicates that the current coding block enables the transform inheritance mode. When the transform inheritance mode flag is a second preset value (e.g., 0), it indicates that the current coding block disables the transform inheritance mode. The setting position of the transform inheritance mode flag in the video bitstream may include at least one of the following:

[0119] a. The transform inheritance mode flag is set in the video sequence header to implement sequence-level signal control. When the transform inheritance mode flag in the sequence header is at a first preset value, the transform inheritance mode is enabled for all coding blocks in all video frames of the video. When the transform inheritance mode flag in the sequence header is at a second preset value, the transform inheritance mode is disabled for all coding blocks in all video frames of the video.

[0120] b. The transform inheritance mode flag is set in the frame header of the current frame of the video to implement image-level signal control. When the transform inheritance mode flag in the frame header of the current frame is a first preset value, it indicates that all coding blocks in the current frame have the transform inheritance mode enabled; when the transform inheritance mode flag in the frame header of the current frame is a second preset value, it indicates that all coding blocks in the current frame have the transform inheritance mode disabled.

[0121] c. The transform inheritance mode flag is set in the slice header of the slice where the current coding block is located to implement slice-level signal control. When the transform inheritance mode flag in the slice header is a first preset value, it indicates that all coding blocks in the slice have the transform inheritance mode enabled; when the transform inheritance mode flag in the slice header is a second preset value, it indicates that all coding blocks in the slice have the transform inheritance mode disabled. A slice refers to a combination of multiple coding blocks.

[0122] d. The transform inheritance mode flag is set in the coding tree unit where the current coding block is located to implement CTU-level signal control. When the transform inheritance mode flag in the coding tree unit is a first preset value, it indicates that all coding blocks in the coding tree unit enable the transform inheritance mode; when the transform inheritance mode flag in the coding tree unit is a second preset value, it indicates that all coding blocks in the coding tree unit disable the transform inheritance mode;

[0123] e. A transform inheritance mode flag is set in the current coding block to implement signal control of the coding block. When the transform inheritance mode flag in the current coding block is a first preset value, it indicates that the current coding block enables the transform inheritance mode; when the transform inheritance mode flag in the current coding block is a second preset value, it indicates that the current coding block disables the transform inheritance mode.

[0124] (2) Setting the enabling conditions of the transform inheritance mode. When the current coding block meets the enabling conditions, the current coding block is instructed to enable the transform inheritance mode; when the current coding block does not meet the enabling conditions, the current coding block is instructed to turn off the transform inheritance mode. The enabling conditions include at least one of the following: size conditions and prediction conditions.

[0125] f. The enabling condition includes a size condition, which is used to define a preset width threshold or a preset height threshold for enabling the transform inheritance mode. The preset width threshold and the preset height threshold can be set as required and are not limited in this embodiment of the present application. The current coding block meets the enabling condition, including any of the following:

[0126] ① When the size condition defines a preset width threshold, the width of the current coding block is greater than the preset width threshold;

[0127] ② When the size condition defines a preset height threshold, the height of the current coding block is greater than the preset height threshold;

[0128] ③ When the size condition defines a preset width threshold, the width of the current coding block is less than the preset width threshold;

[0129] ④ When the size condition defines a preset height threshold, the height of the current coding block is less than the preset height threshold.

[0130] g. The enabling conditions include prediction conditions. Under this implementation, the current coding block satisfies the enabling conditions, including: the adjacent coding block is a prediction reference coding block of the current coding block, that is, the coding block predicted using the prediction information of the adjacent coding block can enable the transform partition inheritance mode. At this time, the adjacent coding block is the prediction reference coding block of the current coding block.

[0131] It should be understood that the turning on and off of the transform division inheritance mode of any coding block can be controlled separately by one of the above-mentioned control methods ag, or by a combination of multiple (at least two) methods in the above-mentioned control methods ag. For example, the control method includes: setting a transform inheritance mode flag in the sequence header of the video code stream, and the height of the coding block is greater than the preset height threshold, which means that all coding blocks in the video code stream whose height is greater than the preset height threshold can enable the transform inheritance mode. For another example, the control method includes: the height of the coding block is less than the preset height threshold and the adjacent coding block is a predicted reference coding block of the coding block, which means that the coding block in the video code stream whose height is less than the preset height threshold and the prediction information of the adjacent coding block is used for prediction can enable the transform inheritance mode. The embodiment of the present application does not impose any limitation on the control method for turning on and off the transform division inheritance mode of any coding block.

[0132] It should be understood that the number of adjacent coding blocks may be greater than or equal to 1. When the number of adjacent coding blocks is greater than 1, the decoding device determines, based on the coding information of the adjacent coding blocks, that the transformation information of the current coding block may include s11-s13:

[0133] s11. Perform deduplication processing on adjacent coding blocks to obtain N deduplicated adjacent coding blocks.

[0134] In a specific implementation, when there are at least two adjacent coding blocks with the same transformation information in the adjacent coding blocks, the at least two adjacent coding blocks can be deduplicated, and only one of the adjacent coding blocks can be retained. After deduplication, N adjacent coding blocks may remain, where N is a positive integer. Schematically, the number of adjacent coding blocks is three, namely adjacent coding block 1, adjacent coding block 2, and adjacent coding block 3, wherein the transformation information of adjacent coding block 1 and the transformation information of adjacent coding block 2 are exactly the same, then the three adjacent coding blocks can be deduplicated to obtain two adjacent coding blocks. If adjacent coding block 1 is retained, the two adjacent coding blocks remaining after deduplication include adjacent coding block 1 and adjacent coding block 3; if adjacent coding block 2 is retained, the two adjacent coding blocks remaining after deduplication include adjacent coding block 2 and adjacent coding block 3.

[0135] The same transform information may include the following cases: ① When the transform information includes a transform partitioning mode, the same transform information means that the transform partitioning mode is exactly the same. For example, if the transform partitioning mode of adjacent coding block 1 is PBT and the transform partitioning mode of adjacent coding block 2 is also PBT, then it can be determined that the transform information of adjacent coding block 1 is the same as the transform information of adjacent coding block 2. ② When the transform information includes a transform combination, the same transform information means that the transform combination is exactly the same. For example, if the transform combination of adjacent coding block 1 is (DCT8, DCT8) and the transform combination of adjacent coding block 2 is also (DCT8, DCT8), then it can be determined that the transform information of adjacent coding block 1 is the same as the transform information of adjacent coding block 2. ② When the transform information includes a transform partitioning mode and a transform combination, the same transform information means that the transform partitioning mode and the transform combination are exactly the same. For example, if the transform partitioning mode of adjacent coding block 1 is SBT and the transform combination is transform combination 1, and if the transform partitioning mode of adjacent coding block 2 is SBT and the transform combination is transform combination 1, then it can be determined that the transform information of adjacent coding block 1 is the same as the transform information of adjacent coding block 2.

[0136] s12. Determine a target adjacent coding block from N adjacent coding blocks.

[0137] Methods for determining the target adjacent coding block include any of the following: ① In the video bitstream, a selection flag can be used to indicate which adjacent coding block's transformation information the current coding block inherits. In this implementation, if the selection flag in the video bitstream includes the identifier of the adjacent coding block to be inherited, the decoding device can select the target adjacent coding block corresponding to the identifier from N adjacent coding blocks based on the selection flag. The identifier of the adjacent coding block includes, for example, the coding block number.

[0138] ② If the N adjacent coding blocks contain at least one prediction reference coding block of the current coding block, and the prediction mode of the current coding block is coupled with the transform inheritance mode, the prediction reference coding block selected by the prediction mode of the current coding block is selected as the target adjacent coding block. The coupling of the prediction mode of the current coding block with the transform inheritance mode means that the prediction mode of the current coding block is associated with the transform inheritance mode. Among them, the prediction mode includes at least one of the following: the prediction mode includes at least one of the following: inter merge mode (Inter merge), intra block copy merge mode (IBC merge), intra template matching merge mode (Intra TMP merge), intra prediction mode.

[0139] In Example 1, if the prediction mode is merge mode (such as Inter merge), and the merge mode of the current coding block is coupled with the transform inheritance mode, the prediction reference coding block selected by the merge mode of the current coding block can be selected from at least one prediction reference coding block as the target adjacent coding block. If the prediction mode of the current coding block is Inter merge mode, and the Inter merge mode of the current coding block selects adjacent coding block 1 from N adjacent coding blocks for prediction reference, then if the Inter merge mode of the current coding block is coupled with the transform inheritance mode, adjacent coding block 1 can be selected as the target adjacent coding block.

[0140] Example 2: When the current coding block is an intra block, and the intra prediction mode of the current coding block is coupled with a transform inheritance mode, the prediction reference coding block selected by the intra prediction mode of the current coding block can be selected from at least one prediction reference coding block as the target adjacent coding block. For example, if the intra prediction mode of the current coding block is derived from adjacent coding block 2 in the at least one prediction reference coding block, that is, the intra prediction mode of the current coding block selects adjacent coding block 2 from N adjacent coding blocks for reference prediction, then adjacent coding block 2 can be selected as the target adjacent coding block.

[0141] It should be understood that in the embodiment of the present application, the prediction mode and the transform inheritance mode of the current coding block can be coupled with each other or independent of each other. Mutual independence means that the prediction mode of the current coding block is not associated with the transform inheritance mode, and the prediction mode of the current coding block and the transform inheritance mode need to be indicated separately. In other words, when the prediction mode of the current coding block and the transform inheritance mode are independent of each other, additional bits are needed to identify the transform inheritance mode, which will result in higher bit rate consumption in the encoding and decoding process; and when the prediction mode of the current coding block and the transform inheritance mode are coupled with each other, the prediction mode of the current coding block is associated with the transform inheritance mode, then the prediction mode of the current coding block and the transform inheritance mode do not need to be indicated separately, that is, there is no need to use additional bits to indicate the transform inheritance mode, thereby reducing the bit rate consumption in the encoding and decoding process and improving encoding and decoding efficiency.

[0142] s13. Determine the transformation information of the target adjacent coding block as the transformation information of the current coding block.

[0143] 2) The coding information of the adjacent coding block includes the residual or transform coefficient of the adjacent coding block; in an embodiment of the present application, the residual or transform coefficient of the adjacent coding block can be used to derive the residual position mode when the current coding block adopts SBT, and the residual position mode is used to indicate the sub-block area for transform coding residual. By utilizing the residual or transform coefficient of the adjacent coding block, the residual position mode when the current coding block adopts SBT can be quickly derived, thereby improving the encoding and decoding efficiency in the encoding and decoding process.

[0144] In this implementation, the transformation information of the current coding block can be determined based on the coding information of the adjacent coding blocks in the following two ways:

[0145] Method 1: One or more context index information (Context index information) is derived based on the coding information of the adjacent coding block, and each context index information corresponds to an entropy decoding method, and the entropy decoding method can be, for example, CABAC decoding, etc.; the decoding device determines the entropy decoding method according to the derived context index information, and performs entropy decoding on the residual position mode flag of the current coding block under SBT according to the determined entropy decoding method to obtain the residual position mode of the current coding block under SBT.

[0146] Wherein, derivation of one or more context index information based on the coding information of the adjacent coding block may include: ① obtaining the first adjacent coding block and the second adjacent coding block of the current coding block, where the first adjacent coding block refers to the adjacent coding block located in the first direction of the current coding block. ② The second adjacent coding block refers to the adjacent coding block located in the second direction of the current coding block; ③ obtaining a first quantity ratio in the first adjacent coding block; the first quantity ratio refers to the ratio between the number of non-zero residual basic units in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block; ④ obtaining a second quantity ratio in the second adjacent coding block; the second quantity ratio refers to the ratio between the number of non-zero residual basic units in the second adjacent coding block and the total number of all residual basic units in the second adjacent coding block; ⑤ determining the context index information based on the relationship between the first quantity ratio and the second quantity ratio; wherein, if the first quantity ratio is greater than the second quantity ratio, the context index information is the first index information; if the first quantity ratio is equal to the second quantity ratio, the context index information is the second index information; if the first quantity ratio is less than the second quantity ratio, the context index information is the third index information.

[0147] The first direction and the second direction can be determined as needed. For example, the first direction may be located above the current coding block, and the second direction may be located to the left of the current coding block; for another example, the first direction may be located below the current coding block, and the second direction may be located to the right of the current coding block. The embodiment of the present application does not impose any restrictions on the first direction and the second direction. A non-zero residual basic unit refers to a residual basic unit with a non-zero transformation, and the residual basic unit may be a 4×4 pixel block or an 8×8 pixel block. The first index information, the second index information, and the third index information can be flexibly set. Schematically, the first index information may be 0, the second index information may be 1, and the third index information may be 2.

[0148] For example, as shown in FIG8 , a schematic diagram of the positional relationship between a first adjacent coding block and a second adjacent coding block and a current coding block is provided for an exemplary embodiment of the present application. In FIG8 , the first adjacent coding block is an adjacent coding block located above the current coding block, and the second adjacent coding block is an adjacent coding block located to the left of the current coding block. The first adjacent coding block and the second adjacent coding block include non-zero residual basic units, and the residual basic units are 4×4 pixel blocks. The decoding device can obtain that the number of non-zero residual basic units in the first adjacent coding block is 4, and the total number of all residual basic units in the first adjacent coding block is 16, and it can be determined that the first quantity ratio r1 in the first adjacent coding block is 0.25. The decoding device obtains that the number of non-zero residual basic units in the second adjacent coding block is 8, the total number of all residual basic units in the second adjacent coding block is 16, and the second quantity ratio r2 in the second adjacent coding block is 0.5. At this time, r1 is less than r2, so the context index information is 2.

[0149] Method 2: The video bitstream includes index information of the residual position mode selected by the current coding block under the SBT; the SBT includes multiple candidate residual position modes, which can be the 12 residual position modes shown in FIG. 4a . In this implementation, the transformation information of the current coding block is determined based on the coding information of the adjacent coding blocks, including the following steps s21-s23:

[0150] s21. Reorder the candidate residual position patterns under the SBT according to the coding information of the adjacent coding blocks to obtain a reordered list, which contains the candidate residual position patterns arranged in order and their corresponding index information.

[0151] As an implementation method, the candidate residual position modes under SBT are reordered according to the coding information of the adjacent coding block to obtain a reordered list, including: the decoding device can obtain the index information of each candidate residual position mode under SBT according to the coding information of the adjacent coding block, and reorder the candidate residual position modes under SBT in descending order of the index information to obtain a reordered list.

[0152] Here, each candidate residual position pattern under the SBT corresponds to a sub-block transform region at a different position. For example, the candidate residual position pattern is candidate residual position pattern a in FIG4 a, and the sub-block transform region corresponding to candidate residual position pattern a is region 41; for another example, the candidate residual position pattern is candidate residual position pattern j in FIG4 a, and the sub-block transform region corresponding to candidate residual position pattern j is region 410. Among them, according to the coding information of the adjacent coding block, the index information of each candidate residual position mode under SBT is obtained, including: ① obtaining the first adjacent coding block and the second adjacent coding block of the current coding block, the first adjacent coding block refers to the adjacent coding block located in the first direction of the current coding block; the second adjacent coding block refers to the adjacent coding block located in the second direction of the current coding block; ② obtaining the first quantity ratio in the first adjacent coding block; the first quantity ratio refers to the ratio between the number of non-zero residual basic units contained in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block; ③ obtaining the second quantity ratio in the second adjacent coding block; the second quantity ratio refers to the ratio between the number of non-zero residual basic units contained in the second adjacent coding block and the total number of all residual basic units in the second adjacent coding block. ④ according to the size relationship between the first quantity ratio and the second quantity ratio, index information is assigned to each candidate residual position mode under SBT.

[0153] It should be understood that the first direction and the second direction can be determined as needed. For example, the first direction can be located above the current coding block, and the second direction can be located to the left of the current coding block; for another example, the first direction can be located below the current coding block, and the second direction can be located to the right of the current coding block. This embodiment of the application is not limited to this. The basic unit of the residual can be a 4×4 pixel block or an 8×8 pixel block.

[0154] According to the relationship between the first quantity ratio and the second quantity ratio, the allocation of index information to each candidate residual position mode under the SBT includes the following cases:

[0155] (1) If the first quantity ratio is greater than or equal to the second quantity ratio, the index information assigned to the candidate residual position pattern where the sub-block transform region is located in the first direction is greater than the index information assigned to the candidate residual position pattern where the sub-block transform region is located in the second direction. Schematically, the first direction is above the current coding block, the second direction is to the left of the current coding block, the first quantity ratio is r1, the second quantity ratio is r2, r1 > r2, and the candidate residual position pattern where the sub-block transform region is located above is assigned a higher index information, that is, the index information assigned to the candidate residual position pattern where the sub-block transform region is located above is greater than the index information assigned to the candidate residual position pattern where the sub-block transform region is located to the left. For example, the candidate residual position patterns where the sub-block transform region is located above may include the residual position pattern a and the residual position pattern e in FIG. 4a; the candidate residual position patterns where the sub-block transform region is located to the left may include the residual position pattern c and the residual position pattern g in FIG. 4a; then the index information assigned to the residual position pattern a and the residual position pattern e is greater than the index information assigned to the residual position pattern c and the residual position pattern g.

[0156] (2) If the first quantity ratio is less than the second quantity ratio, the index information assigned to the candidate residual position pattern where the sub-block transform region is located in the second direction is greater than the index information assigned to the candidate residual position pattern where the sub-block transform region is located in the first direction. Schematically, r1 < r2, and the candidate residual position pattern where the sub-block transform region is located to the left is assigned a higher index information, that is, the index information assigned to the candidate residual position pattern where the sub-block transform region is located to the left is greater than the index information assigned to the candidate residual position pattern where the sub-block transform region is located above. For example, the candidate residual position patterns where the sub-block transform region is located above may include the residual position pattern a and the residual position pattern e in FIG. 4a; the candidate residual position patterns where the sub-block transform region is located to the left may include the residual position pattern c and the residual position pattern g in FIG. 4a; then the index information assigned to the residual position pattern c and the residual position pattern g is greater than the index information assigned to the residual position pattern a and the residual position pattern e.

[0157] It should be understood that the candidate residual position mode that is assigned a higher index information is considered to have a certain correlation with the residual position mode of the current coding block under SBT. Therefore, the larger the index information of the candidate residual position mode, the shorter the encoding code length of the candidate residual position mode; the shorter the encoding code length of the candidate residual position mode, the higher the probability that the candidate residual position mode is selected as the residual position mode of the current coding block under SBT. Among them, the encoding code length is measured by the number of bits. The longer the encoding code length, the more bits are used for encoding; the shorter the encoding code length, the fewer bits are used for encoding. Schematically, variable length codes are used for encoding, and the candidate residual position modes include candidate residual position mode A, candidate residual position mode B, and candidate residual position mode C. The index information of candidate residual position mode A is greater than the index information of candidate residual position mode B, and the index information of candidate residual position mode B is greater than the index information of candidate residual position mode C. Therefore, when encoding using variable-length codes, the index information of candidate residual position mode A can be encoded as 0, the index information of candidate residual position mode B can be encoded as 10, and the index information of candidate residual position mode C can be encoded as 11. In this case, the encoding code length of candidate residual position mode A is the shortest, which means that candidate residual position mode A has the highest probability of being selected as the residual position mode of the current coding block under SBT.

[0158] s22. Perform entropy decoding on the video bitstream to obtain index information of the residual position mode selected by the current coding block under the SBT, and determine the residual position mode of the current coding block under the SBT from the reordered list based on the index information of the residual position mode selected by the current coding block under the SBT. Specifically, search the reordered list for a candidate residual mode corresponding to the index information of the residual position mode selected by the current coding block under the SBT, and determine the found candidate residual mode as the residual mode of the current coding block under the SBT.

[0159] S604: Perform decoding processing on the current coding block based on the determined transformation information of the current coding block.

[0160] In one implementation, the transformation information includes a transformation partitioning method and / or a transformation combination. The decoding device can perform inverse transformation processing on the current coding block based on the transformation partitioning method and / or transformation combination of the current coding block to obtain the residual of the current coding block. The residual of the current coding block can be used to reconstruct the current frame.

[0161] In another implementation, the transformation information includes the residual position mode selected for the current coding block under SBT. The decoding device can perform inverse transformation processing on the current coding block based on the selected residual position mode to obtain the residual of the current coding block, and the residual of the current coding block can be used to reconstruct the current frame.

[0162] In an embodiment of the present application, during the decoding process of the video, the transformation information of the current coding block can be determined based on the coding information of the adjacent coding blocks. This can reduce the coding cost consumed for encoding the transformation information of the current coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the decoding efficiency.

[0163] Please refer to Figure 9, which is a flowchart of a video encoding method provided by another exemplary embodiment of the present application. The video encoding method can be executed by the encoding device in the above-mentioned video encoding and decoding system. The video encoding method described in this embodiment may include the following steps S901-S904:

[0164] S901: Determine a current coding block in a video.

[0165] A video includes one or more video frames, each of which may include one or more coding blocks. A current coding block refers to a coding block that is being encoded in the video.

[0166] S902: Determine adjacent coding blocks of the current coding block.

[0167] Adjacent coding blocks include spatially adjacent coding blocks and / or temporally adjacent coding blocks; spatially adjacent coding blocks refer to coding blocks adjacent to the current coding block in the current frame of the video; the current frame refers to the video frame where the current coding block is located; the current coding block refers to the coding block being encoded in the current frame; temporally adjacent coding blocks refer to coding blocks adjacent to the reference coding block in the reference frame; the reference frame is any video frame or a specified video frame in the video except the current frame; the position of the reference coding block in the reference frame is the same as the position of the current coding block in the current frame.

[0168] The specific implementation of step S902 is similar to that of the above step S602 and will not be repeated here.

[0169] S903: Determine transformation information of the current coding block according to coding information of adjacent coding blocks.

[0170] The coding information of the adjacent coding block includes at least one of the following: transform information, residual, and transform coefficient. The transform information includes a transform division method and / or a transform combination. The transform division method includes at least one of the following: PQT, PBT, SBT; the transform combination includes a transform kernel of a horizontal transform and a transform kernel of a vertical transform, and the transform kernel includes at least one of the following: a discrete cosine transform kernel, a discrete sine transform kernel, and a skip transform. According to the coding information of the adjacent coding block, determining the transform information of the current coding block includes but is not limited to the following methods (method 1) and method 2):

[0171] 1) The current coding block directly inherits the transformation information of the adjacent coding block.

[0172] The number of adjacent coding blocks can be greater than or equal to 1. In this case, a selection flag is included in the video bitstream. This selection flag can specifically indicate the transformation information of the adjacent coding block that the current coding block needs to inherit. After determining the transformation information of the adjacent coding block that the current coding block inherits, the encoding device sets the identifier of the adjacent coding block to be inherited in the selection flag.

[0173] When the encoding information of the adjacent coding block includes the transform information of the adjacent coding block, determining the transform information of the current coding block based on the encoding information of the adjacent coding block includes: determining the transform information of the adjacent coding block as the transform information of the current coding block. As an implementation manner, when the transform information of the adjacent coding block includes a transform partitioning mode, the transform partitioning mode of the adjacent coding block can be determined as the transform partitioning mode of the current coding block, that is, the current coding block can inherit the transform partitioning mode of the adjacent coding block. As another implementation manner, when the transform information of the adjacent coding block includes a transform partitioning mode and a transform combination, the transform partitioning mode and the transform combination of the adjacent coding block can be determined as the transform partitioning mode and the transform combination of the current coding block, that is, the current coding block inherits the transform partitioning mode of the adjacent coding block and the transform combination corresponding to the transform partitioning mode. As yet another implementation manner, when the transform information of the adjacent coding block includes a transform combination, the transform combination of the adjacent coding block can be determined as the transform combination of the current coding block, that is, the current coding block inherits the transform combination of the adjacent coding block.

[0174] It is understandable that the encoding and decoding parties may agree to determine the transformation information of the adjacent coding block as the transformation information of the current coding block; or, in some optional implementations, a series of control methods can be used to control whether the current coding block enables the transformation inheritance mode, thereby determining the transformation information of the adjacent coding block as the transformation information of the current coding block. In this implementation, the encoding device can detect whether the current coding block enables the transformation inheritance mode. If it is determined that the current coding block enables the transformation inheritance mode, the transformation information of the adjacent coding block is determined as the transformation information of the current coding block. Among them, the activation control method of the transformation inheritance mode may include at least one of the following:

[0175] (1) Setting the transform inheritance mode flag in the video bitstream, and controlling whether the current coding block starts the transform inheritance mode through the transform inheritance mode flag. When the current coding block starts the transform inheritance mode, the transform inheritance mode flag can be set to a first preset value (such as 1); when the current coding block turns off the transform inheritance mode, the transform inheritance mode flag is set to a second preset value (such as 0). The setting position of the transform inheritance mode flag in the video bitstream includes at least one of the following:

[0176] a. A transform inheritance mode flag is set in a sequence header of a video. When the transform inheritance mode flag in the sequence header is a first preset value, it indicates that all coding blocks in all video frames of the video have the transform inheritance mode enabled; when the transform inheritance mode flag in the sequence header is a second preset value, it indicates that all coding blocks in all video frames of the video have the transform inheritance mode disabled;

[0177] b. A transform inheritance mode flag is set in the frame header of the current frame of the video. When the transform inheritance mode flag in the frame header is a first preset value, it indicates that all coding blocks in the current frame enable the transform inheritance mode; when the transform inheritance mode flag in the frame header of the current frame is a second preset value, it indicates that all coding blocks in the current frame disable the transform inheritance mode;

[0178] c. The transform inheritance mode flag is set in the slice header of the slice where the current coding block is located. When the transform inheritance mode flag in the slice header is a first preset value, it indicates that all coding blocks in the slice enable the transform inheritance mode; when the transform inheritance mode flag in the slice header is a second preset value, it indicates that all coding blocks in the slice disable the transform inheritance mode.

[0179] d. A transform inheritance mode flag is set in the coding tree unit where the current coding block is located. When the transform inheritance mode flag in the coding tree unit is a first preset value, it indicates that all coding blocks in the coding tree unit enable the transform inheritance mode; when the transform inheritance mode flag in the coding tree unit is a second preset value, it indicates that all coding blocks in the coding tree unit disable the transform inheritance mode.

[0180] e. The transform inheritance mode flag is set in the current coding block. When the transform inheritance mode flag in the current coding block is a first preset value, it indicates that the current coding block enables the transform inheritance mode; when the transform inheritance mode flag in the current coding block is a second preset value, it indicates that the current coding block turns off the transform inheritance mode.

[0181] (2) Setting the enabling conditions of the transform inheritance mode. When the current coding block meets the enabling conditions, the current coding block is instructed to enable the transform inheritance mode; when the current coding block does not meet the enabling conditions, the current coding block is instructed to turn off the transform inheritance mode. The enabling conditions include size conditions and / or prediction conditions.

[0182] f. The enabling condition includes a size condition, which is used to define a preset width threshold or a preset height threshold for enabling the transform inheritance mode. The current coding block satisfies the enabling condition, including any of the following:

[0183] ① When the size condition defines a preset width threshold, the width of the current coding block is greater than the preset width threshold;

[0184] ② When the size condition defines a preset height threshold, the height of the current coding block is greater than the preset height threshold;

[0185] ③ When the size condition defines a preset width threshold, the width of the current coding block is less than the preset width threshold;

[0186] ④ When the size condition defines a preset height threshold, the height of the current coding block is less than the preset height threshold.

[0187] g. The enabling condition includes a prediction condition; the current coding block satisfies the enabling condition, including: the adjacent coding block is a prediction reference coding block of the current coding block.

[0188] It should be understood that the number of adjacent coding blocks may be greater than or equal to 1. When the number of adjacent coding blocks is greater than 1, the encoding device determines, based on the encoding information of the adjacent coding blocks, that the transformation information of the current coding block may include s31-s33:

[0189] s31. De-duplicate adjacent coding blocks to obtain N adjacent coding blocks after de-duplication, where N is a positive integer. The specific implementation of step s31 can be found in the specific implementation of step s11 above, and will not be repeated here.

[0190] s32. Determine a target adjacent coding block from N adjacent coding blocks.

[0191] Among them, the method for determining the target adjacent coding block may include at least one of the following: ① Determine the target adjacent coding block from N adjacent coding blocks according to the rate-distortion optimization rule. Specifically, the current coding block can be encoded based on the transformation information of each adjacent coding block in the N adjacent coding blocks, and the corresponding rate-distortion cost can be determined based on the encoding result corresponding to each adjacent coding block, and the adjacent coding block corresponding to the minimum rate-distortion cost is determined as the target adjacent coding block. ② If the N adjacent coding blocks contain at least one prediction reference coding block of the current coding block, and the prediction mode of the current coding block is coupled with the transform inheritance mode, then the prediction reference coding block selected by the prediction mode of the current coding block is selected as the target adjacent coding block; wherein the prediction mode includes at least one of the following: inter-frame merge mode, intra-frame block copy merge mode, intra-frame template matching merge mode, and intra-frame prediction mode. Among them, the specific implementation method of selecting the prediction reference coding block selected by the prediction mode of the current coding block as the target adjacent coding block can refer to the description of the corresponding part above and will not be repeated here.

[0192] s33. Determine the transformation information of the target adjacent coding block as the transformation information of the current coding block.

[0193] 2) The coding information of the adjacent coding block includes the residual or transform coefficient of the adjacent coding block; in an embodiment of the present application, the residual or transform coefficient of the adjacent coding block can be used to derive the residual position mode when the current coding block adopts SBT, and the residual position mode is used to indicate the sub-block area for transform coding residual. By utilizing the residual or transform coefficient of the adjacent coding block, the residual position mode when the current coding block adopts SBT can be quickly derived, thereby improving the coding efficiency during the coding process.

[0194] The transformation information of the current coding block includes the residual position mode of the current coding block under SBT. The transformation information of the current coding block is determined according to the coding information of the adjacent coding blocks, including steps s41-s43:

[0195] s41. Reorder the candidate residual position patterns under the SBT according to the coding information of the adjacent coding blocks to obtain a reordered list.

[0196] As an implementation method, candidate residual position patterns under the SBT are reordered according to coding information of adjacent coding blocks to obtain a reordered list, including: obtaining index information of each candidate residual position pattern under the SBT according to the coding information of the adjacent coding blocks; and then reordering each candidate residual position pattern under the SBT in descending order of the index information to obtain a reordered list. The reordered list contains the candidate residual position patterns arranged in order and their corresponding index information.

[0197] Among them, each candidate residual position mode under SBT corresponds to a sub-block transformation area at a different position, and according to the coding information of the adjacent coding block, the index information of each candidate residual position mode under SBT is obtained, including: ① obtaining the first adjacent coding block and the second adjacent coding block of the current coding block, the first adjacent coding block refers to the adjacent coding block located in the first direction of the current coding block; the second adjacent coding block refers to the adjacent coding block located in the second direction of the current coding block; ② obtaining the first quantity ratio in the first adjacent coding block; the first quantity ratio refers to the ratio between the number of non-zero residual basic units contained in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block; obtaining the second quantity ratio in the second adjacent coding block; the second quantity ratio refers to the ratio between the number of non-zero residual basic units contained in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block The ratio between the number of non-zero residual basic units in the coding block and the total number of all residual basic units in the second adjacent coding block; ③ According to the size relationship between the first number ratio and the second number ratio, index information is assigned to each candidate residual position mode under SBT; wherein, if the first number ratio is greater than or equal to the second number ratio, the index information assigned to the candidate residual position mode in the sub-block transformation area in the first direction is greater than the index information assigned to the candidate residual position mode in the sub-block transformation area in the second direction; if the first number ratio is less than the second number ratio, the index information assigned to the candidate residual position mode in the sub-block transformation area in the second direction is greater than the index information assigned to the candidate residual position mode in the sub-block transformation area in the first direction.

[0198] It should be understood that the candidate residual position mode assigned with a higher index information is considered to have a certain correlation with the residual position mode of the current coding block under the SBT. Therefore, the larger the index information of the residual position mode, the shorter the encoding code length of the candidate residual position mode; the shorter the encoding code length of the residual position mode, the higher the probability that the candidate residual position mode is selected as the residual position mode of the current coding block under the SBT. It should be understood that the specific implementation method of obtaining the index information of each candidate residual position mode under the SBT based on the encoding information of the adjacent coding block can be found in the description of the corresponding part above and will not be repeated here.

[0199] s42. Select the residual position mode of the current coding block under SBT from the reordering list.

[0200] Among them, selecting the residual position mode of the current coding block under SBT from the reordering table may include any of the following methods: ① In an embodiment of the present application, the closer the candidate residual position mode is in the reordering list, the higher the probability that the candidate residual position mode is selected. Therefore, the candidate residual position mode with the largest index information (that is, the candidate residual position mode with the shortest encoding code length or the candidate residual position mode with the highest probability of being selected) can be selected from the reordering list as the residual position mode of the current coding block under SBT. Schematically, the candidate residual position modes arranged in order in the reordering list include residual position mode a and residual position mode b; residual position mode a is at the front of the reordering list, so the probability of residual position mode a being selected is the highest. At this time, residual position mode a can be determined as the residual position mode of the current coding block under SBT. By selecting the residual position mode of the current coding block under SBT based on the probability that the candidate residual position mode is selected, the residual position mode of the previous coding block under SBT can be quickly determined, thereby improving coding efficiency.

[0201] ② According to the RDO rule, determine the residual position mode of the current coding block under SBT from the reordering list. The encoding device can determine the rate-distortion cost corresponding to each candidate residual position mode of the current coding block under SBT in turn, and use the candidate residual position mode corresponding to the minimum rate-distortion cost as the residual position mode of the current coding block under SBT. Schematically, the candidate residual position modes arranged in order in the reordering list include residual position mode a, residual position mode b, and residual position mode c; wherein, the rate-distortion cost corresponding to residual position mode a < the rate-distortion cost of residual position mode b < the rate-distortion cost of residual position mode c, then residual position mode a is determined as the residual position mode of the current coding block under SBT.

[0202] S904: Based on the determined transformation information of the current coding block, perform coding processing on the current coding block to obtain a video code stream.

[0203] Specific implementations of step S904 may include the following:

[0204] (1) The transformation information includes a transformation division method and / or a transformation combination. Based on the determined transformation information of the current coding block, the current coding block is coded to obtain a video bitstream, including: transforming the current coding block based on the transformation information of the current coding block to obtain transformation coefficients of the current coding block, and performing quantization, entropy coding and other operations on the transformation coefficients of the current coding block to obtain a video bitstream.

[0205] (2) The coding information of the adjacent coding block includes the residual and transformation coefficient of the adjacent coding block. The transformation information of the current coding block includes the position residual mode flag of the current coding block under SBT; based on the determined transformation information of the current coding block, the current coding block is encoded to obtain a video code stream, including: deriving one or more context index information based on the coding information of the adjacent coding block, each context index information corresponds to an entropy coding method, and the entropy coding method includes but is not limited to: variable length coding, Huffman coding, etc.; then the encoding device determines the entropy coding method according to the derived context index information, and performs entropy coding on the residual position mode flag of the current coding block under SBT according to the determined entropy coding method to obtain a video code stream. Among them, the residual position mode flag is used to indicate the residual position mode of the current coding block under SBT.

[0206] Among them, one or more context index information is derived according to the coding information of the adjacent coding block, including: obtaining the first adjacent coding block and the second adjacent coding block of the current coding block, the first adjacent coding block refers to the adjacent coding block located in the first direction of the current coding block; the second adjacent coding block refers to the adjacent coding block located in the second direction of the current coding block; obtaining a first quantity ratio in the first adjacent coding block; the first quantity ratio refers to the ratio between the number of non-zero residual basic units contained in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block; obtaining a second quantity ratio in the second adjacent coding block; the second quantity ratio refers to the ratio between the number of non-zero residual basic units contained in the second adjacent coding block and the total number of all residual basic units in the second adjacent coding block; then determining the context index information according to the size relationship between the first quantity ratio and the second quantity ratio; wherein, if the first quantity ratio is greater than the second quantity ratio, the context index information is the first index information; if the first quantity ratio is equal to the second quantity ratio, the context index information is the second index information; if the first quantity ratio is less than the second quantity ratio, the context index information is the third index information. It should be understood that the derivation of one or more context index information based on the coding information of adjacent coding blocks can be referred to the embodiments of the corresponding parts above, and will not be repeated here.

[0207] (3) The coding information of the adjacent coding block includes the residual and transformation coefficient of the adjacent coding block; the reordering list contains the candidate residual position patterns arranged in order and their corresponding index information; based on the determined transformation information of the current coding block, the current coding block is encoded to obtain a video bitstream, including: determining the index information of the selected residual position pattern in the reordering list, and then performing entropy coding on the index information of the selected residual position pattern in the reordering list to obtain a video bitstream.

[0208] Among them, in the embodiment of the present application, the larger the index information of the candidate residual position mode, the shorter the encoding code length of the candidate residual position mode; the shorter the encoding code length of the candidate residual position mode, the higher the probability of the candidate residual position mode being selected. For example, if the index information of the selected residual position mode in the reordering list is the largest, then when the selected residual position mode is entropy-coded, the selected residual position mode can be encoded using a shorter code length, such as encoding the selected residual position mode as 0 (i.e., 1 bit). In this way, the coding efficiency can be improved.

[0209] In an embodiment of the present application, during the video encoding process, the transformation information of the current coding block can be determined based on the encoding information of the adjacent coding blocks. This can reduce the encoding cost consumed for encoding the transformation information of the current coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the encoding efficiency.

[0210] Please refer to Figure 10, which is a schematic diagram of the structure of a video decoding device provided in an embodiment of the present application. The video decoding device can be a computer program (including program code) in a computer device. For example, the video decoding device can be an application software in the computer device. The video decoding device can be used to perform some or all of the steps in the method embodiment shown in Figure 5. Referring to Figure 10, the video decoding device includes the following units:

[0211] The processing unit 1001 is configured to determine a current coding block in a video stream;

[0212] The processing unit 1001 is further configured to determine adjacent coding blocks of a current coding block;

[0213] The processing unit 1001 is further configured to determine transformation information of a current coding block based on coding information of adjacent coding blocks;

[0214] The decoding unit 1002 is configured to perform decoding processing on the current coding block based on the determined transformation information of the current coding block.

[0215] The video decoding device in this embodiment can execute the implementation methods provided by the steps in FIG. 6 . For details, please refer to the implementation methods provided by the steps above, which will not be described in detail here.

[0216] In an embodiment of the present application, during the decoding process of the video, the transformation information of the current coding block can be determined based on the coding information of the adjacent coding blocks. This can reduce the coding cost consumed for encoding the transformation information of the current coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the decoding efficiency.

[0217] Please refer to Figure 11, which is a schematic diagram of the structure of a video encoding device provided in an embodiment of the present application. The video encoding device can be a computer program (including program code) in a computer device, for example, the video encoding device can be an application software in the computer device; the video encoding device can be used to perform some or all of the steps in the method embodiment shown in Figure 9. Referring to Figure 11, the video encoding device includes the following units:

[0218] Processing unit 1101, configured to determine a current coding block in a video;

[0219] The processing unit 1101 is further configured to determine adjacent coding blocks of a current coding block;

[0220] The processing unit 1101 is further configured to determine transformation information of a current coding block based on coding information of adjacent coding blocks;

[0221] The encoding unit 1102 is configured to perform encoding processing on the current coding block based on the determined transformation information of the current coding block to obtain a video code stream.

[0222] The video encoding device in this embodiment can execute the implementation methods provided by the steps in FIG. 9 . For details, please refer to the implementation methods provided by the steps above, which will not be described again here.

[0223] In an embodiment of the present application, during the video encoding process, the transformation information of the current coding block is determined directly based on the coding information of the adjacent coding blocks. This can reduce the coding cost consumed for encoding the transformation information of the coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the coding efficiency.

[0224] Furthermore, an embodiment of the present application provides a schematic diagram of the structure of a computer device, which can be seen in Figure 12. The computer device may include a processor 1201, an input device 1202, an output device 1203, and a memory 1204. The processor 1201, input device 1202, output device 1203, and memory 1204 are connected via a bus. The memory 1204 is used to store a computer program, which includes program instructions. The processor 1201 is used to execute the program instructions stored in the memory 1204.

[0225] In one embodiment, the computer device may be the above-mentioned decoding device. In this embodiment, the processor 1201 executes the following operations by running program instructions in the memory 1204:

[0226] Determine a current coding block in a video stream and determine adjacent coding blocks of the current coding block;

[0227] Determine the transformation information of the current coding block based on the coding information of the adjacent coding blocks;

[0228] Based on the determined transformation information of the current coding block, decoding processing is performed on the current coding block.

[0229] The computer device (decoding device) in this embodiment can execute the implementation methods provided by the steps in FIG6 . For details, please refer to the implementation methods provided by the steps above, which will not be described in detail here.

[0230] In an embodiment of the present application, during the decoding process of the video, the transformation information of the current coding block can be determined based on the coding information of the adjacent coding blocks. This can reduce the coding cost consumed for encoding the transformation information of the current coding block, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the decoding efficiency.

[0231] In another embodiment, the computer device may be the above-mentioned encoding device. In this embodiment, the processor 1201 executes the following operations by running the program instructions in the memory 1204:

[0232] Determine a current coding block in the video and determine adjacent coding blocks of the current coding block;

[0233] Determine the transformation information of the current coding block based on the coding information of the adjacent coding blocks;

[0234] Based on the determined transformation information of the current coding block, the current coding block is coded to obtain a video stream.

[0235] The computer device (encoding device) in this embodiment can execute the implementation methods provided by the various steps in Figure 9 above. For details, please refer to the implementation methods provided by the various steps above, which will not be repeated here.

[0236] In an embodiment of the present application, during the video encoding process, the transformation information of the current coding block can be determined based on the encoding information of the adjacent coding blocks. In this way, it is only necessary to reduce the cost of encoding the transformation information of the coding block at the encoding end, thereby reducing the bit rate consumption in the entire encoding and decoding process, and thus improving the coding efficiency.

[0237] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions. When the processor executes the above program instructions, it can execute the method in the embodiment corresponding to Figures 6 and 9 above, so it will not be repeated here. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed on a computer device, or executed on multiple computer devices located at one location, or, executed on multiple computer devices distributed at multiple locations and interconnected by a communication network.

[0238] According to one aspect of the present application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, so that the computer device can perform the methods described in the embodiments corresponding to FIG. 5 and FIG. 9 . Therefore, these methods will not be described in detail herein.

[0239] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0240] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A video decoding method, It is characterized in that include: Determine a current coding block in a video bitstream, and determine adjacent coding blocks of the current coding block; Determining transformation information of the current coding block according to the coding information of the adjacent coding block; Based on the determined transformation information of the current coding block, decoding processing is performed on the current coding block.

2. The method according to claim 1, It is characterized in that The adjacent coding blocks include spatial domain adjacent coding blocks and / or temporal domain adjacent coding blocks; The spatially adjacent coding block refers to a coding block adjacent to the current coding block in a current frame of the video; the current frame refers to a video frame where the current coding block is located; the current coding block refers to a coding block being decoded in the current frame; The time-domain adjacent coding block refers to a coding block adjacent to a reference coding block in a reference frame of the video; the reference frame is any video frame or a specified video frame in the video except the current frame; the position of the reference coding block in the reference frame is the same as the position of the current coding block in the current frame.

3. The method according to claim 1 or 2, It is characterized in that The coding information of the adjacent coding block includes transformation information of the adjacent coding block; and determining the transformation information of the current coding block according to the coding information of the adjacent coding block includes: Determining the transformation information of the adjacent coding block as the transformation information of the current coding block; Among them, the transformation information includes at least one of a transformation division method and a transformation combination; the transformation division method includes at least one of the following: a residual quadtree mode, a position-based transformation mode, and a sub-block transformation mode; the transformation combination includes a transformation kernel for a horizontal transformation and a transformation kernel for a vertical transformation, and the transformation kernel includes at least one of the following: a discrete cosine transform kernel, a discrete sine transform kernel, and a skip transform.

4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: Detecting whether the current coding block enables a transform inheritance mode; If the transformation inheritance mode is enabled for the current coding block, a step of determining the transformation information of the adjacent coding block as the transformation information of the current coding block is performed.

5. The method according to any one of claims 1 to 4, It is characterized in that The activation control method of the transformation inheritance mode includes at least one of the following: Setting a transform inheritance mode flag in the video bit stream, when the transform inheritance mode flag is a first preset value, instructing the current coding block to enable the transform inheritance mode; when the transform inheritance mode flag is a second preset value, instructing the current coding block to disable the transform inheritance mode; Setting an enabling condition for a transform inheritance mode, and when the current coding block meets the enabling condition, instructing the current coding block to enable the transform inheritance mode; When the current coding block does not meet the enabling condition, the current coding block is instructed to turn off the transform inheritance mode; the enabling condition includes at least one of the following: a size condition and a prediction condition.

6. The method according to any one of claims 1 to 5, It is characterized in that The setting position of the transform inheritance mode flag in the video bit stream includes at least one of the following: The transform inheritance mode flag is set in the sequence header of the video. When the transform inheritance mode flag in the sequence header is a first preset value, it indicates that all coding blocks in all video frames of the video enable the transform inheritance mode; when the transform inheritance mode flag in the sequence header is a second preset value, it indicates that all coding blocks in all video frames of the video disable the transform inheritance mode. The transform inheritance mode flag is set in the frame header of the current frame of the video. When the transform inheritance mode flag in the frame header of the current frame is a first preset value, it indicates that all coding blocks in the current frame enable the transform inheritance mode; when the transform inheritance mode flag in the frame header of the current frame is a second preset value, it indicates that all coding blocks in the current frame disable the transform inheritance mode. The transform inheritance mode flag is set in the slice header of the slice where the current coding block is located. When the transform inheritance mode flag in the slice header is a first preset value, it indicates that all coding blocks in the slice enable the transform inheritance mode; when the transform inheritance mode flag in the slice header is a second preset value, it indicates that all coding blocks in the slice disable the transform inheritance mode. The transform inheritance mode flag is set in the coding tree unit where the current coding block is located. When the transform inheritance mode flag in the coding tree unit is a first preset value, it indicates that all coding blocks in the coding tree unit enable the transform inheritance mode; when the transform inheritance mode flag in the coding tree unit is a second preset value, it indicates that all coding blocks in the coding tree unit disable the transform inheritance mode. The transform inheritance mode flag is set in the current coding block. When the transform inheritance mode flag in the current coding block is a first preset value, it indicates that the current coding block enables the transform inheritance mode; when the transform inheritance mode flag in the current coding block is a second preset value, it indicates that the current coding block turns off the transform inheritance mode.

7. The method according to any one of claims 1 to 6, It is characterized in that The enabling condition includes a size condition, and the size condition is used to define a preset width threshold or a preset height threshold for enabling the transformation inheritance mode; The current coding block satisfies the enabling condition, including any one of the following: When the size condition defines a preset width threshold, the width of the current coding block is greater than the preset width threshold; When the size condition defines a preset height threshold, the height of the current coding block is greater than the preset height threshold; When the size condition defines a preset width threshold, the width of the current coding block is less than the preset width threshold; When the size condition defines a preset height threshold, the height of the current coding block is less than the preset height threshold.

8. The method according to any one of claims 1 to 7, It is characterized in that The enabling condition includes a prediction condition; the current coding block satisfies the enabling condition, including: the adjacent coding block is a prediction reference coding block of the current coding block.

9. The method according to any one of claims 1 to 8, It is characterized in that The number of adjacent coding blocks is greater than 1; and determining the transformation information of the adjacent coding blocks as the transformation information of the current coding block includes: Performing deduplication processing on the adjacent coding blocks to obtain N adjacent coding blocks after deduplication, where N is a positive integer; Determine a target adjacent coding block from the N adjacent coding blocks; The transformation information of the target adjacent coding block is determined as the transformation information of the current coding block.

10. The method according to any one of claims 1 to 9, It is characterized in that The method for determining the target adjacent coding block includes: If the selection flag in the video bitstream includes an identifier of an adjacent coding block to be inherited, a target adjacent coding block corresponding to the identifier is selected from the N adjacent coding blocks according to the selection flag; or, If the N adjacent coding blocks include at least one prediction reference coding block of the current coding block, and the prediction mode of the current coding block is coupled with the transform inheritance mode, selecting the prediction reference coding block selected by the prediction mode of the current coding block as the target adjacent coding block; The prediction mode includes at least one of the following: an inter-frame merge mode, an intra-frame block copy merge mode, an intra-frame template matching merge mode, and an intra-frame prediction mode.

11. The method according to any one of claims 1 to 10, It is characterized in that The coding information of the adjacent coding block includes the residual or transformation coefficient of the adjacent coding block; the video bit stream includes the position residual mode flag of the current coding block in the sub-block transformation mode; The determining, according to the coding information of the adjacent coding block, the transformation information of the current coding block comprises: Derived one or more context index information according to the coding information of the adjacent coding block, each context index information corresponds to an entropy decoding mode; Determining an entropy decoding method according to the derived context index information; The residual position mode flag of the current coding block in the sub-block transformation mode is entropy decoded according to the determined entropy decoding method to obtain the residual position mode of the current coding block in the sub-block transformation mode.

12. The method according to any one of claims 1 to 11, It is characterized in that The deriving one or more context index information according to the coding information of the adjacent coding block includes: Acquire a first adjacent coding block and a second adjacent coding block of the current coding block, wherein the first adjacent coding block refers to an adjacent coding block located in a first direction of the current coding block; and the second adjacent coding block refers to an adjacent coding block located in a second direction of the current coding block; Obtaining a first quantity ratio in the first adjacent coding block; the first quantity ratio refers to a ratio between the number of non-zero residual basic units in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block; Obtaining a second quantity ratio in the second adjacent coding block; the second quantity ratio refers to a ratio between the number of non-zero residual basic units in the second adjacent coding block and the total number of all residual basic units in the second adjacent coding block; Determining context index information according to a magnitude relationship between the first quantity ratio and the second quantity ratio; Among them, if the first quantity ratio is greater than the second quantity ratio, the context index information is the first index information; if the first quantity ratio is equal to the second quantity ratio, the context index information is the second index information; if the first quantity ratio is less than the second quantity ratio, the context index information is the third index information.

13. The method according to any one of claims 1 to 12, It is characterized in that The coding information of the adjacent coding block includes the residual or transformation coefficient of the adjacent coding block; the video bit stream includes the index information of the residual position mode selected by the current coding block in the sub-block transformation mode; The sub-block transformation mode includes a plurality of candidate residual position modes; The determining, according to the coding information of the adjacent coding block, the transformation information of the current coding block comprises: Reordering the candidate residual position modes under the sub-block transform mode according to the coding information of the adjacent coding block to obtain a reordering list, wherein the reordering list includes the candidate residual position modes arranged in order and their corresponding index information; Performing entropy decoding processing on the video bitstream to obtain index information of the residual position mode selected by the current coding block in the sub-block transformation mode; The residual position mode of the current coding block in the sub-block transform mode is determined from the reordering list according to the index information of the residual position mode selected by the current coding block in the sub-block transform mode.

14. The method according to any one of claims 1 to 13, It is characterized in that The reordering of the candidate residual position modes under the sub-block transform mode according to the coding information of the adjacent coding block to obtain a reordering list includes: According to the coding information of the adjacent coding block, obtaining index information of each candidate residual position mode under the sub-block transformation mode; Reorder the candidate residual position modes under the sub-block transform mode in descending order of index information to obtain a reordered list; Among them, the larger the index information of the candidate residual position pattern, the shorter the encoding code length of the candidate residual position pattern; the shorter the encoding code length of the candidate residual position pattern, the higher the probability that the candidate residual position pattern is selected.

15. The method according to any one of claims 1 to 14, It is characterized in that Each candidate residual position mode under the sub-block transformation mode corresponds to a sub-block transformation area at a different position; The obtaining, according to the coding information of the adjacent coding block, index information of each candidate residual position mode under the sub-block transform mode includes: Acquire a first adjacent coding block and a second adjacent coding block of the current coding block, wherein the first adjacent coding block refers to an adjacent coding block located in a first direction of the current coding block; and the second adjacent coding block refers to an adjacent coding block located in a second direction of the current coding block; Obtaining a first quantity ratio in the first adjacent coding block; the first quantity ratio refers to a ratio between the number of non-zero residual basic units in the first adjacent coding block and the total number of all residual basic units in the first adjacent coding block; Obtaining a second quantity ratio in the second adjacent coding block; the second quantity ratio refers to a ratio between the number of non-zero residual basic units in the second adjacent coding block and the total number of all residual basic units in the second adjacent coding block; Allocating index information to each candidate residual position mode in the sub-block transform mode according to a size relationship between the first quantity ratio and the second quantity ratio; Wherein, if the first number ratio is greater than or equal to the second number ratio, the index information assigned to the candidate residual position mode where the sub-block transform region is located in the first direction is greater than the index information assigned to the candidate residual position mode where the sub-block transform region is located in the second direction; If the first number ratio is smaller than the second number ratio, the index information assigned to the candidate residual position mode whose sub-block transform region is located in the second direction is greater than the index information assigned to the candidate residual position mode whose sub-block transform region is located in the first direction.

16. A video encoding method, It is characterized in that include: Determine a current coding block in the video, and determine adjacent coding blocks of the current coding block; Determining transformation information of the current coding block according to the coding information of the adjacent coding block; Based on the determined transformation information of the current coding block, the current coding block is coded to obtain a video code stream.

17. A video decoding device, It is characterized in that include: A processing unit, configured to determine a current coding block in a video bitstream; The processing unit is further configured to determine an adjacent coding block of the current coding block; The processing unit is further configured to determine transformation information of the current coding block according to the coding information of the adjacent coding block; A decoding unit is used to decode the current coding block based on the determined transformation information of the current coding block.

18. A video encoding device, It is characterized in that include: a processing unit for determining a current coding block in the video; The processing unit is further configured to determine an adjacent coding block of the current coding block; The processing unit is further configured to determine transformation information of the current coding block according to the coding information of the adjacent coding block; The encoding unit is used to encode the current encoding block based on the determined transformation information of the current encoding block to obtain a video code stream.

19. A computer device, It is characterized in that include: a processor suitable for executing a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the video decoding method according to any one of claims 1 to 15 is executed, or the video encoding method according to claim 16 is executed.

20. A computer-readable storage medium, It is characterized in that The computer storage medium stores a computer program, and when the computer program is executed by a processor, the video decoding method according to any one of claims 1 to 15 is executed, or the video encoding method according to claim 16 is executed.

21. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the video decoding method according to any one of claims 1 to 15, or executes the video encoding method according to claim 16.

Citation Information

Patent Citations

  • Video decoding method and device, computer equipment and storage medium

    CN110730353A

  • Image processing method, and image encoding / decoding method and device which use same

    CN110999304A

  • Video image encoding method and apparatus for encoding video data

    CN115733974A

  • Image encoding / decoding method

    CN115914625A