Sample adaptive offset method, apparatus and device, storage medium, and product

By combining the coding reference information of the coding tree unit and the video scene, the skip judgment and mode simplification of sample adaptive compensation are optimized, which solves the problems of computational pressure and compensation accuracy in mobile video coding, and achieves efficient video coding processing.

WO2024212823A1PCT designated stage expired Publication Date: 2024-10-17BIGO TECH PTE LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/084562
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-11
Filing Date
2024-03-28
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

In the existing technology, sample adaptive compensation requires high computational pressure in mobile video encoding, resulting in a video encoding speed bottleneck. In addition, the overall skip judgment conditions are rough and the mode simplification strategy does not combine content characteristics, resulting in poor acceleration effects and compensation accuracy. damage.

Method used

By obtaining the coding reference information and video scene of the coding tree unit, combined with the coding frame type and compensation mode information, it is determined whether to skip sample point compensation, and when it cannot be skipped, the compensation mode is simplified according to the coding sub-block type and video scene, and the preset compensation is reduced number of modes to save computational overhead.

Benefits of technology

It effectively accelerates the processing speed of sample point adaptive compensation, improves the compensation efficiency of coding tree units, reduces computational overhead and unnecessary power consumption and heat, while maintaining high compensation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084562_17102024_PF_FP_ABST
    Figure CN2024084562_17102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a sample adaptive offset method, apparatus and device, a storage medium, and a product. The method comprises: acquiring coding reference information of a coding tree unit and a corresponding video scene; according to a coding frame type and offset mode information, determining whether to skip sample offset of the coding tree unit; in response to a determination result of skipping the sample offset, skipping the sample offset of the coding tree unit; in response to a determination result of not skipping the sample offset, determining, according to a coding sub-block type and the video scene, offset modes to be traversed; and performing sample offset processing on the coding tree unit on the basis of the offset modes to be traversed. According to the present application, whether the offset can be skipped or not is preliminarily determined on the basis of the coding frame type and the offset mode information, to achieve the preliminary acceleration effect; the offset mode is simplified from the perspectives of internal coding information of the coding tree unit and content features, so that under the condition of slightly sacrificing the offset accuracy, the calculation overhead is saved, and the offset processing speed is efficiently improved.
Need to check novelty before this filing date? Find Prior Art

Description

Sample point adaptive compensation method, device, equipment, storage medium and product

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 11, 2023, with application number 202310382784.8, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of video coding technology, and in particular to a sample adaptive compensation method, apparatus, device, storage medium, and product. Background Art

[0003] The next-generation High-Efficiency Video Coding (HEVC) standard, by introducing a series of highly efficient coding tools, nearly doubles the compression ratio of the most widely used advanced video coding standard. However, this significant compression gain inevitably comes at a high computational cost, particularly for coding tools like sample adaptive compensation (SPC), which significantly strains mobile video encoding. SPC was developed primarily to address ringing artifacts. By traversing all pixels, classifying and compensating them based on their relationship to surrounding pixels, it can correct for issues like convex and concave corners in specific directions. SPC is a pixel-level distortion compensation technology, which also carries a high coding cost. On mobile devices with limited computing power, running post-processing steps like SPC in parallel with the encoding process can severely impact encoding speed, becoming a major bottleneck for mobile video encoding and causing issues such as frame drop and video lag. Even on mobile devices with higher computing power, post-processing steps like SPC can be run in separate threads, but the absolute computational effort remains the same, resulting in unnecessary power consumption and heat generation.

[0004] In order to reduce the absolute amount of computation required for sample adaptive compensation, two solutions are mainly used in related technologies: global skipping of sample adaptive compensation and mode simplification. For global skipping, the judgment is mainly based on the texture information of the current block or the existing coding reference information such as the CU (Coding Unit) mode. If the current block is a large flat block, the benefit of performing sample adaptive compensation is not significant, and the related calculations of sample adaptive compensation can be skipped directly. In related technologies, the judgment conditions for global skipping are relatively rough, which can achieve good acceleration effects on large blocks of size 64×64, but it is easy to miss or misselect small blocks such as 32×32 and 16×16, resulting in poor acceleration effects. Mode simplification is primarily aimed at reducing computational complexity in terms of accuracy. During the pixel traversal process of sample adaptive compensation, the traversal categories and rate-distortion optimization processes are simplified. In related technologies, mainstream encoders have simplified the rate-distortion optimization process within sample adaptive compensation, using formula fitting to estimate distortion while using empirical values ​​instead of actual coded bits to save computational overhead within the mode. Consequently, simplifying the RDO process for all modes does not significantly accelerate the process. Furthermore, related technologies directly halve the number of boundary compensation modes, lacking consideration of the content characteristics of the coded frame, which can easily lead to loss of compensation accuracy.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a sample adaptive compensation method, apparatus, device, storage medium, and product, which solve the problems of poor acceleration effect due to rough overall skip judgment conditions, and serious damage to compensation accuracy due to the mode simplification strategy not combining content features and video scenes. The method effectively combines the internal coding information of the coding tree unit and the content features of the coding frame, simplifies the compensation mode when the compensation accuracy is slightly damaged, saves computing overhead, and efficiently improves the compensation processing speed.

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

[0008] Obtaining coding reference information of a coding tree unit and a corresponding video scene, wherein the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units;

[0009] determining whether to skip sample compensation of the coding tree unit according to the coding frame type and the compensation mode information;

