# Resource Optimization for 3D Video SoftCast with Joint Texture/Depth Power Allocation
## 4 Target Distortion Optimization
### Problem Solution
#### 4.3.1 The Power Distortion Optimization  
The minimal power use \(SNR_{clk}\) in (19) is found by searching exhaustively all the feasible \(r\in[1,K]\). For each fixed bandwidth resource usage \(r\), the subproblem is solved as  
\[SNR_{clk}(\rho)=\arg\min_{\rho}\frac{1}{N}\sum_{i=1}^{r}\rho_{i} \tag{21}\]  
\[\text{s.t.}\frac{1}{N}\Big{(}\sum_{i=1}^{r}\frac{\lambda_{i}}{\rho_{i}+1}+\sum _{i=r+1}^{N}\lambda_{i}\Big{)}\leq\overline{MSE} \tag{22}\]  
\[\rho_{i}\geq 0 \tag{23}\]  
To use the Lagrange multiplier method to solve this problem, we define a Lagrange multiplier \(\mu>0\), then  
\[\min_{\rho}J=\sum_{i=1}^{r}\rho_{i}+\mu\left(\sum_{i=1}^{r}\frac{\lambda_{i}} {\rho_{i}+1}+\sum_{i=r+1}^{N}\lambda_{i}-N\cdot\overline{MSE}\right) \tag{24}\]After setting \(\frac{\partial I}{\partial\rho_{i}}=0,i=0,1,2,\ldots,r\) and \(\frac{\partial I}{\partial\mu}=0\), the optimal solution is calculated by solving  
\[\left\{\begin{aligned} &\frac{\partial J}{\partial\rho_{i}}=1+\mu \frac{-\lambda_{i}}{(\rho_{i}+1)^{2}}=0\\ &\frac{\partial I}{\partial\mu}=\sum_{i=1}^{r}\frac{\lambda_{i} }{(\rho_{i}+1)}+\sum_{i=r+1}^{N}\lambda_{i}-N\cdot\overline{MSE}=0\end{aligned}\right. \tag{25}\]  
The optimal power allocation value \(\rho_{i}^{*}\) is derived as  
\[\rho_{i}^{*}=\left\{\begin{aligned} &\frac{\frac{1}{N}\cdot\sqrt{\lambda_{i}} \sum_{j=1}^{r}\sqrt{\lambda_{j}}}{\overline{MSE}-\frac{1}{N}\sum_{j=r+1}^{N} \lambda_{j}}-1,& i=1,2,\ldots,r\\ & 0,& i=r+1,\ldots,N\end{aligned}\right. \tag{26}\]  
The algorithm procedures for power distortion optimization demonstrated in Algorithm 2 are performed on a per GOP basis. Throughout the exhaustive search, the optimal power values lie in three regions. At first, \(\rho_{i}\leq 0\), as the number of channels is still insufficient. Subsequently, the distortion caused by discarded chunks gradually lessens, and when \(\overline{MSE}-\frac{1}{N}\sum_{i=r+1}^{N}\lambda_{i}>0\), the optimal power will start to comply with the constraint (23). This feasible solution continues for a certain range of \(r\). Finally, beyond this range, up to \(r=K\), we have \(\rho_{i}\leq 0\). Therefore, it is better to stop the exhaustive search iteration, as in lines 9 to 11. In line 7, the objective function of problem (19) is calculated in a closed form. Finally, among all the \(SNR_{clk}\)s, the one with the minimum value is chosen, and the associated power allocation \(\rho_{i}^{*}\) is adopted.  
```
Input:\(N,K,\overline{MSE},c=\){texture,depth} Output:\(SNR_{clk}^{c},\rho_{i}^{c}\) initialization:\(\lambda_{i}=0\)
1:for\(i=1\)to\(N\)
2: Compute chunk variance \(\lambda_{i}^{t}\) and \(\lambda_{i}^{d}\)
3:end
4:for\(c=1\)to\(2\)
5:for\(r=1\)to\(K^{c}\)
6:\(K^{c}\gets n\);
7: Calculate optimal power allocation \(\rho_{i,r}^{c}\) via (26)
8: Calculate \(SNR_{clk}^{c}\), via (21).
9:If (\(\overline{MSE}-\frac{1}{N}\sum_{i=r+1}^{N}\lambda_{i}^{c})>0\)and\(\rho_{i,r}^{c}<0\)
10: break;
11:end
12:end
13:\(SNR_{clk}^{c}=\min_{r\in\{1,2,\ldots,K-1\}}SNR_{clk}^{c}\)
14:end
```  
**Algorithm 2**Power Distortion Optimization