Video encoding method, apparatus, computer readable medium, and electronic device

By calculating the motion complexity and scene complexity of the current block and combining the results of surrounding encoded blocks, it is determined whether to skip the quadtree partitioning method, which solves the problem of slow encoding speed in existing technologies and improves video encoding efficiency.

CN115695805BActive Publication Date: 2026-03-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-23
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing video coding technologies take a long time to select the optimal partitioning method, resulting in slow coding speeds.

Method used

By calculating the motion complexity and scene complexity of the current block, if they are below a set threshold, the results of the surrounding encoded blocks are obtained to determine whether the quadtree partitioning method can be skipped, and the partitioning method of the current block is determined based on the coding rate loss of other partitioning methods.

Benefits of technology

It improves video encoding speed and avoids the time spent on quadtree partitioning when estimating the optimal partitioning method for all blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695805B_ABST
    Figure CN115695805B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a video coding method, device, computer readable medium and electronic device. The video coding method comprises: calculating at least one of motion complexity and scene complexity of a current block, the motion complexity being calculated according to time domain information of the current block, and the scene complexity being calculated according to spatial domain information of the current block; if at least one of the motion complexity and the scene complexity is lower than a set threshold, obtaining coding results of other blocks around the current block which have been coded; determining whether the current block can skip a quad-tree partitioning mode when estimating an optimal partitioning mode based on the coding results of the other blocks; and if it is determined that the quad-tree partitioning mode can be skipped, determining a partitioning mode of the current block based on coding bit rate loss of the current block when other partitioning modes are performed. The technical solution of the embodiments of the present application can improve the coding speed of a video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer and communication technology, and more specifically, to a video coding method, apparatus, computer-readable medium, and electronic device. Background Technology

[0002] In the video encoding process (such as game videos, conference videos, etc.), the entire frame image needs to be recursively divided into blocks of various sizes. Quickly selecting the most suitable partitioning method is the optimal way to speed up the entire encoding process. The video encoding process proposed in related technologies usually uses a top-down or bottom-up recursive method to select the optimal partitioning method. Although this can accurately select the optimal partitioning method, it takes a lot of time, resulting in a slow encoding speed. Summary of the Invention

[0003] Embodiments of this application provide a video encoding method, apparatus, computer-readable medium, and electronic device, which can at least to some extent improve the video encoding speed.

[0004] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0005] According to one aspect of the embodiments of this application, a video coding method is provided, comprising: calculating at least one of motion complexity and scene complexity of a current block, wherein the motion complexity is calculated based on temporal information of the current block, and the scene complexity is calculated based on spatial information of the current block; if at least one of the motion complexity and the scene complexity is lower than a set threshold, then obtaining the coding results of other encoded blocks surrounding the current block; determining, based on the coding results of the other blocks, whether the current block can skip the quadtree partitioning method when estimating the optimal partitioning method; if it is determined that the quadtree partitioning method can be skipped, then determining the partitioning method of the current block based on the coding bitrate loss of the current block when performing other partitioning methods.

[0006] According to one aspect of the embodiments of this application, a video encoding apparatus is provided, comprising: a calculation unit configured to calculate at least one of motion complexity and scene complexity of a current block, wherein the motion complexity is calculated based on temporal information of the current block and the scene complexity is calculated based on spatial information of the current block; an acquisition unit configured to acquire the encoding results of other encoded blocks surrounding the current block if at least one of the motion complexity and the scene complexity is lower than a set threshold; a first processing unit configured to determine, based on the encoding results of the other blocks, whether the current block can skip the quadtree partitioning method when estimating the optimal partitioning method; and a second processing unit configured to determine the partitioning method of the current block based on the encoding rate loss of the current block when performing other partitioning methods if it is determined that the quadtree partitioning method can be skipped.

[0007] In some embodiments of this application, based on the foregoing scheme, the acquisition unit is configured to: acquire the first total coding rate consumption of the surrounding encoded blocks of the target coding block containing the current block that are the same size as the current block, and the first number of surrounding encoded blocks of the target coding block that are the same size as the current block; acquire the second total coding rate consumption of the surrounding encoded blocks of the target coding block containing the current block that are the same size as the current block, and the second number of surrounding encoded blocks of the target coding block that are the same size as the current block; and use the first total coding rate consumption, the first number, the second total coding rate consumption, and the second number as the encoding result of other encoded blocks surrounding the current block.

[0008] In some embodiments of this application, based on the foregoing scheme, the first processing unit is configured to: calculate a target parameter for evaluating the coding rate loss based on the first total coding rate consumption, the first quantity, the second total coding rate consumption, and the second quantity; obtain the coding rate loss when the current block is not partitioned; if the difference between the target parameter and the coding rate loss when the current block is not partitioned is greater than a set threshold, then determine that the current block can skip the quadtree partitioning method when estimating the optimal partitioning method.

[0009] In some embodiments of this application, based on the foregoing scheme, the first processing unit is configured to: calculate a first average coding bitrate consumption based on the first total coding bitrate consumption and the first quantity; calculate a second average coding bitrate consumption based on the second total coding bitrate consumption and the second quantity; perform a weighted summation on the first average coding bitrate consumption and the second average coding bitrate consumption, and use the result of the weighted summation as the target parameter.

[0010] In some embodiments of this application, based on the foregoing scheme, the second processing unit is configured to: obtain the coding rate loss when the current block is not divided; if the coding rate loss of the current block when performing other division methods is less than the coding rate loss when the current block is not divided, then determine that the current block is divided using the other division methods during encoding; if the coding rate loss of the current block when performing other division methods is greater than or equal to the coding rate loss when the current block is not divided, then determine that the current block is not divided during encoding.

[0011] In some embodiments of this application, based on the foregoing scheme, the video encoding apparatus further includes: a third processing unit configured to, if it is determined that the quadtree partitioning method cannot be skipped, calculate the encoding bitrate loss of the current block when performing the quadtree partitioning method, and calculate the encoding bitrate loss of the current block when performing other partitioning methods; obtain the encoding bitrate loss of the current block when not partitioned; and determine the partitioning method of the current block based on the minimum value among the encoding bitrate loss of the current block when not partitioned, the encoding bitrate loss of the current block when performing the quadtree partitioning method, and the encoding bitrate loss of the current block when performing other partitioning methods.

