FPGA implementation of new LM-SPIHT colored image compression with reduced complexity and low memory requirement compatible for 5G

ABSTRACT


INTRODUCTION
With the fast development of mobile systems, techniques need to be changed to cope with these developments; among the modifications that need to take place such as image compression. Image compression can be achieved by removing one or more of the three basic data redundancies as briefly outlined below: [1] a. Coding redundancy: if the number of bits per pixel that is required to represent the image is higher than is necessary. b. Inter pixel redundancy: The correlations among image pixels, which result from the structural or geometrical relationships between the objects in the image lead to inter pixel redundancy. c. Psycho visual redundancy: The less important information is considered to be redundant since it is ignored by the human vision system and hence omitted. Many researchers implemented JPEG2000, but the problem was always the high decoding complexity and the amount of memory required to store data. JPEG 2000 image compression is based on Discrete Wavelet Transform (DWT) which is considered a Lossy compression method. The objective of DWT coding is to divide the spectrum of one image into the Low-pass and the High-pass components. JPEG 2000 is a 2-dimension DWT based Image Compression standard [2].
A coding algorithm developed for DWT transformed images is the Set Partitioning in Hierarchical Trees Algorithm (SPIHT). The SPIHT algorithm can be applied to grey-scale and colored images. It ensures that important information is restored first to make it an effective use in networks [3]. SPIHT algorithm is applied on the wavelet transformed image to reduce the correlation between neighboring pixels especially when original image is concentrated in the lowest frequency band of the transformed image [3]. In this paper a modified version of SPIHT is based on reduction of three processing lists in sorting pass into single processing list including refinement passes. Also to improve compression performance and further reduction in memory requirement, Listless SPIHT has been proposed. In L-SPIHT, coefficients are extracted from the whole wavelet-transformed image and encoded separately to reduce the memory requirement without the need to store lists.
Another modification to SPIHT was introduced is the use of three trees instead of continuous scanning. This will help reduce the processing time by performing parallel processing to the three trees. As a final compression step, Runlength Encoding is a very simple form of lossless data compression by storing a single data value and its repetition count. This is most useful on data containing many such runs such as icons, line drawings, and animations [4].
From the parameters that need to be calculated to test the quality of the reconstructed image are Mean Square Error (MSE) and peak signal to noise ratio (PSNR) ratio. Let's assume that the original image is 'A' and the reconstructed image is 'B'.

10
( 2 ) The original and the reconstructed images are considered indistinguishable by human eyes if the PSNR value is 40 dB or greater [5]. Another performance factor is the compression ratio of the image is given by