[0010] In response to a determination result of skipping sample compensation, skipping sample compensation of the coding tree unit;

[0011] In response to a determination result that sample compensation is not skipped, determining a compensation mode to be traversed according to the coding sub-block type and the video scene;

[0012] Sample compensation processing is performed on the coding tree unit based on the compensation modes to be traversed, and the number of the compensation modes to be traversed is less than the number of preset compensation modes.

[0013] In a second aspect, an embodiment of the present application further provides a sample adaptive compensation device, including:

[0014] An acquisition module configured to acquire coding reference information of a coding tree unit and a corresponding video scene, wherein the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units;

[0015] a judgment module configured to determine whether to skip sample compensation of the coding tree unit according to the coding frame type and the compensation mode information;

[0016] an overall skipping module, configured to skip sample compensation of the coding tree unit in response to a judgment result of skipping sample compensation;

[0017] a mode simplification module configured to, in response to a determination result of not skipping sample compensation, determine a compensation mode to be traversed according to the coding sub-block type and the video scene;

[0018] The sample compensation module is configured to perform sample compensation processing on the coding tree unit based on the compensation modes to be traversed, where the number of the compensation modes to be traversed is less than the number of preset compensation modes.

[0019] In a third aspect, an embodiment of the present application further provides a sampling point adaptive compensation device, the device comprising:

[0020] one or more processors;

[0021] a storage device configured to store one or more programs,

[0022] 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 described in the embodiment of the present application.

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

[0024] In a fifth aspect, embodiments of the present application further provide a computer program product, comprising a computer program stored in a computer-readable storage medium. At least one processor of a device reads and executes the computer program from the computer-readable storage medium, causing the device to perform the sample adaptive compensation method described in embodiments of the present application.

[0025] In an embodiment of the present application, by obtaining coding reference information and the corresponding video scene of a coding tree unit, and then determining whether to skip sample compensation for the coding tree unit based on the coding frame type and compensation mode information in the coding reference information; or in response to a determination result that sample compensation is skipped, skipping sample compensation for the coding tree unit; or in response to a determination result that sample compensation is not skipped, determining a to-be-traversed compensation mode based on the coding sub-block type and the video scene in the coding reference information; and finally performing sample compensation processing on the coding tree unit based on the to-be-traversed compensation modes, wherein the number of to-be-traversed compensation modes is less than a preset number of compensation modes. Using the above technical approach, the importance of the current coding tree unit can be determined based on the coding frame type, and the necessity of compensation for the current coding tree unit can be determined based on the compensation status of neighboring coding tree units based on the compensation mode information, thereby preliminarily determining whether compensation can be skipped, thereby achieving a preliminary acceleration effect. If skipping compensation is not possible, the compensation mode is further simplified based on the coding sub-block type and the video scene, taking into account the internal coding information of the coding tree unit and the content characteristics of the coding frame, thereby saving computational overhead and effectively improving compensation processing speed while slightly sacrificing compensation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a flow chart of a sample adaptive compensation method provided by an embodiment of the present application;

[0027] FIG2 is a flowchart of a method for determining whether to skip sample compensation of a coding tree unit provided by an embodiment of the present application;

[0028] FIG3 is a flow chart of a method for determining a compensation mode to be traversed provided by an embodiment of the present application;

[0029] FIG4 is a flowchart of another method for determining a compensation mode to be traversed provided by an embodiment of the present application;

[0030] FIG5 is a flowchart of a method for performing sample compensation processing on a coding tree unit provided by an embodiment of the present application;

[0031] FIG6 is a flowchart of another sample adaptive compensation method provided by an embodiment of the present application;

[0032] FIG7 is a structural block diagram of a sample adaptive compensation device provided in an embodiment of the present application;

[0033] FIG8 is a schematic structural diagram of a sampling point adaptive compensation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] 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.

[0035] 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.

[0036] The sample adaptive compensation method provided in the embodiments of this application is an intermediate step in the video encoding chain, which includes frame acquisition, a PTQ loop, sample adaptive compensation, and the output bitstream. When a user initiates a video encoding request through a video transmitter, this video encoding chain is triggered. Specific application scenarios include video conferencing, video calls, indoor live streaming, and outdoor live streaming. For indoor live streaming, the video transmitter uses the terminal device's camera to capture images and feeds each captured video frame into the PTQ loop for encoding to produce encoded frames. The sample adaptive compensation method provided in the embodiments of this application is then applied to perform sample compensation. Finally, the compensated encoded frames are fed back into the PTQ loop for prediction of the next frame while continuing entropy coding to produce the transmitted bitstream. Video receivers, distributed in different locations, receive the bitstream via network transmission and then decode and play the video. The aforementioned application scenarios are merely exemplary and illustrative. In practice, the sample adaptive compensation method can also be used in video encoding in other scenarios, and this embodiment of the application is not intended to limit this application. This application aims to provide a sample adaptive compensation method that can effectively combine the content characteristics of the coded frame and the video scene, simplify the compensation mode, save computing overhead, and efficiently improve the compensation processing speed while slightly compromising the compensation accuracy.

[0037] In the sample adaptive compensation method provided in the embodiments of the present application, each step may be performed by a computer device. The computer device refers to any electronic device with data calculation, processing, and storage capabilities, such as a mobile phone, a PC (Personal Computer), a tablet computer, or other terminal device. It may also be a server or other device, and the embodiments of the present application are not limited thereto.