[0012] In some embodiments of this application, based on the foregoing scheme, the video encoding device further includes: a fourth processing unit configured to, if both the motion complexity and the scene complexity are higher than the set threshold, calculate the encoding bitrate loss of the current block when performing the quadtree partitioning method, and calculate the encoding bitrate loss of the current block when performing other partitioning methods; obtain the encoding bitrate loss when the current block is not partitioned; and determine the partitioning method of the current block based on the minimum value among the encoding bitrate loss when the current block is not partitioned, the encoding bitrate loss when the current block is performed the quadtree partitioning method, and the encoding bitrate loss when the current block is performed other partitioning methods.

[0013] In some embodiments of this application, based on the foregoing scheme, the partitioning method of the current block is determined according to the minimum value among the coding rate loss when the current block is not partitioned, the coding rate loss when the current block is partitioned using the quadtree method, and the coding rate loss when the current block is partitioned using other methods, including:

[0014] If the coding rate loss when the current block is not partitioned is less than the coding rate loss when the current block is partitioned using the quadtree method and the coding rate loss when the current block is partitioned using other methods, then it is determined that the current block will not be partitioned during encoding.

[0015] If the coding rate loss of the current block when performing the quadtree partitioning method is less than the coding rate loss when the current block is not partitioned and the coding rate loss when the current block is performed in other partitioning methods, then it is determined that the current block adopts the quadtree partitioning method during encoding.

[0016] If the coding rate loss of the current block when performing other partitioning methods is less than the coding rate loss when the current block is not partitioned and the coding rate loss of the current block when performing the quadtree partitioning method, then it is determined that the current block adopts the other partitioning method during encoding.

[0017] In some embodiments of this application, based on the foregoing scheme, the computing unit is configured to calculate the motion complexity of the current block in the following ways: calculate the optimal coding rate loss when the frame to be encoded in which the current block is located adopts inter-frame predictive coding, and use it as the motion complexity of the current block; or calculate the temporal information (TI) of the frame to be encoded in which the current block is located, and use it as the motion complexity of the current block.

[0018] In some embodiments of this application, based on the foregoing scheme, the computing unit is configured to calculate the scene complexity of the current block in the following ways: calculate the optimal coding rate loss when the frame to be encoded in which the current block is located adopts intra-frame predictive coding, and use it as the scene complexity of the current block; or calculate the spatial information SI (i.e., Spatial Information) of the frame to be encoded in which the current block is located, and use it as the scene complexity of the current block.

[0019] In some embodiments of this application, based on the foregoing scheme, the video encoding device further includes: a control unit configured to, if it is determined that the current block is divided using the quadtree partitioning method, after dividing the current block, use the sub-blocks obtained from the partitioning as the current block to continue determining the partitioning method, until no further partitioning is performed or other partitioning methods besides the quadtree partitioning method are used for partitioning.

[0020] In some embodiments of this application, based on the foregoing scheme, the video encoding apparatus further includes: a storage unit configured to collect and store the encoding rate loss of the current block after the current block is encoded.

[0021] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the video encoding method as described in the above embodiments.

[0022] According to one aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the video encoding method as described in the above embodiments.

[0023] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the video encoding methods provided in the various alternative embodiments described above.

[0024] In some embodiments of this application, since video frames are typically continuous, at least one of the motion complexity and scene complexity of the current block can be calculated. Then, when at least one of the motion complexity and scene complexity is below a set threshold, the encoding results of other encoded blocks surrounding the current block are used to determine whether the current block can skip the quadtree partitioning method when estimating the optimal partitioning method. If the quadtree partitioning method can be skipped, the partitioning method of the current block is determined based on the bitrate loss when performing other partitioning methods. Therefore, the technical solution of this application allows for the determination of whether to skip the quadtree partitioning method when the motion complexity or scene complexity is low, based on the encoding results of other encoded blocks surrounding the current block. This facilitates the selection of other partitioning methods, avoiding the need for quadtree partitioning for all blocks when estimating the optimal partitioning method, which would otherwise take a lot of time and improve video encoding speed.

[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0027] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown;

[0028] Figure 2A schematic diagram showing the placement of video encoding and decoding devices in a streaming system;

[0029] Figure 3 A basic flowchart of a video encoder is shown;

[0030] Figure 4 This diagram illustrates the sub-block partitioning method in the AV1 standard.

[0031] Figure 5 A flowchart of a video encoding method according to an embodiment of this application is shown;

[0032] Figure 6 A flowchart of a video encoding method according to an embodiment of this application is shown;

[0033] Figure 7 A flowchart of a video encoding method according to an embodiment of this application is shown;

[0034] Figure 8 A flowchart of a video encoding method according to an embodiment of this application is shown;

[0035] Figure 9 A flowchart of a video encoding method according to an embodiment of this application is shown;

[0036] Figure 10 A block diagram of a video encoding apparatus according to an embodiment of this application is shown;

[0037] Figure 11 A block diagram of a video encoding apparatus according to an embodiment of this application is shown;

[0038] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0039] Exemplary embodiments will now be 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 construed as limited to these examples; rather, these embodiments are provided so that this application will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.

[0040] Furthermore, the features, structures, or characteristics described in this application can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to provide a full understanding of the embodiments of this application. However, those skilled in the art will recognize that when implementing the technical solutions of this application, not all the detailed features in the embodiments may be used, one or more specific details may be omitted, or other methods, elements, devices, steps, etc., may be employed.

[0041] 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 can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0042] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0043] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0044] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown.

[0045] like Figure 1 As shown, system architecture 100 includes multiple terminal devices that can communicate with each other via, for example, a network 150. For instance, system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected via network 150. Figure 1 In one embodiment, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.

[0046] For example, the first terminal device 110 can encode video data (e.g., a video image stream captured by the terminal device 110) to transmit it 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 streams. The second terminal device 120 can receive the encoded video data from the network 150, decode the encoded video data to recover the video data, and display video images based on the recovered video data.

[0047] In one embodiment of this application, system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, such as during a video conference. 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 image stream captured by the terminal device) for transmission over network 150 to the other terminal device. Each of the third terminal device 130 and the fourth terminal device 140 may also receive encoded video data transmitted by the other terminal device, decode the encoded video data to recover the video data, and display the video images on an accessible display device based on the recovered video data.

[0048] exist Figure 1 In the embodiments disclosed herein, the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be servers, terminal devices, etc., but the principles disclosed herein are not limited to these. The embodiments disclosed herein are applicable to laptop computers, tablet computers, media players, and / or dedicated video conferencing equipment. Network 150 refers to any number of networks that transmit 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. Communication network 150 may exchange data in circuit-switched and / or packet-switched channels. This network may include telecommunications networks, local area networks, wide area networks, and / or the Internet. For the purposes of this application, unless explained below, the architecture and topology of network 150 may be irrelevant to the operation of this application.

