Video encoding method, decoding method and device

文档序号:882766 发布日期:2021-03-19 浏览:2次 中文

阅读说明:本技术 视频编码方法、解码方法、装置 (Video encoding method, decoding method and device ) 是由 高伟 袁航 于 2019-12-02 设计创作,主要内容包括:本申请的实施例提供了一种视频编码方法、装置。该视频编码方法包括:获取待编码的视频帧;利用平行线对所述视频帧中的编码单元进行划分,得到大小相等的第一矩形块和第三矩形块,以及大小等于所述第一矩形块与所述第三矩形块的大小之和的第二矩形块,利用与所述平行线段相交的H型线段将所述第二矩形块划分为多个大小相等的矩形块;基于对所述编码单元的划分结果,对所述视频帧进行编码处理。本申请实施例的技术方案能够明显提高对视频编码的编码性能。本申请的实施例还提供了一种视频解码方法、装置。(The embodiment of the application provides a video coding method and device. The video encoding method includes: acquiring a video frame to be coded; dividing coding units in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments; and performing encoding processing on the video frame based on the division result of the encoding unit. The technical scheme of the embodiment of the application can obviously improve the coding performance of video coding. The embodiment of the application also provides a video decoding method and device.)

1. A video encoding method, comprising:

acquiring a video frame to be coded;

dividing coding units in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments;

and performing encoding processing on the video frame based on the division result of the encoding unit.

2. The method of claim 1, wherein 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 of claim 1, wherein the dividing the coding units in the video frame by parallel lines comprises:

the coding unit is divided by parallel line segments in the horizontal direction, or divided by parallel line segments in the vertical direction.

4. The method of claim 1, further comprising:

and partitioning the rectangular blocks with the size meeting a preset threshold value contained in the partitioning result of the coding unit by adopting a binary tree or extended quadtree partitioning method.

5. The method of claim 1, wherein the dividing the coding units in the video frame by parallel lines comprises:

dividing coding units in the video frames by adopting a binary tree or extended quadtree division method to obtain division results of the coding units;

and dividing the division result of the coding unit by using the parallel lines.

6. The method of claim 1, further comprising:

generating identification information corresponding to the coding units based on the division manner of the coding units;

generating recording information according to the identification information corresponding to each coding unit contained in the video frame to be coded and the coding sequence of each coding unit;

adding the recording information to the encoding result of the video frame.

7. A video decoding method, comprising:

acquiring coded data to be decoded;

dividing a decoding unit in the encoded data by using a parallel line to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is equal in 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 which are equal in size by using an H-shaped line segment which is intersected with the parallel line segment;

and decoding the coded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.

8. The method according to claim 7, wherein after the obtaining of the encoded data to be decoded and before the dividing of the decoding units in the encoded data by the parallel lines, the method further comprises:

acquiring identification information corresponding to a division mode adopted when a coding unit is coded from the coded data;

and if the identification information is the designated identification information, dividing decoding units in the coded data by using parallel lines.

9. A video encoding apparatus, comprising:

a first obtaining unit, configured to obtain a video frame to be encoded;

the video coding device comprises a first dividing unit, a second dividing unit and a coding unit, wherein the first dividing unit is used for dividing the coding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size, and a second rectangular block which is equal in size 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments;

and the coding unit is used for carrying out coding processing on the video frame based on the division result of the coding unit.

10. A video decoding apparatus, comprising:

a second acquisition unit configured to acquire encoded data to be decoded;

a second dividing unit, configured to divide the decoding unit in the encoded data by using parallel lines to obtain a first rectangular block and a third rectangular block that are equal in size, and a second rectangular block that is equal in size to a sum of the first rectangular block and the third rectangular block, and divide the second rectangular block into a plurality of rectangular blocks that are equal in size by using H-shaped line segments that intersect with the parallel line segments;

and the decoding unit is used for decoding the coded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.

Technical Field

The present application relates to the field of computer and communication technologies, and in particular, to a video encoding method, a video decoding method, a video encoding device, a video decoding device, a computer-readable medium, and an electronic device.

Background

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 conference, live video and the like. Application scenes of screen content video compression and transmission are gradually increased, and compared with natural scene videos, the videos are richer in details, more obvious in element structuring and more frequent in scene switching, so that higher requirements are provided for the encoding performance of the videos, and the existing encoding performance has a space for further improvement.

Disclosure of Invention

Embodiments of the present application provide a video encoding method, a video decoding device, a computer-readable medium, and an electronic device, so that the encoding performance of a video can be improved at least to a certain extent.

Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.

According to an aspect of an embodiment of the present application, there is provided a video encoding method, including: acquiring a video frame to be coded; dividing coding units in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments; and performing encoding processing on the video frame based on the division result of the encoding unit.

According to an aspect of an embodiment of the present application, there is provided a video decoding method including: acquiring coded data to be decoded; dividing a decoding unit in the encoded data by using a parallel line to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is equal in 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 which are equal in size by using an H-shaped line segment which is intersected with the parallel line segment; and decoding the coded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.

According to an aspect of an embodiment of the present application, there is provided a video encoding apparatus including: a first obtaining unit, configured to obtain a video frame to be encoded; the video coding device comprises a first dividing unit, a second dividing unit and a coding unit, wherein the first dividing unit is used for dividing the coding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size, and a second rectangular block which is equal in size 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments; and the coding unit is used for carrying out coding processing on the video frame based on the division result of the coding unit.

In some embodiments of the present application, based on the above 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.

In some embodiments of the present application, based on the foregoing scheme, the first dividing unit is configured to: the coding unit is divided by parallel line segments in the horizontal direction, or divided by parallel line segments in the vertical direction.

In some embodiments of the present application, based on the foregoing scheme, the video encoding device further includes: and the third dividing unit is used for dividing the rectangular blocks with the size meeting the preset threshold value in the dividing result of the coding unit by adopting a binary tree or expanded quadtree dividing method.

In some embodiments of the present application, based on the foregoing scheme, the first dividing unit is configured to: dividing coding units in the video frames by adopting a binary tree or extended quadtree division method to obtain division results of the coding units; and dividing the division result of the coding unit by using the parallel lines.

In some embodiments of the present application, based on the foregoing scheme, the video encoding device further includes: a first generating unit configured to generate identification information corresponding to the coding unit based on a manner of dividing the coding unit; the second generating unit is used for generating recording information according to the identification information corresponding to each coding unit contained in the video frame to be coded and the coding sequence of each coding unit; an adding unit configured to add the recording information to an encoding result of the video frame.

According to an aspect of an embodiment of the present application, there is provided a video decoding apparatus including: a second acquisition unit configured to acquire encoded data to be decoded; a second dividing unit, configured to divide the decoding unit in the encoded data by using parallel lines to obtain a first rectangular block and a third rectangular block that are equal in size, and a second rectangular block that is equal in size to a sum of the first rectangular block and the third rectangular block, and divide the second rectangular block into a plurality of rectangular blocks that are equal in size by using H-shaped line segments that intersect with the parallel line segments; and the decoding unit is used for decoding the coded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.

In some embodiments of the present application, based on the foregoing scheme, the second obtaining unit is configured to obtain the encoded data to be decoded, and the second dividing unit is configured to divide the decoding unit in the encoded data by using parallel lines, and the video decoding apparatus further includes: acquiring identification information corresponding to a division mode adopted when a coding unit is coded from the coded data; and if the identification information is the designated identification information, dividing decoding units in the coded data by using parallel lines.

According to an aspect of embodiments of the present application, there is provided a computer-readable medium on which a computer program is stored, which, when executed by a processor, implements an image processing method as described in the above embodiments.

According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the image processing method as described in the above embodiments.

In the technical solutions provided in some embodiments of the present application, a coding unit in a video frame is divided by using parallel lines to obtain a first rectangular block and a third rectangular block with equal sizes and a second rectangular block with the 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 with equal sizes by using H-shaped line segments intersecting with the parallel line segments, and a video frame is coded based on a division result of the coding unit. The coding unit division mode in the application can bring richer division results and enhance adaptability, and the coding performance of the video frame can be obviously improved by adopting the coding unit division mode in the application to code the video frame.

It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:

FIG. 1 is a diagram illustrating an exemplary system architecture to which aspects of embodiments of the present application may be applied;

FIG. 2 shows a flow diagram of a video encoding method according to an embodiment of the present application;

FIG. 3 shows a flow diagram of a video encoding method according to an embodiment of the present application;

FIG. 4 shows a flow diagram of a video encoding method according to an embodiment of the present application;

