CN117998089A - Code rate control method, device, computer equipment and storage medium - Google Patents

Code rate control method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117998089A
CN117998089A CN202410289260.9A CN202410289260A CN117998089A CN 117998089 A CN117998089 A CN 117998089A CN 202410289260 A CN202410289260 A CN 202410289260A CN 117998089 A CN117998089 A CN 117998089A
Authority
CN
China
Prior art keywords
key frame
bit number
target
frame interval
current
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
CN202410289260.9A
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.)
Symboltek Co ltd
Original Assignee
Symboltek 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 Symboltek Co ltd filed Critical Symboltek Co ltd
Priority to CN202410289260.9A priority Critical patent/CN117998089A/en
Publication of CN117998089A publication Critical patent/CN117998089A/en
Pending legal-status Critical Current

Links

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/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/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

Landscapes

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

Abstract

The application relates to a code rate control method, a code rate control device, computer equipment and a storage medium. The method comprises the following steps: determining a first target bit number of a current key frame interval according to a target code rate of a code stream to be processed; and determining a second target bit number of the current key frame interval according to the current bit number deviation accumulated value and the first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents the difference value between the first target bit number and the actual bit number of the encoded key frame interval in the code stream. The method can dynamically adjust the actual bit number of the key frame interval, improve the accuracy of the whole code stream and meet the application requirement.

Description

