Joint redundant motion vector and intra macroblock refreshment for video transmission

This paper proposes a scheme for error-resilient transmission of videos which jointly uses intra macroblock refreshment and redundant motion vector. The selection of using intra refreshment or redundant motion vector is determined by the rate-distortion optimization procedure. The end-to-end distortion is used for the rate-distortion optimization, which can be easily calculated with the recursive optimal per-pixel estimate (ROPE) method. Simulation results show that the proposed method outperforms both the intra refreshment approach and redundant motion vector approach significantly, when the two approaches are deployed separately. Specifically, for the Foreman sequence, the average PSNR of the proposed approach can be 1.12 dB higher than that of the intra refreshment approach and 5 dB higher than that of the redundant motion vector approach


Introduction
The H.264/AVC [1] video coding standard provides higher coding efficiency and stronger network adaptation capability in comparison to all the previously developed video coding standards. However, as previous video compression standards, it is still based on a hybrid coding method, which use transform coding with motion-compensated prediction (MCP). As a result, when transmitting the hybrid-coded video in packet loss environments, it suffers from error propagations and this leads to the well-known drifting phenomenon [2,3].
Due to the unreliable underlying networks, the development of error-resilient video coding techniques are a crucial requirement for video communications over lossy networks. Among all the error-resilient video coding techniques, two categories of robust coding approaches are promising. One category is based on intra macroblock refreshment, and another one is redundant coding.
The intra macroblock refreshment approach is standard compatible, and it is an useful tool to combat network packet losses. It can be employed to weaken the inter picture dependency due to inter prediction, and eventually, cut-off the error propagations. The early intra macroblock refreshment algorithms are based on randomly inserting intra macroblocks [4] or periodically inserting intra contiguous macroblocks [5]. However, in both [4] and [5] the intra refresh frequency is determined in a heuristic way, and it is costly to code an entire picture by intra coding. So the trade-off between code efficiency and error resiliency need to be balanced. Zhang et al. first treated this problem as optimization of coding mode selection for each macroblock in [6], and proposed the well-known recursive optimal per-pixel estimate (ROPE) approach to determine intra macroblock. In [6] the expected end-to-end distortion for each pixel is calculated in a recursive way, then in the mode selection step, the expected end-to-end distortion is used in the rate-distortion optimization process. In [7], another flexible intra macroblock update algorithm was investigated to optimize the expected rate-distortion performance. In this approach, the end-to-end distortion is calculated by emulating the real channel behaviors, therefore, the computation complexity is tremendous. Among the methods to get the expected end-to-end distortion, [6] is pixel-based, another block-based approach [8] generates and recursively updates a block-level distortion map for each frame. The work in [6][7][8] are lossaware end-to-end rate-distortion optimized intra macroblock refreshment algorithm, which are currently the best known way for determining both the correct number and placement of intra macroblocks for error resilience.
Redundant coding is another effective tool for robust video communications over lossy networks. In [9], an optimal algorithm is presented to determined whether one picture needs redundant version. In [10], redundant slices are optimally allocated based on the slice position in the group of pictures (GOP), and the primary and redundant slices are then interleaved to generate two equal importance descriptions of the same data using the multiple description coding (MDC) paradigm. Whereas in [11], the two descriptions are generated by splitting the video pictures into two threads, and then redundant pictures are periodically inserted into the two threads. In both [9] and [11] redundant coding are optimized in frame level, namely all the macroblocks in one frame is encoded with the same redundant coding parameters. Whereas for [10], redundant information is allocated in slice level. In all the three approaches, redundant bitrate is allocated to both motion vectors and residual information. In [12] a new approach with only redundant motion vectors is proposed, as the redundant bitrate for motion vector is low, this approach improves the bandwidth utilization with limited primary picture quality degradation. In [13] a significant motion vector protection (SMVP) scheme for error-resilient transmission of videos is proposed. This scheme shows how to determine the significant motion vectors (SMVs) and how much rate should be dedicated to SMVs. The idea behind this scheme is to give more protection to SMVs.
Intra macroblock refreshment can stop errors in the previous frames, while redundant coding is a way of preventing and minimizing propagated errors in the future frames. Motivated by the two approaches, in this paper, we propose an innovative approach that jointly uses intra macroblock refreshment and redundant motion vector. For each macroblock, intra coding or redundant motion vector is chosen based on the rate-distortion optimization procedure. The loss-aware end-to-end expected distortion is used for this RD optimization, and the end-to-end distortion is calculated with the ROPE [6] method.
The rest of the paper is organized as follows. In Section 2, the ROPE method is presented as preliminary, as it is the method we adopt to calculate the end-to-end distortion, In Section 3, the proposed joint redundant motion vector and intra macroblock refreshment (JRVIR) approach is introduced. In Section 4, extensive simulation results are given, which validate our approach. Finally, some conclusions are drawn in Section 5.

