A method, apparatus, device, and medium for determining the coding size of video coding

By combining the spatial correlation and image texture characteristics, the predicted depth value and texture complexity of the video encoding tree unit are calculated, and the optimal encoding size of the video encoding is determined, which solves the problem of high intra-coding complexity in the prior art, and reduces the calculation amount and complexity.

CN116437091BActive Publication Date: 2025-06-24YEALINK (XIAMEN) NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310255431.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2025-06-24
Estimated Expiration
2043-03-16

AI Technical Summary

Technical Problem

The prior art only considers the spatial correlation or only the image texture features when encoding videos, resulting in the intra-coding complexity still high.

Method used

By obtaining the encoding depth value and preset weight factor of the adjacent encoding tree units, the predicted depth value of the current encoding tree unit is calculated, and the preliminary traversal depth range is determined in combination with the texture complexity, and an early termination division mechanism is applied to determine the optimal encoding size.

Benefits of technology

It effectively reduces the calculation amount of video encoding and the complexity of encoding calculation, and improves the accuracy and accuracy of encoding size judgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116437091B_ABST
    Figure CN116437091B_ABST
Patent Text Reader

Abstract

This application belongs to the field of video coding technology, and discloses a coding size determination method, device, equipment and medium for video coding. The method includes: obtaining a plurality of coding depth values corresponding to a plurality of adjacent coding tree units adjacent to the current coding tree unit; calculating a predicted depth value of the current coding tree unit according to the coding depth values of each adjacent coding tree unit and the preset weight factors corresponding to each adjacent coding tree unit; calculating the texture complexity of the current coding tree unit based on the Roberts gradient operator; determining a preliminary traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity; and performing an early termination partitioning mechanism on the current coding unit divided in the current coding tree unit based on the preliminary traversal depth range to obtain the optimal coding size of the current coding unit. This application can effectively reduce the computational amount of video coding and reduce the coding computational complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video coding, and in particular, to a method, apparatus, device and medium for determining the coding size in video coding. Background Art

[0002] As a new generation of video coding standard, H.265 / HEVC (High Efficiency Video Coding) has doubled the compression efficiency compared with the previous generation of video coding standard H.264 / AVC, and at the same time, the coding complexity has also increased significantly. This is mainly because some new technologies are introduced in HEVC, such as large-size quadtree segmentation, 35 intra prediction modes, RDO (Rate Distortion Optimization) technology, and SAO (Sample Adaptive Offset) technology. Among them, the RDO process needs to calculate the coding cost of each coding size and prediction unit, and select the one with the minimum cost as the best size and prediction mode. Therefore, the RDO process is the part with the largest computational amount in the encoder coding process.

[0003] In order to reduce the complexity of intra coding and reduce the computational amount, the prior art adopts a method of estimating the depth prediction range of the current coding tree unit from the perspective of spatial domain correlation to control the depth division range of the coding block, or uses different fast algorithms for mode selection and early termination of division by using the image texture features of the coding unit. However, only considering the spatial domain correlation or only considering the image texture features still has great limitations for reducing the intra coding complexity.

[0004] Therefore, there is a problem in the prior art that the intra coding complexity is still very high because only the spatial domain correlation or only the image texture features are considered during video coding. Summary of the Invention

[0005] The present application provides a method, apparatus, device and medium for determining the coding size in video coding, which can effectively reduce the computational amount of video coding and reduce the coding computational complexity.

[0006] In a first aspect, an embodiment of the present application provides a method for determining the coding size in video coding. The method is applied to a video coding device and includes:

[0007] Obtain a plurality of coding depth values corresponding to a plurality of adjacent coding tree units adjacent to the current coding tree unit;

[0008] Calculate a predicted depth value of the current coding tree unit according to the coding depth values of the adjacent coding tree units and the preset weight factors corresponding to the adjacent coding tree units;

[0009] Calculate the texture complexity of the current coding tree unit based on the Roberts gradient operator;

[0010] Determine the preliminary traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity;

[0011] Execute the early termination partitioning mechanism on the current coding unit divided in the current coding tree unit based on the preliminary traversal depth range to obtain the optimal coding size of the current coding unit.

[0012] Further, multiple adjacent coding tree units include the left coding tree unit, the upper coding tree unit, the upper left coding tree unit, and the upper right coding tree unit of the current coding tree unit; the preset weight factors corresponding to the left coding tree unit and the upper coding tree unit are the first weight factor, and the preset weight factors corresponding to the upper left coding tree unit and the upper right coding tree unit are the second weight factor;

[0013] The first weight factor is greater than the second weight factor.