Code rate control method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of video coding technologies, and in particular, to a code rate control method, a device, a computer device, and a storage medium.
Background
Video transmission bandwidth is generally limited to a certain extent, and in order to effectively transmit video data under the condition of meeting the limitations of channel bandwidth and transmission delay, the video coding process needs to be rate controlled to ensure the playing quality of video service. Rate control is to select a series of quantization parameters (Quantization Parameter, QP) so that the rate after video coding meets the required bandwidth constraint and the coding distortion is as small as possible. The rate control part is not a content specified in the video coding standard, but is a key technology for the practical use of a video encoder.
The video compression standard technology in the prior art has vp9, AV1 and svac, and the video compression standard in the prior art has the defect of low code rate control accuracy, and the low code rate control accuracy in the code stream transmission process can influence the video quality, so that the use requirement of the video is not met.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a code rate control method, apparatus, computer device, and computer readable storage medium capable of improving the accuracy of code rate control in a code stream transmission process.
In a first aspect, the present application provides a code rate control method, including:
determining a first target bit number of a current key frame interval according to a target code rate of a code stream to be processed;
And determining a second target bit number of the current key frame interval according to a current bit number deviation accumulated value and a first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents a difference value between the first target bit number and an actual bit number of the key frame interval coded in the code stream.
In one embodiment, the current key frame interval comprises a key frame and a plurality of predicted frames;
The method further comprises the steps of:
For the key frame, determining a third target bit number of the key frame according to the second target bit number; calculating quantization parameters by taking the third target bit number as a target, and encoding to obtain a first actual bit number of the key frame;
Sequentially encoding the plurality of predicted frames, wherein for each predicted frame, determining a fourth target bit number of the predicted frame according to the second target bit number, the actual bit number of the encoded predicted frame in the key frame interval, the frame number of the current key frame interval and the frame number of the current key frame interval, and calculating and encoding quantization parameters by taking the fourth target bit number as a target to obtain a second actual bit number of the predicted frame;
determining the current key frame interval as an encoded key frame interval and determining a sum of the first actual number of bits and the second actual number of bits as an actual number of bits of the current key frame interval.
In one embodiment, the determining the third target number of bits of the key frame according to the second target number of bits includes:
acquiring the ratio of the code rate of the key frame to each predicted frame and the frame number of the key frame interval;
And calculating a third target bit number of the key frame according to the ratio of the code rate of the key frame to each predicted frame, the frame number of the key frame interval and the second target bit number.
In one embodiment, the code stream includes a plurality of key frame intervals;
The method further comprises the steps of:
Acquiring the time of the code stream;
and obtaining the average code rate of the code stream according to the sum of the time of the code stream and the actual bit number of the current key frame interval.
In one embodiment, the determining the first target bit number of the current key frame interval according to the target code rate of the to-be-processed code stream includes:
and determining a first target bit number of the current key frame interval according to the target code rate of the code stream, the frame number of the current key frame interval and the frame rate of the code stream.
In one embodiment, the code stream is a video code stream.
In a second aspect, the present application further provides a code rate control device, including:
the first determining module is used for determining a first target bit number of the current key frame interval according to the target code rate of the code stream to be processed;
and the second determining module is used for determining a second target bit number of the current key frame interval according to a current bit number deviation accumulated value and a first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents a difference value between the first target bit number of the encoded key frame interval and the actual bit number in the code stream.
In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the method of the first aspect or any one of the embodiments of the first aspect when the processor executes the computer program.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
determining a first target bit number of a current key frame interval according to a target code rate of a code stream to be processed;
And determining a second target bit number of the current key frame interval according to a current bit number deviation accumulated value and a first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents a difference value between the first target bit number and an actual bit number of the key frame interval coded in the code stream.
In a fifth aspect, the application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
determining a first target bit number of a current key frame interval according to a target code rate of a code stream to be processed;
And determining a second target bit number of the current key frame interval according to a current bit number deviation accumulated value and a first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents a difference value between the first target bit number and an actual bit number of the key frame interval coded in the code stream.
According to the code rate control method, the code rate control device, the computer equipment and the storage medium, the first target bit number of the current key frame interval is determined according to the target code rate of the code stream to be processed; and determining a second target bit number of the current key frame interval according to the current bit number deviation accumulated value and the first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents the difference value between the first target bit number and the actual bit number of the encoded key frame interval in the code stream. And adjusting the target bit number of the key frame interval according to the current bit number deviation accumulated value, and compensating the bit number deviation accumulated value of the previous frame to the target bit number of the current key frame, thereby realizing the dynamic adjustment of the actual bit number of the key frame interval, improving the accuracy of the code rate of the whole code stream and meeting the application requirement.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
Fig. 1 is a flow chart of a code rate control method in an embodiment;
FIG. 2 is a schematic diagram of a code stream in one embodiment;
FIG. 3 is a block diagram of a rate control device in one embodiment;
Fig. 4 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In an exemplary embodiment, as shown in fig. 1, a code rate control method is provided, where this embodiment is applied to a terminal to illustrate the method, it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the steps of:
Step 101: and determining a first target bit number of the current key frame interval according to the target code rate of the code stream to be processed.
The code stream to be processed may represent a code stream to be transmitted, and the code stream to be processed may be a video code stream. The target code rate of the code stream to be processed may represent the code rate that needs to be employed when transmitting the code stream.
Fig. 2 is a schematic diagram of a structure of a code stream in one embodiment. As shown in fig. 2, the code stream may include a plurality of key frame intervals, wherein each key frame interval includes a key frame and a plurality of predicted frames. In the process of processing the code stream to be processed, the processing is performed according to the sequence of key frame intervals in the code stream, and the key frames and a plurality of predicted frames in each key frame interval are sequentially processed according to the arrangement sequence of the frames. It should be understood that the number of key frame intervals and the number of predicted frames given in fig. 2 are for illustration only and are not meant to be limiting in any way.
The first target number of bits may represent a number of bits determined from the target code stream. In an exemplary embodiment, step 101 may include: and determining a first target bit number of the current key frame interval according to the target code rate of the code stream to be processed, the frame number of the current key frame interval and the frame rate of the code stream.
In one example, the formula for determining the first target number of bits for the current key frame interval is:
Wherein, A first target number of bits representing a current key frame interval; /(I)Representing a target code rate of a code stream to be processed; /(I)A number of frames representing a current key frame interval; /(I)Representing the frame rate of the code stream to be processed. It is to be understood that, the manner of determining the first target number of bits of the other key frame interval may refer to the manner of determining the first target number of bits of the current key frame interval, which is not described herein.
Step 102: and determining a second target bit number of the current key frame interval according to the current bit number deviation accumulated value and the first target bit number of the current key frame interval.
Wherein the current bit number deviation accumulated value is related to the first target bit number and the actual bit number of the last key frame interval, and the current bit number deviation accumulated value may represent a difference value between the first target bit number and the actual bit number of the encoded key frame interval in the code stream.
In one example, the current bit number deviation accumulated value may be 0 when the bit deviation accumulated value within the first key frame interval or the last key frame interval of the code stream to be processed is calculated to be 0. When the current key frame interval is the first key frame interval of the code stream, the accumulated value is 0, and the first target bit number can be determined as the second target bit number. And determining the sum of the accumulated value and the first target bit number as a second target bit number when the current key frame interval is not the first key frame interval of the code stream. The current bit number deviation accumulated value is a parameter for dynamically adjusting the target bit number of the current key frame interval, and the bit number deviation accumulated value is adopted for adjusting the bit number of the key frame interval, so that the errors of the target code rate and the actual code rate of the code stream are reduced, and the accuracy of code rate control is improved.
In one example, the formula for determining the current bit number bias accumulation value may be:
Wherein, Representing the current bit number deviation accumulated value,/>A first target number of bits representing an encoded key frame interval; /(I)Representing the actual number of bits of the encoded key frame interval. Wherein the number of encoded key frame intervals may be zero, one or more. For example, for the first key frame interval of the code stream, the number of encoded key frame intervals is zero; for the second key frame interval of the code stream, the number of encoded key frame intervals is one; for the third key frame interval of the code stream, the number of key frame intervals encoded is two.
In one example, a second target number of bits for the current key frame interval is determined based on a sum of the current number of bits offset accumulated value and the first target number of bits for the current key frame interval.
In one example, the formula for determining the second target number of bits for the current key frame interval may be:
Wherein, A second target number of bits representing the current key frame interval.
In the code rate control method, a first target bit number of a current key frame interval is determined according to a target code rate of a code stream to be processed; and determining a second target bit number of the current key frame interval according to the current bit number deviation accumulated value and the first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents the difference value between the first target bit number and the actual bit number of the encoded key frame interval in the code stream. And adjusting the target bit number of the key frame interval according to the current bit number deviation accumulated value, and compensating the bit number deviation accumulated value of the previous frame to the target bit number of the current key frame, thereby realizing the dynamic adjustment of the actual bit number of the key frame interval, improving the accuracy of the actual code rate of the whole code stream and meeting the application requirement.
In an exemplary embodiment, the code rate control method further includes: for the key frame, determining a third target bit number of the key frame according to the second target bit number; calculating quantization parameters by taking the third target bit number as a target, and encoding to obtain a first actual bit number of the key frame; sequentially encoding a plurality of predicted frames, wherein for each predicted frame, determining a fourth target bit number of the predicted frame according to the second target bit number, the actual bit number of the encoded predicted frame in the key frame interval, the frame number of the current key frame interval and the frame number of the current key frame interval, and taking the fourth target bit number as a target calculation quantization parameter and encoding to obtain a second actual bit number of the predicted frame; the current key frame interval is determined as the encoded key frame interval and the sum of the first actual number of bits and the second actual number of bits is determined as the actual number of bits of the current key frame interval.
In one example, the actual number of bits is calculated by sequentially processing the key frame and the plurality of predicted frames in the key frame interval according to the order of the key frame and the predicted frames in the key frame interval shown in fig. 2, so as to dynamically adjust the second target number of bits, and improve the accuracy of the code rate of the code stream.
In one exemplary embodiment, determining a third target number of bits of the key frame based on the second target number of bits includes: acquiring the ratio of the code rate of the key frame to each predicted frame and the frame number of the key frame interval; and calculating a third target bit number of the key frame according to the ratio of the code rate of the key frame to each predicted frame, the frame number of the key frame interval and the second target bit number.
In one example, the formula for determining the third target number of bits for the key frame is:
Wherein, A third target number of bits representing a key frame; /(I)Representing the ratio of the code rates of the key frames and predicted frames within the current key frame interval.
In one example, a fourth target number of bits of the predicted frame is determined based on the second target number of bits, the actual number of bits of the predicted frame encoded in the key frame interval, the number of frames of the current key frame interval, and the frame number of the current key frame interval.
In one example, the formula for determining the fourth target number of bits of the predicted frame may be:
Wherein, A fourth target number of bits representing the predicted frame; /(I)A frame number representing the current key frame interval,
In an exemplary embodiment, the code rate control method further includes: acquiring the time of a code stream; and determining the average code rate of the code stream according to the sum of the time of the code stream and the actual bit number of the current key frame interval.
In one example, the sum of the actual number of bits of the current key frame interval is the actual number of bits of the whole code stream, and the ratio of the actual number of bits of the code stream to the time of the code stream is used to obtain the average code rate of the whole code stream. And comparing the average code rate with the target code stream, calculating the code rate deviation of the code stream, wherein the smaller the code rate deviation is, the higher the code rate accuracy of the code stream to be processed is, and the application requirement is better met.
According to the code rate control method, the target bit number of the key frame interval is adjusted according to the current bit number deviation accumulated value, the bit number deviation accumulated value of the previous frame is compensated to the target bit number of the current key frame, dynamic adjustment of the actual bit number of the key frame interval is achieved, and therefore the code rate accuracy of the whole code stream is improved, and application requirements are met.
In one example, a specific process flow for calculating quantization parameters and encoding with a target number of bits as a target may include:
A pixel block MB in an image is designed, the MB is set to represent a pixel block with the size of 16 x 16 in the image, the target code rate parameter of the MB is target_ bpmb = (brp < < 9)/(image width is image height/256), q_min is a minimum quantization parameter, q_max is a maximum quantization parameter, and rc_factor is a calculation factor. And performing cyclic calculation according to the target code rate parameter, the minimum quantization parameter, the maximum quantization parameter and the calculation factor of the MB to obtain the quantization parameter qp of the current frame.
The process of encoding the current frame using the quantization parameter qp to obtain the actual number of bits is as follows. The current frame is processed as follows in MB line scan order: for each MB, if the current frame is a key frame (I-frame), an intra-prediction search is performed to obtain an intra-prediction mode and an intra-prediction pixel. If the current frame is a predicted frame (P frame), intra-frame prediction searching and inter-frame prediction searching are performed to obtain an intra-frame prediction mode, an intra-frame prediction pixel, an inter-frame prediction mode and an inter-frame prediction pixel. And subtracting the original pixel from the predicted pixel to obtain a residual pixel. Performing discrete cosine transform on residual pixels to obtain frequency domain data, quantizing the frequency domain data by using quantization parameters qp to obtain quantization coefficients, and performing entropy coding on information such as the quantization coefficients, the prediction modes and the like to obtain code streams. If the current frame is a P frame, comparing the bit number of the code stream obtained by the intra-frame prediction mode and the inter-frame prediction mode according to the steps, and selecting the smaller code stream as the code stream of the current MB. After the above processing is completed for all MBs, the code stream to be processed and the actual number of bits of the corresponding frame are obtained.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a code rate control device for realizing the related code rate control method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the rate control device provided below may refer to the limitation of the rate control method described above, and will not be repeated here.
In an exemplary embodiment, as shown in fig. 3, there is provided a rate control apparatus, including: a first determination module 31 and a second determination module 32, wherein:
a first determining module 31, configured to determine a first target number of bits of a current key frame interval according to a target code rate of a code stream to be processed;
The second determining module 32 is configured to determine the second target number of bits of the current key frame interval according to the current number of bits deviation accumulated value and the first target number of bits of the current key frame interval, where the current number of bits deviation accumulated value represents a difference between the first target number of bits of the encoded key frame interval and the actual number of bits in the bitstream.
In one embodiment, the second determining module 32 is further configured to determine, for the key frame, a third target number of bits of the key frame according to the second target number of bits; calculating quantization parameters by taking the third target bit number as a target, and encoding to obtain a first actual bit number of the key frame;
sequentially encoding a plurality of predicted frames, wherein for each predicted frame, determining a fourth target bit number of the predicted frame according to the second target bit number, the actual bit number of the encoded predicted frame in the key frame interval, the frame number of the current key frame interval and the frame number of the current key frame interval, and taking the fourth target bit number as a target calculation quantization parameter and encoding to obtain a second actual bit number of the predicted frame;
the current key frame interval is determined as the encoded key frame interval and the sum of the first actual number of bits and the second actual number of bits is determined as the actual number of bits of the current key frame interval.
In one embodiment, the second determining module 32 is further configured to obtain a ratio of a code rate of the key frame to each predicted frame and a frame number of the key frame interval;
And calculating a third target bit number of the key frame according to the ratio of the code rate of the key frame to each predicted frame, the frame number of the key frame interval and the second target bit number.
In one embodiment, the second determining module 32 is further configured to obtain a time of the code stream;
And determining the average code rate of the code stream according to the sum of the time of the code stream and the actual bit number of the current key frame interval.
In one embodiment, the first determining module 31 is configured to calculate the first target number of bits of the current key frame interval according to the target code rate of the code stream, the frame number of the current key frame interval, and the frame rate of the code stream.
In one embodiment, the code stream is a video code stream.
The above-mentioned various modules in the rate control apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store code rates. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a code rate control method.
It will be appreciated by persons skilled in the art that the architecture shown in fig. 4 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magneto-resistive random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method for rate control, the method comprising:
determining a first target bit number of a current key frame interval according to a target code rate of a code stream to be processed;
And determining a second target bit number of the current key frame interval according to a current bit number deviation accumulated value and a first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents a difference value between the first target bit number and an actual bit number of the key frame interval coded in the code stream.
2. The method of claim 1, wherein the current key frame interval comprises a key frame and a plurality of predicted frames;
The method further comprises the steps of:
For the key frame, determining a third target bit number of the key frame according to the second target bit number; calculating quantization parameters by taking the third target bit number as a target, and encoding to obtain a first actual bit number of the key frame;
Sequentially encoding the plurality of predicted frames, wherein for each predicted frame, determining a fourth target bit number of the predicted frame according to the second target bit number, the actual bit number of the encoded predicted frame in the key frame interval, the frame number of the current key frame interval and the frame number of the current key frame interval, and calculating and encoding quantization parameters by taking the fourth target bit number as a target to obtain a second actual bit number of the predicted frame;
determining the current key frame interval as an encoded key frame interval and determining a sum of the first actual number of bits and the second actual number of bits as an actual number of bits of the current key frame interval.
3. The method of claim 2, wherein said determining a third target number of bits of said key frame from said second target number of bits comprises:
acquiring the ratio of the code rate of the key frame to each predicted frame and the frame number of the key frame interval;
And calculating a third target bit number of the key frame according to the ratio of the code rate of the key frame to each predicted frame, the frame number of the key frame interval and the second target bit number.
4. The method of claim 2, wherein the code stream comprises a plurality of key frame intervals;
The method further comprises the steps of:
Acquiring the time of the code stream;
and determining the average code rate of the code stream according to the sum of the time of the code stream and the actual bit number of the current key frame interval.
5. The method of claim 1, wherein determining the first target number of bits for the current key frame interval based on the target code rate of the code stream to be processed comprises:
and determining a first target bit number of the current key frame interval according to the target code rate of the code stream, the frame number of the current key frame interval and the frame rate of the code stream.
6. The method of claim 1, wherein the code stream is a video code stream.
7. A rate control apparatus, the apparatus comprising:
the first determining module is used for determining a first target bit number of the current key frame interval according to the target code rate of the code stream to be processed;
and the second determining module is used for determining a second target bit number of the current key frame interval according to a current bit number deviation accumulated value and a first target bit number of the current key frame interval, wherein the current bit number deviation accumulated value represents a difference value between the first target bit number of the encoded key frame interval and the actual bit number in the code stream.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202410289260.9A 2024-03-14 2024-03-14 Code rate control method, device, computer equipment and storage medium Pending CN117998089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410289260.9A CN117998089A (en) 2024-03-14 2024-03-14 Code rate control method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410289260.9A CN117998089A (en) 2024-03-14 2024-03-14 Code rate control method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117998089A true CN117998089A (en) 2024-05-07

