Sample adaptive compensation method and device in video coding

By calculating the boundary information value of the video coding unit to skip or filter samples for adaptive compensation, the problems of excessive coding overhead and reduced speed are solved, and a more efficient coding process is achieved.

CN116016937BActive Publication Date: 2025-10-03BIGO TECH PTE LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211537637.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-01
Publication Date
2025-10-03
Estimated Expiration
2042-12-01

AI Technical Summary

Technical Problem

In the prior art, sample adaptive compensation causes excessive coding overhead and significantly reduces coding speed. In particular, in a multi-threaded environment, post-processing thread lag causes a significant reduction in coding speed.

Method used

The boundary information value is calculated by obtaining the coding depth information and quantization information of the video coding unit. When the boundary information value is less than the preset threshold, the sample adaptive compensation calculation is skipped. When it is not less than the threshold, the edge strength value is calculated by the edge direction estimation algorithm to screen the boundary compensation mode, and the screened boundary compensation mode is traversed.

Benefits of technology

The overall efficiency and encoding speed of video encoding are improved, encoding overhead is reduced, and the sample adaptive compensation mechanism is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016937B_ABST
    Figure CN116016937B_ABST
Patent Text Reader

Abstract

The present application discloses a method and apparatus for sample adaptive compensation in video coding. The method comprises: obtaining coding depth information and quantization information of a video coding unit, and calculating a boundary information value based on the coding depth information and the quantization information; skipping the sample adaptive compensation calculation if the boundary information value is less than a preset threshold; calculating edge strength values ​​for different preset directions using an edge direction estimation algorithm if the boundary information value is not less than the preset threshold, and screening boundary compensation modes based on the edge strength values; and traversing preset categories in the screened boundary compensation modes to perform sample adaptive compensation. This solution optimizes the sample adaptive compensation mechanism and improves overall coding efficiency and speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of video coding technology, and in particular to a method and device for adaptive sample compensation in video coding. Background Art

[0002] With the development of the Internet, information dissemination through video is becoming more and more widespread. During the video transmission process, in order to improve transmission efficiency, it is necessary to encode the video. Therefore, the use of efficient and fast video encoding methods is an important research topic.

[0003] In the related art, when encoding a video, sample adaptive compensation technology is used to solve the ringing effect caused by the quantization of video encoding, which also brings about a significant compression rate gain. In the process of sample adaptive compensation, each pixel in the video image frame is traversed, classified, and compensated to correct distortion problems such as convex corners and concave corners in a certain edge direction. This is a pixel-level decision-making and compensation process, which causes serious encoding overhead. At the same time, the increase in the computational complexity of the post-processing module to which the sample adaptive compensation belongs will lead to a decrease in the overall encoding speed. Especially in the case of multi-threading, the hysteresis of the post-processing thread causes too much waiting of the encoding thread, which significantly reduces the encoding speed and needs to be improved. Summary of the Invention

[0004] The embodiments of the present application provide a method and apparatus for sample adaptive compensation in video coding, which solves the problems in related technologies of excessive coding overhead and significantly reduced coding speed caused by sample adaptive compensation. The method optimizes the sample adaptive compensation mechanism and improves the overall coding efficiency and coding speed.

[0005] In a first aspect, an embodiment of the present application provides a sample adaptive compensation method in video coding, the method comprising:

[0006] Obtaining coding depth information and quantization information of a video coding unit, and calculating a boundary information value according to the coding depth information and the quantization information;

[0007] When the boundary information value is less than a preset threshold, skipping the calculation of sample adaptive compensation;

[0008] When the boundary information value is not less than the preset threshold, edge strength values ​​of different preset directions are calculated by an edge direction estimation algorithm, and boundary compensation modes are screened based on the edge strength values;

[0009] The preset categories in the filtered boundary compensation mode are traversed to perform sample point adaptive compensation.

[0010] In a second aspect, an embodiment of the present application further provides a sample adaptive compensation device in video coding, comprising:

[0011] a boundary information determination module configured to obtain coding depth information and quantization information of the video coding unit, and calculate a boundary information value based on the coding depth information and the quantization information;

[0012] a sample compensation skipping module, configured to skip calculation of sample adaptive compensation when the boundary information value is less than a preset threshold;

