Method, device and equipment for determining quantization parameter offset of video coding

Through adaptive quantization processing and intensity factor down-regulation, the problem of inability to effectively save bit rate and maintain user experience in the prior art is solved, and the bit rate saving and picture quality improvement of video encoding are achieved.

CN119450046APending Publication Date: 2025-02-14BIGO TECH PTE LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411395864.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the prior art, the AQ method, MBTree method or CUTree method cannot achieve the expected bit rate saving effect, nor can it maintain the user's subjective experience without significant decline.

Method used

By obtaining the video frame to be processed, it is subjected to adaptive quantization processing, and the reference quantization parameter offset of each coded block is obtained, and the reference intervention value is determined based on this. In the encoding block that meets specific conditions, the intensity factor is down-regulated and the target quantization parameter offset is determined based on the down-regulated intensity factor to achieve bit rate saving or image quality improvement.

Benefits of technology

Effectively utilize the bit rate allocation information of adaptive quantization processing, adjust the intensity factor of block-level quantization processing, and ensure that the subjective experience does not drop significantly, and achieve bit rate saving or picture quality improvement at the same bit rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450046A_ABST
    Figure CN119450046A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video coding quantization parameter offset determination method, device and equipment, and the method comprises the steps: obtaining a to-be-processed video frame, carrying out the adaptive quantization processing of the to-be-processed video frame, and obtaining the reference quantization parameter offset of each coding block in the to-be-processed video frame; determining a reference intervention value based on a reference quantization parameter offset of the coded block; in the process of performing block-level quantization processing on each coding block, under the condition that the current coding block meets the condition that the reference quantization parameter offset is greater than the reference intervention value, reducing the intensity factor corresponding to the current coding block; and determining a target quantization parameter offset of the current coding block based on the down-regulated intensity factor, a set function mapping relation and preset information of the current coding block, and using the target quantization parameter offset to perform video coding of the to-be-processed video frame. According to the scheme, under the condition that the subjective experience is not obviously reduced, the code rate is saved, or the subjective image quality is improved under the same code rate.
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 processing technology, and in particular to a method, apparatus and device for determining a quantization parameter offset of video coding. Background Art

[0002] At present, compared with simple media information such as text and pictures, video information occupies a higher bandwidth, which will cause many problems in actual application scenarios. For example, it increases the risk of freezing when playing terminal videos, increases the traffic cost of terminal video consumers, and increases the deployment cost of the content distribution network of video application providers. In order to reduce the above problems, it can be achieved by reducing the configured bit rate of video encoding, but directly reducing the configured bit rate of video encoding often reduces the viewing experience of the video and cannot guarantee the optimal overall benefit.

[0003] In the related art, the AQ (Adaptive Quantization) method, MBTree (Macroblock Tree) method or CUTree (Coding Unit Tree) method can be used to adjust the quantization parameters to achieve bit rate saving. Among them, the AQ method uses the characteristics that the human eye is more sensitive to flat areas and less sensitive to texture areas to redistribute the bit rate in the spatial domain, so that the subjective quality is better at the same bit rate, or the video bit rate is saved at the same subjective quality. However, under the overall coding framework, the bit rate allocation of the AQ method to the flat area is easily affected by the MBTree method or the CUTree method, and it is impossible to achieve the expected bit rate saving or guarantee the user's perception. The MBTree method or the CUTree method relies on the objective amount of information, and considers less about the subjective characteristics of the video. For the coding blocks in the visually insensitive area, a quantization parameter offset with a greater negative degree will still be given according to the rules, and the adjustment mechanism of the AQ method that tends to allocate more bit rates to the flat area cannot be continued, and the user's subjective experience and the bit rate saving effect cannot be effectively balanced. Summary of the invention

[0004] The embodiments of the present application provide a method, device and equipment for determining a quantization parameter offset for video coding, which solves the problem that the combined use of AQ method, MBTree method or CUTree method in the related art cannot achieve the expected bit rate saving effect, and cannot maintain the user's subjective experience without a significant decrease. It effectively utilizes the bit rate allocation information of adaptive quantization processing, reasonably adjusts the intensity factor of the coding block to perform block-level quantization processing, and ensures that the subjective experience is not significantly reduced, while saving the bit rate or improving the subjective image quality at the same bit rate.

[0005] In a first aspect, an embodiment of the present application provides a method for determining a quantization parameter offset for video coding, the method comprising:

[0006] Acquire a video frame to be processed, perform adaptive quantization processing on the video frame to be processed, and obtain a reference quantization parameter offset of each coding block in the video frame to be processed;

[0007] determining a reference intervention value based on a reference quantization parameter offset of the coding block;

[0008] In the process of performing block-level quantization processing on each of the coding blocks, when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered;

[0009] Based on the down-adjusted intensity factor, the set function mapping relationship and the preset information of the current coding block, a target quantization parameter offset of the current coding block is determined, so as to perform video encoding on the to-be-processed video frame based on the determined target quantization parameter offset.

[0010] In a second aspect, an embodiment of the present application further provides a device for determining a quantization parameter offset for video coding, the device comprising:

[0011] An acquisition module, configured to acquire a video frame to be processed;

[0012] A reference value determination module, configured to perform adaptive quantization processing on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed;

[0013] An intervention value determination module, configured to determine a reference intervention value based on a reference quantization parameter offset of the coding block;

[0014] an intensity factor down-adjusting module, configured to, in a process of performing block-level quantization processing on each of the coding blocks, down-adjust an intensity factor corresponding to the current coding block when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value;

[0015] The offset determination module is configured to determine the target quantization parameter offset of the current coding block based on the down-adjusted intensity factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0016] In a third aspect, an embodiment of the present application further provides a device for determining a quantization parameter offset for video coding, the device comprising:

[0017] one or more processors;

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

[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the quantization parameter offset of video encoding described in the embodiment of the present application.

[0020] 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 method for determining a quantization parameter offset for video encoding described in an embodiment of the present application.

[0021] 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 executes the method for determining the quantization parameter offset of video encoding described in the embodiment of the present application.

[0022] In an embodiment of the present application, by acquiring a video frame to be processed, adaptive quantization processing is performed on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed; a reference intervention value is determined based on the reference quantization parameter offset of the coding block; in the process of performing block-level quantization processing on each coding block, when the current coding block satisfies the condition that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered; based on the lowered intensity factor, the set function mapping relationship and the preset information of the current coding block, the target quantization parameter offset of the current coding block is determined, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset. In the above scheme, by determining the reference intervention value based on the reference quantization parameter offset of the coding block obtained by adaptive quantization processing of the video frame to be processed, the bit rate allocation information of the adaptive quantization processing can be effectively utilized, and the technical idea of ​​optimizing the bit rate allocation in the adaptive quantization processing is continued to adjust the intensity factor of the subsequent coding block to perform block-level quantization processing; by lowering the intensity factor corresponding to the current coding block that meets the intervention conditions, and determining the target quantization parameter offset based on the lowered intensity factor, the set function mapping relationship and the preset information of the current coding block, it can be ensured that the subjective experience is not significantly reduced, and the bit rate can be saved, or the subjective picture quality can be improved at the same bit rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a method for determining a quantization parameter offset for video coding provided by an embodiment of the present application;

[0024] Figure 2A flowchart of a method for determining a quantization parameter offset including a process for determining a reference intervention value provided in an embodiment of the present application;

[0025] Figure 3 A flowchart of a method for determining a quantization parameter offset including a process of lowering a strength factor corresponding to a current coding block provided in an embodiment of the present application;

[0026] Figure 4 A flowchart of a method for determining a quantization parameter offset including a process of lowering a strength factor in combination with whether a coding block is located in a non-protected area provided in an embodiment of the present application;

[0027] Figure 5 A flowchart of a method for determining a quantization parameter offset including a process of dividing a region of interest into a protection region and a non-protection region provided in an embodiment of the present application;

[0028] Figure 6 A flowchart of a method for determining a quantization parameter offset including a process of determining a low intervention intensity region and a high intervention intensity region provided in an embodiment of the present application;

[0029] Figure 7 A flowchart of a quantization parameter offset determination method including a process of determining whether to adjust a quantization parameter offset of a video frame to be processed is provided in an embodiment of the present application;

[0030] Figure 8 A structural block diagram of a device for determining a quantization parameter offset for video coding provided in an embodiment of the present application;

[0031] Fig. 9 A schematic diagram of the structure of a device for determining a quantization parameter offset for video coding provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.

[0033] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0034] The method for determining the quantization parameter offset of video coding provided in the embodiment of the present application can be applied to the video coding process to calculate the quantization parameter offset corresponding to each coding block in the video frame to be processed, and the quantization parameter offset can be used to adjust the baseline quantization parameter of the coding block, so as to achieve the purpose of bit rate redistribution. Taking streaming media services as an example, relevant application scenarios may include: video conferencing, video calls, indoor and outdoor live broadcasts, and short videos. The several application scenarios listed above are only exemplary and explanatory. In practical applications, the method for determining the quantization parameter offset of video coding can also be used in video coding in other scenarios, and the embodiment of the present application does not limit this. The method, device and equipment for determining the quantization parameter offset of video coding provided in the embodiment of the present application are intended to solve the problem that the joint use of AQ method, MBTree method or CUTree method in the related technology cannot achieve the expected bit rate saving effect, and cannot maintain the user's subjective experience without a significant decline.

[0035] In the method for determining the quantization parameter offset of video encoding provided in the embodiment of the present application, the execution subject of each step can be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as PC (Personal Computer), tablet computer and other terminal devices, and can also be servers and other devices, which are not limited in the embodiment of the present application.

[0036] In the related art, the AQ method uses the characteristic that the human eye is more sensitive to flat areas and insensitive to texture areas, and transfers the encoding bit rate from the texture area to the flat area to achieve the optimization of subjective video quality at the same bit rate level, or saves bit rate at the same subjective video quality. For example, the specific implementation steps of the AQ method include: 1. Calculate the texture intensity of each coding block using variance, autocovariance or edge density; 2. Determine the quantization parameter offset of each coding block according to an empirical formula; 3. After traversing all coding blocks of the video frame, correct the quantization parameter offset of each coding block according to the whole frame parameter information of the video frame. However, the AQ method has the following specific problems: 1. After executing the AQ method, the first case may be that the coding block in the flat area is assigned a negative quantization parameter offset, which can reduce its corresponding quantization parameter and increase the encoding bit rate, while the texture area is assigned a positive quantization parameter offset, which can increase its corresponding quantization parameter and reduce the encoding bit rate. The second case may be that all coding blocks are assigned a negative quantization parameter offset, and the quantization parameter offset assigned to the coding block in the flat area is more negative than that of the coding block in the texture area. Therefore, in the second case, the overall reduction of the quantization parameter increases the encoding bit rate of the video frame, and the purpose of saving bit rate cannot be achieved. 2. The AQ method analyzes and makes decisions for the entire video frame. When there is a ROI (Region of Interest) in the video frame, the AQ method does not distinguish the ROI, and transfers more encoding bit rate from the high texture area to the flat area, which will affect the quality of the texture area or detail area in the ROI.

[0037] In addition, the MBTree method or the CUTree method will assign a more negative quantization parameter offset to the coding blocks that are referenced more frequently, thereby reducing their quantization parameters and achieving the purpose of improving their encoding quality. At the same time, their encoding bit rate is also increased accordingly. For example, the specific implementation steps of the CUTree method include: 1. Calculate the amount of information carried by each coding block in the video frame, and determine the amount of redundant information in the information carried by each coding block that can be removed by referring to the previous frame. The size of the redundant information represents the importance of the referenced coding block; 2. Quantitatively evaluate the importance of the referenced coding block, and record the redundant information to the contribution of the referenced coding block. If the referenced block is a complete coding block in the grid, for example, a 16x16 coding block, then the redundant information will be fully included in the contribution of the coding block; if the referenced block covers 2 or 4 adjacent coding blocks in the grid, then the redundant information can be distributed to each covered coding block according to the area ratio; 3. The contribution of each coding block in the referenced frame can be calculated by scanning the video frame; 4. According to the amount of information carried by each coding block in the video frame and its corresponding contribution, the quantization parameter offset of the coding block can be determined, and the quantization parameter offset is negative. However, the CUTree method has the following specific problems: 1. The more contributions a coding block is referenced to, the more negative the quantization parameter offset assigned to the coding block is. The formula for calculating the quantization parameter offset can be expressed as: QP Offset =strength*f(x,z,others), where QP Offset is the quantization parameter offset, strength is the strength factor with a positive numerical sign, f(x,z,others) is the function mapping relationship with a negative result, x is the amount of information in the coding block, z is the contribution of the coding block, and others is other information. 2. The quantization parameter offset calculated by the CUTree method often depends on the objective amount of information, and pays less attention to subjective characteristics. For coding blocks in visually insensitive areas, a more negative quantization parameter offset will still be given according to the rules, which cannot continue the adjustment mechanism of the AQ method that tends to allocate more bitrate to flat areas.