fig. 5A illustrates a schematic diagram of horizontal division of coding units of a video coding method according to an embodiment of the present application;

FIG. 5B shows a schematic diagram of vertical partitioning of coding units of a video coding method according to an embodiment of the present application;

fig. 5C is a diagram illustrating a division result of a coding unit of a video coding method according to an embodiment of the present application;

FIG. 6 shows a flow diagram of a video decoding method according to an embodiment of the present application;

FIG. 7 shows a flow diagram of a video decoding method according to an embodiment of the present application;

FIG. 8 shows a block diagram of a video encoding apparatus according to an embodiment of the present application;

FIG. 9 shows a block diagram of a video decoding apparatus according to an embodiment of the present application;

FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.

Detailed Description

Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.

Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.

The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.

The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.

Hereinafter, some terms of art in the present application will be explained to facilitate understanding by those skilled in the art.

And (3) CTU: an image is made up of a plurality of CTUs, one CTU generally corresponding to a square image area, including luminance pixels and/or chrominance pixels in the image area; syntax elements are also included in the CTU that indicate how to divide the CTU into at least one CU and the method of decoding each coding unit resulting in a reconstructed picture.

CU: it is a leaf node of the coding tree, usually corresponding to an a × B rectangular region, containing the luminance pixels and/or chrominance pixels of the rectangular region, a being the width of the rectangle, B being the height of the rectangle, a and B being the same or different, a and B usually taking values to the power of 2, for example 256, 128, 64, 32, 16, 8, 4. One CU can be decoded by a decoding process to obtain a reconstructed image of an a × B rectangular area.

A quadtree: a tree structure, each node in a quadtree may be divided into four child nodes. The CTU may be recursively divided into leaf nodes (CUs) in a quadtree division manner. A node corresponds to an image area, and if the node is not divided, the node is called a leaf node, and its corresponding image area forms a CU. If the nodes continue to be divided, the image areas corresponding to the nodes are divided into four image areas of the same size, one node for each image area.

A binary tree: in a tree structure, each node in a binary tree may be divided into two child nodes. The dividing direction of the binary tree dividing mode can be a horizontal direction or a vertical direction. For example: and dividing the image area corresponding to the node into an upper image area and a lower image area with the same size based on a horizontal binary tree division mode, wherein each divided image area corresponds to one node. And dividing the image area corresponding to the node into a left image area and a right image area with the same size based on a vertical binary tree division mode, wherein each divided image area corresponds to one node.

A ternary tree: a tree structure, each node in a ternary tree may be divided into three child nodes. The dividing direction of the ternary tree dividing mode can be a horizontal direction or a vertical direction. And dividing the image area corresponding to the node into an upper image area, a middle image area and a lower image area based on a horizontal ternary tree division mode, wherein each divided image area corresponds to one node. The heights of these three image regions are 1/4, 1/2, 1/4, respectively, which are the heights of the entire image region. And dividing the image area corresponding to the node into a left image area, a middle image area and a right image area based on a vertical ternary tree division mode, wherein each divided image area corresponds to one node. The three image regions are 1/4, 1/2, 1/4 wide, respectively, of the total image region.

Expanding the quadtree: each node in the expanded quad tree can be divided into four sub-nodes, wherein the dividing direction of the expanding quad tree dividing mode can be the horizontal direction or the vertical direction. Different from the quadtree, the image area corresponding to the node for expanding the quadtree division is divided into four image areas with the same size.

The current Video Coding standards include High Efficiency Video Coding (HEVC), AVS2, AVS3, and multifunctional Video Coding (VVC).

In HEVC and AVS2, the Coding Unit partition mainly uses a cross-type cross partition, also called Quad Tree partition (QT), and with this method, an encoder first divides each frame of image into Largest Coding Units (LCUs), and then divides the LCUs into smaller square CUs by means of cross-type cross partition. The size may be divided from 64 x 64 to 8 x 8, the division result of each LCU being controlled by rate-distortion optimization. The divided CU needs to be further divided into TUs and PUs for subsequent prediction and transform.