[0013] a mode screening module configured to, when the boundary information value is not less than the preset threshold, calculate edge strength values ​​of different preset directions using an edge direction estimation algorithm, and screen the boundary compensation mode based on the edge strength values;

[0014] The sample point compensation module is configured to traverse the preset categories in the screened boundary compensation mode to perform sample point adaptive compensation.

[0015] In a third aspect, an embodiment of the present application further provides a sample adaptive compensation device in video coding, the device comprising:

[0016] one or more processors;

[0017] a storage device for storing one or more programs,

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the sample adaptive compensation method in video encoding described in the embodiment of the present application.

[0019] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to execute the sample adaptive compensation method in video encoding described in the embodiment of the present application.

[0020] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device performs the sample adaptive compensation method in video encoding described in the embodiment of the present application.

[0021] In an embodiment of the present application, coded depth information and quantization information of a video coding unit are obtained, and a boundary information value is calculated based on the coded depth information and quantization information. If the boundary information value is less than a preset threshold, sample adaptive compensation calculation is skipped. If the boundary information value is not less than the preset threshold, edge strength values ​​in different preset directions are calculated using an edge direction estimation algorithm. Boundary compensation modes are then screened based on the edge strength values, and preset categories in the screened boundary compensation modes are traversed to perform sample adaptive compensation. This sample adaptive compensation processing mechanism skips sample adaptive compensation when a small boundary information value indicates that the video coding unit is a flat block. For non-skipped cases, edge strength values ​​in each preset direction of the video coding unit are further calculated, and boundary compensation modes are further screened based on the edge strength values. Each preset category in the screened boundary compensation modes is traversed, and some existing boundary compensation modes are partially eliminated. This reduces the traversal process of preset categories under some boundary compensation modes, thereby improving overall coding efficiency and coding speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart of a sample adaptive compensation method in video coding provided by an embodiment of the present application;

[0023] Figure 2 A flowchart of a method for calculating boundary information value in sample adaptive compensation provided in an embodiment of the present application;

[0024] Figure 3 A flowchart of a method for calculating a boundary information value in sample adaptive compensation provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a convolution matrix used in edge strength value calculation provided in an embodiment of the present application;

[0026] Figure 5 A flowchart of a method for screening compensation modes based on edge strength values ​​provided in an embodiment of the present application;

[0027] Figure 6 A flowchart of another sample adaptive compensation method in video coding provided by an embodiment of the present application;

[0028] Figure 7 A structural block diagram of a sample adaptive compensation device in video coding provided by an embodiment of the present application;

[0029] Figure 8 A schematic diagram of the structure of a sample adaptive compensation device in video coding provided by an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following is a further detailed description of the embodiments of the present application in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the embodiments of the present application, and are not intended to limit the embodiments of the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the embodiments of the present application, rather than all structures.

[0031] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.

[0032] The sample adaptive compensation method in video encoding provided in the embodiments of the present application can be applied to scenarios where video encoding is required, such as sample adaptive compensation when encoding a video generated in a live broadcast scene, or sample adaptive compensation when encoding a video generated during video shooting. The method can be executed by a computing device, such as a smart phone, a server, a laptop computer, a tablet computer, etc. When a computing device has a need to send a video, the sample adaptive compensation method of the present application can be used in the process of video encoding. Optionally, the sample adaptive compensation method can be integrated into an existing video encoding module based on the international standard for high-efficiency video coding, or a separate sample adaptive processing module can be set up. After the video encoding module encodes the video frame, sample adaptive processing is performed to finally encode it into a binary code stream and upload it to the network.

[0033] Figure 1 A flowchart of a sample adaptive compensation method in video coding provided in an embodiment of the present application specifically includes the following steps:

[0034] Step S101: Obtain coding depth information and quantization information of a video coding unit, and calculate a boundary information value according to the coding depth information and the quantization information.

[0035] In one embodiment, the processing object for sample compensation is a video coding unit. Exemplarily, taking the H.265 video coding standard as an example, it can be a defined CTU (Coding Tree Unit), the size of which can be 64*64; for other video coding standards, the size can also be 128*128, 32*32 or 16*16. For a fixed-size video coding unit, it can be recursively divided. For example, a video coding unit of size 64*64 can be divided into 4 sub-units of size 32*32, or divided into 3 sub-units of size 32*32, and 4 sub-units of size 16*16. In another embodiment, the video coding unit can be a basic unit defined in other video compression standards.

