Encoding method, apparatus, and storage medium of video data

By determining the target pixel as the partitioning point in the coding unit of video data, and flexibly partitioning the coding unit according to the rate-distortion cost, the problem of limited coding unit partitioning types in the prior art is solved, image distortion is reduced and coding efficiency is improved.

CN116471420BActive Publication Date: 2026-11-24BEIJING VIMICRO ARTIFICIAL INTELLIGENCE CHIP TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310295192.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2026-11-24
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

The limited number of coding unit types in existing video coding standards makes it difficult to determine a suitable reference image during predictive coding, resulting in greater distortion of the compressed image.

Method used

By determining the target pixel as the dividing point in the first coding unit of the video data and dividing it into the second coding unit, the rate-distortion cost of the target coding unit division method meets the specified conditions, and the first coding unit is encoded in this way to achieve pixel-level division.

Benefits of technology

It improves the flexibility of coding unit partitioning, reduces image distortion caused by coding unit partitioning, and improves coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471420B_ABST
    Figure CN116471420B_ABST
Patent Text Reader

Abstract

This specification provides a method, apparatus, electronic device, and storage medium for encoding video data. The method includes: determining, among a plurality of pixels comprising a first encoding unit of the video data, a target pixel for dividing the first encoding unit into a second encoding unit, such that the rate-distortion cost of the target encoding unit division method corresponding to the target pixel meets specified conditions; wherein the size of the second encoding unit is equal to or smaller than the first encoding unit; and encoding the first encoding unit using the target encoding unit division method. Through the embodiments described in this specification, pixel-level division of encoding units is achieved, solving the problems of limited encoding unit division methods and high image distortion, thereby improving the flexibility of encoding unit division methods while reducing image distortion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments described in this specification relate to the field of video coding technology, and in particular to a method, apparatus, electronic device, and storage medium for encoding video data. Background Technology

[0002] To improve the efficiency of video data compression coding, video frames need to be divided into multiple coding tree units, and then these coding tree units are further divided to form coding units. Currently, the High Efficiency Video Coding (HEVC), Versatile Video Coding (VVC), and Moving Picture Experts Group-5 Essential Video Coding (MPEG-5 EVC) standards, all developed by international video coding standards organizations, only support tree-structured coding unit division, and the supported division types are very limited. However, applying the division types supported by existing video coding standards to divide coding units will make it difficult to determine suitable reference images during predictive coding, further leading to significant image distortion after compression coding.

[0003] Therefore, existing video coding standards have technical problems such as limited supported coding unit division types, inability to meet actual division needs, and significant image distortion. Summary of the Invention

[0004] This specification provides a method, apparatus, electronic device, and storage medium for encoding video data through various embodiments, thereby enhancing the encoding flexibility of encoding units in video data.

[0005] One embodiment of this specification provides a video data encoding method, the method comprising: determining, among a plurality of pixels included in a first encoding unit of the video data, a target pixel for dividing the first encoding unit into a second encoding unit as a dividing point, such that the rate-distortion cost of the target encoding unit division method corresponding to the target pixel meets a specified condition; wherein the size of the second encoding unit is equal to or smaller than the first encoding unit; and encoding the first encoding unit according to the target encoding unit division method.

[0006] One embodiment of this specification provides a video data encoding apparatus, the apparatus comprising: a determining module, configured to determine, among a plurality of pixels included in a first encoding unit of the video data, a target pixel for dividing the first encoding unit into a second encoding unit as a dividing point, such that the rate-distortion cost of the target encoding unit division method corresponding to the target pixel meets a specified condition; wherein the size of the second encoding unit is equal to or smaller than that of the first encoding unit; and an encoding module, configured to encode the first encoding unit according to the target encoding unit division method.

[0007] One embodiment of this specification provides an electronic device, the electronic device including a memory and a processor, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor to implement the video data encoding method described above.

[0008] One embodiment of this specification provides a computer-readable storage medium storing at least one computer program that, when executed by a processor, can implement the video data encoding method described above.

[0009] The various embodiments provided in this specification divide the first coding unit into second coding units by using a target pixel determined among the multiple pixels included in the first coding unit of the video data as a dividing point, so that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets the specified conditions, and then encodes the first coding unit according to the target coding unit division method. This realizes pixel-level division of the coding unit based on the actual image information contained in the coding unit, which improves the flexibility of the coding unit division method and reduces the image distortion caused by the division of the coding unit. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments in this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0011] Figure 1 This diagram illustrates the classification of coding units supported by the existing VVC standard.

[0012] Figure 2 This is a flowchart illustrating a video data encoding method provided as one embodiment of this specification.

[0013] Figure 3This is a schematic diagram of the encoding unit division of a video data encoding method provided in one embodiment of this specification.

[0014] Figure 4 This is a schematic diagram of a video data encoding device provided for one embodiment of this specification.

[0015] Figure 5 This is a schematic block diagram of an electronic device provided for one embodiment of this specification. Detailed Implementation

[0016] The technical solutions in the embodiments provided in this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments, and not all of the embodiments. Based on the embodiments provided in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0017] Please see Figure 1 In the VVC standard, the supported coding unit partitioning types include: First, the coding tree unit is partitioned into a quadtree (QT) to obtain the coding unit (CU). Then, one of the following partitioning methods is selected: horizontal binary tree (H-BT), vertical binary tree (V-BT), horizontal ternary tree (H-TT), vertical ternary tree (V-TT), or quadtree partitioning, to further partition the coding unit or not partition it. The partitioning of the coding unit can be iterated until no further partitioning is required. That is, the VVC standard only supports one partitioning type for the coding tree unit: quadtree partitioning, and for the coding unit, it supports six partitioning types: horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, vertical ternary tree partitioning, quadtree partitioning, and no partitioning.

