### A. Bit-Rate Allocation for the Base Layer

The base layer provides a minimum quality of video, which should be guaranteed to be received by every client with very low loss rate. Thus, the bit-rate allocated to the base layer is determined as
TeX Source
$$r_0 = \min_{1 \leq i \leq C}b(i)\eqno{\hbox{(1)}}$$with *C* being the total number of clients and *b*(*i*) being the available bandwidth of the *i*th client.

The channel coding scheme for the base layer is illustrated in Fig. 2(a). Each rectangle denotes a packet. A block of packets is comprised of *N*_{0} packets, in which *k*_{0} of them are source packets. A packet-level FEC is applied on the source packets to generate *N*_{0}-*k*_{0} parity packets. The video source bit-rate *r*_{0_S} and the channel coding bit-rate *r*_{0_C} are computed as
TeX Source
$$\eqalignno{r_{0\_S} &= r_0\left({k_0\over N_0}\right)&\hbox{(2)}\cr r_{0\_C} &= r_0\left({N_0 - k_0 \over N_0}\right)&\hbox{(3)}}$$

Given each client's end-to-end bit-rate and packet loss rate, the server has to decide the source coding bit-rate and the channel coding bit-rate to make the base layer received by all the clients with a very low loss rate, which is no more than ∊. ∊ is defined as the residual loss rate after error correction.

We use *P*_{b}(*i*) to define the probability that the base layer is lost for client *i*. The probability is related to the packet loss rate over wireless packet-erasure channel. In this paper, we use a two-state Markov model to approximate the wireless channel's packet loss behavior [7]. The Markov model can be calculated by *p*(*m*,*N*), which illustrates the probability of losing *m* packets within *N* packets. As long as the number of lost packets does not exceed the number of protection packets, the original data can be reconstructed. Therefore, *P*_{b}(*i*) is formulated as
TeX Source
$$P_b(i) = \sum^{N_0}_{m=N_0-k_0+1}p_i(m,N_0)\eqno{\hbox{(4)}}$$where *p*_{i}(*m*,*N*_{0}) is the probability for client *i* to lose *m* packets within *N*_{0} packets. *N*_{0} is calculated as
TeX Source
$$N_0 = \left\lfloor r_0\cdot \left.\left({T\over F}\right)\right/8 M\right\rfloor\eqno{\hbox{(5)}}$$with *T* being the number of frames in a GOP and *F* being the frame rate of the video. *M* is the packet size in bytes. Let be the maximum probability for the base layer to be lost among all the clients. Now the problem can be formulated as
TeX Source
$$k_0^* = \max k_0, {\rm sub\ to}\ k_0 \leq N_0, P_{b\_\max}\leq \varepsilon.\eqno{\hbox{(6)}}$$

The searching of the maximum *k*_{0} is for the purpose of maximizing the source data to achieve a better video quality. Once *k*^{*}_{0} is computed, the source bit-rate and the channel bit-rate of the base layer can be calculated using (2) and (3).

### B. Bit-Rate Allocation for the Enhancement Layers

All the clients can access to the base layer and those clients with higher bandwidths may subscribe to more layers to improve the perceived video quality. Once a layer is lost, all the higher layers are useless. Therefore, we apply UEP on different enhancement layers of a GOP as illustrated in Fig. 2(b). There are totally *L* enhancement layers, where *S*_{i} denotes the source data for the *i*th layer (*i* = 1,2,3,…,*L*). FEC codes are added as redundancy for protection of the source data. More protections are allocated to the lower layer while less for the higher ones. All the data are vertically split into *N* packets.

The length and the height of the source data in *S*_{i} are denoted by *k*(*i*) and *h*(*i*), respectively. Let **R**_{S} = [*r*_{S,1} *r*_{S,2}… *r*_{S, L}] and **R**_{C} = [*r*_{C,1} *r*_{C,2}… *r*_{C,L}] where *r*_{S,i} and *r*_{C,i} are the source bit-rate and the channel bit-rate of the *i*th enhancement layer. The calculation of *r*_{S,i} and *r*_{C,i} are as follows,
TeX Source
$$\eqalignno{r_{S,i} &= 8k(i)\cdot h(i)\left/\left({T\over F}\right)\right.&\hbox{(7)}\cr r_{C,i} &= 8(N-k(i))\cdot h(i)\left/\left({T\over F}\right)\right.&\hbox{(8)}}$$

Given the clients' statistics, the server has to determine **R**_{S} and **R**_{C} in order to maximize the system-wide utility function. The proposed scheme can work with any form of user-defined utility function. In this paper, the PSNR of the perceived video is used to measure the utility.