[0036] In one embodiment, the coding depth information is the optimal partitioning method selected for the current video coding unit after recursive traversal of the video frame through the coding analysis phase; the quantization information is the quantization parameter used during the actual encoding of the current video coding unit, which reflects the compression of spatial details in the video frame during the encoding process. For example, using the H.264 and H.265 video coding standards as an example, it can be a specific QP (Quantization Parameter) value. Optionally, the coding depth information and quantization information of the video coding unit can be obtained by the analysis phase of the video encoding process of currently used encoders.

[0037] In one embodiment, after obtaining the coding depth information and quantization information of the video coding unit, the boundary information value corresponding to the video coding unit is calculated based on the coding depth information and quantization information. The boundary information value reflects the flatness of the video coding unit. Optionally, a process for calculating the boundary information value based on the coding depth information and quantization information is as follows: Figure 2 As shown, Figure 2 A flowchart of a method for calculating a boundary information value in sample adaptive compensation provided in an embodiment of the present application specifically includes:

[0038] Step S1011: Calculate an average coded depth value according to the coded depth values ​​of the sub-units in the video coding unit.

[0039] In one embodiment, the average coding depth value calculated by the sub-units of the video coding unit is used as the coding depth value of the video coding unit. An exemplary calculation formula is as follows:

[0040]

[0041] Where avgDepth represents the average coding depth of the video coding unit, sum() is a summation function, and taking the size of the video coding unit as 64*64 as an example, cu_depth(x) is recorded in units of 4x4, which corresponds to the division depth at the xth small block, and the optional values ​​are 0, 1, 2, and 3. The coding depth value of the above sub-unit can be obtained from the encoding result of the encoder.

[0042] Step S1012: Calculate a boundary information value based on the average coding depth value, the quantization information, and the set weight.

[0043] In one embodiment, after calculating the average coding depth value of the video coding unit, the boundary information value is further calculated in combination with the quantization information and the set weight. For example, taking the quantization information as the quantization parameter QP as an example, the weight value is assumed to be a, and the boundary information value is recorded as ES, then the calculation formula of the boundary information value ES can be:

[0044]

[0045] The weight coefficient a can be assigned different constant values ​​according to actual conditions, such as 20 or 25.

[0046] It should be noted that the above-mentioned method of calculating the boundary information value is a preferred calculation method, and any other conventional and replaceable methods may be used, and this solution does not limit it.

[0047] Step S102: When the boundary information value is less than a preset threshold, skip the calculation of sample adaptive compensation.

[0048] In one embodiment, after calculating the boundary information value, a determination is made based on the boundary information value whether to skip the calculation of sample adaptive compensation. Optionally, if the boundary information value is less than a preset threshold, the calculation of sample adaptive compensation is skipped. A smaller boundary information value indicates a flatter video coding unit. A flatter video coding unit results in a lower benefit from performing sample adaptive compensation. Therefore, the calculated boundary information value is compared with a preset threshold. If the value is less than the preset threshold, sample adaptive compensation is skipped. Optionally, the preset threshold can range from 2 to 5, i.e., a suitable value within this range can be selected based on different usage scenarios.

[0049] Step S103 : when the boundary information value is not less than the preset threshold, edge strength values ​​of different preset directions are calculated by an edge direction estimation algorithm, and boundary compensation modes are screened based on the edge strength values.

