Quantization parameter determination method and device, equipment, storage medium and program product

By adjusting the quantization parameters of video encoding, and adjusting the initial quantization level parameters based on the noise estimation information to reduce the encoding rate, the problem of how to maintain video quality under limited bandwidth is solved, and reducing video encoding while the visual quality remains unchanged is achieved. The effect of bit rate.

CN119277071APending Publication Date: 2025-01-07XIAOHONGSHU TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411226591.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In the Internet with limited bandwidth, how to reduce the video encoding coding rate while ensuring visual quality and solve the contradiction between the code rate and video quality during video encoding.

Method used

By obtaining the initial quantization level parameters and noise estimation information of the target image, if the noise estimation information is greater than the preset threshold, adjust the initial quantization level parameters to obtain the target quantization level parameters, and determine the target quantization parameters based on the target quantization level parameters, and then encode it. to reduce the encoding rate.

Benefits of technology

On the premise of ensuring visual quality, the video encoding coding rate and the encoded image data volume are reduced, which is suitable for high-noise images and reduces the encoding coding rate of live videos and on-demand videos.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277071A_ABST
    Figure CN119277071A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a quantization parameter determination method and device, equipment, a storage medium and a program product. The method comprises the steps of obtaining an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used for representing an initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than a preset noise estimation threshold, adjusting the initial quantization level parameter to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; determining a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter and the target quantization level parameter are in a positive correlation trend; and coding the target image according to the target quantization parameter. By adopting the embodiment of the invention, the video coding rate can be reduced on the premise of ensuring the visual quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer application technology, and in particular to a method, device, equipment, storage medium and program product for determining a quantization parameter. Background Art

[0002] In recent years, with the rapid development of the Internet, the demand for video applications on the Internet has increased. However, the amount of video data is very large. If you want to transmit videos on the Internet with limited bandwidth, the first problem that must be solved is video compression encoding. In the video encoding process, due to the limitation of bandwidth and other factors, the video encoding bit rate needs to be controlled to meet the bandwidth requirements. The higher the bit rate, the better the video quality, but the larger the file size; the lower the bit rate, the worse the video quality, but the smaller the file size. Based on this, how to reduce the video encoding bit rate while ensuring visual quality is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The technical problem to be solved by the embodiments of the present application is to provide a method, device, equipment, storage medium and program product for determining a quantization parameter, which can reduce the video encoding bit rate while ensuring visual quality.

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

[0005] Acquire an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image;

[0006] If the noise estimation information is greater than a preset noise estimation threshold, the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter;

[0007] Determining a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter;

[0008] The target image is encoded according to the target quantization parameter.

[0009] In a second aspect, an embodiment of the present application provides a device for determining a quantization parameter, the device comprising:

[0010] An acquisition unit, used for acquiring an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize an initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image;

[0011] an adjusting unit, configured to adjust the initial quantization level parameter to obtain a target quantization level parameter of the target image if the noise estimation information is greater than a preset noise estimation threshold; the target quantization level parameter is greater than the initial quantization level parameter;

[0012] A determination unit, configured to determine a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter;

[0013] An encoding unit is used to encode the target image according to the target quantization parameter.

[0014] In one embodiment, the acquisition unit is further configured to include:

[0015] Acquiring an initial quantization parameter of the target image;

[0016] If the initial quantization parameter is less than a preset quantization parameter threshold, the step of acquiring the initial quantization level parameter of the target image and the noise estimation information of the target image is triggered.

[0017] In one implementation, the adjusting unit adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image, including:

[0018] The initial quantization level parameter is input into a quantization level parameter adjustment function to obtain the target quantization level parameter.

[0019] In one implementation, the quantization level parameter adjustment function includes a piecewise function, the piecewise function includes a plurality of noise estimation intervals and a quantization level parameter adjustment expression corresponding to each noise estimation interval; the adjustment unit inputs the initial quantization level parameter into the quantization level parameter adjustment function to obtain the target quantization level parameter, including:

[0020] determining, from the plurality of noise estimation intervals, a target noise estimation interval to which the noise estimation information belongs;

[0021] The initial quantization level parameter is input into the quantization level parameter adjustment expression corresponding to the target noise estimation interval to obtain the target quantization level parameter.

[0022] In one embodiment, the acquisition unit is further configured to include:

[0023] Acquire a live video captured by a host client, wherein the live video includes the target image, and trigger the step of acquiring an initial quantization level parameter of the target image and noise estimation information of the target image;

[0024] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and the encoded target image is transmitted.

[0025] In one embodiment, the acquisition unit is further configured to include:

[0026] receiving a video-on-demand request for a target video sent by a client, wherein the target video includes the target image;

[0027] In response to the on-demand request, triggering the step of acquiring an initial quantization level parameter of a target image and noise estimation information of the target image;

[0028] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and transmitted to the client.

[0029] In one embodiment, the acquisition unit is further configured to include:

[0030] Acquire a target video to be transmitted to a first computer device, wherein the target video is encoded using a first encoding parameter;

[0031] Decoding the target video using a first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, wherein the decoded target video includes the target image, and triggering the step of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image;

[0032] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and the encoded target image is transmitted to the first computer device.

[0033] In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a communication interface, and a processor, wherein the memory, the communication interface, and the processor are interconnected; the memory stores a computer program, and the processor calls the computer program stored in the memory to implement the method for determining the quantization parameters of the first aspect above.

[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the method for determining the quantization parameter of the first aspect described above is implemented.

[0035] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of a computer device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the computer device executes the method for determining the quantization parameters of the first aspect mentioned above.

[0036] In an embodiment of the present application, an initial quantization level parameter of a target image and noise estimation information of the target image are obtained; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than a preset noise estimation threshold, the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; the target quantization parameter of the target image is determined based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; and the target image is encoded according to the target quantization parameter. The present application increases and adjusts the quantization level parameter of a high-noise image, thereby increasing the quantization parameter, so as to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since high-noise images usually have complex textures, the human eye is not very sensitive to the image quality of such images, and thus the video encoding bit rate can be reduced while ensuring visual quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0038] Figure 1 It is a flowchart of a method for determining a quantization parameter provided in an embodiment of the present application;

[0039] Figure 2 It is a flowchart of another method for determining a quantization parameter provided in an embodiment of the present application;

[0040] Figure 3 It is a structural diagram of a system for determining a quantization parameter provided in an embodiment of the present application;

[0041] Figure 4 It is a flowchart of another method for determining a quantization parameter provided in an embodiment of the present application;

