JP2003273746A - Variable length code decoder - Google Patents

Variable length code decoder

Info

Publication number
JP2003273746A
JP2003273746A JP2002074903A JP2002074903A JP2003273746A JP 2003273746 A JP2003273746 A JP 2003273746A JP 2002074903 A JP2002074903 A JP 2002074903A JP 2002074903 A JP2002074903 A JP 2002074903A JP 2003273746 A JP2003273746 A JP 2003273746A
Authority
JP
Japan
Prior art keywords
code
length
variable
classification
address
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.)
Pending
Application number
JP2002074903A
Other languages
Japanese (ja)
Inventor
Toshiyuki Takahashi
利至 高橋
Masayuki Yoshida
雅之 吉田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2002074903A priority Critical patent/JP2003273746A/en
Publication of JP2003273746A publication Critical patent/JP2003273746A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To obtain a variable length code decoder capable of decoding processing at high speed. <P>SOLUTION: A code length calculation means 108 compares the code sequence of a fixed length including a sorted variable length code from a code sequence selection means 104 with the minimum code of each code length corresponding to a sorting result stored in a minimum code storage means 109, calculates the code length of the sorted variable length code, and calculates the code length of the variable length code with the code length of the sorted variable length and the sorting result. An address calculation means 110 calculates the address of a decoding table storage means 111 storing a decoded value with the code length of the variable code and the code sequence of the fixed length including a variable length code from a barrel shifter 102. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】この発明は、画像データや音
声データ等のディジタルデータを圧縮して伝送したり、
蓄積するのに好適なハフマン符号等の可変長符号を復元
する可変長符号復号装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention compresses and transmits digital data such as image data and audio data,
The present invention relates to a variable length code decoding device that restores a variable length code such as a Huffman code suitable for storage.

【0002】[0002]

【従来の技術】一般に限られたデータ転送能力の通信回
線を用いて、画像データ等の大量のデータを伝送する場
合や、少ない容量の蓄積媒体に長時間のデータを記録す
る場合等においては、このデータ量を削減するデータ圧
縮技術が用いられている。
2. Description of the Related Art Generally, when a large amount of data such as image data is transmitted using a communication line having a limited data transfer capacity or when long-time data is recorded on a storage medium having a small capacity, A data compression technique is used to reduce this data amount.

【0003】このデータを圧縮する方法として、多くの
技術が開発され実用化されている。例えば、画像データ
をコサイン変換して、その係数を用いて圧縮するDCT
(Discrete Cosine Transfor
m)変換符号化や、データの発生頻度に合わせて対応す
る符号の長さを変化させて全体の符号量を削減する可変
長符号化等がある。
As a method of compressing this data, many techniques have been developed and put into practical use. For example, a DCT in which image data is cosine-transformed and compressed using its coefficient.
(Discrete Cosine Transform)
m) Transform coding, variable length coding in which the length of the corresponding code is changed according to the frequency of occurrence of data to reduce the overall code amount, and the like.

【0004】この可変長符号化の例として、従来よりハ
フマン符号化が提案されている。このハフマン符号の基
本的考えは、発生頻度の高い事象(シンボル)には短い
符号を割り当て、発生頻度の低いシンボルには長い符号
を割り当てることにより、平均の符号長、あるいはトー
タルの符号量を減らしデータを圧縮することにある。
As an example of this variable length coding, Huffman coding has been conventionally proposed. The basic idea of this Huffman code is to reduce the average code length or total code amount by assigning short codes to high-frequency events (symbols) and long codes to low-frequency symbols. It is about compressing data.

【0005】具体的なハフマン符号の生成は各シンボル
の発生確率に依存し、その生成理論については種々の情
報理論の文献に述べられているので、ここではその説明
を省略する。図24は各シンボルに割り当てられたハフ
マン符号の一例を示しており、数値が小さいシンボル
程、発生頻度が高いものとする。また、図25は図24
のハフマン符号から生成したハフマンツリーを示す図で
ある。図25において、丸印はノードを示し、ノード間
の数値は符号列を示し、ノードの中の数値はシンボル
(復号値)を示している。
The specific generation of the Huffman code depends on the probability of occurrence of each symbol, and its generation theory is described in various information theory literatures, and therefore its explanation is omitted here. FIG. 24 shows an example of the Huffman code assigned to each symbol, and the smaller the numerical value is, the higher the occurrence frequency is. In addition, FIG.
5 is a diagram showing a Huffman tree generated from the Huffman code of FIG. In FIG. 25, circles indicate nodes, numerical values between nodes indicate code strings, and numerical values inside nodes indicate symbols (decoded values).

【0006】このようにハフマン符号化されたデータを
復号する従来の方法では、ハフマン符号の復号値が格納
された復号テーブルを用い、この復号テーブルをハフマ
ン符号で参照することにより、復号値を得るようにして
いる。この場合、例えば最大符号長が16ビットであれ
ば、アドレスが2**16の復号テーブルを用意し、こ
れを16ビットのアドレスで1回アクセスすることによ
り復号結果を得るものである。以後これを従来例1とす
る。
In the conventional method for decoding Huffman-encoded data in this way, a decoding table in which the decoded values of the Huffman code are stored is used, and the decoded value is obtained by referring to this decoding table with the Huffman code. I am trying. In this case, for example, if the maximum code length is 16 bits, a decoding table with an address of 2 ** 16 is prepared, and the decoding result is obtained by accessing this with a 16-bit address once. Hereinafter, this is referred to as Conventional Example 1.

【0007】この、従来例1では、1回の復号テーブル
のアクセスで復号値が得られるため高速処理には向いて
いるが、復号テーブルの容量が過大となり、復号装置全
体をLSI化する場合や、CPUを伴わないシステムに
は不向きであるという課題がある。
In the conventional example 1, the decoded value can be obtained by accessing the decoding table once, which is suitable for high-speed processing, but the capacity of the decoding table becomes too large, and the entire decoding device is to be integrated into an LSI. However, there is a problem that it is not suitable for a system without a CPU.

【0008】このような課題を解決する方法として、例
えば特開平06−104769号公報に示されるハフマ
ン符号復号装置が提案されており、以後、これを従来例
2とする。図26は従来例2のハフマン符号復号装置の
構成を示すブロック図である。図において、U1,U
2,Uqはユニット、3001はビット列選択手段、3
002は符号語記憶手段、3003はアドレス記憶手
段、3004は比較手段、3005は符号長決定手段、
3006はアドレス決定手段である。
As a method for solving such a problem, for example, a Huffman code decoding apparatus disclosed in Japanese Patent Laid-Open No. 06-104769 has been proposed, which will be hereinafter referred to as Conventional Example 2. FIG. 26 is a block diagram showing a configuration of a Huffman code decoding device of Conventional Example 2. In the figure, U1, U
2, Uq is a unit, 3001 is a bit string selecting means, 3
002 is a code word storage unit, 3003 is an address storage unit, 3004 is a comparison unit, 3005 is a code length determination unit,
3006 is an address determining means.

【0009】次に動作について説明する。ハフマン符号
データが入力されてくると、ユニットUqにおけるビッ
ト列選択手段3001はqビットのデータ列を選択す
る。選択されたデータ列は、符号語記憶手段3002か
ら出力される符号語と、qビットの比較手段3004で
比較され、その結果が符号長決定手段3005に入力さ
れる。符号長決定手段3005は各ユニットの比較手段
3004の出力から、現在処理しようとしているハフマ
ン符号の符号長を決定する。
Next, the operation will be described. When the Huffman code data is input, the bit string selection means 3001 in the unit Uq selects a q-bit data string. The selected data string is compared with the codeword output from the codeword storage unit 3002 by the q-bit comparison unit 3004, and the result is input to the code length determination unit 3005. The code length determining means 3005 determines the code length of the Huffman code currently to be processed from the output of the comparing means 3004 of each unit.

【0010】アドレス決定手段3006は、符号長決定
手段3005で決定された符号長から、復号値が格納さ
れている図示しない復号テーブルのアドレスを計算す
る。こうして、この従来例2では、各符号長での比較処
理を並列化することで、1つのハフマン符号を1サイク
ルで復号することができ、高速な復号処理を実現するこ
とが可能となる。ここで復号テーブルは符号語の数だけ
アドレスを用意すれば良く、メモリも上記の従来例1に
比べ少ない容量で実現することができる。
The address determining means 3006 calculates the address of a decoding table (not shown) in which the decoded value is stored, from the code length determined by the code length determining means 3005. Thus, in the second conventional example, one Huffman code can be decoded in one cycle by parallelizing the comparison processing at each code length, and high-speed decoding processing can be realized. Here, as many addresses as the number of code words are required to be prepared in the decoding table, and the memory can be realized with a smaller capacity than that of the conventional example 1 described above.

【0011】[0011]

【発明が解決しようとする課題】従来例2の可変長符号
復号装置は以上のように構成されているので、それぞれ
のユニットU1,U2,・・・,Uqにおいて、qビッ
トの比較手段3004を備える必要があり、そのqも最
大符号長の数だけ必要となる。当然qが大きくなるに従
って比較結果を計算する時間も長くなり、クロック周波
数が高くなると、1サイクルでその復号処理ができなく
なるという課題があった。
Since the variable-length code decoding apparatus of the conventional example 2 is configured as described above, the q-bit comparison means 3004 is provided in each of the units U1, U2, ..., Uq. It is necessary to provide it, and q is required for the maximum code length. As a matter of course, as q becomes larger, the time for calculating the comparison result becomes longer, and when the clock frequency becomes higher, there is a problem that the decoding process cannot be performed in one cycle.

【0012】この発明は上記のような課題を解決するた
めになされたもので、復号処理に要する時間を短縮化
し、高速に復号処理ができる可変長符号復号装置を得る
ことを目的とする。
The present invention has been made to solve the above problems, and an object thereof is to obtain a variable-length code decoding apparatus which can shorten the time required for decoding processing and can perform decoding processing at high speed.

【0013】[0013]

【課題を解決するための手段】この発明に係る可変長符
号復号装置は、復号するのに必要な分類結果に応じた各
符号長の最小符号を記憶している最小符号記憶手段と、
符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列と、最小符号記憶手段に記憶されて
いる分類結果に応じた各符号長の最小符号を比較して、
分類後の可変長符号の符号長を演算し、演算した分類後
の可変長符号の符号長と分類結果により、可変長符号の
符号長を演算する符号長演算手段と、符号長演算手段に
より演算された可変長符号の符号長と、バレルシフタに
より抽出された可変長符号を含む固定長の符号列によ
り、復号値が記憶されている復号テーブル記憶手段のア
ドレスを演算するアドレス演算手段とを備えたものであ
る。
A variable-length code decoding apparatus according to the present invention includes minimum code storage means for storing the minimum code of each code length according to a classification result required for decoding,
A fixed length code string including a variable length code after classification extracted by the code string selection means and a minimum code of each code length corresponding to the classification result stored in the minimum code storage means are compared,
The code length of the variable-length code after classification is calculated, and the code length of the variable-length code after classification and the classification result are calculated. And an address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by the code length of the variable length code and the fixed length code string including the variable length code extracted by the barrel shifter. It is a thing.

【0014】この発明に係る可変長符号復号装置は、符
号長演算手段が、ビット分配手段から出力される各符号
列を、最小符号記憶手段に記憶されている分類結果に応
じた各符号長の最小符号と比較する複数の比較手段と、
複数の比較手段の出力から分類後の可変長符号の符号長
を求めるプライオリティエンコーダと、プライオリティ
エンコーダからの分類後の可変長符号の符号長と、符号
分類手段からの分類結果により、可変長符号の符号長を
演算する加算手段とを備えたものである。
In the variable-length code decoding apparatus according to the present invention, the code-length calculating means assigns each code string output from the bit distributing means to each code length corresponding to the classification result stored in the minimum code storing means. A plurality of comparison means for comparing with the minimum code,
The priority encoder that obtains the code length of the variable length code after classification from the outputs of the plurality of comparing means, the code length of the variable length code after classification from the priority encoder, and the classification result from the code classifying means determines the variable length code And an adding means for calculating the code length.

【0015】この発明に係る可変長符号復号装置は、ア
ドレス演算手段が、各符号長のベースアドレスを記憶
し、符号長演算手段により演算された可変長符号の符号
長に対応するベースアドレスを出力するベースアドレス
記憶手段と、バレルシフタにより抽出された可変長符号
を含む固定長の符号列と、符号長演算手段により演算さ
れた可変長符号の符号長により、可変長符号を抽出する
可変長符号抽出手段と、ベースアドレス記憶手段から出
力されたベースアドレスと、可変長符号抽出手段により
抽出された可変長符号により、復号テーブル記憶手段の
アドレスを演算する加算手段とを備えたものである。
In the variable length code decoding device according to the present invention, the address calculation means stores the base address of each code length and outputs the base address corresponding to the code length of the variable length code calculated by the code length calculation means. A variable-length code extractor for extracting a variable-length code by a base address storage means, a fixed-length code string including the variable-length code extracted by the barrel shifter, and a code length of the variable-length code calculated by the code-length calculating means. Means, a base address output from the base address storage means, and an addition means for calculating the address of the decoding table storage means by the variable length code extracted by the variable length code extraction means.

【0016】この発明に係る可変長符号復号装置は、復
号するのに必要な分類結果に応じた各符号長の最小符号
を記憶している最小符号記憶手段と、符号列選択手段に
より抽出された分類後の可変長符号を含む固定長の符号
列と、最小符号記憶手段に記憶されている分類結果に応
じた各符号長の最小符号を比較して、分類後の可変長符
号の符号長を演算する符号長演算手段と、符号長演算手
段により演算された分類後の可変長符号の符号長と、分
類結果と、符号列選択手段により抽出された分類後の可
変長符号を含む固定長の符号列により、復号値が記憶さ
れている復号テーブル記憶手段のアドレスを演算するア
ドレス演算手段とを備えたものである。
The variable length code decoding device according to the present invention is extracted by the minimum code storage means for storing the minimum code of each code length according to the classification result required for decoding and the code string selection means. The fixed-length code string including the variable-length code after classification is compared with the minimum code of each code length corresponding to the classification result stored in the minimum-code storage means to determine the code length of the variable-length code after classification. A fixed-length code length calculating means for calculating, a code length of the variable length code after classification calculated by the code length calculating means, a classification result, and a variable length code after classification extracted by the code string selecting means. It is provided with address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by the code string.

【0017】この発明に係る可変長符号復号装置は、符
号長演算手段が、ビット分配手段から出力される各符号
列を、最小符号記憶手段に記憶されている分類結果に応
じた各符号長の最小符号と比較する複数の比較手段と、
複数の比較手段の出力から分類後の可変長符号の符号長
を求めるプライオリティエンコーダとを備えたものであ
る。
In the variable-length code decoding apparatus according to the present invention, the code-length calculating means assigns each code string output from the bit distributing means to each of the code lengths corresponding to the classification result stored in the minimum code storing means. A plurality of comparison means for comparing with the minimum code,
And a priority encoder for obtaining the code length of the variable length code after classification from the outputs of the plurality of comparing means.

【0018】この発明に係る可変長符号復号装置は、ア
ドレス演算手段が、各符号長のベースアドレスを記憶
し、符号長演算手段により演算された分類後の可変長符
号の符号長に対応するベースアドレスを出力するベース
アドレス記憶手段と、符号列選択手段により抽出された
分類後の可変長符号を含む固定長の符号列と、符号長演
算手段により演算された分類後の可変長符号の符号長に
より、分類後の可変長符号を抽出する可変長符号抽出手
段と、ベースアドレス記憶手段から出力されたベースア
ドレスと、可変長符号抽出手段により抽出された分類後
の可変長符号により、復号テーブル記憶手段のアドレス
を演算する加算手段とを備えたものである。
In the variable-length code decoding apparatus according to the present invention, the address calculation means stores the base address of each code length, and the base corresponding to the code length of the classified variable-length code calculated by the code length calculation means. A base address storage means for outputting an address, a fixed-length code string including the classified variable length code extracted by the code string selection means, and a code length of the classified variable length code calculated by the code length calculation means. According to the variable length code extraction means for extracting the variable length code after classification, the base address output from the base address storage means, and the variable length code after classification extracted by the variable length code extraction means are stored in the decoding table. And means for calculating the address of the means.

【0019】この発明に係る可変長符号復号装置は、復
号するのに必要な分類結果に応じた各符号長の最大符号
を記憶している最大符号記憶手段と、符号列選択手段に
より抽出された分類後の可変長符号を含む固定長の符号
列と、最大符号記憶手段に記憶されている分類結果に応
じた各符号長の最大符号を比較して、分類後の可変長符
号の符号長を演算し、演算した分類後の可変長符号の符
号長と分類結果により、可変長符号の符号長を演算する
符号長演算手段と、符号長演算手段により演算された可
変長符号の符号長と、バレルシフタにより抽出された可
変長符号を含む固定長の符号列により、復号値が記憶さ
れている復号テーブル記憶手段のアドレスを演算するア
ドレス演算手段とを備えたものである。
The variable-length code decoding apparatus according to the present invention is extracted by the maximum code storage means for storing the maximum code of each code length corresponding to the classification result required for decoding and the code string selection means. The fixed length code string including the variable length code after classification is compared with the maximum code of each code length according to the classification result stored in the maximum code storage means, and the code length of the variable length code after classification is calculated. A code length calculating means for calculating the code length of the variable length code based on the calculated code length of the variable length code after classification and the classification result; and a code length of the variable length code calculated by the code length calculating means, An address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored is provided by the fixed length code string including the variable length code extracted by the barrel shifter.

【0020】この発明に係る可変長符号復号装置は、符
号長演算手段が、ビット分配手段から出力される各符号
列を、最大符号記憶手段に記憶されている分類結果に応
じた各符号長の最大符号と比較する複数の比較手段と、
複数の比較手段の出力から分類後の可変長符号の符号長
を求めるプライオリティエンコーダと、プライオリティ
エンコーダからの分類後の可変長符号の符号長と、符号
分類手段からの分類結果により、可変長符号の符号長を
演算する加算手段とを備えたものである。
In the variable-length code decoding apparatus according to the present invention, the code-length calculating means assigns each code string output from the bit distributing means to each of the code lengths corresponding to the classification result stored in the maximum code storing means. A plurality of comparison means for comparing with the maximum sign,
The priority encoder that obtains the code length of the variable length code after classification from the outputs of the plurality of comparing means, the code length of the variable length code after classification from the priority encoder, and the classification result from the code classifying means determines the variable length code And an adding means for calculating the code length.