Given the server's total sending bit-rate *R*, the available bit-rate for the enhancement layers, *r*_{e}, is computed as
TeX Source
$$r_e = R - r_0\eqno{\hbox{(9)}}$$

The problem is formally stated as follows,
TeX Source
$$\eqalignno{&U^*_{avg} = \max_{{\bf R}_{\bf S},{\bf R}_{\bf C}}U_{avg} = {1\over C}\sum^C_{i=1}u(i)&\hbox{(10a)}\cr&{\rm sub\ to}\ \sum^L_{i=1}(r_{S,i}+r_{C,i}) \leq r_e,k(1)\leq k(2)\le\cdots \leq k(L).&\hbox{(10b)}}$$where *U*_{avg} is the average utility and *u*(*i*) represents the utility received by client *i*. The first constraint restricts the total amount of bit-rate in the enhancement layers not to exceed the budget bit-rate. The second one confines the protection priority to be non-increasing for the layers from low to high.

To simplify the problem, we apply a classification method to partition all the clients into several groups based on their available bandwidths. Given that there are *L* enhancement layers, the total of *C* clients are clustered into *L*+1 groups. Here, we assume that *C* is far more than *L*. We use *b*_{min}(*i*) to represent the lowest bit-rate of all the clients in the *i*th group, where *i* = 0,1,2,…,*L*. *b*_{min}(*i*) serves as the data rate of group *i*. We assume that a client in the group with a higher index is able to access to more packets. As illustrated in Fig. 2(b), if a client can receive up to *k*(*i*) packets, it can decode the *i*th enhancement layer and all the lower layers. We prescribe the relationship between *b*_{min}(*i*) and *k*(*i*) as
TeX Source
$$k(i) = \left\lfloor b_{\min} (i)\cdot \left.\left({T\over F}\right)\right/8 M\right\rfloor\eqno{\hbox{(11)}}$$where *i* = 1,2,…,*L*.

We use *U*′_{avg} to denote the average utility of all except for the clients in the first group because they can only access to the base layer. Client (*i*,*j*) is used to represent the *j*th client in the *i*th group. Let *g*(*i*) be the number of clients in the *i*th group, *U*′_{avg} is formulated as
TeX Source
$$U'_{avg} = \left.\sum^L_{i=1}U_G(i)\right/\sum^L_{i=1}g(i)=\left.\sum^L_{i=1}\sum^{g(i)}_{j=1}u(i,j)\right/\sum^L_{i=1}g(i)\eqno{\hbox{(12)}}$$with *U*_{G}(*i*) being the overall utility in the *i*th group and *u*(*i*,*j*) being the utility of client (*i*,*j*). *u*(*i*,*j*) is computed as
TeX Source
$$u(i,j) = \delta (0)\cdot P(i,j,0) + \left(\sum^i_{l=1}\delta (l)\cdot P(i,j,l)\right)\cdot P(i,j,0)\eqno{\hbox{(13)}}$$where δ(0) and δ (*l*) are the utility contributions of the base layer and the *l*th enhancement layer respectively. We assume that the rate-distortion function of the scalable video codec in each layer is known. *P*(*i*,*j*,0) and *P*(*i*,*j*,*l*) represent the probabilities for client (*i*,*j*) to correctly receive the base layer and the *l*th enhancement layer, respectively. They are calculated as follows,
TeX Source
$$\eqalignno{P(i,j,0) &= \sum^{N_0-k_0}_{m=0}p_{i,j}(m,N_0)&\hbox{(14)}\cr P(i,j,l) &= \sum^{N_{i,j}-k_l}_{m=0}p_{i,j}(m,N_{i,j})&\hbox{(15)}}$$Both *p*_{i,j}(*m*,*N*_{0}) and *p*_{i,j}(*m*,*N*_{i,j}) are achieved using the two-state Markov model. *N*_{i,j} is the maximum number of packets that can be received by client (*i*,*j*), which should be computed as
TeX Source
$$N_{i,j} = \left\lfloor b(i,j) \cdot \left.\left({T\over F}\right)\right/8 M\right\rfloor\eqno{\hbox{(16)}}$$with *b*(*i*,*j*) being the available bandwidth of client (*i*,*j*). From the above deduction, it is shown that the changing of *h*(*i*) will result in the variation of source coding bit-rate of each layer and consequently affect the overall utility of the system. Therefore, the problem is re-formulated as follows,
TeX Source
$$\eqalignno{&U'^*_{avg} = \max U'_{avg}&\hbox{(17a)}\cr&{\rm sub\ to}\ \sum^L_{i=1}h(i) \leq M,0\leq h(i)\leq M.&\hbox{(17b)}}$$

To save the computation consumption, we employ a dynamic programming algorithm [5] to solve the problem.