[0014] Further, the above-mentioned calculation of the texture complexity of the current coding tree unit based on the Roberts gradient operator includes:

[0015] Calculate based on the Roberts gradient operator according to the width value, height value, and multiple pixel values of the current coding tree unit to obtain the average gradient value of the current coding tree unit;

[0016] Obtain the texture complexity of the current coding tree unit according to the preset first texture threshold, preset second texture threshold, preset third texture threshold, and the average gradient value.

[0017] Further, the preliminary traversal depth range includes a first depth value, a second depth value, and a third depth value;

[0018] Executing the early termination partitioning mechanism on the current coding unit divided in the current coding tree unit based on the preliminary traversal depth range to obtain the optimal coding size of the current coding unit includes:

[0019] Determine the current partitioning size of the current coding unit according to the first depth value;

[0020] Calculate the texture flatness of the current coding unit according to the current partitioning size and the multiple pixel values corresponding to the current coding unit, and detect whether the texture flatness is less than the preset flatness threshold; if it is less, terminate the partitioning in advance and use the current partitioning size as the optimal coding size; if it is greater than or equal to, perform the rate-distortion cost judgment step.

[0021] Further, the above-mentioned execution of the rate-distortion cost judgment step includes:

[0022] Obtain the first average rate-distortion cost of multiple encoded units in the current coding tree unit with the same size as the current partition size, and obtain the second average rate-distortion cost of multiple encoded units in the left coding tree unit, the upper coding tree unit, and the upper-left coding tree unit with the same size as the current partition size;

[0023] Calculate the rate-distortion cost threshold based on the first average rate-distortion cost and the second average rate-distortion cost;

[0024] Obtain the optimal rate-distortion cost of the current coding unit, and detect whether the optimal rate-distortion cost is less than the rate-distortion cost threshold; if it is less, terminate the partition in advance and use the current partition size as the optimal coding size of the current coding unit; if it is greater than or equal to, perform the edge feature judgment step.

[0025] Further, the above-mentioned execution of the edge feature judgment step includes:

[0026] Judge whether the current coding unit contains an edge according to the calculated edge feature of the current coding unit;

[0027] If the current coding unit contains an edge, judge whether to terminate the partition in advance according to the texture complexity, prediction depth value, and current partition size of the current coding tree unit; if the partition is terminated in advance, use the current partition size as the optimal coding size of the current coding unit; if the partition is not terminated in advance, perform the optimal size comparison step;

[0028] If the current coding unit does not contain an edge, judge whether the 4 sub-coding units of the current coding unit contain an edge. If they contain an edge, judge whether to terminate the partition in advance according to the texture complexity and prediction depth value of the current coding tree unit; if the partition is terminated in advance, use the current partition size as the optimal coding size of the current coding unit; if they do not contain an edge or if the partition is not terminated in advance, perform the optimal size comparison step.

[0029] Further, the above-mentioned execution of the optimal size comparison step includes:

[0030] Determine the second partition size according to the second depth value in the preliminary traversal depth range;

[0031] Partition the current coding unit according to the second partition size to obtain the second-size coding unit;

[0032] Calculate and compare the rate-distortion cost of the current coding unit and the rate-distortion cost of the second-size coding unit;

[0033] If the rate-distortion cost of the current coding unit is greater than or equal to the rate-distortion cost of the second-size coding unit, use the current partition size as the optimal coding size of the current coding unit;

[0034] If the rate - distortion cost of the current coding unit is less than the rate - distortion cost of the coding unit with the second size, then the second partition size is taken as the optimal coding size of the current coding unit.

[0035] In a second aspect, an embodiment of the present application provides a coding size determination device for video coding. The device is applied to a video coding device and includes:

[0036] A coding depth value acquisition module, configured to acquire a plurality of coding depth values corresponding to a plurality of adjacent coding tree units adjacent to the current coding tree unit;

[0037] A predicted depth value acquisition module, configured to calculate a predicted depth value of the current coding tree unit according to the coding depth values of each adjacent coding tree unit and the preset weight factors corresponding to each adjacent coding tree unit;

[0038] A texture complexity calculation module, configured to calculate the texture complexity of the current coding tree unit based on the Roberts gradient operator;

[0039] A preliminary traversal depth determination module, configured to determine a preliminary traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity;

[0040] An early termination partitioning module, configured to perform an early termination partitioning mechanism on the current coding unit partitioned in the current coding tree unit based on the preliminary traversal depth range to obtain the optimal coding size of the current coding unit.

[0041] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the steps of a method for determining a coding size of video coding according to any one of the above - mentioned embodiments.

[0042] In a fourth aspect, an embodiment of the present application provides a computer - readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of a method for determining a coding size of video coding according to any one of the above - mentioned embodiments.

