## 4 Methodology
### Buffer-Based ABR Scheme  
This section describes the proposed buffer-based ABR technique for network bandwidth prediction. Figure 8 presents the overall structure of the proposed scheme. When video streaming begins, 20 s chunks of the initially set video quality are downloaded, operating similarly to the conventional BBA technique. After a certain number of chunks are downloaded, the algorithm uses the GRU model to predict the network bandwidth at the time of the next chunk will be downloaded.  
\begin{table}
\begin{tabular}{c c} \hline Input size & 1 \\ Hidden state & 2 \\ Number of layers & 1 \\ Epochs & 400 \\ Learning rate & 0.001 \\ Sequence length & 20 \\ Batch size & 32 \\ Output size & 1 \\ \hline \end{tabular}
\end{table}
Table 1: Parameters for training the gated recurrent unit model.  
Figure 6: Normalized root meant squared error (NRMSE) values with different hyperparameter settings.  
Figure 7: GRU model structure.  
The proposed technique determines the video quality of the next chunk based on the predicted bandwidth value and current playback buffer occupancy. The detailed operating principles are described in Algorithm 1. The algorithm's input values include the video quality of the previous chunk, current buffer occupancy, and predicted network bandwidth. After the algorithm executes, the video quality of the next chunk is output. In the algorithm, current_Buffer refers to the current playback buffer occupancy, reservoir refers to the minimum playback buffer occupancy, bandwidth_prediction refers to the predicted network bandwidth value, and prev_rate refers to the video quality of the previous chunk. The lowest video quality is selected if the current playback buffer occupancy is lower than the reservoir. Conversely, if the current buffer occupancy is higher than the minimum buffer occupancy, and the predicted network bandwidth is one or two levels higher than the previous chunk's video quality, the current video quality or one level higher is selected. Although the current buffer occupancy may be low, high-quality video can be stably received if the available network capacity is high. Because network environment changes may be temporary, the minimum buffer occupancy required for each chunk of video quality is specified, as shown in Figure 9, and is called current_cushion. The x-axis represents buffer occupancy, and the y-axis represents video quality. The adjustment coefficient function F(\(\bullet\)) is used in cases other than those mentioned above. The adjustment coefficient is calculated as shown in Equation (2) using the current buffer occupancy, the predicted network bandwidth value, and the cushion value of the video quality currently being downloaded as inputs. The video quality is increased if the product of the current predicted network bandwidth value, buffer occupancy, and cushion range value of the video quality currently being downloaded exceeds the cushion value of the next level of buffer occupancy. Conversely, the video quality is reduced if the result is below the cushion value of the previous level of buffer occupancy. In all other cases, the current video quality is maintained. The next video rate selection algorithm is repeated as many times as the number of video chunks. When there are n video chunks, the algorithm's time complexity is O(n).  
\[F=\text{bandwidth\_prediction}\times\text{current\_buffer}\times\text{ cushion\_range} \tag{2}\]  
Figure 8: Structure of the proposed scheme.  
Figure 9: Relationship between video rate and buffer occupancy.