Video encoding bit rate adjustment method, device and image processing system

By obtaining target scene parameters and adjusting the encoder's quantized parameter level and code rate, the problem that VBR and ABR modes cannot adaptively adjust the video encoding code rate in the prior art is solved, and effective saving of code rate and image quality improvement is achieved.

CN118646877BActive Publication Date: 2024-11-05ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411123540.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-05
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

In the prior art, the VBR mode and ABR mode cannot adaptively adjust the video encoding code rate according to specific scenarios, resulting in the inability to effectively save the code rate, affecting the picture quality and storage space.

Method used

By obtaining the target parameters of the target scene, determining the encoder's quantization parameter level, and adjusting the video encoding code rate according to the quantization parameters, adaptive adjustment of the encoder code rate is achieved.

Benefits of technology

Based on the ABR mode, save the bit rate in the unimportant scene period, ensure that there is more reserved bit rate in important scene periods to improve the picture quality; based on the VBR mode, the overall code stream storage space is more saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646877B_ABST
    Figure CN118646877B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and image processing system for adjusting the video encoding bit rate, wherein the method comprises: obtaining target parameters of a target scene, determining a quantization parameter level of an encoder according to the target parameters, determining a quantization parameter of the encoder according to the quantization parameter level, and adjusting the video encoding bit rate of the encoder according to the quantization parameter, thereby adaptively adjusting the video encoding bit rate of the encoder. Through the present application, the problem that the VBR mode and the ABR mode in the prior art cannot adaptively adjust the video encoding bit rate according to a specific scene to save the bit rate is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a video encoding bit rate adjustment method, device and image processing system. Background Art

[0002] Existing video encoding code control technology usually has two bit rate control modes: VBR (Variable Bit Rate) and CBR (Constant Bit Rate). In CBR mode, the bit rate is maintained at a stable value regardless of whether it is a simple scene or a complex scene. For simple scenes, it actually consumes more bit rate; for particularly complex motion scenes, if the bit rate setting value is not enough to cope with the period when the picture becomes complex, it will affect the overall picture quality. VBR mode allows the bit rate to fluctuate with the complexity of the picture motion, giving priority to picture quality, and there will be a bit rate upper limit control, but the overall storage space cannot be predicted. Another code control mode, ABR (Average Bit Rate), is a code control strategy that combines the advantages of CBR and VBR. It saves bit rate in simple scene periods and compensates the saved bit rate in periods when the scenes become complex, improving the image quality in complex scene periods and keeping the average bit rate stable over a long period. For long-term complex scenes, or when complex scenes account for a large proportion of time periods, how to save more bit rate through strategy adjustment in the ABR mode, so that there is more saved bit rate available for improving the bit rate in complex scene periods (or periods that pay more attention to effects), is an urgent problem to be solved.

[0003] Currently, the VBR mode and the ABR mode cannot adaptively adjust the video encoding bit rate according to specific scenarios to save bit rate. Summary of the invention

[0004] The embodiments of the present application provide a video encoding bit rate adjustment method, device and image processing system to solve the problem in the prior art that the VBR mode and the ABR mode cannot adaptively adjust the video encoding bit rate according to a specific scene to save bit rate.

[0005] In a first aspect, an embodiment of the present application provides a method for adjusting a video encoding bit rate, the method comprising:

[0006] Acquire target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene;

[0007] Determining a quantization parameter level of an encoder according to the target parameter;

[0008] Determining a quantization parameter of the encoder according to the quantization parameter level;

[0009] The video encoding bit rate of the encoder is adjusted according to the quantization parameter.

[0010] In some of the embodiments, before determining the quantization parameter level of the encoder according to the target parameter, the method further comprises:

[0011] Testing the influence of the target parameters on the video encoding bit rate and image quality under different weight values;

[0012] According to the test results, the target weight value corresponding to the target parameter is determined.

[0013] In some embodiments, determining the target weight value corresponding to the target parameter according to the test result includes:

[0014] The target weight value of the target parameter that is positively correlated with reducing the video encoding bit rate is set to a positive value, and the target weight value of the target parameter that is negatively correlated with reducing the video encoding bit rate is set to a negative value.

