CN108924611B - ABR coding rate control optimization method, electronic equipment and storage medium - Google Patents

ABR coding rate control optimization method, electronic equipment and storage medium Download PDF

Info

Publication number
CN108924611B
CN108924611B CN201810679940.6A CN201810679940A CN108924611B CN 108924611 B CN108924611 B CN 108924611B CN 201810679940 A CN201810679940 A CN 201810679940A CN 108924611 B CN108924611 B CN 108924611B
Authority
CN
China
Prior art keywords
rate control
scene
complexity
code rate
frame
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.)
Active
Application number
CN201810679940.6A
Other languages
Chinese (zh)
Other versions
CN108924611A (en
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.)
Yaoke Intelligent Technology Shanghai Co ltd
Original Assignee
Yaoke Intelligent Technology Shanghai 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 Yaoke Intelligent Technology Shanghai Co ltd filed Critical Yaoke Intelligent Technology Shanghai Co ltd
Priority to CN201810679940.6A priority Critical patent/CN108924611B/en
Publication of CN108924611A publication Critical patent/CN108924611A/en
Application granted granted Critical
Publication of CN108924611B publication Critical patent/CN108924611B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/2662Controlling the complexity of the video stream, e.g. by scaling the resolution or bitrate of the video stream based on the client capabilities
    • 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/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • 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)
  • Databases & Information Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides an ABR coding rate control optimization method, electronic equipment and a storage medium, which optimize and reset rate control parameters through judging scenes with large complexity difference, compensate quantization parameters of rate control through comparing bit numbers, save bit resources after switching a simple scene to a complex scene, distribute more bit resources for the simple scene after switching the complex scene, reduce distortion, improve subjective quality and objective quality of coding, and optimize distribution of the bit resources.

Description