In AVS3, the number of coding unit partitions is up to 6, which are no-split (Non-split), Quad Tree (QT), vertical and horizontal Binary Tree (BT), and vertical and horizontal Extended Quad Tree (EQT), and during the partitioning process, it is first determined whether the current CU is Quad Tree partitioned, and if not, whether partitioning is not required. And if the division is still needed, selecting and using expanded quad-tree division or binary-tree division, and finally selecting and using vertical division or horizontal division. Unlike AVS2 and HEVC, the size of the LCU in AVS3 is raised to 128 × 128, and the resulting shape after partitioning includes not only squares but also rectangles, wherein the rectangle shapes can only be N × 8N, N × 4N, N × 2N, 8N × N, 4N × N, 2N × N, N × N7, as shown by the numbered rectangles in fig. 3. The maximum division depth of the AVS3 is 6 layers, the minimum CU unit size is 4 x 4, the quadtree division is prioritized over the binary tree division and the extended quadtree division, and when the parent CU uses the binary tree division and the quadtree division, the child CU can not use the quadtree division again. The process of CU partitioning is controlled by RDO as in AVS2, but differs from it in that the partitioning of TUs and PUs is not done after the CU partitioning, i.e. the partitioned CU units are directly transformed and predicted.

In the VVC, similar to the AVS3, the number of the partitions is up to 6, which are Non-partition (Non-Split), Quad Tree partition (QT), vertical and horizontal Binary Tree partition (BT), and vertical and horizontal extended ternary Tree partition (TT), respectively, as shown in fig. 4. Like AVS3, when parent-level CUs use binary tree partitioning and ternary tree partitioning, child-level CUs may not use quaternary tree partitioning, and the partitioned CUs may not perform TU and PU partitioning, but may perform transform and prediction directly.

With the rapid development of the 5G technology in application, technologies such as remote computers, cloud servers, network video conferences, live video broadcasting and the like are more popular. Application scenes of screen content video compression and transmission are increasing day by day, and compared with natural scene videos, the videos are richer in details, more obvious in element structuring and more frequent in scene switching. The encoding of such videos also has a greater potential to await mining. The compression performance of such video can be further improved by finding more optimal coding unit partition modes.

Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.

As shown in fig. 1, the application environment includes a terminal 110 and a server 120, wherein the terminal 110 and the server 120 communicate via a network 130.

The terminal 110 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like. The video encoding method and the video decoding method may be completed in the terminal 110 or the server 120, and the terminal 110 may encode a video frame to be encoded by using the video encoding method and then transmit the encoded video frame to the server 120, or may receive encoded data to be decoded from the server 120 and decode the encoded data by using the video decoding method to generate a decoded video frame.

Network 130 serves as a medium for providing communication links between terminals 110 and server 120. Network 102 may include, but is not limited to: a wireless network, a wired network, including but not limited to at least one of: wide area networks, metropolitan area networks, and local area networks. The wireless network includes, but is not limited to, at least one of: bluetooth, WI-FI, Near Field Communication (NFC for short).

It should be understood that the number of terminals 110, networks 130, and servers 120 in fig. 1 is merely illustrative. There may be any number of terminals 110, networks 130, and servers 120, as desired for an implementation. For example, the server 120 may be a server cluster composed of a plurality of servers, and the like.

In an embodiment of the present application, the terminal 110 may obtain a video frame to be encoded from the server 120, divide an encoding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size, and a second rectangular block which is equal in size to a sum of the sizes of the first rectangular block and the third rectangular block, divide the second rectangular block into a plurality of rectangular blocks which are equal in size by using H-shaped line segments intersecting with the parallel line segments, and perform encoding processing on the video frame to be encoded based on a division result of the encoding unit.

In an embodiment of the present application, the terminal 110 may further obtain encoded data to be decoded from the server 120, divide a decoding unit in the encoded data by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size, and a second rectangular block which is equal in size to a sum of the sizes of the first rectangular block and the third rectangular block, divide the second rectangular block into a plurality of rectangular blocks which are equal in size by using an H-shaped line segment intersecting with the parallel line segments, and decode the encoded data based on a division result of the decoding unit to obtain a corresponding decoded video frame.

It should be noted that the video encoding method and the video decoding method provided in the embodiments of the present application may be executed by the terminal 110, and accordingly, the video encoding apparatus and the video decoding apparatus may be disposed in the terminal 110. However, in other embodiments of the present application, the server 120 may also have similar functions as the terminal, so as to execute the scheme of video encoding and video decoding provided by the embodiments of the present application.

The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:

fig. 2 shows a flow chart of a video encoding method according to an embodiment of the present application, which may be performed by a terminal, which may be the terminal 110 shown in fig. 1, but which may also be performed by a server, such as the server 120 shown in fig. 1. Referring to fig. 2, the method includes:

step S210, acquiring a video frame to be coded;

step S220, dividing coding units in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is equal in 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments;

and step S230, carrying out coding processing on the video frame based on the division result of the coding unit.

These steps are described in detail below.

In step S210, a video frame to be encoded is acquired.

Specifically, a video frame to be encoded is obtained by processing an input video frame, where the input video frame is a basic unit constituting a video, and one video sequence may include a plurality of 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 the terminal, or a video frame corresponding to a stored video. The input video frames may be I-frames, which are intra-predicted frames, P-frames, which are forward predicted frames, or B-frames, which are bi-predicted frames.

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 with equal sizes and a second rectangular block with equal 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 with equal sizes by H-shaped line segments intersecting the parallel line segments.

When a video frame is actually encoded, the video frame is generally divided into a plurality of complementary and overlapping maximum regions, each region may be referred to as a maximum coding Unit (LCU), and the maximum basic region is further divided into smaller regions, for example, the maximum basic region is divided by a quadtree, so as to obtain a basic coding Unit (CU, Code Unit). When encoding, each divided coding unit is sequentially encoded.

In the 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 and the third rectangular block have the same size, and the sum of the sizes of the first rectangular block and the third rectangular block is equal to that of the second rectangular block.

In an embodiment of the present application, a coding unit in a video frame is divided by 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 may include three implementation manners:

in the first embodiment, the coding unit in the video frame is divided by parallel lines, and the first rectangular block, the second rectangular block and the third rectangular block obtained by the division may be located in such a way that the second rectangular block is located between the parallel lines and the first rectangular block and the third rectangular block are located on both sides of the parallel lines.

In the second embodiment, the coding units in the video frame are divided by parallel lines, and the first rectangular block, the second rectangular block and the third rectangular block obtained by the division may also be located between the parallel lines, and the second rectangular block and the first rectangular block may be located on both sides of the parallel lines.

In the third embodiment, the coding units in the video frame are divided by parallel lines, and the first rectangular block, the second rectangular block and the third rectangular block obtained by the division may be in a positional relationship 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.

In an embodiment of the present application, a direction in which a coding unit in a video frame is divided by a parallel line may be a horizontal direction or a vertical direction, and in this embodiment, the dividing the coding unit in the video frame by the parallel line includes:

the coding unit is divided by parallel line segments in the horizontal direction, or divided by parallel line segments in the vertical direction.

Fig. 5A is a schematic diagram illustrating horizontal division of a coding unit of a video coding method according to an embodiment of the present application, and referring to fig. 5A, an original coding unit can be divided into two rectangles with height H/4 and width W and one rectangle with height H/2 and width W by parallel line segments in the horizontal direction. Meanwhile, the rectangle with the height H/2 in the middle part is divided into two rectangles with the height H/2 and the width W/4 and two rectangles with the height H/4 and the width W/2 by the H-shaped line segment, and finally 6 coding subunits are formed.

FIG. 5B is a diagram illustrating vertical partitioning of a coding unit of a video coding method according to an embodiment of the present application, and referring to FIG. 5B, an original coding unit can be partitioned into two rectangles with height H and width W/4 and one rectangle with height H and width W/2 by parallel line segments in the vertical direction. Meanwhile, the rectangle with the width of W/2 in the middle part is divided into two rectangles with the height of H/4 and the width of W/2 and two rectangles with the height of H/2 and the width of W/4 by the H-shaped line segment, and finally 6 coding subunits are formed, namely two rectangles with the height of H and the width of W/4, two CUs with the height of H/4 and the width of W/2 and two coding subunits with the height of H/2 and the height of W/4.

In an embodiment of the present application, the dividing manner for the video frame coding unit includes Quad Tree partitioning (QT), Binary Tree partitioning (BT), ternary Tree partitioning (TT), Extended Quad Tree partitioning (EQT), and if the video frame coding unit is divided by Binary Tree partitioning and Extended Quad Tree partitioning, the coding unit in the video frame can still be divided by parallel lines, see fig. 3, where the dividing manner for the coding unit in the video frame by parallel lines includes:

step S310, a binary tree or extended quadtree partitioning method is adopted for partitioning the coding units in the video frame to obtain the partitioning result of the coding units;

