## 3 Proposed Solution
### Forward Error Correction  
The magnitude and location of errors must be known before the correction process. FEC [29] is carried out with block coding that herein works on the macroblock level of a video data stream. In block coding, the data stream is divided into blocks of fixed size called a codeword. The flow chart in Figure 3 depicts the overall working of the FEC methodology to restore video quality in the face of transmission errors. The FEC code can be used to detect and correct both single bit and multibit errors to achieve sufficient QoE. The input data stream consists of two segments, i.e., information bits with length '\(k\)' (called the dataword) and some redundant bits of length '\(r\)' (called the parity or check bits). These check bits are added to each dataword block to form a larger block of total length '\(n\)', which is the codeword. Redundancies can be added either to the start, at the end of the frame, or somewhere in between. Hence, \(C\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\  
In the implemented FEC, matrices are used for codeword generation rather than generating codewords manually. Thus, for \((n,k)\) codes, \(L\) is the generator matrix consisting of \(k\) rows and \(n\) columns, given in (10). \[L=\left[ \begin{array}{cccc}l_{11}&l_{12}&...&l_{1n}\\ l_{21}&l_{22}&...&l_{2n}\\ \vdots&\vdots&&\vdots\\ l_{k1}&l_{k2}&...&l_{kn}\end{array} \right] \tag{10}\]  
where \(L\) is constructed by combining the identity matrix and the parity-bits matrix as:  
\[L_{k\times n} =I_{k\times k}\mid P_{k\times(n-k)} \tag{11}\] \[L_{k\times n} =I_{k\times k}\mid P_{k\times r}\]  
where \(I\) is the \((k\times k)\) identity matrix, and \(P\) is the \((k\times(n-k))\) or \((k\times r)\) matrix for \((n,k)\) codes. The generator matrix \(L\) in our case, i.e., for \((7,4)\) block codes, is given as:  
\[L=\left[ \begin{array}{cccccc}1&0&0&0&1&0&1\\ 0&1&0&0&1&1&1\\ 0&0&1&0&1&1&0\\ 0&0&0&1&0&1&0\end{array} \right] \tag{12}\]  
For \((n,k)\) codes, the codewords in a linear block code can be expressed in vector form by multiplying the generator matrix with the data block of information bits to be transmitted as \(C=F\times G\). Here, the input information bits or decoded \(k\) bits are denoted by \(F\) and expressed in vector form as \(F=[F_{1},F_{2},F_{3},\ldots,F_{k}]\). Then, these codeword bits or encoded \(n\) bits sent over transmission channel are denoted by '\(C\)', and can be expressed in vector form as \(C=[C_{1},C_{2},C_{3},\ldots,C_{k-1},C_{k},C_{k+1},\ldots,C_{n-1},C_{n}]\), and \(C=F\times G\). These are the codewords received by the receiver after being passed through the noisy/error-prone channel. Thus, there is also a possibility of errors in the received codewords. The errors may be denoted by \(E\), and here, there may be up to \(n\) errors in a number, which can be represented in vector form as \(E=[E_{1},E_{2},E_{3},\ldots,E_{n}]\), where \(E_{j}=1\) represents \"error at the jth position\" and \(E_{j}=0\) means \"no error\". If \(C^{\prime}\) is the received codeword, then in vector form, \(C^{\prime}=[C^{\prime}_{1},C^{\prime}_{2},C^{\prime}_{3},\ldots,C^{\prime}_{n}]\). Then, \(C^{\prime}=C+E\)  
\[C^{\prime}=(C_{1},C_{2},C_{3},\ldots,C_{n})+(E_{1},E_{2},E_{3},\ldots,E_{n}) \tag{13}\]  
\[C^{\prime}=\left( \begin{array}{c}(C_{1}+E_{1}),(C_{2}+E_{2}),\\ (C_{3}+E_{3}),\ldots,(C_{n}+E_{n})\end{array} \right) \tag{14}\]  
Figure 4: An \((n,k)\) block code. For a single received word, the word will be calculated as \(C^{\prime}=C+E\). The parity check matrix is constructed using a generator matrix at the decoder side. For \((n,k)\) codes, \(D\) is the generator matrix consisting of \(r=(n-k)\) rows and \(n\) columns. \[D=\left[ \begin{array}{ccccc}d_{11}&d_{12}&\ldots&d_{1n}\\ d_{21}&d_{22}&\ldots&d_{2n}\\ \vdots&\vdots&&\vdots\\ d_{r1}&d_{r2}&\ldots&d_{rn}\end{array}