[0038] Based on this, the embodiments of the present application provide a method, device and equipment for determining the quantization parameter offset of video encoding, which solves the problem that the combined use of AQ method, MBTree method or CUTree method in the related technology cannot achieve the expected bit rate saving effect, and cannot maintain the user's subjective experience without obvious decline.

[0039] Figure 1 The present invention provides a flowchart of a method for determining a quantization parameter offset for video coding. Figure 1 As shown, the following steps are included:

[0040] Step S101: obtaining a video frame to be processed, performing adaptive quantization processing on the video frame to be processed, and obtaining a reference quantization parameter offset of each coding block in the video frame to be processed.

[0041] Among them, adaptive quantization processing can be a related processing step for executing the aforementioned AQ method, wherein the specific reference index for calculating texture intensity, preset empirical formula, etc. can be adaptively selected by the developer according to different encoding scenarios and encoding requirements, and this application does not limit this.

[0042] Step S102: Determine a reference intervention value based on a reference quantization parameter offset of a coding block.

[0043] Among them, the adaptive quantization processing uses the characteristic that the human eye is more sensitive to flat areas but less sensitive to texture areas to redistribute the bit rate in the spatial domain. The corresponding calculation results can be used as reference information for the subsequent adjustment of the intensity factor of the block-level quantization processing, so that the adjustment direction of the intensity factor conforms to the bit rate redistribution law of the adaptive quantization processing, that is, for the texture area, the intensity factor of the block-level quantization processing can be intervened, so that the obtained quantization parameter offset can reduce the degree of downward adjustment of the quantization parameter, so as to achieve the purpose of saving the bit rate, while for the flat area, it is chosen not to intervene in the intensity factor of the block-level quantization processing. In the calculation results corresponding to the adaptive quantization processing, the reference quantization parameter offset corresponding to the coding block located in the texture area is relatively higher in value than the reference quantization parameter offset corresponding to the coding block located in the flat area, thereby making the quantization parameter corresponding to the coding block in the texture area relatively larger and the encoding bit rate smaller. Therefore, a reference intervention value can be determined based on the reference quantization parameter offset of the coding block, and the reference intervention value can be used to distinguish whether the coding block is located in a texture area or a flat area. If the reference quantization parameter offset of the coding block is greater than the reference intervention value, the coding block can be regarded as being located in a texture area. If the reference quantization parameter offset of the coding block is less than or equal to the reference intervention value, the coding block can be regarded as being located in a flat area. In one embodiment, the mean of the reference quantization parameter offsets of all coding blocks can be calculated, and the mean can be determined as the reference intervention value. In one embodiment, the median of the reference quantization parameter offsets in all coding blocks can also be counted, and the mean of the reference quantization parameter offsets of all coding blocks can be calculated, and the median and the mean can be weighted to obtain the reference intervention value.

[0044] Step S103: in the process of performing block-level quantization processing on each coding block, if the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the strength factor corresponding to the current coding block is lowered.

[0045] The block-level quantization process may be a related process step of executing the aforementioned MBTree method or CUTre method, which is not limited in this application. Since the formula for calculating the quantization parameter offset in the block-level quantization process can be expressed as: QP Offset =strength*f(x,z,others), where QP Offset is the quantization parameter offset, strength is the strength factor with a positive numerical sign, f(x,z,others) is the function mapping relationship with a negative result, x is the amount of information of the coding block, z is the contribution of the coding block, and others is other information. Moreover, the more the contribution corresponding to the referenced coding block in the block-level quantization process, the greater the negative degree of the corresponding reference quantization parameter offset, which means that if the texture complexity of the coding block is high, the negative degree of the reference quantization parameter offset corresponding to the coding block will be relatively large, the quantization parameter is small, and the encoding bit rate is higher, which is contrary to the goal of reducing the bit rate of the texture area in the adaptive quantization process. Therefore, when the current coding block satisfies the reference quantization parameter offset greater than the reference intervention value, it can be regarded that the current coding block is located in the texture area that needs to be intervened in the video frame to be processed. The strength factor corresponding to the current coding block can be lowered to reduce the negative degree of the calculated quantization parameter offset and the quantization parameter becomes relatively larger, so as to achieve the purpose of saving the bit rate. In one embodiment, the strength factor corresponding to the current coding block can be lowered according to a set fixed ratio. In one embodiment, the reduction ratio corresponding to the intensity factor can be determined based on the difference between the reference quantization parameter offset of the current coding block and the reference intervention value and a preset quantitative relationship. For example, the product of the difference and the preset coefficient can be used as the reduction ratio, wherein the larger the difference, the larger the reduction ratio.

[0046] Step S104: determining a target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0047] Among them, after the current coding block completes the reduction of the intensity factor, the target quantization parameter offset can be calculated according to the formula for calculating the quantization parameter offset in the block-level quantization processing. The preset information can be the amount of information, contribution and other relevant information of the current coding block. The function mapping relationship can be set by the block-level quantization processing method selected by the developer according to different coding scenarios and coding requirements, and this application is not limited here. In addition, for the current coding block that satisfies the reference quantization parameter offset greater than the reference intervention value, it is necessary to reduce the intensity factor before calculating the corresponding target quantization parameter offset, and for the current coding block that does not meet the reference quantization parameter offset greater than the reference intervention value, there is no need to adjust the intensity factor, and directly calculate the target quantization parameter offset. After calculating the target quantization parameter offset of each coding block, the benchmark quantization parameter corresponding to each coding block can be adjusted, and the video encoding of the video frame to be processed can be performed based on the adjusted benchmark quantization parameter, which can achieve the purpose of saving bit rate or improving subjective image quality at the same bit rate.