[0038] FIG1 is a flow chart of a sample adaptive compensation method provided in an embodiment of the present application, which specifically includes the following steps:

[0039] Step S101: Obtain coding reference information of a coding tree unit and a corresponding video scene, where the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units.

[0040] The video scene may be a scene divided based on the video's picture content, the region where the video is located, and the unidirectional and bidirectional transmission of the video. For example, the video scene may include different scenes such as video conferencing, video calls, indoor live broadcasts, and outdoor live broadcasts. The coding reference information may be the coding information of the video frame after PTQ loop processing and the compensation results of other coding tree units during the sample adaptive compensation process. The coding frame type may be divided into I-frames, P-frames, and B-frames. The current coding frame may be further divided into multiple coding tree unit rows, each coding tree unit row including multiple coding tree units, each coding tree unit may be divided into coding sub-blocks of different sizes according to different division depths. Taking a 64×64 coding tree unit as an example, it may be further divided into 32×32, 16×16, 8×8, and 4×4 coding sub-blocks, and the coding sub-block type of the coding sub-block may include skip type and non-skip type. The sample adaptive compensation method provided in the embodiment of the present application performs sample compensation processing based on the coding tree unit as the basic processing unit. In one embodiment, the sample adaptive compensation method can traverse each coding tree unit of the current coding frame in sequence according to a Z-shaped scanning order, so that the adjacent coding tree unit that has completed sample compensation and is referenced for obtaining the compensation mode information can be the coding tree unit at the left end or the coding tree unit at the top end.

[0041] Step S102: Determine whether to skip sample compensation of the coding tree unit according to the coding frame type and compensation mode information.

[0042] Among them, coding frame types can be divided into I frames, P frames, and B frames. In video coding strategies, I frames represent key frames. The probability of I frames appearing is low, but because I frames are reference frames for P frames and B frames, their quality directly affects the quality of subsequent frames in the same group, making I frames very important. To avoid I frame distortion caused by skipping sample compensation, which in turn affects the entire video sequence, the embodiment of the present application does not skip sample compensation processing for I frames. For P frames, they can be reference frames for other subsequent P frames or for B frames before and after them. If sample compensation is skipped frequently, the introduced errors may be continuously propagated in the subsequent reference chain. For B frames, they need to refer to the preceding I frame and the following P frame, or the P frames before and after them for prediction. Therefore, B frames are relatively least important and are less likely to cause error propagation. Therefore, for P frames, relatively strict judgment conditions can be set to determine whether to skip sample compensation for the current coding tree unit, while for B frames, relatively loose judgment conditions can be set to determine whether to skip sample compensation for the current coding tree unit.

[0043] In one embodiment, FIG2 is a flowchart of a method for determining whether to skip sample compensation of a coding tree unit provided by an embodiment of the present application. As shown in FIG2 , the specific implementation process is as follows:

[0044] Step S1021: When the coding frame type is an I frame, determine sample compensation for skipping coding tree units.

[0045] Step S1022: When the coding frame type is a B frame and the compensation mode information records skip compensation, determine sample compensation for skipped coding tree units.

[0046] In one embodiment, when it is confirmed that the coding frame type is a B frame, combined with the traversal method of the Z-shaped scanning order, the upper coding tree unit and the left coding tree unit adjacent to the current coding tree unit can be selected as reference objects, and the compensation mode information of the upper coding tree unit and the left coding tree unit is read. When the sample compensation of the upper coding tree unit and the left coding tree unit are skipped, the sample compensation of the current coding tree unit is skipped.

[0047] Step S1023: When the coding frame type is a P frame, the compensation mode information records skip compensation, and the division depth of the coding tree unit is not greater than a preset value, determine to skip sample compensation of the coding tree unit.

[0048] In one embodiment, when the coding frame type is confirmed to be a P-frame, combined with a Z-shaped scan order traversal method, the upper and left coding tree units adjacent to the current coding tree unit can be selected as reference objects. The compensation mode information of the upper and left coding tree units is read. After skipping sample compensation for both the upper and left coding tree units, the partition depth of the current coding tree unit is obtained. The partition depth can be the size specification of the coding sub-blocks into which the coding tree unit is further divided. For example, if the coding tree unit is 64×64, a partition depth of 1 can obtain 32×32 coding sub-blocks; a partition depth of 2 can obtain 16×16 coding sub-blocks; and a partition depth of 3 can obtain 8×8 coding sub-blocks. Therefore, given the higher importance of P-frames compared to B-frames, relatively strict judgment conditions can be set to ensure that important details in the video are rendered. For example, for hair in the video, the partition depth of the coding tree unit belonging to the hair is large. To preserve the details of the hair, sample compensation is not skipped. For a wall in the video image, the division depth of the coding tree unit belonging to the wall does not exceed 1, and since the details of the wall are relatively insignificant, sample compensation can be skipped. Therefore, optionally, the preset value corresponding to the division depth is set to 1. If the division depth is not greater than 1, sample compensation for the current coding tree unit is skipped.

[0049] Optionally, of course, the aforementioned division depth setting is only an illustrative example. The embodiment of the present application can also set other division depths according to other specific scenario requirements, and the embodiment of the present application is not limited to this.

[0050] As described above, by combining the coding frame type and the compensation mode information of adjacent coding tree units, fully considering the reference role of different types of coding frames in video coding, and reasonably setting different judgment conditions, the overall skipping of the sample compensation mode of the coding tree unit is achieved, effectively accelerating the sample compensation processing speed of the coding frame.

