KR19990050486A - High-speed processing variable-length codec device - Google Patents
High-speed processing variable-length codec device Download PDFInfo
- Publication number
- KR19990050486A KR19990050486A KR1019970069613A KR19970069613A KR19990050486A KR 19990050486 A KR19990050486 A KR 19990050486A KR 1019970069613 A KR1019970069613 A KR 1019970069613A KR 19970069613 A KR19970069613 A KR 19970069613A KR 19990050486 A KR19990050486 A KR 19990050486A
- Authority
- KR
- South Korea
- Prior art keywords
- variable length
- codeword
- length
- bit string
- value
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
허프만 코드 구조를 기초로 입력 데이터를 가변 길이 코드 워드로 코덱하거나 또는 디코딩하는 고속 처리 가변 길이 코덱 장치가 개시되어 있다. 코덱 장치는 허프만 코드 구조에 따른 가변 길이 코드 워드들의 경계를 검출하기 위한 경계 검출부를 포함한다. 상기 경계 검출부는 외부로부터의 가변 길이 코드 워드들 또는 부호화 메모리로부터의 저장 코드 워드의 가변 길이 코드 워드의 길이를 검출한다. 가변 길이 검출부는 상기 저장 코드 워드에서의 m비트를 갖는 선택 코드 워드들, 및 허프만 코드 구조에서 상기 선택 코드 워드에 의해 결정되는 레벨 n의 터미널 노드의 노드 코드 워드 을 근거로, 상기 저장 코드 워드에서의 가변 길이 코드 워드의 길이를 검출한다. 그리고, 상기 코덱 장치는 가변 길이 검출부에 의해 검출된 가변 길이 코드 워드의 길이 에 응답하여, 저장 코드 워드에서 가변 길이 코드 워드를 검출하기 위한 부호화 팩킹부, 및 검출된 가변 길이 코드 워드를 어드레스로 복호화 코드 워드가 저장된 메모리를 포함한다.Speed variable-length codec apparatus for codewording or decoding input data into a variable-length codeword on the basis of a Huffman code structure. The codec apparatus includes a boundary detection unit for detecting a boundary of variable length codewords according to a Huffman code structure. The boundary detection unit detects the length of the variable length codewords from the outside or the length of the variable length codewords of the storage codewords from the encoding memory. The variable length detection unit is operable to determine whether the stored codeword is in the stored codeword based on the selected codewords having m bits in the stored codeword and the node codeword of the terminal node of level n determined by the selected codeword in the Huffman code structure The length of the variable length codeword of the variable length codeword is detected. The codec apparatus includes an encoding packing unit for detecting a variable length codeword in a stored codeword in response to a length of a variable length codeword detected by the variable length detecting unit, and a decoding unit for decoding the detected variable length codeword into an address And a memory in which a code word is stored.
Description
본 발명은 허프만 코드 구조를 기초로 입력 데이터를 가변 길이 코드 워드로 코딩하거나 또는 입력되는 가변 길이 코드 워드를 디코딩할 수 있는 고속 처리 가변 길이 코덱 장치에 관한 것이다.The present invention relates to a fast processing variable length codec device capable of coding input data into a variable length codeword or decoding an input variable length codeword based on a Huffman code structure.
일반적으로, 가변 길이 코덱은 손실 없이 데이터 압축에 사용되는 코딩 기술이다. 가변 길이 코딩은 모든 가능 입력 데이터(또는 심볼)들을 그 발생 확률에 따라 가변 길이 코드 워드로 변환시켜 그 평균 코드 길이를 감소시킨다. 가변 길이 코딩은 가변 길이 코딩은 빈도 수가 많은 데이터에는 보다 짧은 길이의 코드 워드를, 빈도 수가 적은 데이터에는 보다 긴 길이의 코드 워드를, 모든 가능한 소스 코드 워드의 라이브러리(library)에 할당함으로써, 가변 길이 코드 워드로 코딩한 데이터의 평균 워드 길이가 코딩 전의 데이터의 평균 워드 길이보다 짧아지게 함으로써, 그 결과 데이터 압축을 실현하게 된다.Generally, a variable length codec is a coding technique used for data compression without loss. Variable length coding converts all possible input data (or symbols) into variable length code words according to their probability of occurrence, thereby reducing the average code length. Variable-length coding assigns a codeword of a shorter length to data of a higher frequency and a longer-length codeword of data of a less frequent variable-length coding to a library of all possible source codewords, The average word length of the data coded by the code word is made shorter than the average word length of the data before coding, thereby realizing data compression as a result.
이러한 가변 길이 코딩 방법중 가장 널리 사용되는 방법은 허프만 코딩 방법이다. 허프만 코딩 방법은 통계치가 알려진 데이터를 그 발생 빈도 수에 따라 허프만 코드 트리에 적용함으로써, 프리픽스-프리 가변 길이 코드(Prefix-free Variable Length Code)를 구현한다.The most widely used variable length coding method is a Huffman coding method. The Huffman coding scheme implements a Prefix-free Variable Length Code by applying known data to the Huffman code tree according to the frequency of occurrence.
가변 길이 코딩 장치에 대한 일 예가 조셉에게 허여된 미합중국 특허 제 3,675,212 호에 개시되어 있다. 조셉에 의해 제시된 가변 길이 코딩 장치는 모든 가능 심볼에 가변 길이 코드 워드를 할당하고, 각각의 가변 길이 코드 워드를 상기 심볼들을 주소로 메모리에 저장하는 한편, 상기 가변 길이 코드 워드의 길이를 메모리에 저장하여, 상기 심볼 입력시 상기 심볼에 대응하는 가변 길이 코드 및 그 길이를 메모리로부터 독출하여 코딩하도록 되어 있다.One example of a variable length coding device is disclosed in U.S. Patent No. 3,675,212 to Joseph. The variable length coding apparatus proposed by Joseph assigns variable length codewords to all possible symbols and stores each variable length codeword into memory in the memory as an address and stores the length of the variable length codeword in memory And when the symbol is input, the variable length code corresponding to the symbol and its length are read from the memory and coded.
가변 길이 디코딩 장치는 가변 길이 코드 워드로 변환된 데이터를 복호화하는 것으로, 각각의 가변 길이 코드 워드를 원래의 소스 심볼로 디코딩하기 위해서는 먼저 가변 길이 코드 워드를 수신된 비트 열에서 도출시켜야 한다. 그러나, 가변 길이 코드 워드를 디코딩할 때까지는 다음 코드 워드의 시작 비트의 위치는 알수 없으며, 이러한 디코딩 특성은 디코딩 장치의 제작시 다중 파이프 라인 하드웨어를 사용할 것을 종용한다. 따라서, 통상적으로, 가변 길이 디코딩 장치는 인코딩 장치보다 복잡하다.The variable length decoding apparatus decodes data converted into a variable length codeword. In order to decode each variable length codeword into an original source symbol, a variable length codeword must first be derived from the received bit string. However, until the variable length codeword is decoded, the position of the start bit of the next codeword is unknown, and such decoding characteristics are invited to use multiple pipeline hardware in the production of the decoding device. Thus, typically, the variable length decoding apparatus is more complicated than the encoding apparatus.
통상적으로 가변 길이 코드 워드의 비트 스트림을 복호화하는데는 많은 방법이 있다. 가장 많이 이용되는 것의 하나는 트리-탐색 알고리즘이다. 가변 길이 코드는 터미널 노드라고 불리는 잎으로 코드 워드를 갖는 트리에 의해 표현될 수 있다. 복호화는 코드 트리의 루트로부터 출발하여 수신된 비트열에 의해 안내되어 각 노드에 있는 2개의 가지 중에 하나로 이어진다. 잎에 도달할 때, 코드 워드의 끝이 검출되고 남아 있는 열로부터 세크먼트된다. 이러한 형식의 디코더는 상기 트리에 대응하는 논리 회로 및 코드 트리를 가로지르는 제어 회로를 포함한다. 이러한 방법은 코드 트리를 통한 비트-바이 -비트 탐색이 복호화된 각 심볼에 대해 요구되는 바, 속도가 트리를 통한 비트-방이-비트 탐색이 복호화된 각 심벌에 대해 요구되는 바, 속도가 느리고 특히 긴 코드 워드에 대해 오랜 복호화 시간이 요구된다. 전형적인 적용에 있어서, 입력 심벌은 다수의 비트로 표현된다. 수신된 비트들을 디코더로 시프팅하는 속도는 복호화된 데이터의 평균 속도의 수배이다. 따라서, 트리-탐색을 기초로 하는 디코더는 출력 데이터 비율의 수배 속도로 동작하여야 한다.There are many ways to decode a bitstream of a variable length codeword. One of the most commonly used is the tree-search algorithm. Variable length codes can be represented by a tree with code words in a leaf called a terminal node. Decoding starts from the root of the code tree and is guided by the received bitstream, leading to one of the two branches at each node. When reaching the leaf, the end of the code word is detected and is segmented from the remaining column. This type of decoder includes logic circuitry corresponding to the tree and control circuitry traversing the code tree. This method requires a bit-by-bit search through the code tree for each decoded symbol, so that the rate is slow for each symbol for which the bit-room-bit search through the tree is decoded, Long decode times are required for long codewords. In typical applications, input symbols are represented by a plurality of bits. The rate at which the received bits are shifted to the decoder is a multiple of the average rate of the decoded data. Thus, a decoder based on a tree-search must operate at a multiple of the output data rate.
그러나, 고선명 텔레비젼의 디지털 전송에 있어서 휘도와 신호들을 결합한 전체 샘풀 속도는 약 100MHz를 요구하며, 가변 길이 부호화가 사용되는 경우 최대 길이의 코드 워드는 전형적으로 16비트이므로 상기 비트-바이 비트 디코더는 상기 샘풀 속도로 코드 워드를 검출하기 위해사는 전형적으로 1.6기가 비트/초의 속도로 시프트해야 한다. 그러나 최근의 IC 제조 기술을 고려할 때 상기와 같은 고속의 디코더를 구현하기는 어렵다.However, the total sample rate combining luminance and signals for digital transmission of high-definition television requires about 100 MHz, and when a variable length coding is used, the maximum length codeword is typically 16 bits, so the bit- To detect the codeword at sample rate, the shift typically needs to be shifted at a rate of 1.6 gigabits per second. However, considering the recent IC manufacturing technology, it is difficult to implement such a high-speed decoder.
한편, 가변 길이 코드 워드의 스트림을 복호화하기 위하여 여러 장치가 제안되고 있는데, 현재까지 제안된 가변 길이 복호화 장치의 구조는 순차적 복호화 및 병렬 복호화로 나눌 수 있다. 먼저, 순차적 복호화는 비트열을 앞에서부터 차례로 복호화하는 방법으로, 정속 입력 구조, 정속 출력 구조, 가변 입/출력 구조로 나눌 수 있으며, 정속 입력 구조는 이력 비트열을 비트 단위로 처리하여 설계는 용이하나 속도가 느린 문제점이 있다. 또한, 정속 출력 구조의 가변 길이 복화화 장치는 벨 코어의 M. T Sun이 제안한 구조로 입력 비트 열을 최대 코드 워드 길이 만큼 팩킹하여 ROM 테이블에 저장하며, 복호화시 코드 워드를 찾아 찾은 코드 워드의 길이만큼 배럴 시프터로 시프트 시킨 후, 다음 코드 워드를 찾는 방식이다(Bell Core, U.S.A. 특허 제5173695). 즉, 한 싸이클에 하나의 코드 워드가 복호화되므로 정속 입력 구조보다 속도가 빠른 정속 출력 가변 길이 복호화 장치이다.Meanwhile, various apparatuses have been proposed for decoding a stream of variable length code words. The structure of the variable length decoding apparatus proposed so far can be divided into sequential decoding and parallel decoding. First, sequential decoding is a method of decrypting bitstreams from the beginning in order, and can be divided into a constant speed input structure, a constant speed output structure, and a variable input / output structure. In the constant speed input structure, There is one slow problem. In addition, a variable length decoding apparatus of a constant rate output structure is a structure proposed by M. T Sun of Bell Core and packs the input bit string by a maximum code word length and stores it in a ROM table. In decoding, a codeword is found, Shifted to the barrel shifter by the length, and then the next code word is found (Bell Core, USA Patent No. 5173695). That is, since one codeword is decoded in one cycle, it is a constant output variable length decoding apparatus that is faster than the constant rate input structure.
본 발명의 목적은 가변 길이 코드 워드의 길이를 저장한 메모리없이, 입력 데이터를 가변 길이 코드 워드로 코딩하거나 또는 입력되는 가변 길이 코드 워드를 디코딩할 수 있는 고속 처리 가변 길이 코덱 장치를 제공하는 것이다.It is an object of the present invention to provide a high-speed variable length codec device capable of coding input data into a variable length codeword or decoding an input variable length codeword without a memory storing a length of a variable length codeword.
상기 목적을 실현하기 위한 본 발명에 따른 가변 길이 코덱은 a) 소스로부터 입력되는 부호화 비트 열을 저장하기 위한 버퍼(110); b) 외부로부터의 복호화 비트 열을 저장하고, 상기 저장된 복호화 코드 워드를 가변 길이 코드 워드의 최대 길이로 출력시키며, 상기 복호화 비트 열에 포함된 가변 길이 코드 워드의 길이에 따라 상기 복호화 비트 열에서 복호화된 비트들 다음 비트부터 출력시키기 위한 복호화 팩킹부(130); c) 허프만 코드 구조를 기초로 모든 가능 심볼 각각에 대해 각각 정의된 가변 길이 코드 워드들을 상기 모든 가능 심볼들을 주소로 저장되고, 상기 버퍼(110)로부터 상기 심볼(X)이 입력되는 경우, 상기 심볼(X)에 대응하는 가변 길이 코드 워드 VLW(X)를 포함하는 저장 코드 워드 M(X)를 출력하기 위한 부호화 메모리(150); d) 복호화 코드 워드를 허프만 코드 트리에서의 터미널 노드의 위치를 주소로 저장하기 위한 복호화 메모리; e) 외부로부터의 제어 신호에 응답하여 상기 메모리(150)로부터의 저장 코드 워드 M(X)및 상기 복호화 팩킹부(130)로부터의 부호화 비트 열(ECSi)을 선택 출력하기 위한 선택 수단(160); f) 상기 선택 수단으로부터 입력되는 비트 열(CW)에서 m비트를 선택하여 발생되는 선택 코드 워드(BWm)들 및 상기 선택 코드 워드(BWm)들의 허프만 코드 트리에서의 레벨 및 각 레벨에서의 터미널 노드의 수를 근거로, 상기 비트 열(CW)에 포함된 상기 가변 길이 코드 워드의 길이를 검출하기 위한 가변 길이 검출부(200); g) 상기 가변 길이 검출부(200)에 의해 검출된 가변 길이 코드 워드의 길이에 응답하여 상기 비트 열(CW)에 포함된 가변 길이 코드 워드의 허프만 트리에서의 위치를 검출하고, 상기 검출된 위치를 상기 복호화 메모리에 제공하기 위한 주소 발생부(600); 및 h) 상기 길이 검출부(220)에 의해 검출된 가변 길이 코드 워드의 길이(LEG)에 응답하여 상기 비트 열(CW)에서 가변 길이 코드 워드(W2)를 검출하고, 상기 검출되는 가변 길이 코드 워드(W2)를 출력시키기 위한 부호화 부호화 팩킹부(310)로 구성되며, 여기서, 상기 m은 1, 2, 3 .... K 이고, 상기 K 는 가변 길이 코드 워드의 최대 길이이다.According to an aspect of the present invention, there is provided a variable length codec comprising: a) a buffer for storing an encoded bit stream input from a source; b) storing a decoded bit string from the outside, outputting the stored decoded codeword as a maximum length of the variable length codeword, and decoding the decoded codeword in the decoded bit string according to the length of the variable length codeword included in the decoded bit string A decoding packing unit 130 for outputting bits from the next bit; c) storing variable length codewords defined for each possible symbol for each possible symbol on the basis of the Huffman code structure, and for storing the symbol (X) in the buffer (110) A coding memory 150 for outputting a stored code word M (X) including a variable length code word VLW (X) corresponding to the variable length code word X; d) a decoding memory for storing the decoded codeword as the address of the location of the terminal node in the Huffman code tree; e) selection means 160 for selectively outputting the stored codeword M (X) from the memory 150 and the encoding bit stream ECS i from the decoding packing unit 130 in response to a control signal from the outside ); f) at the level, and each level in a Huffman code tree of a bit string (CW) selection code word (BW m) and said selection code word (BW m) are generated by selecting the m bits in the input from the selection means A variable length detector (200) for detecting a length of the variable length codeword included in the bit string (CW) based on the number of terminal nodes; g) detecting a position of a variable length codeword included in the bit string (CW) in the Huffman tree in response to the length of the variable length codeword detected by the variable length detector (200), and detecting the detected position An address generator 600 for providing the decoded data to the decoding memory; And h) detecting a variable length codeword (W 2 ) in the bit string (CW) in response to a length (LEG) of a variable length codeword detected by the length detector (220) And an encoding / coding unit 310 for outputting a word W 2 , where m is 1, 2, 3 .... K, and K is a maximum length of a variable length codeword.
본 발명에 의하면, 허프만 코드 구조에 따른 가변 길이 코드 워드의 길이를 메모리로부터 발생되는 저장 코드 워드로부터 검출하게 됨으로써, 메모리에 가변 길이 코드 워드의 길이를 저장하지 않고, 입력 데이터를 가변 길이 코드 워드로 코딩하거나 또는 입력되는 가변 길이 코드 워드의 길이를 검출하여 가변 길이 코드 워드를 고정 길이 코드 워드로 디코딩할 수 있게 된다.According to the present invention, by detecting the length of the variable length codeword according to the Huffman code structure from the stored codeword generated from the memory, the length of the variable length codeword is not stored in the memory, The length of the variable length codeword to be coded or inputted can be detected to decode the variable length codeword into the fixed length codeword.
도 1은 본 발명의 일 실시 예에 따른 가변 길이 코덱 장치를 도시한 블록 구상도이다.1 is a block diagram illustrating a variable-length codec apparatus according to an embodiment of the present invention.
도 2는 도 1에 도시한 경계 검출부의 일 예를 도시한 구성도이다.Fig. 2 is a configuration diagram showing an example of the boundary detection unit shown in Fig. 1. Fig.
도 3은 도 2에 도시한 연산부의 일 예를 도시한 구성도이다.3 is a configuration diagram showing an example of the operation unit shown in FIG.
도 4는 도 1에 도시한 길이 검출부의 일 예를 도시한 구성도이다.4 is a configuration diagram showing an example of the length detector shown in Fig.
도 5는 도 1에 도시한 부호화 팩킹부의 일 예를 도시한 회로 구성도이다.Fig. 5 is a circuit diagram showing an example of the coding packing unit shown in Fig. 1. Fig.
도 6은 허프만 코드 구조를 설명하기 위한 도면이다.6 is a diagram for explaining a Huffman code structure.
<도면의 주요 부분에 대한 부호의 설명 >Description of the Related Art
110, 130: 버퍼 150: 부호화 메모리110, 130: buffer 150:
160: 스위치 210: 경계 검출부160: Switch 210:
220 길이 검출부 310: 부호화 팩킹부220 Length Detection Unit 310: Coding Packing Unit
610: 멀티프렉스 620: 레지스터부610: Multiplex 620: Register portion
412, 422, 424, 432: 래치 630, 420: 누산부412, 422, 424, 432: Latches 630, 420:
421, 650: 가산기 510: 코드 선택부421, 650: adder 510: code selector
520: 레벨 검출부 530: 연산부520: level detector 530:
540: 경계 값 발생부540: boundary value generator
도 1은 본 발명의 일 실시 예에 따른 고속 처리 가변 길이 코덱 장치를 도시한 구성도이다.1 is a block diagram illustrating a high-speed processing variable-length codec apparatus according to an embodiment of the present invention.
도 1을 참조하면, 가변 길이 코덱 장치는 버퍼(110), 복호화 팩킹부(130), 부호화 메모리(150), 스위치(160), 가변 길이 검출부(200), 부호화 팩킹부(310), 주소 발생부(600), 및 복호화 메모리(660)로 구성된다.1, the variable length codec apparatus includes a buffer 110, a decoding packing unit 130, a coding memory 150, a switch 160, a variable length detecting unit 200, an encoding packing unit 310, Unit 600, and a decryption memory 660.
상기 버퍼(110)는 외부로부터 시리얼 또는 병렬로 입력되는 부호화 비트 열(이하, 심볼이라 함)을 저장하고, 그 제어 신호(도시하지 않음)에 응답하여 상기 심볼(X)을 상기 부호화 메모리(150)에 출력한다.The buffer 110 stores an encoded bit stream (hereinafter referred to as a symbol) input from the outside in serial or parallel and outputs the symbol X to the encoding memory 150 (not shown) in response to a control signal .
상기 부호화 메모리(150)는 저장 코드 워드 M(X)들을 저장한다. 상기 부호화 메모리(150)는 저장 코드 워드들을 상기 심볼들 또는 상기 심볼들에 대응하는 주소들에 따라 가변 길이 코드 워드의 최대 길이로 저장한다. 따라서, 어떤 심볼이 상기 상기 부호화 메모리(150)에 입력될 때, 상기 부호화 메모리(150)는 상기 심볼에 대응하는 저장 코드 워드 M(X)를 발생시킨다. 상기 저장 코드 워드의 코드 길이는 가변 길이 코드 워드의 최대 길이므로, 상기 저장 코드 워드에는 가변 길이 코드 워드 및 스터핑 비트(stuffing bits)들로 구성된다.The encoding memory 150 stores the stored codewords M (X). The encoding memory 150 stores the stored codewords as the maximum length of variable length codewords according to the symbols or the addresses corresponding to the symbols. Therefore, when a certain symbol is input to the encoding memory 150, the encoding memory 150 generates a stored code word M (X) corresponding to the symbol. Since the code length of the stored codeword is the maximum length of the variable length codeword, the stored codeword is composed of a variable length codeword and stuffing bits.
예컨데, 상기 가변 길이 코드 워드의 최대 길이가 K비트이고, 심볼 [X]가 상기 부호화 메모리(150)에 입력되는 경우, 상기 부호화 메모리(150)는 K 비트 열의 저장 코드 워드 M(X)를 발생시키고, 상기 저장 코드 워드 M(X)를 상기 스위치(160)의 제1 입력 단자(S1) 및 상기 부호화 팩킹부(310)에 각각 제공한다.For example, when the maximum length of the variable length codeword is K bits and a symbol [X] is input to the encoding memory 150, the encoding memory 150 generates a storage codeword M (X) And provides the stored code word M (X) to the first input terminal S1 of the switch 160 and the encoding packing unit 310, respectively.
상기 복호화 팩킹부(130)는 외부로부터 입력되는 복호화 비트 열(VLW)을 저장하고, 상기 저장된 복호화 코드 워드(VLW)를 가변 길이 코드 워드의 최대 길이로 출력시키며, 상기 복호화 비트 열에 포함된 가변 길이 코드 워드의 길이에 따라 상기 복호화 비트 열에서 복호화된 비트들 다음 비트부터 상기 스위치(160)의 제2 입력 단자(S2)에 제공한다.The decryption packing unit 130 stores a decoded bit string VLW input from the outside and outputs the stored decoded code word VLW as a maximum length of a variable length codeword, To the second input terminal (S2) of the switch (160) according to the length of the code word, from the bit subsequent to the bits decoded in the decoded bit string.
상기 스위치(160)는 상기 제1 및 제2 입력 단자(S1 및 S2)를 통해 입력되는 비트 열에서 한 비트 열을 선택하고 선택된 비트 열(CW)을 상기 가변 길이 검출부(200)에 제공한다.The switch 160 selects one bit string from the bit string input through the first and second input terminals S1 and S2 and provides the selected bit string CW to the variable length detector 200. [
상기 가변 길이 검출부(200)는 도 8에 도시한 바와 같이, 상기 캐노니컬 허프만 코드 트리를 기초로 상기 스위치(160)으로부터의 비트 열(CW)에 포함된 가변 길이 코드 워드의 길이 LEG(X)를 검출한다.8, the variable length detecting unit 200 detects the length LEG (X) of the variable length codeword included in the bit string CW from the switch 160 based on the canonical Huffman code tree, ).
상기 가변 길이 검출부(200)는 상기 비트 열(CW)에 포함된 가변 길이 코드 워드의 길이 LEG(X)를 검출하기 위해 상기 비트 열(CW)에서 1비트부터 K비트까지 차례로를 선택하여 선택 코드 워드(BWm)들을 발생시킨다. 이어, 상기 선택 코드 워드(BWm)들이 허프만 코드 트리에 의해 정의되는 레벨들 및 상기 검출된 각 레벨에서의 터미널 노드의 수를 검출한다. 그리고, 선택 코드 워드(BWm), 레벨들 및 상기 검출된 각 레벨에서의 터미널 노드의 수를 근거로, 상기 비트 열(CW)에 포함된 상기 가변 길이 코드 워드의 길이 LEG(X)를 검출한다.The variable length detecting unit 200 sequentially selects 1 bit to K bits in the bit string CW to detect the length LEG (X) of the variable length codeword included in the bit string CW, Words (BW m ). The selected code words (BW m ) then detect the levels defined by the Huffman code tree and the number of terminal nodes at each detected level. The length LEG (X) of the variable length codeword included in the bit string CW is detected based on the selected codeword BW m , the levels, and the number of terminal nodes at each detected level do.
상기 복호화 메모리(660)는 복호화 코드 워드를 허프만 코드 트리에서의 터미널 노드의 위치에 대응하는 주소에 따라 저장한다.The decoding memory 660 stores the decoded codeword according to the address corresponding to the position of the terminal node in the Huffman code tree.
상기 주소 발생부(600)는 상기 가변 길이 검출부(200)에 의해 검출된 가변 길이 코드 워드의 길이에 응답하여 상기 비트 열(CW)에 포함된 가변 길이 코드 워드의 허프만 트리에서의 위치를 검출하고, 상기 검출된 위치에 응답하여 상기 주소를 발생시키고, 상기 발생되는 주소를 상기 복호화 메모리(660)에 제공한다.The address generator 600 detects the position of the variable length codeword included in the bit string CW in the Huffman tree in response to the length of the variable length codeword detected by the variable length detector 200 , Generates the address in response to the detected location, and provides the generated address to the decryption memory 660.
바람직하게는, 상기 가변 길이 검출부(200)는 도 1에 도시된 바와 같이, 상기 가변 길이 코드워드의 길이 LEG(X)를 검출하기 위해 경계 검출부(210) 및 길이 검출부(220)로 구성된다.1, the variable length detector 200 includes a boundary detector 210 and a length detector 220 to detect the length LEG (X) of the variable length codeword.
상기 경계 검출부(210)는 상기 스위치(160)로부터의 상기 비트 열(CW)은 저장 코드워드 M(X)에서 1 비트 내지 K 비트를 차례로 선택하여 K 개의 선택 코드 워드 BW(X)1, BW(X)2, BW(X)3,..., BW(X)K를 발생시킨다. 또한, 상기 경계 검출부(210)는 상기 선택 코드워드 BW(X)m=1,2,...,K각각에 대응하는 허프만 코드 구조에서의 레벨에서의 터미널 노드의 수를 검출한다.The boundary detector 210 sequentially selects 1 bit to K bits of the bit string CW from the switch 160 in the storage codeword M (X) to generate K selected codewords BW (X) 1 , BW (X) 2, to generate a BW (X) 3, ..., BW (X) K. Also, the boundary detecting unit 210 detects the number of terminal nodes at the level in the Huffman code structure corresponding to each of the selected code words BW (X) m = 1, 2, ..., K.
이어, 상기 경계 검출부(210)는 상기 선택 코드워드들 BW(X)m=1,2,...,K각각을 상기 각 레벨에서 터미널 노드의 수들과 비교하고, 그 결과로써 상기 비트 열(CW)에 포함된 가변 길이 코드워드 VLW(X) 및 스터핑 비트들 사이의 경계를 검출하고, 상기 경계 검출 결과로서의 경계 값 MSB(X)m을 발생시키고, 상기 발생되는 경계 값 MSB(X)m을 상기 길이 검출부(220)에 제공한다.Then, the boundary detector 210 compares each of the selected code words BW (X) m = 1, 2, ..., K with the number of terminal nodes at each level, and as a result, CW) the variable-length code words VLW (X) and the stuffing bits detecting a boundary between, and to generate a boundary value MSB (X) m as the edge detection result, the resulting boundary value MSB (X) included in m To the length detector 220.
상기 길이 검출부(220)는 상기 경계 검출부(210)로부터의 경계 값 MSB(X)m을 근거로 상기 비트 열(CW)에 포함된 상기 가변 길이 코드워드의 길이 LEG(X)를 상기 부호화 팩킹부(310)에 제공한다.The length detector 220 detects the length LEG (X) of the variable length codeword included in the bit string CW based on the boundary value MSB (X) m from the boundary detector 210, (310).
도 2는 도 1에 도시한 경계 검출부(210)의 일 예를 도시한 회로 구성도이다.2 is a circuit configuration diagram showing an example of the boundary detection unit 210 shown in FIG.
도 2를 참조하면, 상기 경계 검출부(210)는 상기 경계 값 MSB(X)m을 검출하기 위해 바람직하게는, 코드 선택부(510), 레벨 검출부(520), 연산부(530), 및 경계 값 발생부(540)로 구성된다.2, the boundary detector 210 preferably includes a code selector 510, a level detector 520, a calculator 530, and a boundary value MSB (X) m to detect the boundary value MSB And a generating unit 540.
상기 코드 선택부(510)는 상기 부호화 메모리(150)로부터의 저장 코드워드 M(X)에서 1부터 K 비트까지 차례로 선택하여 상기 선택 코드 워드들 BW(X)m을 발생시키고, 상기 발생된 선택 코드 워드들 BW(X)m=1,2,...,K을 상기 레벨 검출부(520) 및 상기 연산부(530)에 각각 제공한다.The code selector 510 generates the selected code words BW (X) m by sequentially selecting from 1 to K bits in the stored code word M (X) from the encoding memory 150, And provides the codewords BW (X) m = 1, 2, ..., K to the level detector 520 and the arithmetic unit 530, respectively.
상기 코드 선택부(510)로부터 소정의 선택 코드 워드 BW(X)m가 입력되는 경우, 상기 레벨 검출부(520)는상기 코드 선택부(510)로부터 소정의 선택 코드 워드 BW(X)m각각에 응답하여 상기 선택 코드 워드 BW(X)m의 허프만 트리에서의 레벨 m을 검출한다. 그리고, 루트로부터 상기 검출된 레벨 m까지 각 레벨에서의 터미널 노드수를 검출하고, 각 레벨에 대응하는 웨이트(weight)를 상기 터미널 노드수에 부여하며, 상기 웨이트가 부여된 터미널 노드수들을 합산하여, 레벨 코드 워드들 NW(X)m를 발생시킨다.When a predetermined selection code word BW (X) m is input from the code selection unit 510, the level detection unit 520 receives the selected code word BW (X) m from the code selection unit 510 And detects the level m in the Huffman tree of the selected code word BW (X) m in response. Then, the number of terminal nodes at each level from the route to the detected level m is detected, a weight corresponding to each level is given to the number of terminal nodes, and the number of terminal nodes to which the weight is given is added , And level code words NW (X) m .
즉, 상기 선택 코드 워드 BW(X)m에 의해 정의된 레벨 m에 대한 웨이트된 수들의 합은 다음과 수학식 1과같은 형태를 갖는다.That is, the sum of the weighted numbers for the level m defined by the selected code word BW (X) m has the form as shown in the following Equation (1).
여기서, j는 허프만 코드 트리에서의 레밸, 그리고 Lj는 레벨 j에서의 터미널 노드의 수이다.Here, j is rebael, and L j in the Huffman code tree is the number of terminal nodes at level j.
상기 레벨 검출부(520)는 상기 합 WS(X)m을 2진수로 변환하여 상기 레벨 코드 워드 NW(X)m를 발생시키고, 상기 레벨 코드 워드 NW(X)m를 상기 연산부(530)에 제공한다.The level detector 520 generates the level code word NW (X) m by converting the sum WS (X) m into a binary number and provides the level code word NW (X) m to the arithmetic unit 530 do.
상기 연산부(530)는 상기 코드 선택부(510)로부터의 상기 선택 코드워드들 BW(X)m=1,2,..,K에서 상기 레벨 검출부(520)로부터의 상기 레벨 코드 워드들 NW(X)m=1,2,..,K을 감산하고, 그 감산 결과인 위치 값들 LD(X)m=1,2,..,K을 상기 주소 발생부(600) 및 상기 경계 값 발생부(540)에 각각 제공한다. 상기 감산 결과들 LD(X)m=1,2,..,K는 상기 선택 코드 워드들 BW(X)m=1,2,..,K각각에 대해 가변 길이 코드 워드들의 비트들로 구성되었는지를 그 여부를 나타낸다.The operation unit 530 receives the level code words NW (X) from the level detection unit 520 at the selected code words BW (X) m = 1, 2, .., K from the code selection unit 510 X) m = 1,2, .., K is subtracted, and the result of the subtraction of position values LD (X) m = 1,2, .., K the address generation unit 600 and the threshold generating part (540). The subtraction results LD (X) m = 1,2, .., K are composed of bits of variable length codewords for each of the selected codewords BW (X) m = 1, Whether or not it is.
도 3은 도 2에 도시한 연산부의 일 예를 도시한 회로 구성도이다.3 is a circuit configuration diagram showing an example of the operation unit shown in Fig.
도 3을 참조하면, 상기 연산부(530)는 상기 코드 선택부(510)로부터의 상기 선택 코드워드 BW(X)m에서 상기 레벨 검출부(520)로부터의 상기 레벨 코드 워드 NW(X)m를 감산하기 위해 제1 내지 제K 감산기(531 내지 537)로 구성된다.3, the operation unit 530 subtracts the level code word NW (X) m from the level detection unit 520 in the selected code word BW (X) m from the code selection unit 510 First to Kth subtractors 531 to 537, respectively.
상기 제1 내지 제K 감산기(531 내지 537)는 각각 상기 선택 코드워드 BW(X)1내지 상기 선택 코드워드 BW(X)K에서 상기 레벨 코드 워드 NW(X)1내지 레벨 코드 워드 NW(X)K을 감산하고, 제1 내지 제K 감산 결과 LD(X)1내지 LD(X)K를 상기 경계 값 발생부(540)에 제공한다.The first through the K subtractors (531 to 537) are each of the selected code words BW (X) 1 to the selected code words BW (X), the level codes in K word NW (X) 1 to level codeword NW (X ) K and provides LD (X) 1 to LD (X) K as a result of the first to Kth subtraction to the boundary value generator 540.
상기 경계 값 발생부(540)는 상기 연산부(530)로부터의 제1 내지 제K 감산 결과 LD(X)1내지 LD(X)K로부터 최상위 비트들 MSB(X)m=1,2,..,K을 검출하고, 상기 검출된 MSB(X)m=1,2,..,K을 경계 값 MSB(X)m=1,2,..,K으로서 상기 길이 검출부(220)에 제공한다. 상기 경계 값 MSB(X)m=1,2,..,K은 상기 저장 코드 워드 M(X)의 스터핑 비트들 및 가변 길이 코드 워드 VLW(X)사이의 경계를 나타낸다.The boundary value generator 540 generates the most significant bits MSB (X) m = 1, 2, ... from the first through K th subtraction results LD (X) 1 through LD (X) K from the calculator 530 . , detects and K, the detected MSB (X) m = 1,2, .., K the threshold MSB (X) m = 1,2, .., provided to the length detection unit 220 as the K . The boundary value MSB (X) m = 1, 2, .., K represents the boundary between the stuffing bits of the stored codeword M (X) and the variable length codeword VLW (X).
다시 도 1을 참조하면, 상기 길이 검출부(220)는 상기 저장 코드 워드 M(X)의 스터핑 비트들 및 가변 길이 코드 워드 VLW(X)사이의 경계를 나타내는 상기 경계 값 MSB(X)m=1,2,..,K을 근거로 상기 길이 값 LEG(X)를 발생시킨다.1, the length detector 220 detects the boundary value MSB (X) m = 1 indicating the boundary between the stuffing bits of the stored codeword M (X) and the variable length codeword VLW (X) , 2, ..., K to generate the length value LEG (X).
도 4는 도 1에 도시한 길이 검출부의 일 예를 도시한 회로 구성도이다.FIG. 4 is a circuit diagram showing an example of the length detector shown in FIG. 1. FIG.
도 4를 참조하면, 상기 길이 검출부(220)는 K개의 XOR 게이트로 구성된다.Referring to FIG. 4, the length detector 220 includes K XOR gates.
제1 XOR 게이트는 '0' 값 및 MSB(X)1을, 그리고 제n XOR 게이트는 MSB(X)n-1및 MSB(X)n을 배타적 논리합한다. 여기서 n은 2부터 K까지의 정수이다.The XOR gate 1 is "0" value and MSB (X) 1, and the n XOR gate is the exclusive-OR of MSB (X) n-1 and MSB (X) n. Where n is an integer from 2 to K.
그리고, 상기 K개의 XOR 게이트들에 의해 발생되는 로직 값들은 상기 저장 코드 워드 M(X)의 가변 길이 코드 워드 VLW(X)의 길이 값으로서 상기 부호화 부호화 팩킹부(310), 및 상기 주소 발생부(600)에 각각 출력된다.The logic values generated by the K XOR gates are the length values of the variable length codeword VLW (X) of the stored codeword M (X), and the logic values generated by the coding encoding packing unit 310, Respectively.
다시 도 1을 참조하면, 상기 부호화 팩킹부(310)는 상기 가변 길이 검출부(200)로부터의 가변 길이 코드 워드의 길이 LEG(X)에 응답하여 상기 저장 코드 워드 M(X)i에서 가변 길이 코드 워드 VLW(X)를 검출하고, 상기 검출되는 가변 길이 코드 워드 VLW(X)를 외부에 출력시킨다.Referring again to FIG. 1, the encoding and decoding unit 310 encodes the variable length code M (X) i in the storage codeword M (X) i in response to the length LEG (X) of the variable length codeword from the variable length detector 200, Detects the word VLW (X), and outputs the detected variable length codeword VLW (X) to the outside.
상기 부호화 팩킹부(310)는 바람직하게는 도 5에 도시한 바와 같이, 입력부(410), 누산부(420), 및 출력부(430)로 구성된다.5, the encoding and packing unit 310 preferably includes an input unit 410, an accumulator 420, and an output unit 430. [
도 5를 참조하면, 상기 입력부(410)는 제1 배럴 시프터(Barel Shifter; 411) 및 제1 래치(Latch; 412)로 구성된다. 상기 입력부(410)는 제1 배럴 시프터(Barrel Shifter; 411) 및 제1 래치(Latch; 412)로 구성된다.Referring to FIG. 5, the input unit 410 includes a first barrel shifter 411 and a first latch 412. The input unit 410 includes a first barrel shifter 411 and a first latch 412.
상기 입력부(410)의 제1 배럴 시프터(411)는 상기 가변 길이 검출부(200)로부터의 가변 길이 코드워드의 길이 값 LEG(X)에 응답하여, 상기 부호화 메모리(150)로부터의 저장 코드 워드 M(X)의 비트 열 및 상기 제1 래치(412)로부터의 제1 래치 비트 열을 슬라딩(sliding)하여 K 비트의 제1 윈도우 비트 열 B1을 독출하고, 상기 제1 윈도우 비트 열 B1을 상기 제1 레치(412)에 제공한다.The first barrel shifter 411 of the input unit 410 receives the stored codeword M from the encoding memory 150 in response to the length value LEG (X) of the variable length codeword from the variable length detector 200 The first window bit string B 1 is read by sliding the bit string of the first window bit string X and the first latch bit string from the first latch 412 to read out the K bit first window bit string B 1, To the first latch (412).
상기 제1 레치(412)는 상기 제1 윈도우 비트 열 B1을 저장하고, 상기 제1 윈도우 비트 열 B1과 동일한 비트 값을 갖는 제1 레치 비트 열 W1을 상기 제1 베럴 시프터(411) 및 상기 출력부(430)에 각각 제공한다. 따라서, 앞서 설명한 바와 같이, 상기 제1 레치 비트 열 W1및 저장 코드 워드 M(X)의 비트 열이 병렬로 상기 제1 배럴 시프터에 입력된다.The first latch 412 is the first storing the window bit stream B 1, the first window bit string first latch bit string W 1 of the first barrel shifter 411, to have the same bit value, and B 1 And the output unit 430, respectively. Therefore, as described above, the bit streams of the first latch bit stream W 1 and the storage codeword M (X) are input to the first barrel shifter in parallel.
상기 누산부(420)는 도 5에 도시된 바와 같이, 가산기(421), 제2 래치(422), 감산기(423), 및 제3 래치(424)로 구성된다. 상기 누산부(420)의 가산기(421)는 상기 가변 길이 검출부(200)로부터의 길이 값 LEG(X) 및 상기 제2 래치(422)로부터의 래치 값 L1을 K-모듈(module-K)로 가산하여 가산된 값을 상기 제2 래치(422)에 제공한다. 또한, 상기 가산기(421)는 상기 가산된 값이 K이상인 경우에는 캐리 신호(C)를 발생시킨다. 상기 캐리 신호(C)는 이후에 설명할 출력부(430)의 제4 래치(432)에 가변 코드 워드 M(X)i의 비트들로 채워졌음을 외부에 알리기 위한 것이다.5, the accumulator 420 includes an adder 421, a second latch 422, a subtracter 423, and a third latch 424. The adder 421 of the accumulator 420 receives the length value LEG (X) from the variable length detector 200 and the latch value L 1 from the second latch 422 in the K-module (module-K) And provides the added value to the second latch 422. The adder 421 generates a carry signal C when the added value is K or more. The carry signal C is for informing the outside that the fourth latch 432 of the output unit 430 to be described later is filled with the bits of the variable code word M (X) i .
상기 제2 래치(422)는 상기 가산기(421)로부터의 가산 값을 저장하고, 상기 저장된 가산 신호를 래치된 값 L1로서 상기 감산기(423) 및 상기 가산기(421)에 각각 제공한다. 상기 감산기(423)는 가변 길이 코드워드의 최대 길이 K=610에서 상기 제2 래치(422)로부터의 상기 래치된 값 L1을 감산하여 감산 값 S0을 발생시킨다.The second latch 422 stores the addition value from the adder 421 and provides the stored addition signal to the subtracter 423 and the adder 421 as the latched value L 1 , respectively. The subtractor 423 by subtracting the latched value L 1 from the second latch 422 in the K = 6 10 variable-length The maximum length of the codeword to generate a subtraction value S 0.
상기 제3 래치(424)는 상기 감산 값 S0을 저장하고, 상기 저장된 감산 신호 S0을 상기 출력부(430)의 제어 신호 L2로서 상기 출력부(430)에 제공한다.The third latch 424 stores the subtracted value S 0 and provides the stored subtracted signal S 0 to the output unit 430 as a control signal L 2 of the output unit 430.
상기 출력부(430)는 제2 배럴 시프터(431) 및 제4 래치(432)로 구성된다. 상기 제2 배럴 시프터(431)는 상기 제어 신호 L2에 응답하여 상기 부호화 메모리(150)로부터의 상기 저장 코드워드 M(X)의 비트 열 및 상기 입력부(410)의 제1 래치(412)로부터의 제1 래치 비트 열 W1로 구성되는 2K 비트 열을 슬라이딩하여, 제2 윈도우 비트 열 B2을 발생시키고, 상기 발생되는 상기 제2 윈도우 비트 열 B2을 상기 제4 래치(432)에 출력한다.The output unit 430 includes a second barrel shifter 431 and a fourth latch 432. The second barrel shifter 431 is responsive to the control signal L 2 to output a bit string of the stored code word M (X) from the encoding memory 150 and a bit string of the stored code word M (X) from the first latch 412 of the input unit 410 The second window bit string B 2 is generated by sliding the 2K bit string composed of the first latch bit string W 1 of the first window bit string W 1 and the generated second window bit string B 2 to the fourth latch 432 do.
상기 제4 래치(432)는 상기 제2 배럴 시프터(431)로부터의 제2 윈도우 비트 열 B2을 입력 순서에 따라 저장하고, 저장된 상기 제2 윈도우 비트 열 B2을 가변 길이 코드워드 W2로서 외부에 출력한다.The fourth latch 432 stores the second window bit string B 2 from the second barrel shifter 431 in the input order and stores the stored second window bit string B 2 as the variable length code word W 2 And outputs it to the outside.
도 1을 참조하면, 상기 주소 발생부(600)는 멀티 플렉스(610),상기 레지스터부(610), 상기 제5 래치(630), 제6 래치(640), 및 가산기(650)로 구성된다.1, the address generator 600 includes a multiplexer 610, the register unit 610, the fifth latch 630, a sixth latch 640, and an adder 650 .
상기 멀티플레서(610)는 상기 길이 검출부(220)로부터의 가변 길이 코드 워드의 길이에 응답하여 상기 경계선 검출부(210)로부터의 위치 값들중 한 위치 값을 상기 제6 래치(640)에 출력시킨다.The multiplexer 610 outputs one position value from the boundary detection unit 210 to the sixth latch 640 in response to the length of the variable length codeword from the length detector 220.
상기 레지스터부(610)는 허프만 코드 트리 구조의 복호화할 코드 워드에 대한 해당 레벨 이전 까지의 총 터미널 노드 수들을 각각 저장하고, 상기 길이 검출부(220)으로부터의 가변 길이 코드 워드의 길이에 응답하여 상기 저장된 총 터미널 노드 수를 상기 제5 래치(630)에 제공한다.The register unit 610 stores the total number of terminal nodes before the corresponding level with respect to the codeword to be decoded in the Huffman code tree structure, And provides the stored total number of terminal nodes to the fifth latch 630.
상기 제5 래치(630)는 상기 레지스터부(620)로부터의 상기 총 터미널 노드수를 래치하여 상기 래치된 일 총 터미널 노드수를 상기 가산기(650)에 제공한다.The fifth latch 630 latches the total number of terminal nodes from the register portion 620 and provides the number of latched total terminal nodes to the adder 650.
상기 제6 래치(640)는 상기 멀티플렉서(610)로부터의 상기 위치 값을 래치하고, 래치된 위치 값을 상기 가산기(650)에 제공한다.The sixth latch 640 latches the position value from the multiplexer 610 and provides the latched position value to the adder 650.
상기 가산기(650)는 상기 제5 및 제6 래치(630 및 640)로부터의 상기 일 총 터미널 노드수와 상기 위치 값을 가산하여 그 가산치를 상기 주소로서 상기 복호화 메모리(660)에 출력시킨다. 상기 메모리(660)는 복호화 코드 워드를 부호화된 코드 워드의 노드 위치에 따라 허프만 트리의 루트 부터 순차적으로 저장하고, 상기 가산기(650)으로부터의 가산치에 응답하여 해당 복호화 코드 워드(Si)를 출력시킨다.The adder 650 adds the number of the total terminal nodes from the fifth and sixth latches 630 and 640 and the position value and outputs the added value to the decryption memory 660 as the address. The memory 660 sequentially stores the decoded codeword from the root of the Huffman tree according to the node position of the encoded codeword and outputs the decoded codeword Si in response to the addition value from the adder 650 .
이하, 첨부된 도면을 참조하여 본 발명에 따른 가변 길이 코덱 장치를 보다 상세히 설명한다.Hereinafter, a variable length codec according to the present invention will be described in detail with reference to the accompanying drawings.
먼저, 상기 가변 길이 코덱 장치의 인코딩 동작을 설명하면, 상기 버퍼(110)를 통해 데이터 소스로부터 발생 가능한 심볼들이 모두 [a, b, c, d, e, f, g, h]이고, 각 심볼의 발생 빈도 수가 차례로 15, 13, 12, 11, 5, 2, 1, 1인 경우, 도 8에 나타낸 바와 같이, 상기 8개의 심볼들에는 그 발생 빈도수에 따라 가변 길이 코드 워드가 할당된다. 캐노니컬 허프만 코드 트리에 따라 상기 8개의 심볼에 할당된 가변 길이 코드 워드의 코드 값을 아래의 표 1에 나타낸 바와 같다.B, c, d, e, f, g, h] are generated from the data source through the buffer 110, 13, 12, 11, 5, 2, 1, and 1, the variable length codeword is allocated to the eight symbols according to the frequency of occurrence, as shown in FIG. The code values of the variable length codewords allocated to the eight symbols according to the Canonical Huffman code tree are shown in Table 1 below.
표 1에 나타낸 바와 같이, 캐노니컬 허프만 트리 구조에 의거하여 가장 빈도수가 큰 심볼 [a]에 1비트의 가변 길이 코드워드 VLW(X)가 할당되며, 빈도수가 가장 적은 심볼 [g, h]에는 6비트의 가변 길이 코드워드가 할당된다.As shown in Table 1, the variable length codeword VLW (X) of 1 bit is allocated to the symbol [a] having the highest frequency based on the canonical Huffman tree structure, and the symbol [g, h] A variable length code word of 6 bits is allocated.
상기 부호화 메모리(150)에는 아래의 표 2에 나타낸 바와 같이, 상기 각각의 심볼(X)을 주소로 상기 가변 길이 코드 워드 VLW(X)가 저장된다. 상기 가변 길이 코드워드 VLW(X)는 상기 부호화 메모리(150)의 각 단위의 메모리 셀의 최상위의 자리(MSB)부터 최하위 자리(NSB)의 순서로 채워지며, 가변 길이 코드워드 VLW(X)가 저장되고 남는 자리에는 스터핑 비트(또는 don't care)들이 채워진다.As shown in Table 2 below, the variable length codeword VLW (X) is stored in the coding memory 150 with each of the symbols X as an address. The variable length codeword VLW (X) is filled in the order from the most significant digit (MSB) to the least significant digit (NSB) of the memory cells of each unit of the encoding memory 150, and the variable length codeword VLW Stuffing bits (or do not care) are filled in the remaining space.
따라서, 상기 부호화 메모리(150)는 어떤 심볼 X가 입력되는 경우, 입력된 심볼 X를 주소로 갖는 저장 코드 워드 M(X)를 발생시킨다.Accordingly, when the symbol X is input, the encoding memory 150 generates a stored code word M (X) having the input symbol X as an address.
상기 버퍼(110)로부터 상기 부호화 메모리(150)는 표 2에 나타낸 바와 같이, 상기 심볼(X) [c]를 주소로 저장된 [101XXX]의 비트 열을 상기 저장 코드 워드 M(c)로서 발생시키고, 상기 6 비트의 저장 코드 워드 M(c)를 상기 스위치(160)의 제1 입력 단자(S1)를 통해 병렬로 상기 가변 길이 검출부(200)의 경계 검출부(210) 및 상기 부호화 팩킹부(310)에 각각 제공한다.The coding memory 150 generates a bit string of [101XXX] stored as an address of the symbol X (c) from the buffer 110 as the stored code word M (c), as shown in Table 2 , The 6 bits of the storage codeword M (c) are supplied to the boundary detector 210 and the encoding packing unit 310 of the variable length detector 200 in parallel through the first input terminal S1 of the switch 160 Respectively.
상기 가변 길이 검출부(200)에 입력되는 상기 저장 코드워드 M(c)는 상기 경계 검출부(210)의 코드 선택부(510)에 입력된다. 상기 저장 코드워드 M(c)가 상기 코드 선택부(510)에 입력되는 경우, 상기 코드 선택부(510)는 상기 저장 코드워드 M(c)에서 아래의 표 3에 나타낸 바와 같이, 1비트 내지 6비트를 차례로 선택하여 선택 코드 워드 BW(c)m=1,2,3...K을 발생시키고, 상기 발생되는 선택 코드 워드 BW(c)m1,2,3...K각각을 상기 경계 검출부(210)의 레벨 검출부(520) 및 연산부(530)에 각각 제공한다.The stored code word M (c) input to the variable length detector 200 is input to the code selector 510 of the boundary detector 210. When the stored code word M (c) is input to the code selection unit 510, the code selection unit 510 selects one or more bits from the stored code word M (c) select the 6-bit code words in order to select BW (c) m = 1,2,3 ... and generating the K, in which the selected code words generated BW (c) m1,2,3 ... to the respective K Level detector 520 and the arithmetic unit 530 of the boundary detection unit 210, respectively.
상기 코드 선택부(510)로부터 상기 선택 코드워드 BW(c)m가 상기 레벨 검출부(520)에 입력되는 경우, 상기 레벨 검출부(520)는 도 8에 나타낸 허프만 코드 트리를 근거로 상기 선택 코드워드 BW(C)m의 레벨 1부터 m 까지의 터미널 노드들의 수를 검출하고, 앞서 설명한 바와 같이, 각 레벨에 따라 웨이트된 레벨 코드 워드 NW(c)m를 발생시킨다.When the selected code word BW (c) m is input from the code selection unit 510 to the level detection unit 520, the level detection unit 520 detects the selected code word BW (c) m based on the Huffman code tree shown in FIG. Detects the number of terminal nodes from level 1 to m of BW (C) m , and generates a level code word NW (c) m weighted according to each level as described above.
예컨데, m=3인 경우, 상기 표 3에 나타낸 바와 같이, 상기 코드 선택부(510)로부터 선택 코드워드 BW(C)3=[101]이 발생된다.이 때, 상기 레벨 검출부(520)는 각 레벨에 웨이트를 부여하고, 웨이트가 부여된 터미널 노드의 수를 합하여, 다음의 수학식 2와 같은 합을 발생시킨다.For example, when m = 3, the selected code word BW (C) 3 = [101] is generated from the code selection unit 510 as shown in Table 3. At this time, Weights are given to each level, and the number of weighted terminal nodes is added to generate a sum as shown in Equation (2).
여기서, j는 허프만 코드 트리에서의 레벨이며, Lj는 레벨 j에서의 터미널 노드의 수이다.Where j is the level in the Huffman code tree and L j is the number of terminal nodes at level j.
이어, 상기 레벨 검출부(520)는 상기 합 WS(c)3을 2진수로 변환하여 레벨 코드 워드 NW(c)3=[0001000]을 발생시킨다. 모든 선택 코드 워드 BW(c)m(m=1,2,..., 6)에 대한 레벨 코드 워드 NW(c)m는 아래의 나타낸 표 4와 같다.Then, the level detector 520 converts the sum WS (c) 3 into a binary number to generate a level code word NW (c) 3 = [0001000]. The level code word NW (c) m for all selected code words BW (c) m (m = 1,2, ..., 6) is shown in Table 4 below.
상기 레벨 코드 워드 NW(c)m및 선택 코드 워드 BW(c)m들이 각각 상기 연산부(530)에 입력되는 경우, 상기 연산부(530)에 입력된 상기 레벨 코드 워드 NW(c)m및 선택 코드 워드 BW(c)m들은 도 3에 도시한 바와 같이, 상기 연산부(530)의 제1 내지 제6 감산기(531 내지 536)에 차례로 입력된다.The level codeword NW (c) m and selecting code words BW (c) m have the above-level code word NW (c) m and select code input on the operating section 530, if each input to the arithmetic unit 530 The words BW (c) m are sequentially input to the first to sixth subtractors 531 to 536 of the operation unit 530, as shown in FIG.
상기 제1 내지 제6 감산기(531 내지 536)는 다음의 수학식 3과 같은 함수LD(c)m을 행하게 된다.The first to sixth subtractors 531 to 536 perform the function LD (c) m as shown in the following Equation (3).
따라서, 연산부(530)은 아래의 표 5에 나타낸 바와 같이, 제1 내지 제6 감산 결과 LD(c)m=1,2,...,6를 발생시킨다.Therefore, the operation unit 530 generates the first to sixth subtraction results LD (c) m = 1, 2, ..., 6 as shown in Table 5 below.
그리고, 상기 입력 심볼 [c]에 대한 상기 연산부(530)의 제1 내지 제6 감산기(531 내지 536)로부터 출력되는 제1 감산 결과 LD(c)1내지 제6 감산 결과LD(c)6은 상기 경계값 발생부(540)에 제공된다.The first subtraction results LD (c) 1 to the sixth subtraction result LD (c) 6 outputted from the first to sixth subtractors 531 to 536 of the operation unit 530 with respect to the input symbol [c] And is provided to the boundary value generator 540.
상기 연산을 보다 상세히 설명하면, 상기 제1 내지 제6 감산기(531 내지 536)는 아래의 수학식 4와 같은 제1 내지 제6 감산 결과 LD(c)1내지 LD(c)6을 발생시킨다.The first to sixth subtractors 531 to 536 generate the first to sixth subtraction results LD (c) 1 to LD (c) 6 as shown in the following Equation (4).
여기서, bi는 선택 코드 워드 BW(c)m의 i번째 비트 값, 그리고 Lj는 레벨 j에서의 터미널 노드의 수이다.Where b i is the i-th bit value of the selected code word BW (c) m , and L j is the number of terminal nodes at level j.
상기 경계 값 발생부(540)는 상기 제1 감산 결과 LD(c)1내지 제6 감산 결과 LD(c)6에서 최상위 비트들(MSB)을 검출하고, 최상위 비트들(MSB)의 비트 값들을 저장 코드워드 M(c)의 가변 길이 코드워드 VLW(c) 및 스터플링 코드 사이의 경계를 나타내는 경계 값 MSB(c)으로서 상기 길이 검출부(220)에 제공한다.The boundary value generator 540 detects the most significant bits MSB in the first subtraction result LD (c) 1 to the sixth subtraction result LD (c) 6 and outputs the bit values of the most significant bits MSB To the length detector 220 as a variable length codeword VLW (c) of the stored codeword M (c) and a boundary value MSB (c) indicating the boundary between the stapling codes.
도 4에 도시한 바와 같이, 상기 길이 검출부(220)에 입력된 경계 값 MSB(C)m=1,2,...,6=[000111]의 각각의 비트는 병렬로 상기 제1 내지 제6 XOR 게이트(610 내지 660)에 각각 입력되어, 그 결과 상기 길이 검출부(220)는 상기 심볼 [c]의 가변 길이 코드 워드 VLW(c)의 길이 VLG(c)를 나타내는 길이 값 LEG(c)으로서의 비트 열 [000100]을 발생시킨다.4, each bit of the boundary value MSB (C) m = 1, 2, ..., 6 = [000111] input to the length detector 220 is divided into the first through (C) indicating the length VLG (c) of the variable length codeword VLW (c) of the symbol [c], as a result of which the length detector 220 outputs a length value LEG To generate a bit string [000100].
상기 길이 값 LEG(c)이 상기 부호화 팩킹부(310)에 입력되는 경우, 상기 부호화 팩킹부(310)는 상기 길이 값 LEG(c)에 응답하여 저장 코드 워드 M(C)에서 가변 길이 코드워드 VLW(C)만을 검출하고, 검출된 가변 길이 코드워드 VLW(C)를 외부에 출력한다.When the length value LEG (c) is input to the encoding and decoding unit 310, the encoding and decoding unit 310 encodes the variable length codeword M (C) in the storage codeword M (C) in response to the length value LEG Only the VLW (C) is detected, and the detected variable length code word VLW (C) is output to the outside.
이하, 상기 부호화 팩킹부(310)의 동작을 도 5를 참조하여 보다 상세히 설명한다.Hereinafter, the operation of the coding and packing unit 310 will be described in more detail with reference to FIG.
먼저 시간 t=1에서, 상기 부호화 팩킹부(310)에 상기 부호화 메모리(150)로부터 저장 코드 워드 M(X)가 입력되지 않으므로, 상기 부호화 팩킹부(310)의 상기 제1 배럴 시프터(411)는 상기 코드 길이 검출부(220)로부터의 [010]의 가변 길이 코드 워드의 길이 LEG(x)에 응답하여 돈 캐어(don't care)로 구성된 제1 윈도우 비트 열(B1) [xxxxxx]을 상기 제1 래치(412)에 제공한다. 시간 t=2에서, 상기 부호화 메모리(150)로부터 심볼 [a] 에 대한 저장 코드 워드 M(a)가 발생될 때, 상기 부호화 메모리(150)로부터 발생된 상기 심볼 [a] 에 대한 저장 코드 워드 M(a)는 상기 부호화 팩킹부(310)의 입력부(410)의 제1 배럴 시프터(411) 및 출력부(430)의 제2 배럴 시프터(431)에 각각 입력되며, 이와 동시에 상기 제1 배럴 시프터(411) 및 상기 누산부(420)의 가산기(421)에는 각각 상기 가변 길이 검출부(220)로부터 상기 심볼 [a]에 대한 가변 길이 코드 워드의 길이 LEG(b)가 입력된다.The storage codeword M (X) is not input from the encoding memory 150 to the encoding packing unit 310 at time t = 1 and thus the first barrel shifter 411 of the encoding packing unit 310, A first window bit string B 1 [xxxxxx] composed of do not care in response to the length LEG (x) of the variable length codeword [0 10 ] from the code length detector 220, To the first latch (412). A] for the symbol [a] generated from the encoding memory 150 when a stored codeword M (a) for the symbol [a] is generated from the encoding memory 150 at time t = 2, M (a) is input to the first barrel shifter 411 of the input unit 410 of the encoding packing unit 310 and the second barrel shifter 431 of the output unit 430, The length LEG (b) of the variable length codeword for the symbol [a] is input to the shifter 411 and the adder 421 of the accumulator 420 from the variable length detector 220, respectively.
상기 제1 배럴 시프터(411)는 상기 부호화 메모리(150)로부터의 심볼 [a]에 대한 저장 코드 워드 M(a) 및 상기 가변 길이 검출부(220)로부터 상기 가변 길이 코드 워드의 길이 LEG(a)가 입력되는 경우, 상기 가변 길이 코드 워드의 길이 LEG(a) [110]에 응답하여 상기 제1 래치(412)로부터 출력되는 제1 래치 비트 열 [xxxxxx] 및 상기 부호화 메모리(150)로부터 입력되는 저장 코드 워드 M(a)의 비트 열 [a1xxxxx]에서 [110]비트 슬라이딩하여 제1 윈도우 비트 열(B1) [xxxxxa1]를 선택하고, 상기 선택된 [xxxxxa1] 비트 열의 제1 윈도우 비트 열(B1)을 상기 제1 래치(412)에 출력한다.The first barrel shifter 411 receives the storage codeword M (a) for the symbol [a] from the encoding memory 150 and the length LEG (a) of the variable length codeword from the variable length detector 220, If the input, input from the first latch bit string [xxxxxx] and the coding memory 150 to the variable length of the length of the code words in response to the LEG (a) [1 10] output from the first latch (412) storing the code word bits of M (a) in [a 1 xxxxx] [1 10 ] bit sliding is to select the first window bit string (B 1) [xxxxxa 1], wherein the selected [xxxxxa 1] bit sequence the 1 window bit string B 1 to the first latch 412.
한편, 상기 누산부(420)의 제2 가산기(421)는 상기 코드 길이 검출부(220)로부터의 가변 길이 코드 워드의 길이(LEG(a)) 및 상기 제2 래치(422)로부터의 제2 래치 값을 가산하여 가산 신호를 발생시키고, 상기 발생되는 가산 신호를 상기 제2 래치(422)에 출력시킨다. 여기서, 상기 제2 래치 값(L1)이 [010] 이고 상기 가변 길이 코드 워드의 길이 LEG(a)=110의 값을 가지므로, 상기 가산기(421)는 상기 가산 신호로서 [110]의 값을 출력하게 되며, 상기 [110]의 값을 갖는 가산 신호를 상기 제 2래치(422)에 출력시킨다.The second adder 421 of the accumulator 420 receives the length LEG (a) of the variable length codeword from the code length detector 220 and the length of the second latch 422 from the second latch 422, And outputs the added signal to the second latch 422. The second latch 422 outputs the added signal to the second latch 422. [ Since the second latch value L 1 is [0 10 ] and the variable length codeword length LEG (a) = 1 10 , the adder 421 adds [1 10 ], And outputs an addition signal having the value of [ 10 ] to the second latch 422. [
상기 누산부(420)의 감산기(423)는 소정의 값 [610]을 갖는 기준 신호에서 상기 제2 래치(422)로부터의 가산 신호로서의 [010]을 감산하여 [610]의 값을 갖는 감산 신호(S0)를 발생시키고, 상기 발생되는 [610] 값의 감산 신호(S0)를 상기 제3 래치(424)에 제공한다. 상기 제3 래치(424)는 상기 감산기(423)로부터의 [610]값의 감산 신호(S0)를 저장하고, 상기 [510] 값의 감산 신호(S0)를 제3 래치 신호(L2)로서 상기 제2 배럴 시프터(431)에 제공한다. 그러면, 상기 제2 배럴 시프터(431)는 상기 제3 래치 신호(L2)에 응답하여 상기 제1 래치 비트 열 [xxxxxx] 및 상기 저장 코드 워드 M(a)를 6비트 슬라이딩하여 제2 윈도우 비트 열 [a1xxxxx]를 상기 제4 래치(432)에 출력시킨다.Subtractor 423 of the accumulator 420 by subtracting the [0 10] showing an added signal from the second latch 422 from the reference signal having a predetermined value [610] the value of [610] generating a subtracted signal (S 0) and having, a subtracted signal (S 0) in the [610] the value is generated and provided to the third latch (424). The third latch 424, the third latch signal [6 10] store the subtracted signal (S 0) of the value, and subtracting the signal of the [510] value (S 0) from the subtracter 423 ( L 2 ) to the second barrel shifter 431. Then, the second barrel shifter 431 slides the first latch bit string [xxxxxx] and the stored code word M (a) by 6 bits in response to the third latch signal L 2 , And outputs the column [a 1 xxxxx] to the fourth latch 432.
시간 t=3에서, 상기 부호화 메모리(150)로부터 심볼 [b]에 대한 저장 코드 워드 M(b)i가 발생되는 경우, 상기 부호화 메모리(150)로부터 발생된 상기 심볼 'b' 에 대한 저장 코드 워드 M(b)는 앞서 설명한 바와 같이, 상기 부호화 부호화 팩킹부(310)의 입력부(410)의 제1 배럴 시프터(411) 및 출력부(430)의 제2 배럴 시프터(431)에 각각 입력되며, 이와 동시에 상기 제1 배럴 시프터(411) 및 상기 누산부(420)의 가산기(421)에는 각각 상기 가변 길이 검출부(220)로부터 상기 심볼 'b'에 대한 가변 길이 코드 워드의 길이 LEG(b) 값 '310'가 입력된다.When the stored code word M (b) i for the symbol [b] is generated from the encoding memory 150 at time t = 3, the storage code for the symbol 'b' generated from the encoding memory 150 As described above, the word M (b) is input to the first barrel shifter 411 of the input unit 410 and the second barrel shifter 431 of the output unit 430 of the encoding / coding packing unit 310 The length LEG (b) of the variable length codeword for the symbol 'b' from the variable length detector 220 is added to the adder 421 of the first barrel shifter 411 and the accumulator 420, The value '3 10 ' is input.
상기 제1 배럴 시프터(411)는 상기 심볼 'b' 에 대한 저장 코드 워드 M(b)i및 상기 가변 길이 코드 워드의 길이 LEG(b)가 입력되는 경우, 상기 가변 길이 코드 워드의 길이 LEG(b) '310'에 응답하여 상기 제1 래치(412)로부터 출력되는 제1 래치 비트 열 'xxxxxa1' 및 상기 부호화 메모리(150)로부터 입력되는 저장 코드 워드 M(b)i의 비트 열 'b1b2b3xxx' 에서 '310'비트 슬라이딩하여 제1 윈도우 비트 열(B1)로서의 'xxa1b1b2b3'를 선택하고, 상기 선택된 'xxa1b1b2b3' 비트 열을 상기 제1 윈도우 비트 열(B1)로서 상기 제1 래치(412)에 출력한다.When the first code word M (b) i for the symbol 'b' and the length LEG (b) of the variable length codeword are input, the first barrel shifter 411 outputs the variable length codeword length LEG (b) b) a first latch bit string 'xxxxxa 1 ' output from the first latch 412 in response to '3 10 ' and a bit string 'xxxxxa 1 ' of the stored code word M (b) i input from the encoding memory 150 ' xxa 1 b 1 b 2 b 3 'is selected as the first window bit string (B 1 ) by sliding' 3 10 'bits in b 1 b 2 b 3 xxx', and the selected 'xxa 1 b 1 b 2 b 3 'bit string to the first latch 412 as the first window bit string (B 1 ).
한편, 상기 누산부(420)의 가산기(421)는 상기 코드 길이 검출부(400)로부터의 가변 길이 코드 워드의 길이 LEG(b) 및 상기 제2 래치(422)로부터의 제2 래치 값(L1) '110'을 가산하여 가산 값 '410'을 갖는 가산 신호 AD를 발생시키고, 상기 발생되는 가산 신호를 상기 제2 래치(422)에 출력시킨다.The adder 421 of the accumulator 420 receives the length LEG (b) of the variable length codeword from the code length detector 400 and the second latch value L 1 (b) from the second latch 422, ) ' 10 ' to generate an addition signal A D having an added value '4 10 ', and outputs the generated addition signal to the second latch 422.
또한, 상기 누산부(420)의 감산기(423)는 상기 기준 신호로서의 기준 값 '610'에서 상기 제2 래치(422)로부터의 가산 신호로서의 '110'을 감산하여 '510'의 값을 갖는 감산 신호(S0)를 발생시키고, 상기 발생되는 '510' 값의 감산 신호(S0)를 상기 제3 래치(424)에 제공한다. 상기 제3 래치(424)는 상기 감산기(423)로부터의 '510' 값의 감산 신호(S0)를 저장하고, 상기 '510' 값의 감산 신호(S0)를 제3 래치 신호 L2로서 상기 제2 배럴 시프터(431)에 제공한다. 그러면, 상기 제2 배럴 시프터(431)는 상기 제3 래치 신호 L2에 응답하여 상기 제1 래치 비트 열 'xxxxxa1' 및 상기 저장 코드 워드 M(b)='b1b2b3xxx'을 '510' 비트 슬라이딩하여 'a1b1b2b3xx'를 상기 제2 윈도우 비트 열(w2)로서 상기 제4 래치(432)에 출력시킨다.Further, the value of '510' the subtractor 423 is to the reference value '610' as the reference signal subtraction to '110' as the sum signal from the second latch 422 of the accumulator 420, to generate a subtracted signal (S 0) having, a subtracted signal (S 0) of the "510" value is generated and provided to the third latch (424). The third latch 424 stores the subtracted signal (S 0) of the "510" value from the subtractor 423, and the '510' subtracted signal (S 0), the third latch signal value L 2 to the second barrel shifter 431. Then, the second barrel shifter 431 latches the first latch bit string 'xxxxxa 1 ' and the stored code word M (b) = 'b 1 b 2 b 3 xxx' in response to the third latch signal L 2 ' as the "510" bit by sliding, a 1 b 1 b 2 b 3 xx 'of the second window, the bit string (w 2) and outputs to the fourth latch 432.
시간 t=4에서, 상기 부호화 메모리(150)로부터 심볼 [c]에 대한 저장 코드 워드 M(c)i가 발생되는 경우, 상기 부호화 메모리(150)로부터 발생된 상기 심볼 [c] 에 대한 저장 코드 워드 M(c)는 앞서 설명한 심볼 [a] 및 [b]에서와 같이, 상기 입력부(410)의 제1 배럴 시프터(411) 및 출력부(430)의 제2 배럴 시프터(431)에 각각 입력되며, 이와 동시에 상기 제1 배럴 시프터(411) 및 상기 누산부(420)의 가산기(421)에는 각각 상기 가변 길이 검출부(200)로부터 상기 심볼 [c]에 대한 가변 길이 코드 워드의 길이(LEG(b)=3)가 입력된다.C] generated from the encoding memory 150 when the stored codeword M (c) i for the symbol [c] is generated from the encoding memory 150 at time t = 4, The word M (c) is input to the first barrel shifter 411 of the input unit 410 and the second barrel shifter 431 of the output unit 430, as in the symbols [a] and [b] At the same time, the adder 421 of the first barrel shifter 411 and the accumulator 420 receives the length LEG (k) of the variable length codeword for the symbol [c] from the variable length detector 200, b) = 3).
상기 제1 배럴 시프터(411)는 상기 심볼 [c] 에 대한 저장 코드 워드 M(c) 및 상기 가변 길이 코드 워드의 길이 LEG(b)가 입력되는 경우, 상기 가변 길이 코드 워드의 길이 LEG(c) [310]에 응답하여 상기 제1 래치(412)로부터 출력되는 제1 래치 비트 열 [xxa1b1b2b3] 및 상기 부호화 메모리(150)로부터 입력되는 저장 코드 워드 M(c)i의 비트 열 [c1c2c3xxx]에서 3비트 슬라이딩하여 제1 윈도우 비트 열(B1)로서의 [b1b2b3c1c2c3]을 선택하고, 상기 선택된 비트 열 [b1b2b3c1c2c3]을 상기 제1 윈도우 비트 열(B1)로서 상기 제1 래치(412)에 출력한다.When the first code word M (c) for the symbol [c] and the length LEG (b) of the variable length codeword are input, the first barrel shifter 411 determines the length LEG (c ) in response to the [310] of the first latch 412, first latch bit string [xxa 1 b 1 b 2 b 3] and stores the code word M (c inputted from the encoding memory 150) output from the bit string [c 1 c 2 c 3 xxx ] in 3 bits sliding by a first window bit string (b 1) as a [b 1 b 2 b 3 c 1 c 2 c 3] selected, and the selected bit string to the i [b 1 b 2 b 3 c 1 c 2 c 3 ] to the first latch 412 as the first window bit string (B 1 ).
한편, 상기 누산부(420)의 제2 가산기(421)는 상기 코드 길이 검출부(400)로부터의 가변 길이 코드 워드의 길이 LEG(c) 및 상기 제2 래치(422)로부터의 제2 래치 값(L1) [310]을 가산하여 가산 값 [710]를 갖는 가산 신호를 발생시키게 되는데, 상기 가산기(421)는 상기 가산 값이 [610]이상 될 때마다 캐리 신호(c)를 발생시키고, 상기 가산 값 [710]에서 [610]를 감산한 값을 상기 가산 신호를 발생시킨다. 따라서, 상기 가산기(421)는 상기 [110]의 값을 상기 가산 신호로서 상기 제2 래치(422)에 출력시키는 한편, 상기 캐리 신호(C)를 외부에 출력하게 된다.The second adder 421 of the accumulator 420 receives the length LEG (c) of the variable length codeword from the code length detector 400 and the second latch value by adding the L 1) [3 10] there is thereby generate a sum signal having a sum value [710], the adder 421 generates a carry signal (c) whenever the the addition value is more than [610] And generates the addition signal by subtracting [6 10 ] from the addition value [7 10 ]. Therefore, the adder 421 outputs the value of [ 10 2 ] to the second latch 422 as the addition signal, while outputting the carry signal C to the outside.
또한, 상기 누산부(420)의 감산기(423)는 상기 기준 신호로서의 기준 값 [610]에서 상기 제2 래치(422)로부터의 가산 신호로서의 [110]를 감산하여 [510]의 값을 갖는 감산 신호(S0)를 발생시키고, 상기 발생되는 [510] 값의 감산 신호(S0)를 상기 제3 래치(424)에 제공한다. 상기 제3 래치(424)는 상기 감산기(423)로부터의 [510] 값의 감산 신호(S0)를 저장하고, 상기 [510] 값의 감산 신호(S0)를 제3 래치 신호 L2로서 상기 제2 배럴 시프터(431)에 제공한다. 그러면, 상기 제2 배럴 시프터(431)는 상기 제3 래치 신호 L2에 응답하여 상기 제1 래치 비트 열 [xxa1b1b2b3] 및 상기 저장 코드 워드 M(b)=[c1c2c3xxx]을 2 비트 슬라이딩하여 비트 열 [a1b1b2b3c1c2]를 상기 제2 윈도우 비트 열(w2)로서 상기 제4 래치(432)에 출력시킨다.Further, the subtractor 423 of the accumulator 420 is the value of [510] by subtracting [1 10] as the sum signal from the second latch 422 from the reference value [610] as the reference signal to generate a subtracted signal (S 0) having, a subtracted signal (S 0) in the [510] the value is generated and provided to the third latch (424). The third latch 424 is [510] store the subtracted signal (S 0) in value, and the [510] The third latch signal to the subtraction signal (S 0) of the value L from the subtractor 423 2 to the second barrel shifter 431. Then, in response to the third latch signal L 2 , the second barrel shifter 431 latches the first latch bit string [xxa 1 b 1 b 2 b 3 ] and the stored code word M (b) = [c 1 c 2 c 3 xxx] by two bits to output the bit string [a 1 b 1 b 2 b 3 c 1 c 2 ] to the fourth latch 432 as the second window bit string w 2 .
따라서, 상기 캐리 신호(C)의 발생은 상기 출력부(430)의 제4 래치(432)에 가변 길이 코드 워드 VLW(X)들의 비트들만으로 채워졌을 때 발생함으로, 외부에서 상기 캐리 신호(C)에 응답하여 상기 제4 래치(432)의 코드 워드(w2)를 독출하게 되면 상기 저장 코드 워드에서 가변 길이 코드 워드만을 검출할 수 있게 된다.Therefore, the generation of the carry signal C occurs when the fourth latch 432 of the output unit 430 is filled with only the bits of the variable length codewords VLW (X) (W 2 ) of the fourth latch 432 in response to the read code word, it is possible to detect only the variable length codeword in the stored codeword.
이와 같이, 상기 부호화 부호화 팩킹부(310)는 상기 심볼들에 대한 저장 코드 워드 및 가변 길이 코드 워드의 길이가 입력될 때마다 상기와 같은 동작을 반복하여 상기 저장 코드 워드에서 가변 길이 코드 워드만을 검출하여 외부에 출력하게 된다.In this manner, the encoding and encoding unit 310 repeats the above-described operation every time the lengths of the storage codeword and the variable length codeword for the symbols are input, and detects only the variable length codeword in the storage codeword And outputs it to the outside.
따라서, 상기 구성에 의하면, 외부로부터 부호화하기 위한 심볼이 입력될 때마다 입력 심볼에 대한 가변 길이 코드 워드의 길이를 검출하고, 상기 검출된 가변 길이 코드 워드의 길이에 응답하여 부호화 메모리로부터의 저장 코드 워드에서 가변 길이 코드 워드만을 검출 및 출력시킬 수 있게 된다.Thus, according to the above configuration, the length of the variable length codeword for the input symbol is detected whenever a symbol to be encoded from the outside is inputted, and the storage code It is possible to detect and output only the variable length codeword in the word.
이어, 상기 코덱 장치의 디코딩 동작을 설명한다.Next, the decoding operation of the codec apparatus will be described.
먼저, 버퍼(110)에서 처럼, 상기 심볼들 [c b a a e....]에 대응하는 복호화 비트열의 [101100001110....] 이 입력되는 경우, 상기 스위치(160)은 상기 복호화 팩킹부(130)의 제2 입력 단자(S2)에 접속되며, 상기 복호화 팩킹부(130)로부터의 복호화 코드 비트열에서 가변 길이 코드 워드의 최대 길이 K=6 만큼의 비트 열(ECSi)를 상기 경계 검출부(210)에 제공한다.First, when [101100001110 ....] of a decoding bit string corresponding to the symbols [cbaa e ....] is input as in the buffer 110, the switch 160 transmits the decoded data to the decryption packing unit 130 (ECS i ) of the maximum length K of the variable length codeword in the decoded code bit string from the decoding packing unit 130 to the second input terminal S2 of the boundary detection unit 210).
그러면, 상기 경계 검출부(210)는 상기 인코딩 동작에서와 같이, 상기 스위치(160)을 통해 입력되는 복호화할 비트 열(CW)에 포함된 가변 길이 코드 워드의 경계를 검출하고, 검출된 가변 길이 코드 워드의 경계를 나타내는 경계 값을 발생시킨다. 또한, 상기 경계 검출부(210)는 상기 연산부(530)의 제1 내지 제6 감산기(531 내지 536))로부터 출력되는 제1 위치 값 LD(c)1내지 제6 위치 값 LD(c)6을 복호화 코드 워드의 어드레스로 이용하기 위하여 멀티플렉서(610)에 인가한다.Then, as in the encoding operation, the boundary detector 210 detects the boundary of the variable length codeword included in the bit stream CW to be decoded inputted through the switch 160, and outputs the detected variable length codeword And generates a boundary value indicating the boundary of the word. The boundary detection unit 210 detects the first position values LD (c) 1 to LD (c) 6 output from the first to sixth subtractors 531 to 536 of the arithmetic unit 530 And applies it to the multiplexer 610 for use as the address of the decoded code word.
상기 길이 검출부(220)는 앞서 설명한 바와 같이 상기 경계 검출부(210)으로부터의 상기 경계 값 MSBm로부터 상기 비트 열(CW)에 포함된 가변 길이 코드 워드의 길이 LEG(X)를 검출하고, 상기 검출된 가변 길이 코드 워드의 길이 LEG(X)를 상기 복호화 팩킹부(130) 및 상기 주소 발생부(600)의 상기 멀티플렉스(610) 및 상기 다수의 레지스터(620)에 각각 제공한다.The length detector 220 detects the length LEG (X) of the variable length codeword included in the bit string CW from the boundary value MSB m from the boundary detector 210 as described above, Length codeword LEG (X) to the multiplexer 610 and the plurality of registers 620 of the decryption packing unit 130 and the address generator 600, respectively.
즉, 상기 복호화 팩킹부(130)로부터 비트 열[101100]이 상기 경계 검출부(210)에 입력되는 경우, 상기 경계 검출부(210)는 상기 비트열 [101100]로부터 가변 길이 코드 워드의 경계를 검출을 위하여 앞서 설명한 바와 같이, 상기 제1 내지 제6 감산기(531 내지 536)으로부터의 위치 값들 LDk=1,2,...6을 병렬로 연산한다.That is, when the bit string [101100] is input from the decoding packing unit 130 to the boundary detection unit 210, the boundary detection unit 210 detects the boundary of the variable length codeword from the bit string [101100] The position values LD k = 1, 2, ..., 6 from the first to sixth subtractors 531 to 536 are calculated in parallel as described above.
즉, 상기 위치 값들 LDk=1,2,...6은 다음 표.6에 나타낸 바와 같다.That is, the position values LD k = 1, 2, ... 6 are as shown in Table 6 below.
이때, 경계 검출부(210)는 연산한 위치 값들(LD1,LD2,LD3, LD4,LD5,LD6)을 복호화 코드 워드의 어드레스로 이용하기 위하여 상기 멀티플렉서(610)에 출력한다. 상기 경계 검출부(210)는 또한 연산된 위치 값들(LD1,LD2,LD3, LD4,LD5,LD6)의 음/양을 판단하기 위하여 상기 위치 값들(LD1,LD2,LD3, LD4,LD5,LD6)의 최상이 비트들 [MSBm= 000111]을 상기 경계 값(MSBm)으로서 상기 코드 길이 검출부(220)에 인가한다. 그러면, 상기 길이 검출부(220)는 상기 상기 경계 값 [MSBm= 000111]을 배타적 논리 합하여 가변 길이 코드 워드의 길이 LEG(X)=[00100]를 발생시킨다.At this time, the boundary detection unit 210 outputs the calculated position values (LD 1 , LD 2, LD 3 , LD 4 , LD 5, and LD 6 ) to the multiplexer 610 for use as an address of a decoded codeword. The boundary detector 210 also calculates the position values LD 1 , LD 2, LD 3 , LD 4 , LD 5, LD 6 to determine the sound amount of the calculated position values LD 1 , LD 2, LD 3, (MSB m = 000111) of the LDs 3 , 4 , 5, and 6 to the code length detector 220 as the boundary value MSB m . Then, the length detector 220 exclusively ORs the boundary value [MSB m = 000111] to generate a length LEG (X) = [00100] of the variable length codeword.
그러면, 상기 멀티플렉스(610)는 상기 가변 길이 검출부(200)에 의해 검출된 가변 길이 코드 워드의 길이 LEG(X)=[00100]에 응답하여 상기 경계 검출부(210)로부터의 위치 값들 LD(X)m중 한 위치 값 LD(X)2=[1]을 상기 제6 래치(640)에 출력시킨다.The multiplexer 610 receives the position values LD (X) from the boundary detector 210 in response to the length LEG (X) = [00100] of the variable length codeword detected by the variable length detector 200, ) and outputs a position value of LD (X) 2 = a [1] to the sixth latch 640 of the m.
이와 동시에, 상기 다수의 레지스터(620)중 레벨 2까지의 터미널 노드의 수[1]를 저장하고 있는 레지스터만이 인에블되어 레벨 2까지의 터미널 수 [1]이 상기 제5 래치(630)에 출력된다.At the same time, only the register storing the number [1] of terminal nodes up to level 2 among the plurality of registers 620 is enabled, and the number of terminals [1] .
그러면, 상기 가산기(650)는 상기 멀티플렉스(610)로부터의 위치 값 LD(X)2=1에 상기 다수의 레지스터(620)로부터의 터미널 노드 수 [1]이 가산하여 복호화 코드 워드의 주소 [2]를 발생시키고, 상기 발생되는 주소 [2]를 상기 복호화 메모리(660)에 출력시켜, 상기 복호화 메모리(660)으로부터 상기 가변 길이 코드 워드 [101]에 대응하는 복호화 코드 워드(Si)를 발생시키게 한다.Then, the adder 650 adds the number of terminal nodes [1] from the plurality of registers 620 to the position value LD (X) 2 = 1 from the multiplex 610 and outputs the decoded code word address [ 2] and outputs the generated address [2] to the decoding memory 660 to generate a decoded code word Si corresponding to the variable length codeword [101] from the decoding memory 660 .
그리고 또한, 상기 복호화 팩킹부(130)는 가변 길이 코드 워드의 길이 LEG(X)=[001000]에 응답하여 복호 처리된 입력 비트열 [101]을 제외한 다음 비트 부터 가변 길이 코드 워드의 최대 길이만큼의 비트열을 패킹하여 경계 검출부(210)로 인가하므로써 상기와 같은 과정을 통해 다음 비트 열 [100001110 . . . . .]의 코드 워드를 모두 복호화할 수 있게 된다.In addition, the decoding and packing unit 130 may store the variable length codeword in the range of the maximum length of the variable length codeword from the next bit excluding the decoded input bit string [101] in response to the length LEG (X) = [001000] And then the bit string of the next bit string [100001110. . . . .] Can be decoded.
상기한 바와 같이, 본 발명에 의하면, 가변 길이 부호화된 코드 워드는 캐노니컬 트리 구조상의 레벨에 따른 노드 순서로 순차적으로 룩-업 테이블 메모리에 저장되며 복호시 부호화된 코드 워드의 노드 순서가 소정 연산에 의하여 검색되어서 복호화된 코드 워드의 어드레스로 이용되므로 허프만 코드 트리가 중앙 시스템에 따라 변화하여도 하드웨어 변화없이 변수를 메모리와 래치에 단순히 저장하는 방법으로 고속으로 가변 길이 복호화가 된다. 따라서, 부호화된 코드 워드의 길이에 관계없이 하나의 부호화된 코드 워드를 병렬 연산에 의거하여 한 클럭에 처리하므로 비트 단위로 복호 처리하는 종래 가변 길이 복호화 장치 또는 방법보다 고속으로 복호 처리가 수행된다.As described above, according to the present invention, the variable length coded codewords are sequentially stored in the look-up table memory in the node order according to the level on the canonical tree structure, and the node order of the codewords Huffman code tree is used as the address of the decoded codeword, which is searched and decoded by the operation. Therefore, even if the Huffman code tree changes according to the central system, variable length decoding is performed at high speed by simply storing the variable in the memory and latch without changing the hardware. Therefore, regardless of the length of the encoded code word, one encoded codeword is processed in one clock based on the parallel operation, so that the decoding process is performed at a higher speed than the conventional variable length decoding apparatus or method that performs decoding processing on a bit basis.
이상 설명한 바와 같이, 본 발명에 의하면 허프만 코드 구조 및 가변 길이 코드 워드를 근거로 가변 길이 코드 워드의 길이를 검출하고, 검출된 가변 길이 코드 워드의 길이를 이용하여 입력 데이터를 가변 길이 코드 워드로 코딩하는 가변 길이 코딩 방법 및 그 장치를 실현할 수 있게 된다.As described above, according to the present invention, the length of the variable length codeword is detected based on the Huffman code structure and the variable length codeword, and the input data is coded into the variable length codeword using the length of the detected variable length codeword And a variable length coding method and apparatus therefor.
본 발명을 상기 실시 예에 의해 구체적으로 설명하였지만, 본 발명은 이에 의해 제한되는 것이 아니고, 당업자의 통상적인 지식의 범위 내에서 그 변형이나 개량이 가능하다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but variations and modifications may be made without departing from the scope of common knowledge of those skilled in the art.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1019970069613A KR100268831B1 (en) | 1997-12-17 | 1997-12-17 | High speed processing variable length codec device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| KR1019970069613A KR100268831B1 (en) | 1997-12-17 | 1997-12-17 | High speed processing variable length codec device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| KR19990050486A true KR19990050486A (en) | 1999-07-05 |
| KR100268831B1 KR100268831B1 (en) | 2000-10-16 |
Family
ID=19527611
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR1019970069613A Expired - Fee Related KR100268831B1 (en) | 1997-12-17 | 1997-12-17 | High speed processing variable length codec device |
Country Status (1)
| Country | Link |
|---|---|
| KR (1) | KR100268831B1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100720684B1 (en) * | 2005-05-09 | 2007-05-21 | 이화여자대학교 산학협력단 | Huffman decoding method and decoding device using balanced binary search tree |
| KR100975063B1 (en) * | 2003-12-30 | 2010-08-11 | 삼성전자주식회사 | Apparatus for decoding variable length coded bitstream and method thereof, and recording medium having recorded thereon a program for implementing the same |
-
1997
- 1997-12-17 KR KR1019970069613A patent/KR100268831B1/en not_active Expired - Fee Related
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100975063B1 (en) * | 2003-12-30 | 2010-08-11 | 삼성전자주식회사 | Apparatus for decoding variable length coded bitstream and method thereof, and recording medium having recorded thereon a program for implementing the same |
| KR100720684B1 (en) * | 2005-05-09 | 2007-05-21 | 이화여자대학교 산학협력단 | Huffman decoding method and decoding device using balanced binary search tree |
Also Published As
| Publication number | Publication date |
|---|---|
| KR100268831B1 (en) | 2000-10-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5696507A (en) | Method and apparatus for decoding variable length code | |
| US5912636A (en) | Apparatus and method for performing m-ary finite state machine entropy coding | |
| US5436626A (en) | Variable-length codeword encoder | |
| US7079057B2 (en) | Context-based adaptive binary arithmetic coding method and apparatus | |
| KR100648258B1 (en) | Content-based Adaptive Binary Arithmetic Decoder for Pipeline Architectures with Fast Decoding | |
| KR100489908B1 (en) | Digital information signal encoding method and apparatus | |
| US5557271A (en) | Variable length coder and variable length decoder | |
| US5587710A (en) | Syntax based arithmetic coder and decoder | |
| KR0124191B1 (en) | Variable length code decoding device | |
| JPH07240720A (en) | Channel modulation method, error correction method, state machine generation method, coding method, channel modulation device, error correction device | |
| US5901177A (en) | High speed variable length code decoding apparatus and method | |
| US6809665B2 (en) | Apparatus and method for decoding variable length code | |
| KR0152038B1 (en) | Variable-length decoding device using relative address | |
| US5677690A (en) | High speed variable length code decoding apparatus | |
| US5648775A (en) | High speed variable length code decoding apparatus | |
| JP3853439B2 (en) | High speed variable length code decoding apparatus and high speed variable length code decoding method | |
| KR100466455B1 (en) | Code converter, variable length code decoder and method of decoding variable length code | |
| KR19990050486A (en) | High-speed processing variable-length codec device | |
| US5708430A (en) | High speed variable length code decoding apparatus | |
| KR20050010918A (en) | A method and a system for variable-length decoding, and a device for the localization of codewords | |
| KR100207428B1 (en) | An apparatus and method for fast variable length decoding adaptive to Huffman code conversion | |
| JP2934603B2 (en) | Method and apparatus for decoding variable length code | |
| KR100268830B1 (en) | Fast processing variable length coding method and apparatus | |
| JP3389389B2 (en) | Variable length code decoding device | |
| KR0125125B1 (en) | High speed variable length code decoding device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A201 | Request for examination | ||
| PA0109 | Patent application |
St.27 status event code: A-0-1-A10-A12-nap-PA0109 |
|
| PA0201 | Request for examination |
St.27 status event code: A-1-2-D10-D11-exm-PA0201 |
|
| R17-X000 | Change to representative recorded |
St.27 status event code: A-3-3-R10-R17-oth-X000 |
|
| PG1501 | Laying open of application |
St.27 status event code: A-1-1-Q10-Q12-nap-PG1501 |
|
| E701 | Decision to grant or registration of patent right | ||
| PE0701 | Decision of registration |
St.27 status event code: A-1-2-D10-D22-exm-PE0701 |
|
| GRNT | Written decision to grant | ||
| PR0701 | Registration of establishment |
St.27 status event code: A-2-4-F10-F11-exm-PR0701 |
|
| PR1002 | Payment of registration fee |
St.27 status event code: A-2-2-U10-U11-oth-PR1002 Fee payment year number: 1 |
|
| PG1601 | Publication of registration |
St.27 status event code: A-4-4-Q10-Q13-nap-PG1601 |
|
| R18-X000 | Changes to party contact information recorded |
St.27 status event code: A-5-5-R10-R18-oth-X000 |
|
| R18-X000 | Changes to party contact information recorded |
St.27 status event code: A-5-5-R10-R18-oth-X000 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R11-asn-PN2301 |
|
| PN2301 | Change of applicant |
St.27 status event code: A-5-5-R10-R14-asn-PN2301 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 4 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 5 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 6 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 7 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 8 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 9 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 10 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 11 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 12 |
|
| FPAY | Annual fee payment |
Payment date: 20120702 Year of fee payment: 13 |
|
| PR1001 | Payment of annual fee |
St.27 status event code: A-4-4-U10-U11-oth-PR1001 Fee payment year number: 13 |
|
| LAPS | Lapse due to unpaid annual fee | ||
| PC1903 | Unpaid annual fee |
St.27 status event code: A-4-4-U10-U13-oth-PC1903 Not in force date: 20130719 Payment event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE |
|
| PC1903 | Unpaid annual fee |
St.27 status event code: N-4-6-H10-H13-oth-PC1903 Ip right cessation event data comment text: Termination Category : DEFAULT_OF_REGISTRATION_FEE Not in force date: 20130719 |
|
| P22-X000 | Classification modified |
St.27 status event code: A-4-4-P10-P22-nap-X000 |