IMPROVED HUFFMAN CODE TABLES FOR H.263/H.263+ BASED ...

2 downloads 0 Views 120KB Size Report
low bit-rate video applications that easily can substitute the original ... quality and low frame rate video applications for low bit- ..... using a bit stuffing technique.
IMPROVED HUFFMAN CODE TABLES FOR H.263/H.263+ BASED VIDEO COMPRESSION APPLICATIONS Jorge Sastre Rafael Verdú Joaquín López, Antonio Ferreras Dept. of Communications, Dept. Information Technologies Multimedia Tech. Div., Inform. Technical University of and Communications Soc. Devel. Sector, Valencia, Spain Technical University of Telefónica I+D/Soluciones email:[email protected] Cartagena, Spain Madrid, Spain 

ABSTRACT

This paper presents new Huffman code tables to improve H.263+ video compression efficiency for two typical video source features in applications. H.263 and H.263+ standards use fixed Huffman tables regardless of quality, picture format or frame rate. Furthermore, that tables are the same for inter and intra coding, both situations with very different statistics. New Huffman tables have been generated to code DCT coefficients for VHS quality and low bit-rate video applications that easily can substitute the original ones, with efficiency improvements that can reach 8% and 23% in inter and intra frames coding, respectively. They are specially interesting in H.263 and H.263+ applications that need low complexity, for which H.264 could not be a good option. This is the case of the application presented in this communication, called Miravideo, from Telefónica Spanish company, which transmits audio and video via GPRS using the new Huffman tables.

1. INTRODUCTION In the last decades, there has been significant interest in digital video applications. Consequently several successful standards have emerged. With the present broadband data services (xDSL, CATV technologies, etc.) and narrow band fixed and mobile networks (POTS, ISDN, GSM, GPRS, etc.), two typical and very different video applications are requested and have to be considered: medium and high quality video, for digital video providers of video on demand (VOD), near video on demand (NVOD), pay per view (PPV), etc., and low quality and low frame rate video applications for low bitrate applications such as videotelephony, video over GSM or GPRS, etc. Present digital video communication applications require compression efficiency that cannot be achieved by previous block-based video coding standards. Version 1 of the international standard ITU-T H.263, addressed that requirement and others, and became the new standard. H.263 Version 2, also known as H.263+, which was officially approved as a standard in January 1998 This work has been partially supported by the Generalitat Valenciana Grant GV04B-478 and the Polytechnic University of Valencia “Programa de Incentivo a la Investigación” and interdisciplinary project 5607-2004. .

[1]. H.263+ is an extension of H.263, providing 12 new negotiable modes and additional features that improve compression efficiency and broaden its range of useful application [1,2]. However, H.263 and H.263+ entropy coding are the same for every video source, independently of its statistics. In this paper new entropy coding tables are proposed to improve compression efficiency for the two typical and very different applications mentioned above. Other modifications of the original Huffman code tables have been proposed to improve efficiency in still images coding [3], or to improve error resilience in a noisy environment, i.e. semi-fixed-length codes [2], reversible variable length (RVLC’s), etc.