[0048] In the above, by acquiring a video frame to be processed, adaptive quantization processing is performed on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed; a reference intervention value is determined based on the reference quantization parameter offset of the coding block; in the process of performing block-level quantization processing on each coding block, when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered; based on the lowered intensity factor, the set function mapping relationship and the preset information of the current coding block, the target quantization parameter offset of the current coding block is determined, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset. In the above scheme, by determining the reference intervention value based on the reference quantization parameter offset of the coding block obtained by adaptive quantization processing of the video frame to be processed, the bit rate allocation information of the adaptive quantization processing can be effectively utilized, and the technical idea of ​​optimizing the bit rate allocation in the adaptive quantization processing is continued to adjust the intensity factor of the subsequent coding block to perform block-level quantization processing; by lowering the intensity factor corresponding to the current coding block that meets the intervention conditions, and determining the target quantization parameter offset based on the lowered intensity factor, the set function mapping relationship and the preset information of the current coding block, it can be ensured that the subjective experience is not significantly reduced, and the bit rate can be saved, or the subjective picture quality can be improved at the same bit rate.

[0049] Figure 2 A flowchart of a method for determining a quantization parameter offset including a process for determining a reference intervention value is provided in an embodiment of the present application. Figure 2 As shown, the following steps are included:

[0050] Step S201: Obtain a video frame to be processed, perform adaptive quantization processing on the video frame to be processed, and obtain a reference quantization parameter offset of each coding block in the video frame to be processed.

[0051] Step S202: Calculate the average value of the reference quantization parameter offset of the coding block to obtain a first offset average value.

[0052] Step S203: Filter out a first coding block from the coding blocks, where the reference quantization parameter offset is less than the first offset mean, and calculate the mean of the first quantization parameter offset corresponding to the first coding block to obtain a second offset mean.

[0053] Step S204: Calculate a reference intervention value according to the first offset mean value, the second offset mean value and the first preset parameter.

[0054] Among them, if the reference quantization parameter offset is greater than the first offset mean, it can be regarded as that the coding block is located in a region with more complex textures, and if the reference quantization parameter offset is less than the second offset mean, it can be regarded as that the coding block is located in a relatively flat region. Therefore, a reference intervention value can be determined between the first offset mean and the second offset mean to determine whether the coding block is in a texture region requiring intervention. In one embodiment, the intermediate value between the first offset mean and the second offset mean can be used as a reference value, and the setting amplitude of the reference value can be increased or decreased by the first preset parameter to calculate the reference intervention value. In one embodiment, the formula for calculating the reference intervention value is as follows:

[0055] Ot=Oavg-(Oavg-Oless)*f1

[0056] Wherein, Ot is a reference intervention value, Oavg is a first offset mean value, Oless is a second offset mean value, f1 is an adjustable first preset parameter, and the value range of f1 is [0,1].

[0057] Step S205: In the process of performing block-level quantization processing on each coding block, if the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the strength factor corresponding to the current coding block is lowered.

[0058] Step S206: determine a target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship, and preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0059] As described above, by determining the reference intervention value based on the first offset mean, the second offset mean and the first preset parameter, the numerical distribution characteristics of the reference quantization parameter offset can be combined to obtain a reference intervention value that can effectively distinguish whether the coding block is located in the texture area, which is beneficial to the subsequent targeted intervention of the strength factor of the coding block located in the texture area.

[0060] Figure 3 A flowchart of a method for determining a quantization parameter offset including a process of lowering the intensity factor corresponding to the current coding block provided in an embodiment of the present application. Figure 3 As shown, the following steps are included:

[0061] Step S301: Obtain a video frame to be processed, perform adaptive quantization processing on the video frame to be processed, and obtain a reference quantization parameter offset of each coding block in the video frame to be processed.

[0062] Step S302: Determine a reference intervention value based on a reference quantization parameter offset of a coding block.

[0063] Step S303: During the block-level quantization processing for each coding block, when the reference quantization parameter offset of the current coding block satisfies the condition that the reference quantization parameter offset is greater than the reference intervention value, the reference difference value is obtained by subtracting the reference quantization parameter offset of the current coding block from the reference intervention value.

[0064] Among them, the reference difference value can be used to characterize the degree of offset of the reference quantization parameter offset relative to the reference intervention value. The larger the offset, the more complex the texture of the area where the coding block is located, and the smaller the offset, the flatter the area where the coding block is located.

[0065] Step S304: Calculate the reduction amplitude of the strength factor corresponding to the current coding block according to the reference difference value and the second preset parameter, wherein the larger the reference difference value, the larger the corresponding reduction amplitude.

[0066] Among them, the larger the reference difference value corresponding to the coding block, the more complex the texture of the area where it is located, and the corresponding downward adjustment amplitude of the intensity factor can be increased accordingly, so as to better save the bit rate without losing the subjective video quality. In one embodiment, the downward adjustment amplitude can be the product of the reference difference value and the first preset parameter. In one embodiment, a preset limit value can be set to constrain the downward adjustment intensity. If the reference difference value is greater than the preset limit value, the downward adjustment amplitude can be the product of the preset limit value and the first preset parameter; if the reference difference value is less than or equal to the preset limit value, the downward adjustment amplitude can be the product of the reference difference value and the first preset parameter, thereby avoiding excessive downward adjustment of the intensity factor and affecting the encoding quality.

[0067] Step S305: lowering the intensity factor based on the lowering amplitude.

[0068] In one embodiment, the calculation formula of the downward adjustment intensity factor is as follows:

[0069] strength1=strength*(1-f2*(QP Offset -Ot))

[0070] Among them, strength1 is the target strength factor, strength is the original strength factor, f2 is the adjustable first preset coefficient and its value range is (0,1), QP Offset is the reference quantization parameter offset, and Ot is the reference intervention value.

[0071] In order to avoid excessive downward adjustment of the intensity factor, the maximum downward adjustment range may be constrained. In one embodiment, the calculation formula for downward adjustment of the intensity factor is as follows:

[0072] strength1=strength*(1-f2*min(QP Offset -Ot,f3))

[0073] Among them, strength1 is the target strength factor, strength is the original strength factor, f2 is the adjustable first preset coefficient and its value range is (0,1), f3 is the preset limit value and it is greater than 0, QP Offset is the reference quantization parameter offset, Ot is the reference intervention value. For example, f2=0.15, f2=3.