[0015] In some of the embodiments, determining a quantization parameter level of an encoder according to the target parameter includes:

[0016] quantizing the target parameter to obtain a quantized target parameter;

[0017] The target weight value corresponding to the target parameter is used to perform weighted summation on the quantized target parameter to obtain the quantization parameter level of the encoder.

[0018] In some embodiments, determining the quantization parameter of the encoder according to the quantization parameter level includes:

[0019] Determining the quantization parameter change value corresponding to the quantization parameter level according to the correspondence between the quantization parameter level and a preset quantization parameter level and a quantization parameter change value;

[0020] The quantization parameter of the encoder is determined according to the quantization parameter change value and the initial quantization parameter.

[0021] In some of the embodiments, the target parameters include: image gain level, complexity ratio, and ratio of residual size to frame header information size.

[0022] In a second aspect, an embodiment of the present application provides a video encoding bit rate adjustment device, the device comprising:

[0023] An acquisition module, used for acquiring target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene;

[0024] A first determination module, configured to determine a quantization parameter level of an encoder according to the target parameter;

[0025] A second determination module, configured to determine a quantization parameter of the encoder according to the quantization parameter level;

[0026] The adjustment module is used to adjust the video encoding bit rate of the encoder according to the quantization parameter.

[0027] In the third aspect, an embodiment of the present application provides an image processing device, which includes a control module, an image processing module and an encoder, the control module is connected to the image processing module and the encoder respectively, the image processing module is connected to the encoder, and the control module is used to execute the video encoding bit rate adjustment method described in the first aspect.

[0028] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the video encoding bit rate adjustment method described in the first aspect.

[0029] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the video encoding bit rate adjustment method described in the first aspect are implemented.

[0030] Compared with the prior art, the video encoding rate adjustment method, device, image processing system, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain the target parameters of the target scene, determine the quantization parameter level of the encoder according to the target parameters, determine the quantization parameter of the encoder according to the quantization parameter level, and adjust the video encoding rate of the encoder according to the quantization parameter, thereby adaptively adjusting the video encoding rate of the encoder, solving the problem that the VBR mode and the ABR mode in the prior art cannot adaptively adjust the video encoding rate according to a specific scene to save the bit rate. The video encoding rate adjustment method of the embodiment of the present application, based on the ABR mode, allows some scene periods that are not particularly concerned to save more bit rates under the adjustment of the target parameters, so that the scene periods that are more concerned can have more reserve bit rates to improve the image quality. The video encoding rate adjustment method of the embodiment of the present application, based on the VBR mode, allows some scene periods that are not particularly concerned to save more bit rates under the adjustment of the target parameters, thereby saving the overall code stream storage space.

[0031] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0033] Figure 1 It is a hardware structure block diagram of a terminal for executing a video encoding bit rate adjustment method according to an embodiment of the present application;

[0034] Figure 2 is a structural schematic diagram of an image processing device according to an embodiment of the present application;

[0035] Figure 3 is a flow chart of a method for adjusting a video encoding bit rate according to an embodiment of the present application;

[0036] Figure 4 is a flowchart of another video encoding bit rate adjustment method according to an embodiment of the present application;

[0037] Figure 5 It is a schematic diagram of a code control principle of an ABR mode in an embodiment of the present application;