CR
( Yashaswini P R1, and Mr. Ravi Kiran [5] used a modified SPIHT that utilizes only a single list instead of three lists. Thomas W. Fry, and Scott Hauck [7] used a modification to the original SPIHT algorithm to reduce the computation.

THE PROPOSED METHOD 2.1. Discrete Wavelet Transform
The DWT has become so popular that it provides an efficient method for sub band decomposition of signals. The process starts by passing signal through filters with different cut-off frequencies. [9] These filters are the low pass and high-pass decomposition filters to generate four lower resolution components: one low-low (LL1) sub-image, which is the approximation of the original image and three detailed sub-images, which represent the horizontal (LH1), vertical (HL1) and diagonal directions (HH1) of the original image [10,11].
Firstly, the rows of the array are passed to the filters to divide the array into two vertical halves, with the first half represents the average coefficients, while the second vertical half represents the detail coefficients. Secondly, the process is repeated again with the columns, resulting in four sub-bands [9]. Figure 1 shows the output of the two-dimensional wavelet transform for two decomposition steps in a conceptual way. L denotes a low-pass and H a high-pass band. The first letter stands for the transforming of the rows while the second one relates to the columns and the number to the decomposition step [12].

Set Partitioning in Hierarchical Trees Algorithm (SPIHT)
Embedded coding is based on threshold where values greater or equal to the threshold are called significant. While values less than threshold known as insignificant as in (4) 1, This indicates that if the coefficient with maximum magnitude in a set is significant, then the significant test result is 1 [12]. The value of n can be obtained by using (5) , The encoder and the decoder perform the same steps and when the decoder receives the comparisons results with threshold from the encoder, it can recover the ordering information from the execution path. [13]. For a given bit rate, the lower bits is used to represent significant values, gives a lower output bit rate [14].
The Wavelet-coefficients can be classified into three sets where each set contains the representative of whole subtree. These trees are List of Significant Set (LIS), List of Significant Pixels (LSP), and List of Insignificant Pixels (LIP) [13]. a. LIS includes the location of the coefficients that considered insignificant with respect to selected threshold. b. LSP include the pixels that are significant with respect to selected threshold. c. LIP includes the pixels that are considered insignificant with respect to the selected threshold.
Every pass is divided into two parts: [6] Sorting pass: in this pass every value that considered insignificant in previous pass and its significant in this pass are encoded.
Refinement passes: the nth MSB of all the significant values are output. Passes will continue until target data rate is reached or n=0.

Runlength Encoding
Runlength coding is considered as a one form of lossless compression. It represents a run of same numbers by two values, the number followed by the its run counts [4].
Runlength Encoding provides large compression of data, when the data contains large number of runs. One drawback is that in some times when the data contain small number of runs, it provides no compression. The worst case if there are no runs this will lead to increase the sequence size instead of reducing it [15].

THE PROPOSED METHOD
The proposed model is depicted in Figure 2. At first, the input RGB image with size QCIF (176x144) is converted to binary file using MATLAB program to be used as the input to the VHDL program. The wavelet filter is carried out for the red, green, and blue image layers in parallel. Each 8x8 block are processed individually to reduce processing time. Hence only 64 pixels (8x64 bits) needed to be stored in buffer before it is passed to the next stage. And further reduction is made by passing only details subset (LL) of the output of wavelet filter to the SPIHT encoder. This is approximately quarter of the original image (76x88) pixel. A LM-SPIHT is proposed were three trees are used instead of one tree. Each 8x8 block of the detail subset is divided into three trees and without the need to store lists of significant and insignificant. The 8x8 block of image with three trees zigzag scanned is shown in Figure 3.  The zigzag scanning order is performed on each tree then each value is compared to threshold in parallel. The parallelization of the computation process of each tree reduces the computation time. The number of levels where trees are compared to threshold depends on the required output data rate. The less number of levels is the less data rate. Parallel processing has been adopted in implementing the SPIHT coding, where each tree is processed individually. Figure 4 shows a flowchart of LM-SPIHT parallel processing. The output of SPIHT in previous step is encoded using runlength encoding. Runlength is useful when applied on the SPIHT output bitstream. Since the SPIHT output are represented by three values only (1: significant list, 10: significant pixel, and 0: insignificant pixel) this makes the output contains a long successive runs of 10 or 0. Flowchart of Runlength encoding is as in Figure 5.
This step reduces the number of required bits to be transmitted to the receiver. Hence reducing the data rate of the overall system to makes it more compatible to work in the 5G mobile networks. Table 1 shows the LM-SPIHT algorithm step by step.  If 'LL' quarter of wavelet output then step 6 Compute threshold step 7 Divide block into three trees step 8 If at least one value in subset (S1)>=threshold then step 9 If value in S1 >=threshold then out=10 step 10 If value in S1 < threshold then out=0 step 11 Else step 12 Skip subset (S1) step 13 If at least one value in subset (S2)>=threshold then step 14 If value in S2 >=threshold then out=10 step 15 If

HARDWARE IMPLEMENTATION
The system was implemented using netFPGA-CML-IG Kintex-7 board in the stand alone form of connection as shown in Figure 6. Xilinx ISE Design Suite 14.7 is used to write the VHDL code which has to be then compiled with zero errors. A test bench code is written in VHDL. To implement one level 2D-DWT, the input bits are passed to shift registers with 2-bits to perform FIFO operation. The output bits are then passed to the low pass filter and high pass filter in parallel. The operation continues until all rows in the image completion. Then the output of each filter is again passed to 2bit shift register to perform the FIFO operation. Also the same operation is done for bits in each column. The Register Transfer Logic view of the wavelet circuit is shown in Figure 8.
Next step is implementing the low and high pass filters. The low-pass filter can be implemented as an average between the current value of a signal, and the previous value as (6) ( 6 ) Figure 8. RTL view of the wavelet filters Intuitively, the high-pass filter is calculated by determining the distance between the average and one of the signal values (or, in other words, the difference between the current and the previous signal value, divided by 2):as (7) The data cannot be directly stored to the output RAM, because the compression yet needs to be performed. For this purpose, a memory controller device is created which takes the decomposition values and controls the address and data buses of the output RAM to store the correct values. This operation is performed for the red, green, and blue layers of the image in parallel. Figure 9 depicts the simulation results of wavelet transform. A sample of the SPIHT encoder code written in Xilinx ISE is shown in Figure 10. The output of wavelet transform is next SPIHT encoded (note only LL is being encoded). The RTL configuration is in Figure 11. The same operation is done for red, green, and blue in parallel. The simulation results of SPIHT encoding shown in Figure 12. A sample of the SPIHT decoder code in ISE is shown in Figure 13. The VHDL code is downloaded to netFPGA device using JTAG connector and by using the SVF (Serial Vector Format) mode, multiple code programs are simultaneously downloaded in the sequence shown in Figure 14.

RESULTS AND DISCUSSION
The input image for DWT, LM-SPIHT and the restored image from DWT and LM-SPIHT for Compression are presented in MATLAB software. Figure 15 shows the encoding and decoding output for wavelet transform with LM-SPIHT.
As it is noticed the difference between original and reconstructed image is undetectable by human eyes. The difference is only noticeable through calculation or graphical representation. Since the PSNR Performance for the Lena image using Wavelet transform and LM-SPIHT technique is 51.4 dB and MSE is 46.56 dB which is greater than 40 dB, then the two images are virtually indistinguishable. The compression ratio in Lena image is 40% shows that the image has been compressed. As shown in Table 2.  From the calculation it is being seen that the hardware implementation speeded up the processing of Lena image 14604 times faster than that of the results obtained from software (MATLAB) simulations, thereby making it highly promising for real-time and memory limited mobile communication. LM-SPIHT was compared with several models in literature by mean of speedup factor, FPGA processing time, and PSNR as in Table 3.

CONCLUSION
This paper focuses mainly on compressing images using wavelet transform along with the proposed LM-SPIHT; Adding another level of compression using lossless Runlength encoding. Wavelet transform along with LM-SPIHT technique enhance the quality of reconstructed image by mean of PSNR, MSE and so on. Haar wavelet transform makes itself a standard technique for its high efficiency. SPIHT provides variety of important characteristics like good image quality, high PSNR etc., along with HWT technique makes the proposed work a very efficient design. The purpose of this paper is to improve image compression algorithm that is fast, efficient and low memory compatible for real-time implementations. The design was successfully implemented, tested and validated on Xilinx netFPGA-CML-IG Kintex-7 utilizing 1,797 logic cells and achieved a maximum frequency of 260.3MHz. The hardware implementation of the proposed algorithm speeded up the processing of Lena image 14604 times faster than that of the results obtained from MATLAB simulations. Thus, proven the FPGA realization of the design is highly promising for real-time and memory limited mobile communication.