[0043] In summary, compared with the prior art, the beneficial effects brought by the technical solutions provided by the embodiments of the present application at least include:

[0044] A method for determining the coding size in video coding provided by an embodiment of the present application. The present application calculates the predicted depth value of the current coding tree unit according to the coding depth values of adjacent coding tree units, taking into account the spatial correlation in coding; then calculates the preliminary depth traversal range of the current coding tree unit according to the predicted depth value and the texture complexity, that is, the preliminary depth traversal range is obtained by combining the spatial correlation and the image texture features, which makes the coding size results corresponding to the depth values in the preliminary depth traversal range more accurate and precise; then, on the basis of the preliminary depth traversal range, an early termination division mechanism is applied when dividing the coding unit size of the coding tree unit, which can further narrow the range among several depth values closest to the optimal coding size in the preliminary depth traversal range, so as to determine the optimal coding size, avoiding the traversal calculation of each coding size and the corresponding coding cost in the rate-distortion optimization process of video coding, reducing the computational amount of video coding, and reducing the coding computational complexity. Description of the Drawings

[0045] Figure 1 The flowchart of a method for determining the coding size in video coding provided by an exemplary embodiment of the present application.

[0046] Figure 2 The schematic diagram of adjacent coding tree units provided by an exemplary embodiment of the present application.

[0047] Figure 3 The table diagram for determining the preliminary depth traversal range provided by an exemplary embodiment of the present application.

[0048] Figure 4 The flowchart of the rate-distortion cost judgment step provided by an exemplary embodiment of the present application.

[0049] Figure 5 The structural diagram of a device for determining the coding size in video coding provided by an exemplary embodiment of the present application. Detailed Embodiments

[0050] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0051] Please refer to Figure 1 , an embodiment of the present application provides a method for determining the coding size in video coding. This method is applied to a video coding device. Taking the video coding device as the execution subject for illustration, this method may specifically include the following steps:

[0052] Step S1, obtain multiple coding depth values corresponding to multiple adjacent coding tree units adjacent to the current coding tree unit.

[0053] Step S2, calculate the predicted depth value of the current coding tree unit according to the coding depth values of each adjacent coding tree unit and the preset weight factor corresponding to each adjacent coding tree unit.

[0054] Specifically, the predicted depth value can be calculated by the following formula:

[0055]

[0056] where Depth pre is the predicted depth value, N is the number of adjacent coding tree units, ω i is the preset weight factor corresponding to the i-th adjacent coding tree unit, and level i is the coding depth value of the i-th adjacent coding tree unit.

[0057] Step S3, calculate the texture complexity of the current coding tree unit based on the Roberts gradient operator.

[0058] Step S4, determine the initial traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity.

[0059] Step S5, perform an early termination partitioning mechanism on the current coding unit divided in the current coding tree unit based on the initial traversal depth range to obtain the optimal coding size of the current coding unit.

[0060] The coding size decision method for video coding provided in the above embodiment calculates the predicted depth value of the current coding tree unit according to the coding depth values of adjacent coding tree units, considering the spatial correlation of coding; then calculates the initial depth traversal range of the current coding tree unit according to the predicted depth value and the texture complexity, that is, the initial depth traversal range is obtained by combining the spatial correlation and the image texture features, which makes the coding size results corresponding to the depth values in the initial depth traversal range more accurate and precise; then, on the basis of the initial depth traversal range, when partitioning the coding unit of the coding tree unit, applying the early termination partitioning mechanism can further narrow the range among several depth values closest to the optimal coding size in the initial depth traversal range, so as to determine the optimal coding size, avoiding the traversal calculation of each coding size and the corresponding coding cost in the rate-distortion optimization process of video coding, reducing the computational amount of video coding, and reducing the coding computational complexity.

[0061] Please refer to Figure 2 , in some embodiments, the multiple adjacent coding tree units include the left coding tree unit, the upper coding tree unit, the upper left coding tree unit, and the upper right coding tree unit of the current coding tree unit.

[0062] The preset weight factors corresponding to the left coding tree unit and the upper coding tree unit are the first weight factors, and the preset weight factors corresponding to the upper-left coding tree unit and the upper-right coding tree unit are the second weight factors; the first weight factor is greater than the second weight factor.

[0063] Where CTU is the abbreviation of coding tree unit, CUL is the left coding tree unit, CUA is the upper coding tree unit, CULA is the upper-left coding tree unit, and CURA is the upper-right coding tree unit.

