## 4 Multimedia-Based Cross-Layer Optimization in VSNs
### Image-Based Cross-Layer Optimization
#### 4.1.2 Wavelet-Based Image Coding
The works presented in [33] and [34] provide similar results, with some slight differences. An interesting contribution of [34] is an adaptive compression scheme, where the quality of the transmitted image is subject to dynamic parameters to adapt the communication process. In such cases, different levels of transmission quality, computational complexity and energy consumption can be achieved according to the application requirements. The main contribution of both works is actually the prolonging of the lifetime of source nodes, but there is a still more promising benefit of the proposed solutions. As the amount of data is decreased along the path due to compression, the communication cost of the nodes closer to the sink is smaller than the communication cost of previous nodes of the path. In fact, if all nodes closer to the sink run out of energy, the whole network goes offline. As nodes closer to the sink receive more combined upstream traffic, energy saving in such nodes may have a deep impact in the expected network lifetime. Nevertheless, in both works the end-to-end delay of the proposed solutions is not investigated. As images are processed during transmission by many intermediate nodes, the transmission is subject to an extra delay and significant jitter. For real-time applications, the potential higher delay may render unfeasible the proposed in-network image compression. The same in-network encoding paradigm is also employed in [35]. While the methods in [33] and [34] encode images in a distributed way, with different types of coding during transmission over the network, the work presented in [35] consider local source encoding but in-network error recovery based on redundancy and correction codecs. The similarity of these works relies on the cluster-based structure of the deployed _ad hoc_ sensor network. Wireless links in visual sensor networks are expected to be error-prone. As retransmissions may incur in additional undesired end-to-end delay, the authors propose correction mechanisms based on the transmission of redundant packets through multiple paths and the use of Forward Error Correction (FEC) codes, which are computed by each intermediate node instead of only in the source node and in the sink. Source nodes encode the collected images following quality requirements specified by the sink. The images are coded using a wavelet-based image compression technique and a FEC Reed-Solomon code [36]. After transmission, multiple copies of the same packet may be generated in the network. Such redundant packets may be also combined and processed, resulting in new multiple copies of the same packet. Employing the proposed solution, the errors are corrected as soon as possible, or the packet is discarded if the correction cannot be performed. In other words, hop-by-hop decoding and encoding is performed. Cluster heads perform recovery of entire packets that are lost during transmission (exploiting redundant packets) or of only bit errors in received packets (exploiting the FEC code). If only end-to-end correction was employed, early corrupted uncorrectable packets could be transmitted throughout the path, resulting in undesired energy wasting. Error recovery in visual sensor networks is a key issue that may strongly impact the quality of the applications. Many works consider an error-free communication environment [33], which is unrealistic for most deployed wireless sensor networks, or they make artificial assumptions, such as constant loss rates [23]. The in-network error recovery approach investigated in [35] and the source approach proposed in [30] provide promising results for real-world sensor-based visual monitoring. The image coding techniques aim to achieve efficient compression with error resilience, keeping an acceptable perceptual quality of the received media. In fact, there is a trade-off between processing and transmission tasks, where higher compression requires more computational resources and energy consumption.