# Region-of-Interest Based Coding Scheme for Live Videos
## 4 Results  
In the encoding of live videos, we have integrated our proposed rate control scheme into the open-source commercial HEVC encoder x265 [24], employing the low-delay-B configuration. For ROI detection, the coordinates are obtained using the mm-detection toolkit for face and common object detection [19]. We evaluate our method on test sequences recommended by the HEVC standard committee, encompassing CLASS-B, CLASS-C, CLASS-D, and CLASS-E sets. Our ROI reservoir rate control algorithm is compared with a conventional algorithm that lacks ROI coding, where \(\lambda\) is directly modified in the ROI region. For a detailed comparison, consider the 1080 p video stream from the BasketballDrive sequence in Class-B at a frame rate of 50 fps with a bitrate of approximately 1500 kbps. In Table 1, the first row serves as an anchor, showcasing the performance of a rate control algorithm based on R-lambda. The second row represents the commonly employed method of directly adjusting QPoffset for the ROI region, setting QPoffset to \(-6\). Our results demonstrate that while this approach significantly improves PSNR and SSIM metrics in the ROI area, it leads to a 60% increase in bit rate. This substantial addition of bitrate during live streaming can cause increased stutter rates during transmission and playback, negatively impacting the viewer's experience. The subsequent three rows of the table show the outcomes when progressively enhancing the parameter \(K_{roi}\) for the ROI region. As \(K_{roi}\) increases, objective quality metrics within the ROI region improve correspondingly. Concurrently, the ROI reservoir algorithm reduces bits allocated to the ROU region to balance the overall bitrate, which consequently leads to a decrease in the objective metrics of the ROU region. Notably, throughout the process of tuning the ROI enhancement coefficient, the overall file bitrate increases by less than 5%, thereby satisfying the bitrate fluctuation requirements for video coding in live broadcasts scenarios. Experimental outcomes demonstrate the superiority of our proposed method in both objective and subjective evaluations for ROI, as evidenced in Figure 6, and the red box in \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Algorithm** & **BitRate (kbps)** & **ROI-PSNR (dB)** & **ROI-SSIM** & **ROU-PSNR (dB)** & **ROU-SSIM** \\ \hline R-3 [25] & 1526.26 & 35.01 & 0.881 & 34.88 & 0.881 \\ ROI constant & 2472.54 (+62.0\%) & 36.91 (+1.9\%) & 0.907 (+0.026) & 34.80 (\(-\)0.08) & 0.881 (\(-\)0.000) \\ \(K_{roi}\) = 2 & 1544.58 (+1.2\%) & 38.71 (+0.7\%) & 0.901 (+0.020) & 34.77 (\(-\)0.11) & 0.875 (\(-\)0.006) \\ \(K_{roi}\) = 4 & 1525.21 (+1.7\%) & 37.23 (+2.2\%) & 0.908 (+0.027) & 34.48 (\(-\)0.40) & 0.874 (\(-\)0.007) \\ \(K_{roi}\) = 6 & 1556.79 (+2.0\%) & 38.47 (+3.46) & 0.926 (+0.045) & 34.37 (\(-\)0.51) & 0.870 (\(-\)0.011) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: BasketballDrive@1920x1080@50 fps, 1.5 Mbps, ROI metrics. Figure 5: Reference Frame Relationship for Target Tracking. (a) is the ROI area. Our scheme effectively enhances the discernibility of details within ROI regions, particularly human bodies detected by mm-detection, while maintaining an acceptable level of visual quality in the ROU areas without any significant degradation. Comparatively, against the original video, while there is a general uniform increase in PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity Index) metrics across all configurations, a subtle improvement in subjective quality is observed with \(K_{roi}\) = 2. However, a more substantial leap in image subjective quality becomes apparent when setting \(K_{roi}\) to 4. Although the PSNR and SSIM values for \(K_{roi}\) = 6 surpass those of \(K_{roi}\) = 4, the subjective quality difference between the ROI regions of these two settings is not appreciably distinguishable.Simulation results further validate that our custom encoder can adeptly adjust the subjective visual quality of ROI in relatively incremental steps.