Partition mode determination method and device, equipment, medium and program product
In video encoding technology, the target subcoding unit is matched according to the size of the subcoding unit, and the target division method is determined, the problem of low search efficiency of the encoding unit division method is solved, and the efficiency and accuracy of video encoding are improved.
Patent Information
- Application Number
- CN202310640614.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
In video encoding technology, the search efficiency of the encoding unit division method is low, which affects the overall efficiency of video encoding.
By using the first division method to divide the encoding unit, obtain the second division result of multi-level division, and match the target sub-coding unit according to the size of the sub-coding unit, determine the target division method, thereby reducing the search space and improving the division of the encoding unit Search efficiency of the way.
It effectively improves the search efficiency of the encoding unit division method, saves computing resources, and ensures the accuracy, reliability and efficiency of video encoding.
Smart Images

Figure CN119071484A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for determining a partitioning method, an apparatus for determining a partitioning method, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] In video coding technology, a coding unit can be gradually divided into smaller coding units (CodingUnit, CU) through a tree structure. Each CU obtained by division will be compressed and encoded independently, thereby saving computing resources while ensuring video quality. However, in the process of searching for the division method, it is necessary to recursively traverse all possible division methods, which makes the search efficiency of the division method of the coding unit low, thus affecting the overall efficiency of video coding. Therefore, how to improve the search efficiency of the division method of the coding unit is a problem that needs to be solved urgently. Summary of the invention
[0003] The present application provides a method, apparatus, device, medium and program product for determining a division method, which can improve the search efficiency of the division method of the coding unit.
[0004] In a first aspect, the present application provides a method for determining a division mode, the method comprising:
[0005] The coding unit is divided by a first division method to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units;
[0006] Obtaining a second division result of the coding unit; the second division result includes a plurality of division units, the second division result is obtained by performing multi-level division on the coding unit, and the division method adopted in the first-level division is the second division method, the coding unit is divided into a plurality of second sub-coding units after the first-level division, and the plurality of division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method;
[0007] If the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, determining a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units; determining a target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, the target second sub-coding unit being any one of the multiple second sub-coding units;
[0008] If the size of the above-mentioned first sub-coding unit is larger than the size of the above-mentioned second sub-coding unit, a matching second sub-coding unit that matches the target first sub-coding unit among the above-mentioned multiple second sub-coding units is determined; according to the division situation of the above-mentioned matching second sub-coding unit, the target division method of the above-mentioned target first sub-coding unit is determined, and the above-mentioned target first sub-coding unit is any one of the above-mentioned multiple first sub-coding units.
[0009] In a second aspect, the present application provides a device for determining a partitioning method, the device comprising:
[0010] A processing module, configured to divide the coding unit in a first division manner to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units;
[0011] an acquisition module, configured to acquire a second division result of the coding unit; the second division result includes a plurality of division units, the second division result is obtained by performing multi-level division on the coding unit, and the division method adopted in the first-level division is the second division method, the coding unit is divided into a plurality of second sub-coding units after the first-level division, and the plurality of division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method;
[0012] a division mode determination module, configured to determine a matching first sub-coding unit that matches a target second sub-coding unit among the plurality of first sub-coding units if the size of the first sub-coding unit is smaller than the size of the second sub-coding unit; and determine a target division mode of the matching first sub-coding unit according to a division condition of the target second sub-coding unit, wherein the target second sub-coding unit is any one of the plurality of second sub-coding units;
[0013] The above-mentioned division method determination module is also used to determine the matching second sub-coding unit that matches the target first sub-coding unit among the above-mentioned multiple second sub-coding units if the size of the above-mentioned first sub-coding unit is larger than the size of the above-mentioned second sub-coding unit; determine the target division method of the above-mentioned target first sub-coding unit according to the division situation of the above-mentioned matching second sub-coding unit, and the above-mentioned target first sub-coding unit is any one of the above-mentioned multiple first sub-coding units.
[0014] In a third aspect, the present application provides a computer device comprising: a processor, a storage device and a communication interface, wherein the processor, the communication interface and the storage device are interconnected, wherein the storage device stores an executable program code, and the processor is used to call the executable program code to implement the above-mentioned method for determining the division method.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and wherein the program instructions are executed by a processor to implement the method for determining the division method as described above.
[0016] In a fifth aspect, the present application provides a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the above-mentioned method for determining the division method.
[0017] The present application adopts a first division method to divide the coding unit and obtains a first division result including multiple first sub-coding units; then obtains a second division result of the coding unit, wherein the second division result is obtained by dividing the coding unit into multiple levels, and the division method adopted for the first-level division is the second division method, and the coding unit is divided into multiple second sub-coding units after the first-level division; if the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units is determined, and the target division method of the matching first sub-coding unit is determined according to the division of the target second sub-coding unit; if the size of the first sub-coding unit is larger than the size of the second sub-coding unit, a matching second sub-coding unit that matches the target first sub-coding unit among the multiple second sub-coding units is determined, and the target division method of the target first sub-coding unit is determined according to the division of the matching second sub-coding unit. Since the second division result is obtained before the coding unit is divided by the first division method, the target division method of the sub-coding unit in the coding unit is determined by the division results that have been searched, which can effectively narrow the search space, improve the search efficiency of the division method of the coding unit, and save computing resources, thereby completing the video encoding task more accurately, reliably and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 It is a schematic diagram of the architecture of a partitioning method determination system provided by an exemplary embodiment of the present application;
[0020] Figure 2 It is a flowchart of a method for determining a division mode provided by an exemplary embodiment of the present application;
[0021] Figure 3 is a schematic diagram of multiple partitioning methods provided by an exemplary embodiment of the present application;
[0022] Figure 4 is a flowchart of another method for determining a division mode provided by an exemplary embodiment of the present application;
[0023] Figure 5A is a schematic diagram of a target division method for determining a matching first sub-coding unit provided by an exemplary embodiment of the present application;
[0024] Figure 5B is a schematic diagram of another target division method for determining a matching first sub-coding unit provided by an exemplary embodiment of the present application;
[0025] Figure 5C is a schematic diagram of another target division method for determining a matching first sub-coding unit provided by an exemplary embodiment of the present application;
[0026] Figure 5D is a schematic diagram of a target division method for determining a target first sub-coding unit provided by an exemplary embodiment of the present application;
[0027] Figure 5E is a schematic diagram of another target division method for determining a target first sub-coding unit provided by an exemplary embodiment of the present application;
[0028] Fig. 5F is a schematic diagram of another target division method for determining a matching first sub-coding unit provided by an exemplary embodiment of the present application;
[0029] Figure 5G is a schematic diagram of another target division method for determining a matching first sub-coding unit provided by an exemplary embodiment of the present application;
[0030] Figure 5H is a schematic diagram of another target division method for determining a matching first sub-coding unit provided by an exemplary embodiment of the present application;
[0031] Figure 6 is a schematic block diagram of a device for determining a partitioning method provided by an exemplary embodiment of the present application;
[0032] Figure 7 It is a schematic block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] It should be noted that the descriptions of "first", "second", etc. involved in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0035] The embodiments of the present application can be applied to various fields or scenarios such as cloud computing, cloud Internet of Things, cloud gaming, artificial intelligence, in-vehicle scenarios, smart transportation, and assisted driving. Several typical fields or scenarios will be introduced below.
[0036] Cloud computing refers to the delivery and use mode of IT infrastructure, which means obtaining the required resources through the network in an on-demand and easily scalable manner; in a broad sense, cloud computing refers to the delivery and use mode of services, which means obtaining the required services through the network in an on-demand and easily scalable manner. This service can be related to IT and software, the Internet, or other services. Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the promotion of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from previous parallel distributed computing, the emergence of cloud computing will promote revolutionary changes in the entire Internet model and enterprise management model in terms of concept. This application can store data such as coding units, first partition results, and second partition results on a cloud server. When the above different data need to be used, they can be directly obtained on the cloud server, which greatly improves the data acquisition speed.
[0037] Cloud IOT aims to connect the information sensed and instructions received by sensor devices in traditional IoT to the Internet, truly realize networking, and achieve massive data storage and computing through cloud computing technology. Due to the characteristics of IoT, objects are connected to each other and the current operating status of each "object" is perceived in real time. A large amount of data information will be generated in this process. How to aggregate this information and how to filter out useful information from the massive information to support decision-making for subsequent development have become key issues affecting the development of IoT. IoT cloud based on cloud computing and cloud storage technology has therefore become a strong support for IoT technology and applications.
[0038] Cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing technology. Cloud gaming technology enables thin clients with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud gaming scenario, the game is not played on the player's game terminal, but on a cloud server, which renders the game scene into a video and audio stream and transmits it to the player's game terminal over the network. The player's game terminal does not need to have powerful graphics computing and data processing capabilities, but only needs to have basic streaming media playback capabilities and the ability to obtain player input instructions and send them to the cloud server. The present application is applied to cloud gaming, and can determine the target division method of the sub-coding unit in the coding unit through the encoding results of the encoded part in the video encoding task related to the cloud gaming business, thereby improving the search efficiency of the division method of the coding unit, and then improving the efficiency of video encoding.
[0039] Intelligent Traffic System (ITS), also known as Intelligent Transportation System, effectively and comprehensively applies advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) to transportation, service control and vehicle manufacturing, strengthens the connection between vehicles, roads and users, and thus forms a comprehensive transportation system that ensures safety, improves efficiency, improves the environment and saves energy.
[0040] Intelligent Vehicle Infrastructure Cooperative Systems (IVICS), referred to as IVICS, is a development direction of Intelligent Transportation Systems (ITS). The IVICS adopts advanced wireless communications and new generation Internet technologies to implement all-round dynamic real-time information interaction between vehicles and roads, and carries out active vehicle safety control and road cooperative management based on the collection and integration of dynamic traffic information in all time and space, fully realizing the effective coordination of people, vehicles and roads, ensuring traffic safety, and improving traffic efficiency, thus forming a safe, efficient and environmentally friendly road traffic system. The present application can be applied to the above-mentioned fields, such as real-time video encoding tasks for recorded traffic videos. By determining the target division method of the first sub-coding unit of each coding unit, the search speed can be accelerated, the computational complexity can be reduced, and the real-time and processing efficiency of the video encoding task can be improved, thereby improving the efficiency of law enforcement personnel in investigating violations.
[0041] It can be understood that in the specific implementation of the present application, data related to the coding unit, the first division result, the second division result, etc. are involved. When the above embodiments of the present application are applied to specific products or technologies, the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0042] This application will be specifically described by the following embodiments:
[0043] See also Figure 1 , which is a schematic diagram of the architecture of a partitioning method determination system provided by an exemplary embodiment of the present application. The partitioning method determination system may specifically include a database 101 and a terminal device 102. The database 101 and the terminal device 102 are connected via a network, such as a local area network, a wide area network, a mobile Internet, etc.
[0044] In one embodiment, the terminal device 102 may obtain the coding unit from the database 101, and then divide the coding unit to obtain a first division result and a second division result. Specifically: the terminal device 102 divides the coding unit using a first division method to obtain a first division result of the coding unit, and the first division result includes multiple first sub-coding units. For example, when the first division method is quadtree division, the first division result includes four first sub-coding units of CU1, CU2, CU3 and CU4; for another example, when the first division method is binary tree division, the first division result includes two first sub-coding units of CU1 and CU2.
[0045] Then, the terminal device 102 obtains a second division result of the coding unit; the second division result includes multiple division units, the second division result is obtained by dividing the coding unit into multiple levels, and the division method adopted for the first level division is the second division method, the coding unit is divided into multiple second sub-coding units after the first level division, and the multiple division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method, for example, when the second division method is binary tree division, the coding unit is divided into two second sub-coding units after the first level division; for example, when the second division method is quadtree division, the coding unit is divided into four second sub-coding units after the first level division.
[0046] If the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, the terminal device 102 determines a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units; the terminal device 102 then determines a target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, and the target second sub-coding unit is any one of the multiple second sub-coding units. For example, if the division situation of the target second sub-coding unit is that no division is performed, the target division method of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit.
[0047] If the size of the first sub-coding unit is larger than the size of the second sub-coding unit, the terminal device 102 determines a matching second sub-coding unit that matches the target first sub-coding unit among the multiple second sub-coding units; the terminal device 102 then determines a target division method of the target first sub-coding unit according to the division situation of the matching second sub-coding unit, and the target first sub-coding unit is any one of the multiple first sub-coding units. For example, if the division situation of the matching second sub-coding unit is that all or part of the included multiple second sub-coding units are divided, then the target division method of the target first sub-coding unit is determined as: performing division of the target first sub-coding unit.
[0048] It should be noted that the above-mentioned division processing of the coding unit to obtain the first division result and the second division result, as well as determining the target division method that matches the first sub-coding unit (or determining the target division method of the target first sub-coding unit) can be executed by the terminal device 102 or by the target encoder in the terminal device 102, and the embodiments of the present application are not limited to this.
[0049] The database 101 is used to store data, such as the encoding unit, the first division result, the second division result and other data, and can also be used to store logical data for determining the target division method, which can be recorded in the database through different database tables. For example, the database can be a database located in the server, that is, it can be a database built into or carried by the server; the database can also be an external database connected to the server, such as a cloud database (i.e., a database deployed in the cloud), which can be based on any one of private cloud, public cloud, hybrid cloud, edge cloud, etc., so that the cloud database focuses on different functions.
[0050] The terminal device 102 is also referred to as a terminal, user equipment (UE), access terminal, user unit, mobile device, user terminal, wireless communication device, user agent or user device. The terminal device may be a smart home appliance, a handheld device with wireless communication function (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC), a vehicle terminal, an intelligent voice interaction device, a wearable device or other smart device, but is not limited thereto.
[0051] In one embodiment, the architecture of the system determined by the division method proposed in the present application may also include a server, which may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Database 101 may be a database built into the server, or a database independent of the server, which is not limited in the present embodiment of the application.
[0052] In one embodiment, the terminal device may also perform subsequent division processing on the coding units stored in itself (such as on the terminal device) and determine the target division method of the corresponding sub-coding units. At this time, the division method determination system includes: terminal device 102, and the embodiment of the present application is not limited to this.
[0053] It is understandable that the system architecture diagram described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application. For example, the division mode determination method provided in the embodiment of the present application can be executed by the terminal device 102, and can also be executed by other terminal devices, servers or server clusters that are different from the terminal device 102 and can communicate with the database 101 and / or the terminal device 102. It is known to those skilled in the art that Figure 1 The number of databases and terminal devices in the embodiment is only illustrative. According to the business implementation needs, any number of databases and terminal devices can be configured. In addition, with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems. In the subsequent embodiments, the database 101 will be referred to as a database, and the terminal device will be referred to as a terminal device 102, which will not be repeated in the subsequent embodiments.
[0054] See also Figure 2 , which is a flow chart of a method for determining a division mode provided by an exemplary embodiment of the present application, and is described by taking the method applied to a terminal device as an example, the method may include the following steps:
[0055] S201. Divide a coding unit in a first division manner to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units.
[0056] In the embodiment of the present application, the terminal device divides the coding unit by using the first division method to obtain a first division result of the coding unit, and the first division result includes multiple first sub-coding units. The first division method can be quadtree division or binary tree division. When quadtree division is used to divide the coding unit, such as Figure 3 As shown in (2), the first division result obtained includes four first sub-coding units; when the coding unit is divided by binary tree division (including horizontal binary tree division and vertical binary tree division), as shown in FIG. Figure 3 As shown in (3) and (4), the first division result obtained includes two first sub-coding units.
[0057] In one embodiment, video coding is a process of compressing and transmitting continuous video frames in a certain order. In this process, coding units are used to divide each frame, and there is a certain correlation between coding units. The coding unit in the embodiment of the present application may refer to a frame, macroblock, subblock or minimum coding block in video coding. Among them, the frame is the top-level coding unit, and a frame is usually composed of one or more macroblocks; the macroblock is the next level coding unit of the frame, for example, in the H.264 / AVC and HEVC video coding standards, the macroblock is composed of 16×16 pixel blocks; the subblock is the next level coding unit of the macroblock, for example, in the H.264 / AVC and HEVC video coding standards, each macroblock can be further divided into four 8×8 subblocks or one 8×8 and three 8×4 subblocks, etc.; the minimum coding block (also called a transform block): is the minimum coding unit for dividing subblocks, for example, in the H.264 / AVC and HEVC video coding standards, the size of the minimum coding block is 4×4, and the embodiment of the present application does not limit the above coding unit form.
[0058] S202, obtaining a second division result of the coding unit; the second division result is obtained by dividing the coding unit into multiple levels, and the division method adopted in the first level division is the second division method, and the coding unit is divided into multiple second sub-coding units after the first level division.
[0059] In an embodiment of the present application, the second division result is obtained by dividing the coding unit into multiple levels, and the division method adopted for the division of the first level is the second division method. The second division result includes multiple division units, and the multiple division units include units obtained by dividing all or part of the second sub-coding unit. The second division result is obtained before the coding unit is divided by the first division method. The second division result is the optimal division method among multiple feasible division methods searched by the terminal device under the premise that the coding unit is divided into multiple levels and the division method adopted for the division of the first level is the second division method, wherein the optimal division method may refer to: a feasible division method with the lowest rate-distortion cost among multiple feasible division methods. The calculation method of the rate-distortion cost will be described in detail in subsequent embodiments and will not be repeated here.
[0060] In one embodiment, the second division method may be quadtree division or binary tree division. When the first division method is quadtree division, the second division method is binary tree division. In this case, the coding unit is divided into two second sub-coding units after the first level division; when the first division method is binary tree division, the second division method is quadtree division. In this case, the coding unit is divided into four second sub-coding units after the first level division. It should be noted that the levels after the first level in the above multi-level division of the coding unit may adopt the second division method or a division method different from the second division method (such as the first division method, or other division methods different from the first division method and the second division method), which is not limited in the embodiments of the present application.
[0061] In one embodiment, if Figure 1 As shown in Example 1, in this case, the first division method is quadtree division, and the second division method is binary tree division. The first division result in Example 1 includes four first sub-coding units obtained by dividing the coding unit by quadtree division, such as CU1, CU2, CU3 and CU4. The second division result in Example 1 is obtained by dividing the coding unit into three levels, and two second sub-coding units are obtained by binary tree division in the first level division, one of which is obtained by binary tree division in the second level division. Two sub-coding units are obtained, and two sub-coding units are obtained by binary tree division in the third level division.
[0062] In one embodiment, if Figure 1 As shown in Example 2, in this case, the first division method is binary tree division, and the second division method is quadtree division. The first division result in Example 2 includes two first sub-coding units, such as CU1 and CU2, obtained by dividing the coding unit by binary tree division. The second division result in Example 2 is obtained by dividing the coding unit into three levels, and four second sub-coding units are obtained by quadtree division in the first level division, one of which is divided into two sub-coding units by binary tree division in the second level division, and one of the two sub-coding units obtained by the second level division is divided into two sub-coding units by binary tree division in the third level division.
[0063] S203. If the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, determine a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units; determine a target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, and the target second sub-coding unit is any one of the multiple second sub-coding units.
[0064] In an embodiment of the present application, the terminal device first compares the size of the first sub-coding unit with the size of the second sub-coding unit. When the size of the first sub-coding unit is smaller than the size of the second sub-coding unit (such as the first sub-coding unit is obtained by dividing the coding unit using quadtree division, and the second sub-coding unit is obtained by dividing the coding unit using binary tree division, then the size of the first sub-coding unit is 1 / 2 of the size of the second sub-coding unit), first, the terminal device takes any second sub-coding unit among the multiple second sub-coding units as the target second sub-coding unit; then, the terminal device determines a matching first sub-coding unit among the multiple first sub-coding units that matches the target second sub-coding unit (such as the position area in the coding unit to which the multiple first sub-coding units included in the matching first sub-coding unit belong is the same as the position area in the coding unit to which the target second sub-coding unit belongs); finally, the terminal device determines the target division method of the matching first sub-coding unit according to the division of the target second sub-coding unit.
[0065] Among them, the above-mentioned target division method can be used to instruct the matching first sub-coding unit to skip some subsequent unreasonable division methods, or to enforce some reasonable division methods. By determining the target division method, the search space can be effectively narrowed, the search efficiency of the division method of the coding unit can be improved, and computing resources and time can be saved, thereby completing the video encoding task more accurately, reliably and efficiently. The above-mentioned method can use the searched division results to improve the search efficiency of the division method of the ongoing coding unit (such as using the binary tree division results to accelerate the search of the quadtree division), thereby improving the efficiency of video encoding.
[0066] In one embodiment, if Figure 1 As shown in Example 1, the first sub-coding unit is obtained by dividing the coding unit using quadtree division, and the second sub-coding unit is obtained by dividing the coding unit using binary tree division. At this time, the size of the first sub-coding unit is smaller than the size of the second sub-coding unit. Then, the terminal device can use any one of the multiple second sub-coding units as the target second sub-coding unit, such as the target second sub-coding unit shown in Example 1; then determine the matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units, such as CU1 and CU2 in the first division result, and CU1 and CU2 match the position of the target second sub-coding unit; finally, the terminal device determines the target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit. If the division situation of the target second sub-coding unit is not divided, then the target division method of the matching first sub-coding unit can be determined as: skipping the subsequent division of each first sub-coding unit (such as CU1 and CU2) included in the matching first sub-coding unit, etc.
[0067] S204. If the size of the first sub-coding unit is larger than the size of the second sub-coding unit, determine a matching second sub-coding unit that matches the target first sub-coding unit among the multiple second sub-coding units; determine a target division method of the target first sub-coding unit according to the division situation of the matching second sub-coding unit, and the target first sub-coding unit is any one of the multiple first sub-coding units.
[0068] In an embodiment of the present application, the terminal device first compares the size of the first sub-coding unit with the size of the second sub-coding unit. When the size of the first sub-coding unit is larger than the size of the second sub-coding unit (such as the first sub-coding unit is obtained by dividing the coding unit using binary tree division, and the second sub-coding unit is obtained by dividing the coding unit using quadtree division, then the size of the first sub-coding unit is twice the size of the second sub-coding unit, first, the terminal device takes any one of the multiple first sub-coding units as the target first sub-coding unit; then, the terminal device determines a matching second sub-coding unit among the multiple second sub-coding units that matches the target first sub-coding unit (such as the position area in the coding unit to which the multiple second sub-coding units included in the matching second sub-coding unit belong is the same as the position area in the coding unit to which the target first sub-coding unit belongs); finally, the terminal device determines the target division method of the target first sub-coding unit according to the division of the matching second sub-coding unit.
[0069] Among them, the above-mentioned target division method can be used to instruct the matching first sub-coding unit to skip some subsequent unreasonable division methods, or to enforce some reasonable division methods. By determining the target division method, the search space can be effectively narrowed, the search efficiency of the division method of the coding unit can be improved, and computing resources and time can be saved, thereby completing the video encoding task more accurately, reliably and efficiently. The above-mentioned method can use the searched division results to improve the search efficiency of the division method of the ongoing coding unit (such as using the quadtree division results to accelerate the search of the binary tree division), thereby improving the efficiency of video encoding.
[0070] In one embodiment, if Figure 1As shown in Example 2, the first sub-coding unit is obtained by dividing the coding unit using binary tree division, and the second sub-coding unit is obtained by dividing the coding unit using quadtree division. At this time, the size of the first sub-coding unit is larger than the size of the second sub-coding unit. Then, the terminal device can use any one of the multiple first sub-coding units as the target first sub-coding unit, such as the target first sub-coding unit CU1 shown in Example 2; then determine the matching second sub-coding unit that matches the target first sub-coding unit among the multiple second sub-coding units, such as the matching second sub-coding unit shown in the dotted box in Example 2, and the matching second sub-coding unit matches the position of the target first sub-coding unit; finally, the terminal device determines the target division method of the target first sub-coding unit according to the division situation of the matching second sub-coding unit. If the division situation of the matching second sub-coding unit is that one of the multiple second sub-coding units included is divided, then the target division method of the target first sub-coding unit can be determined as: executing the division of the target first sub-coding unit, etc.
[0071] In one embodiment, the terminal device may determine the optimal division mode of the coding unit according to the target division mode. The method for determining the target optimal division mode of the coding unit may be as follows:
[0072] (1) Determine multiple feasible division methods based on the target division method.
[0073] In the process of trying to find the optimal division method, the encoder will try different types of division methods for the coding unit (or each sub-coding unit in the coding unit) in turn, such as Figure 3 The non-division shown in (1), the quadtree division shown in (2), the horizontal binary tree division shown in (3), the vertical binary tree division shown in (4), the horizontal ternary tree division shown in (5), the vertical ternary tree division shown in (6), etc., this attempt process will generate hundreds or thousands of division combinations, and the CU blocks (co-located blocks) of the same position and size will be repeatedly encoded. The embodiment of the present application screens out feasible division methods (the feasible division methods are one or more of all division methods) that meet the target division method from all division methods (such as the hundreds or thousands of division combinations mentioned above), avoids subsequent searches for some unreasonable division methods, thereby reducing the amount of calculation, improving the search efficiency of the division method of the ongoing coding unit, and further improving the efficiency of video coding.
[0074] (2) Calculate the rate-distortion cost of each feasible partitioning method.
[0075] In the embodiment of the present application, the rate-distortion cost (RD Cost) is an indicator used to evaluate the selection of different coding unit division methods in video coding, and is specifically defined as the weighted sum of the number of bits required for selecting the coding unit division method and the reconstruction distortion.
[0076] In one embodiment, the rate-distortion cost of a target feasible partitioning method (the target feasible partitioning method is one of multiple feasible partitioning methods) can be calculated by the following steps:
[0077] Step 1: Calculate the required number of bits (R) for each CU in the target feasible partitioning method, which is used to represent the prediction mode of the CU to the decoder and the residual required for reconstruction.
[0078] Step 2: Calculate the prediction error (D) of each CU in the target feasible partitioning method, expressed as the sum of squared errors between the original pixels and the reconstructed pixels.
[0079] Step 3: Calculate the rate-distortion cost (RdCost) of each CU in the target feasible partitioning method. According to the quantization parameter (QP) corresponding to each CU, the corresponding parameter λ can be obtained at the encoding end to obtain RdCost. The RdCost calculation formula is as follows:
[0080] RdCost=D+λ×R
[0081] Step 4: Calculate the total rate-distortion cost of the target feasible partitioning method. The total rate-distortion cost of the target feasible partitioning method can be obtained by summing up the rate-distortion costs of all CUs under this partitioning method.
[0082] (3) Determine the optimal division method of the coding unit from multiple feasible division methods according to the rate-distortion cost of each feasible division method.
[0083] In an embodiment of the present application, the terminal device can select the feasible division method with the lowest rate-distortion cost as the optimal division method, so as to obtain the best compression quality, achieve a higher compression rate and a better visual experience while maintaining the same video quality, and at the same time reduce the computational complexity and significantly shorten the encoding time. Moreover, by performing video encoding through the optimal division method, a more universal encoding result can be generated, so that the encoding result can be suitable for different application scenarios and devices.
[0084] Based on the above embodiments, the present application proposes to use the historical information of the encoded part (such as the second division result) to accelerate the division search of the sub-CU of the coding unit, which can be applied to the encoder including binary tree division and quadtree division used by the universal video coding (Versatile Video Coding, VVC) technology, thereby reducing the time complexity of the encoder and ensuring the efficiency of video compression, thereby completing the video encoding task more accurately, reliably and efficiently.
[0085] See also Figure 4 , which is a flow chart of a method for determining a division mode provided by an exemplary embodiment of the present application, and is described by taking the method applied to a terminal device as an example, the method may include the following steps:
[0086] S401. Use a first division method to divide a coding unit to obtain a first division result of the coding unit; the first division result includes multiple first sub-coding units.
[0087] S402, obtaining a second division result of the coding unit; the second division result is obtained by dividing the coding unit into multiple levels, and the division method adopted in the first level division is the second division method, and the coding unit is divided into multiple second sub-coding units after the first level division.
[0088] The second division result includes multiple division units, and the multiple division units include units obtained by dividing all or part of the second sub-coding unit; the second division result is obtained before the coding unit is divided by using the first division method.
[0089] S403: Compare the size of the first sub-coding unit with the size of the second sub-coding unit.
[0090] S404: If the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, determine a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units, where the target second sub-coding unit is any one of the multiple second sub-coding units.
[0091] The specific implementation of steps S401-S404 refers to the relevant description of steps S201-S203 in the aforementioned embodiment, which will not be repeated here.
[0092] The following takes the case where the first sub-coding unit is divided into the coding unit by using quadtree division and the second sub-coding unit is divided into the coding unit by using binary tree division as an example, and describes the method of determining the target division mode that matches the first sub-coding unit according to the division situation of the target second sub-coding unit through step S405:
[0093] S405. If the target second sub-coding unit is not divided, the target division method of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit, or skipping the division of each first sub-coding unit included in each first sub-coding unit according to the first division method.
[0094] In one embodiment, if Figure 5A As shown in sub-figure (1), the first division result is obtained by dividing the coding unit by a first division method (such as quadtree division), and the first division result includes four first sub-coding units, such as CU1, CU2, CU3 and CU4. The second division result is obtained by dividing the coding unit into three levels, and two second sub-coding units are obtained by a second division method (such as horizontal binary tree division) in the first level division, wherein one of the second sub-coding units is divided into two sub-coding units by vertical binary tree division in the second level division, and the two sub-coding units obtained by the second level division are divided into two sub-coding units by vertical binary tree division and horizontal binary tree division in the third level division. The target second sub-coding unit is any one of the multiple second sub-coding units (such as Figure 5A The second sub-coding unit that is not subsequently divided in the two second sub-coding units shown in the sub-graph (1) is matched, the first sub-coding unit includes multiple first sub-coding units, and the matched first sub-coding unit is multiple first sub-coding units that match the position of the target second sub-coding unit in the multiple first sub-coding units (such as Figure 5A CU1 and CU2 shown in sub-graph (1)). In the embodiment of the present application, the maximum partition level (that is, the maximum depth) of the multi-type tree (MTT) is greater than or equal to 2.
[0095] like Figure 5A As shown in the middle sub-figure (1), the terminal device first determines the division status of the target second sub-coding unit. If the division status of the target second sub-coding unit is not divided, the target division mode of the matching first sub-coding unit is determined as follows: skipping the division of each first sub-coding unit included in the matching first sub-coding unit (such as skipping the subsequent division of CU1 and CU2), or skipping the division of each first sub-coding unit included in each first sub-coding unit with respect to the first division mode (such as skipping the subsequent quadtree division of CU1 and CU2).
[0096] In one embodiment, if Figure 5AAs shown in sub-figure (2), the first division result is obtained by dividing the coding unit by a first division method (such as quadtree division), and the first division result includes four first sub-coding units, such as CU1, CU2, CU3 and CU4. The second division result is obtained by dividing the coding unit into three levels, and two second sub-coding units are obtained by a second division method (such as vertical binary tree division) in the first level division, one of which is divided into two sub-coding units by a horizontal binary tree in the second level division, and one of the two sub-coding units obtained by the second level division is divided into two sub-coding units by a vertical binary tree in the third level division. The target second sub-coding unit is any one of the multiple second sub-coding units (such as Figure 5A The second sub-coding unit that is not subsequently divided among the two second sub-coding units shown in the sub-graph (2) is matched, the first sub-coding unit includes multiple first sub-coding units, and the matched first sub-coding unit is multiple first sub-coding units that match the position of the target second sub-coding unit among the multiple first sub-coding units (such as Figure 5A CU2 and CU4 shown in sub-graph (2)). In this embodiment of the present application, the maximum partition level (that is, the maximum depth) of the multi-type tree (MTT) is greater than or equal to 2.
[0097] like Figure 5A As shown in sub-figure (2), the terminal device first determines the division status of the target second sub-coding unit. If the division status of the target second sub-coding unit is not divided, the target division mode of the matching first sub-coding unit is determined as follows: skipping the division of each first sub-coding unit included in the matching first sub-coding unit (such as skipping the subsequent division of CU2 and CU4), or skipping the division of each first sub-coding unit included in each first sub-coding unit with respect to the first division mode (such as skipping the subsequent quadtree division of CU2 and CU4).
[0098] In one embodiment, the matching first sub-coding unit includes multiple first sub-coding units. The above-mentioned determination of the target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit can also be implemented by method one. The specific implementation process of method one is as follows: if the division situation of the target second sub-coding unit is that no division is performed in the target direction, then the target division method of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit in the target direction; the target direction is the vertical direction or the horizontal direction.
[0099] like Figure 5BAs shown in sub-figure (1), the first division result is obtained by dividing the coding unit by a first division method (such as quadtree division), and the first division result includes four first sub-coding units, such as CU1, CU2, CU3 and CU4. The second division result is obtained by dividing the coding unit into three levels, and two second sub-coding units are obtained by a second division method (such as horizontal binary tree division) in the first level division, wherein one of the second sub-coding units is divided into two sub-coding units by horizontal binary tree division in the second level division, and the other second sub-coding unit is divided into two sub-coding units by vertical binary tree division in the second level division, and the two sub-coding units obtained by the second level division are divided into two sub-coding units respectively by vertical binary tree division and horizontal binary tree division in the third level division. The target second sub-coding unit is any one of the multiple second sub-coding units (such as Figure 5B The second sub-coding unit shown in the sub-graph (1) is only divided into the second level), the matching first sub-coding unit includes multiple first sub-coding units, and the matching first sub-coding unit is a plurality of first sub-coding units that match the position of the target second sub-coding unit among the multiple first sub-coding units (such as Figure 5B CU1 and CU2 shown in sub-graph (1)). In the embodiment of the present application, the maximum partitioning level (that is, the maximum depth) of the multi-type tree (MTT) is greater than or equal to 3.
[0100] like Figure 5B As shown in the middle sub-figure (1), the terminal device first determines the division of the target second sub-coding unit. If the division of the target second sub-coding unit is that the division in the target direction is not performed (such as the division in the vertical direction), the target division mode of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit in the target direction (such as skipping the subsequent vertical division of CU1 and CU2). The target direction is the vertical direction or the horizontal direction, and the division in the vertical direction may refer to vertical binary tree division, vertical ternary tree division, etc.
[0101] In one embodiment, the first division result and the second division result may also be as follows: Figure 5B As shown in the sub-graph (1), the method for determining the target division method matching the first sub-coding unit can refer to the above embodiment. Figure 5B The introduction related to the neutron diagram (1) will not be repeated in the embodiments of this application.
[0102] In one embodiment, when the target direction is a vertical direction, the division in the target direction may include: one or more of vertical binary tree division and vertical ternary tree division; when the target direction is a horizontal direction, the division in the target direction may include: one or more of horizontal binary tree division and horizontal ternary tree division. The vertical binary tree division refers to the vertical binary tree division for the sub-coding unit, such as Figure 3 In the legend marked by (4), horizontal binary tree partitioning refers to horizontal binary tree partitioning for sub-coding units, such as Figure 3 In the figure marked in (3), the horizontal ternary tree is divided as follows Figure 3 In the figure marked in (5), the vertical ternary tree is divided as follows Figure 3 The legend marked with (6) will not be described in detail in the embodiments of the present application.
[0103] In one embodiment, the matching first sub-coding unit includes multiple first sub-coding units. The above-mentioned determination of the target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit can also be implemented by method two. The specific implementation process of method two is as follows: if the division situation of the target second sub-coding unit is that it is divided, there are undivided third sub-coding units among the multiple third sub-coding units obtained by division, and there is a specific first sub-coding unit in the matching first sub-coding unit that matches the undivided third sub-coding unit, then the target division method of the matching first sub-coding unit is determined as: skipping the division of the specific first sub-coding unit, or skipping the division of the specific first sub-coding unit with respect to the first division method.
[0104] It should be noted that the matching of the specific first sub-coding unit and the undivided third sub-coding unit means that the position area to which the specific first sub-coding unit belongs in the coding unit is the same as the position area to which the undivided third sub-coding unit belongs in the coding unit.
[0105] like Figure 5CAs shown, the first division result is obtained by dividing the coding unit by a first division method (such as quadtree division), and the first division result includes four first sub-coding units, such as CU1, CU2, CU3 and CU4. The second division result is obtained by dividing the coding unit into three levels, and two second sub-coding units are obtained by adopting the second division method (such as horizontal binary tree division) in the first-level division, one of which is divided into two sub-coding units by vertical binary tree division in the second-level division, and one of the sub-coding units obtained by the second-level division is divided into two sub-coding units by horizontal binary tree division in the third-level division. Another second sub-coding unit is divided into two sub-coding units by vertical binary tree division in the second-level division, and the two sub-coding units obtained by the second-level division each adopt vertical binary tree division and horizontal binary tree division in the third-level division to obtain two sub-coding units respectively. The target second sub-coding unit is any one of the multiple second sub-coding units (such as Figure 5C ), the matching first sub-coding unit includes a plurality of first sub-coding units, and the matching first sub-coding unit is a plurality of first sub-coding units (such as Figure 5C CU1 and CU2 shown in ). In the embodiment of the present application, the maximum partition level (that is, the maximum depth) of the multi-type tree (MTT) is greater than or equal to 3.
[0106] like Figure 5C As shown, the terminal device first determines the division of the target second sub-coding unit. If the division of the target second sub-coding unit is divided (such as Figure 5C The target second sub-coding unit is divided), and there is a third sub-coding unit that is not divided among the multiple third sub-coding units obtained by division (such as Figure 5C ), and there is a specific first sub-coding unit in the matching first sub-coding unit that matches the third sub-coding unit that is not divided (such as Figure 5C CU1 in ), the target partitioning method that matches the first sub-coding unit is determined to be: skipping the partitioning of the specific first sub-coding unit (such as skipping the subsequent partitioning of CU1), or skipping the partitioning of the specific first sub-coding unit with respect to the first partitioning method (such as skipping the subsequent quadtree partitioning of CU1).
[0107] In one embodiment, the above step S405 and the method 1 and the method 2 in the embodiment are all an implementable method for determining the target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit. In the above step S405 and the method 1 and the method 2 in the embodiment, the first division method is quadtree division, and the second division method is binary tree division; matching the first sub-coding unit to match the target second sub-coding unit means: the position area of the multiple first sub-coding units included in the matching first sub-coding unit in the coding unit is the same as the position area of the target second sub-coding unit in the coding unit.
[0108] It should be noted that, in the process of determining the target division method of the coding unit, a joint judgment can be performed in combination with the above-mentioned step S405 and method one and method two in the embodiment, so as to find a plurality of target division methods of the coding unit that meet the determination conditions, and then determine the optimal division method of the coding unit from all feasible division methods through a plurality of target division methods, so as to obtain the best compression quality, and achieve a higher compression rate and a better visual experience while maintaining the same video quality.
[0109] S406. If the size of the first sub-coding unit is larger than the size of the second sub-coding unit, determine a matching second sub-coding unit that matches the target first sub-coding unit among the multiple second sub-coding units, where the target first sub-coding unit is any one of the multiple first sub-coding units.
[0110] The specific implementation of step S406 refers to the relevant description of step S204 in the above embodiment, which will not be repeated here.
[0111] The following takes the case where the first sub-coding unit is divided into the coding unit by using a binary tree division and the second sub-coding unit is divided into the coding unit by using a quadtree division as an example, and the method of determining the target division mode of the target first sub-coding unit according to the division situation of the matching second sub-coding unit is described through step S407:
[0112] S407: If the division situation of the matched second sub-coding unit is that all or part of the included multiple second sub-coding units are divided, determine the target division method of the target first sub-coding unit as: execute the division of the target first sub-coding unit.
[0113] In one embodiment, if Figure 5DAs shown in sub-figure (1), the first division result is obtained by dividing the coding unit by a first division method (such as horizontal binary tree division), and the first division result includes two first sub-coding units, such as CU1 and CU2. The second division result is obtained by dividing the coding unit into three levels, and four second sub-coding units are obtained by a second division method (such as quadtree division) in the first level division, one of which is divided into two sub-coding units by a horizontal binary tree in the second level division, and one of the two sub-coding units obtained by the second level division is divided into two sub-coding units by a vertical binary tree in the third level division. The target first sub-coding unit is any one of the multiple first sub-coding units (such as Figure 5D The matching second sub-coding unit includes a plurality of second sub-coding units, and the matching second sub-coding unit is a plurality of first sub-coding units (such as CU1 in the sub-graph (1)) that match the position of the target second sub-coding unit in the plurality of second sub-coding units. Figure 5D The two second sub-coding units included in the dotted box corresponding to the second sub-coding unit in the sub-graph (1) of the present application are matched). In this embodiment, the maximum partition level (that is, the maximum depth) of the multi-type tree (MTT) is greater than or equal to 2.
[0114] like Figure 5D As shown in sub-figure (1), the terminal device first determines the division situation of the matching second sub-coding unit. If the division situation of the matching second sub-coding unit is that all or part of the second sub-coding units included in the multiple second sub-coding units are divided (such as only one second sub-coding unit is subsequently divided), then the target division method of the target first sub-coding unit is determined as: executing the division of the target first sub-coding unit (such as forcing CU1 to continue dividing).
[0115] In one embodiment, if Figure 5D As shown in the sub-figure (2), the first division result can also be obtained by dividing the coding unit by using the first division method (such as vertical binary tree division). When the second division result remains unchanged, if the terminal device determines that the division of the matching second sub-coding unit is that all or part of the second sub-coding units in the plurality of second sub-coding units are divided (such as only one second sub-coding unit is subsequently divided), then the target division method of the target first sub-coding unit is determined as follows: executing the division of the target first sub-coding unit (such as forced division). Figure 5D CU1 shown in sub-figure (2) is further divided), which will not be repeated in this embodiment of the present application.
[0116] In one embodiment, the matching second sub-coding unit includes multiple second sub-coding units. The above-mentioned determination of the target division method of the target first sub-coding unit according to the division situation of the matching second sub-coding unit can also be implemented by method three. The specific implementation process of method three is as follows: if the division situation of the matching second sub-coding unit is that all the second sub-coding units among the multiple second sub-coding units included are not divided in the target direction, then the target division method of the target first sub-coding unit is determined as: skipping the division of the target first sub-coding unit in the target direction; the target direction is the vertical direction or the horizontal direction.
[0117] In one embodiment, if Figure 5E As shown in sub-figure (1), the first division result is obtained by dividing the coding unit by a first division method (such as horizontal binary tree division), and the first division result includes two first sub-coding units, such as CU1 and CU2. The second division result is obtained by dividing the coding unit into two levels, and four second sub-coding units are obtained by using a second division method (such as quadtree division) in the first level division, and one of the second sub-coding units is divided into two sub-coding units by using a vertical binary tree in the second level division. The target first sub-coding unit is any one of the multiple first sub-coding units (such as Figure 5E The matching second sub-coding unit includes a plurality of second sub-coding units, and the matching second sub-coding unit is a plurality of first sub-coding units (such as Figure 5E The two second sub-coding units included in the dotted box corresponding to the second sub-coding unit in the sub-graph (1) of the present application are matched). In this embodiment, the maximum partition level (that is, the maximum depth) of the multi-type tree (MTT) is greater than or equal to 2.
[0118] like Figure 5E As shown in the middle sub-figure (1), the terminal device first determines the division of the matching second sub-coding unit. If the division of the matching second sub-coding unit is that all the second sub-coding units included in the multiple second sub-coding units are not divided in the target direction (such as all the second sub-coding units are not divided in the horizontal direction), then the target division method of the target first sub-coding unit is determined as: skipping the division of the target first sub-coding unit in the target direction (such as skipping the subsequent horizontal division of CU1). The target direction is the vertical direction or the horizontal direction.
[0119] The first division result and the second division result can also be Figure 5E As shown in the sub-graph (2), the method for determining the target division method of the target first sub-coding unit can refer to the above embodiment and Figure 5EThe introduction related to the neutron diagram (1) will not be repeated in the embodiments of this application.
[0120] In one embodiment, the above step S407 and the method three in the embodiment are both an achievable method of determining the target division method of the target first sub-coding unit according to the division situation of the matching second sub-coding unit. In the above step S407 and the method three in the embodiment, the first division method is a binary tree division, and the second division method is a quadtree division; matching the second sub-coding unit with the target first sub-coding unit means: the position area of the multiple second sub-coding units included in the matching second sub-coding unit in the coding unit is the same as the position area of the target first sub-coding unit in the coding unit.
[0121] In one embodiment, if the terminal device determines that the size of the first sub-coding unit is equal to the size of the second sub-coding unit, steps S404 to S407 may be directly skipped.
[0122] It should be noted that, in the process of determining the target division method of the coding unit, a joint judgment can be performed in combination with the above-mentioned step S407 and method three in the embodiment, so as to find a plurality of target division methods of the coding unit that meet the determination conditions, and then determine the optimal division method of the coding unit from all feasible division methods through a plurality of target division methods, so as to obtain the best compression quality and achieve a higher compression rate and a better visual experience while maintaining the same video quality.
[0123] In one embodiment, the first division result and the second division result may also be as follows: Fig. 5F As shown in the sub-figure (1), the first division result is obtained by dividing the coding unit into two levels. Quadtree division is used in the first level division to obtain four first sub-coding units, such as CU1, CU2, CU3 and CU4. Quadtree division is used in the second level division of CU1 to obtain four sub-coding units, such as CU1-1, CU1-2, CU1-3 and CU1-4. The target second sub-coding unit is as follows: Fig. 5F As shown in the dotted box in sub-figure (1), the target second sub-coding unit matches CU-1 and CU1-2, and the terminal device determines the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit. If the division situation of the target second sub-coding unit is not divided, the target division mode of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit (such as skipping the subsequent division of CU1-1 and CU1-2), or skipping the division of each first sub-coding unit included in each first sub-coding unit with respect to the first division mode (such as skipping the subsequent quadtree division of CU1-1 and CU1-2).
[0124] The first division result and the second division result can also be Fig. 5F As shown in the sub-graph (2), the method for determining the target division method matching the first sub-coding unit can refer to the above embodiment and Fig. 5F The introduction related to the neutron diagram (1) will not be repeated in the embodiments of this application.
[0125] In one embodiment, the first division result and the second division result may also be as follows: Figure 5G As shown in sub-figure (1), the first division result is obtained by performing ternary tree division (such as horizontal ternary tree division) on the coding unit, and the first division result includes CU1, CU2 and CU3. The second division result is obtained by performing multiple levels of division on the coding unit, such as using horizontal binary tree division in the first level division to obtain two second sub-coding units, one of the two second sub-coding units obtained by the first level division is divided into two sub-coding units by vertical binary tree division in the second level division, and the two sub-coding units generated by the second level division are divided into two sub-coding units by vertical binary tree and horizontal binary tree division respectively in the third level division. Matching the first sub-coding unit and the target second sub-coding unit is as follows: Figure 5G As shown in the middle sub-graph (1), the location area to which the matching first sub-coding unit belongs in the coding unit is included in the location area to which the target second sub-coding unit belongs in the coding unit. The terminal device determines the target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit. If the division situation of the target second sub-coding unit is that no division is performed, the target division method of the matching first sub-coding unit is determined as: skipping the matching first sub-coding unit (such as skipping Figure 5G CU1 in the sub-picture (1) of FIG. 1 ), or skipping the division of each first sub-coding unit (such as Figure 5G The division of CU1) in the sub-image (1) by a partial division method (such as ternary tree division).
[0126] The first division result and the second division result can also be Figure 5G As shown in the sub-graph (2), the method for determining the target division method matching the first sub-coding unit can refer to the above embodiment and Figure 5G The introduction related to the neutron diagram (1) will not be repeated in the embodiments of this application.
[0127] In one embodiment, the first division result and the second division result may also be as follows: Figure 5HAs shown in the sub-figure (1), the first division result is obtained by performing binary tree division on the coding unit, and the first division result includes CU1 and CU2. The second division result is obtained by performing multiple levels of division on the coding unit, such as using ternary tree division (such as horizontal ternary tree division) in the first level division to obtain three second sub-coding units, and one of the three second sub-coding units obtained by the first level division is divided into three sub-coding units by vertical ternary tree division. Matching the second sub-coding unit and the target first sub-coding unit is as follows Figure 5H As shown in the middle sub-graph (1), the location area to which the matching second sub-coding unit belongs in the coding unit is included in the location area to which the target first sub-coding unit belongs in the coding unit. The terminal device determines the target division mode of the target first sub-coding unit according to the division situation of the matching second sub-coding unit. If the division situation of the matching second sub-coding unit is that the division is performed, the target division mode of the target first sub-coding unit is determined as follows: executing the division of the target first sub-coding unit (such as forcing Figure 5H CU1 in sub-image (1) is further divided).
[0128] The first division result and the second division result can also be Figure 5H As shown in the sub-graph (2), the method for determining the target division method of the target first sub-coding unit can refer to the above embodiment and Figure 5H The introduction related to the neutron diagram (1) will not be repeated in the embodiments of this application.
[0129] See also Figure 6 , which is a schematic block diagram of a division method determination device provided in an embodiment of the present application. The division method determination device may specifically include:
[0130] The processing module 601 is used to divide the coding unit in a first division manner to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units;
[0131] The acquisition module 602 is used to acquire a second division result of the coding unit; the second division result includes a plurality of division units, the second division result is obtained by performing multi-level division on the coding unit, and the division method adopted in the first-level division is the second division method, the coding unit is divided into a plurality of second sub-coding units after the first-level division, and the plurality of division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method;
[0132] The division mode determination module 603 is used to determine a matching first sub-coding unit that matches a target second sub-coding unit among the plurality of first sub-coding units if the size of the first sub-coding unit is smaller than the size of the second sub-coding unit; determine a target division mode of the matching first sub-coding unit according to the division condition of the target second sub-coding unit, wherein the target second sub-coding unit is any one of the plurality of second sub-coding units;
[0133] The above-mentioned division method determination module 603 is also used to determine the matching second sub-coding unit that matches the target first sub-coding unit among the above-mentioned multiple second sub-coding units if the size of the above-mentioned first sub-coding unit is larger than the size of the above-mentioned second sub-coding unit; determine the target division method of the above-mentioned target first sub-coding unit according to the division situation of the above-mentioned matching second sub-coding unit, and the above-mentioned target first sub-coding unit is any one of the above-mentioned multiple first sub-coding units.
[0134] Optionally, the matching first sub-coding unit includes multiple first sub-coding units, and the division mode determination module 603, when used to determine the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, is specifically used to:
[0135] If the target second sub-coding unit is not divided, the target division method of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit, or skipping the division of each first sub-coding unit included in the first sub-coding unit according to the first division method.
[0136] Optionally, the matching first sub-coding unit includes multiple first sub-coding units, and the division mode determination module 603, when used to determine the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, is specifically used to:
[0137] If the target second sub-coding unit is divided without division in the target direction, the target division method of the matching first sub-coding unit is determined as follows: skipping the division of each first sub-coding unit included in the matching first sub-coding unit in the target direction; the target direction is a vertical direction or a horizontal direction.
[0138] Optionally, the matching first sub-coding unit includes multiple first sub-coding units, and the division mode determination module 603, when used to determine the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, is specifically used to:
[0139] If the target second sub-coding unit is divided, there is a third sub-coding unit that is not divided among the multiple third sub-coding units obtained by the division, and there is a specific first sub-coding unit that matches the third sub-coding unit that is not divided among the matching first sub-coding units, then the target division method of the matching first sub-coding unit is determined as: skipping the division of the specific first sub-coding unit, or skipping the division of the specific first sub-coding unit with respect to the first division method;
[0140] Among them, the matching of the above-mentioned specific first sub-coding unit and the above-mentioned undivided third sub-coding unit means that: the position area to which the above-mentioned specific first sub-coding unit belongs in the above-mentioned coding unit is the same as the position area to which the above-mentioned undivided third sub-coding unit belongs in the above-mentioned coding unit.
[0141] Optionally, the first division method is quadtree division, and the second division method is binary tree division; the matching first sub-coding unit matches the target second sub-coding unit means that the position area of the multiple first sub-coding units included in the matching first sub-coding unit in the coding unit is the same as the position area of the target second sub-coding unit in the coding unit.
[0142] Optionally, the matching second sub-coding unit includes a plurality of second sub-coding units, and the division mode determination module 603, when used to determine the target division mode of the target first sub-coding unit according to the division situation of the matching second sub-coding unit, is specifically used to:
[0143] If the division of the matching second sub-coding unit is that all or part of the multiple second sub-coding units are divided, the target division method of the target first sub-coding unit is determined as: executing the division of the target first sub-coding unit.
[0144] Optionally, the matching second sub-coding unit includes a plurality of second sub-coding units, and the division mode determination module 603, when used to determine the target division mode of the target first sub-coding unit according to the division situation of the matching second sub-coding unit, is specifically used to:
[0145] If the division situation of the above-mentioned matching second sub-coding unit is that all the second sub-coding units among the multiple second sub-coding units are not divided in the target direction, then the target division method of the above-mentioned target first sub-coding unit is determined as: skipping the division of the above-mentioned target first sub-coding unit in the above-mentioned target direction; the above-mentioned target direction is the vertical direction or the horizontal direction.
[0146] Optionally, the first division method is binary tree division, and the second division method is quadtree division; the matching second sub-coding unit matches the target first sub-coding unit, which means that the position area of the multiple second sub-coding units included in the matching second sub-coding unit in the coding unit is the same as the position area of the target first sub-coding unit in the coding unit.
[0147] It should be noted that the functions of each functional module of the division method determination device in the embodiment of the present application can be specifically implemented according to the method in the above-mentioned method embodiment, and its specific implementation process can refer to the relevant description of the above-mentioned method embodiment, which will not be repeated here.
[0148] See also Figure 7 , which is a schematic block diagram of a computer device provided in an embodiment of the present application. As shown in the figure, the computer device in this embodiment may include: a processor 701, a storage device 702, and a communication interface 703. The processor 701, the storage device 702, and the communication interface 703 may exchange data.
[0149] The above-mentioned storage device 702 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the storage device 702 may also include a non-volatile memory (non-volatile memory), such as a flash memory, a solid-state drive (SSD), etc.; the above-mentioned storage device 702 may also include a combination of the above-mentioned types of memory.
[0150] The processor 701 may be a central processing unit (CPU). In one embodiment, the processor 701 may also be a graphics processing unit (GPU). The processor 701 may also be a combination of a CPU and a GPU. In one embodiment, the storage device 702 is used to store program instructions, and the processor 701 may call the program instructions to perform the following operations:
[0151] The coding unit is divided by a first division method to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units;
[0152] Obtaining a second division result of the coding unit; the second division result includes a plurality of division units, the second division result is obtained by performing multi-level division on the coding unit, and the division method adopted in the first-level division is the second division method, the coding unit is divided into a plurality of second sub-coding units after the first-level division, and the plurality of division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method;
[0153] If the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, determining a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units; determining a target division method of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, the target second sub-coding unit being any one of the multiple second sub-coding units;
[0154] If the size of the above-mentioned first sub-coding unit is larger than the size of the above-mentioned second sub-coding unit, a matching second sub-coding unit that matches the target first sub-coding unit among the above-mentioned multiple second sub-coding units is determined; according to the division situation of the above-mentioned matching second sub-coding unit, the target division method of the above-mentioned target first sub-coding unit is determined, and the above-mentioned target first sub-coding unit is any one of the above-mentioned multiple first sub-coding units.
[0155] Optionally, the matching first sub-coding unit includes multiple first sub-coding units, and the processor 701, when used to determine the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, is specifically used to:
[0156] If the target second sub-coding unit is not divided, the target division method of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit, or skipping the division of each first sub-coding unit included in the first sub-coding unit according to the first division method.
[0157] Optionally, the matching first sub-coding unit includes multiple first sub-coding units, and the processor 701, when used to determine the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, is specifically used to:
[0158] If the target second sub-coding unit is divided without division in the target direction, the target division method of the matching first sub-coding unit is determined as follows: skipping the division of each first sub-coding unit included in the matching first sub-coding unit in the target direction; the target direction is a vertical direction or a horizontal direction.
[0159] Optionally, the matching first sub-coding unit includes multiple first sub-coding units, and the processor 701, when used to determine the target division mode of the matching first sub-coding unit according to the division situation of the target second sub-coding unit, is specifically used to:
[0160] If the target second sub-coding unit is divided, there is a third sub-coding unit that is not divided among the multiple third sub-coding units obtained by the division, and there is a specific first sub-coding unit that matches the third sub-coding unit that is not divided among the matching first sub-coding units, then the target division method of the matching first sub-coding unit is determined as: skipping the division of the specific first sub-coding unit, or skipping the division of the specific first sub-coding unit with respect to the first division method;
[0161] Among them, the matching of the above-mentioned specific first sub-coding unit and the above-mentioned undivided third sub-coding unit means that: the position area to which the above-mentioned specific first sub-coding unit belongs in the above-mentioned coding unit is the same as the position area to which the above-mentioned undivided third sub-coding unit belongs in the above-mentioned coding unit.
[0162] Optionally, the first division method is quadtree division, and the second division method is binary tree division; the matching first sub-coding unit matches the target second sub-coding unit means that the position area of the multiple first sub-coding units included in the matching first sub-coding unit in the coding unit is the same as the position area of the target second sub-coding unit in the coding unit.
[0163] Optionally, the matching second sub-coding unit includes a plurality of second sub-coding units, and the processor 701, when used to determine the target division mode of the target first sub-coding unit according to the division situation of the matching second sub-coding unit, is specifically used to:
[0164] If the division of the matching second sub-coding unit is that all or part of the multiple second sub-coding units are divided, the target division method of the target first sub-coding unit is determined as: executing the division of the target first sub-coding unit.
[0165] Optionally, the matching second sub-coding unit includes a plurality of second sub-coding units, and the processor 701, when used to determine the target division mode of the target first sub-coding unit according to the division situation of the matching second sub-coding unit, is specifically used to:
[0166] If the division situation of the above-mentioned matching second sub-coding unit is that all the second sub-coding units among the multiple second sub-coding units are not divided in the target direction, then the target division method of the above-mentioned target first sub-coding unit is determined as: skipping the division of the above-mentioned target first sub-coding unit in the above-mentioned target direction; the above-mentioned target direction is the vertical direction or the horizontal direction.
[0167] Optionally, the first division method is binary tree division, and the second division method is quadtree division; the matching second sub-coding unit matches the target first sub-coding unit, which means that the position area of the multiple second sub-coding units included in the matching second sub-coding unit in the coding unit is the same as the position area of the target first sub-coding unit in the coding unit.
[0168] In a specific implementation, the processor 701, the storage device 702, and the communication interface 703 described in the embodiments of the present application can execute the embodiments of the present application. Figure 2 or Figure 4 The implementation method described in the related embodiments of the division method determination method provided can also be implemented in the embodiments of the present application. Figure 6 The implementation method described in the relevant embodiments of the provided division method determination device will not be repeated here.
[0169] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0170] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the aforementioned division method determination device, and the computer program includes program instructions. When the processor executes the above program instructions, it can execute the above Figure 2 , Figure 4The method in the corresponding embodiment, therefore, will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application. As an example, the program instructions can be deployed on a computer device, or executed on multiple computer devices located in one location, or, executed on multiple computer devices distributed in multiple locations and interconnected by a communication network, and multiple computer devices distributed in multiple locations and interconnected by a communication network can constitute a blockchain system.
[0171] According to one aspect of the present application, a computer program product is provided, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can perform the above Figure 2 , Figure 4 The method in the corresponding embodiment will therefore not be described in detail here.
[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The above-mentioned storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0173] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and making equivalent changes according to the claims of this application are still within the scope of the invention.
Claims
1. A method for determining a division mode, characterized in that: The method comprises: The coding unit is divided by a first division method to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units; Obtaining a second division result of the coding unit; the second division result includes a plurality of division units, the second division result is obtained by performing multi-level division on the coding unit, and the division method adopted in the first-level division is the second division method, the coding unit is divided into a plurality of second sub-coding units after the first-level division, and the plurality of division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method; If the size of the first sub-coding unit is smaller than the size of the second sub-coding unit, determining a matching first sub-coding unit that matches the target second sub-coding unit among the multiple first sub-coding units; determining a target division method of the matching first sub-coding unit according to the division condition of the target second sub-coding unit, the target second sub-coding unit being any one of the multiple second sub-coding units; If the size of the first sub-coding unit is larger than the size of the second sub-coding unit, a matching second sub-coding unit that matches the target first sub-coding unit among the multiple second sub-coding units is determined; a target division method of the target first sub-coding unit is determined according to the division situation of the matching second sub-coding unit, and the target first sub-coding unit is any one of the multiple first sub-coding units.
2. The method according to claim 1, characterized in that The matching first sub-coding unit includes a plurality of first sub-coding units, and determining a target division method of the matching first sub-coding unit according to a division condition of the target second sub-coding unit includes: If the target second sub-coding unit is not divided, the target division method of the matching first sub-coding unit is determined as: skipping the division of each first sub-coding unit included in the matching first sub-coding unit, or skipping the division of each first sub-coding unit included in the first sub-coding unit according to the first division method.
3. The method according to claim 1, characterized in that The matching first sub-coding unit includes a plurality of first sub-coding units, and determining a target division method of the matching first sub-coding unit according to a division condition of the target second sub-coding unit includes: If the target second sub-coding unit is divided without division in the target direction, the target division method of the matching first sub-coding unit is determined as follows: skipping the division of each first sub-coding unit included in the matching first sub-coding unit in the target direction; the target direction is a vertical direction or a horizontal direction.
4. The method according to claim 1, characterized in that: The matching first sub-coding unit includes a plurality of first sub-coding units, and determining a target division method of the matching first sub-coding unit according to a division condition of the target second sub-coding unit includes: If the target second sub-coding unit is divided, there is a third sub-coding unit that is not divided among the multiple third sub-coding units obtained by the division, and there is a specific first sub-coding unit that matches the third sub-coding unit that is not divided among the matching first sub-coding units, then determining the target division method of the matching first sub-coding unit is: skipping the division of the specific first sub-coding unit, or skipping the division of the specific first sub-coding unit with respect to the first division method; Among them, the matching of the specific first sub-coding unit and the undivided third sub-coding unit means that: the position area to which the specific first sub-coding unit belongs in the coding unit is the same as the position area to which the undivided third sub-coding unit belongs in the coding unit.
5. The method according to any one of claims 2 to 4, characterized in that: The first division method is quadtree division, and the second division method is binary tree division; the matching first sub-coding unit matches the target second sub-coding unit means that: the position area to which the multiple first sub-coding units included in the matching first sub-coding unit belong in the coding unit is the same as the position area to which the target second sub-coding unit belongs in the coding unit.
6. The method according to claim 1, characterized in that The matching second sub-coding unit includes a plurality of second sub-coding units, and the determining the target division mode of the target first sub-coding unit according to the division condition of the matching second sub-coding unit includes: If the division situation of the matching second sub-coding unit is that all or part of the multiple second sub-coding units are divided, the target division method of the target first sub-coding unit is determined as: executing the division of the target first sub-coding unit.
7. The method according to claim 1, characterized in that The matching second sub-coding unit includes a plurality of second sub-coding units, and the determining the target division mode of the target first sub-coding unit according to the division condition of the matching second sub-coding unit includes: If the division situation of the matching second sub-coding unit is that all the second sub-coding units among the multiple second sub-coding units are not divided in the target direction, then the target division method of the target first sub-coding unit is determined as: skipping the division of the target first sub-coding unit in the target direction; the target direction is the vertical direction or the horizontal direction.
8. The method according to claim 6 or 7, characterized in that: The first division method is binary tree division, and the second division method is quadtree division; the matching second sub-coding unit matches the target first sub-coding unit means that: the position area to which the multiple second sub-coding units included in the matching second sub-coding unit belong in the coding unit is the same as the position area to which the target first sub-coding unit belongs in the coding unit.
9. A device for determining a division method, characterized in that: The device comprises: A processing module, configured to divide the coding unit in a first division manner to obtain a first division result of the coding unit; the first division result includes a plurality of first sub-coding units; an acquisition module, configured to acquire a second division result of the coding unit; the second division result includes a plurality of division units, the second division result is obtained by performing multi-level division on the coding unit, and the division method adopted in the first-level division is the second division method, the coding unit is divided into a plurality of second sub-coding units after the first-level division, and the plurality of division units include units obtained by dividing all or part of the second sub-coding units; the second division result is obtained before the coding unit is divided by the first division method; a division mode determination module, configured to determine a matching first sub-coding unit that matches a target second sub-coding unit among the plurality of first sub-coding units if the size of the first sub-coding unit is smaller than the size of the second sub-coding unit; and determine a target division mode of the matching first sub-coding unit according to a division condition of the target second sub-coding unit, wherein the target second sub-coding unit is any one of the plurality of second sub-coding units; The division method determination module is also used to determine a matching second sub-coding unit among the multiple second sub-coding units that matches the target first sub-coding unit if the size of the first sub-coding unit is larger than the size of the second sub-coding unit; determine a target division method for the target first sub-coding unit according to the division situation of the matching second sub-coding unit, and the target first sub-coding unit is any one of the multiple first sub-coding units.
10. A computer device, characterized in that: include: A processor, a storage device and a communication interface, wherein the processor, the communication interface and the storage device are interconnected, wherein the storage device stores an executable program code, and the processor is used to call the executable program code to implement the method for determining the division method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions are executed by a processor to implement the method for determining a division mode according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product includes a computer program or a computer instruction, and when the computer program or the computer instruction is executed by a processor, it is used to implement the method for determining the division mode according to any one of claims 1 to 8.
