Video coding and decoding method and device, electronic equipment and computer readable storage medium

By implicitly deducing the sub-block transformation mode in the video encoding and decoding method, the problem that the flag bit encoding cost of sub-block transformation mode in the hybrid encoding framework affects the encoding and decoding efficiency is solved, and the effect of saving code rate and improving encoding and decoding efficiency is achieved.

CN119496895APending Publication Date: 2025-02-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311053293.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

In the hybrid encoding framework, a variety of sub-block transformation modes have been introduced, which has led to the encoding end requiring the transformation encoding process of the sub-blocks in the residual block, which increases the encoding cost, and also introduces the flag bit encoding cost of the sub-block transformation mode. It affects the encoding and decoding efficiency.

Method used

By obtaining the target quantization coefficients in the target area in the current block, the decoding end can implicitly deduce the sub-block transformation mode used by the current block, so that the encoding end does not need the flag bits of the sub-block transformation mode used by the current block. Perform explicit encoding.

Benefits of technology

This method saves code rate, improves encoding and decoding efficiency, and solves the impact of the flag bit encoding cost of sub-block transformation mode on encoding and decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496895A_ABST
    Figure CN119496895A_ABST
Patent Text Reader

Abstract

The invention provides a video coding and decoding method and device, electronic equipment and a computer readable storage medium, and the method can improve the coding and decoding efficiency, and comprises the steps: obtaining a target quantization coefficient in a target region in a current block; determining a sub-block transformation mode corresponding to the current block according to a target quantization coefficient in the target region; and decoding the current block according to the sub-block transformation mode corresponding to the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of coding and decoding technology, and more specifically, to a video coding and decoding method, device, electronic device and computer-readable storage medium. Background Art

[0002] In the hybrid coding framework, the residual needs to be transmitted to compensate for the predicted image, thereby improving the quality of the reconstructed image. In some scenarios, multiple sub-block transform modes are introduced. The encoder can perform transform coding only on the sub-blocks in the residual block based on the sub-block transform mode, which reduces the cost of coding the residual. However, the coding cost of the flag bit of the sub-block transform mode is also introduced, which affects the encoding and decoding efficiency. Summary of the invention

[0003] The embodiments of the present application provide a video encoding and decoding method, device, electronic device and computer-readable storage medium, which can improve the encoding and decoding efficiency.

[0004] In a first aspect, a video decoding method is provided, comprising:

[0005] Obtain target quantization coefficients in a target area in the current block;

[0006] Determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient in the target area;

[0007] The current block is decoded according to the sub-block transformation mode corresponding to the current block.

[0008] In a second aspect, a video encoding method is provided, comprising:

[0009] Determine a sub-block transformation mode corresponding to the current block;

[0010] According to the sub-block transformation mode corresponding to the current block, a target quantization coefficient in a target area in the current block is determined.

[0011] According to a third aspect, a video decoding device is provided, comprising:

[0012] An acquisition unit, used for acquiring a target quantization coefficient in a target area in a current block;

[0013] A determination unit, configured to determine a sub-block transformation mode corresponding to the current block according to a target quantization coefficient in the target area;

[0014] The decoding unit is used to decode the current block according to the sub-block transformation mode corresponding to the current block.

[0015] In a fourth aspect, a video encoding device is provided, including:

[0016] A first determining unit, configured to determine a sub-block transformation mode corresponding to a current block;

[0017] The second determining unit is used to determine a target quantization coefficient in a target area in the current block according to a sub-block transformation mode corresponding to the current block.

[0018] In a fifth aspect, a video decoding device is provided, comprising: a communication bus, a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected via the communication bus, wherein the memory is used to store program code, and the processor is configured to call the program code to execute the method of the first aspect as described above.

[0019] In a sixth aspect, a video encoding device is provided, comprising: a communication bus, a processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected via the communication bus, wherein the memory is used to store program code, and the processor is configured to call the program code to execute the method as described in the second aspect above.

[0020] In the seventh aspect, a video encoding and decoding system is provided, comprising: the video decoding device in the third aspect and the video encoding device in the fourth aspect; or, the video decoding device in the fifth aspect and the video encoding device in the sixth aspect.

[0021] In an eighth aspect, a computer storage medium is provided, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect as described above.

[0022] In an eighth aspect, a computer storage medium is provided, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in the second aspect above.

[0023] Based on the above technical solution, the decoding end can implicitly derive the sub-block transformation mode used by the current block according to the target quantization coefficient in the target area in the current block, so that the encoding end does not need to explicitly encode the flag bit of the sub-block transformation mode used by the current block, thereby saving bit rate and improving encoding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1 A schematic diagram showing an exemplary system architecture suitable for embodiments of the present application is shown.

[0026] Figure 2 A basic flow chart of a video encoder is shown.

[0027] Figure 3 It is a schematic diagram of the 8-seed block division method.

[0028] Figure 4 yes Figure 3 Schematic diagram of sub-block transformation methods corresponding to the 8 sub-block division methods.

[0029] Figure 5 It is a schematic diagram of the 16-seed block division method.

[0030] Figure 6 yes Figure 5 Schematic diagram of sub-block transformation methods corresponding to the 16 sub-block division methods.

[0031] Figure 7 It is a schematic flow chart of a video decoding method provided in an embodiment of the present application.

[0032] Figure 8 It is a schematic diagram of the target quantization coefficients in the target area provided in an embodiment of the present application.

[0033] Fig. 9 It is a schematic flowchart of a video encoding method provided in an embodiment of the present application.

[0034] Fig.10 It is a schematic diagram of a video decoding device provided in an embodiment of the present application.

[0035] Fig.11 It is a schematic diagram of a video encoding device provided in an embodiment of the present application.

[0036] Fig.12 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0040] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0041] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0042] In order to better understand the embodiments of the present application, a system architecture applicable to the embodiments of the present application is described.

[0043] See also Figure 1 , Figure 1 Schematic diagram of the system architecture applicable to the embodiment of the present application. Figure 1As shown, the system architecture 100 may include multiple terminals, which may communicate via a network 130. For example, the system architecture 100 may include a first terminal 110 and a second terminal 120, which may perform data transmission via the network 130.

[0044] For example, the first terminal 110 can encode video data (such as a video picture stream captured by the first terminal 110) for transmission to the second terminal 120 through the network 130. The encoded video data is transmitted in the form of one or more encoded video code streams. The second terminal 120 can receive the encoded video data from the network 130, decode the encoded video data to restore the video data, and display the video picture based on the restored video data.

[0045] In some scenarios, the system architecture may further include more terminals, such as a third terminal and a fourth terminal, etc. The third terminal and the fourth terminal may also perform data transmission through the network 130 .

[0046] The terminal in the embodiments of the present application may be a server, a personal computer, a tablet computer, a smart phone, a media player and / or a dedicated video conferencing device, etc., but the present application is not limited thereto.

[0047] The network 130 may be any number of networks for transmitting encoded video data between terminals, including, for example, a wired network and / or a wireless network. The network 130 may exchange data in a circuit switching and / or packet switching channel. The network may include a telecommunications network, a local area network, a wide area network, and / or the Internet.

[0048] In order to better understand the embodiments of the present application, the video encoding technology related to the embodiments of the present application is described.

[0049] In some embodiments of the present application, taking the international video coding standards High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), and China's National Video Coding Standard (AVS) as examples, a hybrid coding framework is adopted to perform the following series of operations and processing on the input original video signal:

[0050] 1) Block partition structure: The input video frame image will be divided into several non-overlapping processing units according to the size of a block, and each processing unit will perform similar compression operations. This processing unit is called a coding tree unit (CTU), or the largest coding unit (LCU). The CTU can be further divided into more detailed divisions to obtain one or more basic coding units (CU). Each CU is the most basic element in the encoding process. The following describes the various encoding methods that may be used for each CU. 2) Predictive Coding: It includes intra-frame prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain a residual video signal. The encoder needs to select the most suitable prediction coding mode for the current CU from many possible prediction coding modes and inform the decoder.

[0051] a: Intra-frame prediction: The predicted signal comes from the already encoded and reconstructed area in the same image.

[0052] b: Inter-frame prediction: The predicted signal comes from an already encoded image that is different from the current image (called a reference image).

[0053] 3) Transform & Quantization: After the residual video signal is transformed by discrete Fourier transform (DFT), discrete cosine transform (DCT) and other transformation operations, the signal is converted into the transform domain, which is called transform coefficient. The signal in the transform domain is further subjected to lossy quantization operations, which loses certain information, making the quantized signal conducive to compression expression. 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 the transforms for the current coding CU and inform the decoder. The degree of quantization is usually determined by the quantization parameter (QP). A larger QP value means that coefficients with a larger value range will be quantized to the same output, which usually results in greater distortion and lower bit rate. On the contrary, a smaller QP value means that coefficients with a smaller value range will be quantized to the same output, which usually results in less distortion and a higher bit rate.