[0074] Step S306: determine the target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0075] As described above, by determining the reduction amplitude of the intensity factor corresponding to the current coding block based on the reference difference and the second preset parameter, it is possible to effectively adapt to the texture complexity of the area where the coding block is located, and control the reduction strength of the intensity factor. The more complex the texture of the area where the coding block is located, the greater the reduction strength of the intensity factor, the corresponding quantization parameter offset is reduced in negative direction, and the quantization parameter becomes relatively larger, which is conducive to better saving the encoding bit rate of texture areas with different complexities and ensuring the user's video viewing experience.

[0076] Figure 4 A flowchart of a method for determining a quantization parameter offset including a process of lowering the intensity factor in combination with whether a coding block is located in a non-protected area is provided in an embodiment of the present application. Figure 4 As shown, the following steps are included:

[0077] Step S401: Obtain a video frame to be processed.

[0078] Step S402: Adaptively quantize the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed.

[0079] Step S403: Determine a reference intervention value based on a reference quantization parameter offset of the coding block.

[0080] Step S404: perform region of interest detection on the video frame to be processed to determine at least one region of interest.

[0081] The region of interest may be a region in the video frame that the human eye is more sensitive to or more interested in, such as a face region, a specific object region, etc. Developers may select relevant regions based on the characteristics of the video content in the actual application scenario, and this application does not limit this. For example, the region of interest may be a face region, and the face detection algorithm may be set to detect at least one face region in the processed video frame.

[0082] Step S405: based on at least one region of interest, divide the to-be-processed video frame into a protection region and a non-protection region, wherein the protection region covers at least one region of interest.

[0083] Among them, although there may be a part with relatively high texture in the region of interest, the video viewer will still pay more attention to the texture area therein, and even the higher the texture complexity, the higher the degree of attention. For example, the region of interest is the face area, in which the human eye is an area with high texture complexity, and video viewers often pay more attention to it. Therefore, it is necessary to avoid saving the bit rate of the region of interest, which affects the viewing experience of the video viewer. Since the purpose of setting the reference intervention value is to save the bit rate of the coding block located in the high texture area, it is necessary to divide the video frame to be processed into a protection area and a non-protection area based on the region of interest. The protection area covers the region of interest in the video frame to be processed, and there is no need to participate in the adjustment of the subsequent intensity factor. In one embodiment, the region of interest in the video frame to be processed is continuous, and the obtained region of interest can be directly determined as the protection area. In one embodiment, the region of interest in the video frame to be processed is discontinuous. Since there may be associated interactive information between the parts of multiple regions of interest, it is also necessary to avoid participating in the adjustment of the subsequent intensity factor. All regions of interest and the intermediate area can be divided into protection areas together.

[0084] Step S406: During the block-level quantization process for each coding block, when the current coding block satisfies the condition that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered according to the region where the current coding block is located.

[0085] The area where the current coding block is located may include a protected area and a non-protected area. In one embodiment, if the current coding block is in the protected area, there is no need to adjust the intensity factor corresponding to the current coding block to avoid affecting the viewing experience of video viewers. In one embodiment, if the current coding block is in the non-protected area, the intensity factor corresponding to the current coding block may be lowered to reasonably save the encoding bit rate.

[0086] Step S407: determine the target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0087] As described above, by determining the region of interest obtained by detecting the video frame to be processed as the protection area, and only lowering the intensity factor of the coding blocks that simultaneously meet the intervention conditions and are located in the non-protection area, it is possible to effectively avoid saving the encoding bit rate of the region of interest, maintain the quality of the high texture area or detail area in the region of interest, and ensure the user's video viewing experience.

[0088] Figure 5 A flowchart of a method for determining a quantization parameter offset including a process of dividing a region of interest into a protected region and a non-protected region is provided in an embodiment of the present application. Figure 5 As shown, the following steps are included:

[0089] Step S501: Obtain a video frame to be processed.

[0090] Step S502: Adaptively quantize the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed.

[0091] Step S503: Determine a reference intervention value based on a reference quantization parameter offset of the coding block.

[0092] Step S504: perform region of interest detection on the video frame to be processed to determine at least one region of interest.

[0093] Step S505: determine the smallest continuous area covering at least one region of interest in the video frame to be processed as a protection area.

[0094] Among them, the minimum continuous area includes all regions of interest and associated regions between regions of interest. For example, there are two circular regions of interest in the video frame to be processed. In one embodiment, the associated region between the two regions of interest can be determined based on two tangent lines located on the same side of the two regions of interest, and the two regions of interest and the associated region can be determined as protection areas; in another embodiment, in order to facilitate calculation and processing, the circumscribed rectangular area of ​​the two regions of interest can be determined as the protection area. Of course, the above is only an exemplary description, and the developer can adjust the division method of the protection area according to the different annotation shapes of the regions of interest in the actual application scenario, and this application is not limited to this.

[0095] Step S506: Determine other areas in the to-be-processed video frame excluding the protected area as non-protected areas.

[0096] Step S507: During the block-level quantization process for each coding block, when the current coding block satisfies the condition that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered according to the region where the current coding block is located.

[0097] Step S508: determine the target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0098] As described above, by determining the minimum continuous area covering at least one region of interest as the protection area, the associated areas between the regions of interest can be added to the protection area, which is conducive to protecting more video content that users are concerned about and avoiding affecting user viewing experience due to bit rate saving.

[0099] Figure 6 A flowchart of a method for determining a quantization parameter offset including a process of determining a low intervention intensity region and a high intervention intensity region is provided in an embodiment of the present application. Figure 6 As shown, the following steps are included:

[0100] Step S601: Obtain a video frame to be processed.

[0101] Step S602: Adaptively quantize the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed.

[0102] Step S603: Determine a reference intervention value based on a reference quantization parameter offset of the coding block.

[0103] Step S604: perform region of interest detection on the video frame to be processed to determine at least one region of interest.

[0104] Step S605: determine the smallest continuous area covering at least one region of interest in the video frame to be processed as a protection area.

[0105] Step S606: determine the edge area of ​​the preset range adjacent to the protection area in the video frame to be processed as the low intervention intensity area.

[0106] Among them, since the edge area of ​​the preset range adjacent to the protection area can be regarded as the transition area between the protection area and the non-protection area, the video viewers may pay certain attention to it. Therefore, it can be determined as a low intervention intensity area to reduce the downward adjustment of the intensity factor and reduce the degree of bit rate saving. In one embodiment, if the protection area is a circular area, the radius of the circular area can be increased according to a preset ratio to obtain a reference circular area, and the annular area between the reference circular area and the circular area is determined as the edge area. In one embodiment, the protection area is a polygonal area, and n layer block areas outside the protection area can be determined as edge areas. For example, n<=3.