[0064] Specifically, in the above formula for calculating the predicted depth value, N = 4, the first weight factors corresponding to CUL and CUA are 0.3, that is, ω1 = ω2 = 0.3, and the second weight factors corresponding to CULA and CURA are 0.2, that is, ω3 = ω4 = 0.2. This is because in the spatial domain, the left coding tree unit and the upper coding tree unit have a greater correlation with the current coding tree unit, while the upper-left coding tree unit and the upper-right coding tree unit have a smaller correlation with the current coding tree unit.

[0065] The above embodiments consider the spatial domain correlation between the current coding tree unit and adjacent coding tree units, set different weight factors according to the magnitude of the correlation, make the calculation of the predicted depth value more accurate, and further make the preliminary depth traversal range more accurate.

[0066] In some embodiments, calculating the texture complexity of the current coding tree unit based on the Roberts gradient operator includes:

[0067] Calculating based on the Roberts gradient operator according to the width value, height value, and multiple pixel values of the current coding tree unit to obtain the average gradient value of the current coding tree unit.

[0068] Obtaining the texture complexity of the current coding tree unit according to a preset first texture threshold, a preset second texture threshold, a preset third texture threshold, and the average gradient value.

[0069] Where the Roberts gradient operator is also called the Roberts gradient operator, which is an operator for finding edges using a local difference operator. In this application, the specific calculation formula for the average gradient value is:

[0070] g x = f(x + 1, y) - f(x, y)

[0071] g y = f(x, y + 1) - f(x, y)

[0072] G(x, y) = |g x + g y |

[0073]

[0074] Among them, f(x, y) represents the pixel value at the position (x, y), and g x represents the horizontal gradient of (x, y), and g y represents the vertical gradient of (x, y), G(x, y) represents the gradient at (x, y), height is the height value of the current coding tree unit, width is the width value of the current coding tree unit, and G avg represents the average gradient value of the current coding tree unit.

[0075]

[0076] Among them, TC is the texture complexity, Thr1 is the preset first texture threshold, which can be 5, Thr2 is the preset second texture threshold, which can be 10, and Thr3 is the preset third texture threshold, which can be 15.

[0077] PSimple indicates that the current coding tree unit is an absolute texture flat block, Simple indicates that the current coding tree unit is a texture flat block, Common indicates that the current coding tree unit is a texture ordinary block, Complex indicates that the current coding tree unit is a texture complex block, and PComplex indicates that the current coding tree unit is an absolute texture complex block.

[0078] Through the calculation and judgment of the texture complexity in the above embodiments, the image texture feature of the current coding tree unit is obtained, and the current coding tree unit is subdivided into 5 types according to the texture complexity, which facilitates the determination of the subsequent preliminary depth traversal range and makes the preliminary depth traversal range more accurate.

[0079] In some embodiments, the preliminary traversal depth range includes a first depth value, a second depth value, and a third depth value; based on the preliminary traversal depth range, an early termination partitioning mechanism is performed on the current coding unit divided in the current coding tree unit to obtain the optimal coding size of the current coding unit, including:

[0080] Determine the current partitioning size of the current coding unit according to the first depth value.

[0081] Calculate the texture flatness of the current coding unit according to the current partitioning size and multiple pixel values corresponding to the current coding unit, and detect whether the texture flatness is less than the preset flatness threshold; if it is less, terminate the partitioning in advance and use the current partitioning size as the optimal coding size; if it is greater than or equal to, perform the rate-distortion cost judgment step.

[0082] Please refer to Figure 3, it can be seen that the predicted depth value and the texture complexity determine the number of depth values in the initial depth traversal range. In this embodiment, the first depth value is not the traversal depth 1, but the smallest depth value in the initial depth traversal range. If the initial depth traversal range is [1, 2, 3], then the first depth value is 1, the second depth value is 2, and the third depth value is 3; if the initial depth traversal range is [2, 3], then the first depth value is 2, the second depth value is 3, and there is no third depth value. That is, the number of depth values in the initial depth traversal range is also determined by the predicted depth value and the texture complexity.

[0083] Specifically, the size of the coding tree unit CTU is 64×64. The traversal depth 1 means that the 64×64 CTU is divided into 4 coding units CU (coding unit) with a coding size of 32×32. That is, the traversal depth value 1 corresponds to a coding size of 32×32. And so on, the traversal depth value 2 means it is divided into 16 coding units CU with a coding size of 16×16, and the traversal depth value 3 means it is divided into 64 coding units CU with a coding size of 8×8.

[0084] For the initial depth traversal range with only one depth value, the coding size corresponding to this depth value can be directly used as the optimal coding size without performing the early termination partitioning mechanism. For the initial depth traversal range containing at least two depth values, the early termination partitioning mechanism is executed. For example, for the current coding tree unit with an initial depth traversal range of [1, 2], the first depth value is 1, and the current partitioning size is 32×32. If it is detected that the early partitioning condition is met in the early termination partitioning mechanism, then 32×32 is used as the optimal coding size, and there is no need to further perform the partitioning with a coding size of 16×16.

[0085] Specifically, the calculation formula for the texture flatness is as follows:

[0086]

[0087] Among them, mean is the pixel average of the pixel values of all pixel points in the current coding unit CU, homo represents the texture flatness of the current coding unit CU, M represents the coding size of the current coding unit CU, that is, M = 32 or 16, and P(i, j) represents the pixel value at the position (i, j) in the current coding unit CU.

[0088] If homo is less than the preset flatness threshold, the current coding unit CU terminates the partitioning in advance; otherwise, the rate-distortion cost judgment step is executed. In this application, the preset flatness threshold can be 0.01 * mean.

[0089] In the above embodiments, if the homo is less than the preset flatness threshold, it indicates that the current coding unit encoded according to the current division size is already flat enough, and the current division size is already accurate enough, and no further division is required. Further division is terminated in advance, thereby reducing the computational amount and computational complexity of encoding.

[0090] Please refer to Figure 4 , in some embodiments, the above execution rate distortion cost judgment step may specifically include:

[0091] Step S61, obtain the first average rate distortion cost of multiple encoded units in the current coding tree unit with the same size as the current division size, and obtain the second average rate distortion cost of multiple encoded units in the left coding tree unit, the upper coding tree unit, and the upper left coding tree unit with the same size as the current division size.

[0092] Step S62, calculate the rate distortion cost threshold according to the first average rate distortion cost and the second average rate distortion cost.

[0093] Specifically, the rate distortion cost RDcost (Rate Distortion Cost) = D + lamda * Bit, where D represents the sum of squared differences SSE (Sum of Squared Error) between the current coding unit CU and the reconstructed block, which is used to measure the distortion of encoding in the current mode, Bit represents the number of bits consumed for encoding the current mode, lamba represents a parameter, and the reconstructed block refers to the image block obtained after inverse transformation, inverse quantization, and filtering operations during the encoding process. Let the first average rate distortion cost be RDcost1 and the second average rate distortion cost be RDcost2. The rate distortion cost threshold THR can be: THR = RDcost1 × 0.6 + RDcost2 × 0.4.

[0094] Step S63, obtain the optimal rate distortion cost of the current coding unit, and detect whether the optimal rate distortion cost is less than the rate distortion cost threshold; if it is less, terminate the division in advance and use the current division size as the optimal coding size of the current coding unit; if it is greater than or equal to, perform the edge feature judgment step.

[0095] Specifically, the optimal rate distortion cost of the current coding unit refers to the minimum rate distortion cost among the 35 rate distortion costs calculated by traversing 35 prediction modes within the image frame for the current coding unit.

[0096] In the above embodiments, by comparing the optimal rate distortion cost of the current coding unit and the rate distortion cost threshold, it is judged whether the effect of the current size division is the best. If it is less than the threshold, it indicates that the coding cost corresponding to the current division size is small. Therefore, the division is terminated in advance, avoiding the increase in the rate distortion cost that may be caused by continuing to divide the size, and effectively reducing the encoding computational complexity.

[0097] In some embodiments, the above-mentioned step of performing edge feature judgment may specifically include:

[0098] Judging whether the current coding unit contains edges according to the calculated edge features of the current coding unit;

[0099] If the current coding unit contains edges, then judge whether to terminate the division in advance according to the texture complexity, prediction depth value and current division size of the current coding tree unit; if the division is terminated in advance, then use the current division size as the optimal coding size of the current coding unit; if the division is not terminated in advance, then perform the optimal size comparison step;

[0100] If the current coding unit does not contain edges, then judge whether the 4 sub-coding units of the current coding unit contain edges. If they contain edges, then judge whether to terminate the division in advance according to the texture complexity and prediction depth value of the current coding tree unit; if the division is terminated in advance, then use the current division size as the optimal coding size of the current coding unit; if they do not contain edges or if the division is not terminated in advance, then perform the optimal size comparison step.

[0101] Among them, the method for calculating the edge features of the current coding unit is as follows:

[0102] Perform 1 / 4 downsampling on the image frame corresponding to the current coding unit, calculate the edge map of the 1 / 4 downsampled image using the Sobel operator, and perform thresholding on the edge map using the Otsu method.

[0103] Build an edge quad-tree for the thresholded edge map from 32×32 to 4×4 in the way of quadtree recursive division.

[0104] Obtain the edge features of the current coding unit and the 4 sub-coding units of the current coding unit according to the position mapping relationship from the 1 / 4 downsampled image to the full-resolution image and the edge quad-tree.