[0054] 4) Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequency of occurrence of each value, and finally a binary (0 or 1) compressed code stream will be output. At the same time, the encoding generates other information, such as the selected coding mode, motion vector data, etc., which also need to be entropy encoded to reduce the bit rate. 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 (Content Adaptive Binary Arithmetic Coding, CABAC).

[0055] 5) Loop Filtering: The encoded image can be reconstructed into a decoded image after inverse quantization, inverse transformation and prediction compensation (i.e., operations 2 to 4 above). Compared with the original image, the reconstructed image has some information different from the original image due to the influence of quantization, resulting in distortion. Therefore, the reconstructed image can be filtered, such as deblocking filter (DB), adaptive pixel compensation (Sample Adaptive Offset, SAO) or adaptive loop filter (ALF), which can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed images will be used as a reference for subsequent encoded images and used to predict future signals, the above filtering operation is also called loop filtering, and the filtering operation in the encoding loop.

[0056] Figure 2 A basic flow chart of a video encoder is shown, in which intra-frame prediction is used as an example for explanation. k [x, y] and predicted image signal Perform difference operation to obtain the residual signal u k [x, y], reference signal u k [x, y] is transformed and quantized to obtain quantized coefficients. The quantized coefficients are entropy coded to obtain the encoded bit stream, and the reconstructed residual signal u′ is obtained through inverse quantization and inverse transformation. k [x, y], predicted image signal and reconstruct the residual signal u′ k [x, y] superposition generates image signal Image signal On the one hand, it is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing, and on the other hand, the reconstructed image signal S′ is output through loop filtering. k [x, y], reconstructed image signal S′ k [x, y] can be used as the reference image for the next frame for motion estimation and motion compensation prediction. Then based on the result of motion compensation prediction S′ r [x+m x , y+m y ] and intra prediction results Get the predicted image signal of the next frame And repeat the above process until the encoding is completed.

[0057] Based on the above encoding process, it can be seen that at the decoding end, for each CU, after the decoder obtains the compression bit rate, it first performs entropy decoding to obtain various mode information and quantization coefficients. Then the quantization coefficients are dequantized and inversely transformed to obtain the residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to the CU can be obtained, and then the residual signal and the prediction signal are added to obtain the reconstructed signal. The reconstructed signal is then subjected to loop filtering and other operations to generate the final output signal.

[0058] Since the prediction method has a large error, the residual needs to be transmitted to compensate the predicted image, thereby improving the quality of the reconstructed image. Therefore, residual processing is an important processing process in the hybrid coding framework.

[0059] like Figure 2 As shown, in the hybrid coding framework, the residual is the difference between the original image signal and the predicted image signal, that is,

[0060] For residual processing, there are two processing methods in HEVC, VVC and AVS3 video coding standards:

[0061] 1) Transformation and quantization:

[0062] By utilizing the correlation of the residuals, the residuals are transformed to concentrate the energy in fewer low-frequency coefficients, that is, the values ​​of most coefficients are small. After the subsequent quantization module, the smaller coefficient values ​​will become zero, greatly reducing the cost of encoding the residuals. Taking the traditional DCT as an example, the transformation is shown in the following formula, which realizes the two-dimensional discrete transformation through two separate one-dimensional discrete transformations (horizontal transformation and vertical transformation).

[0063] Co k =CU k C T

[0064] Due to the diversity of residual distribution, a single DCT cannot adapt to all residual characteristics. Therefore, transform kernels such as DST-7 and DCT-8 are introduced into the transform module, and different transform kernels can be used for horizontal transform and vertical transform. Taking the adaptive multiple core transform (AMT) technology as an example, the combination of transform kernels that may be selected for a residual block includes one or more of the following:

[0065] (DCT-2, DCT-2)

[0066] (DCT-8, DCT-8)

[0067] (DCT-8, DST-7)

[0068] (DST-7, DCT-8)

[0069] (DST-7, DST-7)

[0070] The specific combination of transform kernels for a residual block can be decided by using rate distortion optimization (RDO) at the encoding end. Multiple transform kernels can improve the adaptability of the transform module to the residual, but the problem that comes with it is the encoding cost of the transform kernel index.

[0071] 2) Transformation skipping and quantization: There are also some residuals whose correlation is weak. On the basis of 1), skipping the transformation can actually lead to higher coding efficiency, that is, skipping the transformation process of the residuals and directly quantizing the residuals.

[0072] In order to better understand the embodiments of the present application, the sub-block transform (SBT) mode related to the embodiments of the present application is described. When the sub-block transform mode is used, the encoder only needs to transform and encode a sub-block of the current coding block, which reduces the coding cost.

[0073] The sub-block transform mode of the current block may include a sub-block partitioning method of the current block, and the sub-block partitioning method is used to partition the sub-blocks in the current block. The sub-block partitioning method may be represented by information such as the size of the sub-block and the position of the sub-block in the current block.

[0074] Figure 3A schematic diagram of 8 sub-block transformation modes (or sub-block partitioning methods) in the current block is shown, wherein the quad flag is the size control syntax of the sub-block in the current block, wherein the quad flag value of 1 indicates that after the current block is quad-tree partitioned, the size of the sub-block is 1 / 4 of the size of the current block, and the value of 0 indicates that the size of the sub-block is 1 / 2 of the size of the current block, and the direction (dir) flag and the position (pos) flag are syntaxes for controlling the position of the sub-block in the current block, wherein the dir flag is used to control the direction of the sub-block in the current block, such as horizontal or vertical, and the pos flag is used to control the position of the sub-block, such as left or right, up or down. In other words, the quad flag determines the size (shape) of the sub-block, while the dir flag and the pos flag determine the position of the sub-block. That is, the partitioning method of the current block can be represented by the size of the sub-block, the direction and position of the sub-block in the current block.

[0075] In some embodiments, in the above 8-subblock division method, only the gray subblock is transform-coded, and the white part is forcibly cleared to zero. Alternatively, the transformation can be skipped during the residual coding of the gray subblock, and quantization and coding can be performed directly.

[0076] In some embodiments, the sub-block division mode and the sub-block transformation mode of the current block are associated with each other. For example, the sub-block transformation mode can be pre-set according to the sub-block division mode of the current block and the position of the sub-block, without the need for additional coding bits for identification. Therefore, it can also be considered that the sub-block transformation mode of the current block includes the sub-block division mode and the sub-block transformation mode of the current block. Optionally, the sub-block transformation mode can be represented by a transformation kernel used for sub-block transformation.

[0077] For example, for the selection of the combination of transform kernels of the sub-blocks, when the width or height of the non-zero residual sub-block is 64, the horizontal and vertical transforms of the non-zero residual sub-block are both DCT-2; in other cases, the selection of the transform kernels of the horizontal and vertical transforms can be as follows: Figure 4 As shown, in Figure 4 In the figure, the white sub-block is a 0 residual sub-block, and the gray sub-block is a non-zero residual sub-block.

[0078] In order to better understand the embodiments of the present application, the sub-block transformation extension mode related to the embodiments of the present application is described.

[0079] In some scenarios, based on the sub-block transform mode, the Figure 5 The extended mode of the sub-block transform mode in can further improve the transform efficiency. Similar to the sub-block transform mode, only the residuals of the gray sub-block area are encoded, and the residuals of the other white areas are forcibly cleared to zero.

[0080] In some embodiments, for Figure 5The 16 sub-block division methods in the example, the sub-block transformation method can be as follows Figure 6 As shown, the encoding end only performs transform encoding on the gray sub-block in the current block, and forcibly clears the white sub-block. Alternatively, the transform can be skipped during the residual encoding of the gray sub-block, and quantization and encoding can be performed directly.

[0081] exist Figure 5 In the sub-block division method shown, a00~a11, b00~b11, c00~c11, d00~d11 can be regarded as a type of mode respectively. Optionally, at least one type can be selected from these four types of modes as an extended mode of the sub-block transformation mode. The gray sub-blocks in the four modes in each type of mode are respectively located at the upper left, upper right, lower left and lower right positions of the entire coding block, so each type of mode can be identified by 2 flags: hor_idx (horizontal identification index, or horizontal position flag) and ver_idx (vertical identification index, or vertical position flag). That is, the sub-block division method of the current block can be represented by the horizontal size, vertical size, horizontal position and vertical position of the sub-block in the current block.

[0082] Table 1

[0083] Sub-block expansion mode (hor_idx, ver_idx) Top left mode (a00, b00, c00, d00) (0,0) Top right mode (a01, b01, c01, d01) (1,0) Lower left mode (a10, b10, c10, d10) (0,1) Lower right mode (a11, b11, c11, d11) (1,1)

[0084] The use of sub-block transform mode at the encoder can improve transform efficiency, but it also introduces the coding cost of the flag bit of the sub-block transform mode, which affects the encoding and decoding efficiency. Therefore, how to improve transform efficiency by using the sub-block transform mode while taking into account the encoding and decoding efficiency is an urgent problem to be solved.