Preliminary and the rope approach
In an ideal error-free environment, the rate-distortion optimized intra/inter mode decision is an efficient tool to determine the macroblock mode based on the cost function defined in [14], the cost function of all the macroblocks is defined as where λ mode is the Lagrange multiplier, D MB and R MB are the encoding distortion and the bitrate in different encoding modes, respectively. This optimization mode is tailored for error-free environments, and no packet loss is considered here.
However, when the compressed videos are transmitted over error-prone networks, traditional schemes cannot adaptively insert intra refresh macroblocks to efficiently stop the channel error propagations. The ROPE approach uses the end-to-end distortion in the RD optimization, which takes into account the channel packet losses. With the ROPE approach, intra macroblocks are optimally used to stop error propagations, and it is defined as follows.
Let f i n denote the original value of pixel i in frame n, and letf i n andf i n denote its encoder and decoder reconstruction, respectively. Because of possible packet loss in the channel,f i n can be modeled at the encoder side as a random variable. In the ROPE approach, the D MB is redefined as the overall expected decoder distortion in one macroblock.
The overall expected mean-squared-error (MSE) distortion of a pixel is d i n , obviously, it is determined by the first and second moments of the decoder reconstruction. ROPE provides an optimal recursive algorithm to accurately calculate the two moments for each pixel in a frame.
Let us assume that packet loss events are independent for simplicity, and the packet loss rate (PLR) p is available at the encoder side. To make it more general, there is no limitation on the slice shape and size, so the motion vectors from neighboring macroblocks are not always available in the error concealment stage. Therefore, the decoder may not be able to use motion vector from neighboring macroblocks for concealment. Accordingly, we assume the decoder copies reconstructed pixels from the previous frame for concealment. The prediction at the encoder only employs the previous reconstructed frame. The recursive formulas of ROPE are as follows.
• Pixel in the intra macroblock • Pixel in the inter macroblock where inter coded pixel i is predicted from pixel i+mv in the previous frame. The prediction residual e i n is quantized toê i n . It is important to notice that in order to make it simple, we apply ROPE in its simple setting, where the motion estimation is evaluated at pixel level accuracy, and we use constrained intra prediction, so there are no error propagations in the intra prediction. Recent advances in ROPE further expand its capability to accommodate sub-pixel prediction [15], bursty packet loss [16]. But they are not incorporated here so as to avoid diluting the focus. In the ROPE approach, the end-to-end distortion is only used in the mode selection stage. However, recently, in [17,18] end-to-end distortion is applied in the motion estimation and motion prediction stage, which is so-called loss-aware motion estimation and loss-aware motion prediction. With this extension the error-resilience capability of ROPE is improved further. The loss-aware motion estimation and loss-aware motion prediction is not used in our approach, because we extend ROPE in different direction, in fact, the gain can be accumulated if both the loss-aware motion estimation and loss-aware motion prediction are applied.