and step S320, dividing the division result of the coding unit by using parallel lines.

In step S320, after the coding unit is divided by the binary tree or extended quadtree division method to obtain the division result of the coding unit, the division result of the coding unit may be divided by parallel lines to obtain a first rectangular block and a third rectangular block with the same size, and a second rectangular block with the size equal to the sum of the sizes of the first rectangular block and the third rectangular block, and at the same time, the second rectangular block is divided into a plurality of rectangular blocks with the same size by H-shaped line segments intersecting the parallel line segments.

Fig. 5C is a schematic diagram illustrating a division result of a coding unit of a video coding method according to an embodiment of the present application, and referring to fig. 5C, after a coding unit at the upper right corner obtains two coding subunits by using a binary tree division manner, one of the coding subunits is divided by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size, and a second rectangular block which is equal in size to the sum of the sizes of the first rectangular block and the third rectangular block, and at the same time, the second rectangular block is divided into a plurality of rectangular blocks which are equal in size by using an H-shaped line segment intersecting with the parallel line segments, and finally, a division result of the coding subunit is obtained, that is, the division result includes rectangular blocks 5, 6, 7, 8, 9, and 10.

With continued reference to fig. 2, in step S230, the video frame is subjected to encoding processing based on the division result of the coding unit.

After the coding unit is divided, the coding sub-units obtained by the division may be subjected to coding processing, so as to obtain coded data corresponding to the video frame.

In the technical scheme in the above embodiment, the coding unit in the video frame is divided by using the parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size, and a second rectangular block which is equal in size 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 which are equal in size by using H-shaped line segments intersecting with the parallel line segments, and the video frame is coded based on the division result of the coding unit. The coding unit division mode in the application can bring richer division results and enhance adaptability, and the coding performance of the video frame can be obviously improved by adopting the coding unit division mode in the application to code the video frame.

In an embodiment of the present application, after applying the coding unit partitioning method in the present application, a quadtree partitioning method may not be used for the partitioning result, but if the size of a rectangular block included in the partitioning result of the coding unit satisfies a predetermined threshold, a binary tree partitioning method or an extended quadtree partitioning method may also be used for the rectangular block in the partitioning result.

In this embodiment, the video encoding method in the present application further includes:

and partitioning the rectangular blocks with the size meeting a preset threshold value contained in the partitioning result of the coding unit by adopting a binary tree or extended quadtree partitioning method.

The dividing of the rectangular blocks with the size meeting the predetermined threshold included in the dividing result of the coding unit by using a binary tree or extended quadtree dividing method may be performed in such a manner that when the dividing size ratio of the dividing result is 1:8 or 8:1, the binary tree or extended quadtree dividing method may be further used for the dividing result, and when the dividing result may exceed the ratio (e.g., 1:16, 16:1), the binary tree or extended quadtree dividing method cannot be further used for the dividing result.

In one embodiment of the present application, when the LCU of the start partitioning is 128 × 128, the minimum partitioning is 4 × 4 or the number of partitioning times is not more than 6 times in the AVS3, the partitioning result for the coding unit may further use a binary tree or extend a quadtree partitioning method.

Fig. 5C is a diagram illustrating a division result of a coding unit of a video coding method according to an embodiment of the present application. Referring to fig. 5C, the coding unit at the lower right corner is divided by parallel lines to obtain a first rectangular block and a third rectangular block with the same size, and a second rectangular block with the same size as the sum 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 with the same size by using H-shaped line segments intersecting with parallel line segments, and finally, a division result of the coding unit is obtained, where the division result of the coding unit includes rectangular block 12, rectangular block 17, rectangular block 18, rectangular block 19, rectangular block 20, and rectangular blocks composed of rectangular block 13, rectangular block 14, rectangular block 15, and rectangular block 16, and an extended quadtree division manner is adopted in the rectangular blocks.

In an embodiment of the present application, the division manner used by the coding unit in the coding process is written into the code stream, and is used for reconstructing a video image in the subsequent decoding process. The increased division will inevitably increase the number of division bits used for recording. The encoder is sensitive to the increase of the number of the dividing bits, and the encoding performance is necessarily reduced by increasing the recording information too much. In order to more effectively record the partition information and improve the encoding performance, referring to fig. 4, the video encoding method in this application further includes:

step S410, generating identification information corresponding to the coding units based on the division mode of the coding units;

step S420, generating recording information according to the identification information corresponding to each coding unit contained in the video frame to be coded and the coding sequence of each coding unit;

and step S430, adding the recording information to the encoding result of the video frame.

These steps are described in detail below.

In step S410, identification information corresponding to the coding unit is generated based on the division manner of the coding unit.

As mentioned above, the partition manner of the coding unit may include QT, BT, EQT, no-split (Non-split) and the partition manner of the coding unit adopted in the video coding method in the present application, and for convenience of description, the partition manner of the coding unit adopted in the video coding method in the present application is referred to as Extended H-shape Partitioning (EHP).

The identification information corresponding to the coding unit may be generated by using a name of a division manner of the coding unit as the identification information according to the division manner of the coding unit, for example, if a quadtree division manner is adopted for the coding unit, the identification information corresponding to the coding unit is obtained as "QT".

In step S420, record information is generated according to the identification information corresponding to each coding unit included in the video frame to be coded and the coding sequence of each coding unit.

After the identification information corresponding to the coding units is generated, record information is generated according to the coding order of each coding unit, which may be specifically shown in table 1 below, where the coding order of each coding unit may be to first determine whether the current coding unit uses QT partition, and if the QT partition is used, the recording is stopped, and the identification information corresponding to the current coding unit is "QT"; if the QT partition mode is not used, judging whether the current coding unit uses other partition modes, if not, stopping recording, and the identification information corresponding to the current coding unit is 'QT/SPLIT'; if the current coding unit uses the division mode, firstly judging whether the coding unit is divided in the vertical direction or the horizontal direction, judging whether the EHP division is used, if the EHP division is used, stopping recording, wherein the identification information corresponding to the current coding unit is 'CP/SPLIT/Ver/EHP', and if the EHP division is not used, judging whether the EQT division or the BT division is used.

TABLE 1 recorded information corresponding to the partition modes of different coding units

Dividing method Recording 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

In an embodiment of the present application, as shown in fig. 6, there is further provided a video decoding method, specifically including:

step S610, acquiring coded data to be decoded;

step S620, dividing a decoding unit in the encoded data by using parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is equal in 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 which are equal in size by using H-shaped line segments intersected with the parallel line segments;

step S630, decoding the encoded data based on the division result of the decoding unit to obtain a corresponding decoded video frame.

These steps are described in detail below.

In step S610, encoded data to be decoded is acquired.

In step S620, the decoding unit in the encoded data is divided by parallel lines to obtain a first rectangular block and a third rectangular block with equal sizes and a second rectangular block with equal 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 with equal sizes by H-shaped line segments intersecting the parallel line segments.

In the embodiment of the present application, the decoding unit is divided by parallel lines to obtain three rectangular blocks, which are a first rectangular block, a second rectangular block and a third rectangular block, wherein the first rectangular block and the third rectangular block have the same size, and the sum of the sizes of the first rectangular block and the third rectangular block is equal to that of the second rectangular block.

In an embodiment of the present application, after obtaining encoded data to be decoded, before dividing a decoding unit in the encoded data by using a parallel line, identification information corresponding to a dividing manner adopted when the encoding unit is encoded may also be obtained from the encoded data, and in this embodiment, as shown in fig. 7, the method further includes:

step S710, acquiring identification information corresponding to a division mode adopted when the coding unit is coded from the coded data;

and step S720, if the identification information is the designated identification information, dividing decoding units in the coded data by using parallel lines.

In step S710, as described above, the identification information is information corresponding to the partition method used when the coding unit is coded, for example, when the coding unit is divided into quadtree partitions, the identification information of the coding unit is "QT".

In step S720, the designated identification information indicates that the partition manner of the coding unit corresponding to the identification information is the coding unit partition manner adopted in the video coding method of the present application, and therefore, when the acquired identification information is the designated identification information, the decoding unit in the coded data is partitioned by using the parallel lines to obtain a first rectangular block and a third rectangular block which are equal in size and a second rectangular block which is equal in size to the sum of the sizes of the first rectangular block and the third rectangular block, the second rectangular block is partitioned into a plurality of rectangular blocks which are equal in size by using H-shaped line segments intersecting with the parallel line segments, and the coded data is decoded based on the partition result of the decoding unit to obtain a corresponding decoded video frame.