[0018] Therefore, when using the VVC standard for video data compression encoding, only one or more of the above 7 partitioning types can be selected to divide the coding unit. It is impossible to flexibly divide the coding unit according to the image information contained in the coding unit. Consequently, it is difficult to achieve a good match with the reference image during predictive coding, resulting in high distortion of the encoded image.

[0019] Therefore, it is necessary to provide a video data encoding method and apparatus that can flexibly divide the encoding units according to the image information contained in the encoding units, thereby reducing the image distortion caused by the division of encoding units to a certain extent.

[0020] The video data encoding method provided in the embodiments of this specification is applied to an encoder. The encoder can be used to convert a file in an original video format into another video format file according to a video compression encoding algorithm, to generate a bitstream that conforms to a video standard, enabling a decoder applying the corresponding video standard to decode it.

[0021] Please see Figure 2 One embodiment of this specification provides a method for encoding video data. This encoding method may include the following steps.

[0022] S110: Among the multiple pixels included in the first coding unit of the video data, a target pixel is used as a dividing point to divide the first coding unit into a second coding unit, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets the specified conditions; wherein, the size of the second coding unit is equal to or smaller than the first coding unit.

[0023] In this embodiment, the pixels included in the coding unit can be used as dividing points to divide the coding unit, thus achieving pixel-level division of the coding unit.

[0024] In this embodiment, the video data may include a data stream formed by image data. The data stream may contain multiple frame images. In some embodiments, a frame image may be divided into multiple coding blocks, each coding block being a coding unit; alternatively, each frame image may be divided into multiple non-overlapping coding tree units; or a frame image may be treated as a single coding unit.

[0025] In this embodiment, the first coding unit can be used to represent a coding unit that needs to be divided. Specifically, for example, the first coding unit can be a coding tree unit, or a coding unit formed by dividing a coding tree unit. The embodiments of this specification do not impose specific limitations on the division level of the first coding unit. The shape of the first coding unit can be rectangular or square, or other regular shapes, or irregular shapes. The embodiments of this specification do not impose specific limitations on the shape of the first coding unit.

[0026] In this embodiment, the second coding unit can be used to represent the first coding unit or a coding subunit formed by dividing the first coding unit. Specifically, when the size of the second coding unit is equal to that of the first coding unit, the first coding unit does not need to be divided, and the second coding unit represents the first coding unit. When the size of the second coding unit is smaller than that of the first coding unit, the second coding unit represents a coding subunit formed by dividing the first coding unit. The shape of the second coding unit can be rectangular or square, or other regular shapes, or irregular shapes. The embodiments in this specification do not impose specific limitations on the shape of the second coding unit.

[0027] In this embodiment, a target pixel can refer to a pixel used as a dividing point to divide the coding unit. The number of target pixels can be one or more.

[0028] In this embodiment, the coding unit partitioning method can be used to represent a partitioning method in which any pixel included in the coding unit is used as a partitioning point to divide the coding unit. Specifically, for example, after determining a pixel as a partitioning point, the coding unit partitioning method corresponding to that pixel can be to divide the coding unit along mutually perpendicular directions that are parallel to the edges of the coding unit, using that partitioning point.

[0029] Based on the distribution of the target pixels that serve as the dividing points within the coding unit, the coding unit can be divided in the following three ways.

[0030] When the target pixel used as the partition point is located at the endpoint of the coding unit, the corresponding coding unit partitioning method is no partitioning. When the target pixel used as the partition point is located at the edge of the coding unit, the corresponding coding unit partitioning method is to divide the coding unit into 2 coding sub-units along a direction perpendicular to the edge of the coding unit. When the target pixel used as the partition point is located inside the coding unit, the corresponding coding unit partitioning method is to divide the coding unit into 4 coding sub-units along mutually perpendicular directions that are parallel to the edges of the coding unit.

[0031] In some implementations, after determining a target pixel as a dividing point, the coding unit corresponding to the target pixel can be divided according to the extension direction of the line connecting the target pixel and one endpoint of the coding unit. Alternatively, the coding unit can be divided according to any irregular curve passing through the target pixel.

[0032] In this embodiment, rate-distortion cost can be used to represent the correlation between video data bitrate and image distortion. Rate-distortion cost meeting specified conditions may include the rate-distortion cost being within a specified numerical range. It may also include the rate-distortion cost being within a specified sequence after being sorted according to specified rules. Furthermore, it may include the rate-distortion cost being within the filtered results output after being filtered by a specified algorithm.

[0033] In this embodiment, a target pixel is determined as a dividing point to divide the first coding unit into the second coding unit, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets the specified conditions. This can be achieved by a full pixel search method, that is, traversing all pixels included in the first coding unit, using each pixel included in the first coding unit as a dividing point, calculating the rate-distortion cost of the coding unit division method corresponding to that pixel, and then determining the rate-distortion cost that meets the specified conditions among all the calculated rate-distortion costs, thereby determining the target coding unit division method and the corresponding target pixel.

