## 2 Related Works
### Lossy Compression Algorithms  
The lossy algorithms found in literature are mainly based on transform coding where the Discrete Cosine Transform (DCT) is used [8, 9, 10, 11, 12, 13, 14, 15]. In these algorithms, image pixels need to be accessed in \(4\times 4\) or \(8\times 8\) blocks from the image sensor as shown in Figure 1a. However, commercially availablecomplementary metal-oxide-semiconductor (CMOS) image sensors [16, 17] send pixels in raster scan fashion (_i.e._, row-by-row, from top left to right) as shown in Figure 1b. These image sensors also do not have internal buffer memory for image storage and random access of pixels. Due to the mismatch of pixel steaming sequence of commercial image sensors and pixel access sequence required by transform based compression algorithms, buffer memory needs to be implemented inside the capsule to store a complete or blocks of an image frame, so that the image pixels can be accessed by the compressor in block wise fashion from the buffer memory.  
In order to start processing of the first n \(\times\) n block of an N \(\times\) N size image, the compressor has to wait and store all the pixels coming from the image sensor to buffer memory until the first n \(\times\) n block is available. The memory requirement in bits, \(S\), can be expressed as Equation (1):  
\[S=\left(N\times(n-1)+n\right)\times BPP \tag{1}\]  
where \(BPP\) is the bits-per-pixel. For 320 \(\times\) 320 image size and 8 \(\times\) 8 block access of 24 BPP pixels, 6.6 kB buffer memory need to be implemented inside the capsule. Moreover, when the compressor will start working with the 8 \(\times\) 8 block pixels, the image sensor will continue to send its remaining pixels and more memory will be required to store those pixels while the compressor is busy. One solution of this problem is to pause the image sensor after it sends all the pixels for accessing a block; however the feature of pausing an image sensor in the middle of transmitting pixels of a frame is not found due to the read out timing requirements of the pixel array in the image sensors. Another possible solution to the problem is to use two buffer memory of total size 2\(S\), so that while the compressor works with pixels of one buffer, the new pixels continuously coming from the image sensor are stored in the other buffer. However, this solution can create timing error if compression and transmission time exceeds the input data rate of the image sensor. A safer solution of this problem could be to use sufficient memory to store a complete image frame. For storing a 320 \(\times\) 320 size image of 24 BPP, 300 kB memory is required. Buffer memory takes significantly large silicon area and consumes  
Figure 1: Pixel access sequence in image sensor using two topologies: (**a**) 4 \(\times\) 4 block; (**b**) raster-scan.  
sufficient amount of power which can be a noticeable overhead in capsule endoscopy application. Moreover, complex calculations are associated with transform coding based compressors (_i.e._, multiplications, additions, data scheduling, _etc._), as a result large silicon area and power consumption are required which makes them less suitable for practical implementation.  
The works in [5, 18] by our group present lossy compression algorithms which do not require block based access of image pixels; rather they can work with pixels coming in raster scan fashion. However, these compressors (both raster scan based and block based) presented in the literature are lossy compressors which incur various levels of distortions in the reconstructed images. For medical diagnostics, these distortions can lead to inaccurate diagnostics decisions. Moreover, these works present only computer based simulation results using endoscopic images taken from on-line databases (such as [19]). The performance of their algorithms was not validated using hardware level simulation or _ex-vivo_ trials.