With reference to fig. 6, in step S630, the encoded data is decoded based on the division result of the decoding unit, so as to obtain a corresponding decoded video frame.

The following describes embodiments of the apparatus of the present application, which can be used to perform the video encoding method in the above-described embodiments of the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the image processing method described above in the present application.

Fig. 8 is a block diagram illustrating a video encoding apparatus according to an embodiment of the present application, and referring to fig. 8, a video encoding apparatus 800 according to an embodiment of the present application includes: a first acquisition unit 802, a first dividing unit 804 and an encoding unit 806.

The first obtaining unit 802 is configured to obtain a video frame to be encoded; a first dividing unit 804, configured to divide the coding unit in the video frame by using parallel lines to obtain a first rectangular block and a third rectangular block that are equal in size, and a second rectangular block that is equal in size to a sum of the first rectangular block and the third rectangular block, and divide the second rectangular block into a plurality of rectangular blocks that are equal in size by using H-shaped line segments that intersect with the parallel line segments; an encoding unit 806, configured to perform encoding processing on the video frame based on a division result of the encoding unit.

In some embodiments of the 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.

In some embodiments of the present application, the first dividing unit 804 is configured to: the coding unit is divided by parallel line segments in the horizontal direction, or divided by parallel line segments in the vertical direction.

In some embodiments of the present application, the video encoding device further comprises: and the third dividing unit is used for dividing the rectangular blocks with the size meeting the preset threshold value in the dividing result of the coding unit by adopting a binary tree or expanded quadtree dividing method.

In some embodiments of the present application, the first dividing unit 804 is configured to: dividing coding units in the video frames by adopting a binary tree or extended quadtree division method to obtain division results of the coding units; and dividing the division result of the coding unit by using the parallel lines.

In some embodiments of the present application, the video encoding device further comprises: a first generating unit configured to generate identification information corresponding to the coding unit based on a manner of dividing the coding unit; the second generating unit is used for generating recording information according to the identification information corresponding to each coding unit contained in the video frame to be coded and the coding sequence of each coding unit; an adding unit configured to add the recording information to an encoding result of the video frame.

Fig. 9 shows a block diagram of an image processing apparatus according to an embodiment of the present application.

Referring to fig. 9, a communication processing apparatus 900 according to an embodiment of the present application includes: a second acquisition unit 902, a second dividing unit 904 and a decoding unit 906.

The second obtaining unit 902 is configured to obtain encoded data to be decoded; a second dividing unit 904, configured to divide the decoding unit in the encoded data by using parallel lines to obtain a first rectangular block and a third rectangular block that are equal in size, and a second rectangular block that is equal in size to a sum of the first rectangular block and the third rectangular block, and divide the second rectangular block into a plurality of rectangular blocks that are equal in size by using H-shaped line segments that intersect with the parallel line segments; a decoding unit 906, configured to perform decoding processing on the encoded data based on the division result of the decoding unit, so as to obtain a corresponding decoded video frame.

In some embodiments of the present application, based on the foregoing scheme, after the second obtaining unit 902 is configured to obtain the encoded data to be decoded, and before the second dividing unit 904 is configured to divide the decoding unit in the encoded data by using parallel lines, the video decoding apparatus further includes: acquiring identification information corresponding to a division mode adopted when a coding unit is coded from the coded data; and if the identification information is the designated identification information, dividing decoding units in the coded data by using parallel lines.

FIG. 10 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.

It should be noted that the computer system 1000 of the electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.

As shown in fig. 10, the computer system 1000 includes a Central Processing Unit (CPU)1001 that can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1002 or a program loaded from a storage portion 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other via a bus 1004. An Input/Output (I/O) interface 1005 is also connected to the bus 1004.

The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output section 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 1008 including a hard disk and the like; and a communication section 1009 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The driver 1010 is also connected to the I/O interface 1005 as necessary. A removable medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1010 as necessary, so that a computer program read out therefrom is mounted into the storage section 1008 as necessary.

In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication part 1009 and/or installed from the 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.

It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied 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 foregoing.

The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.

As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.

It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.

Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments 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 disk, a removable 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 embodiments of the present application.

Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.

It will be understood that the present application is not limited to the precise arrangements 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 application is limited only by the appended claims.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:视频编码方法、视频解码方法及相关设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类