Search

CN-116156169-B - Quantization parameter determination method and device

CN116156169BCN 116156169 BCN116156169 BCN 116156169BCN-116156169-B

Abstract

Some embodiments of the application provide a quantization parameter determining method and device, and relate to the technical field of video encoding and decoding. The method comprises the steps of obtaining a video to be encoded, determining whether a video frame to be encoded is a refreshing frame or not, if not, obtaining a first dispersion parameter and a second dispersion parameter, wherein the first dispersion parameter and the second dispersion parameter are used for representing dispersion of pixel values of all pixel points in the video frame to be encoded and a reference video frame respectively, the reference video frame is the refreshing frame with the minimum interval with the video frame to be encoded, updating a reference code rate-quantization parameter RQ model according to the first dispersion parameter and the second dispersion parameter to obtain a first RQ model, the reference RQ model is an RQ model of the reference video frame, and determining quantization parameters corresponding to the video frame to be encoded according to the first RQ model and a target code rate. And the quantization parameter corresponding to the video frame is accurately set according to the target code rate.

Inventors

  • WANG ZHAO
  • HUANG XINGJUN
  • ZHANG HAO
  • LI BIN
  • XING FANG
  • ZHANG WEN
  • WANG ZHIKUI

Assignees

  • 海信视像科技股份有限公司

Dates

Publication Date
20260512
Application Date
20221219

Claims (10)

  1. 1. A quantization parameter determination method, applied to LCEVC encoders, comprising: Acquiring a video to be encoded; when the video to be encoded is not the refreshing frame, the video to be encoded is encoded by taking the encoded video frame as a reference, and when the video to be encoded is the refreshing frame, the video to be encoded is not encoded by taking the encoded video frame as a reference; If the video frame to be encoded is not a refreshing frame, acquiring a first dispersion parameter and a second dispersion parameter, wherein the first dispersion parameter and the second dispersion parameter are respectively used for representing the dispersion of pixel values of all pixel points in the video frame to be encoded and a reference video frame; Updating a reference code rate-quantization parameter RQ model according to the first dispersion parameter and the second dispersion parameter to obtain a first RQ model; And determining quantization parameters corresponding to the video frame to be encoded according to the first RQ model and the target code rate.
  2. 2. The method of claim 1, wherein the obtaining the first dispersion parameter comprises: and calculating the variance of pixel values of all pixel points in the video frame to be encoded so as to obtain the first dispersion parameter.
  3. 3. The method of claim 1, wherein updating the reference code rate-quantization parameter RQ model based on the first and second dispersion parameters to obtain a first RQ model comprises: updating the slope of the reference code rate-quantization parameter RQ model according to the first dispersion parameter and the second dispersion parameter to obtain a first slope; Updating the intercept of the reference code rate-quantization parameter RQ model according to the first dispersion parameter and the second dispersion parameter to obtain a first intercept; the first RQ model is generated from the first slope and the first intercept.
  4. 4. The method of claim 3, wherein the obtaining a first slope from the slopes of the first and second dispersion parameters and the reference code rate-quantization parameter RQ model comprises: calculating the difference value between the second dispersion parameter and the first dispersion parameter to obtain a first calculated value; calculating the ratio of the first calculated value to the second dispersion parameter to obtain a second calculated value; And calculating the product of the second calculated value and the slope of the reference code rate-quantization parameter RQ model to obtain the first slope.
  5. 5. The method of claim 3, wherein the obtaining a first intercept based on the intercepts of the first and second dispersion parameters and the reference code rate-quantization parameter RQ model comprises: calculating the difference value between the second dispersion parameter and the first dispersion parameter to obtain a first calculated value; calculating the ratio of the first calculated value to the second dispersion parameter to obtain a second calculated value; and calculating the product of the second calculated value and the intercept of the reference code rate-quantization parameter RQ model to obtain the first intercept.
  6. 6. The method according to claim 1, wherein the method further comprises: Under the condition that the video frame to be encoded is determined to be a refreshing frame, the LCEVC encoder is controlled to encode the video frame to be encoded through a first quantization parameter and a second quantization parameter respectively, and a first code rate corresponding to the first quantization parameter and a second code rate corresponding to the second quantization parameter are obtained; Acquiring a second RQ model according to the first quantization parameter, the second quantization parameter, the first code rate and the second code rate; and determining quantization parameters corresponding to the video frame to be encoded according to the second RQ model and the target code rate.
  7. 7. The method of claim 6, wherein the obtaining the second RQ model based on the first quantization parameter, the second quantization parameter, the first code rate, and the second code rate comprises: acquiring a second slope according to the first quantization parameter, the second quantization parameter, the common logarithm of the first code rate and the common logarithm of the second code rate; Acquiring a second intercept according to the second slope, the first quantization parameter and the common logarithm of the first code rate; the second RQ model is generated from the second slope and the second intercept.
  8. 8. The method of claim 7, wherein the obtaining the second slope based on the first quantization parameter, the second quantization parameter, the common logarithm of the first code rate, and the common logarithm of the second code rate comprises: calculating the difference value between the second quantization parameter and the first quantization parameter to obtain a third calculation value; Calculating the difference value between the common logarithm of the first code rate and the common logarithm of the second code rate to obtain a fourth calculated value; calculating a ratio of the third calculated value to the fourth calculated value to obtain the second slope.
  9. 9. The method of claim 7, wherein the obtaining a second intercept based on the second slope, the first quantization parameter, and a common logarithm of the first code rate comprises: calculating the product of the second slope and the common logarithm of the first code rate to obtain a fifth calculated value; and calculating a difference value between the first quantization parameter and the fifth calculated value to obtain the second intercept.
  10. 10. A quantization parameter determination apparatus includes a memory configured to store a computer program; A processor configured to cause the quantization parameter determination apparatus to implement the quantization parameter determination method of any one of claims 1-9 when the computer program is invoked.

