CN115883844A - Video data processing method, device, equipment and storage medium - Google Patents
Video data processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115883844A CN115883844A CN202211445730.3A CN202211445730A CN115883844A CN 115883844 A CN115883844 A CN 115883844A CN 202211445730 A CN202211445730 A CN 202211445730A CN 115883844 A CN115883844 A CN 115883844A
- Authority
- CN
- China
- Prior art keywords
- coded
- unit
- encoded
- subunits
- determining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003860 storage Methods 0.000 title claims abstract description 27
- 238000003672 processing method Methods 0.000 title abstract description 19
- 238000000638 solvent extraction Methods 0.000 claims abstract description 229
- 238000000034 method Methods 0.000 claims abstract description 82
- 238000012545 processing Methods 0.000 claims abstract description 33
- 238000005192 partition Methods 0.000 claims description 77
- 238000004590 computer program Methods 0.000 claims description 26
- 230000002457 bidirectional effect Effects 0.000 claims description 7
- 238000012216 screening Methods 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 40
- 238000005516 engineering process Methods 0.000 abstract description 16
- 238000010586 diagram Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 11
- 238000004891 communication Methods 0.000 description 9
- 230000008859 change Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 8
- 238000004458 analytical method Methods 0.000 description 7
- 108091026890 Coding region Proteins 0.000 description 4
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 239000013598 vector Substances 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical group COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The embodiment of the application discloses a video data processing method, a video data processing device, video data processing equipment and a storage medium, which are applied to scenes such as cloud games in a cloud technology, wherein the method comprises the following steps: acquiring a target recursive partitioning strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded; dividing the unit to be coded according to a target recursive division strategy to obtain N first subunits to be coded; acquiring coding parameters respectively corresponding to the N first subunits to be coded, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters respectively corresponding to the N first subunits to be coded; and if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, pausing the re-division of the unit to be coded, and determining a target division result of the unit to be coded according to the first subunit to be coded and the unit to be coded. By the method and the device, the complexity of the encoding process of the video data is reduced, and the encoding efficiency of the video data is improved.
Description
Technical Field
The present application relates to the field of cloud technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing video data.
Background
In the process of encoding video data, units to be encoded in a video frame need to be divided to obtain at least two subunits to be encoded, and then the subunits to be encoded are encoded, so that refined encoding of the video data is realized, and the encoding accuracy of the video data is improved. In practice, it is found that the partitioning strategy of the unit to be encoded generally includes multiple strategies, such as a non-partitioning strategy, a horizontal recursive partitioning strategy, a vertical recursive partitioning strategy, and the like, and the encoder will try all the partitioning strategies and finally select the partitioning strategy adapted to the unit to be encoded. Due to the wide variety of combinations of different partitioning strategies, the complexity of the encoding process of video data is high.
Disclosure of Invention
An embodiment of the present application provides a method, an apparatus, a device, and a storage medium for processing video data, so as to reduce complexity of an encoding process of the video data and improve encoding efficiency of the video data.
An embodiment of the present application provides a video data processing method, including:
acquiring a target recursive partitioning strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded;
dividing the unit to be coded according to the target recursive division strategy to obtain N first subunits to be coded; n is a positive integer greater than 1;
acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively;
and if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, pausing to divide the unit to be coded again, and determining a target division result of the unit to be coded according to the N first subunits to be coded and the unit to be coded.
An aspect of an embodiment of the present application provides a video data processing apparatus, including:
the device comprises an acquisition unit, a coding unit and a coding unit, wherein the acquisition unit is used for acquiring a target recursive partitioning strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded;
the dividing unit is used for dividing the unit to be coded according to the target recursive dividing strategy to obtain N first subunits to be coded; n is a positive integer greater than 1;
the determining unit is used for acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively;
and the pausing module is used for pausing the re-partitioning of the unit to be coded if the parameter relationship indicates that the unit to be coded does not meet the continuous partitioning condition, and determining a target partitioning result of the unit to be coded according to the N first subunits to be coded and the unit to be coded.
One aspect of the present application provides a computer device, including: a processor and a memory;
the memory is used for storing a computer program, and the processor is used for calling the computer program to execute the steps of the method.
An aspect of the embodiments of the present application provides a computer-readable storage medium, in which a computer program is stored, where the computer program includes program instructions, and the program instructions, when executed by a processor, perform the steps of the method.
An aspect of the embodiments of the present application provides a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the computer program/instruction implements the steps of the above method.
In the application, in the process of encoding a unit to be encoded in a target video frame, a target recursive partitioning strategy is tried first, that is, the unit to be encoded is partitioned according to the target recursive partitioning strategy to obtain N first subunits to be encoded of the unit to be encoded, and a parameter relationship between encoding parameters of the N first subunits to be encoded and encoding parameters of the unit to be encoded is determined. The target recursive partitioning policy may refer to any one of K candidate recursive partitioning policies of the unit to be encoded, or the target recursive partitioning policy may refer to a candidate recursive partitioning policy with the highest partitioning fineness among the K candidate recursive partitioning policies. And when the parameter relation reflects that the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, which indicates that texture information and the like of each subunit to be coded have similarity, the unit to be coded is more suitable for coding by adopting a coding unit with a larger size, and the unit to be coded does not meet the continuous division condition at the moment, thus the parameter relation can indicate whether the unit to be coded meets the continuous division condition. When the parameter relation indicates that the unit to be coded does not meet the continuous division condition, the unit to be coded is paused to be divided again, namely, the first subunit to be coded does not need to be divided, and the unit to be coded does not need to try other recursive division strategies, the trial of other recursive division strategies can be stopped in advance, the final division result (namely, the target division result) of the unit to be coded can be determined directly according to the division result (namely, the first subunit to be coded) of the target recursive division strategy and the unit to be coded, the division decision process of the coder can be accelerated, and therefore the cost of coding time and computing resources is reduced. Meanwhile, the coding parameters of the first sub-unit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and high-complexity analysis operation is not required to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a video data process provided herein;
FIG. 2a is a schematic diagram illustrating a relationship between a video frame where a unit to be encoded is located and a reference video frame provided in the present application;
FIG. 2b is a schematic diagram of an image partition provided herein;
fig. 3 is a schematic view of a scene of a video data processing method provided in the present application;
fig. 4 is a schematic flow chart of a video data processing method provided in the present application;
fig. 5 is a schematic flowchart of a video data processing method provided in the present application;
fig. 6 is a schematic flow chart of a video data processing method provided in the present application;
FIG. 7 is a diagram illustrating a final partition of a target video frame according to the present application;
FIG. 8 is a diagram illustrating a final partition of a target video frame according to the present application;
fig. 9 is a schematic structural diagram of a video data processing apparatus provided in the present application;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For example, in the present application, a cloud server renders a game scene as an initial video-audio stream, divides a unit to be encoded of a video frame in the initial video-audio stream according to a target recursive division strategy, obtains a first subunit to be encoded of the unit to be encoded, determines a coding parameter of the first subunit to be encoded and a coding parameter of the unit to be encoded, and indicates that texture information of each subunit to be encoded has similarity when a parameter relationship between the coding parameter of the first subunit to be encoded and the coding parameter of the unit to be encoded is a consistency relationship, if each subunit to be encoded is an area where the same game content is located, the game content may refer to a game prop, a game object, a sky, a forest, a ground, and the like in the game scene. At this time, the cloud server may determine that the unit to be encoded is more suitable for being encoded by using an encoding unit with a larger size, that is, determine that the unit to be encoded does not satisfy the continuous division condition, suspend dividing the unit to be encoded, and determine a final division result (that is, a target division result) of the unit to be encoded based on a division result (that is, a first subunit to be encoded) of the target recursive division policy and the unit to be encoded. Furthermore, the cloud server can encode the unit to be encoded of the video frame in the initial video audio stream according to the final division result to obtain a final video audio stream, the video audio stream is transmitted to the player game terminal, the player game terminal can load game pictures based on the video audio stream, and the division decision process is accelerated through the cloud server, so that the overhead of encoding time and computing resources is reduced, further, the efficiency of loading the game pictures by the player game terminal is improved, the time delay is reduced, and the user experience is improved.
It is understood that Cloud Technology refers to a hosting Technology for unifying resources of hardware, software, network, etc. in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. Cloud Technology (Cloud Technology) is based on the general names of network Technology, information Technology, integration Technology, management platform Technology, application Technology and the like applied in a Cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture-like websites and more web portals. With the high development and application of the internet industry, each article may have an own identification mark and needs to be transmitted to a background system for logic processing, data of different levels can be processed separately, and various industry data need strong system background support and can be realized only through cloud computing.
It can be understood that the Cloud technology is widely applied to medical, security, cloud game and other scenes, wherein Cloud game (Cloud gaming) may also be called game on demand (gaming) and is an online game technology based on the Cloud computing technology. Cloud gaming technology enables light-end devices (Thin clients) with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud game scene, a game is not operated in a player game terminal but in a cloud server, and the cloud server renders the game scene into a video and audio stream which is transmitted to the player game terminal through a network. The game terminal of the player does not need to have strong graphic operation and data processing capacity, and only needs to have basic streaming media playing capacity and capacity of acquiring input instructions of the player and sending the input instructions to the cloud server.
In order to facilitate a clearer understanding of the present application, a video data processing system implementing the video data processing method of the present application is first introduced, as shown in fig. 1, the video data processing system includes a server 10 and a terminal cluster, as shown in fig. 1, and the terminal cluster may include one or more terminals, and the number of the terminals is not limited herein. As shown in fig. 1, the terminal cluster may specifically include terminal 1, terminal 2, \8230, terminal n; it is understood that terminal 1, terminal 2, terminal 3, 8230, and terminal n can be connected to server 10 through network, so that each terminal can interact data with server 10 through network connection.
It is understood that the server 10 may refer to a device for providing a back-end service for video data, for example, the server may refer to a back-end device that performs encoding processing and decoding processing on video data. Each terminal may refer to a device facing a user, a terminal may refer to a device for providing front-end service for video data, and for example, a terminal may refer to a device for rendering and playing video data. The terminal can be provided with clients, such as an audio and video playing client, a short video client, a live broadcast client, a game client and the like, which can be used for playing video data.
It can be understood that the server may be an independent physical server, may also be a server cluster or a distributed system formed by at least two physical servers, and may also be a cloud server that provides basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform. The terminal may specifically refer to a smart phone, a computer, a smart speaker, a smart voice interaction device, a smart appliance, a vehicle-mounted terminal, an aircraft, and the like, but is not limited thereto. Each terminal and each server may be directly or indirectly connected through a wired or wireless communication manner, and the number of the terminals and the number of the servers may be one or at least two, which is not limited herein.
It can be understood that the target video frame may refer to a video frame with a frame type of P frame or B frame in the video data, the P frame may be a forward predicted frame, and the inside may be composed of I macroblocks and P macroblocks; the B frame is a bidirectional predicted frame, and the inner part can be composed of I macroblocks and B macroblocks. The prediction mode of the I macroblock is an intra prediction mode, the prediction mode of the P macroblock can be a forward prediction mode, and the prediction mode of the B macroblock can be a bidirectional prediction mode. The target video frame may include one or at least two units to be encoded, and when the target video frame includes one unit to be encoded, the unit to be encoded refers to the target video frame; when the target video frame includes at least two units to be encoded, the at least two units to be encoded may be obtained by dividing the target video frame according to a target recursive division policy. In particular, a video frame with a frame type of P frame or B frame is generally a video frame other than the first video frame in the video data, and the first video frame may refer to a video frame with the earliest playing time in the video data. Here, the bidirectional prediction mode includes a forward prediction mode and a backward prediction mode, and the forward prediction mode refers to: the coding sequence of the reference video frame corresponding to the unit to be coded is located before the coding sequence of the target video frame, and the playing sequence of the reference video frame corresponding to the unit to be coded is located before the playing sequence of the target video frame, and the backward prediction mode refers to: the coding sequence of the reference video frame corresponding to the unit to be coded is located before the coding sequence of the target video frame, and the playing sequence of the reference video frame corresponding to the unit to be coded is located after the playing sequence of the target video frame.
For example, as shown in fig. 2a, when the unit to be encoded 14b in the target video frame 11a performs inter-frame prediction, the encoder (i.e., the server) constructs a reference frame list for the target video frame, where the reference frame list includes two parts, a forward reference frame list and a backward reference frame list. The forward reference frame list contains a number of video frames that are in a coding order that precedes the coding order of the target video frame and that have a playback order that also precedes the playback order of the target video frame. The backward reference frame list contains video frames that are in coding order before the coding order of the target video frame, but in playback order after the playback order of the target video frame. The encoder may select a frame from the forward reference frame list or the backward reference frame list as a reference frame (unidirectional prediction mode), or may select a frame from the two reference frame lists respectively and two frames in total as reference frames (bidirectional prediction mode). When the encoder selects bi-directional prediction mode as the prediction mode of the unit to be encoded 14b as in fig. 2a, the reference frame selected by the encoder from the forward reference sequence is the video frame 13a, the coding block 16b in the video frame 13a is the reference block of the block to be encoded 14b, the reference frame selected from the backward reference sequence is the video frame 12a, and the coding block 15b in the video frame 12a is the reference block of the block to be encoded 14 b.
It can be understood that the partitioning policy for any unit to be encoded in the target video frame may include a non-partitioning policy and K candidate recursive partitioning policies, where the non-partitioning policy refers to a policy for not partitioning the unit to be encoded, the candidate recursive partitioning policy refers to a policy for partitioning the unit to be encoded, and K may be a positive integer greater than 1. For example, candidate recursive partitioning strategies may include, but are not limited to: horizontal binary division, vertical binary division, quaternary division, horizontal ternary division, and vertical ternary division. The horizontal binary division refers to dividing a unit to be coded into two subunits to be coded according to the horizontal direction of the unit to be coded, and the vertical binary division refers to dividing the unit to be coded into two subunits to be coded according to the vertical direction of the unit to be coded. The horizontal three-division means that the unit to be coded is divided into three subunits to be coded according to the horizontal direction of the unit to be coded; the vertical three-division means that the unit to be coded is divided into three sub-units to be coded according to the vertical direction of the unit to be coded. The fourth division refers to dividing the unit to be coded into four subunits to be coded. When the candidate recursive partitioning strategy is used for partitioning the unit to be coded, the unit to be coded may be partitioned into equal sizes or partitioned into unequal sizes, the sizes of the sub-units to be coded obtained through equal-size partitioning are the same, and the sizes of the sub-units to be coded obtained through unequal-size partitioning may be different.
For example, as shown in fig. 2b, it is assumed that the unit to be encoded 20a in the target video frame is divided according to a non-division strategy to obtain a subunit to be encoded 21a, and the size of the subunit to be encoded 21a is the same as the size of the unit to be encoded 20 a; dividing the unit to be encoded 20a according to the horizontal two-division to obtain two sub-units to be encoded 22a, wherein the sizes of the two sub-units to be encoded 22a in the horizontal direction are both the same as the size of the unit to be encoded 20a in the horizontal direction, and the sum of the sizes of the two sub-units to be encoded 22a in the vertical direction is the same as the size of the unit to be encoded 20a in the vertical direction. Dividing the unit to be encoded 20a according to the vertical binary division to obtain two sub-units to be encoded 23a, wherein the sum of the sizes of the two sub-units to be encoded 23a in the horizontal direction is the same as the size of the unit to be encoded 20a in the horizontal direction, and the sizes of the two sub-units to be encoded 23a in the vertical direction are the same as the size of the unit to be encoded 20a in the vertical direction. Dividing the unit to be encoded 20a according to the four divisions to obtain four sub-units to be encoded 24a, where the sum of the sizes of the four sub-units to be encoded 24a in the horizontal direction is the same as the size of the unit to be encoded 20a in the horizontal direction, and the sum of the sizes of the four sub-units to be encoded 24a in the vertical direction is the same as the size of the unit to be encoded 20a in the vertical direction. Dividing the unit to be coded 20a according to the vertical three divisions to obtain three subunits to be coded 25a, wherein the sum of the sizes of the three subunits to be coded 25a in the horizontal direction is the same as the size of the unit to be coded 20a in the horizontal direction, and the sizes of the three subunits to be coded 25a in the vertical direction are all the same as the size of the unit to be coded 20a in the vertical directionThe same is true. Dividing the unit to be encoded 20a according to the horizontal three divisions to obtain three sub-units to be encoded 26a, wherein the sizes of the three sub-units to be encoded 26a in the horizontal direction are all the same as the size of the unit to be encoded 20a in the horizontal direction, and the sum of the sizes of the three sub-units to be encoded 26a in the vertical direction is the same as the size of the unit to be encoded 20a in the vertical direction. Further, the sub-units to be coded obtained by the division can be used as the units to be coded, and the units to be coded are divided according to the division strategy to obtain the coding sub-units with finer granularity. As shown in FIG. 2b, any sub-unit 24a to be encoded can be used as the unit to be encoded 24a * The coding unit 24a is treated according to a non-partitioning strategy * Dividing to obtain a subunit to be coded 21b; the coding units 24a are treated according to a horizontal subdivision * Dividing to obtain two subunits to be coded 22b; the coding units 24a are treated according to a vertical binary division * Dividing to obtain two subunits to be coded 23b; the coding unit 24a is treated in four divisions * Dividing to obtain four subunits to be coded 24b; the coding unit 24a is treated according to a vertical subdivision * Dividing to obtain three subunits to be coded 25b; the coding units 24a are treated according to a horizontal three-division * And dividing to obtain three subunits to be coded 26b.
As shown in fig. 2b, at present, for any unit to be coded in the target video frame, the above 6 partitioning strategies need to be tried, so as to obtain partitioning results corresponding to the 6 partitioning strategies, respectively, where the partitioning results corresponding to the partitioning strategies include sub-units to be coded obtained based on the corresponding partitioning strategies. And selecting an optimal division strategy from the 6 division strategies based on the division results respectively corresponding to the 6 division strategies, and taking the division result corresponding to the optimal division strategy as a final division result of the unit to be coded. Further, the above steps also need to be repeated for any subunit to be coded, and the division of the unit to be coded is not stopped until the size of the coding subunit does not satisfy the division condition. As can be seen, the complexity of the division of the unit to be coded is relatively high, which leads to a relatively high complexity of the coding process. Based on this, a video data processing method is proposed in the present application, and the video data processing method may be implemented by using a video data processing system as shown in fig. 1, as shown in fig. 3 and fig. 4, the video data processing method of the present application is described by taking an internet of vehicles as an example. The terminal 30a in fig. 3 may refer to any one of the terminals in the terminal cluster in fig. 1, and the server 31a in fig. 3 may refer to the server 10 in fig. 1. The server 31a may obtain video data sent by the vehicle-mounted terminal, where the video data may be obtained by shooting a driving road of a vehicle, sequentially encode video frames in the video data to obtain a code stream of the video data, and transmit the code stream of the video data to the terminal 30a.
As shown in fig. 4, the video data processing method may include the steps s11 to s15 of:
and s11, dividing the unit to be coded according to the four divisions to obtain four subunits to be coded. The server 31a may traverse the frame type of the video frame of the video data, and when the frame type of the traversed video frame is a P frame or a B frame, the traversed video frame is used as a target video frame, where the target video frame includes the unit to be encoded 32a, and the unit to be encoded 32a refers to a target video frame that is not divided. Referring to fig. 3, assuming that the target recursive partitioning strategy is four partitions, the server 31a may first try four partitions for the unit to be encoded, that is, partition the unit to be encoded 32a according to the four partitions, to obtain four sub-units to be encoded, where the four sub-units to be encoded are the sub-unit to be encoded 33a, the sub-unit to be encoded 34a, the sub-unit to be encoded 35a, and the sub-unit to be encoded 36a, respectively. Further, the server may obtain the encoding parameter of each sub-unit to be encoded and the encoding parameter of the unit to be encoded, the encoding parameter of the unit to be encoded is encoding parameter 1, the encoding parameters corresponding to the sub-unit to be encoded 33a, the sub-unit to be encoded 34a, the sub-unit to be encoded 35a, and the sub-unit to be encoded 36a are encoding parameter 2, encoding parameter 3, encoding parameter 4, and encoding parameter 5, the encoding parameter 1 may include the motion information of the unit to be encoded 32a, the encoding parameter of each sub-unit to be encoded may include the motion information of the corresponding sub-unit to be encoded, and the motion information of the unit to be encoded and the motion information of the sub-unit to be encoded may include at least one of a prediction mode, a reference frame mode, and a reference frame index. The prediction mode herein includes an intra-frame prediction mode and an inter-frame prediction mode, the intra-frame prediction mode refers to that a unit to be coded (or a subunit to be coded) refers to a coded unit in a video frame where the unit to be coded is located for coding, the inter-frame prediction mode refers to that the unit to be coded (or the subunit to be coded) refers to a coded unit in other video frames in video data for coding, the inter-frame prediction mode includes a translational inter-frame prediction mode and an affine inter-frame prediction mode, the translational inter-frame prediction mode refers to that motion vectors of all pixel points in the unit to be coded (or the subunit to be coded) are the same, and the affine inter-frame prediction mode refers to that motion vectors of pixel points in the unit to be coded (or the subunit to be coded) are different. The reference index is used to reflect the playing order of the reference video frames of the unit to be encoded (or sub-unit to be encoded), or the number of the reference video frames.
And s12, determining the parameter relation between the coding parameters of the four sub-units to be coded and the coding parameters of the units to be coded.
s13, judging whether the parameter relation is a consistency relation or not, if the parameter relation is the consistency relation, executing a step s15; if the parameter relationship is not a consistency relationship, step s14 is executed.
s14, trying other recursive partitioning strategies for the unit to be coded.
And s15, pausing the division of the unit to be coded.
In steps s12 to s15, the server 31a may compare the encoding parameter 2, the encoding parameter 3, and the encoding parameter 5 with the encoding parameter 1 in sequence, and if there is a parameter relationship between the encoding parameter and the encoding parameter 1 in the encoding parameter 2, the encoding parameter 3, and the encoding parameter 5, it indicates that the texture information in the sub-unit to be encoded 33a, the sub-unit to be encoded 34a, the sub-unit to be encoded 35a, and the sub-unit to be encoded 36a does not have similarity, and the unit to be encoded 32a is more suitable for encoding with a smaller-sized encoding unit. Therefore, the server 31a may divide the unit to be encoded 32a according to other recursive division strategies except for the four divisions to obtain division results corresponding to the other recursive division strategies, and determine a target division result of the unit to be encoded 32a according to the division results of the unit to be encoded 32a under the other recursive division strategies, the division results of the unit to be encoded 32a under the four divisions (i.e., the encoding subunit 33a, the subunit to be encoded 34a, the subunit to be encoded 35a, and the subunit to be encoded 36 a), and the division results of the unit to be encoded 32a under the strategy that is not divided (i.e., the unit to be encoded 32 a). If the encoding parameters 2, 3, and 5 all have a consistent parameter relationship with the encoding parameter 1, this indicates that the texture information in the to-be-encoded subunit 33a, the to-be-encoded subunit 34a, the to-be-encoded subunit 35a, and the to-be-encoded subunit 36a has similarity, and the to-be-encoded unit 32a is more suitable for encoding with a large-sized encoding unit. Therefore, if the encoding parameter 2, the encoding parameter 3, and the encoding parameter 5 all have a consistent parameter relationship with the encoding parameter 1, the server 31a may suspend dividing the unit to be encoded 32a, and determine a final division result (i.e., a target division result) of the unit to be encoded 32a according to a division result of the unit to be encoded 32a under the non-division policy and a division result of the unit to be encoded 32a under the four-division policy.
As shown in fig. 3, when the server 31a obtains the target division result of the unit to be encoded 32a, the server may encode the unit to be encoded 32a according to the target division result of the unit to be encoded 32a to obtain a code stream of video data, and send the code stream of video data to the terminal 30a. When receiving the code stream of the video data, the terminal 30a may decode the code stream of the video data to obtain the video data, and plan a driving route for the vehicle according to the video data, or control automatic driving of the vehicle according to the video data.
Therefore, the partition decision process aiming at the coding unit can be accelerated through the method and the device, so that the coding time and the expenditure of computing resources are reduced. Meanwhile, the coding parameters of each subunit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and high-complexity analysis operation does not need to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved.
Further, please refer to fig. 5, which is a flowchart illustrating a video data processing method according to an embodiment of the present application, where the method may be executed by the terminal in fig. 1, or by the server in fig. 1, or by both the terminal and the server in fig. 1, and devices for executing the method in the present application may be collectively referred to as computer devices. As shown in fig. 5, the method may include the steps of:
s101, a target recursive partitioning strategy for a unit to be coded in a target video frame and a coding parameter of the unit to be coded are obtained.
In this application, a computer device may use a video frame of which a frame type is a P frame or a B frame in video data as a target video frame, determine an uncoded unit in the target video frame as a unit to be coded, acquire a coding parameter of the unit to be coded according to texture information, pixel information, and the like in the unit to be coded, where the coding parameter of the unit to be coded may include motion information of the unit to be coded, and the motion information of the unit to be coded may include at least one of a prediction mode, a reference frame mode, and a reference frame index; the coding parameters of the unit to be Coded may further include a Coded Block Flag (Coded Block Flag, CBF): when the coded block flag is 0, a syntax element related to the residual coding of the unit to be coded indicates that all coefficients of the residual of the unit to be coded after transformation and quantization are 0, and the quantized coefficients do not need to be coded, that is, residual coefficients related to the unit to be coded do not need to be sent to a decoding end.
It can be understood that the method and the device can be applied to a car networking scene, a game scene, a video live broadcast scene, a short video scene, a movie playing scene and the like, and the method and the device are not limited in the application.
It can be understood that the computer device can acquire the target recursive partitioning strategy of the unit to be coded in any one of the following two ways: in a first manner, the computer device may determine, as the target recursive partitioning policy, any one of the K candidate recursive partitioning policies for the K candidate recursive partitioning policies of the unit to be encoded in the target video frame. And determining the partition fineness corresponding to the K candidate recursive partition strategies respectively, wherein the partition fineness is used for reflecting the partition fineness of the units to be coded of the corresponding candidate recursive partition strategies, and the partition fineness can be determined according to the unit number or the size of the sub-units to be coded obtained by partitioning. Further, a candidate recursive partitioning strategy with the maximum partitioning fineness is screened out from the K candidate recursive partitioning strategies, and the screened candidate partitioning strategy is determined to be a target recursive partitioning strategy for a unit to be coded in a target video frame. Therefore, all candidate recursive partitioning strategies can be avoided from being tried in sequence aiming at the unit to be coded, the partitioning decision process of the unit to be coded is accelerated, and the coding time and the expenditure of computing resources are reduced.
It can be understood that the determining the partition fineness corresponding to each of the K candidate recursive partition strategies includes: the computer equipment can obtain the unit number of the sub-units to be coded when the units to be coded are divided according to the candidate recursive division strategy 1, obtain the unit number of the sub-units to be coded when the units to be coded are divided according to the candidate recursive division strategy 2, and so on until the unit numbers respectively corresponding to the K candidate recursive division strategies are obtained. The number of units corresponding to the candidate recursive partitioning policy is predefined in the corresponding candidate recursive partitioning policy, for example, the number of units corresponding to the quartic partition is four, the number of units corresponding to the horizontal quartic partition and the vertical quartic partition is two, and the number of units corresponding to the vertical quartic partition and the horizontal quartic partition is three. The computer device may determine, according to the number of units corresponding to the K candidate recursive partitioning policies, partitioning fineness corresponding to the K candidate recursive partitioning policies, respectively; the number of units corresponding to the candidate recursive partitioning strategy Pi in the K candidate recursive partitioning strategies has positive correlation with the partitioning fineness corresponding to the candidate recursive partitioning strategy Pi; i is a positive integer less than or equal to K. Since the size of the unit to be encoded is fixed, if the number of units corresponding to the candidate recursive partitioning policy Pi is larger, the smaller the size of each sub-unit to be encoded obtained by the candidate recursive partitioning policy Pi and the equal-size partitioning is, indicating that the partitioning fineness corresponding to the candidate recursive partitioning policy Pi is higher. Conversely, if the number of units corresponding to the candidate recursive partitioning policy Pi is smaller, the larger the size of each subunit to be coded obtained by partitioning according to the candidate recursive partitioning policy Pi and the equal size, the lower the partitioning fineness corresponding to the candidate recursive partitioning policy Pi is indicated. Generally, when there is consistency between the coding parameters of the sub-unit to be coded having a first size (i.e. a small size) and the coding parameters of the unit to be coded, there is consistency between the coding parameters of the sub-unit to be coded having a second size (a large size) and the unit to be coded, and the first size is smaller than the second size. In the same way, generally, if there is no consistency between the coding parameters of the sub-unit to be coded with the first size and the coding parameters of the unit to be coded, there is no consistency between the coding parameters of the sub-unit to be coded with the second size and the unit to be coded. Therefore, when the consistency exists between the coding parameters of the sub-unit to be coded under the candidate recursive partitioning strategy for determining the maximum partitioning fineness and the coding parameters of the unit to be coded, the unit to be coded does not need to try other candidate recursive partitioning strategies, the candidate recursive partitioning strategy for determining the maximum partitioning fineness is determined as the target recursive partitioning strategy of the unit to be coded, the partitioning frequency of the unit to be coded is reduced, the partitioning decision process of the unit to be coded is accelerated, and the coding time and the expenditure of computing resources are reduced.
S102, dividing the unit to be coded according to the target recursive division strategy to obtain N first subunits to be coded; n is a positive integer greater than 1.
In the application, the computer device may try a target recursive partitioning policy for the unit to be encoded, that is, partition the unit to be encoded according to the target recursive partitioning policy, to obtain N first subunits to be encoded; n is a positive integer greater than 1, N is predefined by a target recursive partitioning policy, and the sizes of the N subunits to be encoded may be the same or different.
S103, acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively.
In the application, the computer device may obtain, according to texture information, pixel information, and the like respectively corresponding to the N first subunits to be encoded, encoding parameters respectively corresponding to the N first subunits to be encoded; the coding parameters of the first sub-unit to be coded here comprise the motion information of the unit to be coded. Furthermore, the coding parameters corresponding to the N first subunits to be coded are compared with the coding parameters of the unit to be coded, so as to obtain the parameter relationship between the coding parameters corresponding to the N first subunits to be coded and the coding parameters of the unit to be coded. The parameter relationship here is used to reflect whether there is consistency between the coding parameters corresponding to the N first subunits to be coded and the coding parameters of the unit to be coded, and the consistency between the coding parameters corresponding to the N first subunits to be coded and the coding parameters of the unit to be coded may refer to: the coding parameters corresponding to the N first subunits to be coded are all the same as the coding parameters of the unit to be coded, for example, the motion information of the N first subunits to be coded is all the same as the motion information of the unit to be coded. Or, if the coding parameters respectively corresponding to the N first sub-units to be coded and the coding parameters of the unit to be coded have consistency, the following may be: the similarity between the coding parameters corresponding to the N first sub-units to be coded and the coding parameters of the unit to be coded is greater than a similarity threshold, where the similarity may be determined by a difference between the coding parameters, and the similarity threshold may be determined according to an application scenario of the video data, or the similarity threshold may be manually set. For example, the motion information of the N first sub-units to be encoded is the same as the motion information of the unit to be encoded, and the value of the coding block flag of the unit to be encoded is smaller than the threshold, where the threshold may be a value greater than 0 and close to 0, the coding block flag of the unit to be encoded may be a coding block flag of the unit to be encoded on at least one of a Y component, a U component, and a V component, where the Y component is a luma of the unit to be encoded, and the U component and the V component are chroma of the unit to be encoded.
Understandably, when the parameter relationship reflects that the coding parameters respectively corresponding to the N first subunits to be coded and the coding parameters of the unit to be coded have consistency, the parameter relationship indicates that the unit to be coded does not meet the continuous division condition; and when the parameter relationship reflects that the coding parameters respectively corresponding to the N first subunits to be coded are consistent with the coding parameters of the unit to be coded, the parameter relationship indicates that the unit to be coded meets the continuous dividing condition. Here, the unit to be coded satisfying the continuous division condition means: the remaining recursive partitioning strategy needs to be tried for the unit to be encoded.
It can be understood that the basic idea of inter-frame prediction is to select a region (i.e., a reference block) with the most similar pixel distribution, texture information, etc. from one or two frames that have been previously encoded by using the temporal correlation of video data to predict a unit to be encoded, and then only the position information of this similar region and the pixel difference between the unit to be encoded and the similar region need to be encoded. Generally, the smaller the pixel difference is, the smaller the residual coefficient is, the fewer the number of bytes needs to be transmitted, and the higher the coding efficiency is, that is, the better the prediction effect of the unit to be coded is. The encoder can also generate a code stream that meets the standard if the final selected area is not the most reasonable area for prediction, but the encoding efficiency suffers. Finding this most reasonable region is a computationally very complex process, which is often performed by the encoder by pixel comparisons, also called motion search.
Therefore, if the change of texture information and pixel information in the unit to be coded is large, the unit to be coded needs to be divided by recursion for multiple times, the dividing fineness of the unit to be coded is higher, the size of the sub-unit to be coded obtained by dividing the unit to be coded is smaller, and the pixel information and the texture information in a single sub-unit to be coded have similarity, so that a reference block which is more similar to the sub-unit to be coded (namely the texture information or the pixel information and the like) is favorably searched from a reference video frame, and the prediction effect (namely the coding accuracy) of the unit to be coded is favorably improved. If the change of the texture information and the pixel information in the unit to be coded is small, which indicates that the pixel information, the texture information and the like in the unit to be coded have similarity, a reference block which is more similar to the unit to be coded can be searched from the reference frame without carrying out multiple recursive division on the unit to be coded, so that the coding efficiency of the unit to be coded is improved.
Therefore, when the change of texture information, pixel information and the like in the unit to be coded is small, the unit to be coded is more suitable for being coded by using a coding unit with a large size; on the contrary, when the variation of texture information, pixel information, etc. in the unit to be encoded is large, the unit to be encoded is more suitable for encoding using a small-sized encoding unit. Since the encoding parameters of the unit to be encoded are determined based on the texture information, the pixel information, and the like of the unit to be encoded, the encoding parameters of the sub-unit to be encoded, and the like are determined based on the texture information, the pixel information, and the like of the sub-unit to be encoded. Then, the encoding parameters of the unit to be encoded can reflect the pixel information, the texture information, and the like of the unit to be encoded to a certain extent, and the encoding parameters of the sub-unit to be encoded can reflect the pixel information, the texture information, and the like of the sub-unit to be encoded to a certain extent, and further, the parameter relationship between the encoding parameters of the sub-unit to be encoded and the encoding parameters of the sub-unit to be encoded can be used for detecting whether the unit to be encoded meets the continuous division condition.
It can be understood that there is a rule for block division, that is, an image region with good prediction effect is biased to use a large-sized unit to be encoded for encoding, where the good prediction effect means that a residual coefficient in the image region approaches to 0, if a smaller unit to be encoded is used, improvement of accuracy of a residual value after decoding reconstruction is limited, and bit consumption for encoding more divisions and prediction mode information is avoided by using a larger unit to be encoded. Since the result of the motion search (i.e. the motion information of the unit to be coded and the motion information of the sub-unit to be coded) is obtained by very fine computation, it can reflect the prediction effect to a certain extent, which provides feasibility for fast partition decision of the unit to be coded according to the motion information of the motion search.
It can be understood that, when the result (i.e. motion information) of the translational motion search of the unit to be encoded can truly reflect the translational motion trajectory of the image block covered by the unit to be encoded, the prediction effect of the unit to be encoded is often good enough, and the residual error is also small enough. Therefore, when the result of the translational motion search of the unit to be encoded already reflects the real-time motion trajectory of the image block covered by the unit to be encoded, the continuous division of the unit to be encoded is stopped in advance. How can the result of the translational motion search of the unit to be encoded reflect the real-time motion trajectory of the image block covered by the unit to be encoded? Usually, if the result of the translational motion search of the unit to be encoded is indeed the actual motion trajectory of the image block covered by it, the result of the translational motion search of each first sub-unit to be encoded should be the same as the result of the translational motion search of the unit to be encoded. The image blocks covered by the unit to be coded refer to image areas of the unit to be coded in the target video frame.
Specifically, when the coding parameters of the first sub-unit to be coded include the motion information of the first sub-unit to be coded, the coding parameters of the unit to be coded include the motion information of the unit to be coded and a coding block flag; the determining a parameter relationship between the coding parameter of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded includes: if the value of the coding block mark is smaller than the threshold value, which indicates that the residual coefficient of the unit to be coded tends to 0, verifying the consistency between the motion information of the N first sub-units to be coded and the motion information of the unit to be coded respectively; if the motion information of the N first to-be-encoded subunits is consistent with the motion information of the to-be-encoded subunit, it indicates that the motion information of the to-be-encoded subunit can reflect the motion information of the to-be-encoded subunit covered by the to-be-encoded subunit, and it is determined that the to-be-encoded unit is more suitable for being encoded by using a large-size encoding unit, a parameter relationship indicating that the to-be-encoded unit does not satisfy a continuous division condition is generated. When the value of the coding block mark of the unit to be coded is smaller than the threshold value and the motion information of the unit to be coded is consistent with the motion information of each first subunit to be coded, the unit to be coded is suspended from being continuously divided, so that the division decision process of the unit to be coded is accelerated under the condition of ensuring the coding accuracy of the unit to be coded, and the expenses of coding time and computing resources are reduced.
For example, assuming that the target recursive partitioning strategy is four partitions, the number of the first sub-units to be encoded is four, when the prediction mode of the unit to be encoded is the shift inter mode, and the value of the encoding block flag of the Y component of the unit to be encoded is 0. When the prediction modes of the four first subunits to be coded are all the translation inter-frame prediction modes, the coding parameters of the unit to be coded and the coding parameters of the four subunits to be coded are determined to have consistency, the unit to be coded does not try other recursive division modes any more, and the four first subunits to be coded do not continue to be divided any more. The reason for limiting the value of the coding block flag on the Y component of the unit to be coded to 0 is to reduce the loss of coding efficiency due to misjudgment. I.e., the value of the coded block flag on the Y component of the unit to be coded is 0, the probability that the prediction effect of the unit to be coded is sufficiently good is further increased.
It can be understood that the motion information of the unit to be encoded and the motion information of the first sub-unit to be encoded comprise at least one of a prediction mode, a reference frame mode and a reference frame index; the consistency between the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded may be: at least one parameter in the motion information of the unit to be coded is the same as the corresponding parameter in the motion information of the N first subunits to be coded. For example, if the prediction modes of the N first sub-units to be encoded and the prediction mode of the unit to be encoded are both the translational inter-prediction modes, it is determined that the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded have consistency. Or, if the reference frame patterns of the N first sub-units to be encoded are all the same as the reference frame pattern of the unit to be encoded, it is determined that the motion information of the N first sub-units to be encoded has consistency with the motion information of the unit to be encoded. Or, if the reference frame indexes of the N first sub-units to be encoded are all the same as the reference frame index of the unit to be encoded, it is determined that the motion information of the N first sub-units to be encoded has consistency with the motion information of the unit to be encoded.
For another example, if the prediction modes of the N first sub-units to be encoded and the prediction mode of the unit to be encoded are both the translational inter-frame prediction modes, and the reference frame modes of the N first sub-units to be encoded are all the same as the reference frame mode of the unit to be encoded, it is determined that the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded all have consistency. Or if the prediction modes of the N first sub-units to be coded and the prediction mode of the unit to be coded are both the translational inter-frame prediction modes, and the reference frame indexes of the N first sub-units to be coded are all the same as the reference frame index of the unit to be coded, determining that the motion information of the N first sub-units to be coded and the motion information of the unit to be coded have consistency. And if the reference frame modes of the N first subunits to be coded are all the same as the reference frame mode of the unit to be coded, and the reference frame indexes of the N first subunits to be coded are all the same as the reference frame index of the unit to be coded, determining that the motion information of the N first subunits to be coded has consistency with the motion information of the unit to be coded. When the coding parameters of the unit to be coded and the coding parameters of the sub-units to be coded are consistent, the condition that the unit to be coded is suspended to be divided is used, so that the dividing decision process of the unit to be coded is facilitated to be accelerated, and the coding time and the expenditure of computing resources are reduced. Meanwhile, the coding parameters of the first sub-unit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and no high-complexity analysis operation needs to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved.
For another example, if the prediction modes of the N first sub-units to be encoded and the prediction mode of the unit to be encoded are both the translational inter-frame prediction modes, the reference frame modes of the N first sub-units to be encoded are all the same as the reference frame mode of the unit to be encoded, and the reference frame indexes of the N first sub-units to be encoded are all the same as the reference frame index of the unit to be encoded, it is determined that the motion information of the N first sub-units to be encoded has consistency with the motion information of the unit to be encoded. Whether the motion information of the N sub-units to be coded is consistent with the motion information of the unit to be coded is judged from multiple dimensions, and therefore the accuracy of judging the pause division of the unit to be coded is improved.
It can be understood that, if the reference frame patterns of the N first sub-units to be encoded are all the same as the reference frame pattern of the unit to be encoded, determining that the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded have consistency includes: if the reference frame modes of the N first sub-units to be encoded and the reference frame mode of the unit to be encoded are both forward prediction modes, determining that the motion information of the N first sub-units to be encoded has consistency with the motion information of the unit to be encoded; or if the reference frame modes of the N first sub-units to be encoded and the reference frame mode of the unit to be encoded are both backward prediction modes, determining that the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded have consistency; or, if the reference frame modes of the N first sub-units to be encoded and the reference frame mode of the unit to be encoded are both bi-directional prediction modes, it is determined that the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded have consistency.
And S104, if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, suspending the division of the unit to be coded again, and determining a target division result of the unit to be coded according to the first subunit to be coded and the unit to be coded.
In the application, if the parameter relationship reflects that the coding parameters corresponding to the N first subunits to be coded respectively are consistent with the coding parameters of the unit to be coded, it indicates that the pixel information and the texture information between the first subunits to be coded have similarity, that is, the change of the pixel information and the texture information in the unit to be coded is small, that is, the unit to be coded is more suitable for coding based on a large-size coding unit. Therefore, if the parameter relationship reflects that the coding parameters respectively corresponding to the N first subunits to be coded and the coding parameters of the unit to be coded have consistency, it is determined that the unit to be coded does not satisfy the continuous division condition, and the target division result of the unit to be coded is determined according to the first subunits to be coded and the unit to be coded. If the parameter relationship reflects that the coding parameters respectively corresponding to the N first subunits to be coded do not have consistency with the coding parameters of the units to be coded, it indicates that the texture information and the pixel information of each subunit to be coded do not have similarity, that is, the change of the pixel information and the texture information in the units to be coded is relatively large, that is, the units to be coded are more suitable for coding based on small-sized coding units. Therefore, if the parameter relationship reflects that the coding parameters corresponding to the N first subunits to be coded respectively do not have consistency with the coding parameters of the unit to be coded, a residual recursive partitioning policy may be tried for the unit to be coded, where the residual recursive partitioning policy may refer to a candidate recursive partitioning policy other than the target recursive partitioning policy among the K candidate recursive partitioning policies.
In the application, in the process of encoding a unit to be encoded in a target video frame, a target recursive partitioning strategy is tried first, that is, the unit to be encoded is partitioned according to the target recursive partitioning strategy to obtain N first subunits to be encoded of the unit to be encoded, and a parameter relationship between encoding parameters of the N first subunits to be encoded and encoding parameters of the unit to be encoded is determined. The target recursive partitioning policy here may refer to any one of K candidate recursive partitioning policies of the unit to be encoded, or the target recursive partitioning policy may refer to a candidate recursive partitioning policy with the highest partitioning fineness among the K candidate recursive partitioning policies. The parameter relationship is used for reflecting whether the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, when the parameter relationship reflects that the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, the fact that texture information and the like of each subunit to be coded have similarity is indicated, the unit to be coded is more suitable for being coded by adopting a coding unit with a larger size, and at the moment, the fact that the unit to be coded does not meet the continuous dividing condition is determined, therefore, the parameter relationship can indicate whether the unit to be coded meets the continuous dividing condition. When the parameter relation indicates that the unit to be coded does not meet the continuous division condition, the unit to be coded is paused to be divided again, namely, the first subunit to be coded is not required to be divided, and the unit to be coded is not required to try other recursive division strategies, the trial of other recursive division strategies can be stopped in advance, the final division result (namely, the target division result) of the unit to be coded can be determined directly according to the division result (namely, the first subunit to be coded) of the target recursive division strategy and the unit to be coded, the division decision process of the coder can be accelerated, and therefore the coding time and the expenditure of computing resources are reduced. Meanwhile, the coding parameters of the first sub-unit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and high-complexity analysis operation is not required to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved.
Further, please refer to fig. 6, which is a flowchart illustrating a video data processing method according to an embodiment of the present application, where the method may be executed by the terminal in fig. 1, or by the server in fig. 1, or by both the terminal and the server in fig. 1, and devices for executing the method in the present application may be collectively referred to as computer devices. As shown in fig. 6, the method may include the steps of:
s201, obtaining a target recursive division strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded.
S202, dividing the unit to be coded according to the target recursive division strategy to obtain N first subunits to be coded; n is a positive integer greater than 1.
S203, acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively.
It is to be understood that, in the embodiment of the present application, for the explanation of step S201, the explanation of step S10 in fig. 5 above may be referred to, and repeated parts are not repeated.
S204, if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, pausing the re-division of the unit to be coded, and determining a first rate-distortion cost of the unit to be coded when a non-division strategy is adopted for division according to the unit to be coded.
S205, according to the N first sub-units to be coded, determining a second rate-distortion cost of the unit to be coded when the target recursive partitioning strategy is adopted for partitioning.
S206, if the first rate distortion cost is smaller than the second rate distortion cost, determining a target division result of the unit to be coded by the unit to be coded.
S207, if the first rate-distortion cost is greater than or equal to the second rate-distortion cost, determining N first to-be-encoded sub-units as the target partition result of the to-be-encoded unit.
In steps S204 to S207, if the parameter relationship indicates that the unit to be encoded does not satisfy the continue dividing condition, the unit to be encoded is suspended from being divided again, that is, other recursive division strategies are suspended from being tried for the unit to be encoded, and the first sub-unit to be encoded is suspended from being divided. At this time, the computer device may determine the optimal division strategy of the unit to be encoded from the non-division strategy and the target recursive division strategy, and determine the division result corresponding to the optimal division strategy as the target division result of the unit to be encoded. Specifically, the computer device may determine, according to the unit to be encoded, a first rate distortion cost of the unit to be encoded when the unit to be encoded is divided by using a non-division policy as a division result of the unit to be encoded under the non-division policy, where the first rate distortion cost may be a first resource cost required for transmitting encoded data corresponding to the unit to be encoded to a decoding end when the non-division policy is used as a division policy of the unit to be encoded. The larger the first rate-distortion cost is, the larger the first resource overhead is; conversely, a smaller first rate-distortion cost indicates a smaller first resource overhead.
Further, the N first subunits to be encoded are determined as a division result of the unit to be encoded under the target recursive division policy, and the computer device may determine, according to the N first subunits to be encoded, a second rate-distortion cost of the unit to be encoded when the unit to be encoded is divided by using the target recursive division policy, where the first rate-distortion cost may be a second resource cost required for transmitting encoded data corresponding to the unit to be encoded to the decoding end when the target recursive division policy is used as the division policy of the unit to be encoded. The larger the second rate-distortion cost is, the larger the second resource overhead is; conversely, the smaller this second rate-distortion cost, the smaller the second resource overhead. Therefore, if the first rate-distortion cost is less than the second rate-distortion cost, it indicates that the first resource cost is less than the second resource cost, that is, the unit to be encoded is more suitable for being partitioned by using a non-partitioning policy, and the computer device may determine the non-partitioning policy as an optimal partitioning policy for the unit to be encoded, and determine a target partitioning result of the unit to be encoded for the unit to be encoded. If the first rate-distortion cost is greater than or equal to the second rate-distortion cost, it indicates that the first resource cost is greater than or equal to the second resource cost, that is, the unit to be encoded is more suitable for being divided by using a target recursive division strategy, the computer device may determine the target recursive division strategy as the optimal division strategy of the unit to be encoded, and determine the N first subunits to be encoded as the target division result of the unit to be encoded. When the unit to be coded does not meet the continuous division condition, the division accuracy of the unit to be coded is improved by respectively corresponding to the rate distortion cost based on the non-division strategy and the target recursive division strategy, so that the coding accuracy of the unit to be coded is improved.
It can be understood that, if the value of the coding block flag of the unit to be coded is greater than or equal to the threshold, or the motion information of the first subunit to be coded does not have consistency with the motion information of the unit to be coded in the N first subunits to be coded, it indicates that the unit to be coded is suitable for being divided by adopting other recursive division modes, or it indicates that the unit to be coded is suitable for being coded by a coding unit with a smaller size. Therefore, the computer device may divide the unit to be encoded according to the remaining recursive division policy to obtain M second subunits to be encoded of the unit to be encoded; the remaining recursive partitioning scheme strategy is a candidate recursive partitioning strategy except the target recursive partitioning strategy among the K candidate recursive partitioning strategies of the unit to be coded, and M and K are positive integers greater than 1. Further, a target division result of the unit to be encoded is determined according to N first subunits to be encoded (i.e., the division result of the target recursive division strategy), M second subunits to be encoded (i.e., the division result of the remaining recursive division strategies), and the unit to be encoded (i.e., the division result of the non-division strategy).
It can be understood that, the determining the target division result of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded includes: the computer device may determine an optimal partition strategy of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded, where the optimal partition strategy is a partition strategy with the lowest rate-distortion cost. If the optimal division strategy of the unit to be coded is a non-division strategy, suspending the division of the first subunit to be coded, and determining the unit to be coded as a target division result of the unit to be coded; if the optimal dividing strategy of the unit to be coded is the target recursive dividing strategy, determining that the unit to be coded meets a continuous dividing condition, dividing N first subunits to be coded according to the target recursive dividing strategy to obtain L third subunits to be coded of the unit to be coded, and determining a target dividing result of the unit to be coded according to L third subunits to be coded; l is a positive integer greater than 1. In other words, if the optimal partitioning policy of the unit to be encoded is the target recursive partitioning policy, the N first sub-units to be encoded are respectively used as the units to be encoded, the units to be encoded are continuously partitioned according to the target recursive partitioning policy, and steps S203 to S207 in this application are repeatedly performed, so as to obtain the target partitioning result of the unit to be encoded. If the optimal dividing strategy of the unit to be coded is the residual recursive dividing strategy, determining that the unit to be coded meets the continuous dividing condition, dividing the M second subunits to be coded according to the target recursive dividing strategy to obtain S fourth subunits to be coded of the unit to be coded, and determining the target dividing result of the unit to be coded according to the S fourth subunits to be coded. In other words, if the optimal partitioning policy of the unit to be encoded is the remaining recursive partitioning policy, the M second sub-units to be encoded are respectively used as the units to be encoded, the units to be encoded are continuously partitioned according to the target recursive partitioning policy, and steps S203 to S207 in this application are repeatedly performed, so as to obtain the target partitioning result of the unit to be encoded. When the value of the coding block mark of the unit to be coded is greater than or equal to the threshold value, or the motion information of the first subunit to be coded does not have consistency with the motion information of the unit to be coded in the N first subunits to be coded, and the optimal partitioning strategy of the unit to be coded is a target recursive partitioning strategy or a residual recursive partitioning strategy, the unit to be coded is partitioned with finer granularity continuously, so that the coding accuracy of the unit to be coded is improved.
For example, as shown in fig. 7, the target recursive partitioning policy is described as an example of four partitions, and the target video frame 70 includes four units to be encoded, namely, a unit to be encoded 71a, a unit to be encoded 72a, a unit to be encoded 73a, and a unit to be encoded 74a. The computer device may respectively obtain coding parameters corresponding to the unit to be coded 71a, the unit to be coded 72a, the unit to be coded 73a, and the unit to be coded 74a, divide the unit to be coded 71a according to four divisions to obtain four sub units to be coded of the unit to be coded 71a, respectively obtain coding parameters of the four sub units to be coded of the unit to be coded 71a, and determine a parameter relationship between the coding parameters of the unit to be coded 71a and the coding parameters of the four sub units to be coded of the unit to be coded 71 a. If the parameter relationship indicates that the coding parameters of the unit to be coded 71a and the coding parameters of the four subunits to be coded of the unit to be coded 71a have consistency, which indicates that the change of the pixel information and the texture information in the unit to be coded 71a is relatively small and the complexity is relatively low, and the unit to be coded 71 is more suitable for coding by using a large-size coding unit, it is determined that the unit to be coded 71a does not meet the continuous division condition, the division of the unit to be coded 71a is suspended, the optimal division strategy of the unit to be coded 71a is selected from the four division strategies and the non-division strategy, and if the optimal division strategy of the unit to be coded 71a is the non-division strategy, the unit to be coded 71a is used as the final division result of the unit to be coded 71 a. Further, according to the fourth division, the unit to be encoded 72a is divided to obtain four subunits to be encoded of the unit to be encoded 72a, where the four subunits to be encoded are a subunit to be encoded 721b, a subunit to be encoded 722b, a subunit to be encoded 723b, and a subunit to be encoded 724b, respectively. The encoding parameters of the four to-be-encoded subunits of the to-be-encoded unit 72a are respectively obtained, and the encoding parameters of the four to-be-encoded subunits of the to-be-encoded unit 72a are compared with the encoding parameters of the to-be-encoded unit 72a, so as to determine the parameter relationship between the encoding parameters of the to-be-encoded unit 72a and the encoding parameters of the four to-be-encoded subunits of the to-be-encoded unit 72 a. If the parameter relationship indicates that the coding parameter of the unit to be coded 72a and the coding parameters of the four subunits to be coded of the unit to be coded 72a have consistency, which indicates that the change of the pixel information and the texture information in the unit to be coded 72a is relatively small and the complexity is relatively low, and the unit to be coded 72 is more suitable for coding by using a coding unit with a large size, it is determined that the unit to be coded 72a does not satisfy the continuous division condition, the division of the unit to be coded 72a is suspended, the optimal division strategy of the unit to be coded 72a is selected from the four-division strategy and the non-division strategy, and if the optimal division strategy of the unit to be coded 72a is the four-division strategy, the subunit to be coded 721b, the subunit to be coded 722b, the subunit to be coded 723b, and the subunit to be coded 724b are taken as the final division result of the unit to be coded 72 a. Sequentially traversing the unit to be encoded 73a and the unit to be encoded 74a according to the method, if the unit to be encoded 73a and the unit to be encoded 74a do not meet the continuous division condition, and the optimal division strategies of the unit to be encoded 73a and the optimal division strategy of the unit to be encoded 74a are both non-division strategies, determining the unit to be encoded 73a as the final division result of the unit to be encoded 73a, and determining the unit to be encoded 74a as the final division result of the unit to be encoded 74a. Then, the final division shape of the target video frame 70 can be as shown in fig. 7.
For another example, as shown in fig. 8, the target recursive partitioning policy is described as an example of horizontal two-partitioning, and the target video frame 80 includes two units to be encoded, namely, a unit to be encoded 81a and a unit to be encoded 82a. The computer device may respectively obtain encoding parameters corresponding to the unit to be encoded 81a and the unit to be encoded 82a, divide the unit to be encoded 81a according to horizontal binary division to obtain two subunits to be encoded of the unit to be encoded 81a, respectively obtain encoding parameters of the two subunits to be encoded of the unit to be encoded 81a, and compare the encoding parameters of the unit to be encoded 81a with the encoding parameters of the two subunits to be encoded of the unit to be encoded 81a to determine a parameter relationship between the encoding parameters of the unit to be encoded 81a and the encoding parameters of the two subunits to be encoded of the unit to be encoded 81 a. If the parameter relationship indicates that the encoding parameter of the unit to be encoded 81a and the encoding parameters of the two sub-units to be encoded of the unit to be encoded 81a have consistency, which indicates that the change of the pixel information and the texture information in the unit to be encoded 81a is relatively small and the complexity is relatively low, and the unit to be encoded 81 is more suitable for encoding by using a large-sized encoding unit, it is determined that the unit to be encoded 81a does not satisfy the continuous division condition, the division of the unit to be encoded 81a is suspended, the optimal division strategy of the unit to be encoded 81a is selected from the horizontal two-division and non-division strategies, and if the optimal division strategy of the unit to be encoded 81a is the non-division strategy, the unit to be encoded 81a is used as the final division result of the unit to be encoded 81 a. Further, according to the horizontal second division, the unit to be encoded 82a is divided to obtain two subunits to be encoded of the unit to be encoded 82a, the encoding parameters of the two subunits to be encoded of the unit to be encoded 82a are respectively obtained, and the encoding parameters of the two subunits to be encoded of the unit to be encoded 82a are compared with the encoding parameters of the unit to be encoded 82a to determine the parameter relationship between the encoding parameters of the unit to be encoded 82a and the encoding parameters of the two subunits to be encoded of the unit to be encoded 82a. If the parameter relationship indicates that the coding parameters of the unit to be coded 82a and the coding parameters of the two subunits to be coded of the unit to be coded 82a do not have consistency, respectively trying four divisions, vertical two divisions, vertical three divisions, horizontal three divisions, and the like for the unit to be coded 82a to obtain division results of the unit to be coded 82a under the four divisions, the vertical two divisions, the vertical three divisions, and the horizontal three divisions, and determining the optimal division result of the unit to be coded 82a from the four divisions, the vertical two divisions, the vertical three divisions, the horizontal three divisions, the non-division strategies, and the horizontal two divisions according to the division results, the division results of the unit to be coded 82a, and the division results of the horizontal two divisions. If the optimal division result of the unit to be encoded 82a is four divisions, and the four sub-units to be encoded obtained by the four divisions are respectively the sub-unit to be encoded 822b, the sub-unit to be encoded 823b, the sub-unit to be encoded 824b, and the sub-unit to be encoded 825b. The above steps are circulated, that is, the horizontal two-division is respectively tried for the subunit to be coded 822b, the subunit to be coded 823b, the subunit to be coded 824b, and the subunit to be coded 825b, if none of the subunit to be coded 822b, the subunit to be coded 823b, the subunit to be coded 824b, and the subunit to be coded 825b satisfies the continuous division condition, and all of the optimal division strategies of the subunit to be coded 822b, the subunit to be coded 823b, the subunit to be coded 824b, and the subunit to be coded 825b are non-division strategies, the final division form of the target video frame 80 may be as shown in fig. 8.
It can be understood that, the determining the optimal partition strategy of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded includes: the computer equipment can determine a first rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded, and determine a second rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the target recursive division strategy according to the N first subunits to be coded; and determining a third rate-distortion cost of the unit to be encoded when the remaining recursive partitioning strategy is adopted for partitioning according to the M second subunits to be encoded, where the third rate-distortion cost refers to a third resource cost required for transmitting the encoded data corresponding to the unit to be encoded to the decoding end when the remaining recursive partitioning strategy is used as the partitioning strategy of the unit to be encoded. The larger the third rate-distortion cost is, the larger the third resource overhead is; conversely, the smaller this third rate-distortion cost, the smaller the third resource overhead. And if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the first rate distortion cost, which indicates that the first resource cost among the first resource cost, the second resource cost and the third resource cost is the lowest, determining the optimal partition strategy of the unit to be coded according to the non-partition strategy. And if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the second rate distortion cost, which indicates that the second resource cost among the first resource cost, the second resource cost and the third resource cost is the lowest, determining the optimal partition strategy of the unit to be coded by using the target recursive partition strategy. And if the lowest rate distortion cost in the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the third rate distortion cost, which indicates that the third resource cost in the first resource cost, the second resource cost and the third resource cost is the lowest, determining the optimal partitioning strategy of the unit to be coded by using the residual recursive partitioning strategy.
In the application, in the process of encoding a unit to be encoded in a target video frame, a target recursive partitioning strategy is tried first, that is, the unit to be encoded is partitioned according to the target recursive partitioning strategy to obtain N first subunits to be encoded of the unit to be encoded, and a parameter relationship between encoding parameters of the N first subunits to be encoded and encoding parameters of the unit to be encoded is determined. The target recursive partitioning policy may refer to any one of K candidate recursive partitioning policies of the unit to be encoded, or the target recursive partitioning policy may refer to a candidate recursive partitioning policy with the highest partitioning fineness among the K candidate recursive partitioning policies. And when the parameter relation reflects that the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, which indicates that texture information and the like of each subunit to be coded have similarity, the unit to be coded is more suitable for coding by adopting a coding unit with a larger size, and the unit to be coded does not meet the continuous division condition at the moment, thus the parameter relation can indicate whether the unit to be coded meets the continuous division condition.
Furthermore, when the parameter relationship indicates that the unit to be coded does not meet the continuous division condition, the unit to be coded is suspended from being divided again, that is, the first subunit to be coded does not need to be divided, and the unit to be coded does not need to try other recursive division strategies, so that the trial of other recursive division strategies can be stopped in advance, the division decision process of the coder can be accelerated, and the overhead of coding time and calculation resources can be reduced. Meanwhile, the coding parameters of the first sub-unit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and high-complexity analysis operation is not required to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved. In addition, if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, the unit to be coded is suspended from being divided again, the optimal division strategy of the unit to be coded is determined based on the rate distortion cost respectively corresponding to the non-division strategy and the target recursive division strategy, and the final division result of the unit to be coded is determined based on the optimal division strategy, so that the division accuracy of the unit to be coded is improved, and the coding accuracy of the unit to be coded is further improved.
Fig. 9 is a schematic structural diagram of a video data processing apparatus according to an embodiment of the present disclosure. The video data processing apparatus may be a computer program (including program code) running on a computer device, for example, the video data processing apparatus is an application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present application. As shown in fig. 9, the video data processing apparatus may include: an acquisition module 911, a division module 912, a determination module 913, a pause module 914,
An obtaining unit 911, configured to obtain a target recursive partitioning policy for a unit to be encoded in a target video frame, and an encoding parameter of the unit to be encoded;
a dividing unit 912, configured to divide the unit to be encoded according to the target recursive division policy to obtain N first sub-units to be encoded; n is a positive integer greater than 1;
a determining unit 913, configured to obtain coding parameters corresponding to the N first sub-units to be coded, and determine a parameter relationship between the coding parameter of the unit to be coded and the coding parameters corresponding to the N first sub-units to be coded;
a suspending module 914, configured to suspend, if the parameter relationship indicates that the unit to be encoded does not satisfy the condition for continuing to divide, dividing the unit to be encoded again, and determining a target division result of the unit to be encoded according to the N first subunits to be encoded and the unit to be encoded.
Understandably, the encoding parameters of the first subunit to be encoded include the motion information of the first subunit to be encoded, and the encoding parameters of the unit to be encoded include the motion information of the unit to be encoded and an encoded block flag; the determination module 913 includes a verification unit 91a and a first determination unit 92a;
a verifying unit 91a, configured to verify consistency between the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded respectively if the value of the coded block flag is smaller than a threshold;
a second determining unit 92a, configured to generate a parameter relationship indicating that the unit to be encoded does not satisfy the continuous partition condition if the motion information of the N first sub units to be encoded and the motion information of the unit to be encoded all have consistency.
It can be understood that the motion information of the unit to be encoded and the motion information of the first sub-unit to be encoded comprise at least one of a prediction mode, a reference frame mode, and a reference frame index;
if the value of the coding block flag is smaller than the threshold, the verifying unit 91a verifies that the motion information of the N first sub-units to be coded and the motion information of the unit to be coded respectively are consistent with each other includes:
if the prediction modes of the N first subunits to be coded and the prediction mode of the unit to be coded are both the translational inter-frame prediction mode, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency, and generating a parameter relation for indicating that the unit to be coded does not meet the continuous division condition; or,
if the reference frame modes of the N first subunits to be coded are the same as the reference frame mode of the unit to be coded, determining that the motion information of the N first subunits to be coded is consistent with the motion information of the unit to be coded, and generating a parameter relation for indicating that the unit to be coded does not meet the continuous division condition; or,
and if the reference frame indexes of the N first subunits to be coded are the same as the reference frame index of the unit to be coded, determining that the motion information of the N first subunits to be coded has consistency with the motion information of the unit to be coded, and generating a parameter relation for indicating that the unit to be coded does not meet the continuous division condition.
It can be understood that, if the reference frame patterns of the N first subunits to be encoded are all the same as the reference frame pattern of the unit to be encoded, the determining unit 91a determines that the motion information of the N first subunits to be encoded and the motion information of the unit to be encoded have consistency, including:
if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are both forward prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are backward prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
and if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are both bidirectional prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency.
It can be understood that, the dividing module 912 is further configured to divide the unit to be encoded according to a remaining recursive dividing strategy to obtain M second subunits to be encoded of the unit to be encoded if the value of the coded block flag is greater than or equal to the threshold, or the motion information of the first subunit to be encoded does not have consistency with the motion information of the unit to be encoded in the N first subunits to be encoded; the residual recursive partitioning strategy is a candidate recursive partitioning strategy except the target recursive partitioning strategy in K candidate recursive partitioning strategies of the unit to be coded, and M and K are positive integers greater than 1;
it can be understood that, the determining module 913 is further configured to determine a target division result of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded.
It can be understood that, the determining module 913 determines the target division result of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded, including:
determining an optimal partition strategy of the unit to be coded according to the N first subunits to be coded, the M second subunits to be coded and the unit to be coded;
if the optimal partitioning strategy of the unit to be coded is a non-partitioning strategy, determining the unit to be coded as a target partitioning result of the unit to be coded;
if the optimal dividing strategy of the unit to be coded is the target recursive dividing strategy, determining that the unit to be coded meets a continuous dividing condition, dividing the N first subunits to be coded according to the target recursive dividing strategy to obtain L third subunits to be coded of the unit to be coded, and determining a target dividing result of the unit to be coded according to the L third subunits to be coded; l is a positive integer greater than 1;
if the optimal division strategy of the unit to be coded is the residual recursive division strategy, determining that the unit to be coded meets a continuous division condition, dividing the M second subunits to be coded according to the target recursive division strategy to obtain S fourth subunits to be coded of the unit to be coded, and determining a target division result of the unit to be coded according to the S fourth subunits to be coded.
It can be understood that, the determining module 913 determines the optimal partitioning strategy of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded, including:
determining a first rate distortion cost of the unit to be coded when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded;
determining a second rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the target recursive division strategy according to the N first subunits to be coded;
determining a third rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the residual recursive division strategy according to the M second subunits to be coded;
if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the first rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the non-partition strategy;
if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the second rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the target recursive partition strategy;
and if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the third rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the residual recursive partition strategy.
It can be understood that, the suspending module 914 determines the target partition result of the unit to be encoded according to the N first subunits to be encoded and the unit to be encoded, including:
determining a first rate distortion cost of the unit to be coded when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded;
determining a second rate-distortion cost of the unit to be coded when the target recursive partitioning strategy is adopted for partitioning according to the N first subunits to be coded;
if the first rate distortion cost is smaller than the second rate distortion cost, determining a target division result of the unit to be coded by the unit to be coded;
and if the first rate-distortion cost is greater than or equal to the second rate-distortion cost, determining the N first subunits to be coded as target division results of the unit to be coded.
It is understood that the acquiring module 911 includes an acquiring unit 93b, a second determining unit 94b, and a screening unit 95b;
an obtaining unit 93b, configured to obtain K candidate recursive partitioning policies for the unit to be encoded in the target video frame;
a second determining unit 94b, configured to determine partitioning fineness corresponding to each of the K candidate recursive partitioning policies; k is a positive integer greater than 1;
a screening unit 95b, configured to screen out, from the K candidate recursive partitioning policies, a candidate recursive partitioning policy whose partitioning fineness is the maximum partitioning fineness;
a second determining unit 94b, configured to determine the screened candidate recursive partitioning policy as a target recursive partitioning policy for the unit to be encoded in the target video frame.
It is to be understood that the second determining unit 94b determines the partition fineness corresponding to each of the K candidate recursive partition strategies, including:
obtaining the unit quantity corresponding to the sub-unit to be coded when the unit to be coded is divided according to the K candidate recursive division strategies;
determining partition fineness corresponding to the K candidate recursive partition strategies according to the unit quantity corresponding to the K candidate recursive partition strategies respectively; the number of units corresponding to the candidate recursive partitioning strategy Pi in the K candidate recursive partitioning strategies has a positive correlation with the partitioning fineness corresponding to the candidate recursive partitioning strategy Pi; i is a positive integer less than or equal to K.
According to an embodiment of the present application, the steps involved in the video data processing method shown in the foregoing may be performed by respective modules in the video data processing apparatus shown in fig. 9. For example, step S101 shown in fig. 5 may be performed by the obtaining module 911 in fig. 9, and step S102 shown in fig. 5 may be performed by the dividing module 912 in fig. 9; step S103 shown in fig. 5 may be performed by the determination module 913 in fig. 9; step S104 shown in fig. 5 may be performed by the pause module 914 in fig. 9.
According to an embodiment of the present application, each module in the video data processing apparatus shown in fig. 9 may be respectively or entirely combined into one or several units to form the unit, or some unit(s) may be further split into at least two sub-units with smaller functions, which may implement the same operation without affecting implementation of technical effects of the embodiment of the present application. The modules are divided based on logic functions, and in practical applications, the functions of one module may also be implemented by at least two units, or the functions of at least two modules may also be implemented by one unit. In other embodiments of the present application, the data processing apparatus may also include other units, and in practical applications, the functions may also be implemented by assistance of other units, and may be implemented by cooperation of at least two units.
According to an embodiment of the present application, the video data processing apparatus as shown in fig. 9 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods as shown in the foregoing on a general-purpose computer device such as a computer including a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like as processing elements and storage elements, and the video data processing method of the embodiment of the present application may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded into and executed by the computing apparatus via the computer-readable recording medium.
In the application, in the process of encoding a unit to be encoded in a target video frame, a target recursive partitioning strategy is tried at first, that is, the unit to be encoded is partitioned according to the target recursive partitioning strategy to obtain N first subunits to be encoded of the unit to be encoded, and a parameter relationship between encoding parameters of the N first subunits to be encoded and encoding parameters of the unit to be encoded is determined. The target recursive partitioning policy may refer to any one of K candidate recursive partitioning policies of the unit to be encoded, or the target recursive partitioning policy may refer to a candidate recursive partitioning policy with the highest partitioning fineness among the K candidate recursive partitioning policies. The parameter relationship is used for reflecting whether the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, when the parameter relationship reflects that the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, the fact that texture information and the like of each subunit to be coded have similarity is indicated, the unit to be coded is more suitable for being coded by adopting a coding unit with a larger size, and at the moment, the fact that the unit to be coded does not meet the continuous dividing condition is determined, therefore, the parameter relationship can indicate whether the unit to be coded meets the continuous dividing condition. When the parameter relation indicates that the unit to be coded does not meet the continuous division condition, the unit to be coded is paused to be divided again, namely, the first subunit to be coded is not required to be divided, and the unit to be coded is not required to try other recursive division strategies, the trial of other recursive division strategies can be stopped in advance, the final division result (namely, the target division result) of the unit to be coded can be determined directly according to the division result (namely, the first subunit to be coded) of the target recursive division strategy and the unit to be coded, the division decision process of the coder can be accelerated, and therefore the coding time and the expenditure of computing resources are reduced. Meanwhile, the coding parameters of the first sub-unit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and no high-complexity analysis operation needs to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 10, the computer apparatus 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, further, the computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include standard wired, wireless interfaces (e.g., W) I -F I An interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory) i E.g., at least one disk memory). The memory 1005 may alternatively be at least one memory device located remotely from the processor 1001. As shown in fig. 10, the memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a media content interface module, and a device control application program.
In the computer device 1000 shown in fig. 10, the network interface 1004 may provide a network communication function; and the user interface 1003 is primarily used as an interface for providing input for media content.
It will be appreciated that the processor 1001 may be configured to invoke a device definition application stored in the memory 1005 to implement:
acquiring a target recursive partitioning strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded;
dividing the unit to be coded according to the target recursive division strategy to obtain N first subunits to be coded; n is a positive integer greater than 1;
acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively;
and if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, pausing the re-division of the unit to be coded, and determining a target division result of the unit to be coded according to the N first sub-units to be coded and the unit to be coded.
Understandably, the coding parameters of the first subunit to be coded include the motion information of the first subunit to be coded, and the coding parameters of the unit to be coded include the motion information of the unit to be coded and a coded block flag;
it is understood that the processor 1001 may be configured to call the device-defining application program stored in the memory 1005 to implement the determining of the parameter relationship between the encoding parameter of the unit to be encoded and the encoding parameters corresponding to the N first subunits to be encoded, including:
if the value of the coding block flag is smaller than a threshold value, verifying the consistency between the motion information of the N first subunits to be coded and the motion information of the units to be coded respectively;
and if the motion information of the N first sub-units to be coded is consistent with the motion information of the unit to be coded, generating a parameter relation for indicating that the unit to be coded does not meet the continuous division condition.
It can be understood that the motion information of the unit to be encoded and the motion information of the first sub-unit to be encoded comprise at least one of a prediction mode, a reference frame mode, and a reference frame index;
it is understood that the processor 1001 may be configured to call the device defining application program stored in the memory 1005 to implement the verification of the consistency between the motion information of the N first to-be-encoded sub-units and the motion information of the to-be-encoded unit, respectively, including:
if the prediction modes of the N first subunits to be coded and the prediction mode of the unit to be coded are both the translational inter-frame prediction mode, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
if the reference frame modes of the N first subunits to be coded are the same as the reference frame mode of the unit to be coded, determining that the motion information of the N first subunits to be coded has consistency with the motion information of the unit to be coded; or,
and if the reference frame indexes of the N first subunits to be coded are the same as the reference frame index of the unit to be coded, determining that the motion information of the N first subunits to be coded has consistency with the motion information of the unit to be coded.
It is understood that the processor 1001 may be configured to call the device defining application program stored in the memory 1005 to determine that there is consistency between the motion information of all N first sub-units to be encoded and the motion information of the unit to be encoded if the reference frame patterns of all N first sub-units to be encoded are the same as the reference frame pattern of the unit to be encoded, including:
if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are both forward prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are backward prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
and if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are both bidirectional prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency.
It will be appreciated that the processor 1001 may be configured to invoke the device definition application stored in the memory 1005 to implement:
if the value of the coding block flag is greater than or equal to a threshold value, or the motion information of the first subunit to be coded does not have consistency with the motion information of the unit to be coded in the N first subunits to be coded, dividing the unit to be coded according to a residual recursive division strategy to obtain M second subunits to be coded of the unit to be coded; the residual recursive partitioning strategy is a candidate recursive partitioning strategy except the target recursive partitioning strategy in K candidate recursive partitioning strategies of the unit to be coded, and M and K are positive integers greater than 1;
and determining a target division result of the unit to be coded according to the N first subunits to be coded, the M second subunits to be coded and the unit to be coded.
It is understood that the processor 1001 may be configured to call the device-defined application program stored in the memory 1005 to determine the target division result of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded, including:
determining an optimal partitioning strategy of the unit to be coded according to the N first subunits to be coded, the M second subunits to be coded and the unit to be coded;
if the optimal partition strategy of the unit to be coded is a non-partition strategy, determining the unit to be coded as a target partition result of the unit to be coded;
if the optimal partitioning strategy of the unit to be coded is the target recursive partitioning strategy, determining that the unit to be coded meets a continuous partitioning condition, partitioning the N first subunits to be coded according to the target recursive partitioning strategy to obtain L third subunits to be coded of the unit to be coded, and determining a target partitioning result of the unit to be coded according to the L third subunits to be coded; l is a positive integer greater than 1;
if the optimal division strategy of the unit to be coded is the residual recursive division strategy, determining that the unit to be coded meets a continuous division condition, dividing the M second subunits to be coded according to the target recursive division strategy to obtain S fourth subunits to be coded of the unit to be coded, and determining a target division result of the unit to be coded according to the S fourth subunits to be coded.
It can be understood that the processor 1001 may be configured to call the device-defining application stored in the memory 1005 to determine the optimal partition strategy of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded, including:
determining a first rate distortion cost when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded;
determining a second rate-distortion cost of the unit to be coded when the target recursive partitioning strategy is adopted for partitioning according to the N first subunits to be coded;
determining a third rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the residual recursive division strategy according to the M second subunits to be coded;
if the lowest rate distortion cost in the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the first rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the non-partition strategy;
if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the second rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the target recursive partition strategy;
and if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the third rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the residual recursive partition strategy.
It is understood that the processor 1001 may be configured to call the device-defining application program stored in the memory 1005 to determine the target division result of the unit to be encoded according to the N first sub-units to be encoded and the unit to be encoded, including:
determining a first rate distortion cost of the unit to be coded when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded;
determining a second rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the target recursive division strategy according to the N first subunits to be coded;
if the first rate distortion cost is smaller than the second rate distortion cost, determining a target division result of the unit to be coded by the unit to be coded;
and if the first rate distortion cost is greater than or equal to the second rate distortion cost, determining the N first subunits to be coded as target division results of the units to be coded.
It is understood that the processor 1001 may be configured to invoke a device-defined application stored in the memory 1005 to implement obtaining a target recursive partitioning policy for units to be encoded in a target video frame, including:
acquiring K candidate recursive partitioning strategies aiming at the unit to be coded in the target video frame;
determining partition fineness corresponding to the K candidate recursive partition strategies respectively; k is a positive integer greater than 1;
screening out a candidate recursive division strategy with the division fineness being the maximum division fineness from the K candidate recursive division strategies;
and determining the screened candidate recursive partitioning strategies as target recursive partitioning strategies aiming at the unit to be coded in the target video frame.
It is to be understood that the processor 1001 may be configured to invoke the device-defining application stored in the memory 1005 to implement the determining of the partitioning fineness corresponding to each of the K candidate recursive partitioning policies, including:
obtaining the unit quantity corresponding to the sub-unit to be coded when the unit to be coded is divided according to the K candidate recursive division strategies;
determining partition fineness corresponding to the K candidate recursive partition strategies according to the unit quantity corresponding to the K candidate recursive partition strategies respectively; the number of units corresponding to the candidate recursive partitioning strategy Pi in the K candidate recursive partitioning strategies has a positive correlation with the partitioning fineness corresponding to the candidate recursive partitioning strategy Pi; i is a positive integer less than or equal to K.
In the application, in the process of encoding a unit to be encoded in a target video frame, a target recursive partitioning strategy is tried first, that is, the unit to be encoded is partitioned according to the target recursive partitioning strategy to obtain N first subunits to be encoded of the unit to be encoded, and a parameter relationship between encoding parameters of the N first subunits to be encoded and encoding parameters of the unit to be encoded is determined. The target recursive partitioning policy may refer to any one of K candidate recursive partitioning policies of the unit to be encoded, or the target recursive partitioning policy may refer to a candidate recursive partitioning policy with the highest partitioning fineness among the K candidate recursive partitioning policies. The parameter relationship is used for reflecting whether the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, when the parameter relationship reflects that the coding parameters of the unit to be coded and the coding parameters of the N first subunits to be coded have consistency, the fact that texture information and the like of each subunit to be coded have similarity is indicated, the unit to be coded is more suitable for being coded by adopting a coding unit with a larger size, and at the moment, the fact that the unit to be coded does not meet the continuous dividing condition is determined, therefore, the parameter relationship can indicate whether the unit to be coded meets the continuous dividing condition. When the parameter relation indicates that the unit to be coded does not meet the continuous division condition, the unit to be coded is paused to be divided again, namely, the first subunit to be coded does not need to be divided, and the unit to be coded does not need to try other recursive division strategies, the trial of other recursive division strategies can be stopped in advance, the final division result (namely, the target division result) of the unit to be coded can be determined directly according to the division result (namely, the first subunit to be coded) of the target recursive division strategy and the unit to be coded, the division decision process of the coder can be accelerated, and therefore the cost of coding time and computing resources is reduced. Meanwhile, the coding parameters of the first sub-unit to be coded and the parameters of the unit to be coded are the existing information in the coding process, and no high-complexity analysis operation needs to be additionally introduced, so that the complexity of the coding process of the video data is reduced, and the coding efficiency of the video data is improved.
Furthermore, it is to be noted here that: an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program executed by the aforementioned video data processing apparatus, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the video data processing method in the corresponding embodiment can be performed, and therefore, details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application.
As an example, the program instructions described above may be executed on one computer device, or on at least two computer devices located at one site, or on at least two computer devices distributed over at least two sites and interconnected by a communication network, and the at least two computer devices distributed over at least two sites and interconnected by the communication network may constitute a blockchain network.
The computer-readable storage medium may be the video data processing apparatus provided in any of the foregoing embodiments or an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmarT Memory Card (SMC), a Secure DigiTal (SD) card, a flash card (flash card), and the like, provided on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the computer device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the computer device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the description of the video data processing method in the corresponding embodiment is implemented, and therefore, details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product to which the present application relates, reference is made to the description of the embodiments of the method of the present application.
The terms "first," "second," and the like in the description and claims of embodiments of the present application and in the drawings are used for distinguishing between different media content and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or modules recited, but may alternatively include other steps or modules not recited, or may alternatively include other steps or elements inherent to such process, method, apparatus, article, or apparatus.
Those of ordinary skill in the art will appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and should not be taken as limiting the scope of the present application, so that the present application will be covered by the appended claims.
Claims (14)
1. A method of processing video data, comprising:
acquiring a target recursive partitioning strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded;
dividing the unit to be coded according to the target recursive division strategy to obtain N first subunits to be coded; n is a positive integer greater than 1;
acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively;
and if the parameter relation indicates that the unit to be coded does not meet the continuous division condition, pausing to divide the unit to be coded again, and determining a target division result of the unit to be coded according to the N first subunits to be coded and the unit to be coded.
2. The method of claim 1, wherein the coding parameters of the first sub-unit to be coded comprise motion information of the first sub-unit to be coded, and the coding parameters of the unit to be coded comprise motion information of the unit to be coded and a coded block flag;
the determining of the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded includes:
if the value of the coding block flag is smaller than a threshold value, verifying the consistency between the motion information of the N first subunits to be coded and the motion information of the units to be coded respectively;
and if the motion information of the N first sub-units to be coded is consistent with the motion information of the unit to be coded, generating a parameter relation for indicating that the unit to be coded does not meet the continuous division condition.
3. The method of claim 2, wherein the motion information of the unit to be encoded and the motion information of the first sub-unit to be encoded each include at least one of a prediction mode, a reference frame index;
the verifying the consistency between the motion information of the N first sub-units to be encoded and the motion information of the unit to be encoded respectively includes:
if the prediction modes of the N first subunits to be coded and the prediction mode of the unit to be coded are both the translational inter-frame prediction mode, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
if the reference frame modes of the N first subunits to be coded are the same as the reference frame mode of the unit to be coded, determining that the motion information of the N first subunits to be coded has consistency with the motion information of the unit to be coded; or,
and if the reference frame indexes of the N first subunits to be coded are the same as the reference frame index of the unit to be coded, determining that the motion information of the N first subunits to be coded has consistency with the motion information of the unit to be coded.
4. The method of claim 3, wherein the determining that the motion information of the N first sub-units to be encoded has consistency with the motion information of the unit to be encoded if the reference frame patterns of the N first sub-units to be encoded are all the same as the reference frame pattern of the unit to be encoded comprises:
if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are both forward prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are backward prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency; or,
and if the reference frame modes of the N first subunits to be coded and the reference frame mode of the unit to be coded are both bidirectional prediction modes, determining that the motion information of the N first subunits to be coded and the motion information of the unit to be coded have consistency.
5. The method of claim 2, wherein the method further comprises:
if the value of the coding block flag is greater than or equal to a threshold value, or the motion information of the first subunit to be coded does not have consistency with the motion information of the unit to be coded in the N first subunits to be coded, dividing the unit to be coded according to a residual recursive division strategy to obtain M second subunits to be coded of the unit to be coded; the residual recursive partitioning mode strategy is a candidate recursive partitioning strategy except the target recursive partitioning strategy in K candidate recursive partitioning strategies of the unit to be coded, and M and K are positive integers larger than 1;
and determining a target division result of the unit to be coded according to the N first subunits to be coded, the M second subunits to be coded and the unit to be coded.
6. The method of claim 5, wherein the determining the target partition result of the unit to be encoded according to the N first subunits to be encoded, the M second subunits to be encoded, and the unit to be encoded comprises:
determining an optimal partitioning strategy of the unit to be coded according to the N first subunits to be coded, the M second subunits to be coded and the unit to be coded;
if the optimal partitioning strategy of the unit to be coded is a non-partitioning strategy, determining the unit to be coded as a target partitioning result of the unit to be coded;
if the optimal dividing strategy of the unit to be coded is the target recursive dividing strategy, determining that the unit to be coded meets a continuous dividing condition, dividing the N first subunits to be coded according to the target recursive dividing strategy to obtain L third subunits to be coded of the unit to be coded, and determining a target dividing result of the unit to be coded according to the L third subunits to be coded; l is a positive integer greater than 1;
if the optimal division strategy of the unit to be coded is the residual recursive division strategy, determining that the unit to be coded meets a continuous division condition, dividing the M second subunits to be coded according to the target recursive division strategy to obtain S fourth subunits to be coded of the unit to be coded, and determining a target division result of the unit to be coded according to the S fourth subunits to be coded.
7. The method as claimed in claim 6, wherein the determining the optimal partition strategy of the unit to be encoded according to the N first sub-units to be encoded, the M second sub-units to be encoded, and the unit to be encoded comprises:
determining a first rate distortion cost of the unit to be coded when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded;
determining a second rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the target recursive division strategy according to the N first subunits to be coded;
determining a third rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the residual recursive division strategy according to the M second subunits to be coded;
if the lowest rate distortion cost in the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the first rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the non-partition strategy;
if the lowest rate distortion cost in the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the second rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the target recursive partition strategy;
and if the lowest rate distortion cost among the first rate distortion cost, the second rate distortion cost and the third rate distortion cost is the third rate distortion cost, determining the optimal partition strategy of the unit to be coded according to the residual recursive partition strategy.
8. The method of claim 1, wherein the determining the target partition result of the unit to be encoded according to the N first sub-units to be encoded and the unit to be encoded comprises:
determining a first rate distortion cost of the unit to be coded when the unit to be coded is divided by adopting a non-division strategy according to the unit to be coded;
determining a second rate-distortion cost of the unit to be coded when the unit to be coded is divided by adopting the target recursive division strategy according to the N first subunits to be coded;
if the first rate distortion cost is smaller than the second rate distortion cost, determining a target division result of the unit to be coded by the unit to be coded;
and if the first rate-distortion cost is greater than or equal to the second rate-distortion cost, determining the N first subunits to be coded as target division results of the unit to be coded.
9. The method of claim 1, wherein said obtaining a target recursive partitioning policy for units to be encoded in a target video frame comprises:
acquiring K candidate recursive partitioning strategies aiming at the unit to be coded in the target video frame;
determining partition fineness corresponding to the K candidate recursive partition strategies respectively; k is a positive integer greater than 1;
screening out a candidate recursive partitioning strategy with the partitioning fineness being the maximum partitioning fineness from the K candidate recursive partitioning strategies;
and determining the screened candidate recursive partitioning strategies as target recursive partitioning strategies aiming at the unit to be coded in the target video frame.
10. The method of claim 9, wherein said determining a partitioning fineness to which each of said K candidate recursive partitioning strategies corresponds comprises:
obtaining the unit quantity corresponding to the sub-unit to be coded when the unit to be coded is divided according to the K candidate recursive division strategies;
determining partition fineness corresponding to the K candidate recursive partition strategies according to the unit quantity corresponding to the K candidate recursive partition strategies respectively; the number of units corresponding to a candidate recursive partitioning strategy Pi in the K candidate recursive partitioning strategies has a positive correlation with the partitioning fineness corresponding to the candidate recursive partitioning strategy Pi; i is a positive integer less than or equal to K.
11. A video data processing apparatus, comprising:
the device comprises an acquisition unit, a coding unit and a coding unit, wherein the acquisition unit is used for acquiring a target recursive partitioning strategy aiming at a unit to be coded in a target video frame and a coding parameter of the unit to be coded;
the dividing unit is used for dividing the unit to be coded according to the target recursive dividing strategy to obtain N first subunits to be coded; n is a positive integer greater than 1;
the determining unit is used for acquiring coding parameters corresponding to the N first subunits to be coded respectively, and determining the parameter relationship between the coding parameters of the unit to be coded and the coding parameters corresponding to the N first subunits to be coded respectively;
and the pausing module is used for pausing the re-partitioning of the unit to be coded if the parameter relationship indicates that the unit to be coded does not meet the continuous partitioning condition, and determining a target partitioning result of the unit to be coded according to the N first subunits to be coded and the unit to be coded.
12. A computer device, comprising: a processor and a memory;
the processor is connected with the memory; the memory is for storing program code, and the processor is for calling the program code to perform the method of any of claims 1 to 10.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-10.
14. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 10 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211445730.3A CN115883844A (en) | 2022-11-18 | 2022-11-18 | Video data processing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211445730.3A CN115883844A (en) | 2022-11-18 | 2022-11-18 | Video data processing method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115883844A true CN115883844A (en) | 2023-03-31 |
Family
ID=85760240
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211445730.3A Pending CN115883844A (en) | 2022-11-18 | 2022-11-18 | Video data processing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115883844A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118018032A (en) * | 2024-04-09 | 2024-05-10 | 西安西驰信息技术有限公司 | Remote control data transmission method of intelligent switch cabinet |
-
2022
- 2022-11-18 CN CN202211445730.3A patent/CN115883844A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118018032A (en) * | 2024-04-09 | 2024-05-10 | 西安西驰信息技术有限公司 | Remote control data transmission method of intelligent switch cabinet |
CN118018032B (en) * | 2024-04-09 | 2024-06-14 | 西安西驰信息技术有限公司 | Remote control data transmission method of intelligent switch cabinet |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11889098B2 (en) | Method of coding and decoding images, coding and decoding device and computer programs corresponding thereto | |
TWI622288B (en) | Video decoding method | |
KR101131689B1 (en) | Video compression method using filter selection | |
JP2016526336A (en) | System and method for encoding multiple video streams using adaptive quantization for adaptive bitrate streaming | |
CN110248189B (en) | Video quality prediction method, device, medium and electronic equipment | |
TW201415904A (en) | Motion prediction method, motion compensation method, motion prediction apparatus, motion compensation apparatus, and computer readable recording medium for inter-prediction | |
CN112235582B (en) | Video data processing method and device, computer equipment and storage medium | |
CN107079159B (en) | Method and device for parallel video decoding based on multi-core system | |
CN109996080A (en) | Prediction technique, device and the codec of image | |
CN115883844A (en) | Video data processing method, device, equipment and storage medium | |
CN116170582A (en) | Video data processing method, device, computer equipment and storage medium | |
CN116405665A (en) | Encoding method, apparatus, device and storage medium | |
De Praeter et al. | Video encoder architecture for low-delay live-streaming events | |
EP3763125A1 (en) | Quantized coefficient coding | |
CN116567247A (en) | Video encoding method, real-time communication method, device, equipment and storage medium | |
CN113542737A (en) | Encoding mode determining method and device, electronic equipment and storage medium | |
CN110969672A (en) | Image compression method and device | |
CN115767103A (en) | Data processing method and device, computer equipment and storage medium | |
CN114449283B (en) | Data processing method, device, computer equipment and storage medium | |
US20240244229A1 (en) | Systems and methods for predictive coding | |
US20230396783A1 (en) | Data processing method and apparatus, device, and readable storage medium | |
CN115733988A (en) | Video data processing method and device, computer equipment and storage medium | |
Aldin et al. | RHEVC intra‐prediction mode | |
CN116405675A (en) | Encoding method, apparatus, device and storage medium | |
CN118158414A (en) | Video encoding method, video encoding device, electronic equipment and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40083112 Country of ref document: HK |