2. MODIFICATIONS TO HUFFMAN CODE TABLES 2.1 Baseline H.263+ Entropy Coding Entropy coding is performed by means of variable-length codes (VLC's). Prior to entropy coding, the quantized DCT coefficients are arranged into a one-dimensional array by scanning them in zigzag order. This rearrangement places the DC coefficients first in the array, and the remaining AC coefficients are ordered from low to high frequency. The rearranged array is coded using a three-dimensional run-length VLC table, which assigns a Huffman binary code to each LAST, RUN and LEVEL group of values [1, 4]. The symbol RUN is defined as the distance between two nonzero coefficients in the array. The symbol LEVEL is the nonzero value immediately following a sequence of zeros. The symbol LAST indicates if the current code belongs to the last coefficient in the coded block (LAST = 1) or not (LAST = 0). This coding method produces a compact representation of the 8x8 DCT coefficients, as a large number of the coefficients are normally quantized to zero and the reordering results in the grouping of long runs of consecutive zero values. So the DCT quantized coefficients are represented by its corresponding LAST, RUN and LEVEL values, and each group of these parameters are coded with a fixed Huffman code, if it exists in the Huffman coding table, or with an escape word and fixed length codes otherwise. This Huffman tables are fixed regardless of the quality (quantization step), picture format or frame rate needed by the application. Furthermore that tables are the same for

Last Run |Level| Bits VLC Code Last Run |Level| Bits VLC Code Last Run |Level| Bits VLC Code 3 00s 0 0 1 3 00s 0 0 1 0 0 1 3 10s 4 011s 0 0 2 4 011s 0 0 2 0 0 2 4 110s 0 0 3 5 1000s 0 0 3 5 0101s 0 1 1 5 1111s 0 0 4 6 01001s 0 0 4 6 11011s 0 0 3 5 1110s 0 0 5 6 11101s 0 0 5 7 101111s 0 0 4 5 0111s 0 0 6 7 100100s 0 0 6 8 1000111s 0 2 1 6 01101s 0 0 7 7 111110s 0 0 7 8 1111101s 0 0 5 6 01100s 0 0 8 8 0101101s 0 0 8 9 10010110s 0 1 2 6 01011s 0 0 9 8 1100100s 0 0 9 9 01001000s 0 0 6 7 010101s 0 0 10 9 01000111s 0 0 10 10 100101010s 0 3 1 7 010100s 0 0 11 9 10010111s 0 0 11 10 010011111s 1 0 1 7 010011s 0 0 12 9 11001101s 0 0 12 11 1100101101s 0 0 7 7 010010s 0 0 13 10 010001100s 0 0 13 12 11000000010s 0 1 3 7 010001s 0 0 14 10 010111111s 0 0 14 13 100100101001s 0 4 1 7 010000s 0 0 15 10 100111010s 0 1 1 5 1010s 0 0 8 7 001111s 0 0 16 11 0100010000s 0 1 2 6 11010s 1 1 1 7 001110s 0 0 17 11 0100011011s 0 1 3 8 1000110s 0 5 1 7 001101s 0 0 18 11 0101111100s 0 1 4 9 10000110s 0 0 9 7 001100s 0 0 19 11 1001110110s 0 1 5 10 100001110s 0 2 2 8 0010111s 0 0 20 11 1111010000s 0 1 6 10 111111010s 0 0 10 8 0010110s 0 0 21 12 01000101001s 0 1 7 11 1100000101s 0 1 4 8 0010101s 0 0 22 12 01010011011s 0 1 8 12 10010010000s 0 6 1 8 0010100s 0 0 23 12 0011100000s 0 1 9 12 10010101111s 0 0 11 8 0010011s 0 0 24 12 10011100011s 0 1 10 13 100000111110s 1 2 1 8 0010010s 0 0 25 12 11110100010s 0 2 1 6 10011s 0 7 1 8 0010001s 0 0 26 13 010100110100s 0 2 2 8 1011000s 0 3 2 8 0010000s 0 0 27 13 010111110100s 0 2 3 10 100000110s 0 0 12 9 00011111s 0 0 28 13 100111000011s 0 2 4 11 1100000100s 1 3 1 9 00011110s 0 0 29 13 100111111001s 0 2 5 13 100100101000s 0 1 5 9 00011101s 0 0 30 14 0100010001111s 0 3 1 6 01000s 0 0 13 9 00011100s

Table 1: First 30 Huffman codes of the new tables. First 5 columns show the new codes for advanced intra coding H.263+ mode for the VHS quality application; second 5 the new ones for intra MB’s and the last 5 show the H.263+ Huffman original VLC H.263/H.263+ codes with new symbol assignment for inter MB’s, both for the low quality application. inter (coding with prediction by motion compensation) and intra coding (without prediction). Both situations have different statistics. H.263+ only uses different DCT Huffman tables with the Advanced Intra prediction mode (see Annex I [1]). 2.2 Modifications to H.263+ Entropy Coding The efficiency of the DCT Huffman coding tables is due to their adaptation to the video source statistic, which can vary according to the quality, image size and frame rate. So, different tables have been obtained depending on the video source statistics for two general kinds of video applications. This new tables have replaced the original ones used by H.263+ standard for encoding and decoding DCT coefficients to obtain the results in efficiency improvement. The study is focused on two specific applications to achieve entropy coding improvement. These are a medium video quality application (typically VHS quality application), and a low bit rate application, used typically

in mobile networks (GSM, GPRS, UMTS) or Internet. The video coded features considered to model the VHS application are high frame rate (25 fps), a low value of the quantification parameter (Q = 4), and CIF picture format (352288, films, commercials, etc.). The video source for low bit rate video transmission has been characterized by a high value of the quantification parameter (Q = 14 to 18), low frame rate and low image size, QCIF (176144, videoconferencing and videotelephony type). In both statistical studies, more than forty sequences of different kinds have been used for obtaining and testing the new probabilities of the LAST, RUN and LEVEL group values for the three main H263+ MB (macroblock) types: inter, intra and intra with intra-block prediction (see annex I [1]). Once symbol probabilities have been calculated, new binary codes of Huffman tables have been obtained to substitute the original H.263+ ones. These new tables have been generated with the same number of symbols as the original to easily substitute them in the implementation, i.e. with the first 102 more probable symbols, i.e. LAST,

RUN and LEVEL groups, and another Huffman code for the escape word [1].

present the codes for the low bit-rate application and normal intra coding. The high bit-rate tables for inter coding have been obtained for the statistics of a video source coded with Q = 4, 25 fps, and CIF format. The low bit-rate tables have been obtained for the statistics of a video source coded with Q = 14 to 18, 25/6, 25/5 and 25/4 fps, and QCIF format.

Figure 1. Compression gain for CIF image size video with intra and Advanced Intra coding.

Figure 3. Compression gain for the high bit-rate application video, inter coding (left, sequences: 1 TV spot, 2 Coastguard, 3 Flower, 4 Foreman, 5 Fun fair left, 6 Mobile & calendar, 7 Son4, 8 Stephan, 9 Tennis) and the low bit-rate application (right, sequences: 1 Akiyo, 2 Carphone, 3 Coastguard, 4 Container, 5 Silent, 6 Trevor, 7 Mother & daughter, and other sequences). Figure 2. Compression gain for QCIF image size video with intra and Advanced intra coding. The H.263+ coding modes used for the VHS application have been Unrestricted Motion Vectors, Advanced Prediction, Improved PB-frames, and Advanced intra Coding for the inter analysis. The H.263+ coding modes for the low bit-rate applications have been Deblocking Filter, Unrestricted Motion Vectors, Advanced Prediction, Improved PB-frames, and Advanced intra Coding. The motion compensation algorithm has been that presented in [5]. The intra and Advanced intra coding analysis has been done with still images. In the Advanced intra coding mode there exist three intra-block prediction modes, see Annex I [1] for each macroblock: only DC, Vertical DC and AC, and Horizontal DC and AC. The one that produced fewer bits for each macroblock of the still pictures has been selected. The picture start code (PSC) and group of blocks start code (GBSC) illegal emulations [1] have been avoided using a bit stuffing technique. So, no combination of the new Huffman binary codes could produce the PSC (Picture Start Code) or GBSC (Group of Blocks Start Code) emulation inside the picture coding bitstream and the decoder can re-synchronize in error prone environments without problems.

3. RESULTS In this section, the compression efficiency improvement of the new Huffman tables vs. the H.263+ tables is presented for different sequences from that used in the study. First 5 columns of table 1 present the first 30 Huffman codes of the new tables for the VHS application and Advanced intra coding. Next 5 columns

Figure 4: Compression gain with reordered H.263+ Huffman code table (left) and with new Huffman tables (right). Sequences: 1 Akiyo, 4 Claire, 5 Clown, 6 Coastguard, 7 Container, 8 Flower, 10 Foreman, 11 Fun fair left, 12 Hall, 14 Mobile & Calendar, 15 Mother & Daughter, 16 News, 23 Stephan, 24 Tennis. The rest are sequences taken from films, news, etc. Figures 1 and 2 present the results for the new Huffman tables for intra and Advanced intra coding (Annex I of [1]). Figure 1 presents the results for CIF format and both the low bit-rate (medium and high quantization step), and the high bit-rate applications (low and medium quantization step). Figure 2 presents the results for QCIF format and both the low bit-rate (medium and high quantization step), and the high bitrate applications (low and medium quantization step). Compression gain is high for normal intra coded frames and high quality because the tables used in H.263/H.263+ for inter and normal intra frames are the same, and fit much better the more probable mode (inter, predicted) than intra mode (without prediction). Figure 3 presents the inter coding tables gain for the high and low bit-rate applications (25, 5 fps, respectively). Note that, for the high bit-rate application, efficiency improvement is greater for high motion sequences (Flower, Stephan, etc.), where compression efficiency is more needed as bit-rate increases.

Figure 4 shows compression gain keeping original H.263+ Huffman codes but reordering their respective values of RUN, LEVEL and LAST basing on symbol probabilities (few bits for more probable RUN, LEVEL and LAST values), as shown in the right 5 columns of table 1. Note that H.263+ original binary codes are used, not Huffman codes obtained with the statistical study which are fit for that symbol probability. As can be seen the compression gain is very similar, and this option presents the advantage that implementation would consist only of reordering H.263/H.263+ Huffman tables. Figure 5 presents interesting results comparing compression efficiency of the new tables for intra MB’s. When coding intra blocks using advanced intra coding mode in video sequences which have complex content (high vertical and horizontal frecuencies) intra-block prediction fails at high quality (low quantification parameter, Q=4,...8) and better results are obtained using normal intra coding mode than Advanced intra coding mode [1], especially using the new Huffman tables presented. Figure 5 shows results of compression gain with new intra vlc versus H.263+ Annex I table. If quantification parameter increases (lower quality) high spatial frecuencies are filtered and better prediction can be done, so lower compress gain is obtained. But at high quality the new intra Huffman codes achieve better performance than H.263+ Annex I coding mode. Figure 6 presents the receiver of the Miravideo Application, property of Telefónica Móviles, a company from Telefónica Group. This application transmits synchronized audio and video over GPRS channels. Receiver and transmiter of the application work on a PC or Notebook with a GPRS modem and use the new Huffman tables. The encoder commutes between the high, the low bit-rate tables and the H.263/H.263+ depending on the quantization parameter and can code real-time video from a camera or other sources.

[2] G. Côté, B. Erol, M. Gallant and F. Kossentini, “H.263+: Video Coding at Low Bit Rates”, IEEE Trans. Circuits Syst. Video Technol., 8(7):849-866, 1998.

Figure 5: Compression gain with new intra vlc versus H.263+ Annex I table. Videos: Fun fair left (CIF), Mobile & Calendar (CIF), Salesman (QCIF), Silent (QCIF).

4. CONCLUSIONS New Huffman tables have been generated to code DCT coefficients for medium and low bit-rate video H.263/H.263+ applications that easily can substitute the original ones, with efficiency improvements that reach 8% and 23% in inter and intra pictures coding, respectively. The compression gain for inter coding is greater in high motion sequences, where compression efficiency is more needed. Interesting results about compression gain in Advanced intra coding mode vs. new intra codes without using intra prediction have been presented. The use of these new codes is an alternative to the migration to more complex codecs.

5. REFERENCES [1] ITU-T, Recommendation H.263+, “Video Coding for Low Bit Rate Communication”, January, 1998.

Figure 6: Miravideo Application. [3] G. Lakhani and V. Ayyagari, “Improved Huffman Code Tables for JPEG's Encoder”, IEEE Trans. Circuits Syst. Video Technol., 5(6):562-564, 1995. [4] Khalid Sayood, “Introduction to Data Compression”, Morgan Kaufmann, 2000. [5] J. Sastre, A. Ferreras. J.F. Hernández-Gil, “Motion Vector Size Compensation Based Method For Very Low Bit Rate Video Coding”, IEEE Trans. Circuits Syst. Video Technol., 10(7):1192-1197, 2000.