[0049] The aforementioned servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing cloud computing services. Terminal devices can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, in-vehicle terminals, smart TVs, etc., but are not limited to these.

[0050] In one embodiment of this application, Figure 2 The illustration shows the placement of video encoding and decoding devices in a streaming environment. The subject matter disclosed in this application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (television), storing compressed video on digital media including CDs, DVDs, memory sticks, etc.

[0051] 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 image stream 202. In an embodiment, the video image stream 202 includes samples captured by a digital camera. The video image stream 202 is depicted as a thick line to emphasize the high data volume of the video image stream compared to encoded video data 204 (or encoded video bitstream 204). The video image stream 202 may 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 enforce aspects of the disclosed subject matter as described in more detail below. The encoded video data 204 (or encoded video bitstream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or encoded video bitstream 204), which may be stored on a streaming server 205 for future use. One or more streaming client subsystems, such as Figure 2 Client subsystems 206 and 208 can access streaming server 205 to retrieve copies 207 and 209 of encoded video data 204. Client subsystem 206 may include, for example, a video decoding device 210 in electronic device 230. Video decoding device 210 decodes the incoming copy 207 of the encoded video data and produces an output video picture stream 211 that can be displayed on display 212 (e.g., a screen) or another presentation device. In some streaming systems, the encoded video data 204, video data 207, and video data 209 (e.g., video streams) may be encoded according to certain video coding / compression standards. Examples of these standards include Versatile Video Coding (VVC), AV1, etc.

[0052] It should be noted that electronic devices 220 and 230 may include other components not shown in the figures. For example, electronic device 220 may include a video decoding device, and electronic device 230 may also include a video encoding device.

[0053] In one embodiment, taking the international video coding standards HEVC (High Efficiency Video Coding) and VVC, as well as the Chinese national video coding standard AVS (Audio Video Coding Standard), after an input video frame image is obtained, it is divided into several non-overlapping processing units according to a block size. Each processing unit performs a similar compression operation. This processing unit is called a CTU (Coding Tree Unit) or LCU (Largest Coding Unit). The CTU can be further subdivided into one or more basic coding units (CUs), which are the most basic elements in the coding process. The following introduces some concepts related to encoding CUs:

[0054] Predictive coding includes intra-frame prediction and inter-frame prediction. The original video signal is predicted from a selected reconstructed video signal to obtain a residual video signal. The encoder needs to determine which predictive coding mode to choose for the current CU and inform the decoder. Intra-frame prediction refers to predicting a signal from a region within the same image that has already been encoded and reconstructed; inter-frame prediction refers to predicting a signal from another encoded image (called a reference image) that is different from the current image.

[0055] Transform and Quantization: After the residual video signal undergoes transform operations such as DFT (Discrete Fourier Transform) and DCT, the signal is transformed into the transform domain, which are called transform coefficients. The transform coefficients are then subjected to lossy quantization, losing some information to make the quantized signal more suitable for compression. In some video coding standards, there may be more than one transform method to choose from; therefore, the encoder needs to select one of the transform methods for the current CU and inform the decoder. The fineness of quantization is usually determined by the quantization parameter (QP). A larger QP value means that coefficients with a wider range of values ​​will be quantized into the same output, which usually results in greater distortion and a lower bit rate; conversely, a smaller QP value means that coefficients with a smaller range of values ​​will be quantized into the same output, which usually results in less distortion and a higher bit rate.

[0056] Entropy coding, or statistical coding, involves statistically compressing the quantized transform-domain signal based on the frequency of each value, ultimately outputting a binary (0 or 1) compressed bitstream. Simultaneously, other information generated during encoding, such as the selected coding mode and motion vector data, also requires entropy coding to reduce the bit rate. Statistical coding is a lossless coding method that effectively reduces the bit rate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) and Content-Adaptive Binary Arithmetic Coding (CABAC).

[0057] Loop Filtering: The transformed and quantized signal undergoes inverse quantization, inverse transform, and prediction compensation to obtain a reconstructed image. Due to the effects of quantization, the reconstructed image differs from the original image in some aspects, resulting in distortion. Therefore, filtering operations can be performed on the reconstructed image, such as deblocking filters (DB), SAO (Sample Adaptive Offset), or ALF (Adaptive Loop Filter), to effectively reduce the distortion caused by quantization. Since these filtered reconstructed images will serve as a reference for subsequent coded images to predict future image signals, the aforementioned filtering operations are also called loop filtering, i.e., filtering operations within the coding loop.

[0058] In one embodiment of this application, Figure 3 A basic flowchart of a video encoder is shown, illustrating the process using intra-frame prediction as an example. The original image signal s... k [x,y] and the predicted image signal Perform the difference operation to obtain the residual signal u. k [x,y], residual signal u k After transformation and quantization, [x,y] is obtained as quantization coefficients. These coefficients are then used to obtain the encoded bitstream through entropy encoding, and to obtain the reconstructed residual signal u' through inverse quantization and inverse transform. k [x,y], predict image signal With the reconstructed residual signal u' k [x,y] superimposed to generate image signals Image signal On one hand, the signal is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing; on the other hand, the reconstructed image signal s' is output through loop filtering. k [x,y], reconstruct the image signal s' k [x,y] can be used as a reference image for the next frame for motion estimation and motion compensation prediction. Then, based on the result s' of the motion compensation prediction... r [x+m x ,y+m y ] and intra-frame prediction results Obtain the predicted image signal for the next frame. And continue repeating the above process until the coding is complete.

