Video encoding method, apparatus, device, and storage medium
By using the encoding information of the reference coding unit to encode the unit to be encoded in video coding, the problem of high encoding complexity under the VVC standard is solved, and more efficient video coding is achieved.
Patent Information
- Application Number
- CN202310025114.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2043-01-09
AI Technical Summary
Existing video coding technologies have high coding complexity under the Multifunctional Video Coding (VVC)/H.266 standard, resulting in low coding efficiency.
By obtaining the first division method of the unit to be encoded in the coding block of the video frame, if the target division condition is met, the reference coding information of the reference coding unit is obtained from the buffer space, and the unit to be encoded is encoded using the coding information of the reference coding unit, thereby reducing the coding complexity.
It simplifies the video encoding process and improves encoding efficiency.
Smart Images

Figure CN116055734B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to video encoding methods, video encoding apparatus, computer equipment, and computer-readable storage media. Background Technology
[0002] With the rapid development of internet technology, video has become widely used and is gradually replacing text as an important way to acquire knowledge and information. During video transmission, due to the large amount of video data, video encoding technology is usually used to encode the video data into a video stream before transmission. Among them, Versatile Video Coding (VVC) / H.266 is a new generation video coding standard with higher encoding performance than High Efficiency Video Coding (HEVC) / H.265. When using VVC for video encoding, a coding block in a video frame can be divided into multiple coding units (CUs) through different partitioning methods. When encoding multiple coding units, these units can be further divided into multiple sub-coding units through different partitioning methods. The encoder needs to traverse different partitioning methods and finally select the optimal partitioning method. Since there are many combinations of different partitioning methods, this makes the encoding complexity high. Summary of the Invention
[0003] This application provides a video encoding method, apparatus, device, and storage medium, which can reduce the complexity of video encoding and improve video encoding efficiency.
[0004] On one hand, embodiments of this application provide a video encoding method, which includes: obtaining a first partitioning method corresponding to a unit to be encoded in an encoding block of a video frame; the unit to be encoded is obtained by partitioning the encoding block using the first partitioning method; if the first partitioning method satisfies a target partitioning condition, then obtaining reference encoding information of a reference encoding unit of the unit to be encoded from the cache space corresponding to the encoding block; wherein, the reference encoding unit is obtained by partitioning the encoding block using a second partitioning method; the second partitioning method is different from the first partitioning method; the feature information of the reference encoding unit is matched with the feature information of the unit to be encoded; and the unit to be encoded is encoded using the reference encoding information of the reference encoding unit to obtain the target encoding information of the unit to be encoded.
[0005] On one hand, embodiments of this application provide a video encoding apparatus, the apparatus comprising:
[0006] The acquisition unit is used to acquire the first partitioning method corresponding to the unit to be encoded in the coding block of the video frame; the unit to be encoded is obtained by partitioning the coding block using the first partitioning method; if the first partitioning method satisfies the target partitioning condition, the reference coding information of the reference coding unit of the unit to be encoded is acquired from the buffer space corresponding to the coding block; wherein, the reference coding unit is obtained by partitioning the coding block using a second partitioning method; the second partitioning method is different from the first partitioning method; the feature information of the reference coding unit matches the feature information of the unit to be encoded.
[0007] The processing unit is used to encode the unit to be encoded using the reference encoding information of the reference encoding unit to obtain the target encoding information of the unit to be encoded.
[0008] In some embodiments, the first partitioning method satisfying the target partitioning condition includes: the first partitioning method being a quadtree partitioning method; or, the first partitioning method being a combination of a vertical binary tree partitioning method and a horizontal binary tree partitioning method.
[0009] In some embodiments, the processing unit is further configured to determine the position of the unit to be encoded in the coding block; if the position of the unit to be encoded in the coding block is a first position, then determine the target coding information of the unit to be encoded as the reference coding information of the reference coding unit; the acquisition unit is further configured to, if the position of the unit to be encoded in the coding block is a second position, acquire the reference partitioning method of the reference coding unit from the reference coding information of the reference coding unit; the processing unit is further configured to, according to the reference partitioning method, use all or part of the partitioning methods in the optional partitioning method set to perform block partitioning processing on the unit to be encoded respectively, to obtain at least one sub-coding unit of the unit to be encoded; encode the at least one sub-coding unit to obtain the sub-coding information of the at least one sub-coding unit; determine the target coding information of the unit to be encoded according to the sub-coding information of the at least one sub-coding unit; wherein, the first position is determined according to the starting coding position of the coding block, and the second position is a position in the coding block other than the first position.
[0010] In some embodiments, the optional partitioning method set includes a no-partitioning method. The processing unit is further configured to, if the reference partitioning method is a no-partitioning method, use all partitioning methods in the optional partitioning method set to perform block partitioning processing on the unit to be encoded to obtain at least one sub-coding unit of the unit to be encoded; if the reference partitioning method is not a no-partitioning method, use partitioning methods other than the no-partitioning method in the optional partitioning method set to perform block partitioning processing on the unit to be encoded to obtain multiple sub-coding units of the unit to be encoded.
[0011] In some embodiments, at least one sub-coding unit includes a first sub-coding unit, which is obtained by performing block partitioning on the unit to be encoded using a non-partitioning method. The acquisition unit is further configured to, if the reference partitioning method is a non-partitioning method, acquire reference coding mode information of the reference coding unit from the reference coding information. The processing unit is further configured to, based on the reference coding mode information, determine the coding mode information of the first sub-coding unit; and, based on the coding mode information of the first sub-coding unit, encode the first sub-coding unit to obtain the sub-coding information of the first sub-coding unit.
[0012] In some embodiments, the processing unit is further configured to perform block partitioning processing on the coding blocks of the video frame using a second partitioning method to obtain target coding units of the coding blocks; if the second partitioning method satisfies the target partitioning condition, the target coding unit is used as a reference coding unit; the coding information of the reference coding unit is determined, and if the cache information at the position corresponding to the target coding unit in the cache space corresponding to the coding block is empty, the coding information of the reference coding unit is stored as reference coding information in the cache space corresponding to the coding block.
[0013] In some embodiments, the processing unit is further configured to, if the first partitioning method does not meet the target partitioning condition, use all partitioning methods in the optional partitioning method set to perform block partitioning processing on the unit to be encoded to obtain multiple sub-coding units of the unit to be encoded; encode the multiple sub-coding units to obtain sub-coding information of the multiple sub-coding units; and determine the target encoding information of the unit to be encoded based on the sub-coding information of the multiple sub-coding units.
[0014] Accordingly, this application also provides a computer device, including: a processor, a communication interface, and a memory, wherein the processor, the communication interface, and the memory are interconnected, wherein the memory stores executable program code, and the processor is used to call the executable program code to implement the method in this application embodiment.
[0015] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the embodiments of this application.
[0016] Accordingly, this application also provides a computer program product, which includes a computer program or computer instructions, which, when executed by a processor, implement the methods in this application.
[0017] Accordingly, this application provides a computer program that 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 method described in this application.
[0018] By implementing the embodiments of this application, when the first partitioning method corresponding to the unit to be encoded meets the target partitioning conditions, the unit to be encoded can be encoded using the reference encoding information of the reference encoding unit. This approach, compared to encoding by fully traversing the partitioning method of the unit to be encoded, fully utilizes the encoding information generated during the encoding process, simplifying the encoding process and reducing the complexity of video encoding, thereby improving the efficiency of video encoding. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of six H.266 partitioning methods in the embodiments of this application;
[0021] Figure 2 This is a schematic diagram of the architecture of a video encoding system provided in an embodiment of this application;
[0022] Figure 3 This is a flowchart illustrating a video encoding method provided in an embodiment of this application;
[0023] Figure 4A This is a schematic diagram of a unit to be encoded and a reference encoding unit provided in an embodiment of this application;
[0024] Figure 4B This is a schematic diagram of an encoding block provided in an embodiment of this application;
[0025] Figure 4C This is a schematic diagram illustrating a block partitioning process for a unit to be encoded, provided in an embodiment of this application.
[0026] Figure 4D This is a schematic diagram illustrating a possible division method of the unit to be encoded, provided in an embodiment of this application.
[0027] Figures 5A-5B This is a flowchart illustrating another video encoding method provided in an embodiment of this application;
[0028] Figure 6 This is a schematic diagram of the structure of a video encoding device provided in an embodiment of this application;
[0029] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0031] To better understand the solutions of the embodiments of this application, some nouns and terms that may be involved in the embodiments of this application are explained below.
[0032] (1) H.266 / VCC (Multi-Functional Video Coding): H.266 / VCC is a video coding standard that improves the average coding performance by nearly 50% compared to the previous generation video coding standard H.265 / HEVC (High-Efficiency Video Coding). In other words, video streams of the same quality using H.266 require less storage space and less bandwidth.
[0033] (2) Block Partitioning: Video coding can be performed using block partitioning. During the encoding process, a coding block (also called an image block) in a video frame can be divided into several non-overlapping coding units (CUs) using different partitioning methods. Each CU is then encoded sequentially, and finally, the optimal partitioning method for the coding block is selected. H.266 includes six partitioning methods: no partitioning, horizontal binary tree partitioning (abbreviated as horizontal binary partitioning), vertical binary tree partitioning (abbreviated as vertical binary partitioning), quadtree partitioning (abbreviated as quadtree partitioning), horizontal ternary tree partitioning (abbreviated as horizontal ternary partitioning), and vertical ternary tree partitioning (abbreviated as vertical ternary partitioning). For an example, please refer to [link to example]. Figure 1 , Figure 1 This is a schematic diagram illustrating six H.266 partitioning methods in embodiments of this application. Among them, Figure 1 In the diagram, 101 indicates no division, 102 indicates a horizontal two-part division, 103 indicates a vertical two-part division, 104 indicates a four-part division, 105 indicates a horizontal three-part division, and 106 indicates a vertical three-part division.
[0034] (3) Predictive coding: Predictive coding includes intra-frame prediction and inter-frame prediction modes. During coding, the most suitable predictive coding mode needs to be selected from a variety of possible predictive coding modes for the current CU. When using intra-frame prediction for coding, information from other video frames is not referenced; when using inter-frame prediction for coding, information from adjacent video frames is used for coding prediction.
[0035] This application provides a video coding method that, for a unit to be encoded within a coding block of a video frame, can obtain a first partitioning method corresponding to that unit. The unit to be encoded is obtained by partitioning the coding block using the first partitioning method. If the first partitioning method satisfies the target partitioning condition, reference coding information of a reference coding unit for that unit can be obtained from the buffer space corresponding to the coding block. Here, the reference coding unit is obtained by partitioning the coding block using a second partitioning method different from the first partitioning method, and the feature information of the reference coding unit matches the feature information of the unit to be encoded. Then, by using the reference coding information of the reference coding unit to encode the unit to be encoded, the target coding information of the unit to be encoded can be obtained. In this way, the coding information generated during the encoding process can be reused to encode the unit to be encoded, thereby reducing the complexity of video coding and improving its efficiency.
[0036] Please see Figure 2 , Figure 2 This is a schematic diagram of the architecture of a video encoding system provided in an embodiment of this application. Figure 2 As shown, the video encoding system may include a terminal device 201 and a server 202. The terminal device 201 and the server 202 can communicate via a wired network or a wireless network. It is understood that... Figure 2 The architecture shown is merely an example and does not constitute a limitation on the embodiments of this application. In practical applications, it may include different architectures. Figure 2 The number of terminal devices and servers shown.
[0037] Among them, terminal device 201 can be a personal computer, laptop computer, smartphone, tablet computer, smartwatch, smart voice interaction device, smart home appliance, vehicle terminal, and smart wearable device, but is not limited to these. Server 202 can be an independent physical server, 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 communication, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms.
[0038] It is understood that the video encoding method provided in this application embodiment can be executed by terminal device 201, server 202, or jointly executed by terminal device 201 and server 202. This application embodiment does not limit this.
[0039] It should be noted that the video encoding method provided in this application embodiment can be applied to the H.266 / VVC standard, the H.265 / HEVC standard, or the next-generation video codec standard, and this application embodiment is not limited to this.
[0040] Please see Figure 3 , Figure 3 This is a flowchart illustrating a video encoding method provided in an embodiment of this application. Figure 3 As shown, the method may include, but is not limited to, the following steps:
[0041] S301, Obtain the first partitioning method corresponding to the unit to be encoded in the encoding block of the video frame.
[0042] In this context, video is a series of images (called video frames) displayed at a given frequency. By splitting the video into frames, a single video frame, or image, can be obtained. During video encoding, a single video frame can be divided into multiple coding blocks for encoding. Each coding block can be further divided into at least one coding unit, and then each coding unit is encoded. In this embodiment, the unit to be encoded is the coding unit currently being encoded, which is obtained by dividing the coding block using a first partitioning method.
[0043] It is understandable that using the first partitioning method to divide the coded block can yield at least one coded unit, for example, by using... Figure 1 The four-partition method 104 can divide the coding block into four coding units, and the coding unit can be any one of at least one coding unit.
[0044] S302, if the first partitioning method satisfies the target partitioning condition, then the reference encoding information of the reference encoding unit of the unit to be encoded is obtained from the cache space corresponding to the encoding block.
[0045] If the first partitioning method satisfies the target partitioning conditions, the reference coding information of the reference coding unit of the unit to be encoded can be obtained from the cache space corresponding to the coding block. The reference coding unit is obtained by partitioning the coding block using the second partitioning method, which is a different partitioning method from the first partitioning method. The feature information of the reference coding unit matches the feature information of the unit to be encoded. In other words, the reference coding unit of the unit to be encoded is a coding unit that matches the feature information of the unit to be encoded by partitioning the coding block using a different partitioning method.
[0046] In some embodiments, the first partitioning method can be a single partitioning method or a combination of multiple partitioning methods. When the first partitioning method is a single partitioning method, the first partitioning method satisfying the target partitioning condition can be that the first partitioning method is a quadtree partitioning method (i.e., Figure 1 The four partitioning methods in 104); when the first partitioning method is a combination of multiple partitioning methods, the first partitioning method that satisfies the target partitioning condition can be a vertical binary tree partitioning method (i.e. Figure 1 The vertical binary partitioning method (103) and the horizontal binary tree partitioning method (i.e. Figure 1 The combination of the horizontal binary partitioning method 102) is as follows. The combination of the vertical binary tree partitioning method and the horizontal binary tree partitioning method can be: first, the coding block is partitioned using the vertical binary tree partitioning method to obtain two coding sub-blocks; then, at least one of the two coding sub-blocks is partitioned using the horizontal binary tree partitioning method. Alternatively, the coding block is partitioned using the horizontal binary tree partitioning method to obtain two coding sub-blocks; then, at least one of the two coding sub-blocks is partitioned using the vertical binary tree partitioning method. This application does not limit this approach.
[0047] If the first partitioning method corresponding to the unit to be encoded satisfies the target partitioning condition, it means that among the coded units obtained by partitioning the coded block using other partitioning methods, there exists a reference coded unit that matches the unit to be encoded. Matching the unit to be encoded with the reference coded unit can be achieved by matching the feature information of the unit to be encoded with the feature information of the reference coded unit. The feature information of the coded unit can include the size information of the coded unit and its position information within the coded block.
[0048] In some embodiments, matching the feature information of the unit to be encoded with the feature information of the reference encoded unit can mean that the feature information of the unit to be encoded is the same as that of the reference encoded unit. For example, it can mean that the size information of the unit to be encoded is the same as that of the reference encoded unit, and that the position information of the unit to be encoded in the encoding block is the same as that of the reference encoded unit in the encoding block. Specifically, the size information of the unit to be encoded being the same as that of the reference encoded unit can mean that the width and height of the unit to be encoded are the same; the position information of the unit to be encoded in the encoding block being the same as that of the reference encoded unit can mean that the coordinates of the upper left corner of the unit to be encoded in the encoding block are the same.
[0049] For example, such as Figure 4A As shown, Figure 4A This is a schematic diagram of a unit to be encoded and a reference encoded unit provided in an embodiment of this application. Figure 4A The unit to be encoded 401 is obtained by partitioning the coding block 40 using a quadtree partitioning method. The reference coding unit 402 for the unit to be encoded 401 is obtained by first partitioning the coding block 40 using a vertical binary tree partitioning method to obtain a coding sub-block 41, and then partitioning the coding sub-block 41 using a horizontal binary tree partitioning method. The width and height of the unit to be encoded 401 are the same as those of the reference coding unit 402, and the coordinates of the upper left corner of the unit to be encoded 401 in the coding block are the same as those of the upper left corner of the reference coding unit 402 in the coding block. Therefore, it can be seen that the feature information of the unit to be encoded 401 matches the feature information of its reference coding unit 402.
[0050] In some embodiments, matching the feature information of the unit to be encoded with the feature information of the reference encoded unit can also mean that the feature information of the unit to be encoded and the feature information of the reference encoded unit are similar. For example, the similarity between the feature information of the unit to be encoded and the feature information of the reference encoded unit can be calculated to determine whether the feature information of the unit to be encoded and the feature information of the reference encoded unit are similar. If the similarity is within a preset value range, the feature information of the unit to be encoded and the feature information of the reference encoded unit are determined to be similar, that is, the feature information of the unit to be encoded and the feature information of the reference encoded unit are matched; if the similarity exceeds the preset value range, the feature information of the unit to be encoded and the feature information of the reference encoded unit are determined to be dissimilar, that is, the feature information of the unit to be encoded and the feature information of the reference encoded unit are not matched.
[0051] In some embodiments, before obtaining the reference encoding information of the reference encoding unit of the unit to be encoded from the cache space corresponding to the encoding block, it can be determined whether the reference encoding information of the reference encoding unit exists in the cache space corresponding to the encoding block. If the reference encoding information of the reference encoding unit exists in the cache space corresponding to the encoding block, it means that the cache space corresponding to the encoding block contains encoding information that the unit to be encoded can reuse. If the reference encoding information of the reference encoding unit does not exist in the cache space corresponding to the encoding block, the encoding information of the unit to be encoded can be determined and then stored in the cache space corresponding to the encoding block.
[0052] The reference coding information of the reference coding unit can be stored before obtaining the first partitioning method corresponding to the unit to be coded. Specifically, the reference coding information of the reference coding unit can be stored by performing block partitioning processing on the coding blocks of the video frame using a second partitioning method to obtain the target coding unit of the coding block. If the second partitioning method satisfies the target partitioning condition, the target coding unit can be used as the reference coding unit. Then, the coding information of the reference coding unit is determined, and if the cache information at the corresponding position of the target coding unit in the cache space corresponding to the coding block is empty, the coding information of the reference coding unit can be stored as reference coding information in the cache space corresponding to the coding block. Here, each coding block in the video frame can have a corresponding cache space created, and the cache space corresponding to each coding block can be divided into different cache areas for storing the coding information of different coding units.
[0053] For example, such as Figure 4B As shown, the coding block 42 can be divided into four coding units (coding unit A, coding unit B, coding unit C, and coding unit D). Correspondingly, the cache space for coding block 42 can be divided into four different cache regions (e.g., cache region 1, cache region 2, cache region 3, and cache region 4), used to store the coding information of coding units A, B, C, and D, respectively. It is worth noting that since different partitioning methods can be used to divide the coding block during the encoding process, typically, the cache space corresponding to the coding block stores the coding information of the coding units obtained from the first block partitioning process using a partitioning method that meets the target partitioning conditions.
[0054] S303: Encode the unit to be encoded using the reference coding information of the reference coding unit to obtain the target coding information of the unit to be encoded.
[0055] After obtaining the reference coding information of the reference coding unit of the unit to be coded, the unit to be coded can be encoded using the reference coding information of the reference coding unit to obtain the target coding information of the unit to be coded.
[0056] In some embodiments, when encoding a unit to be encoded using the reference encoding information of a reference encoding unit, the position of the unit to be encoded within the encoding block needs to be considered. Different positions of the unit to be encoded within the encoding block will result in different encoding information being used. Specifically, if the unit to be encoded is at a first position within the encoding block, the target encoding information of the unit to be encoded can be determined to be the reference encoding information of the reference encoding unit. If the unit to be encoded is at a second position within the encoding block, the reference partitioning method of the reference encoding unit can be obtained from its reference encoding information. Then, based on the reference partitioning method, all or part of the partitioning methods from the optional partitioning method set are used to perform block partitioning processing on the unit to be encoded, resulting in at least one sub-encoding unit. After encoding at least one sub-encoding unit, sub-encoding information of at least one sub-encoding unit can be obtained. Finally, the target encoding information of the unit to be encoded is determined based on the sub-encoding information of at least one sub-encoding unit. The first position can be determined based on the starting encoding position of the encoding block, and the second position can be any position within the encoding block other than the first position. The first position may include, for example, the top-left corner of the encoded block, and the second position may include the bottom-left, top-right, and bottom-right corners of the encoded block. For example, in... Figure 4B In the coding block 42, the first position may include the position of coding unit A in the coding block 42, and the second position may include the positions of coding unit B, coding unit C, and coding unit D in the coding block 42.
[0057] This is because, during the encoding process, entropy coding or statistical coding is required for each coding unit. Statistical coding can effectively reduce the code rate required to express the same signal, and the statistical coding method can be context-based binary arithmetic coding. Since the context state of the coding unit located at the first position is exactly the same, the reference coding unit at the first position and the unit to be encoded will also generate the same encoded information. Therefore, when the unit to be encoded is located at the first position in the coding block, the reference coding information of the reference coding unit can be directly used as the target coding information of the unit to be encoded.
[0058] When the unit to be encoded is located at the second position in the coding block, since the context state of the unit at the second position is not yet determined, the coding information generated by the reference coding unit at the second position and the unit to be encoded will not be exactly the same. Therefore, the reference coding information of the reference coding unit cannot be directly reused. In this case, the reference partitioning method of the reference coding unit can be obtained from the reference coding information of the reference coding unit. Then, based on the reference partitioning method of the reference coding unit, the coding process of the unit to be encoded can be simplified. In order to better understand the simplified coding process of the unit to be encoded (hereinafter referred to as the fast coding process in this application), the unsimplified coding process of the unit to be encoded (hereinafter referred to as the default coding process in this application) will be introduced first.
[0059] When encoding a unit to be encoded using the default encoding process, all partitioning methods from the optional partitioning method set are used to divide the unit into blocks, resulting in at least one sub-encoding unit. Next, for each sub-encoding unit obtained after block partitioning, all partitioning methods from the optional partitioning method set can be used again to perform block partitioning on that sub-encoding unit. This process continues until all partitioning methods of the entire unit to be encoded are applied, and the partitioning method with the lowest rate-distortion cost is selected as the optimal partitioning method for the entire unit.
[0060] For example, suppose the set of optional partitioning methods includes the six partitioning methods in H.266: no partitioning, horizontal binary partitioning, vertical binary partitioning, quadruple partitioning, horizontal tripartite partitioning, and vertical tripartite partitioning. Figure 4C As shown, six partitioning methods can be used to divide the unit to be encoded into blocks. Specifically, partitioning the unit without partitioning results in the sub-coding unit itself; partitioning using a horizontal two-partition or vertical two-partition method yields two sub-coding units; partitioning using a four-partition method yields four sub-coding units; and partitioning using a horizontal three-partition or vertical three-partition method yields three sub-coding units. Each sub-coding unit obtained after partitioning the unit to be encoded can be further partitioned using one of the six methods, and so on, until the optimal partitioning method for the entire unit to be encoded is determined. For example, as shown... Figure 4D As shown, Figure 4D This represents one possible optimal way to divide the entire unit to be encoded.
[0061] When partitioning coding units into blocks without partitioning, a suitable predictive coding mode can be selected for each coding unit. Predictive coding includes intra-frame prediction and inter-frame prediction, each supporting multiple modes; for example, H.266 supports 67 intra-frame prediction modes. Encoding a coding unit requires iterating through all prediction modes to ultimately select the optimal partitioning method and suitable predictive coding mode. This results in a wide variety of combinations of partitioning methods and prediction modes, leading to high coding complexity.
[0062] It is understandable that, for step S302 above, if the first partitioning method corresponding to the unit to be encoded does not meet the first partitioning condition, the default encoding process can be used to encode the unit to be encoded. Alternatively, if the first partitioning method corresponding to the unit to be encoded meets the first partitioning condition, and there is no reference encoding information of the reference encoding unit of the unit to be encoded in the cache space corresponding to the encoding block, the default encoding process can also be used to encode the unit to be encoded, and the encoded information of the unit to be encoded obtained is stored in the cache space corresponding to the encoding block.
[0063] When using a fast encoding process to encode a unit, the reference encoding information of the reference encoding unit can be used to simplify some steps in the default encoding process. Specifically, the reference partitioning method of the reference encoding unit can be obtained from its reference encoding information; this reference partitioning method is the optimal partitioning method ultimately chosen by the reference encoding unit. If the reference partitioning method of the reference encoding unit is no partitioning, all partitioning methods in the set of optional partitioning methods can be used to partition the unit into blocks. When partitioning the unit into blocks using the no partitioning method, the encoding mode information of the unit to be encoded is determined based on the reference encoding mode information of the reference encoding unit, which includes the predicted encoding mode selected by the reference encoding unit. Thus, when partitioning the unit into blocks using the no partitioning method, it is not necessary to traverse all predicted encoding modes, which helps reduce encoding complexity.
[0064] Specifically, determining the coding mode information of the unit to be coded based on the reference coding mode information of the reference coding unit can be achieved by using the reference coding mode information of the reference coding unit as the coding mode information of the unit to be coded. That is, when the unit to be coded is not divided, the same prediction coding mode as when the reference coding unit is not divided is selected. For example, if intra prediction mode A is selected in intra prediction when the reference coding unit is not divided, intra prediction mode A is also selected in intra prediction when the unit to be coded is not divided. Alternatively, the same type of prediction coding mode can be selected when the unit to be coded is not divided as when the reference coding unit is not divided. For example, if intra prediction is selected when the reference coding unit is not divided, intra prediction can also be selected when the unit to be coded is not divided; if inter prediction is selected when the reference coding unit is not divided, inter prediction can also be selected when the unit to be coded is not divided.
[0065] If the reference partitioning method of the reference coding unit is not a no-partition method, but rather any one or more combinations of horizontal two-partition, vertical two-partition, four-partition, horizontal three-partition, and vertical three-partition methods, then a subset of the optional partitioning methods can be used to partition the coding unit into blocks. These subset partitioning methods are those other than the no-partition method. In other words, if the optimal partitioning method chosen by the reference coding unit is not a no-partition method, the coding unit can skip the no-partition method during the partitioning selection process, i.e., it will not use the no-partition method for block partitioning. This way, the coding unit does not need to traverse all partitioning methods when selecting a partitioning method, which helps to further reduce coding complexity and thus improve coding efficiency.
[0066] In summary, when the unit to be encoded is located at the first position in the coding block, the encoding information of the reference coding unit can be directly reused as the encoding information of the unit to be encoded. This can include the reuse of the optimal partitioning method ultimately selected by the reference coding unit, and the reuse of the predictive coding mode selected when the reference coding unit does not partition. When the unit to be encoded is located at the second position in the coding block, the fast encoding process described in this embodiment is used to encode the unit to be encoded. Based on the reference partitioning method of the reference coding unit, a skip-partitioning method can be selected, or, if the unit to be encoded does not partition, the predictive coding mode is determined based on the predictive coding mode of the reference coding unit. Compared to using the default encoding process, which requires traversing all partitioning methods and predictive coding modes, this approach is significantly simpler.
[0067] By implementing the embodiments of this application, when the first partitioning method corresponding to the unit to be encoded meets the target partitioning conditions, the unit to be encoded can be encoded using the reference encoding information of the reference encoding unit. This reduces the complexity of video encoding and thus improves its efficiency.
[0068] In some embodiments, the video encoding method provided in this application can be summarized into two parts: the first part is to determine whether the reference encoding information of the reference encoding unit of the unit to be encoded can be used to encode the unit to be encoded; the second part is how to use the reference encoding information of the reference encoding unit of the unit to be encoded to encode the unit to be encoded.
[0069] Please see Figures 5A-5B , Figures 5A-5B This is a flowchart illustrating another video encoding method provided in an embodiment of this application. Wherein, Figure 5A This is a schematic diagram illustrating the process of determining whether the reference encoding information of the reference encoding unit of the unit to be encoded can be used to encode the unit in the video encoding method provided in the embodiments of this application. Figure 5B This is a schematic diagram illustrating how to encode a unit using reference encoding information of a reference encoding unit in the video encoding method provided in this application embodiment.
[0070] like Figure 5A As shown, determining whether the reference encoding information of the reference encoding unit of the unit to be encoded can be used to encode the unit to be encoded can specifically include the following steps:
[0071] S501, determine whether the first partitioning method corresponding to the unit to be encoded is a combination of vertical binary partitioning and horizontal binary partitioning.
[0072] The unit to be encoded is obtained by partitioning the coding block using the first partitioning method. The combination of vertical and horizontal partitioning methods can be as follows: first, the coding block is partitioned vertically to obtain two sub-blocks; then, at least one of these sub-blocks is partitioned horizontally. Alternatively, the coding block is partitioned horizontally to obtain two sub-blocks; then, at least one of these sub-blocks is partitioned vertically. Here, a sub-block can be understood as the parent coding unit of the unit to be encoded, and a coding block can be understood as the grandparent coding unit of the unit to be encoded.
[0073] In other words, step S501 can also be described as first determining whether the unit to be encoded was obtained by dividing its parent encoding unit into blocks using either a vertical binary partitioning method or a horizontal binary partitioning method. If the unit to be encoded was obtained by dividing its parent encoding unit into blocks using a vertical binary partitioning method, then it is determined whether the parent encoding unit of the unit to be encoded was obtained by dividing its grandparent encoding unit (i.e., the encoding block) into blocks using a horizontal binary partitioning method; if the unit to be encoded was obtained by dividing its parent encoding unit into blocks using a horizontal binary partitioning method, then it is determined whether the parent encoding unit of the unit to be encoded was obtained by dividing its grandparent encoding unit into blocks using a vertical binary partitioning method.
[0074] S502, if the first partitioning method corresponding to the unit to be encoded is a combination of vertical two-part partitioning and horizontal two-part partitioning, then determine whether there is reference encoding information of the reference encoding unit in the cache space corresponding to the encoding block.
[0075] Specifically, the feature information of the unit to be encoded matches the feature information of the reference encoded unit. For example, the size information of the unit to be encoded may be the same as that of the reference encoded unit, and the position information of the unit to be encoded in the encoding block may be the same as that of the reference encoded unit in the encoding block. It is then determined whether the reference encoding information of the reference encoded unit exists in the cache space corresponding to the encoding block. That is, it is determined whether the encoding information of the encoded unit matching the unit to be encoded, obtained by partitioning the encoding block using other partitioning methods, has already been stored in the cache space corresponding to the encoding block before the unit to be encoded is obtained by partitioning the encoding block using the first partitioning method.
[0076] S503 If the reference encoding information of the reference encoding unit is not found in the cache space corresponding to the encoding block, the default encoding process is used to encode the unit to be encoded.
[0077] If the cache space corresponding to the coding block does not contain reference coding information for the reference coding unit, it means that the cache space corresponding to the coding block does not store coding information that the unit to be coded can use. In this case, the default coding process can be used to encode the unit to be coded.
[0078] S504 stores the encoding information of the unit to be encoded into the cache space corresponding to the encoding block.
[0079] After encoding the unit to be encoded using the default encoding process, the encoded information of the unit to be encoded can be stored in the corresponding cache space so that it can be reused in subsequent encoding processes, thereby simplifying the encoding process.
[0080] S505, if the reference coding information of the reference coding unit exists in the cache space corresponding to the coding block, then the reference coding information of the reference coding unit is used to encode the coding unit.
[0081] If the cache space corresponding to the coding block contains reference coding information of the reference coding unit, it means that the cache space corresponding to the coding block stores coding information that the unit to be coded can use. At this time, the reference coding information of the reference coding unit can be used to encode the unit to be coded.
[0082] S506, if the first partitioning method corresponding to the unit to be encoded is not a combination of vertical two-part partitioning and horizontal two-part partitioning, then determine whether the first partitioning method corresponding to the unit to be encoded is a four-part partitioning method.
[0083] Step S506 can also be described as determining whether the unit to be encoded is obtained by dividing its parent encoding unit into blocks using a four-partition method, where the parent encoding unit of the unit to be encoded is the encoding block.
[0084] S507, if the first partitioning method corresponding to the unit to be encoded is a four-partitioning method, then determine whether there is reference encoding information of the reference encoding unit in the cache space corresponding to the encoding block.
[0085] S508 If the reference encoding information of the reference encoding unit is not found in the cache space corresponding to the encoding block, the default encoding process is used to encode the unit to be encoded.
[0086] S509 stores the encoding information of the unit to be encoded into the cache space corresponding to the encoding block.
[0087] S510, if the reference coding information of the reference coding unit exists in the cache space corresponding to the coding block, then the reference coding information of the reference coding unit is used to encode the coding unit.
[0088] The contents of steps S508-S510 can be found in the description of steps S503-S505, and will not be repeated here.
[0089] S511 If the first division method corresponding to the unit to be encoded is neither a combination of vertical two-part division and horizontal two-part division, nor a four-part division method, then the default encoding process can be used to encode the unit to be encoded.
[0090] Furthermore, such as Figure 5B As shown, if it is determined that the reference encoding information of the reference encoding unit of the unit to be encoded can be used to encode the unit, the encoding process may specifically include the following steps:
[0091] S521, determine whether the position of the unit to be encoded in the encoding block is the first position.
[0092] The first position can be determined based on the starting encoding position of the encoding block. The context state of the encoding unit located at the first position is exactly the same, such as the position of the upper left corner of the encoding block.
[0093] S522, if the position of the unit to be encoded in the coding block is the first position, then the reference coding information of the reference coding unit is reused.
[0094] When the unit to be encoded is located at the first position in the coding block, the reference coding information of the reference coding unit can be directly reused. This is because the context states of coding units at the first position are completely identical, and the reference coding unit and the unit to be encoded will generate identical coding information. Therefore, the reference coding information of the reference coding unit can be directly used as the target coding information of the unit to be encoded. The reused reference coding information can include the final partitioning method of the reused reference coding unit and the coding mode information selected by the reference coding unit.
[0095] S523, if the position of the unit to be encoded in the coding block is not the first position, then determine whether the reference partitioning method of the reference coding unit is the no partitioning method.
[0096] If the position of the unit to be encoded in the coding block is not the first position, it can also be described as the position of the unit to be encoded in the coding block being the second position. The second position refers to a position in the coding block other than the first position. For example, when the first position is the top-left corner of the coding block, the second position could be the bottom-left corner, top-right corner, or bottom-right corner of the coding block. In this case, the unit to be encoded cannot completely reuse the reference coding information of the reference coding unit. The reference partitioning method of the reference coding unit can be obtained from the reference coding information of the reference coding unit to determine whether the reference partitioning method of the reference coding unit is a no-partitioning method.
[0097] S524, if the reference partitioning method of the reference coding unit is no partitioning method, then the coding mode information of the unit to be coded is determined according to the reference coding mode information of the reference coding unit.
[0098] When partitioning coding units into blocks using the no-partition method, a predictive coding mode needs to be selected. If the reference partitioning method of the reference coding unit is no partitioning, then when partitioning the coding unit to be coded using the no-partition method, the coding mode information of the unit to be coded can be determined based on the reference coding mode information of the reference coding unit. For example, if the reference coding unit selects intra-prediction mode without partitioning, then the unit to be coded will also select intra-prediction mode without partitioning; if the reference coding unit selects inter-prediction mode without partitioning, then the unit to be coded will also select inter-prediction mode without partitioning.
[0099] S525 encodes the unit to be encoded to obtain the target encoding information of the unit to be encoded.
[0100] During the encoding of a unit to be encoded, if the reference partitioning method of the reference encoding unit is no partitioning, the encoding mode information of the reference encoding unit can be reused when performing block partitioning of the unit to be encoded using the no partitioning method. If the reference partitioning method of the reference encoding unit is not no partitioning, then the no partitioning method can be skipped, and a partitioning method other than no partitioning can be used from the set of optional partitioning methods to perform block partitioning of the unit to be encoded, resulting in multiple sub-encoding units of the unit to be encoded. These multiple sub-encoding units are then encoded to obtain the target encoding information of the unit to be encoded.
[0101] By implementing the embodiments of this application, on the one hand, the reference coding information of the reference coding unit of the unit to be encoded can be used to encode the unit to be encoded, which helps to reduce the complexity of video coding. On the other hand, since the reference coding information of the reference coding unit is generated during the encoding process, rather than being additionally introduced information, this helps to improve the rate-distortion performance.
[0102] It should be noted that the execution carrier used to perform the steps in the above method embodiments can be hardware, software, or a combination of both. In the specific embodiments of this application, all data used is authorized by the relevant parties. When the above embodiments of this application are applied to specific products or technologies, the data used must be authorized or consented to by the relevant parties, and the collection, use, and processing of related data must comply with the relevant laws and standards of the relevant countries and regions.
[0103] For further details, please see Figure 6 This is a schematic diagram of a video encoding device provided in an embodiment of this application. The video encoding device 600 may include:
[0104] The acquisition unit 601 is used to acquire the first partitioning method corresponding to the unit to be encoded in the coding block of the video frame; the unit to be encoded is obtained by partitioning the coding block using the first partitioning method; if the first partitioning method satisfies the target partitioning condition, the reference coding information of the reference coding unit of the unit to be encoded is acquired from the buffer space corresponding to the coding block; wherein, the reference coding unit is obtained by partitioning the coding block using a second partitioning method; the second partitioning method is different from the first partitioning method; the feature information of the reference coding unit matches the feature information of the unit to be encoded;
[0105] The processing unit 602 is used to encode the unit to be encoded using the reference encoding information of the reference encoding unit to obtain the target encoding information of the unit to be encoded.
[0106] In some embodiments, the first partitioning method satisfying the target partitioning condition includes: the first partitioning method being a quadtree partitioning method; or, the first partitioning method being a combination of a vertical binary tree partitioning method and a horizontal binary tree partitioning method.
[0107] In some embodiments, the processing unit 602 is further configured to determine the position of the unit to be encoded in the coding block; if the position of the unit to be encoded in the coding block is a first position, then determine the target coding information of the unit to be encoded as the reference coding information of the reference coding unit; the acquisition unit 601 is further configured to, if the position of the unit to be encoded in the coding block is a second position, then acquire the reference partitioning method of the reference coding unit from the reference coding information of the reference coding unit; the processing unit 602 is further configured to, according to the reference partitioning method, use all or part of the partitioning methods in the optional partitioning method set to perform block partitioning processing on the unit to be encoded respectively, to obtain at least one sub-coding unit of the unit to be encoded; encode the at least one sub-coding unit to obtain the sub-coding information of the at least one sub-coding unit; determine the target coding information of the unit to be encoded according to the sub-coding information of the at least one sub-coding unit; wherein, the first position is determined according to the starting coding position of the coding block, and the second position is a position in the coding block other than the first position.
[0108] In some embodiments, the set of optional partitioning methods includes a no-partitioning method. The processing unit 602 is further configured to, if the reference partitioning method is a no-partitioning method, use all partitioning methods in the set of optional partitioning methods to perform block partitioning processing on the unit to be encoded to obtain at least one sub-coding unit of the unit to be encoded; if the reference partitioning method is not a no-partitioning method, use partitioning methods other than the no-partitioning method in the set of optional partitioning methods to perform block partitioning processing on the unit to be encoded to obtain multiple sub-coding units of the unit to be encoded.
[0109] In some embodiments, at least one sub-coding unit includes a first sub-coding unit, which is obtained by performing block partitioning on the unit to be encoded using a non-partitioning method. The acquisition unit 601 is further configured to, if the reference partitioning method is a non-partitioning method, obtain reference coding mode information of the reference coding unit from the reference coding information; the processing unit 602 is further configured to, based on the reference coding mode information, determine the coding mode information of the first sub-coding unit; and, based on the coding mode information of the first sub-coding unit, encode the first sub-coding unit to obtain the sub-coding information of the first sub-coding unit.
[0110] In some embodiments, the processing unit 602 is further configured to perform block partitioning processing on the coding blocks of the video frame using a second partitioning method to obtain target coding units of the coding blocks; if the second partitioning method satisfies the target partitioning condition, the target coding unit is used as a reference coding unit; the coding information of the reference coding unit is determined, and if the cache information at the position corresponding to the target coding unit in the cache space corresponding to the coding block is empty, the coding information of the reference coding unit is stored as reference coding information in the cache space corresponding to the coding block.
[0111] In some embodiments, the processing unit 602 is further configured to, if the first partitioning method does not meet the target partitioning condition, use all partitioning methods in the optional partitioning method set to perform block partitioning processing on the unit to be encoded to obtain multiple sub-coding units of the unit to be encoded; encode the multiple sub-coding units to obtain sub-coding information of the multiple sub-coding units; and determine the target encoding information of the unit to be encoded based on the sub-coding information of the multiple sub-coding units.
[0112] In feasible embodiments, the video encoding device provided in this application can be implemented in software. The video encoding device can be stored in a memory and can be software in the form of programs and plug-ins, and includes a series of units, including an acquisition unit and a processing unit; wherein, the acquisition unit and the processing unit are used to implement the video encoding method provided in this application.
[0113] In other feasible embodiments, the video encoding device provided in this application embodiment can also be implemented in a combination of hardware and software. As an example, the video encoding device provided in this application embodiment can be a processor in the form of a hardware decoding processor, which is programmed to execute the video encoding method provided in this application embodiment. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0114] Please see Figure 7 , Figure 7This is a schematic diagram of the structure of a computer device 700 provided in an embodiment of this application. The computer device may include a communication interface 701, a memory 702, and a processor 703. The communication interface 701, memory 702, and processor 703 are connected via one or more communication buses, which are used to enable communication between these components. The communication interface 701 may include a standard wired interface or a wireless interface (such as a WIFI interface). The memory 702 may include volatile memory, such as random-access memory (RAM); the memory 702 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; the memory 702 may also include a combination of the above types of memory. The processor 703 may be a central processing unit (CPU). The processor 703 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), etc. The aforementioned PLD can be a field-programmable gate array (FPGA), a generic array logic (GAL), etc.
[0115] Optionally, the memory 702 is also used to store program instructions, which the processor 703 can also call to implement the video encoding method in this application.
[0116] In some embodiments, the processor 703 calls program instructions stored in the memory 702 to implement:
[0117] The process involves obtaining a first partitioning method corresponding to the unit to be encoded in the encoded block of a video frame; the unit to be encoded is obtained by partitioning the encoded block using the first partitioning method; if the first partitioning method satisfies the target partitioning condition, the reference encoding information of the reference encoding unit of the unit to be encoded is obtained from the buffer space corresponding to the encoded block; wherein, the reference encoding unit is obtained by partitioning the encoded block using a second partitioning method; the second partitioning method is different from the first partitioning method; the feature information of the reference encoding unit is matched with the feature information of the unit to be encoded; the unit to be encoded is encoded using the reference encoding information of the reference encoding unit to obtain the target encoding information of the unit to be encoded.
[0118] In some embodiments, the first partitioning method satisfying the target partitioning condition includes: the first partitioning method being a quadtree partitioning method; or, the first partitioning method being a combination of a vertical binary tree partitioning method and a horizontal binary tree partitioning method.
[0119] In some embodiments, the processor 703 may also invoke the program instructions to: determine the position of the unit to be encoded in the encoding block; if the position of the unit to be encoded in the encoding block is a first position, then determine the target encoding information of the unit to be encoded as the reference encoding information of the reference encoding unit; if the position of the unit to be encoded in the encoding block is a second position, then obtain the reference partitioning method of the reference encoding unit from the reference encoding information of the reference encoding unit; according to the reference partitioning method, use all or part of the partitioning methods in the optional partitioning method set to perform block partitioning processing on the unit to be encoded respectively, to obtain at least one sub-encoding unit of the unit to be encoded; encode the at least one sub-encoding unit to obtain the sub-encoding information of the at least one sub-encoding unit; determine the target encoding information of the unit to be encoded according to the sub-encoding information of the at least one sub-encoding unit; wherein, the first position is determined according to the starting encoding position of the encoding block, and the second position is a position in the encoding block other than the first position.
[0120] In some embodiments, the set of optional partitioning methods includes a no-partitioning method. The processor 703 may also call the program instruction to implement: if the reference partitioning method is a no-partitioning method, then all partitioning methods in the set of optional partitioning methods are used to perform block partitioning processing on the unit to be encoded to obtain at least one sub-coding unit of the unit to be encoded; if the reference partitioning method is not a no-partitioning method, then partitioning methods other than the no-partitioning method in the set of optional partitioning methods are used to perform block partitioning processing on the unit to be encoded to obtain multiple sub-coding units of the unit to be encoded.
[0121] In some embodiments, at least one sub-coding unit includes a first sub-coding unit, which is obtained by performing block partitioning on the unit to be encoded using a non-partitioning method. The processor 703 may also call the program instructions to: if the reference partitioning method is a non-partitioning method, obtain the reference encoding mode information of the reference encoding unit from the reference encoding information; determine the encoding mode information of the first sub-coding unit according to the reference encoding mode information; and encode the first sub-coding unit according to the encoding mode information of the first sub-coding unit to obtain the sub-coding information of the first sub-coding unit.
[0122] In some embodiments, the processor 703 may also call the program instructions to: perform block partitioning processing on the coding blocks of the video frame using the second partitioning method to obtain the target coding unit of the coding block; if the second partitioning method satisfies the target partitioning condition, then the target coding unit is used as a reference coding unit; determine the coding information of the reference coding unit, and if the cache information at the position corresponding to the target coding unit in the cache space corresponding to the coding block is empty, store the coding information of the reference coding unit as reference coding information in the cache space corresponding to the coding block.
[0123] In some embodiments, the processor 703 may also call the program instructions to: if the first partitioning method does not meet the target partitioning conditions, then all partitioning methods in the optional partitioning method set are used to perform block partitioning processing on the unit to be encoded to obtain multiple sub-coding units of the unit to be encoded; the multiple sub-coding units are encoded to obtain sub-coding information of the multiple sub-coding units; and the target encoding information of the unit to be encoded is determined based on the sub-coding information of the multiple sub-coding units.
[0124] It should be understood that the principles and beneficial effects of the computer device 700 in solving the problem described in the embodiments of this application are the same as those in this application. Figures 3-5B The embodiments shown and the foregoing content have similar principles and beneficial effects in solving the problem, and will not be repeated here for the sake of brevity.
[0125] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the embodiments of this application.
[0126] Accordingly, this application also provides a computer program product, which includes a computer program or computer instructions, which, when executed by a processor, implement the methods in this application.
[0127] Accordingly, this application provides a computer program that 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 method described in this application.
[0128] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0129] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0130] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A video encoding method, characterized in that, The method includes: Obtain the first partitioning method corresponding to the unit to be encoded in the encoding block of the video frame; the unit to be encoded is obtained by performing block partitioning processing on the encoding block using the first partitioning method; If the first partitioning method satisfies the target partitioning condition, then the reference encoding information of the reference encoding unit of the unit to be encoded is obtained from the cache space corresponding to the encoding block; wherein, the reference encoding unit is obtained by performing block partitioning processing on the encoding block using the second partitioning method; the second partitioning method is different from the first partitioning method; the feature information of the reference encoding unit matches the feature information of the unit to be encoded; Determine the position of the unit to be encoded within the encoding block; If the position of the unit to be encoded in the coding block is the first position, then the target coding information of the unit to be encoded is determined to be the reference coding information of the reference coding unit; If the unit to be encoded is located at the second position in the encoding block, then the reference partitioning method of the reference encoding unit is obtained from the reference encoding information of the reference encoding unit, and according to the reference partitioning method, all or part of the partitioning methods in the optional partitioning method set are used to perform block partitioning processing on the unit to be encoded to obtain at least one sub-encoding unit of the unit to be encoded; the at least one sub-encoding unit is encoded to obtain the sub-encoding information of the at least one sub-encoding unit; and the target encoding information of the unit to be encoded is determined according to the sub-encoding information of the at least one sub-encoding unit. The first position is determined based on the starting encoding position of the encoding block, and the second position is a position in the encoding block other than the first position.
2. The method as described in claim 1, characterized in that, The first partitioning method satisfies the target partitioning conditions including: The first partitioning method is a quadtree partitioning method; or, The first partitioning method is a combination of vertical binary tree partitioning and horizontal binary tree partitioning.
3. The method as described in claim 1 or 2, characterized in that, The set of optional partitioning methods includes a no-partitioning method; the step of dividing the unit to be encoded into blocks by using all or part of the partitioning methods in the set of optional partitioning methods according to the reference partitioning method, to obtain at least one sub-coding unit of the unit to be encoded, includes: If the reference partitioning method is the no partitioning method, then all partitioning methods in the set of optional partitioning methods are used to perform block partitioning processing on the unit to be encoded, so as to obtain at least one sub-encoding unit of the unit to be encoded. If the reference partitioning method is not the no-partitioning method, then a partitioning method other than the no-partitioning method in the set of optional partitioning methods is used to perform block partitioning processing on the unit to be encoded, thereby obtaining multiple sub-encoding units of the unit to be encoded.
4. The method as described in claim 3, characterized in that, The at least one sub-coding unit includes a first sub-coding unit, which is obtained by performing block partitioning on the unit to be encoded using the non-partitioning method. The method further includes: If the reference partitioning method is the no partitioning method, then the reference coding mode information of the reference coding unit is obtained from the reference coding information; and the coding mode information of the first sub-coding unit is determined based on the reference coding mode information. Based on the encoding mode information of the first sub-encoding unit, the first sub-encoding unit is encoded to obtain the sub-encoding information of the first sub-encoding unit.
5. The method as described in claim 1 or 2, characterized in that, Before obtaining the first partitioning method corresponding to the unit to be encoded in the encoded block of the video frame, the method further includes: The video frame's coded blocks are divided using a second partitioning method to obtain the target coding unit of the coded block; If the second partitioning method satisfies the target partitioning condition, then the target coding unit is used as the reference coding unit; The encoding information of the reference encoding unit is determined, and if the cache information at the position corresponding to the target encoding unit in the cache space corresponding to the encoding block is empty, the encoding information of the reference encoding unit is stored as reference encoding information in the cache space corresponding to the encoding block.
6. The method as described in claim 1 or 2, characterized in that, The method further includes: If the first partitioning method does not meet the target partitioning conditions, then all partitioning methods in the optional partitioning method set are used to perform block partitioning processing on the unit to be encoded, thereby obtaining multiple sub-encoding units of the unit to be encoded; the multiple sub-encoding units are encoded to obtain sub-encoding information of the multiple sub-encoding units; and the target encoding information of the unit to be encoded is determined based on the sub-encoding information of the multiple sub-encoding units.
7. A video encoding device, characterized in that, The device includes: An acquisition unit is configured to acquire a first partitioning method corresponding to a unit to be encoded in an encoding block of a video frame; the unit to be encoded is obtained by partitioning the encoding block using the first partitioning method; if the first partitioning method satisfies the target partitioning condition, reference encoding information of a reference encoding unit of the unit to be encoded is acquired from the cache space corresponding to the encoding block; wherein, the reference encoding unit is obtained by partitioning the encoding block using a second partitioning method; the second partitioning method is different from the first partitioning method; the feature information of the reference encoding unit matches the feature information of the unit to be encoded; A processing unit is configured to determine the position of the unit to be encoded within the coding block; if the position of the unit to be encoded within the coding block is a first position, then the target coding information of the unit to be encoded is determined to be the reference coding information of the reference coding unit; if the position of the unit to be encoded within the coding block is a second position, then the reference partitioning method of the reference coding unit is obtained from the reference coding information of the reference coding unit, and according to the reference partitioning method, all or part of the partitioning methods in the optional partitioning method set are used to perform block partitioning processing on the unit to be encoded to obtain at least one sub-coding unit of the unit to be encoded; the at least one sub-coding unit is encoded to obtain sub-coding information of the at least one sub-coding unit; and the target coding information of the unit to be encoded is determined according to the sub-coding information of the at least one sub-coding unit; wherein, the first position is determined based on the starting coding position of the coding block, and the second position is a position in the coding block other than the first position.
8. A computer device, characterized in that, include: The processor, the communication interface, and the memory are interconnected, wherein the memory stores executable program code, and the processor is used to call the executable program code to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Image block division method and device
CN113259663A