[0051] Step S103: In response to the judgment result of skipping sample compensation, skipping sample compensation of the coding tree unit.

[0052] Step S104 : In response to the judgment result of not skipping sample compensation, determining the compensation mode to be traversed according to the coding sub-block type and the video scene.

[0053] Among them, the preset compensation mode in step S105 can be a possible compensation mode provided by the sample adaptive compensation technology, and the compensation mode to be traversed can be a compensation mode obtained by deleting and simplifying the aforementioned possible compensation mode in the embodiment of the present application. For example, if the sample compensation of the current coding tree unit is not skipped under the judgment condition of step S102, the current coding tree unit may correspond to multiple preset compensation modes, and the optimal compensation mode is selected for compensation by traversing multiple preset compensation modes. In this way, the preset compensation mode can be simplified by combining the coding sub-block type and the video scene to achieve the effect of accelerating the compensation processing. Specifically, the sample adaptive compensation technology in the embodiment of the present application includes boundary compensation technology and sideband compensation technology. Among them, the boundary compensation technology corresponds to 4 compensation modes, namely horizontal mode, vertical mode, 135° direction mode and 45° direction mode. In each compensation mode, a one-dimensional three-pixel template is used to further classify pixels into five categories based on the size relationship between the current pixel and its two adjacent pixels: valley, concave corner, convex corner, peak, and other. Valleys are clearly concave, and concave corners are unidirectionally concave. Both require positive compensation values ​​to achieve a smooth transition between the three pixels. Concave corners are unidirectionally convex, and peaks are clearly convex. Both require negative compensation values ​​to reduce the protrusion of the current pixel. Other scenarios represent less obvious categories and are not specifically addressed. Consequently, boundary compensation technology classifies 21 categories under different compensation modes, each using a different compensation value. Computing all categories requires a high computational cost. Furthermore, sideband compensation technology classifies pixels based on their intensity. For example, using 8-bit video encoding, sideband compensation divides the 256 pixel values ​​from 0 to 255 into 32 sidebands, each containing eight consecutive pixel values. Sideband compensation requires the encoder to perform statistical and averaging calculations on the pixel values ​​within a specific sideband. The difference between the original and reconstructed pixel mean values ​​is then transmitted to the decoder, where it is applied to the corresponding sideband to minimize pixel distortion. If both edge compensation and sideband compensation are considered, a single pixel can have 53 preset compensation modes. This makes sample-adaptive compensation a speed bottleneck on the encoder.

[0054] In one embodiment, the coding sub-block types include skipped and non-skipped types. The more skipped coding sub-blocks a coding tree unit contains, the smaller the distortion caused by simplifying the number of preset compensation modes to be traversed. Furthermore, the simplified preset compensation modes are selected in conjunction with the video scene to better fit the content characteristics of the video frame in which the coding tree unit is located. Optionally, FIG3 is a flowchart of a method for determining compensation modes to be traversed provided in an embodiment of the present application. As shown in FIG3 , the specific implementation process is as follows:

[0055] Step S1041: Count the percentage of skipped coding sub-blocks in the coding tree unit.

[0056] In one embodiment, the current coding tree unit can be divided into 256 coding sub-blocks with a size of 4×4. A cache matrix cuType can be generated corresponding to the 256 coding sub-blocks, wherein the element with a value of 1 in the cache matrix cuType indicates that the corresponding coding sub-block type is a skip type, and the element with a value of 0 indicates that the corresponding coding sub-block type is a non-skipped type. Then, by counting the element values ​​of the cache matrix, the ratio of the skipped coding sub-blocks, skipRatio, can be calculated. The calculation formula is as follows:

[0057] Where i is the index of the coding sub-block of size 4×4.

[0058] Step S1042: determining a compensation mode to be traversed based on the ratio value, the set skip threshold, and the video scene.

[0059] Among them, the skip threshold can be the middle value for dividing the value interval [0,1] of the proportion value into subintervals, and can include one or more. The size of the skip threshold determines the interval length of the corresponding subinterval. It can be understood that the value range of the proportion value calculated in step S1041 is [0,1]. The interval [0,1] can be divided into different subintervals by setting the skip threshold. The number of simplifications of the preset compensation mode corresponding to each subinterval is different. After determining the number of simplifications of the preset compensation mode, the preset compensation mode to be simplified is selected by distinguishing different video scenes, and then the compensation mode to be traversed is determined from all the preset compensation modes.

[0060] In one embodiment, the skip threshold includes a first skip threshold and a second skip threshold, wherein the first skip threshold is less than the second skip threshold. FIG4 is a flowchart of another method for determining a compensation mode to be traversed provided by an embodiment of the present application. As shown in FIG4 , the specific implementation process is as follows:

[0061] Step S10421: When the proportion value is less than or equal to the first skip threshold, the first preset mode is deleted from the preset compensation modes to obtain a compensation mode to be traversed;

[0062] Step S10422: If the proportion is greater than the first skip threshold and less than the second skip threshold, determine a second preset mode to be skipped based on the video scene, delete the second preset mode from the preset compensation modes to obtain compensation modes to be traversed, and the number of second preset modes is greater than the number of first preset modes;

[0063] Step S10423: When the proportion value is greater than or equal to the second skip threshold, skip the sample compensation of the coding tree unit.