[0034] The full-pixel search method can most accurately obtain the target coding unit partitioning method and the corresponding target pixels, but it requires traversing all pixels included in the first coding unit, resulting in a large computational load. To reduce the computational load, in some implementations, target pixels are determined as partitioning points to divide the first coding unit into the second coding unit, such that the rate-distortion cost of the target coding unit partitioning method corresponding to the target pixel meets specified conditions. In some implementations, a pixel block fusion method can also be used, that is, the first coding unit is first divided into multiple pixel blocks, and then a fusion algorithm is used to fuse similar adjacent pixel blocks. This fusion process is repeated until the coding unit partitioning method formed by the pixel block fusion result is close to the coding unit partitioning method determined by the full-pixel search method. Thus, the coding unit partitioning method formed by the pixel block fusion result is determined as the target coding unit partitioning method, and then the target pixels corresponding to the target coding unit partitioning method are determined.

[0035] S120: Encode the first coding unit according to the target coding unit division method.

[0036] In this embodiment, the first coding unit can be encoded according to the target coding unit division method corresponding to the target pixel.

[0037] In this embodiment, the encoding process may include inputting information describing the target coding unit partitioning method and the first coding unit into the encoder. Specifically, for example, the information describing the target coding unit partitioning method may include pixel position information of the target pixel, or other data that can represent the pixel position of the target pixel.

[0038] In the embodiments of this specification, by determining a target pixel among the multiple pixels included in the first coding unit of the video data as a dividing point to divide the first coding unit into a second coding unit, the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets the specified conditions; the first coding unit is encoded using the target coding unit division method, thereby realizing pixel-level division of the coding unit according to the actual image information contained in the coding unit, which improves the flexibility of the coding unit division method while reducing the image distortion caused by the division of the coding unit.

[0039] Please see Figure 3 This specification provides an example of coding unit partitioning for a video data encoding method, using one embodiment. Black dots represent pixels used as partitioning points. The initial coding unit, before partitioning, has a size of 128×128. This initial coding unit is partitioned three times, resulting in eight coding units of different sizes. The three partitioning processes are as follows.

[0040] First division: Using D1 as the division point, the initial coding unit with a size of 128×128 is divided into four coding sub-units with sizes of 80×32, 48×32, 48×96 and 80×96 respectively.

[0041] Second division: Using D2 as the division point, the 80×96 coding unit is divided into four coding sub-units with sizes of 16×66, 16×30, 64×30, and 64×66 respectively.

[0042] The third division: Using D3 as the dividing point, the 64×66 coding unit is divided into two coding sub-units with sizes of 40×66 and 24×66 respectively.

[0043] In some implementations, representative pixel location information sets are provided for different coding unit sizes; wherein, the representative pixel location information set includes multiple representative pixel location information, which are used to represent the position of the representative pixel; the number of representative pixels represented by the representative pixel location information in the representative pixel location information set corresponding to the coding unit size is less than the number of pixels represented by the coding unit size; among the multiple pixels included in the first coding unit of the video data, a target pixel is determined as a dividing point to divide the first coding unit into a second coding unit, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets a specified condition, which may include: obtaining a target representative pixel location information set corresponding to the first coding unit according to the coding unit size of the first coding unit; determining the target pixel among the representative pixels represented by the representative pixel location information included in the target representative pixel location information set, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets a specified condition.

[0044] When using the full-pixel search method to determine the target pixel and its corresponding target coding unit partitioning method, the computational load is extremely high because it requires traversing all pixels included in the first coding unit. To reduce the computational load of the full-pixel search method, the pixel range searched by this method can be reduced. In this embodiment, the pixel range searched by this method can be reduced from all pixels included in the first coding unit to the representative pixel position information set corresponding to the coding unit size of the first coding unit, including the representative pixels represented by the representative pixel position information.

[0045] In this embodiment, the coding unit size can be used to represent the number of columns and rows of the pixel array that makes up the coding unit, as well as the number of pixels that make up the coding unit. Specifically, for example, the coding unit is rectangular in shape and the coding unit size is 128×128, that is, the number of columns and rows of the pixel array that makes up the coding unit is 128, and the number of pixels that make up the coding unit is 16384.

[0046] In this embodiment, the representative pixel can be used to represent multiple pixels selected from all pixels constituting the coding unit according to certain conditions. Specifically, for example, multiple pixels can be selected from all pixels constituting the coding unit using a fuzzy algorithm, provided that the distortion meets certain conditions. Alternatively, multiple pixels can be selected from all pixels constituting the coding unit according to a preset percentage. For example, 50% of the pixels constituting the coding unit can be randomly selected as the representative pixel. The preset percentage can be a factory setting or a user-defined setting. The embodiments described in this specification do not impose specific limitations on the preset percentage.

[0047] In this embodiment, the position of a representative pixel can be used to represent the position of the representative pixel in a specified coordinate system. The representative pixel position information can include the coordinate information of the representative pixel in the specified coordinate system. Specifically, for example, the specified coordinate system can refer to a pixel coordinate system. The pixel coordinate system can be a Cartesian coordinate system with its origin located at the upper left corner of the encoding unit, and its unit of measurement being pixels. The first coordinate axis of this coordinate system can extend in the direction of increasing column number of the pixel array constituting the encoding unit. The second coordinate axis of this coordinate system can extend in the direction of increasing row number of the pixel array constituting the encoding unit.