Family

ID=90897546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410289260.9A Pending CN117998089A (en) 2024-03-14 2024-03-14 Code rate control method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117998089A (en)

Similar Documents

Publication Publication Date Title
KR102424188B1 (en) Intra prediction using multiple reference lines
US11877006B2 (en) Intra-prediction using a cross-component linear model in video coding
US20240267540A1 (en) Coded-block-flag coding and derivation
WO2022088631A1 (en) Image encoding method, image decoding method, and related apparatuses
CN110636313B (en) Transformation and quadratic transformation matrix training method, encoder and related device
US9210435B2 (en) Video encoding method and apparatus for estimating a code amount based on bit string length and symbol occurrence frequency
US20230024834A1 (en) Video decoding method, video encoding method, and related apparatuses
KR100922510B1 (en) Image coding and decoding method, corresponding devices and applications
CN113766249A (en) Loop filtering method, device and equipment in video coding and decoding and storage medium
EP4404562A1 (en) Video compression method and apparatus, and computer device and storage medium
CN113068025B (en) Decoding prediction method, device and computer storage medium
US20230388491A1 (en) Colour component prediction method, encoder, decoder and storage medium
US20240163470A1 (en) Method for inter prediction method, video picture encoder and decoder
CN117544784A (en) Method and device for encoding and decoding a data stream representing at least one image
CN113395516B (en) Intra-frame prediction method and device, and computer readable storage medium
CN117998089A (en) Code rate control method, device, computer equipment and storage medium
WO2022227082A1 (en) Block division methods, encoders, decoders, and computer storage medium
Mys et al. Decoder-driven mode decision in a block-based distributed video codec
WO2021135856A1 (en) Video coding method and apparatus, video decoding method and apparatus, device, and storage medium
US11146787B2 (en) Method of compressing image data
CN112313950A (en) Method and apparatus for predicting video image component, and computer storage medium
US20240064298A1 (en) Loop filtering, video encoding, and video decoding methods and apparatus, storage medium, and electronic device
CN117692648B (en) Video encoding method, apparatus, device, storage medium, and computer program product
CN111194552A (en) Motion compensated reference frame compression
CN112788339B (en) Video coding optimization method, device, system, medium and terminal

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