ABR coding rate control optimization method, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of video coding. And more particularly, to an ABR encoding rate control optimization method, an electronic device, and a storage medium.
Background
When a scene change occurs between frames of a video sequence, how an encoder determines the occurrence of the scene change and how a countermeasure strategy is taken after the scene change is successfully determined have a great influence on the encoding quality. The X264/X265 encoder is commonly used as video encoding as a classical open source encoder. The X264/X265 encoder reads a video sequence into a cache queue to pre-encode images, determines the encoding type of each frame after analysis, and judges whether the frame is a scene switching frame by calculating whether a key frame and a previous frame have obvious difference. When the scene switching is detected, the encoder can reduce the influence of the scene switching on the coding quality by using strategies such as changing the coding type of the current frame, performing additional compensation on coding parameters or refreshing and resetting the parameters of the code rate control model.
Rate control is a method of determining how many bits to allocate for each video frame, which will determine the size and quality of the file. The code rate control method of the X264/X265 coder generally has three modes: ABR, CQP, and CRF. However, after such scene switching is successfully detected, the step of resetting the rate control parameters is performed only in the ABR mode, and if there is no operation of resetting the rate control parameters, the encoder is affected by the encoding state before switching, and the convergence rate of the encoder after switching is slowed down. The step of resetting the code rate control parameters of the ABR mode coding can ensure that a simple scene is allocated with less bits, and enough bits are reserved for generating a high-quality complex part, so that the limited number of bits can be reasonably allocated among different scenes, and the size of an output file can be controlled. Therefore, the ABR coding mode of the X264/X265 coder is more advantageous.
General scene cuts encompass four categories, simple to simple, simple to complex, complex to simple, and complex to complex. When the ABR mode of the X264/X265 coder is used for processing the switching from the simple scene to the simple scene, the coder has the most excellent performance, the output code rate can be controlled to be close to the target code rate, and the coding quality is not influenced; when a complex scene is processed and switched to the complex scene, the performance of an encoder is still satisfactory, the output code rate can be rapidly increased even far away from the target code rate after switching, and then the output code rate can be immediately reduced and converged to be close to the target code rate, although the subjective quality of encoding is reduced for a static image, the discontinuity of quality is difficult to see for a dynamic video.
However, when the ABR mode of the X264/X265 encoder is switched to a complex scene in processing a simple scene, too high encoding bit allocation is easy to occur, so that the output code rate seriously exceeds the target code rate, and more bit resources are wasted; in addition, when a complex scene is processed and switched to a simple scene, too low encoding bit allocation is easily performed on the switched simple scene, so that the video quality is low and the distortion is obvious. Therefore, the ABR mode of the X264/X265 encoder has a problem in handling scene switching with a large difference in complexity, and it is necessary to optimize the rate control of the ABR mode.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide an ABR coding rate control optimization method, an electronic device, and a storage medium, which can adjust the fuzzy complexity in the rate control parameter to change rapidly after determining that a scene switch occurs, thereby reducing the influence of sudden changes in the complexity of video content after the switch occurs, and increasing the convergence rate. Therefore, the problem of the ABR mode of the X264/X265 coder existing in the process of scene switching with great complexity difference is solved.
To achieve the above and other related objects, the present invention provides an optimization method for controlling ABR coding rate, including: calculating the complexity of a current frame under the condition that each frame in a video sequence is coded by adopting an intra-frame prediction coding mode; judging whether a scene switching condition occurs according to a mathematical relation between the complexity of the current frame and the average complexity of the frames with the preset number; the scene change situation comprises: switching the simple scene to the complex scene or switching the complex scene to the simple scene; if the code rate control parameter occurs and meets a first reset condition for switching the simple scene to the complex scene or a second reset condition for switching the complex scene to the simple scene, resetting the code rate control parameter; wherein the first reset condition comprises: the complexity of the current frame is greater than 4 times the average complexity of the previous preset number of frames, and/or the second reset condition includes: the complexity of the current frame is between 0.1 and 0.25 times of the average complexity of the previous preset number of frames; the method for resetting the code rate control parameter comprises the following steps: making the accumulated complexity of the previous frame as the complexity of the current frame, and making the weighted accumulated complexity of the previous frame as 1; acquiring a frame output by predictive coding according to a code rate determined by the reset code rate control parameter, and judging whether the bit number of the frame is higher than a high threshold or lower than a low threshold; if the bit number is higher than the high threshold value, switching to a complex scene corresponding to the simple scene; if the bit number is lower than the low threshold, switching to a simple scene corresponding to the complex scene; if the bit number is judged to be higher than the high threshold value, performing first compensation on the quantization parameter of the reset code rate control parameter, wherein the first compensation is to limit the quantization parameter of the reset code rate control parameter to be higher than the quantization parameter controlled by the target code rate; if the bit number is judged to be lower than the low threshold value, second compensation is carried out on the quantization parameter of the reset code rate control parameter; wherein the second compensation is to limit the quantization parameter of the reset rate control parameter to be lower than the quantization parameter of the target rate control.
In an embodiment of the present invention, the first reset condition includes: the complexity of the current frame is more than 4 times the average complexity of the previous preset number of frames, and the occupation amount of the buffer area is more than-0.1.
In an embodiment of the present invention, the second reset condition includes: the complexity of the current frame is between 0.1 and 0.25 times of the average complexity of the previous preset number of frames, and is more than 1 second away from the last reset interval.
In an embodiment of the present invention, the high threshold is the number of bits from the target code rate to each frame.
In an embodiment of the present invention, the low threshold is 0.64 times the number of bits of the target code rate averaged to each frame.
In an embodiment of the present invention, the first compensation method includes:
Figure GDA0002671492440000021
wherein qscale is a quantization parameter, predictBits is a predicted output bit number of the current frame, and targetBits is a bit number of each frame averaged from the target code rate.
In an embodiment of the invention, the second compensation method includes: qscale ═ qscale × α + qscale' × (1- α); wherein the content of the first and second substances,
Figure GDA0002671492440000031
wherein qscale is a quantization parameter, α is a compensation factor, predictBits is a predicted output bit number of the current frame, and targetBits is a bit number of each frame averaged from the target code rate.
To achieve the above and other related objects, the present invention also provides an electronic device, comprising: a processor for executing a computer program stored by the memory; a memory having stored thereon a computer program which, when executed by the processor, implements the method for optimizing ABR encoding rate control.
To achieve the above and other related objects, the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for optimizing ABR encoding rate control.
As described above, the method for optimizing ABR coding rate control provided by the present invention optimizes and resets the rate control parameter by judging the scene with large complexity difference, and compensates the quantization parameter of rate control by comparing the number of bits, which has the following advantages compared with the prior art: bit resources are saved after the simple scene is switched to the complex scene, more bit resources are allocated to the simple scene after the complex scene is switched, distortion is reduced, subjective quality and objective quality of codes are improved, and allocation of the bit resources is optimized.
Drawings
Fig. 1 is a flowchart illustrating an ABR coding rate control optimization method according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of an electronic device according to an embodiment of the invention.
FIG. 3 is a graph showing the comparison of the output bit results obtained when the target bit rate is set to 1000Kbps for the video sequence bright cutting as the input slice source.
FIG. 4 shows the resulting RD plots for the input slice source for the video sequence bright cutting.
Fig. 5 shows the resulting RD graph for the input film source for the video sequence freeCutting.
Fig. 6 shows the RD graph obtained for the input film source for the video sequence ClassB.
Description of the element reference numerals
Method steps S101 to S106
200 electronic device
201 memory
202 processor
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
As shown in fig. 1, a flow chart of an ABR coding rate control optimization method in an embodiment of the present invention is shown, the method includes:
step S101: and calculating the complexity of the current frame under the condition that each frame in the video sequence is coded by adopting an intra-frame prediction coding mode.
The complexity of the frame is obtained by calculating the absolute value of the change of the image residual error so as to reflect the size of the content change after the scene switching.
Step S102: judging whether a scene switching condition occurs according to a mathematical relation between the complexity of the current frame and the average complexity of the frames with the preset number; the scene change situation comprises: switching the simple scene to the complex scene or switching the complex scene to the simple scene;
wherein the number of previous frames of the preset number is determined by a smoothing window length which is adjustable, preferably 40. The average complexity of the previous preset number of frames is the average complexity of a certain number of frames determined within the preset window length.
Wherein the scene switching further comprises: the simple scene is switched to the simple scene and the complex scene is switched to the complex scene. Although the method of the present invention mainly shows that improvement is provided for switching a simple scene to a complex scene or switching a complex scene to a simple scene, it should be noted that the method of the present invention is also applicable to switching other scenes, such as switching a simple scene to a simple scene or switching a complex scene to a complex scene, with a small complexity difference, and the like, and the influence generated by the method compared with the original algorithm is negligible, and is proved by experimental data subsequently.
In an embodiment of the present invention, the first reset condition includes: the complexity of the current frame is greater than 4 times the average complexity of the previous preset number of frames, and/or the second reset condition includes: the complexity of the current frame is between 0.1 and 0.25 times the average complexity of the previous preset number of frames.
If the complexity of the current frame is less than 4 times of the average complexity of the previous frame and is not between 0.1 time and 0.25 time, the scene switching aimed by the method is judged not to occur, the other scene switching is not judged, and the code rate control parameter is not reset. For example, the complexity of the current frame is less than 0.1 times of the average complexity of the previous frame, the video image of the adjacent frame changes slowly, and the rate control parameter is not reset.
Wherein the range of values between 0.1 and 0.25 times, and greater than 4 times, is obtained by multiple post-test adjustments.
Step S103: if the code rate control parameter occurs and meets a first reset condition for switching the simple scene to the complex scene or a second reset condition for switching the complex scene to the simple scene, resetting the code rate control parameter; the method for resetting the code rate control parameter comprises the following steps: making the accumulated complexity of the previous frame as the complexity of the current frame, and making the weighted accumulated complexity of the previous frame as 1;
compared with the original algorithm, the method optimizes the reset code rate control parameters by adding the reset condition, and the optimization thinking is that after a scene with a large complexity difference occurs, the accumulated complexity of the previous frame and the weighted accumulated complexity of the previous frame in the code rate control parameters are adjusted to change rapidly, so that the influence caused by sudden change of the complexity of the video content after the description and the switching can be reduced, the optimal reset condition is found through repeated experiments, and the convergence speed is accelerated.
In an embodiment of the present invention, the first reset condition includes: the complexity of the current frame is more than 4 times the average complexity of the previous preset number of frames, and the occupation amount of the buffer area is more than-0.1.
In an original algorithm, a special processing measure for switching situations from a simple scene to a complex scene exists, the original algorithm is reset under the condition that the occupied amount of a buffer area is less than 0, but the original algorithm does not play a role in coding certain sequences, because the occupied amount of the buffer area is 0.064 when the switching situation from the simple scene to the complex scene is detected, the reset condition is not met, and the situation that the output code rate seriously exceeds the target code rate occurs. The improved method changes the reset condition to a buffer occupancy greater than-0.1. Wherein the threshold value of-0.1 is a value which is obtained by adjusting and enables the best coding effect after a plurality of experiments are carried out on a plurality of typical video sequences containing the switching situation.
In an embodiment of the present invention, the second reset condition is: the second reset condition includes: the complexity of the current frame is between 0.1 and 0.25 times of the average complexity of the previous preset number of frames, and is more than 1 second away from the last reset interval.
If the time interval from the last reset is less than 1 second, the reset is not carried out, and the aim is to prevent frequent reset and coding quality fluctuation.
Step S104: acquiring a frame output by predictive coding according to a code rate determined by the reset code rate control parameter, and judging whether the bit number of the frame is higher than a high threshold or lower than a low threshold; if the bit number is higher than the high threshold value, switching to a complex scene corresponding to the simple scene; if the bit number is lower than the low threshold, switching to a simple scene corresponding to the complex scene;
in an embodiment of the present invention, the high threshold is the number of bits from the target code rate to each frame.
Step S105: if the bit number is judged to be higher than the high threshold value, performing first compensation on the quantization parameter of the reset code rate control parameter, wherein the first compensation is to limit the quantization parameter of the reset code rate control parameter to be higher than the quantization parameter controlled by the target code rate;
in an embodiment of the present invention, the first compensation method includes:
Figure GDA0002671492440000061
wherein qscale is a quantization parameter, predictBits is a predicted output bit number of the current frame,targetBits is the number of bits per frame averaged over the target code rate.
In order to reduce the possibility that the output code rate exceeds the target code rate, the quantization parameter of the code rate control parameter is additionally compensated to reduce the actual output bit, the control output code rate does not exceed the target code rate, and the more the predicted bit number exceeds, the stronger the compensation is.
In an embodiment of the present invention, the low threshold is 0.64 times the number of bits of the target code rate averaged to each frame.
Step S106: if the bit number is judged to be lower than the low threshold value, second compensation is carried out on the quantization parameter of the reset code rate control parameter; wherein the second compensation is to limit the quantization parameter of the reset rate control parameter to be lower than the quantization parameter of the target rate control.
In an embodiment of the invention, the second compensation method includes: qscale × α + qscale' × (1-); wherein the content of the first and second substances,
Figure GDA0002671492440000062
wherein qscale is a quantization parameter, α is a compensation factor, predictBits is a predicted output bit number of the current frame, and targetBits is a bit number of each frame averaged from the target code rate.
In order to prevent the coding quality of a simple scene from being affected when missing detection occurs, it is necessary to perform additional compensation on quantization parameters after rate control. Multiple experiments show that the average predicted bit number of a simple dim scene is mostly about 0.61 times of the target bit number, so that the method of the invention is set to work when the predicted bit number is less than 0.64 times of the target bit number, and the more serious the predicted bit number deviates from the target bit number, the greater the compensation force is, so that the encoder can more accurately encode the simple dark scene, and the distortion is reduced. In addition, when alpha is small, the image complexity is very low, and the content needing to be coded is little, at this time, even if the coding is carried out by using a small quantization parameter, the number of bits actually output is not increased too much, so that the output code rate for carrying out extra compensation does not appear to be increased steeply. The method can effectively improve the subjective quality of the codes under the condition of not reducing the objective quality.
As shown in fig. 2, which shows a schematic view of an electronic device in an embodiment of the invention, the electronic device 200 includes: a processor 202 for executing the computer program stored in the memory 201; a memory 201 having stored thereon a computer program which, when executed by the processor 202, implements the method for optimizing ABR encoding rate control.
The memory 201 may include a Random Access Memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 202 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
To achieve the above and other related objects, the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for optimizing ABR encoding rate control.
The computer-readable storage medium, as will be appreciated by one of ordinary skill in the art: all or part of the steps for implementing the above method embodiments may be performed by hardware associated with a computer program. The aforementioned computer program may be stored in a computer readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
In the video processing process, BD-BitRATE (BDBR) and BD-PSNR (BDPSNR) are often used to measure the quality of the method. BDBR shows the code rate saving of the two methods under the same objective quality; the BDPSNR represents the PSNR-Y difference of the two methods under the given equal code rate, and provides the change condition of the video obtained by the new method on the code rate and the PSNR relative to the original method. Generally speaking, the code rate is reduced, the PSNR is increased, and the new method has better performance.
In this embodiment, the input film source is a standard YUV video sequence bright cutting, which includes a simple scene to a complex scene, and then to a simple scene.
As shown in FIG. 3, the target bitrate for the video sequence bright cutting of the input film source is set to 1000Kbps to obtain the comparison condition of the output bit results. Between the sequence numbers of 150-; between the sequence numbers of 300 and 350, after the complex scene is switched to the simple scene, the optimization algorithm fully utilizes the bit resources compared with the original algorithm, and the distortion is reduced. The optimization algorithm enables the output code rate to be always converged near the target code rate when the whole video is coded.
The comparison data between the code rate control original algorithm for the thinning cutting of the video sequence and the code rate control algorithm optimized by the embodiment is shown in table 1;
TABLE 1
Figure GDA0002671492440000071
When the target code rate is set to be 1000Kbps, the output code rate of the optimization algorithm is 899.13Kbps, which is lower than the 1237.41Kbps output code rate of the original algorithm.
As shown in fig. 4, for the RD curve graph obtained by using the video sequence bright cutting as the input slice source, it can be seen from the RD curve that the optimization algorithm improves the coding performance of the bright cutting sequence, and the BDPSNR is calculated as that the optimization algorithm of this embodiment improves by 0.84dB compared with the original algorithm, and the BDBR reduces by 23.15%, which indicates that the coding performance is actually improved and the objective quality is improved.
By observing the picture quality, the coding quality of the complex scene switched to the simple scene can not be obviously distorted, and the effect is satisfactory. The coding quality is reduced after the simple scene is switched to the complex scene, but the difference is not obviously different when the video is played normally because the video is a video with strong motion and rapid change. Overall, subjective quality is increasing.
In this embodiment, the input film source is a standard YUV video sequence freecuding, which includes 5 scene switches with obvious complexity difference, including 2 movie trailers containing a large number of scene switches over 1000 frames, and the switching from a complex scene to a simple scene also includes the situation where the complex scene is switched to a simple and bright scene.
The comparison data of the code rate control original algorithm aiming at the video sequence freeCutting and the code rate control algorithm optimized by the embodiment is shown in table 2;
TABLE 2
Figure GDA0002671492440000081
As shown in fig. 5, for the RD curve graph obtained by inputting a video sequence freeCutting into a video sequence, it can be seen from the RD curve that the encoding performance of the freeCutting sequence is improved by the optimization algorithm, and the BDPSNR is calculated to be that the optimization algorithm of this embodiment is improved by 0.50dB compared with the original algorithm, and at the same time, the BDBR is reduced by 14.00%, which indicates that the encoding performance is actually improved, and the effectiveness of the algorithm is further verified.
By observing the picture quality, the subjective quality is improved like the bright cutting of a video sequence, the coding quality of a simple scene is improved, the distortion phenomenon can occur when an original algorithm processes a complex scene and is switched to a simple bright scene, and the optimization algorithm has an obvious improvement effect on the switching situation. Overall, subjective quality rises.
In this embodiment, a video ClassB sequence is input, and the video sequence does not have scene switching with a large complexity difference, and a comparison experiment is performed using the same test method as described above.
The comparison data of the original rate control algorithm aiming at the video sequence ClassB and the rate control algorithm optimized by the embodiment is shown in Table 3;
TABLE 3
Figure GDA0002671492440000091
As shown in fig. 6, for the RD curve graph obtained by ClassB video sequence as the input film source, when the video does not contain the improvement target (scene switching with great complexity difference) of the optimization algorithm in this embodiment, the encoding performance of the optimization algorithm is almost the same as that of the original algorithm, and the RD curve is highly overlapped. The calculated BDBR is-0.04%, the BDPSNR is 0.0008dB, and the performance difference is negligible.
In summary, the method for optimizing ABR coding rate control provided by the present invention optimizes and resets the rate control parameter by judging the scene with large complexity difference, and compensates the quantization parameter of rate control by comparing the bit number, which has the following beneficial effects compared with the prior art: bit resources are saved after the simple scene is switched to the complex scene, more bit resources are allocated to the simple scene after the complex scene is switched, distortion is reduced, subjective quality and objective quality of codes are improved, and allocation of the bit resources is optimized.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (9)

