Video coding and decoding method and device, computer readable medium and electronic equipment
By dividing the coding block into sub-blocks and selecting an appropriate transformation mode, the problem of inflexible sub-block transformation in the existing technology is solved, and the coding and decoding efficiency and performance are improved.
Patent Information
- Application Number
- CN202310428833.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2024-10-18
AI Technical Summary
Existing sub-block transformation technology is not flexible enough to handle a variety of residual distribution situations, which affects encoding and decoding efficiency.
By further dividing the sub-blocks obtained by dividing the coding block, it can adapt to various residual distribution situations, adopt different transformation modes and quantization processing, including entropy decoding, inverse quantization and inverse transformation processing, and select appropriate transformation modes such as DCT2 and DCT5. , DCT8, DST1, DST7 and transform skip modes.
The performance of sub-block transformation and encoding and decoding efficiency are improved, and the adaptability to various residual distributions is enhanced.
Smart Images

Figure CN118803237A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a video encoding and decoding method, device, computer-readable medium and electronic device. Background Art
[0002] In relevant audio and video standards, the sub-block transform (SBT) technology divides the coding block into multiple sub-blocks in a certain way for encoding and decoding. However, the division model proposed by the sub-block transform technology in the relevant technology is not flexible enough and cannot effectively handle a variety of residual distribution situations, which will affect the encoding and decoding efficiency to a certain extent. Summary of the invention
[0003] The embodiments of the present application provide a video encoding and decoding method, device, computer-readable medium and electronic device, which can further divide the sub-blocks obtained by dividing the coding block to adapt to a variety of residual distribution situations, thereby improving the performance of sub-block transformation, which is beneficial to improving the encoding and decoding performance.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a video decoding method is provided, comprising: obtaining block division information corresponding to a coding block to be decoded, the block division information including information of a target sub-block that needs to be entropy decoded; decoding from a bitstream to obtain information of at least one transform sub-block obtained by dividing the target sub-block; performing entropy decoding and inverse quantization processing based on the information of the at least one transform sub-block to obtain an inverse quantization coefficient sub-block corresponding to the at least one transform sub-block; performing inverse transform processing on the inverse quantization coefficient sub-block corresponding to the at least one transform sub-block, and generating a reconstructed residual corresponding to the coding block according to the inverse transform processing result.
[0006] According to one aspect of an embodiment of the present application, a video encoding method is provided, including: obtaining a residual block corresponding to a current block to be encoded; determining corresponding block division information based on the residual block, wherein the block division information includes information of a target sub-block that needs to be entropy encoded; dividing the target sub-block to obtain at least one transform sub-block; transforming and quantizing the at least one transform sub-block to obtain a quantization coefficient block, so as to perform encoding processing based on the quantization coefficient block.
[0007] According to one aspect of an embodiment of the present application, a video decoding device is provided, comprising: an acquisition unit, configured to acquire block division information corresponding to a coding block to be decoded, wherein the block division information includes information of a target sub-block that needs to be entropy decoded; a decoding unit, configured to decode from a bitstream to obtain information of at least one transform sub-block obtained by dividing the target sub-block, and perform entropy decoding and inverse quantization processing based on the information of the at least one transform sub-block to obtain an inverse quantization coefficient sub-block corresponding to the at least one transform sub-block; a processing unit, configured to perform inverse transform processing on the inverse quantization coefficient sub-block corresponding to the at least one transform sub-block, and generate a reconstructed residual corresponding to the coding block according to the inverse transform processing result.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the information of the target sub-block includes width information and height information of the target sub-block; the width information of the target sub-block includes a first ratio of the width of the target sub-block to the width of the coding block; the height information of the target sub-block includes a second ratio of the height of the target sub-block to the height of the coding block.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the numerical value of the first ratio and the numerical value of the second ratio are respectively any one of the following: 1, 1 / 4, 1 / 2, 3 / 4, 1 / 8.
[0010] In some embodiments of the present application, based on the aforementioned solution, the width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or
[0011] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or
[0012] The width of the target sub-block is equal to the coding block width, and the height of the target sub-block is 3 / 4 of the coding block height; or
[0013] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is equal to the height of the coding block; or
[0014] The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 2 of the height of the coding block; or
[0015] The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or
[0016] The width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or
[0017] The width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or
[0018] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or
[0019] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 2 of the height of the coding block.
[0020] In some embodiments of the present application, based on the aforementioned solution, the information of the target sub-block further includes position information of the target sub-block, and the position information is used to indicate the position of the target sub-block in the coding block.
[0021] In some embodiments of the present application, based on the aforementioned scheme, the position of the target sub-block in the coding block includes any one of the following: the upper left corner of the coding block, the upper right corner of the coding block, the lower left corner of the coding block, the lower right corner of the coding block, above the coding block, below the coding block, to the left of the coding block, and to the right of the coding block.
[0022] In some embodiments of the present application, based on the above scheme, the size of the transform sub-block obtained by dividing the target sub-block satisfies the following condition: at least one of the height and width of the transform sub-block is an integer power of 2.
[0023] In some embodiments of the present application, based on the aforementioned scheme:
[0024] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 4 transform sub-blocks;
[0025] If the width of the target sub-block is equal to the coding block width, and the height of the target sub-block is 3 / 4 of the coding block height, the target sub-block is divided into 3 transform sub-blocks in the height direction;
[0026] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is equal to the height of the coding block, the target sub-block is divided into 3 transform sub-blocks in the width direction;
[0027] If the width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction;
[0028] If the width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction;
[0029] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction;
[0030] If the width of the target sub-block is 3 / 4 of the width of the coding block and the height of the target sub-block is 1 / 2 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction.
[0031] In some embodiments of the present application, based on the aforementioned scheme, the processing unit is configured to: select a horizontal transform mode and a vertical transform mode corresponding to each of the dequantization coefficient sub-blocks from the set transform mode, the set transform mode including: DCT2, DCT5, DCT8, DST1, DST7 and transform skip mode; perform inverse transform processing on each of the dequantization coefficient sub-blocks according to the horizontal transform mode and the vertical transform mode corresponding to each of the dequantization coefficient sub-blocks.
[0032] In some embodiments of the present application, based on the aforementioned scheme, the processing unit is further configured as: if there is a first dequantization coefficient sub-block with a width greater than a set threshold in the dequantization coefficient sub-block corresponding to the at least one transform sub-block, the horizontal transform mode of the first dequantization coefficient sub-block is replaced with a DCT2 transform mode; if there is a second dequantization coefficient sub-block with a height greater than a set threshold in the dequantization coefficient sub-block corresponding to the at least one transform sub-block, the vertical transform mode of the second dequantization coefficient sub-block is replaced with a DCT2 transform mode.
[0033] According to one aspect of an embodiment of the present application, a video encoding device is provided, including: an acquisition unit, configured to acquire a residual block corresponding to a current block to be encoded; a determination unit, configured to determine corresponding block division information according to the residual block, wherein the block division information includes information of a target sub-block that needs to be entropy encoded; a division unit, configured to divide the target sub-block to obtain at least one transform sub-block; and an encoding unit, configured to perform transform processing and quantization processing on the at least one transform sub-block to obtain a quantization coefficient block, so as to perform encoding processing based on the quantization coefficient block.
[0034] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the video decoding method or the video encoding method as described in the above embodiments is implemented.
[0035] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the electronic device implements the video decoding method or the video encoding method as described in the above embodiments.
[0036] According to one aspect of an embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the video decoding method or the video encoding method provided in the above-mentioned various optional embodiments.
[0037] In the technical solutions provided in some embodiments of the present application, the block division information corresponding to the coding block to be decoded is obtained to determine the information of the target sub-block that needs to be entropy decoded, and then the information of at least one transformed sub-block obtained by dividing the target sub-block is obtained by decoding from the bitstream, and then entropy decoding and inverse quantization processing are performed based on the information of at least one transformed sub-block to obtain the inverse quantization coefficient sub-block corresponding to the at least one transformed sub-block, and the inverse quantization coefficient sub-block corresponding to the at least one transformed sub-block is inversely transformed to generate the reconstructed residual corresponding to the coding block according to the inverse transformation processing result, so that the sub-blocks obtained by dividing the coding block can be further divided to adapt to a variety of residual distribution situations, thereby improving the performance of sub-block transformation, which is conducive to improving the encoding and decoding performance.
[0038] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0040] Figure 2 A schematic diagram showing the placement of a video encoding device and a video decoding device in a streaming transmission system;
[0041] Figure 3 shows a basic flow chart of a video encoder;
[0042] Figure 4 A schematic diagram of the division of SBT is shown;
[0043] Figure 5 A combined schematic diagram of the transformation mode in SBT is shown;
[0044] Figure 6A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0045] Figure 7 A flowchart of a video encoding method according to an embodiment of the present application is shown;
[0046] FIG. 8A to FIG. 8J A schematic diagram of a sub-block division method according to an embodiment of the present application is shown;
[0047] Fig. 9A FIG. 9J shows a combined schematic diagram of a transform mode of a transform block according to an embodiment of the present application;
[0048] Fig.10 A block diagram of a video decoding device according to an embodiment of the present application is shown;
[0049] Fig.11 A block diagram of a video encoding device according to an embodiment of the present application is shown;
[0050] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] The exemplary embodiments are now described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be understood as being limited to these examples; on the contrary, the purpose of providing these embodiments is to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0052] In addition, the features, structures or characteristics described in the present application may be combined in one or more embodiments in any suitable manner. In the following description, there are many specific details so that the embodiments of the present application can be fully understood. However, those skilled in the art will appreciate that when implementing the technical scheme of the present application, all the detailed features in the embodiments may not be needed, one or more specific details may be omitted, or other methods, elements, devices, steps, etc. may be adopted.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0057] like Figure 1 As shown, the system architecture 100 includes a plurality of terminal devices, which can communicate with each other through, for example, a network 150. For example, the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected through the network 150. Figure 1 In the embodiment of the present invention, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0058] For example, the first terminal device 110 may encode video data (e.g., a video picture stream captured by the terminal device 110) for transmission to the second terminal device 120 via the network 150. The encoded video data is transmitted in the form of one or more encoded video code streams. The second terminal device 120 may receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display the video picture based on the restored video data.
[0059] In one embodiment of the present application, the system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, which may occur during a video conference, for example. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video picture stream collected by the terminal device) to transmit to the other terminal device of the third terminal device 130 and the fourth terminal device 140 through the network 150. Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded video data transmitted by the other terminal device of the third terminal device 130 and the fourth terminal device 140, and may decode the encoded video data to restore the video data, and may display the video picture on an accessible display device according to the restored video data.
[0060] exist Figure 1 In the illustrated embodiment, the first terminal device 110 , the second terminal device 120 , the third terminal device 130 , and the fourth terminal device 140 may be servers or terminals, but the principles disclosed in the present application may not be limited thereto.
[0061] The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart voice interaction device, smart watch, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these.
[0062] Figure 1 The network 150 shown in the figure represents any number of networks for transmitting the encoded video data between the first terminal device 110, the second terminal device 120, the third terminal device 130 and the fourth terminal device 140, including, for example, wired and / or wireless communication networks. The communication network 150 can 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. For the purposes of this application, unless explained below, the architecture and topology of the network 150 may be irrelevant to the operation disclosed in this application.
[0063] In one embodiment of the present application, Figure 2 The placement of the video encoding device and the video decoding device in the streaming environment is shown. The subject matter disclosed in the present application can be equally applicable to other video-supported applications, including, for example, video conferencing, digital TV (television), storing compressed video on digital media including CD, DVD, memory stick, etc.
[0064] The streaming system may include an acquisition subsystem 213, which may include a video source 201 such as a digital camera, which creates an uncompressed video picture stream 202. In an embodiment, the video picture stream 202 includes samples taken by a digital camera. The video picture stream 202 is depicted as a thick line to emphasize the high data volume of the video picture stream compared to the encoded video data 204 (or the encoded video code stream 204), and the video picture stream 202 can be processed by an electronic device 220, which includes a video encoding device 203 coupled to the video source 201. The video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the disclosed subject matter as described in more detail below. Compared to the video picture stream 202, the encoded video data 204 (or the encoded video code stream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or the encoded video code stream 204), which can be stored on the streaming server 205 for future use. One or more streaming client subsystems, such as Figure 2 , can access the streaming server 205 to retrieve the copies 207 and 209 of the encoded video data 204. The client subsystem 206 can include, for example, a video decoding device 210 in the electronic device 230. The video decoding device 210 decodes the incoming copy 207 of the encoded video data and generates an output video picture stream 211 that can be presented on a display 212 (e.g., a display screen) or another presentation device. In some streaming systems, the encoded video data 204, the video data 207, and the video data 209 (e.g., video bitstreams) can be encoded according to certain video encoding / compression standards.
[0065] It should be noted that the electronic device 220 and the electronic device 230 may include other components not shown in the figure. For example, the electronic device 220 may include a video decoding device, and the electronic device 230 may also include a video encoding device.
[0066] In one embodiment of the present application, taking the international video coding standards HEVC (High Efficiency Video Coding), VVC (Versatile Video Coding), and China's national video coding standard AVS as examples, after a video frame image is input, the video frame image will be divided into several non-overlapping processing units according to a block size, and each processing unit will perform similar compression operations. This processing unit is called CTU (Coding Tree Unit), or LCU (Largest Coding Unit). CTU can continue to be divided more finely to obtain one or more basic coding units CU (Coding Unit), which is the most basic element in a coding link.
[0067] In another embodiment, this processing unit may also be referred to as a coding tile, which is a rectangular area of a multimedia data frame that can be independently decoded and encoded. In the AV1 standard, the coding tile can be further divided into more refined parts to obtain one or more maximum coding blocks (Superblock, SB for short). SB is the starting point of block division and can be further divided into multiple sub-blocks. Then the maximum coding block is further divided to obtain one or more blocks. Each block is the most basic element in a coding link. Optionally, an SB can contain several Bs.
[0068] The above division method of video frame images can be called block partition structure. The following introduces some concepts in the encoding process:
[0069] Predictive Coding: Predictive coding includes intra-frame prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain the residual video signal. The encoder needs to decide which predictive coding mode to select for the current coding unit (or coding block) and inform the decoder. Intra-frame prediction means that the predicted signal comes from the area that has been encoded and reconstructed in the same image; inter-frame prediction means that the predicted signal comes from other images that have been encoded and different from the current image (called reference images).
[0070] Transform & Quantization: After the residual video signal is transformed by DFT (Discrete Fourier Transform), DCT (Discrete Cosine Transform), etc., the signal is converted into the transform domain, which is called the transform coefficient. The transform coefficient is further subjected to lossy quantization operation, which loses a certain amount of 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, so the encoder also needs to select one of the transform methods for the current coding unit (or coding block) and inform the decoder. The degree of quantization is usually determined by the quantization parameter (Quantization Parameter, referred to as 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.
[0071] 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 output as a binary (0 or 1) compressed bit stream. 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 (CABAC).
[0072] The CABAC process mainly includes three steps: binarization, context modeling, and binary arithmetic coding. After the input syntax elements are binarized, the binary data can be encoded through the conventional coding mode and the bypass coding mode. The bypass coding mode does not need to assign a specific probability model to each binary bit. The input binary bit bin value is directly encoded with a simple bypass encoder to speed up the entire encoding and decoding. In general, different syntax elements are not completely independent, and the same syntax element itself has a certain memory. Therefore, according to the conditional entropy theory, conditional encoding using other encoded syntax elements can further improve the encoding performance compared to independent encoding or memoryless encoding. These encoded symbol information used as conditions are called context. In the conventional coding mode, the binary bits of the syntax elements enter the context modeler sequentially. The encoder assigns a suitable probability model to each input binary bit according to the value of the previously encoded syntax element or binary bit. This process is called context modeling. The context model corresponding to the syntax element can be located through ctxIdxInc (context index increment) and ctxIdxStart (context index Start). After the bin value and the assigned probability model are sent to the binary arithmetic encoder for encoding, the context model needs to be updated according to the bin value, which is the adaptive process in encoding.
[0073] Loop Filtering: The changed and quantized signal will be reconstructed through inverse quantization, inverse transformation and prediction compensation operations to obtain a reconstructed image. Compared with the original image, due to the influence of quantization, some information of the reconstructed image is different from the original image, that is, the reconstructed image will produce distortion. Therefore, the reconstructed image can be filtered, such as deblocking filter (DB), SAO (Sample Adaptive Offset) or ALF (Adaptive Loop Filter) and other filters, 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 to predict future image signals, the above filtering operation is also called loop filtering, that is, filtering operation within the encoding loop.
[0074] In one embodiment of the present application, Figure 3 The basic flow chart of a video encoder is shown in FIG. 1 , in which intra-frame prediction is used as an example for explanation. In which the original image signal sk [x,y] and predicted image signal Perform difference operation to obtain the residual signal u k [x,y], residual signal u k [x,y] is transformed and quantized to obtain the 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 reconstructed 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 continue to repeat the above process until the encoding is completed.
[0075] Based on the above encoding process, at the decoding end, for each coding unit (or coding block), after obtaining the compressed code stream (i.e., bit stream), entropy decoding is performed to obtain various mode information and quantization coefficients. The quantization coefficients are then dequantized and inversely transformed to obtain a residual signal. On the other hand, based on the known coding mode information, the prediction signal corresponding to the coding unit (or coding block) 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.
[0076] In the aforementioned encoding process, since the prediction method has a large error, it is necessary to transmit the residual signal 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. Figure 3 In the process shown, the residual signal is the difference between the original image signal and the predicted image signal, that is, In video coding standards such as HEVC, VVC and AVS3, the above-mentioned transformation (or transformation skipping), quantization processing, etc. are performed on the residual signal.
[0077] Among them, the transform processing mainly utilizes the correlation of the residual signal, and concentrates the energy of the residual signal through the transform, so that the energy is concentrated in fewer low-frequency coefficients, that is, most coefficient values are small. After the subsequent quantization module, the smaller coefficient value will become zero, which greatly reduces the cost of coding residuals. Due to the diversity of residual signal distribution, a single DCT cannot adapt to all residual characteristics, so transform kernels such as DST7 and DCT8 are introduced into the transform module, and different transform kernels can be used for horizontal transform and vertical transform. Taking AMT (Adaptive Multiple core Transform) technology as an example, the transform combinations that may be selected for a residual block include: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8), (DST7, DST7). For which transform combination to select for a residual block, it is necessary to use RDO (Rate-distortion optimization) at the encoding end to make a decision. There are also some residual signals that have weak correlation, so skipping the transformation will lead to higher coding efficiency, that is, skipping the transformation process of the residual and directly quantizing the residual.
[0078] When performing transform coding, there is a sub-block transform SBT technology. Figure 4 The following are 12 modes corresponding to SBT. The width and height of the coding block are W and H respectively. The sub-block size is 1, 1 / 2 or 1 / 4 of the corresponding size of the coding block. Figure 4 The gray part in the image is transformed and coded, while the other parts are forcibly cleared to zero, and the gray blocks are not further divided and directly transformed and quantized.
[0079] Figure 4 The transformation combinations corresponding to the 12 sub-block partitioning modes shown in (i.e., the combination of horizontal transformation and vertical transformation) are as follows: Figure 5 As shown. For example, for mode a, the width of the sub-block is equal to the width W of the coding block, and the height of the sub-block is equal to 1 / 2 of the coding block height, that is, H / 2. The corresponding transform combination is DST7 for horizontal transform and DCT8 for vertical transform. Accordingly, at the decoding end, only the coefficients of the gray area need to be decoded, and then inverse quantized and inverse transformed, while the residuals of other areas are set to zero by default.
[0080] However, the division mode of the SBT technology mentioned in the above scheme is not flexible enough and cannot effectively handle a variety of residual distribution situations, which will affect the encoding and decoding efficiency to a certain extent. Based on this, the embodiment of the present application proposes a new video encoding and decoding scheme, which can further divide the sub-blocks obtained by dividing the coding block to adapt to a variety of residual distribution situations, thereby improving the performance of sub-block transformation and helping to improve the encoding and decoding performance.
[0081] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0082] Figure 6 A flowchart of a video decoding method according to an embodiment of the present application is shown. The video decoding method can be executed by a device with a computing and processing function, such as a terminal device or a server. Figure 6 As shown, the video decoding method at least includes the following steps S610 to S640, which are described in detail as follows:
[0083] In step S610, block division information corresponding to the coding block to be decoded is obtained, and the block division information includes information of a target sub-block that needs to be entropy decoded.
[0084] In one embodiment of the present application, a video image frame sequence includes a series of images, each of which can be further divided into slices, which can be further divided into a series of LCUs (or CTUs), and the LCU contains several CUs. When encoding, the video image frame is encoded in blocks. In some new video coding standards, such as the H.264 standard, there are macroblocks (MB), which can be further divided into multiple prediction blocks (prediction) that can be used for predictive coding. In other standards, such as HEVC, basic concepts such as coding units CU, prediction units (PU) and transform units (TU) are used to functionally divide multiple block units and describe them using a new tree-based structure. For example, CU can be divided into smaller CUs according to a quadtree, and the smaller CU can be further divided to form a quadtree structure. The coding block in the embodiment of the present application can be a CU, or a smaller block than a CU, such as a smaller block obtained by dividing a CU.
[0085] In some optional embodiments, the decoding end can obtain block division information from the bitstream, and the block division information includes information about the target sub-block obtained by dividing the coding block to be decoded, such as the information about the target sub-block including the width information and height information of the target sub-block. Among them, the width information of the target sub-block includes the first ratio of the width of the target sub-block to the width of the coding block; the height information of the target sub-block includes the second ratio of the height of the target sub-block to the height of the coding block. Optionally, the value of the first ratio and the value of the second ratio are any of the following: 1, 1 / 4, 1 / 2, 3 / 4, 1 / 8.
[0086] In one embodiment, the width of the target sub-block may be 1 / 4 of the width of the coding block, and the height of the target sub-block may be 1 / 4 of the height of the coding block.
[0087] In one embodiment, the width of the target sub-block may be 3 / 4 of the width of the coding block, and the height of the target sub-block may be 3 / 4 of the height of the coding block.
[0088] In one embodiment, the width of the target sub-block may be equal to the coding block width, and the height of the target sub-block may be 3 / 4 of the coding block height.
[0089] In one embodiment, the width of the target sub-block may be ¾ of the width of the coding block, and the height of the target sub-block may be equal to the height of the coding block.
[0090] In one embodiment, the width of the target sub-block may be 1 / 4 of the width of the coding block, and the height of the target sub-block may be 1 / 2 of the height of the coding block.
[0091] In one embodiment, the width of the target sub-block may be 1 / 4 of the width of the coding block, and the height of the target sub-block may be 3 / 4 of the height of the coding block.
[0092] In one embodiment, the width of the target sub-block may be 1 / 2 of the width of the coding block, and the height of the target sub-block may be 1 / 4 of the height of the coding block.
[0093] In one embodiment, the width of the target sub-block may be 1 / 2 of the width of the coding block, and the height of the target sub-block may be 3 / 4 of the height of the coding block.
[0094] In one embodiment, the width of the target sub-block may be 3 / 4 of the width of the coding block, and the height of the target sub-block may be 1 / 4 of the height of the coding block.
[0095] In one embodiment, the width of the target sub-block may be 3 / 4 of the width of the coding block, and the height of the target sub-block may be 1 / 2 of the height of the coding block.
[0096] In some optional embodiments, the information of the target sub-block may further include position information of the target sub-block, and the position information is used to indicate the position of the target sub-block in the coding block. For example, the position of the target sub-block in the coding block includes any of the following: the upper left corner of the coding block, the upper right corner of the coding block, the lower left corner of the coding block, the lower right corner of the coding block, the top of the coding block, the bottom of the coding block, the left of the coding block, and the right of the coding block.
[0097] In step S620, information of at least one transformed sub-block obtained by dividing the target sub-block is obtained by decoding the bitstream.
[0098] In the embodiment of the present application, the target sub-block obtained by dividing the coding block can be further divided, such as divided into smaller transform sub-blocks, to adapt to various residual distribution situations. Of course, the target sub-block can also be divided into only one transform sub-block, that is, the target sub-block is not divided.
[0099] In some optional embodiments, if the target sub-block is further divided to obtain a transform sub-block, the size of the transform sub-block obtained by dividing the target sub-block may satisfy the following condition: at least one of the height and width of the transform sub-block is an integer power of 2, which can reduce the hardware implementation cost.
[0100] Based on the above conditions, if the width of the target sub-block is 3 / 4 of the width of the coding block and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 4 transform sub-blocks. Optionally, the width of the first transform sub-block among the 4 transform sub-blocks is 1 / 2 of the width of the coding block and the height is 1 / 2 of the height of the coding block; the width of the second transform sub-block is 1 / 4 of the width of the coding block and the height is 1 / 2 of the height of the coding block; the width of the third transform sub-block is 1 / 2 of the width of the coding block and the height is 1 / 4 of the height of the coding block; the width of the fourth transform sub-block is 1 / 4 of the width of the coding block and the height is 1 / 4 of the height of the coding block.
[0101] If the width of the target sub-block is equal to the coding block width and the height of the target sub-block is 3 / 4 of the coding block height, the target sub-block is divided into 3 transform sub-blocks in the height direction. Optionally, the width of these 3 transform sub-blocks is the same as the width of the coding block and the height is 1 / 4 of the coding block height.
[0102] If the width of the target sub-block is 3 / 4 of the coding block width and the height of the target sub-block is equal to the coding block height, the target sub-block is divided into 3 transform sub-blocks in the width direction. Optionally, the height of these 3 transform sub-blocks is the same as the height of the coding block and the width is 1 / 4 of the coding block width.
[0103] If the width of the target sub-block is 1 / 4 of the width of the coding block and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction. Optionally, the width of the first transform sub-block is 1 / 4 of the width of the coding block and the height is 1 / 2 of the height of the coding block; the width of the second transform sub-block is 1 / 4 of the width of the coding block and the height is 1 / 4 of the height of the coding block.
[0104] If the width of the target sub-block is 1 / 2 of the coding block width and the height of the target sub-block is 3 / 4 of the coding block height, the target sub-block is divided into 2 transform sub-blocks in the height direction. Optionally, the width of the first transform sub-block is 1 / 2 of the coding block width and the height is 1 / 2 of the coding block height; the width of the second transform sub-block is 1 / 2 of the coding block width and the height is 1 / 4 of the coding block height.
[0105] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction. Optionally, the width of the first transform sub-block is 1 / 2 of the width of the coding block, and the height is 1 / 4 of the height of the coding block; the width of the second transform sub-block is 1 / 4 of the width of the coding block, and the height is 1 / 4 of the height of the coding block.
[0106] If the width of the target sub-block is 3 / 4 of the width of the coding block and the height of the target sub-block is 1 / 2 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction. Optionally, the width of the first transform sub-block is 1 / 2 of the width of the coding block and the height is 1 / 2 of the height of the coding block; the width of the second transform sub-block is 1 / 4 of the width of the coding block and the height is 1 / 2 of the height of the coding block.
[0107] In step S630, entropy decoding and inverse quantization processing are performed based on information of at least one transformed sub-block to obtain an inverse quantization coefficient sub-block corresponding to the at least one transformed sub-block.
[0108] In an embodiment of the present application, after determining the information of the transform sub-block, entropy decoding and inverse quantization processing can be performed according to the information of the transform sub-block, thereby obtaining the inverse quantization coefficient sub-block corresponding to each transform sub-block. Optionally, the information of the transform sub-block may also include the width of the transform sub-block, the height of the transform sub-block, the position information of the transform sub-block, etc.
[0109] In step S640, an inverse transform process is performed on the inverse quantized coefficient sub-block corresponding to at least one transform sub-block, and a reconstructed residual corresponding to the coding block is generated according to the inverse transform process result.
[0110] In some optional embodiments, the inverse transform processing is performed on the inverse quantization coefficient sub-block corresponding to at least one transform sub-block, including: selecting the horizontal transform mode and the vertical transform mode corresponding to each inverse quantization coefficient sub-block from the set transform mode, and the set transform mode includes: DCT2, DCT5, DCT8, DST1, DST7 and transform skip mode, and then performing inverse transform processing on each inverse quantization coefficient sub-block according to the horizontal transform mode and the vertical transform mode corresponding to each inverse quantization coefficient sub-block. That is, in this embodiment, the transform mode of the inverse quantization coefficient sub-block corresponding to the transform sub-block can be flexibly selected from DCT2, DCT5, DCT8, DST1, DST7 and transform skip mode.
[0111] In some optional embodiments, if there is a first dequantized coefficient subblock with a width greater than a set threshold value in the dequantized coefficient subblock corresponding to at least one transform subblock, the horizontal transform mode of the first dequantized coefficient subblock is replaced with a DCT2 transform mode; if there is a second dequantized coefficient subblock with a height greater than a set threshold value in the dequantized coefficient subblock corresponding to at least one transform subblock, the vertical transform mode of the second dequantized coefficient subblock is replaced with a DCT2 transform mode. The technical solution of this embodiment enables the use of a DCT2 transform mode that is more suitable for large-size residual block transforms when the size (such as height or width) of the dequantized coefficient subblock corresponding to the transform subblock is large, so as to ensure the effect of coefficient transform.
[0112] Figure 6 The technical solution of the embodiment of the present application is described from the perspective of the decoding end. Figure 7 The technical solution of the embodiment of the present application is further explained from the perspective of the encoding end:
[0113] Figure 7 A flowchart of a video encoding method according to an embodiment of the present application is shown. The video encoding method can be executed by a device with a computing and processing function, such as a terminal device or a server. Figure 7 As shown, the video encoding method at least includes the following steps S710 to S740, which are described in detail as follows:
[0114] In step S710, a residual block corresponding to the current block to be encoded is obtained.
[0115] Optionally, the residual block is the difference between the original image information (original image block) and the predicted image information (prediction block).
[0116] In step S720, corresponding block division information is determined according to the residual block, and the block division information includes information of a target sub-block that needs to be entropy encoded.
[0117] Optionally, the information of the target sub-block includes width information, height information and position information of the target sub-block, and details may refer to the technical solution of the aforementioned embodiment.
[0118] In step S730, the target sub-block is divided to obtain at least one transformation sub-block.
[0119] In some optional embodiments, the target sub-block may be divided according to a set division strategy to obtain at least one transformation sub-block. The set division strategy includes: at least one of the height and width of the transformation sub-block obtained by division is an integer power of 2. The specific division method may refer to the technical solution of the above embodiment.
[0120] In step S740, transform processing and quantization processing are performed on at least one transform sub-block to obtain a quantized coefficient block, so as to perform encoding processing based on the quantized coefficient block.
[0121] Optionally, the quantized coefficient block may be entropy encoded, and the information of at least one transformed sub-block obtained may be encoded to obtain an encoded bit stream, which is then transmitted to a decoding end.
[0122] It should be noted that: Figure 7 The implementation details of the video encoding method shown in are similar to the implementation details of the video decoding method described in the aforementioned embodiment and are not described in detail again.
[0123] In summary, the technical solution of the embodiment of the present application can further divide the sub-blocks obtained by dividing the coding block to adapt to a variety of residual distribution situations. Specifically, the size of the sub-block obtained by dividing the coding block can be a certain proportion of the size of the corresponding direction of the coding block, such as 1, 1 / 4, 1 / 2, 3 / 4, 1 / 8, etc. When encoding, only the residuals of the specified sub-block area need to be encoded and transmitted, and the residuals of the remaining areas do not need to be encoded and transmitted.
[0124] The following are several embodiments of dividing a coding block into sub-blocks in the present application:
[0125] like Fig. 8A As shown, the width and height of the sub-block are both 1 / 4 of the corresponding directional dimensions of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0126] like Figure 8B As shown, the width and height of the sub-block are both 3 / 4 of the corresponding directional size of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0127] like Figure 8CAs shown, the width of the sub-block is equal to the width of the coding block, the height of the sub-block is 3 / 4 of the height of the coding block, and the position of the sub-block can be above or below the coding block.
[0128] like Fig.8D As shown, the height of the sub-block is equal to the height of the coding block, the width of the sub-block is 3 / 4 of the width of the coding block, and the position of the sub-block can be on the left or right of the coding block.
[0129] like Fig. 8E As shown, the width of the sub-block is 1 / 4 of the width of the coding block, the height of the sub-block is 1 / 2 of the height of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0130] like Fig.8F As shown, the width of the sub-block is 1 / 4 of the width of the coding block, the height of the sub-block is 3 / 4 of the height of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0131] like Figure 8G As shown, the width of the sub-block is 1 / 2 of the width of the coding block, the height of the sub-block is 1 / 4 of the height of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0132] like Figure 8H As shown, the width of the sub-block is 1 / 2 of the width of the coding block, the height of the sub-block is 3 / 4 of the height of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0133] like Figure 8I As shown, the width of the sub-block is 3 / 4 of the width of the coding block, the height of the sub-block is 1 / 4 of the height of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0134] like Figure 8J As shown, the width of the sub-block is 3 / 4 of the width of the coding block, the height of the sub-block is 1 / 2 of the height of the coding block, and the position of the sub-block can be any one of the upper left corner, upper right corner, lower left corner and lower right corner of the coding block.
[0135] It should be noted that: FIG. 8A to FIG. 8J The various partitioning modes shown can be used independently or in combination. Figure 4 The division modes shown are used in combination.
[0136] After the sub-blocks are divided, the transform combination of the sub-blocks can be selected from DCT2, DCT5, DCT8, DST1, DST7 and TS (transform skip). In addition, the sub-blocks to be encoded can be transformed as one transform block or divided into multiple transform blocks for transformation.
[0137] The following takes the selection of the transform combination from DCT8 and DST7 as an example to illustrate the manner of further dividing the sub-blocks in the embodiment of the present application:
[0138] like Fig. 9A As shown in FIG. 1 , the width and height of the sub-block are both 1 / 4 of the corresponding dimension of the coding block, so the sub-block can be transformed as a whole transform block. The transform combination can be arbitrarily selected from DCT8 and DST7.
[0139] like Figure 9B-1 As shown in FIG. 1 , the width and height of the sub-block are both 3 / 4 of the corresponding dimension of the coding block, so the sub-block can be transformed as a whole transform block. The transform combination can be arbitrarily selected from DCT8 and DST7.
[0140] like Figure 9B-2 As shown, the width and height of the sub-block are both 3 / 4 of the corresponding directional size of the coding block. Then the sub-block can be further divided into 4 transform blocks (the dotted lines in the figure indicate the division boundaries), and the transform combinations of these 4 transform blocks can be arbitrarily selected from DCT8 and DST7.
[0141] like Figure 9C-1 As shown in FIG. 1 , the width of the sub-block is equal to the width of the coding block, and the height of the sub-block is 3 / 4 of the height of the coding block, so the sub-block can be transformed as a whole block. The transformation combination can be arbitrarily selected from DCT8 and DST7.
[0142] like Figure 9C-2 As shown, the width of the sub-block is equal to the width of the coding block, and the height of the sub-block is 3 / 4 of the height of the coding block. Then the sub-block can be further divided into three transform blocks (the dotted lines in the figure indicate the division boundaries), and the transform combinations of these three transform blocks can be arbitrarily selected from DCT8 and DST7.
[0143] like Figure 9D-1 As shown in the figure, the height of the sub-block is equal to the height of the coding block, and the width of the sub-block is 3 / 4 of the width of the coding block, so the sub-block can be transformed as a whole block. The transformation combination can be arbitrarily selected from DCT8 and DST7.
[0144] like Figure 9D-2As shown, the height of the sub-block is equal to the height of the coding block, and the width of the sub-block is 3 / 4 of the width of the coding block. Then the sub-block can be further divided into three transform blocks (the dotted lines in the figure indicate the division boundaries), and the transform combinations of these three transform blocks can be arbitrarily selected from DCT8 and DST7.
[0145] like Fig.9E As shown in FIG. 1 , the width of the sub-block is 1 / 4 of the width of the coding block, and the height of the sub-block is 1 / 2 of the height of the coding block. Then the sub-block can be transformed as a whole transform block. The transform combination can be arbitrarily selected from DCT8 and DST7.
[0146] like Figure 9F-1 As shown in FIG. 1 , the width of the sub-block is 1 / 4 of the width of the coding block, and the height of the sub-block is 3 / 4 of the height of the coding block, so the sub-block can be transformed as a whole block. The transformation combination can be arbitrarily selected from DCT8 and DST7.
[0147] like Figure 9F-2 As shown, the width of the sub-block is 1 / 4 of the width of the coding block, and the height of the sub-block is 3 / 4 of the height of the coding block. Then the sub-block can be further divided into two transform blocks (the dotted line in the figure indicates the division boundary), and the transform combination of these two transform blocks can be arbitrarily selected from DCT8 and DST7.
[0148] like Figure 9G As shown in FIG. 1 , the width of the sub-block is 1 / 2 of the width of the coding block, and the height of the sub-block is 1 / 4 of the height of the coding block, so the sub-block can be transformed as a whole transform block. The transform combination can be arbitrarily selected from DCT8 and DST7.
[0149] like Figure 9H-1 As shown in FIG. 1 , the width of the sub-block is 1 / 2 of the width of the coding block, and the height of the sub-block is 3 / 4 of the height of the coding block. Then the sub-block can be transformed as a whole transform block. The transform combination can be arbitrarily selected from DCT8 and DST7.
[0150] like Figure 9H-2 As shown, the width of the sub-block is 1 / 2 of the width of the coding block, and the height of the sub-block is 3 / 4 of the height of the coding block. Then the sub-block can be further divided into 2 transform blocks (the dotted line in the figure indicates the division boundary), and the transform combination of these 2 transform blocks can be arbitrarily selected from DCT8 and DST7.
[0151] like Figure 9I-1 As shown in FIG. 1 , the width of the sub-block is 3 / 4 of the width of the coding block, and the height of the sub-block is 1 / 4 of the height of the coding block, so the sub-block can be transformed as a whole block. The transformation combination can be arbitrarily selected from DCT8 and DST7.
[0152] like Figure 9I-2 As shown, the width of the sub-block is 3 / 4 of the width of the coding block, and the height of the sub-block is 1 / 4 of the height of the coding block. Then the sub-block can be further divided into 2 transform blocks (the dotted line in the figure indicates the division boundary), and the transform combination of these 2 transform blocks can be arbitrarily selected from DCT8 and DST7.
[0153] like Figure 9J-1 As shown in the figure, the width of the sub-block is 3 / 4 of the width of the coding block, and the height of the sub-block is 1 / 2 of the height of the coding block, so the sub-block can be transformed as a whole block. The transformation combination can be arbitrarily selected from DCT8 and DST7.
[0154] like Figure 9J-2 As shown, the width of the sub-block is 3 / 4 of the width of the coding block, and the height of the sub-block is 1 / 2 of the height of the coding block. Then the sub-block can be further divided into two transform blocks (the dotted line in the figure indicates the division boundary), and the transform combination of these two transform blocks can be arbitrarily selected from DCT8 and DST7.
[0155] In some optional embodiments of the present application, the horizontal transform mode and the vertical transform mode of the transform block in the sub-block may also be set to DCT2 transform mode. Or the horizontal transform mode and the vertical transform mode of the transform block in the sub-block may also be set to TS mode, that is, transform skip mode.
[0156] In some optional embodiments of the present application, the transform combination of the transform block in the sub-block can be selected from DCT2, DCT5, DCT8, DST1, DST7 and TS, but if the size of the transform block in the sub-block is greater than a specified threshold, the transform mode in the corresponding direction can be forcibly modified to DCT2. For example, when the width of the transform block in the sub-block is greater than 8, the horizontal transform mode can be forcibly modified to DCT2; when the height of the transform block in the sub-block is greater than 8, the vertical transform mode can be forcibly modified to DCT2.
[0157] The technical solutions of the above embodiments of the present application expand the division mode of the SBT technology, thereby improving the flexibility of the sub-block transformation technology and further improving the encoding and decoding performance.
[0158] The following describes an embodiment of the device of the present application, which can be used to execute the method in the above embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the above embodiment of the method of the present application.
[0159] 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.
[0160] Reference Fig.10 As shown, a video decoding device 1000 according to an embodiment of the present application includes: an acquisition unit 1002 , a decoding unit 1004 and a processing unit 1006 .
[0161] Among them, the acquisition unit 1002 is configured to obtain block division information corresponding to the coding block to be decoded, and the block division information contains information of the target sub-block that needs to be entropy decoded; the decoding unit 1004 is configured to decode from the bit stream to obtain information of at least one transform sub-block obtained by dividing the target sub-block, and perform entropy decoding and inverse quantization processing based on the information of the at least one transform sub-block to obtain an inverse quantization coefficient sub-block corresponding to the at least one transform sub-block; the processing unit 1006 is configured to perform inverse transform processing on the inverse quantization coefficient sub-block corresponding to the at least one transform sub-block, and generate a reconstructed residual corresponding to the coding block according to the inverse transform processing result.
[0162] In some embodiments of the present application, based on the aforementioned scheme, the information of the target sub-block includes width information and height information of the target sub-block; the width information of the target sub-block includes a first ratio of the width of the target sub-block to the width of the coding block; the height information of the target sub-block includes a second ratio of the height of the target sub-block to the height of the coding block.
[0163] In some embodiments of the present application, based on the aforementioned scheme, the numerical value of the first ratio and the numerical value of the second ratio are respectively any one of the following: 1, 1 / 4, 1 / 2, 3 / 4, 1 / 8.
[0164] In some embodiments of the present application, based on the aforementioned solution, the width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or
[0165] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or
[0166] The width of the target sub-block is equal to the coding block width, and the height of the target sub-block is 3 / 4 of the coding block height; or
[0167] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is equal to the height of the coding block; or
[0168] The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 2 of the height of the coding block; or
[0169] The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or
[0170] The width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or
[0171] The width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or
[0172] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or
[0173] The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 2 of the height of the coding block.
[0174] In some embodiments of the present application, based on the aforementioned solution, the information of the target sub-block further includes position information of the target sub-block, and the position information is used to indicate the position of the target sub-block in the coding block.
[0175] In some embodiments of the present application, based on the aforementioned scheme, the position of the target sub-block in the coding block includes any one of the following: the upper left corner of the coding block, the upper right corner of the coding block, the lower left corner of the coding block, the lower right corner of the coding block, above the coding block, below the coding block, to the left of the coding block, and to the right of the coding block.
[0176] In some embodiments of the present application, based on the above scheme, the size of the transform sub-block obtained by dividing the target sub-block satisfies the following condition: at least one of the height and width of the transform sub-block is an integer power of 2.
[0177] In some embodiments of the present application, based on the aforementioned scheme:
[0178] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 4 transform sub-blocks;
[0179] If the width of the target sub-block is equal to the coding block width, and the height of the target sub-block is 3 / 4 of the coding block height, the target sub-block is divided into 3 transform sub-blocks in the height direction;
[0180] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is equal to the height of the coding block, the target sub-block is divided into 3 transform sub-blocks in the width direction;
[0181] If the width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction;
[0182] If the width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction;
[0183] If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction;
[0184] If the width of the target sub-block is 3 / 4 of the width of the coding block and the height of the target sub-block is 1 / 2 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction.
[0185] In some embodiments of the present application, based on the aforementioned scheme, the processing unit 1006 is configured to: select a horizontal transform mode and a vertical transform mode corresponding to each of the dequantization coefficient sub-blocks from the set transform mode, the set transform mode including: DCT2, DCT5, DCT8, DST1, DST7 and transform skip mode; perform inverse transform processing on each of the dequantization coefficient sub-blocks according to the horizontal transform mode and the vertical transform mode corresponding to each of the dequantization coefficient sub-blocks.
[0186] In some embodiments of the present application, based on the aforementioned scheme, the processing unit 1006 is further configured to: if there is a first dequantization coefficient sub-block with a width greater than a set threshold in the dequantization coefficient sub-block corresponding to the at least one transform sub-block, then the horizontal transform mode of the first dequantization coefficient sub-block is replaced with a DCT2 transform mode; if there is a second dequantization coefficient sub-block with a height greater than a set threshold in the dequantization coefficient sub-block corresponding to the at least one transform sub-block, then the vertical transform mode of the second dequantization coefficient sub-block is replaced with a DCT2 transform mode.
[0187] 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.
[0188] Reference Fig.11 As shown, a video encoding device 1100 according to an embodiment of the present application includes: an acquisition unit 1102 , a determination unit 1104 , a division unit 1106 and an encoding unit 1108 .
[0189] Among them, the acquisition unit 1102 is configured to obtain the residual block corresponding to the current block to be encoded; the determination unit 1104 is configured to determine the corresponding block division information according to the residual block, and the block division information contains information of the target sub-block that needs to be entropy encoded; the division unit 1106 is configured to divide the target sub-block to obtain at least one transformed sub-block; the encoding unit 1108 is configured to perform transform processing and quantization processing on the at least one transformed sub-block to obtain a quantized coefficient block, so as to perform encoding processing based on the quantized coefficient block.
[0190] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0191] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0192] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method described in the above embodiment. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202 and the RAM 1203 are connected to each other through the bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.
[0193] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0194] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0195] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0196] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0197] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0198] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more computer programs, and when the above one or more computer programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0199] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0200] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0201] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0202] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A video decoding method, characterized in that: include: Obtaining block partitioning information corresponding to the coding block to be decoded, wherein the block partitioning information includes information of a target sub-block that needs to be entropy decoded; Decoding from a bitstream to obtain information of at least one transformed sub-block obtained by dividing the target sub-block; Performing entropy decoding and inverse quantization processing based on the information of the at least one transformed sub-block to obtain an inverse quantization coefficient sub-block corresponding to the at least one transformed sub-block; An inverse transform process is performed on the inverse quantized coefficient sub-block corresponding to the at least one transform sub-block, and a reconstructed residual corresponding to the coding block is generated according to the inverse transform process result.
2. The video decoding method according to claim 1, characterized in that: The information of the target sub-block includes width information and height information of the target sub-block; The width information of the target sub-block includes a first ratio of the width of the target sub-block to the width of the coding block; The height information of the target sub-block includes a second ratio of the height of the target sub-block to the height of the coding block.
3. The video decoding method according to claim 2, characterized in that: The value of the first ratio and the value of the second ratio are any of the following: 1, 1 / 4, 1 / 2, 3 / 4, 1 / 8.
4. The video decoding method according to claim 3, characterized in that: The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or The width of the target sub-block is equal to the coding block width, and the height of the target sub-block is 3 / 4 of the coding block height; or The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is equal to the height of the coding block; or The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 2 of the height of the coding block; or The width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or The width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or The width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block; or The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block; or The width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 2 of the height of the coding block.
5. The video decoding method according to any one of claims 2 to 4, characterized in that: The information of the target sub-block also includes position information of the target sub-block, where the position information is used to indicate the position of the target sub-block in the coding block.
6. The video decoding method according to claim 5, characterized in that: The position of the target sub-block in the coding block includes any one of the following: the upper left corner of the coding block, the upper right corner of the coding block, the lower left corner of the coding block, the lower right corner of the coding block, above the coding block, below the coding block, to the left of the coding block, and to the right of the coding block.
7. The video decoding method according to claim 1, characterized in that: The size of the transform sub-block obtained by dividing the target sub-block satisfies the following condition: at least one of the height and width of the transform sub-block is an integer power of 2.
8. The video decoding method according to claim 7, characterized in that: If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 4 transform sub-blocks; If the width of the target sub-block is equal to the coding block width, and the height of the target sub-block is 3 / 4 of the coding block height, the target sub-block is divided into 3 transform sub-blocks in the height direction; If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is equal to the height of the coding block, the target sub-block is divided into 3 transform sub-blocks in the width direction; If the width of the target sub-block is 1 / 4 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction; If the width of the target sub-block is 1 / 2 of the width of the coding block, and the height of the target sub-block is 3 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the height direction; If the width of the target sub-block is 3 / 4 of the width of the coding block, and the height of the target sub-block is 1 / 4 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction; If the width of the target sub-block is 3 / 4 of the width of the coding block and the height of the target sub-block is 1 / 2 of the height of the coding block, the target sub-block is divided into 2 transform sub-blocks in the width direction.
9. The video decoding method according to claim 1, characterized in that: Performing inverse transform processing on the inverse quantized coefficient sub-block corresponding to the at least one transform sub-block, comprising: Selecting a horizontal transform mode and a vertical transform mode corresponding to each of the dequantized coefficient sub-blocks from a set transform mode, wherein the set transform mode includes: DCT2, DCT5, DCT8, DST1, DST7 and a transform skip mode; According to the horizontal transform mode and the vertical transform mode corresponding to each of the dequantized coefficient sub-blocks, inverse transform processing is performed on each of the dequantized coefficient sub-blocks.
10. The video decoding method according to claim 9, characterized in that: The method further comprises: If there is a first dequantized coefficient sub-block whose width is greater than a set threshold in the dequantized coefficient sub-block corresponding to the at least one transform sub-block, replacing the horizontal transform mode of the first dequantized coefficient sub-block with a DCT2 transform mode; If there is a second dequantized coefficient subblock whose height is greater than a set threshold in the dequantized coefficient subblock corresponding to the at least one transform subblock, the vertical transform mode of the second dequantized coefficient subblock is replaced with the DCT2 transform mode.
11. A video encoding method, characterized in that: include: Obtain the residual block corresponding to the current block to be encoded; Determine corresponding block partitioning information according to the residual block, wherein the block partitioning information includes information of a target sub-block that needs to be entropy encoded; Dividing the target sub-block to obtain at least one transformation sub-block; The at least one transform sub-block is transformed and quantized to obtain a quantized coefficient block, so as to perform encoding based on the quantized coefficient block.
12. A video decoding device, characterized in that: include: An acquisition unit configured to acquire block partition information corresponding to a coding block to be decoded, wherein the block partition information includes information of a target sub-block to be entropy decoded; A decoding unit, configured to decode from a bitstream to obtain information of at least one transform sub-block obtained by dividing the target sub-block, and perform entropy decoding and inverse quantization processing based on the information of the at least one transform sub-block to obtain an inverse quantization coefficient sub-block corresponding to the at least one transform sub-block; The processing unit is configured to perform inverse transform processing on the inverse quantized coefficient sub-block corresponding to the at least one transform sub-block, and generate a reconstructed residual corresponding to the coding block according to the inverse transform processing result.
13. A video encoding device, characterized in that: include: An acquisition unit, configured to acquire a residual block corresponding to a current block to be encoded; A determining unit, configured to determine corresponding block partitioning information according to the residual block, wherein the block partitioning information includes information of a target sub-block that needs to be entropy encoded; a dividing unit, configured to divide the target sub-block to obtain at least one transformed sub-block; The encoding unit is configured to perform transform processing and quantization processing on the at least one transform sub-block to obtain a quantization coefficient block, so as to perform encoding processing based on the quantization coefficient block.
14. A computer readable 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 10, or implements the video encoding method according to claim 11.
15. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the video decoding method as described in any one of claims 1 to 10, or to implement the video encoding method as described in claim 11.
16. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor of the electronic device reads and executes the computer instructions from the computer-readable storage medium, so that the electronic device performs the video decoding method as described in any one of claims 1 to 10, or implements the video encoding method as described in claim 11.
Citation Information
Cited By
Method and apparatus for video encoding and decoding, computer-readable medium and electronic device
EP4697723A1
Method and apparatus for video encoding and decoding, computer-readable medium and electronic device
WO2024212676A1