[0042] Figure 5 is a structural diagram of another system for determining quantization parameters provided in an embodiment of the present application;

[0043] Figure 6 It is a flowchart of another method for determining a quantization parameter provided in an embodiment of the present application;

[0044] Figure 7 is a structural diagram of another system for determining quantization parameters provided in an embodiment of the present application;

[0045] Figure 8 It is a flowchart of another method for determining a quantization parameter provided in an embodiment of the present application;

[0046] Fig. 9 It is a structural schematic diagram of a device for determining a quantization parameter provided in an embodiment of the present application;

[0047] Fig.10 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0050] In the specific implementation of this application, user-related data, such as user images, video information, etc., is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with local laws, regulations and standards.

[0051] See also Figure 1 , Figure 1 is a flow chart of a method for determining a quantization parameter provided in an embodiment of the present application, such as Figure 1 The method for determining the quantization parameter shown includes but is not limited to steps S101-S104, wherein:

[0052] S101, obtaining an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize an initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image.

[0053] In this embodiment, the quantization level parameter (qscale) represents the ratio of the encoding quality and the encoding bit rate. The change of the qscale value directly affects the encoding quality and encoding bit rate of the video. By adjusting the qscale, the encoding quality and the related encoding bit rate of the video encoding can be controlled. The initial quantization level parameter is used to characterize the initial quantization parameters (Quantitative Parameters, QP) of the target image. The initial quantization level parameter can be calculated by the initial image complexity and the initial encoding bit rate. Among them, the encoding bit rate refers to the rate of the bit stream generated by the encoder, which is usually expressed in bits per second (bps) or kilobits per second (kbps). The encoding bit rate reflects the data density and quality of the encoded video or audio data, that is, it determines the encoded video quality and file size (data volume). The target image can be a single image or any frame image in a video frame sequence. The noise estimation information may include noise level and noise value, wherein the noise level is proportional to the size of the noise, that is, the greater the noise of the target image, the greater the noise level.

[0054] The noise estimation information is obtained by performing noise estimation on the target image. The noise estimation on the target image can be performed by any of the following methods: spatial domain method, frequency domain method, statistical method, model fitting method, and deep learning method. For the spatial domain method, for example, it can include: mean method: calculate the pixel mean of the neighborhood around each pixel of the target image to obtain the noise estimation information; median method: use the pixel median of the neighborhood around each pixel of the target image to obtain the noise estimation information; variance method: obtain the noise estimation information by the variance of the pixel value of the target image. For the frequency domain method, for example, it can include: wavelet transform: convert the target image to the wavelet domain, and obtain the noise estimation information by using the statistical characteristics of the wavelet coefficients; Fourier transform: estimate the noise in the target image by spectrum analysis, and detect periodic noise or noise components within a specific frequency range to obtain noise estimation information. For the statistical method, for example, it can include: Kalman filter: use the Kalman filter to dynamically model the target image and estimate the statistical characteristics of the background noise to obtain the noise estimation information; adaptive filtering: based on the statistical characteristics of the local pixel neighborhood of the target image, dynamically adjust the filtering parameters to obtain the noise estimation information. For the model fitting method, for example, it may include: Gaussian mixture model: if the pixels of the target image are composed of multiple Gaussian distributions, the noise is estimated by fitting the distribution parameters to obtain noise estimation information. Laplace mixture model: if the pixels of the target image are composed of multiple Laplace distributions, the noise is estimated by fitting the distribution parameters to obtain noise estimation information. For the deep learning method, for example, it may include: Convolutional neural network (CNN): training a CNN model for estimating the noise of the target image to obtain noise estimation information.

[0055] In which, taking Laplace noise estimation as an example, the target image is a signal, wherein the signal has two statistics, one statistic is the pixel mean of the target image, and the other statistic is the jitter around the pixel mean, that is, the distance from the mean. Laplace noise estimation is to determine the pixels whose distance from the mean is greater than the preset distance as noise, wherein the distance from the mean is estimated by calculating the variance of the pixel value. In which, since there is a boundary in the target image, the pixel values ​​on both sides of the boundary vary greatly. By using Laplace noise estimation, this situation can be eliminated to improve the accuracy of the noise estimation information obtained. In which, for the above-mentioned Laplace noise estimation, and any of the above-mentioned noise estimation methods, when performing noise estimation, only the information of the target image is used, that is, when the target image is a frame image in a video frame sequence, only the information of the target image itself is used, and the information of other video frame images is not used, that is, it does not involve data dependence, the complexity of noise estimation is low, it has the characteristics of low latency, and it has good applicability for different scenes.

[0056] In an optional implementation, the following method can also be used: obtaining the initial quantization parameter of the target image; if the initial quantization parameter is less than the preset quantization parameter threshold, triggering the execution of the step of obtaining the initial quantization level parameter of the target image and the noise estimation information of the target image. Wherein, after the encoder obtains the target image, the encoder will obtain the initial quantization parameter of the target image. If the initial quantization parameter is less than the preset quantization parameter threshold, it means that the encoder has a low compression rate for the target image, the image quality is high, and the data volume of the encoded target image is high. Therefore, only when the initial quantization parameter is less than the preset quantization parameter threshold, the step of obtaining the initial quantization level parameter of the target image and the noise estimation information of the target image will be executed, and combined with the subsequent steps to increase the quantization parameter and reduce the encoding bit rate. For example, if the preset quantization parameter threshold is 5 and the initial quantization parameter of the target image is 4, it means that the initial quantization parameter is less than the preset quantization parameter threshold, the compression rate of the target image is low, and the step of obtaining the initial quantization level parameter of the target image and the noise estimation information of the target image will be triggered. Among them, if the initial quantization parameter of the target image is greater than or equal to the preset quantization parameter threshold, the step of obtaining the initial quantization level parameter of the target image and the noise estimation information of the target image will not be triggered, and the encoder will encode the target image according to the initial quantization parameter of the target image.

[0057] S102, if the noise estimation information is greater than a preset noise estimation threshold, adjusting the initial quantization level parameter to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter.

[0058] In this embodiment, when the noise estimation information is greater than the preset noise estimation threshold, the texture of the target image is more complex, including more texture details, and the human eye is not very sensitive to the image quality of such images, so the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image, and the target quantization level parameter is greater than the initial quantization level parameter. By increasing the quantization level parameter, the quantization parameter can be increased, thereby reducing the encoding bit rate while ensuring visual quality.

[0059] In an optional implementation, the initial quantization level parameter is adjusted to obtain the target quantization level parameter of the target image, which can be done in the following way: the initial quantization level parameter is input into a quantization level parameter adjustment function to obtain the target quantization level parameter.

