# An Analytic Transform Kernel Derivation Method for Video Codecs
## 2 Proposed Common Sparse Unified Matrix
### Permutation Matrix (G)
Then, variables \(a\) and \(b\) are initially set to 1 and 0, which will be used as initial values of the left column (S0) part of **G**. \(i_{r}\) and \(i_{c}\) represent the row and column indices of **G**, respectively. The index value of \(i_{r}\) was initialized to 0. First, the condition is checked if the \(i_{r}\) index value is less than the size \(N\). If this is true, then the process is divided into two columns, the left column (S0) and right column (S1); then, the \(i_{c}\) index value is initialized to 0 else, the process terminates. Thus, the \(i_{c}\) index value is checked if it is less than half of the value of \(N\). If the condition defined is satisfied, then \(i_{r}\) and \(i_{c}\) corresponding to the respective \(a\) and \(b\) variables are checked. Variables \(a\) and \(b\) are set only for the S0 of the **G** matrix. The value of the permutation matrix at the respective location \([\text{G}_{N}]_{i_{r},i_{c}}\) is set to 0 if the checked condition is false, \(i_{c}\) is incremented by 1, and looped back to the condition, where the \(i_{c}\) index value is checked for whether it is less than half of \(N\). If the checked condition holds true (T), \(c_{1}\) is checked for whether it is true (T) or false (F). If \(c_{1}\) is false, then the value \([\text{G}_{N}]_{i_{r},i_{c}}\) is set to \(-1\), and \(c_{1}\) is set to true. Otherwise, the value of \([\text{G}_{N}]_{i_{r},i_{c}}\) is set to 1, and \(c_{1}\) is set to false. Subsequently, the value of \(a\) is incremented by 2, and the value of \(b\) is incremented by 1. After setting the values of \(a\) and \(b\), \(i_{c}\) is incremented by 1 and finally looped back to the condition where the \(i_{c}\) index value is checked whether it is less than half of the value of \(N\). For the right column (S1) part of **G**, variables \(m\) and \(n\) are used, whose initial values are set to 0 and \(N-1\), respectively. If the condition, where \(i_{c}\) index value is checked to be less than half of \(N\) is false, then the value of \(i_{c}\) is set as half of \(N\). Further, the \(i_{c}\) index is checked to determine whether it is less than \(N\). If the condition is false (F), then the \(i_{r}\) index value is incremented by 1 and looped back to the condition, where \(i_{r}\) is less than \(N\) or is not  
Figure 12: Algorithm for the generation of the permutation matrix **G**. checked. However, if the condition exists (T), then the \(i_{r}\) index equals \(m\) and the \(i_{c}\) index, which equals \(n\), is checked. If it is false, the value of \([\mathbf{G}_{N}]_{i_{r},i_{c}}\) is set to 0. Otherwise, the \(c_{2}\) condition is further checked for whether it is false. If \(c_{2}\) is false, the value \([\mathbf{G}_{N}]_{i_{r},i_{c}}\) is set to 1, and \(c_{2}\) is set as false; thus, the \(i_{c}\) index is incremented by 1 and looped back to the condition where \(i_{c}\) is checked to determine whether it is less than \(N\). Otherwise, the value \([\mathbf{G}_{N}]_{i_{r},i_{c}}\) is set as \(-1\) and \(c_{2}\) is set as true, the value of \(m\) is incremented by 2, and that of \(n\) is decremented by 1. Finally, the value of the \(i_{c}\) index is incremented by 1 and looped back to the condition where the \(i_{c}\) index is checked to determine whether it is less than \(N\). An example of the splitting of S0 and S1 in the \(\mathbf{G}\) matrix for \(N=8\) is shown in Figure 13.