[0048] In this embodiment, the target representative pixel position information set corresponding to the first coding unit is obtained by determining the coding unit size of the first coding unit based on the number of rows and columns of the pixel array that makes up the first coding unit, and then determining the target representative pixel position information set corresponding to the first coding unit based on the geometric correspondence between the coding unit size and the representative pixel position information.

[0049] In this embodiment, there is a one-to-one correspondence between the representative pixel location information and the representative pixel. The target pixel can be determined using a full-pixel search method. This involves traversing the representative pixels represented by the representative pixel location information in the target representative pixel location information set, using each representative pixel as a dividing point, calculating the rate-distortion cost of the coding unit partitioning method corresponding to that representative pixel, and then determining the rate-distortion cost that meets the specified conditions from all the calculated rate-distortion costs. This process thus determines the target coding unit partitioning method and the corresponding target pixel.

[0050] The corresponding representative pixel is determined based on the coding unit size of the first coding unit. The target pixel and the corresponding target coding unit partitioning method are determined by the full pixel search method among the representative pixels. While retaining the high accuracy of the full pixel search method, the computational load of the method is reduced to a certain extent, and the computational efficiency is improved.

[0051] In some embodiments, the video data encoding method may further include: dividing encoding units of different encoding unit sizes into multiple pixel modules; wherein, the pixel module includes multiple pixels; determining representative pixel position information in each pixel module to characterize the representative pixel of the pixel module; wherein, the number of representative pixels in each pixel module is less than the number of pixels included in the pixel module.

[0052] In this embodiment, the encoding unit is divided into multiple pixel modules, and then a representative pixel is determined among the multiple pixels included in the pixel module to reduce the number of representative pixels.

[0053] In this embodiment, a pixel module can refer to a pixel block with a preset size. Specifically, for example, a pixel module can be a 4×4 pixel block. The preset size can be a factory setting or a user-defined setting. The embodiments in this specification do not impose specific limitations on the preset size.

[0054] In this embodiment, encoding units of different sizes can be divided into multiple pixel modules. Specifically, a preset pixel module size can be set for any encoding unit size. After obtaining the encoding unit, the corresponding preset pixel module size is determined based on the encoding unit size, and then the encoding unit is divided into multiple pixel modules based on the preset pixel module size. For example, when the encoding unit size is 128×128, the corresponding preset pixel module size is 8×8. That is, an encoding unit with a size of 128×128 can be divided into 256 pixel modules with a size of 8×8.

[0055] In this embodiment, representative pixel position information for representing representative pixels of the pixel module can be determined separately within each pixel module. Specifically, specified conditions can be set according to the size of the pixel module, and representative pixels can be selected from all pixels included in the pixel module according to the specified conditions, thereby determining the representative pixel position information. The specified conditions may include the number of representative pixels in each pixel module and the position of the representative pixels in the pixel module. For example, when the size of the pixel module is 8×8, the specified condition is that the pixel module can include 4 representative pixels, and each representative pixel is located at the endpoint of the pixel module. Then, the representative pixel position information can be determined as the coordinate information of the endpoint of the pixel module in the pixel coordinate system of the encoding unit.

[0056] By determining the representative pixel and its corresponding position information from the multiple pixels included in the pixel module, and then updating the set of representative pixel position information corresponding to the coding unit size with the obtained representative pixel position information, the number of representative pixels represented by the representative pixel position information included in the set of representative pixel position information is reduced, further reducing the pixel range searched by the full pixel search method and improving the computational efficiency to a greater extent.

[0057] In some implementations, codebooks are provided for different coding unit sizes; wherein the codebooks include corresponding recorded pixel position information and coding values; wherein the number of bits in the coding value is less than the number of bits in the pixel position information; encoding the first coding unit according to the target coding division method may include: matching the target coding value corresponding to the target pixel based on the pixel position information of the target pixel in the codebook corresponding to the coding unit size of the first coding unit; and inputting the target coding value and the first coding unit together into the encoder.

[0058] When the pixel position information value of the target pixel is large, the pixel position information occupies a lot of bits, which may lead to a decrease in encoding efficiency. In order to reduce the number of bits occupied by the pixel position information, in this embodiment, the pixel position information that occupies a lot of bits is converted into an encoded value that occupies fewer bits through the codebook, and then the encoded value is encoded.

[0059] In this embodiment, the codebook can be used to record pixel position information and encoded values ​​according to a specified association relationship. Pixel position information can be the coordinate information of a pixel in the pixel coordinate system of the encoding unit. A codebook is set for each encoding unit size. Specifically, for example, in the codebook corresponding to an encoding unit size of 128×128, pixel position information (64,64) corresponds to encoded value 0, pixel position information (64,0) corresponds to encoded value 1, pixel position information (0,64) corresponds to encoded value 2, pixel position information (0,0) corresponds to encoded value 3, pixel position information (0,32) corresponds to encoded value 4, pixel position information (0,96) corresponds to encoded value 5, pixel position information (32,0) corresponds to encoded value 6, and pixel position information (96,0) corresponds to encoded value 7.