[0059] Based on the above encoding process, at the decoding end, for each CU, after acquiring the compressed bitstream (i.e., bitstream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then, the quantization coefficients undergo inverse quantization and inverse transform processing to obtain the residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to that CU can be obtained. Then, the residual signal and the prediction signal are added together to obtain the reconstructed signal. The reconstructed signal then undergoes loop filtering and other operations to generate the final output signal.

[0060] In the AV1 standard, video frames can be divided into 128×128 units (i.e., Maximum Coding Units, LCUs). Each LCU can be further divided into four equal parts (Split) or two equal parts (including horizontal and vertical bipartitions). Each of the four equal parts (i.e., square blocks) can be further recursively divided, and each sub-block can use... Figure 4 The nine division methods shown are used for classification, but of course, no classification is also optional. Figure 4 The nine partitioning methods shown include quadtree partitioning (i.e., Figure 4 The first partitioning method shown is a quadtree partitioning method, which divides a block into four equal parts.

[0061] In related technologies, when encoding video frames, one approach is to use a top-down recursive block partitioning method. This method partitions from the largest block size to the smallest block size, regardless of the encoding scene, until the optimal partitioning method is found. While this method can find the optimal block partitioning method, it severely impacts encoding speed when encoding video frames with high scene complexity. Another approach is to use a bottom-up recursive block partitioning method. This method partitions from the largest block size to the smallest block size, regardless of the encoding scene, until the optimal partitioning method is found. While this method can find the optimal block partitioning method, it severely impacts encoding speed when encoding video frames with low scene complexity.

[0062] Based on the problems existing in related technologies, the embodiments of this application provide a new video encoding method. It can determine whether to skip the quadtree partitioning method when estimating the optimal partitioning method by comparing and analyzing the motion complexity or scene complexity of the current block with the encoded results of surrounding blocks. This avoids the need for quadtree partitioning for all blocks when estimating the optimal partitioning method, which would take a lot of time and is beneficial to improving the video encoding speed.

[0063] The implementation details of the technical solutions in the embodiments of this application are described in detail below:

[0064] Figure 5 A flowchart of a video encoding method according to an embodiment of this application is shown. This video encoding method can be executed by a device with computing processing capabilities, such as a terminal device or a server. (Refer to...) Figure 5 As shown, the video encoding method includes at least steps S510 to S540, which are described in detail below:

[0065] In step S510, at least one of the motion complexity and scene complexity of the current block is calculated. The motion complexity is calculated based on the temporal information of the current block, and the scene complexity is calculated based on the spatial information of the current block.

[0066] In one embodiment of this application, the motion complexity of the current block is used to represent the temporal complexity. For example, the optimal coding rate loss of the frame to be encoded containing the current block when using inter-frame predictive coding can be calculated as the motion complexity of the current block. Alternatively, the temporal information (TI) of the frame to be encoded containing the current block can be calculated as the motion complexity of the current block. A video image frame can be divided into multiple blocks, and each block can be used as the current block when encoding it.

[0067] In one embodiment of this application, the scene complexity of the current block is used to represent the spatial complexity. For example, the optimal coding rate loss when intra-frame predictive coding is used in the frame to be encoded containing the current block can be calculated as the scene complexity of the current block. Alternatively, the spatial information SI of the frame to be encoded containing the current block can be calculated as the scene complexity of the current block.

[0068] In step S520, if at least one of the motion complexity and scene complexity is lower than a set threshold, the encoding results of other encoded blocks surrounding the current block are obtained.

[0069] In the embodiments of this application, since video frames are continuous, if the motion complexity or scene complexity of the current block is lower than a set threshold, it indicates that the current block has a high degree of correlation with other encoded blocks around it. Therefore, the encoding results of other encoded blocks around the current block can be obtained to determine the partitioning method of the current block. That is, the technical solution of this application embodiment considers the motion complexity and scene complexity in the video scene, so as to adjust the partitioning method for different motion complexities and scene complexities.

[0070] In one embodiment of this application, the encoding results of other encoded blocks surrounding the current block include the encoding results of encoded blocks of the same size surrounding the target encoded block where the current block is located, and the encoding results of encoded blocks of the same size within the target encoded block where the current block is located. It should be noted that in other embodiments of this application, it may also include one of these two types of encoded blocks. The target encoded block is the largest block containing the current block; for example, in the AV1 standard, the target encoded block could be a 128×128 block containing the current block; or it could be a larger block containing the current block, for example, if the current block is 32×32, then the target encoded block could be a 64×64 block containing the current block.

[0071] Optionally, the encoding results of the coded blocks of the same size surrounding the target coding block where the current block is located include: the first total coding rate consumption of the coded blocks of the same size surrounding the target coding block where the current block is located, and the first number of coded blocks of the same size surrounding the target coding block.

[0072] The encoding results of the encoded blocks of the same size as the current block within the target coding block include: the total second coding rate consumption of the encoded blocks of the same size as the current block within the target coding block, and the second number of encoded blocks of the same size as the current block within the target coding block.

[0073] In step S530, based on the encoding results of other blocks, it is determined whether the current block can skip the quadtree partitioning method when estimating the optimal partitioning method.

[0074] In one embodiment of this application, a target parameter for evaluating the coding rate loss can be calculated based on the first total coding rate consumption, the aforementioned first quantity, the second total coding rate consumption, and the aforementioned second quantity. Simultaneously, the coding rate loss when the current block is not partitioned can be obtained. Then, the target parameter and the coding rate loss when the current block is not partitioned are compared. If the difference between the target parameter and the coding rate loss when the current block is not partitioned is greater than a set threshold, it is determined that the current block can skip the quadtree partitioning method when estimating the optimal partitioning method.

[0075] Optionally, if the difference between the target parameter and the coding rate loss when the current block is not partitioned is less than or equal to the set threshold, then it is determined that the current block cannot skip the quadtree partitioning method when estimating the optimal partitioning method.

[0076] It should be noted that: if the difference between the target parameter and the coding rate loss when the current block is not partitioned is greater than the set threshold, it means that the target parameter is much greater than the coding rate loss when the current block is not partitioned. If the target parameter is greater than the coding rate loss when the current block is not partitioned, but the difference is small (i.e., less than or equal to the set threshold), then the current block cannot skip the quadtree partitioning method when estimating the optimal partitioning method.

[0077] In one embodiment of this application, when calculating the target parameter for evaluating the coding rate loss based on the first total coding rate consumption, the first quantity, the second total coding rate consumption, and the second quantity, the target parameter can be obtained by fitting these four parameters using a linear fitting method. In an optional embodiment, a first average coding rate consumption can be calculated based on the first total coding rate consumption and the first quantity, and a second average coding rate consumption can be calculated based on the second total coding rate consumption and the second quantity. Then, the first average coding rate consumption and the second average coding rate consumption are weighted and summed, and the result of the weighted summation is used as the target parameter.

[0078] Optionally, the weights of the first average coding bit rate consumption and the second average coding bit rate consumption when performing weighted summation can be set according to actual needs, and this application embodiment does not limit them.

[0079] In step S540, if it is determined that the quadtree partitioning method can be skipped, the partitioning method of the current block is determined based on the coding rate loss of the current block when performing other partitioning methods.

[0080] In one embodiment of this application, other division methods may include horizontal bisection (e.g.) Figure 4 The ⑧th division method shown) or the vertical bisection method (such as...) Figure 4 The 9th division method shown in the figure, etc., or it can also be Figure 4 The diagram shows other partitioning methods besides the quadtree partitioning method.

[0081] In one embodiment of this application, the process of determining the partitioning method of the current block based on the coding rate loss when the current block is partitioned in other ways can be as follows: obtain the coding rate loss when the current block is not partitioned; if the coding rate loss when the current block is partitioned in other ways is less than the coding rate loss when the current block is not partitioned, then determine that the current block is partitioned using other ways during encoding; if the coding rate loss when the current block is partitioned in other ways is greater than or equal to the coding rate loss when the current block is not partitioned, then determine that the current block is not partitioned during encoding.

[0082] based on Figure 5 Steps S510 to S530 shown in this application, in one embodiment of this application, are as follows: Figure 6 As shown, after step S530, the following steps may also be included:

[0083] Step S610: If it is determined that the quadtree partitioning method cannot be skipped, calculate the coding rate loss of the current block when performing the quadtree partitioning method, and calculate the coding rate loss of the current block when performing other partitioning methods.

[0084] In other words, when estimating the optimal partitioning method for the current block, if the quadtree partitioning method cannot be skipped, then it is necessary to calculate both the coding rate loss of the current block when performing the quadtree partitioning method and the coding rate loss of the current block when performing other partitioning methods.

[0085] Step S620: Obtain the coding rate loss when the current block is not divided. Based on the minimum value among the coding rate loss when the current block is not divided, the coding rate loss when the current block is divided into quadtrees, and the coding rate loss when the current block is divided into other methods, determine the division method of the current block.

[0086] Specifically, if the coding rate loss when the current block is not partitioned is less than the coding rate loss when the current block is partitioned using a quadtree method and the coding rate loss when the current block is partitioned using other methods, then it is determined that the current block will not be partitioned during encoding.

[0087] If the coding rate loss of the current block when using the quadtree partitioning method is less than the coding rate loss when the current block is not partitioned and the coding rate loss when the current block is partitioned in other ways, then it is determined that the current block uses the quadtree partitioning method during encoding.

[0088] If the coding rate loss of the current block when performing other partitioning methods is less than the coding rate loss when the current block is not partitioned and the coding rate loss when the current block is partitioned using a quadtree, then it is determined that the current block should use other partitioning methods during encoding.

[0089] Figure 6 The technical solution of the embodiment shown enables the selection of the partitioning method with the least encoding rate loss to encode the current block when it is determined that the quadtree partitioning method cannot be skipped.

[0090] based on Figure 5 Step S510 shown in this application, in one embodiment of the application, is as follows: Figure 7 As shown, after step S510, the following steps may also be included:

[0091] Step S710: If both motion complexity and scene complexity are higher than the set threshold, calculate the coding rate loss of the current block when performing quadtree partitioning, and calculate the coding rate loss of the current block when performing other partitioning methods.

[0092] That is, if the motion complexity and scene complexity of the current block are both higher than the set threshold, then it is necessary to calculate the coding rate loss of the current block when performing quadtree partitioning, and also to calculate the coding rate loss of the current block when performing other partitioning methods.

[0093] Step S720: Obtain the coding rate loss when the current block is not divided. Based on the minimum value among the coding rate loss when the current block is not divided, the coding rate loss when the current block is divided into quadtrees, and the coding rate loss when the current block is divided into other methods, determine the division method of the current block.

[0094] Specifically, if the coding rate loss when the current block is not partitioned is less than the coding rate loss when the current block is partitioned using a quadtree method and the coding rate loss when the current block is partitioned using other methods, then it is determined that the current block will not be partitioned during encoding.

[0095] If the coding rate loss of the current block when using the quadtree partitioning method is less than the coding rate loss when the current block is not partitioned and the coding rate loss when the current block is partitioned in other ways, then it is determined that the current block uses the quadtree partitioning method during encoding.

[0096] If the coding rate loss of the current block when performing other partitioning methods is less than the coding rate loss when the current block is not partitioned and the coding rate loss when the current block is partitioned using a quadtree, then it is determined that the current block should use other partitioning methods during encoding.

[0097] Figure 7 The technical solution of the embodiment shown enables the current block to be encoded by comparing and selecting the partitioning method with the least encoding rate loss when both the motion complexity and scene complexity of the current block are higher than a set threshold.

[0098] Based on the technical solutions of the foregoing embodiments, in one embodiment of this application, after the current block is encoded, the encoding rate loss of the current block can be collected and stored so that when encoding other blocks in the future, the encoding rate loss of the current block can be referenced to select an appropriate partitioning method.

[0099] In one embodiment of this application, if it is determined that the current block is partitioned using a quadtree partitioning method, then after partitioning the current block, the resulting sub-blocks can be used as the current block to continue determining the partitioning method until no further partitioning is performed or other partitioning methods besides the quadtree partitioning method are used.

[0100] It should be noted that: "no longer dividing" means that the technical solution of the aforementioned embodiment determines that the current block needs to be divided during encoding.

[0101] The following combination Figure 8 and Figure 9 The technical solution of one embodiment of this application will be described in detail below:

[0102] Reference Figure 8 As shown, a video encoding method according to an embodiment of this application includes:

[0103] Step S801: For the current block to be encoded, determine its partitioning method using an adaptive fast partitioning algorithm.

[0104] The adaptive fast partitioning algorithm, as proposed in this embodiment, determines the partitioning method of the current block by analyzing the encoding results of other encoded blocks surrounding it. Its overall process can be found in [reference needed]. Figure 9 As shown.

[0105] Step S802: Determine whether to divide it into four sub-blocks using a quadtree partitioning method (i.e., by...) Figure 4 If the first partitioning method is used to divide the data into four square blocks, then for each sub-block obtained by the partitioning, return to step S801 to recursively perform the partitioning until the quadtree partitioning method is no longer used or no further partitioning is performed; otherwise, proceed to step S803.

[0106] Step S803: If it is determined that the partitioning is not done using a quadtree partitioning method (e.g., no partitioning, or using...) Figure 4 If the partitioning is performed using methods other than quadtree partitioning, then the current block is directly encoded after the partitioning is completed.

[0107] Optionally, the video coding method proposed in this application, namely the adaptive fast partitioning algorithm, has the following flow: Figure 9 As shown, it includes the following steps:

[0108] Step S901: Calculate the motion complexity f, scene complexity g, and coding rate loss square_cost without coding for the current block, and set parameter b_cost = square_cost.

[0109] Optionally, a block-level motion complexity calculation module can be set up to calculate the temporal complexity of the frame to be encoded where the current block is located, and use it as the motion complexity f. Specifically, the optimal coding rate loss of inter-frame predictive coding can be calculated, or the temporal information (TI) of a frame can be calculated, and used as the motion complexity f.

[0110] Simultaneously, a block-level scene complexity calculation module can be set up to calculate the spatial complexity of the frame to be encoded containing the current block, which is then used as the scene complexity g. Specifically, the optimal coding rate loss for intra-frame predictive coding can be calculated, or the spatial information (SI) of a block can be calculated, and this can be used as the scene complexity g.

[0111] Step S902: Determine whether the motion complexity f < h or the scene complexity g < i is true. If the motion complexity f < h or the scene complexity g < i, then execute steps S903a and S903b. If neither the motion complexity f < h nor the scene complexity g < i is true, then execute step S906.

[0112] Step S903a: Collect the total coding rate consumption 'a' and the number 'b' of the encoded blocks of the same size around the target coding block where the current block is located (usually the block above or to the left of the current block, or blocks in other positions).

[0113] Step S903b: Collect the total coding rate consumption c and the number d of the encoded blocks of the same size as the current block in the target coding block where the current block is located.

[0114] It should be noted that the target coding block is the largest block in which the current block is located. For example, in the AV1 standard, the target coding block can be a 128×128 block in which the current block is located; or it can be a larger block in which the current block is located. For example, if the size of the current block is 32×32, then the target coding block can also be a 64×64 block in which the current block is located.

[0115] Step S904: Calculate the parameter value e based on a, b, c, and d.

[0116] Optionally, an average coding rate consumption m can be calculated based on a and b, and an average coding rate consumption n can be calculated based on c and d. Then, m and n are weighted and summed to obtain the parameter value e.

[0117] Step S905: Determine whether e >> square_cost holds. If so, execute Step S908; otherwise, execute Step S906.

[0118] That is, if the parameter value e is much greater than square_cost (i.e., the difference between e and square_cost is greater than a set threshold), then when estimating the partitioning method, the quadtree partitioning can be skipped and Step S908 can be directly executed; otherwise, the quadtree partitioning cannot be skipped.

[0119] Step S906: Calculate the optimal cost value split_cost for the current block to perform quadtree partitioning.

[0120] Step S907: If split_cost < square_cost, then b_cost = split_cost; otherwise, b_cost = square_cost. That is, by comparing split_cost and square_cost, determine the minimum value between split_cost and square_cost and use it as b_cost for subsequent partitioning method decisions.

[0121] Step S908: Calculate the optimal cost value other_cost for the current block to perform other partitioning.

[0122] Optionally, the other partitioning is Figure 4 the other partitioning methods except the quadtree partitioning method among the 9 partitioning methods shown in

[0123] Step S909: Determine whether other_cost < b_cost holds. If so, execute Step S911; otherwise, execute Step S910.

[0124] It should be noted that: if directly jumping from Step S905 to Step S908, then the value of b_cost is square_cost. At this time, Step S909 actually compares other_cost and square_cost.

[0125] Step S910: If b_cost = split_cost, then the optimal partitioning method for the current block is quadtree partitioning; if b_cost = square_cost, then the current block is not partitioned.

[0126] If b_cost = split_cost, then other_cost > split_cost, and a quadtree partitioning method needs to be selected; if b_cost = square_cost, then other_cost > square_cost, and no partitioning is needed.

[0127] Step S911: The optimal partitioning method for the current block is other partitioning methods.

[0128] That is, if other_cost is minimized, then other partitioning methods can be chosen.

[0129] It should be noted that after determining the partitioning method, the current block can be encoded, and the coding rate loss of the current block during encoding can be collected through the partitioning information collection module. This loss is then added to the information statistics of the target coding block (such as the largest block) to which the current block belongs, for reference when making decisions on the partitioning method of other coding blocks. Simultaneously, after the current block is encoded, such as... Figure 8 As shown, when the current block uses a quadtree partitioning method, each sub-block needs to be recursively processed to execute... Figure 9 The process continues until the quadtree partitioning method is no longer used or no further partitioning is performed.

[0130] based on Figure 8 and Figure 9 The technical solutions of the illustrated embodiments, such as Figure 10 As shown, the optimal block partitioning mode can be quickly determined through the block-level motion complexity calculation module 1002, the block-level scene complexity calculation module 1004, the block-level adaptive partitioning fast decision module 1006, and the partitioning information collection module 1008.

[0131] The block-level motion complexity calculation module 1002 is used to calculate the motion complexity of the current block, which is derived based on the current block and the corresponding blocks in its reference frame; the block-level scene complexity calculation module 1004 is used to calculate the scene complexity of the current block, which is an estimation and analysis of the complexity of the current block itself; the block-level adaptive partitioning fast decision module 1006 is used to... Figure 9 The process shown is used to make the partitioning method decision; the partitioning information collection module 1008 is used to collect the coding rate loss of the current block during the encoding after the current block is encoded, and then add it to the information statistics of the target coding block (such as the largest block) where the current block is located, so as to make reference when making partitioning method decisions for other coding blocks.

[0132] The technical solution of this application is universal and applicable to any encoding scenario. It significantly improves encoding speed, enhances video smoothness, and optimizes user experience while ensuring video encoding quality and compression efficiency. Experiments show that the technical solution of this application can increase encoding speed by 5% without significant loss of video compression efficiency.

[0133] Figure 11 A block diagram of a video encoding apparatus according to an embodiment of the present application is shown. The video encoding apparatus can be installed in a device with computing processing capabilities, such as a terminal device or a server.

[0134] Reference Figure 11 As shown, a video encoding apparatus 1100 according to an embodiment of this application includes: a calculation unit 1102, an acquisition unit 1104, a first processing unit 1106, and a second processing unit 1108.

[0135] The calculation unit 1102 is configured to calculate at least one of the motion complexity and scene complexity of the current block, wherein the motion complexity is calculated based on the temporal information of the current block and the scene complexity is calculated based on the spatial information of the current block; the acquisition unit 1104 is configured to acquire the encoding results of other encoded blocks surrounding the current block if at least one of the motion complexity and the scene complexity is lower than a set threshold; the first processing unit 1106 is configured to determine whether the current block can skip the quadtree partitioning method when estimating the optimal partitioning method based on the encoding results of the other blocks; and the second processing unit 1108 is configured to determine the partitioning method of the current block based on the coding rate loss of the current block when performing other partitioning methods if it is determined that the quadtree partitioning method can be skipped.

[0136] In some embodiments of this application, based on the foregoing scheme, the acquisition unit 1104 is configured to: acquire the first total coding rate consumption of the surrounding encoded blocks of the target coding block containing the current block that are the same size as the current block, and the first number of surrounding encoded blocks of the target coding block that are the same size as the current block; acquire the second total coding rate consumption of the surrounding encoded blocks of the target coding block that are the same size as the current block, and the second number of surrounding encoded blocks of the target coding block that are the same size as the current block; and use the first total coding rate consumption, the first number, the second total coding rate consumption, and the second number as the encoding results of other encoded blocks surrounding the current block.

[0137] In some embodiments of this application, based on the foregoing scheme, the first processing unit 1106 is configured to: calculate a target parameter for evaluating the coding rate loss based on the first total coding rate consumption, the first quantity, the second total coding rate consumption, and the second quantity; obtain the coding rate loss when the current block is not partitioned; if the difference between the target parameter and the coding rate loss when the current block is not partitioned is greater than a set threshold, then determine that the current block can skip the quadtree partitioning method when estimating the optimal partitioning method.

[0138] In some embodiments of this application, based on the foregoing scheme, the first processing unit 1106 is configured to: calculate a first average coding bitrate consumption based on the first total coding bitrate consumption and the first quantity; calculate a second average coding bitrate consumption based on the second total coding bitrate consumption and the second quantity; perform a weighted summation on the first average coding bitrate consumption and the second average coding bitrate consumption, and use the result of the weighted summation as the target parameter.

[0139] In some embodiments of this application, based on the foregoing scheme, the second processing unit 1108 is configured to: obtain the coding rate loss when the current block is not divided; if the coding rate loss of the current block when it is divided in other ways is less than the coding rate loss when the current block is not divided, then determine that the current block is divided using the other division method during encoding; if the coding rate loss of the current block when it is divided in other ways is greater than or equal to the coding rate loss when the current block is not divided, then determine that the current block is not divided during encoding.

[0140] In some embodiments of this application, based on the foregoing scheme, the video encoding device 1100 further includes: a third processing unit configured to, if it is determined that the quadtree partitioning method cannot be skipped, calculate the encoding bitrate loss of the current block when performing the quadtree partitioning method, and calculate the encoding bitrate loss of the current block when performing other partitioning methods; obtain the encoding bitrate loss of the current block when not partitioning; and determine the partitioning method of the current block based on the minimum value among the encoding bitrate loss of the current block when not partitioning, the encoding bitrate loss of the current block when performing the quadtree partitioning method, and the encoding bitrate loss of the current block when performing other partitioning methods.

[0141] In some embodiments of this application, based on the foregoing scheme, the video encoding device 1100 further includes: a fourth processing unit, configured to: if both the motion complexity and the scene complexity are higher than the set threshold, calculate the encoding bitrate loss of the current block when performing the quadtree partitioning method, and calculate the encoding bitrate loss of the current block when performing other partitioning methods; obtain the encoding bitrate loss when the current block is not partitioned; and determine the partitioning method of the current block based on the minimum value among the encoding bitrate loss when the current block is not partitioned, the encoding bitrate loss when the current block is performed the quadtree partitioning method, and the encoding bitrate loss when the current block is performed other partitioning methods.

[0142] In some embodiments of this application, based on the foregoing scheme, the partitioning method of the current block is determined according to the minimum value among the coding rate loss when the current block is not partitioned, the coding rate loss when the current block is partitioned using the quadtree method, and the coding rate loss when the current block is partitioned using other methods, including:

[0143] If the coding rate loss when the current block is not partitioned is less than the coding rate loss when the current block is partitioned using the quadtree method and the coding rate loss when the current block is partitioned using other methods, then it is determined that the current block will not be partitioned during encoding.

[0144] If the coding rate loss of the current block when performing the quadtree partitioning method is less than the coding rate loss when the current block is not partitioned and the coding rate loss when the current block is performed in other partitioning methods, then it is determined that the current block adopts the quadtree partitioning method during encoding.

[0145] If the coding rate loss of the current block when performing other partitioning methods is less than the coding rate loss when the current block is not partitioned and the coding rate loss of the current block when performing the quadtree partitioning method, then it is determined that the current block adopts the other partitioning method during encoding.

[0146] In some embodiments of this application, based on the foregoing scheme, the computing unit 1102 is configured to calculate the motion complexity of the current block in the following ways: calculate the optimal coding rate loss when the frame to be encoded in which the current block is located adopts inter-frame predictive coding, and use it as the motion complexity of the current block; or calculate the temporal information (TI) of the frame to be encoded in which the current block is located, and use it as the motion complexity of the current block.

[0147] In some embodiments of this application, based on the foregoing scheme, the computing unit 1102 is configured to calculate the scene complexity of the current block in the following ways: calculate the optimal coding rate loss when the frame to be encoded in which the current block is located adopts intra-frame predictive coding, and use it as the scene complexity of the current block; or calculate the spatial information SI (i.e., Spatial Information) of the frame to be encoded in which the current block is located, and use it as the scene complexity of the current block.

[0148] In some embodiments of this application, based on the foregoing scheme, the video encoding device 1100 further includes: a control unit configured to, if it is determined that the current block is divided using the quadtree partitioning method, after dividing the current block, use the sub-blocks obtained from the partitioning as the current block to continue determining the partitioning method, until no further partitioning is performed or other partitioning methods besides the quadtree partitioning method are used for partitioning.

[0149] In some embodiments of this application, based on the foregoing scheme, the video encoding device 1100 further includes: a storage unit configured to collect the encoding rate loss of the current block and store the encoding rate loss of the current block after the current block is encoded.

[0150] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.

[0151] It should be noted that, Figure 12 The computer system 1200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0152] like Figure 12 As shown, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1202 or programs loaded from storage portion 1208 into Random Access Memory (RAM) 1203, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1203. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. An Input / Output (I / O) interface 1205 is also connected to bus 1204.

