JP3009993B2 - Huffman decoding device - Google Patents

Huffman decoding device

Info

Publication number
JP3009993B2
JP3009993B2 JP6114214A JP11421494A JP3009993B2 JP 3009993 B2 JP3009993 B2 JP 3009993B2 JP 6114214 A JP6114214 A JP 6114214A JP 11421494 A JP11421494 A JP 11421494A JP 3009993 B2 JP3009993 B2 JP 3009993B2
Authority
JP
Japan
Prior art keywords
huffman
code
data
decoding
output
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.)
Expired - Lifetime
Application number
JP6114214A
Other languages
Japanese (ja)
Other versions
JPH07303045A (en
Inventor
太一 永田
Original Assignee
鐘紡株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 鐘紡株式会社 filed Critical 鐘紡株式会社
Priority to JP6114214A priority Critical patent/JP3009993B2/en
Publication of JPH07303045A publication Critical patent/JPH07303045A/en
Application granted granted Critical
Publication of JP3009993B2 publication Critical patent/JP3009993B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】この発明は、ハフマン符号化方式
により符号化されたハフマン符号を復号するためのハフ
マン復号化回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a Huffman decoding circuit for decoding a Huffman code coded by a Huffman coding method.

【0002】[0002]

【従来の技術】画像データは非常に多くの情報量を含ん
でいる。そのため、画像データをそのままの形で処理す
るのは、メモリ容量および通信速度の点で実用的ではな
い。そこで、画像データ圧縮技術が必要となってくる。
画像データ圧縮の国際標準の1つとしてJPEG(Jo
int Photographic Expert G
roup)があり、非可逆符号化を行なうDCT(離散
コサイン変換)方式と、二次元空間でDPCM(Dif
ferential PCM)を行なう可逆符号化方式
が採用されている。以下、DCT方式の画像データ圧縮
を説明する。
2. Description of the Related Art Image data contains a very large amount of information. Therefore, it is not practical to process the image data as it is in terms of memory capacity and communication speed. Therefore, image data compression technology is required.
JPEG (Jo) is one of the international standards for image data compression.
int Photographic Expert G
loop), a DCT (discrete cosine transform) method for irreversible coding, and a DPCM (Dif
A lossless encoding method that performs fermental PCM is adopted. Hereinafter, DCT image data compression will be described.

【0003】図3は、DCT方式を実行するためのシス
テムの基本構成を示すブロック図である。符号化側で
は、DCT装置100が、入力される原画像データにD
CT変換を行ない、DCT係数を出力する。量子化器2
00は、量子化テーブル400を参照してDCT係数に
量子化処理を行ない、量子化されたDCT係数(以下、
量子化DCT係数と呼ぶ)を出力する。エントロピー符
号化器300は、符号化テーブル500を参照して量子
化DCT係数にエントロピー符号化処理を行ない、圧縮
データを出力する。エントロピー符号化の方式としてハ
フマン符号化方式が用いられる。復号化側では、エント
ロピー復号器600が、符号化テーブル500を参照し
て圧縮データにエントロピー復号化処理を行ない、量子
化DCT係数を出力する。逆量子化器700は、量子化
テーブル400を参照して量子化DCT係数に逆量子化
処理を行ない、DCT係数を出力する。逆DCT装置8
00は、DCT係数に逆DCT変換を行ない、再生画像
データを出力する。
FIG. 3 is a block diagram showing a basic configuration of a system for executing the DCT method. On the encoding side, the DCT device 100 converts the input original image data into a D
Performs CT transformation and outputs DCT coefficients. Quantizer 2
00 performs quantization processing on the DCT coefficients with reference to the quantization table 400, and obtains the quantized DCT coefficients (hereinafter, referred to as “DCT coefficients”).
(Referred to as a quantized DCT coefficient). The entropy encoder 300 performs entropy encoding on the quantized DCT coefficients with reference to the encoding table 500, and outputs compressed data. Huffman coding is used as the entropy coding. On the decoding side, the entropy decoder 600 performs entropy decoding processing on the compressed data with reference to the encoding table 500, and outputs quantized DCT coefficients. The inverse quantizer 700 performs an inverse quantization process on the quantized DCT coefficient with reference to the quantization table 400, and outputs the DCT coefficient. Inverse DCT device 8
00 performs inverse DCT transform on the DCT coefficient and outputs reproduced image data.

【0004】図4に示すように、各圧縮データ(符号デ
ータ)は可変長のハフマン符号および可変長の付加ビッ
トからなる。ハフマン符号の符号長および付加ビットの
符号長は各圧縮データによって異なる。
As shown in FIG. 4, each compressed data (code data) is composed of a variable length Huffman code and a variable length additional bit. The code length of the Huffman code and the code length of the additional bit differ depending on each compressed data.

【0005】図5は、従来のハフマン復号化回路の主要
部の構成を示すブロック図である。ハフマンテーブル5
1は、mワードの記憶容量を有するメモリ回路からな
る。ここで、mはハフマン符号の総符号数を表わす。メ
モリ回路としては、スタティックランダムアクセスメモ
リ(SRAM)、ダイナミックランダムアクセスメモリ
(DRAM)等が用いられる。ハフマンテーブル51の
アドレス入力端子ADには、圧縮データの該当するハフ
マン符号の発生頻度がアドレス信号として与えられる。
ハフマンテーブル51内の各アドレスには、そのアドレ
スが表すハフマン符号に対応する復号データが格納され
る。
FIG. 5 is a block diagram showing a configuration of a main part of a conventional Huffman decoding circuit. Huffman table 5
1 is a memory circuit having a storage capacity of m words. Here, m represents the total number of Huffman codes. As the memory circuit, a static random access memory (SRAM), a dynamic random access memory (DRAM), or the like is used. To the address input terminal AD of the Huffman table 51, the frequency of occurrence of the corresponding Huffman code of the compressed data is given as an address signal.
Each address in the Huffman table 51 stores decoded data corresponding to the Huffman code represented by the address.

【0006】またこの方式は、初期設定の段階で各ハフ
マン符号長(L)毎に、最大ハフマン符号値であるMa
xコード(L)、最小ハフマン符号値であるMinコー
ド(L)、Minコード(L)の発生頻度であるP
(L)を記憶しておかなければならず、各コードは最大
ハフマン符号長に相当するワード長を用意する必要があ
る。
In this method, the maximum Huffman code value Ma, which is the maximum Huffman code value, is set for each Huffman code length (L) at the stage of initialization.
x code (L), Min code (L), which is the minimum Huffman code value, and P, which is the frequency of occurrence of Min code (L)
(L) must be stored, and each code needs to have a word length corresponding to the maximum Huffman code length.

【0007】そして、まず圧縮データの第1ビットD0
とMaxコード(1)との比較を行なう。それと同時に
圧縮データ第1ビットD0とMinコード(1)の減算
を行ない、その解とMinコード(1)の発生頻度の加
算を行なうことによって、当該ハフマン符号の発生頻度
(以下Q(L)と記す)を導出する。式で表わすと次式
になる。 Q(L)=DLーMinコード(L)+P(L)
First, the first bit D0 of the compressed data
And Max code (1). At the same time, the first bit D0 of the compressed data and the Min code (1) are subtracted, and the solution and the occurrence frequency of the Min code (1) are added to obtain the Huffman code occurrence frequency (hereinafter Q (L)). Is derived. This can be expressed by the following equation. Q (L) = DL-Min code (L) + P (L)

【0008】次に、発生頻度Q(L)をアドレスとして
ハフマンテーブル51に入力し、復号データが読み出さ
れる。この復号データを最終的に出力するかどうかは、
圧縮データの第1ビットD0とMaxコード(1)との
比較結果によって決定する。ここで出力しないと決定さ
れた場合、次の周期で圧縮データの第1ないし第2ビッ
トD0〜D1とMaxコード(2),Minコード
(2),Minコード(2)の発生頻度を用いて同様の
計算を行なう。この動作を最終的に復号データ出力され
るまで続け、ハフマン符号が復号される。
Next, the occurrence frequency Q (L) is input to the Huffman table 51 as an address, and the decoded data is read. Whether or not to output this decrypted data finally
It is determined based on a comparison result between the first bit D0 of the compressed data and the Max code (1). If it is determined not to output, the first or second bits D0 to D1 of the compressed data and the occurrence frequency of the Max code (2), the Min code (2), and the Min code (2) in the next cycle. The same calculation is performed. This operation is continued until finally decoded data is output, and the Huffman code is decoded.

【0009】前記の動作を、具体的に説明する。例え
ば、ハフマン符号値が「0」、「100」、「101」
であった場合、 符号長 Maxコード Minコード Minコードの発生頻度 1 0 0 1 3 101 100 10 となるから、圧縮データが「0100」の場合、第1ビ
ットの値「0」については、0−0+1=1が発生頻度
Q(L)として導出され、アドレス値が1に格納された
復号データが読み出され、第1ビットの値はMaxコー
ドに等しいから、先に読み出された復号データが最終的
な値として採用される。
The above operation will be specifically described. For example, the Huffman code value is “0”, “100”, “101”
, The code length Max code Min code Min code occurrence frequency becomes 1 0 0 1 3 101 100 10. Therefore, when the compressed data is “0100”, the value of the first bit “0” is 0−0. 0 + 1 = 1 is derived as the occurrence frequency Q (L), the decoded data whose address value is stored in 1 is read, and the value of the first bit is equal to the Max code. Adopted as final value.

【0010】以下、第2ビットについては、その値
「1」が符号長1の場合のMaxコード「0」よりも大
きいため、符号長は1ではなく、符号長3として圧縮デ
ータ「100」で判断を行う。よって、100−100
+10=10が発生頻度Q(L)として導出され、アド
レス値が10に格納された復号データが読み出され最終
的な値として採用される。
Since the value “1” of the second bit is larger than the Max code “0” when the code length is 1, the code length is not 1 but the code length is 3 and the compressed data is “100”. Make a decision. Therefore, 100-100
+ 10 = 10 is derived as the occurrence frequency Q (L), and the decoded data in which the address value is stored at 10 is read and adopted as the final value.

【0011】[0011]

【発明が解決しようとする課題】しかしながら、従来の
ハフマン復号化回路では、各符号長毎に前記の計算を行
うため、たとえば符号長が16ビットのハフマン符号の
場合、復号に16周期もの時間がかかり、符号長が長く
なるにつれて復号時間が飛躍的に増加してしまうため高
速復号が困難であった。また、初期設定で最大ハフマン
符号値、最小ハフマン符号値、最小ハフマン符号値の発
生頻度と3つの値を各ハフマン符号長毎に記憶しなけれ
ばならないため、記憶容量が多くなって、回路規模も大
きくなってしまう。
However, in the conventional Huffman decoding circuit, since the above-described calculation is performed for each code length, for example, in the case of a Huffman code having a code length of 16 bits, it takes 16 cycles to decode. As a result, the decoding time dramatically increases as the code length becomes longer, so that high-speed decoding has been difficult. In addition, since the frequency of occurrence of the maximum Huffman code value, the minimum Huffman code value, and the minimum Huffman code value and the three values must be stored for each Huffman code length in the initial setting, the storage capacity increases and the circuit scale increases. It gets bigger.

【0012】本発明の目的は、比較的規模の小さい装置
によって高速にハフマン復号化を行う装置を提供するこ
とにある。
An object of the present invention is to provide an apparatus for performing Huffman decoding at a high speed by a relatively small-scale apparatus.

【0013】[0013]

【課題を解決するための手段】(1)第1の発明 第1の発明に係わるハフマン復号化装置は、任意の符号
長を有する複数のハフマン符号を復号するためのハフマ
ン復号化装置であって、前記複数のハフマン符号の各符
号長毎に発生頻度を出力する複数のブロックからなる発
生頻度導出手段と、初期データおよび入力されたハフマ
ン符号の符号長に基づいて、前記複数のブロックのいず
れかを選択するアドレス選択手段と、選択されたブロッ
クからの出力をアドレス信号として受け対応する復号デ
ータを読み出す出力手段を備え、前記複数のブロックの
各々は、各符号長毎に、復号に必要な初期データを記憶
する初期データ記憶手段と、符号長に等しいビット長の
圧縮データと初期データとを演算する演算手段を含む、
ハフマン復号化装置である。
(1) First invention A Huffman decoding device according to a first invention is a Huffman decoding device for decoding a plurality of Huffman codes having an arbitrary code length. An occurrence frequency deriving unit including a plurality of blocks that output an occurrence frequency for each code length of the plurality of Huffman codes, and any one of the plurality of blocks based on initial data and a code length of the input Huffman code. And an output unit that receives an output from the selected block as an address signal and reads out corresponding decoded data. Each of the plurality of blocks includes an initial code necessary for decoding for each code length. Initial data storage means for storing data, and a calculating means for calculating the compressed data and the initial data of the bit length equal to the code length,
This is a Huffman decoding device.

【0014】(2)第2の発明 第2の発明に係わるハフマン復号装置においては、初期
データ記憶手段が、各符号長の最小ハフマン符号値と各
最小ハフマン符号値の発生頻度との減算値を反転させた
値を格納している。
(2) Second invention In the Huffman decoding apparatus according to the second invention, the initial data storage means stores the subtraction value between the minimum Huffman code value of each code length and the frequency of occurrence of each minimum Huffman code value. Stores the inverted value.

【0015】(3)第3の発明 第3の発明に係わるハフマン復号装置は、任意の符号長
を有する複数のハフマン符号を復号するためのハフマン
復号化装置であって、所定のビット長以下の圧縮データ
をアドレス信号として受け対応する復号データを読み出
す復号手段と、前記複数のハフマン符号の各符号長毎に
発生頻度を出力する複数のブロックからなる発生頻度導
出手段と、入力されたハフマン符号の符号長に基づい
て、前記複数のブロックのいずれかを選択するアドレス
選択手段と、選択されたブロックからの出力をアドレス
信号として受け対応する復号データを読み出す出力手段
と、入力されたハフマン符号の符号長と前記所定のビッ
ト長に基づいて、復号手段の出力と出力手段の出力のい
づれかを復号データとするデータ選択手段を備え、前記
複数のブロックの各々は、各符号長毎に、復号に必要な
初期データを記憶する初期データ記憶手段と、符号長に
等しいビット長の圧縮データと初期データとを演算する
演算手段を含む、ハフマン復号化装置である。
(3) Third invention A Huffman decoding device according to a third invention is a Huffman decoding device for decoding a plurality of Huffman codes having an arbitrary code length, wherein the Huffman decoding device has a predetermined bit length or less. Decoding means for receiving compressed data as an address signal and reading out corresponding decoded data; occurrence frequency deriving means comprising a plurality of blocks for outputting an occurrence frequency for each code length of the plurality of Huffman codes; Address selecting means for selecting one of the plurality of blocks based on a code length, output means for receiving an output from the selected block as an address signal and reading out corresponding decoded data, and a code for the input Huffman code Based on the length and the predetermined bit length, a data selection unit that sets any one of the output of the decoding unit and the output of the output unit as decoded data. Each of the plurality of blocks includes, for each code length, initial data storage means for storing initial data necessary for decoding, and arithmetic means for calculating compressed data having a bit length equal to the code length and initial data. And a Huffman decoding device.

【0016】[0016]

【作用】[Action]

(1)第1の発明 第1の発明に係わるハフマン復号化回路においては、圧
縮データと各符号長のハフマン符号に対応する初期デー
タを並列で演算し、その演算結果は該当するハフマン符
号の符号長により選択される。選択された演算結果つま
り発生頻度をアドレスとしてハフマンテーブルに入力
し、対応する復号データが出力される。この方法は、全
ての符号長にに対応する演算を同時に行うことにより、
1周期で復号を行う。
(1) First invention In the Huffman decoding circuit according to the first invention, the compressed data and the initial data corresponding to the Huffman code of each code length are operated in parallel, and the operation result is the code of the corresponding Huffman code. Selected by length. The selected calculation result, that is, the occurrence frequency is input to the Huffman table as an address, and the corresponding decoded data is output. In this method, by performing operations corresponding to all code lengths at the same time,
Decoding is performed in one cycle.

【0017】(2)第2の発明 第2の発明に係わるハフマン復号化回路においては、第
1の発明における初期データとして、各符号長の最小ハ
フマン符号値と各最小ハフマン符号値の発生頻度との減
算を行ない、それを反転させた値を格納する。該初期デ
ータを記憶することで、従来の方式の初期データの記憶
容量よりも少ない記憶容量で済み、また復号データの算
出過程も短くなる。
(2) Second invention In the Huffman decoding circuit according to the second invention, the minimum Huffman code value of each code length and the frequency of occurrence of each minimum Huffman code value are used as the initial data in the first invention. , And stores the inverted value. Storing the initial data requires a smaller storage capacity than the storage capacity of the initial data in the conventional method, and shortens the process of calculating the decoded data.

【0018】(3)第3の発明 第3の発明に係わるハフマン復号化回路においては、記
憶手段が2個のブロックを含む。各ブロックはそれぞれ
複数のハフマン符号に対応する復号データを記憶し、そ
のアドレスは、割り当てられた符号長のハフマン符号を
発生頻度に変換しそれをアドレスとする部分(ブロック
A)と、圧縮データをアドレスとする部分(ブロック
B)に分けられ、ブロックAおよびブロックBのどちら
のデータを出力するかを判別するために、ブロックBの
信号を利用して選択信号を作成する。
(3) Third invention In the Huffman decoding circuit according to the third invention, the storage means includes two blocks. Each block stores decoded data corresponding to a plurality of Huffman codes. The address of the block is a part (block A) which converts a Huffman code having an assigned code length into an occurrence frequency and uses the converted frequency as an address (block A). A selection signal is created by using the signal of the block B in order to determine which data of the block A or the block B is to be output, which is divided into an address portion (block B).

【0019】すなはち、符号長の短いハフマン符号は圧
縮データをアドレスとして復号を行い、符号長の長いハ
フマン符号は発生頻度をアドレスとして復号を行なう。
これにより、発生頻度が高い符号長の短いハフマン符号
は、圧縮データをアドレスとして非常に高速で復号化が
でき、全体としての復号速度が高速化される。
That is, a Huffman code having a short code length is decoded using compressed data as an address, and a Huffman code having a long code length is decoded using an occurrence frequency as an address.
As a result, a Huffman code having a high code frequency and a short code length can be decoded at a very high speed using the compressed data as an address, and the decoding speed as a whole is increased.

【0020】[0020]

【実施例】以下、本装置を、16ビットのハフマン符号
を復号する回路によって実現した実施例を、図面を参照
しながら詳細に説明する。図1は、この発明の第1の実
施例によるハフマン復号化回路の構成を示すブロック図
であり、このハフマン復号化回路は、発生頻度導出回路
1、アドレスセレクタ2、メモリ回路3および符号長検
出回路4を含む。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment in which the present apparatus is realized by a circuit for decoding a 16-bit Huffman code will be described in detail with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a Huffman decoding circuit according to a first embodiment of the present invention. The Huffman decoding circuit includes an occurrence frequency deriving circuit 1, an address selector 2, a memory circuit 3, and a code length detection circuit. Circuit 4 is included.

【0021】発生頻度導出回路1は、1〜16ビットの
16個の加算器101〜116と初期データ記憶装置1
21〜136とからなる。1ビット加算器101の、一
方の入力端子には圧縮データの第1ビットD0が与えら
れ、他方の入力端子には初期データ記憶装置121に格
納された1ビット長のハフマン符号に対応する初期デー
タL1が与えられる。2ビット加算器102の一方の入
力端子には、圧縮データの第1ないし第2ビットD0〜
D1が与えられ、他方の入力端子には初期データ記憶装
置122に格納された2ビット長のハフマン符号の初期
データL2が与えられる。以下同様にして16ビットの
加算器116の一方の入力端子には圧縮データの第1な
いし第16ビットD0〜D15が与えられ、他方の入力
端子には初期データ記憶装置136に格納された16ビ
ット長のハフマン符号の初期データL16が与えられ
る。
The occurrence frequency deriving circuit 1 includes 16 adders 101 to 116 of 1 to 16 bits and an initial data storage device 1.
21 to 136. One input terminal of the 1-bit adder 101 is provided with the first bit D0 of the compressed data, and the other input terminal is provided with initial data corresponding to the 1-bit length Huffman code stored in the initial data storage device 121. L1 is provided. One input terminal of the two-bit adder 102 has first and second bits D0 to D0 of the compressed data.
D1 is supplied, and the other input terminal is supplied with the initial data L2 of the 2-bit length Huffman code stored in the initial data storage device 122. Similarly, the first to sixteenth bits D0 to D15 of the compressed data are given to one input terminal of the 16-bit adder 116, and the 16-bit data stored in the initial data storage device 136 is given to the other input terminal. The initial data L16 of the long Huffman code is provided.

【0022】各加算器の計算結果は、符号長導出回路5
より送られてくる信号によって、アドレスセレクタ2で
選択され、当該ハフマン符号の発生頻度が出力される。
メモリ回路3は256ワードRAM(ランダムアクセス
メモリ)からなるハフマンテーブルであり、該RAM
は、ハフマン符号の発生頻度をアドレスとする箇所に、
データとして該ハフマン符号の発生頻度に対応する復号
データを格納しておくことにより、アドレスセレクタ2
の出力(選択された各加算器の計算結果)を該RAMに
入力して、対応する復号データを出力することが出来
る。
The calculation result of each adder is sent to a code length deriving circuit 5
The Huffman code is selected by the address selector 2 according to the signal sent from the controller, and the frequency of occurrence of the Huffman code is output.
The memory circuit 3 is a Huffman table composed of a 256 word RAM (random access memory).
Is where the frequency of occurrence of Huffman codes is
By storing decoded data corresponding to the frequency of occurrence of the Huffman code as data, the address selector 2
(The calculation result of each selected adder) is input to the RAM, and the corresponding decoded data can be output.

【0023】ここで、初期データ記憶装置121〜13
6に格納する値について説明する。初期データの値は、
従来の技術の項で説明した如く、Minコード(L)+
P(L)の値の反転値を格納しておけばよいが、この場
合オーバフローに対する考慮が必要になるため、次の値
を格納しておくことが好ましい。すなはち、前述の式 Q(L)=DLーMinコード(L)+P(L) を変形して、 Q(L)=DL+〔ー(Minコード(L)−P
(L))〕 とすれば、Minコード(L)−P(L)は常に正の値
となるので、Minコード(L)からP(L)を減算
し、これを反転した値を格納する。
Here, the initial data storage devices 121 to 13
6 will be described. The value of the initial data is
As described in the section of the related art, the Min code (L) +
It is sufficient to store the inverted value of the value of P (L), but in this case, it is necessary to consider the overflow, so that it is preferable to store the next value. That is, the above equation Q (L) = DL−Min code (L) + P (L) is transformed into Q (L) = DL + [− (Min code (L) −P
(L))], the Min code (L) -P (L) is always a positive value. Therefore, P (L) is subtracted from the Min code (L), and the inverted value is stored. .

【0024】また、符号長検出回路5は、公知のものを
用いることができ、例えば、16ビットのハフマン符号
の場合、先ず16ビットの圧縮データと、16ビットの
最小ハフマン符号値とを比較し、圧縮データの方が大き
ければ当該ビット長(16ビット)を符号長として出力
するという動作を16ビットから1ビットまで順に行う
方法等がある。
For the code length detection circuit 5, a known one can be used. For example, in the case of a 16-bit Huffman code, first, 16-bit compressed data is compared with a 16-bit minimum Huffman code value. If the compressed data is larger, the bit length (16 bits) is output as the code length, and the operation is performed in order from 16 bits to 1 bit.

【0025】以下、図1のハフマン復号化回路の動作の
一例を、具体的に説明する。例えば、次のような9ビッ
トの圧縮データ、ハフマン符号を例に説明を行う。
An example of the operation of the Huffman decoding circuit shown in FIG. 1 will be specifically described below. For example, a description will be given by taking the following 9-bit compressed data and Huffman code as an example.

【0026】 圧縮データ 111110110 該圧縮データの発生頻度 110101 9ビットの最小符号値 MINコード(9) 111110101 9ビットの最小符号値の発生頻度 P(9) 110011 この場合、初期データとして記憶する9ビット長のハフ
マン符号に対応する初期データI(9)は、 MINコード(9)ーP(9)=111000010 であるから、その反転値「000111101」を設定
する。同様に、その他の各符号長のハフマン符号に対応
する初期データも算出を行なって、初期データの設定を
行う。
Compressed data 111110110 Frequency of occurrence of the compressed data 110101 Minimum code value of 9 bits MIN code (9) 111110101 Frequency of occurrence of minimum code value of 9 bits P (9) 110011 In this case, 9-bit length stored as initial data Since the initial data I (9) corresponding to the Huffman code of is MIN code (9) -P (9) = 111000010, its inverted value “000111101” is set. Similarly, initial data corresponding to Huffman codes of other code lengths is also calculated, and initial data is set.

【0027】次いで、発生頻度導出回路の各ブロックで
は圧縮データと初期データの加算を行なう。例えば、加
算器109では、圧縮データの第1ないし第9ビット
「111110110」と初期データI(9)「000
111101」の加算を行ない、その結果として「00
0110010」が得られ、同様にその他の15個の加
算器101〜108、110〜116についても処理を
行なう。
Next, in each block of the occurrence frequency deriving circuit, the compressed data and the initial data are added. For example, in the adder 109, the first to ninth bits “111110110” of the compressed data and the initial data I (9) “000”
111101 ", and as a result," 00 "
0110010 "is obtained, and the other 15 adders 101 to 108 and 110 to 116 are similarly processed.

【0028】16個の加算器の計算結果はアドレスセレ
クタ2により選択される。アドレスセレクタ2のセレク
ト信号は符号長導出回路の出力であり、この場合その出
力は9であるので加算器109の出力が選択される。
The calculation results of the 16 adders are selected by the address selector 2. The select signal of the address selector 2 is the output of the code length deriving circuit. In this case, the output is 9, so that the output of the adder 109 is selected.

【0029】次いで、加算器109の出力「00011
0010」の下位8ビット「00110010」をアド
レス信号としてメモリ回路3に入力し、復号データが出
力される。よって、上記実施例のハフマン復号回路で
は、初期設定での記憶容量が16ワードとなり、従来の
ハフマン復号化回路における48ワードの3分の1とな
る。
Next, the output of the adder 109 "00011
The lower 8 bits “00110010” of “0010” are input to the memory circuit 3 as an address signal, and decoded data is output. Therefore, in the Huffman decoding circuit of the above embodiment, the storage capacity in the initial setting is 16 words, which is one third of 48 words in the conventional Huffman decoding circuit.

【0030】また従来の方式では、復号時間としてハフ
マン符号の符号長分の周期が必要であったのに対し、こ
の実施例では復号時間は1周期である。
Further, in the conventional system, a period corresponding to the code length of the Huffman code is required as the decoding time, whereas in this embodiment, the decoding time is one period.

【0031】次に、図2はこの発明の第2の実施例によ
るハフマン復号化回路の構成を示すブロック図である。
このハフマン復号化回路は、発生頻度検出回路1、アド
レスセレクタ2、メモリ回路3、データセレクタ4を含
む。発生頻度導出回路1は、それぞれ9〜16ビットの
8個の加算器109〜116と、初期データ記憶装置1
29〜136とからなり、その動作は第1の実施例と同
様である。
FIG. 2 is a block diagram showing a configuration of a Huffman decoding circuit according to a second embodiment of the present invention.
This Huffman decoding circuit includes an occurrence frequency detection circuit 1, an address selector 2, a memory circuit 3, and a data selector 4. The occurrence frequency deriving circuit 1 includes eight adders 109 to 116 each having 9 to 16 bits and an initial data storage device 1.
29 to 136, and the operation is the same as that of the first embodiment.

【0032】メモリ回路3は、256ワードの2個のR
AM(ランダムアクセスメモリ)31、32からなる。
第2メモリ回路32は、256ワードRAMからなるハ
フマンテーブルであり、発生頻度導出回路1の出力を受
け、9ビット長以上のハフマン符号の発生頻度をアドレ
スとし、それに対応する復号データをデータとする。ア
ドレスセレクタ2の動作は、第1の実施例と同様であ
る。第1メモリ回路31も、256ワードRAMからな
るハフマンテーブルであり、8ビット長までのハフマン
符号をアドレスとし、それに対応する復号データをデー
タとする。例えば、2ビット長のハフマン符号「00」
に対応する復号データは、26個のアドレス「00XX
XXXX」に格納される。
The memory circuit 3 has two R words of 256 words.
AM (random access memory) 31, 32.
The second memory circuit 32 is a Huffman table composed of a 256-word RAM, receives the output of the occurrence frequency deriving circuit 1, sets the occurrence frequency of a 9-bit or longer Huffman code as an address, and decodes the corresponding decoded data as data. . The operation of the address selector 2 is the same as in the first embodiment. The first memory circuit 31 is also a Huffman table composed of a 256-word RAM, and uses a Huffman code of up to 8-bit length as an address and corresponding decoded data as data. For example, a 2-bit Huffman code "00"
The decoded data corresponding to 26 addresses "00XX"
XXXX ".

【0033】圧縮データが9ビット長以上のハフマン符
号であった場合それぞれの上位8ビットがアドレスとし
て第1メモリ回路31に入力され、該当するアドレスに
は復号データとして、例えば「11111111」を格
納しておく。
When the compressed data is a Huffman code having a length of 9 bits or more, the upper 8 bits are input to the first memory circuit 31 as an address, and for example, "11111111" is stored as the decoded data at the corresponding address. Keep it.

【0034】データセレクタ4は、第1メモリ回路31
の出力信号を、ハフマン符号判別回路6に入力し、その
結果をセレクト信号として受ける。例えば本実施例の場
合、ハフマン符号判別回路6としてAND回路を用いる
ことができ、総てのビットが「1」の場合のみ「1」が
出力される。すなはち、第1メモリ回路31の出力が
「01011100」であれば、該出力値のANDをと
ると出力として「0」が得られ、セレクト信号が「0」
の時は第1メモリ回路31の出力を選択する。一方、第
1メモリ回路31の出力が「11111111」であれ
ば、該出力値のANDをとるとその出力として「1」が
得られ、セレクト信号が「1」の時は第2メモリ回路3
2の出力を選択する。
The data selector 4 includes a first memory circuit 31
Is input to the Huffman code discriminating circuit 6, and the result is received as a select signal. For example, in the case of this embodiment, an AND circuit can be used as the Huffman code discriminating circuit 6, and "1" is output only when all bits are "1". That is, if the output of the first memory circuit 31 is “01011100”, AND of the output values yields “0” as the output, and the select signal becomes “0”.
In this case, the output of the first memory circuit 31 is selected. On the other hand, if the output of the first memory circuit 31 is “11111111”, ANDing the output value yields “1” as the output, and when the select signal is “1”, the second memory circuit 3
Select output 2

【0035】次に、図2のハフマン復号化回路の動作の
1例を、具体的に説明する。先ず、第1の実施例と同じ
く、次のような9ビットの圧縮データ、ハフマン符号を
例に説明を行う。
Next, an example of the operation of the Huffman decoding circuit shown in FIG. 2 will be specifically described. First, as in the first embodiment, the following description will be made using 9-bit compressed data and Huffman codes as examples.

【0036】 圧縮データ 111110110 該圧縮データの発生頻度 110101 9ビットの最小符号値 MINコード(9) 111110101 9ビットの最小符号値の発生頻度 P(9) 110011 第1の実施例と同じく、初期設定で記憶する9ビット長
のハフマン符号に対応する初期データI(9)は、 MINコード(9)ーP(9)=111000010 であるから、その反転値「000111101」を設定
する。同様に、その他の各符号長のハフマン符号に対応
する初期データも算出を行なって、初期データの設定を
行う。
Compressed data 111110110 Frequency of occurrence of the compressed data 110101 Minimum code value of 9 bits MIN code (9) 111110101 Frequency of occurrence of minimum code value of 9 bits P (9) 110011 As in the first embodiment, Since the initial data I (9) corresponding to the 9-bit Huffman code to be stored is MIN code (9) -P (9) = 111000010, the inverted value "000111101" is set. Similarly, initial data corresponding to Huffman codes of other code lengths is also calculated, and initial data is set.

【0037】以下、第1の実施例と同様に算出し、加算
器109の出力「000110010」の下位8ビット
「00110010」をアドレス信号として第2メモリ
回路32に入力し、対応する復号データが出力される。
Thereafter, calculation is performed in the same manner as in the first embodiment. The lower 8 bits "00110010" of the output "000110010" of the adder 109 are input to the second memory circuit 32 as an address signal, and the corresponding decoded data is output. Is done.

【0038】一方、第1メモリ回路31にはアドレスと
して圧縮データの上位8ビット「11111101」が
入力され、その復号データとして「11111111」
が出力される。第1メモリ回路31の出力値は、ハフマ
ン符号判別回路6であるAND回路に入力されて「1」
が出力され、セレクト信号が「1」の場合、第2メモリ
回路32の出力が選択されるので、第2メモリ回路32
のデータを最終的に復号データとして出力する。
On the other hand, the upper 8 bits “11111101” of the compressed data are input to the first memory circuit 31 as the address, and “11111111” is decoded as the decoded data.
Is output. The output value of the first memory circuit 31 is input to the AND circuit which is the Huffman code discriminating circuit 6 and is "1".
Is output, and when the select signal is “1”, the output of the second memory circuit 32 is selected.
Is finally output as decoded data.

【0039】次に、圧縮データが4ビット長のハフマン
符号「1011」を含む場合について説明する。このハ
フマン符号に対応する復号データは、第1メモリ回路3
1のアドレス「1011XXXX」に格納されている。
而して、圧縮データの上位8ビットが第1メモリ回路3
1に入力されるが、この場合、第1メモリ回路31の出
力が「11111111」となることは無いので第1メ
モリ回路31の出力をハフマン符号判別回路6であるA
ND回路に入力すると「0」が出力されセレクト信号は
「0」となるので、第1メモリ回路31のデータが選択
され、最終的に復号データとして出力される。
Next, a case where the compressed data includes a 4-bit length Huffman code "1011" will be described. The decoded data corresponding to the Huffman code is stored in the first memory circuit 3
1 is stored at the address “1011XXXX”.
Thus, the upper 8 bits of the compressed data are stored in the first memory circuit 3
In this case, since the output of the first memory circuit 31 does not become “11111111”, the output of the first memory circuit 31 is
When input to the ND circuit, "0" is output and the select signal becomes "0", so that the data of the first memory circuit 31 is selected and finally output as decoded data.

【0040】一般にハフマン符号の場合、短い符号長の
ものは発生頻度が高いので、第2の実施例によれば、発
生頻度の高い短い符号長のものは高速に復号でき、更
に、比較的発生頻度の低い長い符号長のものは少ない記
憶容量の回路で復号できることになり、全体としては、
高速且つコンパクトな回路で復号が可能になる。
In general, in the case of the Huffman code, a code having a short code length has a high frequency of occurrence. Therefore, according to the second embodiment, a code having a short code length having a high frequency can be decoded at a high speed, and further, a code having a relatively high frequency can be decoded. Infrequently long code lengths can be decoded by a circuit with a small storage capacity.
Decoding can be performed with a high-speed and compact circuit.

【0041】[0041]

【発明の効果】本発明によれば、圧縮データとこれに対
応する復号データを格納するハフマンテーブルを用いる
方式に比べ、初期設定で記憶する容量が少ないため、規
模の小さな装置で復号化が可能である。
According to the present invention, compared with the method using the Huffman table for storing the compressed data and the corresponding decoded data, the storage capacity in the initial setting is small, so that the decoding can be performed by a small-scale apparatus. It is.

【0042】更に、発生頻度とこれに対応する復号デー
タを格納したハフマンテーブルを用いる方式に比べ、1
周期での復号が可能であるため、高速に復号化が行え
る。従って、本発明装置によれば、コンパクトな装置で
しかも高速にハフマン符号を復号することができる。
Further, as compared with a method using a Huffman table in which the occurrence frequency and the corresponding decoded data are stored, the number of occurrences is one.
Since decoding can be performed periodically, high-speed decoding can be performed. Therefore, according to the apparatus of the present invention, Huffman codes can be decoded at high speed with a compact apparatus.

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

【図1】この発明の第1の実施例のハフマン復号化回路
の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a Huffman decoding circuit according to a first embodiment of the present invention.

【図2】この発明の第2の実施例のハフマン復号化回路
の構成を示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a Huffman decoding circuit according to a second embodiment of the present invention.

【図3】DCT方式の画像データ圧縮システムの基本構
成を示すブロック図である。
FIG. 3 is a block diagram showing a basic configuration of a DCT-based image data compression system.

【図4】圧縮データの構成を示すブロック図である。FIG. 4 is a block diagram illustrating a configuration of compressed data.

【図5】従来のハフマン復号化回路の主要部の構成を示
すブロック図である。
FIG. 5 is a block diagram showing a configuration of a main part of a conventional Huffman decoding circuit.

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

1 発生頻度導出回路 2 アドレスセレクタ 3 メモリ回路 4 データセレクタ 5 符号長導出回路 6 ハフマン符号判別回路 101〜136 加算器 121〜136 初期データ記憶装置 なお、各図中同一符号は同一または相当部分を示す。 DESCRIPTION OF SYMBOLS 1 Occurrence frequency derivation circuit 2 Address selector 3 Memory circuit 4 Data selector 5 Code length derivation circuit 6 Huffman code discrimination circuit 101-136 Adder 121-136 Initial data storage device In each figure, the same code shows the same or equivalent part. .

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 任意の符号長を有する複数のハフマン符
号を復号するためのハフマン復号化装置であって、 前記複数のハフマン符号の各符号長毎に発生頻度を出力
する複数のブロックからなる発生頻度導出手段と、初期データおよび 入力されたハフマン符号の符号長に基
づいて、前記複数のブロックのいずれかを選択するアド
レス選択手段と、 選択されたブロックからの出力をアドレス信号として受
け対応する復号データを読み出す出力手段を備え、 前記複数のブロックの各々は、各符号長毎に、復号に必
要な初期データを記憶する初期データ記憶手段と、符号
長に等しいビット長の圧縮データと初期データとを演算
する演算手段を含む、ハフマン復号化装置。
1. A Huffman decoding apparatus for decoding a plurality of Huffman codes having an arbitrary code length, comprising: a generation unit configured to output a frequency of occurrence for each code length of the plurality of Huffman codes. Frequency deriving means, address selecting means for selecting any of the plurality of blocks based on the initial data and the code length of the input Huffman code, and decoding corresponding to an output from the selected block as an address signal Output means for reading data, each of the plurality of blocks, for each code length, initial data storage means for storing initial data required for decoding, compressed data and initial data having a bit length equal to the code length A Huffman decoding device including a calculating means for calculating.
【請求項2】 初期データ記憶手段が、各符号長の最小
ハフマン符号値と各最小ハフマン符号値の発生頻度との
減算値を反転させた値を格納している請求項1に記載の
ハフマン復号化装置。
2. The Huffman decoding device according to claim 1, wherein said initial data storage means stores a value obtained by inverting a subtraction value between a minimum Huffman code value of each code length and a frequency of occurrence of each minimum Huffman code value. Device.
【請求項3】 任意の符号長を有する複数のハフマン符
号を復号するためのハフマン復号化装置であって、 所定のビット長以下の圧縮データをアドレス信号として
受け対応する復号データを読み出す復号手段と、 前記複数のハフマン符号の各符号長毎に発生頻度を出力
する複数のブロックからなる発生頻度導出手段と、 入力されたハフマン符号の符号長に基づいて、前記複数
のブロックのいずれかを選択するアドレス選択手段と、 選択されたブロックからの出力をアドレス信号として受
け対応する復号データを読み出す出力手段と、 入力されたハフマン符号の符号長と前記所定のビット長
に基づいて、復号手段の出力と出力手段の出力のいづれ
かを復号データとするデータ選択手段を備え、 前記複数のブロックの各々は、各符号長毎に、復号に必
要な初期データを記憶する初期データ記憶手段と、符号
長に等しいビット長の圧縮データと初期データとを演算
する演算手段を含む、ハフマン復号化装置。
3. A Huffman decoding apparatus for decoding a plurality of Huffman codes having an arbitrary code length, comprising: decoding means for receiving compressed data of a predetermined bit length or less as an address signal and reading out corresponding decoded data; An occurrence frequency deriving unit configured to output an occurrence frequency for each code length of the plurality of Huffman codes; and selecting one of the plurality of blocks based on an input code length of the Huffman code. Address selecting means, output means for receiving an output from the selected block as an address signal and reading out corresponding decoded data, and an output of the decoding means based on the code length of the input Huffman code and the predetermined bit length. A data selection unit for setting any one of the outputs of the output unit to decoded data, wherein each of the plurality of blocks is decoded for each code length. A Huffman decoding apparatus including: initial data storage means for storing initial data necessary for a signal; and arithmetic means for calculating compressed data having a bit length equal to the code length and initial data.
JP6114214A 1994-04-28 1994-04-28 Huffman decoding device Expired - Lifetime JP3009993B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6114214A JP3009993B2 (en) 1994-04-28 1994-04-28 Huffman decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6114214A JP3009993B2 (en) 1994-04-28 1994-04-28 Huffman decoding device

Publications (2)

Publication Number Publication Date
JPH07303045A JPH07303045A (en) 1995-11-14
JP3009993B2 true JP3009993B2 (en) 2000-02-14

Family

ID=14632079

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6114214A Expired - Lifetime JP3009993B2 (en) 1994-04-28 1994-04-28 Huffman decoding device

Country Status (1)

Country Link
JP (1) JP3009993B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2553490A (en) * 2016-06-20 2018-03-14 Anthony Simmonds Daniel E-zee lighter aid

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3358721B2 (en) 1999-06-29 2002-12-24 日本電気株式会社 Huffman code decoder
JP2002261623A (en) * 2001-02-28 2002-09-13 Canon Inc Decoding device, decoding method, storage medium and program software
JP4526209B2 (en) * 2001-05-15 2010-08-18 パナソニック株式会社 Variable length code decompression method and apparatus, and variable length code compression and decompression method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2553490A (en) * 2016-06-20 2018-03-14 Anthony Simmonds Daniel E-zee lighter aid

Also Published As

Publication number Publication date
JPH07303045A (en) 1995-11-14

Similar Documents

Publication Publication Date Title
US5604498A (en) Huffman decoder
JP3332619B2 (en) Decoding device and method thereof
US5654706A (en) System for variable length decoding digital transmission data which has been compressed by selecting a scanning pattern
US5510785A (en) Method of coding a digital signal, method of generating a coding table, coding apparatus and coding method
US6140944A (en) Variable-length coding device and method using table that holds information on presence/absence of code correspondingly to region represented by combination of run data and level data
US6546053B1 (en) System and method for decoding signal and method of generating lookup table for using in signal decoding process
US6055273A (en) Data encoding and decoding method and device of a multiple-valued information source
US6313767B1 (en) Decoding apparatus and method
JP3009993B2 (en) Huffman decoding device
US6157327A (en) Encoding/decoding device
JP3005385B2 (en) Huffman decoding circuit
JPH08186723A (en) Encoder for picture processor
JP3277425B2 (en) Digital signal encoding method, encoding table generation method, encoding apparatus, and encoding method
JPH09139955A (en) Data coding device, its method, data decoding device and its method
CN114842108A (en) Probability grid map processing method and device and storage device
US5561422A (en) Method and apparatus for variable length coding with reduced memory requirement
JP3015001B2 (en) Huffman decoding device
JPH08116268A (en) Information processing unit
JP2812064B2 (en) Image processing device
US6331827B1 (en) Huffman decoder using two priority encoder to reduce circuit scale
JP3005384B2 (en) Huffman decoding circuit
JPH06245200A (en) Method and device for scanning two-dimensional data by energy distribution
JP3239664B2 (en) Variable length code decoding method
JP2000244752A (en) Decoder
JPH0856164A (en) Data coding decoding device and its method

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081203

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091203

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101203

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111203

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121203

Year of fee payment: 13

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121203

Year of fee payment: 13

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131203

Year of fee payment: 14

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term