[0050] In one embodiment, when the boundary information value is not less than a preset threshold, the corresponding sample adaptive compensation calculation is performed. Optionally, the sample adaptive compensation calculation includes two calculation processes: boundary compensation and sideband compensation. Boundary compensation is divided into four modes based on the direction of pixel traversal, exemplarily recorded as: horizontal mode (EO_0), vertical mode (EO_1), 135° direction mode (EO_2), and 45° direction mode (EO_3). For each boundary compensation mode, it includes multiple preset categories, such as five preset categories based on the relationship between the current pixel and two adjacent pixels in the above mode direction, exemplarily recorded as obvious concave corners, ordinary concave corners, ordinary convex corners, obvious convex corners, and other categories. The first two preset categories are concave corners, where the current pixel value is lower than the two adjacent pixels, and a positive compensation value is used. For the two convex corners in the preset categories, a negative compensation value is used to reduce the protrusion of the current pixel. No compensation is performed for other categories of scenes. That is, the above-mentioned boundary compensation is divided into 20 (4 boundary compensation modes, each boundary compensation mode contains 5 preset categories) specific traversal categories, and different categories use different compensation values. Among them, sideband compensation is to classify pixels according to the size of the pixel value. For example, when H.265 processes 8-bit video, it divides the pixel values ​​​​from 0 to 255 into 32 sidebands, and each sideband contains 8 consecutive pixel values. The encoding end will count the pixel values ​​within the specified sideband and calculate the mean, and then transmit the difference between the original pixel mean and the reconstructed pixel mean to the decoding end. The decoding end will compensate the parsed difference to the specified sideband to narrow the gap between the reconstructed mean and the original mean. Sideband compensation is divided into 32 categories, and different categories use different compensation values.

[0051] As can be seen above, sample-adaptive compensation includes 52 different compensation methods. This creates a significant bottleneck in the encoder during the sample-adaptive compensation traversal calculation process. In one embodiment, when the boundary information value is no less than a preset threshold, an edge direction estimation algorithm is used to calculate edge strength values ​​for different preset directions. Boundary compensation modes are then applied sequentially to eliminate inappropriate boundary compensation modes, reducing the encoder's data computation load.

[0052] Optionally, the calculation process of the boundary information value is exemplarily shown in FIG3. Figure 3 A flowchart of a method for calculating a boundary information value in sample adaptive compensation provided in an embodiment of the present application specifically includes:

[0053] Step S1031: Divide the video coding unit into multiple sub-units, and calculate the division depth value of each sub-unit respectively.

[0054] For example, taking a video coding unit size of 64*64 as an example, it is divided into four 32x32 sub-units, and the split depth value of each sub-unit is calculated separately. Optionally, a method for calculating the split depth value of each sub-unit may be: obtaining the split depth value of the minimum coding unit in each sub-unit, and determining the sum of the split depth values ​​of the minimum coding units as the split depth value of the sub-unit. For example, the calculation formula is as follows:

[0055]

[0056] Among them, subCUDepth(i) represents the division depth value of the i-th sub-unit, the value of i represents different sub-units, and j represents the index of the minimum coding unit in each sub-unit. For example, the size of the minimum coding unit can be 4*4.

[0057] Optionally, subCUDepth(i) can be stored in the form of a matrix. For example, taking a 64*64 video coding unit as an example, it is equally divided into four 32*32 subunits. Assume that i=0, 1, 2, 3 correspond to the upper left subunit, upper right subunit, lower left subunit, and lower right subunit, respectively. Accordingly, a 2*2 matrix is ​​used to store the division depth values ​​of the upper left subunit, upper right subunit, lower left subunit, and lower right subunit, respectively.

[0058] Step S1032: performing a convolution operation on the divided depth value and a preset matrix to obtain edge strength values ​​in different preset directions, wherein the preset matrix includes a plurality of preset matrices, and each preset matrix corresponds to a preset direction.

[0059] In one embodiment, after calculating the division depth value of each sub-unit of the video encoding unit, the edge strength value of the video encoding unit in different preset directions is calculated, wherein the preset directions may exemplarily include 4 directions, namely the horizontal direction, the vertical direction, the 135° direction and the 45° direction, which respectively correspond to the 4 boundary compensation modes in the boundary compensation. It should be noted that the above-mentioned preset directions can be adaptively adjusted based on different encoders and sample adaptive compensation algorithms, the number of preset directions can be increased or deleted, and the specific direction angle of the preset direction can also be adjusted. Optionally, taking the aforementioned division depth value as an example of a 2*2 matrix calculated and stored, a way to calculate the edge strength value may be: performing a convolution operation on the division depth value and the preset matrix to obtain edge strength values ​​of different preset directions, wherein, taking the horizontal direction, the vertical direction, the 135° direction and the 45° direction as examples, the preset matrices corresponding to the settings are as follows: Figure 4 As shown, Figure 4A schematic diagram of a convolution matrix used to calculate edge strength values ​​in an embodiment of the present application. After performing convolution operations on each preset matrix, the pixel variation differences in the video encoding unit in the horizontal, vertical, 135°, and 45° directions can be obtained due to the numerical settings of the preset matrices. These differences are represented by edge strength values ​​and used as a basis for subsequent boundary compensation mode screening.