[0153] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, 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, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.

[0154] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs various functions defined in the system of this application.

[0155] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0157] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0158] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0159] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0160] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.

[0161] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0162] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method of video coding, the method comprising: The method comprises: calculating at least one of motion complexity and scene complexity of a current block, the motion complexity being calculated according to time domain information of the current block, and the scene complexity being calculated according to spatial domain information of the current block; if at least one of the motion complexity and the scene complexity is lower than a set threshold, obtaining coding results of other blocks around the current block which have been coded, wherein the coding results of the other blocks comprise a first number and a first total amount of coding bit rate consumption of coded blocks around a target coding block in which the current block is located and which have the same size as the current block, and a second number and a second total amount of coding bit rate consumption of coded blocks in the target coding block and which have the same size as the current block; calculating a target parameter for evaluating coding bit rate loss according to the first total amount of coding bit rate consumption, the first number, the second total amount of coding bit rate consumption and the second number; if a difference between the target parameter and coding bit rate loss when the current block is not divided is greater than a set threshold, determining that the current block can skip a quad-tree division mode when estimating an optimal division mode; if it is determined that the current block can skip the quad-tree division mode, determining a division mode of the current block based on coding bit rate loss when the current block is divided in other division modes.

2. The video coding method of claim 1, wherein, The method further comprises: calculating a first average coding bit rate consumption according to the first total amount of coding bit rate consumption and the first number; calculating a second average coding bit rate consumption according to the second total amount of coding bit rate consumption and the second number; performing weighted summation on the first average coding bit rate consumption and the second average coding bit rate consumption, and taking a result of the weighted summation as the target parameter.