[0107] Step S607: Determine other areas in the to-be-processed video frame, excluding the protection area and the low intervention intensity area, as high intervention intensity areas.

[0108] Step S608, in the process of performing block-level quantization processing on each coding block, when the current coding block satisfies the condition that the reference quantization parameter offset is greater than the reference intervention value, if the current coding block is located in a low intervention intensity area, the intensity factor corresponding to the current coding block is lowered by a first preset amplitude; if the current coding block is located in a high intervention intensity area, the intensity factor corresponding to the current coding block is lowered by a second preset amplitude, and the second preset amplitude is greater than the first preset amplitude.

[0109] In one embodiment, the first preset amplitude may be a fixed ratio, and the second preset amplitude may be twice the first preset amplitude. In one embodiment, the calculation formula of the coding block down-adjustment intensity factor in the high intervention intensity area is as follows:

[0110] strength1=strength*(1-f2*min(QP Offset -Ot,f3))

[0111] Among them, strength1 is the target strength factor, strength is the original strength factor, f2 is the adjustable first preset coefficient and its value range is (0,1), f3 is the preset limit value and it is greater than 0, QP Offsetis the reference quantization parameter offset, Ot is the reference intervention value. Accordingly, the calculation formula for the down-adjustment strength factor of the coding block in the high intervention intensity area can be adjusted as follows: strength1 = strength*(1-(f2 / 2)*

[0112] min(QP Offset -Ot,f3)), thereby reducing the intervention intensity of the intensity factor.

[0113] Step S609: determine the target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0114] As mentioned above, by further dividing the non-protected areas into low intervention intensity areas and high intervention intensity areas, the division granularity of the intervention areas can be effectively refined, the intensity of the intensity factor reduction in the edge areas adjacent to the protected areas can be weakened, the bit rate saving of the coding blocks in the low intervention intensity areas can be reduced, and the user's subjective experience can be optimized.

[0115] Figure 7 The embodiment of the present application provides a flow chart of a method for determining a quantization parameter offset including a process of determining whether to adjust a quantization parameter offset of a video frame to be processed. Figure 7 As shown, the following steps are included:

[0116] Step S701, obtaining a video frame to be processed, and obtaining a plurality of quantization parameter increase values ​​corresponding to a preceding video frame group of the video frame to be processed, wherein the quantization parameter increase value is an adjustment value for increasing a frame-level quantization parameter when the preceding video frame meets a bit rate constraint condition.

[0117] Among them, the embodiment of the present application can be implemented based on a rate control framework combining CRF (Constant Rate Factor) and VBV (Video Buffer Verifier), wherein the use of CRF can make the video quality relatively constant, and the use of VBV can constrain the rate fluctuation range, and the combination of the two can achieve a better balance between video quality and rate stability. Since the embodiment of the present application aims to increase the quantization parameter by adjusting the quantization parameter offset corresponding to the block-level quantization processing, thereby achieving the purpose of saving the bit rate. However, if VBV underflow occurs during the actual encoding process, the VBV mechanism will also increase the frame-level quantization parameter, thereby avoiding or reducing VBV underflow, and the regulating effect of the VBV mechanism may overlap with the effect of adjusting the intensity factor in the embodiment of the present application, and the effect of saving the bit rate cannot be achieved. For example, by lowering the intensity factor in the embodiment of the present application, the quantization parameter of some coding blocks can be increased, thereby reducing the original encoding bit rate to the first encoding bit rate. However, due to the occurrence of VBV underflow, the VBV mechanism will reduce the first encoding bit rate to the second encoding bit rate. Then the related processing of lowering the intensity factor can be regarded as redundant, because the original encoding bit rate will eventually be adjusted to the second encoding bit rate due to the VBV mechanism, and the purpose of bit rate saving cannot be achieved. Based on this, multiple quantization parameter increase values ​​corresponding to the preceding video frame group of the video frame to be processed can be obtained as a basis for determining whether to adjust the intensity factor corresponding to the video frame to be processed. The preceding video frame group can be a Gop (Group of Picture), and the GOP can include a key frame and a series of non-key frames that depend on this key frame for encoding. The rate constraint condition can be that the video frame generates VBV underflow.

[0118] Step S702: Calculate the average of multiple quantization parameter increase values ​​to obtain a quantization parameter increase average value.

[0119] Among them, the quantization parameter upward adjustment mean can be used to determine the adjustment amplitude of the quantization parameter due to possible VBV underflow. The larger the quantization parameter upward adjustment mean, the larger the adjustment amplitude, and the worse the effect of reducing the intensity factor of the processed video frame to save bit rate.

[0120] In one embodiment, when the quantization parameter up-adjustment mean is greater than or equal to a preset threshold, the target quantization parameter offset of the current coding block is determined based on the strength factor corresponding to the current coding block, the set function mapping relationship and the preset information of the current coding block.

[0121] Among them, when the quantization parameter upward adjustment mean is greater than or equal to the preset threshold, it can be regarded that the relevant processing of the intensity factor of the processed video frame downward adjustment cannot achieve the purpose of bit rate saving, and the target quantization parameter offset can be generated according to the original intensity factor of the block-level quantization processing. In addition, if in the actual application scenario, in addition to saving bit rate, you can also choose to improve the subjective experience, you can increase the preset threshold.

[0122] In one embodiment, when the quantization parameter increase mean is greater than a preset threshold, if you still choose to continue to perform related processing on the intensity factor reduction of the video frame to be processed, the expected bit rate can be adjusted synchronously. For example, the calculated quantization parameter increase mean is 0.6dB, and the expected bit rate reduction ratio can be set to 0.6*0.2*Lambda, where Lambda is a control factor. Then, combined with the target quantization parameter offset obtained after reducing the intensity factor and the reduction ratio, the quantization parameter that meets the bit rate constraint condition can be obtained through bit rate control. At the same time, by increasing the quantization parameter of the coding block in the high texture area, the purpose of bit rate saving is met.

[0123] Step S703: When the quantization parameter upward adjustment mean is less than a preset threshold, adaptive quantization processing is performed on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed.

[0124] Step S704: Determine a reference intervention value based on a reference quantization parameter offset of the coding block.

[0125] Step S705: In the process of performing block-level quantization processing on each coding block, if the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the strength factor corresponding to the current coding block is lowered.

