## 4 Multimedia-Based Cross-Layer Optimization in VSNs
### Image-Based Cross-Layer Optimization
#### 4.1.2 Wavelet-Based Image Coding
In that approach, in order to reduce energy consumption in multimedia processing and transmission, raw or encoded images can be processed by other nodes besides the source. The basic idea behind in-network processing is to employ (idle) intermediate nodes to share the processing load with source nodes. For that, there should be a logical structure that supports the desired in-network compression. Among the possibilities, clustering [31] is the most used approach. A cluster head is selected in each cluster and maintains a membership list of the associated cluster nodes, and each cluster knows its cluster head [32]. To allow communication among clusters, each cluster head also knows the path to its neighboring clusters. In such logical structure, the cluster heads control the distribution of the data to be processed among the associated cluster nodes. The way packets flow on the network through the available clusters depends on the employed routing protocol and the correspondent routing scheme. Figure 1 shows an example of distributed cluster-based image processing where only two intermediate nodes in each cluster are employed for encoding/decoding. [PERSON] and [PERSON] in [33] defined a mechanism for distributed image compression in visual sensor networks. In order to support the share of the processing tasks, that work assumes a cluster-based topology for a dense deployment of nodes where only some of them are endowed with a camera (source nodes). The authors argue that individual nodes may not have sufficient computational power for source coding of all collected visual data, turning in-network image compression potentially advantageous. Even if the source nodes have sufficient computational power, in-network compression can extend the network lifetime due to energy saving just exploiting idle sensors. The compression technique in [33] is wavelet-based and is expected to be performed by several groups of nodes along the path. The sink sends a request specifying the desired quality to the source node, which perform an initial compression (entropy coding) and send the image to its neighboring nodes for further compression, under the control of the cluster head. The in-network encoding follows the cluster structure and the required number of wavelet decomposition levels. Each cluster is responsible for a wavelet decomposition level, but it is not necessary to employ all nodes of the same cluster. The required number of wavelet decomposition levels is typically small, and some clusters may have no compression to perform or be responsible for more than one wavelet decomposition level if the sensor network is composed of few nodes. Figure 1: A cluster-based in-network image processing scheme. The original images may be distributed to the nodes using two different data exchange schemes: Division by rows/columns and tiling (segmenting of original image in smaller \"parts\"/tiles). These schemes differ in the way the image is organized for compression. The work in [34] proposes a distributed image compression scheme based on the JPEG2000 codec, exploiting the DWT technique and the Embedded Block Coding with Optimized Truncation (EBCOT) algorithm. As in [33], the authors argue that sensors nodes do not have sufficient computational power to compress a large volume of data, and in-network compression would be a reasonable solution to reduce energy consumption in source nodes and over the current path(s) toward the sink. To perform in-network compression, the computational tasks must be distributed among other nodes. For that, a method to share the processing task is proposed, which employs cluster-based routing: Cluster heads distribute compression task among nodes under the same cluster. As the path from the source to the sink may pass through many clusters, different compression tasks (e.g., horizontal decomposition, vertical decomposition, _etc._) are performed by each cluster, but some clusters may only forward the packets with no additional compression, as in [33].