[0038] Figure 6 It is a structural block diagram of a video encoding bit rate adjustment device according to an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0040] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0041] The method embodiments provided in the embodiments of the present application can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 1 is a hardware structure block diagram of a terminal for executing a method for adjusting a video encoding bit rate according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0042] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for adjusting the bit rate of video encoding in an embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0043] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0044] An image processing device is provided in an embodiment of the present application. Figure 2 is a schematic diagram of the structure of an image processing device according to an embodiment of the present application. Figure 2As shown, the image processing device includes a control module 210, an image processing module 220 and an encoder 230, the control module 210 is connected to the image processing module 220 and the encoder 230 respectively, the image processing module 220 is connected to the encoder 230, and the control module 210 is used to execute the video encoding rate adjustment method in the embodiment of the present application. Among them, the control module 210 executes the video encoding rate adjustment method in the embodiment of the present application, that is, the control module 210 obtains the target parameter of the target scene, the target scene is a scene that can reduce the encoding rate, the target parameter is a parameter that affects the encoding rate in the target scene, the control module 210 determines the quantization parameter level of the encoder according to the target parameter, the control module 210 determines the quantization parameter of the encoder according to the quantization parameter level, and the control module 210 adjusts the video encoding rate of the encoder according to the quantization parameter. The control module 210 determines the encoding parameters of the encoder 230 such as the quantization parameter, and the encoder 230 encodes the input video frame according to the encoding parameters output by the control module 210, and outputs a video bit stream, and the bit rate of the output video bit stream is the adjusted video encoding bit rate. The video frame input by the encoder 230 may be a video frame output after image processing by the image processing module 220. The image processing device may be applied to the VBR mode or the ABR mode, so as to adaptively adjust the video encoding bit rate of the encoder.

[0045] The image processing device of this embodiment obtains the target parameters of the target scene, determines the quantization parameter level of the encoder according to the target parameters, determines the quantization parameter of the encoder according to the quantization parameter level, and adjusts the video encoding bit rate of the encoder according to the quantization parameter, thereby adaptively adjusting the video encoding bit rate of the encoder, solving the problem that the VBR mode and the ABR mode in the prior art cannot adaptively adjust the video encoding bit rate according to a specific scene to save bit rate. The image processing device of this embodiment, based on the ABR mode, allows some scene periods that are not particularly concerned to save more bit rate under the adjustment of the target parameters, so that the scene periods that are more concerned can have more reserve bit rate to improve the image quality. The image processing device of this embodiment, based on the VBR mode, allows some scene periods that are not particularly concerned to save more bit rate under the adjustment of the target parameters, thereby saving the overall code stream storage space.

[0046] The present application provides a method for adjusting the bit rate of video encoding. Figure 3 is a flow chart of a method for adjusting the bit rate of video encoding according to an embodiment of the present application. Figure 3 As shown, the process includes the following steps:

[0047] Step S310, obtaining target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene.

[0048] In this step, the control module obtains the target parameters of the target scene. The target scene here is a scene that can reduce the encoding bit rate, such as a scene with simple texture, a static scene, a scene with dim light, etc. Simple texture scenes and static scenes sacrifice a small part of the image quality to reduce the encoding bit rate and thus save the bit rate, and the user does not perceive the change in image quality significantly. The scene with dim light can reduce the encoding bit rate by reducing the encoding of noise to save the bit rate. Therefore, the aforementioned scenes can reduce the encoding bit rate to save the bit rate and can be used as target scenes. After the control module identifies the target scene, it performs corresponding operations to reduce the encoding bit rate. The target parameter here is a parameter that affects the encoding bit rate in the target scene, or the target parameter is a parameter that affects the image quality in the target scene, or the target parameter is a parameter that affects the encoding bit rate and image quality in the target scene. Further, the target parameter here can be the parameter that has the most significant impact on the encoding bit rate and image quality.

[0049] Step S320: determining a quantization parameter level of the encoder according to the target parameter.

[0050] In this step, the control module determines the quantization parameter level of the encoder according to the target parameter. The quantization parameter (QP) in the encoder reflects the compression of spatial details. The smaller the QP value, the more details will be retained and the bit rate will increase; the larger the QP value, the more details will be lost, the bit rate will decrease, but the image distortion will increase and the quality will decrease. For example, in the H.264 encoder, the QP value corresponds to the serial number of the quantization step. For brightness, this value ranges from 0 to 51. For every increase of 6 in the QP value, the quantization step doubles. Different encoders will have different QP control strategies and algorithms to achieve better encoding effects and bit rate control. Some encoders will dynamically adjust the QP value according to the complexity of the video content to reduce the bit rate while ensuring image quality. By controlling or adjusting the QP value, the video encoding bit rate of the encoder is adjusted. The control module determines the quantization parameter level of the encoder according to the target parameter. The quantization parameter level corresponds to the specific QP value, thereby achieving the effect of adjusting the video encoding bit rate of the encoder.