[0126] Step S706: determine the target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0127] As described above, by referring to the degree of adjustment of the frame-level quantization parameters of the previous video frame group due to meeting the bit rate constraint condition, the bit rate saving effect of the related processing of lowering the intensity factor of the processed video frame can be effectively estimated. When the mean value of the quantization parameter increase is less than the preset threshold, it can be regarded as that the related processing of lowering the intensity factor of the processed video frame can achieve a better bit rate saving effect, and the related processing of lowering the intensity factor is performed to avoid excessive redundant calculations when the bit rate cannot be effectively saved, thereby affecting the video encoding efficiency.

[0128] Figure 8This is a structural block diagram of a device for determining a quantization parameter offset for video coding provided in an embodiment of the present application. The device is configured to execute the method for determining a quantization parameter offset for video coding provided in the above embodiment, and has functional modules and beneficial effects corresponding to the execution method. Figure 8 As shown, the device comprises:

[0129] An acquisition module 101 is configured to acquire a video frame to be processed;

[0130] The reference value determination module 102 is configured to perform adaptive quantization processing on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed;

[0131] An intervention value determination module 103, configured to determine a reference intervention value based on a reference quantization parameter offset of a coding block;

[0132] The intensity factor down-adjusting module 104 is configured to, during the process of performing block-level quantization processing on each coding block, down-adjust the intensity factor corresponding to the current coding block when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value;

[0133] The offset determination module 105 is configured to determine the target quantization parameter offset of the current coding block based on the down-adjusted strength factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the processed video frame based on the determined target quantization parameter offset.

[0134] In the above, by acquiring a video frame to be processed, adaptive quantization processing is performed on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed; a reference intervention value is determined based on the reference quantization parameter offset of the coding block; in the process of performing block-level quantization processing on each coding block, when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered; based on the lowered intensity factor, the set function mapping relationship and the preset information of the current coding block, the target quantization parameter offset of the current coding block is determined, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset. In the above scheme, by determining the reference intervention value based on the reference quantization parameter offset of the coding block obtained by adaptive quantization processing of the video frame to be processed, the bit rate allocation information of the adaptive quantization processing can be effectively utilized, and the technical idea of ​​optimizing the bit rate allocation in the adaptive quantization processing is continued to adjust the intensity factor of the subsequent coding block to perform block-level quantization processing; by lowering the intensity factor corresponding to the current coding block that meets the intervention conditions, and determining the target quantization parameter offset based on the lowered intensity factor, the set function mapping relationship and the preset information of the current coding block, it can be ensured that the subjective experience is not significantly reduced, and the bit rate can be saved, or the subjective picture quality can be improved at the same bit rate.

[0135] In a possible embodiment, the intervention value determination module 103 is further configured to:

[0136] Calculating an average value of the reference quantization parameter offset of the coding block to obtain a first offset average value;

[0137] Filter out a first coding block from the coding blocks, which satisfies that the reference quantization parameter offset is less than the first offset mean, and calculate the mean of the first quantization parameter offset corresponding to the first coding block to obtain a second offset mean;

[0138] A reference intervention value is calculated according to the first offset mean, the second offset mean and the first preset parameter.

[0139] In a possible embodiment, the intensity factor down-adjustment module 104 is further configured to:

[0140] Subtracting the reference quantization parameter offset of the current coding block from the reference intervention value to obtain a reference difference value;

[0141] Calculate the reduction amplitude of the intensity factor corresponding to the current coding block according to the reference difference value and the second preset parameter, wherein the larger the reference difference value, the larger the corresponding reduction amplitude;

[0142] The intensity factor is adjusted downward based on the magnitude of the downward adjustment.

[0143] In a possible embodiment, a protection area determination module is further included, configured to:

[0144] Performing region of interest detection on the video frame to be processed to determine at least one region of interest;

[0145] Based on at least one region of interest, the video frame to be processed is divided into a protection area and a non-protection area, wherein the protection area covers at least one region of interest;

[0146] Accordingly, the intensity factor down-adjusting module 104 is further configured as follows:

[0147] According to the area where the current coding block is located, the strength factor corresponding to the current coding block is lowered.

[0148] In a possible embodiment, the protection area determination module is further configured to:

[0149] Determine a minimum continuous area covering at least one region of interest in a video frame to be processed as a protection area;

[0150] Other areas in the video frame to be processed, excluding the protection area, are determined as non-protection areas.

[0151] In a possible embodiment, the non-protected area includes a low intervention intensity area and a high intervention intensity area, and the protected area determination module is further configured to:

[0152] Determine an edge area of ​​a preset range adjacent to the protection area in the video frame to be processed as a low intervention intensity area;

[0153] Determine other areas of the video frame to be processed, excluding the protection area and the low intervention intensity area, as high intervention intensity areas;

[0154] Accordingly, the intensity factor down-adjusting module 104 is further configured as follows:

[0155] When the current coding block is located in the low intervention intensity area, the intensity factor corresponding to the current coding block is lowered by a first preset amplitude;

[0156] When the current coding block is located in a high intervention intensity region, the intensity factor corresponding to the current coding block is lowered by a second preset amplitude, where the second preset amplitude is greater than the first preset amplitude.

[0157] In a possible embodiment, it further includes:

[0158] The second acquisition module is configured as follows:

[0159] Acquire multiple quantization parameter increase values ​​corresponding to the preceding video frame group of the video frame to be processed, where the quantization parameter increase values ​​are adjustment values ​​for increasing the frame-level quantization parameters when the preceding video frame meets the bit rate constraint condition;

[0160] Mean calculation module, configured as:

[0161] Calculating the average of multiple quantization parameter increase values ​​to obtain a quantization parameter increase average value;

[0162] Accordingly, the reference value determination module 102 is further configured as follows:

[0163] When the quantization parameter upward adjustment mean is less than a preset threshold, adaptive quantization processing is performed on the video frame to be processed.

[0164] Fig. 9 A structural diagram of a device for determining a quantization parameter offset for video coding provided in an embodiment of the present application is shown in FIG. Fig. 9 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. Fig. 9 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Fig. 9 The example of connecting through a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for determining the quantization parameter offset of video coding 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 202, that is, implements the above-mentioned method for determining the quantization parameter offset of video coding. The 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. The output device 204 may include a display device such as a display screen.

