# Fuzzy-Based Quality Adaptation Algorithm for Improving QoE from MPEG-DASH Video
## 3 QoE Maximization  
The HTTP server stores video content encoded into a set of \(m\) video rates, \(R=\{R_{1},\ R_{2},\ R_{3},\ \ldots,\ R_{m}\}\). Each representation of a video is split into fixed-duration segments \(\tau\). The segments are downloaded into the playback buffer, which holds the unviewed video. Let \(B^{k}\in[0,\,B^{max}]\) be the playback buffer level upon download of the \(k\)th segment. The client downloads the \(k\)th segment encoded at the \(i\)th video rate, \(R_{i}^{k}\). The size of the segment is \(R_{i}^{k}\times\tau\). The download time of the \(k\)th segment will be \((R_{i}^{k}\times\tau/T^{k})\) where \(T^{k}\) is the throughput observed when downloading the \(k\)th segment. The objective of ABR algorithms is to improve the QoE of video clients to achieve long-term user engagement [32]. As mentioned in Section 1, the key QoE factors that affect user experience include video rate, video rate variations, and playback interruptions. The average video bitrate over downloaded segments is given by:  
\[Q=\frac{\sum_{k=1}^{S}\left(R_{i}^{k}\right)}{S} \tag{2}\]where \(R_{i}^{k}\) is the \(i\)th video rate (\(k\) is the segment index), and \(S\) is the total number of segments downloaded by the client. Magnitude for the changes in the video rate from one segment to another is given by:  
\[QS=\frac{\sum_{k=2}^{S}R_{ij}^{k}-R_{ij}^{k-1}}{Number\ of\ Switches} \tag{3}\]  
The client experiences playback interruption if the download time (\(\tau\times R_{i}^{k}/T^{k}\)) is greater than the current buffer level, \(B^{k}\). The total interruption time, \(IR\), is \(\sum_{k=1}^{S}\left(\tau\times R_{i}^{k}/T^{k}-B^{k}\right)_{+}\). In this study, we used the same QoE metric used by the authors in [17], which is defined as follows:  
\[\text{QoE}_{j}=\sum_{k=1}^{S}q\left(R_{i}^{k}\right)-\mu IR_{j}-\sum_{k=1}^{S }\left|q\left(R_{i}^{k}\right)-q\left(R_{i}^{k-1}\right)\right| \tag{4}\]  
For a video fragmented into \(S\) segments, \(q(R_{i}^{k})\) maps the video rate to the quality perceived by the viewer. The authors in [17] used \(q(R_{i}^{k})=R_{i}^{k}\) and \(\mu=3000\), signifying that a playback interruption of 1 s receives the same penalty as reducing the bitrate of a segment by 3000 kbps. We used the same values in our evaluation. In this study, we calculated the average QoE per segment (that is, the total QoE metric divided by the number of segments). In Section 6, we evaluate the QoE of the algorithms by using Equation (4). In addition, we also calculate mean opinion score (MOS) using the calculations proposed in [10] to evaluate the performance of the algorithms. These MOS calculations were also used by the authors of [8] in their study to evaluate the algorithms. \[MOS_{j}=\max(0.81\times\mu-0.96\times\sigma-4.95\times\varphi+0.17,0) \tag{5}\]  
\[\mu=\sum_{k=1}^{S}\frac{QL_{k}}{S} \tag{6}\]  
\[\sigma=\frac{\sqrt{\sum_{k=1}^{S}\left(QL_{k}-\mu\right)^{2}}}{S} \tag{7}\]  
\[\varphi=\frac{7}{8}\times\max\left(\frac{\ln(F_{req}}{6}+1,\ 0\right)+\frac{1}{8} \times\left(\frac{\min(FT_{avg}.15}{15}\right) \tag{8}\]  
where \(F_{freq}\) and \(FT_{avg}\) represent the playback interruption frequency and the average interruption time, respectively. \(QL_{k}\), \(\mu\), and \(\sigma\) represent the quality level for the \(k\)th segment, average quality level and the standard deviation of the quality level, respectively. **The QoE maximization problem:** The problem of video rate adaptation for QoE maximization is given by:  
\[\underset{\mathbf{R_{1}},\ldots,\mathbf{R_{K}}}{\text{QoE}_{1}^{K}} \tag{9}\]  
Subject to:  
\[B^{k+1}=\left(B^{k}+\tau-\left(\tau\times\frac{R_{i}^{k}}{T^{k}}\right)\right) _{+} \tag{10}\]  
\[0\ \leq\ B^{k}\leq\ B_{max} \tag{11}\]  
\[QS=\frac{\sum_{k=2}^{S}R_{ij}^{k}-R_{ij}^{k-1}}{Number\ of\ Switches} \tag{3}\]0  
Given the throughput history observed from downloading previous segments, \(\{T^{t},t\in[t^{1},\ t^{k+1}]\}\), the optimization problem provides output for the video rate decision: \((R_{1},\ldots,R_{K})\).