Adaptive Quantization for Video Compression in Frequency Domain *Aree A. Mohammed and **Alan A. Abdulla * Computer Science Department ** Mathematic Department University of Sulaimani P.O.Box: 334 Sulaimani - Iraq IRAQ Abstract: - Delivery of video in the presence of bandwidth constraints is one of the most important video compression problems. In this work, the preprocessing for video compression is started by extracting any video format into raw data format and applying float wavelet transform on each frame. This step provides the video frames to perform an adaptive quantization in a frequency domain. This leads to reduce the quantity of information in higher bands (HL, LH, and HH). The proposed preprocessing method is tested on different video sequences and its performance is compared in terms of quality and compression ratio. The obtained results show that for the second level of wavelet decomposition the effect of quantization is reasonable with preserving the quality (PSNR = 28 db) of reconstructed frame. Key-Words: - Wavelet Decomposition Adaptive Quantization Video Compression Quality Measurement Compression Ratio Variable Encoding Scale Factor α 1 Introduction Coding of the high frequency subbands has been recognized as the key to the success of subband coding. However, the existing schemes are not very efficient in exploiting the spectral localization properties resulting from wavelet-based subband decomposition [1,2]. Current standards for compression of still (JPEG) and moving images (e.g., MPEG-1, MPEG- 2) use DCT, which represents an image as a superposition of cosine functions with different discrete frequencies [3]. In recent times, much of the research activities in image coding have been focused on the DWT (discrete wavelet transforms), which become a standard tool in image compression applications because of data reduction capability. DWT offers adaptive spatial-frequency resolution (better spatial resolution at high frequencies and better frequency resolution at low frequencies) that is well suited to the properties of an HVS. It can provide better image quality than DCT, especially on a higher compression ratio [4,5]. The Haar wavelet transform has been used to convert the image form spatial to the frequency domain. The aims behind the adaptive quantization are to quantize the retained coefficients after transformation step according to the quantity of information existed in each subbands and to obtain a large sequence of zeros especially in (HL, LH and HH) bands [6-8]. In the paper a novel adaptive quantization scheme is proposed and applied on different video sequences. This scheme is capable of exploiting the spectral characteristics of the high frequency subbands for different level of decomposition. It also reduces significantly the activities in the high frequency bands while preserving the perceptually important structures (acceptable PSNR value). Such an adaptive quantization makes the entire subband video compression scheme amenable to low bit rate coding. Finally the performance of the preprocessing video compression method is tested on different sequences using different quality measures (PSNR and C.R). Compression ratio is calculated between the original and the reconstructed frames [9]. The general diagram of the proposed work is shown in the Fig.1. The steps needed to preprocess an input video for the compression purpose are as follows: 1. Extract input video into frames. 2. Decompose each frame into a sequence of wavelet coefficients (w). 3. Use threshold to modify the wavelet coefficients from w to another sequence (w'). 4. Use adaptive quantization separately on (LL,HL,LH and HH) bands to convert w' to a sequence (q). 5. Apply variable run length encoding to compress q into a sequence (e). ISSN: 1790-5109 99 ISBN: 978-960-474-028-4
sequence of frames (video) and evaluating the subband s importance. 2.1 Wavelet Transformation Wavelet transform (WT) represents an image as a sum of wavelet functions (wavelets) with different locations and scales. Any decomposition of an image into wavelets involves a pair of waveforms: one to represent the high frequencies corresponding to the detailed parts of an image (wavelet function) and one for the low frequencies or smooth parts of an image (scaling function) [4,5]. The filter which is used for this transformation is reversible Haar filter. At each level the area is divided into 4 subbands: LLi: down-sampled, low-resolution version of the original block. HLi, LHi, HHi: down-sampled residual version of the original block. Where (i) is a level s number. The forward and inverse 2D-DWT for one level is shown in the Fig.2 and Fig.3. Fig.1 General Diagram of the video preprocessing scheme In section 2, the proposed preprocessing scheme is described in details including the effects of the proposed adaptive quantization scheme. The results and all relevant discussions appear in section 3. Finally, the main conclusions are summarized in section 4. 2 Preprocessing Scheme There are many types of video preprocessing for video compression including signal de-noising to eliminate high spatial frequencies. Though a lot of this job is done at the quantization stage by the encoder itself, using pattern sensitivity features can reduce bitrate while resulting in visually indistinguishable video [2]. This work is aimed to implement wavelet transformation scheme on a Fig.2 Forward wavelet transformation ISSN: 1790-5109 100 ISBN: 978-960-474-028-4
Fig.4 Wavelet decomposition, Level=2 Fig.3 Inverse wavelet transformation 2.2 Haar Wavelet Transform Haar Wavelet is the simplest type of Discrete Wavelet Transform (DWT). It operates on data by calculating the sums and differences of adjacent elements. It operates first on adjacent horizontal elements and then on adjacent vertical elements. The Haar Wavelet Transform can be expressed in matrix form: H = 1 1 1 2 1 1 (1 ) H can be represented as a kernel of Haar wavelet filter. This step compacts the more energy of the image into the LL level with a few coefficients. An illustrative example determined for two levels are shown in Fig.4. 2.3 Adaptive Quantization Efficiency and robustness of adaptive quantization for subband coding of video sequences depend on the wavelet coefficient value according to their bands. For example LL band quantizes with a small step size comparing with other bands (Hl, LH and HH). A subband adaptive quantization parameter for each of the subbands is then determined based on the coarseness tolerance of that subband as established by wavelet transformation [7]. A common problem with many existing quantization methods is that the inherent image structures are severely distorted with coarse quantization. Observation shows that subband coefficients with the same magnitude generally do not have the same perceptual importance; this depends on whether or not they belong to clustered scene structures. We propose in this paper a novel scene adaptive and signal adaptive quantization scheme capable of exploiting the spectral localization properties resulting from wavelet transform [6]. Adaptive algorithm for forward and inverse quantization is as follow: ISSN: 1790-5109 101 ISBN: 978-960-474-028-4
Y ( x, y) Q _ f = round( ) Q _ LL Y ( x, y) = round( Q _ f Q _ LL) (2) (3) Where Y(x,y) is the luminance component of the video (gray channel) and Q_LL quantization level of (LL) band. In the same way the above equations can separately apply for other bands. Fig.5 presents the quantized frame for different values of quantization step (LL=20, HL=140, LH=145, HH=150, α = 0.1). small quantization step, other subbands (HL, LH and HH) can be quantized by large quantization step. Table1 shows the test results applied on 10 frames of girl sequence. In this test the set of quantization parameters (Q_LL, Q_HL, Q_LH and Q_HH) are set fixed, while the values of alpha (α ) parameter was varied between 0 1. The values of the fixed parameters have chosen after making a lot of trials, and then those values which led to compression results with acceptable quality level have been adopted as appropriate values for those fixed parameters. The adopted fixed values are Q_LL=20, Q_HL,Q_LH,Q_HH=150. Table 1 Attained PSNR and C.R for 1 st level No. of Level = 1 Frame# = 10 α Av. PSNR Av. C.R 0.1 35 1.953 0.2 34.5 2.5 0.3 34 2.78 0.4 33.2 3.125 0.5 33 3.125 0.6 32.7 3.75 0.7 32 4.166 0.8 31 4.41 0.9 31 5 1.0 30 5.35 Fig.5 Quantized frame, Level=2 Fig.6 presents the relationship between the values of PSNR & C.R. 3 Performance Test Results The proposed preprocessing scheme is tested on two different sequences for two level of wavelet decomposition. The quality of reconstructed frame and the performance of the proposed method are based on PSNR, and compression ratio. Case1: 1 st level The adopted test strategy was based on determining the effects of the involved quantized parameters on compression ratio C.R and fidelity measure PSNR. The value of each quantized parameter which led to the best results had been adopted during the tests conducted to investigate the effects of other quantized parameters. The (LL) subband requires C.R 6 5 4 3 2 1 0 29 30 31 32 33 34 35 36 PSNR db Fig.6 PSNR versus C.R for 1 st level ISSN: 1790-5109 102 ISBN: 978-960-474-028-4
Case2: 2 nd level Table2 shows the test results applied on girl sequence. In this case the adopted fixed parameter values are Q_LL=20, Q_HL,Q_LH,Q_HH=150. Table 2 Attained PSNR and C.R for 2 level No. of Level = 2 Frame# = 10 α Av. PSNR Av. C.R 0.1 32 6.25 0.2 30 10.71 0.3 28 15 0.4 25 18.75 0.5 23 25 0.6 20 37.5 0.7 17.8 37.5 0.8 15 75 0.9 14 75 1.0 12 75 Fig.8 Reconstructed frame PSNR=28 db Fig.7 presents the relationship between the values of PSNR & C.R. C.R 80 70 60 50 40 30 20 10 0 0 5 10 15 20 25 30 35 PSNR db Fig.7 PSNR versus C.R for 2 nd level Finally, the quality of reconstructed frame is shown in Fig.8 for two level of wavelet decomposition. The quantized parameters are fixed as follows: Q_LL = 10, Q_HL, Q_LH and Q_HH = 100 α = 0.1 4 Conclusion The performance of the proposed method is based on fidelity measure and compression ratio. The tested results show that the quality of reconstructed frames is better for the first level of wavelet decomposition than second level. The compression reaches a good ratio with the two level of decomposition associated with quality degradations. For the second case compression ratio reaches 15 with preserving quality of reconstructed frame PSNR = 28 db. The future works will be the development of this method to multi-channel color video and the use of correlations between subbands. This leads us to have good results in both quality and compression factor. References: [1] L. Jiebo et al, Adaptive Quantization with Spatial Constraints in Subband Video Compression using Wavelets, IEEE International Conference on Image Processing, Vol.1, 1995, pp. 594-599. [2] D. Salomon, Data Compression, Springer, New York, 2004. ISSN: 1790-5109 103 ISBN: 978-960-474-028-4
[3] K. R. Rao and P. Yip, Discrete Cosine Transform: Algorithms, Advantages and Applications. San Diego, CA: Academic, 1994. [4] R. Bernardini et al, Wavelet Domain Distributed Coding for Video, IEEE International Conference on Image Processing, 2006, pp. 245-548. [5] Z. Xiang et al, A Comparative Study of DCTand Wavelet-Based Image Coding, IEEE Trans. Circuits Syst. Video Technol., 1999, Vol. 9, pp. 692 695. [6] A. Aree, Adaptive Intra and Inter Frames Compression Techniques, P.hD Thesis, Univerity of Sulaimany, Iraq, 2008. [7] I. Cho et al, An Adaptive Quantization Algorithm for Video Coding, IEEE Transactions on Circuits and Systems for Video Technology, Vol.9, No.4, 1999, pp. 527-535. [8] K. Ramkishor et al, Adaptation of Video Encoders for Improvement in Quality, IEEE International Symposium in Circuits and System, Vol.2, 2003, pp. 692-695. [9] N.-M. Cheung and Y. Itoh, Configurable Variable Length Code for Video Coding, IEEE International Conference on Acoustics, Speech, and Signal Processing, Vol.3, 2001,pp.1805-1808. ISSN: 1790-5109 104 ISBN: 978-960-474-028-4