[0060] The quantization level parameter adjustment function may be a linear function, and the target quantization level parameter is calculated by inputting the initial quantization level parameter into the linear function. The quantization level parameter adjustment function may include a first preset factor, the first preset factor is greater than 1, and the first preset factor and the initial quantization level parameter are multiplied to obtain the target quantization level parameter, that is, the target quantization level parameter = initial quantization level parameter × first preset factor; the quantization level parameter adjustment function may include a second preset factor, the second preset factor is less than 1, and the initial quantization level parameter is divided by the second preset factor to obtain the target quantization level parameter, that is, the target quantization level parameter = initial quantization level parameter / second preset factor; the quantization level parameter adjustment function may include a third preset factor, the third preset factor is greater than 0, and the initial quantization level parameter is added to the third preset factor to obtain the target quantization level parameter, that is, the target quantization level parameter = initial quantization level parameter + third preset factor.

[0061] In an optional implementation, the quantization level parameter adjustment function includes a piecewise function, the piecewise function includes multiple noise estimation intervals and a quantization level parameter adjustment expression corresponding to each noise estimation interval; the initial quantization level parameter is input into the quantization level parameter adjustment function to obtain a target quantization level parameter, which can be done in the following way: determine a target noise estimation interval to which the noise estimation information belongs from multiple noise estimation intervals; input the initial quantization level parameter into the quantization level parameter adjustment expression corresponding to the target noise estimation interval to obtain the target quantization level parameter.

[0062] In this embodiment, the target quantization level parameter of the target image can be calculated by means of a piecewise function, that is, the target noise estimation interval to which the noise estimation information belongs is determined according to the noise estimation information of the target image, and the initial quantization level parameter is input into the quantization level parameter adjustment function according to the quantization level parameter adjustment expression corresponding to the target noise estimation interval to obtain the target quantization level parameter. Taking the noise estimation information including the noise level as an example, the noise estimation interval is the noise level interval. Assuming that there are three noise level intervals, the first noise level interval is the noise level of 1-5, the second noise level interval is the noise level of 6-10, and the third noise level interval is the noise level of 11-15. The quantization level parameter adjustment expression corresponding to the first noise level interval is: target quantization level parameter = initial quantization level parameter × fourth preset factor, the quantization level parameter adjustment expression corresponding to the second noise level interval is: target quantization level parameter = initial quantization level parameter × fifth preset factor, and the quantization level parameter adjustment expression corresponding to the third noise level interval is: target quantization level parameter = initial quantization level parameter × sixth preset factor, wherein the fourth preset factor, the fifth preset factor and the sixth preset factor are greater than 1, and the sixth preset factor is greater than the fifth preset factor, and the fifth preset factor is greater than the fourth factor. If the noise level indicated by the noise estimation information of the target image is 7, it can be determined that the target noise estimation interval to which the noise estimation information of the target image belongs is the second noise level interval. The initial quantization level parameter is input into the quantization level parameter adjustment expression corresponding to the second noise level interval, and the target quantization level parameter = initial quantization level parameter × fifth preset factor can be obtained.

[0063] S103, determining a target quantization parameter of a target image based on the target quantization level parameter; the target quantization parameter and the target quantization level parameter are positively correlated.

[0064] Among them, after the target quantization level parameter is determined, the target quantization parameter of the target image can be determined according to the quantization level parameter, wherein when the initial quantization level parameter is increased through adjustment to obtain the target quantization level parameter, the target quantization parameter determined according to the target quantization level parameter will also increase compared to the initial quantization parameter. Among them, the target quantization parameter is determined according to the target quantization level parameter. Taking the most widely used x265 as an example, it adopts the R-QP (Rate-Quality-Quantization Parameter Model) model. x265 is a currently widely used open source video encoder, which is developed based on the HEVC (High Efficiency Video Coding, also known as H.265) standard. In x265, the R-QP model refers to a relationship model based on bit rate, video quality and quantization parameter (QP), which is used to control the process and results of video encoding. The specific model is as follows: Formula (1):

[0065]

[0066] When the target quantization level parameter qscale is obtained, the target quantization parameter QP can be calculated by formula (1).

[0067] S104, encoding the target image according to the target quantization parameter.

[0068] Optionally, before encoding the target image according to the target quantization parameter, the target image can be divided into blocks and transformed. Specifically, the target image is divided into small blocks; a transformation (such as discrete cosine transform DCT) is applied to each block to convert the target image data from the spatial domain to the frequency domain; the transformed coefficients are quantized according to the target quantization parameter; and the quantized coefficients are entropy encoded (such as Huffman coding or arithmetic coding) to obtain the encoded target image.

[0069] In an embodiment of the present application, an initial quantization level parameter of a target image and noise estimation information of the target image are obtained; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than a preset noise estimation threshold, the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; the target quantization parameter of the target image is determined based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; and the target image is encoded according to the target quantization parameter. The present application increases and adjusts the quantization level parameter of a high-noise image, thereby increasing the quantization parameter, so as to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since high-noise images usually have complex textures, the human eye is not very sensitive to the image quality of such images, and thus the video encoding bit rate can be reduced while ensuring visual quality.

[0070] Based on the above description, see Figure 2 , Figure 2 is a flow chart of another method for determining a quantization parameter provided in an embodiment of the present application. Figure 2 The method for determining the quantization parameter shown includes but is not limited to steps S201-S203, wherein:

[0071] S201, obtaining an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize an initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image.

[0072] For the specific steps of the embodiment of this solution, please refer to the above step S101, which will not be repeated in this solution.

[0073] S202, if the noise estimation information is greater than a preset noise estimation threshold, adjusting the initial quantization level parameter to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter.

[0074] For the specific steps of the embodiment of this solution, please refer to the above step S102, which will not be repeated in this solution.

[0075] S203, determining a target encoding bit rate of the target image based on the target quantization level parameter and the image complexity of the target image.

[0076] Among them, after the target quantization level parameter and the image complexity of the target image are determined, the target encoding rate of the target image can be determined based on the relationship between the quantization level parameter, image complexity and encoding rate. Taking the most widely used x265 as an example, it adopts the R-QP model, which can estimate the encoding rate according to the image content, and then determine the quantization parameter according to the encoding rate. In x265, the R-QP model refers to a relationship model based on the encoding rate, video quality and quantization parameter (QP), which is used to control the process and results of video encoding. The specific model is as follows formula (2):

[0077]