[0051] Step S330: Determine the quantization parameter of the encoder according to the quantization parameter level.

[0052] In this step, the control module determines the quantization parameter corresponding to the quantization parameter level according to the corresponding relationship between the quantization parameter level and the quantization parameter. The corresponding relationship between the quantization parameter level and the quantization parameter here can be obtained through testing.

[0053] Step S340: adjusting the video encoding bit rate of the encoder according to the quantization parameter.

[0054] In this step, the control module adjusts the video encoding rate of the encoder according to the quantization parameter. The control module adjusts the code control parameter according to the quantization parameter, thereby adjusting the video encoding rate of the encoder. The control module sends the quantization parameter to the encoder, and the encoder encodes the input video frame according to the quantization parameter and outputs a video bit stream, and the bit rate of the output video bit stream is the adjusted video encoding bit rate.

[0055] The video encoding rate adjustment method of this embodiment obtains the target parameters of the target scene, determines the quantization parameter level of the encoder according to the target parameters, determines the quantization parameter of the encoder according to the quantization parameter level, and adjusts the video encoding rate of the encoder according to the quantization parameter, thereby adaptively adjusting the video encoding rate of the encoder, solving the problem that the VBR mode and the ABR mode in the prior art cannot adaptively adjust the video encoding rate according to a specific scene to save the bit rate. The video encoding rate adjustment method of this embodiment, based on the ABR mode, allows some scene periods that are not particularly concerned to save more bit rates under the adjustment of the target parameters, so that the scene periods that are more concerned can have more reserve bit rates to improve the image quality. The video encoding rate adjustment method of this embodiment, based on the VBR mode, allows some scene periods that are not particularly concerned to save more bit rates under the adjustment of the target parameters, thereby saving the overall code stream storage space.

[0056] In some of the embodiments, before determining the quantization parameter level of the encoder according to the target parameter, the video encoding bit rate adjustment method also includes: testing the impact of the target parameter on the video encoding bit rate and image quality under different weight values; and determining the target weight value corresponding to the target parameter based on the test results.

[0057] In some of the embodiments, the target parameters include: image gain level, complexity ratio, and ratio of residual size to frame header information size. In the present embodiment, the target parameters include but are not limited to one or more parameters of image gain level, complexity ratio, and ratio of residual size to frame header information size. The image gain level here can be calculated based on the image gain output by the image processing module, the complexity ratio here can be calculated based on the spatial texture complexity of the current frame and the temporal motion complexity of the current frame, and the ratio of residual size to frame header information size here can be calculated based on the number of bits of the residual and the number of bits of the frame header information. It should be noted that the target parameters are not limited to these, and the target parameters can be adjusted according to the scene and focus.

[0058] In some of the embodiments, the target weight value corresponding to the target parameter is determined based on the test results, including: setting the target weight value of the target parameter that is positively correlated with reducing the video encoding bit rate to a positive value, and setting the target weight value of the target parameter that is negatively correlated with reducing the video encoding bit rate to a negative value.

[0059] In this embodiment, the influence of different weight values ​​on the bit rate and image quality is tested to find the balance between the two. The target parameter that is positively correlated with reducing the video encoding bit rate, that is, positively correlated with saving the bit rate and image quality degradation, is assigned a positive weight. The target parameter that is negatively correlated with reducing the video encoding bit rate, that is, negatively correlated with saving the bit rate and image quality degradation, is assigned a negative weight. For example, the image gain level parameter is assigned a negative weight. The higher the gain level, the darker the scene, the more noise, and the image quality needs to be reduced to save the bit rate. For example, the complexity ratio parameter is assigned a positive weight. The simpler the relative texture, the more the image quality can be reduced to save the bit rate. For example, the residual size and frame header information size ratio parameter is assigned a positive weight. The less movement, the more static, the more the image quality can be reduced to save the bit rate.

[0060] In some of the embodiments, the quantization parameter level of the encoder is determined according to the target parameter, including: quantizing the target parameter to obtain the quantized target parameter; and performing weighted summation on the quantized target parameter using the target weight value corresponding to the target parameter to obtain the quantization parameter level of the encoder.

