Video encoding method, decoding method and device
By dividing parallel lines and further dividing H-shaped line segments of the encoding units in the video frame, the problem of insufficient video encoding performance in the prior art is solved, and more efficient video encoding processing is achieved.
Patent Information
- Application Number
- CN201911215452.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-02
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-09-17
AI Technical Summary
When existing video encoding technology deals with screen content videos with rich details, obvious structure and frequent scene switching, the encoding performance is insufficient and it is difficult to meet the high requirements.
By dividing the encoding unit in the video frame into rectangular blocks of equal size using parallel lines, and further dividing them with H-shaped line segments intersecting the parallel line segments, more rectangular blocks of equal size are generated, and then encoding processing is performed.
It improves the encoding performance of video frames, brings richer division results and enhanced adaptability, and significantly improves the encoding performance.
Smart Images

Figure CN112532987B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a video encoding method, decoding method, device, computer-readable medium and electronic device. Background Art
[0002] With the development of digital media technology and computer technology, video is applied to various fields, such as mobile communication, network monitoring, network television, network video conferencing, video live broadcast, etc. The application scenarios of screen content video compression and transmission are increasing day by day. Compared with natural scene videos, such videos have richer details, more obvious element structure, and more frequent scene switching, which puts forward higher requirements on video encoding performance. There is still room for further improvement in the existing encoding performance. Summary of the invention
[0003] The embodiments of the present application provide a video encoding method, a decoding method, an apparatus, a computer-readable medium, and an electronic device, thereby improving the encoding performance of the video at least to a certain extent.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a video encoding method is provided, comprising: obtaining a video frame to be encoded; dividing the encoding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, dividing the second rectangular block into a plurality of rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments; and encoding the video frame based on the division result of the encoding unit.
[0006] According to one aspect of an embodiment of the present application, a video decoding method is provided, comprising: obtaining coded data to be decoded; dividing a decoding unit in the coded data by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and dividing the second rectangular block into a plurality of rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments; and decoding the coded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.
[0007] According to one aspect of an embodiment of the present application, a video encoding device is provided, comprising: a first acquisition unit, used to acquire a video frame to be encoded; a first division unit, used to divide the encoding unit in the video frame using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and divide the second rectangular block into a plurality of rectangular blocks of equal size using an H-shaped line segment intersecting the parallel line segments; and an encoding unit, used to perform encoding processing on the video frame based on the division result of the encoding unit.
[0008] In some embodiments of the present application, based on the aforementioned solution, the second rectangular block is located between the parallel lines, or the second rectangular block is located on either side of the parallel lines.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the first division unit is configured to: divide the coding unit using parallel line segments in the horizontal direction, or divide the coding unit using parallel line segments in the vertical direction.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the video encoding device further includes: a third division unit, configured to divide the rectangular blocks whose sizes meet a predetermined threshold contained in the division results of the encoding unit using a binary tree or extended quadtree division method.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the first division unit is configured to: divide the coding unit in the video frame using a binary tree or extended quadtree division method to obtain the division result of the coding unit; and divide the division result of the coding unit using parallel lines.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the video encoding device also includes: a first generating unit, used to generate identification information corresponding to the encoding unit based on the division method of the encoding unit; a second generating unit, used to generate recording information according to the identification information corresponding to each encoding unit contained in the video frame to be encoded, and the encoding order of each encoding unit; an adding unit, used to add the recording information to the encoding result of the video frame.
[0013] According to one aspect of an embodiment of the present application, a video decoding device is provided, comprising: a second acquisition unit, used to acquire coded data to be decoded; a second division unit, used to divide a decoding unit in the coded data using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and to divide the second rectangular block into a plurality of rectangular blocks of equal size using an H-shaped line segment intersecting with the parallel line segments; and a decoding unit, used to decode the coded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.
[0014] In some embodiments of the present application, based on the aforementioned scheme, after the second acquisition unit is used to acquire the encoded data to be decoded, and before the second division unit is used to divide the decoding units in the encoded data using parallel lines, the video decoding device also includes: obtaining identification information corresponding to the division method used when encoding the encoding unit from the encoded data; if the identification information is specified identification information, dividing the decoding units in the encoded data using parallel lines.
[0015] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the image processing method as described in the above embodiment is implemented.
[0016] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in the above embodiments.
[0017] In the technical solutions provided in some embodiments of the present application, the coding units in the video frame are divided by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and the second rectangular block is divided into a plurality of rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments, and the video frame is encoded based on the division result of the coding unit. The coding unit division method in the present application can bring richer division results and enhance adaptability, and the coding performance of the video frame can be significantly improved by using the coding unit division method in the present application to encode the video frame.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0021] Figure 2 A flowchart of a video encoding method according to an embodiment of the present application is shown;
[0022] Figure 3 A flowchart of a video encoding method according to an embodiment of the present application is shown;
[0023] Figure 4 A flowchart of a video encoding method according to an embodiment of the present application is shown;
[0024] Figure 5A A schematic diagram showing horizontal division of coding units of a video coding method according to an embodiment of the present application is shown;
[0025] Figure 5B A schematic diagram showing vertical division of a coding unit of a video coding method according to an embodiment of the present application is shown;
[0026] Figure 5C A schematic diagram showing a division result of a coding unit of a video coding method according to an embodiment of the present application is shown;
[0027] Figure 6 A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0028] Figure 7 A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0029] Figure 8 A block diagram of a video encoding device according to an embodiment of the present application is shown;
[0030] Fig. 9 A block diagram of a video decoding device according to an embodiment of the present application is shown;
[0031] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0033] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0036] Below, some professional terms in this application are explained to facilitate understanding by those skilled in the art.
[0037] CTU: A picture is composed of multiple CTUs. A CTU usually corresponds to a square image area, including luminance pixels and / or chrominance pixels in this image area. The CTU also contains syntax elements that indicate how to divide the CTU into at least one CU and how to decode each coding unit to obtain a reconstructed image.
[0038] CU: It is a leaf node of the coding tree, usually corresponding to an A×B rectangular area, including the brightness pixels and / or chrominance pixels of the rectangular area. A is the width of the rectangle, and B is the height of the rectangle. A and B can be the same or different. The values of A and B are usually integer powers of 2, such as 256, 128, 64, 32, 16, 8, and 4. A CU can be decoded to obtain a reconstructed image of a rectangular area of A×B through decoding.
[0039] Quadtree: A tree structure in which each node can be divided into four child nodes. According to the division method of the quadtree, the CTU can be recursively divided into several leaf nodes (CU). A node corresponds to an image area. If the node is not divided, the node is called a leaf node, and the image area corresponding to it forms a CU. If the node continues to be divided, the image area corresponding to the node is divided into four image areas of the same size, and each image area corresponds to a node.
[0040] Binary tree: A tree structure in which each node can be divided into two child nodes. The division direction of the binary tree division method can be horizontal or vertical. For example: Based on the horizontal binary tree division method, the image area corresponding to the node is divided into two image areas of the same size, upper and lower, and each image area after the division corresponds to a node. Based on the vertical binary tree division method, the image area corresponding to the node is divided into two image areas of the same size, left and right, and each image area after the division corresponds to a node.
[0041] Ternary tree: a tree structure, each node in the ternary tree can be divided into three sub-nodes. The division direction of the ternary tree division method can be horizontal or vertical. Based on the horizontal ternary tree division method, the image area corresponding to the node is divided into three image areas: upper, middle and lower. Each image area after division corresponds to a node. The heights of these three image areas are 1 / 4, 1 / 2 and 1 / 4 of the height of the entire image area, respectively. Based on the vertical ternary tree division method, the image area corresponding to the node is divided into three image areas: left, middle and right. Each image area after division corresponds to a node. The widths of these three image areas are 1 / 4, 1 / 2 and 1 / 4 of the width of the entire image area, respectively.
[0042] Extended quadtree: A tree structure in which each node can be divided into four child nodes, where the division direction of the extended quadtree can be horizontal or vertical. Unlike the quadtree, the image area corresponding to the node of the extended quadtree is divided into four image areas of the same size.
[0043] Current video coding standards include High Efficiency Video Coding (HEVC), AVS2, AVS3, and Versatile Video Coding (VVC).
[0044] In HEVC and AVS2, the coding unit division mainly uses cross-type division, also known as quad tree division (Quad Tree, QT). Using this method, the encoder will first divide each frame into the largest coding unit (LCU), and then divide the LCU into smaller square CUs by cross division. The size can be divided from 64*64 to 8*8, and the division result of each LCU is controlled by rate-distortion optimization. The divided CU needs to be further divided into TU and PU for subsequent prediction and transformation.
[0045] In AVS3, there are 6 ways to divide the coding unit, namely non-split, quadtree division (Quad Tree, QT), vertical and horizontal binary tree division (Binary tree, BT) and vertical and horizontal extended quadtree division (Extended Quad Tree, EQT). During the division process, first determine whether the current CU is quadtree divided. If not, determine whether it does not need to be divided. If division is still required, choose to use extended quadtree division or binary tree division, and finally choose to use vertical division or horizontal division. Unlike AVS2 and HEVC, the size of LCU in AVS3 is increased to 128*128. The resulting shape after division includes not only squares but also rectangles. The rectangular shape can only be N*8N, N*4N, N*2N, 8N*N, 4N*N, 2N*N, N*N 7 types, such as Figure 3 As shown in the numbered rectangles. The maximum partition depth of AVS3 is 6 layers, the minimum CU unit size is 4*4, and the quadtree partitioning takes precedence over the binary tree and extended quadtree partitioning. When the parent CU uses the binary tree partitioning and the quadtree partitioning, the child CU can no longer use the quadtree partitioning. Similar to AVS2, the CU partitioning process is controlled by RDO, but the difference is that after the CU is divided, the TU and PU division is no longer performed, that is, the divided CU unit is directly transformed and predicted.
[0046] In VVC, similar to AVS3, there are 6 partitioning methods, namely non-split, quad tree partition (Quad Tree, QT), vertical and horizontal binary tree partition (Binary tree, BT) and vertical and horizontal extended ternary tree partition (Trigeminal tree Tree, TT), such as Figure 4 As shown in Figure 2, similar to AVS3, when the parent CU uses binary tree partitioning and ternary tree partitioning, the child CU can no longer use quadtree partitioning. The divided CU no longer performs TU and PU partitioning, and directly performs transformation and prediction.
[0047] With the rapid development and application of 5G technology, remote computers, cloud servers, online video conferencing, live video and other technologies have become more popular. The application scenarios of screen content video compression and transmission are increasing. Compared with natural scene videos, such videos have richer details, more obvious element structure, and more frequent scene switching. The encoding of such videos has greater potential to be explored. The compression performance of such videos can be further improved by finding a more optimized coding unit division mode.
[0048] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0049] like Figure 1 As shown, the application environment includes a terminal 110 and a server 120 , wherein the terminal 110 and the server 120 communicate via a network 130 .
[0050] The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The video encoding method and the video decoding method may be completed in the terminal 110 or the server 120. The terminal 110 may encode the video frame to be encoded using the video encoding method and then send it to the server 120, or may receive the encoded data to be decoded from the server 120 and decode it using the video decoding method to generate a decoded video frame.
[0051] The network 130 is used as a medium for providing a communication link between the terminal 110 and the server 120. The network 102 may include, but is not limited to, a wireless network and a wired network. The wired network includes, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The wireless network includes, but is not limited to, at least one of the following: Bluetooth, WI-FI, and near field communication (NFC).
[0052] It should be understood that Figure 1 The number of terminals 110, networks 130 and servers 120 in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminals 110, networks 130 and servers 120. For example, the server 120 may be a server cluster composed of multiple servers.
[0053] In one embodiment of the present application, the terminal 110 can obtain a video frame to be encoded from the server 120, divide the encoding units in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, divide the second rectangular block into multiple rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments, and encode the video frame to be encoded based on the division result of the encoding unit.
[0054] In one embodiment of the present application, the terminal 110 can also obtain the encoded data to be decoded from the server 120, divide the decoding units in the encoded data by parallel lines, obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, divide the second rectangular block into multiple rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments, and decode the encoded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.
[0055] It should be noted that the video encoding method and the video decoding method provided in the embodiment of the present application can be executed by the terminal 110, and accordingly, the video encoding device and the video decoding device can be arranged in the terminal 110. However, in other embodiments of the present application, the server 120 can also have similar functions as the terminal, so as to execute the video encoding and video decoding schemes provided in the embodiment of the present application.
[0056] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0057] Figure 2 A flowchart of a video encoding method according to an embodiment of the present application is shown. The video encoding method can be executed by a terminal, which can be Figure 1 The terminal 110 shown in FIG. 1 , of course, the video encoding method can also be executed by a server, for example, Figure 1 Executed by the server 120 shown in FIG. Figure 2 As shown, the method includes:
[0058] Step S210, obtaining a video frame to be encoded;
[0059] Step S220: using parallel lines to divide the coding unit in the video frame to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of equal size to the sum of the first rectangular block and the third rectangular block, and using an H-shaped line segment intersecting with the parallel line segments to divide the second rectangular block into a plurality of rectangular blocks of equal size;
[0060] Step S230: Encode the video frame based on the division result of the encoding unit.
[0061] These steps are described in detail below.
[0062] In step S210, a video frame to be encoded is obtained.
[0063] Specifically, the video frame to be encoded is obtained after processing the input video frame, wherein the input video frame is the basic unit constituting the video, and a video sequence may include multiple video frames. The input video frame may be a video frame acquired in real time, for example, a video frame acquired in real time by a camera of a terminal, or a video frame corresponding to a stored video. The input video frame may be an I frame, a P frame, or a B frame, wherein an I frame is an intra-frame prediction frame, a P frame is a forward prediction frame, and a B frame is a bidirectional prediction frame.
[0064] In step S220, the coding unit in the video frame is divided by parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and the second rectangular block is divided into a plurality of rectangular blocks of equal size by an H-shaped line segment intersecting with the parallel line segments.
[0065] When actually encoding a video frame, the video frame is generally divided into multiple complementary overlapping maximum areas, each of which can be called a Large Code Unit (LCU). The largest basic area is further divided into smaller areas, such as the basic coding unit (CU) obtained by dividing the largest basic unit through a quadtree. When encoding, each divided coding unit is encoded in turn.
[0066] In an embodiment of the present application, a coding unit (CU) is divided by parallel lines to obtain three rectangular blocks, namely a first rectangular block, a second rectangular block and a third rectangular block, wherein the first rectangular block is equal to the third rectangular block in size, and the sum of the sizes of the first rectangular block and the third rectangular block is equal to the second rectangular block. At the same time, the second rectangular block is divided into a plurality of rectangular blocks of equal size by an H-shaped line segment intersecting with the parallel line segments, and four rectangular blocks of equal size can be obtained by dividing the second rectangular block by the H-shaped line segment.
[0067] In one embodiment of the present application, the coding unit in the video frame is divided by parallel lines, and the position relationship of the first rectangular block, the second rectangular block, and the third rectangular block obtained by the division may include three implementations:
[0068] In a first implementation, the coding units in a video frame are divided using parallel lines, and the positional relationship of the first rectangular block, the second rectangular block, and the third rectangular block obtained by the division can be that the second rectangular block is located between the parallel lines, while the first rectangular block and the third rectangular block are located on both sides of the parallel lines.
[0069] In a second implementation, the coding units in the video frame are divided using parallel lines, and the positional relationship of the first rectangular block, the second rectangular block, and the third rectangular block obtained by the division can also be that the third rectangular block is located between the parallel lines, while the second rectangular block and the first rectangular block are located on both sides of the parallel lines.
[0070] In a third implementation, the coding units in the video frame are divided by parallel lines, and the positional relationship of the first rectangular block, the second rectangular block, and the third rectangular block obtained by the division can also be that the first rectangular block is located between the parallel lines, and the second rectangular block and the third rectangular block are located on both sides of the parallel lines.
[0071] In one embodiment of the present application, the direction in which the coding units in the video frame are divided by parallel lines may be a horizontal direction or a vertical direction. In this embodiment, the dividing the coding units in the video frame by parallel lines includes:
[0072] The coding unit is divided by using parallel line segments in a horizontal direction, or the coding unit is divided by using parallel line segments in a vertical direction.
[0073] Figure 5A FIG. 1 shows a schematic diagram of horizontal division of a coding unit of a video coding method according to an embodiment of the present application, see Figure 5A , the original coding unit can be divided into two rectangles with a height of H / 4 and a width of W and one rectangle with a height of H / 2 and a width of W by the parallel line segments in the horizontal direction. At the same time, the rectangle with a height of H / 2 in the middle is divided into two rectangles with a height of H / 2 and a width of W / 4 and two rectangles with a height of H / 4 and a width of W / 2 by the H-shaped line segments, finally forming 6 coding sub-units.
[0074] Figure 5B FIG. 1 shows a schematic diagram of vertical division of a coding unit of a video coding method according to an embodiment of the present application, see Figure 5B , the original coding unit can be divided into two rectangles with a height of H and a width of W / 4 and one rectangle with a height of H and a width of W / 2 by parallel line segments in the vertical direction. At the same time, the rectangle with a width of W / 2 in the middle is divided into two rectangles with a height of H / 4 and a width of W / 2 and two rectangles with a height of H / 2 and a width of W / 4 by H-shaped line segments, and finally six coding sub-units are formed, namely, two rectangles with a height of H and a width of W / 4, two CUs with a height of H / 4 and a width of W / 2, and two coding sub-units with a height of H / 2 and a height of W / 4.
[0075] In one embodiment of the present application, the division method of the video frame coding unit includes quad tree division (Quad Tree, QT), binary tree division (Binary tree, BT), ternary tree division (Trigeminal Tree, TT), and extended quad tree division (Extended Quad Tree, EQT). If the video frame coding unit adopts binary tree division and extended quad tree division, the coding unit in the video frame can still be divided by parallel lines, see Figure 3 , the dividing the coding units in the video frame by using parallel lines includes:
[0076] Step S310: Divide the coding unit in the video frame by using a binary tree or an extended quadtree partitioning method to obtain a partitioning result of the coding unit;
[0077] Step S320: divide the division result of the coding unit by using parallel lines.
[0078] In step S320, after the division result of the coding unit is obtained by dividing the coding unit using the binary tree or extended quadtree division method, the division result of the coding unit can be divided using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block. At the same time, the second rectangular block can be divided into multiple rectangular blocks of equal size using H-shaped line segments intersecting with the parallel line segments.
[0079] Figure 5C FIG. 1 is a schematic diagram showing the division result of the coding unit of the video coding method according to an embodiment of the present application, see Figure 5C After the coding unit in the upper right corner is divided into two coding sub-units by a binary tree, one of the coding sub-units is divided by parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block. At the same time, the second rectangular block is divided into a plurality of rectangular blocks of equal size by an H-shaped line segment intersecting with the parallel line segments. Finally, the division result of the coding sub-unit is obtained, which includes rectangular block 5, rectangular block 6, rectangular block 7, rectangular block 8, rectangular block 9, and rectangular block 10.
[0080] Continue to see Figure 2 In step S230, the video frame is encoded based on the division result of the encoding unit.
[0081] After the coding unit is divided, the divided coding sub-units may be coded to obtain coded data corresponding to the video frame.
[0082] The technical solution in the above embodiment uses parallel lines to divide the coding units in the video frame to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and uses an H-shaped line segment intersecting with the parallel line segments to divide the second rectangular block into a plurality of rectangular blocks of equal size, and based on the division result of the coding unit, the video frame is encoded. The coding unit division method in the present application can bring richer division results and enhance adaptability, and the coding performance of the video frame can be significantly improved by using the coding unit division method in the present application to encode the video frame.
[0083] In one embodiment of the present application, after applying the coding unit division method in the present application, the quadtree division method cannot be used for the division result, but if the size of the rectangular block contained in the coding unit division result meets the predetermined threshold, the binary tree division or extended quadtree division method can also be used for the rectangular block in the division result.
[0084] In this embodiment, the video encoding method in the present application further includes:
[0085] The rectangular blocks whose sizes meet a predetermined threshold and are included in the division result of the coding unit are divided by using a binary tree or an extended quadtree division method.
[0086] Among them, the rectangular blocks whose sizes meet the predetermined threshold contained in the division result of the coding unit are divided by a binary tree or an extended quadtree division method. When the division size ratio of the division result is 1:8 or 8:1, the binary tree or the extended quadtree division method can be further used for the division result. When the division result may exceed this ratio (such as 1:16, 16:1), the binary tree or the extended quadtree division method cannot be further used for the division result.
[0087] In one embodiment of the present application, when the starting LCU division is 128*128, the minimum division is 4*4 or the number of divisions does not exceed 6 times in AVS3, the division result of the coding unit can be further divided using a binary tree or an extended quadtree division method.
[0088] Figure 5C FIG. 5 is a schematic diagram showing the division result of the coding unit of the video coding method according to an embodiment of the present application. Figure 5C, the coding unit in the lower right corner is divided by parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block. At the same time, the second rectangular block is divided into a plurality of rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments. Finally, the division result of the coding unit is obtained, and the division result of the coding unit includes rectangular block 12, rectangular block 17, rectangular block 18, rectangular block 19, rectangular block 20, and a rectangular block composed of rectangular block 13, rectangular block 14, rectangular block 15, and rectangular block 16. The extended quadtree division method is used in the rectangular block.
[0089] In one embodiment of the present application, the division method used by the encoding unit during the encoding process will be written into the bitstream and used to reconstruct the video image in the subsequent decoding process. The increase in the division method will inevitably increase the number of division bits used for recording. The encoder is very sensitive to the increase in the number of division bits, and too much recorded information will inevitably reduce the encoding performance. In order to more effectively record the division information and improve the encoding performance, see Figure 4 , the video encoding method in this application also includes:
[0090] Step S410: Generate identification information corresponding to the coding unit based on the division method of the coding unit;
[0091] Step S420: Generate record information according to identification information corresponding to each coding unit included in the video frame to be encoded and the encoding order of each coding unit;
[0092] Step S430: Add the record information to the encoding result of the video frame.
[0093] These steps are described in detail below.
[0094] In step S410, identification information corresponding to the coding unit is generated based on the division manner of the coding unit.
[0095] Among them, as mentioned above, the division method of the coding unit may include QT, BT, EQT, non-split (Non-split) and the coding unit division method used in the video encoding method in this application. For the convenience of description, the coding unit division method used in the video encoding method in this application is called Extended H-shape Partitioning (Extended H-shape Partitioning, EHP).
[0096] According to the division method of the coding unit, the identification information corresponding to the coding unit can be generated by using the name of the division method of the coding unit as the identification information. For example, if the quadtree division method is used for the coding unit, the identification information corresponding to the coding unit is "QT".
[0097] In step S420, record information is generated according to identification information corresponding to each coding unit included in the video frame to be encoded and a coding order of each coding unit.
[0098] After generating the identification information corresponding to the coding unit, the recording information is generated according to the coding order of each coding unit, as shown in the following Table 1, wherein the coding order of each coding unit may be to first determine whether the current coding unit uses QT division, if the QT division method is used, stop recording, and the identification information corresponding to the current coding unit is "QT"; if the QT division method is not used, determine whether the current coding unit uses other division methods, if no other division method is used, stop recording, and the identification information corresponding to the current coding unit is "QT / SPLIT"; if the current coding unit uses a division method, first determine whether it is divided in the vertical direction or the horizontal direction, and determine whether EHP division is used, if EHP division is used, stop recording, and the identification information corresponding to the current coding unit is "CP / SPLIT / Ver / EHP", if EHP division is not used, it is necessary to determine whether EQT division or BT division is used.
[0099] Table 1 Record information corresponding to different coding unit division methods
[0100] Division Record information QT QT Non_Split QT / SPLIT Ver_EHP CP / SPLIT / Ver / EHP Ver_BT CP / SPLIT / Ver / EHP / BT Ver_EQT CP / SPLIT / Ver / EHP / BT Hor_EHP CP / SPLIT / Hor / EHP Hor_BT CP / SPLIT / Hor / EHP / BT Hor_EQT CP / SPLIT / Hor / EHP / EQT
[0101] In one embodiment of the present application, Figure 6 As shown, a video decoding method is also provided, which specifically includes:
[0102] Step S610, obtaining the encoded data to be decoded;
[0103] Step S620: using parallel lines to divide the decoding unit in the encoded data to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of equal size to the sum of the sizes of the first rectangular block and the third rectangular block, and using an H-shaped line segment intersecting with the parallel line segments to divide the second rectangular block into a plurality of rectangular blocks of equal size;
[0104] Step S630: Based on the division result of the decoding unit, the encoded data is decoded to obtain a corresponding decoded video frame.
[0105] These steps are described in detail below.
[0106] In step S610, the encoded data to be decoded is obtained.
[0107] In step S620, the decoding units in the encoded data are divided by parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and the second rectangular block is divided into a plurality of rectangular blocks of equal size by an H-shaped line segment intersecting with the parallel line segments.
[0108] In an embodiment of the present application, the decoding unit is divided by parallel lines to obtain three rectangular blocks, namely a first rectangular block, a second rectangular block and a third rectangular block, wherein the first rectangular block is equal to the third rectangular block in size, and the sum of the sizes of the first rectangular block and the third rectangular block is equal to the second rectangular block. At the same time, the second rectangular block is divided into multiple rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments. Four rectangular blocks of equal size can be obtained by dividing the second rectangular block by using the H-shaped line segment.
[0109] In one embodiment of the present application, after obtaining the coded data to be decoded, before dividing the decoding units in the coded data using parallel lines, identification information corresponding to the division method used when encoding the coding units can also be obtained from the coded data. In this embodiment, Figure 7 As shown, it also includes:
[0110] Step S710: Acquire identification information corresponding to the division method used when encoding the coding unit from the coded data;
[0111] Step S720: If the identification information is designated identification information, the decoding units in the encoded data are divided using parallel lines.
[0112] In step S710, as mentioned above, the identification information is information corresponding to the division method used when encoding the coding unit. For example, if the coding unit is divided into quadtrees, the identification information of the coding unit is "QT".
[0113] In step S720, the designated identification information means that the division method of the coding unit corresponding to the identification information is the coding unit division method adopted in the video encoding method of the present application. Therefore, when the acquired identification information is the designated identification information, the decoding units in the encoded data are divided by parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block. The second rectangular block is divided into a plurality of rectangular blocks of equal size by an H-shaped line segment intersecting with the parallel line segments. Based on the division result of the decoding unit, the encoded data is decoded to obtain a corresponding decoded video frame.
[0114] Continue to see Figure 6 In step S630, based on the division result of the decoding unit, the encoded data is decoded to obtain a corresponding decoded video frame.
[0115] The following describes an apparatus embodiment of the present application, which can be used to execute the video encoding method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the image processing method of the present application.
[0116] Figure 8 A block diagram of a video encoding device according to an embodiment of the present application is shown. Figure 8 As shown, a video encoding device 800 according to an embodiment of the present application includes: a first acquisition unit 802 , a first division unit 804 and an encoding unit 806 .
[0117] Among them, the first acquisition unit 802 is used to obtain a video frame to be encoded; the first division unit 804 is used to divide the encoding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and the second rectangular block is divided into a plurality of rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segment; the encoding unit 806 is used to encode the video frame based on the division result of the encoding unit.
[0118] In some embodiments of the present application, the second rectangular block is located between the parallel lines, or the second rectangular block is located on either side of the parallel lines.
[0119] In some embodiments of the present application, the first division unit 804 is configured to: divide the coding unit using parallel line segments in the horizontal direction, or divide the coding unit using parallel line segments in the vertical direction.
[0120] In some embodiments of the present application, the video encoding device further includes: a third division unit, configured to divide rectangular blocks whose sizes meet a predetermined threshold and are included in the division result of the encoding unit by using a binary tree or extended quadtree division method.
[0121] In some embodiments of the present application, the first division unit 804 is configured to: divide the coding unit in the video frame using a binary tree or extended quadtree division method to obtain a division result of the coding unit; and divide the division result of the coding unit using parallel lines.
[0122] In some embodiments of the present application, the video encoding device also includes: a first generating unit, used to generate identification information corresponding to the encoding unit based on the division method of the encoding unit; a second generating unit, used to generate recording information according to the identification information corresponding to each encoding unit contained in the video frame to be encoded, and the encoding order of each encoding unit; an adding unit, used to add the recording information to the encoding result of the video frame.
[0123] Fig. 9 A block diagram of an image processing device according to an embodiment of the present application is shown.
[0124] See also Fig. 9 As shown, a communication processing device 900 according to an embodiment of the present application includes: a second acquisition unit 902 , a second division unit 904 and a decoding unit 906 .
[0125] Among them, the second acquisition unit 902 is used to obtain the encoded data to be decoded; the second division unit 904 is used to divide the decoding unit in the encoded data by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of a size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and the second rectangular block is divided into multiple rectangular blocks of equal size by using H-shaped line segments intersecting with the parallel line segments; the decoding unit 906 is used to decode the encoded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.
[0126] In some embodiments of the present application, based on the aforementioned scheme, after the second acquisition unit 902 is used to acquire the encoded data to be decoded, and before the second division unit 904 is used to divide the decoding units in the encoded data using parallel lines, the video decoding device also includes: obtaining identification information corresponding to the division method used when encoding the encoding unit from the encoded data; if the identification information is specified identification information, dividing the decoding units in the encoded data using parallel lines.
[0127] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0128] It should be noted that Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0129] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003, such as executing the method described in the above embodiment. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through the bus 1004. The input / output (I / O) interface 1005 is also connected to the bus 1004.
[0130] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0131] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0132] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0133] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0135] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0136] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0137] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0138] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0139] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A video encoding method, characterized in that: include: Get the video frame to be encoded; Using parallel lines to divide the coding unit in the video frame to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of equal size to the sum of the sizes of the first rectangular block and the third rectangular block, and using an H-shaped line segment intersecting the parallel line segments to divide the second rectangular block into a plurality of rectangular blocks of equal size; wherein the second rectangular block is located between the parallel lines or on one side of the parallel lines; Based on the division result of the coding unit, the video frame is coded.
2. The method according to claim 1, characterized in that The second rectangular block is located between the parallel lines, or the second rectangular block is located on either side of the parallel lines.
3. The method according to claim 1, characterized in that The dividing the coding units in the video frame by using parallel lines includes: The coding unit is divided by using parallel line segments in a horizontal direction, or the coding unit is divided by using parallel line segments in a vertical direction.
4. The method according to claim 1, characterized in that: Also includes: The rectangular blocks whose sizes meet a predetermined threshold and are included in the division result of the coding unit are divided by using a binary tree or an extended quadtree division method.
5. The method according to claim 1, characterized in that: The dividing the coding units in the video frame by using parallel lines includes: Dividing the coding unit in the video frame by using a binary tree or an extended quadtree partitioning method to obtain a partitioning result of the coding unit; The division result of the coding unit is divided using parallel lines.
6. The method according to claim 1, characterized in that Also includes: Based on the division method of the coding unit, generating identification information corresponding to the coding unit; Generate record information according to identification information corresponding to each coding unit included in the video frame to be encoded and a coding order of each coding unit; The record information is added to the encoding result of the video frame.
7. A video decoding method, characterized in that: include: Get the encoded data to be decoded; Dividing the decoding unit in the coded data by parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of equal size to the sum of the sizes of the first rectangular block and the third rectangular block, and dividing the second rectangular block into a plurality of rectangular blocks of equal size by an H-shaped line segment intersecting the parallel line segments; wherein the second rectangular block is located between the parallel lines or on one side of the parallel lines; Based on the division result of the decoding unit, the encoded data is decoded to obtain corresponding decoded video frames.
8. The method according to claim 7, characterized in that After acquiring the coded data to be decoded and before dividing the decoding units in the coded data by using parallel lines, the method further includes: Acquire identification information corresponding to a division method used when encoding the coding unit from the coded data; If the identification information is designated identification information, the decoding units in the encoded data are divided using parallel lines.
9. A video encoding device, characterized in that: include: A first acquisition unit, used to acquire a video frame to be encoded; A first dividing unit is used to divide the coding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of which the size is equal to the sum of the sizes of the first rectangular block and the third rectangular block, and to divide the second rectangular block into a plurality of rectangular blocks of equal size by using an H-shaped line segment intersecting with the parallel line segments; wherein the second rectangular block is located between the parallel lines or on one side of the parallel lines; The encoding unit is used to encode the video frame based on the division result of the encoding unit.
10. A video decoding device, characterized in that: include: A second acquisition unit, used to acquire the encoded data to be decoded; a second dividing unit, configured to divide the decoding unit in the coded data by using parallel lines to obtain a first rectangular block and a third rectangular block of equal size, and a second rectangular block of which the size is equal to the sum of the sizes of the first rectangular block and the third rectangular block, and to divide the second rectangular block into a plurality of rectangular blocks of equal size by using H-shaped line segments intersecting the parallel line segments; wherein the second rectangular block is located between the parallel lines or on one side of the parallel lines; The decoding unit is used to decode the encoded data based on the division result of the decoding unit to obtain corresponding decoded video frames.
11. A computer readable medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that The invention comprises a computer program carried on a computer-readable medium, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
13. An electronic device, characterized in that: include: one or more processors; A storage device, used for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Video signal processing method and apparatus
CN109923866A
