KR20060028750A - Huffman coding and decoding - Google Patents

Huffman coding and decoding Download PDF

Info

Publication number
KR20060028750A
KR20060028750A KR1020067004185A KR20067004185A KR20060028750A KR 20060028750 A KR20060028750 A KR 20060028750A KR 1020067004185 A KR1020067004185 A KR 1020067004185A KR 20067004185 A KR20067004185 A KR 20067004185A KR 20060028750 A KR20060028750 A KR 20060028750A
Authority
KR
South Korea
Prior art keywords
data structure
value
level
node
tree
Prior art date
Application number
KR1020067004185A
Other languages
Korean (ko)
Other versions
KR100840757B1 (en
Inventor
지운 베이
Original Assignee
노키아 코포레이션
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 노키아 코포레이션 filed Critical 노키아 코포레이션
Priority to KR1020067004185A priority Critical patent/KR100840757B1/en
Publication of KR20060028750A publication Critical patent/KR20060028750A/en
Application granted granted Critical
Publication of KR100840757B1 publication Critical patent/KR100840757B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • H03M7/42Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code using table look-up for the coding or decoding process, e.g. using read-only memory

Abstract

A method of decoding a bitstream encoded according to a Huffman coding tree of height H comprising: extracting a first codeword of H bits from the bitstream; modifying the codeword by shifting it by a first shift value; using this modified codeword to identify using at least a first data structure either a symbol or a second data structure having an associated second offset value and an associated second shift value; and if a second data structure is identified using the first data structure: modifying the codeword by subtracting the second offset value and shifting the result by the second shift value; and using this modified codeword to identify using the second data structure either a symbol or a third data structure having an associated third offset value and an associated third shift value.

Description

허프만 부호화 및 복호화{Huffman coding and decoding}Huffman coding and decoding

본 발명의 실시예들은 허프만 부호화 및 복호화에 관한 것이다. 특히 본 발명의 실시예들은 부호화 및 복호화를 위한 개선된 메커니즘들 및 허프만 트리의 개선된 표시에 관한 것이다.Embodiments of the present invention relate to Huffman coding and decoding. In particular, embodiments of the present invention relate to improved mechanisms for encoding and decoding and an improved representation of a Huffman tree.

디지털 프로세싱에서, 메시지가 일련의 심볼들을 포함하는 경우, 각 개별 심볼은 개별의 이진 코드워드로서 표현될 수 있다. 허프만의 알고리즘은 메시지내의 각 심볼의 발생 빈도의 테이블을 사용하고 가장 빈번한 코드워드가 가장 짧은 길이를 가지도록 가변 길이 코드워드들을 최적화한다. 이것은 데이터 압축을 초래하고 허프만 부호화는 오디오 및 비디오 압축 부호화, 예를 들어 MPEG에서 일반적으로 사용된다.In digital processing, where a message includes a series of symbols, each individual symbol may be represented as a separate binary codeword. Huffman's algorithm uses a table of the frequency of occurrence of each symbol in the message and optimizes variable length codewords so that the most frequent codewords have the shortest length. This results in data compression and Huffman coding is commonly used in audio and video compression coding, for example MPEG.

IRE 40(1952)의 회보 1098-1101, 데이빗 에이 허프만(David A Huffman)에 의한, "최소-중복 부호들의 구성을 위한 방법"은 허프만 부호화를 소개한다.Bulletin 1098-1101, IRE 40 (1952), by David A Huffman, "Method for Constructing Minimum-Duplicate Codes" introduces Huffman coding.

다음 각 발생 빈도 5, 5, 6, 1, 2, 3, 16, 9, 9를 지닌 9개의 심볼들 S0, S1 ... S8이 존재하는 경우, 그들은 허프만 알고리즘을 사용하여 도 1에 도시된 이진 트리로 부호화될 수 있다.Then if there are nine symbols S0, S1 ... S8 with each occurrence frequency 5, 5, 6, 1, 2, 3, 16, 9, 9, they are shown in Figure 1 using the Huffman algorithm It can be encoded as a binary tree.

트리(10)는 H 레벨들로 배열된 내부 노드들(Fi) 및 리프(leaf) 노드들(Si)을 포함한다. 각 리프 노드는 두번째 최저 레벨상의 단일 내부 노드로부터 종속되고 심볼을 나타낸다. 각 내부 노드는 두번째 최저 레벨상의 단일 내부 노드로부터 종속된다. 노드의 레벨(L)은 루트 노드를 레벨 0으로 설정함으로써 정의되고 다른 노드들은 그것이 종속하는 노드의 레벨보다 하나 높은 레벨을 지닌다. 최고 레벨은 상기 허프만 트리의 높이(H)이다. 상기 심볼들(즉 T의 리프들)은 S0, S1, S2 ... S8로서 좌측에서 우측으로 표시된다.The tree 10 includes internal nodes Fi and leaf nodes Si arranged in H levels. Each leaf node is dependent from a single internal node on the second lowest level and represents a symbol. Each internal node is dependent from a single internal node on the second lowest level. The level L of a node is defined by setting the root node to level 0 and the other nodes have one level higher than the level of the node to which it depends. The highest level is the height H of the Huffman tree. The symbols (ie leaves of T) are represented from left to right as S0, S1, S2 ... S8.

도 1에 도시된 허프만 트리는 하기의 심볼들의 부호화를 초래한다.The Huffman tree shown in FIG. 1 results in the encoding of the following symbols.

심볼symbol 코드워드Codeword S0S0 000000 S1S1 001001 S2S2 010010 S3S3 0110001100 S4S4 0110101101 S5S5 01110111 S6S6 1010 S7S7 110110 S8S8 111111

그것의 가장 단순한 표시에 있어서, 높이가 H인 허프만 이진 트리는 상기 트리의 각 노드에 대해 한 워드를 사용하여 표시될 수 있다. 이러한 표시의 크기는 복호화중 탐색을 어렵게 한다.In its simplest representation, a Huffman binary tree of height H can be represented using one word for each node of the tree. The size of this representation makes searching difficult during decoding.

1995년 10월, 통신에 대한 IEEE 회보, 볼륨 43, 번호 10, 2576-, 하세미안(Hashemian)에 의한 "메모리 효율적 및 고속 탐색 허프만 부호화"는 허프만 트리를 표시하는데 필요한 저장 공간을 감소시키고 상기 트리를 사용하여 복호화 속도를 증가시킨다. 희박 단일-면 성장 허프만 트리가 생성되고 상기 허프만 트리는 각각 L 레벨들 떨어져 있는, 더 작고 덜 희박한 클러스터들(부트리들(sub-trees))로 분할된다. 각 클러스터가 노드로 표시되는, 슈퍼-트리(super-tree)가 구성된다. 슈퍼 테이블은 상기 슈퍼-트리를 지정한다. 그것은 각 노드에 대해, 상기 노드와 연관된 상기 클러스터의 길이 및 상기 클러스터에 대한 룩업 테이블의 주소를 지정한다. 상기 룩업 테이블에서 네거티브 엔트리는 상기 슈퍼-테이블 배후의 기준이다. 포지티브 엔트리는 심볼이 발견되었다는 것을 나타내고 상기 엔트리의 크기는 메모리내의 심볼의 위치, 상기 코드워드 및 상기 코드워드 길이를 제공한다.IEEE Memory for Communications, Volume 43, No. 10, 2576-, Hashemian, October 1995, "Memory Efficient and Fast Search Huffman Coding," reduces the storage space required to represent Huffman trees and reduces the tree size. Increase the decoding speed. A lean single-sided growth Huffman tree is created and the Huffman tree is divided into smaller and less lean clusters (sub-trees), each at L levels apart. A super-tree is constructed, where each cluster is represented by a node. Super table specifies the super-tree. It specifies, for each node, the length of the cluster associated with the node and the address of a lookup table for the cluster. The negative entry in the lookup table is the criterion behind the super-table. A positive entry indicates that a symbol was found and the size of the entry provides the location of the symbol in memory, the codeword and the codeword length.

정보 처리 레터(Inform Process Lett.) 69(1999) 119-122, 첸(Chen)에 의한 "메모리-효율적 및 고속 허프만 복호화 알고리즘"에서, 가중치(weight)가 상기 노드 아래의 완전한 트리내의 리프들의 수와 동일한 리프 노드에 제공된다. 그것은 상기 트리내의 노드의 레벨에 의존한다. 모든 리프 노드에는 그것 이전에 나타나는 모든 리프들의 누적 가중치와 동일한 수 및 그 자신의 가중치가 할당된다. 코드워드에는 그것이 트리상의 노드인 것처럼 동일한 누적 가중치가 제공된다. 하나가 동일한 누적 가중치와 일치하는지를 결정하기 위하여 실제 누적 가중치들이 탐색된다. 일치하는 것이 존재하고 일치하는 노드들의 가중치들이 동일한 경우, 상기 코드워드는 상기 트리의 리프 노드(즉 심볼)이다.Inform Process Lett. 69 (1999) 119-122, "Memory-Efficient and Fast Huffman Decoding Algorithm" by Chen, whose weight is the number of leaves in the complete tree below the node. Is provided on the same leaf node. It depends on the level of the node in the tree. Every leaf node is assigned the same number and its own weight as the cumulative weight of all the leaves appearing before it. The codeword is provided with the same cumulative weight as if it were a node on the tree. Actual cumulative weights are searched to determine if one matches the same cumulative weight. If there is a match and the weights of the matching nodes are the same, the codeword is a leaf node (ie a symbol) of the tree.

정보 처리 레터(Inform Process Lett.), 81 (2002), 305-308, 조드리 등(Chowdhury et al)의 "허프만 부호들을 위한 효율적인 복호화 기법"은 메모리 사용 및 탐색 속도를 개선하기 위하여 모든 리프들을 제거함으로써 허프만 트리를 절단한다.Inform Process Lett., 81 (2002), 305-308, Chowdhury et al, "Efficient Decryption Techniques for Huffman Codes," all leafs to improve memory usage and search speed. Cut the Huffman tree by removing it.

허프만 이진 트리의 대안적인 표시 및 이진 디지트들의 수신된 스트링을 복호화하기 위한 개선된 허프만 복호화 메커니즘을 제공하는 것이 바람직할 것이다.It would be desirable to provide an alternative representation of the Huffman binary tree and an improved Huffman decoding mechanism for decoding the received string of binary digits.

본 발명의 일 실시예에 의하면, 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하는 방법에 있어서,According to an embodiment of the present invention, in a method of decoding a bitstream encoded according to a Huffman coding tree having a height of H,

상기 비트스트림으로부터 H 비트들의 제1 코드워드를 추출하는 단계;Extracting a first codeword of H bits from the bitstream;

상기 코드워드를 제1 시프트 값만큼 시프트함으로써 상기 코드워드를 변경하는 단계;Changing the codeword by shifting the codeword by a first shift value;

적어도 하나의 제1 데이터 구조를 사용하여 관련된 제2 오프셋 값 및 관련된 제2 시프트 값을 지닌 제2 데이터 구조 또는 심볼을 식별하기 위하여 상기 변경된 코드워드를 사용하는 단계; 및Using the modified codeword to identify a second data structure or symbol having an associated second offset value and associated second shift value using at least one first data structure; And

제2 데이터 구조가 상기 제1 데이터 구조를 사용하여 식별되는 경우:If a second data structure is identified using the first data structure:

상기 제2 오프셋 값을 감산하고 그 결과를 상기 제2 시프트 값만큼 시프트함으로써 상기 코드워드를 변경하는 단계; 및Changing the codeword by subtracting the second offset value and shifting the result by the second shift value; And

상기 제2 데이터 구조를 사용하여 관련된 제3 오프셋 값 및 관련된 제3 시프트 값을 지닌 제3 데이터 구조 또는 심볼을 식별하기 위하여 상기 변경된 코드워드를 사용하는 단계를 포함하는 방법이 제공된다.A method is provided that includes using the modified codeword to identify a third data structure or symbol having an associated third offset value and an associated third shift value using the second data structure.

본 발명의 다른 실시예에 의하면, 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하는 방법에 있어서,According to another embodiment of the present invention, in a method of decoding a bitstream encoded according to a Huffman coding tree having a height of H,

상기 비트스트림으로부터 H 비트들의 코드워드를 추출하는 단계;Extracting a codeword of H bits from the bitstream;

상기 코드워드를 소정의 시프트 값만큼 시프트하는 단계; 및Shifting the codeword by a predetermined shift value; And

적어도 하나의 제1 데이터 구조를 사용하여 심볼을 식별하기 위하여 상기 변경된 코드워드를 사용하는 단계를 포함하는 방법이 제공된다.A method is provided that includes using the modified codeword to identify a symbol using at least one first data structure.

본 발명의 다른 실시예에 의하면, 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하기 위한 복호기에 있어서,According to another embodiment of the present invention, in a decoder for decoding a bitstream encoded according to a Huffman encoding tree having a height of H,

관련된 제1 오프셋 값 및 관련된 제1 시프트 값을 지닌 제1 데이터 구조 및 관련된 제2 오프셋 값 및 관련된 제2 시프트 값을 지닌 제2 데이터 구조를 적어도 포함하는 높이가 H인 허프만 부호화 트리를 나타내는 복수의 데이터 구조들을 저장하기 위한 메모리; 및A plurality of Huffman coding trees having a height of at least H comprising at least a first data structure having an associated first offset value and an associated first shift value and a second data structure having an associated second offset value and an associated second shift value; A memory for storing data structures; And

상기 비트스트림으로부터 획득된 H 비트들의 코드워드에서 현재의 오프셋 값을 감산하도록 동작가능하고, 그 결과를 상기 관련된 시프트 값만큼 시프트하도록 동작가능하며, 상기 결과를 사용하여 상기 관련된 데이터 구조를 어드레싱하도록 동작가능한 프로세서를 포함하는 복호기가 제공된다.Operable to subtract a current offset value from a codeword of H bits obtained from the bitstream, operable to shift the result by the associated shift value, and use the result to address the associated data structure A decoder is provided that includes a possible processor.

본 발명의 다른 실시예에 의하면, 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하는 방법에 있어서,According to another embodiment of the present invention, in a method of decoding a bitstream encoded according to a Huffman coding tree having a height of H,

상기 트리의 제1 레벨에서 각 가능한 노드에 대한 값을 포함하는 제1 데이터 구조를 저장하는 단계;Storing a first data structure containing a value for each possible node at the first level of the tree;

상기 트리의 제2의 하위 레벨에서 제1 부트리내의 각 가능한 노드에 대한 값을 포함하는 제2 데이터 구조를 저장하는 단계;Storing a second data structure containing a value for each possible node in a first booty at a second lower level of the tree;

상기 비트스트림으로부터 H 비트들의 제1 코드워드를 추출하는 단계;Extracting a first codeword of H bits from the bitstream;

상기 제1 코드워드의 값을 상기 트리의 제1 레벨에서 상기 트리내의 제1 노드 위치로 변환하는 단계;Converting the value of the first codeword to a first node location in the tree at a first level in the tree;

상기 제1 데이터 구조에 액세스하여 상기 제1 노드 위치에 대응하는 값을 획득하는 단계로서, 상기 값은 상기 제2 데이터 구조를 나타내는 단계;Accessing the first data structure to obtain a value corresponding to the first node location, the value representing the second data structure;

상기 제1 코드워드의 값을 상기 트리의 제2 레벨에서 상기 제1 부트리내의 제2 노드 위치로 변환하는 단계; 및Converting the value of the first codeword to a second node location in the first booty at a second level of the tree; And

상기 제2 데이터 구조에 액세스하여 상기 제2 노드 위치에 대응하는 값을 획득하는 단계를 포함하는 방법이 제공된다.Accessing the second data structure to obtain a value corresponding to the second node location.

본 발명의 다른 실시예에 의하면, 비트스트림으로부터 코드워드를 복호화하는 방법에 있어서,According to another embodiment of the present invention, in a method of decoding a codeword from a bitstream,

복수의 순서화된 데이터 구조들로서 허프만 트리의 표시를 수신하는 단계로서, 상기 복수의 순서화된 데이터 구조들은 상기 트리의 식별된 제1 레벨(L1)과 관련되며 각 엔트리가 상기 식별된 제1 레벨에서 완전한 트리의 노드에 대응하는 복수의 데이터 엔트리들을 포함하는 제1 데이터 구조 및 상기 트리의 식별된 제2 레벨(L2) 및 식별된 제1 부트리와 관련되며, 각 엔트리가 상기 제2 식별된 레벨에서, 완전한 경우, 상기 제1 부트리의 노드에 대응하는 복수의 데이터 엔트리들을 포함하는 적어도 하나의 제2 데이터 구조를 포함하는 단계;Receiving an indication of a Huffman tree as a plurality of ordered data structures, wherein the plurality of ordered data structures are associated with an identified first level L1 of the tree and each entry is complete at the identified first level. A first data structure comprising a plurality of data entries corresponding to nodes of a tree and an identified second level L2 of the tree and an identified first booty, wherein each entry is at the second identified level And, if complete, including at least one second data structure comprising a plurality of data entries corresponding to the node of the first booty;

허프만 트리에서 제1 레벨(L1)에 대한 값을 획득하는 단계;Obtaining a value for a first level L1 in the Huffman tree;

코드워드의 제1 L1 비트들에 대응하는, 완전한 경우, 상기 트리의 상기 제1 레벨(L1)에서 상기 노드를 식별하는 단계;Identifying the node at the first level (L1) of the tree, corresponding to the first L1 bits of a codeword, in a complete case;

상기 식별된 노드가 내부 노드인 경우 추가 데이터 구조를 식별하고 그렇지 않은 경우 심볼을 식별하는, 상기 식별된 노드에 대한 데이터 엔트리를 상기 제1 데이터 구조로부터 획득하는 단계; 및Obtaining a data entry for the identified node from the first data structure, identifying an additional data structure if the identified node is an internal node and otherwise identifying a symbol; And

상기 식별된 노드가 내부 노드인 경우:If the identified node is an internal node:

상기 제1 레벨(L1)보다 더 높은 레벨인, 허프만 트리에서 제2 레벨(L2)에 대한 값을 획득하는 단계;Obtaining a value for a second level (L2) in the Huffman tree, which is a level higher than the first level (L1);

제1 부트리를 식별하는 값을 획득하는 단계;Obtaining a value identifying the first booty;

수신된 비트스트림의 제1 L2 비트들에 대응하는, 완전한 경우, 상기 제1 부트리의 제2 레벨(L2)에서 상기 노드를 식별하는 단계;Identifying the node at the second level (L2) of the first booty, in a complete case, corresponding to the first L2 bits of the received bitstream;

상기 식별된 노드가 내부 노드인 경우 추가 데이터 구조를 식별하고 그렇지 않은 경우 심볼을 식별하는, 상기 식별된 노드에 대한 데이터 엔트리를 추가 데이터 구조로부터 획득하는 단계를 포함하는 방법이 제공된다.Obtaining a data entry for the identified node from the additional data structure that identifies an additional data structure if the identified node is an internal node and otherwise identifies a symbol.

본 발명의 다른 실시예에 의하면, H 레벨들에 배열된 내부 노드들 및 리프(leaf) 노드들을 포함하는 허프만 부호화 트리를 나타내는 데이터로서, 각 리프 노드는 두번째 최저 레벨상의 단일 내부 노드로부터 종속되고 상기 각 리프 노드는 심볼을 나타내며 각 내부 노드는 상기 두번째 최저 레벨상의 단일 내부 노드로부터 종속되는 데이터에 있어서, 상기 데이터는,According to another embodiment of the invention, data representing a Huffman coding tree comprising leaf nodes and inner nodes arranged at H levels, each leaf node being dependent from a single inner node on the second lowest level and Wherein each leaf node represents a symbol and each internal node is dependent on a single internal node on the second lowest level, the data being:

상기 트리의 제1 특정 레벨내의 노드들 각각에 대해, 제1 내부 노드에 대한 제2 데이터 구조를 포함하여, 각 리프 노드에 대한 심볼 및 각 내부 노드에 대한 추가 데이터 구조를 식별하는 제1 데이터 구조;For each of the nodes within the first specific level of the tree, a first data structure identifying a symbol for each leaf node and an additional data structure for each inner node, including a second data structure for a first inner node. ;

상기 제1 데이터 구조에 의해 식별된 적어도 하나의 제2 데이터 구조로서, 상기 제1 내부 노드로부터 종속되고, 상기 트리의 제2 특정 레벨에 있는, 부트리내의 노드들 각각에 대해, 만일 있다면 각 리프 노드에 대한 심볼 및 내부 노드에 대한 추가 데이터 구조를 식별하는 적어도 하나의 제2 데이터 구조; 및At least one second data structure identified by the first data structure, for each of the nodes in the bootee, dependent from the first internal node and at a second particular level of the tree, if any At least one second data structure identifying a symbol for the node and an additional data structure for an internal node; And

적어도 상기 제1 레벨, 상기 제2 레벨 및 상기 제1 내부 노드를 지정하는 데이터를 포함하는 데이터가 제공된다.Data is provided that includes at least the first level, the second level, and data specifying the first internal node.

본 발명의 다른 실시예에 의하면, 허프만 이진 트리를 나타내는 방법에 있어서,According to another embodiment of the present invention, in a method for representing a Huffman binary tree,

상기 트리의 식별된 제1 레벨(L1)과 연관되며 복수의 엔트리들을 포함하는 제1 데이터 구조를 생성하는 단계로서, 각 엔트리는 상기 식별된 제1 레벨에서 완전한 트리의 노드에 대응하고 상기 노드가 내부 노드인 경우 추가 데이터 구조를 식별하며 그렇지 않은 경우 심볼을 식별하는 단계; 및Generating a first data structure associated with the identified first level L1 of the tree and comprising a plurality of entries, each entry corresponding to a node of a complete tree at the identified first level, wherein the node is Identifying an additional data structure if it is an internal node, otherwise identifying a symbol; And

상기 트리의 식별된 제2 레벨(L2)과 연관되고 식별된 제1 부트리와 연관되며 복수의 데이터 엔트리들을 포함하는 적어도 하나의 추가 데이터 구조를 생성하는 단계로서, 각 엔트리는 상기 제2 식별된 레벨(L2)에서 완전한 경우 상기 제1 부트리의 노드에 대응하고 상기 노드가 내부 노드인 경우 추가 데이터 구조를 식별하며 그렇지 않은 경우 심볼을 식별하는 단계를 포함하는 방법이 제공된다.Generating at least one additional data structure associated with the identified second level (L2) of the tree and associated with the identified first booty and comprising a plurality of data entries, each entry identified by the second identified A method is provided that corresponds to a node of the first booty if complete at level L2 and identifies an additional data structure if the node is an internal node and otherwise identifies a symbol.

본 발명의 실시예들과 관련된 하나의 이점은 상기 기술이 코드워드들의 발생 확률을 이용한다는 것이다. 더 빈번히 발생하는 코드워드들은 먼저 복호화될 것이다.One advantage associated with embodiments of the present invention is that the technique uses the probability of occurrence of codewords. Codewords that occur more frequently will be decoded first.

본 발명의 실시예들과 관련된 다른 이점은 복호화와 관련된 낮은 처리 오버헤드인데, 각 복호화 반복에서 최대 하나의 감산, 하나의 시프트 및 하나의 비교만이 존재한다. 따라서 상기 복호화는 디지털 신호 처리기(DSP)에서 매우 효율적으로 구현될 수 있다.Another advantage associated with embodiments of the present invention is the low processing overhead associated with decryption, where there is at most one subtraction, one shift and one comparison at each decryption iteration. Therefore, the decoding can be implemented very efficiently in a digital signal processor (DSP).

본 발명의 실시예들과 관련된 다른 이점은 최대 탐색이 log2 N 미만이 되도록 설계될 수 있다는 것이다.Another advantage associated with embodiments of the present invention is that the maximum search can be designed to be less than log 2 N.

본 발명의 실시예들의 더 나은 이해를 위하여 그리고 본 발명의 실시예들이 실시될 수 있는 방법을 이해하기 위하여, 이제 첨부한 도면들만이 예로서 참조될 것이다.For a better understanding of the embodiments of the invention and to understand how embodiments of the invention may be practiced, only the accompanying drawings will now be referred to by way of example.

도 1은 허프만 이진 트리를 도시한 것이다.1 illustrates a Huffman binary tree.

도 2는 부호기 및/또는 복호기로서 사용가능한 장치를 도시한 것이다.2 shows a device usable as an encoder and / or a decoder.

도 3은 복호화 프로세스를 도시한 것이다.3 shows a decryption process.

도 4는 다른 허프만 트리를 도시한 것이다.4 shows another Huffman tree.

부호화encoding

본 예에서, 다음의 각 발생 빈도들 5, 5, 6, 1, 2, 3, 16, 9, 9를 지닌 9개의 심볼들 S0, S1, ..., S8이 존재한다고 하자. 그들은 상기 허프만 알고리즘을 사용하여 도 1에 도시된 이진 트리로 부호화될 수 있다.In this example, assume that there are nine symbols S0, S1, ..., S8 with each of the following occurrence frequencies 5, 5, 6, 1, 2, 3, 16, 9, 9. They can be encoded into the binary tree shown in FIG. 1 using the Huffman algorithm.

이러한 허프만 트리는 하기의 룩업 테이블들(표 2, 표 3 및 표 4)에서 하기 에 정의된 바와 같이 순서화된 데이터 구조들의 시퀀스로서 표시될 수 있다.This Huffman tree can be represented as a sequence of ordered data structures as defined below in the lookup tables (Tables 2, 3 and 4) below.

룩업 테이블Lookup table Offset_valueOffset_value Shift_valueShift_value 서브-테이블Sub-table 룩업 테이블 0Lookup Table 0 00 22 00 룩업 테이블 1Lookup Table 1 1212 00 1One

서브-테이블 0Sub-table 0 yy 00 1One 22 33 44 55 66 77 symbol_locatesymbol_locate ->S0-> S0 ->S1-> S1 ->S2-> S2 ->서브-테이블 1-> Sub-Table 1 ->S6-> S6 ->S6-> S6 ->S7-> S7 ->S8-> S8

서브 테이블 1Subtable 1 yy 00 1One 22 33 symbol locatesymbol locate ->S3-> S3 ->S4-> S4 ->S5-> S5 ->S5-> S5

상기 제1 데이터 구조(표 2)는 제1 룩업 테이블이다. 그것은 각 식별된 서브-테이블을 가지고 사용될 offset_value 및 shift_value 쌍을 식별한다. 본 예에서, 그것은 0 오프셋 및 2인 shift_value가 서브-테이블 0(표 3)을 가지고 사용되어야 하고 12인 offset_value 및 0인 shift_value가 서브-테이블 1(표 4)을 가지고 사용되어야 한다는 것을 나타낸다.The first data structure (Table 2) is a first lookup table. It identifies the offset_value and shift_value pairs to be used with each identified sub-table. In this example, it indicates that shift_value of 0 offset and 2 should be used with sub-table 0 (Table 3) and offset_value of 12 and shift_value of 0 should be used with sub-table 1 (Table 4).

상기 제2 데이터 구조(표 3)는 룩업 테이블이다. 그것은 값 y를 사용하여 어드레싱되고 회답으로 symbol_locate에 대한 값을 제공한다. 상기 symbol_locate에 대한 값은 심볼 값을 지시하거나 다른 룩업 테이블을 지시할 수 있다. 예를 들어, 0, 1, 2, 4, 5, 6, 7과 동일한 y에 대한 값들은 각각 심볼들 S0, S1, S2, S6, S6, S7, S8을 지시하고 3과 동일한 y에 대한 값은 서브-테이블 1(표 4)을 지시한다.The second data structure (Table 3) is a lookup table. It is addressed using the value y and in return provides a value for symbol_locate. The value for symbol_locate may indicate a symbol value or another lookup table. For example, values for y equal to 0, 1, 2, 4, 5, 6, 7 indicate symbols S0, S1, S2, S6, S6, S7, S8 and values for y equal to 3, respectively. Indicates sub-table 1 (Table 4).

상기 제3 데이터 구조(표 4)는 룩업 테이블이다. 그것은 값 y를 사용하여 어드레싱되고 회답으로 symbol_locate에 대한 값을 제공한다. symbol_locate에 대한 값은 심볼 값을 지시하거나 다른 룩업 테이블을 지시할 수 있다. 본 예에서 0, 1, 2, 3과 동일한 y에 대한 값들은 각각 심볼들 S3, S4 S5, S5를 지시한다.The third data structure (Table 4) is a lookup table. It is addressed using the value y and in return provides a value for symbol_locate. The value for symbol_locate may indicate a symbol value or another lookup table. In this example, values for y equal to 0, 1, 2, 3 indicate symbols S3, S4 S5, S5, respectively.

상기 8-비트 symbol_locate는 그것의 최상위 비트(MSB)가 심볼(MSB=0)에 대한 포인터인지 또는 다른 룩업 테이블(MSB=1)에 대한 포인터인지를 식별하도록 포맷될 수 있다. 비트들 1-7은 정확한 심볼 또는 룩업 테이블의 주소를 제공한다. 예를 들어, y=3에서 서브-테이블 0내의 symbol_locate의 값은 서브-테이블 1을 지시하는 1000 0001일 것이다. y=1에서 서브-테이블 0내의 symbol_locate의 값은 하기에 표 5에 따라 심볼 S0을 나타내는 0000 0000일 것이다.The 8-bit symbol_locate may be formatted to identify whether its most significant bit (MSB) is a pointer to a symbol (MSB = 0) or another lookup table (MSB = 1). Bits 1-7 provide the address of the correct symbol or lookup table. For example, the value of symbol_locate in sub-table 0 at y = 3 would be 1000 0001 indicating sub-table 1. The value of symbol_locate in sub-table 0 at y = 1 will be 0000 0000 representing symbol S0 according to Table 5 below.

symbol locatesymbol locate 심볼symbol 0000 00000000 0000 S0S0 0000 00010000 0001 S1S1 0000 00100000 0010 S2S2 0000 00110000 0011 S3S3 0000 01000000 0100 S4S4 0000 01010000 0101 S5S5 0000 01100000 0110 S6S6 0000 01110000 0111 S7S7 0000 10000000 1000 S8S8

상기 설명된 데이터 구조들의 생성이 이제 설명될 것이다. 표 6은 상기 데이터 구조들을 생성하는데 사용되는 방법론을 도시한 것이다.The generation of the data structures described above will now be described. Table 6 shows the methodology used to generate the data structures.

표 6에서, 컬럼 1은 i=0, 1, 2 ... N-1에 대해 심볼들 Si를 순서대로 열거한 것이다. 컬럼 2는 각 심볼에 인접하여 그것의 코드워드들을 열거한 것이다. 컬럼 3은 각 코드워드에 대한 카운트 값 CountSi을 제공한다.In Table 6, column 1 lists the symbols Si in order for i = 0, 1, 2... Column 2 lists its codewords adjacent to each symbol. Column 3 provides a count value Count Si for each codeword.

CountSi는 심볼 Si에 대한 코드워드가 길이 H를 가질 때까지 심볼 Si에 대한 코드워드에 1들을 부가함으로써 획득된 비트들의 시퀀스의 값이다. 예를 들어, S0에 대한 카운트 값은 00011(2+1)의 값이고, S2에 대한 카운트 값은 01011(8+2+1)의 값이다. 대안적으로 상기 카운트 값 CountSi가 [(V+1)*2^(H-Li)]-1로서, 값 V의 코드워드 및 레벨 Li를 차지하는 각 심볼 Si에 대해 계산될 수 있다. 예를 들어 S3{01100}에 대해, V=12 & L=0 및 count=[(12+1)*(2^0)]-1이고 S8{111}에 대해, V=7 & L=2, 및 count=[(7+1)*(2^2)]-1=31이다.Count Si is the value of the sequence of bits obtained by adding 1s to the codeword for symbol Si until the codeword for symbol Si has a length H. For example, the count value for S0 is a value of 00011 (2 + 1), and the count value for S2 is a value of 01011 (8 + 2 + 1). Alternatively, the count value Count Si may be calculated for each symbol Si occupying the codeword and level L i of the value V, as [(V + 1) * 2 ^ (HL i )] − 1. For example, for S3 {01100} V = 12 & L = 0 and count = [(12 + 1) * (2 ^ 0)]-1 and for S8 {111} V = 7 & L = 2 , And count = [(7 + 1) * (2 ^ 2)]-1 = 31.

컬럼 4는 각 심볼에 대한 인수를 제공한다. 이것은 countS-1=-1인 경우, countSi-countSi-1로서, 심볼 Si에 대해 계산된다. 그것은 대안적으로 레벨 Li에서 심볼 Si에 대해, 2^(H-Li)로서 계산될 수 있다.Column 4 provides an argument for each symbol. This is calculated for symbol Si as count Si −count Si −1 when count S −1 = −1. It can alternatively be calculated as 2 ^ (HL i ), for the symbol Si at level Li.

컬럼 5는 각 심볼에 대한 '시프트(shift)'를 제공한다. 그것은 상기 심볼의 인수의 기수 2에 대한 대수이다. 상기 시프트는 대안적으로 Li로서 각 심볼 Si에 대해 계산될 수 있다.Column 5 provides a 'shift' for each symbol. It is the logarithm to base 2 of the argument of the symbol. The shift can alternatively be calculated for each symbol Si as L i .

1One 22 33 44 55 66 77 88 99 SiSi 코드워드Codeword CountSi Count si 인수 2^(H-Li)Argument 2 ^ (HL i ) 시프트 H-Li Shift HL i y=(x-0)>>2y = (x-0) >> 2 y=(x-12)>>0y = (x-12) >> 0 S-1S-1 -1-One S0S0 000000 3 (011)3 (011) 44 22 0 (0)0 (0) -- S1S1 001001 7 (111)7 (111) 44 22 1 (1)1 (1) -- S2S2 010010 11 (1011)11 (1011) 44 22 2 (10)2 (10) -- S3S3 0110001100 12 (1100)12 (1100) 1One 00 3 (11)3 (11) 00 S4S4 0110101101 13 (1101)13 (1101) 1One 00 3 (11)3 (11) 1One S5S5 01110111 15 (1111)15 (1111) 22 1One 3 (11)3 (11) 33 S6S6 1010 23 (10111)23 (10111) 88 33 5 (101)5 (101) -- S7S7 110110 27 (11011)27 (11011) 44 22 6 (110)6 (110) -- S8S8 111111 31 (11111)31 (11111) 44 22 7 (111)7 (111) --

수학식 1은 상기 제2 및 제3 데이터 구조들(표 3 및 표 4)에 대한 콘텐트를 제공하는, 컬럼 6 및 7내의 값들을 계산하는데 사용된다.Equation 1 is used to calculate the values in columns 6 and 7 which provide the content for the second and third data structures (Tables 3 and 4).

y = (x-offset_value)>>(shift_value)y = (x-offset_value) >> (shift_value)

상기에서 x는 코드워드의 값이고, offset_value는 0 보다 크거나 같은 정수이며, shift_value는 0보다 크거나 같은 정수이다. 상기 연산자 ">>"는 상기 값 (x-offset_value)이 shift_value에 의해, 그것의 최하위 비트들의 shift_value를 잃도록, 절단되어야 한다는 것을 나타낸다. 상기 좌측으로의 시프트는 2^shift_value로 나누는 연산과 동일하지만, 그것은 디지털 신호 처리기(DSP)에 의해 용이하게 수행된다.X is a codeword value, offset_value is an integer greater than or equal to 0, and shift_value is an integer greater than or equal to 0. The operator " >> " indicates that the value (x-offset_value) should be truncated by shift_value to lose its least significant shift_value. The shift to the left is equivalent to the division by 2 ^ shift_value, but it is easily performed by the digital signal processor DSP.

컬럼 6, 즉 상기 제2 데이터 구조(표 3)에 대해 상기 offset_value는 0으로 설정되고 상기 shift_value는 2로 설정된다. 상기 수학식 y=(x-0)>>2는 서브-테이블 0(표 3)내의 y 값들에 대응하는, 컬럼 6내의 엔트리들 각각을 계산하는데 사용된다. 상기 심볼들 S3, S4 및 S5는 공통 y 값을 공유한다. 추가 서브-테이블은 상 기 심볼들에 대해 사용된다.The offset_value is set to 0 and the shift_value is set to 2 for column 6, that is, the second data structure (Table 3). The equation y = (x-0) >> 2 is used to calculate each of the entries in column 6, corresponding to the y values in sub-table 0 (Table 3). The symbols S3, S4 and S5 share a common y value. An additional sub-table is used for the symbols.

컬럼 7, 즉 상기 제3 데이터 구조(표 4)에 대해 상기 offset_value는 12이고 상기 shift_value는 0으로 설정된다. 상기 수학식 y=(x-12)>>0은 서브-테이블 1(표 4)내의 y 값들에 대응하는, 해결되지 않은 심볼들 S3, S4 및 S5에 대해 컬럼 7내의 엔트리들 각각을 계산하는데 사용된다.For column 7, ie the third data structure (Table 4), the offset_value is 12 and the shift_value is set to zero. Equation y = (x-12) >> 0 calculates each of the entries in column 7 for unresolved symbols S3, S4 and S5 corresponding to y values in sub-table 1 (Table 4) Used.

따라서, 상기 서브-테이블 0은 상기 트리의 상단으로부터 제거된 shift_value 레벨들인, 레벨 Li, 즉 Li=H-shift_value에서 도 1의 허프만 이진 트리내의 노드들을 나타낸다.Thus, the sub-table 0 represents nodes in the Huffman binary tree of FIG. 1 at level Li, i.e. Li = H-shift_value, which are shift_value levels removed from the top of the tree.

L=3에서의 노드들은 순서대로 S0, S1, S2, F2, 비어있음, 비어있음, S7, S8이다. 상기 비어있는 노드들은 심볼 S6와 연관된 리프 노드로부터 종속될 것이다. 그러므로 상기 심볼 S6은 상기 종속하는 비어있는 노드들에 배치된다. L=3에서의 노드들은 S0, S1, S2, F2, S6, S7, S8로서 재작성될 수 있다. 이것은 서브-테이블 0내의 엔트리들의 콘텐트에 대응한다.The nodes at L = 3 are S0, S1, S2, F2, empty, empty, S7, S8. The empty nodes will be dependent from the leaf node associated with symbol S6. Therefore, the symbol S6 is placed in the dependent empty nodes. Nodes at L = 3 may be rewritten as S0, S1, S2, F2, S6, S7, S8. This corresponds to the content of the entries in sub-table zero.

상기 내부 노드 F2는 부트리의 루트이다. 상기 서브-테이블 1은 상기 부트리를 나타낸다. F2로부터 종속되는 어떤 리프 노드들의 카운트 값도 12와 15 사이의 값들을 가질 것이다. 상기 코드워드들의 카운트 값들은 12, 서브-테이블 1에 대한 오프셋 값을 감산함으로써 재정규화된다.The internal node F2 is the root of Booty. The sub-table 1 represents the booties. The count value of any leaf nodes dependent from F2 will have values between 12 and 15. The count values of the codewords are renormalized by subtracting the offset value for 12, sub-table 1.

상기 서브-테이블 1은 H-shift_value과 동일한 허프만 이진 트리내의 레벨 L에서 서브-트리의 노드들을 나타낸다. 서브-테이블 1에 대한 shift_value는 상기 서브-트리에 대해 0이어서 L=5이다.The sub-table 1 represents the nodes of the sub-tree at level L in the Huffman binary tree equal to H-shift_value. Shift_value for sub-table 1 is 0 for the sub-tree, so L = 5.

L=5에서의 노드들은 순서대로 S3, S4, 비어있음, 비어있음이다. 상기 비어있는 노드들은 심볼 S5와 연관된 리프 노드로부터 종속될 것이다. 그러므로 상기 심볼 S5는 종속하는 비어있는 노드들내에 배치된다. L=5에서의 노드들은 S3, S4, S5, S5로서 재작성될 수 있다. 이것은 서브-테이블 1내의 엔트리들의 콘텐트에 대응한다.Nodes at L = 5 are S3, S4, empty, empty in order. The empty nodes will be dependent from the leaf node associated with symbol S5. The symbol S5 is therefore placed in the dependent empty nodes. Nodes at L = 5 may be rewritten as S3, S4, S5, S5. This corresponds to the content of entries in sub-table 1.

그러므로 도 1내의 허프만 트리는 레벨 L=3에서 상기 트리를 나타내는 제1 데이터 구조, 서브-테이블 0 및 레벨 L=5에서 서브-트리를 나타내는, 제2 데이터 구조, 서브-테이블 1로 표시된다.Huffman tree in FIG. 1 is therefore represented by a first data structure representing the tree at level L = 3, a second data structure representing sub-tree at sub-table 0 and a level L = 5, sub-table 1.

상기 트리를 섹션화하는 것은 가장 유망한 심볼들이 효율적인 방법으로 먼저 발견되도록 허용하기 위해 필요하다. 하지만, 너무 많은 섹션들의 도입은 부가적인 서브-테이블과 부가적인 시프트 및 오프셋 값들을 저장하기 위하여 부가적인 메모리를 사용하고 덜 공통적으로 발생하는 심볼들을 복호화하는 부가적인 처리 단계들을 필요로 한다.Sectioning the tree is necessary to allow the most promising symbols to be found first in an efficient manner. However, the introduction of too many sections requires additional processing steps to use additional memory to store additional sub-tables and additional shift and offset values and to decode less commonly occurring symbols.

예를 들어, L=3 및 L=5보다는 다른 레벨들에서 상기 허프만 트리를 섹션화함으로써 상기 허프만 트리를 표시하는 것이 가능하다. 예를 들어, 상기 트리가 L=3, L=4 및 L=5에서 섹션화되는 경우, 3개의 서브-테이블들이 존재할 것이다. L=4에 대한 상기 서브-테이블의 제1 엔트리는 L=5에 대한 서브-테이블을 참조할 것이고 상기 제2 엔트리는 S5를 참조할 것이다. L=5에 대한 서브-테이블의 제1 엔트리는 S3을 참조할 것이고 상기 제2 엔트리는 S4를 참조할 것이다. 상기 서브-테이블 양자에 대한 오프셋은 12이다. L=4에 대한 서브-테이블에 대한 시프트는 1이고 L=5에 대한 서브-테이블에 대한 시프트는 0이다.For example, it is possible to indicate the Huffman tree by sectioning the Huffman tree at levels other than L = 3 and L = 5. For example, if the tree is sectioned at L = 3, L = 4 and L = 5, there will be three sub-tables. The first entry of the sub-table for L = 4 will refer to the sub-table for L = 5 and the second entry will refer to S5. The first entry of the sub-table for L = 5 will refer to S3 and the second entry will refer to S4. The offset for both the sub-tables is 12. The shift for the sub-table for L = 4 is 1 and the shift for the sub-table for L = 5 is 0.

표 2, 표 3, 표 4 및 표 5의 데이터 구조들을 제공하는 도 1의 허프만 트리의 섹션화를 위해 하기 사항이 언급되어야 한다.The following should be mentioned for the sectioning of the Huffman tree of FIG. 1 which provides the data structures of Tables 2, 3, 4 and 5.

트리의 레벨 L을 나타내는 (즉 L에서 섹션화된 트리) 데이터 구조는 H-L과 동일한 시프트 값을 갖는다. 상기 노드 N이 코드워드 값 V를 지니고 레벨 L에 있는 경우, 상기 트리내의 노드 N으로부터 참조된 데이터 구조는 offset_value V*2^(H-L)을 갖는다.The data structure representing the level L of the tree (ie the tree sectioned in L) has the same shift value as H-L. If the node N has a codeword value V and is at level L, the data structure referenced from node N in the tree has offset_value V * 2 ^ (H-L).

상기 서브-테이블 0에 대해, 상기 shift_value는 H-L*와 동일하게 설정되는데, L*는 상기 트리가 섹션화되는 레벨이다. 여기에서 그것은 다수의 리프들이 나타나는 최저 레벨이다. 도 1에서 L=2에서 하나의 리프가 존재하지만, L=3에서 다수의 리프들이 존재한다. 그러므로 상기 트리는 L=3에서 섹션화되고 상기 shift_value=2이다. 상기 offset_value는 0이다.For the sub-table 0, the shift_value is set equal to H-L *, where L * is the level at which the tree is sectioned. Here it is the lowest level at which multiple leaves appear. In Figure 1 there is one leaf at L = 2, but there are multiple leaves at L = 3. Therefore the tree is sectioned at L = 3 and the shift_value = 2. The offset_value is zero.

예를 들어, 상기 서브-테이블 1은 L=3에서 노드 {011}을 통해 참조된다. 그러므로, V=3이고 상기 서브-테이블 1에 대한 offset_value는 3*2^2이다. 상기 서브-테이블 1에 대한 시프트 값은 H-L*과 동일하게 설정되는데, L*는 상기 트리가 섹션화되는 레벨이다. 여기에서, 그것은 다수의 리프들이 상기 서브-트리에 나타나는 최저 레벨이다. 도 1에서, 상기 서브-트리는 레벨 L=3에서 그것의 루트로서 F2를 지닌다. 상기 서브-트리는 L=4에서 하나의 리프를 가지지만, L=5에서 두개의 리프들을 갖는다. 그러므로 상기 트리는 L=5에서 섹션화되고 shift_value=0이다.For example, the sub-table 1 is referenced via node {011} at L = 3. Therefore, V = 3 and the offset_value for the sub-table 1 is 3 * 2 ^ 2. The shift value for the sub-table 1 is set equal to H-L *, where L * is the level at which the tree is sectioned. Here, it is the lowest level at which multiple leaves appear in the sub-tree. In FIG. 1, the sub-tree has F2 as its root at level L = 3. The sub-tree has one leaf at L = 4, but has two leaves at L = 5. Thus the tree is sectioned at L = 5 and shift_value = 0.

도 2는 부호기로서 동작가능한 장치(20)를 도시한 것이다. 상기 부호기 장치 는 프로세서(22) 및 메모리(24)를 포함한다. 상기 메모리(24)는 상기에 설명된 부호화 프로세스를 수행하도록 상기 프로세서(22)를 제어하는 컴퓨터 프로그램 명령들을 저장한다.2 shows a device 20 operable as an encoder. The encoder device includes a processor 22 and a memory 24. The memory 24 stores computer program instructions for controlling the processor 22 to perform the encoding process described above.

상기 컴퓨터 프로그램 명령들은 상기 명령들이 구현되는 적합한 저장 매체를 통해 상기 메모리로 전송될 수 있거나 그들은 상기 명령들을 구현하는 전기 신호들을 통해 전송될 수 있다.The computer program instructions may be sent to the memory via a suitable storage medium on which the instructions are implemented or they may be sent via electrical signals implementing the instructions.

상기 프로세서(22)는 부호화를 위한 데이터를 수신하기 위한 입력(21)을 구비하고 부호화된 데이터를 제공하기 위한 출력(23)을 구비한다. 상기 부호화된 데이터는 허프만 트리를 나타내는 복수의 데이터 구조들 및 상기 트리의 높이 H에 대한 값을 포함한다.The processor 22 has an input 21 for receiving data for encoding and an output 23 for providing the encoded data. The encoded data includes a plurality of data structures representing a Huffman tree and a value for the height H of the tree.

복호화Decrypt

도 2는 복호기로서 동작가능한 장치(20)를 도시한 것이다. 상기 복호기는 프로세서(22) 및 메모리(24)를 포함한다. 상기 메모리는 상기에 설명된 바와 같은 허프만 트리를 나타내는 데이터 구조들을 저장한다. 예를 들어 상기 메모리(24)는 상기에 표 2, 표 3, 표 4 및 표 5에 도시된 것들에 대응하는 표들을 저장할 수 있다. 상기 메모리는 또한 도 3을 참조하여 하기에 설명되는 복호화 프로세스를 수행하도록 상기 프로세서(22)를 제어하는 컴퓨터 프로그램 명령들을 저장한다.2 shows a device 20 operable as a decoder. The decoder includes a processor 22 and a memory 24. The memory stores data structures representing the Huffman tree as described above. For example, the memory 24 may store tables corresponding to those shown in Tables 2, 3, 4, and 5 above. The memory also stores computer program instructions for controlling the processor 22 to perform the decryption process described below with reference to FIG.

상기 컴퓨터 프로그램 명령들은 상기 명령들이 구현되는 적합한 저장 매체를 통해 상기 메모리로 전송될 수 있거나 그들은 상기 명령들을 구현하는 전기 신호들을 통해 전송될 수 있다.The computer program instructions may be sent to the memory via a suitable storage medium on which the instructions are implemented or they may be sent via electrical signals implementing the instructions.

상기 프로세서(22)는 복호화를 위한 데이터를 수신하기 위한 입력(21)을 구비하고 복호화된 데이터를 제공하기 위한 출력(23)을 구비한다. 상기 허프만 트리의 높이는 상기 복호기에서 알려져 있다. 이것은 복호화를 위한 데이터가 제공되는 헤더에서 상기 복호기로 전달될 수 있다.The processor 22 has an input 21 for receiving data for decoding and an output 23 for providing the decrypted data. The height of the Huffman tree is known in the decoder. This may be passed to the decoder in a header for which data for decoding is provided.

상기 복호기는 도 3에 도시된 바와 같이 다음 단계들을 수행한다.The decoder performs the following steps as shown in FIG.

단계 100에서 현재의 서브-테이블 식별자 z가 0으로 설정된다.In step 100 the current sub-table identifier z is set to zero.

그다음 단계 102에서, H 비트들이 값 x를 지닌, 비트스트림으로부터 추출된다.Then in step 102, the H bits are extracted from the bitstream, having the value x.

그다음 단계 104에서, 룩업 테이블이 액세스된다. 서브-테이블 z에 대한 offset_value 및 shift_value가 획득된다.Then in step 104, the lookup table is accessed. The offset_value and shift_value for sub-table z are obtained.

그다음 단계 106에서, x 및 현재의 서브-테이블에 대한 offset_value 및 shift_value의 획득된 값들을 사용하여 수학식 1로부터 현재의 서브-테이블에 대한 y 값을 계산한다.Next, in step 106, calculate the y value for the current sub-table from Equation 1 using x and the obtained values of offset_value and shift_value for the current sub-table.

그다음 단계 108에서, 현재의 서브-테이블, 서브-테이블 z에 액세스한다. 상기 계산된 y 값들에 대응하는 서브-테이블 z로부터 symbol_locate를 획득한다.In step 108, the current sub-table, sub-table z, is accessed. Obtain symbol_locate from the sub-table z corresponding to the calculated y values.

그다음 단계 110에서, 상기 획득된 symbol_locate의 MSB에 대해 비교가 수행된다. 상기 획득된 symbol_locate의 MSB가 0인 경우 상기 프로세스는 단계 114로 점프한다. 상기 획득된 symbol_locate의 MSB가 1인 경우 상기 프로세스는 단계 112로 점프한다.Next, in step 110, a comparison is performed on the MSB of the obtained symbol_locate. If the MSB of the obtained symbol_locate is zero, the process jumps to step 114. If the MSB of the obtained symbol_locate is 1, the process jumps to step 112.

단계 112에서, 상기 현재의 서브-테이블 식별자 z가 단계 108에서 획득된 상 기 symbol_locate의 나머지 최하위 비트들과 동일하게 설정된다. 그다음 상기 프로세스는 단계 104로 복귀한다.In step 112, the current sub-table identifier z is set equal to the remaining least significant bits of the symbol_locate obtained in step 108. The process then returns to step 104.

단계 114에서, 상기 symbol_locate에 대응하는 심볼이 단계 108에서 획득된다.In step 114, a symbol corresponding to symbol_locate is obtained in step 108.

이제 도시된 프로세스의 예가 상기 제공된 예시적인 룩업 테이블들(표 2, 표 3, 표 4 및 표 5)을 사용하여 제공될 것이다. 탐색될 코드워드는 {0,1,1,1}이다. 추출된 비트들을 {0,1,1,1,0}이라 하자.An example of the process shown will now be provided using the example lookup tables provided above (Tables 2, 3, 4 and 5). The codeword to be searched for is {0,1,1,1}. Let the extracted bits be {0,1,1,1,0}.

단계 100에서, 현재의 서브-테이블 표시자 z=0으로 설정한다.In step 100, set the current sub-table indicator z = 0.

단계 102에서, 비트들 {0,1,1,1,0}을 추출한다. 그러므로 x=14이다.In step 102, bits {0,1,1,1,0} are extracted. Therefore x = 14.

단계 104에서, 룩업 테이블(표 2)에 액세스한다. 서브-테이블 0에 대한 offset_value=0이고 서브-테이블 0에 대한 shift_value=2이다.In step 104, the lookup table (Table 2) is accessed. Offset_value = 0 for sub-table 0 and shift_value = 2 for sub-table 0.

단계 106에서, 수학식 1을 사용하여 y를 계산한다.In step 106, y is calculated using Equation 1.

y=(x-0)>>2=3y = (x-0) >> 2 = 3

단계 108에서, 현재의 서브-테이블, 서브-테이블 0(표 3)에 액세스한다. 계산된 y 값에 대응하는 서브-테이블 0으로부터 symbol_locate를 획득한다. 상기 symbol_locate는 {1000 0001}이다.In step 108, access the current sub-table, sub-table 0 (Table 3). Obtain symbol_locate from sub-table 0 corresponding to the calculated y value. The symbol_locate is {1000 0001}.

단계 110에서, 상기 획득된 symbol_locate의 MSB는 1인 것으로 결정되므로, 단계 112로 간다.In step 110, since the MSB of the obtained symbol_locate is determined to be 1, the flow goes to step 112.

단계 112에서, z는 상기 획득된 symbol_locate의 나머지 최하위 비트들 {000 0001}와 동일하게 설정되는데, 즉 z=1로 설정된다.In step 112, z is set equal to the remaining least significant bits {000 0001} of the obtained symbol_locate, i.e., z = 1.

단계 104에서, 현재의 룩업 테이블(표 2)에 액세스한다. 새로운 현재의 서브-테이블(서브-테이블 1)에 대해 새로운 offset_value 및 새로운 shift_value를 획득한다. 서브-테이블 1에 대한 offset_value = 12이고 서브-테이블 1에 대한 shift_value = 0이다.In step 104, the current lookup table (Table 2) is accessed. Obtain a new offset_value and a new shift_value for the new current sub-table (sub-table 1). Offset_value = 12 for sub-table 1 and shift_value = 0 for sub-table 1.

단계 106에서, 수학식 1을 사용하여 현재의 서브-테이블, 서브-테이블 1에 대해 y를 계산한다. y=(x-12)>>0=2In step 106, y is computed for the current sub-table, sub-table 1, using equation (1). y = (x-12) >> 0 = 2

단계 108에서, 현재의 서브-테이블(서브-테이블 1)에 액세스한다. 상기 새로운 y 값(y=2)에 대응하는 symbol_locate를 획득한다. 상기 symbol_locate는 {0000 0101}이다.In step 108, the current sub-table (sub-table 1) is accessed. Obtain symbol_locate corresponding to the new y value (y = 2). The symbol_locate is {0000 0101}.

단계 110에서, 상기 획득된 symbol_locate의 MSB는 0인 것으로 결정되므로, 단계 114로 간다.In step 110, the MSB of the obtained symbol_locate is determined to be zero, and therefore, step 114 is reached.

단계 114에서, 상기 획득된 symbol_locate에 대응하는 심볼을 획득한다. 상기 획득된 symbol_locate {0000 0101}에 대응하는 심볼은 표 5로부터 S5이다.In step 114, a symbol corresponding to the obtained symbol_locate is obtained. The symbol corresponding to the obtained symbol_locate {0000 0101} is S5 from Table 5.

추출된 비트들이 {0,1,1,1,0} 대신에 {0,1,1,1,1}인 경우 동일한 결과가 달성될 것이라는 것은 이해될 것이다.It will be appreciated that the same result will be achieved if the extracted bits are {0,1,1,1,1} instead of {0,1,1,1,0}.

추가 설명Additional explanation

추가 설명으로서 도 4에 도시된 허프만 트리의 부호화가 이제 간략히 설명될 것이다.As a further description the encoding of the Huffman tree shown in FIG. 4 will now be briefly described.

표 7이 생성된다:Table 7 is generated:

SiSi 코드워드Codeword countSi count Si S0S0 000 000 1515 S1S1 001 001 3131 S2S2 010 010 4747 S3S3 01100 01100 5151 S4S4 0110100 0110100 5252 S5S5 0110101 0110101 5353 S6S6 011011 011011 5555 S7S7 0111 0111 6363 S8S8 10 10 9595 S9S9 110 110 111111 S10S10 111 111 127127

L=3에서 상기 트리를 섹션화하는 것은 y=(x-0)>>4를 제공한다.Sectioning the tree at L = 3 gives y = (x-0) >> 4.

y0y0 00 1One 22 33 44 55 66 77 symbol_locatesymbol_locate S0S0 S1S1 S2S2 표 1로 감Go to table 1 S8S8 S8S8 S9S9 S10S10

L=4에서 상기 트리를 섹션화하는 것은 y=(x-48)>>3을 제공하는데, V{011}*2^4=48이다.Sectioning the tree at L = 4 gives y = (x-48) >> 3, where V {011} * 2 ^ 4 = 48.

y1y1 00 1One symbol_locatesymbol_locate 표 2로 감Go to table 2 S7S7

L=5에서 상기 트리를 섹션화하는 것은 y=(x-48)>>2를 제공하는데, V{0110}*2^3=48이다.Sectioning the tree at L = 5 gives y = (x-48) >> 2, where V {0110} * 2 ^ 3 = 48.

y2y2 00 1One symbol_locatesymbol_locate S3S3 표 3으로 감Go to table 3

L=7에서 상기 트리를 섹션화하는 것은 y=(x-52)>>0을 제공하는데, V{01101}*2^2=52이다.Sectioning the tree at L = 7 gives y = (x-52) >> 0, where V {01101} * 2 ^ 2 = 52.

y3y3 00 1One 22 33 symbol_locatesymbol_locate S4S4 S5S5 S6S6 S6S6

본 발명이 다양한 특정 예들을 참조하여 설명되었을지라도, 다양한 변형들 및 변경들이 본 발명의 정신 및 범위를 벗어나지 않고 행해질 수 있다는 것은 이해되어야 한다.Although the present invention has been described with reference to various specific examples, it should be understood that various modifications and changes may be made without departing from the spirit and scope of the invention.

Claims (41)

높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하는 방법에 있어서,A method of decoding a bitstream encoded according to a Huffman coding tree having a height of H, 상기 비트스트림으로부터 H 비트들의 제1 코드워드를 추출하는 단계;Extracting a first codeword of H bits from the bitstream; 상기 코드워드를 제1 시프트 값만큼 시프트함으로써 상기 코드워드를 변경하는 단계;Changing the codeword by shifting the codeword by a first shift value; 적어도 하나의 제1 데이터 구조를 사용하여 관련된 제2 오프셋 값 및 관련된 제2 시프트 값을 지닌 제2 데이터 구조 또는 심볼을 식별하기 위하여 상기 변경된 코드워드를 사용하는 단계;Using the modified codeword to identify a second data structure or symbol having an associated second offset value and associated second shift value using at least one first data structure; 제2 데이터 구조가 상기 제1 데이터 구조를 사용하여 식별되는 경우:If a second data structure is identified using the first data structure: 상기 제2 오프셋 값을 감산하고 그 결과를 상기 제2 시프트 값만큼 시프트함으로써 상기 코드워드를 변경하는 단계; 및Changing the codeword by subtracting the second offset value and shifting the result by the second shift value; And 상기 제2 데이터 구조를 사용하여 관련된 제3 오프셋 값 및 관련된 제3 시프트 값을 지닌 제3 데이터 구조 또는 심볼을 식별하기 위하여 상기 변경된 코드워드를 사용하는 단계를 포함하는 것을 특징으로 하는 방법.Using the modified codeword to identify a third data structure or symbol having an associated third offset value and an associated third shift value using the second data structure. 제1항에 있어서, 상기 제1 시프트 값을 획득하기 위하여 룩업 테이블에 액세스하는 단계 및 상기 제2 오프셋 값 및 상기 제2 시프트 값을 획득하기 위하여 상기 룩업 테이블에 액세스하는 단계를 더 포함하는 것을 특징으로 하는 방법.2. The method of claim 1, further comprising accessing a lookup table to obtain the first shift value and accessing the lookup table to obtain the second offset value and the second shift value. How to. 제1항 또는 제2항에 있어서, 상기 제1 데이터 구조는 상기 허프만 부호화 트리의 제1 레벨을 나타내고 상기 제2 데이터 구조는 상기 허프만 부호화 트리의 제2의 하위 레벨을 나타내는 것을 특징으로 하는 방법.3. The method of claim 1 or 2, wherein the first data structure represents a first level of the Huffman coding tree and the second data structure represents a second lower level of the Huffman coding tree. 제1항 내지 제3항 중 어느 한 항에 있어서, 적어도 상기 높이 H의 값, 상기 제1 시프트 값, 상기 제2 오프셋 값, 상기 제2 시프트 값, 상기 제1 데이터 구조 및 상기 제2 데이터 구조를 수신하는 단계를 더 포함하는 것을 특징으로 하는 방법.4. A method as claimed in any preceding claim, wherein at least the value of the height H, the first shift value, the second offset value, the second shift value, the first data structure and the second data structure. The method further comprises the step of receiving. 제1항 내지 제4항 중 어느 한 항에 있어서, 상기 코드워드를 제1 시프트 값만큼 시프트함으로써 상기 코드워드를 변경하는 단계는 만약 있다면, 상기 코드워드에서 제1 오프셋 값을 우선 감산하고 그 결과를 상기 제1 시프트 값만큼 시프트하는 단계를 포함하는 것을 특징으로 하는 방법.5. The method of any one of claims 1 to 4, wherein the step of changing the codeword by shifting the codeword by a first shift value, if any, first subtracts a first offset value from the codeword and as a result Shifting by the first shift value. 제1항 내지 제5항 중 어느 한 항의 방법을 수행하기 위한 컴퓨터 프로그램.A computer program for performing the method of any one of claims 1 to 5. 제6항의 컴퓨터 프로그램을 구현하는 저장 매체 또는 전송 매체.A storage medium or transmission medium embodying the computer program of claim 6. 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하는 방법에 있어서,A method of decoding a bitstream encoded according to a Huffman coding tree having a height of H, 상기 비트스트림으로부터 H 비트들의 코드워드를 추출하는 단계;Extracting a codeword of H bits from the bitstream; 상기 코드워드를 소정의 시프트 값만큼 시프트하는 단계; 및Shifting the codeword by a predetermined shift value; And 적어도 하나의 제1 데이터 구조를 사용하여 심볼을 식별하기 위하여 상기 변경된 코드워드를 사용하는 단계를 포함하는 것을 특징으로 하는 방법.Using the modified codeword to identify a symbol using at least one first data structure. 제7항에 있어서, 상기 소정의 시프트 값을 획득하기 위하여 룩업 테이블에 액세스하는 단계를 더 포함하는 것을 특징으로 하는 방법.8. The method of claim 7, further comprising accessing a lookup table to obtain the predetermined shift value. 제8항 또는 제9항에 있어서, 상기 제1 데이터 구조는 상기 허프만 부호화 트리의 제1 레벨을 나타내는 것을 특징으로 하는 방법.10. The method of claim 8 or 9, wherein the first data structure represents a first level of the Huffman coding tree. 제8항 내지 제10항 중 어느 한 항에 있어서, 적어도 높이 H의 값, 상기 소정의 시프트 값 및 상기 제1 데이터 구조를 수신하는 단계를 더 포함하는 것을 특징으로 하는 방법.11. The method of any one of claims 8 to 10, further comprising receiving a value of at least height H, the predetermined shift value and the first data structure. 제8항 내지 제11항 중 어느 한 항에 있어서, 상기 코드워드를 소정의 시프트 값만큼 시프트하는 단계는 만일 있다면, 우선 상기 코드워드에서 제1 오프셋 값을 감산하고 그 결과를 상기 소정의 시프트 값만큼 시프트하는 단계를 포함하는 것을 특징으로 하는 방법.12. The method according to any one of claims 8 to 11, wherein the step of shifting the codeword by a predetermined shift value, if any, first subtracts a first offset value from the codeword and results in the predetermined shift value. Shifting by as much as possible. 제8항 내지 제12항 중 어느 한 항의 방법을 수행하기 위한 컴퓨터 프로그램.A computer program for performing the method of any one of claims 8 to 12. 제13항의 컴퓨터 프로그램을 구현하는 저장 매체 또는 전송 매체.A storage medium or transmission medium embodying the computer program of claim 13. 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하기 위한 복호기에 있어서,A decoder for decoding a bitstream encoded according to a Huffman coding tree having a height of H, 관련된 제1 오프셋 값 및 관련된 제1 시프트 값을 지닌 제1 데이터 구조 및 관련된 제2 오프셋 값 및 관련된 제2 시프트 값을 지닌 제2 데이터 구조를 적어도 포함하는 높이가 H인 허프만 부호화 트리를 나타내는 복수의 데이터 구조들을 저장하기 위한 메모리; 및A plurality of Huffman coding trees having a height of at least H comprising at least a first data structure having an associated first offset value and an associated first shift value and a second data structure having an associated second offset value and an associated second shift value; A memory for storing data structures; And 상기 비트스트림으로부터 획득된 H 비트들의 코드워드에서 현재의 오프셋 값을 감산하도록 동작가능하고, 그 결과를 상기 관련된 시프트 값만큼 시프트하도록 동작가능하며, 상기 결과를 사용하여 상기 관련된 데이터 구조를 어드레싱하도록 동작가능한 프로세서를 포함하는 것을 특징으로 하는 복호기.Operable to subtract a current offset value from a codeword of H bits obtained from the bitstream, operable to shift the result by the associated shift value, and use the result to address the associated data structure A decoder comprising a processor capable of. 제15항에 있어서, 상기 제1 데이터 구조는 상기 허프만 부호화 트리의 제1 레벨을 나타내고 상기 제2 데이터 구조는 상기 허프만 부호화 트리의 제2의 하위 레벨을 나타내는 것을 특징으로 하는 복호기.16. The decoder of claim 15, wherein the first data structure represents a first level of the Huffman coding tree and the second data structure represents a second lower level of the Huffman coding tree. 제16항에 있어서, 상기 제1 시프트 값은 상기 제1 레벨에 대응하는 것을 특징으로 하는 복호기.17. The decoder of claim 16, wherein the first shift value corresponds to the first level. 제16항 또는 제17항에 있어서, 상기 제2 시프트 값은 상기 제2 레벨에 대응하는 것을 특징으로 하는 복호기.18. The decoder of claim 16 or 17, wherein the second shift value corresponds to the second level. 제16항 내지 제18항 중 어느 한 항에 있어서, 상기 제2 오프셋 값은 상기 허프만 트리내에서 제1 부트리(sub-tree)의 위치를 식별하는 것을 특징으로 하는 복호기.19. The decoder of any one of claims 16-18, wherein the second offset value identifies a location of a first sub-tree in the Huffman tree. 제17항 내지 제19항 중 어느 한 항에 있어서, 상기 프로세서는 상기 관련된 데이터 구조를 어드레싱하는 것으로부터 값을 획득한 후, 상기 값을 사용하여 비교를 수행하고 상기 비교에 따라 상기 값을 사용하여 심볼 또는 새로운 현재의 오프셋 값을 식별하도록 동작가능한 것을 특징으로 하는 복호기.The processor of claim 17, wherein the processor obtains a value from addressing the associated data structure, and then performs a comparison using the value and uses the value according to the comparison. A decoder operable to identify a symbol or a new current offset value. 제20항에 있어서, 상기 비교는 상기 값의 최상위 비트(MSB)를 사용하는 것을 특징으로 하는 복호기.21. The decoder of claim 20 wherein the comparison uses the most significant bit (MSB) of the value. 제20항 또는 제21항에 있어서, 상기 현재의 오프셋 값은 초기에 상기 제1 오프셋 값으로 설정되는 것을 특징으로 하는 복호기.22. The decoder of claim 20 or 21, wherein the current offset value is initially set to the first offset value. 높이가 H인 허프만 부호화 트리에 따라 부호화된 비트스트림을 복호화하는 방법에 있어서,A method of decoding a bitstream encoded according to a Huffman coding tree having a height of H, 상기 트리의 제1 레벨에서 각 가능한 노드에 대한 값을 포함하는 제1 데이터 구조를 저장하는 단계;Storing a first data structure containing a value for each possible node at the first level of the tree; 상기 트리의 제2의 하위 레벨에서 제1 부트리내의 각 가능한 노드에 대한 값을 포함하는 제2 데이터 구조를 저장하는 단계;Storing a second data structure containing a value for each possible node in a first booty at a second lower level of the tree; 상기 비트스트림으로부터 H 비트들의 제1 코드워드를 추출하는 단계;Extracting a first codeword of H bits from the bitstream; 상기 제1 코드워드의 값을 상기 트리의 제1 레벨에서 상기 트리내의 제1 노드 위치로 변환하는 단계;Converting the value of the first codeword to a first node location in the tree at a first level in the tree; 상기 제1 데이터 구조에 액세스하여 상기 제1 노드 위치에 대응하는 값을 획득하는 단계로서, 상기 값은 상기 제2 데이터 구조를 나타내는 단계;Accessing the first data structure to obtain a value corresponding to the first node location, the value representing the second data structure; 상기 제1 코드워드의 값을 상기 트리의 제2 레벨에서 상기 제1 부트리내의 제2 노드 위치로 변환하는 단계; 및Converting the value of the first codeword to a second node location in the first booty at a second level of the tree; And 상기 제2 데이터 구조에 액세스하여 상기 제2 노드 위치에 대응하는 값을 획득하는 단계를 포함하는 것을 특징으로 하는 방법.Accessing the second data structure to obtain a value corresponding to the second node location. 제23항의 방법을 수행하기 위한 컴퓨터 프로그램.A computer program for performing the method of claim 23. 제24항의 컴퓨터 프로그램을 구현하는 저장 매체 또는 전송 매체.A storage medium or transmission medium embodying the computer program of claim 24. 비트스트림으로부터 코드워드를 복호화하는 방법에 있어서,In the method of decoding a codeword from a bitstream, 복수의 순서화된 데이터 구조들로서 허프만 트리의 표시를 수신하는 단계로서, 상기 복수의 순서화된 데이터 구조들은 상기 트리의 식별된 제1 레벨(L1)과 관련되며 각 엔트리가 상기 식별된 제1 레벨에서 완전한 트리의 노드에 대응하는 복수의 데이터 엔트리들을 포함하는 제1 데이터 구조 및 상기 트리의 식별된 제2 레벨(L2) 및 식별된 제1 부트리와 관련되며, 각 엔트리가 상기 제2 식별된 레벨에서, 완전한 경우, 상기 제1 부트리의 노드에 대응하는 복수의 데이터 엔트리들을 포함하는 적어도 하나의 제2 데이터 구조를 포함하는 단계;Receiving an indication of a Huffman tree as a plurality of ordered data structures, wherein the plurality of ordered data structures are associated with an identified first level L1 of the tree and each entry is complete at the identified first level. A first data structure comprising a plurality of data entries corresponding to nodes of a tree and an identified second level L2 of the tree and an identified first booty, wherein each entry is at the second identified level And, if complete, including at least one second data structure comprising a plurality of data entries corresponding to the node of the first booty; 허프만 트리에서 제1 레벨(L1)에 대한 값을 획득하는 단계;Obtaining a value for a first level L1 in the Huffman tree; 코드워드의 제1 L1 비트들에 대응하는, 완전한 경우, 상기 트리의 상기 제1 레벨(L1)에서 상기 노드를 식별하는 단계;Identifying the node at the first level (L1) of the tree, corresponding to the first L1 bits of a codeword, in a complete case; 상기 식별된 노드가 내부 노드인 경우 추가 데이터 구조를 식별하고 그렇지 않은 경우 심볼을 식별하는, 상기 식별된 노드에 대한 데이터 엔트리를 상기 제1 데이터 구조로부터 획득하는 단계; 및Obtaining a data entry for the identified node from the first data structure, identifying an additional data structure if the identified node is an internal node and otherwise identifying a symbol; And 상기 식별된 노드가 내부 노드인 경우:If the identified node is an internal node: 상기 제1 레벨(L1)보다 더 높은 레벨인, 허프만 트리에서 제2 레벨(L2)에 대한 값을 획득하는 단계;Obtaining a value for a second level (L2) in the Huffman tree, which is a level higher than the first level (L1); 제1 부트리를 식별하는 값을 획득하는 단계;Obtaining a value identifying the first booty; 수신된 비트스트림의 제1 L2 비트들에 대응하는, 완전한 경우, 상기 제1 부트리의 제2 레벨(L2)에서 상기 노드를 식별하는 단계;Identifying the node at the second level (L2) of the first booty, if complete, corresponding to the first L2 bits of the received bitstream; 상기 식별된 노드가 내부 노드인 경우 추가 데이터 구조를 식별하고 그렇지 않은 경우 심볼을 식별하는, 상기 식별된 노드에 대한 데이터 엔트리를 추가 데이터 구조로부터 획득하는 단계를 포함하는 것을 특징으로 하는 방법.Obtaining a data entry for the identified node from the additional data structure that identifies an additional data structure if the identified node is an internal node and otherwise identifies a symbol. 제26항의 방법을 수행하기 위한 컴퓨터 프로그램.A computer program for performing the method of claim 26. 제27항의 컴퓨터 프로그램을 구현하는 저장 매체 또는 전송 매체.A storage medium or transmission medium embodying the computer program of claim 27. H 레벨들에 배열된 내부 노드들 및 리프(leaf) 노드들을 포함하는 허프만 부호화 트리를 나타내는 데이터로서, 각 리프 노드는 두번째 최저 레벨상의 단일 내부 노드로부터 종속되고 상기 각 리프 노드는 심볼을 나타내며 각 내부 노드는 상기 두번째 최저 레벨상의 단일 내부 노드로부터 종속되는 데이터에 있어서, 상기 데이터는,Data representing a Huffman coding tree comprising inner nodes and leaf nodes arranged at H levels, each leaf node being subordinated from a single inner node on the second lowest level and each leaf node representing a symbol and each inner The node is data dependent from a single internal node on the second lowest level, the data being: 상기 트리의 제1 특정 레벨내의 노드들 각각에 대해, 제1 내부 노드에 대한 제2 데이터 구조를 포함하여, 각 리프 노드에 대한 심볼 및 각 내부 노드에 대한 추가 데이터 구조를 식별하는 제1 데이터 구조;For each of the nodes within the first specific level of the tree, a first data structure identifying a symbol for each leaf node and an additional data structure for each inner node, including a second data structure for a first inner node. ; 상기 제1 데이터 구조에 의해 식별된 적어도 하나의 제2 데이터 구조로서, 상기 제1 내부 노드로부터 종속되고, 상기 트리의 제2 특정 레벨에 있는, 부트리내의 노드들 각각에 대해, 만일 있다면 각 리프 노드에 대한 심볼 및 내부 노드에 대 한 추가 데이터 구조를 식별하는 적어도 하나의 제2 데이터 구조; 및At least one second data structure identified by the first data structure, for each of the nodes in the bootee, dependent from the first internal node and at a second particular level of the tree, if any At least one second data structure identifying a symbol for the node and an additional data structure for an internal node; And 적어도 상기 제1 레벨, 상기 제2 레벨 및 상기 제1 내부 노드를 지정하는 데이터를 포함하는 것을 특징으로 하는 데이터.Data specifying at least the first level, the second level, and the first internal node. 제29항에 있어서, 상기 제1 데이터 구조는 만일 있다면, 각 빈 노드에 대한 심볼을 식별하는 것을 특징으로 하는 데이터.30. The data of claim 29, wherein the first data structure, if present, identifies a symbol for each empty node. 제29항 또는 제30항에 있어서, 상기 제2 데이터 구조는 상기 트리의 제2 레벨에서 상기 부트리의 각 빈 노드에 대한 심볼을 식별하는 것을 특징으로 하는 데이터.31. The data of claim 29 or 30, wherein the second data structure identifies a symbol for each empty node of the bootie at a second level of the tree. 제29항 내지 제31항 중 어느 한 항에 있어서, 상기 제1 레벨은 적어도 두개의 리프 노드들을 지닌 상기 트리내에서 최저 레벨인 것을 특징으로 하는 데이터.32. The data of any of claims 29 to 31, wherein the first level is the lowest level in the tree with at least two leaf nodes. 제29항 내지 제32항 중 어느 한 항에 있어서, 상기 제2 레벨은 적어도 두개의 리프 노드들을 지닌 상기 부트리내에서 최저 레벨인 것을 특징으로 하는 데이터.33. The data of any of claims 29-32, wherein the second level is the lowest level in the bootley with at least two leaf nodes. 제29항 내지 제33항 중 어느 한 항에 있어서, 레벨 L(L=0, 1, 2..)에서 그리고 값 V를 가지는 경우, 상기 제1 내부 노드는 V*2^(H-L)에 의존하는 값에 의해 지 정하는 것을 특징으로 하는 데이터.34. The method according to any one of claims 29 to 33, wherein at the level L (L = 0, 1, 2 ..) and with the value V, the first internal node depends on V * 2 ^ (HL). Data characterized by the value to be specified. 제29항 내지 제34항 중 어느 한 항에 있어서, H를 지정하는 데이터를 더 포함하는 것을 특징으로 하는 데이터.35. The data of any of claims 29 to 34, further comprising data specifying H. 제29항 내지 제35항 중 어느 한 항에 의한 데이터를 구현하는 저장 매체 또는 전송 매체.36. A storage medium or transmission medium embodying data according to any of claims 29-35. 허프만 이진 트리를 나타내는 방법에 있어서,In the way to represent a Huffman binary tree, 상기 트리의 식별된 제1 레벨(L1)과 연관되며 복수의 엔트리들을 포함하는 제1 데이터 구조를 생성하는 단계로서, 각 엔트리는 상기 식별된 제1 레벨에서 완전한 트리의 노드에 대응하고 상기 노드가 내부 노드인 경우 추가 데이터 구조를 식별하며 그렇지 않은 경우 심볼을 식별하는 단계; 및Generating a first data structure associated with the identified first level L1 of the tree and comprising a plurality of entries, each entry corresponding to a node of a complete tree at the identified first level, wherein the node is Identifying an additional data structure if it is an internal node, otherwise identifying a symbol; And 상기 트리의 식별된 제2 레벨(L2)과 연관되고 식별된 제1 부트리와 연관되며 복수의 데이터 엔트리들을 포함하는 적어도 하나의 추가 데이터 구조를 생성하는 단계로서, 각 엔트리가 상기 제2 식별된 레벨(L2)에서 완전한 경우, 상기 제1 부트리의 노드에 대응하고 상기 노드가 내부 노드인 경우 추가 데이터 구조를 식별하며 그렇지 않은 경우 심볼을 식별하는 단계를 포함하는 것을 특징으로 하는 방법.Generating at least one additional data structure associated with the identified second level L2 of the tree and associated with the identified first booty and comprising a plurality of data entries, wherein each entry is identified by the second identified If complete at level (L2), identifying an additional data structure corresponding to a node of the first booty and if the node is an internal node; otherwise identifying a symbol. 제37항에 있어서, 상기 허프만 트리내의 데이터 구조들의 수 및 상기 데이터 구조들의 연관된 레벨들을 결정하기 위한 알고리즘을 실행하는 것을 특징으로 하는 방법.38. The method of claim 37, executing an algorithm for determining the number of data structures in the Huffman tree and the associated levels of the data structures. 제37항 또는 제38항에 있어서, V*2^(H-L)에 의존하는 값을 사용하여 레벨 L(L=0, 1, 2..) 및 값 V에서 루트 노드를 지닌 부트리를 식별하는 단계를 더 포함하는 것을 특징으로 하는 방법.The method of claim 37 or 38, wherein the value dependent on V * 2 ^ (HL) is used to identify a bootie with a root node at level L (L = 0, 1, 2 ..) and value V. And further comprising a step. 실질적으로 첨부한 도면들을 참조하여 상기에 설명된 바와 같은 그리고/또는 첨부한 도면들에 도시된 바와 같은 부호화 방법 및/또는 복호화 방법.An encoding method and / or a decoding method substantially as described above with reference to the accompanying drawings and / or as shown in the accompanying drawings. 실질적으로 첨부한 도면들을 참조하여 상기에 설명된 바와 같은 그리고/또는 첨부한 도면들에 도시된 바와 같은 부호기 또는 복호기.An encoder or decoder as substantially described above with reference to the accompanying drawings and / or as shown in the accompanying drawings.
KR1020067004185A 2006-02-28 2003-09-02 Huffman coding and decoding KR100840757B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020067004185A KR100840757B1 (en) 2006-02-28 2003-09-02 Huffman coding and decoding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020067004185A KR100840757B1 (en) 2006-02-28 2003-09-02 Huffman coding and decoding

Publications (2)

Publication Number Publication Date
KR20060028750A true KR20060028750A (en) 2006-03-31
KR100840757B1 KR100840757B1 (en) 2008-06-23

Family

ID=37139342

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020067004185A KR100840757B1 (en) 2006-02-28 2003-09-02 Huffman coding and decoding

Country Status (1)

Country Link
KR (1) KR100840757B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727414A (en) * 2019-09-30 2020-01-24 安徽问天量子科技股份有限公司 Random number generation method based on Huffman coding

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101118089B1 (en) * 2008-12-10 2012-03-09 서울대학교산학협력단 Apparatus and system for Variable Length Decoding

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6188797B1 (en) 1997-05-27 2001-02-13 Apple Computer, Inc. Decoder for programmable variable length data
WO2002061948A2 (en) * 2001-01-30 2002-08-08 California Institute Of Technology Lossless and near-lossless source coding for multiple access networks
KR100484137B1 (en) 2002-02-28 2005-04-18 삼성전자주식회사 Improved huffman decoding method and apparatus thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727414A (en) * 2019-09-30 2020-01-24 安徽问天量子科技股份有限公司 Random number generation method based on Huffman coding
CN110727414B (en) * 2019-09-30 2023-12-08 安徽问天量子科技股份有限公司 Random number generation method based on Huffman coding

Also Published As

Publication number Publication date
KR100840757B1 (en) 2008-06-23

Similar Documents

Publication Publication Date Title
US7358870B2 (en) Huffman coding and decoding based upon sectioning of a Huffman coding tree
US6697363B1 (en) Method and apparatus for longest matching prefix determination in a communication network
US7135997B2 (en) Method and apparatus for CAVLC decoding
US7446681B2 (en) Lookup table array compression and indexing
KR101118089B1 (en) Apparatus and system for Variable Length Decoding
TWI428023B (en) Decoding method and apparatus
CA2668222A1 (en) Memory efficient coding of variable length codes
WO2004030305A2 (en) Improved dense mode coding scheme
JP2006050605A (en) Method and apparatus for coding and decoding binary state, and computer program corresponding thereto
US20030085821A1 (en) Method of performing Huffman decoding
US5594435A (en) Permutation-based data compression
EP0127815B1 (en) Data compression method
KR100604364B1 (en) Arithmetic encoding and decoding of an information signal
KR100484137B1 (en) Improved huffman decoding method and apparatus thereof
US7348901B2 (en) Method and system for decoding variable length encoded signals, computer program product therefor
KR100840757B1 (en) Huffman coding and decoding
US7205915B2 (en) Method of decoding variable length prefix codes
JP3256121B2 (en) Data encoding device and data decoding device and method therefor
US20220005229A1 (en) Point cloud attribute encoding method and device, and point cloud attribute decoding method and devcie
Jiang et al. An efficient Huffman decoding method based on pattern partition and look-up table
WO2009001174A1 (en) System and method for data compression and storage allowing fast retrieval
US20110158310A1 (en) Decoding data using lookup tables
US7773003B1 (en) Huffman search algorithm for AAC decoder
CN112506876A (en) Lossless compression query method supporting SQL query
JPH04192744A (en) Decoder

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20130522

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20140521

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20150519

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20160517

Year of fee payment: 9

FPAY Annual fee payment

Payment date: 20170609

Year of fee payment: 10