[0060] In another embodiment, for a processing device with strong computing power, the edge strength value may also be calculated using an edge extraction operator such as a Marr-Hildreth operator.

[0061] In one embodiment, after calculating the edge strength values ​​in different directions, the process further includes screening the boundary compensation mode. For example, Figure 5 As shown, Figure 5 A flowchart of a method for screening compensation modes based on edge strength values ​​provided in an embodiment of the present application specifically includes:

[0062] Step S1033: sorting the calculated edge strength values ​​in different preset directions.

[0063] Step S1034: When the edge strength value satisfies the elimination condition, the boundary compensation mode corresponding to the minimum edge strength value is eliminated.

[0064] In one embodiment, different edge intensity values ​​correspond to a preset direction, that is, to a boundary compensation mode, which reflects the pixel changes in that direction. After calculating the edge intensity values ​​of different preset directions, they are sorted and the boundary compensation mode corresponding to the smallest edge intensity value is eliminated. For example, taking the boundary compensation modes including horizontal mode, vertical mode, 135° direction mode, and 45° direction mode as an example, assuming that the edge intensity value corresponding to the 45° direction mode is the smallest, it is eliminated, and the remaining three boundary compensation modes are retained. Optionally, the number of eliminations can be set according to actual needs.

[0065] In one embodiment, when the boundary compensation mode is eliminated, it is further included to determine whether the edge strength value meets the elimination condition. Optionally, the elimination condition can be that the maximum edge strength value is not 0, thereby avoiding the introduction of large errors caused by eliminating the boundary compensation mode.

[0066] Step S104: traverse the preset categories in the screened boundary compensation mode to perform sample adaptive compensation.

[0067] In one embodiment, when performing sample adaptive compensation for a video coding unit, the preset categories in the boundary compensation mode obtained after screening are traversed to perform sample adaptive compensation. For example, if the boundary compensation mode obtained after screening includes a horizontal mode, a vertical mode, and a 135° direction mode, the five categories of obvious concave corners, ordinary concave corners, ordinary convex corners, obvious convex corners, and other categories set in the horizontal mode, the vertical mode, and the 135° direction mode are traversed to complete the boundary compensation for the video coding unit.

[0068] As can be seen from the above, by obtaining the coding depth information and quantization information of the video coding unit, a boundary information value is calculated based on the coding depth information and quantization information. If the boundary information value is less than a preset threshold, the sample adaptive compensation calculation is skipped. If the boundary information value is not less than the preset threshold, the edge direction estimation algorithm is used to calculate edge strength values ​​in different preset directions. The boundary compensation mode is then screened based on the edge strength values, and the preset categories in the screened boundary compensation modes are traversed to perform sample adaptive compensation. This sample adaptive compensation processing mechanism, when the boundary information value is small, it means that the video coding unit is a flat block, and sample adaptive compensation is skipped. For non-skipped cases, the edge strength values ​​in each preset direction of the video coding unit are further calculated, and the boundary compensation mode is further screened based on the edge strength values. Each preset category in the screened boundary compensation mode is traversed, and some existing boundary compensation modes are partially eliminated. This reduces the traversal process of the preset categories under some boundary compensation modes, thereby improving overall coding efficiency and coding speed.

[0069] Figure 6 A flowchart of another sample adaptive compensation method in video coding provided in an embodiment of the present application provides a method for traversing preset categories in a screened boundary compensation mode to perform sample adaptive compensation, specifically including:

[0070] Step S201: Obtain coding depth information and quantization information of a video coding unit, and calculate a boundary information value according to the coding depth information and the quantization information.

[0071] Step S202: When the boundary information value is less than a preset threshold, skip the calculation of sample adaptive compensation.

[0072] Step S203: When the boundary information value is not less than the preset threshold, edge strength values ​​of different preset directions are calculated by an edge direction estimation algorithm, and boundary compensation modes are screened based on the edge strength values.

[0073] Step S204 : When traversing the preset categories in the screened boundary compensation mode, perform luminance sample compensation of the video encoding unit in sequence and determine the optimal luminance sample compensation mode.

[0074] In one embodiment, taking the boundary compensation modes including four modes, namely, horizontal mode, vertical mode, 135° direction mode, and 45° direction mode, and the preset categories including obvious concave angle, ordinary concave angle, ordinary convex angle, obvious convex angle, and other categories as an example, the five categories of boundary compensation modes obtained after screening are traversed respectively, and the brightness sample compensation of the video encoding unit is performed in turn during the traversal process, wherein the brightness sample compensation can be based on the encoder setting or the existing brightness sample compensation method, which is not limited here.

[0075] In one embodiment, the luma sample compensation process further includes determining an optimal luma sample compensation mode. Alternatively, the number of pixels in the video coding unit that belong to each boundary compensation mode and the mean value to be compensated are calculated sequentially, compensation is performed, and a rate-distortion cost is calculated. The optimal luma sample compensation mode is then selected by comparing the cost.

[0076] Step S205: Filter the chroma sample compensation mode based on the optimal luminance sample compensation mode, traverse the preset categories of the filtered chroma sample compensation mode, and perform chroma sample compensation of the video encoding unit in sequence.

[0077] Taking the YUV video coding format as an example, the luma and chroma components have similarities at the edges. In one embodiment, this similarity is exploited by constraining the candidate modes to be traversed in the chroma sample compensation by using the optimal luma sample compensation mode determined in the luma sample compensation. For example, assuming that the optimal luma sample compensation mode is the 135° directional mode, during the chroma sample compensation process, only the chroma sample compensation corresponding to the 135° directional mode and the chroma sample compensation corresponding to the intrinsic mode set in the chroma sample compensation process may be performed.

[0078] From the above, it can be seen that during the chroma sample compensation process, the chroma sample compensation mode is screened using the optimal luminance sample compensation mode determined during the luminance sample compensation process, which further reduces the number of mode traversals during the sample compensation process and improves the encoding speed.

[0079] On the basis of the above technical solution, the process of determining the chroma sample compensation mode also includes: screening the chroma sample compensation mode according to the video scene corresponding to the video encoding unit. In one embodiment, through experimental test comparison and solution design experience, it is found that the proportion of chroma sample compensation mode in different video scenes is different. For example, for live broadcast scenes, the proportion of horizontal mode and vertical mode in the chroma sample compensation mode is low, so when screening the chroma sample compensation mode, these two modes can be eliminated; for building scenes, the proportion of 135° direction mode and 45° direction mode in the chroma sample compensation mode is low, so when screening the chroma sample compensation mode, these two modes can be eliminated. It can be seen that when screening the chroma sample compensation mode, mode screening is performed according to the video scene, which can effectively reduce the number of traversals while ensuring the accuracy of the sample compensation error, thereby improving the overall efficiency of video encoding.

[0080] Figure 7 This is a structural block diagram of a sample adaptive compensation device in video coding provided by an embodiment of the present application. The device is used to execute the sample adaptive compensation method in video coding provided by the above embodiment, and has the corresponding functional modules and beneficial effects of the execution method. Figure 7 As shown, the device specifically includes: a boundary information determination module 101, a sample compensation skipping module 102, a mode screening module 103 and a sample compensation module 104, wherein,

[0081] The boundary information determination module 101 is configured to obtain coding depth information and quantization information of the video coding unit, and calculate a boundary information value according to the coding depth information and the quantization information;

[0082] A sample compensation skipping module 102 is configured to skip calculation of sample adaptive compensation when the boundary information value is less than a preset threshold;

[0083] A mode screening module 103 is configured to, when the boundary information value is not less than the preset threshold, calculate edge strength values ​​of different preset directions using an edge direction estimation algorithm, and screen the boundary compensation mode based on the edge strength values;

[0084] The sample compensation module 104 is configured to traverse the preset categories in the screened boundary compensation mode to perform sample adaptive compensation.