[0060] In this embodiment, the target encoding value corresponding to the target pixel can be obtained by matching the pixel position information of the target pixel in the codebook corresponding to the encoding unit size of the first encoding unit. Specifically, after determining the target pixel of the first encoding unit, the coordinate information of the target pixel in the pixel coordinate system of the first encoding unit can be obtained, and then the coordinate information can be compared with the pixel position information in the codebook corresponding to the encoding unit size of the first encoding unit. If the coordinate information is the same as a pixel position information in the codebook, then the encoding value recorded corresponding to that pixel position information is the target encoding value corresponding to the target pixel. For example, if the encoding unit size of the first encoding unit is 128×128 and the coordinate information of the target pixel is (0,32), then the target encoding value corresponding to the target pixel is 4.

[0061] In this embodiment, after obtaining the target encoding value corresponding to the target pixel, the target encoding value and the first encoding unit can be used together as input data to the encoder for encoding processing.

[0062] By converting the pixel position information of the target pixel into a target encoded value, the number of bits used to describe the position of the target pixel is reduced, which improves the encoding efficiency to some extent.

[0063] In some implementations, the video data encoding method may further include: if a target encoding value corresponding to the target pixel cannot be obtained by matching the pixel position information of the target pixel in the codebook corresponding to the encoding unit size of the first encoding unit, generating the target encoding value corresponding to the target pixel by a specified algorithm based on the pixel position information of the target pixel.

[0064] In this embodiment, the inability to match the target pixel's corresponding target encoding value based on the target pixel's pixel position information in the codebook corresponding to the encoding unit size of the first encoding unit may include the absence of pixel position information with the same coordinate information as the target pixel recorded in the codebook corresponding to the encoding unit size of the first encoding unit. Specifically, for example, if the encoding unit size of the first encoding unit is 128×128, and the target pixel's coordinate information is (36, 64), and the codebook does not record the encoding value corresponding to the pixel position information of (36, 64), then the target pixel matching fails, and the target encoding value cannot be determined based on the codebook.

[0065] In this embodiment, the specified algorithm can be used to establish the mapping relationship between the pixel position information of the target pixel and the target encoded value. The specified algorithm can be a factory-set algorithm or a user-defined algorithm. The specified algorithm can be related to the coding unit size or not. The embodiments in this specification do not impose specific limitations on the specified algorithm.

[0066] In this embodiment, the target encoding value corresponding to the target pixel can be generated based on the pixel position information of the target pixel using a specified algorithm. Specifically, the specified algorithm can be related to the encoding unit size, that is, the first coordinate value and the second coordinate value of the target pixel's coordinate information are subjected to specified operations according to a preset value corresponding to the encoding unit size to obtain the target encoding value. For example, if the encoding unit size of the first encoding unit is 128×128, the corresponding preset value is 4, and the coordinate information of the target pixel is (36, 64), the specified operation is as follows: first, divide the first coordinate value and the second coordinate value by the preset value, respectively, and the results are 9 and 16; then, divide the encoding unit size value by the preset value, and the results are 32 and 32; then, multiply the results of the first and second operations, respectively, and the results are 288 and 512; finally, add the results obtained in the third operation to obtain the final target encoding value of 800.

[0067] If the pixel position information of the target pixel fails to match the codebook, a target encoded value is generated by a specified algorithm to reduce the number of bits used to describe the position of the target pixel, thereby improving the encoding efficiency to some extent.

[0068] In some implementations, encoding the first coding unit according to the target coding unit division method may include: if the target coding value corresponding to the target pixel cannot be obtained by matching the pixel position information of the target pixel in the codebook corresponding to the coding unit size of the first coding unit, the pixel position information of the target pixel is input into the encoder together with the first coding unit.

[0069] If the pixel position information of the target pixel fails to match the codebook, the pixel position information of the target pixel is directly used as input data and input into the encoder together with the first encoding unit. This achieves the most accurate description of the target pixel position and reduces the possibility of decoding failure.

[0070] In some embodiments, the video data encoding method may further include: for any given encoding unit size, calculating the probability value of dividing the encoding unit by using multiple pixels belonging to the encoding unit size as dividing points; establishing a correspondence between the probability value and the pixel position information of the pixel; establishing a specified association between the pixel position information and the encoded value based on the correspondence between the probability value and the pixel position information; and recording the pixel position information and the encoded value into a codebook corresponding to the encoding unit size according to the specified association.

[0071] In this embodiment, for any given coding unit size, the probability value of using multiple pixels belonging to that coding unit size as partitioning points to divide the coding unit can be calculated. Specifically, for any given coding unit size, a large number of historical coding units belonging to that coding unit size can be used to train a machine learning model to obtain the probability value of using any pixel belonging to that coding unit size as a partitioning point to divide the coding unit.

[0072] In this embodiment, a correspondence can be established between the probability value and the pixel position information of the pixel. Specifically, the pixel position information of any pixel can correspond to a probability value, and a probability value can correspond to the pixel position information of one or more pixels.

[0073] In this embodiment, a specified association between the pixel location information and the encoded value can be established based on the correspondence between the probability value and the pixel location information of the pixel. Specifically, the specified association may include a larger probability value, with a smaller encoded value associated with the pixel location information corresponding to that probability value. Alternatively, the probability values ​​can be sorted from largest to smallest, and then the specified association between the pixel location information and the encoded value can be established based on the sorted probability values. Specifically, the specified association may include a larger probability value, with a smaller encoded value associated with the pixel location information corresponding to that probability value.

[0074] In this embodiment, pixel position information and encoded values ​​that have a specified association with pixel position information can be recorded together in a codebook of the corresponding encoding unit size.