[0078] Wherein, R indicates the encoding bit rate, X indicates the complexity of the current frame (target image), qscale indicates the ratio of encoding quality to encoding bit rate, i.e., the quantization level parameter qscale, and α indicates the code control parameter. After the target quantization level parameter and the image complexity of the target image are determined, the target encoding bit rate can be calculated by the above formula (2).

[0079] Furthermore, the target quantization parameter can be determined based on the target quantization level parameter, and the target image can be encoded using the target quantization parameter. Specifically, the following formulas (3) and (4) are used:

[0080]

[0081]

[0082] Wherein, QP indicates the quantization parameter, R indicates the encoding bit rate, X indicates the complexity of the current frame (target image), qscale indicates the ratio of the encoding quality and the encoding bit rate, that is, the quantization level parameter, α indicates the code control parameter, and formula (3) is obtained by transforming formula (2). After the target quantization level parameter qscale is obtained, the target quantization parameter can be calculated by formula (4), and the target quantization parameter can be used to encode the target image. Optionally, the target quantization parameter and the target bit rate can be used to encode the target image.

[0083] Optionally, the image complexity of the target image may include content complexity of the target image.

[0084] Optionally, the content complexity may be represented by a cost of the Sum of Absolute Transformed Differences (SATD), that is, the image complexity of the target image may be represented by the SATD cost.

[0085] In an optional embodiment, the absolute transformation difference and cost (SATD cost) can be determined by: calculating the pixel difference between the target image and the reference image, and performing a frequency domain transformation on the pixel difference to obtain a difference coefficient; performing an absolute value transformation on the difference coefficient, and summing the absolute value transformed difference coefficients to obtain the absolute transformation difference of the target image; and obtaining the absolute transformation difference and cost of the target image based on the absolute transformation difference of the target image and the absolute transformation difference of images adjacent to the target image.

[0086] Specifically, the target image is compared with its reference image (which may include an image before the target image or a predicted image), and the pixel difference between the images is calculated, wherein the target image may be any frame image in the video, and the image before the target image may be one or more frames of images before the target image. The pixel difference is processed by transformation (such as discrete cosine transform DCT or Hadamard transform) to obtain a difference coefficient, and the absolute value of the transformed difference coefficient is calculated, and then these absolute values ​​are summed, and the obtained sum is the absolute transformation difference SATD of the target image. The absolute transformation difference SATD of the target image and the absolute transformation difference SATD of the image adjacent to the target image are linearly weighted summed to obtain the absolute transformation difference and cost SATD cost of the target image.

[0087] Optionally, the SATD value of the target image is the sum of the residual STAD of the half-pixel accuracy of the image, which is calculated in the preprocessing module before the bit rate control module; SATD requires a predictive coding process, and the I frame (intra-frame prediction) needs to determine its best prediction direction based on the image block of the target image, and the P frame (inter-frame prediction) needs to determine its best motion vector MV based on the image block division of the target image, that is, motion estimation is required to obtain the SATD sum of all blocks of the target image. Among them, for the I frame (intra-frame prediction), the encoder needs to decide which prediction mode (such as horizontal, vertical, DC prediction, etc.) to use for each image block of the target image. Each prediction mode will generate a prediction value. For each image block, the encoder will calculate the residual between its original pixel and the prediction value generated by each prediction mode, transform these residuals (such as DCT), and then calculate the sum of the absolute values ​​of the transformed residuals, that is, SATD. This SATD value is used to measure the encoding effect of each image block using different prediction modes. For P frames (inter-frame prediction), the encoder needs to perform motion estimation on each block of the target image to find the best motion vector (MV), which represents the position in the reference image that best matches the current block. For each image block, its residual is obtained through motion estimation. These residuals are also transformed (such as DCT), and then the sum of the absolute values ​​of the transformed residuals (ie, SATD) is calculated as the SATD of the block.

[0088] In an embodiment of the present application, an initial quantization level parameter of a target image and noise estimation information of the target image are obtained; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than a preset noise estimation threshold, the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; and the target encoding bit rate of the target image is determined based on the target quantization level parameter and the image complexity of the target image. The present application adjusts the quantization level parameter of a high-noise image to reduce the encoding bit rate. At the same time, since high-noise images usually have complex textures, the human eye is not very sensitive to the image quality of such images, and thus the video encoding bit rate can be reduced while ensuring visual quality.

[0089] Based on the above description, the embodiments of the present application can be applied to live broadcast scenarios. Figure 3 , Figure 3It is a structural diagram of a system for determining a quantization parameter provided by an embodiment of the present application. The system for determining a quantization parameter can be applied to a live broadcast scenario. The system for determining a quantization parameter can include at least one viewer client 100 and at least one anchor client 200. A computer-readable storage medium corresponding to a method for determining a quantization parameter is run in the viewer client 100 to execute the method for determining a quantization parameter. The server 300 communicates and interacts with at least one viewer client 100 and at least one anchor client 200. Specifically, the server 300 obtains a live video captured by the anchor client 200, the live video includes a target image, and triggers the execution of the steps of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image; after determining a target quantization parameter of the target image based on the target quantization level parameter, encoding the target image according to the target quantization parameter, and obtaining the encoded target image, the encoded target image is transmitted.

[0090] The server 300 in the quantitative parameter determination system can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0091] Any viewer client 100 and the server 300 may be directly or indirectly connected to each other via wired or wireless communication, and this application does not impose any limitation thereto.

[0092] Any anchor client 200 can communicate directly or indirectly with the server 300 via wired or wireless communication, which is not limited in this application. The anchor client 200 can run in a second computer device, which can be a smart terminal, such as a mobile phone, a wearable device, a car device, a tablet computer, a network device, and a smart computer.

[0093] Understandably, Figure 3The server, or at least one viewer client 100, or at least one anchor client 200 in the system for determining the quantization parameter shown does not constitute a limitation on the embodiments of the present application. That is, the number of servers, the type of servers, the number of at least one viewer client, the type of at least one viewer client, the number of at least one anchor client, the type of at least one anchor client, or the number and type of devices included in each server, each anchor client or viewer client do not affect the overall implementation of the technical solution in the embodiments of the present application, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present application.

[0094] Based on the above description, see Figure 4 , Figure 4 FIG. 1 is a flow chart of another method for determining a quantization parameter provided in an embodiment of the present application. The method for determining a quantization parameter can be applied to a live broadcast scenario, such as Figure 4 The method for determining the quantization parameter shown includes but is not limited to steps S401-S406, wherein:

[0095] S401. The server obtains a live video collected by a host client, where the live video includes a target image.

