## 2 Visual Coding Fundaments
Nevertheless, video is a content-rich visual media that will often require more bandwidth than still images, which has led to many works investigating image sensor networks as a less stringent communication environment for visual monitoring applications. Unless explicitly defined, video media will represent only image streams, since video-based sensors will retrieve video with no audio. The multimedia data have to be digitalized and packetized before transmission through the network. When received at the destination, the media is converted back to its analog form, preferably as close as possible to the original media. The sources may be streaming the encoded data, turning the communication delay a major concern, or they may be transmitting data with no real-time constraints [13]. Such considerations influence the design of the communication protocols and the choosing of the proper codec for the application. Multimedia compression can be roughly classified in lossless and lossy. In lossless compression, the digitally compressed image is identical to the original image and only low compression is obtained. On the other hand, lossy compression discards redundant information achieving higher compression. In this last case, although the compressed image is significantly different from the original image, little visible loss is perceived, if any. In WMSNs, most coding techniques are based on lossy compression. There are a few coding techniques commonly exploited in multimedia-based cross-layer optimization. Typically, progressive and wavelet-based coding techniques are used for images, while predictive, Multiple Description Coding (MDC) and Distributed Video Coding (DVC) are encoding techniques for video. A short description of these multimedia coding techniques is presented as follows:  
* _Progressive_: The source image is compressed through multiple scans with progressively increasing details. The first scan shows the image at the equivalent of a very low quality setting, and following scans gradually improve the quality. Using such coding technique, a low-quality version of the image can be exhibited very quickly, and gradual quality refinements follow. In VSN applications, a conceivable configuration is the transmission of only low quality scans, in order to save energy. The opposite of the progressive coding technique is baseline coding, which performs a single top-to-bottom scan. Typically, progressive coding is based on Discrete Cosine Transform (DCT) [11], used to reduce spatial (among neighboring pixels) and spectral (among different color planes) redundancy as much as possible. * _Wavelet-based_: Typically, wavelet-based image compression employs the Discrete Wavelet Transform (DWT) and involves two-dimensional wavelet decomposition of the original image, giving low and high frequency subbands. Wavelet coefficients are quantized, coded and transmitted as a bit stream, achieving high compression efficiency. For VSN applications, the separate subbands are exploited to define different transmission priorities according to the relevance for the decoding process at the receiver end. Some common wavelet-based codecs are Set Partitioning in Hierarchical Trees (SPIHT), Embedded Zero-Tree (EZT) and JPEG2000 [11]. * _Predictive_: Many video codecs exploit the data statistics to reduce the transmission rate, performing intra-frame (I-frame) and inter-frame (P-frame) coding. In intra-frame coding, the redundancy within one frame is typically reduced exploiting spatial correlation, while inter-frame coding reduces the redundancy in subsequent frames exploiting both spatial and temporal correlation. MPEG-2, MPEG-4, H.263 and H.264 standards are based on predictive video coding. * _MDC_: Multiple Description Coding fragments a single media stream into two or more substreams, which may flow in different packets through distinct paths. Each substream (description) provides acceptable low quality version of the original stream, where higher quality is obtained when all substreams are combined.