The proposed JRVIR approach
As both redundant motion vector and intra macroblock refreshment are powerful tools for error resilient video communications. In the proposed JRVIR approach, they are jointly applied to further protect the video stream. With the JRVIR approach, all the macroblocks of one frame are divided into three types, namely intra macroblock, inter macroblock (including skip) without redundant motion vector and inter macroblock (including skip) with redundant motion vector. The redundant motion vectors are encapsulated in the redundant picture. Let us take macroblocks in Figure 1 as an example, let us suppose the last macroblock in the first row is a macroblock with redundant motion vector, accordingly, it is stored in the redundant picture. On the contrary, for intra refresh macroblock and inter macroblock without redundant motion vector, there will be no redundant information to be sent in the redundant picture. Therefore, for inter macroblock with redundant motion vector, if the macroblock in the primary picture is lost due to packet losses, the redundant extra motion vector can be used to recover the macroblock. It is important to note that, in the proposed JRVIR approach, as not all the macroblocks need to have redundant motion vector, a new flag is applied in each macroblock to indicate whether there is redundant motion vector. For these macroblocks with redundant motion vector, there will be no transformed coefficients to be encapsulated in the redundant macroblocks. Therefore, the proposed JRVIR would not be standard compatible, and some small modifications are required for both the encoder and decoder.
In general, intra coding is more expensive in terms of rate requirement with respect to redundant motion vector, therefore for the macroblocks with smooth texture and/or macroblocks with slow and translational movements, providing redundant motion vector would lead to better resource utilization, i.e., bitrate, with respect to the intra coding. Whether to encode one macroblock with intra mode, inter mode with redundant motion vector or without motion vector is determined by our JRVIR rate-distortion optimization process.

The JRVIR rate-distortion optimization
As in other encoding approaches, in the JRVIR rate-distortion optimization process, the encoder selects the coding option O* for the current encoding macroblock, so that the Lagrangian cost function is minimized.

The JRVIR end-to-end distortion
When calculating the expected end-to-end distortion, we can still use Equations 4 and 5 for intra macroblock, and Equations 6 and 7 for inter macroblock without redundant motion vector. For inter macroblock with redundant motion vector, first and second moments of the decoder reconstruction are as follows.
For those inter macroblocks with redundant motion vector, the probability of receiving the primary information is 1 -p. The probability of receiving the redundant motion vector while losing the primary information is p (1 -p), and the probability of both the primary information and the redundant motion vector get lost is p 2 . With all those probabilities, we can easily get Equations 9 and 10 for inter macroblock with redundant motion vector.

The JRVIR rate
In the RD optimization procedure, the rate of the redundant motion vector should be taken into account. For those redundant motion vectors, encoding them without exploiting the correlation among them can cost a significant number of bits. Motion vectors for neighboring macroblocks are often highly correlated and so each motion vector is predicted from vectors of nearby, and previously coded macroblocks. Therefore, the motion vector encoding procedure in H.264 standard [1], which includes motion vector prediction, is adopted to encode the redundant motion vector to reduce bits. However, it is worth noticing that, in our JRVIR approach we do not provide redundant motion vector for all the inter macroblocks. For example, in Figure 1 only three macroblocks have redundant motion vector, when encoding the redundant motion vector for the macroblock in row 3, there are no motion vectors to predict from, because its up and left macroblocks do not have redundant motion vectors. As a result, the performance is compromised. In future, more sophisticated prediction method will be investigated, for example, the redundant motion vector would be predicted from the concealment emulated motion vector.
To determine the required rate to encode a macroblock using the JRVIR algorithm, let us assume that encoding the macroblock itself and its redundant

Lagrange multiplier selection
The Lagrange multiplier λ mode in (8) controls the ratedistortion trade-off. For the error-prone environment, extensive experimental evidence suggests that there is no significant performance difference between using the Lagrange multiplier tailored to the error-free or the error-prone environment. This argument has also been confirmed in [7]. So λ mode is set as the one tailored to error-free environment.
where QP is the quantization parameter.

