On Constructing the HuffmanCode Based Reversible VariableLength Codes
On Constructing the Huffman-Code. Based Reversible Variable-Length Codes Authors: Chien-Wu Tsai and Ja-Ling Wu Source: IEEE Transactions on Communications, Vol. 49, No. 9, September 2001, pp. 1506 -1509 Presenter: Iuon-Chang Lin Date: 2001/9/27 1
Motivation • Due to the variable-length codes (VLCs), even one single bit mismatch will cause a serious problem resulting from the propagation of errors. • The main purpose of the reversible variable length codes (RVLCs) is to provide the capability of forward and backward decoding. 2
Symmetrical VS Asymmetrical RVLC Sym bol Probab Huffman ility Code Sym. RVLC Asym. RVLC A 0. 33 00 00 00 B 0. 30 01 11 01 C 0. 18 11 010 11 D 0. 10 101 1010 E 0. 09 101 0110 10010 Symmetrical: require only one code table Asymmetrical: offer better efficiently than symmetrical because a more flexible bit assignment is allowed, although two types of coding table are necessary 3
The Symmetrical RVLCs Constructions Level 1 0, 1 Level 2 00, 11 Level 3 000, 010, 101, 111 Level 4 0000, 0110, 1001, 1111 00000, 01010, 00100, 01110, Level 5 10101, 11011, 10001, 11111 000000, 001100, 010010, 011110, Level 6 101101, 110011, 100001, 111111 4
Simple Symmetric Coding 0. 32 Huffman Code 11 Simple Symm. Code 00 B 0. 18 101 11 C 0. 08 1001 010 D 0. 07 1000 101 E 0. 07 0111 0110 F 0. 07 0110 1001 G 0. 06 0101 01110 H 0. 06 0100 10001 I 0. 05 0011 011110 J 0. 05 0010 100001 Symbol Prob. A K 0. 05 0001 0111110 L 0. 04 0000 1000001 A B L K J I H GF E D C Level 1 0, 1 Level 2 00, 11 Level 3 000, × 010, 101, 111 × Level 4 0000, × 0110, 1001, 1111 × Level 5 Level 6 × 01010, × 00100, × 01110, 00000, × 11011, × 10001, 11111 × 10101, × 001100, × 010010, × 011110, 000000, × 110011, × 100001, 111111 × 5 101101,
Symmetric RVLC Algorithm 6
Symmetrical RVLC Symbol Prob. A 0. 32 Huffman Code 11 B 0. 18 101 010 C 0. 08 1001 0000 D 0. 07 1000 0110 E 0. 07 0111 1001 F 0. 07 0110 10101 G 0. 06 0101 01110 H 0. 06 0100 10001 I 0. 05 0011 00100 J 0. 05 0010 011110 Symm. RVLC 11 K 0. 05 0001 100001 L 0. 04 0000 001100 A B L K J I H GF E D C Level 1 0, 1 Level 2 00, 11 Level 3 000, 010, 101, 111 × Level 4 0000, 0110, 1001, 1111 × Level 5 Level 6 × 01010, × 00100, 01110, 00000, × 10001, 11111 × 10101, 11011, × 001100, 010010, × 011110, 000000, × 100001, 111111 × 7 101101, 110011,
The Maximum Length of Symmetrical Bit Suffixes 0000 level 3 level 4 01010 level 3 level 5 011101110 level 5 level 9 1010101 level 5 level 7 8
Asymmetrical RVLC Algorithm 9
Asymmetrical RVLC Symbol Prob. A 0. 32 Huffman Code 11 B 0. 18 C Level 1 0, 1 11 Level 2 00, 01, 10, 11 101 000 Level 3 × 111 × 000, 001, 010, 011, × 100, 101, 110, 0. 08 1001 0010 D 0. 07 1000 0100 E 0. 07 0111 0101 F 0. 07 0110 G 0. 06 0101 1001 H 0. 06 0100 1010 I 0. 05 0011 01110 J 0. 05 0010 10001 K 0. 05 0001 001100 L 0. 04 0000 011110 Asymm. RVLC Level 4 Level 5 0000, × 0100, 0101, × 0010, 0011, × 1000, × 1001, 1010, 1011, × 0110, 0111, × 1101, × 1110, × 1111 × 1100, × 00001, × 00010, × 00011, × 00000, × 00101, × 00110, 00100, × 00111, × × 01001, × 01010, × 01011, × 01000, 01100, × 01101, × 01110, 01111, × × 10001, 10010, × 10011, × 10000, × 10101, × 10110, × 10111, × 10100, 11000, × 11001, × 11010, × 11011, × × 11101, × 11110, × 11111 × 11100, 10
The Minimum Repetition Gap and No. of Available Candidate Codewords Given a codeword c=010, B=010 X 1 X 2 X 3 X=101 010101; B 1=B 3=B 5=0; B 2=B 5=1; Gap=2. X =010 010010; B 1=B 4=0; B 2=B 5=1; B 3=B 6=2; Gap=3. MRG=min{2, 3}=2. 11
Symmetrical and Asymmetrical RVLCs for the English Alphabet 12
Encoding Symmetrical RVLC for English Alphabet Step 1 Initialize nrev(3)=n(3)=2 nrev(4)=n(4)=7 avail(3)=4 nrev(3)<avail(3) nrev(5)=n(5)=7 nrev(6)=n(6)=5 Step 3 Step 2 010 101 avail(4)=4 000 111 nrev(4)>avail(4) Select all 0110 1001 0000 1111 Select 010, 101 nrev(7)=n(7)=1 nrev(5)= nrev(5) + nrev(4)-avail(4)=10 nrev(8)=n(8)=1 nrev(4)=avail(4)=4 nrev(9)=n(9)=1 nrev(10)=n(10)=2 nrev(i): bit length vector of symm. RVLC; n(i): bit length vector of VLC avail(i): the number of candidate codeword at level i 13
Encoding Symmetrical RVLC for English Alphabet (cont. ) Step 4 Avail(5)=4 nrev(5)>avail(5) 10>4 Select all Step 5 01110 10001 00100 11011 010101 00000 11111 Avail(6)=4 × × nrev(6)= nrev(6) + nrev(5)-avail(5)=11 nrev(5)=avail(5)=4 nrev(6)>avail(6) 11>4 Select all 011110 100001 00110011 010010 101101 000000 111111 × × nrev(7)= nrev(7) + nrev(6)-avail(6)=8 nrev(6)=avail(6)=4 14
Encoding Asymmetrical RVLC Step 1 Initialize nrev(3)=n(3)=2 nrev(4)=n(4)=7 nrev(5)=n(5)=7 nrev(6)=n(6)=5 Step 3 Step 2 avail(3)=8 nrev(3)<avail(3) 2<8 000 111 avail(4)=10 010 101 001 110 nrev(4)<avail(4) 011 100 Select all Select 000, 111 nrev(7)=n(7)=1 nrev(8)=n(8)=1 nrev(9)=n(9)=1 0101 1010 0010 1101 0100 1011 0010 0110 1100 0011 nrev(10)=n(10)=2 nrev(i): bit length vector of symm. RVLC; n(i): bit length vector of VLC avail(i): the number of candidate codeword at level i 15
Encoding Asymmetrical RVLC (cont. ) Step 4 Avail(5)=4 nrev(5)>avail(5) Step 5 110011 01110 10001 10>4 Select all nrev(6)= nrev(6) + nrev(5)-avail(5)=11 nrev(5)=avail(5)=4 Avail(6)=3 nrev(6)>avail(6) 001100 011110 100001 11>3 Select all nrev(7)= nrev(7) + nrev(6)-avail(6)=9 nrev(6)=avail(6)=3 16
Conclusion • The authors propose two proper and efficient codeword selection policies for symmetrical and asymmetrical classes. • It would let the number of available candidate as many as possible and coding overhead is as small as possible. • The polices are not the optimal one. 17
- Slides: 17