[0075] By establishing the relationship between the probability value of any pixel as a dividing point for dividing coding units, the pixel position information of that pixel, and the coding value, the coding value associated with the pixel position information corresponding to the larger the probability value is is smaller, and the smaller the coding value is, the fewer bits it occupies. This allows the pixel position information of pixels more likely to be dividing points to be described with fewer bits, thus achieving a reasonable codebook.

[0076] In some implementations, the video data encoding method may further include: filtering the probability values ​​according to a specified numerical range; and establishing a correspondence between the filtered probability values ​​and the pixel position information of the pixels.

[0077] In this embodiment, the probability values ​​can be filtered according to a specified numerical range. Specifically, probability values ​​within a specified data range can be retained, while probability values ​​outside the specified data range can be discarded. For example, the specified numerical range may include values ​​greater than or equal to 0.1.

[0078] In this embodiment, a correspondence can be established between the filtered probability values ​​and the pixel position information of the pixels. Specifically, the pixel position information corresponding to the probability values ​​within a specified data range can be retained.

[0079] By discarding excessively small probability values ​​and their corresponding pixel position information, the storage space required to store the codebook is reduced, thereby improving the usability of the codebook.

[0080] In some embodiments, the video data encoding method may further include: obtaining neighboring encoding units of the first encoding unit; wherein the neighboring encoding units include at least one of the following: an encoding unit located in the same image frame as the first encoding unit and adjacent to the position of the first encoding unit and whose target pixel has been determined; an encoding unit located in a different image frame as the first encoding unit and adjacent to the position of the first encoding unit and whose target pixel has been determined; using the pixel position information of the target pixel of the neighboring encoding units, optimizing the codebook corresponding to the encoding unit size of the first encoding unit by a specified algorithm.

[0081] In this embodiment, adjacent coding units of the first coding unit can be obtained. Specifically, adjacent coding units may include coding units located in the same image frame as the first coding unit, adjacent to the first coding unit in position, and whose target pixel has been determined. Adjacent coding units may also include coding units located in different image frames as the first coding unit, adjacent to the first coding unit in position, and whose target pixel has been determined. For example, when adjacent coding units and the first coding unit are located in the same image frame, the adjacent coding units and the first coding unit can be described in the same coordinate system. This coordinate system can be the pixel coordinate system of the image frame, with the upper left corner of the image frame as the origin and pixels as the unit. The first coordinate axis of this coordinate system can extend in the direction of increasing column number of the pixel array constituting the image frame. The second coordinate axis of this coordinate system can extend in the direction of increasing row number of the pixel array constituting the image frame. The two coordinate axes can be used to represent the encoding order of the image frame in two different directions. Each row of coding units can be processed row by row according to the direction pointed to by the second coordinate axis. When processing each row of coding units, each column of coding units is processed one by one according to the direction pointed to by the first coordinate axis. For example, if the first coordinate axis points to the right and the second coordinate axis points downward, then adjacent coding units can be the coding unit to the left and the coding unit above the first coding unit.

[0082] In this embodiment, the pixel position information of the target pixels of the adjacent coding units can be used to optimize the codebook corresponding to the coding unit size of the first coding unit using a specified algorithm. Specifically, if the coding unit size of the adjacent coding units is the same as that of the first coding unit, the coding value corresponding to the pixel position information of the target pixels of the adjacent coding units can be reduced in the codebook corresponding to the coding unit size. If the coding unit size of the adjacent coding units is different from that of the first coding unit, the codebook corresponding to the coding unit size of the first coding unit can be adjusted using a machine learning algorithm, so that the coding value corresponding to the pixel position information that is close to the pixel position information of the target pixels of the adjacent coding units is reduced.

[0083] By optimizing the codebook corresponding to the coding unit size of the first coding unit using the pixel position information of the target pixels of adjacent coding units, dynamic optimization of the codebook is achieved, further improving the usability of the codebook.

[0084] In some implementations, among the multiple pixels included in the first coding unit of the video data, a target pixel is determined as a dividing point to divide the first coding unit into a second coding unit, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets a specified condition. This may include: obtaining a reference coding unit; wherein the reference coding unit is a coding unit with the same coding unit size as the first coding unit and whose target pixel has been determined; using the target pixel of the reference coding unit as a reference pixel for the dividing point, calculating the predicted pixel position information of the target pixel of the first coding unit; and determining the target pixel of the first coding unit based on the predicted pixel position information.

[0085] In this embodiment, a reference coding unit can be obtained. The reference coding unit can be a coding unit with the same size as the first coding unit and whose target pixel has been determined. Specifically, the reference coding unit can be located in the same image frame as the first coding unit, or in a different image frame. The reference coding unit can be adjacent to the first coding unit, or not adjacent to it.

[0086] In this embodiment, the target pixel of the reference coding unit can be used as the reference pixel for the division point to calculate the predicted pixel position information of the target pixel of the first coding unit. Specifically, a large number of historical coding units with the same coding unit size as the first coding unit can be used as training data to train the prediction model. Then, the target pixel of the reference coding unit is used as the input of the prediction model, and the output value after the model operation is the predicted pixel position information of the target pixel of the first coding unit.

[0087] In this embodiment, the target pixel of the first coding unit can be determined based on the predicted pixel position information. Specifically, the rate-distortion cost of the coding unit partitioning method, which uses the pixel corresponding to the predicted pixel position information as the partitioning point to divide the first coding unit, can be calculated. If the rate-distortion cost meets the specified conditions, the pixel corresponding to the predicted pixel position information can be determined as the target pixel of the first coding unit.