[0064] Among them, the first preset mode and the second preset mode can both be compensation modes that can be simplified through calculation and judgment in the preset compensation mode. The number of compensation modes of the first preset mode and the second preset mode is different, and is set according to the specific degree of simplification. It can be understood that the sample compensation of the current coding tree unit needs to be performed in both luminance and chrominance dimensions, that is, the boundary compensation mode and the sideband compensation mode need to be considered in the luminance dimension, and the boundary compensation mode and the sideband compensation mode need to be considered in the chrominance dimension. Therefore, the simplification of the preset compensation modes to be traversed also needs to consider these two dimensions at the same time. For example, if the proportion value is less than or equal to the first skip threshold Th_min, that is, it is between the sub-interval [0, Th_min], then the area occupied by the skip-type coding sub-block in the current coding tree unit is small, and a conservative level 1 mode simplification can be adopted, that is, deleting the first preset mode to obtain the compensation mode to be traversed, where the first preset mode is all sideband compensation modes of luminance and all sideband compensation modes of chrominance. If the percentage is greater than the first skip threshold Th_min and less than the second skip threshold Th_max, that is, it lies within the subinterval (Th_min, Th_max), the area of ​​the skipped coding sub-blocks in the current coding tree unit is moderate, and a two-level mode simplification can be applied. Specifically, the second preset mode is deleted to obtain the compensation mode to be traversed. The second preset mode is the all-sideband compensation mode for luma and all-sideband compensation modes for chroma, and the luma boundary compensation mode is reduced by half, and the chroma boundary compensation mode is reduced by one. For example, in video conferencing and video calling scenarios, where the image texture is simple, the 135° and 45° direction modes of the boundary compensation mode can be reduced in the luma dimension, and the 45° direction mode of the boundary compensation mode can be reduced in the chroma dimension. If the percentage is greater than or equal to the second skip threshold Th_max, that is, it lies within the subinterval [Th_max, 1], the area of ​​the skipped coding sub-blocks in the current coding tree unit is large, and sample compensation processing can be skipped.

[0065] Optionally, of course, the reduction of the aforementioned specific compensation mode is only an illustrative example. The embodiment of the present application can also perform reductions of different quantities and specific modes according to the characteristics of other specific scenarios, and the embodiment of the present application is not limited to this.

[0066] In one embodiment, the first skip threshold Th_min and the second skip threshold Th_max may be set based on empirical thresholds of experimental data, such as the first skip threshold Th min =0.5, the second skip threshold Th max =0.75;

[0067] In another embodiment, it is also possible to adjust based on the empirical thresholds of the first skip threshold and the second skip threshold, combined with the details of the specific video scene. For example, when the video scene is a preset detail video scene, the first skip threshold and the second skip threshold are increased, wherein the increase value of the first skip threshold is greater than the increase value of the second skip threshold. Taking the outdoor live broadcast scene as an example, since the outdoor live broadcast involves many scene details, such as flowers, grass, etc., you can choose to increase the first skip threshold Th_min and the second skip threshold Th_max, and reduce the interval length of the interval (Th_min, Th_max) to increase the probability of using the 1st level mode simplification, and reduce the probability of skipping the sample compensation processing, so as to achieve better compensation accuracy while improving the compensation processing speed. Specifically, the first skip threshold Th min =0.5, the second skip threshold Th max =0.75, then the interval [0,1] is divided into subintervals [0,0.5], (0.5,0.75) and [0.75,1], and the first skip threshold Th min Adjust to 0.6, the second skip threshold Th max Adjust it to 0.8, and get new sub-intervals [0,0.6], (0.6,0.8) and [0.8,1], which is equivalent to increasing the first skip threshold Th at the same time. min , and the second skip threshold Th max , and the interval length of (0.6, 0.8) is also smaller than the interval length of (0.5, 0.75), which increases the probability of adopting the first-level mode simplification and reduces the probability of skipping sample compensation processing.

[0068] Optionally, of course, the aforementioned skip threshold setting and adjustment of the skip threshold based on the scenario are merely illustrative examples. The embodiment of the present application may also perform other settings based on data statistics and other scenario characteristics, and the embodiment of the present application is not limited to this.

[0069] Step S105 : performing sample compensation processing on the coding tree unit based on the compensation modes to be traversed, where the number of the compensation modes to be traversed is less than the number of preset compensation modes.

[0070] For example, FIG5 is a flowchart of a method for performing sample compensation processing on a coding tree unit provided in an embodiment of the present application. As shown in FIG5 , the specific implementation process is as follows:

[0071] Step S1051: Calculate the cumulative mean value of compensation for each compensation category in each compensation mode to be traversed.

[0072] Specifically, after determining the compensation mode to be traversed in step S104, it is necessary to first determine the cumulative mean compensation of each compensation category under each compensation mode. Taking the horizontal mode and the vertical mode under the brightness dimension that need to be traversed as an example, first use a horizontal one-dimensional three-pixel template to classify each pixel in the current coding tree unit, determine which compensation category the pixel belongs to, such as valley, concave corner, convex corner, peak, and others, and calculate the compensation value of the pixel. Accumulate the compensation value of each pixel corresponding to the compensation category to which it belongs to obtain the total compensation value of the five compensation categories under the horizontal mode, and then average the total compensation value of each compensation category for all pixels belonging to the compensation category to obtain the average compensation value, that is, obtain the cumulative mean compensation of each compensation category. Then use a vertical one-dimensional three-pixel template to perform the same steps of traversal and accumulation to obtain the cumulative mean compensation of the five compensation categories under the vertical mode.