【0021】この発明に係る可変長符号復号装置は、ア
ドレス演算手段が、各符号長のベースアドレスを記憶
し、符号長演算手段により演算された可変長符号の符号
長に対応するベースアドレスを出力するベースアドレス
記憶手段と、バレルシフタにより抽出された可変長符号
を含む固定長の符号列と、符号長演算手段により演算さ
れた可変長符号の符号長により、可変長符号を抽出する
可変長符号抽出手段と、ベースアドレス記憶手段から出
力されたベースアドレスと、可変長符号抽出手段により
抽出された可変長符号により、復号テーブル記憶手段の
アドレスを演算する加算手段とを備えたものである。
In the variable length code decoding device according to the present invention, the address calculation means stores the base address of each code length and outputs the base address corresponding to the code length of the variable length code calculated by the code length calculation means. A variable-length code extractor for extracting a variable-length code by a base address storage means, a fixed-length code string including the variable-length code extracted by the barrel shifter, and a code length of the variable-length code calculated by the code-length calculating means. Means, a base address output from the base address storage means, and an addition means for calculating the address of the decoding table storage means by the variable length code extracted by the variable length code extraction means.

【0022】この発明に係る可変長符号復号装置は、復
号するのに必要な分類結果に応じた各符号長の最大符号
を記憶している最大符号記憶手段と、符号列選択手段に
より抽出された分類後の可変長符号を含む固定長の符号
列と、最大符号記憶手段に記憶されている分類結果に応
じた各符号長の最大符号を比較して、分類後の可変長符
号の符号長を演算する符号長演算手段と、符号長演算手
段により演算された分類後の可変長符号の符号長と、分
類結果と、符号列選択手段により抽出された分類後の可
変長符号を含む固定長の符号列により、復号値が記憶さ
れている復号テーブル記憶手段のアドレスを演算するア
ドレス演算手段とを備えたものである。
The variable-length code decoding apparatus according to the present invention is extracted by the maximum code storage means for storing the maximum code of each code length according to the classification result necessary for decoding, and the code string selection means. The fixed length code string including the variable length code after classification is compared with the maximum code of each code length according to the classification result stored in the maximum code storage means, and the code length of the variable length code after classification is calculated. A fixed-length code length calculating means for calculating, a code length of the variable length code after classification calculated by the code length calculating means, a classification result, and a variable length code after classification extracted by the code string selecting means. It is provided with address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by the code string.

【0023】この発明に係る可変長符号復号装置は、符
号長演算手段が、ビット分配手段から出力される各符号
列を、最大符号記憶手段に記憶されている分類結果に応
じた各符号長の最大符号と比較する複数の比較手段と、
複数の比較手段の出力から分類後の可変長符号の符号長
を求めるプライオリティエンコーダとを備えたものであ
る。
In the variable-length code decoding apparatus according to the present invention, the code-length calculating means assigns each code string output from the bit distributing means to each code length corresponding to the classification result stored in the maximum code storing means. A plurality of comparison means for comparing with the maximum sign,
And a priority encoder for obtaining the code length of the variable length code after classification from the outputs of the plurality of comparing means.

【0024】この発明に係る可変長符号復号装置は、ア
ドレス演算手段が、各符号長のベースアドレスを記憶
し、符号長演算手段により演算された分類後の可変長符
号の符号長に対応するベースアドレスを出力するベース
アドレス記憶手段と、符号列選択手段により抽出された
分類後の可変長符号を含む固定長の符号列と、符号長演
算手段により演算された分類後の可変長符号の符号長に
より、分類後の可変長符号を抽出する可変長符号抽出手
段と、ベースアドレス記憶手段から出力されたベースア
ドレスと、可変長符号抽出手段により抽出された分類後
の可変長符号により、復号テーブル記憶手段のアドレス
を演算する加算手段とを備えたものである。
In the variable-length code decoding apparatus according to the present invention, the address calculation means stores the base address of each code length, and the base corresponding to the code length of the classified variable-length code calculated by the code length calculation means. A base address storage means for outputting an address, a fixed-length code string including the classified variable length code extracted by the code string selection means, and a code length of the classified variable length code calculated by the code length calculation means. According to the variable length code extraction means for extracting the variable length code after classification, the base address output from the base address storage means, and the variable length code after classification extracted by the variable length code extraction means are stored in the decoding table. And means for calculating the address of the means.

【0025】この発明に係る可変長符号復号装置は、符
号分類手段が分類情報として連続する“1”の個数によ
り分類するものである。
In the variable length code decoding apparatus according to the present invention, the code classifying means classifies the classification information according to the number of consecutive "1" s.

【0026】[0026]

【発明の実施の形態】以下、この発明の実施の一形態を
説明する。 実施の形態1.図1はこの発明の実施の形態1による可
変長符号復号装置の構成を示すブロック図であり、図に
おいて、101は入力されたハフマン符号データである
符号列を一時的に格納する符号レジスタ、102は符号
レジスタ101に格納されている符号列の先頭ビットを
示す位置(ポインタ)から、最大符号長分の符号列、即
ち、ハフマン符号(可変長符号)を含む固定長の符号列
であるハフマン符号の候補を抽出するバレルシフタであ
る。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of the present invention will be described below. Embodiment 1. 1 is a block diagram showing a configuration of a variable-length code decoding apparatus according to Embodiment 1 of the present invention. In the figure, 101 is a code register for temporarily storing a code string which is input Huffman code data, and 102. Is a code string for the maximum code length from the position (pointer) indicating the first bit of the code string stored in the code register 101, that is, a Huffman code that is a fixed-length code string including a Huffman code (variable length code) This is a barrel shifter for extracting the candidate of.

【0027】また、図1において、103はハフマン符
号を含む固定長の符号列を、その符号列に含まれる分類
情報により幾つかの種類に分類し、分類結果として分類
番号を出力する符号分類手段、104は符号分類手段1
03から出力される分類番号に応じて、バレルシフタ1
02から出力される固定長の符号列から、分類情報を除
いた分類後のハフマン符号を含む所望のビット数の固定
長の符号列を抽出する符号列選択手段、105は符号分
類手段103から出力される分類番号を一時的に格納す
る分類レジスタ、106は符号列選択手段104から出
力される分類後のハフマン符号を含む固定長の符号列を
一時的に格納する選択符号レジスタ、107はバレルシ
フタ102から出力される現在復号しようとしているハ
フマン符号を含む固定長の符号列を一時的に格納するハ
フマンレジスタである。
Further, in FIG. 1, reference numeral 103 is a code classifying means for classifying a fixed-length code string including a Huffman code into several types according to the classification information included in the code string and outputting a classification number as a classification result. , 104 are code classification means 1
Depending on the classification number output from 03, barrel shifter 1
A code string selecting unit for extracting a fixed-length code string having a desired number of bits including the Huffman code after classification from the fixed-length code string output from 02, 105 is output from the code classifying unit 103. A classification register for temporarily storing the classified number, a selection code register 106 for temporarily storing a fixed-length code string including the post-classification Huffman code output from the code string selection means 104, and a barrel shifter 102. It is a Huffman register that temporarily stores a fixed length code string including the Huffman code that is currently being decoded.

【0028】さらに、図1において、108は選択符号
レジスタ106からの分類後のハフマン符号を含む固定
長の符号列と、最小符号記憶手段109からの分類番号
に応じた各符号長の最小符号を比較して、分類後のハフ
マン符号の符号長を演算し、この分類後のハフマン符号
の符号長と分類レジスタ105からの分類番号により、
現在復号しようとしているハフマン符号の符号長を演算
する符号長演算手段、109は復号するのに必要な各分
類番号に応じた各符号長の最小符号を記憶する最小符号
記憶手段、110は符号長演算手段108により演算さ
れたハフマン符号の符号長と、ハフマンレジスタ107
からのハフマン符号を含む固定長の符号列から、復号テ
ーブル記憶手段111のメモリのアドレスを演算するア
ドレス演算手段、111は各ハフマン符号に対応する復
号値をメモリの所定のアドレスに記憶し、アドレス演算
手段110により演算されたアドレスに記憶されている
復号値を出力する復号テーブル記憶手段である。
Further, in FIG. 1, reference numeral 108 denotes a fixed-length code string including the Huffman code after classification from the selection code register 106, and the minimum code of each code length corresponding to the classification number from the minimum code storage means 109. By comparison, the code length of the Huffman code after classification is calculated, and by the code length of the Huffman code after classification and the classification number from the classification register 105,
Code length calculation means for calculating the code length of the Huffman code to be decoded at present, 109 is the minimum code storage means for storing the minimum code of each code length corresponding to each classification number required for decoding, and 110 is the code length The code length of the Huffman code calculated by the calculation means 108 and the Huffman register 107
From the fixed length code string including the Huffman code from the address calculation means for calculating the address of the memory of the decoding table storage means 111, 111 stores the decoded value corresponding to each Huffman code in a predetermined address of the memory, The decoding table storage means outputs the decoded value stored at the address calculated by the calculation means 110.

【0029】次に図1に示す各要素について詳細に説明
する。なお、この実施の形態では、最大符号長8ビッ
ト、ハフマン符号語数32以下の場合を例として説明す
る。まず、ハフマン符号化データがバイト単位に転送さ
れてくると、符号レジスタ101では、必ずハフマン符
号2つ分の符号列を格納できるように制御される。つま
り、最大符号長2つ分の符号列を格納できるビット幅が
あれば良いので、16ビット、即ち2バイトの符号列を
常に保持するように制御される。
Next, each element shown in FIG. 1 will be described in detail. In this embodiment, the case where the maximum code length is 8 bits and the number of Huffman code words is 32 or less will be described as an example. First, when the Huffman-encoded data is transferred in byte units, the code register 101 is controlled so that a code string for two Huffman codes can be stored. In other words, since it is sufficient that there is a bit width capable of storing a code string of two maximum code lengths, it is controlled to always hold a code string of 16 bits, that is, 2 bytes.

