# Load Balancing Strategies for Slice-Based Parallel Versions of JEM Video Encoder
## 3 Parallel Approaches
### Asynchronous Algorithm: JEM-SP-ASync

Table 7: Computational cost per slice for Park Scene video sequence. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Slice** & & & & \\ \hline size & QP & (0–30) & (30–60) & & \\  & 22 & 56\% & 44\% & & \\
30 & 27 & 56\% & 44\% & & \\  & 32 & 56\% & 44\% & & \\  & 37 & 57\% & 43\% & & \\  & & (0–20) & (20–40) & (40–60) & & \\  & 22 & 31\% & 52\% & 17\% & \\
20 & 27 & 30\% & 54\% & 15\% & \\  & 32 & 31\% & 54\% & 15\% & \\  & 37 & 32\% & 54\% & 14\% & \\  & & (0–15) & (15–30) & (30–45) & (45-60) & \\  & 22 & 25\% & 31\% & 32\% & 11\% & \\
15 & 27 & 25\% & 31\% & 34\% & 10\% & \\  & 32 & 26\% & 31\% & 34\% & 9\% & \\  & 37 & 27\% & 31\% & 33\% & 9\% & \\  & & (0–12) & (12–24) & (24–36) & (36–48) & (48–60) & \\  & 22 & 19\% & 24\% & 29\% & 19\% & 8\% \\
12 & 27 & 18\% & 25\% & 30\% & 20\% & 8\% \\  & 32 & 18\% & 26\% & 29\% & 19\% & 7\% \\  & 37 & 19\% & 26\% & 29\% & 19\% & 7\% \\  & & (0–10) & (10–20) & (20–30) & (30–40) & (40–50) & (50–60) \\  & 22 & 14\% & 18\% & 24\% & 27\% & 11\% & 5\% \\
10 & 27 & 13\% & 18\% & 25\% & 28\% & 10\% & 5\% \\  & 32 & 13\% & 18\% & 26\% & 29\% & 10\% & 5\% \\  & 37 & 14\% & 18\% & 25\% & 28\% & 10\% & 5\% \\  & & (0–9) & (9–18) & (18–27) & (27–36) & (36–45) & (45–54) & (54–60) \\  & 22 & 12\% & 16\% & 22\% & 22\% & 17\% & 8\% & 3\% \\
9 & 27 & 12\% & 16\% & 23\% & 22\% & 17\% & 7\% & 3\% \\  & 32 & 12\% & 16\% & 23\% & 22\% & 17\% & 7\% & 3\% \\  & 37 & 13\% & 16\% & 23\% & 22\% & 17\% & 7\% & 2\% \\  & & (0–8) & (8–16) & (16–24) & (24–32) & (32–40) & (40–48) & (48–56) & (56–60) \\  & 22 & 11\% & 15\% & 16\% & 19\% & 22\% & 8\% & 6\% & 2\% \\
8 & 27 & 11\% & 15\% & 17\% & 19\% & 23\% & 8\% & 6\% & 2\% \\  & 32 & 12\% & 15\% & 17\% & 18\% & 23\% & 7\% & 5\% & 2\% \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Computational cost per slice for Four People video sequence. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Slice** & & & & \\ \hline size & QP & (0–14) & (14–28) & & \\  & 22 & 52\% & 48\% & & \\
14 & 27 & 51\% & 49\% & & \\  & 32 & 51\% & 49\% & & \\  & & (0–10) & (10–20) & (20–28) & \\  & & 22 & 36\% & 40\% & 24\% & \\
10 & 27 & 35\% & 41\% & 23\% & \\  & & 32 & 35\% & 42\% & 22\% & \\  & & 37 & 35\% & 43\% & 22\% & \\  & & (0–7) & (7–14) & (14–21) & (21–28) & \\  & & 22 & 25\% & 27\% & 27\% & 21\% \\
7 & 27 & 24\% & 27\% & 28\% & 21\% & \\  & & 32 & 24\% & 27\% & 29\% & 19\% & \\  & & 37 & 25\% & 26\% & 30\% & 19\% & \\  & & (0–6) & (6–12) & (12–18) & (18–24) & (24–28) & \\  & & 22 & 22\% & 23\% & 20\% & 12\% \\
6 & 27 & 22\% & 22\% & 24\% & 20\% & 12\% \\  & & 32 & 21\% & 21\% & 25\% & 20\% & 12\% \\  & & 37 & 21\% & 21\% & 25\% & 20\% & 13\% \\  & & (0–5) & (5–10) & (10–15) & (15–20) & (20–25) & (25–28) \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Computational cost per slice for Party Scene video sequence. Table 11 shows the computation times (in seconds) needed to encode 120 frames using the AI coding mode for all video sequences tested, and the average computation time per frame for all QPs tested. As can be seen, the sequential algorithm required an average of 14 min to encode a frame of the Park Scene video sequence, meaning that 28.2 h would be needed to encode the 120 frames of the video sequence (five seconds of video). Tables 12 and 13 show the parallel efficiency and the computational times, respectively, of the JEM-SP-Sync algorithm for the BQ Square, Party Scene, Four People and Park Scene video sequences encoded at four QP values (22, 27, 32, 37). The computation times were obtained using OpenMP functions and the parallel efficiency, in percentage, was calculated according to Equation (1). \[Efficiency=\frac{Sequential\_time}{Parallel\_time*NoT}*100 \tag{1}\]