Interframe image code rate control method and device based on random optimal control and medium
Through the inter-frame image bit rate control method based on stochastic optimal control, the bit rate of video transmission is dynamically controlled, solving the video compression problem under complex working conditions and network uncertainty, improving the video coding efficiency and quality, and avoiding video Stuttering and image quality degradation are eliminated, and the user experience is optimized.
Patent Information
- Application Number
- CN202411305756.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-09-19
AI Technical Summary
Existing video compression bit rate control methods are difficult to effectively adjust the bit rate of inter-frame images when faced with complex working conditions and network uncertainty, resulting in poor video quality and efficiency, and cannot effectively cope with video card problems caused by network fluctuations. Stuttering and image quality degradation.
An inter-frame image code rate control method based on stochastic optimal control is adopted. By constructing the Bellman equation and reverse iterative calculation, the code rate is dynamically adjusted according to the total cost of video transmission (including image quality loss, bandwidth usage and buffer stability), and the code rate is automatically controlled. Adapt to changes in video content and network conditions.
It operates stably in different network environments, improves video encoding efficiency and quality, avoids video freezes and image quality degradation caused by network fluctuations, and optimizes users' viewing experience.
Smart Images

Figure CN118827979A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device and medium for controlling an inter-frame image bit rate based on random optimal control. Background Art
[0002] Video compression technology reduces the size of video files by optimizing encoding algorithms. With the increasing application of AI technology in video encoding, the video compression effect is further improved by optimizing encoder parameters through machine learning and deep learning. Video compression technology is widely used in the medical field to support remote diagnosis, medical image storage, and live surgery. It improves the efficiency and quality of medical services and promotes the advancement of medical education and research.
[0003] Among them, the bit rate control methods for video compression include constant bit rate (CBR), variable bit rate (VBR) and dynamic bit rate control. CBR maintains a stable bit rate and is suitable for scenarios with strict network transmission requirements, but may be inefficient when the complexity of the picture changes. VBR dynamically adjusts the bit rate according to the content of the picture, improves encoding efficiency and quality performance, and is suitable for applications with large demand changes. Dynamic bit rate control combines the advantages of CBR and VBR, and can flexibly control the overall bit rate while ensuring quality, but the implementation complexity is high and requires more computing resources. The selection of an appropriate method should be weighed according to specific application requirements and quality standards. Summary of the invention
[0004] In order to better cope with video compression transmission under complex working conditions, the present invention proposes an inter-frame image bit rate control method based on random optimal control, comprising the steps of: S1: Determine system parameters with minimizing the total cost of video transmission as the optimization goal, wherein the system parameters include state variables, control variables and random variables; S2: According to the system parameters and optimization objectives, the Bellman equation is constructed based on the stochastic optimal control theory to recursively express the immediate cost at the current moment and the expected cost at the future moment; S3: Based on the constructed Bellman equation, the expected cost of each control variable under the optimal expected cost is calculated according to the current state variables through reverse iteration; S4: dynamically adjust the bit rate under image resolution control according to the control variable corresponding to the optimal total cost of the current state variable.
[0005] Furthermore, in the step S1, the total cost of video transmission includes image quality loss, bandwidth usage and buffer stability.
[0006] Furthermore, in the step S1, State variables is used to describe the key parameters of the system at each time step t. In the bit rate control with the optimization goal of minimizing the total cost of video transmission, the key parameters include the bit rate of the current frame and buffer status ; Control variables To affect the system state variables The adjustable decision variable for future development, in the bit rate control with minimizing the total cost of video transmission as the optimization goal, the decision variable is the bit rate of the next frame; random variable is the random noise used to represent the uncertainty of network bandwidth.
[0007] Furthermore, in the step S2, the instantaneous cost is obtained by the following formula: Where J is the immediate cost, is the time step corresponding to the current state variable, N is the final time step, is the state variable, is the control variable, is the buffer state, is the bit rate of the current frame, Q is the perceived image quality, R is the bit rate, S is the weight of the buffer state, is the cost of the buffer state, is the image quality based on perceived distortion, It is used to measure the degree of visual information preservation between the encoded video frame and the original video frame. It is a multi-method video evaluation method that comprehensively considers multiple visual feature evaluation indicators. and is a weight parameter used to adjust the importance of different evaluation indicators in the overall quality perception.
[0008] Furthermore, in step S2, the Bellman equation is expressed as the following formula: In the formula, is the current state variable The optimal expected cost at the start, For the current control variable Next, from the state variable Transfer to next state variable A and B are parameters adjusted dynamically according to the system.
[0009] Furthermore, in step S4, the image resolution control is expressed as the following formula: In the formula, is the image resolution after adjustment, is the base resolution, is the base bit rate.
[0010] The present invention also includes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the bit rate control method are implemented.
[0011] Also included is a device for processing data, comprising: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the bit rate control method.
[0012] Compared with the prior art, the present invention has at least the following beneficial effects: The method, device and medium for controlling the bit rate of inter-frame images based on random optimal control described in the present invention consider the changes in video content and the uncertainty of network conditions by establishing a random model, so that it can operate stably under different network environments, automatically adapt to changes, and effectively adjust the bit rate of inter-frame images, thereby improving the overall efficiency and quality of video encoding. It avoids video freezes or image quality degradation caused by network fluctuations, and optimizes the user's viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A step diagram of an inter-frame image bit rate control method based on random optimal control. DETAILED DESCRIPTION
[0014] The following are specific embodiments of the present invention and the accompanying drawings to further describe the technical solution of the present invention, but the present invention is not limited to these embodiments.
[0015] The video compression architecture is a system designed to efficiently compress raw video data, including preprocessing and frame analysis stages for preparing and optimizing video frame data. The encoder uses inter-frame and intra-frame prediction techniques to reduce data redundancy through motion compensation and spatial domain prediction. The transform and quantization steps further compress the prediction error, while entropy coding techniques are used to finally compress the data stream. The decoder parses and reconstructs the video data according to the bitstream format, and the quality assessment module evaluates the decoded video quality through structured and perceptual assessment methods. The control strategy adjusts the encoding parameters based on the evaluation results to optimize video quality and bitrate efficiency. The design of the video compression architecture needs to consider the complexity of the video content and the real-time requirements to meet the visual experience and performance requirements of different application scenarios. Video bitrate control plays a key role in video compression. It balances the relationship between video quality and transmission bandwidth by adjusting the bitrate during the video encoding process. This process ensures that the video can achieve the best visual quality at a given bitrate, avoiding image quality problems or bandwidth waste caused by too high or too low bitrates. To this end, such as Figure 1 As shown, the present invention proposes an inter-frame image bit rate control method based on random optimal control, comprising the steps of: S1: Determine system parameters with minimizing the total cost of video transmission as the optimization goal, wherein the system parameters include state variables, control variables and random variables; S2: According to the system parameters and optimization objectives, the Bellman equation is constructed based on the stochastic optimal control theory to recursively express the immediate cost at the current moment and the expected cost at the future moment; S3: Based on the constructed Bellman equation, the expected cost of each control variable under the optimal expected cost is calculated according to the current state variables through reverse iteration; S4: dynamically adjust the bit rate under image resolution control according to the control variable corresponding to the optimal total cost of the current state variable.
[0016] The stochastic optimal control used in the present invention is a mathematical tool for studying and solving the problem of finding the optimal control strategy in an uncertain environment. This control method is a branch of control theory that deals with the problem of how to optimally control a dynamic system in a random environment. This type of problem can usually be described by a random process to describe the dynamic behavior of the system, and the goal is to minimize a certain performance indicator (such as a cost function or energy consumption).
[0017] In view of the performance and quality requirements of video compression transmission, the minimized performance index in the present invention is the total cost of video transmission, which includes image quality loss, bandwidth usage and buffer stability. Based on these cost factors, the present invention defines system parameters closely related to these cost factors, including: (1) state variables , in the upper and lower image streams of video bit rate control, the state variable It is the key parameter that describes the system at each time step t. Usually, in this application environment, this key parameter includes the bit rate of the current frame And the buffer status ; (2) Control variables , which is used to affect the system state variables An adjustable decision variable for future development, in the bit rate control with the optimization goal of minimizing the total cost of video transmission, this decision variable Usually expressed as the bit rate of the next frame; (3) random variable , used to represent the random noise of network bandwidth uncertainty (t is the time variable).
[0018] Based on these system parameters, the present invention reconstructs the Bellman equation that recursively expresses the instantaneous cost at the current moment and the expected cost at the future moment to implement bit rate control. Among them, the Bellman equation is one of the core concepts in dynamic programming theory, proposed by American mathematician Richard Bellman. It provides a recursive method to solve multi-stage decision-making problems, especially when finding the optimal strategy. The Bellman equation can be applied to discrete-time dynamic programming problems, and can also be extended to continuous-time optimal control problems.
[0019] In the discrete dynamic programming of video compression transmission application scenarios, an optimal strategy is determined by the Bellman equation, which can minimize the cumulative cost. Then, suppose there is a dynamic system, which is expressed as the state transfer equation between inter-frame images: in, The system state at the current time step of the table system, is the system state at the next time step, and A and B are parameters adjusted according to the system dynamics.
[0020] In this system, the instantaneous cost of the system is expressed as follows: Where J is the immediate cost, is the time step corresponding to the current state variable, N is the final time step, Q is the image perception quality, R is the bit rate, S is the weight of the buffer state, is the cost of the buffer state, such as overflow or underflow. It can be expressed as the image quality based on perceptual distortion, and its formula can be expressed as: In the formula, It is used to measure the degree of visual information preservation between the encoded video frame and the original video frame. It is a multi-method video evaluation method that comprehensively considers multiple visual feature evaluation indicators. and It is a weight parameter used to adjust the importance of different evaluation indicators in the overall quality perception.
[0021] Then, considering the inter-frame image transfer to the next state After the expected cost of our Bellman equation is expressed as Next, we solve the problem of minimizing the total cost: In the formula, is the current state variable The optimal expected cost at the start, For the current control variable Next, from the state variable Transfer to next state variable The expected cost of . This equation expresses a recursive relationship that shows how to minimize the total cost in the future by making decisions in the current stage. Specifically, it tells us how to break a complex problem into a series of smaller sub-problems and then solve these sub-problems recursively.
[0022] Specifically, the Bellman equation divides the bit rate and buffer size into a finite number of levels and initializes them. At the end time step t=N, set , because there is no more cost after the last system state. Then, through reverse iteration, for each ,calculate: , for each possible control variable ,renew The total cost is calculated and the optimal control decision for each state is recorded.
[0023] In this way, we can calculate the control variable corresponding to the optimal total cost of the current state variable Here, we first adjust the bit rate according to the control variable Adjust the image resolution of the next frame. Resolution adjustment is usually performed based on current network conditions and the desired video quality level while maintaining the image aspect ratio. The main goal of adjusting resolution is to reduce the amount of data while maintaining the clarity of the video content as much as possible when network bandwidth is limited.
[0024] We first set a base resolution Then we get the optimal control variable according to the Bellman equation , that is, the bit rate is adjusted to obtain the appropriate resolution : In the formula, is the base bit rate, is the bit rate of the current inter-frame image. This can keep the resolution and bit rate in a certain proportional relationship, thus maintaining a relatively consistent visual effect under different bandwidth conditions. and Applied to the video encoder to ensure that the resolution of the output video is consistent with the desired target.
[0025] In practical applications, we also need to adjust parameters based on real-time video quality assessment such as peak signal-to-noise ratio (PSNR) and buffer status. distribution to adapt to new conditions.
[0026] The present invention also includes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the bit rate control method are implemented.
[0027] Also included is a device for processing data, comprising: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the bit rate control method.
[0028] In summary, the inter-frame image bitrate control method, device and medium based on random optimal control described in the present invention considers the changes in video content and the uncertainty of network conditions by establishing a random model, so that it can operate stably in different network environments, automatically adapt to changes, and effectively adjust the bitrate of inter-frame images, thereby improving the overall efficiency and video quality of video encoding, avoiding video freezes or image quality degradation caused by network fluctuations, and optimizing the user's viewing experience.
[0029] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0030] In addition, in the present invention, descriptions such as "first", "second", "one", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0031] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0032] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
Claims
1. A method for controlling inter-frame image bit rate based on random optimal control, characterized in that: Includes steps: S1: Determine system parameters with minimizing the total cost of video transmission as the optimization goal, wherein the system parameters include state variables, control variables and random variables; S2: According to the system parameters and optimization objectives, the Bellman equation is constructed based on the stochastic optimal control theory to recursively express the immediate cost at the current moment and the expected cost at the future moment; S3: Based on the constructed Bellman equation, the expected cost of each control variable under the optimal expected cost is calculated according to the current state variables through reverse iteration; S4: dynamically adjust the bit rate under image resolution control according to the control variable corresponding to the optimal total cost of the current state variable.
2. The inter-frame image bit rate control method based on random optimal control according to claim 1, characterized in that: In the step S1, the total cost of video transmission includes image quality loss, bandwidth usage and buffer stability.
3. The method for controlling the inter-frame image bit rate based on random optimal control according to claim 2, characterized in that: In the step S1, State variables is used to describe the key parameters of the system at each time step t. In the bit rate control with the optimization goal of minimizing the total cost of video transmission, the key parameters include the bit rate of the current frame and buffer status ; Control variables To affect the system state variables The adjustable decision variable for future development, in the bit rate control with minimizing the total cost of video transmission as the optimization goal, the decision variable is the bit rate of the next frame; random variable is the random noise used to represent the uncertainty of network bandwidth.
4. The method for controlling the inter-frame image bit rate based on random optimal control according to claim 3, characterized in that: In the step S2, the instantaneous cost is obtained by the following formula: Where J is the immediate cost, is the time step corresponding to the current state variable, N is the final time step, is the state variable, is the control variable, is the buffer state, is the bit rate of the current frame, Q is the perceived image quality, R is the bit rate, S is the weight of the buffer state, is the cost of the buffer state, is the image quality based on perceived distortion, It is used to measure the degree of visual information preservation between the encoded video frame and the original video frame. It is a multi-method video evaluation method that comprehensively considers multiple visual feature evaluation indicators. and is a weight parameter used to adjust the importance of different evaluation indicators in the overall quality perception.
5. The method for controlling the inter-frame image bit rate based on random optimal control according to claim 4, characterized in that: In the step S2, the Bellman equation is expressed as the following formula: In the formula, is the current state variable The optimal expected cost at the start, For the current control variable Next, from the state variable Transfer to next state variable A and B are parameters adjusted dynamically according to the system.
6. The method for controlling the inter-frame image bit rate based on random optimal control according to claim 3, characterized in that: In step S4, the image resolution control is expressed as the following formula: In the formula, is the image resolution after adjustment, is the base resolution, is the base bit rate.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the rate control method described in any one of claims 1 to 6 are implemented.
8. A device for processing data, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the bit rate control method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Video streaming business code rate self-adaption method based on online study
CN105933329A
Transmission method for adaptive streaming media in wireless network environment
CN108833995A
Compressed video stream recoding method based on deep learning and significance perception
CN111726633A
RTC streaming media adaptive transmission method and device, equipment and storage medium
CN114866461A
Video code rate adaptive method based on reinforcement learning for edge cellular network
CN116016987A