[0096] In this embodiment, the anchor client captures the anchor's picture and sound in real time through a camera or other video acquisition device. The live video collected can be a single picture (single-person live broadcast) or contain multiple pictures (multi-person conference or group live broadcast). The collected live video needs to be encoded, for example, using a video encoder (such as x265, H.264, etc.) to compress the original live video stream into a transmittable code stream. The encoded live video is sent to the server through a network transmission protocol (such as RTMP, HLS, etc.). After the server receives the video stream, it needs to decode it to restore the original live video data. The target image can refer to any frame image in the live video.

[0097] Optionally, the decoded live video data can be subsequently processed, such as content review, watermark addition, etc.

[0098] S402: The server triggers the step of acquiring initial quantization level parameters of the target image and noise estimation information of the target image.

[0099] For the specific steps of the embodiment of this solution, please refer to the above step S101, which will not be repeated in this solution.

[0100] S403: If the noise estimation information is greater than a preset noise estimation threshold, the server adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image.

[0101] For the specific steps of the embodiment of this solution, please refer to the above step S102, which will not be repeated in this solution.

[0102] S404: The server determines a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter.

[0103] For the specific steps of the embodiment of this solution, please refer to the above step S103, which will not be repeated in this solution.

[0104] S405: The server encodes the target image according to the target quantization parameter to obtain an encoded target image, and transmits the encoded target image.

[0105] Among them, the encoder in the server will process the target image according to the target QP value, such as dividing, transforming, quantizing and other steps of the target image to generate coding coefficients for each image block. These coding coefficients will be quantized according to the QP value to determine their accuracy and storage requirements. Then, the encoder will package the quantized data into a bitstream format that meets specific coding standards (such as H.265, H.264). The encoded video bitstream can be transmitted through multiple protocols, such as RTMP, HLS, UDP, etc.

[0106] Optionally, when the server transmits the encoded live video, it may transmit each frame of the video after encoding is completed; or it may transmit the entire video frame after encoding is completed.

[0107] Optionally, the server determines the target encoding bit rate of the target image based on the target quantization level parameter and the image complexity of the target image, and encodes the target image using the target quantization parameter and the target encoding bit rate to obtain the encoded target image, and transmits the encoded target image. Among them, the encoder in the server will process the target image according to the target QP value and the target encoding bit rate, such as performing steps such as block division, transformation, and quantization on the target image to generate encoding coefficients for each image block. These encoding coefficients will be quantized according to the QP value to determine their accuracy and storage requirements. Then, the encoder packages the quantized data into a bitstream format that meets specific coding standards (such as H.265, H.264), wherein the encoder encodes and outputs the target image according to the target encoding bit rate. The encoded video stream can be transmitted through a variety of protocols, such as RTMP, HLS, UDP, etc.

[0108] S406: The server sends the encoded target image to the viewer client.

[0109] Optionally, if the live broadcast scene is a scene of a live broadcast between the host and the client, the audience client will also capture the audience's picture and sound in real time through a camera or other video acquisition device, and send the collected audience-end video to the server. The server will also execute the above steps S402-S406 and send the target image encoded by the audience client to the host client.

[0110] In an embodiment of the present application, the server obtains a live video collected by the anchor client, and the live video includes a target image; the server triggers the execution of the steps of obtaining the initial quantization level parameter of the target image and the noise estimation information of the target image; if the noise estimation information is greater than the preset noise estimation threshold, the server adjusts the initial quantization level parameter to obtain the target quantization level parameter of the target image; the server determines the target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; the server encodes the target image according to the target quantization parameter to obtain the encoded target image, and transmits the encoded target image to the viewer client. The present application increases and adjusts the quantization level parameter of the high-noise image, thereby increasing the quantization parameter to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since the texture of the high-noise image is usually complex, the human eye is not very sensitive to the image quality of such images, so it can reduce the encoding bit rate of the live video and reduce the live broadcast delay while ensuring the visual quality.

[0111] Based on the above description, the embodiments of the present application can be applied to on-demand scenarios. Figure 5 , Figure 5 It is a structural diagram of another quantization parameter determination system provided by an embodiment of the present application. The quantization parameter determination system can be applied to a video-on-demand scenario, and the quantization parameter determination system can include at least one client 400. A computer-readable storage medium corresponding to the quantization parameter determination method is run in the client 400 to execute the quantization parameter determination method. The server 500 communicates and interacts with at least one client 400. Specifically, the server 500 receives a video-on-demand request for a target video sent by the client 400, and the target video includes a target image; in response to the video-on-demand request, triggers the execution of the steps of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image; after determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained, and the encoded target image is transmitted to the client 400.

[0112] The server 500 in the quantitative parameter determination system can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, as well as big data and artificial intelligence platforms.

[0113] Any client 400 and server 500 may be directly or indirectly connected to each other via wired or wireless communication, and this application does not impose any limitation on this.

[0114] Understandably, Figure 5 The server or at least one client 400 in the system for determining the quantization parameter shown does not constitute a limitation on the embodiments of the present application. That is, the number of servers, the type of servers, the number of at least one client, the type of at least one client, or the number of devices and the type of devices contained in each server or client do not affect the overall implementation of the technical solution in the embodiments of the present application, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed in the embodiments of the present application.

[0115] Based on the above description, see Figure 6 , Figure 6 is a flow chart of another method for determining a quantization parameter provided in an embodiment of the present application. The method for determining a quantization parameter can be applied to a video-on-demand scenario, such as Figure 6 The method for determining the quantization parameter shown includes but is not limited to steps S601-S606, wherein:

[0116] S601: A server receives a video-on-demand request for a target video sent by a client, where the target video includes a target image.

[0117] In this embodiment, the server receives a video-on-demand request from a client, and the video-on-demand request includes an identifier or other relevant information specifying a target video to be played, such as a video name, ID, etc. The server confirms the address and storage method of the target video based on the received request information. The target video may be stored in a local file system, a remote storage service, or distributed through a content distribution network. When the storage address of the target video is determined, the server obtains the video file or video stream.

[0118] S602: In response to the on-demand request, the server triggers the step of acquiring an initial quantization level parameter of a target image and noise estimation information of the target image.

[0119] For the specific steps of the embodiment of this solution, please refer to the above step S101, which will not be repeated in this solution.

[0120] S603: If the noise estimation information is greater than a preset noise estimation threshold, the server adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image.

[0121] For the specific steps of the embodiment of this solution, please refer to the above step S102, which will not be repeated in this solution.

[0122] S604: The server determines a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter.

[0123] For the specific steps of the embodiment of this solution, please refer to the above step S103, which will not be repeated in this solution.