【0030】バレルシフタ102は、符号レジスタ10
1に格納されているハフマン符号の先頭ビットを示す位
置(以後、先頭ポインタ)から、最大符号長8ビット分
のハフマン符号を含む固定長の符号列を抽出し、符号列
選択手段104にS102Aとして出力する。図2は初
期状態での符号レジスタ101とバレルシフタ102か
ら出力されるデータの関係を示す図である。即ち、初期
状態では符号長L=0にリセットされているため、先頭
ポインタは15ビット目を表しており(ビット順位は0
オリジンとする)、バレルシフタ102は、そこから最
大符号長分、即ち、15ビット目から8ビット目までの
8ビットを、ハフマン符号を含む符号列として符号列選
択手段104にS102Aとして出力する。また、バレ
ルシフタ102は、先頭ポインタから4ビットのハフマ
ン符号を含む固定長の符号列をS102Bとして符号分
類手段103に出力する。
The barrel shifter 102 includes a code register 10
A fixed length code string including a Huffman code having a maximum code length of 8 bits is extracted from the position (hereinafter, the head pointer) indicating the head bit of the Huffman code stored in 1 and is set as S102A in the code string selecting unit 104. Output. FIG. 2 is a diagram showing a relationship between data output from the code register 101 and the barrel shifter 102 in the initial state. That is, since the code length L is reset to 0 in the initial state, the leading pointer represents the 15th bit (bit order is 0
The barrel shifter 102 outputs the maximum code length, that is, 8 bits from the 15th bit to the 8th bit, to the code string selection means 104 as S102A as a code string including the Huffman code. Further, the barrel shifter 102 outputs the fixed-length code string including the 4-bit Huffman code from the head pointer to the code classification unit 103 as S102B.

【0031】符号分類手段103はバレルシフタ102
からの4ビットの入力を用いて、現在復号しようとして
いるハフマン符号を分類情報により5つの種類に分類
し、その分類番号をS103として出力する。具体的に
は、分類情報として、先頭ビットが“0”の場合に分類
番号0、先頭から2ビット目までが“10”の場合には
分類番号1、先頭から3ビット目までが“110”の場
合に分類番号2、先頭から4ビット目までが“111
0”の場合に分類番号3、先頭から4ビット目までが
“1111”の場合に分類番号4と分類する。
The code classification means 103 is a barrel shifter 102.
The Huffman code to be decoded at present is classified into five types by using the 4-bit input from the above, and the classification number is output as S103. Specifically, as the classification information, if the first bit is "0", the classification number is 0, if the first to the second bit is "10", the classification number is 1, and the first to the third bit is "110". In the case of, the classification number is 2, and the first to fourth bits are “111
If it is "0", the classification number is 3. If the first to fourth bits are "1111", the classification number is 4.

【0032】図3は符号分類手段103による分類方法
と符号列選択手段104の出力の関係を示す図である。
ハフマン符号を「11…10xx…x」(xは“0”又
は“1”の任意のビット)と表したとき、分類情報とし
て連続する“1”の個数z個(z≧0)によりハフマン
符号を分類している。また、xの個数yについては、こ
の実施の形態の前提、即ちハフマン符号の数が32以
下、最大符号長が8ビットの場合を考えると、最大で4
個(ビット)となる。これは、各シンボルの発生確率が
全て均一であるという極端な例を考えるとわかる。各シ
ンボルの発生確率が均一な場合、各シンボルに割り当て
る符号語は全て同一符号長となり、ハフマン符号の数が
32以下という前提を考えると、その符号長は最大で5
ビットとなる。
FIG. 3 is a diagram showing the relationship between the classification method by the code classification means 103 and the output of the code string selection means 104.
When the Huffman code is expressed as “11 ... 10xx ... x” (x is an arbitrary bit of “0” or “1”), the Huffman code is defined by the number z (z ≧ 0) of consecutive “1” s as classification information. Are classified. Regarding the number y of x, the maximum is 4 in consideration of the premise of this embodiment, that is, the number of Huffman codes is 32 or less and the maximum code length is 8 bits.
It becomes a piece (bit). This can be understood by considering an extreme example in which the occurrence probabilities of each symbol are all uniform. When the probability of occurrence of each symbol is uniform, all code words assigned to each symbol have the same code length, and the code length is 5 at maximum considering the number of Huffman codes is 32 or less.
Become a bit.

【0033】図4は発生確率が均一なシンボル(ハフマ
ン符号語数)が32個ある場合のハフマンツリーを示す
図であり、分類番号0の場合について言えば、先頭の
“0”に続く符号語は最大で4ビットとなり、yの最大
値(ビット数)も4となる。
FIG. 4 is a diagram showing a Huffman tree in the case where there are 32 symbols (Huffman codeword numbers) with uniform occurrence probabilities. In the case of classification number 0, the codeword following the leading "0" is The maximum is 4 bits, and the maximum value of y (the number of bits) is also 4.

【0034】符号分類手段103から出力される分類番
号は、ハフマン符号を含む符号列、及び分類後のハフマ
ン符号を含む符号列と同期を取るために、分類レジスタ
105に一時的に格納される。
The classification number output from the code classification means 103 is temporarily stored in the classification register 105 in order to synchronize with the code string including the Huffman code and the code string including the Huffman code after classification.

【0035】符号列選択手段104は、分類番号S10
3を受けて、バレルシフタ102の出力であるハフマン
符号を含む固定長の符号列S102Aから、分類後のハ
フマン符号を含む固定長の符号列4ビットを抽出する。
これは図3に示すxのビット列4ビットを抽出すること
に他ならない。例えば、分類番号0の場合は8ビットの
ビット列のうち6ビット目から3ビット目まで(ビット
順位は0オリジンとする)の4ビットを、分類番号1の
場合は5ビット目から2ビット目までの4ビットを、分
類番号2の場合は4ビット目から1ビット目までの4ビ
ットを、分類番号3、分類番号4の場合は3ビット目か
ら0ビット目までの4ビットをそれぞれ選択して出力す
る。これらの対応関係は、図3に示す表の第2列と第3
列に示されている。
The code string selecting means 104 uses the classification number S10.
Upon receiving 3, the fixed-length code string 4 bits including the Huffman code after classification is extracted from the fixed-length code string S102A including the Huffman code output from the barrel shifter 102.
This is nothing but extracting the 4 bits of the bit string of x shown in FIG. For example, in the case of classification number 0, the 4th bit from the 6th bit to the 3rd bit (bit origin is 0 origin) in the 8-bit bit string, and in the case of classification number 1 from the 5th bit to the 2nd bit 4 bits from the 4th bit to the 1st bit in the case of classification number 2 and 4 bits from the 3rd to 0th bit in the case of classification number 3 and classification number 4, respectively. Output. The correspondence between these is the second column and the third column in the table shown in FIG.
Shown in columns.

【0036】符号列選択手段104から出力される分類
後のハフマン符号を含む固定長の符号列は、分類番号及
びハフマン符号を含む固定長の符号列と同期を取るため
に、選択符号レジスタ106に一時的に格納される。
The fixed length code string including the Huffman code after classification outputted from the code string selecting means 104 is stored in the selection code register 106 in order to synchronize with the fixed length code string including the classification number and the Huffman code. Stored temporarily.

【0037】また、同様に、バレルシフタ102から出
力されるハフマン符号を含む固定長の符号列も、分類番
号及び分類後のハフマン符号を含む固定長の符号列と同
期を取るためにハフマンレジスタ107に一時的に格納
される。
Similarly, the fixed length code string including the Huffman code output from the barrel shifter 102 is also stored in the Huffman register 107 in order to synchronize with the fixed length code string including the classification number and the classified Huffman code. Stored temporarily.

【0038】最小符号記憶手段109は、分類後の符号
列(4ビット)をハフマン符号とみなしたときに、それ
を復号するのに必要な各符号長の最小符号を各分類番号
0〜4に応じて記憶しておく。また、後述するデータ制
限処理のためにその分類番号における最大符号長も同時
に記憶しておくこととする。
When the code string (4 bits) after classification is regarded as a Huffman code, the minimum code storage means 109 assigns the minimum code of each code length necessary for decoding it to the classification numbers 0 to 4. Memorize accordingly. In addition, the maximum code length in the classification number is also stored at the same time for the data restriction process described later.

【0039】符号長演算手段108は、選択符号レジス
タ106から出力される分類後のハフマン符号を含む固
定長の符号列と、最小符号記憶手段109から出力され
る最小符号とを比較して、分類後のハフマン符号の符号
長KLを演算し、符号長KLと分類レジスタ105から
の分類番号により、現在復号しようとしているハフマン
符号の符号長Lを演算する。
The code length calculating means 108 compares the fixed length code string including the post-classification Huffman code output from the selection code register 106 with the minimum code output from the minimum code storage means 109 to classify the code. The code length KL of the subsequent Huffman code is calculated, and the code length L of the Huffman code currently to be decoded is calculated based on the code length KL and the classification number from the classification register 105.

【0040】図5は符号長演算手段108の構成を示す
ブロック図である。ビット分配手段501は、選択符号
レジスタ106からの分類後のハフマン符号を含む4ビ
ットの符号列を受けて、その上位1ビットを比較手段
(1)502に対してS501Aとして出力し、上位2
ビットを比較手段(2)503に対してS501Bとし
て、上位3ビットを比較手段(3)504に対してS5
01Cとして、上位4ビットを比較手段(4)505に
対してS501Dとして出力する。
FIG. 5 is a block diagram showing the configuration of the code length calculating means 108. The bit distribution unit 501 receives a 4-bit code string including the Huffman code after classification from the selection code register 106, outputs the upper 1 bit to the comparison unit (1) 502 as S501A, and outputs the upper 2
The bit is set to S501B for the comparison means (2) 503, and the upper 3 bits are set to S5 for the comparison means (3) 504.
As 01C, the upper 4 bits are output as S501D to the comparing means (4) 505.

【0041】次に、mをビット長としたとき、各比較手
段(m)では、mビットの信号S501A〜S501D
と最小符号記憶手段109から出力されるmビットの最
小符号とを比較し、次の(1)式により判定を行う。 if(S501A〜S501D≧最小符号m) 1を出力 else 0を出力 (1) ただし、最小符号記憶手段109から出力される最大符
号長を超える比較手段(m)については、その出力を強
制的に0になるように制御する。
Next, when m is a bit length, each comparing means (m) outputs m-bit signals S501A to S501D.
Is compared with the m-bit minimum code output from the minimum code storage means 109, and a determination is made by the following equation (1). if (S501A to S501D ≧ minimum code m) 1 is output else 0 is output (1) However, the output of the comparison means (m) exceeding the maximum code length output from the minimum code storage means 109 is forcibly output. Control so that it becomes zero.

【0042】プライオリティエンコーダ506は、これ
らの比較手段(1)502〜(4)505の結果から分
類後のハフマン符号の符号長KLを求める。図6はプラ
イオリティエンコーダ506の動作を示す図である。こ
のようにして得られた符号長は、符号列選択手段104
で、「先頭の連続する“1”及びそれに続く“0”」が
取り除かれた信号を元に生成されているため、それらを
考慮した値に修正する必要がある。連続する“1”の個
数は分類番号と同一値となっていることから、最終的な
符号長Lは、プライオリティエンコーダ506の出力
に、「分類番号+1」を加えた値になる。図5の加算器
(加算手段)507ではその加算処理を行っている。
The priority encoder 506 obtains the code length KL of the Huffman code after classification from the results of these comparing means (1) 502 to (4) 505. FIG. 6 is a diagram showing the operation of the priority encoder 506. The code length thus obtained is used as the code string selection means 104.
Since it is generated on the basis of the signal from which "the leading continuous" 1 "and the following" 0 "" are removed, it is necessary to correct the value in consideration of them. Since the number of consecutive "1" s has the same value as the classification number, the final code length L is a value obtained by adding "classification number +1" to the output of the priority encoder 506. The adder (adding means) 507 in FIG. 5 performs the addition processing.

【0043】図1のアドレス演算手段110は、符号長
L及びハフマンレジスタ107からのハフマン符号を含
む固定長の符号列を受けて、現在復号しようとしている
ハフマン符号の復号値が記憶されている復号テーブル記
憶手段111のメモリのアドレスを演算する。ここで、
符号長Lの最小符号をMC、最小符号MCが記憶されて
いる復号テーブル記憶手段111のメモリのアドレスを
MA、現在復号しようとしているハフマン符号をHCと
したとき、ハフマン符号が記憶されている復号テーブル
記憶手段111のメモリのアドレスDAは、次の(2)
式で求めることができる。 DA=MA+HC−MC (2) このとき、MA及びMCは符号長から一意に求まる値で
あり、以後「MA−MC」をベースアドレスBAと称す
ることとする。
The address calculating means 110 of FIG. 1 receives a code string of fixed length including the code length L and the Huffman code from the Huffman register 107, and decodes the decoded value of the Huffman code currently to be decoded. The address of the memory of the table storage means 111 is calculated. here,
Decoding in which the Huffman code is stored, where MC is the minimum code of the code length L, MA is the address of the memory of the decoding table storage means 111 in which the minimum code MC is stored, and HC is the Huffman code currently to be decoded. The address DA of the memory of the table storage means 111 is the following (2)
It can be obtained by a formula. DA = MA + HC-MC (2) At this time, MA and MC are values uniquely obtained from the code length, and hereinafter "MA-MC" will be referred to as a base address BA.

【0044】図7はアドレス演算手段110の構成を示
すブロック図である。ベースアドレス記憶手段701
は、上記の(2)式の「MA−MC」のベースアドレス
BAを各符号長に対応して記憶するもので、また、ハフ
マン符号抽出手段(可変長符号抽出手段)702は、ハ
フマンレジスタ107から出力される8ビットのハフマ
ン符号を含む固定長の符号列から符号長Lのハフマン符
号HCを抽出するものである。加算器(加算手段)70
3がベースアドレス記憶手段701からのベースアドレ
スBAとハフマン符号抽出手段702からの符号長Lの
ハフマン符号HCを加算することにより、ハフマン符号
が記憶されている復号テーブル記憶手段111のメモリ
のアドレスDAを求めることができる。なお、MAは0
〜31の値、MCが0〜255の値をとることから、B
Aは−255〜31となり9ビット幅のデータとなる。
FIG. 7 is a block diagram showing the configuration of the address calculation means 110. Base address storage means 701
Stores the base address BA of “MA-MC” in the above equation (2) in correspondence with each code length, and the Huffman code extracting means (variable length code extracting means) 702 is provided in the Huffman register 107. The Huffman code HC having the code length L is extracted from the fixed-length code string including the 8-bit Huffman code output from. Adder (adding means) 70
3 adds the base address BA from the base address storage means 701 and the Huffman code HC with the code length L from the Huffman code extraction means 702 to obtain the address DA of the memory of the decoding table storage means 111 in which the Huffman code is stored. Can be asked. Note that MA is 0
Since the value of ~ 31 and the value of MC are 0 to 255, B
A becomes -255 to 31, which is 9-bit width data.

【0045】最後に、図1に示す復号テーブル記憶手段
111は、入力されるアドレスに記憶されている復号値
を出力して復号処理を完了する。
Finally, the decoding table storage means 111 shown in FIG. 1 outputs the decoding value stored at the input address and completes the decoding process.

【0046】次に動作について説明する。図8は復号テ
ーブル記憶手段111に記憶されている復号テーブルの
例を示す図であり、ハフマン符号とその復号値の例、及
びハフマン符号を復号テーブル記憶手段111のメモリ
に記憶する際のアドレスの関係を示している。ここで
は、図8の第2列に示すように、最小符号長が3ビッ
ト、最大符号長が8ビットのハフマン符号があるものと
する。これらのハフマン符号は昇順に並べられており、
復号テーブル記憶手段111のメモリには、その順番で
復号値が記憶されるものとする。図8に示す例では、説
明を簡単にするために、アドレス=復号値としている。
Next, the operation will be described. FIG. 8 is a diagram showing an example of a decoding table stored in the decoding table storage means 111. Examples of the Huffman code and its decoded value and the addresses when the Huffman code is stored in the memory of the decoding table storage means 111 are shown. It shows the relationship. Here, as shown in the second column of FIG. 8, it is assumed that there is a Huffman code having a minimum code length of 3 bits and a maximum code length of 8 bits. These Huffman codes are arranged in ascending order,
The decoded values are stored in the memory of the decoding table storage means 111 in that order. In the example shown in FIG. 8, for simplicity of description, address = decoded value.

【0047】図9は図8のハフマン符号から生成したハ
フマンツリーを示す図であり、図10はこの可変長符号
復号装置に入力する符号列の例を図である。図9に示す
ハフマンツリーに従って、図10に示す符号列“100
101111111011000000”を復号する様
子を説明する。
FIG. 9 is a diagram showing a Huffman tree generated from the Huffman code of FIG. 8, and FIG. 10 is a diagram showing an example of a code string input to this variable length code decoding apparatus. According to the Huffman tree shown in FIG. 9, the code string “100” shown in FIG.
A description will be given of how to decode 1011111111101000000 ".

【0048】まず、図10に示す符号列がバイト単位に
入力されてくるとすると、符号レジスタ101は最低で
もハフマン符号2つ分の符号列が格納できるように制御
される。符号レジスタ101には、図2に示すように、
最大符号長8ビットの2つ分の符号列16ビットが格納
できるレジスタが用意されているため、2バイト分の符
号列が一時的に格納される。
First, assuming that the code string shown in FIG. 10 is input in byte units, the code register 101 is controlled so as to be able to store a code string of at least two Huffman codes. In the code register 101, as shown in FIG.
Since a register that can store two 16-bit code strings with a maximum code length of 8 bits is prepared, a 2-byte code string is temporarily stored.

【0049】バレルシフタ102は、図2に示す初期状
態の先頭ポインタ15から、最大符号長分の符号列をS
102Aとして符号列選択手段104に出力する。即
ち、符号レジスタ101の15ビット目から8ビット目
のデータ“10010111”を符号列選択手段104
に出力する。また、バレルシフタ102は、先頭ポイン
タから4ビットの符号列、即ち15ビット目から12ビ
ット目“1001”をS102Bとして符号分類手段1
03に出力する。
The barrel shifter 102 outputs a code string of the maximum code length from the initial pointer 15 in the initial state shown in FIG.
It is output to the code string selection means 104 as 102A. That is, the data “10010111” of the 15th bit to the 8th bit of the code register 101 is set to the code string selecting means 104.
Output to. Further, the barrel shifter 102 sets the 4-bit code string from the head pointer, that is, the 15th to 12th bits "1001" as S102B, to the code classification means 1
Output to 03.

【0050】符号分類手段103は図3に示す分類方法
に従って符号列を分類する。S102Bの先頭が“1
0”であることから、分類結果として分類番号は1とな
る。また、図3の分類方法を図9に示すハフマンツリー
上で考えると、図9中の点線枠で囲った部分に分類する
ことができる。ここで、各分類番号におけるハフマンツ
リーを部分ツリーと呼ぶものとする。
The code classifying means 103 classifies the code strings according to the classification method shown in FIG. The beginning of S102B is "1"
Since it is "0", the classification number is 1 as a result of classification. Also, considering the classification method of FIG. 3 on the Huffman tree shown in FIG. 9, classify into the portion surrounded by the dotted frame in FIG. Here, the Huffman tree for each classification number is called a partial tree.

【0051】符号列選択手段104は、符号分類手段1
03からの分類番号S103(=1)を受けて、バレル
シフタ102の出力である8ビットのハフマン符号の候
補S102Aから分類後のハフマン符号の候補(図3に
示すxのビット列4ビット)を抽出する。図3に従う
と、分類番号=1のときには、S102A(=1001
0111)の5ビット目から2ビット目の“0101”
を選択することになる。なお、ここで抽出された4ビッ
トの符号列は、図9に示す分類番号1の部分ツリーを復
号するのに必要な符号語となる。
The code string selecting means 104 is the code classifying means 1
In response to the classification number S103 (= 1) from 03, the Huffman code candidate after classification (4 bits of x bit string shown in FIG. 3) is extracted from the 8-bit Huffman code candidate S102A which is the output of the barrel shifter 102. . According to FIG. 3, when the classification number = 1, S102A (= 1001)
0111) 5th to 2nd bits "0101"
Will be selected. The 4-bit code string extracted here is a code word necessary for decoding the partial tree of classification number 1 shown in FIG.

【0052】符号分類手段103の出力1、符号列選択
手段104の出力“0101”及びバレルシフタ102
の出力“10010111”は、後段の処理のために、
それぞれ、分類レジスタ105、選択符号レジスタ10
6、ハフマンレジスタ107に一時的に格納される。
Output 1 of code classifying means 103, output "0101" of code string selecting means 104, and barrel shifter 102
Output "10010111" is for the subsequent processing,
Classification register 105 and selection code register 10 respectively
6, temporarily stored in the Huffman register 107.

【0053】最小符号記憶手段109は各部分ツリーを
復号するのに必要な各符号長の最小符号を記憶する。図
9のハフマンツリーを参照して、例えば、分類番号0に
おいては、2ビット長の最小符号を“00”、3ビット
長の最小符号を“100”とする。1ビット長、4ビッ
ト長の符号語は存在しないので、それぞれ最小符号を
“0”、“1111”としておく。各部分ツリーは最大
で4ビットしか持たないため、これだけ準備しておけば
良い。分類番号1については、1ビット長の最小符号が
“0”、2ビット長の最小符号が“00”、3ビット長
の最小符号が“010”、4ビット長の最小符号が“1
111”となる。以下同様に、各分類番号に対応して各
符号長の最小符号を記憶しておく。
The minimum code storage means 109 stores the minimum code of each code length necessary for decoding each partial tree. With reference to the Huffman tree of FIG. 9, for example, in the classification number 0, the minimum code of 2-bit length is "00" and the minimum code of 3-bit length is "100". Since there are no code words of 1-bit length and 4-bit length, the minimum codes are set to "0" and "1111", respectively. Each subtree has a maximum of only 4 bits, so it is sufficient to prepare this much. For classification number 1, the minimum code of 1-bit length is “0”, the minimum code of 2-bit length is “00”, the minimum code of 3-bit length is “010”, the minimum code of 4-bit length is “1”.
111 ". Similarly, the minimum code of each code length is stored corresponding to each classification number.

【0054】図11は最小符号記憶手段109に記憶さ
れている各分類番号に対応して求めた各符号長の最小符
号を示す図であり、図9に示すハフマンツリーに対して
求めたものである。最小符号記憶手段109では、図1
1に示すように、各符号長の最小符号のほかに、後述す
るデータ制限処理のために、各分類番号に対応して最大
符号長も同時に記憶しておく。
FIG. 11 is a diagram showing the minimum code of each code length obtained corresponding to each classification number stored in the minimum code storage means 109, which is obtained for the Huffman tree shown in FIG. is there. In the minimum code storage means 109, as shown in FIG.
As shown in FIG. 1, in addition to the minimum code of each code length, the maximum code length corresponding to each classification number is also stored at the same time for the data restriction process described later.

【0055】ここで、最小符号記憶手段109には、分
類番号として1が入力されてくるので、図11の表に従
って、符号長1の最小符号“0”、符号長2の最小符号
“00”、符号長3の最小符号“010”、符号長4の
最小符号“1111”、最大符号長3が出力される。
Since 1 is input to the minimum code storage means 109 as the classification number, the minimum code "0" with a code length 1 and the minimum code "00" with a code length 2 are shown in the table of FIG. , The minimum code “010” of code length 3, the minimum code “1111” of code length 4, and the maximum code length 3 are output.

【0056】図5に示す符号長演算手段108では、選
択符号レジスタ106からの出力である4ビットの符号
列“0101”に対して、まず、その上位1ビットの
“0”と分類番号=1における1ビットの最小符号
“0”を比較手段(1)502で比較する。比較手段
(1)502は先に記載した(1)式に従い判別して
“1”を出力する。次に、比較手段(2)503は上位
2ビット“01”と2ビットの最小符号“00”を比較
し“1”を出力する。比較手段(3)504は上位3ビ
ット“010”と3ビットの最小符号“010”を比較
し“1”を出力する。比較手段(4)505は、上位4
ビット“0101”と4ビットの最小符号“1111”
を比較するが、この比較手段(4)505のビット数は
最大符号長3を超えているため、強制的に“0”を出力
するようにデータを制限する。
In the code length calculating means 108 shown in FIG. 5, for the 4-bit code string "0101" output from the selection code register 106, first, the upper 1 bit "0" and the classification number = 1. The comparison means (1) 502 compares the 1-bit minimum code “0” in the above. The comparison means (1) 502 discriminates according to the above-mentioned equation (1) and outputs "1". Next, the comparing means (2) 503 compares the high-order 2 bits "01" with the 2-bit minimum code "00" and outputs "1". The comparing means (3) 504 compares the upper 3 bits "010" with the 3-bit minimum code "010" and outputs "1". Comparing means (4) 505 is the top 4
Bit "0101" and 4-bit minimum code "1111"
However, since the number of bits of the comparing means (4) 505 exceeds the maximum code length 3, the data is forcibly limited to output "0".

【0057】こうして、プライオリティエンコーダ50
6に、“1110”という信号が入力される。プライオ
リティエンコーダ506は、図6に示す対応表に従っ
て、分類後のハフマン符号の符号長KLを求めて“3”
を出力する。さらに、加算器507で分類番号(=1)
+1が加算され、最終的にハフマンツリー全体の符号長
L=3+1+1=5が求められる。
Thus, the priority encoder 50
A signal “1110” is input to 6. The priority encoder 506 obtains the code length KL of the Huffman code after classification according to the correspondence table shown in FIG.
Is output. Further, the classification number (= 1) is added by the adder 507.
+1 is added, and finally the code length L = 3 + 1 + 1 = 5 of the entire Huffman tree is obtained.