The pseudo code of JRVIR algorithm
The whole mode selection process of the proposed JRVIR approach is described in Algorithm 1. It is important to note that, in the proposed JRVIR approach, the end-to-end distortion is used in the rate-distortion optimization process, and five new encoding modes are adopted. Upon the optimal encoding mode is selected, the first and second moments for all the pixels in current macroblock are recorded based on the selected encoding mode, and those values will be recursively used in the rate-distortion optimization process of next frame. At the decoder side, if the primary slice is available, the redundant motion vector will be discarded, whereas when the primary slice is lost while the redundant motion vector is available, the motion vector will be used to conceal the lost region by copying into the lost macroblock the region indicated by the redundant motion vector. In general, with the correct motion vector, the concealed pixels will be much more accurate than those generated by Temporal Replacement (TR), which copies the pixels from the same positions in the previous frame.

Simulation result
Our simulation setting builds on the JM14.0 H.264 codec [19], with constrained intra prediction and CABAC entropy coding used. Rate control mechanism in the JM codec is used with one common quantization scale to all the macroblocks of one row. Pixel level accuracy motion estimation and prediction is used. Each slice contains one row of macroblocks (22 macroblocks for the CIF video sequences) for both primary and redundant frames, and one slice per network packet is adopted, therefore the term packet and slice are used interchangeably. The IPPP. . . GOP structure is used, and it is assumed that the I-frame is transmitted over secure channel. A random packet-loss generator is used to drop the packets according to the required packet loss rate, except the burst packet-loss is specified explicitly. The luminance PSNR (Y-PSNR) is averaged over 200 trials to get statistical meaningful results. To evaluate the proposed JRVIR approach, we use conventional ROPE [6] and redundant motion vector (RMV) [12] as benchmark. First, the frame by frame average PSNR are presented in Figure 2, for the three approaches, namely the JRVIR approach, ROPE and RMV. Both CIF sequence Foreman and Silent are encoded at 1 Mbps bitrate. The packet loss rate is 10%. From the figures, it is observed that for all the frames, the JRVIR frame quality is always better than that of RMV and ROPE. For the Forman sequence, for some frames the PSNR of JRVIR can be up to 2.5 dB higher than that of ROPE, and up to 8.5 dB higher than that of RMV. At the beginning of the sequence, the PSNR of JRVIR and RMV are quite similar, but with the increase of frame number the quality gap between the two approaches increases dramatically. This phenomena indicates that when the GOP length is small, the RMV approach can protect the video stream effectively, but when the GOP length is relatively large, the RMV approach can not work properly. For Foreman, the average PSNR for JRVIR approach is 33.39 dB, it is higher than that of ROPE and RMV, which are 32.27 dB and 28.39 dB, respectively. For Silent, the average PSNR for JRVIR approach is 37.56 dB, while for ROPE and RMV it is 36.83 dB and 31.27 dB. For Foreman, the gap between JRVIR and ROPE is larger than that of Silent, this is because the movement in Foreman is more translational than that in Silent, and this leads to more inter macroblocks with redundant motion vectors being used in the Foreman case. Interestingly, with the JRVIR approach 8.18% of macroblocks in P-frame are intra coded macroblocks, while 35.02% are inter macroblocks with redundant motion vector. In the ROPE approach 18.40% macroblocks are intra macroblocks, which is more than that of JRVIR by nearly 10%. Algorithm