[0124] S605: The server encodes the target image according to the target quantization parameter to obtain an encoded target image, and transmits the encoded target image to the client.

[0125] Among them, the encoder in the server will process the target image according to the target QP value, such as dividing, transforming, quantizing and other steps of the target image to generate coding coefficients for each image block. These coding coefficients will be quantized according to the QP value to determine their accuracy and storage requirements. Then, the encoder will package the quantized data into a bitstream format that meets specific coding standards (such as H.265, H.264). The encoded video bitstream can be transmitted through multiple protocols, such as RTMP, HLS, UDP, etc.

[0126] Optionally, when the server transmits the encoded live video, it may transmit each frame of the video after encoding is completed; or it may transmit the entire video frame after encoding is completed.

[0127] Optionally, the server determines the target encoding bit rate of the target image based on the target quantization level parameter and the image complexity of the target image, and encodes the target image using the target quantization parameter and the target encoding bit rate to obtain the encoded target image, and transmits the encoded target image. Among them, the encoder in the server will process the target image according to the target QP value and the target encoding bit rate, such as performing steps such as block division, transformation, and quantization on the target image to generate encoding coefficients for each image block. These encoding coefficients will be quantized according to the QP value to determine their accuracy and storage requirements. Then, the encoder packages the quantized data into a bitstream format that meets specific coding standards (such as H.265, H.264), wherein the encoder encodes and outputs the target image according to the target encoding bit rate. The encoded video stream can be transmitted through a variety of protocols, such as RTMP, HLS, UDP, etc.

[0128] S606: The server sends the encoded target image to the client.

[0129] In an embodiment of the present application, a server receives a video-on-demand request for a target video sent by a client, and the target video includes a target image; the server triggers the execution of the steps of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image in response to the video-on-demand request; if the noise estimation information is greater than a preset noise estimation threshold, the server adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image; the server determines the target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; the server encodes the target image according to the target quantization parameter to obtain an encoded target image, and transmits the encoded target image to the client. The present application increases and adjusts the quantization level parameter of a high-noise image, thereby increasing the quantization parameter, so as to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since high-noise images usually have complex textures, the human eye is not very sensitive to the image quality of such images, so it is possible to reduce the encoding bit rate of live video and reduce live delay while ensuring visual quality.

[0130] Based on the above description, the embodiments of the present application can be applied to transcoding scenarios. Figure 7 , Figure 7 1 is a structural diagram of another quantization parameter determination system provided by an embodiment of the present application. The quantization parameter determination system can be applied to a transcoding scenario. The quantization parameter determination system can include a first computer device 600 and a second computer device 700. A computer-readable storage medium corresponding to the quantization parameter determination method is run in the second computer device 700 to execute the quantization parameter determination method. The first computer device 600 communicates and interacts with the second computer device 700. Specifically, the second computer device 700 obtains a target video to be transmitted to the first computer device 600, and the target video is obtained by encoding using a first encoding parameter; the target video is decoded using a first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, the decoded target video includes a target image, and triggers the execution of the steps of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image; after determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained, and the encoded target image is transmitted to the first computer device 600.

[0131] The first computer device 600 and the second computer device 700 may be directly or indirectly connected to each other through wired or wireless communication, which is not limited in the present application.

[0132] Understandably, Figure 7The first computer device 600 and the second computer device 700 in the system for determining the quantization parameter shown do not constitute a limitation on the embodiments of the present application. That is, the number of first computer devices 600, the type of first computer devices 600, the number of second computer devices 700, the type of second computer devices 700, or the number and type of devices included in each of the first computer devices 600 and the second computer device 700 do not affect the overall implementation of the technical solution in the embodiments of the present application, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed in the embodiments of the present application.

[0133] Based on the above description, see Figure 8 , Figure 8 is a flow chart of another method for determining a quantization parameter provided in an embodiment of the present application. The method for determining a quantization parameter can be applied to transcoding scenarios, such as Figure 8 The method for determining the quantization parameter shown includes but is not limited to steps S801-S806, wherein:

[0134] S801. A second computer device obtains a target video to be transmitted to a first computer device, where the target video is encoded using a first encoding parameter.

[0135] The first encoding parameter may include a quantization parameter, encoding bit rate, frame rate, etc. The first computer device obtains the target video from a storage address of the target video, where the storage address may include a local file system, a network storage device, or a cloud storage service, etc.

[0136] S802. The second computer device decodes the target video using the first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, where the decoded target video includes a target image, and triggers the step of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image.

[0137] The second computer device decodes the encoded target video data using a decoder supporting the first decoding parameter, and the decoder decodes the target video according to the first decoding parameter (such as QP value, frame rate, etc.) corresponding to the first encoding parameter to restore the original video frame, that is, the decoded target video. The steps of obtaining the initial quantization level parameter of the target image and the noise estimation information of the target image can be found in the above step S101, which will not be described in detail in this solution.

[0138] S803: If the noise estimation information is greater than a preset noise estimation threshold, the second computer device adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image.

[0139] For the specific steps of the embodiment of this solution, please refer to the above step S102, which will not be repeated in this solution.

[0140] S804: The second computer device determines a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter.

[0141] For the specific steps of the embodiment of this solution, please refer to the above step S103, which will not be repeated in this solution.

[0142] S805: The second computer device encodes the target image according to the target quantization parameter to obtain an encoded target image, and transmits the encoded target image to the first computer device.

[0143] Among them, the encoder in the server will process the target image according to the target QP value, such as dividing, transforming, quantizing and other steps of the target image to generate coding coefficients for each image block. These coding coefficients will be quantized according to the QP value to determine their accuracy and storage requirements. Then, the encoder will package the quantized data into a bitstream format that meets specific coding standards (such as H.265, H.264). The encoded video bitstream can be transmitted through multiple protocols, such as RTMP, HLS, UDP, etc.

[0144] Optionally, when the server transmits the encoded live video, it may transmit each frame of the video after encoding is completed; or it may transmit the entire video frame after encoding is completed.

[0145] Optionally, the server determines the target encoding bit rate of the target image based on the target quantization level parameter and the image complexity of the target image, and encodes the target image using the target quantization parameter and the target encoding bit rate to obtain the encoded target image, and transmits the encoded target image. Among them, the encoder in the server will process the target image according to the target QP value and the target encoding bit rate, such as performing steps such as block division, transformation, and quantization on the target image to generate encoding coefficients for each image block. These encoding coefficients will be quantized according to the QP value to determine their accuracy and storage requirements. Then, the encoder packages the quantized data into a bitstream format that meets specific coding standards (such as H.265, H.264), wherein the encoder encodes and outputs the target image according to the target encoding bit rate. The encoded video stream can be transmitted through a variety of protocols, such as RTMP, HLS, UDP, etc.