[0061] In some of the embodiments, the quantization parameter of the encoder is determined according to the quantization parameter level, including: determining the quantization parameter change value corresponding to the quantization parameter level according to the correspondence between the quantization parameter level and a preset quantization parameter level and the quantization parameter change value; determining the quantization parameter of the encoder according to the quantization parameter change value and the initial quantization parameter.

[0062] The present application also provides a method for adjusting the bit rate of video encoding. Figure 4 is a flowchart of another video encoding bit rate adjustment method according to an embodiment of the present application. Figure 4 As shown, the process includes the following steps:

[0063] Step S410, obtaining a scene period that can save bit rate.

[0064] In this step, the scene period that can save bit rate is found through test experiments. The scene period that can save bit rate includes simple texture scene, static scene, dim light scene, etc. Among them, the human eye does not notice that the simple texture scene and static scene sacrifice a small part of the image quality to save bit rate; the dim light scene reduces the encoding of noise to save bit rate. The scene period that can save bit rate here is equivalent to the target scene in the above embodiment.

[0065] Step S420: Screen out the significant parameter factors corresponding to the scene time period.

[0066] In this step, for the scene time periods where bitrate can be saved, screen out the parameter factors with the most significant influence, such as Gain_level (gain level), Complexity_ratio (complexity ratio), Header_ratio (the ratio of the residual size to the frame header information size in P frames), etc. It should be noted that the parameter factors are not limited to these, and can be adjusted according to the scene and the focus of attention. Here, the parameter factors are equivalent to the target parameters in the foregoing embodiments. Determine the gain level Gain_level based on the image gain, Gain_level = Gain_level(N) if Gain_Th(N)<= Gain<Gain_Th(N+1), where the gain threshold Gain_Th(N) is obtained from the experience of detecting day and night, N is the division level of the gain range, and Gain is the image gain. Calculate the ratio of ComplexityS (the spatial domain texture complexity of the current frame) to ComplexityT (the temporal domain motion complexity of the current frame) to obtain the first ratio Complexity_ratio, Complexity_ratio = ComplexityT 100 / ComplexityS, and the value range of Complexity_ratio is [0,100]. When ComplexityT = 0, the current frame is an I frame, or the current frame has little difference from the reference frame. Calculate the ratio of Residual_bits (residual size) to Head_bits (frame header information size) in the P frame to obtain the second ratio Header_ratio, Header_ratio = Residual_bits 100 / Head_bits, and the value range of Header_ratio is [0,100].

[0067] Step S430: Test the influence of each parameter factor on the bitrate and image quality under different weight values and solidify the weights.

[0068] In this step, test the influence of each parameter factor on the bitrate and image quality under different weight values, and solidify the weights according to the test results.

[0069] Step S440: Quantize and perform weighted summation on the parameter factors to obtain the QP level.

[0070] In this step, perform quantization and weighted summation on the above parameter factors to obtain the QP level QP_level, QP_level = w1 Gain_level + w2 Complexity_ratio + w3 Header_ratio. Among them, w1, w2, and w3 are weight coefficients, and w1+w2+w3=1. The weight coefficients w1, w2, and w3 are obtained by testing the impact of each parameter factor on the bit rate and image quality under different weight values. Test the impact of different weight values ​​on the bit rate and image quality online to find a balance point. Parameter factors that are negatively correlated with the reduction of bit rate and image quality are assigned negative weights; parameter factors that are positively correlated are assigned positive weights. For example, w1=-1 (the higher the gain level, the darker the scene, the more noise, and the image quality needs to be reduced to save bit rate), w2=1 (the simpler the relative texture, the more the image quality can be reduced to save bit rate), w3=1 (the less movement, the more static, the more the image quality can be reduced to save bit rate), and substitute into the formula: QP_level= Complexity_ratio + Header_ratio - Gain_level. Among them, Complexity_ratio represents the complexity ratio of time and space domains. The smaller it is, the simpler the texture is. Header_ratio represents the relative value of motion residual. The smaller it is, the more static it is. Gain_level represents the gain level. The larger it is, the darker the light is, such as a night scene.