[0105] The above-mentioned 1 / 4 downsampling means taking pixels at intervals of 1 pixel in the horizontal direction and taking pixels at intervals of 1 pixel point in the vertical direction of the image to form a 1 / 4 downsampled image.

[0106] There are various implementation manners for judging whether there are edge features. For example, when the calculated edge feature is 0, it is judged that there are no edge features, and when the edge feature is 1, it is judged that there are edge features.

[0107] For the current coding unit that does not contain edge features, if the current division size is 32×32, and the coding tree unit CTU it belongs to is a texture simple block or a texture absolutely simple block, and the prediction depth value is less than 1, then the current coding unit can terminate the division in advance and be encoded using the 32x32 size.

[0108] If the current partition size is 16×16, the Coding Tree Unit (CTU) it belongs to is a texture simple block or a texture absolutely simple block, and its predicted depth value is less than 2, then the partition can be terminated early and encoded using the 16x16 size; or if the CTU it belongs to is a texture normal block and its predicted depth value is less than 1, then the partition can also be terminated early and encoded using the 16x16 size. If the Coding Unit (CU) without edge features does not meet these conditions, then the optimal size comparison step is executed.

[0109] If the current coding unit and its 4 sub-CUs all contain edge features, the CTU it belongs to is a texture normal block or a texture complex block, and its predicted depth value is greater than 2, then the current coding unit is directly partitioned according to the coding size of the second depth value. For example, the current coding unit with a current partition size of 16×16 is directly encoded using the 8x8 size.

[0110] If the current coding unit contains edge features while its 4 sub-CUs do not; or if the current coding unit and its 4 sub-CUs all contain edge features but do not meet the above texture feature value and predicted depth value conditions, then the optimal size comparison step is executed.

[0111] The above embodiments judge the coding effect of the current partition size according to whether the image contains edges. If the effect is good enough, there is no need to continue partitioning and it is directly encoded according to the current partition size, avoiding the increase in computational complexity caused by directly partitioning without edge detection.

[0112] In some embodiments, the above execution of the optimal size comparison step may specifically include:

[0113] Determine the second partition size according to the second depth value in the preliminary traversal depth range.

[0114] Partition the current coding unit according to the second partition size to obtain the second size coding unit.

[0115] Calculate and compare the rate-distortion cost of the current coding unit and the rate-distortion cost of the second size coding unit.

[0116] If the rate-distortion cost of the current coding unit is greater than or equal to the rate-distortion cost of the second size coding unit, then the current partition size is used as the optimal coding size of the current coding unit.

[0117] If the rate-distortion cost of the current coding unit is less than the rate-distortion cost of the second size coding unit, then the second partition size is used as the optimal coding size of the current coding unit.

[0118] In the specific implementation process, assume that the initial depth traversal range is [2, 3], the first depth value is 2, the second depth value is 3, and the current partition size is 16×16. Then it is further divided into 4 second-size coding units with a coding size of 8×8. Calculate the rate-distortion costs corresponding to these two coding sizes, and select the coding size with the smaller rate-distortion cost as the optimal coding size for coding.

[0119] In the above embodiment, the rate-distortion cost is used as the final judgment basis, and the coding size with a small rate-distortion cost is selected for coding, effectively reducing the amount of calculation and computational complexity in the rate-distortion optimization process.

[0120] Please refer to Figure 5 , another embodiment of the present application provides a coding size decision device for video coding. This device is applied to a video coding device and specifically may include:

[0121] A coding depth value acquisition module 101, configured to acquire a plurality of coding depth values corresponding to a plurality of adjacent coding tree units adjacent to the current coding tree unit.

[0122] A predicted depth value acquisition module 102, configured to calculate the predicted depth value of the current coding tree unit according to the coding depth values of each adjacent coding tree unit and the preset weight factors corresponding to each adjacent coding tree unit.

[0123] A texture complexity calculation module 103, configured to calculate the texture complexity of the current coding tree unit based on the Roberts gradient operator.

[0124] A preliminary traversal depth determination module 104, configured to determine the preliminary traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity.

[0125] An early termination partitioning module 105, configured to perform an early termination partitioning mechanism on the current coding unit partitioned in the current coding tree unit based on the preliminary traversal depth range to obtain the optimal coding size of the current coding unit.