[0085] As can be seen from the above scheme, by obtaining the coding depth information and quantization information of the video coding unit, a boundary information value is calculated based on the coding depth information and quantization information. If the boundary information value is less than a preset threshold, the sample adaptive compensation calculation is skipped. If the boundary information value is not less than the preset threshold, the edge strength values ​​in different preset directions are calculated using an edge direction estimation algorithm. The boundary compensation mode is then screened based on the edge strength values, and the preset categories in the screened boundary compensation modes are traversed to perform sample adaptive compensation. This sample adaptive compensation processing mechanism, when the boundary information value is small, it means that the video coding unit is a flat block, and sample adaptive compensation is skipped. For non-skipped cases, the edge strength values ​​in each preset direction of the video coding unit are further calculated, and the boundary compensation mode is further screened based on the edge strength values. Each preset category in the screened boundary compensation mode is traversed, and the existing boundary compensation mode is partially eliminated. This reduces the traversal process of the preset categories under some boundary compensation modes, thereby improving overall coding efficiency and coding speed.

[0086] In a possible embodiment, the boundary information determination module 101 is configured to:

[0087] Calculating an average coded depth value according to the coded depth values ​​of the sub-units in the video coding unit;

[0088] A boundary information value is calculated based on the average coding depth value, the quantization information, and a set weight.

[0089] In a possible embodiment, the boundary information determination module 101 is configured to:

[0090] Dividing the video encoding unit into a plurality of sub-units, and calculating a division depth value of each sub-unit respectively;

[0091] A convolution operation is performed on the divided depth value and a preset matrix to obtain edge strength values ​​in different preset directions. The preset matrix includes a plurality of matrices, and each preset matrix corresponds to a preset direction.

[0092] In a possible embodiment, the boundary information determination module 101 is configured to:

[0093] A split depth value of a minimum coding unit in each of the sub-units is obtained, and a sum of the split depth values ​​of the minimum coding units is determined as a split depth value of the sub-unit.

[0094] In a possible embodiment, the pattern screening module 103 is configured to:

[0095] Sorting the calculated edge strength values ​​in different preset directions;

[0096] When the edge strength value satisfies the elimination condition, the boundary compensation mode corresponding to the minimum edge strength value is eliminated.

[0097] In a possible embodiment, the sample point compensation module 104 is configured as follows:

[0098] When traversing the preset categories in the screened boundary compensation mode, sequentially performing luminance sample compensation for the video coding unit, and determining an optimal luminance sample compensation mode;

[0099] screening a chroma sample compensation mode based on the optimal luminance sample compensation mode;

[0100] The preset categories in the filtered chroma sample compensation mode are traversed, and the chroma sample compensation of the video encoding unit is performed in sequence.

[0101] In a possible embodiment, the sample compensation module 104 is further configured to: filter the chroma sample compensation mode according to the video scene corresponding to the video encoding unit.

[0102] Figure 8 A schematic diagram of the structure of a sample adaptive compensation device in video coding provided by an embodiment of the present application is shown as follows: Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 In the embodiment, a processor 201 is used as an example; the processor 201, the memory 202, the input device 203 and the output device 204 in the device can be connected by a bus or other means. Figure 8 The example of the connection via bus is taken. The memory 202, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the sample adaptive compensation method in the video encoding in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 302, that is, implements the above-mentioned sample adaptive compensation method in video encoding. The input device 203 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device 204 may include a display device such as a display screen.

[0103] An embodiment of the present application further provides a non-volatile storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a sample adaptive compensation method in video coding described in the above embodiment, which includes:

[0104] Obtaining coding depth information and quantization information of a video coding unit, and calculating a boundary information value according to the coding depth information and the quantization information;

[0105] When the boundary information value is less than a preset threshold, skipping the calculation of sample adaptive compensation;

[0106] When the boundary information value is not less than the preset threshold, edge strength values ​​of different preset directions are calculated by an edge direction estimation algorithm, and boundary compensation modes are screened based on the edge strength values;

[0107] The preset categories in the filtered boundary compensation mode are traversed to perform sample point adaptive compensation.

[0108] It is worth noting that in the above-mentioned embodiment of the sample adaptive compensation device in video coding, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as they can achieve the corresponding functions; in addition, the specific names of the various functional units are only for the convenience of distinguishing each other and are not used to limit the scope of protection of the embodiments of the present application.

