14-08-2012, 11:26 AM
Wavelet Image Compression on the DSP
Introduction and Theory:
The objective of our project was to perform the discrete Haar wavelet transformation on an image for the purpose of compression. The Haar wavelet transformation is composed of a sequence of low-pass and high-pass filters, known as a filter bank. These filter sequences can be applied in the same way as a discrete FIR filter in the DSP, using the MACP command, except as multiple successive FIR filters. The low pass filter performs an averaging/blurring operation,
Assembly Coding – Second half and Debugging
By this stage in the timeline, we were quite confident of our programming skills in assembly. We identified errors more quickly, which made the programming less frustrating. Nonetheless, our progress was always fraught with unexpected and sometimes arbitrary errors that required much time to correct, mostly by using brute force. We had a major problem running our code right through. To check our results, we had to ‘break through’ the code in code explorer. Because of this problem, our progress began to crawl. Due to this, we realized that we would not be able to achieve our initial objective of performing lossless and lossy compression in assembly. We had also hoped to perform the inverse transformation in assembly. We decided to pursue only lossless compression because doing this would in itself demonstrate the capabilities of compression using the wavelet transform. Finally, we realized that the pipelining of operations was the cause of our inability to run the code in entirety. To solve this problem, we inserted multiple ‘nop’ commands after nearly every line of the code. After this, we successfully got our result and verified it in MATLAB. We also transferred the hex data from the memory to MATLAB, and performed the inverse transformation to recover the original, lossless image.
Presentation
During this week, we gathered our results and compiled a report of them that was then transferred to a presentation that was used in class. We reviewed the details of the wavelet transformation so that we could educate the rest of the class on it too before demonstrating the results of our project during the presentation.
Conclusion:
We successfully implemented the 2-dimensional Haar wavelet transformation on the DSP as applied to lossless image compression. We also implemented the transformation and its inverse in Matlab and compared the results to verify that our algorithm was working correctly. We found that compression on the DSP actually worked, as we achieved smaller JPEG file sizes for the transformed images when compared to file sizes for the original images, and we were able to fully recover the original image from these compressed images using Matlab. Challenges and problems included memory limitation of the DSP, assembly language issues, and automatic pipelining of processing. Future extensions of this project could include implementation of the inverse transform on DSP, and implementation of lossy image compression by setting a threshold value for the transformed image.