1. An optimization method for controlling ABR coding rate, comprising:
calculating the complexity of a current frame under the condition that each frame in a video sequence is coded by adopting an intra-frame prediction coding mode;
judging whether a scene switching condition occurs according to a mathematical relation between the complexity of the current frame and the average complexity of the frames with the preset number; the scene change situation comprises: switching the simple scene to the complex scene or switching the complex scene to the simple scene;
if the code rate control parameter occurs and meets a first reset condition for switching the simple scene to the complex scene or a second reset condition for switching the complex scene to the simple scene, resetting the code rate control parameter; wherein the first reset condition comprises: the complexity of the current frame is greater than 4 times the average complexity of the previous preset number of frames, and/or the second reset condition includes: the complexity of the current frame is between 0.1 and 0.25 times of the average complexity of the previous preset number of frames; the method for resetting the code rate control parameter comprises the following steps: making the accumulated complexity of the previous frame as the complexity of the current frame, and making the weighted accumulated complexity of the previous frame as 1;
acquiring a frame output by predictive coding according to a code rate determined by the reset code rate control parameter, and judging whether the bit number of the frame is higher than a high threshold or lower than a low threshold; if the bit number is higher than the high threshold value, switching to a complex scene corresponding to the simple scene; if the bit number is lower than the low threshold, switching to a simple scene corresponding to the complex scene;
if the bit number is judged to be higher than the high threshold value, performing first compensation on the quantization parameter of the reset code rate control parameter, wherein the first compensation is to limit the quantization parameter of the reset code rate control parameter to be higher than the quantization parameter controlled by the target code rate;
if the bit number is judged to be lower than the low threshold value, second compensation is carried out on the quantization parameter of the reset code rate control parameter; wherein the second compensation is to limit the quantization parameter of the reset rate control parameter to be lower than the quantization parameter of the target rate control.
2. The method of optimizing ABR encoding rate control of claim 1, wherein the first reset condition comprises: the complexity of the current frame is more than 4 times the average complexity of the previous preset number of frames, and the occupation amount of the buffer area is more than-0.1.
3. The method of optimizing ABR encoding rate control of claim 1, wherein the second reset condition comprises: the complexity of the current frame is between 0.1 and 0.25 times of the average complexity of the previous preset number of frames, and is more than 1 second away from the last reset interval.
4. The method of claim 1, wherein the high threshold is the number of bits per frame averaged over a target code rate.
5. The method of claim 1, wherein the low threshold is 0.64 times the number of bits per frame averaged over the target code rate.
6. The method of optimizing ABR coding rate control of claim 1, wherein the first compensation method is:
Figure FDA0002671492430000021
wherein qscale is a quantization parameter, predictBits is a predicted output bit number of the current frame, and targetBits is a bit number of each frame averaged from the target code rate.
7. The method of optimizing ABR coding rate control of claim 1, wherein the second compensation method is:
qscale=qscale×α+qscale′×(1-α);
wherein the content of the first and second substances,
Figure FDA0002671492430000022
wherein qscale is a quantization parameter, α is a compensation factor, predictBits is a predicted output bit number of the current frame, and targetBits is a bit number of each frame averaged from the target code rate.
8. An electronic device, comprising: a processor for executing a computer program stored by the memory; memory having stored thereon a computer program which, when being executed by a processor, implements the method for optimizing ABR encoding rate control as claimed in any one of claims 1 to 7.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the method for optimizing ABR encoding rate control according to any one of claims 1 to 7.
CN201810679940.6A 2018-06-27 2018-06-27 ABR coding rate control optimization method, electronic equipment and storage medium Active CN108924611B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810679940.6A CN108924611B (en) 2018-06-27 2018-06-27 ABR coding rate control optimization method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810679940.6A CN108924611B (en) 2018-06-27 2018-06-27 ABR coding rate control optimization method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108924611A CN108924611A (en) 2018-11-30
CN108924611B true CN108924611B (en) 2020-11-27