[0085] In view of this, the present application provides a technical solution that can utilize part or all of the coefficient matrix of the current block to implicitly indicate the sub-block transformation mode corresponding to the current block, thereby reducing the cost of the flag bit of the sub-block transformation mode encoded at the encoding end and improving the encoding and decoding efficiency.

[0086] Figure 7 A flowchart of a video decoding method provided by an embodiment of the present application is shown. The video decoding method can be executed by a decoding end, which can be a device with a computing and processing function, or is set in a device with a computing and processing function, which can be a terminal device or a server. Figure 7 As shown, the video decoding method 600 includes at least part of the following contents:

[0087] S610, obtaining a target quantization coefficient within a target area in the current block;

[0088] S620, determining a sub-block transform mode corresponding to the current block according to a target quantization coefficient in the target area;

[0089] S630: Decode the current block according to the sub-block transformation mode corresponding to the current block.

[0090] Therefore, in an embodiment of the present application, the decoding end can implicitly derive the sub-block transformation mode used by the current block based on the target quantization coefficient in the target area in the current block, so that the encoding end does not need to explicitly encode the flag bit of the sub-block transformation mode used by the current block, thereby saving bit rate and improving encoding and decoding efficiency.

[0091] In some embodiments of the present application, the video image frame sequence includes a series of video image frames, each video image frame can be further divided into slices (Slices, or strips), and the slices can be divided into a series of LCUs (or CTUs), and the LCU contains several CUs.

[0092] In some embodiments of the present application, the video image frame is encoded in blocks. In some video coding standards, such as the H.264 standard, there is a concept of macroblock (MB), which can be further divided into multiple prediction blocks (prediction) that can be used for predictive coding. In the HEVC standard, basic concepts such as CU, prediction unit (PU) and transform unit (TU) are used to functionally divide various block units.

[0093] The current block in the embodiment of the present application may be a functionally divided block unit, such as a current CU, a current PU, a current TU or a current quantization block, or may be a smaller block than a CU, a PU, a TU or a quantization block, such as a smaller block obtained by dividing a CU, a PU, a TU or a quantization block.

[0094] In some embodiments of the present application, the sub-block transform mode may be a sub-block transform mode in AVS3 or VCC or other video coding standards, or an extended mode of the sub-block transform mode.

[0095] In some embodiments of the present application, the sub-block transformation mode can be represented by a size flag and a position flag, wherein the size flag is used to identify at least one of the horizontal size and the vertical size of the sub-block transformation, and the position flag is used to identify at least one of the horizontal position and the vertical position of the sub-block transformation.

[0096] Optionally, the size flag is also called a type flag or a size type flag. For example, different state values ​​of the size flag represent different combinations of horizontal and vertical sizes of the sub-block transformation.

[0097] In a specific example, the size flag may be 2 bits, and different state values ​​of the 2 bits represent different combinations of horizontal and vertical sizes of the sub-block transformation.

[0098] For example, Figure 5 As shown, a00~a11 correspond to a size type, that is, the horizontal size is W / 2 and the vertical size is H / 2; b00~b11 correspond to a size type, that is, the horizontal size is W / 2 and the vertical size is H / 4; c00~c11 correspond to a size type, that is, the horizontal size is W / 4 and the vertical size is H / 2; d00~d11 correspond to a size type, that is, the horizontal size is W / 4 and the vertical size is H / 4.

[0099] For example, different state values ​​of the 2-bit size flag represent the above four size types. For example, 00 represents the combination of W / 2 and H / 2, 01 represents the combination of W / 2 and H / 4, 10 represents the combination of W / 4 and H / 2, and 11 represents the combination of W / 4 and H / 4. It should be understood that the correspondence between the above state values ​​and size types is only an example, and this application does not limit this as long as each size type corresponds to a unique state value.

[0100] In some embodiments of the present application, when the size flag is used to identify the horizontal size and vertical size of the sub-block transformation, the size flag may include a horizontal size flag and a vertical size flag, the horizontal size flag is used to identify the horizontal size of the sub-block transformation, and the vertical size flag is used to identify the vertical size of the sub-block transformation. That is, the horizontal size and vertical size of the sub-block transformation can be indicated by independent flags. For example, different state values ​​of the horizontal size flag represent different horizontal sizes of the sub-block transformation, and different state values ​​of the vertical size flag represent different vertical sizes of the sub-block transformation.

[0101] In a specific example, the horizontal size flag is 1 bit. The different state values ​​of the 1 bit are used to indicate whether the horizontal size of the sub-block transformation is W / 4 or W / 2. For example, a state value of 0 indicates W / 2, and a state value of 1 indicates W / 4, or vice versa.

[0102] In a specific example, the vertical size flag is 1 bit. The different state values ​​of the 1 bit are used to indicate whether the vertical size of the sub-block transformation is H / 4 or H / 2. For example, a state value of 0 indicates H / 2, and a state value of 1 indicates H / 4, or vice versa.

[0103] In some embodiments of the present application, the position flag bit may be 2 bits, and different state values ​​of the 2 bits represent different combinations of horizontal and vertical positions of the sub-block transformation. For example, different state values ​​of the 2 bits represent Figure 5The four positions in the example shown are: upper left (a00, b00, c00, d00), upper right (a01, b01, c01, d01), lower left (a10, b10, c10, d10), and lower right (a11, b11, c11, d11). For example, 00 represents upper left, 01 represents upper right, 10 represents lower left, and 11 represents lower right. It should be understood that the corresponding relationship between the above state values ​​and position combinations is only an example, as long as each position combination corresponds to a unique state value, the application is not limited to this.

[0104] In some embodiments of the present application, when the position flag is used to identify the horizontal position and vertical position of the sub-block transformation, the position flag may include a horizontal position flag (e.g., hor_idx) and a vertical position flag (e.g., ver_idx), wherein the horizontal position flag is used to identify the horizontal position of the sub-block transformation, and the vertical position flag is used to identify the vertical position of the sub-block transformation. That is, the horizontal position and vertical position of the sub-block transformation may be indicated by independent flags.

[0105] In some embodiments of the present application, different state values ​​of the horizontal position flag are used to identify different horizontal positions of the sub-block transformation. For example, the horizontal position flag may be 1 bit, and the different state values ​​of the 1 bit are used to indicate whether the horizontal position of the sub-block transformation is left or right. Exemplarily, a state value of 0 indicates left, and a state value of 1 indicates right, or vice versa.

[0106] In some embodiments of the present application, different state values ​​of the vertical position flag are used to identify different vertical positions of the sub-block transformation. For example, the vertical position flag may be 1 bit, and the different state values ​​of the 1 bit are used to indicate whether the vertical position of the sub-block transformation is up or down. Exemplarily, a state value of 0 indicates up, and a state value of 1 indicates down, or vice versa.

[0107] In some embodiments of the present application, S620 may include:

[0108] Determine a target flag bit corresponding to the sub-block transform mode according to a target quantization coefficient in the target area, where the target flag bit includes at least one of a size flag bit and a position flag bit;

[0109] At least one of size information and position information of the sub-block transformation mode corresponding to the current block is determined according to the target flag corresponding to the sub-block transformation mode.

[0110] That is to say, in the embodiment of the present application, part or all of the flag bits corresponding to the sub-block transformation mode can be determined according to the target quantization coefficient.

[0111] In some embodiments, when the target flag bits include some flag bits corresponding to the sub-block transform mode, other flag bits can be obtained through entropy decoding, for example, determined by specific identification bits in the decoded code stream, that is, the encoding end can only encode other flag bits, and the target flag bits are implicitly indicated by the quantization coefficient, or, in other implementations, other flag bits can also be pre-set, or the values ​​of other flag bits are default values, for example, 0 or 1 by default.

[0112] Optionally, the target flag includes a position flag (eg, a horizontal position flag and a vertical position flag). In this case, the size flag corresponding to the sub-block transform mode can be obtained by entropy decoding.

[0113] Optionally, the target flag includes a horizontal position flag. In this case, the value of the vertical position flag can be obtained by entropy decoding, for example, by determining a specific identification bit in the decoded bit stream. Optionally, the size flag corresponding to the sub-block transform mode can also be obtained by entropy decoding.

[0114] Optionally, the target flag includes a vertical position flag. In this case, the value of the horizontal position flag may be obtained by entropy decoding, for example, by determining a specific identification bit in a decoded bitstream. Optionally, the size flag corresponding to the sub-block transform mode may also be obtained by entropy decoding, for example, by determining a specific identification bit in a decoded bitstream.

[0115] Optionally, the target flag includes a size flag, which is used to identify the horizontal size and vertical size of the sub-block transformation. In this case, the position flag corresponding to the sub-block transformation mode can be obtained by entropy decoding, for example, by determining a specific identification bit in the decoded bitstream.

[0116] In some embodiments of the present application, the target area is the area where the current block is located, or in other words, the target area includes the entire area where the current block is located, that is, the candidate quantization coefficients include the entire quantization coefficient matrix corresponding to the current block.