[0146] S806: The second computer device sends the encoded target image to the first computer device.

[0147] In an embodiment of the present application, a second computer device obtains a target video to be transmitted to a first computer device, and the target video is obtained by encoding using a first encoding parameter; the second computer device decodes the target video using a first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, and the decoded target video includes a target image, and triggers the execution of the step of obtaining an initial quantization level parameter of the target image, and noise estimation information of the target image; if the noise estimation information is greater than a preset noise estimation threshold, the second computer device adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image; the second computer device determines the target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; the second computer device encodes the target image according to the target quantization parameter to obtain an encoded target image, and transmits the encoded target image to the first computer device. The present application increases and adjusts the quantization level parameter of a high-noise image, thereby increasing the quantization parameter, so as to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since high-noise images usually have complex textures, the human eye is not very sensitive to the image quality of such images, so it can reduce the encoding bit rate of live video and reduce live delay under the premise of ensuring visual quality.

[0148] An embodiment of the present application further provides a computer storage medium, in which program instructions are stored. When the program instructions are executed, they are used to implement the corresponding methods described in the above embodiments.

[0149] An embodiment of the present application provides a computer program product, which includes a computer program stored in a computer storage medium; a processor of a computer device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the computer device executes the corresponding method described in the above embodiment.

[0150] See also Fig. 9 , Fig. 9 It is a structural diagram of a device for determining a quantization parameter provided in an embodiment of the present application.

[0151] In one implementation of the device for determining a quantization parameter in the embodiment of the present application, the device for determining a quantization parameter includes the following structure:

[0152] The acquisition unit 901 is used to acquire an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image;

[0153] An adjusting unit 902 is configured to adjust the initial quantization level parameter to obtain a target quantization level parameter of the target image if the noise estimation information is greater than a preset noise estimation threshold; the target quantization level parameter is greater than the initial quantization level parameter;

[0154] A determination unit 903 is configured to determine a target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter;

[0155] The encoding unit 904 is configured to encode the target image according to the target quantization parameter.

[0156] In one implementation, the acquiring unit 901 is further configured to include:

[0157] Acquiring an initial quantization parameter of the target image;

[0158] If the initial quantization parameter is less than a preset quantization parameter threshold, the step of acquiring the initial quantization level parameter of the target image and the noise estimation information of the target image is triggered.

[0159] In one implementation, the adjusting unit 902 adjusts the initial quantization level parameter to obtain a target quantization level parameter of the target image, including:

[0160] The initial quantization level parameter is input into a quantization level parameter adjustment function to obtain the target quantization level parameter.

[0161] In one implementation, the quantization level parameter adjustment function includes a piecewise function, and the piecewise function includes a plurality of noise estimation intervals and a quantization level parameter adjustment expression corresponding to each noise estimation interval; the adjustment unit 902 inputs the initial quantization level parameter into the quantization level parameter adjustment function to obtain the target quantization level parameter, including:

[0162] determining, from the plurality of noise estimation intervals, a target noise estimation interval to which the noise estimation information belongs;

[0163] The initial quantization level parameter is input into the quantization level parameter adjustment expression corresponding to the target noise estimation interval to obtain the target quantization level parameter.

[0164] In one implementation, the acquiring unit 901 is further configured to include:

[0165] Acquire a live video captured by a host client, wherein the live video includes the target image, and trigger the step of acquiring an initial quantization level parameter of the target image and noise estimation information of the target image;

[0166] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and the encoded target image is transmitted.

[0167] In one implementation, the acquiring unit 901 is further configured to include:

[0168] receiving a video-on-demand request for a target video sent by a client, wherein the target video includes the target image;

[0169] In response to the on-demand request, triggering the step of acquiring an initial quantization level parameter of a target image and noise estimation information of the target image;

[0170] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and transmitted to the client.

[0171] In one implementation, the acquiring unit 901 is further configured to include:

[0172] Acquire a target video to be transmitted to a first computer device, wherein the target video is encoded using a first encoding parameter;

[0173] Decoding the target video using a first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, wherein the decoded target video includes the target image, and triggering the step of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image;

[0174] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and the encoded target image is transmitted to the first computer device.

[0175] In the embodiment of the present application, the acquisition unit 901 acquires the initial quantization level parameter of the target image and the noise estimation information of the target image; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than the preset noise estimation threshold, the adjustment unit 902 adjusts the initial quantization level parameter to obtain the target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; the determination unit 903 determines the target quantization parameter of the target image based on the target quantization level parameter; the target quantization parameter and the target quantization level parameter are positively correlated; the encoding unit 904 encodes the target image according to the target quantization parameter. The present application increases the quantization level parameter of the high-noise image, thereby increasing the quantization parameter, so as to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since the texture of the high-noise image is usually complex, the human eye is not very sensitive to the image quality of such images, so the video encoding bit rate can be reduced under the premise of ensuring the visual quality.

[0176] See also Fig.10 , Fig.10 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device in the embodiment of the present application includes a power supply module and other structures, and includes a processor 1001, a memory 1002, and a communication interface 1003. The processor 1001, the memory 1002, and the communication interface 1003 can exchange data, and the processor 1001 implements the corresponding method for determining the quantization parameter.

[0177] The memory 1002 may include a volatile memory, such as a random-access memory (RAM); the memory 1002 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the memory 1002 may also include a combination of the above-mentioned types of memory.

[0178] The processor 1001 may be a central processing unit (CPU). The processor 1001 may also be a combination of a CPU and a GPU. In a computer device, multiple CPUs and GPUs may be included as needed to determine corresponding quantization parameters. In one embodiment, the memory 1002 is used to store program instructions. The processor 1001 may call program instructions to implement various methods involved in the embodiments of the present application.

[0179] In a first possible implementation, the processor 1001 of the computer device calls the program instructions stored in the memory 1002 to obtain an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than a preset noise estimation threshold, the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; the target quantization parameter of the target image is determined based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; and the target image is encoded according to the target quantization parameter.

[0180] In one implementation, the processor 1001 may further perform the following operations:

[0181] Acquiring an initial quantization parameter of the target image;

[0182] If the initial quantization parameter is less than a preset quantization parameter threshold, the step of acquiring the initial quantization level parameter of the target image and the noise estimation information of the target image is triggered.

[0183] In one implementation, the processor 1001 adjusts the initial quantization level parameter to obtain the target quantization level parameter of the target image, and may perform the following operations:

[0184] The initial quantization level parameter is input into a quantization level parameter adjustment function to obtain the target quantization level parameter.

[0185] In one implementation, the quantization level parameter adjustment function includes a piecewise function, and the piecewise function includes a plurality of noise estimation intervals and a quantization level parameter adjustment expression corresponding to each noise estimation interval; the processor 1001 inputs the initial quantization level parameter into the quantization level parameter adjustment function to obtain the target quantization level parameter, and may perform the following operations:

[0186] determining, from the plurality of noise estimation intervals, a target noise estimation interval to which the noise estimation information belongs;

[0187] The initial quantization level parameter is input into the quantization level parameter adjustment expression corresponding to the target noise estimation interval to obtain the target quantization level parameter.

[0188] In one implementation, the processor 1001 may further perform the following operations:

[0189] Acquire a live video captured by a host client, wherein the live video includes the target image, and trigger the step of acquiring an initial quantization level parameter of the target image and noise estimation information of the target image;

[0190] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and the encoded target image is transmitted.

[0191] In one implementation, the processor 1001 may further perform the following operations:

[0192] receiving a video-on-demand request for a target video sent by a client, wherein the target video includes the target image;

[0193] In response to the on-demand request, triggering the step of acquiring an initial quantization level parameter of a target image and noise estimation information of the target image;

[0194] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and transmitted to the client.

[0195] In one implementation, the processor 1001 may further perform the following operations:

[0196] Acquire a target video to be transmitted to a first computer device, wherein the target video is encoded using a first encoding parameter;

[0197] Decoding the target video using a first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, wherein the decoded target video includes the target image, and triggering the step of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image;

[0198] After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained, and the encoded target image is transmitted to the first computer device.

[0199] In an embodiment of the present application, the processor 1001 obtains an initial quantization level parameter of a target image and noise estimation information of the target image; the initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; if the noise estimation information is greater than a preset noise estimation threshold, the initial quantization level parameter is adjusted to obtain a target quantization level parameter of the target image; the target quantization level parameter is greater than the initial quantization level parameter; the target quantization parameter of the target image is determined based on the target quantization level parameter; the target quantization parameter is positively correlated with the target quantization level parameter; the target image is encoded according to the target quantization parameter. The present application increases and adjusts the quantization level parameter of a high-noise image, thereby increasing the quantization parameter, so as to reduce the encoding bit rate and the amount of data of the encoded image. At the same time, since high-noise images usually have complex textures, the human eye is not very sensitive to the image quality of such images, so the video encoding bit rate can be reduced while ensuring visual quality.

[0200] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0201] The above disclosure is only part of the embodiments of the present application, which certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A method for determining a quantization parameter, characterized in that: include: Acquiring an initial quantization level parameter of a target image and noise estimation information of the target image; The initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; If the noise estimation information is greater than a preset noise estimation threshold, adjusting the initial quantization level parameter to obtain a target quantization level parameter of the target image; The target quantization level parameter is greater than the initial quantization level parameter; Determining a target quantization parameter of the target image based on the target quantization level parameter; The target quantization parameter and the target quantization level parameter are positively correlated; The target image is encoded according to the target quantization parameter.

2. The method according to claim 1, characterized in that The method further comprises: Acquiring an initial quantization parameter of the target image; If the initial quantization parameter is less than a preset quantization parameter threshold, the step of acquiring the initial quantization level parameter of the target image and the noise estimation information of the target image is triggered.

3. The method according to claim 1, characterized in that The adjusting the initial quantization level parameter to obtain the target quantization level parameter of the target image includes: The initial quantization level parameter is input into a quantization level parameter adjustment function to obtain the target quantization level parameter.

4. The method according to claim 3, characterized in that The quantization level parameter adjustment function includes a piecewise function, and the piecewise function includes a plurality of noise estimation intervals and a quantization level parameter adjustment expression corresponding to each noise estimation interval; the initial quantization level parameter is input into the quantization level parameter adjustment function to obtain the target quantization level parameter, including: determining, from the plurality of noise estimation intervals, a target noise estimation interval to which the noise estimation information belongs; The initial quantization level parameter is input into the quantization level parameter adjustment expression corresponding to the target noise estimation interval to obtain the target quantization level parameter.

5. The method according to claim 1, characterized in that The method further comprises: Acquire a live video captured by a host client, wherein the live video includes the target image, and trigger the step of acquiring an initial quantization level parameter of the target image and noise estimation information of the target image; After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and the encoded target image is transmitted.

6. The method according to claim 1, characterized in that The method further comprises: receiving a video-on-demand request for a target video sent by a client, wherein the target video includes the target image; In response to the on-demand request, triggering the step of acquiring an initial quantization level parameter of a target image and noise estimation information of the target image; After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and transmitted to the client.

7. The method according to claim 1, characterized in that The method further comprises: Acquire a target video to be transmitted to a first computer device, wherein the target video is encoded using a first encoding parameter; Decoding the target video using a first decoding parameter corresponding to the first encoding parameter to obtain a decoded target video, wherein the decoded target video includes the target image, and triggering the step of obtaining an initial quantization level parameter of the target image and noise estimation information of the target image; After determining a target quantization parameter of the target image based on the target quantization level parameter and encoding the target image according to the target quantization parameter, an encoded target image is obtained and transmitted to the first computer device.

8. A device for determining a quantization parameter, characterized in that: include: An acquisition unit, used for acquiring an initial quantization level parameter of a target image and noise estimation information of the target image; The initial quantization level parameter is used to characterize the initial quantization parameter of the target image, and the noise estimation information is obtained by performing noise estimation on the target image; an adjusting unit, configured to adjust the initial quantization level parameter to obtain a target quantization level parameter of the target image if the noise estimation information is greater than a preset noise estimation threshold; The target quantization level parameter is greater than the initial quantization level parameter; A determination unit, configured to determine a target quantization parameter of the target image based on the target quantization level parameter; The target quantization parameter and the target quantization level parameter are positively correlated; An encoding unit is used to encode the target image according to the target quantization parameter.

9. A computer device, characterized in that: The computer device includes a memory, a communication interface and a processor, wherein the memory, the communication interface and the processor are interconnected; the memory stores a computer program, and the processor calls the computer program stored in the memory to implement the method for determining the quantization parameter described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for determining a quantization parameter according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer storage medium; a processor of a computer device reads the computer program from the computer storage medium, and the processor executes the computer program, so that the computer device executes the method for determining the quantization parameter as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Video coding method and device, electronic equipment and storage medium

    CN122269030A