[0073] Step S1052: Calculate the total rate distortion cost corresponding to each compensation mode based on the compensation cumulative mean according to a preset cost calculation formula, and determine the compensation mode with the minimum total rate distortion cost as the optimal compensation mode.

[0074] Among them, the rate-distortion cost represents the minimum amount of information required to restore the output of the signal source with a preset distortion degree, and the average amount of information required for each signal source symbol. Specifically, in step S1051, the cumulative mean of compensation for each compensation category is calculated, and the distortion caused by the use of each cumulative mean of compensation can be determined according to the preset cost value calculation formula, and then the rate-distortion cost of each compensation category is determined, and finally the total rate-distortion cost corresponding to each compensation mode is determined. For example, the preset cost value calculation formula is as follows: J = D + λ mode ·R

[0075] Where D represents the distortion value in the current coding mode, R represents the bit rate value in the current coding mode, and λ mode is the Lagrangian factor. By combining the empirical value of entropy coding with the estimated value, the total rate-distortion cost of the five categories in the horizontal mode and the total rate-distortion cost of the five categories in the vertical mode are determined. The total rate-distortion costs of different modes are compared, and the mode with the lowest cost is selected as the optimal compensation mode.

[0076] Step S1053: Add the cumulative mean compensation values ​​of the various compensation categories in the optimal compensation mode to the pixel values ​​of the corresponding category of the coding tree unit.

[0077] Optionally, after completing the sample compensation of the current coding tree unit, the optimal supplementary mode corresponding to the luminance and chrominance of the current coding tree unit may be cached for use in obtaining the area information of the next coding tree unit.

[0078] As can be seen from the above, by obtaining the coding reference information of the coding tree unit and the corresponding video scene, and then determining whether to skip sample compensation for the coding tree unit based on the coding frame type and compensation mode information in the coding reference information; or in response to a determination result that sample compensation is skipped, skipping sample compensation for the coding tree unit; or in response to a determination result that sample compensation is not skipped, determining the compensation mode to be traversed based on the coding sub-block type and the video scene in the coding reference information; and finally performing sample compensation processing on the coding tree unit based on the compensation mode to be traversed, wherein the number of compensation modes to be traversed is less than the number of preset compensation modes. Using the above technical means, the importance of the current coding tree unit can be determined based on the coding frame type, and the necessity of compensation for the current coding tree unit can be determined based on the compensation mode information by comparing the compensation status of neighboring coding tree units. This allows a preliminary determination of whether compensation can be skipped, thereby achieving a preliminary acceleration effect. If skipping compensation is not possible, the compensation mode is further simplified based on the coding sub-block type and the video scene, taking into account the internal coding information of the coding tree unit and the content characteristics of the coding frame. This reduces computational overhead while slightly sacrificing compensation accuracy, effectively improving compensation processing speed.

[0079] FIG6 is a flow chart of another sample adaptive compensation method provided in an embodiment of the present application, which provides a process of performing boundary filling on the current coded frame after sample compensation processing, as shown in FIG6 , including:

[0080] Step S201: Obtain coding reference information of a coding tree unit and a corresponding video scene, where the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units;

[0081] Step S202: determining whether to skip sample compensation of the coding tree unit according to the coding frame type and compensation mode information;

[0082] Step S203: In response to the judgment result of skipping sample compensation, skipping sample compensation of the coding tree unit;

[0083] Step S204: In response to the judgment result of not skipping sample compensation, determining the compensation mode to be traversed according to the coding sub-block type and the video scene;

[0084] Step S205 : performing sample compensation processing on the coding tree unit based on the compensation modes to be traversed, where the number of the compensation modes to be traversed is less than the number of preset compensation modes.

[0085] Step S206: When the coding tree unit is a boundary unit, determine a boundary filling direction based on the position of the coding tree unit;

[0086] Step S207: Fill the boundaries of pixels in the boundary filling direction.

[0087] In one embodiment, when the current coding tree unit is at the beginning of the current unit row, after sample compensation is completed, the updated pixel value needs to be padded to the left boundary. When the current coding tree unit is at the end of the current unit row, the updated pixel value needs to be padded to the right boundary. This ensures that when the motion vector points to an area outside the current coding frame, the correct reference pixel value can still be obtained, avoiding coding errors. In addition, the above-mentioned boundary filling process is not only applicable to the sample adaptive compensation method of the embodiment of the present application, but also applicable to the sample adaptive compensation method provided by any embodiment of the present application.

[0088] FIG7 is a block diagram of a sample adaptive compensation device provided in an embodiment of the present application. The device is configured to execute the sample adaptive compensation method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. As shown in FIG7 , the device specifically includes:

[0089] An acquisition module 101 is configured to acquire coding reference information of a coding tree unit and a corresponding video scene, wherein the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units;

[0090] A determination module 102 is configured to determine whether to skip sample compensation of a coding tree unit according to a coding frame type and compensation mode information;

[0091] The overall skip module 103 is configured to skip sample compensation of the coding tree unit in response to a judgment result of skipping sample compensation;

[0092] The mode simplification module 104 is configured to determine a compensation mode to be traversed according to the coding sub-block type and the video scene in response to the judgment result of not skipping sample compensation;

[0093] The sample compensation module 105 is configured to perform sample compensation processing on the coding tree unit based on the compensation modes to be traversed, where the number of the compensation modes to be traversed is less than the number of preset compensation modes.

