## 2 Visual Coding Fundaments  
There are many design issues that have to be properly considered when dealing with multimedia coding. If multimedia communications have to be performed over _ad hoc_ sensor networks composed of nodes with energy and processing constraints, such issues become even more relevant. Some basic concepts of visual coding and their using in VSNs are discussed in this section. The nature of packet networks such as the Internet has demanded the use of specialized multimedia coding algorithms referred as codecs (enCOder/DECoder). These algorithms aim to reduce the required transmission bandwidth of digitalized multimedia data and to allow some kind of recovery of information lost due to packet dropping. The maximum quality of the received multimedia data is obtained when the sensed data is transmitted with lossless data compression techniques and with enough redundancy to compensate packet loss. However, the resulting transmitted data will require high bandwidth, what could be prohibitive for many links. In order to achieve lower transmission rates, codecs reduce the total amount of the original data using some compression technique, demanding computational time and processing resources, but efficient data compression usually inflict some information loss. In general, information loss grows with increasing compression rate. In visual sensor networks, some nodes endowed with a CMOS camera will transmit visual data to the sink of the network, using the _ad hoc_ structure created by the deployed nodes. In such networks, the nodes are constrained in energy and processing resources and are interconnected by potentially error-prone wireless links. Such contexts create very complex environments, where the stringent requirements of multimedia communications oppose to the constrained nature of the sensor network. In short, there are three main design objectives for multimedia coding in visual sensor networks [5,6]:  
* _High compression_: Uncompressed raw multimedia data require high transmission bandwidth, which will usually not be available in the deployed sensor network. Moreover, a high bit rate also results in undesired energy consumption at the source nodes and over the currently used path(s). Thus, algorithms with efficient compression are mandatory for most VSN applications. * _Error resilience_: The error-prone nature of _ad hoc_ wireless links in wireless sensor networks can be very severe for visual monitoring. The employed coding technique can provide some error resilience, potentially improving the end-to-end attainable quality of the application. * _Low complexity_: Multimedia coding is performed by source nodes and/or intermediate nodes which are constrained in energy and processing resources. High complex codecs may demand excessive energy consumption or be even prohibitive for a particular deployed sensor network. We can divide multimedia data into three different categories: audio, video and still images. Audio typically represent human voice or some noise relevant to the application, with transmission rates usually lower than 64 kbps. Although audio may be important for some kind of applications on the Internet, this media is often used only to complement visual information [12] and pure wireless audio sensor networks are uncommon. In fact, most WMSN applications are concerned with the use of source sensors endowed with CMOS cameras, which are able to collect still images and videos from the environment. Still images are snapshots of the monitored target or scene, while video represent a continuous viewing created by a greater number of frames (images) transmitted and reproduced at the sink, providing a sense of motion. The required transmission rate varies according to the adopted codec, which determines the desired quality of the decoded data, the error resilience and the final resolution.