[0117] In some other embodiments of the present application, the target area is the area where the non-zero coefficients in the current block are located, that is, the candidate quantization coefficients only include the quantization coefficient matrix in the area where the non-zero coefficients are located. For example, the target area can be a Scan Region-based Coefficient Coding (SRCC) area in the current block. This method is conducive to reducing the computational complexity of the decoding end, improving the processing speed, and facilitating hardware implementation.

[0118] In some embodiments, the target region may be pre-set, that is, the decoding end and the encoding end have the same understanding of the target region. For example, the encoding end sets the target quantization coefficient in the target region according to the flag of the sub-block transformation mode, and the decoding end determines the sub-block transformation mode according to the target quantization coefficient in the target region, so that the encoding end and the decoding end can have the same understanding of the sub-block transformation mode used by the current block.

[0119] In an embodiment of the present application, the target quantization coefficient may include part or all of the quantization coefficients in the target region. That is, the decoding end may determine the sub-block transformation mode according to part or all of the quantization coefficients in the target region. The following describes the implementation of the target quantization coefficient in the target region in conjunction with a specific embodiment.

[0120] Mode 1: The target quantization coefficient may include all quantization coefficients in the target area.

[0121] Mode 2: The target quantization coefficient includes quantization coefficients at X preset positions within the target area, where X is a positive integer.

[0122] Optionally, the positions of the X preset positions in the target area may be preset.

[0123] Optionally, the value of X is preset, for example, X=1, or X is greater than 1, such as X=2, etc. For example, X=1, the preset position may be the first row and first column position in the target area, or the last row and last column position, etc.

[0124] Mode 3: The target quantization coefficient includes M rows of quantization coefficients in the target area, where M is a positive integer.

[0125] Optionally, the positions of the M rows of quantization coefficients in the target area may be preset.

[0126] Optionally, the value of M is preset, such as M=1, or M is greater than 1, such as M=2.

[0127] Take M=1 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (a) in FIG. 1 , the M rows of quantization coefficients may be the first row of quantization coefficients in the target area, or may be the last row of quantization coefficients, etc.

[0128] Take M=2 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (b), the M rows of quantization coefficients can be the last two rows of quantization coefficients in the target area, or the first two rows of quantization coefficients, or the middle two rows of quantization coefficients, or the odd rows of quantization coefficients, or the even rows of quantization coefficients.

[0129] Mode 4: The target quantization coefficient includes N columns of quantization coefficients in the target area, where N is a positive integer.

[0130] Optionally, the positions of the N columns of quantization coefficients in the target area may be preset.

[0131] Optionally, the value of N is preset, such as N=1, or N is greater than 1, such as N=2.

[0132] Take N=1 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (c) in FIG. 1 , the N columns of quantization coefficients may be the first column of quantization coefficients in the target area, or may be the last column of quantization coefficients, etc.

[0133] Take N=2 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (d), the N columns of quantization coefficients can be the last two columns of quantization coefficients in the target area, or the first two columns of quantization coefficients, or the middle two columns of quantization coefficients, or the odd-numbered columns of quantization coefficients, or the even-numbered columns of quantization coefficients.

[0134] Mode 5: The target quantization coefficients include P row quantization coefficients and Q column quantization coefficients in the target area, where P and Q are positive integers.

[0135] Optionally, the positions of P rows and Q columns of quantization coefficients in the target area may be preset.

[0136] Optionally, the value of P is preset, such as P=1, or P is greater than 1, such as P=2.

[0137] Optionally, the value of Q is preset, such as Q=1, or Q is greater than 1, such as Q=2.

[0138] Take P=Q=1 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (e) in FIG. 1 , the P rows and Q columns of quantization coefficients may include the last row of quantization coefficients and the last column of quantization coefficients in the target area, or, as shown in FIG. Figure 8 As shown in (g) in FIG. 1 , it may also include the first row of quantized coefficients and the first column of quantized coefficients in the target area.

[0139] Take P=Q=2 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (f) in FIG. 1 , the P rows and Q columns of quantized coefficients may include the last two rows of quantized coefficients and the last two columns of quantized coefficients in the target area, or, as shown in FIG. Figure 8As shown in (h), it may also include the first two rows of quantization coefficients and the first two columns of quantization coefficients in the target area, or it may include odd rows of quantization coefficients and odd columns of quantization coefficients, or it may include even rows of quantization coefficients and even columns of quantization coefficients.

[0140] Mode 6: The target quantization coefficient includes the quantization coefficients at K oblique line positions in the target area, where K is a positive integer.

[0141] Optionally, the positions of the K oblique line positions in the target area may be preset.

[0142] Optionally, the value of K is preset, such as K=1, or K is greater than 1, such as K=2.

[0143] Take K=1 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (i) in FIG. 1 , the quantization coefficients at the K oblique line positions may be the quantization coefficients at the penultimate oblique line position in the target area, or, as Figure 8 As shown in (j) in FIG. 1 , it can also be the quantization coefficient at the third-to-last diagonal position, or it can be the quantization coefficient on the diagonal line.

[0144] Take K=2 and the target area as a 4*4 quantization coefficient block as an example. Figure 8 As shown in (k) in FIG. 1 , the quantization coefficients at the K oblique line positions may include the quantization coefficients at the penultimate and penultimate oblique line positions in the target area, or, as shown in FIG. Figure 8 As shown in (l) in FIG. 1 , it may also include the quantized coefficients at the second to last and third to last diagonal positions, or it may also include the quantized coefficients at the diagonal and adjacent diagonal positions.

[0145] It should be understood that Figure 8 In the example, the target area is only a 4*4 quantization coefficient block, but the present application is not limited thereto. For example, the target area may also be an 8*8 quantization coefficient block, or a 16*16 quantization coefficient block, etc. In addition, Figure 8 Each square in represents a quantization coefficient, and the area where the gray squares are located can be considered as a statistical area for determining the sub-block transformation mode corresponding to the current block.

[0146] Mode 7: The target quantization coefficient includes the quantization coefficients at Y preset positions in the scanning order of the current block, where Y is a positive integer.

[0147] Optionally, the positions of the Y preset positions in the target area may be pre-set.

[0148] Optionally, the value of Y is preset, such as Y=1, or Y is greater than 1, such as Y=2.

[0149] For example, the target quantization coefficients may include the first Y quantization coefficients, or the middle N quantization coefficients, or the last Y quantization coefficients in the scanning order.

[0150] In some embodiments of the present application, the decoding end may also determine whether to use the quantization coefficient to implicitly derive the sub-block transform mode. For example, when the decoding end determines to use the quantization coefficient to implicitly derive the sub-block transform mode, it performs the operations in S610 to S630.

[0151] In some embodiments of the present application, the method 600 further includes:

[0152] Obtain at least one of a first index and a size of the current block, the first index being used to indicate whether to determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient;

[0153] According to at least one of the first index and the size of the current block, it is determined whether to determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient in a target area in the current block.

[0154] In some embodiments, obtaining the first index includes:

[0155] The first index is obtained from at least one of a sequence header corresponding to the current block, an image header corresponding to the current block, a slice header corresponding to the current block, and a maximum coding unit (LCU) corresponding to the current block.

[0156] Optionally, the decoding end may obtain the first index from the sequence header corresponding to the current block. For example, the sequence header is decoded to obtain the first index, in which case the first index indicates that all CUs in the video image frame sequence corresponding to the sequence header need to determine the sub-block transformation mode according to the quantization coefficient, for example, one or more flag bits corresponding to the sub-block transformation mode are determined according to the quantization coefficient.

[0157] Optionally, the decoding end may obtain the first index from the image header corresponding to the current block. For example, the image header is decoded to obtain the first index, in which case the first index indicates that all CUs in the video image frame corresponding to the image header need to determine the sub-block transformation mode according to the quantization coefficient, for example, one or more flag bits corresponding to the sub-block transformation mode are determined according to the quantization coefficient.

[0158] Optionally, the decoding end may obtain the first index from the slice header corresponding to the current block. For example, the slice header is decoded to obtain the first index, in which case the first index indicates that all CUs in the slice need to determine the sub-block transformation mode according to the quantization coefficient, for example, one or more flag bits corresponding to the sub-block transformation mode are determined according to the quantization coefficient.

[0159] Optionally, the decoding end can obtain a first index from the LCU corresponding to the current block, for example, decode the LCU to obtain the first index. In this case, the first index indicates that all CUs in the LCU need to determine the sub-block transformation mode according to the quantization coefficient, for example, determine one or more flag bits corresponding to the sub-block transformation mode according to the quantization coefficient.

[0160] Optionally, the decoding end may also obtain the size of the current block, and determine whether to determine the sub-block transform mode based on the quantization coefficient according to whether the size of the current block is within a preset range. That is, the encoding end may indicate whether it is necessary to determine the sub-block transform mode used by the current block based on the quantization coefficient for the current block through the size of the current block. For example, when the size of the current block is within a preset range, it is determined that the sub-block transform mode corresponding to the current block is determined based on the target quantization coefficient in the target area in the current block.

[0161] In some embodiments of the present application, the S620 includes:

[0162] Determine the statistical value of the target quantization coefficient in the target area, or in other words, perform statistical processing on the target quantization coefficient;

[0163] According to the statistical value of the target quantization coefficient, the sub-block transformation mode corresponding to the current block is determined.

[0164] For example, the value of the target flag bit of the sub-block transform mode corresponding to the current block is determined according to the statistical value of the target quantization coefficient.

[0165] In some embodiments, determining the statistical value of the target quantization coefficient within the target area includes:

[0166] Sum all quantization coefficients included in the target quantization coefficient to obtain a statistical value of the target quantization coefficient; or

[0167] summing up the absolute value of each quantization coefficient among all quantization coefficients included in the target quantization coefficient to obtain a statistical value of the target quantization coefficient; or

[0168] Each quantization coefficient among all quantization coefficients included in the target quantization coefficient is mapped, and a statistical value of the target quantization coefficient is determined according to the mapping value of each quantization coefficient.

[0169] It should be understood that the mapping process performed on the quantization coefficients may be the mapping process performed on the original values ​​of the quantization coefficients, or the mapping process may be the mapping process performed on the absolute values ​​of the quantization coefficients.

[0170] In some implementations, mapping each quantization coefficient among all quantization coefficients included in the target quantization coefficient may include, for example, mapping the quantization coefficients according to parity, for example, mapping the even coefficients and the odd coefficients in the target quantization coefficients to a first value and a second value, respectively, wherein the first value and the second value are different.

[0171] As an example, the first value is 1 and the second value is 0.

[0172] As another example, the first value is 0 and the second value is 1.

[0173] As yet another example, the first value is 2 and the second value is 3.

[0174] As another example, the first value is 3 and the second value is 2.

[0175] In some other implementations, each quantization coefficient among all quantization coefficients included in the target quantization coefficient is mapped, for example, it may include: mapping the zero coefficient and non-zero coefficient in the target quantization coefficient to a third value and a fourth value respectively, wherein the third value and the fourth value are different.

[0176] As an example, the third value is 1 and the fourth value is 0.

[0177] As another example, the third value is 0 and the fourth value is 1.

[0178] As yet another example, the third value is 3 and the fourth value is 2.

[0179] As yet another example, the third value is 2 and the fourth value is 3.

[0180] It should be understood that the above mapping method is only an example, and the embodiments of the present application may also adopt other mapping methods, such as inverse mapping, minus-one mapping, plus-one mapping, etc., and the present application is not limited to this.

[0181] In some embodiments, determining the statistical value of the target quantization coefficient according to the mapping value of each quantization coefficient may include, for example:

[0182] The mapping value of each quantization coefficient is summed to obtain the statistical value of the target quantization coefficient; or the absolute value of the mapping value of each quantization coefficient is summed to obtain the statistical value of the target quantization coefficient.

[0183] In some embodiments, performing statistical processing on the target quantization coefficient may include:

[0184] Statistics are taken on the parity of the number of even coefficients in the target quantization coefficients, or statistics are taken on the parity of the number of odd coefficients in the target quantization coefficients.

[0185] For example, if the number of even coefficients in the target quantization coefficient is an odd number, the statistical value of the target quantization coefficient may be a fifth value; if it is an even number, the statistical value of the target quantization coefficient may be a sixth value, wherein the fifth value and the sixth value are different. For example, the fifth value is 0 and the sixth value is 1, or vice versa.

[0186] For another example, if the number of odd coefficients in the target quantization coefficient is an odd number, the statistical value of the target quantization coefficient may be the seventh value; if it is an even number, the statistical value of the target quantization coefficient may be the eighth value, wherein the seventh value and the eighth value are different. For example, the seventh value is 0 and the eighth value is 1, or vice versa.

[0187] In some embodiments, determining the sub-block transformation mode corresponding to the current block according to the statistical value of the target coefficient includes:

[0188] The statistical value of the target quantization coefficient is modulo L, where L is a positive integer greater than 1;

[0189] The sub-block transform mode corresponding to the current block is determined according to the remainder of the statistical value of the target quantization coefficient. For example, the value of the target flag bit of the sub-block transform mode corresponding to the current block is determined according to the remainder of the statistical value of the target quantization coefficient.

[0190] In some embodiments, determining the sub-block transform mode corresponding to the current block according to the remainder result of the statistical value of the target quantization coefficient may include:

[0191] The target flag value of the sub-block transform mode corresponding to the current block is determined according to the remainder result of the statistical value of the target quantization coefficient and the first mapping relationship, wherein the first mapping relationship is a mapping relationship between different state values ​​of the remainder result and the value of the target flag value.

[0192] Optionally, L remainder results (0 to L-1) of the statistical value of the target quantization coefficient may correspond to L states. The L states may implicitly indicate L values ​​of the target flag bit.

[0193] Taking L=4 as an example, the remainder result can be 0 to 3, corresponding to 4 state values, and the 4 state values ​​can be used to indicate different values ​​of the target flag. For example, the target flag includes a position flag (such as hor_idx, ver_idx), and the 4 state values ​​of the remainder result can correspond to different values ​​of the position flag, such as the four values ​​of (hor_idx, ver_idx) in Table 1: 00, 01, 10, 11.

[0194] As an example, the state value of the remainder result 00 corresponds to the value of (hor_idx, ver_idx) 00, the state value of the remainder result 01 corresponds to the value of (hor_idx, ver_idx) 01, the state value of the remainder result 10 corresponds to the value of (hor_idx, ver_idx) 10, and the state value of the remainder result 11 corresponds to the value of (hor_idx, ver_idx) 11.

[0195] Taking L=2 as an example, the remainder result can be 0-1, corresponding to 2 state values, and the 2 state values ​​can be used to indicate different values ​​of the target flag bit.

[0196] For example, the target flag includes a horizontal position flag (e.g., hor_idx), and the two state values ​​of the remainder result may correspond to two values ​​of the horizontal position flag (e.g., hor_idx): 0 and 1. For example, the state value 0 of the remainder result corresponds to the value of the horizontal position flag 0, and the state value 1 of the remainder result corresponds to the value of the horizontal position flag 1. As a specific implementation, the parity of the number of even coefficients in all quantization coefficients in the target quantization coefficients may be counted, and if the number is an odd number, the value of the horizontal position flag is determined to be 0, and if it is an even number, the value of the horizontal position flag is determined to be 1, or vice versa.

[0197] For another example, the target flag includes a vertical position flag, and the two state values ​​of the remainder result may correspond to two values ​​of the vertical position flag (e.g., ver_idx): 0 and 1. For example, the state value 0 of the remainder result may correspond to the value of the vertical position flag 0. The state value 1 of the remainder result may correspond to the value of the vertical position flag 1. As a specific implementation, the parity of the number of even coefficients in all quantization coefficients in the target quantization coefficient may be counted. If the number is an odd number, the value of the vertical position flag is determined to be 0, and if the number is an even number, the value of the vertical position flag is determined to be 1, or vice versa.

[0198] Optionally, when L=2, information of a flag bit of the sub-block transform mode can be derived, and values ​​of other flag bits of the sub-block transform mode can be obtained by entropy decoding, for example, by decoding specific identification bits in the bitstream, or values ​​of other flag bits are default values, for example, 1 or 0 by default.

[0199] In some embodiments, when the target flag includes multiple flags, the multiple flags are determined based on the target quantization coefficients in the same target region, or the multiple flags are determined based on the target quantization coefficients in multiple target regions. That is, the target quantization coefficient in one target region can be used to determine the values ​​of multiple flags, or the target quantization coefficient in one target region can be used to determine the value of one flag.

[0200] It should be understood that when multiple flag bits are determined based on multiple target areas, the multiple target areas may not overlap with each other, or there may be partial overlap. The present application does not limit this. The method for determining the target quantization coefficients in the multiple target areas may be the same, or may be different, for example, determined by different methods among the aforementioned methods 1 to 7.

[0201] For example, when the target flag includes a horizontal position flag and a vertical position flag (for example, hor_idx, ver_idx), the decoding end can determine two target areas (recorded as a first target area and a second target area), wherein the target quantization coefficient in the first target area is used to determine the value of the horizontal position flag, and the target quantization coefficient in the second target area is used to determine the value of the horizontal position flag. For example, the decoding end can perform statistics on the target quantization coefficient in the first target area, and determine the value of the horizontal position flag according to the statistical value of the target quantization coefficient in the first target area, for example, the statistical value is modulo 2, and the value of the horizontal position flag is determined according to the result of the modulo calculation; perform statistics on the target quantization coefficient in the second target area, and determine the value of the vertical position flag according to the statistical value of the target quantization coefficient in the second target area, for example, the statistical value is modulo 2, and the value of the vertical position flag is determined according to the result of the modulo calculation. The specific determination method refers to the relevant description of the aforementioned embodiment, and for the sake of brevity, it is not repeated here.