[0071] Step S450, looking up a table according to the QP level to obtain an incremental QP value.

[0072] In this step, the incremental QP value is obtained by looking up the preset table according to the QP level, which is recorded as DeltaQP. DeltaQP=DeltaQP_table(QP_level), where DeltaQP_table is a table lookup operation and QP_level is the QP level. The correspondence between the QP level and the incremental QP value in the preset table here is obtained by weighted summation of the parameter factors of the scene period that can save the bit rate, and the corresponding incremental QP value is set according to the QP level. After adjusting the code control parameters of the encoder according to the incremental QP value, it is obtained according to the bit rate and image quality test output by the encoder.

[0073] Step S460: Obtain an actual minimum QP value according to the incremental QP value and the initial minimum QP value.

[0074] In this step, the minimum QP actually used is adjusted according to QP_level, which is recorded as Used_min_QP. Used_min_QP = min_QP + DeltaQP_table(QP_level), where min_QP is the initially configured minimum QP value, DeltaQP_table is a lookup table, and DeltaQP_table(QP_level) is the incremental QP value obtained by looking up the preset table according to the QP level.

[0075] Step S470: Use the actual minimum QP value to adjust the code control parameters to control the bit rate.

[0076] In this step, when the relative texture is simpler, more static, and the light is darker, the smaller the QP_level, the larger the DeltaQP obtained according to the lookup table DeltaQP_table, the larger the final adjusted Used_min_QP, and the more bitrate is saved. The QP value of the encoder can be determined according to the actual minimum QP value to control the bitrate; the QP value of the encoder can also be determined according to the actual minimum QP value and the QP value determined by the encoding mode to control the bitrate. The encoding modes here include VBR mode and ABR mode.

[0077] The code control principle of ABR mode is as follows Figure 5 As shown, the dotted line is the instantaneous target bit rate, which is between the upper and lower limits of the bit rate, and starts to decrease when the instantaneous target bit rate reaches 90% of the reserve bit rate. When the scene is simple, the bit rate is saved. When the scene becomes complex, the complex scene consumes more bit rate. The bit rate is increased from the saved bit rate to improve the picture quality, so that the overall average bit rate remains below the preset average value over a long period. For long-term complex scenes, or when the complex scene period accounts for a large proportion, how to save more bit rate through strategy adjustment, so that there are more saved bit rates available for improving the bit rate during the complex scene period (or the period that pays more attention to the effect), this is the problem to be solved by this application.

[0078] The present application obtains the target parameters of the target scene, determines the quantization parameter level of the encoder according to the target parameters, determines the quantization parameter of the encoder according to the quantization parameter level, and adjusts the video encoding bit rate of the encoder according to the quantization parameter, thereby adaptively adjusting the video encoding bit rate of the encoder. On the basis of ABR code control, some scene periods that are not particularly concerned can save more bit rate under the adjustment of parameter factors, so that scene periods that are more concerned can have more reserve bit rate to improve image quality.

[0079] In addition, VBR code control allows the bit rate to fluctuate with the complexity of the picture motion, giving priority to picture quality, and there will be a bit rate upper limit control, but the overall storage space cannot be predicted. VBR code control will reduce and increase the bit rate as the stillness and movement complexity of the scene change, but in order to make the overall bit stream storage space smaller and achieve the ultimate low bit rate, it is also necessary to save more bit rate, which is also the problem to be solved by this application.

[0080] The present application obtains the target parameters of the target scene, determines the quantization parameter level of the encoder according to the target parameters, determines the quantization parameter of the encoder according to the quantization parameter level, and adjusts the video encoding bit rate of the encoder according to the quantization parameter, thereby adaptively adjusting the video encoding bit rate of the encoder. On the basis of VBR code control, some scene periods that are not particularly concerned can save more bit rate under the adjustment of parameter factors, thereby saving the overall code stream storage space.

[0081] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0082] The present application also provides a video encoding bit rate adjustment device in the embodiments, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0083] Figure 6 is a structural block diagram of a video encoding bit rate adjustment device according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:

[0084] An acquisition module 610 is used to acquire target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene;

[0085] A first determination module 620, configured to determine a quantization parameter level of an encoder according to the target parameter;

[0086] A second determination module 630, configured to determine a quantization parameter of the encoder according to the quantization parameter level;

[0087] The adjustment module 640 is used to adjust the video encoding bit rate of the encoder according to the quantization parameter.

[0088] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0089] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0090] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0091] Optionally, in the embodiment of the present application, the processor may be configured to perform the following steps through a computer program:

[0092] S1, obtaining target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene;

[0093] S2, determining a quantization parameter level of the encoder according to the target parameter;

[0094] S3, determining a quantization parameter of the encoder according to the quantization parameter level;

[0095] S4: adjusting the video encoding bit rate of the encoder according to the quantization parameter.

[0096] It should be noted that the specific examples in the embodiments of the present application can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in the embodiments of the present application.

[0097] In addition, in combination with a video encoding bit rate adjustment method provided in the above embodiment, a storage medium can also be provided in the embodiment of the present application to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any video encoding bit rate adjustment method in the above embodiment is implemented.

[0098] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0099] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0100] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0101] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A video encoding bit rate adjustment method, characterized in that: The method comprises: Obtain target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene; the target parameters include: image gain level, complexity ratio, and ratio of residual size to frame header information size; Testing the influence of the target parameter on the video encoding bit rate and image quality under different weight values; determining the target weight value corresponding to the target parameter according to the test result; Determining the quantization parameter level of the encoder according to the target parameter; determining the quantization parameter level of the encoder according to the target parameter, including: quantizing the target parameter to obtain a quantized target parameter; performing weighted summation on the quantized target parameter using a target weight value corresponding to the target parameter to obtain the quantization parameter level of the encoder; Determining a quantization parameter of the encoder according to the quantization parameter level; The video encoding bit rate of the encoder is adjusted according to the quantization parameter.

2. The video encoding bit rate adjustment method according to claim 1, characterized in that: Determining the target weight value corresponding to the target parameter according to the test result includes: The target weight value of the target parameter that is positively correlated with reducing the video encoding bit rate is set to a positive value, and the target weight value of the target parameter that is negatively correlated with reducing the video encoding bit rate is set to a negative value.

3. The video encoding bit rate adjustment method according to claim 1, characterized in that: The step of determining the quantization parameter of the encoder according to the quantization parameter level includes: Determining the quantization parameter change value corresponding to the quantization parameter level according to the correspondence between the quantization parameter level and a preset quantization parameter level and a quantization parameter change value; The quantization parameter of the encoder is determined according to the quantization parameter change value and the initial quantization parameter.

4. A video encoding bit rate adjustment device, characterized in that: The device comprises: An acquisition module is used to acquire target parameters of a target scene; the target scene is a scene that can reduce the encoding bit rate, and the target parameters are parameters that affect the encoding bit rate and / or image quality in the target scene; the target parameters include: image gain level, complexity ratio, and ratio of residual size to frame header information size; The first determination module is used to determine the quantization parameter level of the encoder according to the target parameter; and is also used to test the influence of the target parameter on the video encoding bit rate and image quality under different weight values; according to the test result, determine the target weight value corresponding to the target parameter; determine the quantization parameter level of the encoder according to the target parameter, including: quantizing the target parameter to obtain the quantized target parameter; using the target weight value corresponding to the target parameter to perform weighted summation on the quantized target parameter to obtain the quantization parameter level of the encoder; the second determination module is used to determine the quantization parameter of the encoder according to the quantization parameter level; The adjustment module is used to adjust the video encoding bit rate of the encoder according to the quantization parameter.

5. An image processing device, characterized in that: The image processing device includes a control module, an image processing module and an encoder, the control module is connected to the image processing module and the encoder respectively, the image processing module is connected to the encoder, and the control module is used to execute the video encoding bit rate adjustment method described in any one of claims 1 to 3.

6. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the video encoding bit rate adjustment method according to any one of claims 1 to 3.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the video encoding bit rate adjustment method according to any one of claims 1 to 3 are implemented.