[0165] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a method for determining a quantization parameter offset for video encoding described in the above embodiment, including: obtaining a video frame to be processed, performing adaptive quantization processing on the video frame to be processed, and obtaining a reference quantization parameter offset for each coding block in the video frame to be processed; determining a reference intervention value based on the reference quantization parameter offset of the coding block; in the process of performing block-level quantization processing on each coding block, when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, lowering the intensity factor corresponding to the current coding block; determining a target quantization parameter offset for the current coding block based on the lowered intensity factor, a set function mapping relationship, and preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

[0166] It is worth noting that in the embodiment of the above-mentioned video encoding quantization parameter offset determination 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 the corresponding functions can be achieved; 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 protection scope of the embodiments of the present application.

[0167] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps of the method according to various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the method for determining the quantization parameter offset of video coding recorded in the embodiment of the present application. The program product may be implemented in any combination of one or more readable media.

Claims

1. A method for determining a quantization parameter offset for video coding, characterized in that: include: Acquire a video frame to be processed, perform adaptive quantization processing on the video frame to be processed, and obtain a reference quantization parameter offset of each coding block in the video frame to be processed; determining a reference intervention value based on a reference quantization parameter offset of the coding block; In the process of performing block-level quantization processing on each of the coding blocks, when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value, the intensity factor corresponding to the current coding block is lowered; Based on the down-adjusted intensity factor, the set function mapping relationship and the preset information of the current coding block, a target quantization parameter offset of the current coding block is determined, so as to perform video encoding on the to-be-processed video frame based on the determined target quantization parameter offset.

2. The method for determining a quantization parameter offset for video coding according to claim 1, characterized in that: The determining a reference intervention value based on a reference quantization parameter offset of the coding block includes: Calculating an average value of the reference quantization parameter offset of the coding block to obtain a first offset average value; Filter out a first coding block satisfying that a reference quantization parameter offset is less than the first offset mean from the coding blocks, and calculate the mean of the first quantization parameter offsets corresponding to the first coding block to obtain a second offset mean; A reference intervention value is calculated according to the first offset mean value, the second offset mean value and a first preset parameter.

3. The method for determining a quantization parameter offset for video coding according to claim 1, characterized in that: The step of lowering the strength factor corresponding to the current coding block includes: Subtracting the reference quantization parameter offset of the current coding block from the reference intervention value to obtain a reference difference value; Calculate the reduction amplitude of the intensity factor corresponding to the current coding block according to the reference difference value and the second preset parameter, wherein the larger the reference difference value, the larger the corresponding reduction amplitude; The intensity factor is adjusted downward based on the magnitude of the downward adjustment.

4. The method for determining a quantization parameter offset for video coding according to claim 1, wherein: Before performing block-level quantization processing on each coding block, the method further includes: Performing region of interest detection on the video frame to be processed to determine at least one region of interest; Based on the at least one region of interest, the to-be-processed video frame is divided into a protection region and a non-protection region, wherein the protection region covers the at least one region of interest; Correspondingly, the step of lowering the strength factor corresponding to the current coding block includes: According to the area where the current coding block is located, the strength factor corresponding to the current coding block is lowered.

5. The method for determining a quantization parameter offset for video coding according to claim 4, characterized in that: The step of dividing the to-be-processed video frame into a protection area and a non-protection area based on the at least one region of interest comprises: Determine a minimum continuous area covering the at least one region of interest in the to-be-processed video frame as a protection area; Other areas in the to-be-processed video frame excluding the protection area are determined as non-protection areas.

6. The method for determining a quantization parameter offset for video coding according to claim 5, characterized in that: The non-protected area includes a low intervention strength area and a high intervention strength area, and determining other areas in the to-be-processed video frame excluding the protected area as the non-protected area includes: Determine an edge area of ​​a preset range adjacent to the protection area in the to-be-processed video frame as a low intervention intensity area; Determine other areas of the to-be-processed video frame excluding the protection area and the low intervention intensity area as high intervention intensity areas; Correspondingly, the step of lowering the strength factor corresponding to the current coding block according to the area where the current coding block is located includes: When the current coding block is located in the low intervention intensity area, the intensity factor corresponding to the current coding block is lowered by a first preset amplitude; When the current coding block is located in the high intervention intensity area, the intensity factor corresponding to the current coding block is lowered by a second preset amplitude, and the second preset amplitude is greater than the first preset amplitude.

7. The method for determining a quantization parameter offset for video coding according to claim 1, characterized in that: Before the adaptive quantization processing is performed on the video frame to be processed, the method further includes: Acquire multiple quantization parameter increase values ​​corresponding to the preceding video frame group of the video frame to be processed, wherein the quantization parameter increase values ​​are adjustment values ​​for increasing the frame-level quantization parameters when the preceding video frame meets the bit rate constraint condition; Calculating the average of the plurality of quantization parameter increase values ​​to obtain a quantization parameter increase average value; Accordingly, the step of performing adaptive quantization processing on the video frame to be processed includes: When the upward mean value of the quantization parameter is less than a preset threshold, adaptive quantization processing is performed on the video frame to be processed.

8. A device for determining a quantization parameter offset for video coding, characterized in that: include: An acquisition module, configured to acquire a video frame to be processed; A reference value determination module, configured to perform adaptive quantization processing on the video frame to be processed to obtain a reference quantization parameter offset of each coding block in the video frame to be processed; An intervention value determination module, configured to determine a reference intervention value based on a reference quantization parameter offset of the coding block; an intensity factor down-adjusting module, configured to, in a process of performing block-level quantization processing on each of the coding blocks, down-adjust an intensity factor corresponding to the current coding block when the current coding block satisfies that the reference quantization parameter offset is greater than the reference intervention value; The offset determination module is configured to determine the target quantization parameter offset of the current coding block based on the down-adjusted intensity factor, the set function mapping relationship and the preset information of the current coding block, so as to perform video encoding on the video frame to be processed based on the determined target quantization parameter offset.

9. A device for determining a quantization parameter offset for video coding, the device comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method for determining the quantization parameter offset of video encoding according to any one of claims 1-7.

10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the method for determining a quantization parameter offset for video encoding according to any one of claims 1 to 7 when executed by a computer processor.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for determining a quantization parameter offset for video encoding according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Code rate control method and device, electronic equipment and storage medium

    CN120434392A

  • Quantization parameter offset determination method and apparatus for video encoding, and device

    WO2026077226A1