[0094] As can be seen from the above scheme, by obtaining the coding reference information of the coding tree unit and the corresponding video scene, and then determining whether to skip sample compensation for the coding tree unit based on the coding frame type and compensation mode information in the coding reference information; or in response to the judgment result of skipping sample compensation, skipping sample compensation for the coding tree unit; or in response to the judgment result of not skipping sample compensation, determining the compensation mode to be traversed based on the coding sub-block type and video scene in the coding reference information; finally, performing sample compensation processing on the coding tree unit based on the compensation mode to be traversed, wherein the number of compensation modes to be traversed is less than the number of preset compensation modes. Using the above technical means, the importance of the current coding tree unit can be determined based on the coding frame type, and the necessity of compensation for the current coding tree unit can be determined based on the compensation status of neighboring coding tree units based on the compensation mode information, thereby preliminarily determining whether to skip compensation, thereby achieving a preliminary acceleration effect. If skipping compensation is not possible, the compensation mode is further simplified based on the coding sub-block type and video scene, taking into account the internal coding information of the coding tree unit and the content characteristics of the coding frame, thereby saving computational overhead and effectively improving the compensation processing speed while slightly sacrificing compensation accuracy.

[0095] In a possible embodiment, the determination module 102 is specifically configured as follows:

[0096] When the coding frame type is an I frame, determining a sample compensation for skipping a coding tree unit;

[0097] When the coding frame type is a B frame and the compensation mode information records skip compensation, determining sample compensation for skipping the coding tree unit;

[0098] When the coding frame type is a P frame, the compensation mode information records skip compensation, and the division depth of the coding tree unit is not greater than a preset value, it is determined to skip sample compensation of the coding tree unit.

[0099] In a possible embodiment, the coding tree unit is pre-divided into a plurality of coding sub-blocks, each coding sub-block corresponds to a coding sub-block type, and the coding sub-block type includes a skip type and a non-skip type. The mode simplification module 104 is specifically configured as follows:

[0100] Count the percentage of skipped coding sub-blocks in the coding tree unit;

[0101] The compensation mode to be traversed is determined based on the ratio value, the set skip threshold, and the video scene.

[0102] In a possible embodiment, the skip threshold includes a first skip threshold and a second skip threshold, the first skip threshold is less than the second skip threshold, and the mode simplification module 104 is specifically configured as follows:

[0103] When the proportion value is less than or equal to the first skip threshold, deleting the first preset mode from the preset compensation modes to obtain the compensation mode to be traversed;

[0104] When the proportion value is greater than the first skip threshold and less than the second skip threshold, determining a second preset mode to be skipped based on the video scene, deleting the second preset mode from the preset compensation modes to obtain compensation modes to be traversed, and the number of the second preset modes is greater than the number of the first preset modes;

[0105] When the ratio is greater than or equal to the second skip threshold, sample compensation of the coding tree unit is skipped.

[0106] In a possible embodiment, the pattern simplification module 104 is further configured to:

[0107] When the video scene is a preset detail video scene, the first skip threshold and the second skip threshold are increased, wherein the increase value of the first skip threshold is greater than the increase value of the second skip threshold.

[0108] In a possible embodiment, the sample point compensation module 105 is specifically configured as follows:

[0109] Calculate the cumulative mean of compensation for each compensation category under each compensation mode in the compensation mode to be traversed;

[0110] According to a preset cost calculation formula, the total rate distortion cost corresponding to each compensation mode is calculated based on the compensation cumulative mean value, and the compensation mode with the smallest total rate distortion cost is determined as the optimal compensation mode;

[0111] The cumulative mean of compensation of each compensation category under the optimal compensation mode is added to the pixel value of the corresponding category of the coding tree unit.

[0112] In a possible embodiment, the apparatus further includes a boundary filling module 106 configured to:

[0113] In the case where the coding tree unit is a boundary unit, determining a boundary filling direction based on a position of the coding tree unit;

[0114] Fill the border of pixels in the border filling direction.

[0115] Figure 8 is a schematic diagram of the structure of a sample point adaptive compensation device provided in an embodiment of the present application. As shown in Figure 8, the device includes a processor 201, a memory 202, an input device 203, and an output device 204. The device may include one or more processors 201, with one processor 201 being used as an example in Figure 8. The processor 201, memory 202, input device 203, and output device 204 in the device may be connected via a bus or other means, with bus connection being used as an example in Figure 8. Memory 202, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the sample point adaptive compensation method in the embodiment of the present application. Processor 201 executes the software programs, instructions, and modules stored in memory 202 to execute various functional applications and data processing of the device, thereby implementing the sample point adaptive compensation method described above. Input device 203 can be configured to receive input digital or character information and generate key signal input related to user settings and function control of the device. Output device 204 may include a display device such as a display screen.

[0116] 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 configured to perform a sample adaptive compensation method described in the above embodiment, which includes:

[0117] Obtaining coding reference information of a coding tree unit and a corresponding video scene, wherein the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units;

[0118] determining whether to skip sample compensation of the coding tree unit according to the coding frame type and the compensation mode information;

[0119] In response to a determination result of skipping sample compensation, skipping sample compensation of the coding tree unit;

[0120] In response to a determination result that sample compensation is not skipped, determining a compensation mode to be traversed according to the coding sub-block type and the video scene;

[0121] Sample compensation processing is performed on the coding tree unit based on the compensation modes to be traversed, and the number of the compensation modes to be traversed is less than the number of preset compensation modes.