[0088] The predicted pixel position information of the first coding unit is obtained based on the target pixel of the reference coding unit, and then the target pixel of the first coding unit is determined based on the predicted pixel position information. This reduces the amount of computation required to determine the target pixel of the first coding unit and greatly improves the computational efficiency.

[0089] In some implementations, encoding the first coding unit according to the target coding unit partitioning method may include: if the actual pixel position information of the target pixel of the first coding unit is the same as the predicted pixel position information, inputting the marker data and the first coding unit into the encoder; wherein, the marker data is used to indicate that the actual pixel position information of the target pixel of the first coding unit is the same as the predicted pixel position information.

[0090] In this embodiment, the marker data is used to indicate that the actual pixel position information of the target pixel in the first coding unit is the same as the predicted pixel position information, and it is not necessary to describe the position of the target pixel. Therefore, the number of bits occupied by the marker data can be very small. Specifically, for example, the marker data can occupy only 1 bit, that is, the marker data is 0 or 1.

[0091] By converting the pixel position information of the target pixel into marker data, the number of bits used to describe the position of the target pixel is reduced, which improves the coding efficiency to some extent.

[0092] In some implementations, encoding the first encoding unit according to the target encoding unit division method may include: inputting the pixel position information of the target pixel and the first encoding unit together into an encoder; or, generating a target encoding value corresponding to the target pixel based on the pixel position information of the target pixel using a specified algorithm; and inputting the target encoding value and the first encoding unit together into an encoder.

[0093] By directly using the pixel position information of the target pixel as input data and feeding it into the encoder along with the first encoding unit, the target pixel position can be described as accurately as possible, reducing the possibility of decoding failure. Furthermore, converting the pixel position information of the target pixel into a target encoded value reduces the number of bits used to describe the position of the target pixel, thus improving encoding efficiency to some extent.

[0094] Please see Figure 4 One embodiment of this specification also provides a video data encoding apparatus, which may include: a determining module 21, configured to determine, among a plurality of pixels included in a first encoding unit of the video data, a target pixel for dividing the first encoding unit into a second encoding unit as a dividing point, such that the rate-distortion cost of the target encoding unit division method corresponding to the target pixel meets a specified condition; wherein the size of the second encoding unit is equal to or smaller than that of the first encoding unit. An encoding module 22 is configured to encode the first encoding unit according to the target encoding unit division method.

[0095] The specific functions and effects of the device can be explained by referring to other embodiments in this specification, and will not be repeated here. Each module in the vehicle control device can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0096] Please see Figure 5 This specification also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the video data encoding method of any of the above embodiments.

[0097] The electronic device may include a processor connected to a system bus, a non-volatile storage medium, internal memory, a communication interface, a display device, and an input device. The non-volatile storage medium may store an operating system and related computer programs.

[0098] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the video data encoding method described in any of the above embodiments.

[0099] It is understood that the specific examples in this document are only intended to help those skilled in the art better understand the implementation methods of this specification, and are not intended to limit the scope of this application.

[0100] It is understood that in the various embodiments described in this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments described in this specification.

[0101] It is understood that the various implementation methods described in this specification can be implemented individually or in combination, and the implementation methods in this specification are not limited in this respect.

[0102] Unless otherwise stated, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0103] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0104] It is understood that the memory in the embodiments of this specification may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0105] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.

[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0107] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0109] In addition, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0110] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0111] The above description is merely a specific embodiment of this specification, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of encoding video data, characterized by, include: Among the multiple pixels included in the first coding unit of the video data, a target pixel is determined as a dividing point to divide the first coding unit into a second coding unit, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets a specified condition; wherein, the size of the second coding unit is equal to or smaller than the first coding unit; The target coding unit division method corresponding to the target pixel includes: when the target pixel is located at the endpoint of the first coding unit, the first coding unit is not divided; when the target pixel is located at the edge of the first coding unit, the first coding unit is divided into two second coding units along a direction perpendicular to the edge, with the target pixel as the dividing point; when the target pixel is located inside the first coding unit, the first coding unit is divided into four second coding units along mutually perpendicular directions that are parallel to the edges of the first coding unit, with the target pixel as the dividing point. The specified conditions include any one of the following: the rate distortion cost is within a specified numerical range, the rate distortion cost is within a specified sequence after being sorted according to specified rules, or the rate distortion cost is within the filtering results output after being filtered by a specified algorithm. The first coding unit is encoded according to the target coding unit division method.

2. The method according to claim 1, characterized in that, A set of representative pixel position information is set for each different coding unit size; wherein, the set of representative pixel position information includes multiple sets of representative pixel position information, which are used to represent the position of the representative pixel; the number of representative pixels represented by the representative pixel position information in the set of representative pixel position information corresponding to the coding unit size is less than the number of pixels represented by the coding unit size; the step of determining a target pixel to be used as a dividing point to divide the first coding unit into a second coding unit from among the multiple pixels included in the first coding unit of the video data, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets the specified conditions, includes: According to the size of the first coding unit, obtain the set of target representative pixel position information corresponding to the first coding unit; Among the representative pixels represented by the representative pixel position information included in the target representative pixel position information set, the target pixel is determined such that the rate-distortion cost of the target coding unit partitioning method corresponding to the target pixel meets the specified conditions.