Description

Quantization parameter determination method and device Technical Field Some embodiments of the application relate to the field of video coding technology. And more particularly, to a quantization parameter determination method and apparatus. Background Because high-definition video and ultra-high-definition video can provide clearer image quality and more realistic perceived quality for users, the high-definition video and the ultra-high-definition video are increasingly favored by the public. However, as the resolution and bit depth increase, the data size of the video increases, and in order to improve the compression efficiency of the video and reduce the data size of the video, a low complexity enhanced video coding (Low Complexity Enhancement Video Coding, LCEVC) standard is proposed in the related art. In the related art, when a LCEVC encoder is used to encode a video frame sequence, a constant quantization parameter (Quantization Parameter, QP) is used to perform quantization encoding on all video frames in the video frame sequence. However, the LCEVC encoder rate control requires that the LCEVC encoder can output a code stream with a desired code rate, but when the LCEVC encoder uses the same quantization parameter to encode different video frames, the code rate of the code stream output by the LCEVC encoder is not the same, so that the code rate of the code stream corresponding to the video frame cannot be accurately controlled through the quantization parameter. Therefore, how to accurately set the quantization parameter corresponding to the video frame according to the target code rate is a problem to be solved. Disclosure of Invention The exemplary embodiment of the application provides a quantization parameter determining method and a quantization parameter determining device, which are used for accurately setting quantization parameters corresponding to video frames according to a target code rate. Some embodiments of the present application provide the following technical solutions: in a first aspect, some embodiments of the present application provide a quantization parameter determination method, including: Acquiring a video to be encoded; Determining whether the video frame to be encoded is a refreshing frame, when the video frame to be encoded is not the refreshing frame, encoding the video frame to be encoded by taking the encoded video frame as a reference, and when the video frame to be encoded is the refreshing frame, encoding the video frame to be encoded by not taking the encoded video frame as a reference; If not, acquiring a first dispersion parameter and a second dispersion parameter, wherein the first dispersion parameter and the second dispersion parameter are respectively used for representing the dispersion of pixel values of all pixel points in the video frame to be encoded and a reference video frame; Updating a reference code rate-quantization parameter RQ model according to the first dispersion parameter and the second dispersion parameter to obtain a first RQ model; And determining quantization parameters corresponding to the video frame to be encoded according to the first RQ model and the target code rate. In a second aspect, some embodiments of the present application provide a quantization parameter determining apparatus, including: A memory configured to store a computer program; a processor configured to cause the apparatus to determine a rate control parameter to implement the quantization parameter determination method of the first aspect when invoking a computer program. In a third aspect, some embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a computing device, causes the computing device to implement the quantization parameter determination method of the first aspect. In a fourth aspect, some embodiments of the present application provide a computer program product, which when run on a computer causes the computer to implement the quantization parameter determination method. As can be seen from the above technical solutions, in the quantization parameter determining method provided by some embodiments of the present application, when determining a quantization parameter of a video frame to be encoded, it is first determined whether the video frame to be encoded is a refresh frame that does not use the encoded video frame as a reference for encoding, and when the video frame to be encoded is not a refresh frame, a first dispersion for characterizing pixel values of each pixel point in the video frame to be encoded, and a second dispersion for characterizing pixel values of each pixel point in the refresh frame with a minimum interval with the video frame to be encoded are obtained, and according to the first dispersion parameter, the second dispersion parameter, and a reference RQ model of a reference frame, a first RQ model is obtained, and a quantization paramete