[0202] For another example, when the target flag includes a horizontal position flag and a vertical position flag (for example, hor_idx, ver_idx), the decoding end can determine a target area, and the target quantization coefficient in the target area is used to determine the horizontal position flag and the vertical position flag. For example, the target quantization coefficient in the target area is counted, and the values ​​of the horizontal position flag and the vertical position flag are determined according to the statistical value of the target quantization coefficient in the target area. For example, the statistical value is modulo 4, and the values ​​of the horizontal position flag and the vertical position flag are determined according to the modulo result. The specific determination method refers to the relevant description of the aforementioned embodiment, and for the sake of brevity, it is not repeated here.

[0203] In summary, in the embodiments of the present application, the decoding end can implicitly derive part or all of the flag bits of the sub-block transform mode through the statistical value of the quantization coefficient, thereby reducing the cost of encoding the flag bits of the sub-block transform mode at the encoding end, saving bit rate and improving encoding and decoding efficiency.

[0204] Fig. 9A flowchart of a video encoding method according to an embodiment of the present application is shown. The video encoding method can be executed by an encoding end, which can be a device with a computing and processing function, or is set in a device with a computing and processing function, which can be a terminal device or a server. Fig. 9 As shown, the video encoding method 800 may include at least part of the following contents:

[0205] S810, determining a sub-block transformation mode corresponding to the current block;

[0206] S820, determining a target quantization coefficient in a target area in the current block according to a sub-block transformation mode corresponding to the current block.

[0207] Therefore, in an embodiment of the present application, the encoder can implicitly indicate to the decoder the sub-block transformation mode corresponding to the current block through the target quantization coefficient in the target area in the current block, so that the encoder does not need to explicitly encode the flag bit of the sub-block transformation mode used by the current block, thereby saving bit rate and improving encoding and decoding efficiency.

[0208] It should be understood that the behavior of the encoding end implicitly indicating the sub-block transform mode through the quantization coefficient and the behavior of the decoding end obtaining the sub-block transform mode through the quantization coefficient correspond to each other. Similar descriptions can refer to the detailed description of the decoding end. For the sake of brevity, they will not be repeated here.

[0209] In some embodiments, the encoder may use RDO to make a decision and determine the sub-block transformation mode corresponding to the current block.

[0210] In some embodiments of the present application, the target area is the area where the current block is located; or,

[0211] The target area is the area where the non-zero coefficients in the current block are located.

[0212] In some embodiments of the present application, the target quantization coefficient includes all quantization coefficients in the target area; or

[0213] The target quantization coefficient includes quantization coefficients at X preset positions within the target area, where X is a positive integer; or

[0214] The target quantization coefficients include M rows of quantization coefficients in the target area, where M is a positive integer; or

[0215] The target quantization coefficients include N columns of quantization coefficients in the target area, where N is a positive integer; or

[0216] The target quantization coefficients include P row quantization coefficients and Q column quantization coefficients in the target area, where P and Q are positive integers; or

[0217] The target quantization coefficients include quantization coefficients at K oblique line positions within the target area, where K is a positive integer; or

[0218] The target quantization coefficients include quantization coefficients at Y preset positions in the scanning order of the current block, where Y is a positive integer.

[0219] In some embodiments of the present application, method 800 further includes:

[0220] The size of the current block is determined, wherein the size of the current block is used to determine whether to determine a sub-block transformation mode corresponding to the current block according to a target quantization coefficient.

[0221] In some embodiments of the present application, method 800 further includes:

[0222] The first index is encoded into at least one of a sequence header corresponding to the current block, an image header corresponding to the current block, a slice header corresponding to the current block, and a maximum coding unit corresponding to the current block, wherein the first index is used to indicate whether a sub-block transformation mode corresponding to the current block is determined according to a target quantization coefficient.

[0223] In some embodiments, the sub-block transformation mode is represented by a size flag and a position flag, wherein the size flag is used to identify at least one of the horizontal size and the vertical size of the sub-block transformation, and the position flag is used to identify at least one of the horizontal position and the vertical position of the sub-block transformation.

[0224] In some embodiments, the position flag includes at least one of the following flags:

[0225] The horizontal position flag is used to identify the horizontal position of the sub-block transformation;

[0226] The vertical position flag is used to identify the vertical position of the sub-block transformation.

[0227] In some embodiments, determining a target quantization coefficient in a target area in the current block according to a sub-block transformation mode corresponding to the current block includes:

[0228] Determine a target statistical value according to a target flag bit of a sub-block transformation mode corresponding to the current block, wherein the target flag bit includes at least one of a size flag bit and a position flag bit;

[0229] According to the statistical rule of the target quantization coefficient, the target quantization coefficient in the target area in the current block is adjusted so that the statistical value of the target quantization coefficient meets the target statistical value.

[0230] In some implementations, the statistical value of the target quantization coefficient in the target region and the value of the target flag corresponding to the sub-block transformation mode satisfy a certain mapping relationship. Therefore, the encoder can determine the value of the target flag according to the selected sub-block transformation mode and determine the target statistical value that the target quantization coefficient needs to satisfy in combination with the mapping relationship, and then adjust the target quantization coefficient to satisfy the target statistical value, thereby achieving the purpose of indicating the target flag of the sub-block transformation mode to the decoder.

[0231] In some specific implementations, the statistical value of the target quantization coefficient is the parity of the number of even coefficients in all quantization coefficients included in the target quantization coefficient, for example, the value of the horizontal position flag is 0, corresponding to the number of even coefficients being an odd number, and the value of the horizontal position flag is 1, corresponding to the number of even coefficients being an even number. If the horizontal position flag corresponding to the sub-block transform mode selected by the encoder is 0, the encoder needs to adjust the value of the target quantization coefficient so that the number of even coefficients in all quantization coefficients is an odd number, or, if the horizontal position flag corresponding to the sub-block transform mode selected by the encoder is 1, the encoder needs to adjust the value of the target quantization coefficient so that the number of even coefficients in all quantization coefficients is an even number.

[0232] It should be understood that the above-mentioned statistical method of the target quantization coefficient is only an example, and the present application is not limited to this. For example, the statistical value of the target quantization coefficient may also be the sum of all quantization coefficients included in the target quantization coefficient; or the statistical value of the target quantization coefficient may also be the sum of the absolute values ​​of each quantization coefficient in all quantization coefficients included in the target quantization coefficient; or, the statistical value of the target quantization coefficient may also be the statistical value of the mapping value of each quantization coefficient in all quantization coefficients included in the target quantization coefficient. For example, the statistical value of the target quantization coefficient may be the sum of the mapping values ​​of each quantization coefficient, or the sum of the absolute values ​​of each quantization coefficient.

[0233] In some embodiments, mapping values ​​of even coefficients and odd coefficients in the target quantization coefficients are respectively a first value and a second value, wherein the first value and the second value are different.

[0234] In some embodiments, the first value is 1 and the second value is 0.

[0235] In some embodiments, the first value is 0 and the second value is 1.

[0236] In some embodiments, the first value is 2 and the second value is 3.

[0237] In some embodiments, mapping values ​​of zero coefficients and non-zero coefficients in the target quantized coefficients are third values ​​and fourth values, respectively, wherein the third value and the fourth value are different.

[0238] In some embodiments, the third value is 1 and the fourth value is 0.

[0239] In some embodiments, the third value is 0 and the fourth value is 1.

[0240] In some embodiments, the third value is 3 and the fourth value is 2.

[0241] In some embodiments, when the target flag bit includes multiple flag bits, the multiple flag bits are used to determine the values ​​of the target quantization coefficients in a target area, or the multiple flag bits are used to determine the values ​​of the target quantization coefficients in multiple target areas.

[0242] It should be understood that the video coding method of the embodiment of the present application can be applicable to a video codec or a video compression product using a sub-block transformation technology.

[0243] The following describes an apparatus embodiment of the present application, which can be used to execute the method described in the above embodiments of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above method embodiment of the present application.

[0244] Fig.10 A block diagram of a video decoding device according to an embodiment of the present application is shown. The video decoding device can be set in a device with a computing and processing function, such as a terminal device or a server.

[0245] Reference Fig.10 As shown, a video decoding device 900 according to an embodiment of the present application includes: an acquisition unit 910, a determination unit 920 and a decoding unit 930.

[0246] In some embodiments, the acquisition unit 910 is used to acquire a target quantization coefficient in a target area in the current block;

[0247] A determination unit 920, configured to determine a sub-block transformation mode corresponding to the current block according to a target quantization coefficient in a target area;

[0248] The decoding unit 930 is used to decode the current block according to the sub-block transformation mode corresponding to the current block.

[0249] In some embodiments, the sub-block transformation mode is represented by a size flag and a position flag, wherein the size flag is used to identify at least one of the horizontal size and the vertical size of the sub-block transformation, and the position flag is used to identify at least one of the horizontal position and the vertical position of the sub-block transformation.

[0250] In some embodiments, the determining unit 920 is further configured to:

[0251] Determine a target flag bit corresponding to the sub-block transform mode according to a target quantization coefficient in the target area, where the target flag bit includes at least one of a size flag bit and a position flag bit;