[0122] It is worth noting that in the above-mentioned embodiment of the sample adaptive compensation device, 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 functional units are only for the convenience of distinguishing each other and are not configured to limit the scope of protection of the embodiments of the present application.

[0123] In some possible implementations, various aspects of the methods 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 configured to cause the computer device to perform the steps of the methods 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 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. Sample point adaptive compensation method, where: include: Acquire coding reference information of a coding tree unit and a corresponding video scene, wherein the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units; Determine whether to skip sample compensation of the coding tree unit according to the coding frame type and the compensation mode information; In response to a determination result of skipping sample compensation, skipping sample compensation of the coding tree unit; In response to a determination result that sample compensation is not skipped, determining a compensation mode to be traversed according to the coding sub-block type and the video scene; The coding tree unit is subjected to sample point compensation processing based on the compensation modes to be traversed, wherein the number of the compensation modes to be traversed is less than the number of preset compensation modes.

2. The sample point adaptive compensation method according to claim 1, wherein: The determining whether to skip sample compensation of the coding tree unit according to the coding frame type and the compensation mode information includes: When the coding frame type is an I frame, determining a sample compensation for skipping the coding tree unit; When the coding frame type is a B frame and the compensation mode information records skip compensation, determining to skip sample compensation of the coding tree unit; When the coding frame type is a P frame, skip compensation is recorded in the compensation mode information, and the division depth of the coding tree unit is not greater than a preset value, it is determined to skip sample compensation of the coding tree unit.

3. The sample point adaptive compensation method according to claim 1, wherein: The coding tree unit is pre-divided into a plurality of coding sub-blocks, each coding sub-block corresponds to a coding sub-block type, the coding sub-block type includes a skip type and a non-skip type, and determining the compensation mode to be traversed according to the coding sub-block type and the video scene includes: Counting the proportion of skipped coding sub-blocks in the coding tree unit; The compensation mode to be traversed is determined based on the proportion value, the set skip threshold and the video scene.

4. The sample point adaptive compensation method according to claim 3, wherein: The skip threshold includes a first skip threshold and a second skip threshold, the first skip threshold is less than the second skip threshold, and the determining of the compensation mode to be traversed based on the proportion value, the set skip threshold and the video scene includes: When the proportion value is less than or equal to the first skip threshold, the first preset mode is deleted from the preset compensation modes to obtain a compensation mode to be traversed; When the proportion value is greater than the first skip threshold and less than the second skip threshold, determining a second preset mode to be skipped based on the video scene, deleting the second preset mode from the preset compensation mode to obtain a compensation mode to be traversed, and the number of the second preset modes is greater than the number of the first preset modes; When the proportion value is greater than or equal to the second skip threshold, sample compensation of the coding tree unit is skipped.

5. The sample point adaptive compensation method according to claim 4, wherein: The sample point adaptive compensation method also includes: In a case where the video scene is a preset detail video scene, the first skip threshold and the second skip threshold are increased, wherein the increase value of the first skip threshold is greater than the increase value of the second skip threshold.

6. The sample point adaptive compensation method according to any one of claims 1 to 5, wherein: The performing sample point compensation processing on the coding tree unit based on the compensation mode to be traversed includes: Calculate the cumulative mean of compensation for each compensation category in each compensation mode to be traversed; According to a preset cost value calculation formula, based on the compensation cumulative mean, the total rate distortion cost corresponding to each compensation mode is calculated, and the compensation mode with the smallest total rate distortion cost is determined as the optimal compensation mode; The accumulated mean values ​​of compensation of each compensation category under the optimal compensation mode are added to the pixel values ​​of the corresponding category of the coding tree unit.

7. The sample point adaptive compensation method according to any one of claims 1 to 6, wherein: After performing sample point compensation processing on the coding tree unit based on the compensation mode to be traversed, the method further includes: In a case where the coding tree unit is a boundary unit, determining a boundary filling direction based on a position of the coding tree unit; The pixel boundaries are filled in the boundary filling direction.

8. Sample point adaptive compensation device, wherein: include: An acquisition module configured to acquire coding reference information of a coding tree unit and a corresponding video scene, wherein the coding reference information includes a coding frame type, a coding sub-block type, and compensation mode information of adjacent coding tree units; A determination module, configured to determine whether to skip sample compensation of the coding tree unit according to the coding frame type and the compensation mode information; an overall skipping module, configured to skip sample compensation of the coding tree unit in response to a judgment result of skipping sample compensation; A mode simplification module, configured to determine a compensation mode to be traversed according to the coding sub-block type and the video scene in response to a judgment result that sample compensation is not skipped; The sample compensation module is configured to perform sample compensation processing on the coding tree unit based on the compensation modes to be traversed, and the number of the compensation modes to be traversed is less than the number of preset compensation modes.

9. A sample point adaptive compensation device, wherein: one or more processors; The storage device is configured to store one or more programs, and 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 according to any one of claims 1 to 7.

10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the sample adaptive compensation method according to any one of claims 1 to 7 when executed by a computer processor.

11. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the sample adaptive compensation method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Sample point adaptive compensation method and device, equipment, storage medium and product

    CN116527944A

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

    CN107343199A

  • Sampling point adaptive offset filtering control method and image processing system thereof

    CN107707915A

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

    CN108259903A

  • Sampling point adaptive compensation mode rapid selection method and system, and terminal

    CN109462757A