3. The method according to claim 2, characterized in that, The method further includes: Encoding units of different sizes are divided into multiple pixel modules; wherein, each pixel module includes multiple pixels; Representative pixel position information for representing the representative pixels of each pixel module is determined; wherein the number of representative pixels in each pixel module is less than the number of pixels included in the pixel module.

4. The method according to claim 1, characterized in that, Codebooks are provided for different coding unit sizes; wherein, each codebook includes corresponding recorded pixel position information and coding values; wherein, the number of bits in the coding value is less than the number of bits in the pixel position information; the step of encoding the first coding unit according to the target coding division method includes: In the codebook corresponding to the size of the first coding unit, the target coding value corresponding to the target pixel is obtained by matching based on the pixel position information of the target pixel; The target encoded value and the first encoding unit are input into the encoder together.

5. The method according to claim 4, characterized in that, The method further includes: If the target encoding value corresponding to the target pixel cannot be obtained by matching the pixel position information of the target pixel in the codebook corresponding to the encoding unit size of the first encoding unit, the target encoding value corresponding to the target pixel is generated by a specified algorithm based on the pixel position information of the target pixel.

6. The method according to claim 4, characterized in that, The step of encoding the first coding unit according to the target coding unit partitioning method includes: If the target encoding value corresponding to the target pixel cannot be obtained by matching the pixel position information of the target pixel in the codebook corresponding to the encoding unit size of the first encoding unit, the pixel position information of the target pixel is input into the encoder together with the first encoding unit.

7. The method according to claim 4, characterized in that, The method further includes: For any given coding unit size, calculate the probability value of dividing the coding unit by using multiple pixels belonging to the coding unit size as dividing points; Establish a correspondence between the probability value and the pixel position information of the pixel; Based on the correspondence between the probability value and the pixel position information of the pixel, a specified association relationship is established between the pixel position information and the encoded value; According to the specified association relationship, the pixel position information and the encoded value are recorded in the codebook corresponding to the size of the encoded unit.

8. The method according to claim 7, characterized in that, The method further includes: The probability values ​​are filtered according to a specified range. Establish the correspondence between the filtered probability values ​​and the pixel position information of the pixels.

9. The method according to claim 7, characterized in that, The method further includes: Obtain neighboring coding units of the first coding unit; wherein, the neighboring coding units include at least one of the following: a coding unit located in the same image frame as the first coding unit and adjacent to the position of the first coding unit and whose target pixel has been determined; a coding unit located in a different image frame as the first coding unit and adjacent to the position of the first coding unit and whose target pixel has been determined; Using the pixel position information of the target pixels of the adjacent coding units, the codebook corresponding to the coding unit size of the first coding unit is optimized by a specified algorithm.

10. The method according to claim 1, characterized in that, The step of determining a target pixel among the multiple pixels included in the first coding unit of the video data to serve as a dividing point for dividing the first coding unit into a second coding unit, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets a specified condition, includes: Obtain a reference coding unit; wherein the reference coding unit is a coding unit with the same size as the first coding unit and whose target pixel has been determined; Using the target pixel of the reference coding unit as the reference pixel of the division point, the predicted pixel position information of the target pixel of the first coding unit is calculated; The target pixel of the first encoding unit is determined based on the predicted pixel position information.

11. The method according to claim 10, characterized in that, The step of encoding the first coding unit according to the target coding unit partitioning method includes: If the actual pixel position information of the target pixel of the first encoding unit is the same as the predicted pixel position information, the marker data and the first encoding unit are input into the encoder; wherein, the marker data is used to indicate that the actual pixel position information of the target pixel of the first encoding unit is the same as the predicted pixel position information.

12. The method according to claim 1, characterized in that, The step of encoding the first coding unit according to the target coding unit partitioning method includes: The pixel position information of the target pixel and the first encoding unit are input together into the encoder; or, Based on the pixel position information of the target pixel, a target encoding value corresponding to the target pixel is generated using a specified algorithm; The target encoded value and the first encoding unit are input into the encoder together.

13. A video data encoding device, characterized in that, include: A determining module is configured to determine, among the plurality of pixels included in the first coding unit of the video data, a target pixel for dividing the first coding unit into a second coding unit as a dividing point, such that the rate-distortion cost of the target coding unit division method corresponding to the target pixel meets a specified condition; wherein, the size of the second coding unit is equal to or smaller than the first coding unit; The target coding unit division method corresponding to the target pixel includes: when the target pixel is located at the endpoint of the first coding unit, the first coding unit is not divided; when the target pixel is located at the edge of the first coding unit, the first coding unit is divided into two second coding units along a direction perpendicular to the edge, with the target pixel as the dividing point; when the target pixel is located inside the first coding unit, the first coding unit is divided into four second coding units along mutually perpendicular directions that are parallel to the edges of the first coding unit, with the target pixel as the dividing point. The specified conditions include any one of the following: the rate distortion cost is within a specified numerical range, the rate distortion cost is within a specified sequence after being sorted according to specified rules, or the rate distortion cost is within the filtering results output after being filtered by a specified algorithm. The encoding module is used to encode the first encoding unit according to the target encoding unit division method.

14. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores at least one computer program, which is loaded and executed by the processor to implement the video data encoding method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which, when executed by a processor, is capable of implementing the video data encoding method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Intraframe video encoding optimization method based on video texture information

    CN104796694A

  • Video coding processing method and device and electronic equipment

    CN111988612A