[0252] At least one of size information and position information of the sub-block transformation mode corresponding to the current block is determined according to the target flag corresponding to the sub-block transformation mode.

[0253] In some embodiments, the target area is the area where the current block is located; or,

[0254] The target area is the area where the non-zero coefficients in the current block are located.

[0255] In some embodiments, the target quantization coefficients include all quantization coefficients within the target area; or

[0256] The target quantization coefficient includes quantization coefficients at X preset positions within the target area, where X is a positive integer; or

[0257] The target quantization coefficients include M rows of quantization coefficients in the target area, where M is a positive integer; or

[0258] The target quantization coefficients include N columns of quantization coefficients in the target area, where N is a positive integer; or

[0259] The target quantization coefficients include P row quantization coefficients and Q column quantization coefficients in the target area, where P and Q are positive integers; or

[0260] The target quantization coefficients include quantization coefficients at K oblique line positions within the target area, where K is a positive integer; or

[0261] The target quantization coefficients include quantization coefficients at Y preset positions in the scanning order of the current block, where Y is a positive integer.

[0262] In some embodiments, the acquisition unit 910 is further used to: acquire at least one of a first index and a size of the current block, the first index being used to indicate whether to determine a sub-block transformation mode corresponding to the current block according to a target quantization coefficient.

[0263] In some embodiments, the determination unit 920 is further used to determine whether to determine a sub-block transformation mode corresponding to the current block according to a target quantization coefficient in a target area in the current block according to at least one of the first index and the size of the current block.

[0264] In some embodiments, the acquisition unit 910 is further configured to:

[0265] The first index is obtained from at least one of a sequence header corresponding to the current block, an image header corresponding to the current block, a slice header corresponding to the current block, and a maximum coding unit corresponding to the current block.

[0266] In some embodiments, the determining unit 920 is further configured to:

[0267] When the size of the current block is within a preset range, a sub-block transform mode corresponding to the current block is determined according to a target quantization coefficient in a target area in the current block.

[0268] In some embodiments, the determining unit 920 is further configured to:

[0269] Determine the statistical value of the target quantization coefficient within the target area;

[0270] According to the statistical value of the target quantization coefficient, the sub-block transformation mode corresponding to the current block is determined.

[0271] In some embodiments, the determining unit 920 is further configured to:

[0272] Sum all quantization coefficients included in the target quantization coefficient to obtain a statistical value of the target quantization coefficient; or

[0273] summing up the absolute value of each quantization coefficient among all quantization coefficients included in the target quantization coefficient to obtain a statistical value of the target quantization coefficient; or

[0274] Each quantization coefficient among all quantization coefficients included in the target quantization coefficient is mapped, and a statistical value of the target quantization coefficient is determined according to the mapping value of each quantization coefficient.

[0275] In some embodiments, the determining unit 920 is further configured to:

[0276] Mapping even coefficients and odd coefficients in the target quantized coefficients to a first value and a second value respectively, wherein the first value and the second value are different; or

[0277] The zero coefficients and the non-zero coefficients in the target quantized coefficients are mapped to a third value and a fourth value, respectively, wherein the third value and the fourth value are different.

[0278] In some embodiments, the first value is 1 and the second value is 0; or

[0279] The first value is 0 and the second value is 1; or

[0280] The first value is 2 and the second value is 3; or

[0281] The third value is 1 and the fourth value is 0; or

[0282] The third value is 0 and the fourth value is 1; or

[0283] The third value is 3 and the fourth value is 2.

[0284] In some embodiments, the determining unit 920 is further configured to:

[0285] Sum the mapping values ​​of each quantization coefficient to obtain the statistical value of the target quantization coefficient; or

[0286] The absolute values ​​of the mapping values ​​of each quantization coefficient are summed to obtain the statistical value of the target quantization coefficient.

[0287] In some embodiments, the determining unit 920 is further configured to:

[0288] The statistical value of the target quantization coefficient is modulo L, where L is a positive integer greater than 1;

[0289] The sub-block transform mode corresponding to the current block is determined according to the remainder result of the statistical value of the target quantization coefficient.

[0290] In some embodiments, the determining unit 920 is further configured to:

[0291] Determine, according to a remainder result of the statistical value of the target quantization coefficient and a first mapping relationship, a value of a target flag bit corresponding to the sub-block transform mode, wherein the target flag bit includes at least one of a size flag bit and a position flag bit, and the first mapping relationship is a mapping relationship between different state values ​​of the remainder result and a value of the target flag bit;

[0292] At least one of size information and position information of the sub-block transformation mode corresponding to the current block is determined according to the target flag corresponding to the sub-block transformation mode.

[0293] In some embodiments, the position flag includes at least one of the following flags:

[0294] The horizontal position flag is used to identify the horizontal position of the sub-block transformation;

[0295] The vertical position flag is used to identify the vertical position of the sub-block transformation.

[0296] In some embodiments, when the target flag bit includes multiple flag bits, the multiple flag bits are determined based on target quantization coefficients in the same target region, or the multiple flag bits are determined based on target quantization coefficients in multiple target regions.

[0297] Fig.11 A block diagram of a video encoding device according to an embodiment of the present application is shown. The video encoding device can be set in a device with a computing and processing function, such as a terminal device or a server.

[0298] Reference Fig.11 As shown, according to an embodiment of the present application, a video encoding device 1000 includes: a first determining unit 1010 and a second determining unit 1020. The first determining unit 1010 is used to determine a sub-block transform mode corresponding to a current block, and the second determining unit 1020 is used to determine a target quantization coefficient in a target area in the current block according to the sub-block transform mode corresponding to the current block.

[0299] In some embodiments of the present application, the target area is the area where the current block is located; or,

[0300] The target area is the area where the non-zero coefficients in the current block are located.

[0301] In some embodiments of the present application, the target quantization coefficient includes all quantization coefficients in the target area; or

[0302] The target quantization coefficient includes quantization coefficients at X preset positions within the target area, where X is a positive integer; or

[0303] The target quantization coefficients include M rows of quantization coefficients in the target area, where M is a positive integer; or

[0304] The target quantization coefficients include N columns of quantization coefficients in the target area, where N is a positive integer; or

[0305] The target quantization coefficients include P row quantization coefficients and Q column quantization coefficients in the target area, where P and Q are positive integers; or

[0306] The target quantization coefficients include quantization coefficients at K oblique line positions within the target area, where K is a positive integer; or

[0307] The target quantization coefficients include quantization coefficients at Y preset positions in the scanning order of the current block, where Y is a positive integer.

[0308] In some embodiments of the present application, the second determining unit 1020 is further configured to:

[0309] At least one of the sizes of the current block is determined, wherein the size of the current block is used to determine whether to determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient.

[0310] In some embodiments of the present application, the video encoding device 1000 further includes:

[0311] A coding unit, used to encode a first index into at least one of a sequence header corresponding to a current block, an image header corresponding to the current block, a slice header corresponding to the current block, and a maximum coding unit corresponding to the current block, wherein the first index is used to indicate whether a sub-block transformation mode corresponding to the current block is determined according to a target quantization coefficient.

[0312] In some embodiments of the present application, the second determining unit 1020 is further configured to:

[0313] Determine a target statistical value according to a target flag bit of a sub-block transformation mode corresponding to the current block;

[0314] According to the statistical rule of the target quantization coefficient, the value of the target quantization coefficient in the target area in the current block is adjusted so that the statistical value of the target quantization coefficient meets the target statistical value.

[0315] In some embodiments, the statistical value of the target quantization coefficient is the sum of all quantization coefficients included in the target quantization coefficient; or

[0316] The statistical value of the target quantization coefficient is the sum of the absolute values ​​of each quantization coefficient in all quantization coefficients included in the target quantization coefficient; or

[0317] The statistical value of the target quantization coefficient is a statistical value of a mapping value of each quantization coefficient among all quantization coefficients included in the target quantization coefficient.

[0318] In some embodiments, the mapping values ​​of the even coefficients and the odd coefficients in the target quantization coefficients are respectively a first value and a second value, wherein the first value and the second value are different; or

[0319] The mapping values ​​of the zero coefficient and the non-zero coefficient in the target quantization coefficient are respectively a third value and a fourth value, wherein the third value and the fourth value are different.

[0320] In some embodiments, the first value is 1 and the second value is 0; or

[0321] The first value is 0 and the second value is 1; or

[0322] The first value is 2 and the second value is 3; or

[0323] The third value is 1 and the fourth value is 0; or

[0324] The third value is 0 and the fourth value is 1; or

[0325] The third value is 3 and the fourth value is 2.

[0326] In some embodiments, the sub-block transformation mode is represented by a size flag and a position flag, wherein the size flag is used to identify at least one of the horizontal size and the vertical size of the sub-block transformation, and the position flag is used to identify at least one of the horizontal position and the vertical position of the sub-block transformation.

[0327] In some embodiments of the present application, the second determining unit 1020 is further configured to:

[0328] According to the target flag bit corresponding to the sub-block transform mode, a target quantization coefficient in a target area in the current block is determined, wherein the target flag bit includes at least one of a size flag bit and a position flag bit.

[0329] In some embodiments, the position flag includes at least one of the following flags:

[0330] The horizontal position flag is used to identify the horizontal position of the sub-block transformation;

[0331] The vertical position flag is used to identify the vertical position of the sub-block transformation.

[0332] In some embodiments, when the target flag bit includes multiple flag bits, the multiple flag bits are used to determine the target quantization coefficients in one target region, or the multiple flag bits are used to determine the target quantization coefficients in multiple target regions.

[0333] Fig.12 11 is a schematic block diagram of an electronic device 1100 provided in an embodiment of the present application. The electronic device may be the video encoding device or the video decoding device mentioned above.

[0334] like Fig.12 As shown, the electronic device 1100 may include:

[0335] The memory 1110 and the processor 1120, the memory 1110 is used to store the computer program and transmit the program code to the processor 1120. In other words, the processor 1120 can call and run the computer program from the memory 1110 to implement the method in the embodiment of the present application.

[0336] In one embodiment of the present application, the processor 1120 is used to:

[0337] Obtain target quantization coefficients in a target area in the current block;

[0338] Determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient in the target area;

[0339] The current block is decoded according to the sub-block transformation mode corresponding to the current block.

[0340] In another embodiment of the present application, the processor 1120 is used to:

[0341] Determine a sub-block transformation mode corresponding to the current block;

[0342] According to the sub-block transformation mode corresponding to the current block, a target quantization coefficient in a target area in the current block is determined.

[0343] In some embodiments of the present application, the processor 1120 may include but is not limited to:

[0344] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0345] In some embodiments of the present application, the memory 1110 includes but is not limited to:

[0346] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0347] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 1110 and executed by the processor 1120 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0348] like Fig.12 As shown, the electronic device 1100 may further include:

[0349] The transceiver 1130 may be connected to the processor 1120 or the memory 1110 .

[0350] The processor 1120 may control the transceiver 1130 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 1130 may include a transmitter and a receiver. The transceiver 1130 may further include an antenna, and the number of antennas may be one or more.

[0351] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0352] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0353] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0354] It is understandable that in the specific implementation of the present application, when the above embodiments of the present application are applied to specific products or technologies and involve relevant data such as user information, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards.

[0355] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0356] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0357] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0358] The above contents are only specific implementation methods of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be included in the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be based on the protection scope of the claims.

[0359] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A video decoding method, characterized in that: include: Obtain target quantization coefficients in a target area in the current block; Determining a sub-block transform mode corresponding to the current block according to a target quantization coefficient in the target area; The current block is decoded according to the sub-block transformation mode corresponding to the current block.

2. The method according to claim 1, characterized in that The target area is the area where all coefficients in the current block are located; or, The target area is an area where non-zero coefficients in the current block are located.

3. The method according to claim 1, characterized in that The target quantization coefficients include all quantization coefficients within the target area; or The target quantization coefficient includes quantization coefficients at X preset positions within the target area, where X is a positive integer; or The target quantization coefficients include M rows of quantization coefficients in the target area, where M is a positive integer; or The target quantization coefficients include N columns of quantization coefficients in the target area, where N is a positive integer; or The target quantization coefficients include P row quantization coefficients and Q column quantization coefficients in the target area, where P and Q are positive integers; or The target quantization coefficients include quantization coefficients at K oblique line positions within the target area, where K is a positive integer; or The target quantization coefficients include quantization coefficients at Y preset positions in the scanning order of the current block, where Y is a positive integer.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Obtain at least one of a first index and a size of the current block, wherein the first index is used to indicate whether to determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient; According to at least one of the first index and the size of the current block, it is determined whether to determine a sub-block transform mode corresponding to the current block according to a target quantization coefficient in a target area in the current block.

5. The method according to claim 4, characterized in that The obtaining of the first index comprises: The first index is obtained from at least one of a sequence header corresponding to the current block, an image header corresponding to the current block, a slice header corresponding to the current block, and a maximum coding unit corresponding to the current block.

6. The method according to claim 4, characterized in that The determining, according to the size of the current block, whether to determine the sub-block transform mode corresponding to the current block according to the target quantization coefficient in the target area in the current block comprises: In a case where the size of the current block is within a preset range, a sub-block transform mode corresponding to the current block is determined according to a target quantization coefficient in a target area in the current block.

7. The method according to any one of claims 1 to 3, characterized in that The determining, according to the target quantization coefficient in the target area, a sub-block transformation mode corresponding to the current block comprises: Determine the statistical value of the target quantization coefficient within the target area; A sub-block transformation mode corresponding to the current block is determined according to the statistical value of the target quantization coefficient.

8. The method according to claim 7, characterized in that The determining of the statistical value of the target quantization coefficient within the target area includes: summing up all quantization coefficients included in the target quantization coefficient to obtain a statistical value of the target quantization coefficient; or summing up the absolute value of each quantization coefficient in all quantization coefficients included in the target quantization coefficient to obtain a statistical value of the target quantization coefficient; or Each quantization coefficient among all quantization coefficients included in the target quantization coefficient is mapped, and a statistical value of the target quantization coefficient is determined according to the mapping value of each quantization coefficient.

9. The method according to claim 8, characterized in that The mapping process of each quantization coefficient among all quantization coefficients included in the target quantization coefficient comprises: Mapping even coefficients and odd coefficients in the target quantization coefficients to a first value and a second value respectively, wherein the first value and the second value are different; or The zero coefficients and non-zero coefficients in the target quantization coefficients are mapped to a third value and a fourth value respectively, wherein the third value and the fourth value are different.

10. The method according to claim 9, characterized in that The first value is 1, and the second value is 0; or The first value is 0, and the second value is 1; or The first value is 2, and the second value is 3; or The third value is 1, and the fourth value is 0; or The third value is 0, and the fourth value is 1; or The third value is 3, and the fourth value is 2.

11. The method according to any one of claims 8 to 10, characterized in that: The determining the statistical value of the target quantization coefficient according to the mapping value of each quantization coefficient includes: Sum the mapping values ​​of each quantization coefficient to obtain a statistical value of the target quantization coefficient; or The absolute values ​​of the mapping values ​​of each quantization coefficient are summed to obtain the statistical value of the target quantization coefficient.

12. The method according to any one of claims 1 to 3, characterized in that The determining, according to the statistical value of the target coefficient, a sub-block transform mode corresponding to the current block includes: Calculate the modulus of the statistical value of the target quantization coefficient with respect to L, where L is a positive integer greater than 1; The sub-block transformation mode corresponding to the current block is determined according to the remainder result of the statistical value of the target quantization coefficient.

13. The method according to claim 12, characterized in that The sub-block transformation mode is represented by a size flag and a position flag, wherein the size flag is used to identify at least one of a horizontal size and a vertical size of the sub-block transformation, and the position flag is used to identify at least one of a horizontal position and a vertical position of the sub-block transformation; The determining of the sub-block transform mode corresponding to the current block according to the remainder result of the statistical value of the target quantization coefficient includes: Determine, according to a remainder result of the statistical value of the target quantization coefficient and a first mapping relationship, a value of a target flag bit corresponding to the sub-block transform mode, wherein the target flag bit includes at least one of the size flag bit and the position flag bit, and the first mapping relationship is a mapping relationship between different state values ​​of the remainder result and the value of the target flag bit; At least one of size information and position information of the sub-block transformation mode corresponding to the current block is determined according to the value of the target flag bit corresponding to the sub-block transformation mode.

14. The method according to claim 13, characterized in that The position flag includes at least one of the following flags: The horizontal position flag is used to identify the horizontal position of the sub-block transformation; The vertical position flag is used to identify the vertical position of the sub-block transformation.

15. The method according to claim 13 or 14, characterized in that In the case where the target flag bit includes a plurality of flag bits, the plurality of flag bits are determined based on target quantization coefficients in the same target region, or the plurality of flag bits are determined based on target quantization coefficients in a plurality of target regions.

16. A video encoding method, characterized in that: include: Determine a sub-block transformation mode corresponding to the current block; According to the sub-block transformation mode corresponding to the current block, a target quantization coefficient in a target area in the current block is determined.

17. A video decoding device, characterized in that: include: An acquisition unit, used for acquiring a target quantization coefficient in a target area in a current block; A determination unit, configured to determine a sub-block transformation mode corresponding to the current block according to a target quantization coefficient in the target area; The decoding unit is used to decode the current block according to the sub-block transformation mode corresponding to the current block.

18. A video encoding device, characterized in that: include: A first determining unit, configured to determine a sub-block transformation mode corresponding to a current block; The second determining unit is used to determine a target quantization coefficient in a target area in the current block according to a sub-block transformation mode corresponding to the current block.

19. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the video decoding method as described in any one of claims 1 to 15, or implement the video encoding method as described in claim 16.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that: 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 implements the video encoding method according to claim 16.