3. The video coding method of claim 1, wherein, The method further comprises: obtaining coding bit rate loss when the current block is not divided; if coding bit rate loss when the current block is divided in other division modes is less than coding bit rate loss when the current block is not divided, determining that the current block is divided in the other division modes when being coded; if coding bit rate loss when the current block is divided in other division modes is greater than or equal to coding bit rate loss when the current block is not divided, determining that the current block is not divided when being coded.

4. The video coding method of claim 1, wherein, The method further comprises: if it is determined that the current block cannot skip the quad-tree division mode, calculating coding bit rate loss when the current block is divided in the quad-tree division mode, and calculating coding bit rate loss when the current block is divided in other division modes; obtaining coding bit rate loss when the current block is not divided; The coding mode of the current block is determined according to the minimum value among the coding rate loss when the current block is not divided, the coding rate loss when the current block is divided in the quad-tree division mode, and the coding rate loss when the current block is divided in other division modes.

5. The video coding method of claim 1, wherein, The video coding method further comprises: If the motion complexity and the scene complexity are both higher than the set threshold, the coding rate loss when the current block is divided in the quad-tree division mode is calculated, and the coding rate loss when the current block is divided in other division modes is calculated; The coding rate loss when the current block is not divided is obtained; The coding mode of the current block is determined according to the minimum value among the coding rate loss when the current block is not divided, the coding rate loss when the current block is divided in the quad-tree division mode, and the coding rate loss when the current block is divided in other division modes.