【0058】次にアドレス演算手段110の動作を説明
する。図12は図7に示すアドレス演算手段110のベ
ースアドレス記憶手段701に記憶されているベースア
ドレスを示す図である。このベースアドレスは先に説明
したように、「符号長Lの最小符号が記憶されている復
号テーブル記憶手段111のメモリのアドレスMA−符
号長Lの最小符号MC」を計算した結果であり、図12
では、わかりやすいように、それぞれMA、MCも併記
している。
Next, the operation of the address calculation means 110 will be described. FIG. 12 is a diagram showing the base address stored in the base address storage means 701 of the address calculation means 110 shown in FIG. This base address is the result of calculating "address MA of the memory of the decoding table storage means 111 in which the minimum code of the code length L is stored-the minimum code MC of the code length L", as described above. 12
Then, for easy understanding, MA and MC are also shown together.

【0059】図7において、符号長L=5が入力される
と、ベースアドレス記憶手段701からは“−11”が
出力され、さらに、ハフマン符号抽出手段702からは
ハフマンレジスタの8ビットの出力“1001011
1”のうち上位L(=5)ビットの信号を抽出し“00
010010”=18が出力される。ここで、ハフマン
符号抽出手段702の出力ビット数は、ハフマン符号の
最大符号長分用意しなければならないが、もし、現在復
号しようとしているハフマン符号がそのビット数に満た
ない場合は上位ビットに“0”を挿入して出力する。
In FIG. 7, when the code length L = 5 is input, "-11" is output from the base address storage means 701, and the 8-bit output of the Huffman register is output from the Huffman code extraction means 702. 1001011
The signal of the upper L (= 5) bits of "1" is extracted and "00" is extracted.
010010 "= 18 is output. Here, the number of output bits of the Huffman code extraction unit 702 must be prepared for the maximum code length of the Huffman code, but if the Huffman code currently being decoded is the number of bits. If it does not satisfy the condition, "0" is inserted in the upper bit and output.

【0060】加算器703は、それぞれの出力“−1
1”と“18”を加算して、復号テーブル記憶手段11
1のメモリのアドレス“7”を得て出力する。図8のハ
フマン符号表を見ると、アドレス“7”のハフマン符号
“10010”はハフマン符号抽出手段702の出力
“00010010”と一致していることがわかる。
The adder 703 outputs each output "-1".
Decoding table storage means 11 by adding 1 ”and“ 18 ”
The address "7" of the memory 1 is obtained and output. It can be seen from the Huffman code table of FIG. 8 that the Huffman code “10010” at the address “7” matches the output “00010010” of the Huffman code extraction means 702.

【0061】最終的に、復号テーブル記憶手段111か
らはアドレス7に記憶されている復号値“7”が出力さ
れる。
Finally, the decoding value "7" stored in the address 7 is output from the decoding table storage means 111.

【0062】また、図1の符号長演算手段108の出力
である符号長L=5はバレルシフタ102にも入力さ
れ、先頭ポインタを15−5=10にセットする。バレ
ルシフタ102からは符号レジスタ101の10ビット
目から3ビット目までの8ビットの信号をS102Aと
して出力し、同様に復号処理される。具体的には、S1
02A=“11111110”、S102B=“111
1”、分類番号=“4”となり、図5に示す符号長演算
手段108の4つの比較手段(1)502〜(4)50
5の出力は“1111”、符号長L=8が求められる。
The code length L = 5 output from the code length calculating means 108 in FIG. 1 is also input to the barrel shifter 102, and the leading pointer is set to 15-5 = 10. The barrel shifter 102 outputs an 8-bit signal from the 10th bit to the 3rd bit of the code register 101 as S102A, and is similarly decoded. Specifically, S1
02A = "11111110", S102B = "111"
1 ”, classification number =“ 4 ”, and the four comparison means (1) 502 to (4) 50 of the code length calculation means 108 shown in FIG.
The output of 5 is “1111”, and the code length L = 8 is obtained.

【0063】最後に、図1に示すアドレス演算手段11
0は、最終的な復号メモリ記憶手段111のメモリのア
ドレスをDA=−224+254=30と演算し、復号
テーブル記憶手段111から復号値“30”が出力され
る。なお、先頭ポインタが7以下になると、符号レジス
タ101は8ビット左シフトして上位の8ビットを捨て
る。そして、下位1バイトに次の符号データ1バイトを
読み込むと共に、先頭ポインタに8を加算し、現在のハ
フマン符号の先頭位置に合わせる。
Finally, the address calculation means 11 shown in FIG.
For 0, the final memory address of the decoding memory storage means 111 is calculated as DA = −224 + 254 = 30, and the decoding value “30” is output from the decoding table storage means 111. When the leading pointer becomes 7 or less, the code register 101 shifts left by 8 bits and discards the upper 8 bits. Then, 1 byte of the next code data is read in the lower 1 byte, and 8 is added to the head pointer to match the head position of the current Huffman code.

【0064】以上の処理を繰り返すことによって、可変
長ビットのハフマン符号データを復号することができ
る。
By repeating the above processing, variable length bit Huffman code data can be decoded.

【0065】従来例2の場合、ハフマン符号の最大符号
長が8ビットの場合であれば、符号長演算手段における
比較手段は1ビット〜8ビットのビット精度の比較器8
個を持つ必要があり、プライオリティエンコーダも1〜
8の値を出力できる構成のものが必要になる。それに比
べて、この実施の形態1の比較手段(1)502〜
(4)505では、1ビット〜4ビットのビット精度の
比較器4個で良く、プライオリティエンコーダ506も
1〜4の値を出力できれば良いことになる。
In the case of the conventional example 2, if the maximum code length of the Huffman code is 8 bits, the comparing means in the code length calculating means is the comparator 8 having a bit precision of 1 bit to 8 bits.
It is necessary to have one, and the priority encoder is 1 to
A structure capable of outputting a value of 8 is required. Compared with this, the comparison means (1) 502 of the first embodiment
(4) In 505, four comparators with bit precision of 1 bit to 4 bits are enough, and the priority encoder 506 is also required to be able to output the values of 1 to 4.

【0066】以上のように、この実施の形態1によれ
ば、入力された符号列を分類することで、比較手段
(1)502〜(4)505やプライオリティエンコー
ダ506のビット精度を削減できるため、処理時間が短
くなり、高速に動作させることが可能になるという効果
が得られる。また、先のビット精度の減少に加え、比較
手段(1)502〜(4)505における比較器数も削
減させることができるため、論理回路の規模を低減でき
るという効果も得られる。
As described above, according to the first embodiment, the bit precision of the comparison means (1) 502 to (4) 505 and the priority encoder 506 can be reduced by classifying the input code strings. The processing time can be shortened, and high speed operation can be achieved. Further, in addition to the reduction of the bit precision, it is possible to reduce the number of comparators in the comparison means (1) 502 to (4) 505, so that the effect of reducing the scale of the logic circuit can be obtained.

【0067】実施の形態2.図13はこの発明の実施の
形態2による可変長符号復号装置の構成を示すブロック
図である。図において、1301は符号長演算手段、1
302はアドレス演算手段、1303は復号テーブル記
憶手段、1304は加算器であり、図1と同一番号が付
与されている要素は共通の要素であることを意味する。
Embodiment 2. FIG. 13 is a block diagram showing the configuration of a variable length code decoding apparatus according to Embodiment 2 of the present invention. In the figure, reference numeral 1301 denotes a code length calculating means, 1
Reference numeral 302 is an address calculation means, 1303 is a decoding table storage means, 1304 is an adder, and it means that elements given the same numbers as in FIG. 1 are common elements.

【0068】上記実施の形態1では、復号テーブル記憶
手段111の復号テーブルにハフマン符号そのものを記
憶していたために、分類後のハフマン符号の符号長KL
から再度ハフマンツリー全体における符号長Lを計算し
て復号処理を行っていた。それに対して、この実施の形
態2では、復号テーブル記憶手段1303の復号テーブ
ルも分類後のハフマン符号を記憶する構成とすること
で、全体のハフマンツリーにおける符号長Lを再計算す
る処理を省き、さらに高速化を図るものである。
In the first embodiment, since the Huffman code itself is stored in the decoding table of the decoding table storage means 111, the code length KL of the Huffman code after classification is stored.
Therefore, the code length L in the entire Huffman tree is calculated again and the decoding process is performed. On the other hand, in the second embodiment, the decoding table of the decoding table storage unit 1303 is also configured to store the classified Huffman code, thereby omitting the process of recalculating the code length L in the entire Huffman tree. It is intended to further increase the speed.

【0069】次に上記実施の形態1と異なる要素である
符号長演算手段1301、アドレス演算手段1302、
復号テーブル記憶手段1303、加算器1304につい
て説明する。図14は符号長演算手段1301の構成を
示すブロック図であり、上記実施の形態1における図5
と同一番号が付与されている要素は共通の要素であるこ
とを意味し、図5の加算器507を省いたものである。
図14に示すように、この実施の形態2における符号長
演算手段1301では、プライオリティエンコーダ50
6の出力、即ち分類後のハフマン符号に対する符号長K
Lをそのまま出力する構成とする。
Next, the code length calculation means 1301, the address calculation means 1302, which are elements different from those of the first embodiment,
The decoding table storage means 1303 and the adder 1304 will be described. FIG. 14 is a block diagram showing the configuration of the code length calculation means 1301, and FIG.
The elements to which the same numbers are given are common elements, and the adder 507 of FIG. 5 is omitted.
As shown in FIG. 14, in the code length calculation means 1301 according to the second embodiment, the priority encoder 50 is used.
6, the code length K for the Huffman code after classification
L is output as it is.

【0070】図15はアドレス演算手段1302の構成
を示すブロック図である。図においてベースアドレス記
憶手段1501は、各分類番号に対応してベースアドレ
スKBAを記憶する。つまり、各分類番号における各符
号長の最小符号をKMC、その最小符号が記憶されてい
る復号テーブル記憶手段1303のメモリのアドレスを
KMAとしたとき、KBA=KMA−KMCを記憶して
おくことになる。
FIG. 15 is a block diagram showing the configuration of the address calculation means 1302. In the figure, a base address storage unit 1501 stores a base address KBA corresponding to each classification number. That is, assuming that the minimum code of each code length in each classification number is KMC and the memory address of the decoding table storage unit 1303 in which the minimum code is stored is KMA, KBA = KMA-KMC is stored. Become.

【0071】また、ハフマン符号抽出手段(可変長符号
抽出手段)1502は、選択符号レジスタ106の出力
である分類後のハフマン符号を含む符号列4ビットか
ら、符号長KLビットの分類後のハフマン符号KHCを
取り出す。ここでは、最大符号長にあわせて4ビットの
信号を出力する。加算器(加算手段)1503は、こう
して得られたベースアドレスKBA、及びハフマン符号
KHCをそれぞれ加算し、復号テーブル記憶手段130
3のメモリのアドレスKDAを求める。
Further, the Huffman code extracting means (variable length code extracting means) 1502 extracts the classified Huffman code of code length KL bits from the code string 4 bits including the classified Huffman code output from the selection code register 106. Take out KHC. Here, a 4-bit signal is output according to the maximum code length. The adder (adding means) 1503 adds the base address KBA and the Huffman code KHC thus obtained, respectively, and the decoding table storage means 130 is added.
The address KDA of the memory 3 is obtained.