[0126] A coding size determination device for video coding provided in the above embodiment, wherein a predicted depth value acquisition module 102 calculates a predicted depth value of a current coding tree unit according to the coding depth values of adjacent coding tree units, taking into account the spatial correlation of coding; a preliminary traversal depth determination module 104 calculates a preliminary depth traversal range of the current coding tree unit according to the predicted depth value and the texture complexity, that is, the preliminary depth traversal range is obtained by combining the spatial correlation and the image texture features, which makes the coding size results corresponding to the depth values in the preliminary depth traversal range more accurate and precise; an early termination division module 105 applies an early termination division mechanism when dividing the coding unit size of the coding tree unit based on the preliminary depth traversal range, and can further narrow the range among several depth values closest to the optimal coding size in the preliminary depth traversal range, so as to determine the optimal coding size, avoiding the traversal calculation of each coding size and the corresponding coding cost in the rate-distortion optimization process of video coding, reducing the computational amount of video coding, and reducing the coding computational complexity.

[0127] For the specific limitations of a coding size determination device for video coding provided in this embodiment, reference may be made to the embodiment of a coding size determination method for video coding in the foregoing text, which will not be elaborated herein. Each module in the above coding size determination device for video coding can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above modules.

[0128] An embodiment of the present application provides a computer device, which may include a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the processor is caused to execute the steps of a coding size determination method for video coding according to any of the above embodiments.

[0129] For the working process, working details, and technical effects of the computer device provided in this embodiment, reference may be made to the embodiment of a coding size determination method for video coding in the foregoing text, which will not be elaborated herein.

[0130] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method for determining an encoding size in video encoding as described in any of the above embodiments are implemented. Wherein, the computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, floppy disks, optical discs, hard disks, flash memories, USB flash drives, and / or memory sticks, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0131] For the working process, working details and technical effects of the computer-readable storage medium provided in this embodiment, reference may be made to the embodiments of the method for determining an encoding size in video encoding described above, and details are not repeated here.

[0132] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the embodiments of the above methods. Wherein, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application may include non-volatile and / or volatile memories. Non-volatile memories may include read-only memories (ROMs), programmable ROMs (PROMs), electrically programmable ROMs (EPROMs), electrically erasable programmable ROMs (EEPROMs), or flash memories. Volatile memories may include random access memories (RAMs) or external cache memories. By way of illustration and not limitation, RAMs are available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), Rambus dynamic RAM (RDRAM), etc.

[0133] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0134] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A coding size determination method for video coding, characterized in that The method includes: Obtaining a plurality of coding depth values corresponding to a plurality of adjacent coding tree units adjacent to the current coding tree unit; Calculating a predicted depth value of the current coding tree unit according to the coding depth values of the adjacent coding tree units and preset weight factors corresponding to the adjacent coding tree units; Calculating the texture complexity of the current coding tree unit based on the Roberts gradient operator; Determining a preliminary traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity; Performing an early termination partitioning mechanism on the current coding unit divided in the current coding tree unit based on the preliminary traversal depth range to obtain an optimal coding size of the current coding unit; wherein, the preliminary traversal depth range includes a first depth value, a second depth value, and a third depth value, and the first depth value is the smallest depth value in the preliminary depth traversal range; Specifically, determining a current partitioning size of the current coding unit according to the first depth value; calculating a texture flatness of the current coding unit according to the current partitioning size and a plurality of pixel values corresponding to the current coding unit, and detecting whether the texture flatness is less than a preset flatness threshold; if it is greater than or equal to, obtaining a first average rate-distortion cost of a plurality of coded units in the current coding tree unit having the same size as the current partitioning size, and obtaining a second average rate-distortion cost of a plurality of coded units in a plurality of adjacent coding tree units having the same size as the current partitioning size; calculating a rate-distortion cost threshold according to the first average rate-distortion cost and the second average rate-distortion cost; the rate-distortion cost threshold THR = RDcost1×0.6 + RDcost2×0.4; wherein, RDcost1 is the first average rate-distortion cost, and RDcost2 is the second average rate-distortion cost; obtaining an optimal rate-distortion cost of the current coding unit, and detecting whether the optimal rate-distortion cost is less than the rate-distortion cost threshold; if it is greater than or equal to, determining whether the current coding unit contains edges according to the calculated edge features of the current coding unit; if the current coding unit contains edges, determining whether to terminate partitioning early according to the texture complexity, the predicted depth value, and the current partitioning size of the current coding tree unit; if terminating partitioning early, taking the current partitioning size as the optimal coding size of the current coding unit; if not terminating partitioning early, performing an optimal size comparison step; if the current coding unit does not contain edges, determining whether 4 sub-coding units of the current coding unit contain edges, if they contain edges, determining whether to terminate partitioning early according to the texture complexity and the predicted depth value of the current coding tree unit; if terminating partitioning early, taking the current partitioning size as the optimal coding size of the current coding unit; if not containing edges or if not terminating partitioning early, performing an optimal size comparison step.

2. The method according to claim 1, wherein A plurality of the adjacent coding tree units include the left coding tree unit, the upper coding tree unit, the upper left coding tree unit, and the upper right coding tree unit of the current coding tree unit; the preset weight factors corresponding to the left coding tree unit and the upper coding tree unit are the first weight factors, and the preset weight factors corresponding to the upper left coding tree unit and the upper right coding tree unit are the second weight factors; The first weight factor is greater than the second weight factor.

3. The method according to claim 1, wherein The calculating the texture complexity of the current coding tree unit based on the Roberts gradient operator includes: Calculating based on the Roberts gradient operator according to the width value, height value, and a plurality of pixel values of the current coding tree unit to obtain an average gradient value of the current coding tree unit; Obtaining the texture complexity of the current coding tree unit according to a preset first texture threshold, a preset second texture threshold, a preset third texture threshold, and the average gradient value.

4. The method according to claim 2, wherein The performing the optimal size comparison step includes: Determining a second partitioning size according to the second depth value in the preliminary traversal depth range; Partitioning the current coding unit according to the second partitioning size to obtain a coding unit of the second size; Calculating and comparing the rate distortion cost of the current coding unit and the rate distortion cost of the coding unit of the second size; If the rate distortion cost of the current coding unit is less than or equal to the rate distortion cost of the coding unit of the second size, then taking the current partitioning size as the optimal coding size of the current coding unit; If the rate distortion cost of the current coding unit is greater than the rate distortion cost of the coding unit of the second size, then taking the second partitioning size as the optimal coding size of the current coding unit.

5. An encoding size determination device for video encoding, characterized in that, The apparatus includes: A coding depth value acquisition module, configured to acquire a plurality of coding depth values corresponding to a plurality of adjacent coding tree units adjacent to the current coding tree unit; A predicted depth value acquisition module, configured to calculate a predicted depth value of the current coding tree unit according to the coding depth values of the adjacent coding tree units and the preset weight factors corresponding to the adjacent coding tree units; A texture complexity calculation module, configured to calculate the texture complexity of the current coding tree unit based on the Roberts gradient operator; A preliminary traversal depth determination module, configured to determine a preliminary traversal depth range of the current coding tree unit according to the predicted depth value and the texture complexity; An early termination partitioning module, configured to perform an early termination partitioning mechanism on a current coding unit partitioned in the current coding tree unit based on the preliminary traversal depth range, to obtain an optimal coding size of the current coding unit; wherein, the preliminary traversal depth range includes a first depth value, a second depth value, and a third depth value, and the first depth value is the smallest depth value in the preliminary depth traversal range; the early termination partitioning module is specifically configured to determine a current partitioning size of the current coding unit according to the first depth value; calculate a texture flatness of the current coding unit according to the current partitioning size and a plurality of pixel values corresponding to the current coding unit, and detect whether the texture flatness is less than a preset flatness threshold; if it is greater than or equal to, obtain a first average rate-distortion cost of a plurality of coded units in the current coding tree unit having the same size as the current partitioning size, and obtain a second average rate-distortion cost of a plurality of coded units in a plurality of adjacent coding tree units having the same size as the current partitioning size; calculate a rate-distortion cost threshold according to the first average rate-distortion cost and the second average rate-distortion cost; the rate-distortion cost threshold THR = RDcost1 × 0.6 + RDcost2 × 0.4; wherein, RDcost1 is the first average rate-distortion cost, and RDcost2 is the second average rate-distortion cost; obtain an optimal rate-distortion cost of the current coding unit, and detect whether the optimal rate-distortion cost is less than the rate-distortion cost threshold; if it is greater than or equal to, judge whether the current coding unit contains an edge according to the calculated edge feature of the current coding unit; if the current coding unit contains an edge, judge whether to terminate the partitioning early according to the texture complexity, the predicted depth value, and the current partitioning size of the current coding tree unit; if the partitioning is terminated early, use the current partitioning size as the optimal coding size of the current coding unit; if the partitioning is not terminated early, perform an optimal size comparison step; if the current coding unit does not contain an edge, judge whether any of the 4 sub-coding units of the current coding unit contains an edge, if it contains an edge, judge whether to terminate the partitioning early according to the texture complexity and the predicted depth value of the current coding tree unit; if the partitioning is terminated early, use the current partitioning size as the optimal coding size of the current coding unit; if it does not contain an edge or if the partitioning is not terminated early, perform an optimal size comparison step.

6. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • HEVC intra-frame prediction coding method and system

    CN103957414A

  • HEVC interframe coding quick mode selection method

    CN105141954A