6. The video coding method of claim 4 or 5, wherein, The coding mode of the current block is determined according to the minimum value among the coding rate loss when the current block is not divided, the coding rate loss when the current block is divided in the quad-tree division mode, and the coding rate loss when the current block is divided in other division modes, comprising: If the coding rate loss when the current block is not divided is smaller than the coding rate loss when the current block is divided in the quad-tree division mode and the coding rate loss when the current block is divided in other division modes, it is determined that the current block is not divided during coding; If the coding rate loss when the current block is divided in the quad-tree division mode is smaller than the coding rate loss when the current block is not divided and the coding rate loss when the current block is divided in other division modes, it is determined that the current block adopts the quad-tree division mode during coding; If the coding rate loss when the current block is divided in other division modes is smaller than the coding rate loss when the current block is not divided and the coding rate loss when the current block is divided in the quad-tree division mode, it is determined that the current block adopts the other division mode during coding.

7. The video coding method of any of claims 1-5, wherein, The motion complexity of the current block is calculated by: Calculating the optimal coding rate loss when the frame where the current block is located is encoded by using inter-frame prediction, as the motion complexity of the current block; or Calculating the time information TI of the frame where the current block is located, as the motion complexity of the current block.

8. The video coding method of any of claims 1-5, wherein, The scene complexity of the current block is calculated by: Calculating the optimal coding rate loss when the frame where the current block is located is encoded by using intra-frame prediction, as the scene complexity of the current block; or Calculating the spatial information SI of the frame where the current block is located, as the scene complexity of the current block. The video coding method further comprises:

9. The video coding method of any of claims 1-5, wherein, If it is determined that the current block adopts the quad-tree division mode for division, after the current block is divided, the sub-blocks obtained by division are taken as the current block to continue to determine the adopted division mode, until no further division is performed or other division modes except the quad-tree division mode are adopted for division. The video coding method further comprises:

10. The video coding method of any of claims 1-5, wherein, ​ After the encoding of the current block is completed, the encoding code rate loss of the current block is collected and stored.

11. A video encoding apparatus, comprising: The method comprises: a calculation unit configured to calculate at least one of a motion complexity and a scene complexity of the current block, the motion complexity being calculated according to time domain information of the current block, and the scene complexity being calculated according to spatial domain information of the current block; an acquisition unit configured to, if at least one of the motion complexity and the scene complexity is lower than a set threshold, acquire encoding results of other blocks that have been encoded around the current block; wherein the encoding results of the other blocks include a first number and a first total encoding code rate consumption of encoded blocks that are the same size as the current block and are around a target encoding block in which the current block is located, and a second number and a second total encoding code rate consumption of encoded blocks that are the same size as the current block and are within the target encoding block; a first processing unit configured to calculate a target parameter for evaluating encoding code rate loss according to the first total encoding code rate consumption, the first number, the second total encoding code rate consumption and the second number, and determine that the current block can skip a quadtree partitioning mode when estimating an optimal partitioning mode if a difference between the target parameter and an encoding code rate loss when the current block is not partitioned is greater than a set threshold; a second processing unit configured to, if it is determined that the current block can skip the quadtree partitioning mode, determine a partitioning mode of the current block based on encoding code rate losses of the current block when other partitioning modes are performed.

12. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by a processor to implement the video encoding method in any one of claims 1 to 10.

13. An electronic device, comprising: The method comprises: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the video encoding method in any one of claims 1 to 10.

14. A computer program product, characterised in that, The computer program product comprises a computer program stored in a computer readable storage medium, and a processor of a computer device reads and executes the computer program from the computer readable storage medium, so that the computer device executes the video encoding method in any one of claims 1 to 10.

15. A method of storing a video bitstream, the method comprising: The video encoding method in any one of claims 1 to 10 is executed to generate a video bitstream; and the video bitstream is stored.

Citation Information

Patent Citations

  • Coding management method and apparatus based on high efficiency video coding

    WO2020248715A1