Family

ID=64422808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810679940.6A Active CN108924611B (en) 2018-06-27 2018-06-27 ABR coding rate control optimization method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108924611B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111182303A (en) * 2019-10-08 2020-05-19 腾讯科技(深圳)有限公司 Encoding method and device for shared screen, computer readable medium and electronic equipment
CN111913473B (en) * 2020-07-31 2021-10-22 深圳市元征科技股份有限公司 Code adjusting method, vehicle diagnosis equipment and system
CN116567242A (en) * 2022-01-27 2023-08-08 腾讯科技(深圳)有限公司 Image processing method, device and equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102158702A (en) * 2011-04-25 2011-08-17 南京信息工程大学 Self-adaption H.264 code rate control method
CN102625106A (en) * 2012-03-28 2012-08-01 上海交通大学 Scene self-adaptive screen encoding rate control method and system
CN103841418A (en) * 2012-11-22 2014-06-04 中国科学院声学研究所 Optimization method and system for code rate control of video monitor in 3G network
CN105208390A (en) * 2014-06-30 2015-12-30 杭州海康威视数字技术股份有限公司 Code rate control method of video coding and system thereof
CN105376568A (en) * 2015-12-22 2016-03-02 广州通达汽车电气股份有限公司 Optimization method of ABR video coding code rate control
CN106851272A (en) * 2017-01-20 2017-06-13 杭州当虹科技有限公司 A kind of method of HDR and SDR adaptive rate controls
CN107454408A (en) * 2017-06-28 2017-12-08 深圳中维世纪科技有限公司 A kind of method of Image Coding code check dynamic adjustment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060239347A1 (en) * 2005-04-25 2006-10-26 Ashish Koul Method and system for scene change detection in a video encoder

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102158702A (en) * 2011-04-25 2011-08-17 南京信息工程大学 Self-adaption H.264 code rate control method
CN102625106A (en) * 2012-03-28 2012-08-01 上海交通大学 Scene self-adaptive screen encoding rate control method and system
CN103841418A (en) * 2012-11-22 2014-06-04 中国科学院声学研究所 Optimization method and system for code rate control of video monitor in 3G network
CN105208390A (en) * 2014-06-30 2015-12-30 杭州海康威视数字技术股份有限公司 Code rate control method of video coding and system thereof
CN105376568A (en) * 2015-12-22 2016-03-02 广州通达汽车电气股份有限公司 Optimization method of ABR video coding code rate control
CN106851272A (en) * 2017-01-20 2017-06-13 杭州当虹科技有限公司 A kind of method of HDR and SDR adaptive rate controls
CN107454408A (en) * 2017-06-28 2017-12-08 深圳中维世纪科技有限公司 A kind of method of Image Coding code check dynamic adjustment