[0109] In some possible implementations, various aspects of the method provided herein may also be implemented in the form of a program product, which includes program code. When the program product is executed on a computer device, the program code is used to cause the computer device to perform the steps of the method according to the various exemplary embodiments of the present application described above in this specification. For example, the computer device may perform the sample adaptive compensation method in video coding described in the embodiments of the present application. The program product may be implemented using any combination of one or more readable media.

Claims

1. A sample adaptive compensation method in video coding, characterized in that: include: Obtaining coded depth information and quantization information of a video coding unit, and calculating a boundary information value based on the coded depth information and the quantization information, wherein calculating the boundary information value based on the coded depth information and the quantization information includes: calculating an average coded depth value based on the coded depth values ​​of subunits in the video coding unit, and calculating the boundary information value based on the average coded depth value, the quantization information, and a set weight; When the boundary information value is less than a preset threshold, skipping the calculation of sample adaptive compensation; When the boundary information value is not less than the preset threshold, edge strength values ​​of different preset directions are calculated by an edge direction estimation algorithm, and boundary compensation modes are screened based on the edge strength values; The preset categories in the filtered boundary compensation mode are traversed to perform sample point adaptive compensation.

2. The method for sample adaptive compensation in video coding according to claim 1, wherein: The edge strength values ​​of different preset directions are calculated by the edge direction estimation algorithm, including: Dividing the video encoding unit into a plurality of sub-units, and calculating a division depth value of each sub-unit respectively; A convolution operation is performed on the divided depth value and a preset matrix to obtain edge strength values ​​in different preset directions. The preset matrix includes a plurality of matrices, and each preset matrix corresponds to a preset direction.

3. The method for sample adaptive compensation in video coding according to claim 2, wherein: The calculating the partition depth value of each sub-unit separately includes: A split depth value of a minimum coding unit in each of the sub-units is obtained, and a sum of the split depth values ​​of the minimum coding units is determined as a split depth value of the sub-unit.

4. The method for sample adaptive compensation in video coding according to claim 1, wherein: The screening of the boundary compensation mode based on the edge strength value includes: Sorting the calculated edge strength values ​​in different preset directions; When the edge strength value satisfies the elimination condition, the boundary compensation mode corresponding to the minimum edge strength value is eliminated.

5. The method for adaptive sample compensation in video coding according to any one of claims 1 to 4, characterized in that: The traversing of the preset categories in the screened boundary compensation mode to perform sample adaptive compensation includes: When traversing the preset categories in the screened boundary compensation mode, sequentially performing luminance sample compensation for the video coding unit, and determining an optimal luminance sample compensation mode; screening a chroma sample compensation mode based on the optimal luminance sample compensation mode; The preset categories in the filtered chroma sample compensation mode are traversed, and the chroma sample compensation of the video encoding unit is performed in sequence.

6. The method for sample adaptive compensation in video coding according to claim 5, wherein: The process of determining the chroma sample compensation mode further includes: The chroma sample compensation mode is screened according to the video scene corresponding to the video encoding unit.

7. A sample adaptive compensation device in video coding, characterized in that: include: a boundary information determination module configured to obtain coded depth information and quantization information of a video coding unit, and calculate a boundary information value based on the coded depth information and the quantization information, wherein the boundary information determination module is specifically configured to calculate an average coded depth value based on the coded depth values ​​of subunits in the video coding unit, and calculate the boundary information value based on the average coded depth value, the quantization information, and a set weight; a sample compensation skipping module, configured to skip calculation of sample adaptive compensation when the boundary information value is less than a preset threshold; a mode screening module configured to, when the boundary information value is not less than the preset threshold, calculate edge strength values ​​of different preset directions using an edge direction estimation algorithm, and screen the boundary compensation mode based on the edge strength values; The sample point compensation module is configured to traverse the preset categories in the screened boundary compensation mode to perform sample point adaptive compensation.

8. A device for adaptive sample compensation in video coding, the device comprising: one or more processors; A storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the sample adaptive compensation method in video encoding according to any one of claims 1 to 6.

9. A non-volatile storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to perform the sample adaptive compensation method in video coding according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the sample adaptive compensation method in video coding according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Fast sample adaptive offset method in HEVC (High Efficient Video Coding)

    CN107343199A

  • H.265 sample point adaptive compensation method based on region of interest of human eyes

    CN108259903A

  • Cross-component sampling point adaptive compensation method, coding method and related device

    CN113099221A