【0072】復号テーブル記憶手段1303の復号テー
ブルも、各分類番号に対応してハフマン符号に対する復
号値を記憶しておく。つまり、分類の際に利用した「連
続する“1”とそれに続く“0”」は分類番号として記
憶し、それを取り除いた分類後のハフマン符号(最大4
ビット)に対して復号値を記憶しておくことになる。
The decoding table of the decoding table storage means 1303 also stores the decoding value for the Huffman code corresponding to each classification number. That is, the "consecutive" 1 "and the subsequent" 0 "" used in classification are stored as classification numbers, and the Huffman code after classification (maximum 4
The decoded value will be stored for each bit.

【0073】図13に示す加算器1304は、符号長演
算手段1301から出力される分類後のハフマン符号の
符号長KLに対して、「分類番号+1」を加算すること
で、ハフマンツリー全体の符号長Lを計算する。これを
使って、バレルシフタ102では、次のハフマン符号の
候補に先頭ポインタを移すことができるようになる。
The adder 1304 shown in FIG. 13 adds the "classification number +1" to the code length KL of the Huffman code after classification outputted from the code length calculation means 1301 to obtain the code of the entire Huffman tree. Calculate the length L. By using this, the barrel shifter 102 can move the head pointer to the next Huffman code candidate.

【0074】次に動作について説明する。図16は復号
テーブル記憶手段1303に記憶されている復号テーブ
ルの例を示す図であり、分類後のハフマン符号とその復
号値の例、及びハフマン符号を復号テーブル記憶手段1
303のメモリに記憶する際のアドレスの関係を示して
おり、実施の形態1の図8と比較して、各分類番号に対
応した復号テーブルとなっている。ここでは実施の形態
1と同様に、図10の符号列が入力されてきた場合に、
図16のハフマン復号テーブルを使って復号する例を説
明する。
Next, the operation will be described. FIG. 16 is a diagram showing an example of a decoding table stored in the decoding table storage means 1303. An example of the Huffman code after classification and its decoded value and the Huffman code are shown in the decoding table storage means 1.
The relationship of addresses when stored in the memory 303 is shown, which is a decoding table corresponding to each classification number as compared with FIG. 8 of the first embodiment. Here, as in the first embodiment, when the code string in FIG. 10 is input,
An example of decoding using the Huffman decoding table of FIG. 16 will be described.

【0075】先に説明したように、分類の際に利用した
「連続する“1”とそれに続く“0”」は分類番号とし
て記憶しているため、図16のハフマン符号は図8と比
較すると、先頭の幾つかのビットが削除されている。例
えば、分類番号1のハフマン符号について見てみる。ア
ドレス6は図8では“1000”であるのに対し、図1
6では“00”となっている。つまり、分類番号1であ
れば、先頭の2ビットは必ず“10”であるため、その
先頭2ビットを取り除かれた形となっている。同様に、
アドレス7については図8のハフマン符号“1001
0”の先頭2ビットを取り除いて“010”が、アドレ
ス8については、ハフマン符号“10011”の先頭2
ビットを取り除いて“011”が、アドレス9について
は、ハフマン符号“10100”の先頭2ビットを取り
除いて“100”が、アドレス10については、ハフマ
ン符号“10101”の先頭2ビットを取り除いて“1
01”が、アドレス11については、ハフマン符号“1
0110”の先頭2ビットを取り除いて“110”が、
アドレス12については、ハフマン符号“10111”
の先頭2ビットを取り除いて“111”が、記憶されて
いる。
As described above, since the "consecutive" 1 "and the subsequent" 0 "" used in classification are stored as classification numbers, the Huffman code of FIG. 16 is compared with FIG. , The first few bits have been removed. For example, consider the Huffman code of classification number 1. The address 6 is “1000” in FIG.
In the case of 6, it is “00”. In other words, if the classification number is 1, the leading 2 bits are always "10", so that the leading 2 bits are removed. Similarly,
For the address 7, the Huffman code “1001” in FIG.
"010" is obtained by removing the leading 2 bits of "0", but for address 8, the leading 2 of Huffman code "10011"
"011" is obtained by removing bits, "100" is obtained by removing the first 2 bits of Huffman code "10100" for address 9, and "1" is obtained by removing the first 2 bits of Huffman code "10101" for address 10.
01 ”is the Huffman code“ 1 ”for the address 11.
The first 2 bits of 0110 "are removed and" 110 "becomes
For address 12, Huffman code “10111”
"111" is stored by removing the first 2 bits of the.

【0076】図15に示すアドレス演算手段1302に
おけるベースアドレス記憶手段1501は、各分類番号
における各符号長のベースアドレスKBAを記憶する。
図17はベースアドレス記憶手段1501に記憶されて
いるベースアドレスを示す図であり、図16の復号テー
ブルに対して、各分類番号における各符号長の最小符号
KMCとそれが格納されているアドレスKMAからベー
スアドレスKBAを求める図である。
The base address storage means 1501 in the address calculation means 1302 shown in FIG. 15 stores the base address KBA of each code length in each classification number.
FIG. 17 is a diagram showing the base address stored in the base address storage means 1501. In the decoding table of FIG. 16, the minimum code KMC of each code length in each classification number and the address KMA in which it is stored. It is a figure which calculates | requires base address KBA from.

【0077】例えば、分類番号4の部分ツリーを見る
と、1ビットの符号は存在しないため、その意味で
“−”が記されている。2ビットの最小符号は“00”
で、これはアドレス24に記憶されていることから、ベ
ースアドレスKBA=KMA−MKC=24−0=24
となる。3ビットの最小符号は“010”で、これはア
ドレス25に記憶されていることから、ベースアドレス
KBA=25−2=23となる。4ビットの最小符号は
“1110”で、これはアドレス30に記憶されている
ことから、ベースアドレスKBA=30−14=16と
なる。このとき、KMAは0〜31、KMCが0〜15
であることを考えると、KBAは−15〜31となり、
6ビットの信号幅があれば良いことになる。
For example, looking at the partial tree of classification number 4, since there is no 1-bit code, "-" is written in that meaning. 2-bit minimum code is "00"
Since this is stored in the address 24, the base address KBA = KMA-MKC = 24-0 = 24.
Becomes The minimum code of 3 bits is "010", which is stored in the address 25, so that the base address KBA = 25-2 = 23. The minimum 4-bit code is "1110", which is stored in the address 30, so the base address KBA = 30-14 = 16. At this time, KMA is 0 to 31, and KMC is 0 to 15.
Considering that, KBA becomes -15 to 31,
A signal width of 6 bits would suffice.

【0078】次に実際の復号処理の流れを説明する。こ
こで、符号レジスタ101に図10の符号列が格納され
ているものとすると、実施の形態1の場合と同様に分類
レジスタ105には1が、選択符号レジスタ106には
“0101”が格納される。これをもとに、現在の分類
番号=1に対する符号長KLが計算され、これも実施の
形態1と同様に“3”と求められる。アドレス演算手段
1302は、符号長3と、分類番号1というデータをも
とに、図17の図を利用して、ベースアドレス“5”を
得る。
Next, the flow of the actual decoding process will be described. Here, assuming that the code string of FIG. 10 is stored in the code register 101, 1 is stored in the classification register 105 and “0101” is stored in the selection code register 106 as in the case of the first embodiment. It Based on this, the code length KL for the current classification number = 1 is calculated, and this is also determined as "3" as in the first embodiment. The address calculation means 1302 obtains the base address “5” based on the code length 3 and the data of the classification number 1 using the diagram of FIG.

【0079】次に、図15に示すアドレス演算手段13
02のハフマン符号抽出手段1502は、選択符号レジ
スタ106の出力“0101”のうち、上位KL(=
3)ビットを抽出し、さらに1ビットの“0”を付加し
て、4ビットのハフマン符号KHC=“0010”=2
を出力する。こうして、復号テーブル記憶手段1303
のメモリのアドレスKDAを求めると、KDA=KBA
+KHC=5+2=7が得られ、復号テーブル記憶手段
1303から復号値“7”が出力される。
Next, the address calculation means 13 shown in FIG.
The Huffman code extraction unit 1502 of No. 02 of the output “0101” of the selection code register 106 has the upper KL (=
3) Bits are extracted, 1-bit “0” is further added, and 4-bit Huffman code KHC = “0010” = 2
Is output. In this way, the decoding table storage means 1303
When the address KDA of the memory of is calculated, KDA = KBA
+ KHC = 5 + 2 = 7 is obtained, and the decoded value “7” is output from the decoding table storage unit 1303.

【0080】最後に、図13の符号長演算手段1301
から出力される分類後のハフマン符号の符号長KLに対
して、加算器1304は「分類番号+1」を加算してハ
フマンツリー全体の符号長Lを計算する。ここでは、符
号長3+分類番号1+1=5となり、符号長L=5を
得、バレルシフタ102に入力する。バレルシフタ10
2は次のハフマン符号の先頭ポインタの位置を計算し、
ハフマン符号を含む符号列8ビットを準備する。ここで
は、一つ前の先頭ポインタ15から符号長L=5を減算
して、次の先頭ポインタ10を得ることになる。
Finally, the code length calculation means 1301 of FIG.
The adder 1304 adds "classification number +1" to the code length KL of the Huffman code after classification output from to calculate the code length L of the entire Huffman tree. Here, the code length is 3 + the classification number 1 + 1 = 5, the code length L = 5 is obtained, and is input to the barrel shifter 102. Barrel shifter 10
2 calculates the position of the leading pointer of the next Huffman code,
An 8-bit code string including a Huffman code is prepared. In this case, the code length L = 5 is subtracted from the previous head pointer 15 to obtain the next head pointer 10.

【0081】以上の処理を繰り返すことによって、可変
長ビットのハフマン符号データを復号することができ
る。
By repeating the above processing, variable length bit Huffman code data can be decoded.

【0082】以上のように、この実施の形態2によれ
ば、符号長演算手段1301、アドレス演算手段130
2、復号テーブル記憶手段1303による復号処理を、
各分類後のハフマン符号に対して行う構成にすることに
より、実施の形態1に比べ、符号長演算手段1301の
加算器を取り除けると共に、アドレス演算手段1302
の加算器1503のビット数も削減することができ、さ
らに処理時間が短くなり、さらなる高速処理を実現でき
ると共に、さらに論理回路の規模を低減できるという効
果が得られる。
As described above, according to the second embodiment, the code length calculating means 1301 and the address calculating means 130 are provided.
2. Decoding processing by the decoding table storage means 1303
By adopting a configuration in which the Huffman code after each classification is performed, the adder of the code length calculating means 1301 can be removed and the address calculating means 1302 can be removed as compared with the first embodiment.
The number of bits of the adder 1503 can be reduced, the processing time can be further shortened, higher speed processing can be realized, and the size of the logic circuit can be further reduced.

【0083】実施の形態3.図18はこの発明の実施の
形態3による可変長符号復号装置の構成を示すブロック
図であり、図において、1801は最大符号記憶手段、
1802は符号長演算手段、1803はアドレス演算手
段であり、図1と同一番号が付与されている要素は共通
の要素であることを意味する。この実施の形態3は、実
施の形態1で符号長を求める際に使用していた各符号長
の最小符号を最大符号に代えて実現するものである。
Third Embodiment FIG. 18 is a block diagram showing the configuration of a variable-length code decoding apparatus according to Embodiment 3 of the present invention, in which 1801 is a maximum code storage means.
Reference numeral 1802 is a code length calculation means, and 1803 is an address calculation means, which means that elements given the same numbers as in FIG. 1 are common elements. The third embodiment is realized by replacing the minimum code of each code length used when obtaining the code length in the first embodiment with the maximum code.

【0084】符号長演算手段1802の構成を示すブロ
ック図は、実施の形態1の図5に示す符号長演算手段1
08の構成と基本的には同じであるが、比較手段(1)
502〜(4)505に入力されている最小符号1〜4
の代わりに、最大符号1〜4が入力され、最大符号長の
代わりに最小符号長が入力される点が異なっている。ま
た、アドレス演算手段1803の構成を示すブロック図
は、実施の形態1の図7に示すアドレス演算手段110
の構成と同じである。
The block diagram showing the configuration of the code length calculating means 1802 is the code length calculating means 1 shown in FIG. 5 of the first embodiment.
The configuration is basically the same as the configuration of 08, but comparison means (1)
502 to (4) Minimum code 1 to 4 input to 505
The maximum difference is that the maximum codes 1 to 4 are input instead of, and the minimum code length is input instead of the maximum code length. Further, the block diagram showing the configuration of the address calculation unit 1803 is the address calculation unit 110 shown in FIG. 7 of the first embodiment.
The configuration is the same as that of.

【0085】最大符号記憶手段1801は、各分類番号
の部分ツリーにおいて求められる各符号長の最大符号を
記憶することを特徴としており、同時にそれぞれの分類
番号における最小符号長も記憶する。図19は各分類番
号に対応した各符号長の最大符号を示す図である。図8
に示す復号テーブルを用いた場合を例として、この最大
符号記憶手段1801の内容を求めると図19のように
なる。最大符号記憶手段1801では、図19に示すよ
うに、データ制限処理のために、各分類番号の最小符号
長も同時に記憶しておく。
The maximum code storage means 1801 is characterized by storing the maximum code of each code length obtained in the subtree of each classification number, and at the same time stores the minimum code length of each classification number. FIG. 19 is a diagram showing the maximum code of each code length corresponding to each classification number. Figure 8
FIG. 19 shows the contents of the maximum code storage unit 1801 when the decoding table shown in FIG. As shown in FIG. 19, the maximum code storage unit 1801 also stores the minimum code length of each classification number at the same time for the data restriction process.

【0086】符号長演算手段1802は、実施の形態1
における図5の構成と比較して、以下の点が異なる。ま
ず、最小符号1〜4、及び最大符号長の入力の代わり
に、最大符号記憶手段1801の出力を受けて、最大符
号1〜4、及び最小符号長が入力されることになる。ま
た、各比較手段(m)も、次の(3)式により判定を行
う。 if(S501A〜D≦最大符号m) 0を出力 else 1を出力 (3) ただし、最大符号記憶手段1801から出力される最小
符号長を下回るビット数の比較手段(m)については、
その出力を強制的に1になるように制御する。なお、上
記(3)式においてmは対応するビット数を表してい
る。図20は図5に示すプライオリティエンコーダ50
6の動作を示す図である。
The code length calculating means 1802 is the same as in the first embodiment.
5 is different from that of FIG. 5 in the following points. First, instead of inputting the minimum codes 1 to 4 and the maximum code length, the maximum code storage unit 1801 receives the output and the maximum codes 1 to 4 and the minimum code length are input. Further, each comparison means (m) also makes a determination by the following equation (3). if (S501A to D ≦ maximum code m) 0 is output else 1 is output (3) However, regarding the comparison means (m) of the number of bits less than the minimum code length output from the maximum code storage means 1801,
The output is forcibly controlled to be 1. In the above equation (3), m represents the corresponding number of bits. 20 shows a priority encoder 50 shown in FIG.
It is a figure which shows operation | movement of 6.

【0087】実施の形態1におけるアドレス演算手段1
10は、上記(2)式から復号テーブル記憶手段111
のメモリのアドレスDAを求めていたが、この実施の形
態3のアドレス演算手段1803は、符号長Lの最大符
号をNC、符号長Lの最大符号NCが記憶されている復
号テーブル記憶手段111のメモリのアドレスをNA、
現在復号しようとしているハフマン符号をHCとしたと
き、ハフマン符号が記憶されている復号テーブル記憶手
段111のメモリのアドレスDAを、次の(4)式によ
り求める。 DA=NA−(NC−HC)=NA−NC+HC (4) このとき、ベースアドレスBAはBA=NA−NCとし
て、図7に示すベースアドレス記憶手段701に記憶し
ておくものとする。
Address calculating means 1 in the first embodiment
10 is the decoding table storage means 111 from the above equation (2).
The address calculation unit 1803 of the third embodiment has the maximum code NC of the code length L and the maximum code NC of the code length L stored in the decoding table storage unit 111. Memory address is NA,
When the Huffman code currently to be decoded is HC, the address DA of the memory of the decoding table storage means 111 in which the Huffman code is stored is calculated by the following equation (4). DA = NA- (NC-HC) = NA-NC + HC (4) At this time, the base address BA is stored as BA = NA-NC in the base address storage means 701 shown in FIG.

【0088】図21はベースアドレス記憶手段701に
記憶されているベースアドレスを示す図である。
FIG. 21 is a diagram showing the base address stored in the base address storage means 701.

【0089】次に動作について説明する。実施の形態1
と同様に、図10に示す入力された符号列に対して、図
8の復号テーブルで復号する様子を説明する。まず、符
号レジスタ101に格納された符号列から、バレルシフ
タ102、符号分類手段103、符号列選択手段104
を経て、分類番号及び分類後のハフマン符号含む固定長
の符号列、現在復号しようとしているハフマン符号を含
む固定長の符号列が、それぞれ分類レジスタ105、選
択符号レジスタ106、ハフマンレジスタ107に格納
されることは、実施の形態1と同じである。従って、分
類レジスタ105の出力は1、選択符号レジスタ106
の出力は“0101”、ハフマンレジスタ107の出力
は“10010111”となる。
Next, the operation will be described. Embodiment 1
Similarly to the above, a description will be given of how the input code string shown in FIG. 10 is decoded by the decoding table of FIG. First, from the code string stored in the code register 101, the barrel shifter 102, the code classifying means 103, and the code string selecting means 104.
After that, a fixed-length code string including the classification number and the Huffman code after classification, and a fixed-length code string including the Huffman code currently to be decoded are stored in the classification register 105, the selection code register 106, and the Huffman register 107, respectively. This is the same as in the first embodiment. Therefore, the output of the classification register 105 is 1, and the selection code register 106 is
Is 0101, and the output of the Huffman register 107 is 100100111.

【0090】ここで、最大符号記憶手段1801に図1
9に示すデータが記憶されているものとする。分類番号
として1が入力されてくるので、図19に従って、符号
長1の最大符号“0”、符号長2の最大符号“00”、
符号長3の最大符号“111”、符号長4の最大符号
“1111”、最小符号長2が出力される。
Here, the maximum code storage means 1801 shown in FIG.
It is assumed that the data shown in 9 is stored. Since 1 is input as the classification number, the maximum code “0” with a code length 1 and the maximum code “00” with a code length 2 according to FIG.
The maximum code "111" of code length 3, the maximum code "1111" of code length 4, and the minimum code length 2 are output.

【0091】符号長演算手段1802は、選択符号レジ
スタ106からの出力である4ビットの符号列“010
1”に対して、まず、その上位1ビットの“0”と分類
番号1における1ビットの最大符号“0”とを、図5に
示す比較手段(1)502で上記(3)式に従って比較
処理する。しかしながら、この比較手段(1)502の
ビット数は最大符号記憶手段1801から出力される最
小符号長2より小さいため強制的に“1”を出力する。
The code length calculating means 1802 outputs a 4-bit code string "010" output from the selection code register 106.
For “1”, first, the upper 1 bit “0” and the 1-bit maximum code “0” in the classification number 1 are compared by the comparing means (1) 502 shown in FIG. However, since the number of bits of the comparison means (1) 502 is smaller than the minimum code length 2 output from the maximum code storage means 1801, "1" is forcibly output.

【0092】次に、比較手段(2)503は、上位2ビ
ット“01”と2ビットの最大符号“00”を比較し
“1”を出力する。比較手段(3)504は、上位3ビ
ット“010”と3ビットの最大符号“111”を比較
し“0”を出力する。比較手段(4)505では、上位
4ビット“0101”と4ビットの最大符号“111
1”を比較し“0”を出力する。
Next, the comparing means (2) 503 compares the high-order 2 bits "01" with the 2-bit maximum code "00" and outputs "1". The comparison means (3) 504 compares the upper 3 bits “010” with the maximum 3-bit code “111” and outputs “0”. In the comparison means (4) 505, the upper 4 bits “0101” and the maximum 4-bit code “111”
1 "is compared and" 0 "is output.

【0093】こうして、プライオリティエンコーダ50
6に、“1100”という信号が入力される。プライオ
リティエンコーダ506は、図20に従って、分類後の
ハフマン符号の符号長KLを求める。ここでは、“3”
を出力することとなる。さらに、加算器507で分類番
号(=1)+1が加算され、最終的にハフマンツリー全
体の符号長L=3+1+1=5が求められる。
Thus, the priority encoder 50
A signal “1100” is input to 6. The priority encoder 506 obtains the code length KL of the Huffman code after classification according to FIG. Here, "3"
Will be output. Further, the classification number (= 1) +1 is added by the adder 507, and finally the code length L = 3 + 1 + 1 = 5 of the entire Huffman tree is obtained.

【0094】次にアドレス演算手段1803の動作を説
明する。図21より符号長5のベースアドレスは、BA
=NA−NC=13−24=−11となり、図7のベー
スアドレス記憶手段701から出力される。現在のハフ
マン符号HCは、ハフマンレジスタ107の8ビットの
出力“10010111”のうち上位5ビットの信号を
抽出し“00010010”=18となり、ハフマン符
号抽出手段702から出力される。加算器703は、こ
れらを加算して−11+18=7を得、これが復号テー
ブル記憶手段111のメモリのアドレスとなる。
Next, the operation of the address calculation means 1803 will be described. From FIG. 21, the base address of code length 5 is BA
= NA-NC = 13-24 = -11, which is output from the base address storage unit 701 of FIG. The current Huffman code HC is output from the Huffman code extraction unit 702 by extracting the upper 5 bits of the 8-bit output “10010111” of the Huffman register 107 and setting “00010010” = 18. The adder 703 adds these to obtain −11 + 18 = 7, and this becomes the memory address of the decoding table storage means 111.

【0095】最終的に、復号テーブル記憶手段111か
らはアドレス7を参照して復号値“7”が出力されるこ
とになる。
Finally, the decoding value "7" is output from the decoding table storage means 111 with reference to the address 7.

【0096】以上の処理を繰り返すことによって、可変
長ビットのハフマン符号データを実施の形態1と同様に
復号することができる。
By repeating the above processing, variable length bit Huffman code data can be decoded as in the first embodiment.

【0097】以上のように、この実施の形態3によれ
ば、実施の形態1と同様に、処理時間が短くなり高速に
動作させることができると共に、論理回路の規模を低減
できるという効果が得られる。
As described above, according to the third embodiment, similar to the first embodiment, the processing time can be shortened, high-speed operation can be achieved, and the scale of the logic circuit can be reduced. To be

【0098】実施の形態4.図22はこの発明の実施の
形態4による可変長符号復号装置の構成を示すブロック
図であり、図において、2201は符号長演算手段、2
202はアドレス演算手段であり、実施の形態2におけ
る図13と同一番号が付与されている要素は共通の要素
であることを意味し、実施の形態3における図18と同
一番号が付与されている要素は共通の要素であることを
意味する。この実施の形態4は、実施の形態2で符号長
を求める際に使用していた各符号長の最小符号を最大符
号に代えて実現するものである。
Fourth Embodiment 22 is a block diagram showing the configuration of a variable-length code decoding apparatus according to Embodiment 4 of the present invention. In the figure, reference numeral 2201 denotes code length calculation means, 2201.
Reference numeral 202 denotes an address calculation means, which means that elements given the same numbers as those in FIG. 13 in the second embodiment are common elements, and are given the same numbers as those in FIG. 18 in the third embodiment. Elements are common elements. The fourth embodiment is realized by replacing the minimum code of each code length used when obtaining the code length in the second embodiment with the maximum code.

【0099】符号長演算手段2201の構成を示すブロ
ック図は、実施の形態2の図14に示す符号長演算手段
1301の構成と基本的には同じであるが、比較手段
(1)502〜(4)505に入力されている最小符号
1〜4の代わりに、最大符号1〜4が入力され、最大符
号長の代わりに最小符号長が入力される点が異なってい
る。また、アドレス演算手段2202の構成を示すブロ
ック図は、実施の形態2の図15に示すアドレス演算手
段1302の構成と同じである。
The block diagram showing the configuration of the code length calculation means 2201 is basically the same as the configuration of the code length calculation means 1301 shown in FIG. 14 of the second embodiment, but the comparison means (1) 502- ( 4) The maximum codes 1 to 4 are input instead of the minimum codes 1 to 4 input to 505, and the minimum code length is input instead of the maximum code length. Further, the block diagram showing the configuration of address computing means 2202 is the same as the configuration of address computing means 1302 shown in FIG. 15 of the second embodiment.

【0100】符号長演算手段2201は、実施の形態2
における図14の構成と比較して、以下の点が異なる。
まず、最小符号1〜4、及び最大符号長の入力の代わり
に、最大符号記憶手段1801の出力を受けて、最大符
号1〜4、及び最小符号長が入力されることになる。ま
た、各比較手段(m)も、次の(5)式により判定す
る。 if(S501A〜D≦最大符号m) 0を出力 else 1を出力 (5) ただし、最大符号記憶手段1801から出力される最小
符号長を下回るビット数の比較手段(m)についてはそ
の出力が強制的に1になるように制御する。なお、上記
(5)式においてmは対応するビット数を表している。
プライオリティエンコーダ506の動作は図20に示す
対応表のようになる。
The code length calculating means 2201 is the same as the second embodiment.
14 is different from the configuration of FIG. 14 in the following points.
First, instead of inputting the minimum codes 1 to 4 and the maximum code length, the maximum code storage unit 1801 receives the output and the maximum codes 1 to 4 and the minimum code length are input. Further, each comparing means (m) also makes a determination by the following equation (5). if (S501A to D ≦ maximum code m) 0 is output else 1 is output (5) However, the output is forced for the comparison means (m) having the number of bits less than the minimum code length output from the maximum code storage means 1801. Control so that it becomes 1. In the above equation (5), m represents the corresponding number of bits.
The operation of the priority encoder 506 is as shown in the correspondence table shown in FIG.

【0101】実施の形態2におけるアドレス演算手段1
302は、各分類番号に対応した符号長Lの最小符号K
MC、及び最小符号KMCが格納されている復号テーブ
ル記憶手段1303のメモリのアドレスKMA、分類後
のハフマン符号KHCから復号テーブル記憶手段130
3のメモリのアドレスKDAを計算していた。この実施
の形態4のアドレス演算手段2202は、各分類番号の
符号長Lの最大符号をKNC、その最大符号KNCが記
憶されている復号テーブル記憶手段1303のメモリの
アドレスをKNA、分類後のハフマン符号をKHCとし
たとき、ハフマン符号が記憶されている復号テーブル記
憶手段1303のメモリのアドレスKDAを次の(6)
式により求める。 KDA=KNA−(KNC−KHC)=KNA−KNC+KHC (6) このとき、ベースアドレスKBAはKBA=KNA−K
NCとして、図15に示すベースアドレス記憶手段15
01に記憶しておくこととする。
Address calculating means 1 in the second embodiment
302 is a minimum code K of code length L corresponding to each classification number
Decoding table storage means 130 from the address KMA of the memory of the decoding table storage means 1303 in which MC and the minimum code KMC are stored and the Huffman code KHC after classification
The address KDA of memory 3 was calculated. The address calculation unit 2202 of the fourth embodiment uses KNC as the maximum code of the code length L of each classification number, KNA as the memory address of the decoding table storage unit 1303 in which the maximum code KNC is stored, and Huffman after classification. When the code is KHC, the address KDA of the memory of the decoding table storage means 1303 in which the Huffman code is stored is the following (6).
Calculate by formula. KDA = KNA- (KNC-KHC) = KNA-KNC + KHC (6) At this time, the base address KBA is KBA = KNA-K.
As the NC, the base address storage means 15 shown in FIG.
It will be stored in 01.

【0102】図23はベースアドレス記憶手段1501
に記憶されている各分類番号に対応して求めたベースア
ドレスを示す図であり、図16に示す復号テーブルを用
いた場合のベースアドレスを示している。
FIG. 23 shows base address storage means 1501.
FIG. 17 is a diagram showing a base address obtained corresponding to each classification number stored in FIG. 16, and shows a base address when the decoding table shown in FIG. 16 is used.

【0103】次に動作について説明する。実施の形態2
と同様に、図10の入力された符号列に対して、図16
の復号テーブルで復号する様子を説明する。まず、符号
レジスタ101に格納された符号列から、バレルシフタ
102、符号分類手段103、符号列選択手段104を
経て、分類番号及び分類後のハフマン符号を含む符号列
が、それぞれ分類レジスタ105、選択符号レジスタ1
06に格納されることは、実施の形態2と同じである。
従って、分類レジスタの出力は“1”、選択符号レジス
タの出力は“0101”となる。
Next, the operation will be described. Embodiment 2
Similarly to the input code string in FIG.
A description will be given of how the decoding is performed by the decoding table of 1. First, from the code string stored in the code register 101, through the barrel shifter 102, the code classifying means 103, and the code string selecting means 104, the code strings including the classification number and the Huffman code after classification are classified register 105 and selection code, respectively. Register 1
It is the same as the second embodiment that it is stored in 06.
Therefore, the output of the classification register is "1" and the output of the selection code register is "0101".

【0104】また、最大符号記憶手段1801の動作に
ついては、実施の形態3と同じである。従って、分類番
号1における符号長1の最大符号“0”、符号長2の最
大符号“00”、符号長3の最大符号“111”、符号
長4の最大符号“1111”、最小符号長2が出力され
る。
The operation of the maximum code storage means 1801 is the same as in the third embodiment. Therefore, in the classification number 1, the maximum code “0” with the code length 1, the maximum code “00” with the code length 2, the maximum code “111” with the code length 3, the maximum code “1111” with the code length 4, and the minimum code length 2 Is output.

【0105】符号長演算手段2201では、選択符号レ
ジスタ106からの出力である4ビットの符号列“01
01”に対して、まず、その上位1ビットの“0”と分
類番号1における1ビットの最大符号“0”とを、図1
4に示す比較手段(1)502で上記(5)式に従って
比較処理する。しかしながら、このビット数の比較手段
(m)は最大符号記憶手段1801から出力される最小
符号長2より小さいため強制的に“1”を出力する。
In the code length calculation means 2201, the 4-bit code string "01" output from the selection code register 106 is output.
For “01”, first, the upper 1 bit “0” and the 1-bit maximum code “0” in the classification number 1 are shown in FIG.
The comparison means (1) 502 shown in FIG. 4 performs comparison processing according to the above equation (5). However, since the comparison means (m) of the number of bits is smaller than the minimum code length 2 output from the maximum code storage means 1801, "1" is forcibly output.

【0106】比較手段(2)503は、上位2ビット
“01”と2ビットの最大符号“00”を比較し“1”
を出力する。比較手段(3)504は、上位3ビット
“010”と3ビットの最大符号“111”を比較し
“0”を出力する。比較手段(4)505では、上位4
ビット“0101”と4ビットの最大符号“1111”
を比較し“0”を出力する。
The comparing means (2) 503 compares the high-order 2 bits “01” with the 2-bit maximum code “00” and outputs “1”.
Is output. The comparison means (3) 504 compares the upper 3 bits “010” with the maximum 3-bit code “111” and outputs “0”. In the comparison means (4) 505, the top 4
Bit “0101” and 4-bit maximum code “1111”
And outputs "0".

【0107】こうして、図14に示すプライオリティエ
ンコーダ506に、“1100”という信号が入力され
る。プライオリティエンコーダ506は、図20に従っ
て、分類後のハフマン符号の符号長KLを求めて3を出
力する。
Thus, the signal "1100" is input to the priority encoder 506 shown in FIG. The priority encoder 506 calculates the code length KL of the Huffman code after classification according to FIG. 20, and outputs 3.

【0108】図23は各分類番号に対応して求めたベー
スアドレスを示す図である。アドレス演算手段2202
は、図23より符号長3のベースアドレスKBAを、K
BA=KNA−KNC=12−7=5と求め、図15に
示すベースアドレス記憶手段1501から出力される。
4ビットのハフマン符号KHCは、選択符号レジスタ1
06の4ビットの出力“0101”のうち上位3ビット
の信号を抽出し“0010”=2となり、ハフマン符号
抽出手段1502から出力される。加算器1503は、
これらを加算して5+2=7を得て、これが復号テーブ
ル記憶手段1303のメモリのアドレスとなる。
FIG. 23 is a diagram showing the base address found corresponding to each classification number. Address calculation means 2202
23, the base address KBA of code length 3 is
BA = KNA−KNC = 12−7 = 5 is obtained and output from the base address storage means 1501 shown in FIG.
The 4-bit Huffman code KHC is the selection code register 1
Of the 4-bit output “0101” of 06, the signal of the upper 3 bits is extracted and “0010” = 2, which is output from the Huffman code extraction means 1502. The adder 1503 is
These are added to obtain 5 + 2 = 7, which is the address of the memory of the decoding table storage means 1303.

【0109】最終的に、復号テーブル記憶手段1303
からはアドレス7を参照して復号値“7”が出力され
る。
Finally, the decoding table storage means 1303
Outputs a decoded value "7" with reference to the address 7.

【0110】また、図22に示す符号長演算手段220
1から出力される分類後のハフマン符号の符号長KLに
対して、加算器1304は「分類番号+1」を加算して
ハフマンツリー全体の符号長Lを計算する。ここでは、
符号長3+分類番号1+1=5となり符号長L=5を得
てバレルシフタ102に入力する。バレルシフタ102
は次のハフマン符号の先頭ポインタを計算し、ハフマン
符号を含む符号列8ビットを準備する。ここでは、一つ
前の先頭ポインタ15から符号長L=5を減算して、次
の先頭ポインタ10を得ることになる。
Further, the code length calculating means 220 shown in FIG.
The adder 1304 adds “classification number + 1” to the code length KL of the Huffman code after classification output from 1 to calculate the code length L of the entire Huffman tree. here,
The code length 3 + the classification number 1 + 1 = 5 is obtained, and the code length L = 5 is obtained and input to the barrel shifter 102. Barrel shifter 102
Calculates the head pointer of the next Huffman code and prepares an 8-bit code string including the Huffman code. In this case, the code length L = 5 is subtracted from the previous head pointer 15 to obtain the next head pointer 10.

【0111】以上の処理を繰り返すことによって、可変
長ビットのハフマン符号データを実施の形態2と同様に
復号することができる。
By repeating the above processing, variable length bit Huffman code data can be decoded as in the second embodiment.

【0112】以上のように、この実施の形態4によれ
ば、符号長演算手段2201、アドレス演算手段220
2、復号テーブル記憶手段1303による復号処理を、
各分類後のハフマン符号に対して行う構成にすることに
より、実施の形態3に比べ、符号長演算手段2201の
加算器を取り除けると共に、アドレス演算手段2202
の加算器1503のビット数も削減することができ、さ
らに処理時間が短くなり、さらなる高速処理を実現でき
ると共に、さらに論理回路の規模を低減できるという効
果が得られる。
As described above, according to the fourth embodiment, the code length calculating means 2201 and the address calculating means 220 are included.
2. Decoding processing by the decoding table storage means 1303
By adopting a configuration for the Huffman code after each classification, the adder of the code length calculation means 2201 can be removed and the address calculation means 2202 can be removed as compared with the third embodiment.
The number of bits of the adder 1503 can be reduced, the processing time can be further shortened, higher speed processing can be realized, and the size of the logic circuit can be further reduced.

【0113】なお、上記実施の形態1から実施の形態4
では、最大符号長8ビット、ハフマン符号数32以下の
例で説明してきたが、この数値に限るものではなく、最
大符号長とハフマン符号数が既知であれば、どのような
場合でも適応することができる。特に、最大符号長が大
きくなるほどその効果も大きくなる。
Incidentally, the above-mentioned first to fourth embodiments.
In the above, the example in which the maximum code length is 8 bits and the Huffman code number is 32 or less has been described, but the present invention is not limited to this value, and any case where the maximum code length and the Huffman code number are known is applicable. You can In particular, the larger the maximum code length, the greater the effect.

【0114】[0114]

【発明の効果】以上のように、この発明によれば、復号
するのに必要な分類結果に応じた各符号長の最小符号を
記憶している最小符号記憶手段と、符号列選択手段によ
り抽出された分類後の可変長符号を含む固定長の符号列
と、最小符号記憶手段に記憶されている分類結果に応じ
た各符号長の最小符号を比較して、分類後の可変長符号
の符号長を演算し、演算した分類後の可変長符号の符号
長と分類結果により、可変長符号の符号長を演算する符
号長演算手段と、符号長演算手段により演算された可変
長符号の符号長と、バレルシフタにより抽出された可変
長符号を含む固定長の符号列により、復号値が記憶され
ている復号テーブル記憶手段のアドレスを演算するアド
レス演算手段とを備えたことにより、処理時間が短くな
り高速に動作させることができると共に、論理回路の規
模を低減できるという効果がある。
As described above, according to the present invention, the minimum code storage means for storing the minimum code of each code length according to the classification result necessary for decoding and the code string selection means extract the code. The fixed-length code string including the classified variable-length code and the minimum code of each code length corresponding to the classification result stored in the minimum code storage means are compared, and the code of the variable-length code after classification is compared. A code length calculating means for calculating the length and calculating the code length of the variable length code according to the calculated code length of the variable length code after classification and the classification result, and a code length of the variable length code calculated by the code length calculating means. And the address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by the fixed length code string including the variable length code extracted by the barrel shifter, thereby shortening the processing time. Operate at high speed It is possible, the effect of reducing the scale of the logic circuit.

【0115】この発明によれば、符号長演算手段が、ビ
ット分配手段から出力される各符号列を、最小符号記憶
手段に記憶されている分類結果に応じた各符号長の最小
符号と比較する複数の比較手段と、複数の比較手段の出
力から分類後の可変長符号の符号長を求めるプライオリ
ティエンコーダと、プライオリティエンコーダからの分
類後の可変長符号の符号長と、符号分類手段からの分類
結果により、可変長符号の符号長を演算する加算手段と
を備えたことにより、比較手段やプライオリティエンコ
ーダのビット精度を削減できるため、処理時間が短くな
り高速に動作させることができると共に、論理回路の規
模を低減できるという効果がある。
According to the present invention, the code length calculation means compares each code string output from the bit distribution means with the minimum code of each code length corresponding to the classification result stored in the minimum code storage means. A plurality of comparing means, a priority encoder for obtaining the code length of the variable length code after classification from the outputs of the plurality of comparing means, a code length of the variable length code after classification from the priority encoder, and a classification result from the code classifying means Since the addition means for calculating the code length of the variable-length code is provided, the bit accuracy of the comparison means and the priority encoder can be reduced, so that the processing time can be shortened and the operation can be performed at high speed. The effect is that the scale can be reduced.

【0116】この発明によれば、復号するのに必要な分
類結果に応じた各符号長の最小符号を記憶している最小
符号記憶手段と、符号列選択手段により抽出された分類
後の可変長符号を含む固定長の符号列と、最小符号記憶
手段に記憶されている分類結果に応じた各符号長の最小
符号を比較して、分類後の可変長符号の符号長を演算す
る符号長演算手段と、符号長演算手段により演算された
分類後の可変長符号の符号長と、分類結果と、符号列選
択手段により抽出された分類後の可変長符号を含む固定
長の符号列により、復号値が記憶されている復号テーブ
ル記憶手段のアドレスを演算するアドレス演算手段とを
備えたことにより、さらに処理時間が短くなり、さらな
る高速処理を実現できると共に、論理回路の規模を低減
できるという効果がある。
According to the present invention, the minimum code storage means for storing the minimum code of each code length corresponding to the classification result necessary for decoding, and the variable length after classification extracted by the code string selection means. A code length operation for calculating the code length of a variable length code after classification by comparing a fixed-length code string including a code with the minimum code of each code length according to the classification result stored in the minimum code storage means. Means, a code length of the variable length code after classification calculated by the code length calculation means, a classification result, and a fixed length code string including the variable length code after classification extracted by the code string selection means. By providing the address calculation means for calculating the address of the decoding table storage means in which the value is stored, the processing time can be further shortened, the higher speed processing can be realized, and the scale of the logic circuit can be reduced. A.

【0117】この発明によれば、符号長演算手段が、ビ
ット分配手段から出力される各符号列を、最小符号記憶
手段に記憶されている分類結果に応じた各符号長の最小
符号と比較する複数の比較手段と、複数の比較手段の出
力から分類後の可変長符号の符号長を求めるプライオリ
ティエンコーダとを備えたことにより、さらに処理時間
が短くなり、さらなる高速処理を実現できると共に、論
理回路の規模を低減できるという効果がある。
According to the present invention, the code length calculation means compares each code string output from the bit distribution means with the minimum code of each code length corresponding to the classification result stored in the minimum code storage means. By providing a plurality of comparing means and a priority encoder for obtaining the code length of the variable length code after classification from the outputs of the plurality of comparing means, the processing time can be further shortened, and further high speed processing can be realized, and the logic circuit can be realized. The effect is that the scale of can be reduced.

【0118】この発明によれば、復号するのに必要な分
類結果に応じた各符号長の最大符号を記憶している最大
符号記憶手段と、符号列選択手段により抽出された分類
後の可変長符号を含む固定長の符号列と、最大符号記憶
手段に記憶されている分類結果に応じた各符号長の最大
符号を比較して、分類後の可変長符号の符号長を演算
し、演算した分類後の可変長符号の符号長と分類結果に
より、可変長符号の符号長を演算する符号長演算手段
と、符号長演算手段により演算された可変長符号の符号
長と、バレルシフタにより抽出された可変長符号を含む
固定長の符号列により、復号値が記憶されている復号テ
ーブル記憶手段のアドレスを演算するアドレス演算手段
とを備えたことにより、処理時間が短くなり高速処理を
実現できると共に、論理回路の規模を低減できるという
効果がある。
According to the present invention, the maximum code storage means for storing the maximum code of each code length corresponding to the classification result required for decoding, and the variable length after classification extracted by the code string selection means. A fixed-length code string including a code is compared with the maximum code of each code length according to the classification result stored in the maximum code storage means, and the code length of the variable-length code after classification is calculated and calculated. Based on the code length of the variable length code after classification and the classification result, the code length calculation means for calculating the code length of the variable length code, the code length of the variable length code calculated by the code length calculation means, and the extraction by the barrel shifter By providing the address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by the fixed-length code string including the variable-length code, the processing time can be shortened and high-speed processing can be realized. Argument There is an effect that it is possible to reduce the scale of the circuit.

【0119】この発明によれば、符号長演算手段が、ビ
ット分配手段から出力される各符号列を、最大符号記憶
手段に記憶されている分類結果に応じた各符号長の最大
符号と比較する複数の比較手段と、複数の比較手段の出
力から分類後の可変長符号の符号長を求めるプライオリ
ティエンコーダと、プライオリティエンコーダからの分
類後の可変長符号の符号長と、符号分類手段からの分類
結果により、可変長符号の符号長を演算する加算手段と
を備えたことにより、処理時間が短くなり高速処理を実
現できると共に、論理回路の規模を低減できるという効
果がある。
According to the present invention, the code length calculation means compares each code string output from the bit distribution means with the maximum code of each code length corresponding to the classification result stored in the maximum code storage means. A plurality of comparing means, a priority encoder for obtaining the code length of the variable length code after classification from the outputs of the plurality of comparing means, a code length of the variable length code after classification from the priority encoder, and a classification result from the code classifying means With the addition of the addition means for calculating the code length of the variable length code, the processing time can be shortened, high-speed processing can be realized, and the scale of the logic circuit can be reduced.

【0120】この発明によれば、復号するのに必要な分
類結果に応じた各符号長の最大符号を記憶している最大
符号記憶手段と、符号列選択手段により抽出された分類
後の可変長符号を含む固定長の符号列と、最大符号記憶
手段に記憶されている分類結果に応じた各符号長の最大
符号を比較して、分類後の可変長符号の符号長を演算す
る符号長演算手段と、符号長演算手段により演算された
分類後の可変長符号の符号長と、分類結果と、符号列選
択手段により抽出された分類後の可変長符号を含む固定
長の符号列により、復号値が記憶されている復号テーブ
ル記憶手段のアドレスを演算するアドレス演算手段とを
備えたことにより、さらに処理時間が短くなり、さらな
る高速処理を実現できると共に、論理回路の規模を低減
できるという効果がある。
According to the present invention, the maximum code storage means for storing the maximum code of each code length according to the classification result required for decoding, and the variable length after classification extracted by the code string selection means. A code length operation for calculating a code length of a variable length code after classification by comparing a fixed-length code string including a code with the maximum code of each code length according to the classification result stored in the maximum code storage means. Means, a code length of the variable length code after classification calculated by the code length calculation means, a classification result, and a fixed length code string including the variable length code after classification extracted by the code string selection means. By providing the address calculation means for calculating the address of the decoding table storage means in which the value is stored, the processing time can be further shortened, the higher speed processing can be realized, and the scale of the logic circuit can be reduced. A.

【0121】この発明によれば、符号長演算手段が、ビ
ット分配手段から出力される各符号列を、最大符号記憶
手段に記憶されている分類結果に応じた各符号長の最大
符号と比較する複数の比較手段と、複数の比較手段の出
力から分類後の可変長符号の符号長を求めるプライオリ
ティエンコーダとを備えたことにより、さらなる高速処
理を実現できると共に、論理回路の規模を低減できると
いう効果がある。
According to the present invention, the code length calculation means compares each code string output from the bit distribution means with the maximum code of each code length corresponding to the classification result stored in the maximum code storage means. By providing a plurality of comparison means and a priority encoder for obtaining the code length of the variable length code after classification from the outputs of the plurality of comparison means, it is possible to realize further high-speed processing and reduce the scale of the logic circuit. There is.

【図面の簡単な説明】[Brief description of drawings]

【図1】 この発明の実施の形態1による可変長符号復
号装置の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a variable-length code decoding apparatus according to Embodiment 1 of the present invention.

【図2】 この発明の実施の形態1による可変長符号復
号装置の符号レジスタとバレルシフタから出力されるデ
ータの関係を示す図である。
FIG. 2 is a diagram showing a relationship between data output from a code register and a barrel shifter of the variable length code decoding device according to the first embodiment of the present invention.

【図3】 この発明の実施の形態1による可変長符号復
号装置の符号分類手段における分類方法と符号列選択手
段の出力の関係を示す図である。
FIG. 3 is a diagram showing the relationship between the classification method in the code classification means and the output of the code string selection means of the variable-length code decoding apparatus according to the first embodiment of the present invention.

【図4】 発生確率が均一なシンボルが32個ある場合
のハフマンツリーを示す図である。
FIG. 4 is a diagram showing a Huffman tree in a case where there are 32 symbols having uniform occurrence probabilities.

【図5】 この発明の実施の形態1による可変長符号復
号装置の符号長演算手段の構成を示すブロック図であ
る。
FIG. 5 is a block diagram showing a configuration of a code length calculation means of the variable length code decoding device according to the first embodiment of the present invention.

【図6】 この発明の実施の形態1による可変長符号復
号装置の符号長演算手段におけるプライオリティエンコ
ーダの動作を示す図である。
FIG. 6 is a diagram showing an operation of a priority encoder in the code length calculation means of the variable length code decoding device according to the first embodiment of the present invention.

【図7】 この発明の実施の形態1による可変長符号復
号装置のアドレス演算手段の構成を示す図である。
FIG. 7 is a diagram showing a configuration of address calculation means of the variable-length code decoding apparatus according to the first embodiment of the present invention.

【図8】 この発明の実施の形態1による可変長符号復
号装置の復号テーブル記憶手段に記憶されている復号テ
ーブルの例を示す図である。
FIG. 8 is a diagram showing an example of a decoding table stored in a decoding table storage means of the variable length code decoding device according to the first embodiment of the present invention.

【図9】 図8に示すハフマン符号から生成したハフマ
ンツリーを示す図である。
9 is a diagram showing a Huffman tree generated from the Huffman code shown in FIG.

【図10】 入力する符号列の例を示す図である。FIG. 10 is a diagram showing an example of a code string to be input.

【図11】 この発明の実施の形態1による可変長符号
復号装置の最小符号記憶手段に記憶されている各分類番
号に対応して求めた各符号長の最小符号を示す図であ
る。
FIG. 11 is a diagram showing the minimum code of each code length obtained corresponding to each classification number stored in the minimum code storage means of the variable-length code decoding apparatus according to the first embodiment of the present invention.

【図12】 この発明の実施の形態1による可変長符号
復号装置のアドレス演算手段におけるベースアドレス記
憶手段に記憶されているベースアドレスを示す図であ
る。
FIG. 12 is a diagram showing a base address stored in a base address storage unit in the address calculation unit of the variable-length code decoding apparatus according to the first embodiment of the present invention.

【図13】 この発明の実施の形態2による可変長符号
復号装置の構成を示すブロック図である。
FIG. 13 is a block diagram showing a configuration of a variable-length code decoding apparatus according to Embodiment 2 of the present invention.

【図14】 この発明の実施の形態2による可変長符号
復号装置の符号長演算手段の構成を示すブロック図であ
る。
FIG. 14 is a block diagram showing a configuration of a code length calculation means of a variable length code decoding device according to a second embodiment of the present invention.

【図15】 この発明の実施の形態2による可変長符号
復号装置のアドレス演算手段の構成を示すブロック図で
ある。
FIG. 15 is a block diagram showing a configuration of an address calculating means of a variable length code decoding device according to a second embodiment of the present invention.

【図16】 この発明の実施の形態2による可変長符号
復号装置の復号テーブル記憶手段に記憶されている復号
テーブルの例を示す図である。
FIG. 16 is a diagram showing an example of a decoding table stored in a decoding table storage means of the variable length code decoding device according to the second embodiment of the present invention.

【図17】 この発明の実施の形態2による可変長符号
復号装置のアドレス演算手段におけるベースアドレス記
憶手段に記憶されているベースアドレスを示す図であ
る。
FIG. 17 is a diagram showing a base address stored in a base address storage means in the address calculation means of the variable length code decoding apparatus according to the second embodiment of the present invention.

【図18】 この発明の実施の形態3による可変長符号
復号装置の構成を示すブロック図である。
FIG. 18 is a block diagram showing the configuration of a variable-length code decoding apparatus according to Embodiment 3 of the present invention.

【図19】 この発明の実施の形態3による可変長符号
復号装置の最大符号記憶手段に記憶されている各分類番
号に対応して求めた各符号長の最大符号を示す図であ
る。
FIG. 19 is a diagram showing the maximum code of each code length obtained corresponding to each classification number stored in the maximum code storage means of the variable-length code decoding apparatus according to the third embodiment of the present invention.

【図20】 この発明の実施の形態3による可変長符号
復号装置の符号長演算手段におけるプライオリティエン
コーダの動作を示す図である。
FIG. 20 is a diagram showing the operation of the priority encoder in the code length calculation means of the variable length code decoding apparatus according to the third embodiment of the present invention.

【図21】 この発明の実施の形態3による可変長符号
復号装置のアドレス演算手段におけるベースアドレス記
憶手段に記憶されているベースアドレスを示す図であ
る。
FIG. 21 is a diagram showing a base address stored in a base address storage means in the address calculation means of the variable-length code decoding apparatus according to the third embodiment of the present invention.

【図22】 この発明の実施の形態4による可変長符号
復号装置の構成を示すブロック図である。
FIG. 22 is a block diagram showing the configuration of a variable-length code decoding apparatus according to Embodiment 4 of the present invention.

【図23】 この発明の実施の形態4による可変長符号
復号装置のアドレス演算手段におけるベースアドレス記
憶手段に記憶されている各分類番号に対応して求めたベ
ースアドレスを示す図である。
FIG. 23 is a diagram showing a base address obtained corresponding to each classification number stored in the base address storage means in the address calculation means of the variable-length code decoding apparatus according to the fourth embodiment of the present invention.

【図24】 各シンボルに割り当てられたハフマン符号
の例を示す図である。
FIG. 24 is a diagram showing an example of a Huffman code assigned to each symbol.

【図25】 図24に示すハフマン符号から生成したハ
フマンツリーを示す図である。
FIG. 25 is a diagram showing a Huffman tree generated from the Huffman code shown in FIG. 24.

【図26】 従来のハフマン符号復号装置の構成を示す
ブロック図である。
FIG. 26 is a block diagram showing a configuration of a conventional Huffman code decoding apparatus.

【符号の説明】[Explanation of symbols]

101 符号レジスタ、102 バレルシフタ、103
符号分類手段、104 符号列選択手段、105 分
類レジスタ、106 選択符号レジスタ、107 ハフ
マンレジスタ、108 符号長演算手段、109 最小
符号記憶手段、110 アドレス演算手段、111 復
号テーブル記憶手段、501 ビット分配手段、50
2,503,504,505 比較手段、506 プラ
イオリティエンコーダ、507 加算器、701 ベー
スアドレス記憶手段、702 ハフマン符号抽出手段、
703 加算器、1301 符号長演算手段、1302
アドレス演算手段、1303 復号テーブル記憶手
段、1304 加算器、1501 ベースアドレス記憶
手段、1502 ハフマン符号抽出手段、1503 加
算器、1801 最大符号記憶手段、1802 符号長
演算手段、1803 アドレス演算手段、2201 符
号長演算手段、2202 アドレス演算手段。
101 code register, 102 barrel shifter, 103
Code classification means, 104 code string selection means, 105 classification register, 106 selection code register, 107 Huffman register, 108 code length calculation means, 109 minimum code storage means, 110 address calculation means, 111 decoding table storage means, 501 bit distribution means , 50
2, 503, 504, 505 comparison means, 506 priority encoder, 507 adder, 701 base address storage means, 702 Huffman code extraction means,
703 adder, 1301 code length calculating means, 1302
Address calculation means, 1303 decoding table storage means, 1304 adder, 1501 base address storage means, 1502 Huffman code extraction means, 1503 adder, 1801 maximum code storage means, 1802 code length calculation means, 1803 address calculation means, 2203 code length Calculation means 2202 Address calculation means.

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5C059 KK06 KK11 MA23 MC11 MC38 ME02 SS06 SS11 UA05 UA32 UA36 5J064 AA03 BA09 BB05 BC00 BC01 BC02 BC04 BC08 BC14 BC25 BC28 BD02 BD03    ─────────────────────────────────────────────────── ─── Continued front page    F term (reference) 5C059 KK06 KK11 MA23 MC11 MC38                       ME02 SS06 SS11 UA05 UA32                       UA36                 5J064 AA03 BA09 BB05 BC00 BC01                       BC02 BC04 BC08 BC14 BC25                       BC28 BD02 BD03

Claims (13)

【特許請求の範囲】[Claims] 【請求項1】 入力された符号列から可変長符号を含む
固定長の符号列を抽出するバレルシフタと、 上記バレルシフタにより抽出された可変長符号を含む固
定長の符号列を、その符号列に含まれる分類情報により
分類し分類結果を出力する符号分類手段と、 上記分類結果に応じて、上記バレルシフタにより抽出さ
れた可変長符号を含む固定長の符号列から、上記分類情
報を除いた分類後の可変長符号を含む固定長の符号列を
抽出する符号列選択手段と、 復号するのに必要な上記分類結果に応じた各符号長の最
小符号を記憶している最小符号記憶手段と、 上記符号列選択手段により抽出された分類後の可変長符
号を含む固定長の符号列と、上記最小符号記憶手段に記
憶されている分類結果に応じた各符号長の最小符号を比
較して、分類後の可変長符号の符号長を演算し、演算し
た分類後の可変長符号の符号長と上記分類結果により、
上記可変長符号の符号長を演算する符号長演算手段と、 上記符号長演算手段により演算された可変長符号の符号
長と、上記バレルシフタにより抽出された可変長符号を
含む固定長の符号列により、復号値が記憶されている復
号テーブル記憶手段のアドレスを演算するアドレス演算
手段と、 各可変長符号に対する復号値を所定のアドレスに記憶
し、上記アドレス演算手段により演算されたアドレスに
記憶されている復号値を出力する復号テーブル記憶手段
とを備えた可変長符号復号装置。
1. A barrel shifter for extracting a fixed-length code string including a variable-length code from an input code string, and a fixed-length code string including the variable-length code extracted by the barrel shifter are included in the code string. Code classification means for classifying according to the classification information and outputting the classification result, and according to the classification result, the fixed-length code string including the variable-length code extracted by the barrel shifter after the classification information after the classification information is removed. Code string selecting means for extracting a fixed length code string including a variable length code, minimum code storing means for storing the minimum code of each code length according to the classification result required for decoding, and the above code After the classification, the fixed-length code string including the post-classification variable-length code extracted by the column selection unit is compared with the minimum code of each code length corresponding to the classification result stored in the minimum code storage unit. Acceptable Calculates the code length of the long code, the code length and the classification result of the variable length code after the calculated classification,
A code length calculation means for calculating the code length of the variable length code, a code length of the variable length code calculated by the code length calculation means, and a fixed length code string including the variable length code extracted by the barrel shifter. Address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored, and the decoded value for each variable length code is stored in a predetermined address and stored in the address calculated by the address calculation means. Variable-length code decoding device having a decoding table storage means for outputting the decoded value.
【請求項2】 符号長演算手段は、 符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列から複数の異なる符号長の符号列を
生成するビット分配手段と、 上記ビット分配手段から出力される各符号列を、最小符
号記憶手段に記憶されている分類結果に応じた各符号長
の最小符号と比較する複数の比較手段と、 上記複数の比較手段の出力から分類後の可変長符号の符
号長を求めるプライオリティエンコーダと、 上記プライオリティエンコーダからの分類後の可変長符
号の符号長と、符号分類手段からの分類結果により、上
記可変長符号の符号長を演算する加算手段とを備えたこ
とを特徴とする請求項1記載の可変長符号復号装置。
2. A code length calculating means, a bit distributing means for generating a plurality of code strings of different code lengths from a fixed length code string including the classified variable length code extracted by the code string selecting means, and A plurality of comparing means for comparing each code string output from the bit distributing means with the minimum code of each code length according to the classification result stored in the minimum code storing means, and classification from the outputs of the plurality of comparing means. A priority encoder that obtains the code length of the subsequent variable-length code, a code length of the variable-length code after classification from the priority encoder, and an addition that calculates the code length of the variable-length code based on the classification result from the code classification means. The variable length code decoding apparatus according to claim 1, further comprising:
【請求項3】 アドレス演算手段は、 各符号長の最小符号とそれが記憶されている復号テーブ
ル記憶手段のアドレスから計算された各符号長のベース
アドレスを記憶し、符号長演算手段により演算された可
変長符号の符号長に対応するベースアドレスを出力する
ベースアドレス記憶手段と、 バレルシフタにより抽出された可変長符号を含む固定長
の符号列と、符号長演算手段により演算された可変長符
号の符号長により、上記可変長符号を抽出する可変長符
号抽出手段と、 上記ベースアドレス記憶手段から出力されたベースアド
レスと、上記可変長符号抽出手段により抽出された可変
長符号により、上記復号テーブル記憶手段のアドレスを
演算する加算手段とを備えたことを特徴とする請求項1
記載の可変長符号復号装置。
3. The address calculation means stores the minimum code of each code length and the base address of each code length calculated from the address of the decoding table storage means in which the code is stored, and is calculated by the code length calculation means. A base address storage unit for outputting a base address corresponding to the code length of the variable length code, a fixed length code string including the variable length code extracted by the barrel shifter, and a variable length code calculated by the code length calculation unit. Variable length code extraction means for extracting the variable length code according to the code length, the base address output from the base address storage means, and the variable length code extracted by the variable length code extraction means to store the decoding table. An adding means for calculating an address of the means is provided.
The variable-length code decoding device described.
【請求項4】 入力された符号列から可変長符号を含む
固定長の符号列を抽出するバレルシフタと、 上記バレルシフタにより抽出された可変長符号を含む固
定長の符号列を、その符号列に含まれる分類情報により
分類し分類結果を出力する符号分類手段と、 上記分類結果に応じて、上記バレルシフタにより抽出さ
れた可変長符号を含む固定長の符号列から、上記分類情
報を除いた分類後の可変長符号を含む固定長の符号列を
抽出する符号列選択手段と、 復号するのに必要な上記分類結果に応じた各符号長の最
小符号を記憶している最小符号記憶手段と、 上記符号列選択手段により抽出された分類後の可変長符
号を含む固定長の符号列と、上記最小符号記憶手段に記
憶されている分類結果に応じた各符号長の最小符号を比
較して、分類後の可変長符号の符号長を演算する符号長
演算手段と、 上記符号長演算手段により演算された分類後の可変長符
号の符号長と、上記分類結果と、上記符号列選択手段に
より抽出された分類後の可変長符号を含む固定長の符号
列により、復号値が記憶されている復号テーブル記憶手
段のアドレスを演算するアドレス演算手段と、 上記分類結果に応じて分類後の各可変長符号に対する復
号値を所定のアドレスに記憶し、上記アドレス演算手段
により演算されたアドレスに記憶されている復号値を出
力する復号テーブル記憶手段とを備えた可変長符号復号
装置。
4. A barrel shifter for extracting a fixed-length code string including a variable-length code from an input code string, and a fixed-length code string including the variable-length code extracted by the barrel shifter are included in the code string. Code classification means for classifying according to the classification information and outputting the classification result, and according to the classification result, the fixed-length code string including the variable-length code extracted by the barrel shifter after the classification information after the classification information is removed. Code string selecting means for extracting a fixed length code string including a variable length code, minimum code storing means for storing the minimum code of each code length according to the classification result required for decoding, and the above code After the classification, the fixed-length code string including the post-classification variable-length code extracted by the column selection unit is compared with the minimum code of each code length corresponding to the classification result stored in the minimum code storage unit. Acceptable Code length calculating means for calculating the code length of the long code, code length of the variable length code after classification calculated by the code length calculating means, the classification result, and after classification extracted by the code string selecting means Address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by the fixed length code string including the variable length code of, and the decoded value for each variable length code after classification according to the classification result Is stored at a predetermined address, and a decoding table storage means for outputting the decoded value stored at the address calculated by the address calculation means is provided.
【請求項5】 符号長演算手段は、 符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列から複数の異なる符号長の符号列を
生成するビット分配手段と、 上記ビット分配手段から出力される各符号列を、最小符
号記憶手段に記憶されている分類結果に応じた各符号長
の最小符号と比較する複数の比較手段と、 上記複数の比較手段の出力から分類後の可変長符号の符
号長を求めるプライオリティエンコーダとを備えたこと
を特徴とする請求項4記載の可変長符号復号装置。
5. The code length calculating means includes a bit distributing means for generating a plurality of code strings of different code lengths from a fixed length code string including the classified variable length code extracted by the code string selecting means, and A plurality of comparing means for comparing each code string output from the bit distributing means with the minimum code of each code length according to the classification result stored in the minimum code storing means, and classification from the outputs of the plurality of comparing means. 5. The variable length code decoding device according to claim 4, further comprising a priority encoder for obtaining a code length of a subsequent variable length code.
【請求項6】 アドレス演算手段は、 各分類結果における各符号長の最小符号とそれが記憶さ
れている復号テーブル記憶手段のアドレスから計算され
た各符号長のベースアドレスを記憶し、符号長演算手段
により演算された分類後の可変長符号の符号長に対応す
るベースアドレスを出力するベースアドレス記憶手段
と、 符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列と、符号長演算手段により演算され
た分類後の可変長符号の符号長により、上記分類後の可
変長符号を抽出する可変長符号抽出手段と、 上記ベースアドレス記憶手段から出力されたベースアド
レスと、上記可変長符号抽出手段により抽出された分類
後の可変長符号により、上記復号テーブル記憶手段のア
ドレスを演算する加算手段とを備えたことを特徴とする
請求項4記載の可変長符号復号装置。
6. The address calculation means stores the minimum code of each code length in each classification result and the base address of each code length calculated from the address of the decoding table storage means in which the code is stored, and calculates the code length. A base address storage means for outputting a base address corresponding to the code length of the classified variable length code calculated by the means, and a fixed length code string including the classified variable length code extracted by the code string selection means, A variable-length code extracting means for extracting the variable-length code after classification by the code length of the variable-length code after classification calculated by the code-length calculating means, and a base address output from the base address storage means, And an adding means for calculating the address of the decoding table storage means by the variable length code after classification extracted by the variable length code extraction means. The variable-length code decoding device according to claim 4, characterized in that
【請求項7】 入力された符号列から可変長符号を含む
固定長の符号列を抽出するバレルシフタと、 上記バレルシフタにより抽出された可変長符号を含む固
定長の符号列を、その符号列に含まれる分類情報により
分類し分類結果を出力する符号分類手段と、 上記分類結果に応じて、上記バレルシフタにより抽出さ
れた可変長符号を含む固定長の符号列から、上記分類情
報を除いた分類後の可変長符号を含む固定長の符号列を
抽出する符号列選択手段と、 復号するのに必要な上記分類結果に応じた各符号長の最
大符号を記憶している最大符号記憶手段と、 上記符号列選択手段により抽出された分類後の可変長符
号を含む固定長の符号列と、上記最大符号記憶手段に記
憶されている分類結果に応じた各符号長の最大符号を比
較して、分類後の可変長符号の符号長を演算し、演算し
た分類後の可変長符号の符号長と上記分類結果により、
上記可変長符号の符号長を演算する符号長演算手段と、 上記符号長演算手段により演算された可変長符号の符号
長と、上記バレルシフタにより抽出された可変長符号を
含む固定長の符号列により、復号値が記憶されている復
号テーブル記憶手段のアドレスを演算するアドレス演算
手段と、 各可変長符号に対する復号値を所定のアドレスに記憶
し、上記アドレス演算手段により演算されたアドレスに
記憶されている復号値を出力する復号テーブル記憶手段
とを備えた可変長符号復号装置。
7. A barrel shifter for extracting a fixed-length code string including a variable-length code from an input code string, and a fixed-length code string including the variable-length code extracted by the barrel shifter are included in the code string. Code classification means for classifying according to the classification information and outputting the classification result, and according to the classification result, the fixed-length code string including the variable-length code extracted by the barrel shifter after the classification information after the classification information is removed. Code string selecting means for extracting a fixed length code string including a variable length code, maximum code storing means for storing the maximum code of each code length according to the classification result required for decoding, and the above code After the classification, the fixed-length code string including the post-classification variable-length code extracted by the column selection unit is compared with the maximum code of each code length corresponding to the classification result stored in the maximum code storage unit. Acceptable Calculates the code length of the long code, the code length and the classification result of the variable length code after the calculated classification,
A code length calculation means for calculating the code length of the variable length code, a code length of the variable length code calculated by the code length calculation means, and a fixed length code string including the variable length code extracted by the barrel shifter. Address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored, and the decoded value for each variable length code is stored in a predetermined address and stored in the address calculated by the address calculation means. Variable-length code decoding device having a decoding table storage means for outputting the decoded value.
【請求項8】 符号長演算手段は、 符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列から複数の異なる符号長の符号列を
生成するビット分配手段と、 上記ビット分配手段から出力される各符号列を、最大符
号記憶手段に記憶されている分類結果に応じた各符号長
の最大符号と比較する複数の比較手段と、 上記複数の比較手段の出力から分類後の可変長符号の符
号長を求めるプライオリティエンコーダと、 上記プライオリティエンコーダからの分類後の可変長符
号の符号長と、符号分類手段からの分類結果により、上
記可変長符号の符号長を演算する加算手段とを備えたこ
とを特徴とする請求項7記載の可変長符号復号装置。
8. The code length calculating means includes a bit distributing means for generating a plurality of code strings having different code lengths from a fixed length code string including the classified variable length code extracted by the code string selecting means, and A plurality of comparing means for comparing each code string output from the bit distributing means with the maximum code of each code length according to the classification result stored in the maximum code storing means, and classification from the outputs of the plurality of comparing means. A priority encoder that obtains the code length of the subsequent variable-length code, a code length of the variable-length code after classification from the priority encoder, and an addition that calculates the code length of the variable-length code based on the classification result from the code classification means. 8. The variable length code decoding apparatus according to claim 7, further comprising:
【請求項9】 アドレス演算手段は、 各符号長の最大符号とそれが記憶されている復号テーブ
ル記憶手段のアドレスから計算された各符号長のベース
アドレスを記憶し、符号長演算手段により演算された可
変長符号の符号長に対応するベースアドレスを出力する
ベースアドレス記憶手段と、 バレルシフタにより抽出された可変長符号を含む固定長
の符号列と、符号長演算手段により演算された可変長符
号の符号長により、上記可変長符号を抽出する可変長符
号抽出手段と、 上記ベースアドレス記憶手段から出力されたベースアド
レスと、上記可変長符号抽出手段により抽出された可変
長符号により、上記復号テーブル記憶手段のアドレスを
演算する加算手段とを備えたことを特徴とする請求項7
記載の可変長符号復号装置。
9. The address calculation means stores the maximum code of each code length and the base address of each code length calculated from the address of the decoding table storage means in which it is stored, and is calculated by the code length calculation means. A base address storage unit for outputting a base address corresponding to the code length of the variable length code, a fixed length code string including the variable length code extracted by the barrel shifter, and a variable length code calculated by the code length calculation unit. Variable length code extraction means for extracting the variable length code according to the code length, the base address output from the base address storage means, and the variable length code extracted by the variable length code extraction means to store the decoding table. 8. Addition means for calculating the address of the means are provided.
The variable-length code decoding device described.
【請求項10】 入力された符号列から可変長符号を含
む固定長の符号列を抽出するバレルシフタと、 上記バレルシフタにより抽出された可変長符号を含む固
定長の符号列を、その符号列に含まれる分類情報により
分類し分類結果を出力する符号分類手段と、 上記分類結果に応じて、上記バレルシフタにより抽出さ
れた可変長符号を含む固定長の符号列から、上記分類情
報を除いた分類後の可変長符号を含む固定長の符号列を
抽出する符号列選択手段と、 復号するのに必要な上記分類結果に応じた各符号長の最
大符号を記憶している最大符号記憶手段と、 上記符号列選択手段により抽出された分類後の可変長符
号を含む固定長の符号列と、上記最大符号記憶手段に記
憶されている分類結果に応じた各符号長の最大符号を比
較して、分類後の可変長符号の符号長を演算する符号長
演算手段と、 上記符号長演算手段により演算された分類後の可変長符
号の符号長と、上記分類結果と、上記符号列選択手段に
より抽出された分類後の可変長符号を含む固定長の符号
列により、復号値が記憶されている復号テーブル記憶手
段のアドレスを演算するアドレス演算手段と、 上記分類結果に応じて分類後の各可変長符号に対する復
号値を所定のアドレスに記憶し、上記アドレス演算手段
により演算されたアドレスに記憶されている復号値を出
力する復号テーブル記憶手段とを備えた可変長符号復号
装置。
10. A barrel shifter for extracting a fixed-length code string including a variable-length code from an input code string, and a fixed-length code string including the variable-length code extracted by the barrel shifter are included in the code string. Code classification means for classifying according to the classification information and outputting the classification result, and according to the classification result, the fixed-length code string including the variable-length code extracted by the barrel shifter after the classification information after the classification information is removed. Code string selecting means for extracting a fixed length code string including a variable length code, maximum code storing means for storing the maximum code of each code length according to the classification result required for decoding, and the above code After the classification, the fixed-length code string including the post-classification variable-length code extracted by the column selection unit is compared with the maximum code of each code length corresponding to the classification result stored in the maximum code storage unit. of Code length calculation means for calculating the code length of the variable length code, code length of the variable length code after classification calculated by the code length calculation means, the classification result, and the classification extracted by the code string selection means. Address calculation means for calculating the address of the decoding table storage means in which the decoded value is stored by a fixed-length code string including the subsequent variable-length code, and decoding for each variable-length code after classification according to the classification result. A variable length code decoding apparatus comprising: a decoding table storing means for storing a value at a predetermined address and outputting a decoded value stored at the address calculated by the address calculating means.
【請求項11】 符号長演算手段は、 符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列から複数の異なる符号長の符号列を
生成するビット分配手段と、 上記ビット分配手段から出力される各符号列を、最大符
号記憶手段に記憶されている分類結果に応じた各符号長
の最大符号と比較する複数の比較手段と、 上記複数の比較手段の出力から分類後の可変長符号の符
号長を求めるプライオリティエンコーダとを備えたこと
を特徴とする請求項10記載の可変長符号復号装置。
11. The code length calculating means includes a bit distributing means for generating a plurality of code strings of different code lengths from a fixed length code string including the classified variable length code extracted by the code string selecting means, and A plurality of comparing means for comparing each code string output from the bit distributing means with the maximum code of each code length according to the classification result stored in the maximum code storing means, and classification from the outputs of the plurality of comparing means. 11. The variable length code decoding device according to claim 10, further comprising a priority encoder that obtains a code length of a subsequent variable length code.
【請求項12】 アドレス演算手段は、 各分類結果における各符号長の最大符号とそれが記憶さ
れている復号テーブル記憶手段のアドレスから計算され
た各符号長のベースアドレスを記憶し、符号長演算手段
により演算された分類後の可変長符号の符号長に対応す
るベースアドレスを出力するベースアドレス記憶手段
と、 符号列選択手段により抽出された分類後の可変長符号を
含む固定長の符号列と、符号長演算手段により演算され
た分類後の可変長符号の符号長により、上記分類後の可
変長符号を抽出する可変長符号抽出手段と、 上記ベースアドレス記憶手段から出力されたベースアド
レスと、上記可変長符号抽出手段により抽出された分類
後の可変長符号により、上記復号テーブル記憶手段のア
ドレスを演算する加算手段とを備えたことを特徴とする
請求項10記載の可変長符号復号装置。
12. The address calculation means stores the maximum code of each code length in each classification result and the base address of each code length calculated from the address of the decoding table storage means in which the code is stored, and the code length calculation is performed. A base address storage means for outputting a base address corresponding to the code length of the classified variable length code calculated by the means, and a fixed length code string including the classified variable length code extracted by the code string selection means, A variable-length code extracting means for extracting the variable-length code after classification by the code length of the variable-length code after classification calculated by the code-length calculating means, and a base address output from the base address storage means, Adder means for calculating the address of the decoding table storage means by the classified variable length code extracted by the variable length code extraction means 11. The variable length code decoding device according to claim 10.
【請求項13】 符号分類手段は分類情報として連続す
る“1”の個数により分類することを特徴とする請求項
1、請求項4、請求項7または請求項10のうちのいず
れか1項記載の可変長符号復号装置。
13. The code classifying means classifies according to the number of consecutive “1” s as classification information, according to any one of claims 1, 4, 7 and 10. Variable length code decoding device.
JP2002074903A 2002-03-18 2002-03-18 Variable length code decoder Pending JP2003273746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002074903A JP2003273746A (en) 2002-03-18 2002-03-18 Variable length code decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002074903A JP2003273746A (en) 2002-03-18 2002-03-18 Variable length code decoder

Publications (1)

Publication Number Publication Date
JP2003273746A true JP2003273746A (en) 2003-09-26

Family

ID=29204178

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002074903A Pending JP2003273746A (en) 2002-03-18 2002-03-18 Variable length code decoder

Country Status (1)

Country Link
JP (1) JP2003273746A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100852220B1 (en) 2006-12-08 2008-08-13 한국전자통신연구원 Method for finding minimal signed digit with variable multi-bit coding based on booth's algorithm
JP2010509895A (en) * 2006-11-14 2010-03-25 クゥアルコム・インコーポレイテッド Memory efficient (MEMORYEFFICENT) adaptive block coding
JP2010509893A (en) * 2006-11-14 2010-03-25 クゥアルコム・インコーポレイテッド Memory efficient coding of variable length codes
JP2011004338A (en) * 2009-06-22 2011-01-06 Fujifilm Corp Data decoder

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010509895A (en) * 2006-11-14 2010-03-25 クゥアルコム・インコーポレイテッド Memory efficient (MEMORYEFFICENT) adaptive block coding
JP2010509893A (en) * 2006-11-14 2010-03-25 クゥアルコム・インコーポレイテッド Memory efficient coding of variable length codes
KR101095335B1 (en) 2006-11-14 2011-12-16 퀄컴 인코포레이티드 Memory efficient adaptive block coding
JP4897887B2 (en) * 2006-11-14 2012-03-14 クゥアルコム・インコーポレイテッド Memory efficient coding of variable length codes
JP4897888B2 (en) * 2006-11-14 2012-03-14 クゥアルコム・インコーポレイテッド Memory efficient (MEMORYEFFICENT) adaptive block coding
KR100852220B1 (en) 2006-12-08 2008-08-13 한국전자통신연구원 Method for finding minimal signed digit with variable multi-bit coding based on booth's algorithm
US8150899B2 (en) 2006-12-08 2012-04-03 Electronics And Telecommunications Research Institute Method for finding minimal signed digit with variable multi-bit coding based on booth's algorithm
JP2011004338A (en) * 2009-06-22 2011-01-06 Fujifilm Corp Data decoder

Similar Documents

Publication Publication Date Title
JP3332619B2 (en) Decoding device and method thereof
US5710562A (en) Method and apparatus for compressing arbitrary data
KR100894002B1 (en) Device and data method for selective compression and decompression and data format for compressed data
JP3309031B2 (en) Method and apparatus for compressing and decompressing short block data
US5936560A (en) Data compression method and apparatus performing high-speed comparison between data stored in a dictionary window and data to be compressed
US4044347A (en) Variable-length to fixed-length conversion of minimum-redundancy codes
US6982661B2 (en) Method of performing huffman decoding
JPH0879092A (en) Mevhod for compressing and compression-releasing data and device therefor
JPH0799812B2 (en) Signal coding apparatus, signal decoding apparatus, and signal coding / decoding apparatus
KR20010006554A (en) Method and apparatus for lossless digital data compression
US5832037A (en) Method of compressing and expanding data
JPS61242122A (en) Adaptive compression for character data
JPH03503707A (en) A system for decoding statistically encoded digital data
EP0742646A1 (en) Data compression method and apparatus with expansion protection
KR20220054651A (en) multi-symbol decoder
JP2003273746A (en) Variable length code decoder
CN104682966B (en) The lossless compression method of table data
JPH03204234A (en) Restoration of compressed data
Belodedov et al. Development of an algorithm for optimal encoding of WAV files using genetic algorithms
GB2360915A (en) Run length compression encoding of selected bits of data words
JPH0628149A (en) Method for compressing plural kinds of data
KR100207428B1 (en) Variable length coding apparatus and method adaptive to changes of the hoffman codes
GB2311704A (en) Compression of arbitrary data using context modelling and entropy coding
JP3565147B2 (en) Decryption device
JP3113765B2 (en) Variable length code decoding circuit