end for
In order to further evaluate the error-resilient performance of the JRVIR approach, we compare the video quality for different packet loss rate in Figure 3, with GOP length 150 and 15 in Figure 3.a, b, respectively. CIF Foreman sequence is used, and the target bitrate is 1 Mbps. From the figures, we can see that for different packet loss rates (0-20%) and GOP length the JRVIR approach can provide the best video quality among the three approaches. In Figure 4 video quality versus the bitrate is presented for the three approaches. CIF Foreman sequence is used, the packet loss rate is 10%, and the GOP length is 150 and 15. In the 200 Kbps to 1 Mbps bitrate range, the proposed JRVIR approach outperforms the other two approaches, and the performance gap between JRVIR and the other two approaches increases with the bitrate. In both Figures 3  and 4, it is interesting to note that, with long GOP length ROPE can provide better video quality than RMV, while for short GOP length, RMV outperforms  ROPE. This is because, in the ROPE approach, intra coding macroblocks are optimally inserted, the PSNR inside one GOP is more stable than RMV, while for the RMV approach, intra coding is not used, and consequently the PSNR inside one GOP drops incessantly.
In all the previous experiments, the channel packet loss rate is assumed to be available at the encoder, this can be implemented with the real time control protocol (RTCP) [20]. However, in practical situation, feedback packet loss rate information may be delayed from the decoder. Therefore, the packet loss rate used by the encoder in its RD optimization process may not be exactly identical to the actual packet loss rate. To further evaluate the performances of the proposed JRVIR approach when the estimated packet loss rate does not match the actual one, we use 10% packet loss rate in the RD optimization process, whereas, the actual packet loss rate is varied from 0% to 20%. Figure 5 shows that the penalty because of the mismatch of the packet loss is not significant, especially when the packet  loss rate is in the range from 5% to 15%, the gap is less than 0.25 dB. Comparing with the ROPE approach, the proposed JRVIR approach can provide better video quality when the estimated packet loss rate is not matched with the real situation.
In Table 1, simulation results for video sequences with varies degree of movement and bitrate are presented, and the percentage of intra macroblocks and macroblocks with redundant motion vector is given. For all the video sequences, GOP length is 150. We can observe that, in different test environments, the proposed JRVIR approach always outperforms both ROPE and RMV approach. It is interesting to notice the JRVIR approach uses less intra macroblocks than ROPE, so as to allocate bitrate for redundant motion vector. Note that for the ROPE approach, the higher the packet loss rate, the more macroblocks are encoded with intra mode, whereas for the JRVIR approach, the total number of intra macroblocks and macroblocks with redundant motion vector increases. Table 1    vectors. Accordingly, the gaps between the JRVIR and ROPE approaches for these two video sequences are relatively larger than other sequences. The actual network loss behavior have addressed by many papers, and it is agreed that Internet packet loss often exhibits finite temporal dependency, which means if current packet is lost, then the next packet is also likely to be lost. This leads to burst packet losses, with average burst length two for the Internet [21]. Therefore, besides i.i.d. random packet loss model, we also use burst loss model for simulation, and as indicated in [21], we set the average burst length as two. In practical burst loss environments, the transmission order of the primary and redundant packets would affect the performance. In our simulations, all the redundant packets of one frame are transmitted after the last primary packet of this frame, therefore there is no interleaving delay. In Figure 6, the PSNR versus bitrate curves in burst loss environments are plotted. The results are similar with that in the i.i.d. case, and the proposed JRVIR approach can provide best video quality among the three approaches. This makes us conclude that, the error resilient performance of proposed JRVIR approach is robust on different error distribution models.
In Table 2, we compare the encoding time of JRVIR with JM 14.0. In order to have fair comparison, we use the same configuration file for the two approaches. It is interesting to see that, the time costs for the two approaches are quite similar. In all cases, JRVIR costs less than 5% extra encoding time, this makes the JRVIR approach suitable for the real-time hand-device applications, where the battery capacity is usually the bottleneck. This is because in the H.264/AVC encoding process, the motion estimation step is the main timeconsuming task, so in comparison with this step, the end-to-end distortion calculation and new mode selection task costs much less time.

Conclusions
In this paper, a novel joint redundant motion vector and intra macroblock refreshment approach has been proposed to combat packet loss. Besides the traditional skip, inter and intra mode, we add a set of new modes, which are inter coding modes with redundant motion vector. Given the packet loss rate and the channel bitrate, the reconstructed distortion at the decoder side and the total bitrate for each mode are estimated at the encoder during the mode selection process. Based on the estimated end-to-end RD cost, the optimal encoding mode is selected. Equipped with the two tools, namely intra macroblock refreshment and redundant motion vector, extensive experimental results show that the  proposed approach outperforms other error-resilient approaches. Our future work would be investigating more sophisticated prediction method to compress the redundant motion vector. In addition, in this paper, we use pixel accuracy motion estimation and motion prediction, extending the current approach to quarter-pixel accuracy motion estimation and motion prediction would also be promising.