{'fraction_non_alphanumeric': 0.02107142857142857, 'fraction_numerical': 0.0035, 'mean_word_length': 4.804726368159204, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An Adaptive QP Adjustment of Multimedia over Heterogeneous Wireless Networks

When videos are transmitted to the moving vehicle through heterogeneous networks, the mobility will frequently trigger the vertical handoff of networks. This may cause large fluctuation of channel bandwidth and will affect the Quality of Experience(QoE) of videos. In order to effectively solve the problem, an adaptive video transmission mechanism was proposed to guarantee the video quality. An information feedback link from the vehicle terminal was designed first. After analyzing the queue length of the vehicle receiver buffer and its future variation trend, the terminal fed back the judgment and prediction and the video’s encoding Quantization Parameters(QP) were updated at the sender. Simulation results show that the variation of video encoding rates in our algorithm could properly adapt to the bandwidth fluctuation of heterogeneous networks. This mechanism not only makes full use of the wireless bandwidth resource, but also effectively avoids video interruption and ensures the video QoE.


Introduction
In the process of driving, live video broadcast can provide drivers with more support for operating judgment and it can also meet the online multimedia viewing and instant video communication requirements of the passengers in the vehicles.
The real-time vehicle video transmission needs to depend on the wireless access networks which are always heterogeneous during driving. Generally speaking, heterogeneous wireless networks often integrate various access modes such as Wireless Local Area Network (WLAN), terrestrial 4G/5G cellular network and satellite communication network [1][2]. When getting access to them, vehicular terminals not only need to have diverse accessing capabilities and compatibility, but also have to consider the impact of vertical handoff between networks, which may bring about inevitable fluctuation of wireless bandwidth. Thus, it has become an urgent problem to dynamically adjust the video encoding rate to adapt to the variation of channel resources and ensure the QoE of video transmission.
The above adaptation problem in video transmission has been extensively studied, for example, the HTTP-based MPEG-DASH (Dynamic Adaptive Streaming over HTTP) standard [3]. Although the original DASH cannot adequately meet the demand of real-time rate adjustment, the basic method that the receiver sends back requests to select different quality video segments at the sender has offered a good idea for adaptive streaming. Many algorithms are based on the feedback mode [4][5][6][7] and their difference always lies in the contents of feedback. Generally, they can be divided into three kinds: a method based on channel throughput, a method based on receiver buffer queue, and a hybrid method  [8][9][10][11]. Among them, the buffer queue-based method directly starts from the results of bandwidth variation, and adopts statistical analysis methods, which has low complexity, good real-time performance and more accurate judgment.
In video encoding algorithms, QP is a kind of parameter which is easy to be adjusted and realized. In order to meet the requirement of video adaptation for the vehicle terminal travelling in heterogeneous networks, this paper proposes a QP adaptive adjustment method based on the receiver buffer prediction. The main contributions of this paper are as follows:  In order to improve the video QoE, this mechanism adopts the way of changing video bitrates by updating the encoding QP at the sender.
 The receiving buffer queue of the vehicle terminal is analyzed. The video interruptions in the future is regarded as a rare event, and the Buffer Underflow Probability(BUP) is solved by adopting the Large Deviation Principle(LDP).
 A specific algorithm for adjusting the video QP values at the sender is proposed.  We make the real-time comparison between the average video bitrates and heterogeneous network throughput and find that the proposed algorithm could accurately follow the changes of network bandwidth and provide satisfying video quality.

System Model and Problem Formulation
As shown in figure 1, when the vehicle is driven along the red dotted path, it will pass through the coverage areas of the Macro and Pico Cellular Networks. The Vehicle Terminal Equipment(VTE) will get access to one of them continuously. During the moving process, the VTE receives the real-time monitoring video and broadcast it instantly to the passengers in the car. Neither of the two kinds of networks completely covers the trajectory of vehicle, while the combination of the them can seamlessly cover the whole trajectory. Therefore, the vehicle antenna could compatibly receive signals from the two cellular networks and adaptively switch between them. The system model is shown in figure 2. At the sender of the communication, the Video Acquisition and Processing Terminal(VAPT) mainly takes the tasks of video shooting, and continuously compresses and encodes the video frames. The encoded video streaming is transmitted over the Internet and eventually sent to the VTE through the heterogeneous cellular networks. The VTE first stores the received video data in its receiving buffer, and then decodes and broadcasts it at a certain rate.
In order to better evaluate the transmission effect from the perspective of application layer services, this paper studies the packet arrivals at VTE buffer queue in the unit of frame. Assuming that the video frame rate is f , the duration time of each slot is set as 1/ eachslot f  . Therefore, the VTE broadcasts a video frame in one slot, and the buffer queue also decreases one frame per slot. Due to the frequent occurrence of vertical handoff, the channel conditions are always changing, which makes the number of frames arriving at the VTE dynamically change in each slot. We continuously observe the size of the receiving buffer and the arrival of new frames at the VTE. According to the observation  3 and prediction, the request of changing the video QP value is fed back to the VAPT through the network. As a result, the video encoding rate is adjusted in real time.
If the encoding rates do not match with the channel condition, the frame arriving rate will be either too fast or too slow, which will result in the buffer overflow or underflow. These need to be avoided because both of them could affect the users' QoE. In the following discussion, we assume that VTE's buffer capacity is large enough and the only disadvantage lies in buffer underflow, which means the real-time throughput of wireless link cannot meet the requirement of video transmission rate.
First, two thresholds are specified.
(1) The minimum queue length that the VTE buffer can tolerate is min L . (2) The allowed maximum probability that the actual queue length is less than min L is max P . The goal of video transmission is to provide users with good QoE. In order to objectively describe QoE, we analyze the Q-STAR model [12] first. From this model we know if the frame rate and resolution of the video at the VTE keeps unchanged, the key factor affecting QoE value depends on the quantization step. As QP is the serial number of the quantization step, so we could change the video QoE by adjusting the QP values, which vary from 0 to 51. The smaller the QP is, the higher the video encoding rate could achieve, the better the video quality is. So the optimization problem can be described as: The current slot is set as i , the queue length of the current slot is i l , and the queue length after N slots is i N l  .   P  represents taking probability values. This expression not only involves the current queue size, but also considers the probability after N slots, which reflects the prediction and estimation of the future bandwidth. When solving this problem, min L and max P in equation (1)  , which is the BUP after N slots .

The Queue Length Prediction
The variations of network bandwidth are the main factor that causes the changes of buffer queue. By observing the length of the receiving buffer and estimating the BUP of min ( ) i N P l L   , we can infer the condition of the network in the future.
It is assumed that the arrival of video frames is independent and identically distributed. Compared with slot i , the queue length increases N l  after N slots, the probability can be transformed as min min min min In equation (4),  can be gained from the historical observation values of the queue and calculated with the method of a sliding window. When the video interruption occurs as a certain event, the serial number will be decreased multiplicatively. If there is a possibility of video interruption after N slots, we only subtract 1 from the corresponding serial number. Also, we adopt a conservative way to increase the QP value.

Simulations and Analyses
The simulations in this paper are based on the platform of MATLAB R2017a. We uses one of the video sequences in [14] named "Big Buck Bunny". The basic features of the video are listed in table 1. The considered future slot is set as  Table 2 lists the average encoding rates of the video corresponding to different QP values. In the simulation, VTE maintains the buffer queue, calculates the length and predicted value in each slot according to the proposed algorithm, and gives the adjustment strategy of QP. The sender dynamically adjusts the QP value according to the feedback adjustment strategy of the receiver, and finally changes the transmission rate and arrival rate of the video frames. Then, it goes on to the next slot and repeats the process until the end of the simulation. The encoding rate of video recorded in each slot is analyzed after simulation. In order to analyze the adaptability of the proposed algorithm to the change of channel bandwidth, the average video encoding rate achieved by VAPT transmitter is investigated first. When the vehicle is moving, it is assumed that the bandwidth of heterogeneous wireless networks obtained by VTE varies from 100 kbps to 18 Mbps, and there is a random jitter of 100 kbps to describe the channel fading. The channel bandwidth change over time is shown in the red dotted line in figure 4. It can be seen that there are many times when the channel bandwidth suddenly decreases or increases. This means that in the process of vehicle driving, the vertical handoff is triggered in different networks. The blue curve in figure 4 is the actual video encoding rate corresponding to each slot by our proposed algorithm. Overall, when the bandwidth provided by heterogeneous networks increases, the algorithm can reduce the QP value of the video at the sender and increase the encoding rate. When the heterogeneous network throughput decreases, requests to change QP will also reduce the bit rate of the sender. Compared with the change of throughput, there is no significant delay in the change of average encoding rate.  The change of network throughput, or called bandwidth, not only causes the change of video encoding rate, but also further affects the QoE video transmission. We analyze the relationship between average network throughput and average Peak Signal to Noise Ratio (PSNR) of the video, as shown in figure 5. The blue circle curve represents the ideal situation where the channel bandwidth is fully utilized. That means the average throughput value of the horizontal axis is exactly equal to the video encoding rate. We get their corresponding average PSNR. The red asterisk curve shows the average PSNR that the proposed algorithm can achieve under different network throughput. It can be seen that the algorithm proposed in this paper is close to the ideal situation. Under the condition of heterogeneous networks with frequent channel bandwidth switching, it can provide good video quality for mobile vehicle users. In addition to video interruption, the flicker effect also needs to be concerned. Frame Quality Standard Deviation (FQSD) could reflect the offset of video quality relative to the mean value. When it is large, video flicker is apt to happen. In order to effectively evaluate the flicker effect caused by the our adjustment algorithm, the corresponding relationship between FQSD and average PSNR is analyzed in this paper. In figure 6, the blue curve is still the FQSD corresponding to the ideal case. The red curve is the simulation result of our algorithm. Because of the vertical handover of heterogeneous networks, the changes of networks themselves are full of unknown and mutation. Therefore, when using FQSD to evaluate video flicker effect, this ideal situation is not an optimal reference. On the contrary, the frequent switching of the network can easily lead to the occurrence of video flicker. The simulation results show that the proposed algorithm is basically the same as the ideal one, and in some cases it is slightly lower than the ideal FQSD value. So it does not trigger more serious video flicker phenomena.

Conclusion
When mobile vehicle users receive video in real time through heterogeneous networks, frequent fluctuations of channel bandwidth will affect the quality of video viewing. In order to effectively solve this problem, an adaptive QP adjustment mechanism is proposed in this paper. The mechanism estimates and predicts the current and future changes of channel bandwidth resources in the heterogeneous networks from the perspectives of the queue length of the buffer at the VTE. The decision results of the terminal buffer queue are fed back to the video sender in time. By the feedback information, the sender updates the QP of the video based on the basic idea of AIMD. Thus, the bit rate of video is changed, so that the transmission can follow up the bandwidth changes of heterogeneous networks adaptively. The simulation results show that the mechanism has sufficient timeliness and accuracy in tracking channel bandwidth variation. It can not only make full use of Average PSNR (dB) FQSD (dB)