Efficient Huffman Decoding Source: 2000. Proceedings. 2000 International Conference on Image Processing, Volume: 1 , 2000, pp. 936–939 Author: Aggarwal, M.; Narayan, A. Speaker: Hsien-Wen Tseng Date: 11/15/2001
Outline Introduction Lookup Table Method Proposed Algorithm Discussion
Introduction Memory: O(2h) Complexity: O(h) Memory: O(n) Complexity: a few computations K L I J H G F E D C B A
Lookup Table Method
Proposed Algorithm Huffman Table
LMBC Function lmbc( ): The position of the first-bit-change. Example: Decoding procedure: Determine the partition Search the codeword sequentially Example B = 00000000111000111
Canonical Huffman Code Canonical codes are a subclass of Human codes, that have a numerical sequence property, i.e. codewords with the same length are binary representations of consecutive integers. The usage of canonical codes is simple decoding technique.
Modified Huffman Table
Decoding Algorithm Determine the partition Using first bit and lmbc( ) function B = “0001011001”, LMBC = 3 Determine the common length Li and the numerically least codeword FCi in Pi Li = 7, FCi = “0001000” Let C be the first Li bits of B, then (C-FCi) can be used as an index into lookup table yielding the desired symbol and its actual length li C = “0001011”, C-FCi = 3, li = 5 The bitstream is left-shifted by li and process iterated until the last symbol
Discussion The proposed algorithm requires very few computations to decode a codeword. The memory requirement would be large in worst case. Codewords {000100, 00011111} Require 24=16 entries In the MPEG-1, MPEG-2, H.261, H.263 standards, require additional memory only about one-third of n.