Also Published As

Publication number Publication date
CN108924611A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
AU2020202363B2 (en) Chroma quantization in video coding
US10567764B2 (en) Controlling a video content system by adjusting the compression parameters
US9369720B2 (en) Image coding apparatus and image coding method
US7206453B2 (en) Dynamic filtering for lossy compression
US8442337B2 (en) Encoding adjustments for animation content
CN109862359B (en) Code rate control method and device based on layered B frame and electronic equipment
CN108924611B (en) ABR coding rate control optimization method, electronic equipment and storage medium
US8189660B2 (en) Bit rate control method and apparatus
US7688234B2 (en) Coding apparatus, coding method, program for executing the method, and recording medium storing the program
JP2008504750A (en) Multi-pass video encoding
JP2016526336A (en) System and method for encoding multiple video streams using adaptive quantization for adaptive bitrate streaming
CN110225343B (en) Code rate control method and device for video coding
CN112272299A (en) Video coding method, device, equipment and storage medium
JP6373033B2 (en) Encoding apparatus and encoding method
CN109803146B (en) Method, apparatus, medium, and device for secondary compression of video
US8774268B2 (en) Moving image encoding apparatus and method for controlling the same
JP4179917B2 (en) Video encoding apparatus and method
US20230108722A1 (en) Allocating bit rate between video streams using machine learning
US11825088B2 (en) Adaptively encoding video frames based on complexity
CN109951707B (en) Target motion vector selection method and device, electronic equipment and medium
CN109561315B (en) Motion estimation method and device, electronic equipment and storage medium
JP2004247889A (en) Video coding method, video coding apparatus, video coding program, and recording medium recording the program
CN112422962A (en) Method and device for controlling video coding layer
CN112243129A (en) Video data processing method and device, computer equipment and storage medium
US20200177888A1 (en) Block type prediction leveraging block-based pixel activities

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
GR01 Patent grant
GR01 Patent grant