CN116156169A - Quantization parameter determination method and device - Google Patents

Quantization parameter determination method and device Download PDF

Info

Publication number
CN116156169A
CN116156169A CN202211635469.3A CN202211635469A CN116156169A CN 116156169 A CN116156169 A CN 116156169A CN 202211635469 A CN202211635469 A CN 202211635469A CN 116156169 A CN116156169 A CN 116156169A
Authority
CN
China
Prior art keywords
video frame
encoded
code rate
parameter
video
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211635469.3A
Other languages
Chinese (zh)
Inventor
王照
黄兴军
张昊
李斌
邢芳
张雯
王之奎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN202211635469.3A priority Critical patent/CN116156169A/en
Publication of CN116156169A publication Critical patent/CN116156169A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/177Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a group of pictures [GOP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Some embodiments of the present application provide a quantization parameter determining method and apparatus, and relate to the technical field of video encoding and decoding. Comprising the following steps: acquiring a video to be encoded; determining whether the video frame to be encoded is a refresh frame; 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 the reference video frame; the reference video frame is a refreshing frame with the minimum interval with the video frame to be coded; 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 the 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 the target code rate. And the quantization parameter corresponding to the video frame is accurately set according to the target code rate.

Description

Quantization parameter determination method and device
Technical Field
Some embodiments of the present 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 encoding a video frame sequence using an LCEVC encoder, all video frames in the video frame sequence are quantized using constant quantization parameters (Quantization Parameter, QP). However, the rate control of the LCEVC encoder requires that the LCEVC encoder can output a code stream with an expected code rate, but when the LCEVC encoder uses the same quantization parameter to encode different video frames, the code rates of the code streams output by the LCEVC encoder are not the same, so that the code rates of the code streams corresponding to the video frames 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 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 the reference video frame; the reference video frame is a refreshing frame with the minimum interval with the video frame to be coded;
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 the 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 the target code rate.
In a second aspect, some embodiments of the present application provide a quantization parameter determination 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, when determining the quantization parameter of the video frame to be encoded, the quantization parameter determining method provided in some embodiments of the present application first determines 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, obtains a first dispersion for characterizing the pixel value of each pixel point in the video frame to be encoded, and a second dispersion for characterizing the pixel value of each pixel point in the refresh frame with the minimum interval with the video frame to be encoded, and obtains a first RQ model according to the first dispersion parameter, the second dispersion parameter, and a reference RQ model of the reference frame, and determines the quantization parameter corresponding to the video frame to be encoded according to the first RQ model and the target code rate. Because the dispersion of the pixel values of each pixel point in the video frame is directly related to the code rate of the code stream corresponding to the video frame, some embodiments of the present application can obtain the similarity of the video frame to be encoded and the refresh frame with the minimum coding interval under the code rate dimension according to the first dispersion parameter and the second dispersion parameter, and further accurately obtain the first RQ model of the video frame to be encoded according to the similarity update of the reference RQ model, so some embodiments of the present application can accurately determine the quantization parameter corresponding to the video frame to be encoded according to the target code rate.
Drawings
In order to more clearly illustrate some embodiments of the present application or implementations in the related art, a brief description will be given below of the drawings required for the embodiments or the related art descriptions, and it is apparent that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings for those of ordinary skill in the art.
Fig. 1 illustrates a schematic diagram of a video decoder framework in some embodiments of the present application;
FIG. 2 illustrates a schematic diagram of a LCEVC encoder in some embodiments of the present application;
FIG. 3 is a schematic diagram of a H.264/AVC, H.265 code rate allocation flow in some embodiments of the present application;
fig. 4 is a schematic diagram illustrating LCEVC encoder code rate allocation in some embodiments of the present application;
FIG. 5 illustrates a flow chart of a quantization parameter determination method in some embodiments of the present application;
FIG. 6 illustrates a graph of logarithms of quantization step sizes and code rates in some embodiments of the present application;
FIG. 7 illustrates a flow chart of a quantization parameter determination method in some embodiments of the present application;
FIG. 8 illustrates a flow chart of a quantization parameter determination method in some embodiments of the present application;
Fig. 9 illustrates a flow chart of a quantization parameter determination method in some embodiments of the present application.
Detailed Description
For purposes of clarity and implementation of the present application, the following description will make clear and complete descriptions of exemplary implementations of the present application with reference to the accompanying drawings in which exemplary implementations of the present application are illustrated, it being apparent that the exemplary implementations described are only some, but not all, of the examples of the present application.
It should be noted that the brief description of the terms in the present application is only for convenience in understanding the embodiments described below, and is not intended to limit the embodiments of the present application. Unless otherwise indicated, these terms should be construed in their ordinary and customary meaning.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
Reference is made to the block diagram of video coding system 100 in some embodiments of the present application shown in fig. 1. As shown in fig. 1, a video coding system 100 includes: a source device 11 and a destination device 12. Wherein the source device 11 may obtain the original video data through the video source 111, and encode the video encoded data obtained by encoding the original video data through the video encoder 112, and provide the video encoder 112 to the destination device 12 through the output interface 113 to output the video encoded data. The destination device 12 may obtain the video encoded data provided by the source device 11 through the input interface 121, decode the video encoded data through the video decoder 122 to obtain video decoded data, and input the video decoded data to the player 123 to realize the playing of the video. Source device 11 and destination device 12 may comprise any of a wide range of devices, such as: personal computers (Program Counter), notebook computers, tablet computers, set-top boxes, cell phones, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, and the like.
In some embodiments, the video source 111 of the source device 11 may be a video capturing device, such as a video camera. In other embodiments, video source 111 may be a component capable of generating video based on computer graphics. Such as: a screen recording component, an animation generation component, etc.
In some embodiments, destination device 12 may receive video encoded data provided by source device 11 via a computer readable medium. The computer readable medium may include any type of medium or device capable of moving video encoded data from source device 11 to destination device 12. In one example, a computer-readable medium may comprise a communication medium. The communication medium may modulate the video-encoded data according to a communication standard (e.g., a wireless communication protocol) and transmit it to the destination device 12. Communication media may include any wireless or wired communication media such as a Radio Frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet network (e.g., a local area network, a wide area network, or a global network such as the internet). The communication medium may include a router, a switch, a base station, or any other apparatus that may be used to facilitate communication from source device 11 to destination device 12.
In some examples, video encoded data may be output from output interface 113 of source device 11 to a storage device. Accordingly, the video encoding data may be accessed from the storage device by the input interface 123 of the destination device 12. The storage device may include any of a variety of distributed or locally accessed data storage media such as hard drives, blu-ray discs, DVDs, CD-ROMs, flash memory, volatile or non-volatile memory, or any other suitable digital storage media for storing video encoding data. In another example, the storage device may correspond to a server or an intermediate storage device that may hold video encoding data generated by source device 11. Destination device 12 may obtain stored video encoding data from a storage device via streaming or download. The file server may be any type of server capable of storing encoded video data and transmitting the encoded video data to destination device 12. In some embodiments. The file server includes a web server (e.g., for a website), an FTP server, a network attached storage device, or a local disk drive. Destination device 12 may access the encoded video data over any standard data connection, including an internet connection. This may include a wireless channel (e.g., wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both suitable for accessing encoded video data stored on a file server. The transmission of encoded video data from the storage device may be a streaming transmission, a download transmission, or a combination thereof.
As described above, video encoding may be understood as a process of compressing video data, video decoding may be understood as a process of restoring compressed video data, and video encoder 112 may be understood as a set of standard rules in the process of compressing video data, and video decoder 122 may be understood as a set of standard rules in the process of restoring video data, and generally, video decoder 122 needs to use a decoding manner corresponding to the encoding manner used by video encoder 121 to correctly decode video data.
Currently, video coding standards have gradually evolved from the very beginning ISO/IECMPEG-1 to multi-functional video coding (Versatile Video Coding, VVC), HEVC via ISO/IECMPEG-2, ISO/IEC MPEG-4, advanced video coding (Advanced Viedo Coding, AVC), high efficiency video coding (High Efficiency Video Coding, HEVC), etc. Although some embodiments of the present application are described in the context of the HEVC standard, it will be appreciated by those skilled in the art that the video encoding methods and video decoding methods provided by the embodiments of the present application may be applicable to any suitable video coding standard.
The quantization parameter determining method provided in some embodiments of the present application is used for determining a quantization parameter when encoding a video frame based on an LCEVC encoder, and controlling the LCEVC encoder to encode the video frame according to the quantization parameter corresponding to the video frame, so that a code rate of a code stream of the video frame output by the LCEVC encoder is a target code rate, and therefore, a structure of the LCEVC encoder is first described below.
Referring to fig. 2, the LCEVC encoder includes: a first downsampling layer 21, a second downsampling layer 22, a base encoding layer 23, a first upsampling layer 24, a first enhancement layer 25, a reduction layer 26, a fusion layer 27, a second upsampling layer 28, and a second enhancement layer 29.
The first downsampling layer 21 is used for downsampling the video frames to be encoded to reduce the resolution of the video frames to be encoded.
The second downsampling layer 22 is used for further downsampling the output of the first downsampling layer 21 to further reduce the resolution of the video frames to be encoded.
The base coding layer 23 is configured to encode the output of the second downsampling layer 22 by a base layer encoder to generate a code stream of the base coding layer 23. It should be noted that the base layer encoder may be any encoder, for example: advanced video coding (Advanced Video Coding, AVC), high efficiency video coding (High Efficiency Video Coding, HEVC) encoder, multi-function video coding (Versatile Video Coding, VVC) encoder, and so forth.
The first upsampling layer 24 is used for upsampling the coded reconstructed image of the base coding layer 23 to increase the resolution of the coded reconstructed image of the base coding layer 23.
The first enhancement layer 25 is configured to calculate a residual (L1 residual) between the output of the first downsampling layer 21 and the output of the first upsampling layer 24, and sequentially transform, quantize, and entropy encode the L1 residual to obtain an L1 enhancement coefficient.
The reduction layer 26 is configured to sequentially perform dequantization, inverse transformation, and filtering on the data quantized by the first enhancement layer 25, and obtain an output of the reduction layer 26.
And a fusion layer 27, configured to perform additive fusion on the output of the reduction layer 26 and the output of the first upsampling layer 24, so as to obtain an output of the fusion layer 27.
The second upsampling layer 28 is used for upsampling the output of the fusion layer 27 to improve the resolution of the image output by the fusion layer 17.
The second enhancement layer 29 is used for calculating the residual (L2 residual) between the output of the second upsampling layer 28 and the original video frame to be encoded, and sequentially performing time domain prediction, transformation, quantization and entropy coding on the L2 residual to obtain the L2 enhancement coefficient.
The quantization control parameters of the base coding layer 23, the first enhancement layer 25, and the second upsampling layer 28 together constitute the rate control parameters of the LCEVC encoder. The encoding process of the LCEVC encoder can be formulated as:
out=E 2 (E 1 (E 0 (x,BaseRate),W1),W2)
wherein x represents an input of the LCEVC encoder; out represents the output of the LCEVC encoder, E 2 、E 1 And E is 0 Representing the coding functions of the second upsampling layer 28, the first enhancement layer 25 and the base coding layer 23, respectively; baseRate, SW1 and SW2 represent rate control parameters of the base coding layer 23, the first enhancement layer 25 and the second upsampling layer 28, respectively.
As described above, the LCEVC encoder encodes a frame of video frame by: the quantization when the basic coding layer generates the basic code stream, the quantization of the L1 residual by the first enhancement layer 25 and the quantization of the L1 residual by the second enhancement layer 29 all require control of quantization parameters, and all affect the code rate of the finally generated code stream, so that determining quantization parameters in some embodiments of the present application may control one or more of the three quantization of the LCEVC encoder to achieve final code rate control.
At present, an enhancement layer in a reference encoder of LCEVC has no code rate control algorithm, and the whole video frame sequence is quantized by using constant quantization parameters, so that the code rate of an output code stream cannot be accurately controlled. To solve this problem, an RQ model needs to be built, and the more accurate the RQ model, the more accurate the rate control can be performed.
In the video coding standards of h.264/advanced video coding (Advanced Video Coding, AVC) and h.265, there are already a variety of RQ models. As shown in fig. 3, the process of allocating the code rate from the code rate to the actual code rate obtained finally by the coding standards of h.264/AVC, h.265 and the like includes:
s31, the code rates are distributed step by step according to the expected total code rate and the sequence of the video frames (Group of Pictures, GOP), the video frames and the image blocks.
The implementation of step S31 (allocating code rates step by step in order from GOP, video frame, picture block according to the expected total code rate) may include: firstly, a constant code rate is allocated to each GOP according to the target code rate requirement, then the code rate is allocated to each video frame in the GOP according to the number of video frames in the GOP and the code rate allocated to the GOP, and the code rate is divided into the code rate for each image block according to the code rate of the video frame and the size and the number of the image blocks in the video frame. It should be noted that, the target allocated in step S31 is not the code rate of the code stream obtained by the final actual encoding, and the code rates of the GOP, the video frame, and the image block in the actual encoding process are dynamically adjusted according to the code rate consumption in the actual encoding process.
S32, predicting to obtain preliminary quantization parameters.
In some embodiments, the quantization parameters for a video frame or picture block may be calculated from the RQ model and the code rate assigned to the video frame or picture block. That is, the coding rate allocated to the video frame or image block is substituted into the RQ model to calculate the quantization parameter corresponding to the video frame or image block. The preliminary quantization parameter is not directly used for quantization coding, but needs to be dynamically adjusted according to the code rate consumption in the actual coding process.
S33, performing actual coding according to the quantization parameters, wherein the coding process involves selection of various blocks and coding modes.
In the actual encoding process, firstly, a GOP needs to be split into single video frames, then the split video frames are input into an encoder one by one, the encoder needs to divide image blocks of the video frames after receiving the video frames, and then a corresponding encoding mode is selected for encoding according to the characteristics of the divided image blocks.
And S34, obtaining the final actual coding rate according to Lagrangian optimization.
The nature of code rate allocation is a problem with extremum from the lagrangian constraint. That is, the code rate allocated to one GOP is constant G, N I 、N B 、N P Respectively representing the number of I frames, B frames and P frames in a GOP, T I 、T B 、T P Representing the average code rate allocated to I, B, P frames, the lagrangian constraint is:
N I *T I +N B *T B +N P *T P =G
minimizing distortion under the constraints described above is to minimize the value of the following equation:
Figure BDA0004007027230000091
wherein Q is I 、Q B 、Q P Mean quantization parameters respectively representing I frame, B frame, P frame, and T t *Q t =X t ,t=I,P,B,X t Is a constant, in particular an estimate of the complexity of the I-frames, B-frames, P-frames.
In general, T in actual calculation t Can be simplified to the following formula:
T t =X t G/∑K t X t N t
wherein K is t Is constant.
In addition, in order to fully consider the coding condition of the previous frame, a linear feedback mechanism is also introduced to limit the code rate allocated to the nth frame type T to be T t,n The method specifically comprises the following steps:
Figure BDA0004007027230000092
wherein T is prev The code rate used by the previous frame image.
Further to ensure minimum quality requirements, T is also t,n The restrictions apply the following restrictions:
T t,n =max(R/8F,(1-λ)X t,n-1 G/∑X t,n-1 N t +aT prev
where F is the frame rate.
Based on all the above constraints, the code rate allocated to each video frame satisfies the following equation for the coded picture buffer to neither overflow nor underflow:
Figure BDA0004007027230000101
where β is a constant. Illustratively, β=0.9.
As shown in fig. 4, in the LCEVC standard, the procedure of allocating the progressive code rate to the final coding code rate includes:
s41, gradually distributing code rates according to the expected total code rate according to the sequence of the video frames (Group of Pictures, GOP) and the sequence of the video frames.
The implementation of step S41 is similar to that of step S31 above, except that the minimum granularity of code rate allocation is video frames, and code rates do not need to be allocated to image blocks of the video frames.
S42, determining quantization parameters.
Similarly, the bit rate allocated to the video frame is substituted into the RQ model to calculate the quantization parameter corresponding to the video frame. The difference from the coding standards of H.264/AVC, H.265, etc. is that the quantization parameters determined here are directly used for quantization coding without any further dynamic adjustment. .
S43, coding to obtain the code rate.
The biggest difference from coding standards such as h.264/AVC, h.265, etc. is that the code rate obtained here is the code rate of the code stream obtained by actual coding, is the exact code rate and is not based on the code rate obtained according to lagrangian optimization.
As described above, no code rate allocation is made for image blocks among LCEVC standards, and thus the minimum granularity of code rate allocation is a video frame. After the code rate of the video frame is determined, a specific quantization parameter is predicted according to the code rate of the video frame, and the coding is performed according to the predicted quantization parameter to obtain an accurate code rate.
The LCEVC standard is different from H.264/AVC and H.265 in terms of code rate allocation, and the difference is one: the granularity of code rate allocation, the minimum granularity of code rate allocation of H.264/AVC and H.265 is an image block, and the minimum granularity of code rate allocation of LCEVC standard is a video frame; and the difference is as follows: the h.264/AVC, h.265 requires a complex mode selection coding process after the quantization parameters are determined, whereas the LCEVC standard does not.
Based on the first difference, because the H.264/AVC and the H.265 divide the video frame into a plurality of image blocks and respectively encode, the number of the image blocks divided by one frame of video frame is large, different image blocks of the same video frame can be encoded by using different quantization parameters, even if the code rate of the allocation of some image blocks is inaccurate, the subsequent image blocks can be allocated according to the residual code rate, and the code rate of the final video frame can still be kept stable. In the LCEVC standard, since the minimum granularity of code rate allocation is a video frame, that is, one video frame has only one quantization parameter, if the prediction of the quantization parameter is inaccurate, the code rate fluctuation between video frames will be large, and the final quality fluctuation will also be large, so compared with h.264/AVC and h.265, the LCEVC standard needs to predict the quantization parameter more accurately.
Based on the second difference, since the coding flow of the LCEVC standard has no complex mode selection process, the coding flow is relatively simple, and thus the complexity of the quantization time is not increased particularly even a plurality of times under the LCEVC standard.
Compared with H.264/AVC and H.265, the LCEVC standard needs to predict the quantization parameters more accurately, and the complexity of multiple times of quantization time under the LCEVC standard is not increased particularly, so some embodiments of the application provide a scheme for improving the accuracy of the final code rate in a multiple times of quantization mode.
Based on the foregoing, some embodiments of the present application provide a quantization parameter determination method, as shown in fig. 5, which includes the following steps S51 to S54:
s51, obtaining a video to be encoded.
In some embodiments, each video frame of the video to be encoded may be sequentially input to the encoder, so that the encoder regards each video frame of the video frame to be encoded as the video to be encoded one by one.
S52, determining whether the video frame to be encoded is a refresh frame.
When the video to be encoded is not a 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 a refreshing frame, the video to be encoded is not encoded by taking the encoded video frame as a reference.
Specifically, when video coding is performed, if all video frames of a video are coded by taking a certain coded video frame preceding the video frame as a reference, if any video frame has a coding error, the subsequent all video frames have a coding error, and the video coding fault tolerance is extremely low. To solve this problem, when video encoding is actually performed, one or more special video frames are specified in the video frame sequence, and when the video encoder encodes the specified special video frames, the video encoder empties the buffered reference data portion, so as to prevent the previous encoding error from propagating to the subsequent video frames, and the video encoder empties the buffered reference data portion, and the video frame that does not take the encoded video frame as a reference during encoding is the refresh frame in some embodiments of the present application.
In some embodiments, the refresh frame may be the first video frame of each sequence of video frames. When the refresh frame is the first video frame of each video frame sequence, the step S51 (determining whether the video frame to be encoded is a refresh frame) includes: judging whether the video frame to be encoded is the first video frame of the current video frame sequence; if yes, determining the video frame to be encoded as the refreshing frame; if not, determining that the video frame to be encoded is not the refreshing frame.
In some embodiments, one refresh frame may be set per a preset number of video frames per interval. When one refresh frame is set per a preset number of video frames at intervals, the above step S51 (determining whether or not the video frame to be encoded is a refresh frame) includes: judging whether the interval between the video frame to be encoded and the last refreshing frame reaches a preset quantity or not; if yes, determining the video frame to be encoded as the refreshing frame; if not, determining that the video frame to be encoded is not the refreshing frame.
Of course, it is also possible to designate a refresh frame in the video frames in other manners, and determine whether each video frame to be encoded is the refresh frame in a corresponding manner, which is not limited in some embodiments of the present application, so as to be able to determine whether each video frame of the video is the refresh frame.
In the above step S52, if the video frame to be encoded is not the refresh frame, the following steps S53 to S55 are performed.
S53, acquiring a first dispersion parameter and a second dispersion parameter.
The first dispersion parameter and the second dispersion parameter are used for representing the dispersion of pixel values of each pixel point in the video frame to be encoded and the reference video frame respectively; the reference video frame is a refresh frame with the minimum interval with the video frame to be encoded.
In some embodiments, the first dispersion parameter may be a variance of pixel values of respective pixels in the video frame to be encoded, and the second dispersion parameter may be a variance of pixel values of respective pixels in the reference video frame.
In some embodiments, the first dispersion parameter may be a standard deviation of pixel values of respective pixels in the video frame to be encoded, and the second dispersion parameter may be a standard deviation of pixel values of respective pixels in the reference video frame.
Of course, the first dispersion parameter and the second dispersion parameter may also be other parameters characterizing the dispersion of pixel values of each pixel point in the video frame to be encoded, for example: the range, the coefficient of variation (coefficient of variation), etc., which are not limited in some embodiments of the present application, the first dispersion parameter can represent the dispersion of the pixel values of each pixel point in the video frame to be encoded, and the first dispersion parameter can represent the dispersion of the pixel values of each pixel point in the reference video frame.
The entropy coding mode used in the LCEVC standard is run-length coding. Run length encoding is an arithmetic encoding such as: a string "aaabcccddddd" may be represented by "3a1b2c5d" after run-length encoding. Because the run-length encoding and the data distribution have a great relationship, if the pixel value distribution of the video frame is more concentrated (the dispersion is lower), the encoding efficiency of the video frame is higher, so that the first dispersion parameter capable of representing the dispersion of the pixel value of each pixel point in the video frame to be encoded is obtained as the update basis of the RQ model in the application embodiment.
S54, updating a reference code Rate (Rate) -quantization parameter (Quantization Parameter, QP) model according to the first dispersion parameter and the second dispersion parameter, and obtaining a first RQ model.
Wherein the reference RQ model is an RQ model of the reference video frame.
The RQ model of a video frame is first described below.
Referring to fig. 6, fig. 6 is a graph of logarithms of quantization step sizes and code rates corresponding to quantization parameters of video frames 1 to 4. As shown in fig. 6, the logarithm of the quantization parameter and the code rate shows a linear relationship, i.e., the relationship of the quantization parameter and the code rate shows a logarithmic relationship. Further, as can be seen from fig. 6: the relationship between quantization parameters and code rates of different video frames is different (e.g., the curve 61 corresponding to video frame 1 and the curve 62 corresponding to video frame 2 in fig. 6 do not overlap), so different linear parameters need to be used to fit the logarithm of quantization parameters and code rates according to the content of video frames. And finally, the linear equation Q=lambdanR+gamma obtained by fitting the logarithm of the quantization parameter and the code rate is the RQ model of the video frame.
The linear equation q=λlnr+γ includes two parameters in total, one being the slope (λ) and the other being the intercept (γ), so that the reference RQ model is updated according to the first and second dispersion parameters, obtaining a first RQ model comprising: and updating the slope and/or intercept of the reference RQ model according to the first dispersion parameter and the second dispersion parameter to acquire the first RQ model.
S55, determining quantization parameters corresponding to the video frame to be encoded according to the first RQ model and the target code rate.
In some embodiments, the step S55 (determining the quantization parameter corresponding to the video frame to be encoded according to the first RQ model and the target bitrate) includes: substituting the target code rate into the first RQ model to calculate and obtain the quantization parameter corresponding to the video frame to be encoded.
When determining the quantization parameter of a video frame to be encoded, the quantization parameter determining method provided by some embodiments of the present application first determines whether the video frame to be encoded is a refresh frame encoded with the encoded video frame as a reference, and when the video frame to be encoded is not the refresh frame, obtains 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 the minimum interval with the video frame to be encoded, and obtains a first RQ model according to the first dispersion parameter, the second dispersion parameter, and a reference RQ model of the reference frame, and determines the quantization parameter corresponding to the video frame to be encoded according to the first RQ model and a target code rate. Because the dispersion of the pixel values of each pixel point in the video frame is directly related to the code rate of the code stream corresponding to the video frame, some embodiments of the present application can obtain the similarity of the video frame to be encoded and the refresh frame with the minimum interval under the code rate dimension according to the first dispersion parameter and the second dispersion parameter, and further accurately obtain the first RQ model of the video frame to be encoded according to the similarity update of the reference RQ model, so some embodiments of the present application can accurately determine the quantization parameter corresponding to the video frame to be encoded according to the target code rate.
As an extension and refinement of the above embodiments, some embodiments of the present application provide another quantization parameter determination method, as shown with reference to fig. 7, including the following steps S701 to S708:
s701, obtaining a video to be encoded.
S702, determining whether the video frame to be encoded is a refresh frame.
When the video to be encoded is not a 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 a refreshing frame, the video to be encoded is not encoded by taking the encoded video frame as a reference.
The implementation manner of acquiring and determining whether the video frame to be encoded is the refresh frame in the above steps S701 and S702 is the same as the implementation manner of acquiring and determining whether the video frame to be encoded is the refresh frame in the steps S51 and S52, and in order to avoid redundancy, detailed description will be omitted here.
In the above step S702, if the video frame to be encoded is not a refresh frame, the following steps S703 to S709 are performed.
S703, calculating the variance of the pixel values of each pixel point in the video frame to be encoded to obtain the first dispersion parameter.
In some embodiments, the variance of pixel values for each pixel point in the video frame to be encoded may be calculated by the following formula:
Figure BDA0004007027230000151
Wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure BDA0004007027230000152
for the variance of the pixel values of each pixel point in the video frame to be encoded, X is the pixel value of the pixel point in the video frame to be encoded, μ is the average value of the pixel values of each pixel point in the video frame to be encoded, and N is the number of pixel points in the video frame to be encoded (the resolution of the video frame to be encoded).
S704, calculating the variance of pixel values of all pixel points in the reference video frame to obtain the second dispersion parameter.
The implementation of step S704 is similar to the implementation of step S703 above and will not be described in detail here.
S705, obtaining a first slope according to the first dispersion parameter, the second dispersion parameter and the slope of the reference RQ model.
In some embodiments, the step S705 (obtaining a first slope from the first and second dispersion parameters and the slope of the reference RQ model) above includes steps 705a to 705c as follows:
step 705a, calculating a difference value between the second dispersion parameter and the first dispersion parameter, and obtaining a first calculated value.
The first calculated value is denoted as m, and the second dispersion parameter is denoted as
Figure BDA0004007027230000161
Said second dispersion parameter is marked +. >
Figure BDA0004007027230000162
Then there are: />
Figure BDA0004007027230000163
Step 705b, calculating the ratio of the first calculated value to the second dispersion parameter, and obtaining a second calculated value.
The second calculated value is denoted as n, and then there is:
Figure BDA0004007027230000164
step 705c, calculating the product of the second calculated value and the slope of the reference RQ model, to obtain the first slope.
The first slope is denoted as lambda i The slope of the reference RQ model is denoted as lambda 0 The following steps are:
Figure BDA0004007027230000165
s706, updating the intercept of the reference RQ model according to the first dispersion parameter and the second dispersion parameter, and obtaining a first intercept.
In some embodiments, step S706 above (updating the intercept of the reference RQ model according to the first and second dispersion parameters, obtaining a first intercept) includes steps 706 a-706 c as follows:
step 706a, calculating a difference value between the second dispersion parameter and the first dispersion parameter, and obtaining a first calculated value.
Likewise, the first calculated value is denoted as m and the second dispersion parameter is denoted as
Figure BDA0004007027230000171
Said second dispersion parameter is marked +.>
Figure BDA0004007027230000172
Then there are:
Figure BDA0004007027230000173
step 706b, calculating a ratio of the first calculated value to the second dispersion parameter, so as to obtain a second calculated value.
Similarly, when the second calculated value is denoted as n, there are:
Figure BDA0004007027230000174
step 706c, calculating a product of the second calculated value and an intercept of the reference RQ model to obtain the first intercept.
The first slope is marked as gamma i The slope of the reference RQ model is noted as gamma 0 Then there is:
Figure BDA0004007027230000175
S707, generating the first RQ model according to the first slope and the first intercept.
That is, the first RQ model is: q=λ i lnR+γ i . Wherein lambda is i For the first slope, gamma i Is the first intercept.
S708, determining quantization parameters corresponding to the video frame to be encoded according to the first RQ model and the target code rate.
In some embodiments, the target code rate may be substituted into the first RQ model q=λ i lnR+γ i Calculating a quantization parameter corresponding to the target code rate, and determining the calculated quantization parameter as the quantization parameter corresponding to the video frame to be encoded.
S709, controlling an LCEVC encoder to encode the video frame to be encoded through the quantization parameter corresponding to the video frame to be encoded so as to acquire encoded data of the video frame to be encoded.
Although the RQ models of different video frames differ, the content of temporally close video frames in a sequence of video frames is similar, and thus the RQ models of temporally close video frames also have some similarity. The above embodiment is similar based on the RQ models of video frames that are close in time, and uses the variance of each pixel value to quantify the specific index to quantify the similarity between the similarities between adjacent frames, so as to predict the RQ model of one video frame according to the RQ model of another video frame and the variance of each pixel value, so that the above example can avoid constructing the RQ model independently for each video frame, and further reduce the calculation amount in the encoding process of the video frame sequence.
Because the quantization parameter corresponding to the video frame to be encoded is obtained according to the target code rate and the first RQ model, the rate of the code stream obtained by encoding the video frame to be encoded by the LCEVC encoder is controlled to be the target code rate or close to the target code rate through the quantization parameter corresponding to the video frame to be encoded.
Some embodiments of the present application provide another quantization parameter determination method, referring to fig. 8, which includes the following steps S801 to S806:
s801, obtaining a video to be encoded.
S802, determining whether the video frame to be encoded is a refresh frame.
When the video to be encoded is not a 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 a refreshing frame, the video to be encoded is not encoded by taking the encoded video frame as a reference.
The implementation manner of acquiring and determining whether the video frame to be encoded is the refresh frame in the above steps S801 and S802 is the same as the implementation manner of acquiring and determining whether the video frame to be encoded is the refresh frame in the steps S51 and S52, and in order to avoid redundancy, detailed description will be omitted here.
In step S802, if it is determined that the refresh frame is present, the following steps S904 to S806 are performed:
S803, the LCEVC encoder is controlled to encode the video frame to be encoded through the first quantization parameter and the 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.
As described above, the RQ model is a linear equation q=λlnr+γ, so that only two parameters of the slope λ and the intercept γ need to be determined to obtain an accurate RQ model. To obtain these two parameters, some embodiments of the present application employ the following methods: and (3) arbitrarily selecting two unequal quantization parameters (a first quantization parameter and a second quantization parameter), respectively using an LCEVC encoder to encode the video frame to obtain code rates (a first code rate and a second code rate) of a code stream obtained by encoding based on the two quantization parameters, and constructing a binary once equation according to the first quantization parameter, the second quantization parameter, the first code rate and the second code rate so as to solve lambda and gamma in a linear equation Q=lambda lnR+gamma.
S804, according to the first quantization parameter, the second quantization parameter, the first code rate and the second code rate, the second RQ model is obtained.
In some embodiments, the first quantization parameter and the first code rate may be substituted into a linear equation q=λlnr+γ, and the second quantization parameter and the second code rate may be substituted into a linear equation q=λlnr+γ, resulting in a binary first-order equation, and the two binary first-order equations are solved to obtain values of λ and γ.
S805, determining quantization parameters corresponding to the video frame to be encoded according to the second RQ model and the target code rate.
Namely, substituting the target code rate into the second RQ model to obtain a quantization parameter corresponding to the target code rate, and determining the quantization parameter corresponding to the target code rate as the quantization parameter corresponding to the video frame to be encoded.
S806, controlling an LCEVC encoder to encode the video frame to be encoded through the quantization parameter corresponding to the video frame to be encoded so as to acquire encoded data of the video frame to be encoded.
According to the embodiment, under the condition that the video frame to be encoded is a refresh frame, two unequal quantization parameters are selected for quantization, entropy encoding is then carried out to obtain code rates corresponding to the two unequal quantization parameters respectively, and then an RQ model corresponding to the video frame to be encoded is accurately constructed according to the two unequal quantization parameters and the code rates corresponding to the two unequal quantization parameters respectively.
Some embodiments of the present application provide another quantization parameter determination method, referring to fig. 9, which includes the following steps S901 to S913:
s901, obtaining a video to be encoded.
S902, determining whether the video frame to be encoded is a refresh frame.
When the video to be encoded is not a 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 a refreshing frame, the video to be encoded is not encoded by taking the encoded video frame as a reference.
The implementation manner of acquiring and determining whether the video frame to be encoded is the refresh frame in the above steps S901 and S902 is the same as the implementation manner of acquiring and determining whether the video frame to be encoded is the refresh frame in the steps S51 and S52, and in order to avoid redundancy, detailed description will be omitted here.
In step S902, if it is determined that the refresh frame is present, the following steps S903 to S907 are performed:
s903, the LCEVC encoder is controlled to encode the video frame to be encoded through the first quantization parameter and the 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.
The implementation manner and principle of the step S903 are the same as those of the step S904, and will not be described in detail here for avoiding redundant description.
S904, obtaining a second slope according to the first quantization parameter, the second quantization parameter, the common logarithm of the first code rate (common logrithm/Briggs logrithm) and the common logarithm of the second code rate.
Specifically, the common logarithm in the examples of the present application refers to the logarithm based on 10. For example: the common logarithm of the first code rate is the logarithm of the base 10, the true number of the first code rate. Setting: the first code rate is R1, and the common logarithm of the first code rate is L1, l1=log 10 R1=lnR1。
In some embodiments, the step S904 obtains 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, and includes the following steps 904a to 904c:
step 904a, calculating a difference value between the second quantization parameter and the first quantization parameter, and obtaining a third calculated value.
The first quantization parameter is denoted as Q1, the second quantization parameter is denoted as Q2, and the third calculated value is denoted as a, then there are:
a=Q2-Q1
and 904b, calculating a difference value between the common logarithm of the first code rate and the common logarithm of the second code rate, and obtaining a fourth calculated value.
The first code rate is denoted as R1, the second code rate is denoted as R2, and the fourth calculated value is denoted as b, then:
b=lnR2-lnR1
Step 904c, calculating a ratio of the third calculated value to the fourth calculated value to obtain the second slope.
The second slope is denoted as lambda j The following steps are:
Figure BDA0004007027230000211
s905, obtaining a second intercept according to the second slope, the first quantization parameter and the common logarithm of the first code rate.
In some embodiments, the step S905 (obtaining the second intercept according to the second slope, the first quantization parameter, and the common logarithm of the first code rate) includes the following steps 905a and 905b:
step 905a, calculating the product of the second slope and the common logarithm of the first code rate, to obtain a fifth calculated value.
The fifth calculated value is denoted as c, and there are:
c=λ j *lnR1
step 905b, calculating a difference between the first quantization parameter and the fifth calculated value to obtain the second intercept.
Marking the second intercept as gamma j The following steps are:
γ j =Q1-c=Q1-λ j *lnR1
s906, generating the second RQ model from the second slope and the second intercept.
That is, the second RQ model is:
Figure BDA0004007027230000212
s907, determining quantization parameters corresponding to the video frame to be encoded according to the second RQ model and the target code rate.
In the above step S902, if the video frame to be encoded is not a refresh frame, the following steps S908 to S913 are performed.
S908, calculating the variance of pixel values of all pixel points in the video frame to be encoded to obtain the first dispersion parameter.
S909, calculating the variance of the pixel values of each pixel point in the reference video frame to obtain the second dispersion parameter.
The reference video frame is a refresh frame with the minimum interval with the video frame to be encoded.
S910, obtaining a first slope according to the first dispersion parameter, the second dispersion parameter and the slope of the reference RQ model.
S911, acquiring a first intercept according to the first dispersion parameter, the second dispersion parameter and the intercept of the reference RQ model.
S912, generating the first RQ model from the first slope and the first intercept.
S913, determining quantization parameters corresponding to the video frame to be encoded according to the first RQ model and the target code rate.
The implementation manner of the steps S908 to S913 is the same as the implementation manner of the steps S703 to S708 in the embodiment shown in fig. 7, and will not be described in detail here for avoiding redundancy.
After the quantization parameter corresponding to the video frame to be encoded is obtained through the above step S907 (determining the quantization parameter corresponding to the video frame to be encoded according to the second RQ model and the target code rate) or the above step S913 (determining the quantization parameter corresponding to the video frame to be encoded according to the first RQ model and the target code rate), the following step S914 is performed.
S914, controlling an LCEVC encoder to encode the video frame to be encoded through the quantization parameter corresponding to the video frame to be encoded so as to acquire encoded data of the video frame to be encoded.
According to the embodiment, under the condition that the video frame to be encoded is a refreshing frame or not, the RQ model of the video frame to be encoded can be accurately obtained, further, the quantization parameter of the video frame to be encoded is accurately set according to the RQ model corresponding to the video frame to be encoded and the target code rate, and the LCEVC encoder is controlled to encode the video frame to be encoded according to the quantization parameter corresponding to the video frame to be encoded, so that encoded data with the code rate of the target code rate is obtained.
When the LCEVC encoder is configured as LTM, the encoder of the basic encoding layer of the LCEVC encoder is x264, the refresh period is set to 3,5, and 10, the target code rate is set to 100,300, and 500, and the following tables 1 and 2 show the encoding results of the video sequences basketballoon drive_1920x1080 and fourier_1280x720 under different target code rates, respectively, where the target code rate and the actual code rate unit are kbit/s.
TABLE 1
Figure BDA0004007027230000231
TABLE 2
Figure BDA0004007027230000232
As can be seen from the above tables 1 and 2, the quantization parameter determined by the quantization parameter determining method provided by the embodiments of the present application can make the actual code rate the same as the target code rate more accurately, so that some embodiments of the present application can accurately determine the quantization parameter corresponding to the video frame to be encoded according to the target code rate.
Further, as can be seen from tables 1 and 2 above: the shorter the refresh period is, the smaller the code rate deviation is, the larger the target code rate is, and the smaller the code rate deviation is, so that the refresh period can be set according to the requirement on the code rate deviation and the target code rate in actual use, and the actual code rate deviation meets the requirement.
It should be further noted that the shorter the refresh period, the higher the accuracy of the RQ model prediction, but each refresh period needs to be encoded twice to obtain the corresponding RQ model, and performing the encoding twice introduces additional calculation amount, so in order to balance the accuracy and the calculation amount in practical use, some embodiments of the present application propose a strategy of periodic refresh and local update. On one hand, periodic refreshing can ensure that errors cannot accumulate too much to cause overlarge subsequent coding deviation, on the other hand, local updating is used, and the prediction of parameters of the RQ model is carried out by utilizing the characteristic of similarity between frames close to each other in the time domain, so that the parameter self-adaptive adjustment of the RQ model is carried out, and the accuracy of the RQ model is improved. The basis of the local update by using the variance information as the update is that the entropy coding uses run-length coding, which is sensitive to the probability distribution of the characters, so that the coding efficiency is higher when the variance is smaller, and the code rate is smaller.
Based on the same inventive concept, as an implementation of the above method, some embodiments of the present application further provide a quantization parameter determining device, where the embodiments of the device correspond to the foregoing method embodiments, and for convenience of reading, details of the foregoing method embodiments are not repeated one by one, but it should be clear that the quantization parameter determining device in this embodiment can correspondingly implement all the details of the foregoing method embodiments. In some embodiments, the quantization parameter determining device includes: a memory configured to store a computer program; a processor configured to cause the apparatus for determining a rate control parameter to implement the quantization parameter determination method according to any one of the above embodiments when a computer program is invoked.
In some embodiments, 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 according to any of the above embodiments.
In some embodiments, 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 of any of the above embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
The foregoing description, for purposes of explanation, has been presented in conjunction with specific embodiments. However, the illustrative discussions above are not intended to be exhaustive or to limit the embodiments to the precise forms disclosed above. Many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles and the practical application, to thereby enable others skilled in the art to best utilize the embodiments and various embodiments with various modifications as are suited to the particular use contemplated.

Claims (10)

1. A quantization parameter determination method, comprising:
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 the reference video frame; the reference video frame is a refreshing frame with the minimum interval with the video frame to be coded;
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 the 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 the target code rate.
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. The method of claim 1, wherein updating the reference RQ model based on the first and second dispersion parameters to obtain a first RQ model comprises:
updating the slope of the reference RQ model according to the first dispersion parameter and the second dispersion parameter to obtain a first slope;
updating the intercept of the reference 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. The method of claim 3, wherein the obtaining a first slope from the first and second dispersion parameters and the slope of the reference 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 RQ model to obtain the first slope.
5. The method of claim 3, wherein the obtaining a first intercept based on the first and second dispersion parameters and the intercept of the reference 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 RQ model to obtain the first intercept.
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 the 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. 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. 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. 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. A quantization parameter determination apparatus, comprising:
a memory configured to store a computer program;
a processor configured to cause the apparatus for determining a rate control parameter to implement the quantization parameter determination method of any one of claims 1-9 when the computer program is invoked.
CN202211635469.3A 2022-12-19 2022-12-19 Quantization parameter determination method and device Pending CN116156169A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211635469.3A CN116156169A (en) 2022-12-19 2022-12-19 Quantization parameter determination method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211635469.3A CN116156169A (en) 2022-12-19 2022-12-19 Quantization parameter determination method and device

Publications (1)

Publication Number Publication Date
CN116156169A true CN116156169A (en) 2023-05-23

Family

ID=86339919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211635469.3A Pending CN116156169A (en) 2022-12-19 2022-12-19 Quantization parameter determination method and device

Country Status (1)

Country Link
CN (1) CN116156169A (en)

Similar Documents

Publication Publication Date Title
CN102301710B (en) Multiple bit rate video encoding using variable bit rate and dynamic resolution for adaptive video streaming
CN106961603B (en) Intracoded frame code rate allocation method and device
US8477843B2 (en) Method of implementing improved rate control for a multimedia compression and encoding system
CN103402099A (en) Picture-level rate control for video encoding
ITTO20090486A1 (en) DYNAMIC CONTROLLER OF INDEPENDENT TRANSMISSION SPEED FROM THE GROUP OF IMAGES
US9560386B2 (en) Pyramid vector quantization for video coding
CN114501010A (en) Image encoding method, image decoding method and related device
US20240205467A1 (en) Delivery and playback of content
CN103533365A (en) Bit rate control method and bit rate control system
US20230111773A1 (en) Processing media using neural networks
US20240080500A1 (en) Methods, systems, and apparatuses for processing video by adaptive rate distortion optimization
US11303916B2 (en) Motion compensation techniques for video
RU2485711C2 (en) Method of controlling video bitrate, apparatus for controlling video bitrate, machine-readable recording medium on which video bitrate control program is recorded
US20240048694A1 (en) Processing Media By Adaptive Group of Pictures Structuring
US11343513B2 (en) Image encoding method and decoding method, encoder, decoder, and storage medium
CN116156169A (en) Quantization parameter determination method and device
KR20130086294A (en) Video rate control based on transform-coefficients histogram
CN116506617B (en) Image shallow compression code rate control method and device
US20240040153A1 (en) Systems, methods, and apparatuses for video processing
WO2016083229A1 (en) Scalable encoding and decoding methods and corresponding devices with combined intraprediction and interlayer prediction
KR20060019801A (en) Rate control apparatus and method in video encoder
CN117425009A (en) Bit number distribution method, device, equipment and storage medium in video coding
WO2024088999A1 (en) Method for encoding an input signal using neural network and corresponding device
CN115243042A (en) Quantization parameter determination method and related device
CN115695800A (en) Video coding method and device for optimizing code rate allocation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination